summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo Buehler <tb@cvs.openbsd.org>2021-03-21 19:08:23 +0000
committerTheo Buehler <tb@cvs.openbsd.org>2021-03-21 19:08:23 +0000
commit5b812255bdf7e6b38455c53fbd0a2b01dcc75777 (patch)
treedb34db5973a3fa4f2ff2aad2784723347f0e39f5
parentc0f14a226bd6b4ccf12813e7c110816e76c6616a (diff)
Fully initialize rrec in tls12_record_layer_open_record_protected
The CBC code path initializes rrec.padding_length in an indirect fashion and later makes use of it for copying the MAC. This is confusing some static analyzers as well as people investigating the whining. Avoid this confusion and add a bit of robustness by clearing the stack variable up front. ok jsing
-rw-r--r--lib/libssl/tls12_record_layer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libssl/tls12_record_layer.c b/lib/libssl/tls12_record_layer.c
index ee8552a9ca1..ba3c3dfb2bd 100644
--- a/lib/libssl/tls12_record_layer.c
+++ b/lib/libssl/tls12_record_layer.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tls12_record_layer.c,v 1.23 2021/03/02 17:26:25 jsing Exp $ */
+/* $OpenBSD: tls12_record_layer.c,v 1.24 2021/03/21 19:08:22 tb Exp $ */
/*
* Copyright (c) 2020 Joel Sing <jsing@openbsd.org>
*
@@ -922,6 +922,7 @@ tls12_record_layer_open_record_protected_cipher(struct tls12_record_layer *rl,
int ret = 0;
memset(&cbb_mac, 0, sizeof(cbb_mac));
+ memset(&rrec, 0, sizeof(rrec));
if (!tls12_record_protection_block_size(rl->read, &block_size))
goto err;