From ffd3a25f2822ad41040600e98da045f9f9ca96dd Mon Sep 17 00:00:00 2001 From: jsing <> Date: Mon, 29 Mar 2021 16:46:09 +0000 Subject: 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@ --- src/lib/libssl/tls13_server.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src/lib/libssl/tls13_server.c') diff --git a/src/lib/libssl/tls13_server.c b/src/lib/libssl/tls13_server.c index bac9623a15..4fed1a43d0 100644 --- a/src/lib/libssl/tls13_server.c +++ b/src/lib/libssl/tls13_server.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_server.c,v 1.73 2021/03/24 18:44:00 jsing Exp $ */ +/* $OpenBSD: tls13_server.c,v 1.74 2021/03/29 16:46:09 jsing Exp $ */ /* * Copyright (c) 2019, 2020 Joel Sing * Copyright (c) 2020 Bob Beck @@ -783,7 +783,6 @@ tls13_server_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))) @@ -815,8 +814,8 @@ tls13_server_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; @@ -1050,7 +1049,6 @@ tls13_client_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; /* @@ -1085,9 +1083,9 @@ tls13_client_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)) -- cgit v1.2.3-55-g6feb