mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-03-18 18:15:20 +00:00
spdm processing
This commit is contained in:
parent
738a687b40
commit
93c1a9bf29
@ -30,6 +30,8 @@ public class DeviceSecurityEventDataHeader extends DeviceSecurityEventDataHeader
|
||||
|
||||
public DeviceSecurityEventDataHeader(final byte[] dSEDbytes) {
|
||||
|
||||
super(dSEDbytes);
|
||||
|
||||
byte[] lengthBytes = new byte[UefiConstants.SIZE_2];
|
||||
System.arraycopy(dSEDbytes, 18, lengthBytes, 0,
|
||||
UefiConstants.SIZE_2);
|
||||
|
@ -150,6 +150,35 @@ public abstract class DeviceSecurityEventDataHeaderBase {
|
||||
|
||||
}
|
||||
|
||||
public int getDeviceTypeId(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;
|
||||
}
|
||||
|
||||
public String getDevicePathString(final byte[] dSEDbytes, int startByte) {
|
||||
|
||||
// get the device path length
|
||||
byte[] devicePathLengthBytes = new byte[UefiConstants.SIZE_8];
|
||||
System.arraycopy(dSEDbytes, startByte, devicePathLengthBytes, 0,
|
||||
UefiConstants.SIZE_8);
|
||||
int deviceTypeLength = HexUtils.leReverseInt(devicePathLengthBytes);
|
||||
|
||||
// TO DO: how to interpret this?? i'ts not ascii
|
||||
|
||||
// get the device path
|
||||
startByte = startByte + UefiConstants.SIZE_8;
|
||||
byte[] devicePathBytes = new byte[UefiConstants.SIZE_16];
|
||||
System.arraycopy(dSEDbytes, startByte, devicePathBytes, 0,
|
||||
deviceTypeLength);
|
||||
|
||||
return "";
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the device type via a lookup.
|
||||
* Lookup based upon section 10.2.7.2, Table 19, in the PFP 1.06 v52 spec.
|
||||
|
Loading…
x
Reference in New Issue
Block a user