diff options
author | Alex Chavkin <achavkin@scclin013.flatironinstitute.org> | 2023-01-24 11:12:42 -0500 |
---|---|---|
committer | Jeff Forcier <jeff@bitprophet.org> | 2023-02-16 16:59:14 -0500 |
commit | 2361fd666e44b179d2a53a929a3eb5bd0afd45c0 (patch) | |
tree | 6c7e5d60b986e1ac6703a816973cd2e676417295 | |
parent | 74c9f530ceb77c71c545fe35b3b70ed9fd528be0 (diff) |
Split known_hosts fields on either a single space or tab
-rw-r--r-- | paramiko/hostkeys.py | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/paramiko/hostkeys.py b/paramiko/hostkeys.py index 13a0355d..7362c013 100644 --- a/paramiko/hostkeys.py +++ b/paramiko/hostkeys.py @@ -20,6 +20,7 @@ from base64 import encodebytes, decodebytes import binascii import os +import re from collections.abc import MutableMapping from hashlib import sha1 @@ -337,7 +338,7 @@ class HostKeyEntry: :param str line: a line from an OpenSSH known_hosts file """ log = get_logger("paramiko.hostkeys") - fields = line.split() + fields = re.split(' |\t', line) if len(fields) < 3: # Bad number of fields msg = "Not enough fields found in known_hosts in line {} ({!r})" |