libpass 1.8.2__tar.gz → 1.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {libpass-1.8.2 → libpass-1.9.0}/PKG-INFO +1 -2
- {libpass-1.8.2 → libpass-1.9.0}/libpass/context.py +7 -5
- {libpass-1.8.2 → libpass-1.9.0}/libpass/hashers/pbkdf2.py +4 -3
- {libpass-1.8.2 → libpass-1.9.0}/passlib/__init__.py +1 -1
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/bcrypt.py +1 -110
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/des_crypt.py +3 -46
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/md5_crypt.py +2 -23
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/sha1_crypt.py +1 -23
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/sha2_crypt.py +2 -30
- {libpass-1.8.2 → libpass-1.9.0}/passlib/utils/__init__.py +1 -123
- {libpass-1.8.2 → libpass-1.9.0}/pyproject.toml +2 -3
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_handlers.py +1 -8
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_handlers_bcrypt.py +0 -32
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_totp.py +3 -3
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_utils.py +0 -68
- {libpass-1.8.2 → libpass-1.9.0}/tests/utils.py +0 -28
- {libpass-1.8.2 → libpass-1.9.0}/uv.lock +3 -12
- {libpass-1.8.2 → libpass-1.9.0}/.git-blame-ignore-revs +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/.github/workflows/lint.yaml +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/.github/workflows/publish.yml +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/.github/workflows/test.yaml +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/.gitignore +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/CHANGELOG.md +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/LICENSE +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/README.md +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/Taskfile.yml +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_fragments/asa_verify_callout.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_fragments/insecure_hash_warning.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_fragments/trivial_hash_warning.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_static/bb-logo.png +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_static/bb-logo.svg +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_static/logo-128.png +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_static/logo-64.png +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_static/logo.ico +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_static/logo.png +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_static/logo.svg +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_static/masthead.png +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/_static/masthead.svg +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/conf.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/contents.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/copyright.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/dev-requirements.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/faq.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/history/1.5.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/history/1.6.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/history/1.7.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/history/1.8.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/history/ancient.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/history/index.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/history.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/index.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/install.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/index.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.apache.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.apps.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.context-tutorial.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.context.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.crypto.des.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.crypto.digest.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.crypto.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.exc.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.ext.django.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.apr_md5_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.argon2.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.atlassian_pbkdf2_sha1.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.bcrypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.bcrypt_sha256.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.bigcrypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.bsdi_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.cisco_asa.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.cisco_pix.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.cisco_type7.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.crypt16.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.cta_pbkdf2_sha1.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.des_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.django_std.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.dlitz_pbkdf2_sha1.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.fshp.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.grub_pbkdf2_sha512.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.hex_digests.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.ldap_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.ldap_other.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.ldap_pbkdf2_digest.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.ldap_std.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.lmhash.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.md5_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.msdcc.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.msdcc2.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.mssql2000.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.mssql2005.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.mysql323.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.mysql41.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.nthash.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.oracle10.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.oracle11.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.pbkdf2_digest.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.phpass.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.plaintext.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.postgres_md5.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.scram.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.scrypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.sha1_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.sha256_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.sha512_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.sun_md5_crypt.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hash.unix_disabled.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.hosts.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.ifc.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.pwd.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.registry.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.totp.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.utils.binary.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.utils.compat.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.utils.des.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.utils.handlers.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.utils.pbkdf2.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/lib/passlib.utils.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/modular_crypt_format.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/narr/context-tutorial.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/narr/hash-tutorial.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/narr/index.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/narr/overview.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/narr/quickstart.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/narr/totp-tutorial.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/new_app_quickstart.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/other.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/overview.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/password_hash_api.rst +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/docs/requirements.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/_salt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/_utils/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/_utils/base64.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/_utils/binary.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/_utils/bytes.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/_utils/const.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/_utils/deprecated.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/_utils/protocols.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/_utils/str.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/_utils/validation.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/errors.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/hashers/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/hashers/abc.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/hashers/argon2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/hashers/bcrypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/hashers/django.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/hashers/sha_crypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/inspect/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/inspect/bcrypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/inspect/django.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/inspect/pbkdf2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/inspect/phc/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/inspect/phc/_phc.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/inspect/phc/defs.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/inspect/sha_crypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/libpass/py.typed +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/_data/wordsets/bip39.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/_data/wordsets/eff_long.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/_data/wordsets/eff_prefixed.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/_data/wordsets/eff_short.txt +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/apache.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/apps.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/context.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/_blowfish/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/_blowfish/_gen_files.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/_blowfish/base.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/_blowfish/unrolled.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/_md4.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/des.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/digest.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/scrypt/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/scrypt/_builtin.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/scrypt/_gen_files.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/crypto/scrypt/_salsa.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/exc.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/ext/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/ext/django/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/ext/django/models.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/ext/django/utils.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/argon2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/cisco.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/digests.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/django.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/fshp.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/ldap_digests.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/misc.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/mssql.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/mysql.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/oracle.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/pbkdf2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/phpass.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/postgres.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/roundup.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/scram.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/scrypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/sun_md5_crypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/handlers/windows.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/hash.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/hosts.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/ifc.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/pwd.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/registry.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/totp.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/utils/binary.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/utils/compat/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/utils/decor.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/utils/des.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/utils/handlers.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/utils/md4.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/passlib/utils/pbkdf2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/_test_bad_register.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/hashers/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/hashers/test_argon2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/hashers/test_bcrypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/hashers/test_bcrypt_sha256.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/hashers/test_django.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/hashers/test_pbkdf2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/hashers/test_sha_crypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/inspect/__init__.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/inspect/test_inspect.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/test_arch.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/libpass/test_context.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/sample1.cfg +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/sample1b.cfg +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/sample1c.cfg +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/sample_config_1s.cfg +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_apache.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_apache_pytest.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_apps.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_context.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_crypto_builtin_md4.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_crypto_des.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_crypto_digest.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_crypto_scrypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_ext_django.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_handlers_argon2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_handlers_cisco.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_handlers_django.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_handlers_pbkdf2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_handlers_scrypt.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_hosts.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_pwd.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_registry.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_utils_handlers.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_utils_md4.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/test_utils_pbkdf2.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tests/utils_.py +0 -0
- {libpass-1.8.2 → libpass-1.9.0}/tox.ini +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: libpass
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.9.0
|
|
4
4
|
Summary: Fork of passlib, a comprehensive password hashing framework supporting over 30 schemes
|
|
5
5
|
Project-URL: Homepage, https://github.com/ThirVondukr/passlib
|
|
6
6
|
Project-URL: Repository, https://github.com/ThirVondukr/passlib
|
|
@@ -27,7 +27,6 @@ Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
|
27
27
|
Classifier: Topic :: Security :: Cryptography
|
|
28
28
|
Classifier: Topic :: Software Development :: Libraries
|
|
29
29
|
Requires-Python: >=3.9
|
|
30
|
-
Requires-Dist: legacycrypt>=0.3
|
|
31
30
|
Requires-Dist: typing-extensions>=4.6.0
|
|
32
31
|
Provides-Extra: argon2
|
|
33
32
|
Requires-Dist: argon2-cffi>=18.2.0; extra == 'argon2'
|
|
@@ -30,11 +30,7 @@ class CryptContext:
|
|
|
30
30
|
return any(scheme.verify(secret=secret, hash=hash) for scheme in self._schemes)
|
|
31
31
|
|
|
32
32
|
def needs_update(self, hash: str) -> bool:
|
|
33
|
-
|
|
34
|
-
schemes = list(
|
|
35
|
-
scheme for scheme in self._schemes if scheme not in self._deprecated_schemes
|
|
36
|
-
)
|
|
37
|
-
return all(not scheme.identify(hash) for scheme in schemes)
|
|
33
|
+
return all(not scheme.identify(hash) for scheme in self._active_schemes)
|
|
38
34
|
|
|
39
35
|
def _validate_init(self) -> None:
|
|
40
36
|
if not self._schemes:
|
|
@@ -44,6 +40,12 @@ class CryptContext:
|
|
|
44
40
|
def _default_scheme(self) -> PasswordHasher:
|
|
45
41
|
return self._schemes[0]
|
|
46
42
|
|
|
43
|
+
@functools.cached_property
|
|
44
|
+
def _active_schemes(self) -> Sequence[PasswordHasher]:
|
|
45
|
+
return tuple(
|
|
46
|
+
scheme for scheme in self._schemes if scheme not in self._deprecated_schemes
|
|
47
|
+
)
|
|
48
|
+
|
|
47
49
|
@functools.cached_property
|
|
48
50
|
def _deprecated_schemes(self) -> Sequence[PasswordHasher]:
|
|
49
51
|
if self._deprecated == "auto":
|
|
@@ -20,9 +20,6 @@ from libpass.inspect.pbkdf2 import (
|
|
|
20
20
|
if TYPE_CHECKING:
|
|
21
21
|
from libpass._utils.bytes import StrOrBytes
|
|
22
22
|
|
|
23
|
-
# PBKDF2 Recommended rounds:
|
|
24
|
-
# https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#pbkdf2
|
|
25
|
-
|
|
26
23
|
_ab64_encoder = Base64Encoder(
|
|
27
24
|
encode=lambda v: ab64_encode(v).decode("ascii"),
|
|
28
25
|
decode=ab64_decode,
|
|
@@ -103,6 +100,10 @@ class PBKDF2SHAHandler(PasswordHasher):
|
|
|
103
100
|
return not (hash_info.rounds == self._rounds and key_length_matches)
|
|
104
101
|
|
|
105
102
|
|
|
103
|
+
# PBKDF2 Recommended rounds:
|
|
104
|
+
# https://cheatsheetseries.owasp.org/cheatsheets/Password_Storage_Cheat_Sheet.html#pbkdf2
|
|
105
|
+
|
|
106
|
+
|
|
106
107
|
class PBKDF2SHA256Handler(PBKDF2SHAHandler):
|
|
107
108
|
HASH_NAME = hashlib.sha256().name
|
|
108
109
|
DEFAULT_ROUNDS = 600_000
|
|
@@ -11,7 +11,6 @@ TODO:
|
|
|
11
11
|
from __future__ import annotations
|
|
12
12
|
|
|
13
13
|
import logging
|
|
14
|
-
import os
|
|
15
14
|
import re
|
|
16
15
|
from base64 import b64encode
|
|
17
16
|
from hashlib import sha256
|
|
@@ -23,10 +22,7 @@ import passlib.utils.handlers as uh
|
|
|
23
22
|
from passlib.crypto.digest import compile_hmac
|
|
24
23
|
from passlib.exc import PasslibHashWarning, PasslibSecurityError
|
|
25
24
|
from passlib.utils import (
|
|
26
|
-
crypt_accepts_bytes,
|
|
27
25
|
repeat_string,
|
|
28
|
-
safe_crypt,
|
|
29
|
-
test_crypt,
|
|
30
26
|
to_unicode,
|
|
31
27
|
utf8_repeat_string,
|
|
32
28
|
utf8_truncate,
|
|
@@ -34,7 +30,6 @@ from passlib.utils import (
|
|
|
34
30
|
from passlib.utils.binary import bcrypt64
|
|
35
31
|
|
|
36
32
|
_bcrypt = None # dynamically imported by _load_backend_bcrypt()
|
|
37
|
-
_builtin_bcrypt = None # dynamically imported by _load_backend_builtin()
|
|
38
33
|
|
|
39
34
|
log = logging.getLogger(__name__)
|
|
40
35
|
__all__ = [
|
|
@@ -658,108 +653,6 @@ class _BcryptBackend(_BcryptCommon):
|
|
|
658
653
|
return hash[-31:].decode("ascii")
|
|
659
654
|
|
|
660
655
|
|
|
661
|
-
# -----------------------------------------------------------------------
|
|
662
|
-
# os crypt backend
|
|
663
|
-
# -----------------------------------------------------------------------
|
|
664
|
-
class _OsCryptBackend(_BcryptCommon):
|
|
665
|
-
"""
|
|
666
|
-
backend which uses :func:`crypt.crypt`
|
|
667
|
-
"""
|
|
668
|
-
|
|
669
|
-
#: set flag to ensure _prepare_digest_args() doesn't create invalid utf8 string
|
|
670
|
-
#: when truncating bytes.
|
|
671
|
-
_require_valid_utf8_bytes = not crypt_accepts_bytes
|
|
672
|
-
|
|
673
|
-
@classmethod
|
|
674
|
-
def _load_backend_mixin(mixin_cls, name, dryrun):
|
|
675
|
-
if not test_crypt("test", TEST_HASH_2A):
|
|
676
|
-
return False
|
|
677
|
-
return mixin_cls._finalize_backend_mixin(name, dryrun)
|
|
678
|
-
|
|
679
|
-
def _calc_checksum(self, secret):
|
|
680
|
-
#
|
|
681
|
-
# run secret through crypt.crypt().
|
|
682
|
-
# if everything goes right, we'll get back a properly formed bcrypt hash.
|
|
683
|
-
#
|
|
684
|
-
secret, ident = self._prepare_digest_args(secret)
|
|
685
|
-
config = self._get_config(ident)
|
|
686
|
-
hash = safe_crypt(secret, config)
|
|
687
|
-
if hash is not None:
|
|
688
|
-
if not hash.startswith(config) or len(hash) != len(config) + 31:
|
|
689
|
-
raise uh.exc.CryptBackendError(self, config, hash)
|
|
690
|
-
return hash[-31:]
|
|
691
|
-
|
|
692
|
-
#
|
|
693
|
-
# Check if this failed due to non-UTF8 bytes
|
|
694
|
-
# In detail: under py3, crypt.crypt() requires unicode inputs, which are then encoded to
|
|
695
|
-
# utf8 before passing them to os crypt() call. this is done according to the "s" format
|
|
696
|
-
# specifier for PyArg_ParseTuple (https://docs.python.org/3/c-api/arg.html).
|
|
697
|
-
# There appears no way to get around that to pass raw bytes; so we just throw error here
|
|
698
|
-
# to let user know they need to use another backend if they want raw bytes support.
|
|
699
|
-
#
|
|
700
|
-
# XXX: maybe just let safe_crypt() throw UnicodeDecodeError under passlib 2.0,
|
|
701
|
-
# and then catch it above? maybe have safe_crypt ALWAYS throw error
|
|
702
|
-
# instead of returning None? (would save re-detecting what went wrong)
|
|
703
|
-
# XXX: isn't secret ALWAYS bytes at this point?
|
|
704
|
-
#
|
|
705
|
-
if isinstance(secret, bytes):
|
|
706
|
-
try:
|
|
707
|
-
secret.decode("utf-8")
|
|
708
|
-
except UnicodeDecodeError:
|
|
709
|
-
raise uh.exc.PasswordValueError(
|
|
710
|
-
"python3 crypt.crypt() ony supports bytes passwords using UTF8; "
|
|
711
|
-
"passlib recommends running `pip install bcrypt` for general bcrypt support.",
|
|
712
|
-
) from None
|
|
713
|
-
|
|
714
|
-
#
|
|
715
|
-
# else crypt() call failed for unknown reason.
|
|
716
|
-
#
|
|
717
|
-
# NOTE: getting here should be considered a bug in passlib --
|
|
718
|
-
# if os_crypt backend detection said there's support,
|
|
719
|
-
# and we've already checked all known reasons above;
|
|
720
|
-
# want them to file bug so we can figure out what happened.
|
|
721
|
-
# in the meantime, users can avoid this by installing bcrypt-cffi backend;
|
|
722
|
-
# which won't have this (or utf8) edgecases.
|
|
723
|
-
#
|
|
724
|
-
# XXX: throw something more specific, like an "InternalBackendError"?
|
|
725
|
-
# NOTE: if do change this error, need to update test_81_crypt_fallback() expectations
|
|
726
|
-
# about what will be thrown; as well as safe_verify() above.
|
|
727
|
-
#
|
|
728
|
-
debug_only_repr = uh.exc.debug_only_repr
|
|
729
|
-
raise uh.exc.InternalBackendError(
|
|
730
|
-
"crypt.crypt() failed for unknown reason; "
|
|
731
|
-
"passlib recommends running `pip install bcrypt` for general bcrypt support."
|
|
732
|
-
# for debugging UTs --
|
|
733
|
-
f"(config={debug_only_repr(config)}, secret={debug_only_repr(secret)})",
|
|
734
|
-
)
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
class _BuiltinBackend(_BcryptCommon):
|
|
738
|
-
"""
|
|
739
|
-
backend which uses passlib's pure-python implementation
|
|
740
|
-
"""
|
|
741
|
-
|
|
742
|
-
@classmethod
|
|
743
|
-
def _load_backend_mixin(mixin_cls, name, dryrun):
|
|
744
|
-
from passlib.utils import as_bool
|
|
745
|
-
|
|
746
|
-
if not as_bool(os.environ.get("PASSLIB_BUILTIN_BCRYPT")):
|
|
747
|
-
log.debug(
|
|
748
|
-
"bcrypt 'builtin' backend not enabled via $PASSLIB_BUILTIN_BCRYPT"
|
|
749
|
-
)
|
|
750
|
-
return False
|
|
751
|
-
global _builtin_bcrypt
|
|
752
|
-
|
|
753
|
-
return mixin_cls._finalize_backend_mixin(name, dryrun)
|
|
754
|
-
|
|
755
|
-
def _calc_checksum(self, secret):
|
|
756
|
-
secret, ident = self._prepare_digest_args(secret)
|
|
757
|
-
chk = _builtin_bcrypt(
|
|
758
|
-
secret, ident[1:-1], self.salt.encode("ascii"), self.rounds
|
|
759
|
-
)
|
|
760
|
-
return chk.decode("ascii")
|
|
761
|
-
|
|
762
|
-
|
|
763
656
|
class bcrypt(_NoBackend, _BcryptCommon): # type: ignore[misc]
|
|
764
657
|
"""This class implements the BCrypt password hash, and follows the :ref:`password-hash-api`.
|
|
765
658
|
|
|
@@ -833,7 +726,7 @@ class bcrypt(_NoBackend, _BcryptCommon): # type: ignore[misc]
|
|
|
833
726
|
# in order to load the appropriate backend.
|
|
834
727
|
|
|
835
728
|
#: list of potential backends
|
|
836
|
-
backends = ("bcrypt",
|
|
729
|
+
backends = ("bcrypt",)
|
|
837
730
|
|
|
838
731
|
#: flag that this class's bases should be modified by SubclassBackendMixin
|
|
839
732
|
_backend_mixin_target = True
|
|
@@ -842,8 +735,6 @@ class bcrypt(_NoBackend, _BcryptCommon): # type: ignore[misc]
|
|
|
842
735
|
_backend_mixin_map = {
|
|
843
736
|
None: _NoBackend,
|
|
844
737
|
"bcrypt": _BcryptBackend,
|
|
845
|
-
"os_crypt": _OsCryptBackend,
|
|
846
|
-
"builtin": _BuiltinBackend,
|
|
847
738
|
}
|
|
848
739
|
|
|
849
740
|
|
|
@@ -5,7 +5,7 @@ from warnings import warn
|
|
|
5
5
|
|
|
6
6
|
import passlib.utils.handlers as uh
|
|
7
7
|
from passlib.crypto.des import des_encrypt_int_block
|
|
8
|
-
from passlib.utils import
|
|
8
|
+
from passlib.utils import to_unicode
|
|
9
9
|
from passlib.utils.binary import h64, h64big
|
|
10
10
|
|
|
11
11
|
# local
|
|
@@ -182,29 +182,7 @@ class des_crypt(uh.TruncateMixin, uh.HasManyBackends, uh.HasSalt, uh.GenericHand
|
|
|
182
182
|
|
|
183
183
|
return self._calc_checksum_backend(secret)
|
|
184
184
|
|
|
185
|
-
backends = ("
|
|
186
|
-
|
|
187
|
-
# ---------------------------------------------------------------
|
|
188
|
-
# os_crypt backend
|
|
189
|
-
# ---------------------------------------------------------------
|
|
190
|
-
@classmethod
|
|
191
|
-
def _load_backend_os_crypt(cls):
|
|
192
|
-
if test_crypt("test", "abgOeLfPimXQo"):
|
|
193
|
-
cls._set_calc_checksum_backend(cls._calc_checksum_os_crypt)
|
|
194
|
-
return True
|
|
195
|
-
return False
|
|
196
|
-
|
|
197
|
-
def _calc_checksum_os_crypt(self, secret):
|
|
198
|
-
# NOTE: we let safe_crypt() encode unicode secret -> utf8;
|
|
199
|
-
# no official policy since des-crypt predates unicode
|
|
200
|
-
hash = safe_crypt(secret, self.salt)
|
|
201
|
-
if hash is None:
|
|
202
|
-
# py3's crypt.crypt() can't handle non-utf8 bytes.
|
|
203
|
-
# fallback to builtin alg, which is always available.
|
|
204
|
-
return self._calc_checksum_builtin(secret)
|
|
205
|
-
if not hash.startswith(self.salt) or len(hash) != 13:
|
|
206
|
-
raise uh.exc.CryptBackendError(self, self.salt, hash)
|
|
207
|
-
return hash[2:]
|
|
185
|
+
backends = ("builtin",)
|
|
208
186
|
|
|
209
187
|
# ---------------------------------------------------------------
|
|
210
188
|
# builtin backend
|
|
@@ -332,28 +310,7 @@ class bsdi_crypt(uh.HasManyBackends, uh.HasRounds, uh.HasSalt, uh.GenericHandler
|
|
|
332
310
|
# hand off to base implementation
|
|
333
311
|
return super()._calc_needs_update(**kwds)
|
|
334
312
|
|
|
335
|
-
backends = ("
|
|
336
|
-
|
|
337
|
-
# ---------------------------------------------------------------
|
|
338
|
-
# os_crypt backend
|
|
339
|
-
# ---------------------------------------------------------------
|
|
340
|
-
@classmethod
|
|
341
|
-
def _load_backend_os_crypt(cls):
|
|
342
|
-
if test_crypt("test", "_/...lLDAxARksGCHin."):
|
|
343
|
-
cls._set_calc_checksum_backend(cls._calc_checksum_os_crypt)
|
|
344
|
-
return True
|
|
345
|
-
return False
|
|
346
|
-
|
|
347
|
-
def _calc_checksum_os_crypt(self, secret):
|
|
348
|
-
config = self.to_string()
|
|
349
|
-
hash = safe_crypt(secret, config)
|
|
350
|
-
if hash is None:
|
|
351
|
-
# py3's crypt.crypt() can't handle non-utf8 bytes.
|
|
352
|
-
# fallback to builtin alg, which is always available.
|
|
353
|
-
return self._calc_checksum_builtin(secret)
|
|
354
|
-
if not hash.startswith(config[:9]) or len(hash) != 20:
|
|
355
|
-
raise uh.exc.CryptBackendError(self, config, hash)
|
|
356
|
-
return hash[-11:]
|
|
313
|
+
backends = ("builtin",)
|
|
357
314
|
|
|
358
315
|
# ---------------------------------------------------------------
|
|
359
316
|
# builtin backend
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
from hashlib import md5
|
|
4
4
|
|
|
5
5
|
import passlib.utils.handlers as uh
|
|
6
|
-
from passlib.utils import repeat_string
|
|
6
|
+
from passlib.utils import repeat_string
|
|
7
7
|
from passlib.utils.binary import h64
|
|
8
8
|
|
|
9
9
|
__all__ = [
|
|
@@ -241,28 +241,7 @@ class md5_crypt(uh.HasManyBackends, _MD5_Common):
|
|
|
241
241
|
# FIXME: can't find definitive policy on how md5-crypt handles non-ascii.
|
|
242
242
|
# all backends currently coerce -> utf-8
|
|
243
243
|
|
|
244
|
-
backends = ("
|
|
245
|
-
|
|
246
|
-
# ---------------------------------------------------------------
|
|
247
|
-
# os_crypt backend
|
|
248
|
-
# ---------------------------------------------------------------
|
|
249
|
-
@classmethod
|
|
250
|
-
def _load_backend_os_crypt(cls):
|
|
251
|
-
if test_crypt("test", "$1$test$pi/xDtU5WFVRqYS6BMU8X/"):
|
|
252
|
-
cls._set_calc_checksum_backend(cls._calc_checksum_os_crypt)
|
|
253
|
-
return True
|
|
254
|
-
return False
|
|
255
|
-
|
|
256
|
-
def _calc_checksum_os_crypt(self, secret):
|
|
257
|
-
config = self.ident + self.salt
|
|
258
|
-
hash = safe_crypt(secret, config)
|
|
259
|
-
if hash is None:
|
|
260
|
-
# py3's crypt.crypt() can't handle non-utf8 bytes.
|
|
261
|
-
# fallback to builtin alg, which is always available.
|
|
262
|
-
return self._calc_checksum_builtin(secret)
|
|
263
|
-
if not hash.startswith(config) or len(hash) != len(config) + 23:
|
|
264
|
-
raise uh.exc.CryptBackendError(self, config, hash)
|
|
265
|
-
return hash[-22:]
|
|
244
|
+
backends = ("builtin",)
|
|
266
245
|
|
|
267
246
|
# ---------------------------------------------------------------
|
|
268
247
|
# builtin backend
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import passlib.utils.handlers as uh
|
|
2
2
|
from passlib.crypto.digest import compile_hmac
|
|
3
|
-
from passlib.utils import safe_crypt, test_crypt
|
|
4
3
|
from passlib.utils.binary import h64
|
|
5
4
|
|
|
6
5
|
__all__: list[str] = []
|
|
@@ -73,28 +72,7 @@ class sha1_crypt( # type: ignore[misc]
|
|
|
73
72
|
chk = None if config else self.checksum
|
|
74
73
|
return uh.render_mc3(self.ident, self.rounds, self.salt, chk)
|
|
75
74
|
|
|
76
|
-
backends = ("
|
|
77
|
-
|
|
78
|
-
# ---------------------------------------------------------------
|
|
79
|
-
# os_crypt backend
|
|
80
|
-
# ---------------------------------------------------------------
|
|
81
|
-
@classmethod
|
|
82
|
-
def _load_backend_os_crypt(cls):
|
|
83
|
-
if test_crypt("test", "$sha1$1$Wq3GL2Vp$C8U25GvfHS8qGHimExLaiSFlGkAe"):
|
|
84
|
-
cls._set_calc_checksum_backend(cls._calc_checksum_os_crypt)
|
|
85
|
-
return True
|
|
86
|
-
return False
|
|
87
|
-
|
|
88
|
-
def _calc_checksum_os_crypt(self, secret):
|
|
89
|
-
config = self.to_string(config=True)
|
|
90
|
-
hash = safe_crypt(secret, config)
|
|
91
|
-
if hash is None:
|
|
92
|
-
# py3's crypt.crypt() can't handle non-utf8 bytes.
|
|
93
|
-
# fallback to builtin alg, which is always available.
|
|
94
|
-
return self._calc_checksum_builtin(secret)
|
|
95
|
-
if not hash.startswith(config) or len(hash) != len(config) + 29:
|
|
96
|
-
raise uh.exc.CryptBackendError(self, config, hash)
|
|
97
|
-
return hash[-28:]
|
|
75
|
+
backends = ("builtin",)
|
|
98
76
|
|
|
99
77
|
# ---------------------------------------------------------------
|
|
100
78
|
# builtin backend
|
|
@@ -5,7 +5,7 @@ from __future__ import annotations
|
|
|
5
5
|
import hashlib
|
|
6
6
|
|
|
7
7
|
import passlib.utils.handlers as uh
|
|
8
|
-
from passlib.utils import repeat_string,
|
|
8
|
+
from passlib.utils import repeat_string, to_unicode
|
|
9
9
|
from passlib.utils.binary import h64
|
|
10
10
|
|
|
11
11
|
__all__ = [
|
|
@@ -430,35 +430,7 @@ class _SHA2_Common( # type: ignore[misc]
|
|
|
430
430
|
)
|
|
431
431
|
return hash
|
|
432
432
|
|
|
433
|
-
backends = ("
|
|
434
|
-
|
|
435
|
-
# ---------------------------------------------------------------
|
|
436
|
-
# os_crypt backend
|
|
437
|
-
# ---------------------------------------------------------------
|
|
438
|
-
|
|
439
|
-
#: test hash for OS detection -- provided by subclass
|
|
440
|
-
_test_hash: tuple[str, ...] | None = None
|
|
441
|
-
|
|
442
|
-
@classmethod
|
|
443
|
-
def _load_backend_os_crypt(cls):
|
|
444
|
-
if test_crypt(*cls._test_hash):
|
|
445
|
-
cls._set_calc_checksum_backend(cls._calc_checksum_os_crypt)
|
|
446
|
-
return True
|
|
447
|
-
return False
|
|
448
|
-
|
|
449
|
-
def _calc_checksum_os_crypt(self, secret):
|
|
450
|
-
config = self.to_string()
|
|
451
|
-
hash = safe_crypt(secret, config)
|
|
452
|
-
if hash is None:
|
|
453
|
-
# py3's crypt.crypt() can't handle non-utf8 bytes.
|
|
454
|
-
# fallback to builtin alg, which is always available.
|
|
455
|
-
return self._calc_checksum_builtin(secret)
|
|
456
|
-
# NOTE: avoiding full parsing routine via from_string().checksum,
|
|
457
|
-
# and just extracting the bit we need.
|
|
458
|
-
cs = self.checksum_size
|
|
459
|
-
if not hash.startswith(self.ident) or hash[-cs - 1] != _UDOLLAR:
|
|
460
|
-
raise uh.exc.CryptBackendError(self, config, hash)
|
|
461
|
-
return hash[-cs:]
|
|
433
|
+
backends = ("builtin",)
|
|
462
434
|
|
|
463
435
|
# ---------------------------------------------------------------
|
|
464
436
|
# builtin backend
|
|
@@ -11,7 +11,6 @@ import os
|
|
|
11
11
|
import random
|
|
12
12
|
import stringprep
|
|
13
13
|
import sys
|
|
14
|
-
import threading
|
|
15
14
|
import time
|
|
16
15
|
import timeit
|
|
17
16
|
import unicodedata
|
|
@@ -698,128 +697,7 @@ def as_bool(
|
|
|
698
697
|
return bool(value)
|
|
699
698
|
|
|
700
699
|
|
|
701
|
-
|
|
702
|
-
"""
|
|
703
|
-
UT helper --
|
|
704
|
-
test if value is safe to pass to crypt.crypt();
|
|
705
|
-
since PY3 won't let us pass non-UTF8 bytes to crypt.crypt.
|
|
706
|
-
"""
|
|
707
|
-
if crypt_accepts_bytes or not isinstance(value, bytes):
|
|
708
|
-
return True
|
|
709
|
-
try:
|
|
710
|
-
value.decode("utf-8")
|
|
711
|
-
return True
|
|
712
|
-
except UnicodeDecodeError:
|
|
713
|
-
return False
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
_NULL = "\x00"
|
|
717
|
-
crypt_accepts_bytes = False
|
|
718
|
-
# some crypt() variants will return various constant strings when
|
|
719
|
-
# an invalid/unrecognized config string is passed in; instead of
|
|
720
|
-
# returning NULL / None. examples include ":", ":0", "*0", etc.
|
|
721
|
-
# safe_crypt() returns None for any string starting with one of the
|
|
722
|
-
# chars in this string...
|
|
723
|
-
_invalid_prefixes = "*:!"
|
|
724
|
-
_safe_crypt_lock = threading.Lock()
|
|
725
|
-
|
|
726
|
-
try:
|
|
727
|
-
import legacycrypt # type: ignore[import-untyped]
|
|
728
|
-
|
|
729
|
-
_crypt = legacycrypt.crypt
|
|
730
|
-
except ImportError:
|
|
731
|
-
# ImportError: libcrypt / libxcrypt missing
|
|
732
|
-
|
|
733
|
-
def safe_crypt(secret, hash):
|
|
734
|
-
return None
|
|
735
|
-
|
|
736
|
-
_crypt = None
|
|
737
|
-
has_crypt = False
|
|
738
|
-
else:
|
|
739
|
-
has_crypt = True
|
|
740
|
-
|
|
741
|
-
def safe_crypt(secret, hash):
|
|
742
|
-
# CPython3's crypt() doesn't take bytes, only unicode; unicode which is then
|
|
743
|
-
# encoding using utf-8 before passing to the C-level crypt().
|
|
744
|
-
# so we have to decode the secret.
|
|
745
|
-
if isinstance(secret, bytes):
|
|
746
|
-
orig = secret
|
|
747
|
-
try:
|
|
748
|
-
secret = secret.decode("utf-8")
|
|
749
|
-
except UnicodeDecodeError:
|
|
750
|
-
return None
|
|
751
|
-
# sanity check it encodes back to original byte string,
|
|
752
|
-
# otherwise when crypt() does it's encoding, it'll hash the wrong bytes!
|
|
753
|
-
assert secret.encode("utf-8") == orig, "utf-8 spec says this can't happen!"
|
|
754
|
-
if _NULL in secret:
|
|
755
|
-
raise ValueError("null character in secret")
|
|
756
|
-
if isinstance(hash, bytes):
|
|
757
|
-
hash = hash.decode("ascii")
|
|
758
|
-
try:
|
|
759
|
-
with _safe_crypt_lock:
|
|
760
|
-
result = _crypt(secret, hash)
|
|
761
|
-
except OSError:
|
|
762
|
-
# new in py39 -- per https://bugs.python.org/issue39289,
|
|
763
|
-
# crypt() now throws OSError for various things, mainly unknown hash formats
|
|
764
|
-
# translating that to None for now (may revise safe_crypt behavior in future)
|
|
765
|
-
return None
|
|
766
|
-
# NOTE: per issue 113, crypt() may return bytes in some odd cases.
|
|
767
|
-
# assuming it should still return an ASCII hash though,
|
|
768
|
-
# or there's a bigger issue at hand.
|
|
769
|
-
if isinstance(result, bytes):
|
|
770
|
-
result = result.decode("ascii")
|
|
771
|
-
if not result or result[0] in _invalid_prefixes:
|
|
772
|
-
return None
|
|
773
|
-
return result
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
add_doc(
|
|
777
|
-
safe_crypt,
|
|
778
|
-
"""Wrapper around stdlib's crypt.
|
|
779
|
-
|
|
780
|
-
This is a wrapper around stdlib's :func:`!crypt.crypt`, which attempts
|
|
781
|
-
to provide uniform behavior across Python 2 and 3.
|
|
782
|
-
|
|
783
|
-
:arg secret:
|
|
784
|
-
password, as bytes or unicode (unicode will be encoded as ``utf-8``).
|
|
785
|
-
|
|
786
|
-
:arg hash:
|
|
787
|
-
hash or config string, as ascii bytes or unicode.
|
|
788
|
-
|
|
789
|
-
:returns:
|
|
790
|
-
resulting hash as ascii unicode; or ``None`` if the password
|
|
791
|
-
couldn't be hashed due to one of the issues:
|
|
792
|
-
|
|
793
|
-
* :func:`crypt()` not available on platform.
|
|
794
|
-
|
|
795
|
-
* Under Python 3, if *secret* is specified as bytes,
|
|
796
|
-
it must be use ``utf-8`` or it can't be passed
|
|
797
|
-
to :func:`crypt()`.
|
|
798
|
-
|
|
799
|
-
* Some OSes will return ``None`` if they don't recognize
|
|
800
|
-
the algorithm being used (though most will simply fall
|
|
801
|
-
back to des-crypt).
|
|
802
|
-
|
|
803
|
-
* Some OSes will return an error string if the input config
|
|
804
|
-
is recognized but malformed; current code converts these to ``None``
|
|
805
|
-
as well.
|
|
806
|
-
""",
|
|
807
|
-
)
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
def test_crypt(secret, hash):
|
|
811
|
-
"""check if :func:`crypt.crypt` supports specific hash
|
|
812
|
-
:arg secret: password to test
|
|
813
|
-
:arg hash: known hash of password to use as reference
|
|
814
|
-
:returns: True or False
|
|
815
|
-
"""
|
|
816
|
-
# safe_crypt() always returns unicode, which means that for py3,
|
|
817
|
-
# 'hash' can't be bytes, or "== hash" will never be True.
|
|
818
|
-
# under py2 unicode & str(bytes) will compare fine;
|
|
819
|
-
# so just enforcing "str" limitation
|
|
820
|
-
assert isinstance(hash, str), f"hash must be str, got {type(hash)}"
|
|
821
|
-
assert hash, "hash must be non-empty"
|
|
822
|
-
return safe_crypt(secret, hash) == hash
|
|
700
|
+
has_crypt = False
|
|
823
701
|
|
|
824
702
|
|
|
825
703
|
timer = timeit.default_timer
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
[project]
|
|
2
2
|
name = "libpass"
|
|
3
|
-
version = "1.
|
|
3
|
+
version = "1.9.0"
|
|
4
4
|
description = "Fork of passlib, a comprehensive password hashing framework supporting over 30 schemes"
|
|
5
5
|
authors = [
|
|
6
6
|
{ name = "Eli Collins", email = "elic@assurancetechnologies.com" },
|
|
@@ -9,7 +9,6 @@ maintainers = [
|
|
|
9
9
|
{ name = "Doctor", email = "thirvondukr@gmail.com" },
|
|
10
10
|
]
|
|
11
11
|
dependencies = [
|
|
12
|
-
"legacycrypt>=0.3",
|
|
13
12
|
"typing-extensions>=4.6.0",
|
|
14
13
|
]
|
|
15
14
|
requires-python = ">=3.9"
|
|
@@ -196,7 +195,7 @@ ignore = [
|
|
|
196
195
|
|
|
197
196
|
[tool.commitizen]
|
|
198
197
|
name = "cz_conventional_commits"
|
|
199
|
-
version = "1.
|
|
198
|
+
version = "1.9.0"
|
|
200
199
|
tag_format = "$version"
|
|
201
200
|
version_files = [
|
|
202
201
|
"passlib/__init__.py",
|
|
@@ -212,7 +212,6 @@ class _bsdi_crypt_test(HandlerCase):
|
|
|
212
212
|
|
|
213
213
|
|
|
214
214
|
# create test cases for specific backends
|
|
215
|
-
bsdi_crypt_os_crypt_test = _bsdi_crypt_test.create_backend_case("os_crypt")
|
|
216
215
|
bsdi_crypt_builtin_test = _bsdi_crypt_test.create_backend_case("builtin")
|
|
217
216
|
|
|
218
217
|
|
|
@@ -285,7 +284,6 @@ class _des_crypt_test(HandlerCase):
|
|
|
285
284
|
|
|
286
285
|
|
|
287
286
|
# create test cases for specific backends
|
|
288
|
-
des_crypt_os_crypt_test = _des_crypt_test.create_backend_case("os_crypt")
|
|
289
287
|
des_crypt_builtin_test = _des_crypt_test.create_backend_case("builtin")
|
|
290
288
|
|
|
291
289
|
|
|
@@ -707,7 +705,6 @@ class _ldap_md5_crypt_test(HandlerCase):
|
|
|
707
705
|
|
|
708
706
|
|
|
709
707
|
# create test cases for specific backends
|
|
710
|
-
ldap_md5_crypt_os_crypt_test = _ldap_md5_crypt_test.create_backend_case("os_crypt")
|
|
711
708
|
ldap_md5_crypt_builtin_test = _ldap_md5_crypt_test.create_backend_case("builtin")
|
|
712
709
|
|
|
713
710
|
|
|
@@ -730,7 +727,7 @@ class _ldap_sha1_crypt_test(HandlerCase):
|
|
|
730
727
|
|
|
731
728
|
|
|
732
729
|
# create test cases for specific backends
|
|
733
|
-
ldap_sha1_crypt_os_crypt_test = _ldap_sha1_crypt_test.create_backend_case("
|
|
730
|
+
ldap_sha1_crypt_os_crypt_test = _ldap_sha1_crypt_test.create_backend_case("builtin")
|
|
734
731
|
|
|
735
732
|
|
|
736
733
|
class lmhash_test(EncodingHandlerMixin, HandlerCase):
|
|
@@ -830,7 +827,6 @@ class _md5_crypt_test(HandlerCase):
|
|
|
830
827
|
|
|
831
828
|
|
|
832
829
|
# create test cases for specific backends
|
|
833
|
-
md5_crypt_os_crypt_test = _md5_crypt_test.create_backend_case("os_crypt")
|
|
834
830
|
md5_crypt_builtin_test = _md5_crypt_test.create_backend_case("builtin")
|
|
835
831
|
|
|
836
832
|
|
|
@@ -1383,7 +1379,6 @@ class _sha1_crypt_test(HandlerCase):
|
|
|
1383
1379
|
|
|
1384
1380
|
|
|
1385
1381
|
# create test cases for specific backends
|
|
1386
|
-
sha1_crypt_os_crypt_test = _sha1_crypt_test.create_backend_case("os_crypt")
|
|
1387
1382
|
sha1_crypt_builtin_test = _sha1_crypt_test.create_backend_case("builtin")
|
|
1388
1383
|
|
|
1389
1384
|
|
|
@@ -1574,7 +1569,6 @@ class _sha256_crypt_test(HandlerCase):
|
|
|
1574
1569
|
|
|
1575
1570
|
|
|
1576
1571
|
# create test cases for specific backends
|
|
1577
|
-
sha256_crypt_os_crypt_test = _sha256_crypt_test.create_backend_case("os_crypt")
|
|
1578
1572
|
sha256_crypt_builtin_test = _sha256_crypt_test.create_backend_case("builtin")
|
|
1579
1573
|
|
|
1580
1574
|
|
|
@@ -1698,7 +1692,6 @@ class _sha512_crypt_test(HandlerCase):
|
|
|
1698
1692
|
|
|
1699
1693
|
|
|
1700
1694
|
# create test cases for specific backends
|
|
1701
|
-
sha512_crypt_os_crypt_test = _sha512_crypt_test.create_backend_case("os_crypt")
|
|
1702
1695
|
sha512_crypt_builtin_test = _sha512_crypt_test.create_backend_case("builtin")
|
|
1703
1696
|
|
|
1704
1697
|
|