mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-01-31 00:24:00 +00:00
Updated a supply chain validation check for delta certificates. Updated the check for duplicate base platform certificates when storing them for the same device and updated the begin validity date for the delta vs the base check.
This commit is contained in:
parent
fcb496686c
commit
beb1ccbee3
@ -122,7 +122,7 @@ public final class CredentialManagementHelper {
|
||||
if (!certificates.isEmpty()) {
|
||||
// found associated certificates
|
||||
for (PlatformCredential pc : certificates) {
|
||||
if (pc.isBase()) {
|
||||
if (pc.isBase() && platformCredential.isBase()) {
|
||||
// found a base in the database associated with
|
||||
// parsed certificate
|
||||
LOG.error(String.format("Base certificate stored"
|
||||
|
@ -184,8 +184,8 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe
|
||||
// the base
|
||||
if (baseCredential != null) {
|
||||
for (PlatformCredential pc : pcs) {
|
||||
int result = pc.getBeginValidity()
|
||||
.compareTo(baseCredential.getBeginValidity());
|
||||
int result = baseCredential.getBeginValidity()
|
||||
.compareTo(pc.getBeginValidity());
|
||||
if (!pc.isBase() && (result > 0)) {
|
||||
pcErrorMessage = String.format("%s%s%n", pcErrorMessage,
|
||||
"Delta Certificate's validity "
|
||||
|
@ -664,7 +664,7 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
"%s attempted MODIFIED with no prior instance.%n",
|
||||
classValue));
|
||||
scv = deltaMapping.get(delta);
|
||||
if (scv.getResult() != AppraisalStatus.Status.PASS) {
|
||||
if (scv != null && scv.getResult() != AppraisalStatus.Status.PASS) {
|
||||
failureMsg.append(scv.getMessage());
|
||||
}
|
||||
deltaMapping.put(delta, new SupplyChainValidation(
|
||||
@ -694,7 +694,7 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
"%s attempted REMOVED with no prior instance.%n",
|
||||
classValue));
|
||||
scv = deltaMapping.get(delta);
|
||||
if (scv.getResult() != AppraisalStatus.Status.PASS) {
|
||||
if (scv != null && scv.getResult() != AppraisalStatus.Status.PASS) {
|
||||
failureMsg.append(scv.getMessage());
|
||||
}
|
||||
deltaMapping.put(delta, new SupplyChainValidation(
|
||||
@ -723,7 +723,7 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
|
||||
"%s was ADDED, the serial already exists.%n",
|
||||
classValue));
|
||||
scv = deltaMapping.get(delta);
|
||||
if (scv.getResult() != AppraisalStatus.Status.PASS) {
|
||||
if (scv != null && scv.getResult() != AppraisalStatus.Status.PASS) {
|
||||
failureMsg.append(scv.getMessage());
|
||||
}
|
||||
deltaMapping.put(delta, new SupplyChainValidation(
|
||||
|
Loading…
x
Reference in New Issue
Block a user