mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-18 20:47:58 +00:00
Merge pull request #822 from nsacyber/v3_issue-807
[#807] Display PCR comparison table for mismatches
This commit is contained in:
commit
f7917625ed
@ -105,7 +105,7 @@ public class SupplyChainValidation extends ArchivableEntity {
|
||||
this.certificatesUsed = new ArrayList<>();
|
||||
this.rimId = "";
|
||||
for (ArchivableEntity ae : certificatesUsed) {
|
||||
if (ae instanceof BaseReferenceManifest rm) {
|
||||
if (ae instanceof ReferenceManifest rm) {
|
||||
this.rimId = rm.getId().toString();
|
||||
break;
|
||||
} else if (ae instanceof Certificate) {
|
||||
|
@ -190,16 +190,22 @@ public class ValidationService {
|
||||
final SupplyChainValidation.ValidationType validationType
|
||||
= SupplyChainValidation.ValidationType.FIRMWARE;
|
||||
|
||||
List<ReferenceManifest> rims = rimRepo.findByDeviceName(device.getName());
|
||||
ReferenceManifest baseRim = null;
|
||||
for (ReferenceManifest rim : rims) {
|
||||
if (rim.getRimType().equals(ReferenceManifest.BASE_RIM)) {
|
||||
baseRim = rim;
|
||||
}
|
||||
}
|
||||
AppraisalStatus result = FirmwareScvValidator.validateFirmware(device, policySettings,
|
||||
rimRepo, rdvRepo, caRepo);
|
||||
Level logLevel;
|
||||
List<ReferenceManifest> rims = rimRepo.findByDeviceName(device.getName());
|
||||
ReferenceManifest referenceManifest = null;
|
||||
String rimType = "";
|
||||
if (result.getAdditionalInfo().equals(ReferenceManifest.MEASUREMENT_RIM)) {
|
||||
rimType = ReferenceManifest.MEASUREMENT_RIM;
|
||||
} else {
|
||||
rimType = ReferenceManifest.BASE_RIM;
|
||||
}
|
||||
for (ReferenceManifest rim : rims) {
|
||||
if (rim.getRimType().equals(rimType)) {
|
||||
referenceManifest = rim;
|
||||
}
|
||||
}
|
||||
|
||||
switch (result.getAppStatus()) {
|
||||
case PASS:
|
||||
@ -213,7 +219,7 @@ public class ValidationService {
|
||||
logLevel = Level.ERROR;
|
||||
}
|
||||
return buildValidationRecord(validationType, result.getAppStatus(),
|
||||
result.getMessage(), baseRim, logLevel);
|
||||
result.getMessage(), referenceManifest, logLevel);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -270,7 +270,8 @@ public class FirmwareScvValidator extends SupplyChainCredentialValidator {
|
||||
fwStatus = new AppraisalStatus(FAIL, String.format("%s%n%s",
|
||||
fwStatus.getMessage(), sb.toString()));
|
||||
} else {
|
||||
fwStatus = new AppraisalStatus(FAIL, sb.toString());
|
||||
fwStatus = new AppraisalStatus(FAIL,
|
||||
sb.toString(), ReferenceManifest.MEASUREMENT_RIM);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user