Skip to content

Commit

Permalink
oem-factory-reset: set title_text accordingly to mode, either 'OEM Fa…
Browse files Browse the repository at this point in the history
…ctory Reset Mode', 'Re-Ownership Mode' or 'OEM Factory Reset / Re-Ownership'

TODO: further specialize warning prompt to tell what is going to happen (randomized PIN, signle custom randomized PIN etc)

Signed-off-by: Thierry Laurion <[email protected]>
  • Loading branch information
tlaurion committed Dec 5, 2024
1 parent 91704d0 commit e436260
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions initrd/bin/oem-factory-reset
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,16 @@ handle_mode() {
USER_PIN=$CUSTOM_SINGLE_PASS
ADMIN_PIN=$CUSTOM_SINGLE_PASS
TPM_PASS=$CUSTOM_SINGLE_PASS

title_text="OEM Factory Reset Mode"
;;
user)
DEBUG "User mode selected"
USER_PIN=$(generate_passphrase --number_words 2 --max_length $MAX_HOTP_GPG_PIN_LENGTH)
ADMIN_PIN=$(generate_passphrase --number_words 2 --max_length $MAX_HOTP_GPG_PIN_LENGTH)
TPM_PASS=$ADMIN_PIN

title_text="User Re-Ownership Mode"
;;
*)
warn "Unknown oem-factory-reset lauched mode, setting PINs to weak defaults"
Expand Down Expand Up @@ -911,9 +915,7 @@ usb_security_token_capabilities_check() {
## main script start

# check for args
if [ "$1" != "" ]; then
title_text=$1
else
if [ -z "$title_text" ]; then
title_text="OEM Factory Reset / Re-Ownership"
fi
if [ "$2" != "" ]; then
Expand Down

0 comments on commit e436260

Please sign in to comment.