From 2bfa614161d84f970aaa1037b14525b0ab7998b5 Mon Sep 17 00:00:00 2001 From: iadgovuser58 <124906646+iadgovuser58@users.noreply.github.com> Date: Wed, 10 Apr 2024 12:02:01 -0400 Subject: [PATCH] SPDM processing --- .../DeviceSecurityEventDataDeviceContext.java | 5 +++ .../events/DeviceSecurityEventDataHeader.java | 34 ++++++++++++------- 2 files changed, 27 insertions(+), 12 deletions(-) diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataDeviceContext.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataDeviceContext.java index 286ebc31..34bdd300 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataDeviceContext.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataDeviceContext.java @@ -36,6 +36,11 @@ public class DeviceSecurityEventDataDeviceContext { @Getter private String pciLength = ""; + /** + * DeviceSecurityEventDataDeviceContext Constructor. + * + * @param dSEDbytes byte array holding the DeviceSecurityEventData. + */ public DeviceSecurityEventDataDeviceContext(final byte[] dSEDbytes, int byteStartOffset) { int byteOffset = byteStartOffset; diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataHeader.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataHeader.java index 28348eeb..1bee8f51 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataHeader.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataHeader.java @@ -73,6 +73,16 @@ import java.util.List; */ public class DeviceSecurityEventDataHeader { + /** + * Contains the human-readable info inside the Device Security Event. + */ + @Getter + private String dSEDheaderInfo = ""; + /** + * Contains the size (in bytes) of the Header. + */ + @Getter + private Integer dSEDheaderByteSize = 0; /** * Signature (text) data. */ @@ -85,22 +95,22 @@ public class DeviceSecurityEventDataHeader { @Getter private String version = ""; /** - * Contains the human-readable info inside the Device Security Event. + * Event Data Length. */ @Getter - private String dSEDheaderInfo = ""; + private String length = ""; /** - * Contains the size (in bytes) of the Header. + * Signature (text) data. */ @Getter - private Integer dSEDheaderByteSize = 0; -// -// /** -// * EvEfiSpecIdEvent Constructor. -// * -// * @param efiSpecId byte array holding the spec ID Event. -// */ -// public EvEfiSpecIdEvent(final byte[] efiSpecId) { + private String spdmHashAlgo = ""; + + /** + * DeviceSecurityEventDataHeader Constructor. + * + * @param dSEDbytes byte array holding the DeviceSecurityEventData. + */ + public DeviceSecurityEventDataHeader(final byte[] dSEDbytes) { // algList = new ArrayList<>(); // byte[] signatureBytes = new byte[UefiConstants.SIZE_16]; // System.arraycopy(efiSpecId, 0, signatureBytes, 0, UefiConstants.SIZE_16); @@ -143,7 +153,7 @@ public class DeviceSecurityEventDataHeader { // } else { // cryptoAgile = true; // } -// } + } // // /** // * Returns a human readable description of the data within this event.