From 31f0ef7b19fe4670a78eb1412b5d2e38a095aead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Wed, 17 May 2017 10:05:58 +0200 Subject: [PATCH] Fix style issues introduced earlier --- library/ecdsa.c | 3 ++- library/ecp.c | 9 ++++++--- library/pk_wrap.c | 6 ++++-- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/library/ecdsa.c b/library/ecdsa.c index 673076275..8d1f9d632 100644 --- a/library/ecdsa.c +++ b/library/ecdsa.c @@ -189,7 +189,8 @@ static void ecdsa_restart_det_free( mbedtls_ecdsa_restart_det_ctx *ctx ) #define ECDSA_RS_LEAVE( SUB ) do { \ /* 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 ); \ mbedtls_free( rs_ctx->SUB ); \ rs_ctx->SUB = NULL; \ diff --git a/library/ecp.c b/library/ecp.c index 9b586eebe..74a19eecb 100644 --- a/library/ecp.c +++ b/library/ecp.c @@ -147,7 +147,8 @@ static void ecp_restart_mul_free( mbedtls_ecp_restart_mul_ctx *ctx ) mbedtls_ecp_point_free( &ctx->R ); - if( ctx->T != NULL ) { + if( ctx->T != NULL ) + { for( i = 0; i < ctx->T_size; i++ ) mbedtls_ecp_point_free( ctx->T + i ); mbedtls_free( ctx->T ); @@ -1907,7 +1908,8 @@ cleanup: /* clear our sub-context when not in progress (done or error) */ #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 ); mbedtls_free( rs_ctx->rsm ); rs_ctx->rsm = NULL; @@ -2392,7 +2394,8 @@ cleanup: #if defined(MBEDTLS_ECP_RESTARTABLE) /* 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 ); mbedtls_free( rs_ctx->ma ); rs_ctx->ma = NULL; diff --git a/library/pk_wrap.c b/library/pk_wrap.c index d3933a0f1..8b94d8129 100644 --- a/library/pk_wrap.c +++ b/library/pk_wrap.c @@ -307,7 +307,8 @@ static int eckey_verify_rs_wrap( void *ctx, mbedtls_md_type_t md_alg, cleanup: /* 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_free( rs_ctx->ecdsa ); rs_ctx->ecdsa = NULL; @@ -357,7 +358,8 @@ static int eckey_sign_rs_wrap( void *ctx, mbedtls_md_type_t md_alg, cleanup: /* 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_free( rs_ctx->ecdsa ); rs_ctx->ecdsa = NULL;