xref: /rk3399_ARM-atf/plat/arm/board/fvp/fvp_realm_attest_key.c (revision 138ddcbf4d330d13a11576d973513014055f98c1)
1 /*
2  * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  */
6 
7 #include <assert.h>
8 #include <delegated_attestation.h>
9 #include <psa/error.h>
10 #include <services/rmmd_svc.h>
11 
12 /*
13  * Get the delegated realm attestation key through the PSA delegated
14  * attestation layer.
15  *
16  * FVP cannot support RSS hardware at the moment, but it can still mock
17  * the RSS implementation of the PSA interface (see PLAT_RSS_NOT_SUPPORTED).
18  */
19 int plat_rmmd_get_cca_realm_attest_key(uintptr_t buf, size_t *len,
20 				       unsigned int type)
21 {
22 	psa_status_t ret;
23 
24 	assert(type == ATTEST_KEY_CURVE_ECC_SECP384R1);
25 
26 	ret = rss_delegated_attest_get_delegated_key(0U, 0U, (uint8_t *)buf,
27 						     *len, len, 0U);
28 
29 	return ret;
30 }
31