From 81efb391ebc5ae425d614a74fdf067425da0259c Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Mon, 13 May 2019 14:38:16 +0200 Subject: [PATCH] Enrollment algorithm in policy: implement persistent keys --- library/psa_crypto_storage.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/library/psa_crypto_storage.c b/library/psa_crypto_storage.c index 840f418c38..babc5bb95a 100644 --- a/library/psa_crypto_storage.c +++ b/library/psa_crypto_storage.c @@ -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(policy->usage, storage_format->policy, 0); 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); 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(policy->usage, storage_format->policy, 0); 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 );