mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
selftests: tpm2: Fix ill defined assertions
Remove parentheses around assert statements in Python. With parentheses, assert always evaluates to True, making the checks ineffective. Signed-off-by: Maurice Hieronymus <mhi@mailbox.org> Signed-off-by: Jarkko Sakkinen <jarkko@kernel.org>
This commit is contained in:
committed by
Jarkko Sakkinen
parent
a619fe35ab
commit
cffc934c0d
@@ -437,7 +437,7 @@ class Client:
|
||||
|
||||
def extend_pcr(self, i, dig, bank_alg = TPM2_ALG_SHA1):
|
||||
ds = get_digest_size(bank_alg)
|
||||
assert(ds == len(dig))
|
||||
assert ds == len(dig)
|
||||
|
||||
auth_cmd = AuthCommand()
|
||||
|
||||
@@ -589,7 +589,7 @@ class Client:
|
||||
def seal(self, parent_key, data, auth_value, policy_dig,
|
||||
name_alg = TPM2_ALG_SHA1):
|
||||
ds = get_digest_size(name_alg)
|
||||
assert(not policy_dig or ds == len(policy_dig))
|
||||
assert not policy_dig or ds == len(policy_dig)
|
||||
|
||||
attributes = 0
|
||||
if not policy_dig:
|
||||
|
||||
Reference in New Issue
Block a user