summaryrefslogtreecommitdiff
path: root/src/lib/libssl/tls13_legacy.c
diff options
context:
space:
mode:
authorjsing <>2021-09-03 13:16:54 +0000
committerjsing <>2021-09-03 13:16:54 +0000
commit2efb240aaf5057757a506aaf2a1a893292848122 (patch)
tree3d92f7fe42d0aeae31b8430dfa3a4b7eb899fc74 /src/lib/libssl/tls13_legacy.c
parentc49f54bd21b91f7bf439543ffad1572e290083d4 (diff)
downloadopenbsd-2efb240aaf5057757a506aaf2a1a893292848122.tar.gz
openbsd-2efb240aaf5057757a506aaf2a1a893292848122.tar.bz2
openbsd-2efb240aaf5057757a506aaf2a1a893292848122.zip
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@
Diffstat (limited to 'src/lib/libssl/tls13_legacy.c')
-rw-r--r--src/lib/libssl/tls13_legacy.c4
1 files changed, 2 insertions, 2 deletions
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 @@
1/* $OpenBSD: tls13_legacy.c,v 1.27 2021/08/30 16:50:23 tb Exp $ */ 1/* $OpenBSD: tls13_legacy.c,v 1.28 2021/09/03 13:16:54 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org> 3 * Copyright (c) 2018, 2019 Joel Sing <jsing@openbsd.org>
4 * 4 *
@@ -340,7 +340,7 @@ tls13_use_legacy_stack(struct tls13_ctx *ctx)
340 340
341 S3I(s)->hs.tls12.reuse_message = 1; 341 S3I(s)->hs.tls12.reuse_message = 1;
342 S3I(s)->hs.tls12.message_type = tls13_handshake_msg_type(ctx->hs_msg); 342 S3I(s)->hs.tls12.message_type = tls13_handshake_msg_type(ctx->hs_msg);
343 S3I(s)->hs.tls12.message_size = CBS_len(&cbs); 343 S3I(s)->hs.tls12.message_size = CBS_len(&cbs) - SSL3_HM_HEADER_LENGTH;
344 344
345 return 1; 345 return 1;
346 346