mirror of
https://github.com/rwinkhart/sshyp.git
synced 2026-09-02 23:27:17 -04:00
Implemented quick-unlock decryption support
Former-commit-id: e09eafab15796554dd5ae4013834c68a99b1df8a [formerly b81018c122]
Former-commit-id: 6a539e12d1ff63e29ba551b3b4622c4022673ff0
This commit is contained in:
+9
-2
@@ -146,7 +146,14 @@ def encrypt(_entry_dir, _shm_folder, _shm_entry, _gpg_com, _gpg_id, _tmp_dir=pat
|
|||||||
def decrypt(_entry_dir, _shm_folder, _shm_entry, _gpg_command, _tmp_dir=path.expanduser('~/.config/sshyp/tmp/')):
|
def decrypt(_entry_dir, _shm_folder, _shm_entry, _gpg_command, _tmp_dir=path.expanduser('~/.config/sshyp/tmp/')):
|
||||||
# decrypts an entry to a temporary directory
|
# decrypts an entry to a temporary directory
|
||||||
if _shm_folder == 0 and _shm_entry == 0:
|
if _shm_folder == 0 and _shm_entry == 0:
|
||||||
_command = f"{_gpg_command} -qd --output /dev/null {path.expanduser('~/.config/sshyp/lock.gpg')}"
|
if quick_unlock_enabled == 'y':
|
||||||
|
_command = f"gpg --pinentry-mode loopback --passphrase {whitelist_verify()} -qd --output /dev/null " \
|
||||||
|
f"{path.expanduser('~/.config/sshyp/lock.gpg')}"
|
||||||
|
else:
|
||||||
|
_command = f"{_gpg_command} -qd --output /dev/null {path.expanduser('~/.config/sshyp/lock.gpg')}"
|
||||||
|
elif quick_unlock_enabled == 'y':
|
||||||
|
_command = f"gpg --pinentry-mode loopback --passphrase '{whitelist_verify()}' -qd --output " \
|
||||||
|
f"{_tmp_dir}{_shm_folder}/{_shm_entry} '{_entry_dir}.gpg'"
|
||||||
else:
|
else:
|
||||||
_command = f"{_gpg_command} -qd --output {_tmp_dir}{_shm_folder}/{_shm_entry} '{_entry_dir}.gpg'"
|
_command = f"{_gpg_command} -qd --output {_tmp_dir}{_shm_folder}/{_shm_entry} '{_entry_dir}.gpg'"
|
||||||
try:
|
try:
|
||||||
@@ -822,7 +829,7 @@ if __name__ == "__main__":
|
|||||||
directory = path.expanduser('~/.local/share/sshyp/')
|
directory = path.expanduser('~/.local/share/sshyp/')
|
||||||
gpg_id = sshyp_data[1].rstrip()
|
gpg_id = sshyp_data[1].rstrip()
|
||||||
editor = sshyp_data[2].rstrip()
|
editor = sshyp_data[2].rstrip()
|
||||||
quick_unlock_length = int(sshyp_data[3].rstrip())
|
quick_unlock_enabled = sshyp_data[3].rstrip()
|
||||||
if Path(path.expanduser('~/.config/sshyp/sshyp.sshync')).is_file():
|
if Path(path.expanduser('~/.config/sshyp/sshyp.sshync')).is_file():
|
||||||
ssh_info = sshync.get_profile(path.expanduser('~/.config/sshyp/sshyp.sshync'))
|
ssh_info = sshync.get_profile(path.expanduser('~/.config/sshyp/sshyp.sshync'))
|
||||||
username_ssh = ssh_info[0].rstrip()
|
username_ssh = ssh_info[0].rstrip()
|
||||||
|
|||||||
Reference in New Issue
Block a user