lkml.org 
[lkml]   [2018]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH v5 4/7] tpm: modify tpm_pcr_read() definition to pass a TPM hash algorithm
    On Wed, Nov 14, 2018 at 04:31:05PM +0100, Roberto Sassu wrote:
    > Currently the TPM driver allows other kernel subsystems to read only the
    > SHA1 PCR bank. This patch modifies the parameters of tpm_pcr_read() and
    > tpm2_pcr_read() to pass a tpm_digest structure, which contains the desired
    > hash algorithm. Also, since commit 125a22105410 ("tpm: React correctly to
    > RC_TESTING from TPM 2.0 self tests") removed the call to tpm2_pcr_read(),
    > the new parameter is expected to be always not NULL.
    >
    > Due to the API change, IMA functions have been modified.
    >
    > Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
    > Acked-by: Mimi Zohar <zohar@linux.ibm.com>
    > ---
    > drivers/char/tpm/tpm-interface.c | 9 +++++----
    > drivers/char/tpm/tpm.h | 3 ++-
    > drivers/char/tpm/tpm2-cmd.c | 23 ++++++++++++++++-------
    > include/linux/tpm.h | 6 ++++--
    > security/integrity/ima/ima_crypto.c | 10 +++++-----
    > 5 files changed, 32 insertions(+), 19 deletions(-)
    >
    > diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
    > index 96c8261d0f04..04aa39432f58 100644
    > --- a/drivers/char/tpm/tpm-interface.c
    > +++ b/drivers/char/tpm/tpm-interface.c
    > @@ -451,11 +451,12 @@ EXPORT_SYMBOL_GPL(tpm_is_tpm2);
    > * tpm_pcr_read - read a PCR value from SHA1 bank
    > * @chip: a &struct tpm_chip instance, %NULL for the default chip
    > * @pcr_idx: the PCR to be retrieved
    > - * @res_buf: the value of the PCR
    > + * @digest_struct: the PCR bank and buffer current PCR value is written to
    > *
    > * Return: same as with tpm_transmit_cmd()
    > */
    > -int tpm_pcr_read(struct tpm_chip *chip, u32 pcr_idx, u8 *res_buf)
    > +int tpm_pcr_read(struct tpm_chip *chip, u32 pcr_idx,
    > + struct tpm_digest *digest_struct)

    Should be just struct tpm_digest *digest

    /Jarkko

    \
     
     \ /
      Last update: 2018-11-16 14:42    [W:4.445 / U:0.196 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site