mirror of https://github.com/acidanthera/audk.git
SecurityPkg Tpm12CommandLib: Fix TPM12 GetCapability response error
TPM12 command lib doesn't convert Response Size before using. Add logic to fix the issue. Cc: Long Qin <qin.long@intel.com> Cc: Yao Jiewen <jiewen.yao@intel.com> Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Long Qin <qin.long@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com>
This commit is contained in:
parent
dd577319e8
commit
28892d768b
|
@ -1,7 +1,7 @@
|
|||
/** @file
|
||||
Implement TPM1.2 Get Capabilities related commands.
|
||||
|
||||
Copyright (c) 2016 - 2017, Intel Corporation. All rights reserved. <BR>
|
||||
Copyright (c) 2016 - 2018, Intel Corporation. All rights reserved. <BR>
|
||||
This program and the accompanying materials
|
||||
are licensed and made available under the terms and conditions of the BSD License
|
||||
which accompanies this distribution. The full text of the license may be found at
|
||||
|
@ -85,7 +85,7 @@ Tpm12GetCapabilityFlagPermanent (
|
|||
}
|
||||
|
||||
ZeroMem (TpmPermanentFlags, sizeof (*TpmPermanentFlags));
|
||||
CopyMem (TpmPermanentFlags, &Response.Flags, MIN (sizeof (*TpmPermanentFlags), Response.ResponseSize));
|
||||
CopyMem (TpmPermanentFlags, &Response.Flags, MIN (sizeof (*TpmPermanentFlags), SwapBytes32(Response.ResponseSize)));
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@ -131,7 +131,7 @@ Tpm12GetCapabilityFlagVolatile (
|
|||
}
|
||||
|
||||
ZeroMem (VolatileFlags, sizeof (*VolatileFlags));
|
||||
CopyMem (VolatileFlags, &Response.Flags, MIN (sizeof (*VolatileFlags), Response.ResponseSize));
|
||||
CopyMem (VolatileFlags, &Response.Flags, MIN (sizeof (*VolatileFlags), SwapBytes32(Response.ResponseSize)));
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue