summaryrefslogtreecommitdiffstats
path: root/lib/libssl/tls13_handshake.c
diff options
context:
space:
mode:
authorjsing <jsing@openbsd.org>2021-03-21 18:36:34 +0000
committerjsing <jsing@openbsd.org>2021-03-21 18:36:34 +0000
commitd4edc922de00e0977a67ceb1c4b74ab035533c7e (patch)
tree3197dd6f6f75325215a27d268f794d3633bf34ac /lib/libssl/tls13_handshake.c
parentUse new terminology of RFC 8981 and (mechanically) replace "privacy" (diff)
downloadwireguard-openbsd-d4edc922de00e0977a67ceb1c4b74ab035533c7e.tar.xz
wireguard-openbsd-d4edc922de00e0977a67ceb1c4b74ab035533c7e.zip
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@
Diffstat (limited to 'lib/libssl/tls13_handshake.c')
-rw-r--r--lib/libssl/tls13_handshake.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/libssl/tls13_handshake.c b/lib/libssl/tls13_handshake.c
index b3cecc77efd..c18a2dfe062 100644
--- a/lib/libssl/tls13_handshake.c
+++ b/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 <tb@openbsd.org>
* Copyright (c) 2019 Joel Sing <jsing@openbsd.org>
@@ -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;
}