summaryrefslogtreecommitdiff
path: root/lib/libcrypto/ec/ec_ameth.c
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2024-10-29 06:36:59 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2024-10-29 06:36:59 +0000
commitfc94c0e64be88258f0bae43cb7ef28b87f49e81e (patch)
treef52c9eaeca6a731045d1f7cfd41764579e2cc83c /lib/libcrypto/ec/ec_ameth.c
parentf2c1c1c10205a0cb367a334ffdbfcb3141b38134 (diff)
eckey_compute_pubkey: don't leak the public key
EC_KEY_set_public_key() sets a copy, so it doesn't take ownership and hence pub_key must not be nulled out on success.
Diffstat (limited to 'lib/libcrypto/ec/ec_ameth.c')
-rw-r--r--lib/libcrypto/ec/ec_ameth.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libcrypto/ec/ec_ameth.c b/lib/libcrypto/ec/ec_ameth.c
index 246da224503..754fabfb4d3 100644
--- a/lib/libcrypto/ec/ec_ameth.c
+++ b/lib/libcrypto/ec/ec_ameth.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ec_ameth.c,v 1.71 2024/10/28 18:01:26 tb Exp $ */
+/* $OpenBSD: ec_ameth.c,v 1.72 2024/10/29 06:36:58 tb Exp $ */
/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
* project 2006.
*/
@@ -328,7 +328,6 @@ eckey_compute_pubkey(EC_KEY *eckey)
goto err;
if (!EC_KEY_set_public_key(eckey, pub_key))
goto err;
- pub_key = NULL;
ret = 1;