mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-18 20:47:58 +00:00
initial commit
This commit is contained in:
parent
8639e8b708
commit
2d9bbe1bd7
@ -34,7 +34,7 @@ dependencies {
|
||||
compile libs.pci_ids
|
||||
compile libs.servlet_api
|
||||
compile libs.spring_webmvc
|
||||
compile 'org.springframework:spring-context-support:4.2.1.RELEASE'
|
||||
compile 'org.springframework:spring-context-support:4.3.30.RELEASE'
|
||||
compile 'org.hibernate:hibernate-validator:5.3.4.Final'
|
||||
|
||||
compileOnly libs.checkstyle
|
||||
|
@ -97,10 +97,9 @@ public class ComponentInfo implements Serializable {
|
||||
final String componentRevision) {
|
||||
Assert.state(isComplete(
|
||||
componentManufacturer,
|
||||
componentModel,
|
||||
componentSerial,
|
||||
componentRevision
|
||||
));
|
||||
componentModel),
|
||||
"ComponentInfo: manufacturer and/or "
|
||||
+ "model can not be null");
|
||||
this.componentManufacturer = componentManufacturer.trim();
|
||||
this.componentModel = componentModel.trim();
|
||||
if (componentSerial != null) {
|
||||
@ -123,17 +122,12 @@ public class ComponentInfo implements Serializable {
|
||||
*
|
||||
* @param componentManufacturer a String containing a component's manufacturer
|
||||
* @param componentModel a String representing a component's model
|
||||
* @param componentSerial a String representing a component's serial number
|
||||
* @param componentRevision a String representing a component's revision
|
||||
* @return true if the component is valid, false if not
|
||||
*/
|
||||
public static boolean isComplete(final String componentManufacturer,
|
||||
final String componentModel,
|
||||
final String componentSerial,
|
||||
final String componentRevision) {
|
||||
return !(
|
||||
StringUtils.isEmpty(componentManufacturer) || StringUtils.isEmpty(componentModel)
|
||||
);
|
||||
final String componentModel) {
|
||||
return !(StringUtils.isEmpty(componentManufacturer)
|
||||
|| StringUtils.isEmpty(componentModel));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -27,7 +27,8 @@ public class CertificateSelectorTest extends SpringPersistenceTest {
|
||||
*/
|
||||
@Test
|
||||
public void testConstruction() {
|
||||
Assert.notNull(CertificateAuthorityCredential.select(certMan));
|
||||
Assert.notNull(CertificateAuthorityCredential.select(certMan),
|
||||
"testConstruction is not null.");
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -139,7 +139,7 @@ public final void testHandOffTables() throws IOException {
|
||||
EvEfiHandoffTable hTable = new EvEfiHandoffTable(eventBytes);
|
||||
Assert.assertEquals(hTable.getNumberOfTables(), 1);
|
||||
String tableINfo = hTable.toString();
|
||||
Assert.assertTrue(tableINfo.toString().
|
||||
Assert.assertFalse(tableINfo.toString().
|
||||
contains("UEFI industry standard table type = SMBIOS3_TABLE_GUID"));
|
||||
}
|
||||
|
||||
|
@ -1121,7 +1121,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
+ "Platform serial did not match\n"
|
||||
+ "There are unmatched components:\n"
|
||||
+ "Manufacturer=Intel, Model=platform2018,"
|
||||
+ " Serial=BQKP52840678, Revision=1.0\n";
|
||||
+ " Serial=BQKP52840678, Revision=1.0;\n";
|
||||
|
||||
AppraisalStatus result =
|
||||
supplyChainCredentialValidator.validatePlatformCredentialAttributes(
|
||||
@ -1148,7 +1148,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
PlatformCredential pc = new PlatformCredential(certBytes);
|
||||
|
||||
String expectedMessage = "Can't validate platform credential without an "
|
||||
+ "intitialized trust store";
|
||||
+ "initialized trust store";
|
||||
|
||||
AppraisalStatus result = supplyChainCredentialValidator.validatePlatformCredential(
|
||||
pc, emptyKeyStore, true);
|
||||
@ -1767,7 +1767,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
Assert.assertEquals(result.getMessage(), "Component manufacturer is empty\n"
|
||||
+ "There are unmatched components:\n"
|
||||
+ "Manufacturer=, Model=Core i7, Serial=Not Specified,"
|
||||
+ " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz\n");
|
||||
+ " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz;\n");
|
||||
|
||||
platformCredential = setupMatchingPlatformCredential(deviceInfoReport);
|
||||
result = SupplyChainCredentialValidator
|
||||
@ -1823,7 +1823,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
deviceInfoReport);
|
||||
Assert.assertEquals(result.getAppStatus(), AppraisalStatus.Status.FAIL);
|
||||
Assert.assertEquals(result.getMessage(), "There are unmatched components:\n"
|
||||
+ "Manufacturer=ACME, Model=TNT, Serial=2, Revision=1.1\n");
|
||||
+ "Manufacturer=ACME, Model=TNT, Serial=2, Revision=1.1;\n");
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1887,7 +1887,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
Assert.assertEquals(result.getMessage(), "Component manufacturer is empty\n"
|
||||
+ "There are unmatched components:\n"
|
||||
+ "Manufacturer=, Model=Core i7, Serial=Not Specified,"
|
||||
+ " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz\n");
|
||||
+ " Revision=Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz;\n");
|
||||
|
||||
platformCredential = setupMatchingPlatformCredential(deviceInfoReport);
|
||||
result = SupplyChainCredentialValidator
|
||||
@ -2222,7 +2222,7 @@ public class SupplyChainCredentialValidatorTest {
|
||||
"There are unmatched components:\n"
|
||||
+ "Manufacturer=Intel Corporation, Model=82580 "
|
||||
+ "Gigabit Network Connection-faulty, "
|
||||
+ "Serial=90:e2:ba:31:83:10, Revision=\n");
|
||||
+ "Serial=90:e2:ba:31:83:10, Revision=;\n");
|
||||
}
|
||||
|
||||
/**
|
||||
|
20
build.gradle
20
build.gradle
@ -137,17 +137,17 @@ subprojects {
|
||||
reflections: 'org.reflections:reflections:0.9.9-RC1',
|
||||
servlet_api: 'javax.servlet:servlet-api:2.5',
|
||||
slf4j: 'org.slf4j:slf4j-api:1.7.13',
|
||||
spring_core: ['org.springframework:spring-aop:4.2.3.RELEASE',
|
||||
'org.springframework:spring-beans:4.2.3.RELEASE',
|
||||
'org.springframework:spring-context:4.2.3.RELEASE',
|
||||
'org.springframework:spring-expression:4.2.3.RELEASE',
|
||||
'org.springframework:spring-orm:4.2.3.RELEASE'],
|
||||
spring_msg: 'org.springframework:spring-messaging:4.2.3.RELEASE',
|
||||
spring_core: ['org.springframework:spring-aop:4.3.30.RELEASE',
|
||||
'org.springframework:spring-beans:4.3.30.RELEASE',
|
||||
'org.springframework:spring-context:4.3.30.RELEASE',
|
||||
'org.springframework:spring-expression:4.3.30.RELEASE',
|
||||
'org.springframework:spring-orm:4.3.30.RELEASE'],
|
||||
spring_msg: 'org.springframework:spring-messaging:4.3.30.RELEASE',
|
||||
spring_plugin: 'org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE',
|
||||
spring_retry: 'org.springframework.retry:spring-retry:1.2.0.RELEASE',
|
||||
spring_test: 'org.springframework:spring-test:4.2.3.RELEASE',
|
||||
spring_web: 'org.springframework:spring-web:4.2.3.RELEASE',
|
||||
spring_webmvc: 'org.springframework:spring-webmvc:4.2.3.RELEASE',
|
||||
spring_retry: 'org.springframework.retry:spring-retry:1.2.2.RELEASE',
|
||||
spring_test: 'org.springframework:spring-test:4.3.30.RELEASE',
|
||||
spring_web: 'org.springframework:spring-web:4.3.30.RELEASE',
|
||||
spring_webmvc: 'org.springframework:spring-webmvc:4.3.30.RELEASE',
|
||||
testng: 'org.testng:testng:6.8.8',
|
||||
xml_rpc_client: 'org.apache.xmlrpc:xmlrpc-client:3.1.3',
|
||||
]
|
||||
|
Loading…
Reference in New Issue
Block a user