From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga05.intel.com (mga05.intel.com []) by mx.groups.io with SMTP id smtpd.web10.50756.1594007384981362438 for ; Sun, 05 Jul 2020 20:49:53 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=fail (domain: intel.com, ip: , mailfrom: qi1.zhang@intel.com) IronPort-SDR: uS3WN5O8cQ3AC9EcXsNhPR2cRrppLVIA41EvSO3mqDjMQcQDoEGfLsDWaTVKpZHfJ6s48WNxZo vB8rB5yFLmXg== X-IronPort-AV: E=McAfee;i="6000,8403,9673"; a="232202688" X-IronPort-AV: E=Sophos;i="5.75,318,1589266800"; d="scan'208";a="232202688" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Jul 2020 20:49:53 -0700 IronPort-SDR: UVSG4geCs0ld6i50Mjv1JEhZsNiRTDVUJxcmVBDQOLZry7gwq4mIR/J4g7gQswtzisvTijB1xT IomcbhaHXhiA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,318,1589266800"; d="scan'208";a="456555658" Received: from shwdesssddpdqi.ccr.corp.intel.com ([10.239.9.10]) by orsmga005.jf.intel.com with ESMTP; 05 Jul 2020 20:49:51 -0700 From: Qi Zhang To: devel@edk2.groups.io Cc: Qi Zhang , Jiewen Yao , Jian J Wang , Chao Zhang , Rahul Kumar Subject: [PATCH v3 2/2] SecurityPkg/Tcg2Config: remove TPM2_ChangEPS if it is not supported. Date: Mon, 6 Jul 2020 11:49:33 +0800 Message-Id: <20200706034933.3605-3-qi1.zhang@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 In-Reply-To: <20200706034933.3605-1-qi1.zhang@intel.com> References: <20200706034933.3605-1-qi1.zhang@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2793 In current implementation TPM2_ChangeEPS command is always available in the TPM2 operation pull down list in TCG2 Configuration, which is confusing when the command is not supported by specific TPM chip. As a user experience improvement, TPM2_ChangeEPS command should be removed from the list when it is not supported. Cc: Jiewen Yao Cc: Jian J Wang Cc: Chao Zhang Cc: Rahul Kumar Signed-off-by: Qi Zhang --- SecurityPkg/Tcg/Tcg2Config/Tcg2Config.vfr | 2 ++ SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c | 7 +++++++ SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h | 1 + 3 files changed, 10 insertions(+) diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2Config.vfr b/SecurityPkg/Tcg/Tc= g2Config/Tcg2Config.vfr index 91a463997c..47d63b009d 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2Config.vfr +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2Config.vfr @@ -144,7 +144,9 @@ formset option text =3D STRING_TOKEN(STR_TCG2_DISABLE), value =3D TCG2= _PHYSICAL_PRESENCE_DISABLE, flags =3D RESET_REQUIRED;=0D option text =3D STRING_TOKEN(STR_TCG2_CLEAR), value =3D TCG2_P= HYSICAL_PRESENCE_CLEAR, flags =3D RESET_REQUIRED;=0D option text =3D STRING_TOKEN(STR_TCG2_SET_PCD_BANKS), value = =3D TCG2_PHYSICAL_PRESENCE_SET_PCR_BANKS, flags =3D RESET_REQUIRED;=0D + suppressif ideqval TCG2_CONFIGURATION_INFO.ChangeEPSSupported = =3D=3D 0;=0D option text =3D STRING_TOKEN(STR_TCG2_CHANGE_EPS), value =3D T= CG2_PHYSICAL_PRESENCE_CHANGE_EPS, flags =3D RESET_REQUIRED;=0D + endif=0D option text =3D STRING_TOKEN(STR_TCG2_LOG_ALL_DIGESTS), value = =3D TCG2_PHYSICAL_PRESENCE_LOG_ALL_DIGESTS, flags =3D RESET_REQUIRED;=0D option text =3D STRING_TOKEN(STR_TCG2_DISABLE_ENDORSEMENT_ENAB= LE_STORAGE_HIERARCHY), value =3D TCG2_PHYSICAL_PRESENCE_DISABLE_ENDORSEMENT= _ENABLE_STORAGE_HIERARCHY, flags =3D RESET_REQUIRED;=0D endoneof;=0D diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c b/SecurityPkg/Tcg/= Tcg2Config/Tcg2ConfigImpl.c index baa8fcd08d..f3731d7990 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigImpl.c @@ -788,6 +788,7 @@ InstallTcg2ConfigForm ( CHAR16 TempBuffer[1024];=0D TCG2_CONFIGURATION_INFO Tcg2ConfigInfo;=0D TPM2_PTP_INTERFACE_TYPE TpmDeviceInterfaceDetected;=0D + BOOLEAN IsCmdImp =3D FALSE;=0D =0D DriverHandle =3D NULL;=0D ConfigAccess =3D &PrivateData->ConfigAccess;=0D @@ -870,6 +871,12 @@ InstallTcg2ConfigForm ( HiiSetString (PrivateData->HiiHandle, STRING_TOKEN (STR_TPM2_SUPPORTED= _HASH_ALGO_CONTENT), TempBuffer, NULL);=0D }=0D =0D + Status =3D Tpm2GetCapabilityIsCommandImplemented (TPM_CC_ChangeEPS, &IsC= mdImp);=0D + if (EFI_ERROR (Status)) {=0D + DEBUG ((EFI_D_ERROR, "Tpm2GetCapabilityIsCmdImpl fails %r\n", Status))= ;=0D + }=0D + Tcg2ConfigInfo.ChangeEPSSupported =3D IsCmdImp;=0D +=0D FillBufferWithBootHashAlg (TempBuffer, sizeof(TempBuffer), PcdGet32 (Pcd= Tcg2HashAlgorithmBitmap));=0D HiiSetString (PrivateData->HiiHandle, STRING_TOKEN (STR_BIOS_HASH_ALGO_C= ONTENT), TempBuffer, NULL);=0D =0D diff --git a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h b/SecurityPkg/Tc= g/Tcg2Config/Tcg2ConfigNvData.h index a91c052850..b84af40a04 100644 --- a/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h +++ b/SecurityPkg/Tcg/Tcg2Config/Tcg2ConfigNvData.h @@ -70,6 +70,7 @@ typedef struct { UINT8 TpmDeviceInterfaceAttempt;=0D BOOLEAN TpmDeviceInterfacePtpFifoSupported;=0D BOOLEAN TpmDeviceInterfacePtpCrbSupported;=0D + BOOLEAN ChangeEPSSupported;=0D } TCG2_CONFIGURATION_INFO;=0D =0D //=0D --=20 2.26.2.windows.1