Check BN_rand return value.

"make update".
This commit is contained in:
Bodo Möller
2000-02-29 22:37:27 +00:00
parent 2c51f2d909
commit 19c057da2e
2 changed files with 19 additions and 1 deletions

View File

@@ -84,7 +84,8 @@ int DSA_generate_key(DSA *dsa)
i=BN_num_bits(dsa->q);
for (;;)
{
BN_rand(priv_key,i,1,0);
if (!BN_rand(priv_key,i,1,0))
goto err;
if (BN_cmp(priv_key,dsa->q) >= 0)
BN_sub(priv_key,priv_key,dsa->q);
if (!BN_is_zero(priv_key)) break;