psa_key_slot_is_external exists. Use it.
diff --git a/library/psa_crypto.c b/library/psa_crypto.c
index 8595a0f..92364ca 100644
--- a/library/psa_crypto.c
+++ b/library/psa_crypto.c
@@ -888,10 +888,7 @@
psa_status_t status = psa_get_key_from_slot( handle, p_slot, usage, alg );
if( status != PSA_SUCCESS )
return( status );
- /* Use a simple, cheap test to check whether the key is transparent.
- * This check assumes that there are no persistent lifetimes other than
- * PSA_KEY_LIFETIME_PERSISTENT. */
- if( ( *p_slot )->lifetime > PSA_KEY_LIFETIME_PERSISTENT )
+ if( psa_key_slot_is_external( *p_slot ) )
{
*p_slot = NULL;
return( PSA_ERROR_NOT_SUPPORTED );