aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMark Adams <mark@markadams.me>2014-12-14 08:11:48 -0600
committerMark Adams <mark@markadams.me>2014-12-14 14:02:58 -0600
commitc3e8b8890585d82bf19ac642756c5c4baac74237 (patch)
tree15f0d33a3f6bb29c7fc2f17a9f2466a4170ae44e /src
parent4724d61be546f900298c7594d3bdb942b39a919f (diff)
downloadcryptography-c3e8b8890585d82bf19ac642756c5c4baac74237.tar.gz
cryptography-c3e8b8890585d82bf19ac642756c5c4baac74237.tar.bz2
cryptography-c3e8b8890585d82bf19ac642756c5c4baac74237.zip
Made a couple of minor tweaks to clean up _read_next_string and _read_next_mpint
Diffstat (limited to 'src')
-rw-r--r--src/cryptography/hazmat/primitives/serialization.py4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/cryptography/hazmat/primitives/serialization.py b/src/cryptography/hazmat/primitives/serialization.py
index f20d9f56..455c8a91 100644
--- a/src/cryptography/hazmat/primitives/serialization.py
+++ b/src/cryptography/hazmat/primitives/serialization.py
@@ -65,8 +65,6 @@ def load_ssh_public_key(data, backend):
def _load_ssh_rsa_public_key(key_type, key_body, backend):
- assert key_type == b'ssh-rsa'
-
data = base64.b64decode(key_body)
key_body_type, rest = _read_next_string(data)
@@ -85,7 +83,7 @@ def _load_ssh_rsa_public_key(key_type, key_body, backend):
def _read_next_string(data):
"""Retrieves the next RFC 4251 string value from the data."""
- str_len = struct.unpack('>I', data[0:4])[0]
+ str_len, = struct.unpack('>I', data[0:4])
return data[4:4 + str_len], data[4 + str_len:]