Rename BN_generate_dsa_nonce() to ossl_bn_gen_dsa_nonce_fixed_top()
authorTomas Mraz <tomas@openssl.org>
Mon, 29 Apr 2024 15:56:01 +0000 (17:56 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 2 May 2024 07:21:30 +0000 (09:21 +0200)
commit9c85f6cd2d6debe5ef6ef475ff4bf17e0985f7a2
tree4bc89d0b0f33d0e15631b9edbc5da0236f02405a
parent13b3ca5c998e6db4f7251a56c43541cb1a422bd0
Rename BN_generate_dsa_nonce() to ossl_bn_gen_dsa_nonce_fixed_top()

And create a new BN_generate_dsa_nonce() that corrects the BIGNUM top.
We do this to avoid leaking fixed top numbers via the public API.

Also add a slight optimization in ossl_bn_gen_dsa_nonce_fixed_top()
and make it LE/BE agnostic.

Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/24265)
crypto/bn/bn_rand.c
crypto/dsa/dsa_ossl.c
crypto/ec/ecdsa_ossl.c
include/crypto/bn.h