]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
tests: Replace OpenSSL MD4 invocation with a python3 call
authorAndrew Bartlett <abartlet@samba.org>
Sun, 30 Oct 2022 23:01:12 +0000 (12:01 +1300)
committerStefan Metzmacher <metze@samba.org>
Thu, 24 Nov 2022 11:01:37 +0000 (11:01 +0000)
This will allow the test to pass on Ubuntu 22.04 which has MD4 disabled
in OpenSSL by default.

Signed-off-by: Andrew Bartlett <abartlet@samba.org>
Reviewed-by: Stefan Metzmacher <metze@samba.org>
source3/script/tests/test_rpcclient_pw_nt_hash.sh

index 33e49a86f9232cec56e856556974c2aaa805aeda..24d81519c4c83f3124f293fbaf88ab488ec90149 100755 (executable)
@@ -15,7 +15,7 @@ PASSWORD="$2"
 SERVER="$3"
 RPCCLIENT="$4"
 
-HASH=$(echo -n $PASSWORD | iconv -t utf16le | openssl md4 | cut -d ' ' -f2)
+HASH=$(echo -n $PASSWORD | iconv -t utf16le | $PYTHON -c 'import sys, binascii, samba, samba.crypto; sys.stdout.buffer.write(binascii.hexlify(samba.crypto.md4_hash_blob(sys.stdin.buffer.read(1000))))')
 
 RPCCLIENTCMD="$RPCCLIENT $SERVER --pw-nt-hash -U$USERNAME%$HASH -c queryuser"