From 1d57ab0d0917c765a17f7a6dbc101e8fe83fd12d Mon Sep 17 00:00:00 2001 From: chubtub <43381989+chubtub@users.noreply.github.com> Date: Wed, 16 Feb 2022 11:17:25 -0500 Subject: [PATCH] Revert "Decode the event content for display on the frontend." This reverts commit 2671a572bacc8de4a23fbc108832583453a2d9d8. --- .../RimDatabasePageController.java | 23 ------------------ .../main/webapp/WEB-INF/jsp/rim-database.jsp | 24 ++++--------------- .../data/persist/ReferenceDigestValue.java | 20 ---------------- 3 files changed, 5 insertions(+), 62 deletions(-) diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/RimDatabasePageController.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/RimDatabasePageController.java index 13220698..0036e96d 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/RimDatabasePageController.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/RimDatabasePageController.java @@ -19,8 +19,6 @@ import hirs.persist.DBReferenceManifestManager; import hirs.persist.ReferenceDigestManager; import hirs.persist.ReferenceEventManager; import hirs.persist.ReferenceManifestManager; -import hirs.tpm.eventlog.TCGEventLog; -import hirs.tpm.eventlog.TpmPcrEvent; import org.apache.logging.log4j.LogManager; import org.apache.logging.log4j.Logger; import org.hibernate.Criteria; @@ -34,13 +32,9 @@ import org.springframework.web.bind.annotation.RequestMethod; import org.springframework.web.bind.annotation.ResponseBody; import org.springframework.web.servlet.ModelAndView; -import java.io.IOException; -import java.security.NoSuchAlgorithmException; -import java.security.cert.CertificateException; import java.text.DateFormat; import java.text.ParseException; import java.text.SimpleDateFormat; -import java.util.Arrays; /** * Controller for the TPM Events page. @@ -183,23 +177,6 @@ public class RimDatabasePageController LOGGER.error("Failed to update TPM Event with Base RIM ID"); LOGGER.error(rdv); } - - //Find the matching TpmPcrEvent and decode the event content - try { - TCGEventLog logProcessor = new TCGEventLog(support.getRimBytes()); - for (TpmPcrEvent tpe : logProcessor.getEventList()) { - if (Arrays.equals(rdv.getContentBlob(), tpe.getEventContent())) { - rdv.setContentString(tpe.getEventContentStr()); - break; - } - } - } catch (NoSuchAlgorithmException e) { - LOGGER.info("Unknown algorithm encountered."); - } catch (CertificateException e) { - LOGGER.info("Log certificate could not be parsed."); - } catch (IOException e) { - LOGGER.info("Event could not be parsed."); - } } } } diff --git a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-database.jsp b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-database.jsp index 3a4d1827..4df6377e 100644 --- a/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-database.jsp +++ b/HIRS_AttestationCAPortal/src/main/webapp/WEB-INF/jsp/rim-database.jsp @@ -15,8 +15,6 @@ RIM Database - -
@@ -27,9 +25,7 @@ - -
Event Type PCR Index Digest ValueDetails Base RIMSupport RIM
@@ -41,35 +37,25 @@ var columns = [ {data: 'manufacturer', orderable: true, - searchable: false}, + searchable:false}, {data: 'model', orderable: false, - searchable: false}, + searchable:false}, {data: 'eventType', orderable: false, - searchable: false,}, + searchable:false,}, {data: 'pcrIndex', orderable: true, - searchable: false}, + searchable:false}, {data: 'digestValue', orderable: false, - searchable: false}, - {data: 'contentString', - orderable: false, - searchable: false}, + searchable:false}, {data: 'baseRimId', orderable: false, searchable: false, render: function(data, type, full, meta) { return rimDetailsLink(full.baseRimId); } - }, - {data: 'supportRimId', - orderable: false, - searchable: false, - render: function(data, type, full, meta) { - return rimDetailsLink(full.supportRimId); - } } ]; diff --git a/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceDigestValue.java b/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceDigestValue.java index 98a9b772..7b25b38a 100644 --- a/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceDigestValue.java +++ b/HIRS_Utils/src/main/java/hirs/data/persist/ReferenceDigestValue.java @@ -8,7 +8,6 @@ import javax.persistence.AccessType; import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.Table; -import javax.persistence.Transient; import javax.xml.bind.annotation.XmlAccessType; import javax.xml.bind.annotation.XmlAccessorType; import javax.xml.bind.annotation.XmlRootElement; @@ -48,8 +47,6 @@ public class ReferenceDigestValue extends ArchivableEntity { private boolean matchFail; @Column(nullable = false) private boolean patched = false; - @Transient - private String contentString; //used for displaying content blob on frontend /** * Default constructor necessary for Hibernate. @@ -96,7 +93,6 @@ public class ReferenceDigestValue extends ArchivableEntity { this.matchFail = matchFail; this.patched = patched; this.contentBlob = Arrays.clone(contentBlob); - this.contentString = ""; } /** @@ -261,22 +257,6 @@ public class ReferenceDigestValue extends ArchivableEntity { } } - /** - * Getter for the String representation of the contentBlob property. - * @return the content string - */ - public String getContentString() { - return contentString; - } - - /** - * Setter for the String representation of the contentBlob property. - * @param contentString the string value - */ - public void setContentString(final String contentString) { - this.contentString = contentString; - } - @Override public boolean equals(final Object obj) { if (this == obj) {