mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-07-04 12:58:14 +00:00
TinyCrypt PK parse: Remove MBEDTLS_PK_ECDSA during pubkey parsing
The PK type MBEDTLS_PK_ECDSA is never returned from `mbedtls_pk_info_from_type()`. Instead, EC keys either are identified as MBEDTLS_PK_ECKEY_DH (in case they must only be used for ECDHE) or MBEDTLS_PK_ECKEY (in case they can be used for any algorithm).
This commit is contained in:
parent
e65697c351
commit
75f8d3276f
|
@ -716,7 +716,7 @@ int mbedtls_pk_parse_subpubkey( unsigned char **p, const unsigned char *end,
|
||||||
return( ret );
|
return( ret );
|
||||||
|
|
||||||
#if defined(MBEDTLS_USE_TINYCRYPT)
|
#if defined(MBEDTLS_USE_TINYCRYPT)
|
||||||
if( pk_alg == MBEDTLS_PK_ECDSA )
|
if( pk_alg == MBEDTLS_PK_ECKEY )
|
||||||
{
|
{
|
||||||
ret = pk_get_ueccpubkey( p, end, (uint8_t*) pk->pk_ctx );
|
ret = pk_get_ueccpubkey( p, end, (uint8_t*) pk->pk_ctx );
|
||||||
} else
|
} else
|
||||||
|
@ -1204,7 +1204,7 @@ static int pk_parse_key_pkcs8_unencrypted_der(
|
||||||
} else
|
} else
|
||||||
#endif /* MBEDTLS_RSA_C */
|
#endif /* MBEDTLS_RSA_C */
|
||||||
#if defined(MBEDTLS_USE_TINYCRYPT)
|
#if defined(MBEDTLS_USE_TINYCRYPT)
|
||||||
if( pk_alg == MBEDTLS_PK_ECDSA)
|
if( pk_alg == MBEDTLS_PK_ECKEY )
|
||||||
{
|
{
|
||||||
if( ( ret = pk_use_ecparams( ¶ms ) ) != 0 ||
|
if( ( ret = pk_use_ecparams( ¶ms ) ) != 0 ||
|
||||||
( ret = pk_parse_key_sec1_der( mbedtls_uecc_pk( *pk ), p, len ) ) != 0)
|
( ret = pk_parse_key_sec1_der( mbedtls_uecc_pk( *pk ), p, len ) ) != 0)
|
||||||
|
|
Loading…
Reference in a new issue