TPM20: Add support for new commands

TCG Spec 1.59 defines two new tpm commands:
TPM2_CC_CertifyX509, and TPM2_CC_ACT_SetTimeout
This commit add support for these new commands.

Change-Id: Ibbeb85dac88a874bb57fe097b979adbfd9d92e9f
Reviewed-on: https://code.wireshark.org/review/37943
Petri-Dish: Anders Broman <a.broman58@gmail.com>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
Tadeusz Struk 2020-07-22 17:02:14 -07:00 committed by Anders Broman
parent 18bc35e3e5
commit fc0581e032
1 changed files with 24 additions and 0 deletions

View File

@ -63,6 +63,7 @@ static int hf_tpmi_dh_parent = -1;
static int hf_tpmi_dh_pcr = -1;
static int hf_tpmi_ht_handle = -1;
static int hf_tpmi_sh_auth_session = -1;
static int hf_tpmi_rh_act = -1;
static int hf_auth_area_size = -1;
static int hf_session_nonce_size = -1;
static int hf_session_nonce = -1;
@ -250,6 +251,8 @@ struct num_handles tpm_handles_map[] = {
{ 0x194, 1, { &hf_tpmi_ht_handle, 0, 0 }, 0, { 0, 0, 0 }}, /* CC_AC_GetCapability */
{ 0x195, 3, { &hf_tpmi_dh_object, &hf_tpmi_rh_nv_auth, &hf_tpmi_ht_handle }, 0, { 0, 0, 0 }}, /* CC_AC_Send */
{ 0x196, 1, { &hf_tpmi_sh_auth_session, 0, 0 }, 0, { 0, 0, 0 }}, /* CC_Policy_AC_SendSelect */
{ 0x197, 2, { &hf_tpmi_dh_object, &hf_tpmi_dh_object, 0 }, 0, { 0, 0, 0 }}, /* CC_CertifyX509 */
{ 0x198, 1, { &hf_tpmi_rh_act, 0, 0 }, 0, { 0, 0, 0 }}, /* TPM_CC_ACT_SetTimeout */
};
static void get_num_hndl(struct num_handles *map)
@ -285,6 +288,22 @@ static const value_string handles[] = {
{ 0x4000000D, "TPM2_RH_PLATFORM_NV" },
{ 0x40000010, "TPM2_RH_AUTH_00" },
{ 0x4000010F, "TPM2_RH_AUTH_FF" },
{ 0x40000110, "TPM_RH_ACT_0" },
{ 0x40000111, "TPM_RH_ACT_1" },
{ 0x40000112, "TPM_RH_ACT_2" },
{ 0x40000113, "TPM_RH_ACT_3" },
{ 0x40000114, "TPM_RH_ACT_4" },
{ 0x40000115, "TPM_RH_ACT_5" },
{ 0x40000116, "TPM_RH_ACT_6" },
{ 0x40000117, "TPM_RH_ACT_7" },
{ 0x40000118, "TPM_RH_ACT_8" },
{ 0x40000119, "TPM_RH_ACT_9" },
{ 0x4000011A, "TPM_RH_ACT_10" },
{ 0x4000011B, "TPM_RH_ACT_11" },
{ 0x4000011C, "TPM_RH_ACT_12" },
{ 0x4000011D, "TPM_RH_ACT_13" },
{ 0x4000011E, "TPM_RH_ACT_14" },
{ 0x4000011F, "TPM_RH_ACT_15" },
{ 0, NULL }
};
@ -476,6 +495,8 @@ static const value_string commands[] = {
{ 0x194, "TPM2_CC_AC_GetCapability" },
{ 0x195, "TPM2_CC_AC_Send" },
{ 0x196, "TPM2_CC_Policy_AC_SendSelect" },
{ 0x197, "TPM2_CC_CertifyX509" },
{ 0x198, "TPM2_CC_ACT_SetTimeout" },
{ 0, NULL }
};
@ -1180,6 +1201,9 @@ static hf_register_info hf[] = {
{ &hf_tpmi_sh_auth_session,
{ "TPMI_SH_AUTH_SESSION", "tpm.handle.TPMI_SH_AUTH_SESSION", FT_UINT32, BASE_HEX, VALS(handles),
0x0, NULL, HFILL }},
{ &hf_tpmi_rh_act,
{ "TPMI_RH_ACT", "tpm.handle.TPMI_RH_ACT", FT_UINT32, BASE_HEX, VALS(handles),
0x0, NULL, HFILL }},
{ &hf_tpmi_rh_hierarhy,
{ "TPMI_RH_HIERARCHY", "tpm.handle.TPMI_RH_HIERARCHY", FT_UINT32, BASE_HEX, VALS(hierarhies),
0x0, NULL, HFILL }},