mirror of
https://github.com/linuxboot/heads.git
synced 2025-01-18 02:39:59 +00:00
Prepare usage of /boot/kexec_hotp_key as branding
This commit is contained in:
parent
28735a8c84
commit
53b67d27a4
3
Makefile
3
Makefile
@ -48,9 +48,6 @@ include $(CONFIG)
|
||||
# Unless otherwise specified, we are building for heads
|
||||
CONFIG_HEADS ?= y
|
||||
|
||||
# HOTP USB Security naming if not specified in boards config
|
||||
CONFIG_HOTPKEY_BRANDING ?= "HOTP USB Security dongle"
|
||||
|
||||
# Some things want usernames, we use the current checkout
|
||||
# so that they are reproducible
|
||||
GIT_HASH := $(shell git rev-parse HEAD)
|
||||
|
@ -3,6 +3,12 @@
|
||||
|
||||
CONFIG_BOOT_GUI_MENU_NAME='Heads Boot Menu'
|
||||
|
||||
if [ -r /boot/kexec_hotp_key ]; then
|
||||
CONFIG_HOTPKEY_BRANDING="$(cat /boot/kexec_hotp_key)"
|
||||
else
|
||||
CONFIG_HOTPKEY_BRANDING="HOTP USB security dongle"
|
||||
fi
|
||||
|
||||
. /etc/functions
|
||||
. /tmp/config
|
||||
|
||||
@ -93,7 +99,7 @@ update_totp()
|
||||
echo "Scan the QR code to add the new TOTP secret"
|
||||
/bin/seal-totp
|
||||
if [ -x /bin/libremkey_hotp_verification ]; then
|
||||
echo "Once you have scanned the QR code, hit Enter to configure your $(CONFIG_HOTPKEY_BRANDING)"
|
||||
echo "Once you have scanned the QR code, hit Enter to configure your HOTP USB security dongle (e.g. Librem Key or Nitrokey)"
|
||||
read
|
||||
/bin/seal-libremkey
|
||||
else
|
||||
|
@ -6,6 +6,10 @@
|
||||
HOTP_SEALED="/tmp/secret/hotp.sealed"
|
||||
HOTP_SECRET="/tmp/secret/hotp.key"
|
||||
HOTP_COUNTER="/boot/kexec_hotp_counter"
|
||||
HOTP_KEY="/boot/kexec_hotp_key"
|
||||
|
||||
CONFIG_HOTPKEY_BRANDING="HOTP USB security dongle"
|
||||
|
||||
|
||||
mount_boot()
|
||||
{
|
||||
@ -59,6 +63,8 @@ if ! libremkey_hotp_verification info ; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# TODO find out branding now and set variable
|
||||
|
||||
echo -e ""
|
||||
read -s -p "Enter your $(CONFIG_HOTPKEY_BRANDING) Admin PIN: " admin_pin
|
||||
echo -e "\n"
|
||||
@ -75,6 +81,8 @@ if [ $? -ne 0 ]; then
|
||||
fi
|
||||
fi
|
||||
|
||||
# TODO store key branding in HOTP_KEY
|
||||
|
||||
# HOTP key no longer needed
|
||||
shred -n 10 -z -u "$HOTP_SECRET" 2> /dev/null
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user