summaryrefslogtreecommitdiff
path: root/src/lib/libssl/t1_lib.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/t1_lib.c')
-rw-r--r--src/lib/libssl/t1_lib.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/src/lib/libssl/t1_lib.c b/src/lib/libssl/t1_lib.c
index 092331aae1..78532054a0 100644
--- a/src/lib/libssl/t1_lib.c
+++ b/src/lib/libssl/t1_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: t1_lib.c,v 1.183 2021/10/25 10:01:46 jsing Exp $ */ 1/* $OpenBSD: t1_lib.c,v 1.184 2021/11/26 16:41:42 tb Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -572,16 +572,17 @@ tls1_check_ec_server_key(SSL *s)
572 CERT_PKEY *cpk = s->cert->pkeys + SSL_PKEY_ECC; 572 CERT_PKEY *cpk = s->cert->pkeys + SSL_PKEY_ECC;
573 uint16_t curve_id; 573 uint16_t curve_id;
574 uint8_t comp_id; 574 uint8_t comp_id;
575 EC_KEY *eckey;
575 EVP_PKEY *pkey; 576 EVP_PKEY *pkey;
576 int rv; 577 int rv;
577 578
578 if (cpk->x509 == NULL || cpk->privatekey == NULL) 579 if (cpk->x509 == NULL || cpk->privatekey == NULL)
579 return (0); 580 return (0);
580 if ((pkey = X509_get_pubkey(cpk->x509)) == NULL) 581 if ((pkey = X509_get0_pubkey(cpk->x509)) == NULL)
581 return (0); 582 return (0);
582 rv = tls1_set_ec_id(&curve_id, &comp_id, pkey->pkey.ec); 583 if ((eckey = EVP_PKEY_get0_EC_KEY(pkey)) == NULL)
583 EVP_PKEY_free(pkey); 584 return (0);
584 if (rv != 1) 585 if ((rv = tls1_set_ec_id(&curve_id, &comp_id, eckey)) != 1)
585 return (0); 586 return (0);
586 587
587 return tls1_check_ec_key(s, &curve_id, &comp_id); 588 return tls1_check_ec_key(s, &curve_id, &comp_id);