spdm processing

This commit is contained in:
iadgovuser58 2024-04-16 19:38:32 -04:00 committed by chubtub
parent 2cb2437ca0
commit 92dffcf0f0
4 changed files with 38 additions and 13 deletions

View File

@ -5,6 +5,7 @@ import hirs.utils.tpm.eventlog.events.EvCompactHash;
import hirs.utils.tpm.eventlog.events.EvConstants; import hirs.utils.tpm.eventlog.events.EvConstants;
import hirs.utils.tpm.eventlog.events.EvEfiGptPartition; import hirs.utils.tpm.eventlog.events.EvEfiGptPartition;
import hirs.utils.tpm.eventlog.events.EvEfiHandoffTable; import hirs.utils.tpm.eventlog.events.EvEfiHandoffTable;
import hirs.utils.tpm.eventlog.events.EvEfiSpdmFirmwareBlob;
import hirs.utils.tpm.eventlog.events.EvEfiSpecIdEvent; import hirs.utils.tpm.eventlog.events.EvEfiSpecIdEvent;
import hirs.utils.tpm.eventlog.events.EvEventTag; import hirs.utils.tpm.eventlog.events.EvEventTag;
import hirs.utils.tpm.eventlog.events.EvIPL; import hirs.utils.tpm.eventlog.events.EvIPL;
@ -534,6 +535,8 @@ public class TpmPcrEvent {
description += "Event Content:\n" + new UefiVariable(content).toString(); description += "Event Content:\n" + new UefiVariable(content).toString();
break; break;
case EvConstants.EV_EFI_SPDM_FIRMWARE_BLOB: case EvConstants.EV_EFI_SPDM_FIRMWARE_BLOB:
EvEfiSpdmFirmwareBlob efiSpdmFwBlob = new EvEfiSpdmFirmwareBlob(content);
description += "Event Content:\n" + efiSpdmFwBlob.toString();
default: default:
description += " Unknown Event found" + "\n"; description += " Unknown Event found" + "\n";
} }
@ -549,6 +552,7 @@ public class TpmPcrEvent {
*/ */
private static String eventString(final long event) { private static String eventString(final long event) {
System.out.println("XXXX " + event);
if (event == EvConstants.EV_PREBOOT_CERT) { if (event == EvConstants.EV_PREBOOT_CERT) {
return "EV_PREBOOT_CERT"; return "EV_PREBOOT_CERT";
} else if (event == EvConstants.EV_POST_CODE) { } else if (event == EvConstants.EV_POST_CODE) {

View File

@ -113,18 +113,38 @@ public class DeviceSecurityEventData {
} }
dSEDdeviceContext = new DeviceSecurityEventDataDeviceContext(dSEDbytes, byteOffset); dSEDdeviceContext = new DeviceSecurityEventDataDeviceContext(dSEDbytes, byteOffset);
if (version == "1") { // if (version == "1") {
dSEDinfo =+ // dSEDinfo =+
dSEDataHeader.getDSEDheaderInfo(); // dSEDataHeader.getDSEDheaderInfo();
dSEDinfo =+ // dSEDinfo =+
dSEDdeviceContext.getdSEDdeviceContextInfo(); // dSEDdeviceContext.getdSEDdeviceContextInfo();
} else if (version == "2") { // } else if (version == "2") {
dSEDinfo =+ // dSEDinfo =+
dSEDheader.getDSEDheaderInfo(); // dSEDheader.getDSEDheaderInfo();
dSEDinfo =+ // dSEDinfo =+
dSEDsubHeader.getDSEDsubHeaderInfo(); // dSEDsubHeader.getDSEDsubHeaderInfo();
dSEDinfo =+ // 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;
} }
} }

View File

@ -91,6 +91,7 @@ public class EvEfiSpdmFirmwareBlob {
// specInfo += " Platform Profile Specification version = " // specInfo += " Platform Profile Specification version = "
// + specIDEvent.getVersionMajor() + "." + specIDEvent.getVersionMinor() // + specIDEvent.getVersionMajor() + "." + specIDEvent.getVersionMinor()
// + " using errata version " + specIDEvent.getErrata(); // + " using errata version " + specIDEvent.getErrata();
// specInfo += DeviceSecurityEventData.toString();
} else { } else {
specInfo = "EV_EFI_SPDM_FIRMWARE_BLOB event named " + signature specInfo = "EV_EFI_SPDM_FIRMWARE_BLOB event named " + signature
+ " encountered but support for processing it has not been added to this application.\n"; + " encountered but support for processing it has not been added to this application.\n";