diff options
author | jsing <> | 2021-03-21 18:36:34 +0000 |
---|---|---|
committer | jsing <> | 2021-03-21 18:36:34 +0000 |
commit | b4267956efe26acca04e81248b224852ab3b48df (patch) | |
tree | 04368005066ac217cbc5ba4c6633356e81eb6d00 /src/lib/libssl/tls13_handshake.c | |
parent | 25064bbd608cffa42b7bf46d3ea7eeb88d693de4 (diff) | |
download | openbsd-b4267956efe26acca04e81248b224852ab3b48df.tar.gz openbsd-b4267956efe26acca04e81248b224852ab3b48df.tar.bz2 openbsd-b4267956efe26acca04e81248b224852ab3b48df.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 'src/lib/libssl/tls13_handshake.c')
-rw-r--r-- | src/lib/libssl/tls13_handshake.c | 12 |
1 files changed, 7 insertions, 5 deletions
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 @@ | |||
1 | /* $OpenBSD: tls13_handshake.c,v 1.64 2020/07/30 16:23:17 tb Exp $ */ | 1 | /* $OpenBSD: tls13_handshake.c,v 1.65 2021/03/21 18:36:34 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2018-2019 Theo Buehler <tb@openbsd.org> |
4 | * Copyright (c) 2019 Joel Sing <jsing@openbsd.org> | 4 | * Copyright (c) 2019 Joel Sing <jsing@openbsd.org> |
@@ -428,8 +428,9 @@ tls13_handshake_send_action(struct tls13_ctx *ctx, | |||
428 | 428 | ||
429 | if (action->send_preserve_transcript_hash) { | 429 | if (action->send_preserve_transcript_hash) { |
430 | if (!tls1_transcript_hash_value(ctx->ssl, | 430 | if (!tls1_transcript_hash_value(ctx->ssl, |
431 | ctx->hs->transcript_hash, sizeof(ctx->hs->transcript_hash), | 431 | ctx->hs->tls13.transcript_hash, |
432 | &ctx->hs->transcript_hash_len)) | 432 | sizeof(ctx->hs->tls13.transcript_hash), |
433 | &ctx->hs->tls13.transcript_hash_len)) | ||
433 | return TLS13_IO_FAILURE; | 434 | return TLS13_IO_FAILURE; |
434 | } | 435 | } |
435 | 436 | ||
@@ -471,8 +472,9 @@ tls13_handshake_recv_action(struct tls13_ctx *ctx, | |||
471 | 472 | ||
472 | if (action->recv_preserve_transcript_hash) { | 473 | if (action->recv_preserve_transcript_hash) { |
473 | if (!tls1_transcript_hash_value(ctx->ssl, | 474 | if (!tls1_transcript_hash_value(ctx->ssl, |
474 | ctx->hs->transcript_hash, sizeof(ctx->hs->transcript_hash), | 475 | ctx->hs->tls13.transcript_hash, |
475 | &ctx->hs->transcript_hash_len)) | 476 | sizeof(ctx->hs->tls13.transcript_hash), |
477 | &ctx->hs->tls13.transcript_hash_len)) | ||
476 | return TLS13_IO_FAILURE; | 478 | return TLS13_IO_FAILURE; |
477 | } | 479 | } |
478 | 480 | ||