summaryrefslogtreecommitdiff
path: root/src/lib/libcrypto/crypto_init.c
diff options
context:
space:
mode:
authortb <>2023-08-21 09:52:30 +0000
committertb <>2023-08-21 09:52:30 +0000
commit5da8854a55630a13207388a7ea72fd22707b8355 (patch)
tree9bde0b5077ca4bfd1588eafeaa0cffd8572151fe /src/lib/libcrypto/crypto_init.c
parent7f163475c2da97c8766f77f713283fee9757e912 (diff)
downloadopenbsd-5da8854a55630a13207388a7ea72fd22707b8355.tar.gz
openbsd-5da8854a55630a13207388a7ea72fd22707b8355.tar.bz2
openbsd-5da8854a55630a13207388a7ea72fd22707b8355.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/crypto_init.c')
0 files changed, 0 insertions, 0 deletions