Simplify priv_key handling in d2i_ECPrivateKey()
authortb <tb@openbsd.org>
Thu, 31 Mar 2022 13:00:58 +0000 (13:00 +0000)
committertb <tb@openbsd.org>
Thu, 31 Mar 2022 13:00:58 +0000 (13:00 +0000)
commitcabe998964bbae1a09f89296e742a018387bf5b0
treecc528cfbaa8cd07efa9e012cd12aa623a2598ceb
parent326af693966ccfc600796f445a88b37549ae3e64
Simplify priv_key handling in d2i_ECPrivateKey()

d2i_EC_PRIVATEKEY() can handle the allocation of priv_key internally,
no need to do this up front and reach it through the dangerous reuse
mechanism. There's also no point in freeing a variable we know to be
NULL.

ok jsing
lib/libcrypto/ec/ec_asn1.c