diff --git a/.ci/system-tests/tests/aca_policy_tests.sh b/.ci/system-tests/tests/aca_policy_tests.sh index 16d8679e..88599ef3 100755 --- a/.ci/system-tests/tests/aca_policy_tests.sh +++ b/.ci/system-tests/tests/aca_policy_tests.sh @@ -51,6 +51,7 @@ fi if [ "$test" = "6" ] || [ "$test" = "all" ]; then writeToLogs "### ACA POLICY TEST 6: Test PC Validation Policy with valid PC with no Attribute Check ###" clearAcaDb + resetTpmForNewTest setPolicyEkPc_noAttCheck uploadTrustedCerts setPlatformCerts "laptop" "default" @@ -58,8 +59,9 @@ if [ "$test" = "6" ] || [ "$test" = "all" ]; then fi if [ "$test" = "7" ] || [ "$test" = "all" ]; then writeToLogs "### ACA POLICY TEST 7: Test PC Validation Policy with valid PC with Attribute Check ###" - writeToLog "Now using appsettings with hardware information" + writeToLogs "Now using appsettings with hardware information" clearAcaDb + resetTpmForNewTest setPolicyEkPc uploadTrustedCerts setPlatformCerts "laptop" "default" @@ -69,6 +71,7 @@ fi if [ "$test" = "8" ] || [ "$test" = "all" ]; then writeToLogs "### ACA POLICY TEST 8: Test PC with RIM Validation Policy with valid PC and RIM ###" clearAcaDb + resetTpmForNewTest setPolicyEkPcFw uploadTrustedCerts setPlatformCerts "laptop" "default" diff --git a/.ci/system-tests/tests/platform_cert_tests.sh b/.ci/system-tests/tests/platform_cert_tests.sh index 3eeec7a3..6d4db639 100755 --- a/.ci/system-tests/tests/platform_cert_tests.sh +++ b/.ci/system-tests/tests/platform_cert_tests.sh @@ -18,9 +18,12 @@ esac # provisionTpm2 takes 1 parameter (the expected result): "pass" or "fail" # Note that the aca_policy_tests have already run several Platform Certificate system tests +setAppsettings --paccor-output-file /ci_test/hw.json --event-log-file /ci_test/binary_bios_measurements --linux-dmi + if [ "$test" = "1" ] || [ "$test" = "all" ]; then writeToLogs "### ACA PLATFORM CERTIFICATE TEST 1: Test a delta Platform Certificate that adds a new memory component ###" clearAcaDb + resetTpmForNewTest uploadTrustedCerts setPolicyEkPc setPlatformCerts "laptop" "deltaPlatMem" @@ -29,6 +32,7 @@ fi if [ "$test" = "2" ] || [ "$test" = "all" ]; then writeToLogs "### ACA PLATFORM CERTIFICATE TEST 2: Test a Platform Certificate that is missing a memory component ###" clearAcaDb + resetTpmForNewTest uploadTrustedCerts setPlatformCerts "laptop" "platCertLight" provisionTpm2 "pass" @@ -36,6 +40,7 @@ fi if [ "$test" = "3" ] || [ "$test" = "all" ]; then writeToLogs "### ACA PLATFORM CERTIFICATE TEST 3: Test a Delta Platform Certificate that has a wrong a memory component ###" clearAcaDb + resetTpmForNewTest uploadTrustedCerts setPlatformCerts "laptop" "badDeltaMem" provisionTpm2 "fail" @@ -47,4 +52,4 @@ if [[ $failedTests != 0 ]]; then echo "**** $failedTests out of $totalTests Platform Certificate Tests Failed! ****" else echo "**** $totalTests Platform Certificate Tests Passed! ****" -fi \ No newline at end of file +fi diff --git a/.ci/system-tests/tests/rim_system_tests.sh b/.ci/system-tests/tests/rim_system_tests.sh index e16ae5c3..69ca2c66 100755 --- a/.ci/system-tests/tests/rim_system_tests.sh +++ b/.ci/system-tests/tests/rim_system_tests.sh @@ -31,6 +31,7 @@ fi if [ "$test" = "2" ] || [ "$test" = "all" ]; then writeToLogs "### ACA RIM TEST 2: Test a RIM from an OEM with a bad reference measurement and a Supplemental RIM from a VAR ###" clearAcaDb + resetTpmForNewTest uploadTrustedCerts setPolicyEkPcFw setPlatformCerts "laptop" "badOemInstall" @@ -40,6 +41,7 @@ fi if [ "$test" = "3" ] || [ "$test" = "all" ]; then writeToLogs "### ACA RIM TEST 3: Test a RIM from an OEM and a Supplemental RIM from a VAR with a bad reference measurement ###" clearAcaDb + resetTpmForNewTest uploadTrustedCerts setPolicyEkPcFw setPlatformCerts "laptop" "badVarInstall" diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/service/SupplyChainValidationService.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/service/SupplyChainValidationService.java index 41cb7ded..ff5b1611 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/service/SupplyChainValidationService.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/service/SupplyChainValidationService.java @@ -356,7 +356,7 @@ public class SupplyChainValidationService { } BaseReferenceManifest bRim = null; - if (sRim.getAssociatedRim() != null) { + if (sRim != null && sRim.getAssociatedRim() != null) { Optional oRim = referenceManifestRepository.findById(sRim.getAssociatedRim()); if (oRim.isPresent()) { ReferenceManifest rim = oRim.get();