Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -557,10 +557,11 @@ <h3 class="accordion-header" th:id="${'pcrHeader' + resourceStat.count}">
</div><!--accordion item-->
</div><!--pcrAccordion-->
</th:block>
<span style="color: red; padding-left: 20px" th:text="Associated RIM ${resource.name} not found."
th:if="${#arrays.isEmpty(initialData.get('pcrList'))}
<th:block th:if="${#arrays.isEmpty(initialData.get('pcrList'))}
and not ${initialData.get('swidPatch')}
and not ${initialData.get('swidSupplemental')}"/>
and not ${initialData.get('swidSupplemental')}">
<span style="color: red">PCR values not found.</span>
</th:block>
</div><!--accordion body-->
</div><!--accordion collapse-->
</div><!--accordion item-->
Expand Down
32 changes: 23 additions & 9 deletions HIRS_Utils/src/main/java/hirs/utils/tpm/eventlog/TCGEventLog.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import hirs.utils.tpm.eventlog.events.EvNoAction;
import hirs.utils.tpm.eventlog.uefi.UefiConstants;
import lombok.Getter;
import lombok.extern.log4j.Log4j2;
import org.apache.commons.codec.DecoderException;
import org.apache.commons.codec.binary.Hex;
import org.apache.logging.log4j.LogManager;
Expand All @@ -34,6 +35,7 @@
/**
* Class for handling different formats of TCG Event logs.
*/
@Log4j2
public final class TCGEventLog {

// The TCG PC Client Platform TPM Profile Specification for TPM 2.0 defines 5 localities
Expand Down Expand Up @@ -230,11 +232,21 @@ public TCGEventLog(final byte[] rawlog, final boolean bEventFlag,
// put the remaining events into the event list
while (is.available() > 0) {
if (bCryptoAgile) {
TpmPcrEvent2 event2 = new TpmPcrEvent2(is, eventNumber++, strongestEvLogHashAlgName);
eventList.put(eventNumber, event2);
if (event2.isStartupLocalityEvent()) {
EvNoAction event = new EvNoAction(event2.getEventContent());
startupLocality = event.getStartupLocality();
TpmPcrEvent2 event2 = null;
eventNumber++;
try {
event2 = new TpmPcrEvent2(is, eventNumber, strongestEvLogHashAlgName);
eventList.put(eventNumber, event2);
if (event2.isStartupLocalityEvent()) {
EvNoAction event = new EvNoAction(event2.getEventContent());
startupLocality = event.getStartupLocality();
}
} catch (Exception e) {
log.warn("Couldn't parse event #{} {}: {}",
eventNumber,
(event2 != null) ? event2.getEventTypeStr() : "(couldn't parse)",
e.getMessage());
continue;
}
} else {
TpmPcrEvent1 event1 = new TpmPcrEvent1(is, eventNumber++);
Expand Down Expand Up @@ -267,10 +279,12 @@ public TCGEventLog(final byte[] rawlog, final boolean bEventFlag,
// the if-statement is executed
// [new event file status = eventList.get(eventNumber-1).getPciidsFileStatus()]
// (ie. if the new file status is not-accessible or from-code, then want to update)
if ((pciidsFileStatus != UefiConstants.FILESTATUS_NOT_ACCESSIBLE)
&& (eventList.get(eventNumber - 1).getPciidsFileStatus()
!= UefiConstants.FILESTATUS_FROM_FILESYSTEM)) {
pciidsFileStatus = eventList.get(eventNumber - 1).getPciidsFileStatus();
if (eventList.containsKey(eventNumber - 1)) {
if ((pciidsFileStatus != UefiConstants.FILESTATUS_NOT_ACCESSIBLE)
&& (eventList.get(eventNumber - 1).getPciidsFileStatus()
!= UefiConstants.FILESTATUS_FROM_FILESYSTEM)) {
pciidsFileStatus = eventList.get(eventNumber - 1).getPciidsFileStatus();
}
}
}
calculatePcrValues();
Expand Down
Loading