Fix style issues introduced earlier

This commit is contained in:
Manuel Pégourié-Gonnard 2017-05-17 10:05:58 +02:00
parent 1f596064bc
commit 31f0ef7b19
3 changed files with 12 additions and 6 deletions

View File

@ -189,7 +189,8 @@ static void ecdsa_restart_det_free( mbedtls_ecdsa_restart_det_ctx *ctx )
#define ECDSA_RS_LEAVE( SUB ) do { \ #define ECDSA_RS_LEAVE( SUB ) do { \
/* clear our sub-context when not in progress (done or error) */ \ /* clear our sub-context when not in progress (done or error) */ \
if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS ) { \ if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS ) \
{ \
ecdsa_restart_## SUB ##_free( rs_ctx->SUB ); \ ecdsa_restart_## SUB ##_free( rs_ctx->SUB ); \
mbedtls_free( rs_ctx->SUB ); \ mbedtls_free( rs_ctx->SUB ); \
rs_ctx->SUB = NULL; \ rs_ctx->SUB = NULL; \

View File

@ -147,7 +147,8 @@ static void ecp_restart_mul_free( mbedtls_ecp_restart_mul_ctx *ctx )
mbedtls_ecp_point_free( &ctx->R ); mbedtls_ecp_point_free( &ctx->R );
if( ctx->T != NULL ) { if( ctx->T != NULL )
{
for( i = 0; i < ctx->T_size; i++ ) for( i = 0; i < ctx->T_size; i++ )
mbedtls_ecp_point_free( ctx->T + i ); mbedtls_ecp_point_free( ctx->T + i );
mbedtls_free( ctx->T ); mbedtls_free( ctx->T );
@ -1907,7 +1908,8 @@ cleanup:
/* clear our sub-context when not in progress (done or error) */ /* clear our sub-context when not in progress (done or error) */
#if defined(MBEDTLS_ECP_RESTARTABLE) #if defined(MBEDTLS_ECP_RESTARTABLE)
if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS ) { if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS )
{
ecp_restart_mul_free( rs_ctx->rsm ); ecp_restart_mul_free( rs_ctx->rsm );
mbedtls_free( rs_ctx->rsm ); mbedtls_free( rs_ctx->rsm );
rs_ctx->rsm = NULL; rs_ctx->rsm = NULL;
@ -2392,7 +2394,8 @@ cleanup:
#if defined(MBEDTLS_ECP_RESTARTABLE) #if defined(MBEDTLS_ECP_RESTARTABLE)
/* clear our sub-context when not in progress (done or error) */ /* clear our sub-context when not in progress (done or error) */
if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS ) { if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS )
{
ecp_restart_muladd_free( rs_ctx->ma ); ecp_restart_muladd_free( rs_ctx->ma );
mbedtls_free( rs_ctx->ma ); mbedtls_free( rs_ctx->ma );
rs_ctx->ma = NULL; rs_ctx->ma = NULL;

View File

@ -307,7 +307,8 @@ static int eckey_verify_rs_wrap( void *ctx, mbedtls_md_type_t md_alg,
cleanup: cleanup:
/* clear our sub-context when not in progress (done or error) */ /* clear our sub-context when not in progress (done or error) */
if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS ) { if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS )
{
mbedtls_ecdsa_free( rs_ctx->ecdsa ); mbedtls_ecdsa_free( rs_ctx->ecdsa );
mbedtls_free( rs_ctx->ecdsa ); mbedtls_free( rs_ctx->ecdsa );
rs_ctx->ecdsa = NULL; rs_ctx->ecdsa = NULL;
@ -357,7 +358,8 @@ static int eckey_sign_rs_wrap( void *ctx, mbedtls_md_type_t md_alg,
cleanup: cleanup:
/* clear our sub-context when not in progress (done or error) */ /* clear our sub-context when not in progress (done or error) */
if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS ) { if( rs_ctx != NULL && ret != MBEDTLS_ERR_ECP_IN_PROGRESS )
{
mbedtls_ecdsa_free( rs_ctx->ecdsa ); mbedtls_ecdsa_free( rs_ctx->ecdsa );
mbedtls_free( rs_ctx->ecdsa ); mbedtls_free( rs_ctx->ecdsa );
rs_ctx->ecdsa = NULL; rs_ctx->ecdsa = NULL;