summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_handshake.h
diff options
context:
space:
mode:
authorjsing <>2020-04-22 17:05:07 +0000
committerjsing <>2020-04-22 17:05:07 +0000
commitc18a60d45888295bb8cf344e076d84ef817a65a5 (patch)
treec7a924ebca094d3b2e25924b18e7bcf1cf4da7b7 /src/lib/libssl/tls13_handshake.h
parentc430432c2ef1ea560124b642f581c3e1ddb24f69 (diff)
downloadopenbsd-c18a60d45888295bb8cf344e076d84ef817a65a5.tar.gz
openbsd-c18a60d45888295bb8cf344e076d84ef817a65a5.tar.bz2
openbsd-c18a60d45888295bb8cf344e076d84ef817a65a5.zip
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 'src/lib/libssl/tls13_handshake.h')
-rw-r--r--src/lib/libssl/tls13_handshake.h8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/lib/libssl/tls13_handshake.h b/src/lib/libssl/tls13_handshake.h
index 956d27c61a..8a08b9fd5b 100644
--- a/src/lib/libssl/tls13_handshake.h
+++ b/src/lib/libssl/tls13_handshake.h
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_handshake.h,v 1.4 2020/03/10 17:15:02 jsing Exp $ */ 1/* $OpenBSD: tls13_handshake.h,v 1.5 2020/04/22 17:05:07 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2019 Theo Buehler <tb@openbsd.org> 3 * Copyright (c) 2019 Theo Buehler <tb@openbsd.org>
4 * 4 *
@@ -24,7 +24,7 @@ __BEGIN_HIDDEN_DECLS
24 24
25#define INITIAL 0x00 25#define INITIAL 0x00
26#define NEGOTIATED 0x01 26#define NEGOTIATED 0x01
27#define WITH_HRR 0x02 27#define WITHOUT_HRR 0x02
28#define WITHOUT_CR 0x04 28#define WITHOUT_CR 0x04
29#define WITH_PSK 0x08 29#define WITH_PSK 0x08
30#define WITH_CCV 0x10 30#define WITH_CCV 0x10
@@ -33,9 +33,9 @@ __BEGIN_HIDDEN_DECLS
33enum tls13_message_type { 33enum tls13_message_type {
34 INVALID, 34 INVALID,
35 CLIENT_HELLO, 35 CLIENT_HELLO,
36 SERVER_HELLO, 36 SERVER_HELLO_RETRY_REQUEST,
37 CLIENT_HELLO_RETRY, 37 CLIENT_HELLO_RETRY,
38 SERVER_HELLO_RETRY, 38 SERVER_HELLO,
39 SERVER_ENCRYPTED_EXTENSIONS, 39 SERVER_ENCRYPTED_EXTENSIONS,
40 SERVER_CERTIFICATE_REQUEST, 40 SERVER_CERTIFICATE_REQUEST,
41 SERVER_CERTIFICATE, 41 SERVER_CERTIFICATE,