psa: Remove extra status handling from import
Remove extra status handling code from psa_import_key_into_slot(). This
helps save a tiny amount of code space, but mainly serves to improve the
readability of the code.
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 03d3371..bb53f81 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -701,8 +701,6 @@
status = psa_import_ec_private_key( PSA_KEY_TYPE_GET_CURVE( slot->type ),
data, data_length,
&slot->data.ecp );
- if( status != PSA_SUCCESS )
- return( status );
}
else if( PSA_KEY_TYPE_IS_ECC_PUBLIC_KEY( slot->type ) )
{
@@ -710,9 +708,6 @@
PSA_KEY_TYPE_GET_CURVE( slot->type ),
data, data_length,
&slot->data.ecp );
-
- if( status != PSA_SUCCESS )
- return( status );
}
else
#endif /* MBEDTLS_ECP_C */
@@ -722,16 +717,13 @@
status = psa_import_rsa_key( slot->type,
data, data_length,
&slot->data.rsa );
-
- if( status != PSA_SUCCESS )
- return( status );
}
else
#endif /* defined(MBEDTLS_RSA_C) && defined(MBEDTLS_PK_PARSE_C) */
{
return( PSA_ERROR_NOT_SUPPORTED );
}
- return( PSA_SUCCESS );
+ return( status );
}
/* Retrieve an empty key slot (slot with no key data, but possibly