Skip to content

deprecated-crypt-alternative fails with undecipherable errors if libxcrypt doesn't have the right hash algorithms enabled #51

Description

@quantenzitrone
$ python3 --version
Python 3.13.8
$ pwd
/path/to/python-deadlib/crypt
$ python3 -m unittest
.E.F..Es
======================================================================
ERROR: test_crypt (tests.test_crypt.CryptTestCase.test_crypt)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/path/to/python-deadlib/crypt/tests/test_crypt.py", line 33, in test_crypt
    cr = crypt.crypt('mypassword', 'ab')
  File "/path/to/python-deadlib/crypt/crypt/__init__.py", line 96, in crypt
    return _crypt.crypt(word, salt)
           ~~~~~~~~~~~~^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument

======================================================================
ERROR: test_sha2_rounds (tests.test_crypt.CryptTestCase.test_sha2_rounds)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/path/to/python-deadlib/crypt/tests/test_crypt.py", line 76, in test_sha2_rounds
    cr = crypt.crypt('mypassword', salt)
  File "/path/to/python-deadlib/crypt/crypt/__init__.py", line 96, in crypt
    return _crypt.crypt(word, salt)
           ~~~~~~~~~~~~^^^^^^^^^^^^
OSError: [Errno 22] Invalid argument

======================================================================
FAIL: test_methods (tests.test_crypt.CryptTestCase.test_methods)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/path/to/python-deadlib/crypt/tests/test_crypt.py", line 60, in test_methods
    self.assertEqual(crypt.methods[-1], crypt.METHOD_CRYPT)
    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: <crypt.METHOD_BLOWFISH> != <crypt.METHOD_CRYPT>

----------------------------------------------------------------------
Ran 8 tests in 0.910s

FAILED (failures=1, errors=2, skipped=1)

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions