Replace libremkey_htop_* by hotp_*

This commit is contained in:
alex-nitrokey 2020-06-25 15:35:47 +02:00
parent c2a2134eb2
commit 53dc659c01
No known key found for this signature in database
GPG Key ID: A8853020E8EE6FBA
4 changed files with 13 additions and 13 deletions

View File

@ -92,7 +92,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/hotp_verification ]; then
echo "Once you have scanned the QR code, hit Enter to configure your HOTP USB Security Dongle (e.g. Librem Key or Nitrokey)" 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-hotpkey /bin/seal-hotpkey
@ -195,16 +195,16 @@ while true; do
fi fi
if [ "$totp_confirm" = "i" -o -z "$totp_confirm" ]; then if [ "$totp_confirm" = "i" -o -z "$totp_confirm" ]; then
if [ -x /bin/libremkey_hotp_verification ]; then if [ -x /bin/hotp_verification ]; then
HOTP=`unseal-hotp` HOTP=`unseal-hotp`
enable_usb enable_usb
if ! libremkey_hotp_verification info ; then if ! hotp_verification info ; then
whiptail $CONFIG_WARNING_BG_COLOR --clear \ whiptail $CONFIG_WARNING_BG_COLOR --clear \
--title "WARNING: Please Insert Your $HOTPKEY_BRANDING" \ --title "WARNING: Please Insert Your $HOTPKEY_BRANDING" \
--msgbox "Your $HOTPKEY_BRANDING was not detected.\n\nPlease insert your $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 hotp_verification check $HOTP
case "$?" in case "$?" in
0 ) 0 )
HOTP="Success" HOTP="Success"

View File

@ -86,7 +86,7 @@ luks_pcr=`tpm calcfuturepcr -ix 16 -if /tmp/luksDump.txt`
# HOTP USB Secrity Dongle loads USB modules which changes PCR5. # HOTP USB Secrity Dongle loads USB modules which changes PCR5.
# In the event HOTP USB Security Dongle is enabled, skip verification of PCR5 # In the event HOTP USB Security Dongle is enabled, skip verification of PCR5
if [ -x /bin/libremkey_hotp_verification ]; then if [ -x /bin/hotp_verification ]; then
pcr_5="X" pcr_5="X"
else else
pcr_5="0000000000000000000000000000000000000000" pcr_5="0000000000000000000000000000000000000000"

View File

@ -57,10 +57,10 @@ mount_boot
counter_value=1 counter_value=1
enable_usb enable_usb
if ! libremkey_hotp_verification info ; then if ! hotp_verification info ; then
echo "Insert your $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 ! 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 $HOTPKEY_BRANDING" die "Unable to find $HOTPKEY_BRANDING"
@ -80,12 +80,12 @@ echo -e ""
read -s -p "Enter your $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 hotp_initialize "$admin_pin" $HOTP_SECRET $counter_value $HOTPKEY_BRANDING
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo -e "\n" echo -e "\n"
read -s -p "Error setting HOTP secret, re-enter Admin PIN and try again: " admin_pin read -s -p "Error setting HOTP secret, re-enter Admin PIN and try again: " admin_pin
echo -e "\n" echo -e "\n"
if ! libremkey_hotp_initialize "$admin_pin" $HOTP_SECRET $counter_value ; then if ! hotp_initialize "$admin_pin" $HOTP_SECRET $counter_value $HOTPKEY_BRANDING ; 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 "Setting HOTP secret failed" die "Setting HOTP secret failed"

View File

@ -2,19 +2,19 @@ modules-$(CONFIG_HOTPKEY) += hotp-verification
hotp-verification_depends := libusb $(musl_dep) hotp-verification_depends := libusb $(musl_dep)
hotp-verification_version := 29094d8ff0f1c9321886079860f3747aa04c44b4 hotp-verification_version := 5fb260e631b237a298b6dcca47bbd728f2c5ac3a
hotp-verification_dir := hotp-verification-$(hotp-verification_version) hotp-verification_dir := hotp-verification-$(hotp-verification_version)
hotp-verification_tar := nitrokey-hotp-verification-$(hotp-verification_version).tar.gz hotp-verification_tar := nitrokey-hotp-verification-$(hotp-verification_version).tar.gz
hotp-verification_url := https://github.com/Nitrokey/nitrokey-hotp-verification/archive/$(hotp-verification_version).tar.gz hotp-verification_url := https://github.com/Nitrokey/nitrokey-hotp-verification/archive/$(hotp-verification_version).tar.gz
hotp-verification_hash := b8591a6abafaefd769e7e58d121d4ba6af1c54587b4b7f3438d65b37632fa2b0 hotp-verification_hash := 5d98d158ba97fb970061d68e2c6f41582395e687b7752efb1a8038762b0e7b79
hotp-verification_target := \ hotp-verification_target := \
$(MAKE_JOBS) \ $(MAKE_JOBS) \
$(CROSS_TOOLS) \ $(CROSS_TOOLS) \
hotp-verification_output := \ hotp-verification_output := \
libremkey_hotp_verification \ hotp_verification \
libremkey_hotp_initialize hotp_initialize
hotp-verification_configure := \ hotp-verification_configure := \
INSTALL="$(INSTALL)" \ INSTALL="$(INSTALL)" \