mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 02:37:28 +02:00
Merge pull request #6581 from kareem-wolfssl/eccNullKCheck
Fixed crash in wc_ecc_free.
This commit is contained in:
@ -7654,7 +7654,10 @@ int wc_ecc_free(ecc_key* key)
|
||||
mp_clear(key->pubkey.y);
|
||||
mp_clear(key->pubkey.z);
|
||||
|
||||
mp_forcezero(key->k);
|
||||
#ifdef ALT_ECC_SIZE
|
||||
if (key->k)
|
||||
#endif
|
||||
mp_forcezero(key->k);
|
||||
|
||||
#ifdef WOLFSSL_CUSTOM_CURVES
|
||||
if (key->deallocSet && key->dp != NULL)
|
||||
|
@ -4398,6 +4398,9 @@ void fp_clear(fp_int *a)
|
||||
|
||||
void fp_forcezero (mp_int * a)
|
||||
{
|
||||
if (a == NULL)
|
||||
return;
|
||||
|
||||
int size;
|
||||
a->used = 0;
|
||||
a->sign = FP_ZPOS;
|
||||
|
Reference in New Issue
Block a user