Remove extra spacings
Signed-off-by: Tuvshinzaya Erdenekhuu <tuvshinzaya.erdenekhuu@arm.com>
diff --git a/library/pk.c b/library/pk.c
index 98ba675..8dc19ef 100644
--- a/library/pk.c
+++ b/library/pk.c
@@ -46,13 +46,11 @@
#include <limits.h>
#include <stdint.h>
-
/*
* Initialise a mbedtls_pk_context
*/
void mbedtls_pk_init( mbedtls_pk_context *ctx )
{
-
ctx->pk_info = NULL;
ctx->pk_ctx = NULL;
}
@@ -395,8 +393,7 @@
const unsigned char *sig, size_t sig_len,
mbedtls_pk_restart_ctx *rs_ctx )
{
- if( ( md_alg != MBEDTLS_MD_NONE || hash_len != 0 ) &&
- hash == NULL )
+ if( ( md_alg != MBEDTLS_MD_NONE || hash_len != 0 ) && hash == NULL )
return MBEDTLS_ERR_PK_BAD_INPUT_DATA;
if( ctx->pk_info == NULL ||
@@ -452,8 +449,7 @@
const unsigned char *hash, size_t hash_len,
const unsigned char *sig, size_t sig_len )
{
- if( ( md_alg != MBEDTLS_MD_NONE || hash_len != 0 ) &&
- hash == NULL )
+ if( ( md_alg != MBEDTLS_MD_NONE || hash_len != 0 ) && hash == NULL )
return MBEDTLS_ERR_PK_BAD_INPUT_DATA;
if( ctx->pk_info == NULL )
@@ -577,12 +573,10 @@
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng,
mbedtls_pk_restart_ctx *rs_ctx )
{
- if( ( md_alg != MBEDTLS_MD_NONE || hash_len != 0 ) &&
- hash == NULL )
+ if( ( md_alg != MBEDTLS_MD_NONE || hash_len != 0 ) && hash == NULL )
return MBEDTLS_ERR_PK_BAD_INPUT_DATA;
- if( ctx->pk_info == NULL ||
- pk_hashlen_helper( md_alg, &hash_len ) != 0 )
+ if( ctx->pk_info == NULL || pk_hashlen_helper( md_alg, &hash_len ) != 0 )
return( MBEDTLS_ERR_PK_BAD_INPUT_DATA );
#if defined(MBEDTLS_ECDSA_C) && defined(MBEDTLS_ECP_RESTARTABLE)
@@ -695,7 +689,6 @@
unsigned char *output, size_t *olen, size_t osize,
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng )
{
-
if( ctx->pk_info == NULL )
return( MBEDTLS_ERR_PK_BAD_INPUT_DATA );
@@ -714,7 +707,6 @@
unsigned char *output, size_t *olen, size_t osize,
int (*f_rng)(void *, unsigned char *, size_t), void *p_rng )
{
-
if( ctx->pk_info == NULL )
return( MBEDTLS_ERR_PK_BAD_INPUT_DATA );
@@ -733,7 +725,6 @@
int (*f_rng)(void *, unsigned char *, size_t),
void *p_rng )
{
-
if( pub->pk_info == NULL ||
prv->pk_info == NULL )
{
diff --git a/library/pkparse.c b/library/pkparse.c
index 9194040..2a9a558 100644
--- a/library/pkparse.c
+++ b/library/pkparse.c
@@ -56,7 +56,6 @@
#define mbedtls_free free
#endif
-
#if defined(MBEDTLS_FS_IO)
/*
* Load all data from a file into a given buffer.
@@ -70,7 +69,6 @@
FILE *f;
long size;
-
if( ( f = fopen( path, "rb" ) ) == NULL )
return( MBEDTLS_ERR_PK_FILE_IO_ERROR );
@@ -125,7 +123,6 @@
size_t n;
unsigned char *buf;
-
if( ( ret = mbedtls_pk_load_file( path, &buf, &n ) ) != 0 )
return( ret );
@@ -150,7 +147,6 @@
size_t n;
unsigned char *buf;
-
if( ( ret = mbedtls_pk_load_file( path, &buf, &n ) ) != 0 )
return( ret );
@@ -608,7 +604,6 @@
mbedtls_pk_type_t pk_alg = MBEDTLS_PK_NONE;
const mbedtls_pk_info_t *pk_info;
-
if( ( ret = mbedtls_asn1_get_tag( p, end, &len,
MBEDTLS_ASN1_CONSTRUCTED | MBEDTLS_ASN1_SEQUENCE ) ) != 0 )
{
diff --git a/library/pkwrite.c b/library/pkwrite.c
index 17343c2..4d87b07 100644
--- a/library/pkwrite.c
+++ b/library/pkwrite.c
@@ -59,7 +59,6 @@
#define mbedtls_free free
#endif
-
#if defined(MBEDTLS_RSA_C)
/*
* RSAPublicKey ::= SEQUENCE {
@@ -177,7 +176,6 @@
int ret = MBEDTLS_ERR_ERROR_CORRUPTION_DETECTED;
size_t len = 0;
-
#if defined(MBEDTLS_RSA_C)
if( mbedtls_pk_get_type( key ) == MBEDTLS_PK_RSA )
MBEDTLS_ASN1_CHK_ADD( len, pk_write_rsa_pubkey( p, start, mbedtls_pk_rsa( *key ) ) );
@@ -487,7 +485,6 @@
unsigned char output_buf[PUB_DER_MAX_BYTES];
size_t olen = 0;
-
if( ( ret = mbedtls_pk_write_pubkey_der( key, output_buf,
sizeof(output_buf) ) ) < 0 )
{
@@ -511,7 +508,6 @@
const char *begin, *end;
size_t olen = 0;
-
if( ( ret = mbedtls_pk_write_key_der( key, output_buf, sizeof(output_buf) ) ) < 0 )
return( ret );