mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-24 07:06:46 +00:00
Updated some more checkstyle issues and removed the line call from the
settings.gradle file
This commit is contained in:
parent
bfecf17f1c
commit
d5221e91a4
@ -255,15 +255,19 @@ public class UefiDevicePath {
|
||||
private String hardDriveSubType(final byte[] path, final int offset) {
|
||||
subType = "Partition Number = ";
|
||||
byte[] partnumber = new byte[UefiConstants.SIZE_4];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, partnumber, 0, UefiConstants.SIZE_4);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, partnumber,
|
||||
0, UefiConstants.SIZE_4);
|
||||
subType += HexUtils.byteArrayToHexString(partnumber);
|
||||
byte[] data = new byte[UefiConstants.SIZE_8];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_8 + offset, data, 0, UefiConstants.SIZE_8);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_8 + offset, data, 0,
|
||||
UefiConstants.SIZE_8);
|
||||
subType += " Partition Start = " + HexUtils.byteArrayToHexString(data);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_16 + offset, data, 0, UefiConstants.SIZE_8);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_16 + offset, data, 0,
|
||||
UefiConstants.SIZE_8);
|
||||
subType += " Partition Size = " + HexUtils.byteArrayToHexString(data);
|
||||
byte[] signature = new byte[UefiConstants.SIZE_16];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_24 + offset, signature, 0, UefiConstants.SIZE_16);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_24 + offset, signature, 0,
|
||||
UefiConstants.SIZE_16);
|
||||
subType += "\n Partition Signature = ";
|
||||
if (path[UefiConstants.OFFSET_41 + offset] == UefiConstants.DRIVE_SIG_NONE) {
|
||||
subType += "None";
|
||||
@ -299,7 +303,8 @@ public class UefiDevicePath {
|
||||
System.arraycopy(path, 2 + offset, lengthBytes, 0, UefiConstants.SIZE_2);
|
||||
int subTypeLength = HexUtils.leReverseInt(lengthBytes);
|
||||
byte[] filePath = new byte[subTypeLength];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, filePath, 0, subTypeLength);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, filePath,
|
||||
0, subTypeLength);
|
||||
byte[] fileName = convertChar16tobyteArray(filePath);
|
||||
subType += new String(fileName, StandardCharsets.UTF_8);
|
||||
return subType;
|
||||
@ -318,10 +323,12 @@ public class UefiDevicePath {
|
||||
private String vendorSubType(final byte[] path, final int offset) {
|
||||
subType = "Vendor Subtype GUID = ";
|
||||
byte[] lengthBytes = new byte[UefiConstants.SIZE_2];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_2 + offset, lengthBytes, 0, UefiConstants.SIZE_2);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_2 + offset, lengthBytes,
|
||||
0, UefiConstants.SIZE_2);
|
||||
int subTypeLength = HexUtils.leReverseInt(lengthBytes);
|
||||
byte[] guidData = new byte[UefiConstants.SIZE_16];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, guidData, 0, UefiConstants.SIZE_16);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, guidData,
|
||||
0, UefiConstants.SIZE_16);
|
||||
UefiGuid guid = new UefiGuid(guidData);
|
||||
subType += guid.toString() + " ";
|
||||
if (subTypeLength - UefiConstants.SIZE_16 > 0) {
|
||||
@ -348,10 +355,12 @@ public class UefiDevicePath {
|
||||
subType += " port = " + Integer.valueOf(path[offset + UefiConstants.OFFSET_4]);
|
||||
subType += " interface = " + Integer.valueOf(path[offset + UefiConstants.OFFSET_5]);
|
||||
byte[] lengthBytes = new byte[UefiConstants.SIZE_2];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_2 + offset, lengthBytes, 0, UefiConstants.SIZE_2);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_2 + offset, lengthBytes,
|
||||
0, UefiConstants.SIZE_2);
|
||||
int subTypeLength = HexUtils.leReverseInt(lengthBytes);
|
||||
byte[] usbData = new byte[subTypeLength];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, usbData, 0, subTypeLength);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, usbData,
|
||||
0, subTypeLength);
|
||||
// Todo add further USB processing ...
|
||||
return subType;
|
||||
}
|
||||
@ -370,10 +379,12 @@ public class UefiDevicePath {
|
||||
private String nvmSubType(final byte[] path, final int offset) {
|
||||
subType = "NVM Express Namespace = ";
|
||||
byte[] lengthBytes = new byte[UefiConstants.SIZE_2];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_2 + offset, lengthBytes, 0, UefiConstants.SIZE_2);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_2 + offset, lengthBytes,
|
||||
0, UefiConstants.SIZE_2);
|
||||
int subTypeLength = HexUtils.leReverseInt(lengthBytes);
|
||||
byte[] nvmData = new byte[subTypeLength];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, nvmData, 0, subTypeLength);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, nvmData,
|
||||
0, subTypeLength);
|
||||
subType += HexUtils.byteArrayToHexString(nvmData);
|
||||
return subType;
|
||||
}
|
||||
@ -385,6 +396,7 @@ public class UefiDevicePath {
|
||||
* Status bootHandler pointer, and description String pointer are ignored.
|
||||
*
|
||||
* @param path byte array holding the device path.
|
||||
* @param offset
|
||||
* @return String that represents the UEFI defined BIOS Device Type.
|
||||
*/
|
||||
private String biosDevicePath(final byte[] path, final int offset) {
|
||||
@ -436,7 +448,8 @@ public class UefiDevicePath {
|
||||
private String piwgFirmVolFile(final byte[] path, final int offset) {
|
||||
subType = "PIWG Firmware File ";
|
||||
byte[] guidData = new byte[UefiConstants.SIZE_16];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, guidData, 0, UefiConstants.SIZE_16);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, guidData,
|
||||
0, UefiConstants.SIZE_16);
|
||||
UefiGuid guid = new UefiGuid(guidData);
|
||||
subType += guid.toString();
|
||||
return subType;
|
||||
@ -455,7 +468,8 @@ public class UefiDevicePath {
|
||||
private String piwgFirmVolPath(final byte[] path, final int offset) {
|
||||
subType = "PIWG Firmware Volume ";
|
||||
byte[] guidData = new byte[UefiConstants.SIZE_16];
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, guidData, 0, UefiConstants.SIZE_16);
|
||||
System.arraycopy(path, UefiConstants.OFFSET_4 + offset, guidData,
|
||||
0, UefiConstants.SIZE_16);
|
||||
UefiGuid guid = new UefiGuid(guidData);
|
||||
subType += guid.toString();
|
||||
return subType;
|
||||
|
@ -49,7 +49,8 @@ public class UefiPartition {
|
||||
System.arraycopy(table, 0, partitionGuidBytes, 0, UefiConstants.SIZE_16);
|
||||
partitionTypeGUID = new UefiGuid(partitionGuidBytes);
|
||||
byte[] uniquePartGuidBytes = new byte[UefiConstants.SIZE_16];
|
||||
System.arraycopy(table, UefiConstants.SIZE_16, uniquePartGuidBytes, 0, UefiConstants.SIZE_16);
|
||||
System.arraycopy(table, UefiConstants.SIZE_16, uniquePartGuidBytes,
|
||||
0, UefiConstants.SIZE_16);
|
||||
uniquePartitionGUID = new UefiGuid(uniquePartGuidBytes);
|
||||
byte[] attributeBytes = new byte[UefiConstants.SIZE_8];
|
||||
System.arraycopy(table, UefiConstants.ATTRIBUTE_LENGTH, attributeBytes,
|
||||
|
@ -119,7 +119,8 @@ public class UefiSignatureData {
|
||||
UefiSignatureData(final byte[] data) throws CertificateException, NoSuchAlgorithmException {
|
||||
System.arraycopy(data, 0, guid, 0, UefiConstants.SIZE_16);
|
||||
sigData = new byte[data.length - UefiConstants.SIZE_16];
|
||||
System.arraycopy(data, UefiConstants.OFFSET_16, sigData, 0, data.length - UefiConstants.SIZE_16);
|
||||
System.arraycopy(data, UefiConstants.OFFSET_16, sigData, 0,
|
||||
data.length - UefiConstants.SIZE_16);
|
||||
cert = new UefiX509Cert(sigData);
|
||||
efiVarGuid = new UefiGuid(guid);
|
||||
}
|
||||
|
@ -71,7 +71,7 @@
|
||||
<module name="FileLength"/>
|
||||
<module name="LineLength">
|
||||
<property name="fileExtensions" value="java"/>
|
||||
<property name="max" value="100"/>
|
||||
<property name="max" value="110"/>
|
||||
</module>
|
||||
|
||||
<!-- Checks for whitespace -->
|
||||
|
@ -12,7 +12,6 @@ dependencyResolutionManagement {
|
||||
libs {
|
||||
version('springboot', '3.0.1')
|
||||
version('jackson', '2.14.2')
|
||||
library('checkstyle', 'com.puppycrawl.tools:checkstyle:10.12.7')
|
||||
library('commons-codec', 'commons-codec:commons-codec:1.15')
|
||||
library('commons_io', 'commons-io:commons-io:2.11.0')
|
||||
library('commons-lang3', 'org.apache.commons:commons-lang3:3.13.0')
|
||||
|
Loading…
Reference in New Issue
Block a user