X-Git-Url: https://git.openssl.org/?p=openssl.git;a=blobdiff_plain;f=crypto%2Fdsa%2Fdsa_key.c;h=af3c56d770ecb2480b996875df3b5624dd205f26;hp=d51ed9395f14a6e7f13226007666c5f21fb899e7;hb=c11dead17c0808e1a312ca02a849ed5cdd74c535;hpb=58964a492275ca9a59a0cd9c8155cb2491b4b909 diff --git a/crypto/dsa/dsa_key.c b/crypto/dsa/dsa_key.c index d51ed9395f..af3c56d770 100644 --- a/crypto/dsa/dsa_key.c +++ b/crypto/dsa/dsa_key.c @@ -56,16 +56,16 @@ * [including the GNU Public Licence.] */ +#ifndef NO_SHA #include #include #include "cryptlib.h" -#include "sha.h" -#include "bn.h" -#include "dsa.h" -#include "rand.h" +#include +#include +#include +#include -int DSA_generate_key(dsa) -DSA *dsa; +int DSA_generate_key(DSA *dsa) { int ok=0; unsigned int i; @@ -84,7 +84,8 @@ DSA *dsa; i=BN_num_bits(dsa->q); for (;;) { - BN_rand(priv_key,i,1,0); + if (!BN_rand(priv_key,i,0,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; @@ -109,4 +110,4 @@ err: if (ctx != NULL) BN_CTX_free(ctx); return(ok); } - +#endif