summaryrefslogtreecommitdiff
path: root/lib/libssl/tls13_handshake.h
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2020-04-22 17:05:08 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2020-04-22 17:05:08 +0000
commit9be24d599402e0cb85d39479e6eafeb2e97b27c8 (patch)
tree09648a3382f840ed6a1722e6f274e1e7be919ecf /lib/libssl/tls13_handshake.h
parent8457e28324908ebe6f7345f10de1bfc1e695d774 (diff)
Improve TLSv1.3 state machine for HelloRetryRequest handling.
The state machine currently handles the HelloRetryRequest case by using WITH_HRR - in other words, we're explicitly indicating when we transition to the alternate path. The problem here is that we do not know if we're going to receive a ServerHello or a HelloRetryRequest until we process the message. This means that the ServerHello processing code has to handle both types of messages. The state machine and associated processing code becomes cleaner if we flip this around so that we assume we are going to receive a HelloRetryRequest and upon discovering that it is not, trigger WITHOUT_HRR and hand off to the ServerHello processing function. In particular, this makes the logic much more straight forward on the server side, when adding support for HRR. With feedback from tb@ ok tb@
Diffstat (limited to 'lib/libssl/tls13_handshake.h')
-rw-r--r--lib/libssl/tls13_handshake.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/libssl/tls13_handshake.h b/lib/libssl/tls13_handshake.h
index 956d27c61aa..8a08b9fd5bc 100644
--- a/lib/libssl/tls13_handshake.h
+++ b/lib/libssl/tls13_handshake.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_handshake.h,v 1.4 2020/03/10 17:15:02 jsing Exp $ */
+/* $OpenBSD: tls13_handshake.h,v 1.5 2020/04/22 17:05:07 jsing Exp $ */
/*
* Copyright (c) 2019 Theo Buehler <tb@openbsd.org>
*
@@ -24,7 +24,7 @@ __BEGIN_HIDDEN_DECLS
#define INITIAL 0x00
#define NEGOTIATED 0x01
-#define WITH_HRR 0x02
+#define WITHOUT_HRR 0x02
#define WITHOUT_CR 0x04
#define WITH_PSK 0x08
#define WITH_CCV 0x10
@@ -33,9 +33,9 @@ __BEGIN_HIDDEN_DECLS
enum tls13_message_type {
INVALID,
CLIENT_HELLO,
- SERVER_HELLO,
+ SERVER_HELLO_RETRY_REQUEST,
CLIENT_HELLO_RETRY,
- SERVER_HELLO_RETRY,
+ SERVER_HELLO,
SERVER_ENCRYPTED_EXTENSIONS,
SERVER_CERTIFICATE_REQUEST,
SERVER_CERTIFICATE,