summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJeff Forcier <jeff@bitprophet.org>2017-08-28 21:47:39 -0700
committerJeff Forcier <jeff@bitprophet.org>2017-08-28 21:47:39 -0700
commitbad045f7dada340d2c707d25923406e32406fc22 (patch)
treeca5b5b97f5f6a2079243ae5584a26980025b5e8c
parent9b693d4753bd1e12da488b09e1961ac9979212d3 (diff)
Python 3 fixes re #1042
-rw-r--r--paramiko/pkey.py4
-rw-r--r--tests/test_pkey.py2
2 files changed, 3 insertions, 3 deletions
diff --git a/paramiko/pkey.py b/paramiko/pkey.py
index 8646b609..67723be2 100644
--- a/paramiko/pkey.py
+++ b/paramiko/pkey.py
@@ -493,7 +493,7 @@ class PublicBlob(object):
msg = "Not enough fields for public blob: {0}"
raise ValueError(msg.format(fields))
key_type = fields[0]
- key_blob = decodebytes(fields[1])
+ key_blob = decodebytes(b(fields[1]))
try:
comment = fields[2].strip()
except IndexError:
@@ -501,7 +501,7 @@ class PublicBlob(object):
# Verify that the blob message first (string) field matches the
# key_type
m = Message(key_blob)
- blob_type = m.get_string()
+ blob_type = m.get_text()
if blob_type != key_type:
msg = "Invalid PublicBlob contents: key type={0!r}, but blob type={1!r}" # noqa
raise ValueError(msg.format(key_type, blob_type))
diff --git a/tests/test_pkey.py b/tests/test_pkey.py
index dac1d02b..80843222 100644
--- a/tests/test_pkey.py
+++ b/tests/test_pkey.py
@@ -491,7 +491,7 @@ class KeyTest(unittest.TestCase):
self.assertEqual(key.public_blob.comment, 'test_rsa.key.pub')
# Delve into blob contents, for test purposes
msg = Message(key.public_blob.key_blob)
- self.assertEqual(msg.get_string(), 'ssh-rsa-cert-v01@openssh.com')
+ self.assertEqual(msg.get_text(), 'ssh-rsa-cert-v01@openssh.com')
nonce = msg.get_string()
e = msg.get_mpint()
n = msg.get_mpint()