SecurityPkg/Tcg: Fix bug that prevented SubmitCommand buffers from being Max size

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>
This commit is contained in:
Zhang, Chao B 2016-07-01 10:32:27 +08:00
parent 1d9869f9e9
commit e1f3583409
2 changed files with 4 additions and 4 deletions

View File

@ -1330,10 +1330,10 @@ Tcg2SubmitCommand (
return EFI_DEVICE_ERROR;
}
if (InputParameterBlockSize >= mTcgDxeData.BsCap.MaxCommandSize) {
if (InputParameterBlockSize > mTcgDxeData.BsCap.MaxCommandSize) {
return EFI_INVALID_PARAMETER;
}
if (OutputParameterBlockSize >= mTcgDxeData.BsCap.MaxResponseSize) {
if (OutputParameterBlockSize > mTcgDxeData.BsCap.MaxResponseSize) {
return EFI_INVALID_PARAMETER;
}

View File

@ -893,10 +893,10 @@ TreeSubmitCommand (
return EFI_UNSUPPORTED;
}
if (InputParameterBlockSize >= mTcgDxeData.BsCap.MaxCommandSize) {
if (InputParameterBlockSize > mTcgDxeData.BsCap.MaxCommandSize) {
return EFI_INVALID_PARAMETER;
}
if (OutputParameterBlockSize >= mTcgDxeData.BsCap.MaxResponseSize) {
if (OutputParameterBlockSize > mTcgDxeData.BsCap.MaxResponseSize) {
return EFI_INVALID_PARAMETER;
}