Clean up and simplify BIGNUM handling in DSA code.
authorjsing <jsing@openbsd.org>
Wed, 11 Jan 2023 04:39:42 +0000 (04:39 +0000)
committerjsing <jsing@openbsd.org>
Wed, 11 Jan 2023 04:39:42 +0000 (04:39 +0000)
commit7090137482713d4076509ac37f02822c7b4b42bb
tree40286623f03c5fe579cdfc492fb820fe237e6189
parentf6b6cc33007e6d3d1d9d24955ba7783b71bb73c4
Clean up and simplify BIGNUM handling in DSA code.

This adds missing BN_CTX_start()/BN_CTX_end() calls, removes NULL checks
before BN_CTX_end()/BN_CTX_free() (since they're NULL safe) and calls
BN_free() instead of BN_clear_free() (which does the same thing).

Also replace stack allocated BIGNUMs with calls to BN_CTX_get(), using the
BN_CTX that is already available.

ok tb@
lib/libcrypto/dsa/dsa_ameth.c
lib/libcrypto/dsa/dsa_gen.c
lib/libcrypto/dsa/dsa_ossl.c