summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_server.c
diff options
context:
space:
mode:
authortb <>2020-05-23 08:47:19 +0000
committertb <>2020-05-23 08:47:19 +0000
commit75a517d36cb6927c5e5e2af71f5bed9d6ac6b884 (patch)
treeff8ad2a5ab8226a8d16a168de4c9b55ae8daabcb /src/lib/libssl/tls13_server.c
parentb252d4c293dcc14a07d6eff59aab97e224d207b2 (diff)
downloadopenbsd-75a517d36cb6927c5e5e2af71f5bed9d6ac6b884.tar.gz
openbsd-75a517d36cb6927c5e5e2af71f5bed9d6ac6b884.tar.bz2
openbsd-75a517d36cb6927c5e5e2af71f5bed9d6ac6b884.zip
Do not assume that server_group != 0 or tlsext_supportedgroups != NULL
implies that we're dealing with a HRR in the extension handling code. Explicitly check that we're in this situation by inspecting the flag in the handshake context. Add missing error checks and send the appropriate alerts. The hrr flag needs to be unset after parsing the client hello retry to avoid breaking the server hello handling. All this is far from ideal, but better than nothing. The correct fix would likely be to make the message type available but that would need to be part of a more extensive rearchitecture of the extension handling. Discussed at length with jsing
Diffstat (limited to 'src/lib/libssl/tls13_server.c')
-rw-r--r--src/lib/libssl/tls13_server.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_server.c b/src/lib/libssl/tls13_server.c
index e0ea6b564d..e605ccd90f 100644
--- a/src/lib/libssl/tls13_server.c
+++ b/src/lib/libssl/tls13_server.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_server.c,v 1.51 2020/05/22 02:37:27 beck Exp $ */ 1/* $OpenBSD: tls13_server.c,v 1.52 2020/05/23 08:47:19 tb Exp $ */
2/* 2/*
3 * Copyright (c) 2019, 2020 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2019, 2020 Joel Sing <jsing@openbsd.org>
4 * Copyright (c) 2020 Bob Beck <beck@openbsd.org> 4 * Copyright (c) 2020 Bob Beck <beck@openbsd.org>
@@ -365,6 +365,8 @@ tls13_client_hello_retry_recv(struct tls13_ctx *ctx, CBS *cbs)
365 if (s->method->internal->version < TLS1_3_VERSION) 365 if (s->method->internal->version < TLS1_3_VERSION)
366 return 0; 366 return 0;
367 367
368 ctx->hs->hrr = 0;
369
368 return 1; 370 return 1;
369} 371}
370 372