4 # Blackbox tests for weak crytpo
5 # Copyright (c) 2020 Andreas Schneider <asn@samba.org>
10 Usage: $0 SERVER USERNAME PASSWORD REALM DOMAIN PREFIX
24 . $
(dirname $0)/subunit.sh
26 samba_bindir
="$BINDIR"
27 samba_testparm
="$BINDIR/testparm"
28 samba_rpcclient
="$samba_bindir/rpcclient"
30 opt
="--option=gensec:gse_krb5=no -U${USERNAME}%${PASSWORD}"
32 unset GNUTLS_FORCE_FIPS_MODE
34 # Checks that testparm reports: Weak crypto is allowed
35 testit_grep
"testparm" "Weak crypto is allowed" $samba_testparm --suppress-prompt $SMB_CONF_PATH 2>&1 || failed
=$
(expr $failed + 1)
37 # We should be allowed to use NTLM for connecting
38 testit
"rpclient.ntlm" $samba_rpcclient ncacn_np
:$SERVER $opt -c "getusername" || failed
=$
(expr $failed + 1)
40 GNUTLS_FORCE_FIPS_MODE
=1
41 export GNUTLS_FORCE_FIPS_MODE
43 # Checks that testparm reports: Weak crypto is disallowed
44 testit_grep
"testparm" "Weak crypto is disallowed" $samba_testparm --suppress-prompt $SMB_CONF_PATH 2>&1 || failed
=$
(expr $failed + 1)
46 # We should not be allowed to use NTLM for connecting
47 testit_expect_failure
"rpclient.ntlm" $samba_rpcclient ncacn_np
:$SERVER $opt -c "getusername" || failed
=$
(expr $failed + 1)
49 unset GNUTLS_FORCE_FIPS_MODE