diff options
author | tb <> | 2023-08-21 09:52:30 +0000 |
---|---|---|
committer | tb <> | 2023-08-21 09:52:30 +0000 |
commit | d3ac126cef693adbcc7de565f3cb40e700cc0e5d (patch) | |
tree | 9bde0b5077ca4bfd1588eafeaa0cffd8572151fe /src/lib/libcrypto/ts | |
parent | 1fad85be488e3d1aa8280c0510baf46c4157fb18 (diff) | |
download | openbsd-d3ac126cef693adbcc7de565f3cb40e700cc0e5d.tar.gz openbsd-d3ac126cef693adbcc7de565f3cb40e700cc0e5d.tar.bz2 openbsd-d3ac126cef693adbcc7de565f3cb40e700cc0e5d.zip |
ec_ameth: clean up eckey_{pub,priv}_encode()
Factor eckey_param_free() out of eckey_pub_encode(). ASN1_OBJECT_free()
is not actually needed. This will be addressed later.
i2o_ECPublicKey() allocates internally if *out == NULL, so no need to do
the two-call dance. Its return value is documented to be <= 0 on error,
which is wrong in the sense that only 0 is returned. Keep using the same
check for <= 0 as everywhere else.
Set of EC_PKEY_NO_PARAMETERS after the poorly named eckey_param2type() to
avoid potential underhanded side effects.
In eckey_priv_encode(), error exits would leak pval was leaked a few times.
Avoid this and simplify using i2d's internal allocation. Reinstate the
flags in a single error path.
ok jsing
Diffstat (limited to 'src/lib/libcrypto/ts')
0 files changed, 0 insertions, 0 deletions