Skip to content

Commit

Permalink
added option to clear the slot or not clear slot
Browse files Browse the repository at this point in the history
  • Loading branch information
cornelinux committed Jul 22, 2014
1 parent e8fdcf5 commit d0563f5
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ info:
@echo "ppa-dev - upload to ppa launchpad. Development"
@echo "ppa - upload to ppa launchpad. Stable"

VERSION=0.3.2
VERSION=0.3.3
SRC_DIR = yubikey_luks.orig

debianize:
Expand Down
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
yubikey-luks (0.3.3-1) trusty; uegency=low

* added option, to clear the slot, so that an empty slot will also work

-- Cornelius Kölbel <cornelius.koelbel@netknights.it> Tue, 22 Jul 2014 21:46:00 +0200


yubikey-luks (0.3.2-1) trusty; uegency=low

* added parameters for slot and partition.
Expand Down
18 changes: 12 additions & 6 deletions yubiky-luks-enroll
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/bin/sh
SLOT=7
DISK="/dev/sda3"
CLEAR_SLOT=0
TMP_FILE=/tmp/new_key
set -e



while getopts ":s:d:h" opt; do
while getopts ":s:d:hc" opt; do
case $opt in
s)
SLOT=$OPTARG
Expand All @@ -16,10 +17,14 @@ while getopts ":s:d:h" opt; do
DISK=$OPTARG
echo "setting disk to $OPTARG."
;;
c) CLEAR_SLOT=1
echo "clearing slot"
;;
h)
echo
echo " -d : set the partition"
echo " -s : set the slot"
echo " -d <partition>: set the partition"
echo " -s <slot> : set the slot"
echo " -c : clear the slot prior to writing"
echo
exit 1
;;
Expand All @@ -29,9 +34,10 @@ while getopts ":s:d:h" opt; do
esac
done


echo "Killing LUKS slot $SLOT"
cryptsetup luksKillSlot $DISK $SLOT
if [ $CLEAR_SLOT -eq 1 ]; then
echo "Killing LUKS slot $SLOT"
cryptsetup luksKillSlot $DISK $SLOT
fi
echo "Adding yubikey to initrd"
P1=$(/lib/cryptsetup/askpass "Please insert a yubikey and enter a new password:")
P2=$(/lib/cryptsetup/askpass "again:")
Expand Down

0 comments on commit d0563f5

Please sign in to comment.