mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-24 07:06:46 +00:00
This last commit corrects the database error. The code attempts to save a new supplychainvalidationsummary it needs to be a supplychainvalidation recreation to create new primary keys.
This commit is contained in:
parent
325feffd90
commit
1ed02e72b2
HIRS_AttestationCA/src/main/java/hirs/attestationca
@ -478,6 +478,7 @@ public abstract class AbstractAttestationCertificateAuthority
|
||||
// this will just allow for the certificate to be saved.
|
||||
validationResult = AppraisalStatus.Status.PASS;
|
||||
} else {
|
||||
device.setSummaryId(scvs.getId().toString());
|
||||
// update the validation result in the device
|
||||
validationResult = scvs.getOverallValidationResult();
|
||||
device.setSupplyChainStatus(validationResult);
|
||||
|
@ -342,7 +342,6 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe
|
||||
for (SwidResource swid : swids) {
|
||||
baseline = swid.getPcrValues()
|
||||
.toArray(new String[swid.getPcrValues().size()]);
|
||||
LOGGER.error("is file size valid {}", swid.isValidFileSize());
|
||||
}
|
||||
pcrPolicy.setBaselinePcrs(baseline);
|
||||
|
||||
@ -460,11 +459,24 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe
|
||||
SupplyChainValidationSummary previous
|
||||
= this.supplyChainValidatorSummaryManager.get(
|
||||
UUID.fromString(device.getSummaryId()));
|
||||
validations.addAll(previous.getValidations());
|
||||
for (SupplyChainValidation scv : previous.getValidations()) {
|
||||
if (scv.getValidationType() != SupplyChainValidation.ValidationType.FIRMWARE) {
|
||||
validations.add(buildValidationRecord(scv.getValidationType(),
|
||||
scv.getResult(), scv.getMessage(),
|
||||
scv.getCertificatesUsed().get(0), Level.INFO));
|
||||
}
|
||||
}
|
||||
validations.add(quoteScv);
|
||||
previous.archive();
|
||||
supplyChainValidatorSummaryManager.update(previous);
|
||||
summary = new SupplyChainValidationSummary(device, validations);
|
||||
supplyChainValidatorSummaryManager.save(summary);
|
||||
supplyChainValidatorSummaryManager.delete(previous.getId());
|
||||
|
||||
// try removing the supply chain validation as well and resaving that
|
||||
try {
|
||||
supplyChainValidatorSummaryManager.save(summary);
|
||||
} catch (DBManagerException ex) {
|
||||
LOGGER.error("Failed to save Supply Chain Summary", ex);
|
||||
}
|
||||
}
|
||||
|
||||
return summary;
|
||||
|
Loading…
Reference in New Issue
Block a user