From b4267956efe26acca04e81248b224852ab3b48df Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sun, 21 Mar 2021 18:36:34 +0000 Subject: Move the TLSv1.3 handshake struct inside the shared handshake struct. There are currently three different handshake structs that are in use - the SSL_HANDSHAKE struct (as S3I(s)->hs), the SSL_HANDSHAKE_TLS13 struct (as S3I(s)->hs_tls13 or ctx->hs in the TLSv1.3 code) and the infamous 'tmp' embedded in SSL3_STATE_INTERNAL (as S3I(s)->tmp)). This is the first step towards cleaning up the handshake structs so that shared data is in the SSL_HANDSHAKE struct, with sub-structs for TLSv1.2 and TLSv1.3 specific information. Place SSL_HANDSHAKE_TLS13 inside SSL_HANDSHAKE and change ctx->hs to refer to the SSL_HANDSHAKE struct instead of the SSL_HANDSHAKE_TLS13 struct. This allows the TLSv1.3 code to access the shared handshake data without needing the SSL struct. ok inoguchi@ tb@ --- src/lib/libssl/tls13_handshake.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'src/lib/libssl/tls13_handshake.c') diff --git a/src/lib/libssl/tls13_handshake.c b/src/lib/libssl/tls13_handshake.c index b3cecc77ef..c18a2dfe06 100644 --- a/src/lib/libssl/tls13_handshake.c +++ b/src/lib/libssl/tls13_handshake.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_handshake.c,v 1.64 2020/07/30 16:23:17 tb Exp $ */ +/* $OpenBSD: tls13_handshake.c,v 1.65 2021/03/21 18:36:34 jsing Exp $ */ /* * Copyright (c) 2018-2019 Theo Buehler * Copyright (c) 2019 Joel Sing @@ -428,8 +428,9 @@ tls13_handshake_send_action(struct tls13_ctx *ctx, if (action->send_preserve_transcript_hash) { if (!tls1_transcript_hash_value(ctx->ssl, - ctx->hs->transcript_hash, sizeof(ctx->hs->transcript_hash), - &ctx->hs->transcript_hash_len)) + ctx->hs->tls13.transcript_hash, + sizeof(ctx->hs->tls13.transcript_hash), + &ctx->hs->tls13.transcript_hash_len)) return TLS13_IO_FAILURE; } @@ -471,8 +472,9 @@ tls13_handshake_recv_action(struct tls13_ctx *ctx, if (action->recv_preserve_transcript_hash) { if (!tls1_transcript_hash_value(ctx->ssl, - ctx->hs->transcript_hash, sizeof(ctx->hs->transcript_hash), - &ctx->hs->transcript_hash_len)) + ctx->hs->tls13.transcript_hash, + sizeof(ctx->hs->tls13.transcript_hash), + &ctx->hs->tls13.transcript_hash_len)) return TLS13_IO_FAILURE; } -- cgit v1.2.3-55-g6feb