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.
This commit is contained in:
Ron Eldor 2018-02-07 18:59:41 +02:00
parent 1072e5c7e5
commit 9566ff7913
2 changed files with 5 additions and 6 deletions

View file

@ -1325,16 +1325,16 @@ int mbedtls_pk_parse_public_key( mbedtls_pk_context *ctx,
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;

View file

@ -110,11 +110,10 @@ Parse Public RSA Key #1 (PKCS#8 wrapped, DER)
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)