From 3e8772786aaa80a59a43f6e8685de99dfb4211b7 Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Wed, 12 Oct 2022 14:37:54 -0400 Subject: [PATCH] Fixed failed decryption on excluded.gpg Former-commit-id: 8bd59bcf06d63daad654f9ddea9e5ccbcf1b2ea5 [formerly 8dd5101c7faac822211ab48900c38acf1313ffc8] Former-commit-id: 6b4e01337c3a0a337a558384283a467eb9e7de1c --- lib/sshyp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/sshyp.py b/lib/sshyp.py index c0de05c..6d942ec 100755 --- a/lib/sshyp.py +++ b/lib/sshyp.py @@ -544,7 +544,7 @@ def whitelist_setup(): # takes input from the user to set up quick-unlock passw # encrypt excluded with the assembly key _shm_folder, _shm_entry = shm_gen() open(f"{tmp_dir}{_shm_folder}/{_shm_entry}", 'w').write(_quick_unlock_password_excluded) - encrypt(path.expanduser('~/.config/sshyp/excluded.gpg'), _shm_folder, _shm_entry, gpg, _gpg_id) + encrypt(path.expanduser('~/.config/sshyp/excluded'), _shm_folder, _shm_entry, gpg, _gpg_id) print(f"\nyour quick-unlock passphrase: {_quick_unlock_password}") @@ -557,9 +557,9 @@ def whitelist_verify(): # checks the user's whitelist status and fetches the fu _quick_unlock_password = input('\nquick-unlock passphrase: ') _quick_unlock_password_excluded = run( 'ssh -i ' + "'" + path.expanduser('~/.ssh/sshyp') + "' -p " + port + " " + username_ssh + '@' + ip + - f"'gpg --pinentry-mode loopback --passphrase '{_quick_unlock_password}' " + f" 'gpg --pinentry-mode loopback --passphrase '{_quick_unlock_password}' " f"-qd ~/.config/sshyp/excluded.gpg'", shell=True, stdout=PIPE, text=True).stdout.rstrip() - while _i < len(_quick_unlock_password_excluded): + while _i < len(_quick_unlock_password_excluded) + len(_quick_unlock_password): try: _full_password += _quick_unlock_password_excluded[_i] except IndexError: