]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
x509: Separately calculate sha256 for blacklist
authorDavid Howells <dhowells@redhat.com>
Wed, 21 Jan 2026 13:33:37 +0000 (13:33 +0000)
committerDavid Howells <dhowells@redhat.com>
Fri, 30 Jan 2026 11:32:23 +0000 (11:32 +0000)
commit2c62068ac86bdd917a12eef49ba82ec8b091208b
tree6219e873d63ba1078a25d81426946e3c1f802b98
parentd3b6dd90e23ef1b57143e60668175ecd890948d1
x509: Separately calculate sha256 for blacklist

Calculate the SHA256 hash for blacklisting purposes independently of the
signature hash (which may be something other than SHA256).

This is necessary because when ML-DSA is used, no digest is calculated.

Note that this represents a change of behaviour in that the hash used for
the blacklist check would previously have been whatever digest was used
for, say, RSA-based signatures.  It may be that this is inadvisable.

Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jarkko Sakkinen <jarkko@kernel.org>
cc: Lukas Wunner <lukas@wunner.de>
cc: Ignat Korchagin <ignat@cloudflare.com>
cc: Stephan Mueller <smueller@chronox.de>
cc: Eric Biggers <ebiggers@kernel.org>
cc: Herbert Xu <herbert@gondor.apana.org.au>
cc: keyrings@vger.kernel.org
cc: linux-crypto@vger.kernel.org
crypto/asymmetric_keys/x509_parser.h
crypto/asymmetric_keys/x509_public_key.c