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

Add support for ECDSA key sizes 384 and 521 alongside the existing 256. #731

Closed
wants to merge 1 commit into from

Commits on Apr 25, 2016

  1. Add support for ECDSA key sizes 384 and 521 alongside the existing 256.

    Previously only 256-bit was handled and in certain cases (private key
    reading) 384- and 521-bit keys were treated as 256-bit keys causing
    silent errors.
    
    Tests have been added to specifically test the 384 and 521 keysizes. As
    RFC 5656 defines 256, 384, and 521 as the required keysizes this seems a
    good set to test. Also, this will cover the branches at ecdsakey.py:55.
    Test keys were renamed and test_client.py was modified as a result.
    
    This also fixes two bugs in ecdsakey.py. First, when calculating bytes
    needed to store a key, the assumption was made that the key size (in
    bits) was divisible by 8 (see line 137). This has been fixed by rounding
    up (wasn't an issue as only 256-bit keys were used before). Another bug
    was that the key padding in asbytes was being done backwards (was
    padding on current_length - needed_length bytes).
    CrazyCasta committed Apr 25, 2016
    Copy the full SHA
    3924421 View commit details
    Browse the repository at this point in the history