From 7e1d01d5a6ced7d28ff98425050886b037b07c9f Mon Sep 17 00:00:00 2001 From: jsing <> Date: Fri, 3 Sep 2021 13:16:54 +0000 Subject: Set message_size correctly when switching to the legacy stack. The message_size variable is not actually the handshake message size, rather the number of bytes contained within the handshake message, hence we have to subtract the length of the handshake message header. ok beck@ --- src/lib/libssl/tls13_legacy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/lib') diff --git a/src/lib/libssl/tls13_legacy.c b/src/lib/libssl/tls13_legacy.c index 0360f8159c..477d09d63e 100644 --- a/src/lib/libssl/tls13_legacy.c +++ b/src/lib/libssl/tls13_legacy.c @@ -1,4 +1,4 @@ -/* $OpenBSD: tls13_legacy.c,v 1.27 2021/08/30 16:50:23 tb Exp $ */ +/* $OpenBSD: tls13_legacy.c,v 1.28 2021/09/03 13:16:54 jsing Exp $ */ /* * Copyright (c) 2018, 2019 Joel Sing * @@ -340,7 +340,7 @@ tls13_use_legacy_stack(struct tls13_ctx *ctx) S3I(s)->hs.tls12.reuse_message = 1; S3I(s)->hs.tls12.message_type = tls13_handshake_msg_type(ctx->hs_msg); - S3I(s)->hs.tls12.message_size = CBS_len(&cbs); + S3I(s)->hs.tls12.message_size = CBS_len(&cbs) - SSL3_HM_HEADER_LENGTH; return 1; -- cgit v1.2.3-55-g6feb