* [including the GNU Public Licence.]
*/
+#ifndef NO_SHA
#include <stdio.h>
#include <time.h>
#include "cryptlib.h"
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;
if (ctx != NULL) BN_CTX_free(ctx);
return(ok);
}
-
+#endif