aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2020-08-27 00:30:06 +0200
committerToni Uhlig <matzeton@googlemail.com>2020-08-27 16:30:05 +0200
commite998fc28d12d5094f509d3168ac59cae91602173 (patch)
treeae6d857363df83b17ab04986cc8a00f8e6f1a292
parent5b27dfdd0ca498869f0a59926c7b2c874a45abd4 (diff)
Fixed use-of-uninitialized-value in QUIC clho decryption probably caused by a BUG in libgcrypt (not verified).
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
-rw-r--r--src/lib/protocols/quic.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/protocols/quic.c b/src/lib/protocols/quic.c
index d40b4219b..905a93543 100644
--- a/src/lib/protocols/quic.c
+++ b/src/lib/protocols/quic.c
@@ -286,7 +286,9 @@ static gcry_error_t hkdf_expand(int hashalgo, const uint8_t *prk, uint32_t prk_l
gcry_md_write(h, lastoutput, hash_len); /* T(1..N) */
}
gcry_md_write(h, info, info_len); /* info */
- gcry_md_putc(h, (uint8_t) (offset / hash_len + 1)); /* constant 0x01..N */
+
+ uint8_t c = offset / hash_len + 1;
+ gcry_md_write(h, &c, sizeof(c)); /* constant 0x01..N */
memcpy(lastoutput, gcry_md_read(h, hashalgo), hash_len);
memcpy(out + offset, lastoutput, MIN(hash_len, out_len - offset));