Additional changes

This commit is contained in:
iadgovuser29 2024-06-13 10:46:06 -04:00
parent 14d26e0c1b
commit 9664056e94
4 changed files with 10 additions and 9 deletions

View File

@ -17,6 +17,7 @@ import java.util.UUID;
public interface ReferenceManifestRepository extends JpaRepository<ReferenceManifest, UUID> { public interface ReferenceManifestRepository extends JpaRepository<ReferenceManifest, UUID> {
ReferenceManifest findByHexDecHash(String hexDecHash); ReferenceManifest findByHexDecHash(String hexDecHash);
ReferenceManifest findByEventLogHash(String eventLogHash);
ReferenceManifest findByBase64Hash(String base64Hash); ReferenceManifest findByBase64Hash(String base64Hash);
ReferenceManifest findByHexDecHashAndRimType(String hexDecHash, String rimType); ReferenceManifest findByHexDecHashAndRimType(String hexDecHash, String rimType);
@Query(value = "SELECT * FROM ReferenceManifest WHERE platformManufacturer = ?1 AND platformModel = ?2 AND rimType = 'Base'", nativeQuery = true) @Query(value = "SELECT * FROM ReferenceManifest WHERE platformManufacturer = ?1 AND platformModel = ?2 AND rimType = 'Base'", nativeQuery = true)

View File

@ -9,6 +9,5 @@ import java.util.UUID;
@Repository @Repository
public interface SupplyChainValidationSummaryRepository extends JpaRepository<SupplyChainValidationSummary, UUID> { public interface SupplyChainValidationSummaryRepository extends JpaRepository<SupplyChainValidationSummary, UUID> {
SupplyChainValidationSummary findByDevice(String device);
SupplyChainValidationSummary findByDevice(Device device); SupplyChainValidationSummary findByDevice(Device device);
} }

View File

@ -114,8 +114,8 @@ public class Device extends AbstractEntity {
public String toString() { public String toString() {
return String.format("Device Name: %s%nStatus: %s%nSummary: %s%n", return String.format("Device Name: %s%nStatus: %s%nSummary: %s%n",
name, healthStatus.getStatus(), name, (healthStatus == null ? "N/A" : healthStatus.getStatus()),
supplyChainValidationStatus.toString()); (supplyChainValidationStatus == null ? "N/A" : supplyChainValidationStatus.toString()));
} }
@Override @Override

View File

@ -11,10 +11,7 @@ import hirs.attestationca.persist.entity.manager.ReferenceDigestValueRepository;
import hirs.attestationca.persist.entity.manager.ReferenceManifestRepository; import hirs.attestationca.persist.entity.manager.ReferenceManifestRepository;
import hirs.attestationca.persist.entity.manager.SupplyChainValidationRepository; import hirs.attestationca.persist.entity.manager.SupplyChainValidationRepository;
import hirs.attestationca.persist.entity.manager.SupplyChainValidationSummaryRepository; import hirs.attestationca.persist.entity.manager.SupplyChainValidationSummaryRepository;
import hirs.attestationca.persist.entity.userdefined.Device; import hirs.attestationca.persist.entity.userdefined.*;
import hirs.attestationca.persist.entity.userdefined.PolicySettings;
import hirs.attestationca.persist.entity.userdefined.SupplyChainValidation;
import hirs.attestationca.persist.entity.userdefined.SupplyChainValidationSummary;
import hirs.attestationca.persist.entity.userdefined.certificate.ComponentResult; import hirs.attestationca.persist.entity.userdefined.certificate.ComponentResult;
import hirs.attestationca.persist.entity.userdefined.certificate.EndorsementCredential; import hirs.attestationca.persist.entity.userdefined.certificate.EndorsementCredential;
import hirs.attestationca.persist.entity.userdefined.certificate.PlatformCredential; import hirs.attestationca.persist.entity.userdefined.certificate.PlatformCredential;
@ -29,6 +26,7 @@ import lombok.extern.log4j.Log4j2;
import org.apache.logging.log4j.Level; import org.apache.logging.log4j.Level;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.yaml.snakeyaml.events.Event;
import java.security.KeyStore; import java.security.KeyStore;
import java.util.ArrayList; import java.util.ArrayList;
@ -322,8 +320,11 @@ public class SupplyChainValidationService {
+ "could be found for %s", + "could be found for %s",
deviceName)); deviceName));
} else { } else {
eventLog = (EventLogMeasurements) referenceManifestRepository ReferenceManifest manifest = referenceManifestRepository
.findByHexDecHash(sRim.getEventLogHash()); .findByEventLogHash(sRim.getEventLogHash());
if (manifest instanceof EventLogMeasurements) {
eventLog = (EventLogMeasurements)manifest;
}
} }
if (eventLog == null) { if (eventLog == null) {
fwStatus = new AppraisalStatus(FAIL, fwStatus = new AppraisalStatus(FAIL,