From: Douglas Bagnall Date: Wed, 11 Dec 2024 21:46:16 +0000 (+1300) Subject: pytest: password_hash uses internal _glue.crypt X-Git-Tag: tdb-1.4.13~251 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=552053b6445611ecef6ac4c11c55ebf92f03571d;p=thirdparty%2Fsamba.git pytest: password_hash uses internal _glue.crypt This will remove an external dependency. BUG: https://bugzilla.samba.org/show_bug.cgi?id=15756 Signed-off-by: Douglas Bagnall Reviewed-by: Andreas Schneider --- diff --git a/python/samba/tests/password_hash.py b/python/samba/tests/password_hash.py index 1b7af7de7b8..39ef13fd7b2 100644 --- a/python/samba/tests/password_hash.py +++ b/python/samba/tests/password_hash.py @@ -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