lkml.org 
[lkml]   [2015]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v2 1/3] keys, trusted: select the hash algorithm
On Mon, Nov 02, 2015 at 07:16:49AM -0500, Mimi Zohar wrote:
> On Fri, 2015-10-30 at 13:35 +0200, Jarkko Sakkinen wrote:
>
> > @@ -787,6 +791,20 @@ static int getoptions(char *c, struct trusted_key_payload *pay,
> > return -EINVAL;
> > opt->pcrlock = lock;
> > break;
> > + case Opt_hash:
> > + for (i = 0; i < HASH_ALGO__LAST; i++) {
> > + if (!strcmp(args[0].from, hash_algo_name[i])) {
> > + opt->hash = i;
> > + break;
> > + }
> > + }
> > + res = tpm_is_tpm2(TPM_ANY_NUM);
>
> While looking at this, I wanted to verify that chips are still added to
> the tail of the tpm_chip_list. Unfortunately, commit "afb5abc tpm:
> two-phase chip management functions" reverted David Howell's commit
> "770ab65 TPM: Add new TPMs to the tail of the list to prevent
> inadvertent change of dev".

Ouch. I'll send a fix that reverts the behavior. Good catch and
apologies. Platforms that I've used BIOS let choose either dTPM 1.2 or
fTPM and platforms that have dTPM 2.0 do not have fTPM option at all.
That's why it went unnoticed.

> > + if (res < 0)
> > + return res;
> > + if (i == HASH_ALGO__LAST ||
> > + (!res && i != HASH_ALGO_SHA1))
> > + return -EINVAL;
> > + break;
>
> If the first TPM registered is a TPM 1.2, then changing the default TPM
> 2.0 hash algorithm will fail.

Yup.

> Mimi
>
> > default:
> > return -EINVAL;
> > }

/Jarkko


\
 
 \ /
  Last update: 2015-11-02 19:01    [W:0.089 / U:0.220 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site