Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

crypto: testmgr - Restore sha384 and hmac_sha384 drbgs in FIPS mode

Set .fips_allowed in the following drbg alg_test_desc structs.

drbg_nopr_hmac_sha384
drbg_nopr_sha384
drbg_pr_hmac_sha384
drbg_pr_sha384

The sha384 and hmac_sha384 DRBGs with and without prediction resistance
were disallowed in an early version of the FIPS 140-3 Implementation
Guidance document. Hence, the fips_allowed flag in struct alg_test_desc
pertaining to the affected DRBGs was unset. The IG has been withdrawn
and they are allowed again.

Furthermore, when the DRBGs are configured, /proc/crypto shows that
drbg_*pr_sha384 and drbg_*pr_hmac_sha384 are fips-approved ("fips: yes")
but because their self-tests are not run (a consequence of unsetting
the fips_allowed flag), the drbgs won't load successfully with the seeming
contradictory "fips: yes" in /proc/crypto.

This series contains a single patch that sets the fips_allowed flag in
the sha384-impacted DRBGs, which restores the ability to load them in
FIPS mode.

Link: https://lore.kernel.org/linux-crypto/979f4f6f-bb74-4b93-8cbf-6ed653604f0e@jvdsn.com/
Link: https://csrc.nist.gov/CSRC/media/Projects/cryptographic-module-validation-program/documents/fips%20140-3/FIPS%20140-3%20IG.pdf

To: Herbert Xu <herbert@gondor.apana.org.au>
To: David S. Miller <davem@davemloft.net>
Cc: linux-crypto@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Signed-off-by: Jeff Barnes <jeffbarnes@linux.microsoft.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Jeff Barnes and committed by
Herbert Xu
e109b8ee 4e55a929

+4
+4
crypto/testmgr.c
··· 4735 4735 */ 4736 4736 .alg = "drbg_nopr_hmac_sha384", 4737 4737 .test = alg_test_null, 4738 + .fips_allowed = 1 4738 4739 }, { 4739 4740 .alg = "drbg_nopr_hmac_sha512", 4740 4741 .test = alg_test_drbg, ··· 4754 4753 /* covered by drbg_nopr_sha256 test */ 4755 4754 .alg = "drbg_nopr_sha384", 4756 4755 .test = alg_test_null, 4756 + .fips_allowed = 1 4757 4757 }, { 4758 4758 .alg = "drbg_nopr_sha512", 4759 4759 .fips_allowed = 1, ··· 4786 4784 /* covered by drbg_pr_hmac_sha256 test */ 4787 4785 .alg = "drbg_pr_hmac_sha384", 4788 4786 .test = alg_test_null, 4787 + .fips_allowed = 1 4789 4788 }, { 4790 4789 .alg = "drbg_pr_hmac_sha512", 4791 4790 .test = alg_test_null, ··· 4802 4799 /* covered by drbg_pr_sha256 test */ 4803 4800 .alg = "drbg_pr_sha384", 4804 4801 .test = alg_test_null, 4802 + .fips_allowed = 1 4805 4803 }, { 4806 4804 .alg = "drbg_pr_sha512", 4807 4805 .fips_allowed = 1,