Remove dead code from pk_parse_key_pkcs8_unencrypted_der

pk_get_pk_alg will either return 0 or a pk error code. This means that
the error code will always be a high level module ID and so we just
return ret.

Signed-off-by: Chris Jones <christopher.jones@arm.com>
This commit is contained in:
Chris Jones 2021-04-28 14:12:07 +01:00
parent 860f509421
commit 4d01c5b5c3

View file

@ -1041,14 +1041,7 @@ static int pk_parse_key_pkcs8_unencrypted_der(
if( ( ret = pk_get_pk_alg( &p, end, &pk_alg, &params ) ) != 0 )
{
if( ret >= -0x007F )
{
return( MBEDTLS_ERROR_ADD( MBEDTLS_ERR_PK_KEY_INVALID_FORMAT, ret ) );
}
else
{
return ret;
}
return( ret );
}
if( ( ret = mbedtls_asn1_get_tag( &p, end, &len, MBEDTLS_ASN1_OCTET_STRING ) ) != 0 )