Updated the live log information if the base and support rim are not

uploaded together.
This commit is contained in:
Cyrus 2022-02-11 08:01:28 -05:00
parent 2db5b86da1
commit 1f2be7ce18
2 changed files with 20 additions and 1 deletions

View File

@ -950,11 +950,20 @@ public abstract class AbstractAttestationCertificateAuthority
this.referenceManifestManager.update(rim);
}
}
for (BaseReferenceManifest baseRim : BaseReferenceManifest
.select(referenceManifestManager).getRIMs()) {
if (baseRim.getPlatformManufacturer().equals(dv.getHw().getManufacturer())
&& baseRim.getPlatformModel().equals(dv.getHw().getProductName())) {
baseRim.setEventLogHash(temp.getHexDecHash());
this.referenceManifestManager.update(baseRim);
}
}
} catch (IOException ioEx) {
LOG.error(ioEx);
}
} else {
LOG.warn(String.format("Device did not send bios measurement log...",
LOG.warn(String.format("%s did not send bios measurement log...",
dv.getNw().getHostname()));
}

View File

@ -10,6 +10,7 @@ import hirs.attestationca.portal.page.PageController;
import hirs.attestationca.portal.page.PageMessages;
import hirs.attestationca.portal.page.params.NoPageParams;
import hirs.data.persist.BaseReferenceManifest;
import hirs.data.persist.EventLogMeasurements;
import hirs.data.persist.ReferenceManifest;
import hirs.data.persist.SupportReferenceManifest;
import hirs.data.persist.SwidResource;
@ -257,6 +258,15 @@ public class ReferenceManifestPageController
}
}
}
for (EventLogMeasurements liveLog : EventLogMeasurements
.select(referenceManifestManager).getRIMs()) {
if (liveLog.getPlatformManufacturer().equals(base.getPlatformManufacturer())
&& liveLog.getPlatformModel().equals(base.getPlatformModel())) {
rim.setEventLogHash(liveLog.getEventLogHash());
break;
}
}
}
storeManifest(file.getOriginalFilename(),