Fix minor issues raised in PR review
1. Style issues fixes - remove redundant spacing.
2. Remove depency of `MBEDTLS_RSA_C` in `pk_parse_public_keyfile_rsa()`
tests, as the function itself is dependent on it.
diff --git a/library/pkparse.c b/library/pkparse.c
index 41eeadf..cccc0b5 100644
--- a/library/pkparse.c
+++ b/library/pkparse.c
@@ -1325,16 +1325,16 @@
if( ( ret = mbedtls_pk_setup( ctx, pk_info ) ) != 0 )
return( ret );
- p = (unsigned char *) key;
+ p = (unsigned char *)key;
ret = pk_get_rsapubkey( &p, p + keylen, mbedtls_pk_rsa( *ctx ) );
- if ( ret == 0 )
+ if( ret == 0 )
{
return( ret );
}
mbedtls_pk_free( ctx );
- if ( ret != ( MBEDTLS_ERR_PK_INVALID_PUBKEY + MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) )
+ if( ret != ( MBEDTLS_ERR_PK_INVALID_PUBKEY + MBEDTLS_ERR_ASN1_UNEXPECTED_TAG ) )
{
- return ( ret );
+ return( ret );
}
#endif /* MBEDTLS_RSA_C */
p = (unsigned char *) key;
diff --git a/tests/suites/test_suite_pkparse.data b/tests/suites/test_suite_pkparse.data
index 3295726..e9f65c9 100644
--- a/tests/suites/test_suite_pkparse.data
+++ b/tests/suites/test_suite_pkparse.data
@@ -110,11 +110,10 @@
pk_parse_public_keyfile_rsa:"data_files/rsa_pkcs8_2048_public.der":0
Parse Public RSA Key #3 (PKCS#1 wrapped)
-depends_on:MBEDTLS_RSA_C:MBEDTLS_PEM_PARSE_C
+depends_on:MBEDTLS_PEM_PARSE_C
pk_parse_public_keyfile_rsa:"data_files/rsa_pkcs1_2048_public.pem":0
Parse Public RSA Key #4 (PKCS#1 wrapped, DER)
-depends_on:MBEDTLS_RSA_C
pk_parse_public_keyfile_rsa:"data_files/rsa_pkcs1_2048_public.der":0
Parse Public EC Key #1 (RFC 5480, DER)