summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_clnt.c
diff options
context:
space:
mode:
authorjsing <>2021-10-25 10:01:46 +0000
committerjsing <>2021-10-25 10:01:46 +0000
commitb56105c2617b86206d3688dd7940aa6e553af6e1 (patch)
tree7da475234e07731ebcbe2828153d1920d308e436 /src/lib/libssl/ssl_clnt.c
parent75891c69eb8972c8d768d8bd1068a807ba084652 (diff)
downloadopenbsd-b56105c2617b86206d3688dd7940aa6e553af6e1.tar.gz
openbsd-b56105c2617b86206d3688dd7940aa6e553af6e1.tar.bz2
openbsd-b56105c2617b86206d3688dd7940aa6e553af6e1.zip
Fold SSL_SESSION_INTERNAL back into SSL_SESSION.
ok beck@ tb@
Diffstat (limited to 'src/lib/libssl/ssl_clnt.c')
-rw-r--r--src/lib/libssl/ssl_clnt.c36
1 files changed, 18 insertions, 18 deletions
diff --git a/src/lib/libssl/ssl_clnt.c b/src/lib/libssl/ssl_clnt.c
index ea502e6a33..fe864d1cdc 100644
--- a/src/lib/libssl/ssl_clnt.c
+++ b/src/lib/libssl/ssl_clnt.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_clnt.c,v 1.116 2021/10/23 16:11:30 tb Exp $ */ 1/* $OpenBSD: ssl_clnt.c,v 1.117 2021/10/25 10:01:46 jsing 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 *
@@ -655,7 +655,7 @@ ssl3_send_client_hello(SSL *s)
655 if (sess == NULL || 655 if (sess == NULL ||
656 sess->ssl_version != s->version || 656 sess->ssl_version != s->version ||
657 (!sess->session_id_length && !sess->tlsext_tick) || 657 (!sess->session_id_length && !sess->tlsext_tick) ||
658 sess->internal->not_resumable) { 658 sess->not_resumable) {
659 if (!ssl_get_new_session(s, 0)) 659 if (!ssl_get_new_session(s, 0))
660 goto err; 660 goto err;
661 } 661 }
@@ -1157,8 +1157,8 @@ ssl3_get_server_certificate(SSL *s)
1157 sc = ssl_sess_cert_new(); 1157 sc = ssl_sess_cert_new();
1158 if (sc == NULL) 1158 if (sc == NULL)
1159 goto err; 1159 goto err;
1160 ssl_sess_cert_free(SSI(s)->sess_cert); 1160 ssl_sess_cert_free(s->session->sess_cert);
1161 SSI(s)->sess_cert = sc; 1161 s->session->sess_cert = sc;
1162 1162
1163 sc->cert_chain = sk; 1163 sc->cert_chain = sk;
1164 /* 1164 /*
@@ -1231,7 +1231,7 @@ ssl3_get_server_kex_dhe(SSL *s, EVP_PKEY **pkey, CBS *cbs)
1231 int al; 1231 int al;
1232 1232
1233 alg_a = S3I(s)->hs.cipher->algorithm_auth; 1233 alg_a = S3I(s)->hs.cipher->algorithm_auth;
1234 sc = SSI(s)->sess_cert; 1234 sc = s->session->sess_cert;
1235 1235
1236 if ((dh = DH_new()) == NULL) { 1236 if ((dh = DH_new()) == NULL) {
1237 SSLerror(s, ERR_R_DH_LIB); 1237 SSLerror(s, ERR_R_DH_LIB);
@@ -1359,7 +1359,7 @@ ssl3_get_server_kex_ecdhe(SSL *s, EVP_PKEY **pkey, CBS *cbs)
1359 int al; 1359 int al;
1360 1360
1361 alg_a = S3I(s)->hs.cipher->algorithm_auth; 1361 alg_a = S3I(s)->hs.cipher->algorithm_auth;
1362 sc = SSI(s)->sess_cert; 1362 sc = s->session->sess_cert;
1363 1363
1364 /* Only named curves are supported. */ 1364 /* Only named curves are supported. */
1365 if (!CBS_get_u8(cbs, &curve_type) || 1365 if (!CBS_get_u8(cbs, &curve_type) ||
@@ -1468,18 +1468,18 @@ ssl3_get_server_key_exchange(SSL *s)
1468 return (1); 1468 return (1);
1469 } 1469 }
1470 1470
1471 if (SSI(s)->sess_cert != NULL) { 1471 if (s->session->sess_cert != NULL) {
1472 DH_free(SSI(s)->sess_cert->peer_dh_tmp); 1472 DH_free(s->session->sess_cert->peer_dh_tmp);
1473 SSI(s)->sess_cert->peer_dh_tmp = NULL; 1473 s->session->sess_cert->peer_dh_tmp = NULL;
1474 1474
1475 EC_KEY_free(SSI(s)->sess_cert->peer_ecdh_tmp); 1475 EC_KEY_free(s->session->sess_cert->peer_ecdh_tmp);
1476 SSI(s)->sess_cert->peer_ecdh_tmp = NULL; 1476 s->session->sess_cert->peer_ecdh_tmp = NULL;
1477 1477
1478 free(SSI(s)->sess_cert->peer_x25519_tmp); 1478 free(s->session->sess_cert->peer_x25519_tmp);
1479 SSI(s)->sess_cert->peer_x25519_tmp = NULL; 1479 s->session->sess_cert->peer_x25519_tmp = NULL;
1480 } else { 1480 } else {
1481 SSI(s)->sess_cert = ssl_sess_cert_new(); 1481 s->session->sess_cert = ssl_sess_cert_new();
1482 if (SSI(s)->sess_cert == NULL) 1482 if (s->session->sess_cert == NULL)
1483 goto err; 1483 goto err;
1484 } 1484 }
1485 1485
@@ -2267,7 +2267,7 @@ ssl3_send_client_key_exchange(SSL *s)
2267 if (S3I(s)->hs.state == SSL3_ST_CW_KEY_EXCH_A) { 2267 if (S3I(s)->hs.state == SSL3_ST_CW_KEY_EXCH_A) {
2268 alg_k = S3I(s)->hs.cipher->algorithm_mkey; 2268 alg_k = S3I(s)->hs.cipher->algorithm_mkey;
2269 2269
2270 if ((sess_cert = SSI(s)->sess_cert) == NULL) { 2270 if ((sess_cert = s->session->sess_cert) == NULL) {
2271 ssl3_send_alert(s, SSL3_AL_FATAL, 2271 ssl3_send_alert(s, SSL3_AL_FATAL,
2272 SSL_AD_UNEXPECTED_MESSAGE); 2272 SSL_AD_UNEXPECTED_MESSAGE);
2273 SSLerror(s, ERR_R_INTERNAL_ERROR); 2273 SSLerror(s, ERR_R_INTERNAL_ERROR);
@@ -2670,12 +2670,12 @@ ssl3_check_cert_and_algorithm(SSL *s)
2670 if (alg_a & SSL_aNULL) 2670 if (alg_a & SSL_aNULL)
2671 return (1); 2671 return (1);
2672 2672
2673 sc = SSI(s)->sess_cert; 2673 sc = s->session->sess_cert;
2674 if (sc == NULL) { 2674 if (sc == NULL) {
2675 SSLerror(s, ERR_R_INTERNAL_ERROR); 2675 SSLerror(s, ERR_R_INTERNAL_ERROR);
2676 goto err; 2676 goto err;
2677 } 2677 }
2678 dh = SSI(s)->sess_cert->peer_dh_tmp; 2678 dh = s->session->sess_cert->peer_dh_tmp;
2679 2679
2680 /* This is the passed certificate. */ 2680 /* This is the passed certificate. */
2681 2681