Skip to content

Commit ba20d98

Browse files
committed
UX improvements PIN questions
Signed-off-by: Christian Foerster <christian.foerster@mailfence.com>
1 parent 609a9db commit ba20d98

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

initrd/bin/oem-factory-reset

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -989,11 +989,11 @@ if [ "$use_defaults" == "n" -o "$use_defaults" == "N" ]; then
989989
luks_new_Disk_Recovery_Key_passphrase=${CUSTOM_SINGLE_PASS}
990990
fi
991991
else
992-
echo -e -n "Would you like to set distinct PINs/passwords to configure previously stated security components? [y/N]: "
992+
echo -e -n "Would you like to set distinct PINs/passwords to configure previously stated security components? [Y/n]: "
993993
read -n 1 prompt_output
994994
echo
995-
if [ "$prompt_output" == "y" \
996-
-o "$prompt_output" == "Y" ]; then
995+
if [ "$prompt_output" != "n" \
996+
-a "$prompt_output" != "N" ]; then
997997
echo -e "\nThey must be each at least 8 characters in length.\n"
998998
echo
999999
if [ "$CONFIG_TPM" = "y" ]; then
@@ -1011,7 +1011,7 @@ if [ "$use_defaults" == "n" -o "$use_defaults" == "N" ]; then
10111011
# That is, if keys were NOT generated in memory (on smartcard only) or
10121012
# if keys were generated in memory but are to be moved from local keyring to smartcard
10131013
if [ "$GPG_GEN_KEY_IN_MEMORY" = "n" -o "$GPG_GEN_KEY_IN_MEMORY_COPY_TO_SMARTCARD" = "y" ]; then
1014-
while [[ ${#USER_PIN} -lt 8 ]] || [[ ${#USER_PIN} -gt $MAX_HOTP_GPG_PIN_LENGTH ]]; do
1014+
while [[ ${#USER_PIN} -lt 6 ]] || [[ ${#USER_PIN} -gt $MAX_HOTP_GPG_PIN_LENGTH ]]; do
10151015
echo -e -n "\nThis PIN should be between 8 to $MAX_HOTP_GPG_PIN_LENGTH characters in length.\n"
10161016
echo -e -n "Enter desired GPG User PIN: "
10171017
read USER_PIN

0 commit comments

Comments
 (0)