diff --git a/library/psa_crypto_storage.c b/library/psa_crypto_storage.c index 840f418c3..babc5bb95 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 );