Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions ta/crypt/derive_key_taf.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ TEE_Result derive_ta_unique_key_test(uint32_t param_types,
TEE_TASessionHandle session = TEE_HANDLE_NULL;
uint8_t big_key[64] = { };
uint8_t extra_key_data[] = { "My dummy data" };
uint8_t extra_key_data_large[TA_DERIVED_EXTRA_DATA_MAX_SIZE + 1] = { "My dummy data" };
uint8_t key1[32] = { };
uint8_t key2[32] = { };
uint32_t ret_origin = 0;
Expand Down Expand Up @@ -131,11 +132,9 @@ TEE_Result derive_ta_unique_key_test(uint32_t param_types,
TEE_MemFill(key1, 0, sizeof(key1));
TEE_MemFill(key2, 0, sizeof(key2));

/*
* Testing limits for extra data size (if this would success, then we
* would overwrite the buffer extra_key_data also).
*/
res = derive_unique_key(session, key1, sizeof(key1), extra_key_data,
/* Testing limits for extra data size. */
res = derive_unique_key(session, key1, sizeof(key1),
extra_key_data_large,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see why the buffer must be large, but I don't see the point with this particular test or even why the PTA must enforce the limit TA_DERIVED_EXTRA_DATA_MAX_SIZE.
@jockebech do you remember?

TA_DERIVED_EXTRA_DATA_MAX_SIZE + 1);
/* This shall fail */
if (res == TEE_SUCCESS)
Expand Down