summarylogtreecommitdiffstats
diff options
context:
space:
mode:
authorCorey Hinshaw2017-03-12 20:05:47 -0400
committerCorey Hinshaw2017-03-12 20:05:47 -0400
commitaf89448291a72309a92217fce221417589aae146 (patch)
tree76fa8153eb0f5b7f244f1af1e9adcf6a0ed06e7b
parent13e93ce1baef3a12a6cea6451d68c15796d09c2e (diff)
downloadaur-af89448291a72309a92217fce221417589aae146.tar.gz
Clean up a few conditionals
-rw-r--r--.SRCINFO4
-rw-r--r--PKGBUILD4
-rwxr-xr-xluks-tpm7
3 files changed, 6 insertions, 9 deletions
diff --git a/.SRCINFO b/.SRCINFO
index 267ddb85232a..c25b9489c3dd 100644
--- a/.SRCINFO
+++ b/.SRCINFO
@@ -1,6 +1,6 @@
pkgbase = luks-tpm
pkgdesc = Utility to manage LUKS keyfiles sealed by the TPM
- pkgver = 0.1.0
+ pkgver = 0.1.1
pkgrel = 1
url = https://github.com/electrickite/luks-tpm
arch = any
@@ -11,7 +11,7 @@ pkgbase = luks-tpm
depends = coreutils
depends = util-linux
source = luks-tpm
- sha256sums = 97c7b2a7f45674e96ec25bd69f48bda7749c59bbf6744608d561f84410634198
+ sha256sums = 4d360ae7ec695ff3c8bf720971173c89a13625bbb34fa46e1ada85dee2bb1fb2
pkgname = luks-tpm
diff --git a/PKGBUILD b/PKGBUILD
index 5086f28928c0..d408491b8d9e 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: Corey Hinshaw <coreyhinshaw@gmail.com>
pkgname=luks-tpm
-pkgver=0.1.0
+pkgver=0.1.1
pkgrel=1
pkgdesc="Utility to manage LUKS keyfiles sealed by the TPM"
arch=('any')
@@ -10,7 +10,7 @@ license=('GPL')
depends=('tpm-tools' 'trousers' 'cryptsetup' 'coreutils' 'util-linux')
source=('luks-tpm')
-sha256sums=('97c7b2a7f45674e96ec25bd69f48bda7749c59bbf6744608d561f84410634198')
+sha256sums=('4d360ae7ec695ff3c8bf720971173c89a13625bbb34fa46e1ada85dee2bb1fb2')
package() {
install -Dm755 luks-tpm "${pkgdir}/usr/bin/luks-tpm"
diff --git a/luks-tpm b/luks-tpm
index fac80d80e9e3..add89fb7ecd5 100755
--- a/luks-tpm
+++ b/luks-tpm
@@ -46,9 +46,7 @@ add_temp_key() {
tpm_unsealdata -i "$SEALED_KEYFILE" -o "$KEYFILE" $WELL_KNOWN
echo "Preparing to set a temporary LUKS passphrase..."
- cryptsetup luksAddKey --key-slot $RESET_KEY_SLOT --key-file "$KEYFILE" $ROOT_DEVICE < /dev/tty
-
- if [ $? -eq 0 ]; then
+ if cryptsetup luksAddKey --key-slot $RESET_KEY_SLOT --key-file "$KEYFILE" $ROOT_DEVICE < /dev/tty; then
echo "After booting into the current kernel, run"
echo " luks-tpm $(echo $ORIGINAL_ARGS | sed 's/temp$/reset/')"
echo "to generate a new TPM keyfile and remove this temporary key"
@@ -96,8 +94,7 @@ reset_tpm_key() {
create_tmpfs() {
mkdir -p "$TMPFS_MOUNT"
- mount tmpfs "$TMPFS_MOUNT" -t tmpfs -o size=1m
- if [ $? -ne 0 ]; then
+ if ! mount tmpfs "$TMPFS_MOUNT" -t tmpfs -o size=1m; then
echo "Could not create tmpfs. Aborting..." >&2
exit 3
fi