summaryrefslogtreecommitdiffstats
path: root/crypto/bn
diff options
context:
space:
mode:
authorPeiwei Hu <jlu.hpw@foxmail.com>2021-11-14 23:16:57 +0800
committerTomas Mraz <tomas@openssl.org>2021-11-22 14:43:44 +0100
commita8f4cdd70c9d9ebe4553d7a72c67f73eaf0c169d (patch)
tree9997d12b7ce1113caa6209ea18811b79d82b76b8 /crypto/bn
parent7f608e4b1d9473258445144ba66216fb0e63aebe (diff)
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)
Diffstat (limited to 'crypto/bn')
-rw-r--r--crypto/bn/bn_rand.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/bn/bn_rand.c b/crypto/bn/bn_rand.c
index baac4ea7ed..1b49596990 100644
--- a/crypto/bn/bn_rand.c
+++ b/crypto/bn/bn_rand.c
@@ -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)