summaryrefslogtreecommitdiff
path: root/lib/libssl/tls13_client.c
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2024-07-20 04:04:24 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2024-07-20 04:04:24 +0000
commit37f22cb8afa67eb9115b60b7c2957f4184219d14 (patch)
tree435a7893329978e7fe2cec997d0a36569024783d /lib/libssl/tls13_client.c
parent5e235feafc38c0da2de3e6869942e7b5b3770420 (diff)
Remove cipher from SSL_SESSION.
For a long time SSL_SESSION has had both a cipher ID and a pointer to an SSL_CIPHER (and not both are guaranteed to be populated). There is also a pointer to an SSL_CIPHER in the SSL_HANDSHAKE that denotes the cipher being used for this connection. Some code has been using the cipher from SSL_SESSION and some code has been using the cipher from SSL_HANDSHAKE. Remove cipher from SSL_SESSION and use the version in SSL_HANDSHAKE everywhere. If resuming from a session then we need to use the SSL_SESSION cipher ID to set the SSL_HANDSHAKE cipher. And we still need to ensure that we update the cipher ID in the SSL_SESSION whenever the SSL_HANDSHAKE cipher changes (this only occurs in a few places). ok tb@
Diffstat (limited to 'lib/libssl/tls13_client.c')
-rw-r--r--lib/libssl/tls13_client.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libssl/tls13_client.c b/lib/libssl/tls13_client.c
index 053cf1689b1..8f6894fd888 100644
--- a/lib/libssl/tls13_client.c
+++ b/lib/libssl/tls13_client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_client.c,v 1.102 2023/06/10 15:34:36 tb Exp $ */
+/* $OpenBSD: tls13_client.c,v 1.103 2024/07/20 04:04:23 jsing Exp $ */
/*
* Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
*
@@ -347,7 +347,7 @@ tls13_client_engage_record_protection(struct tls13_ctx *ctx)
&shared_key_len))
goto err;
- s->session->cipher = ctx->hs->cipher;
+ s->session->cipher_id = ctx->hs->cipher->id;
s->session->ssl_version = ctx->hs->tls13.server_version;
if ((ctx->aead = tls13_cipher_aead(ctx->hs->cipher)) == NULL)