mirror of
https://github.com/yuzu-emu/mbedtls.git
synced 2025-01-11 02:15:31 +00:00
Enrollment algorithm in policy: implement persistent keys
This commit is contained in:
parent
6fbfdb9e06
commit
81efb391eb
|
@ -269,6 +269,7 @@ void psa_format_key_data_for_storage( const uint8_t *data,
|
||||||
PUT_UINT32_LE(type, storage_format->type, 0);
|
PUT_UINT32_LE(type, storage_format->type, 0);
|
||||||
PUT_UINT32_LE(policy->usage, storage_format->policy, 0);
|
PUT_UINT32_LE(policy->usage, storage_format->policy, 0);
|
||||||
PUT_UINT32_LE(policy->alg, storage_format->policy, sizeof( uint32_t ));
|
PUT_UINT32_LE(policy->alg, storage_format->policy, sizeof( uint32_t ));
|
||||||
|
PUT_UINT32_LE(policy->alg2, storage_format->policy, 2 * sizeof( uint32_t ) );
|
||||||
PUT_UINT32_LE(data_length, storage_format->data_len, 0);
|
PUT_UINT32_LE(data_length, storage_format->data_len, 0);
|
||||||
memcpy( storage_format->key_data, data, data_length );
|
memcpy( storage_format->key_data, data, data_length );
|
||||||
}
|
}
|
||||||
|
@ -316,6 +317,7 @@ psa_status_t psa_parse_key_data_from_storage( const uint8_t *storage_data,
|
||||||
GET_UINT32_LE(*type, storage_format->type, 0);
|
GET_UINT32_LE(*type, storage_format->type, 0);
|
||||||
GET_UINT32_LE(policy->usage, storage_format->policy, 0);
|
GET_UINT32_LE(policy->usage, storage_format->policy, 0);
|
||||||
GET_UINT32_LE(policy->alg, storage_format->policy, sizeof( uint32_t ));
|
GET_UINT32_LE(policy->alg, storage_format->policy, sizeof( uint32_t ));
|
||||||
|
GET_UINT32_LE(policy->alg2, storage_format->policy, 2 * sizeof( uint32_t ));
|
||||||
|
|
||||||
memcpy( *key_data, storage_format->key_data, *key_data_length );
|
memcpy( *key_data, storage_format->key_data, *key_data_length );
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue