mirror of
https://github.com/nsacyber/HIRS.git
synced 2025-03-16 00:55:25 +00:00
Added some if statements to separate the dev id code from the aik cert displays
This commit is contained in:
parent
154a536e73
commit
c92b28437e
@ -1,5 +1,7 @@
|
||||
package hirs.attestationca.portal.util;
|
||||
|
||||
import hirs.data.persist.Device;
|
||||
import hirs.data.persist.DeviceInfoReport;
|
||||
import hirs.data.persist.certificate.Certificate;
|
||||
import hirs.data.persist.certificate.CertificateAuthorityCredential;
|
||||
import hirs.data.persist.certificate.EndorsementCredential;
|
||||
@ -8,6 +10,7 @@ import hirs.data.persist.certificate.IssuedCertificate;
|
||||
import hirs.data.persist.certificate.PlatformCredential;
|
||||
import hirs.data.persist.certificate.attributes.ComponentIdentifier;
|
||||
import hirs.data.persist.certificate.attributes.PlatformConfiguration;
|
||||
import hirs.data.persist.info.HardwareInfo;
|
||||
import hirs.persist.CertificateManager;
|
||||
import hirs.utils.BouncyCastleUtils;
|
||||
import org.apache.logging.log4j.LogManager;
|
||||
@ -476,6 +479,7 @@ public final class CertificateStringMapBuilder {
|
||||
if (certificate != null) {
|
||||
data.putAll(getGeneralCertificateInfo(certificate, certificateManager));
|
||||
|
||||
data.put("devId", "");
|
||||
// add endorsement credential ID if not null
|
||||
if (certificate.getEndorsementCredential() != null) {
|
||||
EndorsementCredential ek = certificate.getEndorsementCredential();
|
||||
@ -519,6 +523,14 @@ public final class CertificateStringMapBuilder {
|
||||
// remove last comma character
|
||||
buf.deleteCharAt(buf.lastIndexOf(","));
|
||||
data.put("platformID", buf.toString());
|
||||
} else if (certificate.getDevice() != null) {
|
||||
HardwareInfo hardwareInfo = certificate.getDevice()
|
||||
.getDeviceInfo().getHardwareInfo();
|
||||
data.put("manufacturer", hardwareInfo.getManufacturer());
|
||||
data.put("model", hardwareInfo.getProductName());
|
||||
data.put("version", hardwareInfo.getVersion());
|
||||
data.put("platformSerial", hardwareInfo.getSystemSerialNumber());
|
||||
data.put("devId", "devID");
|
||||
}
|
||||
} else {
|
||||
String notFoundMessage = "Unable to find Issued Attestation Certificate "
|
||||
|
@ -1,4 +1,5 @@
|
||||
<%@ page contentType="text/html"%>
|
||||
<%@ page contentType="text/html"%>
|
||||
<%@ page pageEncoding="UTF-8"%><%-- JSP TAGS--%>
|
||||
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
|
||||
<%@taglib prefix="spring" uri="http://www.springframework.org/tags"%>
|
||||
@ -791,6 +792,7 @@
|
||||
<div id="serial">Serial Number: <span>${initialData.platformSerial}</span></div>
|
||||
</div>
|
||||
</div>
|
||||
<c:if test="${empty initialData.devId}">
|
||||
<div class="row">
|
||||
<div class="col-md-1 col-md-offset-1"><span class="colHeader">Policy Reference</span></div>
|
||||
<div id="policyReference" class="col col-md-8 vertical">
|
||||
@ -876,6 +878,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</c:if>
|
||||
</c:when>
|
||||
</c:choose>
|
||||
</div>
|
||||
|
Loading…
x
Reference in New Issue
Block a user