timprove wrapping of key generation - tomb - the crypto undertaker (HTM) git clone git://parazyd.org/tomb.git (DIR) Log (DIR) Files (DIR) Refs (DIR) README (DIR) LICENSE --- (DIR) commit db976a521029c5991d8316f6d0572e5d6e9b482e (DIR) parent e59518befac9d8006c70a99bbaba1b6cee2ea4bc (HTM) Author: Jaromil <jaromil@dyne.org> Date: Mon, 26 Dec 2016 20:19:01 +0100 improve wrapping of key generation gen_key now avoids adding a final newline to file (addressing #226) and provides more debugging information from the gpg process. Diffstat: M tomb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) --- (DIR) diff --git a/tomb b/tomb t@@ -1172,13 +1172,18 @@ gen_key() { print $header - # TODO: check result of gpg operation - cat <<EOF | gpg --openpgp --force-mdc --cipher-algo ${algo} \ - --batch --no-options --no-tty --passphrase-fd 0 --status-fd 2 \ - -o - -c -a -${tombpass} -$TOMBSECRET -EOF + _tmp_create + local tmpres=$TOMBTMP + + print -n - "${tombpass}\n$TOMBSECRET" \ + | gpg --openpgp --force-mdc --cipher-algo ${algo} --batch \ + --no-options --no-tty --passphrase-fd 0 \ + --status-fd 2 -o - -c -a 2> $tmpres + # check result of gpg operation + for i in ${(f)"$(cat $tmpres)"}; do + _verbose "$i" + done + # print -n "${tombpass}" \ # | gpg --openpgp --force-mdc --cipher-algo ${algo} \ # --batch --no-options --no-tty --passphrase-fd 0 --status-fd 2 \