Rename CONFIG_HOTP_BRANDING to HOTP_BRANDING

reason: it not a config option anymore
This commit is contained in:
alex-nitrokey 2020-06-24 18:12:56 +02:00
parent 2fe946ccbe
commit fecb9cfd80
No known key found for this signature in database
GPG Key ID: A8853020E8EE6FBA
2 changed files with 15 additions and 15 deletions

View File

@ -142,9 +142,9 @@ fi
# Use stored HOTP key branding # Use stored HOTP key branding
if [ -r /boot/kexec_hotp_key ]; then if [ -r /boot/kexec_hotp_key ]; then
CONFIG_HOTPKEY_BRANDING="$(cat /boot/kexec_hotp_key)" HOTPKEY_BRANDING="$(cat /boot/kexec_hotp_key)"
else else
CONFIG_HOTPKEY_BRANDING="HOTP USB Security Dongle" HOTPKEY_BRANDING="HOTP USB Security Dongle"
fi fi
last_half=X last_half=X
@ -200,8 +200,8 @@ while true; do
enable_usb enable_usb
if ! libremkey_hotp_verification info ; then if ! libremkey_hotp_verification info ; then
whiptail $CONFIG_WARNING_BG_COLOR --clear \ whiptail $CONFIG_WARNING_BG_COLOR --clear \
--title "WARNING: Please Insert Your $CONFIG_HOTPKEY_BRANDING" \ --title "WARNING: Please Insert Your $HOTPKEY_BRANDING" \
--msgbox "Your $CONFIG_HOTPKEY_BRANDING was not detected.\n\nPlease insert your $CONFIG_HOTPKEY_BRANDING" 30 90 --msgbox "Your $HOTPKEY_BRANDING was not detected.\n\nPlease insert your $HOTPKEY_BRANDING" 30 90
fi fi
# Don't output HOTP codes to screen, so as to make replay attacks harder # Don't output HOTP codes to screen, so as to make replay attacks harder
libremkey_hotp_verification check $HOTP libremkey_hotp_verification check $HOTP
@ -214,7 +214,7 @@ while true; do
MAIN_MENU_BG_COLOR=$CONFIG_ERROR_BG_COLOR MAIN_MENU_BG_COLOR=$CONFIG_ERROR_BG_COLOR
;; ;;
* ) * )
HOTP="Error checking code, Insert $CONFIG_HOTPKEY_BRANDING and retry" HOTP="Error checking code, Insert $HOTPKEY_BRANDING and retry"
MAIN_MENU_BG_COLOR=$CONFIG_WARNING_BG_COLOR MAIN_MENU_BG_COLOR=$CONFIG_WARNING_BG_COLOR
;; ;;
esac esac

View File

@ -19,9 +19,9 @@ mount_boot()
# Use stored HOTP key branding (this might be useful after OEM reset) # Use stored HOTP key branding (this might be useful after OEM reset)
if [ -r /boot/kexec_hotp_key ]; then if [ -r /boot/kexec_hotp_key ]; then
CONFIG_HOTPKEY_BRANDING="$(cat /boot/kexec_hotp_key)" HOTPKEY_BRANDING="$(cat /boot/kexec_hotp_key)"
else else
CONFIG_HOTPKEY_BRANDING="HOTP USB Security Dongle" HOTPKEY_BRANDING="HOTP USB Security Dongle"
fi fi
tpm nv_readvalue \ tpm nv_readvalue \
@ -58,26 +58,26 @@ counter_value=1
enable_usb enable_usb
if ! libremkey_hotp_verification info ; then if ! libremkey_hotp_verification info ; then
echo "Insert your $CONFIG_HOTPKEY_BRANDING and press Enter to configure it" echo "Insert your $HOTPKEY_BRANDING and press Enter to configure it"
read read
if ! libremkey_hotp_verification info ; then if ! libremkey_hotp_verification info ; then
# don't leak key on failure # don't leak key on failure
shred -n 10 -z -u "$HOTP_SECRET" 2> /dev/null shred -n 10 -z -u "$HOTP_SECRET" 2> /dev/null
die "Unable to find $CONFIG_HOTPKEY_BRANDING" die "Unable to find $HOTPKEY_BRANDING"
fi fi
fi fi
# Set HOTP USB Security Dongle branding based on VID # Set HOTP USB Security Dongle branding based on VID
if [ ! $(lsusb | grep -q "20a0:") ]; then if [ ! $(lsusb | grep -q "20a0:") ]; then
CONFIG_HOTPKEY_BRANDING="Nitrokey" HOTPKEY_BRANDING="Nitrokey"
elif [ ! $(lsusb | grep -q "316d:") ]; then elif [ ! $(lsusb | grep -q "316d:") ]; then
CONFIG_HOTPKEY_BRANDING="Librem Key" HOTPKEY_BRANDING="Librem Key"
else else
CONFIG_HOTPKEY_BRANDING="HOTP USB Security Dongle" HOTPKEY_BRANDING="HOTP USB Security Dongle"
fi fi
echo -e "" echo -e ""
read -s -p "Enter your $CONFIG_HOTPKEY_BRANDING Admin PIN: " admin_pin read -s -p "Enter your $HOTPKEY_BRANDING Admin PIN: " admin_pin
echo -e "\n" echo -e "\n"
libremkey_hotp_initialize "$admin_pin" $HOTP_SECRET $counter_value libremkey_hotp_initialize "$admin_pin" $HOTP_SECRET $counter_value
@ -108,14 +108,14 @@ echo $counter_value > $HOTP_COUNTER \
|| die "Unable to create hotp counter file" || die "Unable to create hotp counter file"
# Store/overwrite HOTP USB Security Dongle branding found out beforehand # Store/overwrite HOTP USB Security Dongle branding found out beforehand
echo $CONFIG_HOTPKEY_BRANDING > $HOTP_KEY \ echo $HOTPKEY_BRANDING > $HOTP_KEY \
|| die "Unable to store hotp key file" || die "Unable to store hotp key file"
#sha256sum /tmp/counter-$counter > $HOTP_COUNTER \ #sha256sum /tmp/counter-$counter > $HOTP_COUNTER \
#|| die "Unable to create hotp counter file" #|| die "Unable to create hotp counter file"
mount -o remount,ro /boot mount -o remount,ro /boot
echo -e "\n$CONFIG_HOTPKEY_BRANDING initialized successfully. Press Enter to continue." echo -e "\n$HOTPKEY_BRANDING initialized successfully. Press Enter to continue."
read read
exit 0 exit 0