Soby Mathew | f05d93a | 2022-03-22 16:21:19 +0000 | [diff] [blame] | 1 | /* |
Manish V Badarkhe | 37f9ac2 | 2023-03-12 21:34:44 +0000 | [diff] [blame] | 2 | * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved. |
Soby Mathew | f05d93a | 2022-03-22 16:21:19 +0000 | [diff] [blame] | 3 | * |
| 4 | * SPDX-License-Identifier: BSD-3-Clause |
| 5 | */ |
| 6 | |
| 7 | #include <assert.h> |
Manish V Badarkhe | 37f9ac2 | 2023-03-12 21:34:44 +0000 | [diff] [blame] | 8 | #include <delegated_attestation.h> |
| 9 | #include <psa/error.h> |
Soby Mathew | f05d93a | 2022-03-22 16:21:19 +0000 | [diff] [blame] | 10 | #include <services/rmmd_svc.h> |
| 11 | |
Manish V Badarkhe | 37f9ac2 | 2023-03-12 21:34:44 +0000 | [diff] [blame] | 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 | */ |
Javier Almansa Sobrino | 7176a77 | 2021-11-24 18:37:37 +0000 | [diff] [blame] | 19 | int plat_rmmd_get_cca_realm_attest_key(uintptr_t buf, size_t *len, |
| 20 | unsigned int type) |
Soby Mathew | f05d93a | 2022-03-22 16:21:19 +0000 | [diff] [blame] | 21 | { |
Manish V Badarkhe | 37f9ac2 | 2023-03-12 21:34:44 +0000 | [diff] [blame] | 22 | psa_status_t ret; |
Soby Mathew | f05d93a | 2022-03-22 16:21:19 +0000 | [diff] [blame] | 23 | |
Manish V Badarkhe | 37f9ac2 | 2023-03-12 21:34:44 +0000 | [diff] [blame] | 24 | assert(type == ATTEST_KEY_CURVE_ECC_SECP384R1); |
Soby Mathew | f05d93a | 2022-03-22 16:21:19 +0000 | [diff] [blame] | 25 | |
Manish V Badarkhe | 37f9ac2 | 2023-03-12 21:34:44 +0000 | [diff] [blame] | 26 | ret = rss_delegated_attest_get_delegated_key(0U, 0U, (uint8_t *)buf, |
| 27 | *len, len, 0U); |
Soby Mathew | f05d93a | 2022-03-22 16:21:19 +0000 | [diff] [blame] | 28 | |
Manish V Badarkhe | 37f9ac2 | 2023-03-12 21:34:44 +0000 | [diff] [blame] | 29 | return ret; |
Soby Mathew | f05d93a | 2022-03-22 16:21:19 +0000 | [diff] [blame] | 30 | } |