Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1641559

Re: [PATCH v2 2/5] tpm: introduce tpm_pcr_algo_to_crypto() and tpm_pcr_algo_from_crypto()

From Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH v2 2/5] tpm: introduce tpm_pcr_algo_to_crypto() and tpm_pcr_algo_from_crypto()
Date 2017-05-15 13:20 +0200
Message-ID <tHmcG-7ob-21@gated-at.bofh.it> (permalink)
References <tDMp3-2VD-3@gated-at.bofh.it> <tDMp4-2VD-11@gated-at.bofh.it>
Organization Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo

Show all headers | View raw


On Fri, May 05, 2017 at 04:21:49PM +0200, Roberto Sassu wrote:
> tpm_pcr_algorithms() returns to its callers the IDs of the hash algorithms
> supported by the TPM. This patch introduces tpm_pcr_algo_to_crypto(),
> so that the callers can use the crypto subsystem to calculate the digest
> to be passed to tpm_pcr_extend().
> 
> tpm_pcr_algo_from_crypto(), implemented for completeness, is instead used

What do you mean by completeness? Please, never add unused stuff.

> by tpm2_seal_trusted() to perform the opposite conversion.
> 
> Signed-off-by: Roberto Sassu <roberto.sassu@huawei.com>
> ---
> v2
> 
> - fixed return values of tpm2_pcr_algo_to_crypto() and
>   tpm2_pcr_algo_from_crypto() if TPM support is disabled in the kernel

Change Log only to the cover letter.

>  drivers/char/tpm/tpm-interface.c | 51 ++++++++++++++++++++++++++++++++++++++++
>  drivers/char/tpm/tpm2-cmd.c      | 42 +++++++++------------------------
>  include/linux/tpm.h              | 13 ++++++++++
>  3 files changed, 75 insertions(+), 31 deletions(-)

This commit is just deadly wrong in so many ways.

I would suggest to make extend always just take crypto ID in so you
don't have to add these bizarre conversion functions.

This probably covers all the patches but just "unsigned int" as type
for parameters and local variables.

I think I'll pass rest of the patches for now because just reviewing the
two first took too much time and wait for an updated version.

/Jarkko

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH v2 2/5] tpm: introduce tpm_pcr_algo_to_crypto() and  tpm_pcr_algo_from_crypto() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-15 13:20 +0200
  Re: [PATCH v2 2/5] tpm: introduce tpm_pcr_algo_to_crypto() and  tpm_pcr_algo_from_crypto() Roberto Sassu <roberto.sassu@huawei.com> - 2017-05-15 16:30 +0200
    Re: [PATCH v2 2/5] tpm: introduce tpm_pcr_algo_to_crypto() and  tpm_pcr_algo_from_crypto() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-20 15:30 +0200
      Re: [PATCH v2 2/5] tpm: introduce tpm_pcr_algo_to_crypto() and  tpm_pcr_algo_from_crypto() Roberto Sassu <roberto.sassu@huawei.com> - 2017-05-22 09:30 +0200
        Re: [PATCH v2 2/5] tpm: introduce tpm_pcr_algo_to_crypto() and  tpm_pcr_algo_from_crypto() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-24 19:40 +0200
          Re: [PATCH v2 2/5] tpm: introduce tpm_pcr_algo_to_crypto() and  tpm_pcr_algo_from_crypto() Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com> - 2017-05-24 22:30 +0200

csiph-web