SecurityPkg: Change use of EFI_D_* to DEBUG_*
REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3739 Update all use of EFI_D_* defines in DEBUG() macros to DEBUG_* defines. Cc: Andrew Fish <afish@apple.com> Cc: Leif Lindholm <leif@nuviainc.com> Cc: Michael Kubacki <michael.kubacki@microsoft.com> Signed-off-by: Michael D Kinney <michael.d.kinney@intel.com> Reviewed-by: Jian J Wang <jian.j.wang@intel.com>
This commit is contained in:
committed by
mergify[bot]
parent
ca56749b0e
commit
e905fbb05a
@@ -1752,7 +1752,7 @@ CleanCertsFromDb (
|
||||
AuthVariableInfo.Attributes | EFI_VARIABLE_NON_VOLATILE
|
||||
);
|
||||
CertCleaned = TRUE;
|
||||
DEBUG((EFI_D_INFO, "Recovery!! Cert for Auth Variable %s Guid %g is removed for consistency\n", VariableName, &AuthVarGuid));
|
||||
DEBUG((DEBUG_INFO, "Recovery!! Cert for Auth Variable %s Guid %g is removed for consistency\n", VariableName, &AuthVarGuid));
|
||||
FreePool(VariableName);
|
||||
break;
|
||||
}
|
||||
|
@@ -153,9 +153,9 @@ AuthVariableLibInitialize (
|
||||
|
||||
Status = AuthServiceInternalFindVariable (EFI_PLATFORM_KEY_NAME, &gEfiGlobalVariableGuid, (VOID **) &Data, &DataSize);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_INFO, "Variable %s does not exist.\n", EFI_PLATFORM_KEY_NAME));
|
||||
DEBUG ((DEBUG_INFO, "Variable %s does not exist.\n", EFI_PLATFORM_KEY_NAME));
|
||||
} else {
|
||||
DEBUG ((EFI_D_INFO, "Variable %s exists.\n", EFI_PLATFORM_KEY_NAME));
|
||||
DEBUG ((DEBUG_INFO, "Variable %s exists.\n", EFI_PLATFORM_KEY_NAME));
|
||||
}
|
||||
|
||||
//
|
||||
@@ -238,9 +238,9 @@ AuthVariableLibInitialize (
|
||||
return Status;
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "Variable %s is %x\n", EFI_SETUP_MODE_NAME, mPlatformMode));
|
||||
DEBUG ((EFI_D_INFO, "Variable %s is %x\n", EFI_SECURE_BOOT_MODE_NAME, SecureBootMode));
|
||||
DEBUG ((EFI_D_INFO, "Variable %s is %x\n", EFI_SECURE_BOOT_ENABLE_NAME, SecureBootEnable));
|
||||
DEBUG ((DEBUG_INFO, "Variable %s is %x\n", EFI_SETUP_MODE_NAME, mPlatformMode));
|
||||
DEBUG ((DEBUG_INFO, "Variable %s is %x\n", EFI_SECURE_BOOT_MODE_NAME, SecureBootMode));
|
||||
DEBUG ((DEBUG_INFO, "Variable %s is %x\n", EFI_SECURE_BOOT_ENABLE_NAME, SecureBootEnable));
|
||||
|
||||
//
|
||||
// Initialize "CustomMode" in STANDARD_SECURE_BOOT_MODE state.
|
||||
@@ -257,7 +257,7 @@ AuthVariableLibInitialize (
|
||||
return Status;
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "Variable %s is %x\n", EFI_CUSTOM_MODE_NAME, CustomMode));
|
||||
DEBUG ((DEBUG_INFO, "Variable %s is %x\n", EFI_CUSTOM_MODE_NAME, CustomMode));
|
||||
|
||||
//
|
||||
// Check "certdb" variable's existence.
|
||||
@@ -289,7 +289,7 @@ AuthVariableLibInitialize (
|
||||
//
|
||||
Status = CleanCertsFromDb();
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Clean up CertDB fail! Status %x\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Clean up CertDB fail! Status %x\n", Status));
|
||||
return Status;
|
||||
}
|
||||
}
|
||||
@@ -347,7 +347,7 @@ AuthVariableLibInitialize (
|
||||
return Status;
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "Variable %s is %x\n", EFI_VENDOR_KEYS_VARIABLE_NAME, mVendorKeyState));
|
||||
DEBUG ((DEBUG_INFO, "Variable %s is %x\n", EFI_VENDOR_KEYS_VARIABLE_NAME, mVendorKeyState));
|
||||
|
||||
AuthVarLibContextOut->StructVersion = AUTH_VAR_LIB_CONTEXT_OUT_STRUCT_VERSION;
|
||||
AuthVarLibContextOut->StructSize = sizeof (AUTH_VAR_LIB_CONTEXT_OUT);
|
||||
|
@@ -253,8 +253,8 @@ MeasureVariable (
|
||||
VarSize
|
||||
);
|
||||
|
||||
DEBUG ((EFI_D_INFO, "DxeImageVerification: MeasureVariable (Pcr - %x, EventType - %x, ", (UINTN)7, (UINTN)EV_EFI_VARIABLE_AUTHORITY));
|
||||
DEBUG ((EFI_D_INFO, "VariableName - %s, VendorGuid - %g)\n", VarName, VendorGuid));
|
||||
DEBUG ((DEBUG_INFO, "DxeImageVerification: MeasureVariable (Pcr - %x, EventType - %x, ", (UINTN)7, (UINTN)EV_EFI_VARIABLE_AUTHORITY));
|
||||
DEBUG ((DEBUG_INFO, "VariableName - %s, VendorGuid - %g)\n", VarName, VendorGuid));
|
||||
|
||||
Status = TpmMeasureAndLogData (
|
||||
7,
|
||||
@@ -295,7 +295,7 @@ SecureBootHook (
|
||||
}
|
||||
|
||||
if (IsDataMeasured (VariableName, VendorGuid, Data, DataSize)) {
|
||||
DEBUG ((EFI_D_ERROR, "MeasureSecureAuthorityVariable - IsDataMeasured\n"));
|
||||
DEBUG ((DEBUG_ERROR, "MeasureSecureAuthorityVariable - IsDataMeasured\n"));
|
||||
return ;
|
||||
}
|
||||
|
||||
@@ -305,7 +305,7 @@ SecureBootHook (
|
||||
Data,
|
||||
DataSize
|
||||
);
|
||||
DEBUG ((EFI_D_INFO, "MeasureBootPolicyVariable - %r\n", Status));
|
||||
DEBUG ((DEBUG_INFO, "MeasureBootPolicyVariable - %r\n", Status));
|
||||
|
||||
if (!EFI_ERROR (Status)) {
|
||||
AddDataMeasured (VariableName, VendorGuid, Data, DataSize);
|
||||
|
@@ -84,15 +84,15 @@ Tpm2CommandClear (
|
||||
CopyMem (LocalAuthSession.hmac.buffer, PlatformAuth->buffer, PlatformAuth->size);
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "Tpm2ClearControl ... \n"));
|
||||
DEBUG ((DEBUG_INFO, "Tpm2ClearControl ... \n"));
|
||||
Status = Tpm2ClearControl (TPM_RH_PLATFORM, AuthSession, NO);
|
||||
DEBUG ((EFI_D_INFO, "Tpm2ClearControl - %r\n", Status));
|
||||
DEBUG ((DEBUG_INFO, "Tpm2ClearControl - %r\n", Status));
|
||||
if (EFI_ERROR (Status)) {
|
||||
goto Done;
|
||||
}
|
||||
DEBUG ((EFI_D_INFO, "Tpm2Clear ... \n"));
|
||||
DEBUG ((DEBUG_INFO, "Tpm2Clear ... \n"));
|
||||
Status = Tpm2Clear (TPM_RH_PLATFORM, AuthSession);
|
||||
DEBUG ((EFI_D_INFO, "Tpm2Clear - %r\n", Status));
|
||||
DEBUG ((DEBUG_INFO, "Tpm2Clear - %r\n", Status));
|
||||
|
||||
Done:
|
||||
ZeroMem (&LocalAuthSession.hmac, sizeof(LocalAuthSession.hmac));
|
||||
@@ -126,7 +126,7 @@ Tpm2CommandChangeEps (
|
||||
}
|
||||
|
||||
Status = Tpm2ChangeEPS (TPM_RH_PLATFORM, AuthSession);
|
||||
DEBUG ((EFI_D_INFO, "Tpm2ChangeEPS - %r\n", Status));
|
||||
DEBUG ((DEBUG_INFO, "Tpm2ChangeEPS - %r\n", Status));
|
||||
|
||||
ZeroMem(&LocalAuthSession.hmac, sizeof(LocalAuthSession.hmac));
|
||||
return Status;
|
||||
@@ -913,7 +913,7 @@ Tcg2PhysicalPresenceLibProcessRequest (
|
||||
&gEfiTcg2PhysicalPresenceGuid
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "[TPM2] Error when lock variable %s, Status = %r\n", TCG2_PHYSICAL_PRESENCE_FLAGS_VARIABLE, Status));
|
||||
DEBUG ((DEBUG_ERROR, "[TPM2] Error when lock variable %s, Status = %r\n", TCG2_PHYSICAL_PRESENCE_FLAGS_VARIABLE, Status));
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
}
|
||||
@@ -922,7 +922,7 @@ Tcg2PhysicalPresenceLibProcessRequest (
|
||||
// Check S4 resume
|
||||
//
|
||||
if (GetBootModeHob () == BOOT_ON_S4_RESUME) {
|
||||
DEBUG ((EFI_D_INFO, "S4 Resume, Skip TPM PP process!\n"));
|
||||
DEBUG ((DEBUG_INFO, "S4 Resume, Skip TPM PP process!\n"));
|
||||
return ;
|
||||
}
|
||||
|
||||
@@ -947,7 +947,7 @@ Tcg2PhysicalPresenceLibProcessRequest (
|
||||
&PpiFlags
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "[TPM2] Set physical presence flag failed, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "[TPM2] Set physical presence flag failed, Status = %r\n", Status));
|
||||
return ;
|
||||
}
|
||||
DEBUG((DEBUG_INFO, "[TPM2] Initial physical presence flags value is 0x%x\n", PpiFlags.PPFlags));
|
||||
@@ -975,18 +975,18 @@ Tcg2PhysicalPresenceLibProcessRequest (
|
||||
&TcgPpData
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "[TPM2] Set physical presence variable failed, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "[TPM2] Set physical presence variable failed, Status = %r\n", Status));
|
||||
return ;
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "[TPM2] Flags=%x, PPRequest=%x (LastPPRequest=%x)\n", PpiFlags.PPFlags, TcgPpData.PPRequest, TcgPpData.LastPPRequest));
|
||||
DEBUG ((DEBUG_INFO, "[TPM2] Flags=%x, PPRequest=%x (LastPPRequest=%x)\n", PpiFlags.PPFlags, TcgPpData.PPRequest, TcgPpData.LastPPRequest));
|
||||
|
||||
//
|
||||
// Execute pending TPM request.
|
||||
//
|
||||
Tcg2ExecutePendingTpmRequest (PlatformAuth, &TcgPpData, &PpiFlags);
|
||||
DEBUG ((EFI_D_INFO, "[TPM2] PPResponse = %x (LastPPRequest=%x, Flags=%x)\n", TcgPpData.PPResponse, TcgPpData.LastPPRequest, PpiFlags.PPFlags));
|
||||
DEBUG ((DEBUG_INFO, "[TPM2] PPResponse = %x (LastPPRequest=%x, Flags=%x)\n", TcgPpData.PPResponse, TcgPpData.LastPPRequest, PpiFlags.PPFlags));
|
||||
|
||||
}
|
||||
|
||||
@@ -1016,7 +1016,7 @@ Tcg2PhysicalPresenceLibNeedUserConfirm(
|
||||
// Check S4 resume
|
||||
//
|
||||
if (GetBootModeHob () == BOOT_ON_S4_RESUME) {
|
||||
DEBUG ((EFI_D_INFO, "S4 Resume, Skip TPM PP process!\n"));
|
||||
DEBUG ((DEBUG_INFO, "S4 Resume, Skip TPM PP process!\n"));
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@@ -1092,7 +1092,7 @@ Tcg2PhysicalPresenceLibReturnOperationResponseToOsFunction (
|
||||
UINTN DataSize;
|
||||
EFI_TCG2_PHYSICAL_PRESENCE PpData;
|
||||
|
||||
DEBUG ((EFI_D_INFO, "[TPM2] ReturnOperationResponseToOsFunction\n"));
|
||||
DEBUG ((DEBUG_INFO, "[TPM2] ReturnOperationResponseToOsFunction\n"));
|
||||
|
||||
//
|
||||
// Get the Physical Presence variable
|
||||
@@ -1108,7 +1108,7 @@ Tcg2PhysicalPresenceLibReturnOperationResponseToOsFunction (
|
||||
if (EFI_ERROR (Status)) {
|
||||
*MostRecentRequest = 0;
|
||||
*Response = 0;
|
||||
DEBUG ((EFI_D_ERROR, "[TPM2] Get PP variable failure! Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "[TPM2] Get PP variable failure! Status = %r\n", Status));
|
||||
return TCG_PP_RETURN_TPM_OPERATION_RESPONSE_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1143,7 +1143,7 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction (
|
||||
EFI_TCG2_PHYSICAL_PRESENCE PpData;
|
||||
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS Flags;
|
||||
|
||||
DEBUG ((EFI_D_INFO, "[TPM2] SubmitRequestToPreOSFunction, Request = %x, %x\n", OperationRequest, RequestParameter));
|
||||
DEBUG ((DEBUG_INFO, "[TPM2] SubmitRequestToPreOSFunction, Request = %x, %x\n", OperationRequest, RequestParameter));
|
||||
|
||||
//
|
||||
// Get the Physical Presence variable
|
||||
@@ -1157,7 +1157,7 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction (
|
||||
&PpData
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "[TPM2] Get PP variable failure! Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "[TPM2] Get PP variable failure! Status = %r\n", Status));
|
||||
return TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE;
|
||||
}
|
||||
|
||||
@@ -1179,7 +1179,7 @@ Tcg2PhysicalPresenceLibSubmitRequestToPreOSFunction (
|
||||
&PpData
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "[TPM2] Set PP variable failure! Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "[TPM2] Set PP variable failure! Status = %r\n", Status));
|
||||
return TCG_PP_SUBMIT_REQUEST_TO_PREOS_GENERAL_FAILURE;
|
||||
}
|
||||
}
|
||||
@@ -1217,7 +1217,7 @@ Tcg2PhysicalPresenceLibGetManagementFlags (
|
||||
EFI_TCG2_PHYSICAL_PRESENCE_FLAGS PpiFlags;
|
||||
UINTN DataSize;
|
||||
|
||||
DEBUG ((EFI_D_INFO, "[TPM2] GetManagementFlags\n"));
|
||||
DEBUG ((DEBUG_INFO, "[TPM2] GetManagementFlags\n"));
|
||||
|
||||
DataSize = sizeof (EFI_TCG2_PHYSICAL_PRESENCE_FLAGS);
|
||||
Status = gRT->GetVariable (
|
||||
|
@@ -1203,11 +1203,11 @@ TcgPhysicalPresenceLibProcessRequest (
|
||||
&PpiFlags
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "[TPM] Set physical presence flag failed, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "[TPM] Set physical presence flag failed, Status = %r\n", Status));
|
||||
return ;
|
||||
}
|
||||
}
|
||||
DEBUG ((EFI_D_INFO, "[TPM] PpiFlags = %x\n", PpiFlags.PPFlags));
|
||||
DEBUG ((DEBUG_INFO, "[TPM] PpiFlags = %x\n", PpiFlags.PPFlags));
|
||||
|
||||
//
|
||||
// This flags variable controls whether physical presence is required for TPM command.
|
||||
@@ -1221,7 +1221,7 @@ TcgPhysicalPresenceLibProcessRequest (
|
||||
&gEfiPhysicalPresenceGuid
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "[TPM] Error when lock variable %s, Status = %r\n", PHYSICAL_PRESENCE_FLAGS_VARIABLE, Status));
|
||||
DEBUG ((DEBUG_ERROR, "[TPM] Error when lock variable %s, Status = %r\n", PHYSICAL_PRESENCE_FLAGS_VARIABLE, Status));
|
||||
ASSERT_EFI_ERROR (Status);
|
||||
}
|
||||
}
|
||||
@@ -1248,12 +1248,12 @@ TcgPhysicalPresenceLibProcessRequest (
|
||||
&TcgPpData
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "[TPM] Set physical presence variable failed, Status = %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "[TPM] Set physical presence variable failed, Status = %r\n", Status));
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "[TPM] Flags=%x, PPRequest=%x\n", PpiFlags.PPFlags, TcgPpData.PPRequest));
|
||||
DEBUG ((DEBUG_INFO, "[TPM] Flags=%x, PPRequest=%x\n", PpiFlags.PPFlags, TcgPpData.PPRequest));
|
||||
|
||||
if (TcgPpData.PPRequest == PHYSICAL_PRESENCE_NO_ACTION) {
|
||||
//
|
||||
@@ -1292,7 +1292,7 @@ TcgPhysicalPresenceLibProcessRequest (
|
||||
// Execute pending TPM request.
|
||||
//
|
||||
ExecutePendingTpmRequest (TcgProtocol, &TcgPpData, PpiFlags);
|
||||
DEBUG ((EFI_D_INFO, "[TPM] PPResponse = %x\n", TcgPpData.PPResponse));
|
||||
DEBUG ((DEBUG_INFO, "[TPM] PPResponse = %x\n", TcgPpData.PPResponse));
|
||||
|
||||
//
|
||||
// Lock physical presence.
|
||||
@@ -1397,4 +1397,3 @@ TcgPhysicalPresenceLibNeedUserConfirm(
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
|
@@ -164,7 +164,7 @@ Tcg2MeasureGptTable (
|
||||
(UINT8 *)PrimaryHeader
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Failed to Read Partition Table Header!\n"));
|
||||
DEBUG ((DEBUG_ERROR, "Failed to Read Partition Table Header!\n"));
|
||||
FreePool (PrimaryHeader);
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
@@ -334,7 +334,7 @@ Tcg2MeasurePeImage (
|
||||
break;
|
||||
default:
|
||||
DEBUG ((
|
||||
EFI_D_ERROR,
|
||||
DEBUG_ERROR,
|
||||
"Tcg2MeasurePeImage: Unknown subsystem type %d",
|
||||
ImageType
|
||||
));
|
||||
@@ -441,7 +441,7 @@ DxeTpm2MeasureBootHandler (
|
||||
// Tcg2 protocol is not installed. So, TPM2 is not present.
|
||||
// Don't do any measurement, and directly return EFI_SUCCESS.
|
||||
//
|
||||
DEBUG ((EFI_D_VERBOSE, "DxeTpm2MeasureBootHandler - Tcg2 - %r\n", Status));
|
||||
DEBUG ((DEBUG_VERBOSE, "DxeTpm2MeasureBootHandler - Tcg2 - %r\n", Status));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -454,7 +454,7 @@ DxeTpm2MeasureBootHandler (
|
||||
//
|
||||
// TPM device doesn't work or activate.
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "DxeTpm2MeasureBootHandler (%r) - TPMPresentFlag - %x\n", Status, ProtocolCapability.TPMPresentFlag));
|
||||
DEBUG ((DEBUG_ERROR, "DxeTpm2MeasureBootHandler (%r) - TPMPresentFlag - %x\n", Status, ProtocolCapability.TPMPresentFlag));
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -503,7 +503,7 @@ DxeTpm2MeasureBootHandler (
|
||||
// Measure GPT disk.
|
||||
//
|
||||
Status = Tcg2MeasureGptTable (Tcg2Protocol, Handle);
|
||||
DEBUG ((EFI_D_INFO, "DxeTpm2MeasureBootHandler - Tcg2MeasureGptTable - %r\n", Status));
|
||||
DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - Tcg2MeasureGptTable - %r\n", Status));
|
||||
if (!EFI_ERROR (Status)) {
|
||||
//
|
||||
// GPT disk check done.
|
||||
@@ -654,7 +654,7 @@ DxeTpm2MeasureBootHandler (
|
||||
ImageContext.ImageType,
|
||||
DevicePathNode
|
||||
);
|
||||
DEBUG ((EFI_D_INFO, "DxeTpm2MeasureBootHandler - Tcg2MeasurePeImage - %r\n", Status));
|
||||
DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - Tcg2MeasurePeImage - %r\n", Status));
|
||||
}
|
||||
|
||||
//
|
||||
@@ -665,7 +665,7 @@ Finish:
|
||||
FreePool (OrigDevicePathNode);
|
||||
}
|
||||
|
||||
DEBUG ((EFI_D_INFO, "DxeTpm2MeasureBootHandler - %r\n", Status));
|
||||
DEBUG ((DEBUG_INFO, "DxeTpm2MeasureBootHandler - %r\n", Status));
|
||||
|
||||
return Status;
|
||||
}
|
||||
|
@@ -164,7 +164,7 @@ TcgMeasureGptTable (
|
||||
(UINT8 *)PrimaryHeader
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((EFI_D_ERROR, "Failed to Read Partition Table Header!\n"));
|
||||
DEBUG ((DEBUG_ERROR, "Failed to Read Partition Table Header!\n"));
|
||||
FreePool (PrimaryHeader);
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
@@ -355,7 +355,7 @@ TcgMeasurePeImage (
|
||||
break;
|
||||
default:
|
||||
DEBUG ((
|
||||
EFI_D_ERROR,
|
||||
DEBUG_ERROR,
|
||||
"TcgMeasurePeImage: Unknown subsystem type %d",
|
||||
ImageType
|
||||
));
|
||||
|
@@ -237,7 +237,7 @@ HashAndExtend (
|
||||
TPM2B_EVENT EventData;
|
||||
TPM2B_DIGEST Result;
|
||||
|
||||
DEBUG((EFI_D_VERBOSE, "\n HashAndExtend Entry \n"));
|
||||
DEBUG((DEBUG_VERBOSE, "\n HashAndExtend Entry \n"));
|
||||
|
||||
SequenceHandle = 0xFFFFFFFF; // Know bad value
|
||||
|
||||
@@ -257,7 +257,7 @@ HashAndExtend (
|
||||
if (EFI_ERROR(Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
DEBUG((EFI_D_VERBOSE, "\n Tpm2HashSequenceStart Success \n"));
|
||||
DEBUG((DEBUG_VERBOSE, "\n Tpm2HashSequenceStart Success \n"));
|
||||
|
||||
Buffer = (UINT8 *)(UINTN)DataToHash;
|
||||
for (HashLen = DataToHashLen; HashLen > sizeof(HashBuffer.buffer); HashLen -= sizeof(HashBuffer.buffer)) {
|
||||
@@ -271,7 +271,7 @@ HashAndExtend (
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
}
|
||||
DEBUG((EFI_D_VERBOSE, "\n Tpm2SequenceUpdate Success \n"));
|
||||
DEBUG((DEBUG_VERBOSE, "\n Tpm2SequenceUpdate Success \n"));
|
||||
|
||||
HashBuffer.size = (UINT16)HashLen;
|
||||
CopyMem(HashBuffer.buffer, Buffer, (UINTN)HashLen);
|
||||
@@ -289,7 +289,7 @@ HashAndExtend (
|
||||
if (EFI_ERROR(Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
DEBUG((EFI_D_VERBOSE, "\n Tpm2EventSequenceComplete Success \n"));
|
||||
DEBUG((DEBUG_VERBOSE, "\n Tpm2EventSequenceComplete Success \n"));
|
||||
} else {
|
||||
Status = Tpm2SequenceComplete (
|
||||
SequenceHandle,
|
||||
@@ -299,7 +299,7 @@ HashAndExtend (
|
||||
if (EFI_ERROR(Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
DEBUG((EFI_D_VERBOSE, "\n Tpm2SequenceComplete Success \n"));
|
||||
DEBUG((DEBUG_VERBOSE, "\n Tpm2SequenceComplete Success \n"));
|
||||
|
||||
DigestList->count = 1;
|
||||
DigestList->digests[0].hashAlg = AlgoId;
|
||||
@@ -311,7 +311,7 @@ HashAndExtend (
|
||||
if (EFI_ERROR(Status)) {
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
DEBUG((EFI_D_VERBOSE, "\n Tpm2PcrExtend Success \n"));
|
||||
DEBUG((DEBUG_VERBOSE, "\n Tpm2PcrExtend Success \n"));
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
|
@@ -69,7 +69,7 @@ Tpm12Extend (
|
||||
}
|
||||
|
||||
if (SwapBytes32(Response.Hdr.returnCode) != TPM_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm12Extend: Response Code error! 0x%08x\r\n", SwapBytes32(Response.Hdr.returnCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm12Extend: Response Code error! 0x%08x\r\n", SwapBytes32(Response.Hdr.returnCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
@@ -58,7 +58,7 @@ Tpm12PhysicalPresence (
|
||||
}
|
||||
|
||||
if (SwapBytes32(Response.returnCode) != TPM_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm12PhysicalPresence: Response Code error! 0x%08x\r\n", SwapBytes32(Response.returnCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm12PhysicalPresence: Response Code error! 0x%08x\r\n", SwapBytes32(Response.returnCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
@@ -266,22 +266,22 @@ Tpm12TisTpmCommand (
|
||||
DEBUG_CODE (
|
||||
UINTN DebugSize;
|
||||
|
||||
DEBUG ((EFI_D_VERBOSE, "Tpm12TisTpmCommand Send - "));
|
||||
DEBUG ((DEBUG_VERBOSE, "Tpm12TisTpmCommand Send - "));
|
||||
if (SizeIn > 0x100) {
|
||||
DebugSize = 0x40;
|
||||
} else {
|
||||
DebugSize = SizeIn;
|
||||
}
|
||||
for (Index = 0; Index < DebugSize; Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
}
|
||||
if (DebugSize != SizeIn) {
|
||||
DEBUG ((EFI_D_VERBOSE, "...... "));
|
||||
DEBUG ((DEBUG_VERBOSE, "...... "));
|
||||
for (Index = SizeIn - 0x20; Index < SizeIn; Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
}
|
||||
}
|
||||
DEBUG ((EFI_D_VERBOSE, "\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "\n"));
|
||||
);
|
||||
TpmOutSize = 0;
|
||||
|
||||
@@ -352,11 +352,11 @@ Tpm12TisTpmCommand (
|
||||
}
|
||||
}
|
||||
DEBUG_CODE (
|
||||
DEBUG ((EFI_D_VERBOSE, "Tpm12TisTpmCommand ReceiveHeader - "));
|
||||
DEBUG ((DEBUG_VERBOSE, "Tpm12TisTpmCommand ReceiveHeader - "));
|
||||
for (Index = 0; Index < sizeof (TPM_RSP_COMMAND_HDR); Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
}
|
||||
DEBUG ((EFI_D_VERBOSE, "\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "\n"));
|
||||
);
|
||||
//
|
||||
// Check the response data header (tag, parasize and returncode)
|
||||
@@ -364,7 +364,7 @@ Tpm12TisTpmCommand (
|
||||
CopyMem (&Data16, BufferOut, sizeof (UINT16));
|
||||
RspTag = SwapBytes16 (Data16);
|
||||
if (RspTag != TPM_TAG_RSP_COMMAND && RspTag != TPM_TAG_RSP_AUTH1_COMMAND && RspTag != TPM_TAG_RSP_AUTH2_COMMAND) {
|
||||
DEBUG ((EFI_D_ERROR, "TPM12: Response tag error - current tag value is %x\n", RspTag));
|
||||
DEBUG ((DEBUG_ERROR, "TPM12: Response tag error - current tag value is %x\n", RspTag));
|
||||
Status = EFI_UNSUPPORTED;
|
||||
goto Exit;
|
||||
}
|
||||
@@ -396,11 +396,11 @@ Tpm12TisTpmCommand (
|
||||
}
|
||||
Exit:
|
||||
DEBUG_CODE (
|
||||
DEBUG ((EFI_D_VERBOSE, "Tpm12TisTpmCommand Receive - "));
|
||||
DEBUG ((DEBUG_VERBOSE, "Tpm12TisTpmCommand Receive - "));
|
||||
for (Index = 0; Index < TpmOutSize; Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
}
|
||||
DEBUG ((EFI_D_VERBOSE, "\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "\n"));
|
||||
);
|
||||
MmioWrite8((UINTN)&TisReg->Status, TIS_PC_STS_READY);
|
||||
return Status;
|
||||
|
@@ -47,7 +47,7 @@ Tpm12SubmitCommand (
|
||||
//
|
||||
// TCG protocol is not installed. So, TPM12 is not present.
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "Tpm12SubmitCommand - TCG - %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm12SubmitCommand - TCG - %r\n", Status));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
@@ -91,7 +91,7 @@ Tpm12RequestUseTpm (
|
||||
//
|
||||
// TCG protocol is not installed. So, TPM12 is not present.
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "Tpm12RequestUseTpm - TCG - %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm12RequestUseTpm - TCG - %r\n", Status));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
@@ -67,14 +67,13 @@ Tpm2FlushContext (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2FlushContext - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2FlushContext - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2FlushContext - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2FlushContext - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
return EFI_SUCCESS;
|
||||
}
|
||||
|
||||
|
@@ -102,12 +102,12 @@ Tpm2DictionaryAttackLockReset (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2DictionaryAttackLockReset - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2DictionaryAttackLockReset - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2DictionaryAttackLockReset - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2DictionaryAttackLockReset - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
@@ -193,12 +193,12 @@ Tpm2DictionaryAttackParameters (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2DictionaryAttackParameters - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2DictionaryAttackParameters - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2DictionaryAttackParameters - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2DictionaryAttackParameters - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
|
@@ -159,12 +159,12 @@ Tpm2PolicySecret (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2PolicySecret - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2PolicySecret - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2PolicySecret - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2PolicySecret - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
@@ -263,11 +263,11 @@ Tpm2PolicyOR (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2PolicyOR - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2PolicyOR - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2PolicyOR - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2PolicyOR - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
@@ -318,11 +318,11 @@ Tpm2PolicyCommandCode (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2PolicyCommandCode - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2PolicyCommandCode - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2PolicyCommandCode - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2PolicyCommandCode - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
@@ -373,11 +373,11 @@ Tpm2PolicyGetDigest (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2PolicyGetDigest - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2PolicyGetDigest - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2PolicyGetDigest - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2PolicyGetDigest - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
@@ -266,7 +266,7 @@ CopyDigestListToBuffer (
|
||||
Buffer = (UINT8 *)Buffer + sizeof(DigestList->count);
|
||||
for (Index = 0; Index < DigestList->count; Index++) {
|
||||
if (!IsHashAlgSupportedInHashAlgorithmMask(DigestList->digests[Index].hashAlg, HashAlgorithmMask)) {
|
||||
DEBUG ((EFI_D_ERROR, "WARNING: TPM2 Event log has HashAlg unsupported by PCR bank (0x%x)\n", DigestList->digests[Index].hashAlg));
|
||||
DEBUG ((DEBUG_ERROR, "WARNING: TPM2 Event log has HashAlg unsupported by PCR bank (0x%x)\n", DigestList->digests[Index].hashAlg));
|
||||
continue;
|
||||
}
|
||||
CopyMem (Buffer, &DigestList->digests[Index].hashAlg, sizeof(DigestList->digests[Index].hashAlg));
|
||||
|
@@ -184,12 +184,12 @@ Tpm2SetPrimaryPolicy (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2SetPrimaryPolicy - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2SetPrimaryPolicy - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2SetPrimaryPolicy - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2SetPrimaryPolicy - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
@@ -252,7 +252,7 @@ Tpm2Clear (
|
||||
}
|
||||
|
||||
if (ResultBufSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "Clear: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
DEBUG ((DEBUG_ERROR, "Clear: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -262,7 +262,7 @@ Tpm2Clear (
|
||||
//
|
||||
RespSize = SwapBytes32(Res.Header.paramSize);
|
||||
if (RespSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "Clear: Response size too large! %d\r\n", RespSize));
|
||||
DEBUG ((DEBUG_ERROR, "Clear: Response size too large! %d\r\n", RespSize));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -271,7 +271,7 @@ Tpm2Clear (
|
||||
// Fail if command failed
|
||||
//
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Clear: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Clear: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
@@ -346,7 +346,7 @@ Tpm2ClearControl (
|
||||
}
|
||||
|
||||
if (ResultBufSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "ClearControl: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
DEBUG ((DEBUG_ERROR, "ClearControl: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -356,7 +356,7 @@ Tpm2ClearControl (
|
||||
//
|
||||
RespSize = SwapBytes32(Res.Header.paramSize);
|
||||
if (RespSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "ClearControl: Response size too large! %d\r\n", RespSize));
|
||||
DEBUG ((DEBUG_ERROR, "ClearControl: Response size too large! %d\r\n", RespSize));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -365,7 +365,7 @@ Tpm2ClearControl (
|
||||
// Fail if command failed
|
||||
//
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "ClearControl: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "ClearControl: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
@@ -459,7 +459,7 @@ Tpm2HierarchyChangeAuth (
|
||||
}
|
||||
|
||||
if (ResultBufSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "HierarchyChangeAuth: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
DEBUG ((DEBUG_ERROR, "HierarchyChangeAuth: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -469,7 +469,7 @@ Tpm2HierarchyChangeAuth (
|
||||
//
|
||||
RespSize = SwapBytes32(Res.Header.paramSize);
|
||||
if (RespSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "HierarchyChangeAuth: Response size too large! %d\r\n", RespSize));
|
||||
DEBUG ((DEBUG_ERROR, "HierarchyChangeAuth: Response size too large! %d\r\n", RespSize));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -478,7 +478,7 @@ Tpm2HierarchyChangeAuth (
|
||||
// Fail if command failed
|
||||
//
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG((EFI_D_ERROR,"HierarchyChangeAuth: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG((DEBUG_ERROR,"HierarchyChangeAuth: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
@@ -557,7 +557,7 @@ Tpm2ChangeEPS (
|
||||
}
|
||||
|
||||
if (ResultBufSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "ChangeEPS: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
DEBUG ((DEBUG_ERROR, "ChangeEPS: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -567,7 +567,7 @@ Tpm2ChangeEPS (
|
||||
//
|
||||
RespSize = SwapBytes32(Res.Header.paramSize);
|
||||
if (RespSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "ChangeEPS: Response size too large! %d\r\n", RespSize));
|
||||
DEBUG ((DEBUG_ERROR, "ChangeEPS: Response size too large! %d\r\n", RespSize));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -576,7 +576,7 @@ Tpm2ChangeEPS (
|
||||
// Fail if command failed
|
||||
//
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG((EFI_D_ERROR,"ChangeEPS: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG((DEBUG_ERROR,"ChangeEPS: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
@@ -655,7 +655,7 @@ Tpm2ChangePPS (
|
||||
}
|
||||
|
||||
if (ResultBufSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "ChangePPS: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
DEBUG ((DEBUG_ERROR, "ChangePPS: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -665,7 +665,7 @@ Tpm2ChangePPS (
|
||||
//
|
||||
RespSize = SwapBytes32(Res.Header.paramSize);
|
||||
if (RespSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "ChangePPS: Response size too large! %d\r\n", RespSize));
|
||||
DEBUG ((DEBUG_ERROR, "ChangePPS: Response size too large! %d\r\n", RespSize));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -674,7 +674,7 @@ Tpm2ChangePPS (
|
||||
// Fail if command failed
|
||||
//
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG((EFI_D_ERROR,"ChangePPS: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG((DEBUG_ERROR,"ChangePPS: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
@@ -763,7 +763,7 @@ Tpm2HierarchyControl (
|
||||
}
|
||||
|
||||
if (ResultBufSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "HierarchyControl: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
DEBUG ((DEBUG_ERROR, "HierarchyControl: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -773,7 +773,7 @@ Tpm2HierarchyControl (
|
||||
//
|
||||
RespSize = SwapBytes32(Res.Header.paramSize);
|
||||
if (RespSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "HierarchyControl: Response size too large! %d\r\n", RespSize));
|
||||
DEBUG ((DEBUG_ERROR, "HierarchyControl: Response size too large! %d\r\n", RespSize));
|
||||
Status = EFI_BUFFER_TOO_SMALL;
|
||||
goto Done;
|
||||
}
|
||||
@@ -782,7 +782,7 @@ Tpm2HierarchyControl (
|
||||
// Fail if command failed
|
||||
//
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG((EFI_D_ERROR,"HierarchyControl: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG((DEBUG_ERROR,"HierarchyControl: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
|
@@ -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));
|
||||
|
@@ -96,12 +96,12 @@ Tpm2SetAlgorithmSet (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2SetAlgorithmSet - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2SetAlgorithmSet - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2SetAlgorithmSet - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2SetAlgorithmSet - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
|
@@ -200,12 +200,12 @@ Tpm2NvReadPublic (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvReadPublic - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvReadPublic - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
ResponseCode = SwapBytes32(RecvBuffer.Header.responseCode);
|
||||
if (ResponseCode != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvReadPublic - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvReadPublic - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
}
|
||||
switch (ResponseCode) {
|
||||
case TPM_RC_SUCCESS:
|
||||
@@ -220,7 +220,7 @@ Tpm2NvReadPublic (
|
||||
}
|
||||
|
||||
if (RecvBufferSize <= sizeof (TPM2_RESPONSE_HEADER) + sizeof (UINT16) + sizeof(UINT16)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvReadPublic - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvReadPublic - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ Tpm2NvReadPublic (
|
||||
}
|
||||
|
||||
if (RecvBufferSize != sizeof(TPM2_RESPONSE_HEADER) + sizeof(UINT16) + NvPublicSize + sizeof(UINT16) + NvNameSize) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvReadPublic - RecvBufferSize Error - NvPublicSize %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvReadPublic - RecvBufferSize Error - NvPublicSize %x\n", RecvBufferSize));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
|
||||
@@ -354,14 +354,14 @@ Tpm2NvDefineSpace (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvDefineSpace - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvDefineSpace - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
ResponseCode = SwapBytes32(RecvBuffer.Header.responseCode);
|
||||
if (ResponseCode != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvDefineSpace - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvDefineSpace - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
}
|
||||
switch (ResponseCode) {
|
||||
case TPM_RC_SUCCESS:
|
||||
@@ -462,14 +462,14 @@ Tpm2NvUndefineSpace (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvUndefineSpace - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvUndefineSpace - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
ResponseCode = SwapBytes32(RecvBuffer.Header.responseCode);
|
||||
if (ResponseCode != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvUndefineSpace - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvUndefineSpace - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
}
|
||||
switch (ResponseCode) {
|
||||
case TPM_RC_SUCCESS:
|
||||
@@ -577,13 +577,13 @@ Tpm2NvRead (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvRead - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvRead - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
ResponseCode = SwapBytes32(RecvBuffer.Header.responseCode);
|
||||
if (ResponseCode != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvRead - responseCode - %x\n", ResponseCode));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvRead - responseCode - %x\n", ResponseCode));
|
||||
}
|
||||
switch (ResponseCode) {
|
||||
case TPM_RC_SUCCESS:
|
||||
@@ -723,13 +723,13 @@ Tpm2NvWrite (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvWrite - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvWrite - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
ResponseCode = SwapBytes32(RecvBuffer.Header.responseCode);
|
||||
if (ResponseCode != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvWrite - responseCode - %x\n", ResponseCode));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvWrite - responseCode - %x\n", ResponseCode));
|
||||
}
|
||||
switch (ResponseCode) {
|
||||
case TPM_RC_SUCCESS:
|
||||
@@ -843,14 +843,14 @@ Tpm2NvReadLock (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvReadLock - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvReadLock - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
ResponseCode = SwapBytes32(RecvBuffer.Header.responseCode);
|
||||
if (ResponseCode != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvReadLock - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvReadLock - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
}
|
||||
switch (ResponseCode) {
|
||||
case TPM_RC_SUCCESS:
|
||||
@@ -930,14 +930,14 @@ Tpm2NvWriteLock (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvWriteLock - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvWriteLock - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
ResponseCode = SwapBytes32(RecvBuffer.Header.responseCode);
|
||||
if (ResponseCode != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvWriteLock - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvWriteLock - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
}
|
||||
switch (ResponseCode) {
|
||||
case TPM_RC_SUCCESS:
|
||||
@@ -1014,14 +1014,14 @@ Tpm2NvGlobalWriteLock (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvGlobalWriteLock - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvGlobalWriteLock - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
Status = EFI_DEVICE_ERROR;
|
||||
goto Done;
|
||||
}
|
||||
|
||||
ResponseCode = SwapBytes32(RecvBuffer.Header.responseCode);
|
||||
if (ResponseCode != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2NvGlobalWriteLock - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2NvGlobalWriteLock - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
}
|
||||
switch (ResponseCode) {
|
||||
case TPM_RC_SUCCESS:
|
||||
|
@@ -134,7 +134,7 @@ Tpm2HashSequenceStart (
|
||||
}
|
||||
|
||||
if (ResultBufSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "HashSequenceStart: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
DEBUG ((DEBUG_ERROR, "HashSequenceStart: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
@@ -143,7 +143,7 @@ Tpm2HashSequenceStart (
|
||||
//
|
||||
RespSize = SwapBytes32(Res.Header.paramSize);
|
||||
if (RespSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "HashSequenceStart: Response size too large! %d\r\n", RespSize));
|
||||
DEBUG ((DEBUG_ERROR, "HashSequenceStart: Response size too large! %d\r\n", RespSize));
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
@@ -151,7 +151,7 @@ Tpm2HashSequenceStart (
|
||||
// Fail if command failed
|
||||
//
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "HashSequenceStart: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "HashSequenceStart: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
@@ -231,7 +231,7 @@ Tpm2SequenceUpdate (
|
||||
}
|
||||
|
||||
if (ResultBufSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "SequenceUpdate: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
DEBUG ((DEBUG_ERROR, "SequenceUpdate: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ Tpm2SequenceUpdate (
|
||||
//
|
||||
RespSize = SwapBytes32(Res.Header.paramSize);
|
||||
if (RespSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "SequenceUpdate: Response size too large! %d\r\n", RespSize));
|
||||
DEBUG ((DEBUG_ERROR, "SequenceUpdate: Response size too large! %d\r\n", RespSize));
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
@@ -248,7 +248,7 @@ Tpm2SequenceUpdate (
|
||||
// Fail if command failed
|
||||
//
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "SequenceUpdate: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "SequenceUpdate: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
@@ -340,7 +340,7 @@ Tpm2EventSequenceComplete (
|
||||
}
|
||||
|
||||
if (ResultBufSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "EventSequenceComplete: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
DEBUG ((DEBUG_ERROR, "EventSequenceComplete: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
@@ -349,7 +349,7 @@ Tpm2EventSequenceComplete (
|
||||
//
|
||||
RespSize = SwapBytes32(Res.Header.paramSize);
|
||||
if (RespSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "EventSequenceComplete: Response size too large! %d\r\n", RespSize));
|
||||
DEBUG ((DEBUG_ERROR, "EventSequenceComplete: Response size too large! %d\r\n", RespSize));
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
@@ -357,7 +357,7 @@ Tpm2EventSequenceComplete (
|
||||
// Fail if command failed
|
||||
//
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "EventSequenceComplete: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "EventSequenceComplete: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
@@ -382,7 +382,7 @@ Tpm2EventSequenceComplete (
|
||||
|
||||
DigestSize = GetHashSizeFromAlgo (Results->digests[Index].hashAlg);
|
||||
if (DigestSize == 0) {
|
||||
DEBUG ((EFI_D_ERROR, "EventSequenceComplete: Unknown hash algorithm %d\r\n", Results->digests[Index].hashAlg));
|
||||
DEBUG ((DEBUG_ERROR, "EventSequenceComplete: Unknown hash algorithm %d\r\n", Results->digests[Index].hashAlg));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
CopyMem(
|
||||
@@ -466,7 +466,7 @@ Tpm2SequenceComplete (
|
||||
}
|
||||
|
||||
if (ResultBufSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "SequenceComplete: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
DEBUG ((DEBUG_ERROR, "SequenceComplete: Failed ExecuteCommand: Buffer Too Small\r\n"));
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
@@ -475,7 +475,7 @@ Tpm2SequenceComplete (
|
||||
//
|
||||
RespSize = SwapBytes32(Res.Header.paramSize);
|
||||
if (RespSize > sizeof(Res)) {
|
||||
DEBUG ((EFI_D_ERROR, "SequenceComplete: Response size too large! %d\r\n", RespSize));
|
||||
DEBUG ((DEBUG_ERROR, "SequenceComplete: Response size too large! %d\r\n", RespSize));
|
||||
return EFI_BUFFER_TOO_SMALL;
|
||||
}
|
||||
|
||||
@@ -483,7 +483,7 @@ Tpm2SequenceComplete (
|
||||
// Fail if command failed
|
||||
//
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "SequenceComplete: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "SequenceComplete: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
@@ -124,7 +124,7 @@ Tpm2StartAuthSession (
|
||||
break;
|
||||
default:
|
||||
ASSERT (FALSE);
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2StartAuthSession - Symmetric->algorithm - %x\n", Symmetric->algorithm));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2StartAuthSession - Symmetric->algorithm - %x\n", Symmetric->algorithm));
|
||||
return EFI_UNSUPPORTED;
|
||||
}
|
||||
|
||||
@@ -144,11 +144,11 @@ Tpm2StartAuthSession (
|
||||
}
|
||||
|
||||
if (RecvBufferSize < sizeof (TPM2_RESPONSE_HEADER)) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2StartAuthSession - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2StartAuthSession - RecvBufferSize Error - %x\n", RecvBufferSize));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
if (SwapBytes32(RecvBuffer.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2StartAuthSession - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2StartAuthSession - responseCode - %x\n", SwapBytes32(RecvBuffer.Header.responseCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
@@ -77,7 +77,7 @@ Tpm2Startup (
|
||||
DEBUG ((DEBUG_INFO, "TPM2Startup: TPM_RC_INITIALIZE\n"));
|
||||
return EFI_SUCCESS;
|
||||
default:
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2Startup: Response Code error! 0x%08x\r\n", ResponseCode));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2Startup: Response Code error! 0x%08x\r\n", ResponseCode));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ Tpm2Shutdown (
|
||||
}
|
||||
|
||||
if (SwapBytes32(Res.Header.responseCode) != TPM_RC_SUCCESS) {
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2Shutdown: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2Shutdown: Response Code error! 0x%08x\r\n", SwapBytes32(Res.Header.responseCode)));
|
||||
return EFI_DEVICE_ERROR;
|
||||
}
|
||||
|
||||
|
@@ -154,22 +154,22 @@ PtpCrbTpmCommand (
|
||||
DEBUG_CODE (
|
||||
UINTN DebugSize;
|
||||
|
||||
DEBUG ((EFI_D_VERBOSE, "PtpCrbTpmCommand Send - "));
|
||||
DEBUG ((DEBUG_VERBOSE, "PtpCrbTpmCommand Send - "));
|
||||
if (SizeIn > 0x100) {
|
||||
DebugSize = 0x40;
|
||||
} else {
|
||||
DebugSize = SizeIn;
|
||||
}
|
||||
for (Index = 0; Index < DebugSize; Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
}
|
||||
if (DebugSize != SizeIn) {
|
||||
DEBUG ((EFI_D_VERBOSE, "...... "));
|
||||
DEBUG ((DEBUG_VERBOSE, "...... "));
|
||||
for (Index = SizeIn - 0x20; Index < SizeIn; Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
}
|
||||
}
|
||||
DEBUG ((EFI_D_VERBOSE, "\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "\n"));
|
||||
);
|
||||
TpmOutSize = 0;
|
||||
|
||||
@@ -286,11 +286,11 @@ PtpCrbTpmCommand (
|
||||
BufferOut[Index] = MmioRead8 ((UINTN)&CrbReg->CrbDataBuffer[Index]);
|
||||
}
|
||||
DEBUG_CODE (
|
||||
DEBUG ((EFI_D_VERBOSE, "PtpCrbTpmCommand ReceiveHeader - "));
|
||||
DEBUG ((DEBUG_VERBOSE, "PtpCrbTpmCommand ReceiveHeader - "));
|
||||
for (Index = 0; Index < sizeof (TPM2_RESPONSE_HEADER); Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
}
|
||||
DEBUG ((EFI_D_VERBOSE, "\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "\n"));
|
||||
);
|
||||
//
|
||||
// Check the response data header (tag, parasize and returncode)
|
||||
@@ -298,7 +298,7 @@ PtpCrbTpmCommand (
|
||||
CopyMem (&Data16, BufferOut, sizeof (UINT16));
|
||||
// TPM2 should not use this RSP_COMMAND
|
||||
if (SwapBytes16 (Data16) == TPM_ST_RSP_COMMAND) {
|
||||
DEBUG ((EFI_D_ERROR, "TPM2: TPM_ST_RSP error - %x\n", TPM_ST_RSP_COMMAND));
|
||||
DEBUG ((DEBUG_ERROR, "TPM2: TPM_ST_RSP error - %x\n", TPM_ST_RSP_COMMAND));
|
||||
Status = EFI_UNSUPPORTED;
|
||||
goto GoIdle_Exit;
|
||||
}
|
||||
@@ -321,11 +321,11 @@ PtpCrbTpmCommand (
|
||||
}
|
||||
|
||||
DEBUG_CODE (
|
||||
DEBUG ((EFI_D_VERBOSE, "PtpCrbTpmCommand Receive - "));
|
||||
DEBUG ((DEBUG_VERBOSE, "PtpCrbTpmCommand Receive - "));
|
||||
for (Index = 0; Index < TpmOutSize; Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
}
|
||||
DEBUG ((EFI_D_VERBOSE, "\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "\n"));
|
||||
);
|
||||
|
||||
GoReady_Exit:
|
||||
@@ -494,36 +494,36 @@ DumpPtpInfo (
|
||||
//
|
||||
// Dump InterfaceId Register for PTP
|
||||
//
|
||||
DEBUG ((EFI_D_INFO, "InterfaceId - 0x%08x\n", InterfaceId.Uint32));
|
||||
DEBUG ((EFI_D_INFO, " InterfaceType - 0x%02x\n", InterfaceId.Bits.InterfaceType));
|
||||
DEBUG ((DEBUG_INFO, "InterfaceId - 0x%08x\n", InterfaceId.Uint32));
|
||||
DEBUG ((DEBUG_INFO, " InterfaceType - 0x%02x\n", InterfaceId.Bits.InterfaceType));
|
||||
if (InterfaceId.Bits.InterfaceType != PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_TIS) {
|
||||
DEBUG ((EFI_D_INFO, " InterfaceVersion - 0x%02x\n", InterfaceId.Bits.InterfaceVersion));
|
||||
DEBUG ((EFI_D_INFO, " CapFIFO - 0x%x\n", InterfaceId.Bits.CapFIFO));
|
||||
DEBUG ((EFI_D_INFO, " CapCRB - 0x%x\n", InterfaceId.Bits.CapCRB));
|
||||
DEBUG ((DEBUG_INFO, " InterfaceVersion - 0x%02x\n", InterfaceId.Bits.InterfaceVersion));
|
||||
DEBUG ((DEBUG_INFO, " CapFIFO - 0x%x\n", InterfaceId.Bits.CapFIFO));
|
||||
DEBUG ((DEBUG_INFO, " CapCRB - 0x%x\n", InterfaceId.Bits.CapCRB));
|
||||
}
|
||||
|
||||
//
|
||||
// Dump Capability Register for TIS and FIFO
|
||||
//
|
||||
DEBUG ((EFI_D_INFO, "InterfaceCapability - 0x%08x\n", InterfaceCapability.Uint32));
|
||||
DEBUG ((DEBUG_INFO, "InterfaceCapability - 0x%08x\n", InterfaceCapability.Uint32));
|
||||
if ((InterfaceId.Bits.InterfaceType == PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_TIS) ||
|
||||
(InterfaceId.Bits.InterfaceType == PTP_INTERFACE_IDENTIFIER_INTERFACE_TYPE_FIFO)) {
|
||||
DEBUG ((EFI_D_INFO, " InterfaceVersion - 0x%x\n", InterfaceCapability.Bits.InterfaceVersion));
|
||||
DEBUG ((DEBUG_INFO, " InterfaceVersion - 0x%x\n", InterfaceCapability.Bits.InterfaceVersion));
|
||||
}
|
||||
|
||||
//
|
||||
// Dump StatusEx Register for PTP FIFO
|
||||
//
|
||||
DEBUG ((EFI_D_INFO, "StatusEx - 0x%02x\n", StatusEx));
|
||||
DEBUG ((DEBUG_INFO, "StatusEx - 0x%02x\n", StatusEx));
|
||||
if (InterfaceCapability.Bits.InterfaceVersion == INTERFACE_CAPABILITY_INTERFACE_VERSION_PTP) {
|
||||
DEBUG ((EFI_D_INFO, " TpmFamily - 0x%x\n", (StatusEx & PTP_FIFO_STS_EX_TPM_FAMILY) >> PTP_FIFO_STS_EX_TPM_FAMILY_OFFSET));
|
||||
DEBUG ((DEBUG_INFO, " TpmFamily - 0x%x\n", (StatusEx & PTP_FIFO_STS_EX_TPM_FAMILY) >> PTP_FIFO_STS_EX_TPM_FAMILY_OFFSET));
|
||||
}
|
||||
|
||||
Vid = 0xFFFF;
|
||||
Did = 0xFFFF;
|
||||
Rid = 0xFF;
|
||||
PtpInterface = GetCachedPtpInterface ();
|
||||
DEBUG ((EFI_D_INFO, "PtpInterface - %x\n", PtpInterface));
|
||||
DEBUG ((DEBUG_INFO, "PtpInterface - %x\n", PtpInterface));
|
||||
switch (PtpInterface) {
|
||||
case Tpm2PtpInterfaceCrb:
|
||||
Vid = MmioRead16 ((UINTN)&((PTP_CRB_REGISTERS *)Register)->Vid);
|
||||
@@ -539,9 +539,9 @@ DumpPtpInfo (
|
||||
default:
|
||||
break;
|
||||
}
|
||||
DEBUG ((EFI_D_INFO, "VID - 0x%04x\n", Vid));
|
||||
DEBUG ((EFI_D_INFO, "DID - 0x%04x\n", Did));
|
||||
DEBUG ((EFI_D_INFO, "RID - 0x%02x\n", Rid));
|
||||
DEBUG ((DEBUG_INFO, "VID - 0x%04x\n", Vid));
|
||||
DEBUG ((DEBUG_INFO, "DID - 0x%04x\n", Did));
|
||||
DEBUG ((DEBUG_INFO, "RID - 0x%02x\n", Rid));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@@ -221,22 +221,22 @@ Tpm2TisTpmCommand (
|
||||
DEBUG_CODE (
|
||||
UINTN DebugSize;
|
||||
|
||||
DEBUG ((EFI_D_VERBOSE, "Tpm2TisTpmCommand Send - "));
|
||||
DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand Send - "));
|
||||
if (SizeIn > 0x100) {
|
||||
DebugSize = 0x40;
|
||||
} else {
|
||||
DebugSize = SizeIn;
|
||||
}
|
||||
for (Index = 0; Index < DebugSize; Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
}
|
||||
if (DebugSize != SizeIn) {
|
||||
DEBUG ((EFI_D_VERBOSE, "...... "));
|
||||
DEBUG ((DEBUG_VERBOSE, "...... "));
|
||||
for (Index = SizeIn - 0x20; Index < SizeIn; Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferIn[Index]));
|
||||
}
|
||||
}
|
||||
DEBUG ((EFI_D_VERBOSE, "\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "\n"));
|
||||
);
|
||||
TpmOutSize = 0;
|
||||
|
||||
@@ -333,11 +333,11 @@ Tpm2TisTpmCommand (
|
||||
}
|
||||
}
|
||||
DEBUG_CODE (
|
||||
DEBUG ((EFI_D_VERBOSE, "Tpm2TisTpmCommand ReceiveHeader - "));
|
||||
DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand ReceiveHeader - "));
|
||||
for (Index = 0; Index < sizeof (TPM2_RESPONSE_HEADER); Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
}
|
||||
DEBUG ((EFI_D_VERBOSE, "\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "\n"));
|
||||
);
|
||||
//
|
||||
// Check the response data header (tag,parasize and returncode )
|
||||
@@ -345,7 +345,7 @@ Tpm2TisTpmCommand (
|
||||
CopyMem (&Data16, BufferOut, sizeof (UINT16));
|
||||
// TPM2 should not use this RSP_COMMAND
|
||||
if (SwapBytes16 (Data16) == TPM_ST_RSP_COMMAND) {
|
||||
DEBUG ((EFI_D_ERROR, "TPM2: TPM_ST_RSP error - %x\n", TPM_ST_RSP_COMMAND));
|
||||
DEBUG ((DEBUG_ERROR, "TPM2: TPM_ST_RSP error - %x\n", TPM_ST_RSP_COMMAND));
|
||||
Status = EFI_UNSUPPORTED;
|
||||
goto Exit;
|
||||
}
|
||||
@@ -377,11 +377,11 @@ Tpm2TisTpmCommand (
|
||||
}
|
||||
Exit:
|
||||
DEBUG_CODE (
|
||||
DEBUG ((EFI_D_VERBOSE, "Tpm2TisTpmCommand Receive - "));
|
||||
DEBUG ((DEBUG_VERBOSE, "Tpm2TisTpmCommand Receive - "));
|
||||
for (Index = 0; Index < TpmOutSize; Index++) {
|
||||
DEBUG ((EFI_D_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
DEBUG ((DEBUG_VERBOSE, "%02x ", BufferOut[Index]));
|
||||
}
|
||||
DEBUG ((EFI_D_VERBOSE, "\n"));
|
||||
DEBUG ((DEBUG_VERBOSE, "\n"));
|
||||
);
|
||||
MmioWrite8((UINTN)&TisReg->Status, TIS_PC_STS_READY);
|
||||
return Status;
|
||||
|
@@ -123,7 +123,7 @@ Tpm2RegisterTpm2DeviceLib (
|
||||
//
|
||||
// In PEI phase, there will be shadow driver dispatched again.
|
||||
//
|
||||
DEBUG ((EFI_D_INFO, "Tpm2RegisterTpm2DeviceLib - Override\n"));
|
||||
DEBUG ((DEBUG_INFO, "Tpm2RegisterTpm2DeviceLib - Override\n"));
|
||||
CopyMem (Tpm2DeviceInterface, Tpm2Device, sizeof(*Tpm2Device));
|
||||
return EFI_SUCCESS;
|
||||
} else {
|
||||
|
@@ -46,7 +46,7 @@ Tpm2SubmitCommand (
|
||||
//
|
||||
// Tcg2 protocol is not installed. So, TPM2 is not present.
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2SubmitCommand - Tcg2 - %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2SubmitCommand - Tcg2 - %r\n", Status));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
@@ -90,7 +90,7 @@ Tpm2RequestUseTpm (
|
||||
//
|
||||
// Tcg2 protocol is not installed. So, TPM2 is not present.
|
||||
//
|
||||
DEBUG ((EFI_D_ERROR, "Tpm2RequestUseTpm - Tcg2 - %r\n", Status));
|
||||
DEBUG ((DEBUG_ERROR, "Tpm2RequestUseTpm - Tcg2 - %r\n", Status));
|
||||
return EFI_NOT_FOUND;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user