Skip to content

Commit

Permalink
Rename old/new_format to be slightly more accurate (pem vs openssh)
Browse files Browse the repository at this point in the history
  • Loading branch information
bitprophet committed Dec 3, 2019
1 parent 592b712 commit 0e33705
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions paramiko/pkey.py
Original file line number Diff line number Diff line change
Expand Up @@ -319,10 +319,10 @@ def _read_private_key(self, tag, f, password=None):
m = self.END_TAG.match(lines[end])

if keytype == tag:
data = self._read_private_key_old_format(lines, end, password)
data = self._read_private_key_pem(lines, end, password)
pkformat = self._PRIVATE_KEY_FORMAT_ORIGINAL
elif keytype == "OPENSSH":
data = self._read_private_key_new_format(
data = self._read_private_key_openssh(
lines[start:end], password
)
pkformat = self._PRIVATE_KEY_FORMAT_OPENSSH
Expand All @@ -337,7 +337,7 @@ def _got_bad_key_format_id(self, id_):
err = "{}._read_private_key() spat out an unknown key format id '{}'"
raise SSHException(err.format(self.__class__.__name__, id_))

def _read_private_key_old_format(self, lines, end, password):
def _read_private_key_pem(self, lines, end, password):
start = 0
# parse any headers first
headers = {}
Expand Down Expand Up @@ -384,7 +384,7 @@ def _read_private_key_old_format(self, lines, end, password):
).decryptor()
return decryptor.update(data) + decryptor.finalize()

def _read_private_key_new_format(self, lines, password):
def _read_private_key_openssh(self, lines, password):
"""
Read the new OpenSSH SSH2 private key format available
since OpenSSH version 6.5
Expand Down

0 comments on commit 0e33705

Please sign in to comment.