summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authortb <>2024-10-29 06:36:58 +0000
committertb <>2024-10-29 06:36:58 +0000
commit70850c047f141cf86dd9dc4ed010b2a352b5036b (patch)
tree5bac78bb07a3a8b81348d54a6b2070bc0c287ccf /src/lib
parentb6840aacc4c4d93817118bf0d184e1f70fc60110 (diff)
downloadopenbsd-70850c047f141cf86dd9dc4ed010b2a352b5036b.tar.gz
openbsd-70850c047f141cf86dd9dc4ed010b2a352b5036b.tar.bz2
openbsd-70850c047f141cf86dd9dc4ed010b2a352b5036b.zip
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 'src/lib')
-rw-r--r--src/lib/libcrypto/ec/ec_ameth.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/lib/libcrypto/ec/ec_ameth.c b/src/lib/libcrypto/ec/ec_ameth.c
index 246da22450..754fabfb4d 100644
--- a/src/lib/libcrypto/ec/ec_ameth.c
+++ b/src/lib/libcrypto/ec/ec_ameth.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ec_ameth.c,v 1.71 2024/10/28 18:01:26 tb Exp $ */ 1/* $OpenBSD: ec_ameth.c,v 1.72 2024/10/29 06:36:58 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2006. 3 * project 2006.
4 */ 4 */
@@ -328,7 +328,6 @@ eckey_compute_pubkey(EC_KEY *eckey)
328 goto err; 328 goto err;
329 if (!EC_KEY_set_public_key(eckey, pub_key)) 329 if (!EC_KEY_set_public_key(eckey, pub_key))
330 goto err; 330 goto err;
331 pub_key = NULL;
332 331
333 ret = 1; 332 ret = 1;
334 333