mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-18 18:56:29 +00:00
These are some minor updates while investigating a bug.
This commit is contained in:
parent
6a13d8dbb1
commit
350cf2b802
@ -225,7 +225,13 @@ public class IdentityClaimProcessor extends AbstractProcessor {
|
||||
platformCredential.getSerialNumber().toString(),
|
||||
platformCredential.getPlatformSerial());
|
||||
if (componentResults.isEmpty()) {
|
||||
handlePlatformComponents(platformCredential);
|
||||
savePlatformComponents(platformCredential);
|
||||
} else {
|
||||
componentResults.stream().forEach((componentResult) -> {
|
||||
componentResult.restore();
|
||||
componentResult.resetCreateTime();
|
||||
componentResultRepository.save(componentResult);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@ -628,7 +634,7 @@ public class IdentityClaimProcessor extends AbstractProcessor {
|
||||
return true;
|
||||
}
|
||||
|
||||
private int handlePlatformComponents(final Certificate certificate) {
|
||||
private void savePlatformComponents(final Certificate certificate) {
|
||||
PlatformCredential platformCredential;
|
||||
int componentResults = 0;
|
||||
if (certificate instanceof PlatformCredential) {
|
||||
@ -647,7 +653,6 @@ public class IdentityClaimProcessor extends AbstractProcessor {
|
||||
componentResults++;
|
||||
}
|
||||
}
|
||||
return componentResults;
|
||||
}
|
||||
|
||||
private int handleDeviceComponents(final String hostName, final String paccorString) {
|
||||
|
@ -264,10 +264,14 @@ public class CertificateAttributeScvValidator extends SupplyChainCredentialValid
|
||||
// first create hash map based on hashCode
|
||||
List<ComponentResult> remainingComponentResults = checkDeviceHashMap(
|
||||
componentInfos, componentResults);
|
||||
//this is used to get a unique count
|
||||
List<UUID> componentIdList = new ArrayList<>();
|
||||
int numOfAttributes = 0;
|
||||
if (!remainingComponentResults.isEmpty()) {
|
||||
List<ComponentAttributeResult> attributeResults = checkComponentClassMap(
|
||||
componentInfos, remainingComponentResults);
|
||||
|
||||
numOfAttributes = attributeResults.size();
|
||||
boolean saveAttributeResult;
|
||||
for (ComponentAttributeResult componentAttributeResult : attributeResults) {
|
||||
saveAttributeResult = true;
|
||||
@ -279,17 +283,18 @@ public class CertificateAttributeScvValidator extends SupplyChainCredentialValid
|
||||
componentAttributeResult.setProvisionSessionId(provisionSessionId);
|
||||
componentAttributeRepository.save(componentAttributeResult);
|
||||
fieldValidation &= componentAttributeResult.checkMatchedStatus();
|
||||
componentIdList.add(componentAttributeResult.getComponentId());
|
||||
} else {
|
||||
numOfAttributes--;
|
||||
}
|
||||
}
|
||||
numOfAttributes = attributeResults.size();
|
||||
}
|
||||
|
||||
StringBuilder additionalInfo = new StringBuilder();
|
||||
if (!remainingComponentResults.isEmpty()) {
|
||||
resultMessage.append(String.format("There are %d components not matched%n",
|
||||
remainingComponentResults.size()));
|
||||
resultMessage.append(String.format("\twith %d total attributes mismatched.",
|
||||
numOfAttributes));
|
||||
if (numOfAttributes > 0) {
|
||||
resultMessage.append(String.format("There are %d component(s) not matched%n "
|
||||
+ "with %d total attributes mismatched.",
|
||||
componentIdList.stream().distinct().count(), numOfAttributes));
|
||||
}
|
||||
|
||||
passesValidation &= fieldValidation;
|
||||
|
@ -973,9 +973,9 @@ public class CertificatePageController extends PageController<NoPageParams> {
|
||||
log.error(failMessage);
|
||||
}
|
||||
|
||||
private int handlePlatformComponents(final Certificate certificate) {
|
||||
private void handlePlatformComponents(final Certificate certificate) {
|
||||
PlatformCredential platformCredential;
|
||||
int componentResults = 0;
|
||||
|
||||
if (certificate instanceof PlatformCredential) {
|
||||
platformCredential = (PlatformCredential) certificate;
|
||||
ComponentResult componentResult;
|
||||
@ -987,10 +987,8 @@ public class CertificatePageController extends PageController<NoPageParams> {
|
||||
platformCredential.getPlatformChainType(),
|
||||
componentIdentifier);
|
||||
componentResultRepository.save(componentResult);
|
||||
componentResults++;
|
||||
}
|
||||
}
|
||||
return componentResults;
|
||||
}
|
||||
|
||||
private void deleteComponentResults(final String platformSerial) {
|
||||
|
@ -653,16 +653,12 @@
|
||||
<span class="fieldValue">${address.getAddressValueString()}</span><br/>
|
||||
</c:forEach>
|
||||
<c:choose>
|
||||
<c:when test="${component.isDelta()}">
|
||||
<c:choose>
|
||||
<c:when test="${component.isFieldReplaceable()=='TRUE'}">
|
||||
<span class="label label-success">Replaceable</span><br/>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<span class="label label-danger">Irreplaceable</span><br/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
</c:when>
|
||||
<c:when test="${component.isFieldReplaceable()=='TRUE'}">
|
||||
<span class="label label-success">Replaceable</span><br/>
|
||||
</c:when>
|
||||
<c:otherwise>
|
||||
<span class="label label-danger">Irreplaceable</span><br/>
|
||||
</c:otherwise>
|
||||
</c:choose>
|
||||
<c:if test="${component.isVersion2()}">
|
||||
<c:if test="${not empty component.getIssuerDN()}">
|
||||
|
Loading…
Reference in New Issue
Block a user