summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_client.c
diff options
context:
space:
mode:
authorjsing <>2019-02-25 16:46:17 +0000
committerjsing <>2019-02-25 16:46:17 +0000
commit395120b4a264fb5eaadb4e8296f4d6bec2216b6b (patch)
treecebaae5d5b5ab740d82c2b521bc74611d3160eb0 /src/lib/libssl/tls13_client.c
parent320d76ea5cdfa7ca71accff1e8bbc5ee3bf1ac34 (diff)
downloadopenbsd-395120b4a264fb5eaadb4e8296f4d6bec2216b6b.tar.gz
openbsd-395120b4a264fb5eaadb4e8296f4d6bec2216b6b.tar.bz2
openbsd-395120b4a264fb5eaadb4e8296f4d6bec2216b6b.zip
Add a handshake action sent handler and use it for client finished.
The write traffic key needs to be changed to the client application traffic key after the client finished message has been sent. The send handler generates the client finished message, however we cannot switch keys at this stage since the client finished message has not yet been protected by the record layer. ok tb@
Diffstat (limited to 'src/lib/libssl/tls13_client.c')
-rw-r--r--src/lib/libssl/tls13_client.c23
1 files changed, 14 insertions, 9 deletions
diff --git a/src/lib/libssl/tls13_client.c b/src/lib/libssl/tls13_client.c
index 5071507bbd..728d1a00c8 100644
--- a/src/lib/libssl/tls13_client.c
+++ b/src/lib/libssl/tls13_client.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: tls13_client.c,v 1.11 2019/02/25 16:39:14 jsing Exp $ */ 1/* $OpenBSD: tls13_client.c,v 1.12 2019/02/25 16:46:17 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -687,14 +687,6 @@ tls13_client_finished_send(struct tls13_ctx *ctx)
687 if (!tls13_handshake_msg_finish(ctx->hs_msg)) 687 if (!tls13_handshake_msg_finish(ctx->hs_msg))
688 goto err; 688 goto err;
689 689
690 /*
691 * Any records following the client finished message must be encrypted
692 * using the client application traffic keys.
693 */
694 if (!tls13_record_layer_set_write_traffic_key(ctx->rl,
695 &secrets->client_application_traffic))
696 goto err;
697
698 ret = 1; 690 ret = 1;
699 691
700 err: 692 err:
@@ -702,3 +694,16 @@ tls13_client_finished_send(struct tls13_ctx *ctx)
702 694
703 return ret; 695 return ret;
704} 696}
697
698int
699tls13_client_finished_sent(struct tls13_ctx *ctx)
700{
701 struct tls13_secrets *secrets = ctx->hs->secrets;
702
703 /*
704 * Any records following the client finished message must be encrypted
705 * using the client application traffic keys.
706 */
707 return tls13_record_layer_set_write_traffic_key(ctx->rl,
708 &secrets->client_application_traffic);
709}