qemu_realm_attest_key.c 956 B

123456789101112131415161718192021222324252627282930313233343536
  1. /*
  2. * Copyright (c) 2024, Arm Limited and Contributors. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #include <errno.h>
  7. #include <string.h>
  8. #include <plat/common/platform.h>
  9. static const uint8_t sample_delegated_key[] = {
  10. 0x20, 0x11, 0xC7, 0xF0, 0x3C, 0xEE, 0x43, 0x25, 0x17, 0x6E,
  11. 0x52, 0x4F, 0x03, 0x3C, 0x0C, 0xE1, 0xE2, 0x1A, 0x76, 0xE6,
  12. 0xC1, 0xA4, 0xF0, 0xB8, 0x39, 0xAA, 0x1D, 0xF6, 0x1E, 0x0E,
  13. 0x8A, 0x5C, 0x8A, 0x05, 0x74, 0x0F, 0x9B, 0x69, 0xEF, 0xA7,
  14. 0xEB, 0x1A, 0x41, 0x85, 0xBD, 0x11, 0x7F, 0x68
  15. };
  16. /*
  17. * Get the hardcoded delegated realm attestation key as QEMU
  18. * does not support RSE.
  19. */
  20. int plat_rmmd_get_cca_realm_attest_key(uintptr_t buf, size_t *len,
  21. unsigned int type)
  22. {
  23. if (*len < sizeof(sample_delegated_key)) {
  24. return -EINVAL;
  25. }
  26. (void)memcpy((void *)buf, (const void *)sample_delegated_key,
  27. sizeof(sample_delegated_key));
  28. *len = sizeof(sample_delegated_key);
  29. return 0;
  30. }