__ __ __ __ _____ _ _ _____ _ _ _ | \/ | \ \ / / | __ \ (_) | | / ____| | | | | | \ / |_ __\ V / | |__) | __ ___ ____ _| |_ ___ | (___ | |__ ___| | | | |\/| | '__|> < | ___/ '__| \ \ / / _` | __/ _ \ \___ \| '_ \ / _ \ | | | | | | |_ / . \ | | | | | |\ V / (_| | || __/ ____) | | | | __/ | | |_| |_|_(_)_/ \_\ |_| |_| |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1 if you need WebShell for Seo everyday contact me on Telegram Telegram Address : @jackleetFor_More_Tools:
"""tests for passlib.win32 -- (c) Assurance Technologies 2003-2009"""
#=============================================================================
# imports
#=============================================================================
# core
import warnings
# site
# pkg
from passlib.tests.utils import TestCase
# module
from passlib.utils.compat import u
#=============================================================================
#
#=============================================================================
class UtilTest(TestCase):
"""test util funcs in passlib.win32"""
##test hashes from http://msdn.microsoft.com/en-us/library/cc245828(v=prot.10).aspx
## among other places
def setUp(self):
super(UtilTest, self).setUp()
warnings.filterwarnings("ignore",
"the 'passlib.win32' module is deprecated")
def test_lmhash(self):
from passlib.win32 import raw_lmhash
for secret, hash in [
("OLDPASSWORD", u("c9b81d939d6fd80cd408e6b105741864")),
("NEWPASSWORD", u('09eeab5aa415d6e4d408e6b105741864')),
("welcome", u("c23413a8a1e7665faad3b435b51404ee")),
]:
result = raw_lmhash(secret, hex=True)
self.assertEqual(result, hash)
def test_nthash(self):
warnings.filterwarnings("ignore",
r"nthash\.raw_nthash\(\) is deprecated")
from passlib.win32 import raw_nthash
for secret, hash in [
("OLDPASSWORD", u("6677b2c394311355b54f25eec5bfacf5")),
("NEWPASSWORD", u("256781a62031289d3c2c98c14f1efc8c")),
]:
result = raw_nthash(secret, hex=True)
self.assertEqual(result, hash)
#=============================================================================
# eof
#=============================================================================
| Name | Type | Size | Permission | Actions |
|---|---|---|---|---|
| __pycache__ | Folder | 0755 |
|
|
| __init__.py | File | 20 B | 0644 |
|
| __main__.py | File | 82 B | 0644 |
|
| _test_bad_register.py | File | 541 B | 0644 |
|
| backports.py | File | 2.53 KB | 0644 |
|
| sample1.cfg | File | 243 B | 0644 |
|
| sample1b.cfg | File | 252 B | 0644 |
|
| sample1c.cfg | File | 490 B | 0644 |
|
| sample_config_1s.cfg | File | 238 B | 0644 |
|
| test_apache.py | File | 28.75 KB | 0644 |
|
| test_apps.py | File | 5.16 KB | 0644 |
|
| test_context.py | File | 72.8 KB | 0644 |
|
| test_context_deprecated.py | File | 28.6 KB | 0644 |
|
| test_crypto_builtin_md4.py | File | 5.53 KB | 0644 |
|
| test_crypto_des.py | File | 8.67 KB | 0644 |
|
| test_crypto_digest.py | File | 20 KB | 0644 |
|
| test_crypto_scrypt.py | File | 26.02 KB | 0644 |
|
| test_ext_django.py | File | 40.4 KB | 0644 |
|
| test_ext_django_source.py | File | 10.78 KB | 0644 |
|
| test_handlers.py | File | 67.02 KB | 0644 |
|
| test_handlers_argon2.py | File | 22.3 KB | 0644 |
|
| test_handlers_bcrypt.py | File | 28.86 KB | 0644 |
|
| test_handlers_cisco.py | File | 19.99 KB | 0644 |
|
| test_handlers_django.py | File | 15.17 KB | 0644 |
|
| test_handlers_pbkdf2.py | File | 18.35 KB | 0644 |
|
| test_handlers_scrypt.py | File | 4.09 KB | 0644 |
|
| test_hosts.py | File | 3.81 KB | 0644 |
|
| test_pwd.py | File | 7.02 KB | 0644 |
|
| test_registry.py | File | 9.03 KB | 0644 |
|
| test_totp.py | File | 64.25 KB | 0644 |
|
| test_utils.py | File | 45.04 KB | 0644 |
|
| test_utils_handlers.py | File | 31.38 KB | 0644 |
|
| test_utils_md4.py | File | 1.44 KB | 0644 |
|
| test_utils_pbkdf2.py | File | 11.91 KB | 0644 |
|
| test_win32.py | File | 1.88 KB | 0644 |
|
| tox_support.py | File | 2.42 KB | 0644 |
|
| utils.py | File | 144.17 KB | 0644 |
|