summaryrefslogtreecommitdiffhomepage
path: root/tests/test_pkey.py
AgeCommit message (Collapse)Author
2016-04-25Formatting tweaks re #731Jeff Forcier
2016-04-25Add support for ECDSA key sizes 384 and 521 alongside the existing 256.Alex Orange
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).
2015-03-18Fixed tests.Alex Gaynor
The expected output keys for these tests needed to be rewritten because previously they were generated with a BER encoder, which is basically slopper. Now they're exported as DER, which means they're always as compact as possible. A comparison of the two strings with openssl asn1parse will show that they represent the same data, they the new value is just shorter
2014-09-08Fix a braino in new testJeff Forcier
2014-09-08Test proving #346Jeff Forcier
2014-04-14Merge branch 'master' into use-urandomAlex Gaynor
Conflicts: paramiko/dsskey.py paramiko/ecdsakey.py paramiko/hostkeys.py paramiko/kex_gex.py paramiko/kex_group1.py paramiko/pkey.py paramiko/primes.py paramiko/rsakey.py tests/test_pkey.py
2014-03-29Switch from using PyCrypto's Random to using os.urandom.Alex Gaynor
There's several reasons for this change: 1) It's faster for reads up to 1024 bytes (nearly 10x faster for 16 byte reads) 2) It receives considerably more security review since it's in the kernel. 3) It's yet another step towards running on PyPy. 4) Using userspace CSPRNGs is considered something of an anti-pattern. See: http://sockpuppet.org/blog/2014/02/25/safely-generate-random-numbers/ http://webcache.googleusercontent.com/search?q=cache:2nTvpCgKZXIJ:www.2uo.de/myths-about-urandom/+&cd=3&hl=en&ct=clnk&gl=us
2014-03-29Switched hash functions from PyCrypto to hashlib.Alex Gaynor
There's a few advantages to this: 1) It's probably fast, OpenSSL, which typically backs hashlib, receives far more attention for optimizaitons than PyCrypto. 2) It's the first step to supporting PyPy, where PyCrypto doesn't run.
2014-03-07Fix import * and a bunch of PEP8 formattingScott Maxwell
2013-11-19Remove byte conversions and unhexlify calls that we only needed for Py2.5 ↵Scott Maxwell
support and use the `b` byte string marker instead
2013-11-19Change conditional from PY3 to PY2 to be better prepared for a possible Py4.Scott Maxwell
2013-11-02Fix some deprecation and resource warningsScott Maxwell
2013-11-01Fixes for Python 2.5 and Python 3.2 supportScott Maxwell
2013-11-01Eliminate all uses of b'' syntax to allow for Python 2.5 supportScott Maxwell
2013-10-31Fix bytes/str type in more placesScott Maxwell
2013-10-30Convert and detect types properly, use helper constants, use StringIO and rangeScott Maxwell
2013-10-30Fix message sendingScott Maxwell
Create constants for byte messages, implement asbytes so many methods can take Message and key objects directly and split get_string into get_text and get_binary. Also, change int handling to use mpint with a flag whenever the int is greater than 32 bits.
2013-10-30Fix importsScott Maxwell
2013-09-27Merge branch '1.11'Jeff Forcier
2013-09-27Fixed a typo in the license header of most filesJeff Forcier
Conflicts: paramiko/proxy.py
2013-03-25Introduce ECDSAEthan Glasser-Camp
This just adds tests; hooking this up with paramiko comes in the next commit.
2010-08-03Use Crypto.Random rather than Crypto.Util.RandomPool.Gary van der Merwe
2009-07-19fix my email address to be the current one.Robey Pointer
2007-02-13[project @ robey@lag.net-20070213191706-v8djxd4jiunb3his]Robey Pointer
bump copyright year to 2007
2006-08-01[project @ robey@lag.net-20060801182143-088ff687e0945937]Robey Pointer
use hexlify in tests
2006-06-26[project @ robey@lag.net-20060627064106-71a2bfb5a39a2913]Robey Pointer
add PKey.from_private_key to read from a file object
2006-06-26[project @ robey@lag.net-20060627060600-07d5b7e2fc57202d]Robey Pointer
add PKey.write_private_key to write a private key into a file object, and add tests for it
2005-07-07[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-25]Robey Pointer
cool optimization from john rochester: use cStringIO in Message (and also fix some unit test bugs revealed by the change)
2005-06-28[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-17]Robey Pointer
more unit tests
2005-05-21[project @ Arch-1:robey@lag.net--2005-master-shake%paramiko--dev--1--patch-10]Robey Pointer
fix stupid bug in kex_group1 which luckily only affected unit tests
2005-02-28[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-154]Robey Pointer
even better 1.2 lapras re-bump the version # to 1.2 (with a new date since i added more stuff). add 2005 to the copyright date in a bunch of files.
2004-09-25[project @ Arch-1:robey@lag.net--2003-public%secsh--dev--1.0--patch-92]Robey Pointer
add rsa/dss key object unit tests add tests for rsa/dss key objects -- yay!