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:   Wed, 12 Dec 2018 20:16:25 +0200
From:   Jarkko Sakkinen <jarkko.sakkinen@...ux.intel.com>
To:     Roberto Sassu <roberto.sassu@...wei.com>
Cc:     zohar@...ux.ibm.com, david.safford@...com, monty.wiseman@...com,
        linux-integrity@...r.kernel.org,
        linux-security-module@...r.kernel.org,
        linux-kernel@...r.kernel.org, silviu.vlasceanu@...wei.com
Subject: Re: [PATCH v6 5/7] tpm: retrieve digest size of unknown algorithms
 with PCR read

On Thu, Dec 06, 2018 at 07:00:13PM +0100, Roberto Sassu wrote:
> On 12/5/2018 12:53 AM, Jarkko Sakkinen wrote:
> > On Tue, Dec 04, 2018 at 09:21:36AM +0100, Roberto Sassu wrote:
> > > +	for (i = 0; i < ARRAY_SIZE(tpm2_hash_map); i++) {
> > > +		enum hash_algo crypto_algo = tpm2_hash_map[i].crypto_id;
> > > +
> > > +		if (bank->alg_id != tpm2_hash_map[i].tpm_id)
> > > +			continue;
> > > +
> > > +		bank->digest_size = hash_digest_size[crypto_algo];
> > > +		bank->crypto_id = crypto_algo;
> > > +		return 0;
> > > +	}
> > > +
> > > +	return tpm2_pcr_read(chip, 0, &digest, &bank->digest_size);
> > > +}
> > 
> > This is a part that I don't get. Coud you just always call
> > tpm2_pcr_read() instead of this complexity
> 
> First, we avoid operations that may increase the boot time. Second, the
> loop is necessary to obtain the crypto subsystem identifier from a TPM
> algorithm identifier.

I think here would be a comment in place and it would be fine.

/Jarkko

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ