From 12c05e146ca3acbf7777293ff7eb52cd36cce1c3 Mon Sep 17 00:00:00 2001 From: Dominik Polakovics Date: Wed, 22 Nov 2023 17:50:59 +0100 Subject: [PATCH] fix ykfde_enroll --- utils/pkgs/ykfde/scripts/ykfde_enroll | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/utils/pkgs/ykfde/scripts/ykfde_enroll b/utils/pkgs/ykfde/scripts/ykfde_enroll index 26a00ff..7072c31 100755 --- a/utils/pkgs/ykfde/scripts/ykfde_enroll +++ b/utils/pkgs/ykfde/scripts/ykfde_enroll @@ -20,11 +20,14 @@ YKFDE_STORAGE=/boot/crypt-storage/default YKFDE_SLOT_CHECK="$(ykinfo -q -"$YKFDE_SLOT")" printf '%s\n' " > YubiKey slot status 'ykinfo -q -$YKFDE_SLOT': $YKFDE_SLOT_CHECK" -if [ "$YKFDE_SLOT_CHECK" != 1 ]; then - printf '%s\n' "ERROR: Chosen YubiKey slot '$YKFDE_SLOT' isn't configured. Please choose slot configured for 'HMAC-SHA1 Challenge-Response' mode in '/etc/ykfde.conf'" - exit 1 +if [ "$(ykinfo -q -"$YKFDE_SLOT")" != 1 ]; then + printf '%s\n' "ERROR: Chosen YubiKey slot '$YKFDE_SLOT' isn't configured. Please insert a YubiKey with the slot configured for 'HMAC-SHA1 Challenge-Response'." fi +while [ "$(ykinfo -q -"$YKFDE_SLOT")" != 1 ] +do +done + YKFDE_SALT="$(dd if=/dev/random bs=1 count=$YKFDE_SALT_LENGTH 2>/dev/null | rbtohex)" if [ -f "$YKFDE_STORAGE" ]; then YKFDE_SALT="$(head -1 $YKFDE_STORAGE)"