Don't set the two top bits to one when generating a random number < q.:wq
[openssl.git] / crypto / dsa / dsa_key.c
index 5aef2d5..af3c56d 100644 (file)
@@ -84,7 +84,7 @@ int DSA_generate_key(DSA *dsa)
        i=BN_num_bits(dsa->q);
        for (;;)
                {
-               if (!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);