From 1763b759fb47698a303b8b6d9e4eac83f25c1890 Mon Sep 17 00:00:00 2001 From: Alex Gaynor Date: Mon, 3 Aug 2015 17:37:10 -0400 Subject: Fixes #2199 -- allow SSH keys to have spaces in their comments --- src/cryptography/hazmat/primitives/serialization.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/cryptography/hazmat/primitives/serialization.py b/src/cryptography/hazmat/primitives/serialization.py index 098b31dc..fc50456e 100644 --- a/src/cryptography/hazmat/primitives/serialization.py +++ b/src/cryptography/hazmat/primitives/serialization.py @@ -33,9 +33,9 @@ def load_der_public_key(data, backend): def load_ssh_public_key(data, backend): - key_parts = data.split(b' ') + key_parts = data.split(b' ', 2) - if len(key_parts) != 2 and len(key_parts) != 3: + if len(key_parts) < 2: raise ValueError( 'Key is not in the proper format or contains extra data.') -- cgit v1.2.3