1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-08-07 06:42:56 +03:00

psa_export_public_key

This commit is contained in:
Moran Peker
2018-04-04 12:47:52 +03:00
committed by itayzafrir
parent dd4ea38d58
commit b4d0ddd2d3
5 changed files with 68 additions and 12 deletions

View File

@@ -522,18 +522,15 @@ psa_status_t psa_export_key(psa_key_slot_t key,
psa_status_t psa_export_public_key(psa_key_slot_t key,
uint8_t *data,
size_t data_size,
size_t *data_length)
uint8_t *data,
size_t data_size,
size_t *data_length)
{
key_slot_t *slot;
psa_status_t status;
if( key == 0 || key > MBEDTLS_PSA_KEY_SLOT_COUNT )
return( PSA_ERROR_EMPTY_SLOT );
status = psa_get_key_slot( key, &slot );
if( status != PSA_SUCCESS)
return( status );
slot = &global_data.key_slots[key];
if( slot->type == PSA_KEY_TYPE_NONE )
return( PSA_ERROR_EMPTY_SLOT );