diff options
| author | tb <> | 2019-04-05 20:23:38 +0000 |
|---|---|---|
| committer | tb <> | 2019-04-05 20:23:38 +0000 |
| commit | c2876e8ba1959b3e0627d20de447c1449f8294da (patch) | |
| tree | 6f5b00fafa4585971679b89854e3ba9289deccf5 /src/lib/libssl/tls13_handshake.c | |
| parent | a98b4eba250f598d6a0d68257edc1e04e6374565 (diff) | |
| download | openbsd-c2876e8ba1959b3e0627d20de447c1449f8294da.tar.gz openbsd-c2876e8ba1959b3e0627d20de447c1449f8294da.tar.bz2 openbsd-c2876e8ba1959b3e0627d20de447c1449f8294da.zip | |
By design, our state machine is a DAG contrary to the state machine in
the spec. To avoid the obvious loop in the RFC's state machine, we added
a CLIENT_HELLO_RETRY state which is a second ClientHello with special
rules. There is, however, no state to react to this second client hello.
This adds a matching SERVER_HELLO_RETRY state to the handshakes table.
This means in particular that the WITH_HRR state cannot be set in
tls13_server_hello_recv(), so remove this now dead check.
ok jsing
Diffstat (limited to 'src/lib/libssl/tls13_handshake.c')
| -rw-r--r-- | src/lib/libssl/tls13_handshake.c | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_handshake.c b/src/lib/libssl/tls13_handshake.c index fd49e03adc..542410bd39 100644 --- a/src/lib/libssl/tls13_handshake.c +++ b/src/lib/libssl/tls13_handshake.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: tls13_handshake.c,v 1.34 2019/04/05 05:13:12 tb Exp $ */ | 1 | /* $OpenBSD: tls13_handshake.c,v 1.35 2019/04/05 20:23:38 tb Exp $ */ |
| 2 | /* | 2 | /* |
| 3 | * Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org> |
| 4 | * Copyright (c) 2019 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2019 Joel Sing <jsing@openbsd.org> |
| @@ -98,6 +98,12 @@ struct tls13_handshake_action state_machine[] = { | |||
| 98 | .send = tls13_server_hello_send, | 98 | .send = tls13_server_hello_send, |
| 99 | .recv = tls13_server_hello_recv, | 99 | .recv = tls13_server_hello_recv, |
| 100 | }, | 100 | }, |
| 101 | [SERVER_HELLO_RETRY] = { | ||
| 102 | .handshake_type = TLS13_MT_SERVER_HELLO, | ||
| 103 | .sender = TLS13_HS_SERVER, | ||
| 104 | .send = tls13_server_hello_retry_send, | ||
| 105 | .recv = tls13_server_hello_retry_recv, | ||
| 106 | }, | ||
| 101 | [SERVER_ENCRYPTED_EXTENSIONS] = { | 107 | [SERVER_ENCRYPTED_EXTENSIONS] = { |
| 102 | .handshake_type = TLS13_MT_ENCRYPTED_EXTENSIONS, | 108 | .handshake_type = TLS13_MT_ENCRYPTED_EXTENSIONS, |
| 103 | .sender = TLS13_HS_SERVER, | 109 | .sender = TLS13_HS_SERVER, |
| @@ -156,6 +162,7 @@ enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES] = { | |||
| 156 | CLIENT_HELLO, | 162 | CLIENT_HELLO, |
| 157 | SERVER_HELLO, | 163 | SERVER_HELLO, |
| 158 | CLIENT_HELLO_RETRY, | 164 | CLIENT_HELLO_RETRY, |
| 165 | SERVER_HELLO_RETRY, | ||
| 159 | SERVER_ENCRYPTED_EXTENSIONS, | 166 | SERVER_ENCRYPTED_EXTENSIONS, |
| 160 | SERVER_CERTIFICATE_REQUEST, | 167 | SERVER_CERTIFICATE_REQUEST, |
| 161 | SERVER_CERTIFICATE, | 168 | SERVER_CERTIFICATE, |
| @@ -179,6 +186,7 @@ enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES] = { | |||
| 179 | CLIENT_HELLO, | 186 | CLIENT_HELLO, |
| 180 | SERVER_HELLO, | 187 | SERVER_HELLO, |
| 181 | CLIENT_HELLO_RETRY, | 188 | CLIENT_HELLO_RETRY, |
| 189 | SERVER_HELLO_RETRY, | ||
| 182 | SERVER_ENCRYPTED_EXTENSIONS, | 190 | SERVER_ENCRYPTED_EXTENSIONS, |
| 183 | SERVER_CERTIFICATE, | 191 | SERVER_CERTIFICATE, |
| 184 | SERVER_CERTIFICATE_VERIFY, | 192 | SERVER_CERTIFICATE_VERIFY, |
| @@ -198,6 +206,7 @@ enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES] = { | |||
| 198 | CLIENT_HELLO, | 206 | CLIENT_HELLO, |
| 199 | SERVER_HELLO, | 207 | SERVER_HELLO, |
| 200 | CLIENT_HELLO_RETRY, | 208 | CLIENT_HELLO_RETRY, |
| 209 | SERVER_HELLO_RETRY, | ||
| 201 | SERVER_ENCRYPTED_EXTENSIONS, | 210 | SERVER_ENCRYPTED_EXTENSIONS, |
| 202 | SERVER_FINISHED, | 211 | SERVER_FINISHED, |
| 203 | CLIENT_FINISHED, | 212 | CLIENT_FINISHED, |
| @@ -220,6 +229,7 @@ enum tls13_message_type handshakes[][TLS13_NUM_MESSAGE_TYPES] = { | |||
| 220 | CLIENT_HELLO, | 229 | CLIENT_HELLO, |
| 221 | SERVER_HELLO, | 230 | SERVER_HELLO, |
| 222 | CLIENT_HELLO_RETRY, | 231 | CLIENT_HELLO_RETRY, |
| 232 | SERVER_HELLO_RETRY, | ||
| 223 | SERVER_ENCRYPTED_EXTENSIONS, | 233 | SERVER_ENCRYPTED_EXTENSIONS, |
| 224 | SERVER_CERTIFICATE_REQUEST, | 234 | SERVER_CERTIFICATE_REQUEST, |
| 225 | SERVER_CERTIFICATE, | 235 | SERVER_CERTIFICATE, |
| @@ -404,6 +414,12 @@ tls13_client_hello_retry_send(struct tls13_ctx *ctx) | |||
| 404 | } | 414 | } |
| 405 | 415 | ||
| 406 | int | 416 | int |
| 417 | tls13_server_hello_retry_recv(struct tls13_ctx *ctx) | ||
| 418 | { | ||
| 419 | return 0; | ||
| 420 | } | ||
| 421 | |||
| 422 | int | ||
| 407 | tls13_client_hello_retry_recv(struct tls13_ctx *ctx) | 423 | tls13_client_hello_retry_recv(struct tls13_ctx *ctx) |
| 408 | { | 424 | { |
| 409 | return 0; | 425 | return 0; |
| @@ -473,6 +489,12 @@ tls13_server_hello_send(struct tls13_ctx *ctx) | |||
| 473 | } | 489 | } |
| 474 | 490 | ||
| 475 | int | 491 | int |
| 492 | tls13_server_hello_retry_send(struct tls13_ctx *ctx) | ||
| 493 | { | ||
| 494 | return 0; | ||
| 495 | } | ||
| 496 | |||
| 497 | int | ||
| 476 | tls13_server_encrypted_extensions_send(struct tls13_ctx *ctx) | 498 | tls13_server_encrypted_extensions_send(struct tls13_ctx *ctx) |
| 477 | { | 499 | { |
| 478 | return 0; | 500 | return 0; |
