mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-19 04:58:00 +00:00
When a delta has the component that is bad, not the base, it wasn't highlighting. This is because the component failures wasn't be updated and then the certificate needed to be updated as well.
This commit is contained in:
parent
7912ff2f2e
commit
8a571f1788
@ -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:
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user