lkml.org 
[lkml]   [2018]   [Dec]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v6 7/7] tpm: pass an array of tpm_bank_list structures to tpm_pcr_extend()
On Thu, Dec 13, 2018 at 08:57:17AM +0100, Roberto Sassu wrote:
> > 1. The function does not fail if alg_id is not found. This will go
> > silent.
>
> It is intentional. If alg_id is not found, the PCR is extended with the
> first digest passed by the caller of tpm_pcr_extend(). If no digest was
> provided, the PCR is extended with 0s. This is done to prevent that
> PCRs in unused banks are extended later with fake measurements.
>
>
> > 2. The function does not fail if there is a mismatch with the digest
> > sizes.
>
> The data passed by the caller of tpm_pcr_extend() is copied to
> dummy_hash, which has the maximum length. Then, tpm2_pcr_extend() takes
> from dummy_hash as many bytes as needed, depending on the current
> algorithm.

I would suggest to document these corner cases to the function long
description to make it easy and obvious to understand.

/Jarkko

\
 
 \ /
  Last update: 2018-12-14 09:00    [W:0.134 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site