From d61dbd4df7deace80bd3e315f6547ba3f925c5c4 Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Tue, 17 Jan 2023 15:52:44 +0000 Subject: [PATCH] ecp_curves: Update `mbedtls_ecp_group_free()`. This patch updates the method to not free the `grp->P` and `grp->N` structure members. The contents of `P` and `N` are stored in static memory at `curve448_p/n` and `curve25519p/n` and no longer dynamically allocated. Signed-off-by: Minos Galanakis --- library/ecp.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/library/ecp.c b/library/ecp.c index d9d5425eda..08fbe86c73 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -582,11 +582,9 @@ void mbedtls_ecp_group_free(mbedtls_ecp_group *grp) } if (grp->h != 1) { - mbedtls_mpi_free(&grp->P); mbedtls_mpi_free(&grp->A); mbedtls_mpi_free(&grp->B); mbedtls_ecp_point_free(&grp->G); - mbedtls_mpi_free(&grp->N); } if (!ecp_group_is_static_comb_table(grp) && grp->T != NULL) {