Skip to content

Commit

Permalink
fixup! Add ossl_bn_priv_rand_range_fixed_top() and use it for EC/DSA
Browse files Browse the repository at this point in the history
  • Loading branch information
t8m committed May 2, 2024
1 parent c967ed5 commit 88f7549
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions crypto/ec/ecdsa_ossl.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,11 +151,10 @@ static int ecdsa_sign_setup(EC_KEY *eckey, BN_CTX *ctx_in,
goto err;
}
} else {
res = ossl_bn_priv_rand_range_fixed_top(k, order, 0, ctx);
}
if (!res) {
ERR_raise(ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED);
goto err;
if (!ossl_bn_priv_rand_range_fixed_top(k, order, 0, ctx)) {
ERR_raise(ERR_LIB_EC, EC_R_RANDOM_NUMBER_GENERATION_FAILED);
goto err;
}
}
} while (ossl_bn_is_word_fixed_top(k, 0));

Expand Down

0 comments on commit 88f7549

Please sign in to comment.