From e65f11e6d5f3c039a38980c678dbaddf1e64f518 Mon Sep 17 00:00:00 2001 From: iadgovuser58 <124906646+iadgovuser58@users.noreply.github.com> Date: Mon, 24 Jun 2024 15:20:52 -0400 Subject: [PATCH] consolidate case statement --- .../hirs/utils/tpm/eventlog/TpmPcrEvent.java | 20 ++++++------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/TpmPcrEvent.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/TpmPcrEvent.java index d98abe21..9c91113d 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/TpmPcrEvent.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/TpmPcrEvent.java @@ -527,9 +527,12 @@ public class TpmPcrEvent { vendorTableFileStatus = efiVar.getVendorTableFileStatus(); break; case EvConstants.EV_EFI_VARIABLE_BOOT: - UefiVariable efiVarBoot = new UefiVariable(content); - description += "Event Content:\n" + efiVarBoot.toString(); - vendorTableFileStatus = efiVarBoot.getVendorTableFileStatus(); + case EvConstants.EV_EFI_VARIABLE_AUTHORITY: + case EvConstants.EV_EFI_SPDM_DEVICE_POLICY: + case EvConstants.EV_EFI_SPDM_DEVICE_AUTHORITY: + UefiVariable efiVar2 = new UefiVariable(content); + description += "Event Content:\n" + efiVar2.toString(); + vendorTableFileStatus = efiVar2.getVendorTableFileStatus(); break; case EvConstants.EV_EFI_BOOT_SERVICES_APPLICATION: EvEfiBootServicesApp bootServices = new EvEfiBootServicesApp(content); @@ -557,23 +560,12 @@ public class TpmPcrEvent { break; case EvConstants.EV_EFI_HCRTM_EVENT: break; - case EvConstants.EV_EFI_VARIABLE_AUTHORITY: - UefiVariable efiVarAuth = new UefiVariable(content); - description += "Event Content:\n" + efiVarAuth.toString(); - vendorTableFileStatus = efiVarAuth.getVendorTableFileStatus(); - break; case EvConstants.EV_EFI_SPDM_FIRMWARE_BLOB: description += "Event Content:\n" + new EvEfiSpdmDeviceSecurityEvent(content).toString(); break; case EvConstants.EV_EFI_SPDM_FIRMWARE_CONFIG: description += "Event Content:\n" + new EvEfiSpdmDeviceSecurityEvent(content).toString(); break; - case EvConstants.EV_EFI_SPDM_DEVICE_POLICY: - case EvConstants.EV_EFI_SPDM_DEVICE_AUTHORITY: - UefiVariable efiSpdmDevPol = new UefiVariable(content); - description += "Event Content:\n" + efiSpdmDevPol.toString(); - vendorTableFileStatus = efiSpdmDevPol.getVendorTableFileStatus(); - break; default: description += " Unknown Event found" + "\n"; }