From 07c0dee0a4dcd1c2288c4c5366ada1b89f9c04ce Mon Sep 17 00:00:00 2001 From: Randall Winkhart Date: Sun, 7 Jan 2024 19:08:02 -0500 Subject: [PATCH] Fix quick-unlock: newly generated quick-unlock pins have not been valid since v1.5.0 - this is now fixed - re-generate your quick-unlock pin if it was created after v1.5.0 --- lib/stweak.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/stweak.py b/lib/stweak.py index 7940423..6bae568 100644 --- a/lib/stweak.py +++ b/lib/stweak.py @@ -362,14 +362,14 @@ def registered_dev_id_remover(_back=False): # takes input from the user to set up quick-unlock pin def whitelist_setup(): _gpg_password_temp = str(curses_text('full gpg passphrase:\n\n\n\n\n(ctrl+g/enter to confirm)')) - _half_length = int(len(_gpg_password_temp) / 2) + _half_length = len(_gpg_password_temp) // 2 try: _short_password_length = int(curses_text(f"quick unlock pin length ({_half_length}):\n\n\n\n\n(ctrl+g/enter " "to confirm)\n\nnote: do NOT enter your desired pin - this is simply " "an integer used to determine the length of the auto-generated pin" "\n\npin must be half the length of the gpg passphrase or less and " - "cannot be a negative number")) - if not 0 <= _short_password_length <= _half_length: + "must be greater than 0")) + if not 0 < _short_password_length <= _half_length: _short_password_length = _half_length except ValueError: _short_password_length = _half_length @@ -394,7 +394,7 @@ def whitelist_setup(): # encrypt excluded with the assembly key from sshyp import encrypt - encrypt(_quick_unlock_password_excluded, f"{home}/.config/sshyp/excluded", _gpg_id) + encrypt([_quick_unlock_password_excluded], f"{home}/.config/sshyp/excluded", _gpg_id) curses_radio(['okay, I have it memorized'], f"your quick-unlock pin: {_quick_unlock_password}")