mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-02-20 01:36:15 +00:00
All components were failing on tests specifically set up to match components and pass. This happened because the int value of the component class value was being translated with SHORT.size. This is odd because it worked before but stopped.
This commit is contained in:
parent
0f8d41e78f
commit
3269e81783
@ -102,11 +102,6 @@ public class ComponentClass {
|
||||
*/
|
||||
public ComponentClass(final Path componentClassPath, final String componentIdentifier) {
|
||||
this(TCG_COMPONENT_REGISTRY, componentClassPath, getComponentIntValue(componentIdentifier));
|
||||
if (componentIdentifier != null && componentIdentifier.contains("#")) {
|
||||
this.classValueString = componentIdentifier.replaceAll("#", "");
|
||||
} else {
|
||||
this.classValueString = componentIdentifier;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@ -152,6 +147,8 @@ public class ComponentClass {
|
||||
getCategory(JsonUtils.getSpecificJsonObject(componentClassPath, registryType));
|
||||
break;
|
||||
}
|
||||
|
||||
this.classValueString = String.valueOf(componentIdentifier);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -276,12 +273,11 @@ public class ComponentClass {
|
||||
componentValue = Integer.decode(component);
|
||||
} else {
|
||||
if (component.contains("#")) {
|
||||
componentValue = Integer.valueOf(
|
||||
component.replace("#", ""),
|
||||
Short.SIZE);
|
||||
componentValue = Integer.parseInt(
|
||||
component.replace("#", ""));
|
||||
} else {
|
||||
componentValue = Integer.valueOf(
|
||||
component, Short.SIZE);
|
||||
componentValue = Integer.parseInt(
|
||||
component);
|
||||
}
|
||||
}
|
||||
} catch (NumberFormatException nfEx) {
|
||||
|
@ -750,8 +750,8 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
for (ComponentInfo cInfo : allDeviceInfoComponents) {
|
||||
for (ComponentIdentifier cId : fullDeltaChainComponents) {
|
||||
ciV2 = (ComponentIdentifierV2) cId;
|
||||
if (ciV2.getComponentClass().getClassValueString()
|
||||
.contains(cInfo.getComponentClass())
|
||||
if (cInfo.getComponentClass().contains(
|
||||
ciV2.getComponentClass().getClassValueString())
|
||||
&& isMatch(cId, cInfo)) {
|
||||
subCompIdList.remove(cId);
|
||||
subCompInfoList.remove(cInfo);
|
||||
|
Loading…
x
Reference in New Issue
Block a user