feat(tc): implement platform function to measure and publish Public Key

Implemented 'plat_mboot_measure_key' platform function for TC platform
to measure and publicise the public key information via RSS.

Change-Id: I10d90e921b135e729d5450d5a7468d0598072e60
Signed-off-by: Manish V Badarkhe <Manish.Badarkhe@arm.com>
This commit is contained in:
Manish V Badarkhe 2023-07-12 10:21:38 +01:00
parent 9eaa5a09ed
commit eee9fb02f7
3 changed files with 14 additions and 0 deletions

View file

@ -9,6 +9,7 @@
#include <drivers/arm/rss_comms.h> #include <drivers/arm/rss_comms.h>
#include <drivers/measured_boot/rss/rss_measured_boot.h> #include <drivers/measured_boot/rss/rss_measured_boot.h>
#include <lib/psa/measured_boot.h> #include <lib/psa/measured_boot.h>
#include <tools_share/zero_oid.h>
#include <plat/arm/common/plat_arm.h> #include <plat/arm/common/plat_arm.h>
#include <platform_def.h> #include <platform_def.h>
@ -22,18 +23,21 @@ struct rss_mboot_metadata tc_rss_mboot_metadata[] = {
.slot = U(6), .slot = U(6),
.signer_id_size = SIGNER_ID_MIN_SIZE, .signer_id_size = SIGNER_ID_MIN_SIZE,
.sw_type = RSS_MBOOT_FW_CONFIG_STRING, .sw_type = RSS_MBOOT_FW_CONFIG_STRING,
.pk_oid = ZERO_OID,
.lock_measurement = true }, .lock_measurement = true },
{ {
.id = TB_FW_CONFIG_ID, .id = TB_FW_CONFIG_ID,
.slot = U(7), .slot = U(7),
.signer_id_size = SIGNER_ID_MIN_SIZE, .signer_id_size = SIGNER_ID_MIN_SIZE,
.sw_type = RSS_MBOOT_TB_FW_CONFIG_STRING, .sw_type = RSS_MBOOT_TB_FW_CONFIG_STRING,
.pk_oid = ZERO_OID,
.lock_measurement = true }, .lock_measurement = true },
{ {
.id = BL2_IMAGE_ID, .id = BL2_IMAGE_ID,
.slot = U(8), .slot = U(8),
.signer_id_size = SIGNER_ID_MIN_SIZE, .signer_id_size = SIGNER_ID_MIN_SIZE,
.sw_type = RSS_MBOOT_BL2_STRING, .sw_type = RSS_MBOOT_BL2_STRING,
.pk_oid = ZERO_OID,
.lock_measurement = true }, .lock_measurement = true },
{ {

View file

@ -9,6 +9,7 @@
#include <drivers/arm/rss_comms.h> #include <drivers/arm/rss_comms.h>
#include <drivers/measured_boot/rss/rss_measured_boot.h> #include <drivers/measured_boot/rss/rss_measured_boot.h>
#include <lib/psa/measured_boot.h> #include <lib/psa/measured_boot.h>
#include <tools_share/tbbr_oid.h>
#include <plat/common/common_def.h> #include <plat/common/common_def.h>
#include <platform_def.h> #include <platform_def.h>
@ -22,18 +23,21 @@ struct rss_mboot_metadata tc_rss_mboot_metadata[] = {
.slot = U(9), .slot = U(9),
.signer_id_size = SIGNER_ID_MIN_SIZE, .signer_id_size = SIGNER_ID_MIN_SIZE,
.sw_type = RSS_MBOOT_BL31_STRING, .sw_type = RSS_MBOOT_BL31_STRING,
.pk_oid = BL31_IMAGE_KEY_OID,
.lock_measurement = true }, .lock_measurement = true },
{ {
.id = HW_CONFIG_ID, .id = HW_CONFIG_ID,
.slot = U(10), .slot = U(10),
.signer_id_size = SIGNER_ID_MIN_SIZE, .signer_id_size = SIGNER_ID_MIN_SIZE,
.sw_type = RSS_MBOOT_HW_CONFIG_STRING, .sw_type = RSS_MBOOT_HW_CONFIG_STRING,
.pk_oid = HW_CONFIG_KEY_OID,
.lock_measurement = true }, .lock_measurement = true },
{ {
.id = SOC_FW_CONFIG_ID, .id = SOC_FW_CONFIG_ID,
.slot = U(11), .slot = U(11),
.signer_id_size = SIGNER_ID_MIN_SIZE, .signer_id_size = SIGNER_ID_MIN_SIZE,
.sw_type = RSS_MBOOT_SOC_FW_CONFIG_STRING, .sw_type = RSS_MBOOT_SOC_FW_CONFIG_STRING,
.pk_oid = SOC_FW_CONFIG_KEY_OID,
.lock_measurement = true }, .lock_measurement = true },
{ {
.id = RSS_MBOOT_INVALID_ID } .id = RSS_MBOOT_INVALID_ID }

View file

@ -28,3 +28,9 @@ int plat_mboot_measure_image(unsigned int image_id, image_info_t *image_data)
return err; return err;
} }
int plat_mboot_measure_key(void *pk_oid, void *pk_ptr, unsigned int pk_len)
{
return rss_mboot_set_signer_id(tc_rss_mboot_metadata, pk_oid, pk_ptr,
pk_len);
}