diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/AbstractAttestationCertificateAuthority.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/AbstractAttestationCertificateAuthority.java index acd3d396..09b2f78a 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/AbstractAttestationCertificateAuthority.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/AbstractAttestationCertificateAuthority.java @@ -94,7 +94,6 @@ import java.security.interfaces.RSAPublicKey; import java.security.spec.InvalidKeySpecException; import java.security.spec.MGF1ParameterSpec; import java.security.spec.RSAPublicKeySpec; -import java.util.ArrayList; import java.util.Calendar; import java.util.Date; import java.util.HashSet; @@ -681,7 +680,6 @@ public abstract class AbstractAttestationCertificateAuthority for (String line : lines) { if (!line.isEmpty() && !line.contains(TPM_SIGNATURE_ALG)) { - LOG.error(line); pcrs[counter++] = line.split(":")[1].trim(); } } @@ -784,7 +782,6 @@ public abstract class AbstractAttestationCertificateAuthority Pattern pattern = Pattern.compile("([^\\s]+(\\.(?i)(rimpcr|rimel|bin|log))$)"); Matcher matcher; MessageDigest messageDigest = MessageDigest.getInstance("SHA-256"); - List baseLogFiles = new ArrayList<>(); if (dv.getLogfileCount() > 0) { for (ByteString logFile : dv.getLogfileList()) { @@ -859,7 +856,6 @@ public abstract class AbstractAttestationCertificateAuthority LOG.error(ioEx); } } - baseLogFiles.addAll(dv.getSwidfileList()); } else { LOG.warn("Device did not send swid tag file..."); } diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestDetailsPageController.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestDetailsPageController.java index e257ec7a..df6c5b3c 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestDetailsPageController.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestDetailsPageController.java @@ -32,6 +32,7 @@ import java.io.ByteArrayInputStream; import java.io.IOException; import java.security.NoSuchAlgorithmException; import java.security.cert.CertificateException; +import java.util.ArrayList; import java.util.Arrays; import java.util.HashMap; import java.util.LinkedList; @@ -288,8 +289,6 @@ public class ReferenceManifestDetailsPageController } } - // Let's pull the supply chain validation - data.put("associatedRim", baseRim.getAssociatedRim()); data.put("swidFiles", resources); if (support != null && (!baseRim.isSwidSupplemental() @@ -547,6 +546,21 @@ public class ReferenceManifestDetailsPageController } } + if (support != null) { + Map> baselineLogEvents = new HashMap<>(); + List baselines = null; + for (TpmPcrEvent tpe : livelogEvents) { + baselines = new ArrayList<>(); + for (TpmPcrEvent supports : support.getEventLog()) { + if (supports.getEventType() == tpe.getEventType()) { + baselines.add(supports); + } + } + baselineLogEvents.put(tpe.getEventDigestStr(), baselines); + } + data.put("eventTypeMap", baselineLogEvents); + } + data.put("livelogEvents", livelogEvents); return data; diff --git a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp index a32e72b6..0fba0572 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp +++ b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-details.jsp @@ -260,25 +260,37 @@
Client Log
+ -
-
-
Event#:
-
${lEvent.getEventNumber()+1}
-
-
-
PCR Index:
-
${lEvent.getPcrIndex()}
-
-
-
Digest:
-
${lEvent.getEventDigestStr()}
-
-
-
Content:
-
${lEvent.getEventContentStr()}
+
+
+
Failed
Digest:
+
+ ${lEvent.getEventDigestStr()}
${lEvent.getEventContentStr()} +
+
+
+ Baseline Events of Type:
+ ${lEvent.getEventTypeString()} +
+
+ + + + +
+
PCR Index: ${event.getPcrIndex()}
+
Digest: ${event.getEventDigestStr()}
+
Event Content: ${event.getEventContentStr()}
+
+
+
+
+
+
+
diff --git a/HIRS_AttestationCAPortal/src/main/webapp/common/rim_details.css b/HIRS_AttestationCAPortal/src/main/webapp/common/rim_details.css index 9c49a253..55d68caa 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/common/rim_details.css +++ b/HIRS_AttestationCAPortal/src/main/webapp/common/rim_details.css @@ -81,4 +81,28 @@ .data-value { flex: 5 +} + +.mappedType { + display: flex 1; + padding: 1rem; + width: 20rem; + font-weight: bold +} + +.mappedOverhead { + display: flex; + flex-direction: column; + padding: 1rem; +} + +.mappedData { + font-weight: bold; +} + +.mappedButton { + display: flex 1; + padding: 1rem; + width: 20rem; + font-weight: bold; } \ No newline at end of file diff --git a/HIRS_Utils/src/main/java/hirs/tpm/eventlog/TpmPcrEvent.java b/HIRS_Utils/src/main/java/hirs/tpm/eventlog/TpmPcrEvent.java index ca2d5098..e99f42ba 100644 --- a/HIRS_Utils/src/main/java/hirs/tpm/eventlog/TpmPcrEvent.java +++ b/HIRS_Utils/src/main/java/hirs/tpm/eventlog/TpmPcrEvent.java @@ -1,17 +1,7 @@ package hirs.tpm.eventlog; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.math.BigInteger; -import java.nio.charset.StandardCharsets; -import java.security.MessageDigest; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; -import java.util.Arrays; - -import hirs.tpm.eventlog.events.EvConstants; import hirs.tpm.eventlog.events.EvCompactHash; +import hirs.tpm.eventlog.events.EvConstants; import hirs.tpm.eventlog.events.EvEfiBootServicesApp; import hirs.tpm.eventlog.events.EvEfiGptPartition; import hirs.tpm.eventlog.events.EvEfiHandoffTable; @@ -30,6 +20,16 @@ import org.apache.commons.codec.binary.Hex; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; +import java.io.ByteArrayInputStream; +import java.io.IOException; +import java.io.UnsupportedEncodingException; +import java.math.BigInteger; +import java.nio.charset.StandardCharsets; +import java.security.MessageDigest; +import java.security.NoSuchAlgorithmException; +import java.security.cert.CertificateException; +import java.util.Arrays; + /** * Class to process a TCG_PCR_EVENT. * TCG_PCR_EVENT is used when the Event log uses the SHA1 Format as described in the @@ -211,6 +211,14 @@ public class TpmPcrEvent { return String.format("0x%s %s", Long.toHexString(eventType), eventString((int) eventType)); } + /** + * Returns a formatted string of the type for the event minus the byte code + * @return a string formatted to be human readable + */ + public String getEventTypeString() { + return eventString((int) eventType); + } + /** * Returns the version of the TCG Log Event specification pertaining to the log. * only updated if the event is a TCG_EfiSpecIdEvent.