From 4547998384ceb8264b91b92cf98624aba38d8a4f Mon Sep 17 00:00:00 2001 From: iadgovuser58 <124906646+iadgovuser58@users.noreply.github.com> Date: Wed, 17 Apr 2024 17:28:17 -0400 Subject: [PATCH] spdm initial output --- ...s_addEvt11asSPDMFirmwareBlob_origVersion0} | Bin ...ements_addEvt11asSPDMFirmwareBlob_version1 | Bin 0 -> 23866 bytes .../events/DeviceSecurityEventData.java | 89 ++++++++------ .../events/DeviceSecurityEventDataHeader.java | 116 ++++++++++-------- .../events/EvEfiSpdmFirmwareBlob.java | 18 +-- .../tpm/eventlog/spdm/SpdmMeasurement.java | 13 ++ .../eventlog/spdm/SpdmMeasurementBlock.java | 13 ++ 7 files changed, 147 insertions(+), 102 deletions(-) rename 0_temp/{binary_bios_measurements_addEvt11asSPDMFirmwareBlob => binary_bios_measurements_addEvt11asSPDMFirmwareBlob_origVersion0} (100%) create mode 100644 0_temp/binary_bios_measurements_addEvt11asSPDMFirmwareBlob_version1 create mode 100644 HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/spdm/SpdmMeasurement.java create mode 100644 HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/spdm/SpdmMeasurementBlock.java diff --git a/0_temp/binary_bios_measurements_addEvt11asSPDMFirmwareBlob b/0_temp/binary_bios_measurements_addEvt11asSPDMFirmwareBlob_origVersion0 similarity index 100% rename from 0_temp/binary_bios_measurements_addEvt11asSPDMFirmwareBlob rename to 0_temp/binary_bios_measurements_addEvt11asSPDMFirmwareBlob_origVersion0 diff --git a/0_temp/binary_bios_measurements_addEvt11asSPDMFirmwareBlob_version1 b/0_temp/binary_bios_measurements_addEvt11asSPDMFirmwareBlob_version1 new file mode 100644 index 0000000000000000000000000000000000000000..3d1b3dbd4a122cfa9619f6c1c0c4e879c3777286 GIT binary patch literal 23866 zcmd_S1zc2Jy9YXScPauyC=D}oDxK1eGz>7*(4k0&f+zx_peQ90l8Ur63P>X%AS$3p z2$CWKcW*#n9evODefPZQ{Lb&*4SUb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mR;ZCqWg{>0LHLPwKD zFX^#j3pR_lY8>}tZk;^_$57cXyZQ<1jd7bY)6Y@`_21DU0Ej08!9L2kAP^pCU2HbQ zx-n6^sEMadsN}cHRYQece;| z!|oHZYh%|4w=6C!(nZ!$VnoH%J}LN_Emx#F@Ftb-X{{iafS((9>imC|zWr}{IB*T^ zr^Fu>``WbaW$kz(5>h3jCsIHiP7R03KCv7)eyy})tKN*!&@?AuSt{PlM00<)fFU#rI1(HPD zTO6_E0&91l2>F();Bn_K=HKn1OaF2MihU6_Lsg>my@TKa$zfLVbLS4u*th{<=zo#L z^CR6H(T2zN-rKj!zGCyQM`(BYG>fx?E4c5Q6YbXW6Mp$bCHo=l_u)}H$cP~S5AB0; Aq5uE@ literal 0 HcmV?d00001 diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventData.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventData.java index 560965ee..710598a4 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventData.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/DeviceSecurityEventData.java @@ -63,26 +63,26 @@ public class DeviceSecurityEventData { */ @Getter private String version = ""; - /** - * Contains the human-readable info inside the Device Security Event. - */ - @Getter - private String dSEDinfo = ""; +// /** +// * Contains the human-readable info inside the Device Security Event. +// */ +// @Getter +// private String dsedInfo = ""; /** * DeviceSecurityEventDataHeader Object. */ @Getter - private DeviceSecurityEventDataHeader dSEDheader = null; + private DeviceSecurityEventDataHeader dsedHeader = null; /** * DeviceSecurityEventDataSubHeader Object. */ - @Getter - private DeviceSecurityEventDataHeader dSEDsubHeader = null; +// @Getter +// private DeviceSecurityEventDataSubHeader dsedSubHeader = null; /** * DeviceSecurityEventDataDeviceContext Object. */ @Getter - private DeviceSecurityEventDataDeviceContext dSEDdeviceContext = null; + private DeviceSecurityEventDataDeviceContext dsedDeviceContext = null; /** * DeviceSecurityEventData Constructor. @@ -95,56 +95,65 @@ public class DeviceSecurityEventData { System.arraycopy(dSEDbytes, 0, signatureBytes, 0, UefiConstants.SIZE_16); //signature = HexUtils.byteArrayToHexString(signatureBytes); signature = new String(signatureBytes, StandardCharsets.UTF_8) - .substring(0, UefiConstants.SIZE_15); + .substring(0, UefiConstants.SIZE_15); // size 15 bc last letter is a 00 (null) - byte[] versionBytes = new byte[UefiConstants.SIZE_4]; + byte[] versionBytes = new byte[UefiConstants.SIZE_2]; System.arraycopy(dSEDbytes, UefiConstants.OFFSET_16, versionBytes, 0, - UefiConstants.SIZE_4); + UefiConstants.SIZE_2); version = HexUtils.byteArrayToHexString(versionBytes); +// int byteOffset = 0; +// byteOffset = dsedHeader.getDsedHeaderByteSize(); + // If version is 0x01, the event is a DEVICE_SECURITY_EVENT_DATA // If version is 0x02, the event is a DEVICE_SECURITY_EVENT_DATA2 - int byteOffset = 0; - dSEDheader = new DeviceSecurityEventDataHeader(dSEDbytes); - byteOffset = dSEDheader.getDSEDheaderByteSize(); - if (version == "2") { -// dSEDsubHeader = new DeviceSecurityEventDataSubHeader(dSEDbytes,byteOffset); -// byteOffset = dSEDheader.getDSEDsubHeaderByteSize(); - } - dSEDdeviceContext = new DeviceSecurityEventDataDeviceContext(dSEDbytes, byteOffset); + switch (version) { + case "0100": + dsedHeader = new DeviceSecurityEventDataHeader(dSEDbytes); +// dsedDeviceContext = new DeviceSecurityEventDataDeviceContext(dSEDbytes, +// dsedHeader.getDSEDheaderByteSize()); + break; + case "0200": + dsedHeader = new DeviceSecurityEventDataHeader(dSEDbytes); +// dsedSubHeader = new DeviceSecurityEventDataSubHeader(dSEDbytes,byteOffset); +// byteOffset = dsedHeader.getDSEDsubHeaderByteSize(); +// dsedDeviceContext = new DeviceSecurityEventDataDeviceContext(dSEDbytes, byteOffset); + break; + default: + break; + // if (version == "1") { // dSEDinfo =+ // dSEDataHeader.getDSEDheaderInfo(); // dSEDinfo =+ -// dSEDdeviceContext.getdSEDdeviceContextInfo(); +// dsedDeviceContext.getdSEDdeviceContextInfo(); // } else if (version == "2") { // dSEDinfo =+ // dSEDheader.getDSEDheaderInfo(); // dSEDinfo =+ -// dSEDsubHeader.getDSEDsubHeaderInfo(); +// dsedSubHeader.getDSEDsubHeaderInfo(); // dSEDinfo =+ -// dSEDdeviceContext.getDSEDdeviceContextInfo(); +// dsedDeviceContext.getDSEDdeviceContextInfo(); // } + } } public String toString() { - String specInfo = ""; - - specInfo += " Signature = SPDM Device Sec : "; -// if (specIDEvent.isCryptoAgile()) { -// specInfo += "Log format is Crypto Agile\n"; -// } else { -// specInfo += "Log format is SHA 1 (NOT Crypto Agile)\n"; -// } -// specInfo += " Platform Profile Specification version = " -// + specIDEvent.getVersionMajor() + "." + specIDEvent.getVersionMinor() -// + " using errata version " + specIDEvent.getErrata(); -// specInfo += DeviceSecurityEventData.toString(); -// } else { -// specInfo = "EV_EFI_SPDM_FIRMWARE_BLOB event named " + signature -// + " encountered but support for processing it has not been added to this application.\n"; -// } - return specInfo; + String dsedInfo = ""; + switch (version) { + case "0100": + dsedInfo += dsedHeader.toString(); +// dsedInfo += dsedDeviceContext.toString(); + break; + case "0200": +// dsedInfo += dsedHeader.toString(); +// dsedInfo += dsedSubHeader.toString(); +// dsedInfo += dsedDeviceContext.toString(); + break; + default: + dsedInfo += " Unknown SPDM Device Security Event Data version " + version + " found" + "\n"; + } + return dsedInfo; } } 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 772b766e..4c3c81f0 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 @@ -30,7 +30,7 @@ import java.util.List; * UNIT8 DevicePath[DevicePathLength] * } DEVICE_SECURITY_EVENT_DATA_HEADER; *

- * typedef struct tdDEVICE_SECURITY_EVENT_DATA_HEADER2 { + * typedef struct tdDEVICE_SECURITY_EVENT_DATA_HEADER2 { - NOT IMPLEMENTED YET * UINT8 Signature[16]; * UINT16 Version; * UINT8 AuthState; @@ -73,11 +73,14 @@ import java.util.List; */ public class DeviceSecurityEventDataHeader { - /** - * Contains the human-readable info inside the Device Security Event. +// /** +// * Contains the human-readable info inside the Device Security Event. +// */ +// @Getter +// private String dSEDheaderInfo = ""; + + /** ----------- Variables common to all Header Types ----------- */ - @Getter - private String dSEDheaderInfo = ""; /** * Contains the size (in bytes) of the Header. */ @@ -94,21 +97,42 @@ public class DeviceSecurityEventDataHeader { */ @Getter private String version = ""; - /** - * Event data length. - */ - @Getter - private String length = ""; - /** - * SPDM hash algorithm. - */ - @Getter - private String spdmHashAlgo = ""; /** * Device type. */ @Getter private String deviceType = ""; + /** + * Device path length. + */ + @Getter + private String devicePathLength = ""; + /** + * Device path. + */ + @Getter + private String devicePath = ""; + + /** ----------- Variables specific to Header Type 1 ----------- + /** + * Type Header 1 event data length. + */ + @Getter + private String h1Length = ""; + /** + * Type Header 1 SPDM hash algorithm. + */ + @Getter + private String h1SpdmHashAlgo = ""; + /** + * Type Header 1 SPDM measurement block. + */ + @Getter + private String h1SpdmMeasurementBlock = ""; + + /** ----------- Variables specific to Header Type 2 ----------- + */ + // TBD /** * DeviceSecurityEventDataHeader Constructor. @@ -123,33 +147,26 @@ public class DeviceSecurityEventDataHeader { signature = new String(signatureBytes, StandardCharsets.UTF_8) .substring(0, UefiConstants.SIZE_15); - byte[] versionBytes = new byte[UefiConstants.SIZE_4]; + byte[] versionBytes = new byte[UefiConstants.SIZE_2]; System.arraycopy(dSEDbytes, UefiConstants.OFFSET_16, versionBytes, 0, - UefiConstants.SIZE_4); + UefiConstants.SIZE_2); version = HexUtils.byteArrayToHexString(versionBytes); - byte[] lengthBytes = new byte[UefiConstants.SIZE_4]; - System.arraycopy(dSEDbytes, UefiConstants.OFFSET_20, lengthBytes, 0, - UefiConstants.SIZE_4); - length = HexUtils.byteArrayToHexString(lengthBytes); + byte[] lengthBytes = new byte[UefiConstants.SIZE_2]; + System.arraycopy(dSEDbytes, 18, lengthBytes, 0, + UefiConstants.SIZE_2); + h1Length = HexUtils.byteArrayToHexString(lengthBytes); - byte[] spdmHashAlgoBytes = new byte[UefiConstants.SIZE_8]; - System.arraycopy(dSEDbytes, UefiConstants.OFFSET_24, spdmHashAlgoBytes, 0, + byte[] spdmHashAlgoBytes = new byte[UefiConstants.SIZE_4]; + System.arraycopy(dSEDbytes, UefiConstants.OFFSET_20, spdmHashAlgoBytes, 0, UefiConstants.SIZE_4); - spdmHashAlgo = HexUtils.byteArrayToHexString(spdmHashAlgoBytes); + h1SpdmHashAlgo = HexUtils.byteArrayToHexString(spdmHashAlgoBytes); - byte[] deviceTypeBytes = new byte[UefiConstants.SIZE_8]; + byte[] deviceTypeBytes = new byte[UefiConstants.SIZE_4]; System.arraycopy(dSEDbytes, UefiConstants.OFFSET_24, deviceTypeBytes, 0, UefiConstants.SIZE_4); deviceType = HexUtils.byteArrayToHexString(deviceTypeBytes); -// byte[] specVersionMajorBytes = new byte[1]; -// System.arraycopy(efiSpecId, UefiConstants.OFFSET_21, specVersionMajorBytes, 0, 1); -// versionMajor = HexUtils.byteArrayToHexString(specVersionMajorBytes); -// -// byte[] specErrataBytes = new byte[1]; -// System.arraycopy(efiSpecId, UefiConstants.OFFSET_22, specErrataBytes, 0, 1); -// errata = HexUtils.byteArrayToHexString(specErrataBytes); // // byte[] numberOfAlgBytes = new byte[UefiConstants.SIZE_4]; // System.arraycopy(efiSpecId, UefiConstants.OFFSET_24, numberOfAlgBytes, 0, @@ -170,23 +187,24 @@ public class DeviceSecurityEventDataHeader { // cryptoAgile = true; // } } -// -// /** -// * Returns a human readable description of the data within this event. -// * -// * @return a description of this event.. -// */ -// public String toString() { -// String specInfo = ""; -// if (signature.equals("Spec ID Event#")) { -// specInfo += "Platform Profile Specification version = " + versionMajor + "." + versionMinor -// + " using errata version" + errata; -// } else { -// specInfo = "EV_NO_ACTION event named " + signature -// + " encountered but support for processing it has not been added to this application"; -// } -// return specInfo; -// } + /** + * Returns a human readable description of the data within this event. + * + * @return a description of this event.. + */ + public String toString() { + String dsedHeaderInfo = ""; + if (version.equals("0100")) { + dsedHeaderInfo += "\n SPDM hash algorithm = " + h1SpdmHashAlgo; + dsedHeaderInfo += "\n SPDM Device"; + dsedHeaderInfo += "\n Device Type: " + deviceType; + dsedHeaderInfo += "\n Device Path: " + devicePath; + dsedHeaderInfo += "\n SPDM Measurement Block " + h1SpdmMeasurementBlock; + } else if(version.equals("0200")) { + dsedHeaderInfo = "tbd"; + } + return dsedHeaderInfo; + } } diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpdmFirmwareBlob.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpdmFirmwareBlob.java index 89863723..c0a7d6c5 100644 --- a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpdmFirmwareBlob.java +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/events/EvEfiSpdmFirmwareBlob.java @@ -80,22 +80,14 @@ public class EvEfiSpdmFirmwareBlob { * @return Human readable description of this event. */ public String toString() { - String specInfo = ""; + String spdmInfo = ""; if (bDeviceSecurityEventData) { - specInfo += " Signature = SPDM Device Sec : "; -// if (specIDEvent.isCryptoAgile()) { -// specInfo += "Log format is Crypto Agile\n"; -// } else { -// specInfo += "Log format is SHA 1 (NOT Crypto Agile)\n"; -// } -// specInfo += " Platform Profile Specification version = " -// + specIDEvent.getVersionMajor() + "." + specIDEvent.getVersionMinor() -// + " using errata version " + specIDEvent.getErrata(); -// specInfo += DeviceSecurityEventData.toString(); + spdmInfo += " Signature = SPDM Device Sec"; + spdmInfo += deviceSecurityEventData.toString(); } else { - specInfo = "EV_EFI_SPDM_FIRMWARE_BLOB event named " + signature + spdmInfo = "EV_EFI_SPDM_FIRMWARE_BLOB event named " + signature + " encountered but support for processing it has not been added to this application.\n"; } - return specInfo; + return spdmInfo; } } diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/spdm/SpdmMeasurement.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/spdm/SpdmMeasurement.java new file mode 100644 index 00000000..4dd82a4e --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/spdm/SpdmMeasurement.java @@ -0,0 +1,13 @@ +package hirs.utils.tpm.eventlog.spdm; + +public class SpdmMeasurement { + + public SpdmMeasurement(final byte[] spdmMeasBytes) { + + } + + + public String toString() { + return "TEMP TEST SpdmMeasurement"; + } +} diff --git a/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/spdm/SpdmMeasurementBlock.java b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/spdm/SpdmMeasurementBlock.java new file mode 100644 index 00000000..00cd926d --- /dev/null +++ b/HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/spdm/SpdmMeasurementBlock.java @@ -0,0 +1,13 @@ +package hirs.utils.tpm.eventlog.spdm; + +public class SpdmMeasurementBlock { + + public SpdmMeasurementBlock(final byte[] spdmMeasBlockBytes) { + + } + + public String toString() { + return "TEMP TEST spdmMeasBlockBytes"; + } + +}