From 2526808e5c1101b49020ff587f8fd39c544aae49 Mon Sep 17 00:00:00 2001 From: Cyrus <24922493+cyrus-dev@users.noreply.github.com> Date: Thu, 25 May 2023 09:07:58 -0400 Subject: [PATCH] Changed the look up for support rim hash from base [no ci] --- .../ReferenceManifestPageController.java | 6 ++++-- .../hirs/data/persist/BaseReferenceManifest.java | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java index 2bf8d357..27124d2a 100644 --- a/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java +++ b/HIRS_AttestationCAPortal/src/main/java/hirs/attestationca/portal/page/controllers/ReferenceManifestPageController.java @@ -251,8 +251,10 @@ public class ReferenceManifestPageController .getRIMs()); allSupports.stream().forEach((support) -> { - if (!support.isUpdated() && payloadHashMap.containsKey(support.getHexDecHash())) { - BaseReferenceManifest dbBaseRim = payloadHashMap.get(support.getHexDecHash()); + BaseReferenceManifest dbBaseRim = BaseReferenceManifest + .select(referenceManifestManager) + .byRimLink(support.getHexDecHash()).getRIM(); + if (dbBaseRim != null) { support.setSwidTagVersion(dbBaseRim.getSwidTagVersion()); support.setPlatformManufacturer(dbBaseRim.getPlatformManufacturer()); support.setPlatformModel(dbBaseRim.getPlatformModel()); 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 a693374c..0ecfec61 100644 --- a/HIRS_Utils/src/main/java/hirs/data/persist/BaseReferenceManifest.java +++ b/HIRS_Utils/src/main/java/hirs/data/persist/BaseReferenceManifest.java @@ -43,6 +43,10 @@ public class BaseReferenceManifest extends ReferenceManifest { * Holds the name of the 'base64Hash' field. */ public static final String BASE_64_HASH_FIELD = "base64Hash"; + /** + * Holds the name of the 'base64Hash' field. + */ + public static final String RIM_LINK_FIELD = "rimLinkHash"; private static JAXBContext jaxbContext; @@ -171,6 +175,16 @@ public class BaseReferenceManifest extends ReferenceManifest { return this; } + /** + * Specify the RIM hash associated with the base RIM. + * @param rimLinkHash the hash of the file associated with the rim + * @return this instance + */ + public Selector byRimLink(final String rimLinkHash) { + setFieldValue(RIM_LINK_FIELD, rimLinkHash); + return this; + } + /** * Specify the RIM hash associated with the base RIM. * @param hexDecHash the hash of the file associated with the rim