mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-15 09:20:24 +00:00
updated toString
This commit is contained in:
parent
c6e5dd125c
commit
4ddf56232f
@ -35,10 +35,10 @@ public class EvEfiSpdmDeviceSecurityEvent {
|
|||||||
* Signature (text) data.
|
* Signature (text) data.
|
||||||
*/
|
*/
|
||||||
private String signature = "";
|
private String signature = "";
|
||||||
/**
|
// /**
|
||||||
* True if the event is a DEVICE_SECURITY_EVENT_DATA or ..DATA2.
|
// * True if the event is a DEVICE_SECURITY_EVENT_DATA or ..DATA2.
|
||||||
*/
|
// */
|
||||||
private boolean bSpdmDeviceSecurityEventData = false;
|
// private boolean bSpdmDeviceSecurityEventData = false;
|
||||||
/**
|
/**
|
||||||
* Human readable description of the data within this DEVICE_SECURITY_EVENT_DATA/..DATA2 event.
|
* 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
|
signature = signature.replaceAll("[^\\P{C}\t\r\n]", ""); // remove null characters
|
||||||
|
|
||||||
if (signature.contains("SPDM Device Sec")) { // implies Device Security event
|
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];
|
byte[] versionBytes = new byte[UefiConstants.SIZE_2];
|
||||||
System.arraycopy(eventData, UefiConstants.OFFSET_16, versionBytes, 0,
|
System.arraycopy(eventData, UefiConstants.OFFSET_16, versionBytes, 0,
|
||||||
@ -67,16 +69,20 @@ public class EvEfiSpdmDeviceSecurityEvent {
|
|||||||
|
|
||||||
if (version.equals("0100")) {
|
if (version.equals("0100")) {
|
||||||
DeviceSecurityEventData dSED = new DeviceSecurityEventData(eventData);
|
DeviceSecurityEventData dSED = new DeviceSecurityEventData(eventData);
|
||||||
spdmInfo = dSED.toString();
|
spdmInfo += dSED.toString();
|
||||||
}
|
}
|
||||||
else if (version.equals("0200")) {
|
else if (version.equals("0200")) {
|
||||||
DeviceSecurityEventData2 dSED2 = new DeviceSecurityEventData2(eventData);
|
DeviceSecurityEventData2 dSED2 = new DeviceSecurityEventData2(eventData);
|
||||||
spdmInfo = dSED2.toString();
|
spdmInfo += dSED2.toString();
|
||||||
}
|
}
|
||||||
else {
|
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() {
|
public String toString() {
|
||||||
|
|
||||||
spdmInfo = " Signature = SPDM Device Sec" + spdmInfo;
|
// spdmInfo = " Signature = SPDM Device Sec" + spdmInfo;
|
||||||
// if (bSpdmDeviceSecurityEventData) {
|
// if (bSpdmDeviceSecurityEventData) {
|
||||||
// spdmInfo = " Signature = SPDM Device Sec" + spdmInfo;
|
// spdmInfo = " Signature = SPDM Device Sec" + spdmInfo;
|
||||||
// } else {
|
// } else {
|
||||||
|
Loading…
Reference in New Issue
Block a user