aboutsummaryrefslogtreecommitdiffstats
path: root/udev
diff options
context:
space:
mode:
Diffstat (limited to 'udev')
-rw-r--r--udev/20-ykfde.rules4
-rwxr-xr-xudev/ykfde9
2 files changed, 13 insertions, 0 deletions
diff --git a/udev/20-ykfde.rules b/udev/20-ykfde.rules
new file mode 100644
index 0000000..54cd1c2
--- /dev/null
+++ b/udev/20-ykfde.rules
@@ -0,0 +1,4 @@
+# do challenge response with Yubikey II and try to answer
+# password agent
+ACTION=="add", ATTRS{idVendor}=="1050", ATTRS{idProduct}=="0010|0110|0111", \
+ RUN+="/usr/lib/udev/ykfde"
diff --git a/udev/ykfde b/udev/ykfde
new file mode 100755
index 0000000..ce83117
--- /dev/null
+++ b/udev/ykfde
@@ -0,0 +1,9 @@
+#!/bin/sh
+
+source /etc/ykfde.conf
+
+# Looks like Yubikey is reset after challenge response, triggering
+# yet another add event. Ignore if the file exists.
+[ -s /crypto_keyfile.bin ] && exit 0
+
+ykchalresp -${YKFDE_SLOT:-2} "$(cat /ykfde-challenge)" > /crypto_keyfile.bin 2>/dev/null