pubkey handling

This commit is contained in:
Jakobus Schürz 2019-07-31 12:49:07 +02:00
parent 0b35036df6
commit 5264a15b25

View file

@ -33,7 +33,7 @@ class InsecureSSHKeyUsername(Exception):
return '%s: %s' % (self.__doc__, ': '.join(self.args)) return '%s: %s' % (self.__doc__, ': '.join(self.args))
def ssh_extract_user(pubkey): def ssh_extract_user(pubkey):
if re.search(r"\s", pubkey): if not re.search(r"\s", pubkey):
_, user = pubkey.rsplit(None, 1) _, user = pubkey.rsplit(None, 1)
else: else:
user = pubkey user = pubkey