We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 396b5ec + 355081b commit 031c874Copy full SHA for 031c874
wolfcrypt/src/dsa.c
@@ -85,10 +85,7 @@ void wc_FreeDsaKey(DsaKey* key)
85
if (key == NULL)
86
return;
87
88
- if (key->type == DSA_PRIVATE)
89
- mp_forcezero(&key->x);
90
-
91
- mp_clear(&key->x);
+ mp_forcezero(&key->x);
92
mp_clear(&key->y);
93
mp_clear(&key->g);
94
mp_clear(&key->q);
@@ -227,10 +224,11 @@ int wc_MakeDsaKey(WC_RNG *rng, DsaKey *dsa)
227
224
dsa->type = DSA_PRIVATE;
228
225
229
226
if (err != MP_OKAY) {
230
- mp_clear(&dsa->x);
+ mp_forcezero(&dsa->x);
231
mp_clear(&dsa->y);
232
}
233
+ ForceZero(cBuf, (word32)cSz);
234
#if defined(WOLFSSL_SMALL_STACK) && !defined(WOLFSSL_NO_MALLOC)
235
XFREE(cBuf, dsa->heap, DYNAMIC_TYPE_TMP_BUFFER);
236
if (tmpQ != NULL) {
0 commit comments