mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2026-07-05 15:30:49 +02:00
fixes for
F-2554 Missing wc_ecc_free Before free in km_ecdh_init When wc_ecc_set_rng Fails F-2555 Missing wc_FreeDhKey Before free in km_ffdhe_init When wc_DhSetNamedKey Fails
This commit is contained in:
@@ -779,6 +779,7 @@ static int km_ffdhe_init(struct crypto_kpp *tfm, int name, word32 nbits)
|
||||
pr_err("%s: wc_DhSetNamedKey returned: %d\n", WOLFKM_DH_DRIVER,
|
||||
err);
|
||||
#endif /* WOLFKM_DEBUG_DH */
|
||||
wc_FreeDhKey(ctx->key);
|
||||
free(ctx->key);
|
||||
ctx->key = NULL;
|
||||
return -ENOMEM;
|
||||
|
||||
@@ -415,6 +415,7 @@ static int km_ecdh_init(struct crypto_kpp *tfm, int curve_id)
|
||||
#ifdef ECC_TIMING_RESISTANT
|
||||
ret = wc_ecc_set_rng(ctx->key, &ctx->rng);
|
||||
if (ret < 0) {
|
||||
wc_ecc_free(ctx->key);
|
||||
free(ctx->key);
|
||||
ctx->key = NULL;
|
||||
return -ENOMEM;
|
||||
|
||||
Reference in New Issue
Block a user