diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java index 51a054fa..d56cdea2 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/service/SupplyChainValidationServiceImpl.java @@ -393,10 +393,11 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe ReferenceDigestRecord digestRecord = null; baseReferenceManifests = BaseReferenceManifest.select(referenceManifestManager) - .byDeviceName(device.getDeviceInfo().getNetworkInfo().getHostname()).getRIMs(); + .byModel(model).getRIMs(); for (BaseReferenceManifest bRim : baseReferenceManifests) { - if (!bRim.isSwidSupplemental() && !bRim.isSwidPatch()) { + if (bRim.getPlatformManufacturer().equals(manufacturer) + && !bRim.isSwidSupplemental() && !bRim.isSwidPatch()) { baseReferenceManifest = bRim; } } @@ -408,6 +409,11 @@ public class SupplyChainValidationServiceImpl implements SupplyChainValidationSe } else { measurement = EventLogMeasurements.select(referenceManifestManager) .byHexDecHash(baseReferenceManifest.getEventLogHash()).getRIM(); + + if (measurement == null) { + measurement = EventLogMeasurements.select(referenceManifestManager) + .byModel(baseReferenceManifest.getPlatformModel()).getRIM(); + } } if (measurement == null) { diff --git a/HIRS_Utils/src/main/java/hirs/data/persist/BaseReferenceManifest.java b/HIRS_Utils/src/main/java/hirs/data/persist/BaseReferenceManifest.java index 1ca317b3..aea0d04d 100644 --- a/HIRS_Utils/src/main/java/hirs/data/persist/BaseReferenceManifest.java +++ b/HIRS_Utils/src/main/java/hirs/data/persist/BaseReferenceManifest.java @@ -110,6 +110,17 @@ public class BaseReferenceManifest extends ReferenceManifest { return this; } + /** + * Specify the platform model that rims must have to be considered + * as matching. + * @param model string for the model + * @return this instance + */ + public Selector byModel(final String model) { + setFieldValue(PLATFORM_MODEL, model); + return this; + } + /** * Specify the device name that rims must have to be considered * as matching. diff --git a/HIRS_Utils/src/main/java/hirs/data/persist/EventLogMeasurements.java b/HIRS_Utils/src/main/java/hirs/data/persist/EventLogMeasurements.java index 9a3920b8..66b053cf 100644 --- a/HIRS_Utils/src/main/java/hirs/data/persist/EventLogMeasurements.java +++ b/HIRS_Utils/src/main/java/hirs/data/persist/EventLogMeasurements.java @@ -61,6 +61,17 @@ public class EventLogMeasurements extends ReferenceManifest { return this; } + /** + * Specify the platform model that rims must have to be considered + * as matching. + * @param model string for the model + * @return this instance + */ + public Selector byModel(final String model) { + setFieldValue(PLATFORM_MODEL, model); + return this; + } + /** * Specify the device name that rims must have to be considered * as matching.