mirror of https://github.com/acidanthera/audk.git
SecurityPkg: Use pointer instead of array to make code readable.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Qiu Shumin <shumin.qiu@intel.com> Reviewed-by: Yao Jiewen <Jiewen.Yao@intel.com> Reviewed-by: Chao Zhang <chao.b.zhang@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@18403 6f19259b-4bc3-4df7-8a09-765794883524
This commit is contained in:
parent
374ecd0450
commit
35e00ace19
|
@ -1456,6 +1456,7 @@ SetupEventLog (
|
||||||
UINT8 TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + (HASH_COUNT * sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)];
|
UINT8 TempBuf[sizeof(TCG_EfiSpecIDEventStruct) + (HASH_COUNT * sizeof(TCG_EfiSpecIdEventAlgorithmSize)) + sizeof(UINT8)];
|
||||||
TCG_PCR_EVENT_HDR FirstPcrEvent;
|
TCG_PCR_EVENT_HDR FirstPcrEvent;
|
||||||
TCG_EfiSpecIdEventAlgorithmSize *DigestSize;
|
TCG_EfiSpecIdEventAlgorithmSize *DigestSize;
|
||||||
|
TCG_EfiSpecIdEventAlgorithmSize *TempDigestSize;
|
||||||
UINT8 *VendorInfoSize;
|
UINT8 *VendorInfoSize;
|
||||||
UINT32 NumberOfAlgorithms;
|
UINT32 NumberOfAlgorithms;
|
||||||
|
|
||||||
|
@ -1501,32 +1502,44 @@ SetupEventLog (
|
||||||
NumberOfAlgorithms = 0;
|
NumberOfAlgorithms = 0;
|
||||||
DigestSize = (TCG_EfiSpecIdEventAlgorithmSize *)((UINT8 *)TcgEfiSpecIdEventStruct + sizeof(*TcgEfiSpecIdEventStruct) + sizeof(NumberOfAlgorithms));
|
DigestSize = (TCG_EfiSpecIdEventAlgorithmSize *)((UINT8 *)TcgEfiSpecIdEventStruct + sizeof(*TcgEfiSpecIdEventStruct) + sizeof(NumberOfAlgorithms));
|
||||||
if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA1) != 0) {
|
if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA1) != 0) {
|
||||||
DigestSize[NumberOfAlgorithms].algorithmId = TPM_ALG_SHA1;
|
TempDigestSize = DigestSize;
|
||||||
DigestSize[NumberOfAlgorithms].digestSize = SHA1_DIGEST_SIZE;
|
TempDigestSize += NumberOfAlgorithms;
|
||||||
|
TempDigestSize->algorithmId = TPM_ALG_SHA1;
|
||||||
|
TempDigestSize->digestSize = SHA1_DIGEST_SIZE;
|
||||||
NumberOfAlgorithms++;
|
NumberOfAlgorithms++;
|
||||||
}
|
}
|
||||||
if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA256) != 0) {
|
if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA256) != 0) {
|
||||||
DigestSize[NumberOfAlgorithms].algorithmId = TPM_ALG_SHA256;
|
TempDigestSize = DigestSize;
|
||||||
DigestSize[NumberOfAlgorithms].digestSize = SHA256_DIGEST_SIZE;
|
TempDigestSize += NumberOfAlgorithms;
|
||||||
|
TempDigestSize->algorithmId = TPM_ALG_SHA256;
|
||||||
|
TempDigestSize->digestSize = SHA256_DIGEST_SIZE;
|
||||||
NumberOfAlgorithms++;
|
NumberOfAlgorithms++;
|
||||||
}
|
}
|
||||||
if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA384) != 0) {
|
if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA384) != 0) {
|
||||||
DigestSize[NumberOfAlgorithms].algorithmId = TPM_ALG_SHA384;
|
TempDigestSize = DigestSize;
|
||||||
DigestSize[NumberOfAlgorithms].digestSize = SHA384_DIGEST_SIZE;
|
TempDigestSize += NumberOfAlgorithms;
|
||||||
|
TempDigestSize->algorithmId = TPM_ALG_SHA384;
|
||||||
|
TempDigestSize->digestSize = SHA384_DIGEST_SIZE;
|
||||||
NumberOfAlgorithms++;
|
NumberOfAlgorithms++;
|
||||||
}
|
}
|
||||||
if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA512) != 0) {
|
if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SHA512) != 0) {
|
||||||
DigestSize[NumberOfAlgorithms].algorithmId = TPM_ALG_SHA512;
|
TempDigestSize = DigestSize;
|
||||||
DigestSize[NumberOfAlgorithms].digestSize = SHA512_DIGEST_SIZE;
|
TempDigestSize += NumberOfAlgorithms;
|
||||||
|
TempDigestSize->algorithmId = TPM_ALG_SHA512;
|
||||||
|
TempDigestSize->digestSize = SHA512_DIGEST_SIZE;
|
||||||
NumberOfAlgorithms++;
|
NumberOfAlgorithms++;
|
||||||
}
|
}
|
||||||
if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SM3_256) != 0) {
|
if ((mTcgDxeData.BsCap.ActivePcrBanks & EFI_TCG2_BOOT_HASH_ALG_SM3_256) != 0) {
|
||||||
DigestSize[NumberOfAlgorithms].algorithmId = TPM_ALG_SM3_256;
|
TempDigestSize = DigestSize;
|
||||||
DigestSize[NumberOfAlgorithms].digestSize = SM3_256_DIGEST_SIZE;
|
TempDigestSize += NumberOfAlgorithms;
|
||||||
|
TempDigestSize->algorithmId = TPM_ALG_SM3_256;
|
||||||
|
TempDigestSize->digestSize = SM3_256_DIGEST_SIZE;
|
||||||
NumberOfAlgorithms++;
|
NumberOfAlgorithms++;
|
||||||
}
|
}
|
||||||
CopyMem (TcgEfiSpecIdEventStruct + 1, &NumberOfAlgorithms, sizeof(NumberOfAlgorithms));
|
CopyMem (TcgEfiSpecIdEventStruct + 1, &NumberOfAlgorithms, sizeof(NumberOfAlgorithms));
|
||||||
VendorInfoSize = (UINT8 *)&DigestSize[NumberOfAlgorithms];
|
TempDigestSize = DigestSize;
|
||||||
|
TempDigestSize += NumberOfAlgorithms;
|
||||||
|
VendorInfoSize = (UINT8 *)TempDigestSize;
|
||||||
*VendorInfoSize = 0;
|
*VendorInfoSize = 0;
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
Loading…
Reference in New Issue