X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=SecurityPkg%2FLibrary%2FTpm2CommandLib%2FTpm2Integrity.c;fp=SecurityPkg%2FLibrary%2FTpm2CommandLib%2FTpm2Integrity.c;h=8c87de0b0cb9b9e9655015f0b3c928528e791e6e;hb=e905fbb05adfc050e2953309e64f44e8562c0ddd;hp=ddb15178fb6a5e434c71d5623b4f2978b2372c47;hpb=ca56749b0eba28d429e3d58fabca26c6a995fa44;p=mirror_edk2.git diff --git a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Integrity.c b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Integrity.c index ddb15178fb..8c87de0b0c 100644 --- a/SecurityPkg/Library/Tpm2CommandLib/Tpm2Integrity.c +++ b/SecurityPkg/Library/Tpm2CommandLib/Tpm2Integrity.c @@ -130,7 +130,7 @@ Tpm2PcrExtend ( Buffer += sizeof(UINT16); DigestSize = GetHashSizeFromAlgo (Digests->digests[Index].hashAlg); if (DigestSize == 0) { - DEBUG ((EFI_D_ERROR, "Unknown hash algorithm %d\r\n", Digests->digests[Index].hashAlg)); + DEBUG ((DEBUG_ERROR, "Unknown hash algorithm %d\r\n", Digests->digests[Index].hashAlg)); return EFI_DEVICE_ERROR; } CopyMem( @@ -151,7 +151,7 @@ Tpm2PcrExtend ( } if (ResultBufSize > sizeof(Res)) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrExtend: Failed ExecuteCommand: Buffer Too Small\r\n")); + DEBUG ((DEBUG_ERROR, "Tpm2PcrExtend: Failed ExecuteCommand: Buffer Too Small\r\n")); return EFI_BUFFER_TOO_SMALL; } @@ -160,7 +160,7 @@ Tpm2PcrExtend ( // RespSize = SwapBytes32(Res.Header.paramSize); if (RespSize > sizeof(Res)) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrExtend: Response size too large! %d\r\n", RespSize)); + DEBUG ((DEBUG_ERROR, "Tpm2PcrExtend: Response size too large! %d\r\n", RespSize)); return EFI_BUFFER_TOO_SMALL; } @@ -168,7 +168,7 @@ Tpm2PcrExtend ( // Fail if command failed // if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrExtend: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode))); + DEBUG ((DEBUG_ERROR, "Tpm2PcrExtend: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode))); return EFI_DEVICE_ERROR; } @@ -246,7 +246,7 @@ Tpm2PcrEvent ( } if (ResultBufSize > sizeof(Res)) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrEvent: Failed ExecuteCommand: Buffer Too Small\r\n")); + DEBUG ((DEBUG_ERROR, "Tpm2PcrEvent: Failed ExecuteCommand: Buffer Too Small\r\n")); return EFI_BUFFER_TOO_SMALL; } @@ -255,7 +255,7 @@ Tpm2PcrEvent ( // RespSize = SwapBytes32(Res.Header.paramSize); if (RespSize > sizeof(Res)) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrEvent: Response size too large! %d\r\n", RespSize)); + DEBUG ((DEBUG_ERROR, "Tpm2PcrEvent: Response size too large! %d\r\n", RespSize)); return EFI_BUFFER_TOO_SMALL; } @@ -263,7 +263,7 @@ Tpm2PcrEvent ( // Fail if command failed // if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrEvent: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode))); + DEBUG ((DEBUG_ERROR, "Tpm2PcrEvent: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode))); return EFI_DEVICE_ERROR; } @@ -284,7 +284,7 @@ Tpm2PcrEvent ( Buffer += sizeof(UINT16); DigestSize = GetHashSizeFromAlgo (Digests->digests[Index].hashAlg); if (DigestSize == 0) { - DEBUG ((EFI_D_ERROR, "Unknown hash algorithm %d\r\n", Digests->digests[Index].hashAlg)); + DEBUG ((DEBUG_ERROR, "Unknown hash algorithm %d\r\n", Digests->digests[Index].hashAlg)); return EFI_DEVICE_ERROR; } CopyMem( @@ -353,11 +353,11 @@ Tpm2PcrRead ( } if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrRead - RecvBufferSize Error - %x\n", RecvBufferSize)); + DEBUG ((DEBUG_ERROR, "Tpm2PcrRead - RecvBufferSize Error - %x\n", RecvBufferSize)); return EFI_DEVICE_ERROR; } if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrRead - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode))); + DEBUG ((DEBUG_ERROR, "Tpm2PcrRead - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode))); return EFI_NOT_FOUND; } @@ -369,7 +369,7 @@ Tpm2PcrRead ( // PcrUpdateCounter // if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER) + sizeof(RecvBuffer.PcrUpdateCounter)) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrRead - RecvBufferSize Error - %x\n", RecvBufferSize)); + DEBUG ((DEBUG_ERROR, "Tpm2PcrRead - RecvBufferSize Error - %x\n", RecvBufferSize)); return EFI_DEVICE_ERROR; } *PcrUpdateCounter = SwapBytes32(RecvBuffer.PcrUpdateCounter); @@ -378,7 +378,7 @@ Tpm2PcrRead ( // PcrSelectionOut // if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER) + sizeof(RecvBuffer.PcrUpdateCounter) + sizeof(RecvBuffer.PcrSelectionOut.count)) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrRead - RecvBufferSize Error - %x\n", RecvBufferSize)); + DEBUG ((DEBUG_ERROR, "Tpm2PcrRead - RecvBufferSize Error - %x\n", RecvBufferSize)); return EFI_DEVICE_ERROR; } PcrSelectionOut->count = SwapBytes32(RecvBuffer.PcrSelectionOut.count); @@ -388,7 +388,7 @@ Tpm2PcrRead ( } if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER) + sizeof(RecvBuffer.PcrUpdateCounter) + sizeof(RecvBuffer.PcrSelectionOut.count) + sizeof(RecvBuffer.PcrSelectionOut.pcrSelections[0]) * PcrSelectionOut->count) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrRead - RecvBufferSize Error - %x\n", RecvBufferSize)); + DEBUG ((DEBUG_ERROR, "Tpm2PcrRead - RecvBufferSize Error - %x\n", RecvBufferSize)); return EFI_DEVICE_ERROR; } for (Index = 0; Index < PcrSelectionOut->count; Index++) { @@ -513,7 +513,7 @@ Tpm2PcrAllocate ( } if (ResultBufSize > sizeof(Res)) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrAllocate: Failed ExecuteCommand: Buffer Too Small\r\n")); + DEBUG ((DEBUG_ERROR, "Tpm2PcrAllocate: Failed ExecuteCommand: Buffer Too Small\r\n")); Status = EFI_BUFFER_TOO_SMALL; goto Done; } @@ -523,7 +523,7 @@ Tpm2PcrAllocate ( // RespSize = SwapBytes32(Res.Header.paramSize); if (RespSize > sizeof(Res)) { - DEBUG ((EFI_D_ERROR, "Tpm2PcrAllocate: Response size too large! %d\r\n", RespSize)); + DEBUG ((DEBUG_ERROR, "Tpm2PcrAllocate: Response size too large! %d\r\n", RespSize)); Status = EFI_BUFFER_TOO_SMALL; goto Done; } @@ -532,7 +532,7 @@ Tpm2PcrAllocate ( // Fail if command failed // if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) { - DEBUG((EFI_D_ERROR,"Tpm2PcrAllocate: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode))); + DEBUG((DEBUG_ERROR,"Tpm2PcrAllocate: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode))); Status = EFI_DEVICE_ERROR; goto Done; } @@ -673,15 +673,15 @@ Tpm2PcrAllocateBanks ( &SizeNeeded, &SizeAvailable ); - DEBUG ((EFI_D_INFO, "Tpm2PcrAllocateBanks call Tpm2PcrAllocate - %r\n", Status)); + DEBUG ((DEBUG_INFO, "Tpm2PcrAllocateBanks call Tpm2PcrAllocate - %r\n", Status)); if (EFI_ERROR (Status)) { goto Done; } - DEBUG ((EFI_D_INFO, "AllocationSuccess - %02x\n", AllocationSuccess)); - DEBUG ((EFI_D_INFO, "MaxPCR - %08x\n", MaxPCR)); - DEBUG ((EFI_D_INFO, "SizeNeeded - %08x\n", SizeNeeded)); - DEBUG ((EFI_D_INFO, "SizeAvailable - %08x\n", SizeAvailable)); + DEBUG ((DEBUG_INFO, "AllocationSuccess - %02x\n", AllocationSuccess)); + DEBUG ((DEBUG_INFO, "MaxPCR - %08x\n", MaxPCR)); + DEBUG ((DEBUG_INFO, "SizeNeeded - %08x\n", SizeNeeded)); + DEBUG ((DEBUG_INFO, "SizeAvailable - %08x\n", SizeAvailable)); Done: ZeroMem(&LocalAuthSession.hmac, sizeof(LocalAuthSession.hmac));