Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fallback password input if fail from yubikey #92

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion key-script
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@ message()

check_yubikey_present="$(ykinfo -q -"$YUBIKEY_LUKS_SLOT")"

if [ -z "$YUBIKEY_CHALLENGE" ] || [ "$check_yubikey_present" != "1" ] ; then
touch /run/ykluks-fail
TRIED="$(grep ${CRYPTTAB_SOURCE} /run/ykluks-fail | wc -l)"
if [ -z "$YUBIKEY_CHALLENGE" ] || [ "$check_yubikey_present" != "1" ] || [ "$TRIED" -ge 3 ] ; then
if [ -z "$cryptkeyscript" ]; then
if [ -x /bin/plymouth ] && plymouth --ping; then
cryptkeyscript="plymouth ask-for-password --prompt"
Expand All @@ -35,6 +37,7 @@ else
PW="$YUBIKEY_CHALLENGE"
fi


if [ "$check_yubikey_present" = "1" ]; then
message "Accessing yubikey..."
if [ "$HASH" = "1" ]; then
Expand All @@ -48,8 +51,12 @@ if [ "$check_yubikey_present" = "1" ]; then
else
printf '%s' "$R"
fi
echo "$CRYPTTAB_SOURCE tried" >> /run/ykluks-fail
echo "$CRYPTTAB_SOURCE tried" >> /run/ykluks-fail
echo "$CRYPTTAB_SOURCE tried" >> /run/ykluks-fail
else
message "Failed to retrieve the response from the Yubikey"
echo "$CRYPTTAB_SOURCE tried" >> /run/ykluks-fail
fi
else
printf '%s' "$PW"
Expand Down