diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2014-09-05 14:26:40 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2014-09-05 14:26:40 -0700 |
commit | 1a162428dd8ee6dc7b44d97aa7237bcb83145f42 (patch) | |
tree | 1d86c93084558a08f091ec6df8d5143d3801a8c4 | |
parent | 76c2073e9e098bec89837ae980167ee9b0a6efcf (diff) | |
parent | 286b5fb7088b11efcbe6c1b452a1d1785890ac3f (diff) |
Merge branch 'master' into 218-int
-rw-r--r-- | paramiko/ecdsakey.py | 7 | ||||
-rw-r--r-- | sites/www/changelog.rst | 2 |
2 files changed, 5 insertions, 4 deletions
diff --git a/paramiko/ecdsakey.py b/paramiko/ecdsakey.py index 6736315f..8cf4b1e7 100644 --- a/paramiko/ecdsakey.py +++ b/paramiko/ecdsakey.py @@ -24,7 +24,6 @@ import binascii from hashlib import sha256 from ecdsa import SigningKey, VerifyingKey, der, curves -from ecdsa.test_pyecdsa import ECDSA from paramiko.common import four_byte, one_byte from paramiko.message import Message @@ -51,7 +50,7 @@ class ECDSAKey (PKey): if (msg is None) and (data is not None): msg = Message(data) if vals is not None: - self.verifying_key, self.signing_key = vals + self.signing_key, self.verifying_key = vals else: if msg is None: raise SSHException('Key object may not be empty') @@ -125,7 +124,7 @@ class ECDSAKey (PKey): key = self.signing_key or self.verifying_key self._write_private_key('EC', file_obj, key.to_der(), password) - def generate(bits, progress_func=None): + def generate(curve=curves.NIST256p, progress_func=None): """ Generate a new private RSA key. This factory function can be used to generate a new host key or authentication key. @@ -138,7 +137,7 @@ class ECDSAKey (PKey): @return: new private key @rtype: L{RSAKey} """ - signing_key = ECDSA.generate() + signing_key = SigningKey.generate(curve) key = ECDSAKey(vals=(signing_key, signing_key.get_verifying_key())) return key generate = staticmethod(generate) diff --git a/sites/www/changelog.rst b/sites/www/changelog.rst index 57f00f12..f1215f62 100644 --- a/sites/www/changelog.rst +++ b/sites/www/changelog.rst @@ -2,6 +2,8 @@ Changelog ========= +* :bug:`335 major` Fix ECDSA key generation (generation of brand new ECDSA keys + was broken previously). Thanks to ``@solarw`` for catch & patch. * :feature:`184` Support quoted values in SSH config file parsing. Credit to Yan Kalchevskiy. * :feature:`131` Add a `~paramiko.sftp_client.SFTPClient.listdir_iter` method |