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/ts.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/ts.c')
-rw-r--r-- | src/usr.bin/openssl/ts.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/usr.bin/openssl/ts.c b/src/usr.bin/openssl/ts.c index c765465c45..cd7d9cc81e 100644 --- a/src/usr.bin/openssl/ts.c +++ b/src/usr.bin/openssl/ts.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: ts.c,v 1.2 2014/08/28 14:23:52 jsing Exp $ */ | 1 | /* $OpenBSD: ts.c,v 1.3 2014/10/22 13:54:03 jsing Exp $ */ |
2 | /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL | 2 | /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL |
3 | * project 2002. | 3 | * project 2002. |
4 | */ | 4 | */ |
@@ -66,7 +66,6 @@ | |||
66 | #include <openssl/bn.h> | 66 | #include <openssl/bn.h> |
67 | #include <openssl/err.h> | 67 | #include <openssl/err.h> |
68 | #include <openssl/pem.h> | 68 | #include <openssl/pem.h> |
69 | #include <openssl/rand.h> | ||
70 | #include <openssl/ts.h> | 69 | #include <openssl/ts.h> |
71 | 70 | ||
72 | /* Length of the nonce of the request in bits (must be a multiple of 8). */ | 71 | /* Length of the nonce of the request in bits (must be a multiple of 8). */ |
@@ -593,8 +592,7 @@ create_nonce(int bits) | |||
593 | /* Generating random byte sequence. */ | 592 | /* Generating random byte sequence. */ |
594 | if (len > (int) sizeof(buf)) | 593 | if (len > (int) sizeof(buf)) |
595 | goto err; | 594 | goto err; |
596 | if (RAND_bytes(buf, len) <= 0) | 595 | arc4random_buf(buf, len); |
597 | goto err; | ||
598 | 596 | ||
599 | /* Find the first non-zero byte and creating ASN1_INTEGER object. */ | 597 | /* Find the first non-zero byte and creating ASN1_INTEGER object. */ |
600 | for (i = 0; i < len && !buf[i]; ++i) | 598 | for (i = 0; i < len && !buf[i]; ++i) |