Skip to content

Commit

Permalink
Merge pull request #333 from nsacyber/sf-4-update
Browse files Browse the repository at this point in the history
SpringFramework 4 version update
  • Loading branch information
cyrus-dev authored Feb 8, 2021
2 parents 8639e8b + 2d9bbe1 commit 9b8721e
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 31 deletions.
2 changes: 1 addition & 1 deletion HIRS_AttestationCAPortal/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
18 changes: 6 additions & 12 deletions HIRS_Utils/src/main/java/hirs/data/persist/info/ComponentInfo.java
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,9 @@ public ComponentInfo(final String componentManufacturer,
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) {
Expand All @@ -123,17 +122,12 @@ public ComponentInfo(final String componentManufacturer,
*
* @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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,8 @@ public void setUp() {
*/
@Test
public void testConstruction() {
Assert.notNull(CertificateAuthorityCredential.select(certMan));
Assert.notNull(CertificateAuthorityCredential.select(certMan),
"testConstruction is not null.");
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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"));
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1121,7 +1121,7 @@ public final void verifyPlatformCredentialSerialNumberUnexpectedDeviceSerial()
+ "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(
Expand All @@ -1148,7 +1148,7 @@ public final void verifyPlatformCredentialWithBadKeyStore()
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);
Expand Down Expand Up @@ -1767,7 +1767,7 @@ public final void testvalidatePlatformCredentialAttributesV2p0RequiredFieldsEmpt
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
Expand Down Expand Up @@ -1823,7 +1823,7 @@ public final void testvalidatePlatformCredentialAttributesV2p0MissingComponentIn
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");
}

/**
Expand Down Expand Up @@ -1887,7 +1887,7 @@ public final void testvalidatePlatformCredentialAttributesV2p0RequiredComponentF
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
Expand Down Expand Up @@ -2222,7 +2222,7 @@ public final void testValidateChainFailure()
"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");
}

/**
Expand Down
20 changes: 10 additions & 10 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -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',
]
Expand Down

0 comments on commit 9b8721e

Please sign in to comment.