diff options
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/auth/tbbr/tbbr_cot.c | 204 |
1 files changed, 102 insertions, 102 deletions
diff --git a/drivers/auth/tbbr/tbbr_cot.c b/drivers/auth/tbbr/tbbr_cot.c index 71634a19..ab0243da 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 sig_alg = AUTH_PARAM_TYPE_DESC( 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 @@ static const auth_img_desc_t cot_desc[] = { /* * 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 @@ static const auth_img_desc_t cot_desc[] = { }, .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 @@ static const auth_img_desc_t cot_desc[] = { [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 @@ static const auth_img_desc_t cot_desc[] = { }, .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 @@ static const auth_img_desc_t cot_desc[] = { }, .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 @@ static const auth_img_desc_t cot_desc[] = { }, .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 @@ static const auth_img_desc_t cot_desc[] = { [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 @@ static const auth_img_desc_t cot_desc[] = { }, .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 @@ static const auth_img_desc_t cot_desc[] = { }, .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 @@ static const auth_img_desc_t cot_desc[] = { [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 @@ static const auth_img_desc_t cot_desc[] = { }, .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 @@ static const auth_img_desc_t cot_desc[] = { }, .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 @@ static const auth_img_desc_t cot_desc[] = { [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 @@ static const auth_img_desc_t cot_desc[] = { }, .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 @@ static const auth_img_desc_t cot_desc[] = { }, .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 @@ static const auth_img_desc_t cot_desc[] = { [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 @@ static const auth_img_desc_t cot_desc[] = { [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 } } |