mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2024-11-26 03:55:39 +01:00
Fix issues when MBEDTLS_PEM_PARSE_C
not defined
1) Fix compilatoin issues when `MBEDTLS_PEM_PARSE_C` not defined 2) remove dependency for `MBEDTLS_PEM_PARSE_C` in DER tests
This commit is contained in:
parent
40b14a894b
commit
5472d43ffb
@ -1250,10 +1250,12 @@ int mbedtls_pk_parse_public_key( mbedtls_pk_context *ctx,
|
||||
{
|
||||
int ret;
|
||||
unsigned char *p;
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
const mbedtls_pk_info_t *pk_info;
|
||||
#endif
|
||||
#if defined(MBEDTLS_PEM_PARSE_C)
|
||||
size_t len;
|
||||
mbedtls_pem_context pem;
|
||||
const mbedtls_pk_info_t *pk_info;
|
||||
mbedtls_pem_init( &pem );
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
/* Avoid calling mbedtls_pem_read_buffer() on non-null-terminated string */
|
||||
@ -1311,6 +1313,7 @@ int mbedtls_pk_parse_public_key( mbedtls_pk_context *ctx,
|
||||
mbedtls_pem_free( &pem );
|
||||
return( ret );
|
||||
}
|
||||
mbedtls_pem_free( &pem );
|
||||
#endif /* MBEDTLS_PEM_PARSE_C */
|
||||
|
||||
#if defined(MBEDTLS_RSA_C)
|
||||
@ -1324,7 +1327,6 @@ int mbedtls_pk_parse_public_key( mbedtls_pk_context *ctx,
|
||||
ret = pk_get_rsapubkey( &p, p + keylen, mbedtls_pk_rsa( *ctx ) );
|
||||
if ( ret == 0 )
|
||||
{
|
||||
mbedtls_pem_free( &pem );
|
||||
return( ret );
|
||||
}
|
||||
mbedtls_pk_free( ctx );
|
||||
|
@ -107,7 +107,7 @@ depends_on:MBEDTLS_MD5_C:MBEDTLS_PEM_PARSE_C
|
||||
pk_parse_public_keyfile_rsa:"data_files/format_gen.pub":0
|
||||
|
||||
Parse Public RSA Key #1 (PKCS#8 wrapped, DER)
|
||||
depends_on:MBEDTLS_MD5_C:MBEDTLS_PEM_PARSE_C
|
||||
depends_on:MBEDTLS_MD5_C
|
||||
pk_parse_public_keyfile_rsa:"data_files/rsa_pkcs8_1024_public.der":0
|
||||
|
||||
Parse Public RSA Key #3 (PKCS#1 wrapped)
|
||||
@ -115,7 +115,7 @@ depends_on:MBEDTLS_RSA_C: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:MBEDTLS_PEM_PARSE_C
|
||||
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)
|
||||
|
Loading…
Reference in New Issue
Block a user