Skip to content

Commit 296493a

Browse files
committed
f283 harden GeneratePrivateDh186
1 parent 178f96c commit 296493a

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

wolfcrypt/src/dh.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1157,8 +1157,9 @@ static int GeneratePrivateDh186(DhKey* key, WC_RNG* rng, byte* priv,
11571157
if (err == MP_OKAY)
11581158
err = mp_read_unsigned_bin(tmpX, cBuf, cSz);
11591159
if (err != MP_OKAY) {
1160-
mp_clear(tmpX);
1160+
mp_forcezero(tmpX);
11611161
mp_clear(tmpQ);
1162+
ForceZero(cBuf, cSz);
11621163
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
11631164
XFREE(cBuf, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
11641165
XFREE(tmpQ, key->heap, DYNAMIC_TYPE_DH);

0 commit comments

Comments
 (0)