mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-13 07:31:07 +00:00
Add FIPS cryptographic algorithm self-tests for all SHA-1 and SHA-2 algorithms. Following the "Implementation Guidance for FIPS 140-3" document, to achieve this it's sufficient to just test a single test vector for each of HMAC-SHA1, HMAC-SHA256, and HMAC-SHA512. Just run these tests in the initcalls, following the example of e.g. crypto/kdf_sp800108.c. Note that this should meet the FIPS self-test requirement even in the built-in case, given that the initcalls run before userspace, storage, network, etc. are accessible. This does not fix a regression, seeing as lib/ has had SHA-1 support since 2005 and SHA-256 support since 2018. Neither ever had FIPS self-tests. Moreover, fips=1 support has always been an unfinished feature upstream. However, with lib/ now being used more widely, it's now seeing more scrutiny and people seem to want these now [1][2]. [1] https://lore.kernel.org/r/3226361.1758126043@warthog.procyon.org.uk/ [2] https://lore.kernel.org/r/f31dbb22-0add-481c-aee0-e337a7731f8e@oracle.com/ Reviewed-by: Ard Biesheuvel <ardb@kernel.org> Link: https://lore.kernel.org/r/20251011001047.51886-1-ebiggers@kernel.org Signed-off-by: Eric Biggers <ebiggers@kernel.org> |
History
|
|
|---|---|---|
| .. | ||
| arm | ||
| arm64 | ||
| mips | ||
| mpi | ||
| powerpc | ||
| riscv | ||
| s390 | ||
| sparc | ||
| tests | ||
| x86 | ||
| aes.c | ||
| aescfb.c | ||
| aesgcm.c | ||
| arc4.c | ||
| blake2s.c | ||
| chacha-block-generic.c | ||
| chacha.c | ||
| chacha20poly1305-selftest.c | ||
| chacha20poly1305.c | ||
| curve25519-fiat32.c | ||
| curve25519-hacl64.c | ||
| curve25519.c | ||
| des.c | ||
| fips.h | ||
| gf128mul.c | ||
| hash_info.c | ||
| Kconfig | ||
| Makefile | ||
| md5.c | ||
| memneq.c | ||
| poly1305-donna32.c | ||
| poly1305-donna64.c | ||
| poly1305.c | ||
| sha1.c | ||
| sha256.c | ||
| sha512.c | ||
| simd.c | ||
| sm3.c | ||
| utils.c | ||