lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <aSXM5l47FCN81gan@kernel.org>
Date: Tue, 25 Nov 2025 17:36:06 +0200
From: Jarkko Sakkinen <jarkko@...nel.org>
To: Maurice Hieronymus <mhi@...lbox.org>
Cc: peterhuewe@....de, linux-integrity@...r.kernel.org,
	linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] selftests: tpm2: Fix ill defined assertions

On Sun, Nov 23, 2025 at 12:18:09PM +0100, Maurice Hieronymus wrote:
> Remove parentheses around assert statements in Python. With parentheses,
> assert always evaluates to True, making the checks ineffective.
> 
> Signed-off-by: Maurice Hieronymus <mhi@...lbox.org>
> ---
>  tools/testing/selftests/tpm2/tpm2.py | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/tools/testing/selftests/tpm2/tpm2.py b/tools/testing/selftests/tpm2/tpm2.py
> index bba8cb54548e..3d130c30bc7c 100644
> --- a/tools/testing/selftests/tpm2/tpm2.py
> +++ b/tools/testing/selftests/tpm2/tpm2.py
> @@ -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:
> 
> base-commit: 821e6e2a328bb907d40f8d1141d8b6c079aa7340
> -- 
> 2.50.1
> 


Reviewed-by: Jarkko Sakkinen <jarkko@...nel.org>

BR, Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ