Skip to content

Commit d7a2fc1

Browse files
magalilemeskuba-moo
authored andcommitted
selftests: net: fcnal-test: check if FIPS mode is enabled
There are some MD5 tests which fail when the kernel is in FIPS mode, since MD5 is not FIPS compliant. Add a check and only run those tests if FIPS mode is not enabled. Fixes: f0bee1e ("fcnal-test: Add TCP MD5 tests") Fixes: 5cad8bc ("fcnal-test: Add TCP MD5 tests for VRF") Reviewed-by: David Ahern <[email protected]> Signed-off-by: Magali Lemes <[email protected]> Signed-off-by: Jakub Kicinski <[email protected]>
1 parent cb43c60 commit d7a2fc1

File tree

1 file changed

+19
-8
lines changed

1 file changed

+19
-8
lines changed

tools/testing/selftests/net/fcnal-test.sh

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,13 @@ NSC_CMD="ip netns exec ${NSC}"
9292

9393
which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping)
9494

95+
# Check if FIPS mode is enabled
96+
if [ -f /proc/sys/crypto/fips_enabled ]; then
97+
fips_enabled=`cat /proc/sys/crypto/fips_enabled`
98+
else
99+
fips_enabled=0
100+
fi
101+
95102
################################################################################
96103
# utilities
97104

@@ -1216,7 +1223,7 @@ ipv4_tcp_novrf()
12161223
run_cmd nettest -d ${NSA_DEV} -r ${a}
12171224
log_test_addr ${a} $? 1 "No server, device client, local conn"
12181225

1219-
ipv4_tcp_md5_novrf
1226+
[ "$fips_enabled" = "1" ] || ipv4_tcp_md5_novrf
12201227
}
12211228

12221229
ipv4_tcp_vrf()
@@ -1270,9 +1277,11 @@ ipv4_tcp_vrf()
12701277
log_test_addr ${a} $? 1 "Global server, local connection"
12711278

12721279
# run MD5 tests
1273-
setup_vrf_dup
1274-
ipv4_tcp_md5
1275-
cleanup_vrf_dup
1280+
if [ "$fips_enabled" = "0" ]; then
1281+
setup_vrf_dup
1282+
ipv4_tcp_md5
1283+
cleanup_vrf_dup
1284+
fi
12761285

12771286
#
12781287
# enable VRF global server
@@ -2772,7 +2781,7 @@ ipv6_tcp_novrf()
27722781
log_test_addr ${a} $? 1 "No server, device client, local conn"
27732782
done
27742783

2775-
ipv6_tcp_md5_novrf
2784+
[ "$fips_enabled" = "1" ] || ipv6_tcp_md5_novrf
27762785
}
27772786

27782787
ipv6_tcp_vrf()
@@ -2842,9 +2851,11 @@ ipv6_tcp_vrf()
28422851
log_test_addr ${a} $? 1 "Global server, local connection"
28432852

28442853
# run MD5 tests
2845-
setup_vrf_dup
2846-
ipv6_tcp_md5
2847-
cleanup_vrf_dup
2854+
if [ "$fips_enabled" = "0" ]; then
2855+
setup_vrf_dup
2856+
ipv6_tcp_md5
2857+
cleanup_vrf_dup
2858+
fi
28482859

28492860
#
28502861
# enable VRF global server

0 commit comments

Comments
 (0)