diff options
author | Tamas Ban <tamas.ban@arm.com> | 2020-01-10 13:15:39 +0000 |
---|---|---|
committer | Tamas Ban <tamas.ban@arm.com> | 2020-01-23 13:33:03 +0000 |
commit | 608f039345c9795d974d17e30fcb3f0d53152a6a (patch) | |
tree | 50cbc1ba09e7ec85b987d2d4ed73df9e1e673654 | |
parent | 166836fdf82327cf0604c25040b6cd1e8c909bfc (diff) | |
download | trusted-firmware-m-608f039345c9795d974d17e30fcb3f0d53152a6a.tar.gz |
Attest: Return with real token size to caller
This patch is a fix because the secure side implementation
of the attestation API has not returned with the real
token size to the caller. Instead just returned with the
input value, which indicates the size of the token buffer.
Change-Id: I8da9da2da22e5dc9dc948ea4e58cee57188fce75
Signed-off-by: Tamas Ban <tamas.ban@arm.com>
-rw-r--r-- | secure_fw/services/initial_attestation/tfm_attestation_secure_api.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c b/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c index 2f6754f539..b134224334 100644 --- a/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c +++ b/secure_fw/services/initial_attestation/tfm_attestation_secure_api.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2018-2019, Arm Limited. All rights reserved. + * Copyright (c) 2018-2020, Arm Limited. All rights reserved. * * SPDX-License-Identifier: BSD-3-Clause * @@ -48,15 +48,15 @@ psa_initial_attest_get_token(const uint8_t *challenge_obj, if (status < PSA_SUCCESS) { return PSA_ATTEST_ERR_GENERAL; } - - if (status == PSA_SUCCESS) { - *token_size = out_vec[0].len; - } #else status = tfm_initial_attest_get_token_veneer(in_vec, IOVEC_LEN(in_vec), out_vec, IOVEC_LEN(out_vec)); #endif + if (status == PSA_SUCCESS) { + *token_size = out_vec[0].len; + } + return (enum psa_attest_err_t)status; } |