Skip to content

Commit b8ff1e9

Browse files
committed
Add hook for verification using secure element
1 parent d9cb640 commit b8ff1e9

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

library/psa_crypto.c

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3090,11 +3090,28 @@ psa_status_t psa_asymmetric_verify( psa_key_handle_t handle,
30903090
{
30913091
psa_key_slot_t *slot;
30923092
psa_status_t status;
3093+
const psa_se_drv_table_entry_t *driver = NULL;
30933094

30943095
status = psa_get_key_from_slot( handle, &slot, PSA_KEY_USAGE_VERIFY, alg );
30953096
if( status != PSA_SUCCESS )
30963097
return( status );
30973098

3099+
#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
3100+
driver = psa_get_se_driver_entry( slot->lifetime );
3101+
if( driver != NULL )
3102+
{
3103+
const psa_drv_se_t *drv = psa_get_se_driver_methods( driver );
3104+
if( drv->asymmetric == NULL ||
3105+
drv->asymmetric->p_verify == NULL )
3106+
{
3107+
return PSA_ERROR_NOT_SUPPORTED;
3108+
}
3109+
return( drv->asymmetric->p_verify(
3110+
slot->data.se.slot_number, alg, hash, hash_length, signature,
3111+
signature_length ) );
3112+
}
3113+
else
3114+
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
30983115
#if defined(MBEDTLS_RSA_C)
30993116
if( PSA_KEY_TYPE_IS_RSA( slot->type ) )
31003117
{

0 commit comments

Comments
 (0)