From: Pavel Filipenský Date: Mon, 3 Jan 2022 14:33:46 +0000 (+0100) Subject: tests: Add test for disabling NTLMSSP for ldap client connections X-Git-Tag: tdb-1.4.6~6 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb0fa26dce77829995505f542af02e32df088cd6;p=thirdparty%2Fsamba.git tests: Add test for disabling NTLMSSP for ldap client connections BUG: https://bugzilla.samba.org/show_bug.cgi?id=14955 Signed-off-by: Pavel Filipenský Signed-off-by: Andreas Schneider Reviewed-by: Stefan Metzmacher --- diff --git a/testprogs/blackbox/test_weak_disable_ntlmssp_ldap.sh b/testprogs/blackbox/test_weak_disable_ntlmssp_ldap.sh new file mode 100755 index 00000000000..2822ab29d14 --- /dev/null +++ b/testprogs/blackbox/test_weak_disable_ntlmssp_ldap.sh @@ -0,0 +1,41 @@ +#!/bin/sh +# Blackbox tests for diabing NTLMSSP for ldap clinet connections +# Copyright (c) 2022 Pavel Filipenský + +if [ $# -lt 2 ]; then +cat <&1 || failed=`expr $failed + 1` + +# We should be allowed to use NTLM for connecting +testit "net_ads_search.ntlm" $samba_net ads search --use-kerberos=off '(objectCategory=group)' sAMAccountName -U${USERNAME}%${PASSWORD} || failed=`expr $failed + 1` + +GNUTLS_FORCE_FIPS_MODE=1 +export GNUTLS_FORCE_FIPS_MODE + +# Checks that testparm reports: Weak crypto is disallowed +testit_grep "testparm" "Weak crypto is disallowed" $samba_testparm --suppress-prompt $SMB_CONF_PATH 2>&1 || failed=`expr $failed + 1` + +# We should not be allowed to use NTLM for connecting +testit_expect_failure_grep "net_ads_search.ntlm" "We can't fallback to NTLMSSP, weak crypto is disallowed." $samba_net ads search --use-kerberos=off -d10 '(objectCategory=group)' sAMAccountName -U${USERNAME}%${PASSWORD} || failed=`expr $failed + 1` + +unset GNUTLS_FORCE_FIPS_MODE + +exit $failed