From 88600f0942f2e903590638c56373533da6e64f31 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Fri, 26 May 2017 21:52:57 -0400 Subject: integration test, with ourselves --- tests/test_client.py | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'tests/test_client.py') diff --git a/tests/test_client.py b/tests/test_client.py index 5f4f0dd5..eb6aa7b3 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -43,6 +43,7 @@ FINGERPRINTS = { 'ssh-dss': b'\x44\x78\xf0\xb9\xa2\x3c\xc5\x18\x20\x09\xff\x75\x5b\xc1\xd2\x6c', 'ssh-rsa': b'\x60\x73\x38\x44\xcb\x51\x86\x65\x7f\xde\xda\xa2\x2b\x5a\x57\xd5', 'ecdsa-sha2-nistp256': b'\x25\x19\xeb\x55\xe6\xa1\x47\xff\x4f\x38\xd2\x75\x6f\xa5\xd5\x60', + 'ssh-ed25519': b'\x1d\xf3\xefoj\x95\x99\xb7\xedq\x7f&\xba\xb0CD', } @@ -194,6 +195,9 @@ class SSHClientTest (unittest.TestCase): """ self._test_connection(key_filename=test_path('test_ecdsa_256.key')) + def test_client_ed25519(self): + self._test_connection(key_filename=test_path('test_ed25519.key')) + def test_3_multiple_key_files(self): """ verify that SSHClient accepts and tries multiple key files. -- cgit v1.2.3 From 5e103b31f12f701254ee07f61ffd482bf6e08dd4 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Sat, 3 Jun 2017 01:58:24 -0400 Subject: Fixed encoding/decoding of the public key on the wire Public point was accidentally encoded as 32 bytes, with no length prefix. --- paramiko/ed25519key.py | 4 ++-- paramiko/hostkeys.py | 1 + tests/test_client.py | 2 +- 3 files changed, 4 insertions(+), 3 deletions(-) (limited to 'tests/test_client.py') diff --git a/paramiko/ed25519key.py b/paramiko/ed25519key.py index d9c92aa2..e1a8a732 100644 --- a/paramiko/ed25519key.py +++ b/paramiko/ed25519key.py @@ -52,7 +52,7 @@ class Ed25519Key(PKey): if msg is not None: if msg.get_text() != "ssh-ed25519": raise SSHException("Invalid key") - verifying_key = nacl.signing.VerifyKey(msg.get_bytes(32)) + verifying_key = nacl.signing.VerifyKey(msg.get_binary()) elif filename is not None: with open(filename, "r") as f: data = self._read_private_key("OPENSSH", f) @@ -164,7 +164,7 @@ class Ed25519Key(PKey): v = self._verifying_key m = Message() m.add_string("ssh-ed25519") - m.add_bytes(v.encode()) + m.add_string(v.encode()) return m.asbytes() def get_name(self): diff --git a/paramiko/hostkeys.py b/paramiko/hostkeys.py index 7586b903..f3cb29db 100644 --- a/paramiko/hostkeys.py +++ b/paramiko/hostkeys.py @@ -35,6 +35,7 @@ from paramiko.dsskey import DSSKey from paramiko.rsakey import RSAKey from paramiko.util import get_logger, constant_time_bytes_eq from paramiko.ecdsakey import ECDSAKey +from paramiko.ed25519key import Ed25519Key from paramiko.ssh_exception import SSHException diff --git a/tests/test_client.py b/tests/test_client.py index eb6aa7b3..a340be00 100644 --- a/tests/test_client.py +++ b/tests/test_client.py @@ -43,7 +43,7 @@ FINGERPRINTS = { 'ssh-dss': b'\x44\x78\xf0\xb9\xa2\x3c\xc5\x18\x20\x09\xff\x75\x5b\xc1\xd2\x6c', 'ssh-rsa': b'\x60\x73\x38\x44\xcb\x51\x86\x65\x7f\xde\xda\xa2\x2b\x5a\x57\xd5', 'ecdsa-sha2-nistp256': b'\x25\x19\xeb\x55\xe6\xa1\x47\xff\x4f\x38\xd2\x75\x6f\xa5\xd5\x60', - 'ssh-ed25519': b'\x1d\xf3\xefoj\x95\x99\xb7\xedq\x7f&\xba\xb0CD', + 'ssh-ed25519': b'\xb3\xd5"\xaa\xf9u^\xe8\xcd\x0e\xea\x02\xb9)\xa2\x80', } -- cgit v1.2.3