public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Zhang, Chao B" <chao.b.zhang@intel.com>
To: "Dong, Eric" <eric.dong@intel.com>,
	"edk2-devel@lists.01.org" <edk2-devel@lists.01.org>
Cc: "Yao, Jiewen" <jiewen.yao@intel.com>
Subject: Re: [Patch 07/10] SecurityPkg SmmTcg2PhysicalPresenceLib: Enable Storage actions.
Date: Thu, 17 Nov 2016 05:58:13 +0000	[thread overview]
Message-ID: <FF72C7E4248F3C4E9BDF19D4918E90F2472EB25A@shsmsx102.ccr.corp.intel.com> (raw)
In-Reply-To: <1479276049-34308-8-git-send-email-eric.dong@intel.com>

Eric: 
  Suggest update commit log with the spec name/version of this feature





Thanks & Best regards
Chao Zhang


-----Original Message-----
From: Dong, Eric 
Sent: Wednesday, November 16, 2016 2:01 PM
To: edk2-devel@lists.01.org
Cc: Yao, Jiewen; Zhang, Chao B
Subject: [Patch 07/10] SecurityPkg SmmTcg2PhysicalPresenceLib: Enable Storage actions.

After enable storage related actions in the
TcgPhysicalPresenceStorageLib, use this library to support
storage related actions in this library.

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Chao Zhang <chao.b.zhang@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Eric Dong <eric.dong@intel.com>
---
 .../SmmTcg2PhysicalPresenceLib.c                   | 41 +++++++++++++++++-----
 .../SmmTcg2PhysicalPresenceLib.inf                 |  2 ++
 2 files changed, 35 insertions(+), 8 deletions(-)

diff --git a/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c b/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c
index 039bca1..e3f7150 100644
--- a/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c
+++ b/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c
@@ -31,6 +31,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
 #include <Library/BaseMemoryLib.h>
 #include <Library/Tcg2PpVendorLib.h>
 #include <Library/SmmServicesTableLib.h>
+#include <Library/TcgPhysicalPresenceStorageLib.h>
 
 EFI_SMM_VARIABLE_PROTOCOL  *mTcg2PpSmmVariable;
 
@@ -129,8 +130,10 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunctionEx (
     goto EXIT;
   }
 
-  if ((*OperationRequest > TCG2_PHYSICAL_PRESENCE_NO_ACTION_MAX) &&
-      (*OperationRequest < TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION) ) {
+  if (((*OperationRequest > TCG2_PHYSICAL_PRESENCE_NO_ACTION_MAX) &&
+       (*OperationRequest < TCG2_PHYSICAL_PRESENCE_STORAGE_MANAGEMENT_BEGIN))||
+      ((*OperationRequest > TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_DISABLE_BLOCK_SID_FUNC_FALSE) &&
+       (*OperationRequest < TCG2_PHYSICAL_PRESENCE_STORAGE_MANAGEMENT_BEGIN))) {
     //
     // This command requires UI to prompt user for Auth data.
     //
@@ -244,12 +247,13 @@ Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction (
   IN UINT32                 OperationRequest
   )
 {
-  EFI_STATUS                        Status;
-  UINTN                             DataSize;
-  EFI_TCG2_PHYSICAL_PRESENCE        PpData;
-  EFI_TCG2_PHYSICAL_PRESENCE_FLAGS  Flags;
-  BOOLEAN                           RequestConfirmed;
-  
+  EFI_STATUS                               Status;
+  UINTN                                    DataSize;
+  EFI_TCG2_PHYSICAL_PRESENCE               PpData;
+  EFI_TCG2_PHYSICAL_PRESENCE_FLAGS         Flags;
+  UINT32                                   StorageFlags;
+  BOOLEAN                                  RequestConfirmed;
+
   DEBUG ((EFI_D_INFO, "[TPM2] GetUserConfirmationStatusFunction, Request = %x\n", OperationRequest));
 
   //
@@ -283,6 +287,11 @@ Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction (
     return TCG_PP_GET_USER_CONFIRMATION_BLOCKED_BY_BIOS_CONFIGURATION;
   }
 
+  //
+  // Get the Physical Presence storage flags
+  //
+  StorageFlags = TcgPhysicalPresenceStorageLibReturnStorageFlags();
+
   RequestConfirmed = FALSE;
 
   switch (OperationRequest) {
@@ -318,6 +327,22 @@ Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction (
       RequestConfirmed = TRUE;
       break;
 
+    case TCG2_PHYSICAL_PRESENCE_ENABLE_BLOCK_SID:
+      if ((StorageFlags & TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_ENABLE_BLOCK_SID) == 0) {
+        RequestConfirmed = TRUE;
+      }
+      break;
+
+    case TCG2_PHYSICAL_PRESENCE_DISABLE_BLOCK_SID:
+      if ((StorageFlags & TCG_BIOS_STORAGE_MANAGEMENT_FLAG_PP_REQUIRED_FOR_DISABLE_BLOCK_SID) == 0) {
+        RequestConfirmed = TRUE;
+      }
+      break;
+
+    case TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_ENABLE_BLOCK_SID_FUNC_TRUE:
+    case TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_DISABLE_BLOCK_SID_FUNC_TRUE:
+      break;
+
     default:
       if (OperationRequest <= TCG2_PHYSICAL_PRESENCE_NO_ACTION_MAX) {
         RequestConfirmed = TRUE;
diff --git a/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.inf b/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.inf
index 5fa84b1..a039bbc 100644
--- a/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.inf
+++ b/SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.inf
@@ -47,6 +47,8 @@
   SmmServicesTableLib
   BaseMemoryLib
 
+  TcgPhysicalPresenceStorageLib
+
 [Guids]
   ## SOMETIMES_PRODUCES ## Variable:L"PhysicalPresence"
   ## SOMETIMES_CONSUMES ## Variable:L"PhysicalPresence"
-- 
2.6.4.windows.1



  reply	other threads:[~2016-11-17  5:58 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-16  6:00 [Patch 00/10] Enable BlockSid related PP actions Eric Dong
2016-11-16  6:00 ` [Patch 01/10] SecurityPkg: Add definition for Physical Presence storage flag Eric Dong
2016-11-16  6:00 ` [Patch 02/10] SecurityPkg: Add header file for TcgPhysicalPresenceStorageLib Eric Dong
2016-11-16  6:00 ` [Patch 03/10] SecurityPkg: Add DxeTcgPhysicalPresenceStorageLib Eric Dong
2016-11-17  5:49   ` Zhang, Chao B
2016-11-16  6:00 ` [Patch 04/10] SecurityPkg: Add SmmTcgPhysicalPresenceStorageLib Eric Dong
2016-11-16  6:00 ` [Patch 05/10] SecurityPkg DxeTcg2PhysicalPresenceLib: Enable Storage actions Eric Dong
2016-11-16  6:00 ` [Patch 06/10] SecurityPkg DxeTcgPhysicalPresenceLib: " Eric Dong
2016-11-16  6:00 ` [Patch 07/10] SecurityPkg SmmTcg2PhysicalPresenceLib: " Eric Dong
2016-11-17  5:58   ` Zhang, Chao B [this message]
2016-11-16  6:00 ` [Patch 08/10] SecurityPkg TcgSmm: " Eric Dong
2016-11-16  6:00 ` [Patch 09/10] SecurityPkg OpalPasswordDxe: Use PP actions to enable BlockSID Eric Dong
2016-11-16  6:00 ` [Patch 10/10] SecurityPkg Tcg2Config: Remove the empty options Eric Dong
2016-11-21  3:31 ` [Patch 00/10] Enable BlockSid related PP actions Yao, Jiewen
2016-11-23  8:12   ` Dong, Eric
2016-11-23  8:14     ` Yao, Jiewen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=FF72C7E4248F3C4E9BDF19D4918E90F2472EB25A@shsmsx102.ccr.corp.intel.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox