mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-24 10:35:12 +00:00
Fix unused variable warnings in pkparse.c
In a reduced configuration without PEM, PKCS5 or PKCS12, armc5 found that ret was set but not used. Fixing that lead to a new warning about the variable not being used at all. Now the variable is only declared when it's needed.
This commit is contained in:
parent
070f107a61
commit
e83b2c2a50
|
@ -1164,7 +1164,11 @@ int mbedtls_pk_parse_key( mbedtls_pk_context *pk,
|
||||||
const unsigned char *key, size_t keylen,
|
const unsigned char *key, size_t keylen,
|
||||||
const unsigned char *pwd, size_t pwdlen )
|
const unsigned char *pwd, size_t pwdlen )
|
||||||
{
|
{
|
||||||
|
#if defined(MBEDTLS_PKCS12_C) || \
|
||||||
|
defined(MBEDTLS_PKCS5_C) || \
|
||||||
|
defined(MBEDTLS_PEM_PARSE_C)
|
||||||
int ret;
|
int ret;
|
||||||
|
#endif
|
||||||
const mbedtls_pk_info_t *pk_info;
|
const mbedtls_pk_info_t *pk_info;
|
||||||
#if defined(MBEDTLS_PEM_PARSE_C)
|
#if defined(MBEDTLS_PEM_PARSE_C)
|
||||||
size_t len;
|
size_t len;
|
||||||
|
@ -1327,7 +1331,7 @@ int mbedtls_pk_parse_key( mbedtls_pk_context *pk,
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_PKCS12_C || MBEDTLS_PKCS5_C */
|
#endif /* MBEDTLS_PKCS12_C || MBEDTLS_PKCS5_C */
|
||||||
|
|
||||||
if( ( ret = pk_parse_key_pkcs8_unencrypted_der( pk, key, keylen ) ) == 0 )
|
if( pk_parse_key_pkcs8_unencrypted_der( pk, key, keylen ) == 0 )
|
||||||
return( 0 );
|
return( 0 );
|
||||||
|
|
||||||
mbedtls_pk_free( pk );
|
mbedtls_pk_free( pk );
|
||||||
|
|
Loading…
Reference in a new issue