From 85b016137f0bd9cf3b15129668f9d794a71c6d34 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 22 Oct 2014 13:54:03 +0000 Subject: Use arc4random_buf() instead of RAND(_pseudo)?_bytes(). ok bcook@ --- src/usr.bin/openssl/ts.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'src/usr.bin/openssl/ts.c') 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 @@ -/* $OpenBSD: ts.c,v 1.2 2014/08/28 14:23:52 jsing Exp $ */ +/* $OpenBSD: ts.c,v 1.3 2014/10/22 13:54:03 jsing Exp $ */ /* Written by Zoltan Glozik (zglozik@stones.com) for the OpenSSL * project 2002. */ @@ -66,7 +66,6 @@ #include #include #include -#include #include /* Length of the nonce of the request in bits (must be a multiple of 8). */ @@ -593,8 +592,7 @@ create_nonce(int bits) /* Generating random byte sequence. */ if (len > (int) sizeof(buf)) goto err; - if (RAND_bytes(buf, len) <= 0) - goto err; + arc4random_buf(buf, len); /* Find the first non-zero byte and creating ASN1_INTEGER object. */ for (i = 0; i < len && !buf[i]; ++i) -- cgit v1.2.3-55-g6feb