diff --git a/initrd/bin/oem-factory-reset b/initrd/bin/oem-factory-reset index a84e6a8c..79f19267 100755 --- a/initrd/bin/oem-factory-reset +++ b/initrd/bin/oem-factory-reset @@ -89,6 +89,7 @@ gpg_key_reset() whiptail_error_die "GPG Key automatic keygen failed!\n\n$ERROR" fi } + gpg_key_change_pin() { # 1 = user PIN, 3 = admin PIN @@ -271,15 +272,33 @@ echo if [ "$prompt_output" == "y" \ -o "$prompt_output" == "Y" ] \ ; then - echo -e "\nPlease enter the following information...\n" - echo - echo -e -n "Real name: " - read GPG_USER_NAME - echo -e -n "Email address: " - read GPG_USER_MAIL - echo -e -n "Comment: " - read GPG_USER_COMMENT - echo + echo -e "\n\n" + echo -e "We will generate a GnuPG (PGP) keypair identifiable with the following text form:" + echo -e "Real Name (Comment) email@address.org" + + echo -e "\nEnter your Real Name (At least 5 characters long):" + read -r GPG_USER_NAME + while [[ ${#GPG_USER_NAME} -lt 5 ]]; do + { + echo -e "\nEnter your Real Name (At least 5 characters long):" + read -r GPG_USER_NAME + };done + + echo -e "\nEnter your email@adress.org:" + read -r GPG_USER_MAIL + while ! $(expr "$GPG_USER_MAIL" : '.*@' >/dev/null); do + { + echo -e "\nEnter your email@address.org:" + read -r GPG_USER_MAIL + };done + + echo -e "\nEnter Comment (Optional, to distinguish this key from others with same previous attributes. Must be smaller then 60 characters):" + read -r GPG_USER_MAIL + while [[ ${#gpgcard_comment} -gt 60 ]]; do + { + echo -e "\nEnter Comment (Optional, to distinguish this key from others with same previous attributes. Must be smaller then 60 characters):" + read -r GPG_USER_MAIL + };done fi ## sanity check the USB, GPG key, and boot device before proceeding further