All of lore.kernel.org
 help / color / mirror / Atom feed
From: Roberto Sassu <roberto.sassu@huawei.com>
To: Lakshmi Ramasubramanian <nramas@linux.microsoft.com>,
	James Bottomley <James.Bottomley@HansenPartnership.com>,
	"jarkko.sakkinen@linux.intel.com"
	<jarkko.sakkinen@linux.intel.com>,
	Mimi Zohar <zohar@linux.ibm.com>,
	"linux-integrity@vger.kernel.org"
	<linux-integrity@vger.kernel.org>,
	"Wiseman, Monty (GE Global Research, US)" <monty.wiseman@ge.com>,
	"david.safford@ge.com" <david.safford@ge.com>,
	Silviu Vlasceanu <Silviu.Vlasceanu@huawei.com>
Subject: RE: Does IMA support SHA-256 PCR banks?
Date: Wed, 11 Dec 2019 08:45:06 +0000	[thread overview]
Message-ID: <36fb73d7534f47b6906c348792bd5d96@huawei.com> (raw)
In-Reply-To: <62e91411-d38d-8b75-bf0e-849fdd3c447f@linux.microsoft.com>

> -----Original Message-----
> From: linux-integrity-owner@vger.kernel.org [mailto:linux-integrity-
> owner@vger.kernel.org] On Behalf Of Lakshmi Ramasubramanian
> Sent: Tuesday, December 10, 2019 11:37 PM
> To: James Bottomley <James.Bottomley@HansenPartnership.com>;
> jarkko.sakkinen@linux.intel.com; Mimi Zohar <zohar@linux.ibm.com>;
> linux-integrity@vger.kernel.org
> Subject: Does IMA support SHA-256 PCR banks?
> 
> Hi,
> 
> I noticed that even when SHA-256 is selected as the digest algorithm for
> IMA measurement, the PCR hash is still SHA-1.
> 
> A net search found the text given below in the following wiki:
>     https://wiki.strongswan.org/projects/strongswan/wiki/IMA
> 
> **********************************************************
> ************
> Since SHA-1 has been "shattered" we recommend to use SHA-256 for the
> file measurement hashes.
> 
> IMA implementation does not support SHA-256 PCR banks yet, so the
> SHA-256 file hashes are extended into SHA-1 PCR registers.
> **********************************************************
> ************
> 
> Is the above still true?
> 
> In ima_init_digests() the digest algorithm for PCR extend is set from
> the digest algorithm set in the PCR banks.
> 
> Is there a way to configure IMA to use SHA-256 PCR banks?
> 
> int __init ima_init_digests(void)
> {
> ...
> 	for (i = 0; i < ima_tpm_chip->nr_allocated_banks; i++)
> 		digests[i].alg_id = ima_tpm_chip->allocated_banks[i].alg_id;
> ...

Hi Lakshmi

currently the SHA256 PCR bank is extended with a padded SHA1.

Some time ago, I posted some patches to support the TGC Crypto Agile format:

https://lkml.org/lkml/2017/5/16/369

However, this is a bit complicate because the current format does not follow
the TCG standard. A work to support the new IMA Canonical Event Log format
has been presented at LSS:

https://static.sched.com/hosted_files/lssna18/03/lss_2018_slides_V4.pdf

Given that the patches are very invasive, to me seems a good idea to split this
work in two parts: first, extend PCRs with the correct digest and second
change the measurement list format.

For the first part, the patch will be very simple, as IMA will just query the TPM
to get the list of hash algorithms and will calculate all the digests in
ima_calc_field_array_hash().

Also, the first part would be sufficient for remote attestation, as the data used
to calculate the digests is passed to the verifier. The verifier can calculate by
himself the digest of non-SHA1 PCR banks, even if they are not included in the
measurement list.

Roberto

  reply	other threads:[~2019-12-11  8:45 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-10 22:37 Does IMA support SHA-256 PCR banks? Lakshmi Ramasubramanian
2019-12-11  8:45 ` Roberto Sassu [this message]
2019-12-11 17:35   ` Lakshmi Ramasubramanian
2019-12-25 16:46   ` Ken Goldman
2020-01-07  8:58     ` Roberto Sassu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36fb73d7534f47b6906c348792bd5d96@huawei.com \
    --to=roberto.sassu@huawei.com \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=Silviu.Vlasceanu@huawei.com \
    --cc=david.safford@ge.com \
    --cc=jarkko.sakkinen@linux.intel.com \
    --cc=linux-integrity@vger.kernel.org \
    --cc=monty.wiseman@ge.com \
    --cc=nramas@linux.microsoft.com \
    --cc=zohar@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.