Skip to content

Commit adad813

Browse files
psa_key_slot_is_external exists. Use it.
1 parent 6a3dd89 commit adad813

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

library/psa_crypto.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -888,10 +888,7 @@ static psa_status_t psa_get_transparent_key( psa_key_handle_t handle,
888888
psa_status_t status = psa_get_key_from_slot( handle, p_slot, usage, alg );
889889
if( status != PSA_SUCCESS )
890890
return( status );
891-
/* Use a simple, cheap test to check whether the key is transparent.
892-
* This check assumes that there are no persistent lifetimes other than
893-
* PSA_KEY_LIFETIME_PERSISTENT. */
894-
if( ( *p_slot )->lifetime > PSA_KEY_LIFETIME_PERSISTENT )
891+
if( psa_key_slot_is_external( *p_slot ) )
895892
{
896893
*p_slot = NULL;
897894
return( PSA_ERROR_NOT_SUPPORTED );

0 commit comments

Comments
 (0)