From a9f24628df539c8088b9794446120c0373037961 Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 5 Jan 2022 17:10:03 +0000 Subject: Rename tls13_key_share to tls_key_share. In preparation to use the key share code in both the TLSv1.3 and legacy stacks, rename tls13_key_share to tls_key_share, moving it into the shared handshake struct. Further changes will then allow the legacy stack to make use of the same code for ephemeral key exchange. ok inoguchi@ tb@ --- src/lib/libssl/s3_lib.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'src/lib/libssl/s3_lib.c') diff --git a/src/lib/libssl/s3_lib.c b/src/lib/libssl/s3_lib.c index 497dea6f08..b83a380547 100644 --- a/src/lib/libssl/s3_lib.c +++ b/src/lib/libssl/s3_lib.c @@ -1,4 +1,4 @@ -/* $OpenBSD: s3_lib.c,v 1.219 2021/11/02 13:59:29 tb Exp $ */ +/* $OpenBSD: s3_lib.c,v 1.220 2022/01/05 17:10:02 jsing Exp $ */ /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) * All rights reserved. * @@ -1569,7 +1569,8 @@ ssl3_free(SSL *s) EC_KEY_free(S3I(s)->tmp.ecdh); freezero(S3I(s)->tmp.x25519, X25519_KEY_LENGTH); - tls13_key_share_free(S3I(s)->hs.tls13.key_share); + tls_key_share_free(S3I(s)->hs.key_share); + tls13_secrets_destroy(S3I(s)->hs.tls13.secrets); freezero(S3I(s)->hs.tls13.cookie, S3I(s)->hs.tls13.cookie_len); tls13_clienthello_hash_clear(&S3I(s)->hs.tls13); @@ -1612,8 +1613,8 @@ ssl3_clear(SSL *s) S3I(s)->hs.sigalgs = NULL; S3I(s)->hs.sigalgs_len = 0; - tls13_key_share_free(S3I(s)->hs.tls13.key_share); - S3I(s)->hs.tls13.key_share = NULL; + tls_key_share_free(S3I(s)->hs.key_share); + S3I(s)->hs.key_share = NULL; tls13_secrets_destroy(S3I(s)->hs.tls13.secrets); S3I(s)->hs.tls13.secrets = NULL; @@ -1686,8 +1687,8 @@ _SSL_get_peer_tmp_key(SSL *s, EVP_PKEY **key) } else if (sc->peer_x25519_tmp != NULL) { if (!ssl_kex_dummy_ecdhe_x25519(pkey)) goto err; - } else if (S3I(s)->hs.tls13.key_share != NULL) { - if (!tls13_key_share_peer_pkey(S3I(s)->hs.tls13.key_share, + } else if (S3I(s)->hs.key_share != NULL) { + if (!tls_key_share_peer_pkey(S3I(s)->hs.key_share, pkey)) goto err; } else { -- cgit v1.2.3-55-g6feb