]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
crypto: testmgr - disallow RSA PKCS#1 SHA-1 sig algs in FIPS mode
authorJeff Barnes <jeffbarnes@linux.microsoft.com>
Thu, 23 Apr 2026 15:21:41 +0000 (11:21 -0400)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 7 May 2026 08:10:02 +0000 (16:10 +0800)
commit76d2e560c76dabbf9f31f4311069e68610d1ac18
tree0c5da31299776730a037ee333c3418e610ddc719
parent25056329384010a8672552b134f609601dc4f80e
crypto: testmgr - disallow RSA PKCS#1 SHA-1 sig algs in FIPS mode

When booted with fips=1, RSA signature generation using SHA-1 must not be
available.  However, pkcs1pad(rsa,sha1) can currently be instantiated
because it is not present in alg_test_descs; alg_test() falls through the
no_test path and succeeds, after which the algorithm appears in
/proc/crypto as fips-capable.

Add explicit alg_test_descs entries for pkcs1pad(rsa,sha1) and
pkcs1(rsa,sha1) without marking them fips_allowed, so they are treated as
not FIPS-allowed when fips=1 is enabled.

Include both names to cover kernels where RSA sign/verify is provided via
the pkcs1(...) signature template, while pkcs1pad(...) remains for the
traditional wrapper naming and/or RSAES operations.

Signed-off-by: Jeff Barnes <jeffbarnes@linux.microsoft.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/testmgr.c