Skip to content

Commit

Permalink
tpm_main: fix temp file handling in parse_binary_bootlog(..)
Browse files Browse the repository at this point in the history
Signed-off-by: Thore Sommer <[email protected]>
  • Loading branch information
THS-on authored and mpeters committed Jun 3, 2022
1 parent f53e7ee commit 3755315
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions keylime/tpm/tpm_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -1472,6 +1472,7 @@ def parse_binary_bootlog(self, log_bin: bytes) -> typing.Optional[dict]:
The output is the result of parsing and applying other conveniences."""
with tempfile.NamedTemporaryFile() as log_bin_file:
log_bin_file.write(log_bin)
log_bin_file.seek(0)
log_bin_filename = log_bin_file.name
retDict_tpm2 = self.__run(["tpm2_eventlog", "--eventlog-version=2", log_bin_filename])
log_parsed_strs = retDict_tpm2["retout"]
Expand Down

0 comments on commit 3755315

Please sign in to comment.