mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-04-07 19:34:27 +00:00
* Updated code by removing a loop that wasn't necessary. It was supposed to filter out the deltas but this wasn't needed as the chain was established. * The debug code was left in, this is now removed.
This commit is contained in:
parent
a8e2c5cc6e
commit
3208241cc3
@ -304,7 +304,6 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
// parse out the provided delta and its specific chain.
|
||||
Collections.reverse(chainCertificates);
|
||||
List<PlatformCredential> leafChain = new LinkedList<>();
|
||||
PlatformCredential dc;
|
||||
List<ComponentIdentifier> origPcComponents = new LinkedList<>();
|
||||
|
||||
for (PlatformCredential pc : chainCertificates) {
|
||||
@ -315,8 +314,7 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
origPcComponents.addAll(pc.getComponentIdentifiers());
|
||||
}
|
||||
} else {
|
||||
dc = pc;
|
||||
leafChain.add(dc);
|
||||
leafChain.add(pc);
|
||||
}
|
||||
}
|
||||
|
||||
@ -326,24 +324,6 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
leafMap.put(delta.getHolderSerialNumber().toString(), delta);
|
||||
});
|
||||
|
||||
leafChain.clear();
|
||||
String serialNumber = basePlatformCredential.getSerialNumber().toString();
|
||||
PlatformCredential tempCred;
|
||||
|
||||
// Start with the base serial number, find the delta pointing to it
|
||||
// and put that first in the list
|
||||
for (int i = 0; i < leafMap.size(); i++) {
|
||||
tempCred = leafMap.get(serialNumber);
|
||||
// this should never be null
|
||||
if (tempCred != null) {
|
||||
leafChain.add(i, tempCred);
|
||||
serialNumber = tempCred.getSerialNumber().toString();
|
||||
} else {
|
||||
return new AppraisalStatus(ERROR, String.format("Delta platform search "
|
||||
+ "for mapping returned null for %s", serialNumber));
|
||||
}
|
||||
}
|
||||
|
||||
return validateDeltaAttributesChainV2p0(deviceInfoReport,
|
||||
leafChain, origPcComponents);
|
||||
}
|
||||
@ -613,7 +593,6 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
if (ci.isVersion2()) {
|
||||
ciSerial = ci.getComponentSerial().toString();
|
||||
ComponentIdentifierV2 ciV2 = (ComponentIdentifierV2) ci;
|
||||
|
||||
if (ciV2.isModified()) {
|
||||
// this won't match
|
||||
// check it is there
|
||||
|
Loading…
x
Reference in New Issue
Block a user