EVP_RAND_generate: fix return check

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17028)
This commit is contained in:
Peiwei Hu 2021-11-14 23:16:57 +08:00 committed by Tomas Mraz
parent 7f608e4b1d
commit a8f4cdd70c

View File

@ -287,7 +287,7 @@ int BN_generate_dsa_nonce(BIGNUM *out, const BIGNUM *range,
goto err;
}
for (done = 0; done < num_k_bytes;) {
if (!RAND_priv_bytes_ex(libctx, random_bytes, sizeof(random_bytes), 0))
if (RAND_priv_bytes_ex(libctx, random_bytes, sizeof(random_bytes), 0) <= 0)
goto err;
if (!EVP_DigestInit_ex(mdctx, md, NULL)