This commit is contained in:
a 2021-04-01 08:44:48 +03:00
parent f81bac83ec
commit c8cb57f9d6

View file

@ -154,11 +154,13 @@ class xxh:
if pattern == 2: if pattern == 2:
# Expected: # Expected:
# Enter passphrase for key '<keyfile>': # Enter passphrase for key '<keyfile>':
if key_password is None: if user_key_password:
sess.sendline(user_key_password)
elif key_password:
sess.sendline(key_password)
else:
user_key_password = getpass.getpass(prompt=(sess.before + sess.after).decode("utf-8")+' ') user_key_password = getpass.getpass(prompt=(sess.before + sess.after).decode("utf-8")+' ')
sess.sendline(user_key_password) sess.sendline(user_key_password)
else:
sess.sendline(key_password)
if pattern in [3, 4]: if pattern in [3, 4]:
# Expected: # Expected: