diff options
author | Jared Hobbs <jared@pyhacker.com> | 2018-11-27 18:12:45 -0700 |
---|---|---|
committer | Jared Hobbs <jared@pyhacker.com> | 2018-11-27 18:12:45 -0700 |
commit | 79a6bbfe53842b2385fb77497f39f38d6a61c0fd (patch) | |
tree | e24c1a30d94ee79a9ddd2d6f99a75fd339ac61ed | |
parent | 2dcdba72cf79f8bc1a72426c879afedf1fa47f72 (diff) |
try to fix test
-rw-r--r-- | paramiko/pkey.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/paramiko/pkey.py b/paramiko/pkey.py index 6839ccc4..9db4dfe7 100644 --- a/paramiko/pkey.py +++ b/paramiko/pkey.py @@ -319,7 +319,7 @@ class PKey(object): m = self.END_TAG.match(lines[end]) if keytype == tag: - data = self._read_private_key_old_format(lines, password) + data = self._read_private_key_old_format(lines, end, password) pkformat = self.PRIVATE_KEY_FORMAT_ORIGINAL elif keytype == "OPENSSH": data = self._read_private_key_new_format( @@ -333,7 +333,7 @@ class PKey(object): return pkformat, data - def _read_private_key_old_format(self, lines, password): + def _read_private_key_old_format(self, lines, end, password): start = 0 # parse any headers first headers = {} @@ -346,7 +346,7 @@ class PKey(object): start += 1 # if we trudged to the end of the file, just try to cope. try: - data = decodebytes(b("".join(lines[start:]))) + data = decodebytes(b("".join(lines[start:end]))) except base64.binascii.Error as e: raise SSHException("base64 decoding error: " + str(e)) if "proc-type" not in headers: |