Skip to content

Commit

Permalink
ima_ast: fix handling ToMToU errors
Browse files Browse the repository at this point in the history
Signed-off-by: Thore Sommer <mail@thson.de>
  • Loading branch information
THS-on authored and mpeters committed Jan 5, 2022
1 parent 2902fe8 commit 4f0fc04
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions keylime/ima_ast.py
Original file line number Diff line number Diff line change
Expand Up @@ -348,6 +348,7 @@ def __init__(self, data: str, validator=None, ima_hash_alg: Hash = Hash.SHA1, pc
# https://elixir.bootlin.com/linux/v5.12.12/source/security/integrity/ima/ima_main.c#L101
if self.ima_template_hash == get_START_HASH(ima_hash_alg):
self.ima_template_hash = get_FF_HASH(ima_hash_alg)
self.pcr_template_hash = get_FF_HASH(pcr_hash_alg)

def invalid(self):
failure = Failure(Component.IMA, ["validation"])
Expand Down

0 comments on commit 4f0fc04

Please sign in to comment.