From 760f5d6b6b82767e0ce6e22a9e384161734bc2ea Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Thu, 11 Aug 2022 12:21:09 +0100 Subject: [PATCH] bignum_mod: Updated mbedtls_mpi_mod_modulus_setup/free with new fields At the current state, those fields are initialised to 0, NULL. Signed-off-by: Minos Galanakis --- library/bignum_mod.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/bignum_mod.c b/library/bignum_mod.c index f2c11a582..7cf1b012c 100644 --- a/library/bignum_mod.c +++ b/library/bignum_mod.c @@ -77,8 +77,8 @@ void mbedtls_mpi_mod_modulus_free( mbedtls_mpi_mod_modulus *m ) switch( m->int_rep ) { case MBEDTLS_MPI_MOD_REP_MONTGOMERY: - mbedtls_free( m->rep.mont ); - break; + m->rep.mont.rr = NULL; + m->rep.mont.mm = 0; break; case MBEDTLS_MPI_MOD_REP_OPT_RED: mbedtls_free( m->rep.ored ); break; @@ -120,8 +120,8 @@ int mbedtls_mpi_mod_modulus_setup( mbedtls_mpi_mod_modulus *m, { case MBEDTLS_MPI_MOD_REP_MONTGOMERY: m->int_rep = int_rep; - m->rep.mont = NULL; - break; + m->rep.mont.rr = NULL; + m->rep.mont.mm = 0; break; case MBEDTLS_MPI_MOD_REP_OPT_RED: m->int_rep = int_rep; m->rep.ored = NULL;