Created
October 11, 2019 10:15
-
-
Save MichalMazurek/33dd1fac2087542d97d98b2e0e121ebd to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if not two_factor: | |
for key_filename in key_filenames: | |
for pkey_class in (RSAKey, DSSKey, ECDSAKey, Ed25519Key): | |
try: | |
key = self._key_from_filepath( | |
key_filename, pkey_class, passphrase | |
) | |
allowed_types = set( | |
self._transport.auth_publickey(username, key) | |
) | |
two_factor = allowed_types & two_factor_types | |
if not two_factor: | |
return | |
break | |
except SSHException as e: | |
saved_exception = e |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment