TBB: apply TBBR naming convention to certificates and extensions
This patch applies the TBBR naming convention to the certificates
and the corresponding extensions defined by the CoT:
* Certificate UUID names
* Certificate identifier names
* OID names
Changes apply to:
* Generic code (variables and defines)
* The default certificate identifiers provided in the generic
code
* Build system
* ARM platforms port
* cert_create tool internal definitions
* fip_create and cert_create tools command line options
* Documentation
IMPORTANT: this change breaks the compatibility with platforms
that use TBBR. The platform will need to adapt the identifiers
and OIDs to the TBBR naming convention introduced by this patch:
Certificate UUIDs:
UUID_TRUSTED_BOOT_FIRMWARE_BL2_CERT --> UUID_TRUSTED_BOOT_FW_CERT
UUID_SCP_FIRMWARE_BL30_KEY_CERT --> UUID_SCP_FW_KEY_CERT
UUID_SCP_FIRMWARE_BL30_CERT --> UUID_SCP_FW_CONTENT_CERT
UUID_EL3_RUNTIME_FIRMWARE_BL31_KEY_CERT --> UUID_SOC_FW_KEY_CERT
UUID_EL3_RUNTIME_FIRMWARE_BL31_CERT --> UUID_SOC_FW_CONTENT_CERT
UUID_SECURE_PAYLOAD_BL32_KEY_CERT --> UUID_TRUSTED_OS_FW_KEY_CERT
UUID_SECURE_PAYLOAD_BL32_CERT --> UUID_TRUSTED_OS_FW_CONTENT_CERT
UUID_NON_TRUSTED_FIRMWARE_BL33_KEY_CERT --> UUID_NON_TRUSTED_FW_KEY_CERT
UUID_NON_TRUSTED_FIRMWARE_BL33_CERT --> UUID_NON_TRUSTED_FW_CONTENT_CERT
Certificate identifiers:
BL2_CERT_ID --> TRUSTED_BOOT_FW_CERT_ID
BL30_KEY_CERT_ID --> SCP_FW_KEY_CERT_ID
BL30_CERT_ID --> SCP_FW_CONTENT_CERT_ID
BL31_KEY_CERT_ID --> SOC_FW_KEY_CERT_ID
BL31_CERT_ID --> SOC_FW_CONTENT_CERT_ID
BL32_KEY_CERT_ID --> TRUSTED_OS_FW_KEY_CERT_ID
BL32_CERT_ID --> TRUSTED_OS_FW_CONTENT_CERT_ID
BL33_KEY_CERT_ID --> NON_TRUSTED_FW_KEY_CERT_ID
BL33_CERT_ID --> NON_TRUSTED_FW_CONTENT_CERT_ID
OIDs:
TZ_FW_NVCOUNTER_OID --> TRUSTED_FW_NVCOUNTER_OID
NTZ_FW_NVCOUNTER_OID --> NON_TRUSTED_FW_NVCOUNTER_OID
BL2_HASH_OID --> TRUSTED_BOOT_FW_HASH_OID
TZ_WORLD_PK_OID --> TRUSTED_WORLD_PK_OID
NTZ_WORLD_PK_OID --> NON_TRUSTED_WORLD_PK_OID
BL30_CONTENT_CERT_PK_OID --> SCP_FW_CONTENT_CERT_PK_OID
BL30_HASH_OID --> SCP_FW_HASH_OID
BL31_CONTENT_CERT_PK_OID --> SOC_FW_CONTENT_CERT_PK_OID
BL31_HASH_OID --> SOC_AP_FW_HASH_OID
BL32_CONTENT_CERT_PK_OID --> TRUSTED_OS_FW_CONTENT_CERT_PK_OID
BL32_HASH_OID --> TRUSTED_OS_FW_HASH_OID
BL33_CONTENT_CERT_PK_OID --> NON_TRUSTED_FW_CONTENT_CERT_PK_OID
BL33_HASH_OID --> NON_TRUSTED_WORLD_BOOTLOADER_HASH_OID
BL2U_HASH_OID --> AP_FWU_CFG_HASH_OID
SCP_BL2U_HASH_OID --> SCP_FWU_CFG_HASH_OID
NS_BL2U_HASH_OID --> FWU_HASH_OID
Change-Id: I1e047ae046299ca913911c39ac3a6e123bd41079
diff --git a/drivers/auth/tbbr/tbbr_cot.c b/drivers/auth/tbbr/tbbr_cot.c
index 71634a1..ab0243d 100644
--- a/drivers/auth/tbbr/tbbr_cot.c
+++ b/drivers/auth/tbbr/tbbr_cot.c
@@ -44,14 +44,14 @@
* extracted from the certificates. In this case, because of the way the CoT is
* established, we can reuse some of the buffers on different stages
*/
-static unsigned char plat_bl2_hash_buf[HASH_DER_LEN];
-static unsigned char plat_bl30_hash_buf[HASH_DER_LEN];
-static unsigned char plat_bl31_hash_buf[HASH_DER_LEN];
-static unsigned char plat_bl32_hash_buf[HASH_DER_LEN];
-static unsigned char plat_bl33_hash_buf[HASH_DER_LEN];
-static unsigned char plat_tz_world_pk_buf[PK_DER_LEN];
-static unsigned char plat_ntz_world_pk_buf[PK_DER_LEN];
-static unsigned char plat_content_pk[PK_DER_LEN];
+static unsigned char tb_fw_hash_buf[HASH_DER_LEN];
+static unsigned char scp_fw_hash_buf[HASH_DER_LEN];
+static unsigned char soc_fw_hash_buf[HASH_DER_LEN];
+static unsigned char tos_fw_hash_buf[HASH_DER_LEN];
+static unsigned char nt_world_bl_hash_buf[HASH_DER_LEN];
+static unsigned char trusted_world_pk_buf[PK_DER_LEN];
+static unsigned char non_trusted_world_pk_buf[PK_DER_LEN];
+static unsigned char content_pk_buf[PK_DER_LEN];
/*
* Parameter type descriptors
@@ -65,36 +65,36 @@
static auth_param_type_desc_t raw_data = AUTH_PARAM_TYPE_DESC(
AUTH_PARAM_RAW_DATA, 0);
-static auth_param_type_desc_t tz_world_pk = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_PUB_KEY, TZ_WORLD_PK_OID);
-static auth_param_type_desc_t ntz_world_pk = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_PUB_KEY, NTZ_WORLD_PK_OID);
+static auth_param_type_desc_t trusted_world_pk = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_PUB_KEY, TRUSTED_WORLD_PK_OID);
+static auth_param_type_desc_t non_trusted_world_pk = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_PUB_KEY, NON_TRUSTED_WORLD_PK_OID);
-static auth_param_type_desc_t bl30_content_pk = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_PUB_KEY, BL30_CONTENT_CERT_PK_OID);
-static auth_param_type_desc_t bl31_content_pk = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_PUB_KEY, BL31_CONTENT_CERT_PK_OID);
-static auth_param_type_desc_t bl32_content_pk = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_PUB_KEY, BL32_CONTENT_CERT_PK_OID);
-static auth_param_type_desc_t bl33_content_pk = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_PUB_KEY, BL33_CONTENT_CERT_PK_OID);
+static auth_param_type_desc_t scp_fw_content_pk = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_PUB_KEY, SCP_FW_CONTENT_CERT_PK_OID);
+static auth_param_type_desc_t soc_fw_content_pk = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_PUB_KEY, SOC_FW_CONTENT_CERT_PK_OID);
+static auth_param_type_desc_t tos_fw_content_pk = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_PUB_KEY, TRUSTED_OS_FW_CONTENT_CERT_PK_OID);
+static auth_param_type_desc_t nt_fw_content_pk = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_PUB_KEY, NON_TRUSTED_FW_CONTENT_CERT_PK_OID);
-static auth_param_type_desc_t bl2_hash = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_HASH, BL2_HASH_OID);
-static auth_param_type_desc_t bl30_hash = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_HASH, BL30_HASH_OID);
-static auth_param_type_desc_t bl31_hash = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_HASH, BL31_HASH_OID);
-static auth_param_type_desc_t bl32_hash = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_HASH, BL32_HASH_OID);
-static auth_param_type_desc_t bl33_hash = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_HASH, BL33_HASH_OID);
+static auth_param_type_desc_t tb_fw_hash = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_HASH, TRUSTED_BOOT_FW_HASH_OID);
+static auth_param_type_desc_t scp_fw_hash = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_HASH, SCP_FW_HASH_OID);
+static auth_param_type_desc_t soc_fw_hash = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_HASH, SOC_AP_FW_HASH_OID);
+static auth_param_type_desc_t tos_fw_hash = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_HASH, TRUSTED_OS_FW_HASH_OID);
+static auth_param_type_desc_t nt_world_bl_hash = AUTH_PARAM_TYPE_DESC(
+ AUTH_PARAM_HASH, NON_TRUSTED_WORLD_BOOTLOADER_HASH_OID);
static auth_param_type_desc_t scp_bl2u_hash = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_HASH, SCP_BL2U_HASH_OID);
+ AUTH_PARAM_HASH, SCP_FWU_CFG_HASH_OID);
static auth_param_type_desc_t bl2u_hash = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_HASH, BL2U_HASH_OID);
+ AUTH_PARAM_HASH, AP_FWU_CFG_HASH_OID);
static auth_param_type_desc_t ns_bl2u_hash = AUTH_PARAM_TYPE_DESC(
- AUTH_PARAM_HASH, NS_BL2U_HASH_OID);
+ AUTH_PARAM_HASH, FWU_HASH_OID);
/*
* TBBR Chain of trust definition
@@ -103,8 +103,8 @@
/*
* BL2
*/
- [BL2_CERT_ID] = {
- .img_id = BL2_CERT_ID,
+ [TRUSTED_BOOT_FW_CERT_ID] = {
+ .img_id = TRUSTED_BOOT_FW_CERT_ID,
.img_type = IMG_CERT,
.parent = NULL,
.img_auth_methods = {
@@ -120,9 +120,9 @@
},
.authenticated_data = {
[0] = {
- .type_desc = &bl2_hash,
+ .type_desc = &tb_fw_hash,
.data = {
- .ptr = (void *)plat_bl2_hash_buf,
+ .ptr = (void *)tb_fw_hash_buf,
.len = (unsigned int)HASH_DER_LEN
}
}
@@ -131,13 +131,13 @@
[BL2_IMAGE_ID] = {
.img_id = BL2_IMAGE_ID,
.img_type = IMG_RAW,
- .parent = &cot_desc[BL2_CERT_ID],
+ .parent = &cot_desc[TRUSTED_BOOT_FW_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_HASH,
.param.hash = {
.data = &raw_data,
- .hash = &bl2_hash,
+ .hash = &tb_fw_hash,
}
}
}
@@ -162,33 +162,33 @@
},
.authenticated_data = {
[0] = {
- .type_desc = &tz_world_pk,
+ .type_desc = &trusted_world_pk,
.data = {
- .ptr = (void *)plat_tz_world_pk_buf,
+ .ptr = (void *)trusted_world_pk_buf,
.len = (unsigned int)PK_DER_LEN
}
},
[1] = {
- .type_desc = &ntz_world_pk,
+ .type_desc = &non_trusted_world_pk,
.data = {
- .ptr = (void *)plat_ntz_world_pk_buf,
+ .ptr = (void *)non_trusted_world_pk_buf,
.len = (unsigned int)PK_DER_LEN
}
}
}
},
/*
- * BL3-0
+ * SCP Firmware
*/
- [BL30_KEY_CERT_ID] = {
- .img_id = BL30_KEY_CERT_ID,
+ [SCP_FW_KEY_CERT_ID] = {
+ .img_id = SCP_FW_KEY_CERT_ID,
.img_type = IMG_CERT,
.parent = &cot_desc[TRUSTED_KEY_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_SIG,
.param.sig = {
- .pk = &tz_world_pk,
+ .pk = &trusted_world_pk,
.sig = &sig,
.alg = &sig_alg,
.data = &raw_data,
@@ -197,23 +197,23 @@
},
.authenticated_data = {
[0] = {
- .type_desc = &bl30_content_pk,
+ .type_desc = &scp_fw_content_pk,
.data = {
- .ptr = (void *)plat_content_pk,
+ .ptr = (void *)content_pk_buf,
.len = (unsigned int)PK_DER_LEN
}
}
}
},
- [BL30_CERT_ID] = {
- .img_id = BL30_CERT_ID,
+ [SCP_FW_CONTENT_CERT_ID] = {
+ .img_id = SCP_FW_CONTENT_CERT_ID,
.img_type = IMG_CERT,
- .parent = &cot_desc[BL30_KEY_CERT_ID],
+ .parent = &cot_desc[SCP_FW_KEY_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_SIG,
.param.sig = {
- .pk = &bl30_content_pk,
+ .pk = &scp_fw_content_pk,
.sig = &sig,
.alg = &sig_alg,
.data = &raw_data,
@@ -222,9 +222,9 @@
},
.authenticated_data = {
[0] = {
- .type_desc = &bl30_hash,
+ .type_desc = &scp_fw_hash,
.data = {
- .ptr = (void *)plat_bl30_hash_buf,
+ .ptr = (void *)scp_fw_hash_buf,
.len = (unsigned int)HASH_DER_LEN
}
}
@@ -233,29 +233,29 @@
[BL30_IMAGE_ID] = {
.img_id = BL30_IMAGE_ID,
.img_type = IMG_RAW,
- .parent = &cot_desc[BL30_CERT_ID],
+ .parent = &cot_desc[SCP_FW_CONTENT_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_HASH,
.param.hash = {
.data = &raw_data,
- .hash = &bl30_hash,
+ .hash = &scp_fw_hash,
}
}
}
},
/*
- * BL3-1
+ * SoC Firmware
*/
- [BL31_KEY_CERT_ID] = {
- .img_id = BL31_KEY_CERT_ID,
+ [SOC_FW_KEY_CERT_ID] = {
+ .img_id = SOC_FW_KEY_CERT_ID,
.img_type = IMG_CERT,
.parent = &cot_desc[TRUSTED_KEY_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_SIG,
.param.sig = {
- .pk = &tz_world_pk,
+ .pk = &trusted_world_pk,
.sig = &sig,
.alg = &sig_alg,
.data = &raw_data,
@@ -264,23 +264,23 @@
},
.authenticated_data = {
[0] = {
- .type_desc = &bl31_content_pk,
+ .type_desc = &soc_fw_content_pk,
.data = {
- .ptr = (void *)plat_content_pk,
+ .ptr = (void *)content_pk_buf,
.len = (unsigned int)PK_DER_LEN
}
}
}
},
- [BL31_CERT_ID] = {
- .img_id = BL31_CERT_ID,
+ [SOC_FW_CONTENT_CERT_ID] = {
+ .img_id = SOC_FW_CONTENT_CERT_ID,
.img_type = IMG_CERT,
- .parent = &cot_desc[BL31_KEY_CERT_ID],
+ .parent = &cot_desc[SOC_FW_KEY_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_SIG,
.param.sig = {
- .pk = &bl31_content_pk,
+ .pk = &soc_fw_content_pk,
.sig = &sig,
.alg = &sig_alg,
.data = &raw_data,
@@ -289,9 +289,9 @@
},
.authenticated_data = {
[0] = {
- .type_desc = &bl31_hash,
+ .type_desc = &soc_fw_hash,
.data = {
- .ptr = (void *)plat_bl31_hash_buf,
+ .ptr = (void *)soc_fw_hash_buf,
.len = (unsigned int)HASH_DER_LEN
}
}
@@ -300,29 +300,29 @@
[BL31_IMAGE_ID] = {
.img_id = BL31_IMAGE_ID,
.img_type = IMG_RAW,
- .parent = &cot_desc[BL31_CERT_ID],
+ .parent = &cot_desc[SOC_FW_CONTENT_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_HASH,
.param.hash = {
.data = &raw_data,
- .hash = &bl31_hash,
+ .hash = &soc_fw_hash,
}
}
}
},
/*
- * BL3-2
+ * Trusted OS Firmware
*/
- [BL32_KEY_CERT_ID] = {
- .img_id = BL32_KEY_CERT_ID,
+ [TRUSTED_OS_FW_KEY_CERT_ID] = {
+ .img_id = TRUSTED_OS_FW_KEY_CERT_ID,
.img_type = IMG_CERT,
.parent = &cot_desc[TRUSTED_KEY_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_SIG,
.param.sig = {
- .pk = &tz_world_pk,
+ .pk = &trusted_world_pk,
.sig = &sig,
.alg = &sig_alg,
.data = &raw_data,
@@ -331,23 +331,23 @@
},
.authenticated_data = {
[0] = {
- .type_desc = &bl32_content_pk,
+ .type_desc = &tos_fw_content_pk,
.data = {
- .ptr = (void *)plat_content_pk,
+ .ptr = (void *)content_pk_buf,
.len = (unsigned int)PK_DER_LEN
}
}
}
},
- [BL32_CERT_ID] = {
- .img_id = BL32_CERT_ID,
+ [TRUSTED_OS_FW_CONTENT_CERT_ID] = {
+ .img_id = TRUSTED_OS_FW_CONTENT_CERT_ID,
.img_type = IMG_CERT,
- .parent = &cot_desc[BL32_KEY_CERT_ID],
+ .parent = &cot_desc[TRUSTED_OS_FW_KEY_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_SIG,
.param.sig = {
- .pk = &bl32_content_pk,
+ .pk = &tos_fw_content_pk,
.sig = &sig,
.alg = &sig_alg,
.data = &raw_data,
@@ -356,9 +356,9 @@
},
.authenticated_data = {
[0] = {
- .type_desc = &bl32_hash,
+ .type_desc = &tos_fw_hash,
.data = {
- .ptr = (void *)plat_bl32_hash_buf,
+ .ptr = (void *)tos_fw_hash_buf,
.len = (unsigned int)HASH_DER_LEN
}
}
@@ -367,29 +367,29 @@
[BL32_IMAGE_ID] = {
.img_id = BL32_IMAGE_ID,
.img_type = IMG_RAW,
- .parent = &cot_desc[BL32_CERT_ID],
+ .parent = &cot_desc[TRUSTED_OS_FW_CONTENT_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_HASH,
.param.hash = {
.data = &raw_data,
- .hash = &bl32_hash,
+ .hash = &tos_fw_hash,
}
}
}
},
/*
- * BL3-3
+ * Non-Trusted Firmware
*/
- [BL33_KEY_CERT_ID] = {
- .img_id = BL33_KEY_CERT_ID,
+ [NON_TRUSTED_FW_KEY_CERT_ID] = {
+ .img_id = NON_TRUSTED_FW_KEY_CERT_ID,
.img_type = IMG_CERT,
.parent = &cot_desc[TRUSTED_KEY_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_SIG,
.param.sig = {
- .pk = &ntz_world_pk,
+ .pk = &non_trusted_world_pk,
.sig = &sig,
.alg = &sig_alg,
.data = &raw_data,
@@ -398,23 +398,23 @@
},
.authenticated_data = {
[0] = {
- .type_desc = &bl33_content_pk,
+ .type_desc = &nt_fw_content_pk,
.data = {
- .ptr = (void *)plat_content_pk,
+ .ptr = (void *)content_pk_buf,
.len = (unsigned int)PK_DER_LEN
}
}
}
},
- [BL33_CERT_ID] = {
- .img_id = BL33_CERT_ID,
+ [NON_TRUSTED_FW_CONTENT_CERT_ID] = {
+ .img_id = NON_TRUSTED_FW_CONTENT_CERT_ID,
.img_type = IMG_CERT,
- .parent = &cot_desc[BL33_KEY_CERT_ID],
+ .parent = &cot_desc[NON_TRUSTED_FW_KEY_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_SIG,
.param.sig = {
- .pk = &bl33_content_pk,
+ .pk = &nt_fw_content_pk,
.sig = &sig,
.alg = &sig_alg,
.data = &raw_data,
@@ -423,9 +423,9 @@
},
.authenticated_data = {
[0] = {
- .type_desc = &bl33_hash,
+ .type_desc = &nt_world_bl_hash,
.data = {
- .ptr = (void *)plat_bl33_hash_buf,
+ .ptr = (void *)nt_world_bl_hash_buf,
.len = (unsigned int)HASH_DER_LEN
}
}
@@ -434,13 +434,13 @@
[BL33_IMAGE_ID] = {
.img_id = BL33_IMAGE_ID,
.img_type = IMG_RAW,
- .parent = &cot_desc[BL33_CERT_ID],
+ .parent = &cot_desc[NON_TRUSTED_FW_CONTENT_CERT_ID],
.img_auth_methods = {
[0] = {
.type = AUTH_METHOD_HASH,
.param.hash = {
.data = &raw_data,
- .hash = &bl33_hash,
+ .hash = &nt_world_bl_hash,
}
}
}
@@ -467,21 +467,21 @@
[0] = {
.type_desc = &scp_bl2u_hash,
.data = {
- .ptr = (void *)plat_bl30_hash_buf,
+ .ptr = (void *)scp_fw_hash_buf,
.len = (unsigned int)HASH_DER_LEN
}
},
[1] = {
.type_desc = &bl2u_hash,
.data = {
- .ptr = (void *)plat_bl2_hash_buf,
+ .ptr = (void *)tb_fw_hash_buf,
.len = (unsigned int)HASH_DER_LEN
}
},
[2] = {
.type_desc = &ns_bl2u_hash,
.data = {
- .ptr = (void *)plat_bl33_hash_buf,
+ .ptr = (void *)nt_world_bl_hash_buf,
.len = (unsigned int)HASH_DER_LEN
}
}