Re: [PATCH v7 06/13] x86: Add early SHA support for Secure Launch early measurements
From: Andrew Cooper
Date: Mon Nov 13 2023 - 18:21:44 EST
On 11/11/2023 8:36 pm, James Bottomley wrote:
> On Sat, 2023-11-11 at 18:19 +0000, Andrew Cooper wrote:
>> On 11/11/2023 5:44 pm, Eric Biggers wrote:
>>> On Fri, Nov 10, 2023 at 05:27:44PM -0500, Ross Philipson wrote:
>>>> arch/x86/boot/compressed/early_sha1.c | 12 ++++
>>>> lib/crypto/sha1.c | 81
>>>> +++++++++++++++++++++++++
>>> It's surprising to still see this new use of SHA-1 after so many
>>> people objected to it in the v6 patchset. It's also frustrating
>>> that the SHA-1 support is still being obfuscated by being combined
>>> in one patch with SHA-2 support, perhaps in an attempt to conflate
>>> the two algorithms and avoid having to give a rationale for the
>>> inclusion of SHA-1. Finally, new functions should not be added to
>>> lib/crypto/sha1.c unless those functions have multiple users.
>> The rational was given. Let me reiterate it.
>>
>> There are real TPMs in the world that can't use SHA-2. The use of
>> SHA-1 is necessary to support DRTM on such systems, and there are
>> real users of such configurations.
> Given that TPM 2.0 has been shipping in bulk since Windows 10 (2015)
> and is required for Windows 11 (2021), are there really such huge
> numbers of TPM 1.2 systems involved in security functions?
Yes.
As ever, it's not as simple as a straight TPM version issue.
AMD's firmware-TPM2 isn't compatible with their DRTM implementation.
Users are limited to whatever headers are available on the motherboard.
Furthermore, even with a TPM2, it is the firmware (Intel TXT ACM) or
hardware (AMD SKINIT) which chooses the hash algorithms to use, and in a
lot of cases the end user doesn't get a choice.
So yes - there really are modern systems which you can't use SHA-2-only
with.
>> DRTM with SHA-1-only is a damnsight better than no DTRM, even if SHA-
>> 1 is getting a little long in the tooth.
> That's not the problem. The problem is that sha1 is seen as a
> compromised algorithm by NIST which began deprecating it in 2011 and is
> now requiring it to be removed from all systems supplied to the US
> government by 2030
This is a non-issue.
People who care about having no SHA-1 can not compile in DRTM support.
But there are people who will tolerate SHA-1 code to get DTRM support.
~Andrew