summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lib/libssl/ssl_rsa.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_rsa.c b/src/lib/libssl/ssl_rsa.c
index 28a24f83b3..70c29359f0 100644
--- a/src/lib/libssl/ssl_rsa.c
+++ b/src/lib/libssl/ssl_rsa.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_rsa.c,v 1.47 2022/08/31 20:20:53 tb Exp $ */ 1/* $OpenBSD: ssl_rsa.c,v 1.48 2022/08/31 20:49:37 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 *
@@ -184,9 +184,17 @@ ssl_set_pkey(SSL_CTX *ctx, SSL *ssl, EVP_PKEY *pkey)
184 184
185 if (c->pkeys[i].x509 != NULL) { 185 if (c->pkeys[i].x509 != NULL) {
186 EVP_PKEY *pktmp; 186 EVP_PKEY *pktmp;
187 pktmp = X509_get_pubkey(c->pkeys[i].x509); 187
188 if ((pktmp = X509_get0_pubkey(c->pkeys[i].x509)) == NULL)
189 return 0;
190
191 /*
192 * Callers of EVP_PKEY_copy_parameters() can't distinguish
193 * errors from the absence of a param_copy() method. So
194 * pretend it can never fail.
195 */
188 EVP_PKEY_copy_parameters(pktmp, pkey); 196 EVP_PKEY_copy_parameters(pktmp, pkey);
189 EVP_PKEY_free(pktmp); 197
190 ERR_clear_error(); 198 ERR_clear_error();
191 199
192 /* 200 /*
@@ -209,7 +217,7 @@ ssl_set_pkey(SSL_CTX *ctx, SSL *ssl, EVP_PKEY *pkey)
209 c->key = &(c->pkeys[i]); 217 c->key = &(c->pkeys[i]);
210 218
211 c->valid = 0; 219 c->valid = 0;
212 return (1); 220 return 1;
213} 221}
214 222
215int 223int