summaryrefslogtreecommitdiff
path: root/SecurityPkg/Tcg/TcgDxe
diff options
context:
space:
mode:
authorChao Zhang <chao.b.zhang@intel.com>2014-10-31 10:59:25 +0000
committerczhang46 <czhang46@Edk2>2014-10-31 10:59:25 +0000
commitf7fe68db7dad70646523a6ae2442f592651df8d9 (patch)
treee957797547f791c991e7935305e09c354baa4b80 /SecurityPkg/Tcg/TcgDxe
parent6ebffb67c8eca68cf5eb36bd308b305ab84fdd99 (diff)
downloadedk2-platforms-f7fe68db7dad70646523a6ae2442f592651df8d9.tar.xz
Remove redundant ASSERT in TcgDxe & TreeDxe. Some asserts are removed directly, some are replaced by debug output.
ASSERT for SetupEventLog is kept. It is the foundation of TcgProtocol and TrEEProtocol Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Chao Zhang <chao.b.zhang@intel.com> Reviewed-by: Yao Jiewen <jiewen.yao@intel.com> git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@16281 6f19259b-4bc3-4df7-8a09-765794883524
Diffstat (limited to 'SecurityPkg/Tcg/TcgDxe')
-rw-r--r--SecurityPkg/Tcg/TcgDxe/TcgDxe.c43
1 files changed, 30 insertions, 13 deletions
diff --git a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
index df9700a4d9..bf9c7521aa 100644
--- a/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
+++ b/SecurityPkg/Tcg/TcgDxe/TcgDxe.c
@@ -505,7 +505,10 @@ TcgDxeHashLogExtendEventI (
(UINTN) HashDataLen,
&NewEventHdr->Digest
);
- ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR(Status)) {
+ DEBUG ((DEBUG_ERROR, "TpmCommHashAll Failed. %x\n", Status));
+ return Status;
+ }
}
Status = TpmCommExtend (
@@ -745,9 +748,7 @@ MeasureHandoffTables (
(VOID **) &SmbiosTable
);
- if (!EFI_ERROR (Status)) {
- ASSERT (SmbiosTable != NULL);
-
+ if (!EFI_ERROR (Status) && SmbiosTable != NULL) {
TcgEvent.PCRIndex = 1;
TcgEvent.EventType = EV_EFI_HANDOFF_TABLES;
TcgEvent.EventSize = sizeof (HandoffTables);
@@ -1023,9 +1024,11 @@ MeasureAllBootVariables (
if (Status == EFI_NOT_FOUND) {
return EFI_SUCCESS;
}
- ASSERT (BootOrder != NULL);
if (EFI_ERROR (Status)) {
+ //
+ // BootOrder can't be NULL if status is not EFI_NOT_FOUND
+ //
FreePool (BootOrder);
return Status;
}
@@ -1091,14 +1094,18 @@ OnReadyToBoot (
Status = TcgMeasureAction (
EFI_CALLING_EFI_APPLICATION
);
- ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "%s not Measured. Error!\n", EFI_CALLING_EFI_APPLICATION));
+ }
//
// 2. Draw a line between pre-boot env and entering post-boot env.
//
for (PcrIndex = 0; PcrIndex < 8; PcrIndex++) {
Status = MeasureSeparatorEvent (PcrIndex);
- ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "Seperator Event not Measured. Error!\n"));
+ }
}
//
@@ -1119,7 +1126,9 @@ OnReadyToBoot (
Status = TcgMeasureAction (
EFI_RETURNING_FROM_EFI_APPLICATOIN
);
- ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "%s not Measured. Error!\n", EFI_RETURNING_FROM_EFI_APPLICATOIN));
+ }
}
DEBUG ((EFI_D_INFO, "TPM TcgDxe Measure Data when ReadyToBoot\n"));
@@ -1198,7 +1207,10 @@ InstallAcpiTable (
&TableKey
);
}
- ASSERT_EFI_ERROR (Status);
+
+ if (EFI_ERROR (Status)) {
+ DEBUG((EFI_D_ERROR, "Tcg Acpi Table installation failure"));
+ }
}
/**
@@ -1225,7 +1237,9 @@ OnExitBootServices (
Status = TcgMeasureAction (
EFI_EXIT_BOOT_SERVICES_INVOCATION
);
- ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)) {
+ DEBUG ((EFI_D_ERROR, "%s not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_INVOCATION));
+ }
//
// Measure success of ExitBootServices
@@ -1233,7 +1247,9 @@ OnExitBootServices (
Status = TcgMeasureAction (
EFI_EXIT_BOOT_SERVICES_SUCCEEDED
);
- ASSERT_EFI_ERROR (Status);
+ if (EFI_ERROR (Status)){
+ DEBUG ((EFI_D_ERROR, "%s not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_SUCCEEDED));
+ }
}
/**
@@ -1260,8 +1276,9 @@ OnExitBootServicesFailed (
Status = TcgMeasureAction (
EFI_EXIT_BOOT_SERVICES_FAILED
);
- ASSERT_EFI_ERROR (Status);
-
+ if (EFI_ERROR (Status)){
+ DEBUG ((EFI_D_ERROR, "%s not Measured. Error!\n", EFI_EXIT_BOOT_SERVICES_FAILED));
+ }
}
/**