SecurityPkg/Tcg: Fix bug that prevented SubmitCommand buffers from being Max size
authorZhang, Chao B <chao.b.zhang@intel.com>
Fri, 1 Jul 2016 02:32:27 +0000 (10:32 +0800)
committerZhang, Chao B <chao.b.zhang@intel.com>
Fri, 1 Jul 2016 02:33:47 +0000 (10:33 +0800)
SubmitCommand() was checking the buffer size for ">=" Max size. This would
cause code to fail with "EFI_INVALID_PARAMETER" if a buffer was passed
that was the "max" size as indicated by the GetCapability() command.
Change to ">" to allow for maximum buffer size.

Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Bret Barkelew <brbarkel@microsoft.com>
Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
Reviewed-by: Chao Zhang <chao.b.zhang@intel.com>
SecurityPkg/Tcg/Tcg2Dxe/Tcg2Dxe.c
SecurityPkg/Tcg/TrEEDxe/TrEEDxe.c

index bdff5bd598a40428f3623973b93dc756487222e2..7720c2708db9128c66f1370c081151b7d32e9074 100644 (file)
@@ -1330,10 +1330,10 @@ Tcg2SubmitCommand (
     return EFI_DEVICE_ERROR;\r
   }\r
 \r
-  if (InputParameterBlockSize >= mTcgDxeData.BsCap.MaxCommandSize) {\r
+  if (InputParameterBlockSize > mTcgDxeData.BsCap.MaxCommandSize) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  if (OutputParameterBlockSize >= mTcgDxeData.BsCap.MaxResponseSize) {\r
+  if (OutputParameterBlockSize > mTcgDxeData.BsCap.MaxResponseSize) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r
index dfdee046885546ef49e742011179b3d31a7663d6..a30cd5161d40210ac297124bd13be644c5b52ad1 100644 (file)
@@ -893,10 +893,10 @@ TreeSubmitCommand (
     return EFI_UNSUPPORTED;\r
   }\r
 \r
-  if (InputParameterBlockSize >= mTcgDxeData.BsCap.MaxCommandSize) {\r
+  if (InputParameterBlockSize > mTcgDxeData.BsCap.MaxCommandSize) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
-  if (OutputParameterBlockSize >= mTcgDxeData.BsCap.MaxResponseSize) {\r
+  if (OutputParameterBlockSize > mTcgDxeData.BsCap.MaxResponseSize) {\r
     return EFI_INVALID_PARAMETER;\r
   }\r
 \r