summaryrefslogtreecommitdiff
path: root/tests/test_ecdsa_password_521.key
diff options
context:
space:
mode:
authorAlex Orange <crazycasta@gmail.com>2016-04-25 13:53:06 -0600
committerAlex Orange <crazycasta@gmail.com>2016-04-25 14:56:51 -0600
commit39244216e4b8b1e0ef684473b9387dca7256bc37 (patch)
tree8abe3ac609c8ba18c61ff2743dd9df9423ddd596 /tests/test_ecdsa_password_521.key
parent86645149c9d066d5fe9222525c8bdf91df7f7de9 (diff)
downloadparamiko-39244216e4b8b1e0ef684473b9387dca7256bc37.tar.gz
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).
Diffstat (limited to 'tests/test_ecdsa_password_521.key')
-rw-r--r--tests/test_ecdsa_password_521.key10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/test_ecdsa_password_521.key b/tests/test_ecdsa_password_521.key
new file mode 100644
index 00000000..5986b930
--- /dev/null
+++ b/tests/test_ecdsa_password_521.key
@@ -0,0 +1,10 @@
+-----BEGIN EC PRIVATE KEY-----
+Proc-Type: 4,ENCRYPTED
+DEK-Info: AES-128-CBC,AEB2DE62C65D1A88C4940A3476B2F10A
+
+5kNk/FFPbHa0402QTrgpIT28uirJ4Amvb2/ryOEyOCe0NPbTLCqlQekj2RFYH2Un
+pgCLUDkelKQv4pyuK8qWS7R+cFjE/gHHCPUWkK3djZUC8DKuA9lUKeQIE+V1vBHc
+L5G+MpoYrPgaydcGx/Uqnc/kVuZx1DXLwrGGtgwNROVBtmjXC9EdfeXHLL1y0wvH
+paNgacJpUtgqJEmiehf7eL/eiReegG553rZK3jjfboGkREUaKR5XOgamiKUtgKoc
+sMpImVYCsRKd/9RI+VOqErZaEvy/9j0Ye3iH32wGOaA=
+-----END EC PRIVATE KEY-----