Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test test_key_too_short fails #176

Closed
tkdchen opened this issue May 18, 2020 · 3 comments
Closed

Test test_key_too_short fails #176

tkdchen opened this issue May 18, 2020 · 3 comments

Comments

@tkdchen
Copy link

tkdchen commented May 18, 2020

When run tests from master branch within testenv py36-base, the expected error BadDigestError is not raised.

    @pytest.mark.parametrize("Backend,ExceptionType", _backend_exception_types())
    def test_key_too_short(self, Backend, ExceptionType):
        key = Backend(TOO_SHORT_PRIVATE_KEY, ALGORITHMS.ES512)
        with pytest.raises(ExceptionType):
>           key.sign(b'foo')
E           Failed: DID NOT RAISE <class 'ecdsa.keys.BadDigestError'>

tests/algorithms/test_EC.py:121: Failed

Steps to reproduce:

  • create a virtual environment
  • install tox
  • tox -e py36-base
@das-g
Copy link

das-g commented Jun 11, 2020

In NixOS/nixpkgs#89723, this was caused by upgrading ecdsa from 0.14.1 to 0.15 in NixOS/nixpkgs@81667ef.

@blag
Copy link
Contributor

blag commented Jul 29, 2020

I have opened a PR in the ecdsa project to resolve this. Once that PR is merged a new version of ecdsa is released, I will update python-jose to use the fixed version (or later) which should resolve this issue. Hang tight until then.

@blag
Copy link
Contributor

blag commented Jul 30, 2020

This is fixed in version 3.2.0, which is now available on PyPI and GitHub. It pins the ecdsa package to < 0.15 to avoid this breakage. I hope to have a better solution available in the next release of python-jose.

Closing. Thank you for reporting this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants