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

Test for valid LUKS device #75

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

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
5 changes: 5 additions & 0 deletions yubikey-luks-enroll
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ while getopts ":s:d:y:hcv" opt; do
esac
done

if ! cryptsetup isLuks "$DISK"; then
echo "Device is not a valid LUKS partition, bailing." >&2
exit 1
fi

echo "This script will utilize the YubiKey slot $YUBIKEY_LUKS_SLOT for slot $SLOT on drive $DISK. If this is not what you intended, exit now!"

if [ "$CLEAR_SLOT" = "1" ]; then
Expand Down
5 changes: 5 additions & 0 deletions yubikey-luks-open
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,11 @@ while getopts ":d:n:hv" opt; do
esac
done

if ! cryptsetup isLuks "$DISK"; then
echo "Device is not a valid LUKS partition, bailing." >&2
exit 1
fi

echo "This script will try opening $NAME LUKS container on drive $DISK . If this is not what you intended, exit now!"

while true ; do
Expand Down