From d64c0c309aec4e45f67a3019d550a0f652f3d080 Mon Sep 17 00:00:00 2001 From: John Safranek Date: Thu, 15 Jul 2021 10:00:02 -0700 Subject: [PATCH] DH Size Fix When creating the handshake info, initialize the size of the e and x values to their sizes. --- src/internal.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/internal.c b/src/internal.c index 18b9b37f..7c3384cd 100644 --- a/src/internal.c +++ b/src/internal.c @@ -437,6 +437,8 @@ static HandshakeInfo* HandshakeInfoNew(void* heap) newHs->macId = ID_NONE; newHs->blockSz = MIN_BLOCK_SZ; newHs->hashId = WC_HASH_TYPE_NONE; + newHs->eSz = sizeof newHs->e; + newHs->xSz = sizeof newHs->x; #ifndef WOLFSSH_NO_DH_GEX_SHA256 newHs->dhGexMinSz = WOLFSSH_DEFAULT_GEXDH_MIN; newHs->dhGexPreferredSz = WOLFSSH_DEFAULT_GEXDH_PREFERRED;