summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authorjsing <>2024-07-20 04:04:23 +0000
committerjsing <>2024-07-20 04:04:23 +0000
commitb68193edfb3424eb0f993aec6089c9e057aa5d4d (patch)
treeb04719de2f91b0f8d7c9c7acb93cef76a89b9948 /src/lib/libssl/ssl_lib.c
parentcc7dc6e9b7012526aa3797842d226b3a275a7e70 (diff)
downloadopenbsd-b68193edfb3424eb0f993aec6089c9e057aa5d4d.tar.gz
openbsd-b68193edfb3424eb0f993aec6089c9e057aa5d4d.tar.bz2
openbsd-b68193edfb3424eb0f993aec6089c9e057aa5d4d.zip
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 'src/lib/libssl/ssl_lib.c')
-rw-r--r--src/lib/libssl/ssl_lib.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c
index 4b86b70db8..4cf5c46fda 100644
--- a/src/lib/libssl/ssl_lib.c
+++ b/src/lib/libssl/ssl_lib.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_lib.c,v 1.327 2024/07/19 08:54:31 jsing Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.328 2024/07/20 04:04:23 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 *
@@ -3073,11 +3073,10 @@ LSSL_ALIAS(SSL_get_privatekey);
3073const SSL_CIPHER * 3073const SSL_CIPHER *
3074SSL_get_current_cipher(const SSL *s) 3074SSL_get_current_cipher(const SSL *s)
3075{ 3075{
3076 if ((s->session != NULL) && (s->session->cipher != NULL)) 3076 return s->s3->hs.cipher;
3077 return (s->session->cipher);
3078 return (NULL);
3079} 3077}
3080LSSL_ALIAS(SSL_get_current_cipher); 3078LSSL_ALIAS(SSL_get_current_cipher);
3079
3081const void * 3080const void *
3082SSL_get_current_compression(SSL *s) 3081SSL_get_current_compression(SSL *s)
3083{ 3082{