|
@@ -274,6 +274,10 @@ int ossl_bn_priv_rand_range_fixed_top(BIGNUM *r, const BIGNUM *range,
|
|
|
ossl_bn_mask_bits_fixed_top(r, n);
|
|
|
}
|
|
|
while (BN_ucmp(r, range) >= 0);
|
|
|
+#ifdef BN_DEBUG
|
|
|
+ /* With BN_DEBUG on a fixed top number cannot be returned */
|
|
|
+ bn_correct_top(r);
|
|
|
+#endif
|
|
|
}
|
|
|
|
|
|
return 1;
|
|
@@ -370,6 +374,10 @@ int ossl_bn_gen_dsa_nonce_fixed_top(BIGNUM *out, const BIGNUM *range,
|
|
|
|
|
|
if (BN_ucmp(out, range) < 0) {
|
|
|
ret = 1;
|
|
|
+#ifdef BN_DEBUG
|
|
|
+ /* With BN_DEBUG on a fixed top number cannot be returned */
|
|
|
+ bn_correct_top(out);
|
|
|
+#endif
|
|
|
goto end;
|
|
|
}
|
|
|
}
|