From: Marco d'Itri Date: Thu, 27 Jan 2005 18:24:10 +0000 (+0000) Subject: Evaluate gpg's machine-parseable status messages. X-Git-Tag: mutt-1-5-7-rel~34 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=312f37532517ffb543d8971b1e012ddc2bd02663;p=mutt Evaluate gpg's machine-parseable status messages. --- diff --git a/contrib/gpg.rc b/contrib/gpg.rc index 92e58859..3b4bf351 100644 --- a/contrib/gpg.rc +++ b/contrib/gpg.rc @@ -31,13 +31,13 @@ # breaking PGP/MIME. # decode application/pgp -set pgp_decode_command="/usr/bin/gpg --charset utf-8 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" +set pgp_decode_command="/usr/bin/gpg --charset utf-8 --status-fd=2 %?p?--passphrase-fd 0? --no-verbose --quiet --batch --output - %f" # verify a pgp/mime signature -set pgp_verify_command="/usr/bin/gpg --no-verbose --quiet --batch --output - --verify %s %f" +set pgp_verify_command="/usr/bin/gpg --status-fd=2 --no-verbose --quiet --batch --output - --verify %s %f" # decrypt a pgp/mime attachment -set pgp_decrypt_command="/usr/bin/gpg --passphrase-fd 0 --no-verbose --quiet --batch --output - %f" +set pgp_decrypt_command="/usr/bin/gpg --status-fd=2 --passphrase-fd 0 --no-verbose --quiet --batch --output - %f" # create a pgp/mime signed attachment # set pgp_sign_command="/usr/bin/gpg-2comp --comment '' --no-verbose --batch --output - --passphrase-fd 0 --armor --detach-sign --textmode %?a?-u %a? %f" @@ -78,5 +78,8 @@ set pgp_list_secring_command="/usr/bin/gpg --no-verbose --batch --quiet --wi # set pgp_good_sign="^gpg: Good signature from" # OK, here's a version which uses gnupg's message catalog: -set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`" +# set pgp_good_sign="`gettext -d gnupg -s 'Good signature from "' | tr -d '"'`" + +# This version uses --status-fd messages +set pgp_good_sign="^\\[GNUPG:\\] GOODSIG" diff --git a/pgp.c b/pgp.c index e13b4a9d..73ac0740 100644 --- a/pgp.c +++ b/pgp.c @@ -151,6 +151,8 @@ static int pgp_copy_checksig (FILE *fpin, FILE *fpout) dprint (2, (debugfile, "pgp_copy_checksig: \"%s\" doesn't match regexp.\n", line)); + if (strncmp (line, "[GNUPG:] ", 9) == 0) + continue; fputs (line, fpout); fputc ('\n', fpout); }