initial commit

This commit is contained in:
Cyrus 2020-11-09 12:45:36 -05:00
parent 26fc356db0
commit bdb32d13ad
2 changed files with 9 additions and 9 deletions

View File

@ -31,7 +31,7 @@ public final class CertificateStringMapBuilder {
private static final Logger LOGGER =
LogManager.getLogger(CertificateStringMapBuilder.class);
private static final int SERIAL_INDEX = 1;
private static final int VALUE_INDEX = 1;
private CertificateStringMapBuilder() {
@ -343,13 +343,13 @@ public final class CertificateStringMapBuilder {
//component failure
StringBuilder savedFailures = new StringBuilder();
String[] serialSplit;
for (String s : certificate.getComponentFailures().split(",")) {
if (s.contains("Serial")) {
serialSplit = s.split("=");
if (serialSplit.length > SERIAL_INDEX) {
savedFailures.append(serialSplit[SERIAL_INDEX]);
for (String str : certificate.getComponentFailures().split(",")) {
if (str.contains("Model")) {
serialSplit = str.split("=");
if (serialSplit.length > VALUE_INDEX) {
savedFailures.append(serialSplit[VALUE_INDEX]);
} else {
savedFailures.append(s);
savedFailures.append(str);
}
}
}

View File

@ -852,9 +852,9 @@ public final class SupplyChainCredentialValidator implements CredentialValidator
LOGGER.error(String.format("Platform Credential contained %d unmatched components:",
pcUnmatchedComponents.size()));
int umatchedComponentCounter = 1;
int unmatchedComponentCounter = 1;
for (ComponentIdentifier unmatchedComponent : pcUnmatchedComponents) {
LOGGER.error("Unmatched component " + umatchedComponentCounter++ + ": "
LOGGER.error("Unmatched component " + unmatchedComponentCounter++ + ": "
+ unmatchedComponent);
sb.append(String.format("Manufacturer=%s, Model=%s, Serial=%s, Revision=%s%n",
unmatchedComponent.getComponentManufacturer(),