mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-20 21:43:18 +00:00
This commit is contained in:
parent
634d09ff5d
commit
a6f5a48307
@ -491,22 +491,32 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
// 2. a list of components listed in the device info for the same manufacturer
|
||||
// Then eliminate matches from both lists. Finally, decide if the validation passes based
|
||||
// on the leftovers in the lists and the policy in place.
|
||||
|
||||
final List<ComponentIdentifier> pcComponents = new ArrayList<>();
|
||||
untrimmedPcComponents.forEach(component -> pcComponents.add(
|
||||
for (ComponentIdentifier component : untrimmedPcComponents) {
|
||||
DERUTF8String componentSerial = null;
|
||||
DERUTF8String componentRevision = null;
|
||||
if (component.getComponentSerial() != null) {
|
||||
componentSerial = new DERUTF8String(
|
||||
component.getComponentSerial().getString().trim());
|
||||
}
|
||||
if (component.getComponentRevision() != null) {
|
||||
componentRevision = new DERUTF8String(
|
||||
component.getComponentRevision().getString().trim());
|
||||
}
|
||||
pcComponents.add(
|
||||
new ComponentIdentifier(
|
||||
new DERUTF8String(component.getComponentManufacturer().getString().trim()),
|
||||
new DERUTF8String(component.getComponentModel().getString().trim()),
|
||||
new DERUTF8String(component.getComponentSerial().getString().trim()),
|
||||
new DERUTF8String(component.getComponentRevision().getString().trim()),
|
||||
componentSerial,
|
||||
componentRevision,
|
||||
component.getComponentManufacturerId(),
|
||||
component.getFieldReplaceable(),
|
||||
component.getComponentAddress()
|
||||
)));
|
||||
));
|
||||
}
|
||||
|
||||
LOGGER.info("Validating the following Platform Cert components...");
|
||||
pcComponents.forEach(component -> LOGGER.info(component.toString()));
|
||||
|
||||
LOGGER.info("...against the the following DeviceInfoReport components:");
|
||||
allDeviceInfoComponents.forEach(component -> LOGGER.info(component.toString()));
|
||||
|
||||
@ -608,7 +618,6 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pcUnmatchedComponents.addAll(pcComponentsFromManufacturer);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user