From 0db49ef83a32ee4ef40fc006e07453168b23a110 Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Wed, 14 Jun 2023 10:12:04 +1000 Subject: [PATCH] ECC, ALT_ECC_SIZE, CryptoCB: ensure err is 0 in _ecc_make_key_ex When CryptoCB is used and the key gen operation is not implemented, err is CRYPTOCB_UNAVAILABLE and needs to be reset to 0. --- wolfcrypt/src/ecc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/wolfcrypt/src/ecc.c b/wolfcrypt/src/ecc.c index 7bee4b16d6..a837986ad6 100644 --- a/wolfcrypt/src/ecc.c +++ b/wolfcrypt/src/ecc.c @@ -5612,6 +5612,7 @@ static int _ecc_make_key_ex(WC_RNG* rng, int keysize, ecc_key* key, #ifndef ALT_ECC_SIZE err = mp_init(key->k); #else + err = 0; key->k = (mp_int*)key->ka; alt_fp_init(key->k); #endif