mirror of
https://github.com/rwinkhart/sshyp-labs.git
synced 2026-09-05 16:47:29 -04:00
sshyp-mfa - Fixed inability to work in offline mode
This commit is contained in:
@@ -26,7 +26,10 @@ def mfa_read_shortcut(): # extracts MFA info from the user-specified sshyp entr
|
|||||||
print(f"\n\u001b[38;5;9merror: entry ({arguments[0]}) does not exist\u001b[0m\n")
|
print(f"\n\u001b[38;5;9merror: entry ({arguments[0]}) does not exist\u001b[0m\n")
|
||||||
s_exit(1)
|
s_exit(1)
|
||||||
if quick_unlock_enabled == 'true':
|
if quick_unlock_enabled == 'true':
|
||||||
_mfa_data = decrypt(directory + arguments[0], _quick_pass=whitelist_verify(port, username_ssh, ip, device_id))
|
_mfa_data = decrypt(directory + arguments[0],
|
||||||
|
_quick_pass=whitelist_verify(sshyp_data.get('SSHYNC', 'port'),
|
||||||
|
sshyp_data.get('SSHYNC', 'user'), sshyp_data.get('SSHYNC', 'ip'),
|
||||||
|
listdir(f"{home}/.config/sshyp/devices")[0]))
|
||||||
else:
|
else:
|
||||||
_mfa_data = decrypt(directory + arguments[0])
|
_mfa_data = decrypt(directory + arguments[0])
|
||||||
try:
|
try:
|
||||||
@@ -51,12 +54,8 @@ if __name__ == '__main__':
|
|||||||
# user data fetcher
|
# user data fetcher
|
||||||
sshyp_data = ConfigParser()
|
sshyp_data = ConfigParser()
|
||||||
sshyp_data.read(f"{home}/.config/sshyp/sshyp.ini")
|
sshyp_data.read(f"{home}/.config/sshyp/sshyp.ini")
|
||||||
|
directory = f"{home}/.local/share/sshyp/"
|
||||||
quick_unlock_enabled = sshyp_data.get('CLIENT-ONLINE', 'quick_unlock_enabled')
|
quick_unlock_enabled = sshyp_data.get('CLIENT-ONLINE', 'quick_unlock_enabled')
|
||||||
username_ssh = sshyp_data.get('SSHYNC', 'user')
|
|
||||||
ip = sshyp_data.get('SSHYNC', 'ip')
|
|
||||||
port = sshyp_data.get('SSHYNC', 'port')
|
|
||||||
directory = sshyp_data.get('SSHYNC', 'local_dir')
|
|
||||||
device_id = listdir(f"{home}/.config/sshyp/devices")[0]
|
|
||||||
|
|
||||||
# main process: runs functions to generate MFA key, then continuously copies up-to-date MFA key to clipboard
|
# main process: runs functions to generate MFA key, then continuously copies up-to-date MFA key to clipboard
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user