Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions wolfcrypt/src/dh.c
Original file line number Diff line number Diff line change
Expand Up @@ -1157,8 +1157,9 @@ static int GeneratePrivateDh186(DhKey* key, WC_RNG* rng, byte* priv,
if (err == MP_OKAY)
err = mp_read_unsigned_bin(tmpX, cBuf, cSz);
if (err != MP_OKAY) {
mp_clear(tmpX);
mp_forcezero(tmpX);
Comment thread
embhorn marked this conversation as resolved.
mp_clear(tmpQ);
ForceZero(cBuf, cSz);
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
XFREE(cBuf, key->heap, DYNAMIC_TYPE_TMP_BUFFER);
XFREE(tmpQ, key->heap, DYNAMIC_TYPE_DH);
Expand Down Expand Up @@ -2403,7 +2404,7 @@ int wc_DhImportKeyPair(DhKey* key, const byte* priv, word32 privSz,
}
if (havePriv) {
if (mp_read_unsigned_bin(&key->priv, priv, privSz) != MP_OKAY) {
mp_clear(&key->priv);
mp_forcezero(&key->priv);
havePriv = 0;
Comment thread
embhorn marked this conversation as resolved.
} else {
WOLFSSL_MSG("DH Private Key Set");
Expand Down