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.
Unified · Split
| @@ -92,6 +92,13 @@ NSC_CMD="ip netns exec ${NSC}" · 91 unmodified lines | |||
| 92 | 92 | ||
| 93 | which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping) | 93 | which ping6 > /dev/null 2>&1 && ping6=$(which ping6) || ping6=$(which ping) |
| 94 | 94 | ||
| 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 | |||
| 95 | ################################################################################ | 102 | ################################################################################ |
| 96 | # utilities | 103 | # utilities |
| 97 | 104 | ||
| @@ -1216,7 +1223,7 @@ ipv4_tcp_novrf() · 1118 unmodified lines | |||
| 1216 | run_cmd nettest -d ${NSA_DEV} -r ${a} | 1223 | run_cmd nettest -d ${NSA_DEV} -r ${a} |
| 1217 | log_test_addr ${a} $? 1 "No server, device client, local conn" | 1224 | log_test_addr ${a} $? 1 "No server, device client, local conn" |
| 1218 | 1225 | ||
| 1219 | ipv4_tcp_md5_novrf | 1226 | [ "$fips_enabled" = "1" ] || ipv4_tcp_md5_novrf |
| 1220 | } | 1227 | } |
| 1221 | 1228 | ||
| 1222 | ipv4_tcp_vrf() | 1229 | ipv4_tcp_vrf() |
| @@ -1270,9 +1277,11 @@ ipv4_tcp_vrf() · 47 unmodified lines | |||
| 1270 | log_test_addr ${a} $? 1 "Global server, local connection" | 1277 | log_test_addr ${a} $? 1 "Global server, local connection" |
| 1271 | 1278 | ||
| 1272 | # run MD5 tests | 1279 | # run MD5 tests |
| 1273 | setup_vrf_dup | 1280 | if [ "$fips_enabled" = "0" ]; then |
| 1274 | ipv4_tcp_md5 | 1281 | setup_vrf_dup |
| 1275 | cleanup_vrf_dup | 1282 | ipv4_tcp_md5 |
| 1283 | cleanup_vrf_dup | ||
| 1284 | fi | ||
| 1276 | 1285 | ||
| 1277 | # | 1286 | # |
| 1278 | # enable VRF global server | 1287 | # enable VRF global server |
| @@ -2772,7 +2781,7 @@ ipv6_tcp_novrf() · 1493 unmodified lines | |||
| 2772 | log_test_addr ${a} $? 1 "No server, device client, local conn" | 2781 | log_test_addr ${a} $? 1 "No server, device client, local conn" |
| 2773 | done | 2782 | done |
| 2774 | 2783 | ||
| 2775 | ipv6_tcp_md5_novrf | 2784 | [ "$fips_enabled" = "1" ] || ipv6_tcp_md5_novrf |
| 2776 | } | 2785 | } |
| 2777 | 2786 | ||
| 2778 | ipv6_tcp_vrf() | 2787 | ipv6_tcp_vrf() |
| @@ -2842,9 +2851,11 @@ ipv6_tcp_vrf() · 63 unmodified lines | |||
| 2842 | log_test_addr ${a} $? 1 "Global server, local connection" | 2851 | log_test_addr ${a} $? 1 "Global server, local connection" |
| 2843 | 2852 | ||
| 2844 | # run MD5 tests | 2853 | # run MD5 tests |
| 2845 | setup_vrf_dup | 2854 | if [ "$fips_enabled" = "0" ]; then |
| 2846 | ipv6_tcp_md5 | 2855 | setup_vrf_dup |
| 2847 | cleanup_vrf_dup | 2856 | ipv6_tcp_md5 |
| 2857 | cleanup_vrf_dup | ||
| 2858 | fi | ||
| 2848 | 2859 | ||
| 2849 | # | 2860 | # |
| 2850 | # enable VRF global server | 2861 | # enable VRF global server |