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] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 27 Nov 2018 12:49:00 -1000
From:   Joey Pabalinas <joeypabalinas@...il.com>
To:     Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
Cc:     linux-integrity@...r.kernel.org,
        linux-security-module@...r.kernel.org,
        Tadeusz Struk <tadeusz.struk@...el.com>,
        Shuah Khan <shuah@...nel.org>,
        open list <linux-kernel@...r.kernel.org>,
        "open list:KERNEL SELFTEST FRAMEWORK" 
        <linux-kselftest@...r.kernel.org>,
        Joey Pabalinas <joeypabalinas@...il.com>
Subject: Re: [PATCH] selftests: add TPM 2.0 tests

On Tue, Nov 27, 2018 at 02:10:48PM -0800, Jarkko Sakkinen wrote:
> Added the tests that I've been using for testing TPM 2.0 functionality
> for long time but have out-of-tree so far residing in
> 
> https://github.com/jsakkine-intel/tpm2-scripts
> 
> Cc: Tadeusz Struk <tadeusz.struk@...el.com>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>

Just one thing I didn't really understand:

> +    def start_auth_session(self, session_type, name_alg = TPM2_ALG_SHA1):
> +        fmt = '>HII IIH16sHBHH'
> +        cmd = struct.pack(fmt,
> +                          TPM2_ST_NO_SESSIONS,
> +                          struct.calcsize(fmt),
> +                          TPM2_CC_START_AUTH_SESSION,
> +                          TPM2_RH_NULL,
> +                          TPM2_RH_NULL,
> +                          16,
> +                          '\0' * 16,
> +                          0,
> +                          session_type,
> +                          TPM2_ALG_NULL,
> +                          name_alg)
> +
> +        return struct.unpack('>I', self.send_cmd(cmd)[10:14])[0]
> +
> +    def __calc_pcr_digest(self, pcrs, bank_alg = TPM2_ALG_SHA1,
> +                          digest_alg = TPM2_ALG_SHA1):
> +        x = []

Is there a reason for using `'\0' * 16` there instead of just 0?

-- 
Cheers,
Joey Pabalinas

Download attachment "signature.asc" of type "application/pgp-signature" (834 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ