Free {priv,pub}_key before assigning to it
authortb <tb@openbsd.org>
Sat, 12 Aug 2023 07:50:47 +0000 (07:50 +0000)
committertb <tb@openbsd.org>
Sat, 12 Aug 2023 07:50:47 +0000 (07:50 +0000)
commit52d22fd75a470a5df94fdb4fe83c70bb9580a74a
tree90b64e1d3dd1bf4934f07aff71bced8e47641b9e
parent741c28584f77a436b1cee283d5ed93394952f9ae
Free {priv,pub}_key before assigning to it

While it isn't the case for the default implementations, custom DH and DSA
methods could conceivably populate private and public keys, which in turn
would result in leaks in the pub/priv decode methods.

ok jsing
lib/libcrypto/dh/dh_ameth.c
lib/libcrypto/dsa/dsa_ameth.c