diff options
author | Erwin Lansing <erwin@FreeBSD.org> | 2014-12-15 12:14:41 +0000 |
---|---|---|
committer | Erwin Lansing <erwin@FreeBSD.org> | 2014-12-15 12:14:41 +0000 |
commit | 4c9547cd12b5bb569f10b368eb6bb04d897d596f (patch) | |
tree | 025b1191fa4f9c03bf5345071dd2658f5d240b69 /lib/isc/random.c | |
parent | 989b3b2d6068ce5b525479b7754977baf6364a7d (diff) |
Notes
Diffstat (limited to 'lib/isc/random.c')
-rw-r--r-- | lib/isc/random.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/isc/random.c b/lib/isc/random.c index 4c48e60fd77d4..d18204d6e3375 100644 --- a/lib/isc/random.c +++ b/lib/isc/random.c @@ -1,5 +1,5 @@ /* - * Copyright (C) 2004, 2005, 2007, 2009, 2013 Internet Systems Consortium, Inc. ("ISC") + * Copyright (C) 2004, 2005, 2007, 2009, 2013, 2014 Internet Systems Consortium, Inc. ("ISC") * Copyright (C) 1999-2003 Internet Software Consortium. * * Permission to use, copy, modify, and/or distribute this software for any @@ -67,8 +67,16 @@ isc_random_seed(isc_uint32_t seed) #ifndef HAVE_ARC4RANDOM srand(seed); -#else +#elif defined(HAVE_ARC4RANDOM_ADDRANDOM) arc4random_addrandom((u_char *) &seed, sizeof(isc_uint32_t)); +#else + /* + * If arcrandom() is available and no corresponding seeding + * function arc4random_addrandom() is available, no seeding is + * done on such platforms (e.g., OpenBSD 5.5). This is because + * the OS itself is supposed to seed the RNG and it is assumed + * that no explicit seeding is required. + */ #endif } |