fix(psa): align with original API in tf-m-extras

The measured boot API is available in the tf-m-extras
repo:
partitions/measured_boot/interface/src/measured_boot_api.c

This change make the API behavior align with
the original implementation.

Signed-off-by: Tamas Ban <tamas.ban@arm.com>
Change-Id: Ie4af38b859f942b2ef090e92da64d75811b5b49b
This commit is contained in:
Tamas Ban 2022-10-03 13:06:53 +02:00
parent e3a6fb84f5
commit 471c9895a6

View file

@ -87,12 +87,11 @@ rss_measured_boot_extend_measurement(uint8_t index,
{.base = measurement_value, .len = measurement_value_size}
};
uint32_t sw_type_size_limited;
if (sw_type != NULL) {
sw_type_size_limited = (sw_type_size < SW_TYPE_MAX_SIZE) ?
sw_type_size : SW_TYPE_MAX_SIZE;
memcpy(extend_iov.sw_type, sw_type, sw_type_size_limited);
if (sw_type_size > SW_TYPE_MAX_SIZE) {
return PSA_ERROR_INVALID_ARGUMENT;
}
memcpy(extend_iov.sw_type, sw_type, sw_type_size);
}
log_measurement(index, signer_id, signer_id_size,