linux-kselftest.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/4] Check if FIPS mode is enabled when running selftests
@ 2023-06-12 12:51 Magali Lemes
  2023-06-12 12:51 ` [PATCH v3 1/4] selftests/harness: allow tests to be skipped during setup Magali Lemes
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Magali Lemes @ 2023-06-12 12:51 UTC (permalink / raw)
  To: davem, dsahern, edumazet, keescook, kuba, pabeni, shuah,
	tianjia.zhang, vfedorenko
  Cc: andrei.gherzan, netdev, linux-kernel, linux-kselftest

Some test cases from net/tls, net/fcnal-test and net/vrf-xfrm-tests
that rely on cryptographic functions to work and use non-compliant FIPS
algorithms fail in FIPS mode.

In order to allow these tests to pass in a wider set of kernels,
 - for net/tls, skip the test variants that use the ChaCha20-Poly1305
and SM4 algorithms, when FIPS mode is enabled;
 - for net/fcnal-test, skip the MD5 tests, when FIPS mode is enabled;
 - for net/vrf-xfrm-tests, replace the algorithms that are not
FIPS-compliant with compliant ones.

Changes in v3:
 - Add new commit to allow skipping test directly from test setup.
 - No need to initialize static variable to zero.
 - Skip tests during test setup only.
 - Use the constructor attribute to set fips_enabled before entering
 main().

Changes in v2:
 - Add R-b tags.
 - Put fips_non_compliant into the variants.
 - Turn fips_enabled into a static global variable.
 - Read /proc/sys/crypto/fips_enabled only once at main().

v1: https://lore.kernel.org/netdev/20230607174302.19542-1-magali.lemes@canonical.com/
v2: https://lore.kernel.org/netdev/20230609164324.497813-1-magali.lemes@canonical.com/

Magali Lemes (4):
  selftests/harness: allow tests to be skipped during setup
  selftests: net: tls: check if FIPS mode is enabled
  selftests: net: vrf-xfrm-tests: change authentication and encryption
    algos
  selftests: net: fcnal-test: check if FIPS mode is enabled

 tools/testing/selftests/kselftest_harness.h   |  6 ++--
 tools/testing/selftests/net/fcnal-test.sh     | 27 +++++++++++-----
 tools/testing/selftests/net/tls.c             | 25 ++++++++++++++-
 tools/testing/selftests/net/vrf-xfrm-tests.sh | 32 +++++++++----------
 4 files changed, 62 insertions(+), 28 deletions(-)

-- 
2.34.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-06-13  4:09 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-06-12 12:51 [PATCH v3 0/4] Check if FIPS mode is enabled when running selftests Magali Lemes
2023-06-12 12:51 ` [PATCH v3 1/4] selftests/harness: allow tests to be skipped during setup Magali Lemes
2023-06-12 12:51 ` [PATCH v3 2/4] selftests: net: tls: check if FIPS mode is enabled Magali Lemes
2023-06-13  4:09   ` Jakub Kicinski
2023-06-12 12:51 ` [PATCH v3 3/4] selftests: net: vrf-xfrm-tests: change authentication and encryption algos Magali Lemes
2023-06-12 12:51 ` [PATCH v3 4/4] selftests: net: fcnal-test: check if FIPS mode is enabled Magali Lemes

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).