Skip to content

Commit

Permalink
FirmwareScvValidator rename eventLog -> expectedEventLog, eventLog ->…
Browse files Browse the repository at this point in the history
… actualEventLog, eventValue -> rimIntegrityMeasurements, eventValueMap -> expectedEventLogRecords
  • Loading branch information
chubtub committed Nov 13, 2024
1 parent 3e8e55a commit b7c15ee
Showing 1 changed file with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ public static AppraisalStatus validateFirmware(
}

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) {
Expand Down Expand Up @@ -242,21 +242,21 @@ public static AppraisalStatus validateFirmware(
// part 2 of firmware validation check: bios measurements
// vs baseline tcg event log
// find the measurement
TCGEventLog eventLog;
TCGEventLog actualEventLog;
LinkedList<TpmPcrEvent> failedPcrValues = new LinkedList<>();
List<ReferenceDigestValue> eventValue;
HashMap<String, ReferenceDigestValue> eventValueMap = new HashMap<>();
List<ReferenceDigestValue> rimIntegrityMeasurements;
HashMap<String, ReferenceDigestValue> 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);
Expand Down

0 comments on commit b7c15ee

Please sign in to comment.