diff options
author | jsing <> | 2014-10-22 13:54:03 +0000 |
---|---|---|
committer | jsing <> | 2014-10-22 13:54:03 +0000 |
commit | 85b016137f0bd9cf3b15129668f9d794a71c6d34 (patch) | |
tree | 5182be1e2bb99eb4ec60a5c42f2f953b4c1cadf1 /src/usr.bin/openssl/s_cb.c | |
parent | e931cb809e30a11ec87c1f47536227dc2f58dbdb (diff) | |
download | openbsd-85b016137f0bd9cf3b15129668f9d794a71c6d34.tar.gz openbsd-85b016137f0bd9cf3b15129668f9d794a71c6d34.tar.bz2 openbsd-85b016137f0bd9cf3b15129668f9d794a71c6d34.zip |
Use arc4random_buf() instead of RAND(_pseudo)?_bytes().
ok bcook@
Diffstat (limited to 'src/usr.bin/openssl/s_cb.c')
-rw-r--r-- | src/usr.bin/openssl/s_cb.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/src/usr.bin/openssl/s_cb.c b/src/usr.bin/openssl/s_cb.c index 2e00abe7f1..f7d8a323a6 100644 --- a/src/usr.bin/openssl/s_cb.c +++ b/src/usr.bin/openssl/s_cb.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: s_cb.c,v 1.1 2014/08/26 17:47:25 jsing Exp $ */ | 1 | /* $OpenBSD: s_cb.c,v 1.2 2014/10/22 13:54:03 jsing Exp $ */ |
2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) |
3 | * All rights reserved. | 3 | * All rights reserved. |
4 | * | 4 | * |
@@ -121,7 +121,6 @@ | |||
121 | #include "apps.h" | 121 | #include "apps.h" |
122 | 122 | ||
123 | #include <openssl/err.h> | 123 | #include <openssl/err.h> |
124 | #include <openssl/rand.h> | ||
125 | #include <openssl/ssl.h> | 124 | #include <openssl/ssl.h> |
126 | #include <openssl/x509.h> | 125 | #include <openssl/x509.h> |
127 | 126 | ||
@@ -728,11 +727,7 @@ generate_cookie_callback(SSL * ssl, unsigned char *cookie, | |||
728 | 727 | ||
729 | /* Initialize a random secret */ | 728 | /* Initialize a random secret */ |
730 | if (!cookie_initialized) { | 729 | if (!cookie_initialized) { |
731 | if (!RAND_bytes(cookie_secret, COOKIE_SECRET_LENGTH)) { | 730 | arc4random_buf(cookie_secret, COOKIE_SECRET_LENGTH); |
732 | BIO_printf(bio_err, | ||
733 | "error setting random cookie secret\n"); | ||
734 | return 0; | ||
735 | } | ||
736 | cookie_initialized = 1; | 731 | cookie_initialized = 1; |
737 | } | 732 | } |
738 | /* Read peer information */ | 733 | /* Read peer information */ |