SecurityPkg\SmmTcg2PhysicalPresenceLib.c Handle reserved or unimplemented PP Operation
authorZhang, Chao B <chao.b.zhang@intel.com>
Fri, 22 Sep 2017 06:40:12 +0000 (14:40 +0800)
committerZhang, Chao B <chao.b.zhang@intel.com>
Thu, 28 Sep 2017 03:29:42 +0000 (11:29 +0800)
Several PP operations < 128(Vendor Specific) are reserved or unimplemented.
Follow TCG PC Client Platform Physical Presence Interface Specification to return
not implemented.
https://trustedcomputinggroup.org/wp-content/uploads/Physical-Presence-Interface_1-30_0-52.pdf

Cc: Jiewen Yao <jiewen.yao@intel.com>
Cc: Star Zeng <star.zeng@intel.com>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Chao Zhang <chao.b.zhang@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Star Zeng <star.zeng@intel.com>
SecurityPkg/Library/SmmTcg2PhysicalPresenceLib/SmmTcg2PhysicalPresenceLib.c

index ba4db1113aed5ae1431eb774366350126173285c..606145315b67b10d68967a2d5559297316050137 100644 (file)
@@ -10,7 +10,7 @@
   Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction() and Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction()\r
   will receive untrusted input and do validation.\r
 \r
-Copyright (c) 2015 - 2016, Intel Corporation. All rights reserved.<BR>\r
+Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.<BR>\r
 This program and the accompanying materials \r
 are licensed and made available under the terms and conditions of the BSD License \r
 which accompanies this distribution.  The full text of the license may be found at \r
@@ -291,6 +291,7 @@ Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction (
       }\r
       break;\r
 \r
+    case TCG2_PHYSICAL_PRESENCE_NO_ACTION:\r
     case TCG2_PHYSICAL_PRESENCE_SET_PP_REQUIRED_FOR_CLEAR_TRUE:\r
       RequestConfirmed = TRUE;\r
       break;\r
@@ -336,12 +337,11 @@ Tcg2PhysicalPresenceLibGetUserConfirmationStatusFunction (
       break;\r
 \r
     default:\r
-      if (OperationRequest <= TCG2_PHYSICAL_PRESENCE_NO_ACTION_MAX) {\r
-        RequestConfirmed = TRUE;\r
-      } else {\r
-        if (OperationRequest < TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION) {\r
-          return TCG_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED;\r
-        }\r
+      if (OperationRequest < TCG2_PHYSICAL_PRESENCE_VENDOR_SPECIFIC_OPERATION) {\r
+        //\r
+        // TCG PP spec defined operations that are reserved or un-implemented\r
+        //\r
+        return TCG_PP_GET_USER_CONFIRMATION_NOT_IMPLEMENTED;\r
       }\r
       break;\r
   }\r