linux-integrity.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joey Pabalinas <joeypabalinas@gmail.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Cc: linux-integrity@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	Tadeusz Struk <tadeusz.struk@intel.com>,
	Shuah Khan <shuah@kernel.org>,
	open list <linux-kernel@vger.kernel.org>,
	"open list:KERNEL SELFTEST FRAMEWORK" 
	<linux-kselftest@vger.kernel.org>,
	Joey Pabalinas <joeypabalinas@gmail.com>
Subject: Re: [PATCH] selftests: add TPM 2.0 tests
Date: Tue, 27 Nov 2018 12:49:00 -1000	[thread overview]
Message-ID: <20181127224900.fpbqujcsqwgxpwyq@gmail.com> (raw)
In-Reply-To: <20181127221059.25966-1-jarkko.sakkinen@linux.intel.com>

[-- Attachment #1: Type: text/plain, Size: 1378 bytes --]

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@intel.com>
> Signed-off-by: Jarkko Sakkinen <jarkko.sakkinen@linux.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

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2018-11-27 22:49 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-27 22:10 [PATCH] selftests: add TPM 2.0 tests Jarkko Sakkinen
2018-11-27 22:13 ` Jarkko Sakkinen
2018-11-27 22:34 ` Tadeusz Struk
2018-11-27 23:15   ` Jarkko Sakkinen
2018-11-27 22:49 ` Joey Pabalinas [this message]
2018-11-27 22:53   ` Joey Pabalinas
2018-11-27 23:13     ` Jarkko Sakkinen
2018-12-05  0:33       ` Jarkko Sakkinen
2019-01-04 21:09         ` Jarkko Sakkinen
2019-02-01 17:50 Jarkko Sakkinen
2019-02-03 22:26 ` Petr Vorel
2019-02-04 12:01   ` Jarkko Sakkinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181127224900.fpbqujcsqwgxpwyq@gmail.com \
    --to=joeypabalinas@gmail.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=shuah@kernel.org \
    --cc=tadeusz.struk@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).