blob: 5af240542e029fda0f0c8458ca13b08e929aa6f9 [file] [log] [blame]
Soby Mathew294e1cf2022-03-22 16:19:39 +00001/*
Manish V Badarkhe37f9ac22023-03-12 21:34:44 +00002 * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
Soby Mathew294e1cf2022-03-22 16:19:39 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Manish V Badarkhe37f9ac22023-03-12 21:34:44 +00007#include <delegated_attestation.h>
8#include <psa/error.h>
Soby Mathew294e1cf2022-03-22 16:19:39 +00009
Manish V Badarkhe37f9ac22023-03-12 21:34:44 +000010/*
11 * Get the platform attestation token through the PSA delegated attestation
12 * layer.
13 *
14 * FVP cannot support RSS hardware at the moment, but it can still mock the
15 * RSS implementation of the PSA interface (see PLAT_RSS_NOT_SUPPORTED).
16 */
Javier Almansa Sobrino7176a772021-11-24 18:37:37 +000017int plat_rmmd_get_cca_attest_token(uintptr_t buf, size_t *len,
18 uintptr_t hash, size_t hash_size)
Soby Mathew294e1cf2022-03-22 16:19:39 +000019{
Manish V Badarkhe37f9ac22023-03-12 21:34:44 +000020 psa_status_t ret;
Soby Mathew294e1cf2022-03-22 16:19:39 +000021
Manish V Badarkhe37f9ac22023-03-12 21:34:44 +000022 ret = rss_delegated_attest_get_token((const uint8_t *)hash, hash_size,
23 (uint8_t *)buf, *len, len);
Soby Mathew294e1cf2022-03-22 16:19:39 +000024
Manish V Badarkhe37f9ac22023-03-12 21:34:44 +000025 return ret;
Soby Mathew294e1cf2022-03-22 16:19:39 +000026}