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 f3ad0ae4..5073a1d2 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 @@ -43,11 +43,11 @@ public class DeviceSecurityEventDataHeader extends DeviceSecurityEventDataHeader int h1SpdmHashAlgoInt = HexUtils.leReverseInt(spdmHashAlgoBytes); h1SpdmHashAlgo = SpdmHa.tcgAlgIdToString(h1SpdmHashAlgoInt); - byte[] deviceTypeBytes = new byte[UefiConstants.SIZE_4]; - System.arraycopy(dSEDbytes, UefiConstants.OFFSET_24, deviceTypeBytes, 0, - UefiConstants.SIZE_4); - int deviceTypeInt = HexUtils.leReverseInt(deviceTypeBytes); - deviceType = deviceTypeToString(deviceTypeInt); +// byte[] deviceTypeBytes = new byte[UefiConstants.SIZE_4]; +// System.arraycopy(dSEDbytes, UefiConstants.OFFSET_24, deviceTypeBytes, 0, +// UefiConstants.SIZE_4); +// int deviceTypeInt = HexUtils.leReverseInt(deviceTypeBytes); +// deviceType = deviceTypeToString(deviceTypeInt); // For each measurement block, create a SpdmMeasurementBlock object (can there be many blocks ?) diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataHeaderBase.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataHeaderBase.java index 27df6267..ad4b93da 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataHeaderBase.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventDataHeaderBase.java @@ -98,7 +98,12 @@ public abstract class DeviceSecurityEventDataHeaderBase { * Device type. */ @Getter - private String deviceType = ""; + private int deviceTypeId = -1; +// /** +// * Device type. +// */ +// @Getter +// private String deviceType = ""; /** * Device path length. */ @@ -150,17 +155,16 @@ public abstract class DeviceSecurityEventDataHeaderBase { } - public int getDeviceTypeId(final byte[] dSEDbytes, int startByte) { + public void extractDeviceTypeId(final byte[] dSEDbytes, int startByte) { // get the device type ID byte[] deviceTypeBytes = new byte[UefiConstants.SIZE_4]; System.arraycopy(dSEDbytes, startByte, deviceTypeBytes, 0, UefiConstants.SIZE_4); - int deviceTypeId = HexUtils.leReverseInt(deviceTypeBytes); - return deviceTypeId; + deviceTypeId = HexUtils.leReverseInt(deviceTypeBytes); } - public String getDevicePathString(final byte[] dSEDbytes, int startByte) { + public void extractDevicePathString(final byte[] dSEDbytes, int startByte) { // get the device path length byte[] devicePathLengthBytes = new byte[UefiConstants.SIZE_8]; @@ -168,7 +172,7 @@ public abstract class DeviceSecurityEventDataHeaderBase { UefiConstants.SIZE_8); int deviceTypeLength = HexUtils.leReverseInt(devicePathLengthBytes); - // TO DO: how to interpret this?? i'ts not ascii + // TODO: how to interpret this?? i'ts not ascii // get the device path startByte = startByte + UefiConstants.SIZE_8; @@ -176,7 +180,7 @@ public abstract class DeviceSecurityEventDataHeaderBase { System.arraycopy(dSEDbytes, startByte, devicePathBytes, 0, deviceTypeLength); - return ""; + // TODO: store device path length } /**