]> git.ipfire.org Git - thirdparty/samba.git/commitdiff
pytest: password_hash uses internal _glue.crypt
authorDouglas Bagnall <douglas.bagnall@catalyst.net.nz>
Wed, 11 Dec 2024 21:46:16 +0000 (10:46 +1300)
committerAndreas Schneider <asn@cryptomilk.org>
Fri, 20 Dec 2024 07:04:31 +0000 (07:04 +0000)
This will remove an external dependency.

BUG: https://bugzilla.samba.org/show_bug.cgi?id=15756

Signed-off-by: Douglas Bagnall <douglas.bagnall@catalyst.net.nz>
Reviewed-by: Andreas Schneider <asn@samba.org>
python/samba/tests/password_hash.py

index 1b7af7de7b8a942e6387c7bf3915575e8985ceee..39ef13fd7b2fed5680946680b969e0dca0cce4af 100644 (file)
@@ -30,11 +30,11 @@ from samba.dcerpc.samr import DOMAIN_PASSWORD_STORE_CLEARTEXT
 from samba.dsdb import UF_ENCRYPTED_TEXT_PASSWORD_ALLOWED
 from samba.tests import delete_force
 from samba.tests.password_test import PasswordCommon
+from samba._glue import crypt
 import ldb
 import samba
 import binascii
 from hashlib import md5
-import crypt
 
 
 USER_NAME = "PasswordHashTestUser"
@@ -321,7 +321,7 @@ class PassWordHashTests(TestCase):
                 cmd = "$%s$rounds=%d$%s" % (alg, rounds, data[3])
 
             # Calculate the expected hash value
-            expected = crypt.crypt(USER_PASS, cmd)
+            expected = crypt(USER_PASS, cmd)
             self.assertEqual(expected, up.hashes[i].value.decode('utf8'))
             i += 1