03af0b16cd
Including security fixes for CVE-2008-1447 and CVE-2007-1558. Tested by Jeremy Evans, jcs@, sturm@ and msf@. Thank you!
16 lines
428 B
Plaintext
16 lines
428 B
Plaintext
$OpenBSD: patch-random_c,v 1.2 2009/04/27 10:54:09 bernd Exp $
|
|
--- random.c.orig Sat Jan 17 04:15:36 2009
|
|
+++ random.c Sat Apr 4 15:25:11 2009
|
|
@@ -273,7 +273,11 @@ random_seed()
|
|
memset(digits, 0, big->len * SIZEOF_BDIGITS);
|
|
|
|
#ifdef S_ISCHR
|
|
+# ifdef __OpenBSD__
|
|
+ if ((fd = open("/dev/arandom", O_RDONLY
|
|
+# else
|
|
if ((fd = open("/dev/urandom", O_RDONLY
|
|
+# endif
|
|
#ifdef O_NONBLOCK
|
|
|O_NONBLOCK
|
|
#endif
|