rse_measured_boot.h 1015 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. /*
  2. * Copyright (c) 2022-2024, Arm Limited. All rights reserved.
  3. *
  4. * SPDX-License-Identifier: BSD-3-Clause
  5. */
  6. #ifndef RSE_MEASURED_BOOT_H
  7. #define RSE_MEASURED_BOOT_H
  8. #include <stdint.h>
  9. #include <common/debug.h>
  10. #include <drivers/measured_boot/metadata.h>
  11. #define RSE_MBOOT_INVALID_ID UINT32_MAX
  12. struct rse_mboot_metadata {
  13. unsigned int id;
  14. uint8_t slot;
  15. uint8_t signer_id[SIGNER_ID_MAX_SIZE];
  16. size_t signer_id_size;
  17. uint8_t version[VERSION_MAX_SIZE];
  18. size_t version_size;
  19. uint8_t sw_type[SW_TYPE_MAX_SIZE];
  20. size_t sw_type_size;
  21. void *pk_oid;
  22. bool lock_measurement;
  23. };
  24. /* Functions' declarations */
  25. void rse_measured_boot_init(struct rse_mboot_metadata *metadata_ptr);
  26. int rse_mboot_measure_and_record(struct rse_mboot_metadata *metadata_ptr,
  27. uintptr_t data_base, uint32_t data_size,
  28. uint32_t data_id);
  29. int rse_mboot_set_signer_id(struct rse_mboot_metadata *metadata_ptr,
  30. const void *pk_oid, const void *pk_ptr,
  31. size_t pk_len);
  32. #endif /* RSE_MEASURED_BOOT_H */