sshyp-mfa - Pass device_id to whitelist_verify

This commit is contained in:
2022-10-24 15:32:51 -04:00
parent 3c80d72a36
commit 521714fd12
+3 -2
View File
@@ -2,7 +2,7 @@
from base64 import b32decode from base64 import b32decode
from hmac import new as new_mac from hmac import new as new_mac
from os import environ, path, system, uname from os import environ, listdir, path, system, uname
from pathlib import Path from pathlib import Path
from shutil import rmtree from shutil import rmtree
from sshync import get_profile from sshync import get_profile
@@ -27,7 +27,7 @@ def mfa_read_shortcut(): # reads and extracts MFA info from the user-specified
s_exit(1) s_exit(1)
_shm_folder, _shm_entry = shm_gen() _shm_folder, _shm_entry = shm_gen()
if quick_unlock_enabled == 'y': if quick_unlock_enabled == 'y':
decrypt(directory + argument, _shm_folder, _shm_entry, gpg, whitelist_verify(port, username_ssh, ip)) decrypt(directory + argument, _shm_folder, _shm_entry, gpg, whitelist_verify(port, username_ssh, ip, device_id))
else: else:
decrypt(directory + argument, _shm_folder, _shm_entry, gpg, False) decrypt(directory + argument, _shm_folder, _shm_entry, gpg, False)
try: try:
@@ -53,6 +53,7 @@ if __name__ == '__main__':
s_exit(1) s_exit(1)
# user data fetcher # user data fetcher
device_id = listdir(path.expanduser('~/.config/sshyp/devices'))[0]
quick_unlock_enabled = open(path.expanduser('~/.config/sshyp/sshyp-data')).readlines()[3].rstrip() quick_unlock_enabled = open(path.expanduser('~/.config/sshyp/sshyp-data')).readlines()[3].rstrip()
ssh_info = get_profile(path.expanduser('~/.config/sshyp/sshyp.sshync')) ssh_info = get_profile(path.expanduser('~/.config/sshyp/sshyp.sshync'))
username_ssh = str(ssh_info[0].rstrip()) username_ssh = str(ssh_info[0].rstrip())