From 4ddf56232f6f172c4838d50bd4e0fdc9894daca2 Mon Sep 17 00:00:00 2001 From: iadgovuser58 <124906646+iadgovuser58@users.noreply.github.com> Date: Thu, 20 Jun 2024 17:34:06 -0400 Subject: [PATCH] updated toString --- .../events/EvEfiSpdmDeviceSecurityEvent.java | 24 ++++++++++++------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpdmDeviceSecurityEvent.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpdmDeviceSecurityEvent.java index cfdcdd20..33b65615 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpdmDeviceSecurityEvent.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpdmDeviceSecurityEvent.java @@ -35,10 +35,10 @@ public class EvEfiSpdmDeviceSecurityEvent { * Signature (text) data. */ private String signature = ""; - /** - * True if the event is a DEVICE_SECURITY_EVENT_DATA or ..DATA2. - */ - private boolean bSpdmDeviceSecurityEventData = false; +// /** +// * True if the event is a DEVICE_SECURITY_EVENT_DATA or ..DATA2. +// */ +// private boolean bSpdmDeviceSecurityEventData = false; /** * Human readable description of the data within this DEVICE_SECURITY_EVENT_DATA/..DATA2 event. */ @@ -58,7 +58,9 @@ public class EvEfiSpdmDeviceSecurityEvent { signature = signature.replaceAll("[^\\P{C}\t\r\n]", ""); // remove null characters if (signature.contains("SPDM Device Sec")) { // implies Device Security event - bSpdmDeviceSecurityEventData = true; +// bSpdmDeviceSecurityEventData = true; + + spdmInfo = " Signature = SPDM Device Sec"; byte[] versionBytes = new byte[UefiConstants.SIZE_2]; System.arraycopy(eventData, UefiConstants.OFFSET_16, versionBytes, 0, @@ -67,16 +69,20 @@ public class EvEfiSpdmDeviceSecurityEvent { if (version.equals("0100")) { DeviceSecurityEventData dSED = new DeviceSecurityEventData(eventData); - spdmInfo = dSED.toString(); + spdmInfo += dSED.toString(); } else if (version.equals("0200")) { DeviceSecurityEventData2 dSED2 = new DeviceSecurityEventData2(eventData); - spdmInfo = dSED2.toString(); + spdmInfo += dSED2.toString(); } else { - spdmInfo = " Unknown version of DeviceSecurityEventData structure"; + spdmInfo += " Unknown version of DeviceSecurityEventData structure"; } } + else { + + spdmInfo = " Signature = Undetermined value: " + signature; + } } // /** @@ -95,7 +101,7 @@ public class EvEfiSpdmDeviceSecurityEvent { */ public String toString() { - spdmInfo = " Signature = SPDM Device Sec" + spdmInfo; +// spdmInfo = " Signature = SPDM Device Sec" + spdmInfo; // if (bSpdmDeviceSecurityEventData) { // spdmInfo = " Signature = SPDM Device Sec" + spdmInfo; // } else {