Updated a check on the SERIAL_INDEX in certificate string map builder. (#235)

This commit is contained in:
Cyrus 2020-03-06 07:04:13 -05:00 committed by GitHub
parent 6dd9615ee0
commit 5dbbbafafe
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -342,9 +342,15 @@ public final class CertificateStringMapBuilder {
data.put("CPSuri", certificate.getCPSuri());
//component failure
StringBuilder savedFailures = new StringBuilder();
String[] serialSplit;
for (String s : certificate.getComponentFailures().split(",")) {
if (s.contains("Serial")) {
savedFailures.append(s.split("=")[SERIAL_INDEX]);
serialSplit = s.split("=");
if (serialSplit.length > SERIAL_INDEX) {
savedFailures.append(serialSplit[SERIAL_INDEX]);
} else {
savedFailures.append(s);
}
}
}
data.put("failures", savedFailures.toString());