summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--paramiko/ed25519key.py12
-rw-r--r--tests/test_pkey.py2
2 files changed, 7 insertions, 7 deletions
diff --git a/paramiko/ed25519key.py b/paramiko/ed25519key.py
index 21c69305..3e447eb7 100644
--- a/paramiko/ed25519key.py
+++ b/paramiko/ed25519key.py
@@ -72,9 +72,9 @@ class Ed25519Key(PKey):
if message.get_bytes(len(OPENSSH_AUTH_MAGIC)) != OPENSSH_AUTH_MAGIC:
raise SSHException('Invalid key')
- ciphername = message.get_string()
- kdfname = message.get_string()
- kdfoptions = message.get_string()
+ ciphername = message.get_text()
+ kdfname = message.get_text()
+ kdfoptions = message.get_binary()
num_keys = message.get_int()
if kdfname == "none":
@@ -97,7 +97,7 @@ class Ed25519Key(PKey):
public_keys = []
for _ in range(num_keys):
pubkey = Message(message.get_binary())
- if pubkey.get_string() != 'ssh-ed25519':
+ if pubkey.get_text() != 'ssh-ed25519':
raise SSHException('Invalid key')
public_keys.append(pubkey.get_binary())
@@ -128,7 +128,7 @@ class Ed25519Key(PKey):
signing_keys = []
for i in range(num_keys):
- if message.get_string() != 'ssh-ed25519':
+ if message.get_text() != 'ssh-ed25519':
raise SSHException('Invalid key')
# A copy of the public key, again, ignore.
public = message.get_binary()
@@ -142,7 +142,7 @@ class Ed25519Key(PKey):
)
signing_keys.append(signing_key)
# Comment, ignore.
- message.get_string()
+ message.get_binary()
if len(signing_keys) != 1:
raise SSHException('Invalid key')
diff --git a/tests/test_pkey.py b/tests/test_pkey.py
index 74330b8d..a26ff170 100644
--- a/tests/test_pkey.py
+++ b/tests/test_pkey.py
@@ -433,7 +433,7 @@ class KeyTest(unittest.TestCase):
def test_ed25519(self):
key1 = Ed25519Key.from_private_key_file(test_path('test_ed25519.key'))
key2 = Ed25519Key.from_private_key_file(
- test_path('test_ed25519_password.key'), 'abc123'
+ test_path('test_ed25519_password.key'), b'abc123'
)
self.assertNotEqual(key1.asbytes(), key2.asbytes())