diff options
author | jsing <> | 2019-02-14 18:06:11 +0000 |
---|---|---|
committer | jsing <> | 2019-02-14 18:06:11 +0000 |
commit | 73e18c3d9f407f18cd1094dce90bce00a3cd9d09 (patch) | |
tree | 6604c9c3f9df4b3784a5ad51de06cc839f12ee23 /src | |
parent | 9507004da76db0b4a0cef78dcdb9e35596e20f68 (diff) | |
download | openbsd-73e18c3d9f407f18cd1094dce90bce00a3cd9d09.tar.gz openbsd-73e18c3d9f407f18cd1094dce90bce00a3cd9d09.tar.bz2 openbsd-73e18c3d9f407f18cd1094dce90bce00a3cd9d09.zip |
Switch to application traffic keys as appropriate.
Switch the read traffic key to the server application traffic key once
the server finished message has been processed. Switch the write traffic
key to the client application traffic key after sending the client
finished message.
ok tb@
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/libssl/tls13_client.c | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/libssl/tls13_client.c b/src/lib/libssl/tls13_client.c index 5353b5a3c8..63dff31061 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.9 2019/02/14 17:55:31 jsing Exp $ */ | 1 | /* $OpenBSD: tls13_client.c,v 1.10 2019/02/14 18:06:11 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 | * |
@@ -622,6 +622,14 @@ tls13_server_finished_recv(struct tls13_ctx *ctx) | |||
622 | if (!tls13_derive_application_secrets(secrets, &context)) | 622 | if (!tls13_derive_application_secrets(secrets, &context)) |
623 | return TLS13_IO_FAILURE; | 623 | return TLS13_IO_FAILURE; |
624 | 624 | ||
625 | /* | ||
626 | * Any records following the server finished message must be encrypted | ||
627 | * using the server application traffic keys. | ||
628 | */ | ||
629 | if (!tls13_record_layer_set_read_traffic_key(ctx->rl, | ||
630 | &secrets->server_application_traffic)) | ||
631 | return TLS13_IO_FAILURE; | ||
632 | |||
625 | ret = 1; | 633 | ret = 1; |
626 | 634 | ||
627 | err: | 635 | err: |
@@ -679,6 +687,14 @@ tls13_client_finished_send(struct tls13_ctx *ctx) | |||
679 | if (!tls13_handshake_msg_finish(ctx->hs_msg)) | 687 | if (!tls13_handshake_msg_finish(ctx->hs_msg)) |
680 | goto err; | 688 | goto err; |
681 | 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 | return TLS13_IO_FAILURE; | ||
697 | |||
682 | ret = 1; | 698 | ret = 1; |
683 | 699 | ||
684 | err: | 700 | err: |