summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libssl/tls13_handshake.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/src/lib/libssl/tls13_handshake.c b/src/lib/libssl/tls13_handshake.c
index f322cbe39b..7798093def 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.10 2019/01/19 04:02:29 jsing Exp $ */ 1/* $OpenBSD: tls13_handshake.c,v 1.11 2019/01/20 02:08:05 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>
@@ -45,7 +45,8 @@ struct tls13_handshake_action {
45 uint8_t sender; 45 uint8_t sender;
46#define TLS13_HS_CLIENT 1 46#define TLS13_HS_CLIENT 1
47#define TLS13_HS_SERVER 2 47#define TLS13_HS_SERVER 2
48#define TLS13_HS_BOTH (TLS13_HS_CLIENT | TLS13_HS_SERVER) 48
49 uint8_t handshake_complete;
49 50
50 int (*send)(struct tls13_ctx *ctx); 51 int (*send)(struct tls13_ctx *ctx);
51 int (*recv)(struct tls13_ctx *ctx); 52 int (*recv)(struct tls13_ctx *ctx);
@@ -157,10 +158,7 @@ struct tls13_handshake_action state_machine[] = {
157 }, 158 },
158 [APPLICATION_DATA] = { 159 [APPLICATION_DATA] = {
159 .record_type = TLS13_APPLICATION_DATA, 160 .record_type = TLS13_APPLICATION_DATA,
160 .handshake_type = 0, 161 .handshake_complete = 1,
161 .sender = TLS13_HS_BOTH,
162 .send = NULL,
163 .recv = NULL,
164 }, 162 },
165}; 163};
166 164
@@ -287,7 +285,7 @@ tls13_connect(struct tls13_ctx *ctx)
287 if ((action = tls13_handshake_active_action(ctx)) == NULL) 285 if ((action = tls13_handshake_active_action(ctx)) == NULL)
288 return TLS13_IO_FAILURE; 286 return TLS13_IO_FAILURE;
289 287
290 if (action->sender == TLS13_HS_BOTH) 288 if (action->handshake_complete)
291 return TLS13_IO_SUCCESS; 289 return TLS13_IO_SUCCESS;
292 290
293 if (action->sender == TLS13_HS_CLIENT) { 291 if (action->sender == TLS13_HS_CLIENT) {
@@ -315,7 +313,7 @@ tls13_accept(struct tls13_ctx *ctx)
315 if ((action = tls13_handshake_active_action(ctx)) == NULL) 313 if ((action = tls13_handshake_active_action(ctx)) == NULL)
316 return TLS13_IO_FAILURE; 314 return TLS13_IO_FAILURE;
317 315
318 if (action->sender == TLS13_HS_BOTH) 316 if (action->handshake_complete)
319 return TLS13_IO_SUCCESS; 317 return TLS13_IO_SUCCESS;
320 318
321 if (action->sender == TLS13_HS_SERVER) { 319 if (action->sender == TLS13_HS_SERVER) {