summaryrefslogtreecommitdiff
path: root/services
diff options
context:
space:
mode:
authorAndrea Sanchez <andreasanchezp@google.com>2026-07-22 19:31:03 +0000
committerAndrea Sanchez <andreasanchezp@google.com>2026-07-24 16:56:11 +0000
commit8fb99a9477ca9d4f784e47ca7693689ac8451835 (patch)
treea27ca22a87ba8e88a8b4fff889be120691febf9e /services
parentfdc31c829cf265c28775e59c7d84a3cfa3185e90 (diff)
downloadarm-trusted-firmware-8fb99a9477ca9d4f784e47ca7693689ac8451835.tar.gz
arm-trusted-firmware-8fb99a9477ca9d4f784e47ca7693689ac8451835.zip
fix(rmmd): fix token challenge validation
Allow a challenge size of zero (c_size == 0) in rmmd_attest_get_platform_token() to support continuation calls for multi-hunk attestation token transfers since the challenge is not sent in the continuation retrieval of the platform attestation token. Change-Id: I7d13ecb524b85d760f0dbc74c9cd993089a8f333 Signed-off-by: Andrea Sanchez <andreasanchezp@google.com>
Diffstat (limited to 'services')
-rw-r--r--services/std_svc/rmmd/rmmd_attest.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/services/std_svc/rmmd/rmmd_attest.c b/services/std_svc/rmmd/rmmd_attest.c
index 7d4ea701c..affe55852 100644
--- a/services/std_svc/rmmd/rmmd_attest.c
+++ b/services/std_svc/rmmd/rmmd_attest.c
@@ -99,7 +99,8 @@ int rmmd_attest_get_platform_token(uint64_t buf_pa, uint64_t *buf_size,
return err;
}
- if ((c_size != SHA256_DIGEST_SIZE) &&
+ if ((c_size != 0) &&
+ (c_size != SHA256_DIGEST_SIZE) &&
(c_size != SHA384_DIGEST_SIZE) &&
(c_size != SHA512_DIGEST_SIZE)) {
ERROR("Invalid hash size: %lu\n", c_size);
@@ -108,13 +109,17 @@ int rmmd_attest_get_platform_token(uint64_t buf_pa, uint64_t *buf_size,
spin_lock(&lock);
- (void)memcpy(temp_buf, (void *)buf_pa, c_size);
+ uintptr_t hash_ptr = (uintptr_t)NULL;
- print_challenge((uint8_t *)temp_buf, c_size);
+ if (c_size != 0) {
+ (void)memcpy(temp_buf, (void *)buf_pa, c_size);
+ print_challenge((uint8_t *)temp_buf, c_size);
+ hash_ptr = (uintptr_t)temp_buf;
+ }
/* Get the platform token. */
err = plat_rmmd_get_cca_attest_token((uintptr_t)buf_pa,
- buf_size, (uintptr_t)temp_buf, c_size, remaining_len);
+ buf_size, hash_ptr, c_size, remaining_len);
switch (err) {
case 0: