Skip to content

Commit

Permalink
Fix quick-unlock: newly generated quick-unlock pins have not been val…
Browse files Browse the repository at this point in the history
…id since v1.5.0 - this is now fixed - re-generate your quick-unlock pin if it was created after v1.5.0
  • Loading branch information
rwinkhart committed Jan 8, 2024
1 parent c856408 commit 07c0dee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/stweak.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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}")


Expand Down

0 comments on commit 07c0dee

Please sign in to comment.