From b7c15ee6ea1e0e768d5c0c564f04e652003d20c7 Mon Sep 17 00:00:00 2001 From: chubtub <43381989+chubtub@users.noreply.github.com> Date: Wed, 13 Nov 2024 18:22:47 -0500 Subject: [PATCH] FirmwareScvValidator rename eventLog -> expectedEventLog, eventLog -> actualEventLog, eventValue -> rimIntegrityMeasurements, eventValueMap -> expectedEventLogRecords --- .../validation/FirmwareScvValidator.java | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/validation/FirmwareScvValidator.java b/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/validation/FirmwareScvValidator.java index 1957eea4..9edc08ce 100644 --- a/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/validation/FirmwareScvValidator.java +++ b/HIRS_AttestationCA/src/main/java/hirs/attestationca/persist/validation/FirmwareScvValidator.java @@ -206,10 +206,10 @@ public class FirmwareScvValidator extends SupplyChainCredentialValidator { } if (passed) { - TCGEventLog logProcessor; + TCGEventLog expectedEventLog; try { - logProcessor = new TCGEventLog(supportReferenceManifest.getRimBytes()); - baseline = logProcessor.getExpectedPCRValues(); + expectedEventLog = new TCGEventLog(supportReferenceManifest.getRimBytes()); + baseline = expectedEventLog.getExpectedPCRValues(); } catch (CertificateException cEx) { log.error(cEx); } catch (NoSuchAlgorithmException noSaEx) { @@ -242,21 +242,21 @@ public class FirmwareScvValidator extends SupplyChainCredentialValidator { // part 2 of firmware validation check: bios measurements // vs baseline tcg event log // find the measurement - TCGEventLog eventLog; + TCGEventLog actualEventLog; LinkedList failedPcrValues = new LinkedList<>(); - List eventValue; - HashMap eventValueMap = new HashMap<>(); + List rimIntegrityMeasurements; + HashMap expectedEventLogRecords = new HashMap<>(); try { if (measurement.getDeviceName().equals(hostName)) { - eventLog = new TCGEventLog(measurement.getRimBytes()); - eventValue = referenceDigestValueRepository + actualEventLog = new TCGEventLog(measurement.getRimBytes()); + rimIntegrityMeasurements = referenceDigestValueRepository .findValuesByBaseRimId(baseReferenceManifest.getId()); - for (ReferenceDigestValue rdv : eventValue) { - eventValueMap.put(rdv.getDigestValue(), rdv); + for (ReferenceDigestValue rdv : rimIntegrityMeasurements) { + expectedEventLogRecords.put(rdv.getDigestValue(), rdv); } failedPcrValues.addAll(pcrValidator.validateTpmEvents( - eventLog, eventValueMap, policySettings)); + actualEventLog, expectedEventLogRecords, policySettings)); } } catch (CertificateException cEx) { log.error(cEx);