-
Notifications
You must be signed in to change notification settings - Fork 52
Debian/Ubuntu support #88
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
base: master
Are you sure you want to change the base?
Changes from 15 commits
9c6308d
0ef1752
0482ba2
e31f138
a7c8b8d
d4e4bbe
6614340
8cc6938
db3d82d
a7985a3
611e170
44a78be
25c27cd
341d856
76459a9
cd7c08a
393b25d
301f1c1
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| install: reinstall | ||
| install -v -b -Dm644 ../../src/ykfde.conf "$(DESTDIR)/etc/ykfde.conf" | ||
|
|
||
| reinstall: | ||
| install -Dm644 ../../src/archlinux/hooks/ykfde "$(DESTDIR)/usr/lib/initcpio/hooks/ykfde" | ||
| install -Dm644 ../../src/archlinux/install/ykfde "$(DESTDIR)/usr/lib/initcpio/install/ykfde" | ||
| install -Dm755 ../../src/archlinux/ykfde-suspend "$(DESTDIR)/usr/lib/ykfde-suspend/ykfde-suspend" | ||
| install -Dm755 ../../src/archlinux/initramfs-suspend "$(DESTDIR)/usr/lib/ykfde-suspend/initramfs-suspend" | ||
| install -Dm644 ../../src/archlinux/ykfde-suspend.service "$(DESTDIR)/usr/lib/systemd/system/ykfde-suspend.service" | ||
| install -Dm755 ../../src/ykfde-enroll "$(DESTDIR)/usr/bin/ykfde-enroll" | ||
| install -Dm755 ../../src/ykfde-format "$(DESTDIR)/usr/bin/ykfde-format" | ||
| install -Dm755 ../../src/ykfde-open "$(DESTDIR)/usr/bin/ykfde-open" | ||
| install -Dm644 ../../README.md "$(DESTDIR)/usr/share/doc/ykfde/README.md" | ||
| test: | ||
| ../../src/testrun.sh | ||
|
|
||
| all: install |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,27 @@ | ||
| info: | ||
| @echo "builddeb [NO_SIGN=1] - build deb package for Ubuntu LTS [NO_SIGN disables signing]" | ||
| @echo "clean - clean build directory DEBUILD" | ||
|
|
||
| VERSION=0.1 | ||
| SRC_DIR = ykfde-${VERSION} | ||
|
|
||
| debianize: | ||
| rm -fr DEBUILD | ||
| mkdir -p DEBUILD/${SRC_DIR} | ||
| cp -r * DEBUILD/${SRC_DIR} || true | ||
| cp -r ../../src/ykfde* DEBUILD/${SRC_DIR} || true | ||
| cp -r ../../src/debian/* DEBUILD/${SRC_DIR} || true | ||
| cp ../../README.md DEBUILD/${SRC_DIR} || true | ||
| (cd DEBUILD; tar -zcf ykfde_${VERSION}.orig.tar.gz --exclude=${SRC_DIR}/debian ${SRC_DIR}) | ||
|
|
||
| builddeb: | ||
| make debianize | ||
| ifndef NO_SIGN | ||
| (cd DEBUILD/${SRC_DIR}; debuild) | ||
| else | ||
| (cd DEBUILD/${SRC_DIR}; debuild -uc -us) | ||
| endif | ||
|
|
||
| clean: | ||
| rm -fr DEBUILD | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| ykfde (0.1) UNRELEASED; urgency=medium | ||
|
|
||
| * Added Debian/Ubuntu support | ||
|
|
||
| -- crispy-landslide <[email protected]> Tue, 11 Jan 2022 21:28:25 -0800 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 11 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| Source: ykfde | ||
| Section: admin | ||
| Priority: optional | ||
| Maintainer: Andrei Gherzan <https://github.com/agherzan> | ||
| Build-Depends: debhelper (>= 11), dh-exec | ||
| Standards-Version: 4.1.4 | ||
| Homepage: https://github.com/agherzan/yubikey-full-disk-encryption | ||
|
|
||
| Package: ykfde | ||
| Architecture: all | ||
| Depends: cryptsetup, initramfs-tools, yubikey-personalization (>= 1.5), udisks2, expect, ${misc:Depends} | ||
| Description: This project leverages a YubiKey HMAC-SHA1 Challenge-Response | ||
| mode for creating strong LUKS encrypted volume passphrases. | ||
| It can be used in intramfs stage during boot process as well as on running system. | ||
| . | ||
| Requires Yubikey 4 or newer. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| Copyright 2017 Andrei Gherzan | ||
|
|
||
| Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at | ||
|
|
||
| http://www.apache.org/licenses/LICENSE-2.0 | ||
|
|
||
| Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| #! /usr/bin/make -f | ||
|
|
||
| %: | ||
| dh $@ | ||
|
|
||
| override_dh_auto_build: | ||
| # nothing to build | ||
|
|
||
| override_dh_install: | ||
| dh_install | ||
| install -D -o root -g root -m755 hooks/ykfde debian/ykfde/usr/share/initramfs-tools/hooks/ykfde | ||
| install -D -o root -g root -m755 key-script debian/ykfde/usr/share/ykfde/ykfde-keyscript | ||
| install -D -o root -g root -m755 ykfde-open debian/ykfde/usr/bin/ykfde-open | ||
| install -D -o root -g root -m755 ykfde-enroll debian/ykfde/usr/bin/ykfde-enroll | ||
| install -D -o root -g root -m755 ykfde-format debian/ykfde/usr/bin/ykfde-format | ||
| install -D -o root -g root -m644 README.md debian/ykfde/usr/share/doc/ykfde/README.md | ||
| install -D -o root -g root -m644 ykfde.conf debian/ykfde/etc/ykfde.conf |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| #! /bin/sh | ||
|
|
||
| set -e | ||
|
|
||
| case "$1" in | ||
| configure) | ||
| if [ -x /usr/sbin/update-initramfs ]; then | ||
| echo | ||
| update-initramfs -u | ||
| fi | ||
| ;; | ||
| abort-upgrade|abort-remove|abort-deconfigure) | ||
|
|
||
| ;; | ||
|
|
||
| *) | ||
| echo "postinst called with unknown argument \`$1'" >&2 | ||
| exit 1 | ||
| ;; | ||
| esac | ||
|
|
||
| #DEBHELPER# |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,28 @@ | ||
| #!/bin/sh | ||
|
|
||
| set -e | ||
|
|
||
| PREREQ="cryptroot" | ||
|
|
||
| prereqs() | ||
| { | ||
| echo "$PREREQ" | ||
| } | ||
|
|
||
| case $1 in | ||
| prereqs) | ||
| prereqs | ||
| exit 0 | ||
| ;; | ||
| esac | ||
|
|
||
| . /usr/share/initramfs-tools/hook-functions | ||
| . /etc/ykfde.conf | ||
|
|
||
| copy_exec /usr/bin/ykchalresp | ||
| copy_exec /usr/bin/ykinfo | ||
| copy_exec /usr/bin/sha256sum | ||
| cp /usr/share/ykfde/ykfde-keyscript "${DESTDIR}/sbin/ykfde-keyscript" | ||
| cp /etc/ykfde.conf "${DESTDIR}/etc/ykfde.conf" | ||
|
|
||
| exit 0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,70 @@ | ||
| #! /bin/sh | ||
|
||
| # | ||
| # This is /sbin/ykfde-keyscript, which gets called when unlocking the disk | ||
| # | ||
| # set defualt values: | ||
| DBG="" | ||
| YKFDE_CONFIG_FILE="/etc/ykfde.conf" | ||
| YKFDE_NFC="" | ||
| YKFDE_DISK_UUID="" | ||
| YKFDE_LUKS_NAME="" | ||
| YKFDE_LUKS_DEV="" | ||
| YKFDE_LUKS_OPTIONS="" | ||
| YKFDE_CHALLENGE_YUBIKEY_INSERT_TIMEOUT="30" | ||
| YKFDE_CRYPTSETUP_TRIALS="5" | ||
| YKFDE_CHALLENGE_SLOT="2" | ||
| YKFDE_CHALLENGE="" | ||
| YKFDE_CHALLENGE_PASSWORD_NEEDED="" | ||
| YKFDE_SLEEP_AFTER_SUCCESSFUL_CRYPTSETUP="" | ||
| YKFDE_USE_PLYMOUTH="" | ||
|
|
||
| . /etc/ykfde.conf | ||
|
|
||
| if [ -z "$WELCOME_TEXT" ]; then | ||
| WELCOME_TEXT="Please insert yubikey and press enter or enter a valid passphrase" | ||
| fi | ||
|
|
||
| message() | ||
| { | ||
| if [ -x /bin/plymouth ] && plymouth --ping; then | ||
| plymouth message --text="$*" | ||
| else | ||
| echo "$@" >&2 | ||
| fi | ||
| return 0 | ||
| } | ||
|
|
||
| check_yubikey_present="$(ykinfo -q -"$YKFDE_CHALLENGE_SLOT")" | ||
|
|
||
| if [ -z "$YKFDE_CHALLENGE" ] || [ "$check_yubikey_present" != "1" ] ; then | ||
| if [ -z "$cryptkeyscript" ]; then | ||
| if [ -x /bin/plymouth ] && plymouth --ping; then | ||
| cryptkeyscript="plymouth ask-for-password --prompt" | ||
| else | ||
| cryptkeyscript="/lib/cryptsetup/askpass" | ||
| fi | ||
| fi | ||
| PW="$($cryptkeyscript "$WELCOME_TEXT")" | ||
| else | ||
| PW="$YKFDE_CHALLENGE" | ||
| fi | ||
|
|
||
| if [ "$check_yubikey_present" = "1" ]; then | ||
| message "Accessing yubikey..." | ||
| PW=$(printf %s "$PW" | sha256sum | awk '{print $1}') | ||
| R="$(printf %s "$PW" | ykchalresp -"$YKFDE_CHALLENGE_SLOT" -i- 2>/dev/null || true)" | ||
| if [ "$R" ]; then | ||
| message "Retrieved the response from the Yubikey" | ||
| if [ "$YKFDE_CHALLENGE_PASSWORD_NEEDED" = "1" ]; then | ||
| printf '%s' "$PW$R" | ||
| else | ||
| printf '%s' "$R" | ||
| fi | ||
| else | ||
| message "Failed to retrieve the response from the Yubikey" | ||
| fi | ||
| else | ||
| printf '%s' "$PW" | ||
| fi | ||
|
|
||
| exit 0 | ||
Uh oh!
There was an error while loading. Please reload this page.