diff options
author | Matt Caswell <matt@openssl.org> | 2016-04-25 17:06:56 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-06-27 15:00:08 +0100 |
commit | ad64a69e02f7dda422d0f4f53dce7b1278715380 (patch) | |
tree | 5c76fd6da6b731a05cbd8559db71e8c821b44f36 /crypto/ocsp | |
parent | f3dbce6634dee43dcb0243544db05e101104fe6b (diff) |
Change usage of RAND_pseudo_bytes to RAND_bytes
RAND_pseudo_bytes() allows random data to be returned even in low entropy
conditions. Sometimes this is ok. Many times it is not. For the avoidance
of any doubt, replace existing usage of RAND_pseudo_bytes() with
RAND_bytes().
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/ocsp')
-rw-r--r-- | crypto/ocsp/ocsp_ext.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/ocsp/ocsp_ext.c b/crypto/ocsp/ocsp_ext.c index c19648c732..55af31b573 100644 --- a/crypto/ocsp/ocsp_ext.c +++ b/crypto/ocsp/ocsp_ext.c @@ -361,7 +361,7 @@ static int ocsp_add1_nonce(STACK_OF(X509_EXTENSION) **exts, ASN1_put_object(&tmpval, 0, len, V_ASN1_OCTET_STRING, V_ASN1_UNIVERSAL); if (val) memcpy(tmpval, val, len); - else if (RAND_pseudo_bytes(tmpval, len) < 0) + else if (RAND_bytes(tmpval, len) <= 0) goto err; if (!X509V3_add1_i2d(exts, NID_id_pkix_OCSP_Nonce, &os, 0, X509V3_ADD_REPLACE)) |