mirror of
https://github.com/nsacyber/HIRS.git
synced 2024-12-18 20:47:58 +00:00
IdentityClaimProcessor rename measurements -> integrityMeasurements, temp -> deviceLiveLog
This commit is contained in:
parent
7846b86010
commit
5250d648bf
@ -350,7 +350,7 @@ public class IdentityClaimProcessor extends AbstractProcessor {
|
|||||||
dv.getHw().getProductName());
|
dv.getHw().getProductName());
|
||||||
BaseReferenceManifest baseRim = null;
|
BaseReferenceManifest baseRim = null;
|
||||||
SupportReferenceManifest supportRim = null;
|
SupportReferenceManifest supportRim = null;
|
||||||
EventLogMeasurements measurements;
|
EventLogMeasurements integrityMeasurements;
|
||||||
boolean isReplacement = false;
|
boolean isReplacement = false;
|
||||||
String replacementRimId = "";
|
String replacementRimId = "";
|
||||||
String tagId = "";
|
String tagId = "";
|
||||||
@ -542,30 +542,30 @@ public class IdentityClaimProcessor extends AbstractProcessor {
|
|||||||
fileName = String.format("%s.measurement",
|
fileName = String.format("%s.measurement",
|
||||||
dv.getNw().getHostname());
|
dv.getNw().getHostname());
|
||||||
try {
|
try {
|
||||||
EventLogMeasurements temp = new EventLogMeasurements(fileName,
|
EventLogMeasurements deviceLiveLog = new EventLogMeasurements(fileName,
|
||||||
dv.getLivelog().toByteArray());
|
dv.getLivelog().toByteArray());
|
||||||
// find previous version.
|
// find previous version.
|
||||||
measurements = referenceManifestRepository
|
integrityMeasurements = referenceManifestRepository
|
||||||
.byMeasurementDeviceName(dv.getNw().getHostname());
|
.byMeasurementDeviceName(dv.getNw().getHostname());
|
||||||
|
|
||||||
if (measurements != null) {
|
if (integrityMeasurements != null) {
|
||||||
// Find previous log and delete it
|
// Find previous log and delete it
|
||||||
referenceManifestRepository.delete(measurements);
|
referenceManifestRepository.delete(integrityMeasurements);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<BaseReferenceManifest> baseRims = referenceManifestRepository
|
List<BaseReferenceManifest> baseRims = referenceManifestRepository
|
||||||
.getBaseByManufacturerModel(dv.getHw().getManufacturer(),
|
.getBaseByManufacturerModel(dv.getHw().getManufacturer(),
|
||||||
dv.getHw().getProductName());
|
dv.getHw().getProductName());
|
||||||
measurements = temp;
|
integrityMeasurements = deviceLiveLog;
|
||||||
measurements.setPlatformManufacturer(dv.getHw().getManufacturer());
|
integrityMeasurements.setPlatformManufacturer(dv.getHw().getManufacturer());
|
||||||
measurements.setPlatformModel(dv.getHw().getProductName());
|
integrityMeasurements.setPlatformModel(dv.getHw().getProductName());
|
||||||
if (tagId != null && !tagId.trim().isEmpty()) {
|
if (tagId != null && !tagId.trim().isEmpty()) {
|
||||||
measurements.setTagId(tagId);
|
integrityMeasurements.setTagId(tagId);
|
||||||
}
|
}
|
||||||
measurements.setDeviceName(dv.getNw().getHostname());
|
integrityMeasurements.setDeviceName(dv.getNw().getHostname());
|
||||||
measurements.archive();
|
integrityMeasurements.archive();
|
||||||
|
|
||||||
this.referenceManifestRepository.save(measurements);
|
this.referenceManifestRepository.save(integrityMeasurements);
|
||||||
|
|
||||||
for (BaseReferenceManifest bRim : baseRims) {
|
for (BaseReferenceManifest bRim : baseRims) {
|
||||||
if (bRim != null) {
|
if (bRim != null) {
|
||||||
@ -573,8 +573,8 @@ public class IdentityClaimProcessor extends AbstractProcessor {
|
|||||||
// event log hash for use during provision
|
// event log hash for use during provision
|
||||||
SupportReferenceManifest sBaseRim = referenceManifestRepository
|
SupportReferenceManifest sBaseRim = referenceManifestRepository
|
||||||
.getSupportRimEntityById(bRim.getAssociatedRim());
|
.getSupportRimEntityById(bRim.getAssociatedRim());
|
||||||
bRim.setEventLogHash(temp.getHexDecHash());
|
bRim.setEventLogHash(deviceLiveLog.getHexDecHash());
|
||||||
sBaseRim.setEventLogHash(temp.getHexDecHash());
|
sBaseRim.setEventLogHash(deviceLiveLog.getHexDecHash());
|
||||||
referenceManifestRepository.save(bRim);
|
referenceManifestRepository.save(bRim);
|
||||||
referenceManifestRepository.save(sBaseRim);
|
referenceManifestRepository.save(sBaseRim);
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user