Fix psa_pake_abort() order to correctly free memory when alg is PSA_ALG_JPAKE

Signed-off-by: Neil Armstrong <narmstrong@baylibre.com>
This commit is contained in:
Neil Armstrong 2022-06-10 08:54:53 +02:00
parent a24278a74a
commit fbc4b4aa8e

View File

@ -702,10 +702,6 @@ psa_status_t psa_pake_abort(psa_pake_operation_t * operation)
return( PSA_SUCCESS );
}
operation->alg = 0;
operation->state = 0;
operation->sequence = 0;
#if defined(MBEDTLS_PSA_BUILTIN_ALG_ECJPAKE)
if( operation->alg == PSA_ALG_JPAKE )
{
@ -721,6 +717,10 @@ psa_status_t psa_pake_abort(psa_pake_operation_t * operation)
}
#endif
operation->alg = 0;
operation->state = 0;
operation->sequence = 0;
return( PSA_SUCCESS );
}