From: Dr. Matthias St. Pierre Date: Tue, 17 Apr 2018 06:39:42 +0000 (+0200) Subject: p5_scrypt.c: fix error check of RAND_bytes() call X-Git-Tag: OpenSSL_1_1_1-pre6~111 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=e62fb0d31bdf25854aa2c7cda8e1d03768984ab4;p=oweals%2Fopenssl.git p5_scrypt.c: fix error check of RAND_bytes() call Reviewed-by: Kurt Roeckx (Merged from https://github.com/openssl/openssl/pull/5977) --- diff --git a/crypto/asn1/p5_scrypt.c b/crypto/asn1/p5_scrypt.c index c556d017f1..1daaa6f834 100644 --- a/crypto/asn1/p5_scrypt.c +++ b/crypto/asn1/p5_scrypt.c @@ -82,7 +82,7 @@ X509_ALGOR *PKCS5_pbe2_set_scrypt(const EVP_CIPHER *cipher, if (EVP_CIPHER_iv_length(cipher)) { if (aiv) memcpy(iv, aiv, EVP_CIPHER_iv_length(cipher)); - else if (RAND_bytes(iv, EVP_CIPHER_iv_length(cipher)) < 0) + else if (RAND_bytes(iv, EVP_CIPHER_iv_length(cipher)) <= 0) goto err; }