mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-19 21:17:59 +00:00
Fixed issues that caused the ACA to not complete a provision.
FWvalidator was using an object used by the tool and not the portal. Updated a few repository calls
This commit is contained in:
parent
995d69cc8f
commit
8ae0745ac5
@ -145,7 +145,7 @@ public class ComponentInfo implements Serializable {
|
||||
final String componentModel,
|
||||
final String componentSerial,
|
||||
final String componentRevision) {
|
||||
return !(StringUtils.isEmpty(componentManufacturer)
|
||||
return (StringUtils.isEmpty(componentManufacturer)
|
||||
|| StringUtils.isEmpty(componentModel));
|
||||
}
|
||||
}
|
||||
|
@ -66,8 +66,8 @@ public class FirmwareScvValidator extends SupplyChainCredentialValidator {
|
||||
failedString = "Base Reference Integrity Manifest\n";
|
||||
passed = false;
|
||||
} else {
|
||||
measurement = (EventLogMeasurements) referenceManifestRepository.findByHexDecHash(
|
||||
baseReferenceManifest.getEventLogHash());
|
||||
measurement = (EventLogMeasurements) referenceManifestRepository.findByHexDecHashAndRimType(
|
||||
baseReferenceManifest.getEventLogHash(), ReferenceManifest.MEASUREMENT_RIM);
|
||||
|
||||
if (measurement == null) {
|
||||
measurement = referenceManifestRepository.byMeasurementDeviceName(
|
||||
@ -125,8 +125,8 @@ public class FirmwareScvValidator extends SupplyChainCredentialValidator {
|
||||
}
|
||||
|
||||
for (SwidResource swidRes : resources) {
|
||||
supportReferenceManifest = referenceManifestRepository.findByHexDecHash(
|
||||
swidRes.getHashValue());
|
||||
supportReferenceManifest = referenceManifestRepository.findByHexDecHashAndRimType(
|
||||
swidRes.getHashValue(), ReferenceManifest.SUPPORT_RIM);
|
||||
if (supportReferenceManifest != null) {
|
||||
// Removed the filename check from this if statement
|
||||
referenceManifestValidator.validateSupportRimHash(
|
||||
|
@ -271,7 +271,8 @@ public class ReferenceManifestDetailsPageController extends PageController<Refer
|
||||
// to get the id to make the link
|
||||
RIM_VALIDATOR.setRim(baseRim.getRimBytes());
|
||||
for (SwidResource swidRes : resources) {
|
||||
support = (SupportReferenceManifest) referenceManifestRepository.findByHexDecHash(swidRes.getHashValue());
|
||||
support = (SupportReferenceManifest) referenceManifestRepository.findByHexDecHashAndRimType(
|
||||
swidRes.getHashValue(), ReferenceManifest.SUPPORT_RIM);
|
||||
|
||||
if (support != null && swidRes.getHashValue()
|
||||
.equalsIgnoreCase(support.getHexDecHash())) {
|
||||
|
@ -39,7 +39,13 @@ import javax.xml.transform.dom.DOMResult;
|
||||
import javax.xml.transform.stream.StreamSource;
|
||||
import javax.xml.validation.Schema;
|
||||
import javax.xml.validation.SchemaFactory;
|
||||
import java.io.*;
|
||||
import java.io.BufferedInputStream;
|
||||
import java.io.ByteArrayInputStream;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.io.UnsupportedEncodingException;
|
||||
import java.nio.file.Files;
|
||||
import java.nio.file.Paths;
|
||||
import java.security.*;
|
||||
@ -204,7 +210,9 @@ public class ReferenceManifestValidator {
|
||||
log.error("Cannot validate RIM, signature element not found!");
|
||||
return false;
|
||||
}
|
||||
trustStore = parseCertificatesFromPem(trustStoreFile);
|
||||
if (!trustStoreFile.isEmpty()) {
|
||||
trustStore = parseCertificatesFromPem(trustStoreFile);
|
||||
}
|
||||
NodeList certElement = rim.getElementsByTagName("X509Certificate");
|
||||
if (certElement.getLength() > 0) {
|
||||
X509Certificate embeddedCert = parseCertFromPEMString(
|
||||
|
Loading…
Reference in New Issue
Block a user