diff options
author | Jeff Forcier <jeff@bitprophet.org> | 2017-08-28 21:26:18 -0700 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2017-08-28 21:26:18 -0700 |
commit | 59f9a64239b5e4be7b6a067cb63fa4a5420121fe (patch) | |
tree | 815e556207f20cb720d4c0ce31932abb146c36c6 | |
parent | e0babd7a2da93501fed8a83da0cfb70ce6a90bbd (diff) |
Implement ed25519 certs.
God damn it took me ages to notice that frickin self.public_blob = None bit :( :( :( :(
-rw-r--r-- | paramiko/ed25519key.py | 8 | ||||
-rw-r--r-- | paramiko/pkey.py | 1 | ||||
-rw-r--r-- | paramiko/transport.py | 1 |
3 files changed, 6 insertions, 4 deletions
diff --git a/paramiko/ed25519key.py b/paramiko/ed25519key.py index d904f1ac..2e1eb18a 100644 --- a/paramiko/ed25519key.py +++ b/paramiko/ed25519key.py @@ -50,8 +50,11 @@ class Ed25519Key(PKey): if msg is None and data is not None: msg = Message(data) if msg is not None: - if msg.get_text() != "ssh-ed25519": - raise SSHException("Invalid key") + self._check_type_and_load_cert( + msg=msg, + key_type="ssh-ed25519", + cert_type="ssh-ed25519-cert-v01@openssh.com", + ) verifying_key = nacl.signing.VerifyKey(msg.get_binary()) elif filename is not None: with open(filename, "r") as f: @@ -63,7 +66,6 @@ class Ed25519Key(PKey): self._signing_key = signing_key self._verifying_key = verifying_key - self.public_blob = None def _parse_signing_key_data(self, data, password): from paramiko.transport import Transport diff --git a/paramiko/pkey.py b/paramiko/pkey.py index 50a99bfa..4e95f5fc 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -413,7 +413,6 @@ class PKey(object): err = 'Invalid key (class: {0}, data type: {1}' raise SSHException(err.format(self.__class__.__name__, type_)) - def load_certificate(self, value): """ Supplement the private key contents with data loaded from an OpenSSH diff --git a/paramiko/transport.py b/paramiko/transport.py index 1a95f990..df068b3c 100644 --- a/paramiko/transport.py +++ b/paramiko/transport.py @@ -214,6 +214,7 @@ class Transport(threading.Thread, ClosingContextManager): 'ecdsa-sha2-nistp521': ECDSAKey, 'ecdsa-sha2-nistp521-cert-v01@openssh.com': ECDSAKey, 'ssh-ed25519': Ed25519Key, + 'ssh-ed25519-cert-v01@openssh.com': Ed25519Key, } _kex_info = { |