mirror of
https://github.com/linuxboot/heads.git
synced 2025-02-06 11:10:46 +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
|
# Unless otherwise specified, we are building for heads
|
||||||
CONFIG_HEADS ?= y
|
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
|
# Some things want usernames, we use the current checkout
|
||||||
# so that they are reproducible
|
# so that they are reproducible
|
||||||
GIT_HASH := $(shell git rev-parse HEAD)
|
GIT_HASH := $(shell git rev-parse HEAD)
|
||||||
|
@ -3,6 +3,12 @@
|
|||||||
|
|
||||||
CONFIG_BOOT_GUI_MENU_NAME='Heads Boot Menu'
|
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
|
. /etc/functions
|
||||||
. /tmp/config
|
. /tmp/config
|
||||||
|
|
||||||
@ -93,7 +99,7 @@ update_totp()
|
|||||||
echo "Scan the QR code to add the new TOTP secret"
|
echo "Scan the QR code to add the new TOTP secret"
|
||||||
/bin/seal-totp
|
/bin/seal-totp
|
||||||
if [ -x /bin/libremkey_hotp_verification ]; then
|
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
|
read
|
||||||
/bin/seal-libremkey
|
/bin/seal-libremkey
|
||||||
else
|
else
|
||||||
|
@ -6,6 +6,10 @@
|
|||||||
HOTP_SEALED="/tmp/secret/hotp.sealed"
|
HOTP_SEALED="/tmp/secret/hotp.sealed"
|
||||||
HOTP_SECRET="/tmp/secret/hotp.key"
|
HOTP_SECRET="/tmp/secret/hotp.key"
|
||||||
HOTP_COUNTER="/boot/kexec_hotp_counter"
|
HOTP_COUNTER="/boot/kexec_hotp_counter"
|
||||||
|
HOTP_KEY="/boot/kexec_hotp_key"
|
||||||
|
|
||||||
|
CONFIG_HOTPKEY_BRANDING="HOTP USB security dongle"
|
||||||
|
|
||||||
|
|
||||||
mount_boot()
|
mount_boot()
|
||||||
{
|
{
|
||||||
@ -59,6 +63,8 @@ if ! libremkey_hotp_verification info ; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# TODO find out branding now and set variable
|
||||||
|
|
||||||
echo -e ""
|
echo -e ""
|
||||||
read -s -p "Enter your $(CONFIG_HOTPKEY_BRANDING) Admin PIN: " admin_pin
|
read -s -p "Enter your $(CONFIG_HOTPKEY_BRANDING) Admin PIN: " admin_pin
|
||||||
echo -e "\n"
|
echo -e "\n"
|
||||||
@ -75,6 +81,8 @@ if [ $? -ne 0 ]; then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# TODO store key branding in HOTP_KEY
|
||||||
|
|
||||||
# HOTP key no longer needed
|
# HOTP key no longer needed
|
||||||
shred -n 10 -z -u "$HOTP_SECRET" 2> /dev/null
|
shred -n 10 -z -u "$HOTP_SECRET" 2> /dev/null
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user