summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_lib.c
diff options
context:
space:
mode:
authortb <>2021-03-27 17:56:28 +0000
committertb <>2021-03-27 17:56:28 +0000
commitc181c81fb01592ad1d49ebf7afa9676c41a32aaf (patch)
treeac68380783b8a8e28d9f271506951e261e2e33a4 /src/lib/libssl/ssl_lib.c
parent5d4b8b6f9a8de0dda3e5c12178bbb427e7f32037 (diff)
downloadopenbsd-c181c81fb01592ad1d49ebf7afa9676c41a32aaf.tar.gz
openbsd-c181c81fb01592ad1d49ebf7afa9676c41a32aaf.tar.bz2
openbsd-c181c81fb01592ad1d49ebf7afa9676c41a32aaf.zip
Garbage collect s->internal->type
This variable is used in the legacy stack to decide whether we are a server or a client. That's what s->server is for... The new TLSv1.3 stack failed to set s->internal->type, which resulted in hilarious mishandling of previous_{client,server}_finished. Indeed, both client and server would first store the client's verify_data in previous_server_finished and later overwrite it with the server's verify_data. Consequently, renegotiation has been completely broken for more than a year. In fact, server side renegotiation was broken during the 6.5 release cycle. Clearly, no-one uses this. This commit fixes client side renegotiation and restores the previous behavior of SSL_get_client_CA_list(). Server side renegotiation will be fixed in a later commit. ok jsing
Diffstat (limited to 'src/lib/libssl/ssl_lib.c')
-rw-r--r--src/lib/libssl/ssl_lib.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/lib/libssl/ssl_lib.c b/src/lib/libssl/ssl_lib.c
index e3e0c974af..c77fdd77e9 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.252 2021/03/24 18:44:00 jsing Exp $ */ 1/* $OpenBSD: ssl_lib.c,v 1.253 2021/03/27 17:56:28 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 *
@@ -186,8 +186,6 @@ SSL_clear(SSL *s)
186 return (0); 186 return (0);
187 } 187 }
188 188
189 s->internal->type = 0;
190
191 s->version = s->method->internal->version; 189 s->version = s->method->internal->version;
192 s->client_version = s->version; 190 s->client_version = s->version;
193 s->internal->rwstate = SSL_NOTHING; 191 s->internal->rwstate = SSL_NOTHING;
@@ -2494,7 +2492,6 @@ SSL_dup(SSL *s)
2494 goto err; 2492 goto err;
2495 2493
2496 ret->version = s->version; 2494 ret->version = s->version;
2497 ret->internal->type = s->internal->type;
2498 ret->method = s->method; 2495 ret->method = s->method;
2499 2496
2500 if (s->session != NULL) { 2497 if (s->session != NULL) {