tMerge branch 'gpgfix' for gnupg result parsing and stdin keys - tomb - the crypto undertaker HTML git clone git://parazyd.org/tomb.git DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit f43ab33872805f7828e61300f2419b8849aaf34b DIR parent 772b731e5fde5eae5567d26b4d3930bc242c2f8a HTML Author: Jaromil <jaromil@dyne.org> Date: Tue, 11 Jun 2013 15:57:20 +0000 Merge branch 'gpgfix' for gnupg result parsing and stdin keys Diffstat: M tomb | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) --- DIR diff --git a/tomb b/tomb t@@ -614,15 +614,31 @@ get_lukskey() { ;; esac fi + + # fix for gpg 1.4.11 where the --status-* options don't work ;^/ + gpgver=`gpg --version | awk '/^gpg/ {print $3}'` + if [ "$gpgver" = "1.4.11" ]; then + xxx "GnuPG is version 1.4.11 - adopting status fix" + + print ${tombpass} | \ + gpg --batch --passphrase-fd 0 --no-tty --no-options -d "${keyfile}" + unset tombpass + ret=$? + + else # using status-file in gpg != 1.4.12 + res=`safe_filename tomb.open` - (( $? )) && { unset tombpass; die "error creating temp dir" } + { test $? = 0 } || { unset tombpass; die "Fatal error creating temp file." } print ${tombpass} | \ gpg --batch --passphrase-fd 0 --no-tty --no-options --status-fd 2 \ + --no-mdc-warning --no-permission-warning --no-secmem-warning \ -d "${keyfile}" 2>$res unset tombpass grep 'DECRYPTION_OKAY' $res ret=$?; rm -f $res + + fi xxx "get_lukskey returns $ret" return $ret }