summaryrefslogtreecommitdiff
path: root/lib/libssl/tls13_handshake.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libssl/tls13_handshake.c')
-rw-r--r--lib/libssl/tls13_handshake.c25
1 files changed, 11 insertions, 14 deletions
diff --git a/lib/libssl/tls13_handshake.c b/lib/libssl/tls13_handshake.c
index d324a7f4ba1..d739dc99e58 100644
--- a/lib/libssl/tls13_handshake.c
+++ b/lib/libssl/tls13_handshake.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_handshake.c,v 1.55 2020/05/02 00:30:55 inoguchi Exp $ */
+/* $OpenBSD: tls13_handshake.c,v 1.56 2020/05/09 08:39:44 jsing Exp $ */
/*
* Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org>
* Copyright (c) 2019 Joel Sing <jsing@openbsd.org>
@@ -309,13 +309,16 @@ tls13_handshake_perform(struct tls13_ctx *ctx)
if (ctx->alert)
return tls13_send_alert(ctx->rl, ctx->alert);
- if (action->sender == ctx->mode) {
- if ((ret = tls13_handshake_send_action(ctx, action)) <= 0)
- return ret;
- } else {
- if ((ret = tls13_handshake_recv_action(ctx, action)) <= 0)
- return ret;
- }
+ if (action->sender == ctx->mode)
+ ret = tls13_handshake_send_action(ctx, action);
+ else
+ ret = tls13_handshake_recv_action(ctx, action);
+
+ if (ctx->alert)
+ return tls13_send_alert(ctx->rl, ctx->alert);
+
+ if (ret <= 0)
+ return ret;
if (!tls13_handshake_advance_state_machine(ctx))
return TLS13_IO_FAILURE;
@@ -340,9 +343,6 @@ tls13_handshake_send_action(struct tls13_ctx *ctx,
return TLS13_IO_FAILURE;
if (!tls13_handshake_msg_finish(ctx->hs_msg))
return TLS13_IO_FAILURE;
-
- if (ctx->alert)
- return tls13_send_alert(ctx->rl, ctx->alert);
}
if ((ret = tls13_handshake_msg_send(ctx->hs_msg, ctx->rl)) <= 0)
@@ -424,9 +424,6 @@ tls13_handshake_recv_action(struct tls13_ctx *ctx,
}
}
- if (ctx->alert)
- ret = tls13_send_alert(ctx->rl, ctx->alert);
-
tls13_handshake_msg_free(ctx->hs_msg);
ctx->hs_msg = NULL;