FirmwareScvValidator rename eventLog -> expectedEventLog, eventLog -> actualEventLog, eventValue -> rimIntegrityMeasurements, eventValueMap -> expectedEventLogRecords

This commit is contained in:
chubtub 2024-11-13 18:22:47 -05:00
parent 3e8e55a00c
commit b7c15ee6ea

View File

@ -206,10 +206,10 @@ public class FirmwareScvValidator extends SupplyChainCredentialValidator {
} }
if (passed) { if (passed) {
TCGEventLog logProcessor; TCGEventLog expectedEventLog;
try { try {
logProcessor = new TCGEventLog(supportReferenceManifest.getRimBytes()); expectedEventLog = new TCGEventLog(supportReferenceManifest.getRimBytes());
baseline = logProcessor.getExpectedPCRValues(); baseline = expectedEventLog.getExpectedPCRValues();
} catch (CertificateException cEx) { } catch (CertificateException cEx) {
log.error(cEx); log.error(cEx);
} catch (NoSuchAlgorithmException noSaEx) { } catch (NoSuchAlgorithmException noSaEx) {
@ -242,21 +242,21 @@ public class FirmwareScvValidator extends SupplyChainCredentialValidator {
// part 2 of firmware validation check: bios measurements // part 2 of firmware validation check: bios measurements
// vs baseline tcg event log // vs baseline tcg event log
// find the measurement // find the measurement
TCGEventLog eventLog; TCGEventLog actualEventLog;
LinkedList<TpmPcrEvent> failedPcrValues = new LinkedList<>(); LinkedList<TpmPcrEvent> failedPcrValues = new LinkedList<>();
List<ReferenceDigestValue> eventValue; List<ReferenceDigestValue> rimIntegrityMeasurements;
HashMap<String, ReferenceDigestValue> eventValueMap = new HashMap<>(); HashMap<String, ReferenceDigestValue> expectedEventLogRecords = new HashMap<>();
try { try {
if (measurement.getDeviceName().equals(hostName)) { if (measurement.getDeviceName().equals(hostName)) {
eventLog = new TCGEventLog(measurement.getRimBytes()); actualEventLog = new TCGEventLog(measurement.getRimBytes());
eventValue = referenceDigestValueRepository rimIntegrityMeasurements = referenceDigestValueRepository
.findValuesByBaseRimId(baseReferenceManifest.getId()); .findValuesByBaseRimId(baseReferenceManifest.getId());
for (ReferenceDigestValue rdv : eventValue) { for (ReferenceDigestValue rdv : rimIntegrityMeasurements) {
eventValueMap.put(rdv.getDigestValue(), rdv); expectedEventLogRecords.put(rdv.getDigestValue(), rdv);
} }
failedPcrValues.addAll(pcrValidator.validateTpmEvents( failedPcrValues.addAll(pcrValidator.validateTpmEvents(
eventLog, eventValueMap, policySettings)); actualEventLog, expectedEventLogRecords, policySettings));
} }
} catch (CertificateException cEx) { } catch (CertificateException cEx) {
log.error(cEx); log.error(cEx);