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>
diff --git a/library/pkparse.c b/library/pkparse.c
index 31339c1..3222ca2 100644
--- a/library/pkparse.c
+++ b/library/pkparse.c
@@ -1041,14 +1041,7 @@
if( ( ret = pk_get_pk_alg( &p, end, &pk_alg, ¶ms ) ) != 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 )