diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java index a5820b77..29c6233c 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java @@ -720,6 +720,8 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe base.setComponentFailures(result.getAdditionalInfo()); this.certificateManager.update(base); } + // we are adding things to componentFailures + this.certificateManager.update(delta); return buildValidationRecord(validationType, AppraisalStatus.Status.FAIL, result.getMessage(), delta, Level.WARN); case ERROR: diff --git a/HIRS_Utils/src/main/java/hirs/validation/SupplyChainCredentialValidator.java b/HIRS_Utils/src/main/java/hirs/validation/SupplyChainCredentialValidator.java index 2322bf06..9c988056 100644 --- a/HIRS_Utils/src/main/java/hirs/validation/SupplyChainCredentialValidator.java +++ b/HIRS_Utils/src/main/java/hirs/validation/SupplyChainCredentialValidator.java @@ -696,7 +696,7 @@ public final class SupplyChainCredentialValidator implements CredentialValidator } } - if (!fieldValidation) { + if (!fieldValidation || !deltaSb.toString().isEmpty()) { return new AppraisalStatus(FAIL, resultMessage.toString(), deltaSb.toString()); } @@ -1452,6 +1452,8 @@ public final class SupplyChainCredentialValidator implements CredentialValidator failureMsg.append(String.format( "%s attempted MODIFIED with no prior instance.%n", ciSerial)); + delta.setComponentFailures(String.format("%s,%d", + delta.getComponentFailures(), ciV2.hashCode())); scv = deltaMapping.get(delta); if (scv != null && scv.getResult() != AppraisalStatus.Status.PASS) { @@ -1469,6 +1471,8 @@ public final class SupplyChainCredentialValidator implements CredentialValidator failureMsg.append(String.format( "%s attempted REMOVED with no prior instance.%n", ciSerial)); + delta.setComponentFailures(String.format("%s,%d", + delta.getComponentFailures(), ciV2.hashCode())); scv = deltaMapping.get(delta); if (scv != null && scv.getResult() != AppraisalStatus.Status.PASS) { @@ -1489,6 +1493,8 @@ public final class SupplyChainCredentialValidator implements CredentialValidator failureMsg.append(String.format( "%s was ADDED, the serial already exists.%n", ciSerial)); + delta.setComponentFailures(String.format("%s,%d", + delta.getComponentFailures(), ciV2.hashCode())); scv = deltaMapping.get(delta); if (scv != null && scv.getResult() != AppraisalStatus.Status.PASS) {