blob: fe0cde7258f90eec2c5c5dd5a5486973639c333b [file] [log] [blame]
Soby Mathewf05d93a2022-03-22 16:21:19 +00001/*
Manish V Badarkhe37f9ac22023-03-12 21:34:44 +00002 * Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.
Soby Mathewf05d93a2022-03-22 16:21:19 +00003 *
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
Manish V Badarkheee3855e2023-09-11 19:52:25 +01007#include <errno.h>
8#include <string.h>
9
10#include <plat/common/platform.h>
11
12static const uint8_t sample_delegated_key[] = {
13 0x20, 0x11, 0xC7, 0xF0, 0x3C, 0xEE, 0x43, 0x25, 0x17, 0x6E,
14 0x52, 0x4F, 0x03, 0x3C, 0x0C, 0xE1, 0xE2, 0x1A, 0x76, 0xE6,
15 0xC1, 0xA4, 0xF0, 0xB8, 0x39, 0xAA, 0x1D, 0xF6, 0x1E, 0x0E,
16 0x8A, 0x5C, 0x8A, 0x05, 0x74, 0x0F, 0x9B, 0x69, 0xEF, 0xA7,
17 0xEB, 0x1A, 0x41, 0x85, 0xBD, 0x11, 0x7F, 0x68
18};
Soby Mathewf05d93a2022-03-22 16:21:19 +000019
Manish V Badarkhe37f9ac22023-03-12 21:34:44 +000020/*
Manish V Badarkheee3855e2023-09-11 19:52:25 +010021 * Get the hardcoded delegated realm attestation key as FVP
22 * does not support RSS.
Manish V Badarkhe37f9ac22023-03-12 21:34:44 +000023 */
Javier Almansa Sobrino7176a772021-11-24 18:37:37 +000024int plat_rmmd_get_cca_realm_attest_key(uintptr_t buf, size_t *len,
25 unsigned int type)
Soby Mathewf05d93a2022-03-22 16:21:19 +000026{
Manish V Badarkheee3855e2023-09-11 19:52:25 +010027 if (*len < sizeof(sample_delegated_key)) {
28 return -EINVAL;
29 }
Soby Mathewf05d93a2022-03-22 16:21:19 +000030
Manish V Badarkheee3855e2023-09-11 19:52:25 +010031 (void)memcpy((void *)buf, (const void *)sample_delegated_key,
32 sizeof(sample_delegated_key));
33 *len = sizeof(sample_delegated_key);
Soby Mathewf05d93a2022-03-22 16:21:19 +000034
Manish V Badarkheee3855e2023-09-11 19:52:25 +010035 return 0;
Soby Mathewf05d93a2022-03-22 16:21:19 +000036}