summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/ocsp
diff options
context:
space:
mode:
authorjsing <>2014-10-22 13:02:04 +0000
committerjsing <>2014-10-22 13:02:04 +0000
commita2960bc2e14b4c5f7d8f78d2a69ebb537ca4afa8 (patch)
tree32d920c77e1ecf12be5fad632b9ae71343194a7c /src/lib/libcrypto/ocsp
parent5a6d7fd5a10b0ad084948463b25822d91091b325 (diff)
downloadopenbsd-a2960bc2e14b4c5f7d8f78d2a69ebb537ca4afa8.tar.gz
openbsd-a2960bc2e14b4c5f7d8f78d2a69ebb537ca4afa8.tar.bz2
openbsd-a2960bc2e14b4c5f7d8f78d2a69ebb537ca4afa8.zip
Use arc4random_buf() instead of RAND_bytes() or RAND_pseudo_bytes().
arc4random_buf() is guaranteed to always succeed - it is worth noting that a number of the replaced function calls were already missing return value checks. ok deraadt@
Diffstat (limited to 'src/lib/libcrypto/ocsp')
-rw-r--r--src/lib/libcrypto/ocsp/ocsp_ext.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/libcrypto/ocsp/ocsp_ext.c b/src/lib/libcrypto/ocsp/ocsp_ext.c
index c7b9d817ac..6318e1718b 100644
--- a/src/lib/libcrypto/ocsp/ocsp_ext.c
+++ b/src/lib/libcrypto/ocsp/ocsp_ext.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ocsp_ext.c,v 1.11 2014/07/11 08:44:49 jsing Exp $ */ 1/* $OpenBSD: ocsp_ext.c,v 1.12 2014/10/22 13:02:04 jsing Exp $ */
2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL 2/* Written by Tom Titchener <Tom_Titchener@groove.net> for the OpenSSL
3 * project. */ 3 * project. */
4 4
@@ -62,11 +62,11 @@
62 */ 62 */
63 63
64#include <stdio.h> 64#include <stdio.h>
65#include <stdlib.h>
65#include <string.h> 66#include <string.h>
66 67
67#include <openssl/objects.h> 68#include <openssl/objects.h>
68#include <openssl/ocsp.h> 69#include <openssl/ocsp.h>
69#include <openssl/rand.h>
70#include <openssl/x509.h> 70#include <openssl/x509.h>
71#include <openssl/x509v3.h> 71#include <openssl/x509v3.h>
72 72
@@ -389,7 +389,7 @@ ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts, unsigned char *val, int len)
389 if (val) 389 if (val)
390 memcpy(tmpval, val, len); 390 memcpy(tmpval, val, len);
391 else 391 else
392 RAND_pseudo_bytes(tmpval, len); 392 arc4random_buf(tmpval, len);
393 if (!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce, &os, 0, 393 if (!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce, &os, 0,
394 X509V3_ADD_REPLACE)) 394 X509V3_ADD_REPLACE))
395 goto err; 395 goto err;