mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-04-12 21:53:08 +00:00
v3_issue_896: part ii of should fix issues with pc found on certain devices
Some checks failed
Dotnet Provisioner Unit Tests / Restore and Run Unit Tests (ubuntu-20.04) (push) Has been cancelled
Dotnet Provisioner Unit Tests / Restore and Run Unit Tests (windows-2022) (push) Has been cancelled
HIRS Build and Unit Test / ACA_Provisioner_Unit_Tests (push) Has been cancelled
HIRS System Tests / DockerTests (push) Has been cancelled
Dotnet Provisioner Unit Tests / Evaluate Tests (push) Has been cancelled
Some checks failed
Dotnet Provisioner Unit Tests / Restore and Run Unit Tests (ubuntu-20.04) (push) Has been cancelled
Dotnet Provisioner Unit Tests / Restore and Run Unit Tests (windows-2022) (push) Has been cancelled
HIRS Build and Unit Test / ACA_Provisioner_Unit_Tests (push) Has been cancelled
HIRS System Tests / DockerTests (push) Has been cancelled
Dotnet Provisioner Unit Tests / Evaluate Tests (push) Has been cancelled
This commit is contained in:
parent
fdacd4df6e
commit
2ed262774f
@ -113,7 +113,8 @@ public final class CredentialManagementHelper {
|
||||
PlatformCredential.parseWithPossibleHeader(platformBytes);
|
||||
|
||||
if (platformCredential == null) {
|
||||
log.error("The platform credential that was parsed was null");
|
||||
log.error("The platform credential that was parsed with the provided"
|
||||
+ "byte array was null");
|
||||
return null;
|
||||
}
|
||||
|
||||
@ -155,6 +156,10 @@ public final class CredentialManagementHelper {
|
||||
} catch (Exception e) {
|
||||
log.error("Error parsing platform credential", e);
|
||||
}
|
||||
|
||||
log.error("Due to an exception being thrown while "
|
||||
+ " attempting to store platform certificate(s) "
|
||||
+ "this method will return a null platform certificate.");
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
@ -989,16 +989,17 @@ public class CertificateAttributeScvValidator extends SupplyChainCredentialValid
|
||||
final List<ComponentInfo> componentInfos,
|
||||
final List<ComponentResult> compiledComponentList) {
|
||||
Map<Integer, List<ComponentInfo>> deviceHashMap = new HashMap<>();
|
||||
|
||||
componentInfos.forEach((componentInfo) -> {
|
||||
List<ComponentInfo> innerList;
|
||||
List<ComponentInfo> innerList = new ArrayList<>();
|
||||
Integer compInfoHash = componentInfo.hashCommonElements();
|
||||
|
||||
if (deviceHashMap.containsKey(compInfoHash)) {
|
||||
innerList = deviceHashMap.get(compInfoHash);
|
||||
innerList.add(componentInfo);
|
||||
} else {
|
||||
innerList = new ArrayList<>(0);
|
||||
innerList.add(componentInfo);
|
||||
}
|
||||
|
||||
innerList.add(componentInfo);
|
||||
|
||||
deviceHashMap.put(compInfoHash, innerList);
|
||||
});
|
||||
|
||||
@ -1028,23 +1029,37 @@ public class CertificateAttributeScvValidator extends SupplyChainCredentialValid
|
||||
// continue down the options, move to a different method.
|
||||
// create component class mapping to component info
|
||||
Map<String, List<ComponentInfo>> componentDeviceMap = new HashMap<>();
|
||||
|
||||
componentInfos.forEach((componentInfo) -> {
|
||||
List<ComponentInfo> innerList;
|
||||
List<ComponentInfo> innerList = new ArrayList<>();
|
||||
String componentClass = componentInfo.getComponentClassValue();
|
||||
|
||||
if (componentDeviceMap.containsKey(componentClass)) {
|
||||
innerList = componentDeviceMap.get(componentClass);
|
||||
innerList.add(componentInfo);
|
||||
} else {
|
||||
innerList = new ArrayList<>(0);
|
||||
innerList.add(componentInfo);
|
||||
}
|
||||
|
||||
innerList.add(componentInfo);
|
||||
|
||||
componentDeviceMap.put(componentClass, innerList);
|
||||
});
|
||||
|
||||
List<ComponentInfo> componentClassInfo;
|
||||
List<ComponentAttributeResult> attributeResults = new ArrayList<>();
|
||||
|
||||
for (ComponentResult componentResult : remainingComponentResults) {
|
||||
|
||||
componentClassInfo = componentDeviceMap.get(componentResult.getComponentClassValue());
|
||||
|
||||
if (componentClassInfo == null) {
|
||||
log.error("The retrieved list of component class info is null. The null list"
|
||||
+ "is associated with the component result's component class value of {}",
|
||||
componentResult.getComponentClassValue());
|
||||
|
||||
//move on to the next iteration since there is nothing we can do with the null
|
||||
// component class info
|
||||
continue;
|
||||
}
|
||||
|
||||
if (componentClassInfo.size() == 1) {
|
||||
attributeResults.addAll(generateComponentAttributeResults(
|
||||
componentClassInfo.get(0), componentResult));
|
||||
|
Loading…
x
Reference in New Issue
Block a user