diff options
author | 2013-09-11 15:00:18 +0000 | |
---|---|---|
committer | 2013-09-11 15:00:18 +0000 | |
commit | 05d863314c58237be48095f5225b5545704b0ecd (patch) | |
tree | 17f19175fabc2fa2ee0477572588f65c8e9b611e /lib/libsqlite3/src/random.c | |
parent | According to ITU X.690 (ASN.1 definition document), "octet strings" (diff) | |
download | wireguard-openbsd-05d863314c58237be48095f5225b5545704b0ecd.tar.xz wireguard-openbsd-05d863314c58237be48095f5225b5545704b0ecd.zip |
switch to using arc4random, as prompted by deraadt@.
also, OMIT_BUILTIN_TEST, since we're just a production library (duh)
bump shlib_version accordingly
okay reyk@, thanks for looking at this!
Diffstat (limited to 'lib/libsqlite3/src/random.c')
-rw-r--r-- | lib/libsqlite3/src/random.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/libsqlite3/src/random.c b/lib/libsqlite3/src/random.c index 234ebdf658f..d371e446672 100644 --- a/lib/libsqlite3/src/random.c +++ b/lib/libsqlite3/src/random.c @@ -17,7 +17,12 @@ */ #include "sqliteInt.h" +#if HAVE_ARC4RANDOM_BUF && defined(SQLITE_OMIT_BUILTIN_TEST) +void sqlite3_randomness(int N, void *pBuf){ + arc4random_buf(pBuf, N); +} +#else /* All threads share a single random number generator. ** This structure is the current state of the generator. */ @@ -143,3 +148,4 @@ void sqlite3PrngResetState(void){ GLOBAL(struct sqlite3PrngType, sqlite3Prng).isInit = 0; } #endif /* SQLITE_OMIT_BUILTIN_TEST */ +#endif |