mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-03-24 22:25:11 +00:00
psa_key_slot_is_external exists. Use it.
This commit is contained in:
parent
6a3dd89a64
commit
adad813d7b
|
@ -888,10 +888,7 @@ static psa_status_t psa_get_transparent_key( psa_key_handle_t handle,
|
||||||
psa_status_t status = psa_get_key_from_slot( handle, p_slot, usage, alg );
|
psa_status_t status = psa_get_key_from_slot( handle, p_slot, usage, alg );
|
||||||
if( status != PSA_SUCCESS )
|
if( status != PSA_SUCCESS )
|
||||||
return( status );
|
return( status );
|
||||||
/* Use a simple, cheap test to check whether the key is transparent.
|
if( psa_key_slot_is_external( *p_slot ) )
|
||||||
* This check assumes that there are no persistent lifetimes other than
|
|
||||||
* PSA_KEY_LIFETIME_PERSISTENT. */
|
|
||||||
if( ( *p_slot )->lifetime > PSA_KEY_LIFETIME_PERSISTENT )
|
|
||||||
{
|
{
|
||||||
*p_slot = NULL;
|
*p_slot = NULL;
|
||||||
return( PSA_ERROR_NOT_SUPPORTED );
|
return( PSA_ERROR_NOT_SUPPORTED );
|
||||||
|
|
Loading…
Reference in a new issue