Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/patches-2.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
nmathewson committed Jun 10, 2013
2 parents c307a25 + 6e49696 commit 0b05aa6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
2 changes: 2 additions & 0 deletions arc4random.c
Original file line number Diff line number Diff line change
Expand Up @@ -287,6 +287,7 @@ arc4_seed_proc_sys_kernel_random_uuid(void)
}
memset(entropy, 0, sizeof(entropy));
memset(buf, 0, sizeof(buf));
arc4_seeded_ok = 1;
return 0;
}
#endif
Expand Down Expand Up @@ -388,6 +389,7 @@ arc4_stir(void)
*/
for (i = 0; i < 12*256; i++)
(void)arc4_getbyte();

arc4_count = BYTES_BEFORE_RESEED;

return 0;
Expand Down
9 changes: 6 additions & 3 deletions include/event2/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -677,9 +677,12 @@ const char *evutil_gai_strerror(int err);

/** Generate n bytes of secure pseudorandom data, and store them in buf.
*
* By default, Libevent uses an ARC4-based random number generator, seeded
* using the platform's entropy source (/dev/urandom on Unix-like systems;
* CryptGenRandom on Windows).
* Current versions of Libevent use an ARC4-based random number generator,
* seeded using the platform's entropy source (/dev/urandom on Unix-like
* systems; CryptGenRandom on Windows). This is not actually as secure as it
* should be: ARC4 is a pretty lousy cipher, and the current implementation
* provides only rudimentary prediction- and backtracking-resistance. Don't
* use this for serious cryptographic applications.
*/
void evutil_secure_rng_get_bytes(void *buf, size_t n);

Expand Down

0 comments on commit 0b05aa6

Please sign in to comment.