summaryrefslogtreecommitdiff
path: root/src/usr.bin/openssl/ts.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/usr.bin/openssl/ts.c')
-rw-r--r--src/usr.bin/openssl/ts.c6
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)