mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-29 17:28:57 +00:00
spdm processing
This commit is contained in:
parent
c129522768
commit
f4c52271f5
@ -43,11 +43,11 @@ public class DeviceSecurityEventDataHeader extends DeviceSecurityEventDataHeader
|
|||||||
int h1SpdmHashAlgoInt = HexUtils.leReverseInt(spdmHashAlgoBytes);
|
int h1SpdmHashAlgoInt = HexUtils.leReverseInt(spdmHashAlgoBytes);
|
||||||
h1SpdmHashAlgo = SpdmHa.tcgAlgIdToString(h1SpdmHashAlgoInt);
|
h1SpdmHashAlgo = SpdmHa.tcgAlgIdToString(h1SpdmHashAlgoInt);
|
||||||
|
|
||||||
byte[] deviceTypeBytes = new byte[UefiConstants.SIZE_4];
|
// byte[] deviceTypeBytes = new byte[UefiConstants.SIZE_4];
|
||||||
System.arraycopy(dSEDbytes, UefiConstants.OFFSET_24, deviceTypeBytes, 0,
|
// System.arraycopy(dSEDbytes, UefiConstants.OFFSET_24, deviceTypeBytes, 0,
|
||||||
UefiConstants.SIZE_4);
|
// UefiConstants.SIZE_4);
|
||||||
int deviceTypeInt = HexUtils.leReverseInt(deviceTypeBytes);
|
// int deviceTypeInt = HexUtils.leReverseInt(deviceTypeBytes);
|
||||||
deviceType = deviceTypeToString(deviceTypeInt);
|
// deviceType = deviceTypeToString(deviceTypeInt);
|
||||||
|
|
||||||
// For each measurement block, create a SpdmMeasurementBlock object (can there be many blocks ?)
|
// For each measurement block, create a SpdmMeasurementBlock object (can there be many blocks ?)
|
||||||
|
|
||||||
|
@ -98,7 +98,12 @@ public abstract class DeviceSecurityEventDataHeaderBase {
|
|||||||
* Device type.
|
* Device type.
|
||||||
*/
|
*/
|
||||||
@Getter
|
@Getter
|
||||||
private String deviceType = "";
|
private int deviceTypeId = -1;
|
||||||
|
// /**
|
||||||
|
// * Device type.
|
||||||
|
// */
|
||||||
|
// @Getter
|
||||||
|
// private String deviceType = "";
|
||||||
/**
|
/**
|
||||||
* Device path length.
|
* 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
|
// get the device type ID
|
||||||
byte[] deviceTypeBytes = new byte[UefiConstants.SIZE_4];
|
byte[] deviceTypeBytes = new byte[UefiConstants.SIZE_4];
|
||||||
System.arraycopy(dSEDbytes, startByte, deviceTypeBytes, 0,
|
System.arraycopy(dSEDbytes, startByte, deviceTypeBytes, 0,
|
||||||
UefiConstants.SIZE_4);
|
UefiConstants.SIZE_4);
|
||||||
int deviceTypeId = HexUtils.leReverseInt(deviceTypeBytes);
|
deviceTypeId = HexUtils.leReverseInt(deviceTypeBytes);
|
||||||
return deviceTypeId;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDevicePathString(final byte[] dSEDbytes, int startByte) {
|
public void extractDevicePathString(final byte[] dSEDbytes, int startByte) {
|
||||||
|
|
||||||
// get the device path length
|
// get the device path length
|
||||||
byte[] devicePathLengthBytes = new byte[UefiConstants.SIZE_8];
|
byte[] devicePathLengthBytes = new byte[UefiConstants.SIZE_8];
|
||||||
@ -168,7 +172,7 @@ public abstract class DeviceSecurityEventDataHeaderBase {
|
|||||||
UefiConstants.SIZE_8);
|
UefiConstants.SIZE_8);
|
||||||
int deviceTypeLength = HexUtils.leReverseInt(devicePathLengthBytes);
|
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
|
// get the device path
|
||||||
startByte = startByte + UefiConstants.SIZE_8;
|
startByte = startByte + UefiConstants.SIZE_8;
|
||||||
@ -176,7 +180,7 @@ public abstract class DeviceSecurityEventDataHeaderBase {
|
|||||||
System.arraycopy(dSEDbytes, startByte, devicePathBytes, 0,
|
System.arraycopy(dSEDbytes, startByte, devicePathBytes, 0,
|
||||||
deviceTypeLength);
|
deviceTypeLength);
|
||||||
|
|
||||||
return "";
|
// TODO: store device path length
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user