]> granicus.if.org Git - mutt/commitdiff
Evaluate gpg's machine-parseable status messages.
authorMarco d'Itri <md@Linux.IT>
Thu, 27 Jan 2005 18:24:10 +0000 (18:24 +0000)
committerMarco d'Itri <md@Linux.IT>
Thu, 27 Jan 2005 18:24:10 +0000 (18:24 +0000)
contrib/gpg.rc
pgp.c

index 92e58859ef77b602bdb90c41f7cd5b4016467f66..3b4bf3510b68e93a7c1acc4438b732c9521b0113 100644 (file)
 # 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 e13b4a9d62d97ff03a496dab5548c15c485b800f..73ac07408d4f2f5029301cb16fbfc6c38344c441 100644 (file)
--- 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);
     }