summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_handshake.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/libssl/tls13_handshake.c')
-rw-r--r--src/lib/libssl/tls13_handshake.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/lib/libssl/tls13_handshake.c b/src/lib/libssl/tls13_handshake.c
index c86187caec..48a01d3ca4 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.37 2020/01/20 22:04:17 beck Exp $ */ 1/* $OpenBSD: tls13_handshake.c,v 1.38 2020/01/21 03:40:05 beck 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>
@@ -291,7 +291,8 @@ tls13_handshake_perform(struct tls13_ctx *ctx)
291 ctx->handshake_completed = 1; 291 ctx->handshake_completed = 1;
292 tls13_record_layer_handshake_completed(ctx->rl); 292 tls13_record_layer_handshake_completed(ctx->rl);
293 return TLS13_IO_SUCCESS; 293 return TLS13_IO_SUCCESS;
294 } 294 } else if (ctx->alert)
295 return tls13_send_alert(ctx->rl, ctx->alert);
295 296
296 if (action->sender == ctx->mode) { 297 if (action->sender == ctx->mode) {
297 if ((ret = tls13_handshake_send_action(ctx, action)) <= 0) 298 if ((ret = tls13_handshake_send_action(ctx, action)) <= 0)
@@ -329,6 +330,8 @@ tls13_handshake_send_action(struct tls13_ctx *ctx,
329 /* XXX - provide CBB. */ 330 /* XXX - provide CBB. */
330 if (!action->send(ctx)) 331 if (!action->send(ctx))
331 return TLS13_IO_FAILURE; 332 return TLS13_IO_FAILURE;
333 else if (ctx->alert)
334 return tls13_send_alert(ctx->rl, ctx->alert);
332 } 335 }
333 336
334 if ((ret = tls13_handshake_msg_send(ctx->hs_msg, ctx->rl)) <= 0) 337 if ((ret = tls13_handshake_msg_send(ctx->hs_msg, ctx->rl)) <= 0)
@@ -389,6 +392,8 @@ tls13_handshake_recv_action(struct tls13_ctx *ctx,
389 ret = TLS13_IO_FAILURE; 392 ret = TLS13_IO_FAILURE;
390 if (action->recv(ctx)) 393 if (action->recv(ctx))
391 ret = TLS13_IO_SUCCESS; 394 ret = TLS13_IO_SUCCESS;
395 else if (ctx->alert)
396 ret = tls13_send_alert(ctx->rl, ctx->alert);
392 397
393 tls13_handshake_msg_free(ctx->hs_msg); 398 tls13_handshake_msg_free(ctx->hs_msg);
394 ctx->hs_msg = NULL; 399 ctx->hs_msg = NULL;