summaryrefslogtreecommitdiffstats
path: root/lib/libssl/tls13_client.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2021-03-29 16:46:09 +0000
committerjsing <jsing@openbsd.org>2021-03-29 16:46:09 +0000
commit268dad53d6e6176ac2f0893130b94dd69e18f3ef (patch)
treea65b7a541b765dc697a54c9e507a2c946601a81b /lib/libssl/tls13_client.c
parentAdd regress coverage for TLSv1.2 record number increment. (diff)
downloadwireguard-openbsd-268dad53d6e6176ac2f0893130b94dd69e18f3ef.tar.xz
wireguard-openbsd-268dad53d6e6176ac2f0893130b94dd69e18f3ef.zip
Move finished and peer finished to the handshake struct.
This moves the finish_md and peer_finish_md from the 'tmp' struct to the handshake struct, renaming to finished and peer_finished in the process. This also allows the remaining S3I(s) references to be removed from the TLSv1.3 client and server. ok inoguchi@ tb@
Diffstat (limited to 'lib/libssl/tls13_client.c')
-rw-r--r--lib/libssl/tls13_client.c14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/libssl/tls13_client.c b/lib/libssl/tls13_client.c
index 78bf15ec591..e0febee926d 100644
--- a/lib/libssl/tls13_client.c
+++ b/lib/libssl/tls13_client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls13_client.c,v 1.76 2021/03/24 18:44:00 jsing Exp $ */
+/* $OpenBSD: tls13_client.c,v 1.77 2021/03/29 16:46:09 jsing Exp $ */
/*
* Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
*
@@ -746,7 +746,6 @@ tls13_server_finished_recv(struct tls13_ctx *ctx, CBS *cbs)
uint8_t key[EVP_MAX_MD_SIZE];
HMAC_CTX *hmac_ctx = NULL;
unsigned int hlen;
- SSL *s = ctx->ssl;
int ret = 0;
/*
@@ -781,9 +780,9 @@ tls13_server_finished_recv(struct tls13_ctx *ctx, CBS *cbs)
goto err;
}
- if (!CBS_write_bytes(cbs, S3I(s)->tmp.peer_finish_md,
- sizeof(S3I(s)->tmp.peer_finish_md),
- &S3I(s)->tmp.peer_finish_md_len))
+ if (!CBS_write_bytes(cbs, ctx->hs->peer_finished,
+ sizeof(ctx->hs->peer_finished),
+ &ctx->hs->peer_finished_len))
goto err;
if (!CBS_skip(cbs, verify_data_len))
@@ -1032,7 +1031,6 @@ tls13_client_finished_send(struct tls13_ctx *ctx, CBB *cbb)
unsigned int hlen;
HMAC_CTX *hmac_ctx = NULL;
CBS cbs;
- SSL *s = ctx->ssl;
int ret = 0;
if (!tls13_secret_init(&finished_key, EVP_MD_size(ctx->hash)))
@@ -1064,8 +1062,8 @@ tls13_client_finished_send(struct tls13_ctx *ctx, CBB *cbb)
goto err;
CBS_init(&cbs, verify_data, verify_data_len);
- if (!CBS_write_bytes(&cbs, S3I(s)->tmp.finish_md,
- sizeof(S3I(s)->tmp.finish_md), &S3I(s)->tmp.finish_md_len))
+ if (!CBS_write_bytes(&cbs, ctx->hs->finished,
+ sizeof(ctx->hs->finished), &ctx->hs->finished_len))
goto err;
ret = 1;