patches from the debian package
080_Md.gpg_import_nonverbose
trivial: the gpg command line has both -v and --no-verbose
patch-1.5.3.Md.gpg_status_fd
run gpg with --status-fd. This removes the ugly gettext call to get the
translated message to be checked. Used since dec 2001.
patch-1.5.4.ametzler.pgp_good_sign
Fixes the bug explained in the comment, see debian bug #110414 for
details. Used since nov 2001.
patch-1.5.4.hsteoh.pgpewrap
trivial: fix a segfault when pgpewrap is manually run by a user.
And then there is the GNUTLS patch, which has been used by the package
for two years and I believe is definitely production-quality.
--
ciao, |
Marco | [2330 imH4Lxljcguho]
diff -ruN mutt.orig/contrib/gpg.rc mutt/contrib/gpg.rc
--- mutt.orig/contrib/gpg.rc 2003-08-17 15:23:59.000000000 +0200
+++ mutt/contrib/gpg.rc 2003-08-17 15:23:48.000000000 +0200
@@ -56,7 +56,7 @@
set pgp_encrypt_sign_command="pgpewrap /usr/bin/gpg --charset utf-8
--passphrase-fd 0 --batch --quiet --no-verbose --textmode --output -
--encrypt --sign %?a?-u %a? --armor --always-trust -- -r %r -- %f"
# import a key into the public key ring
-set pgp_import_command="/usr/bin/gpg --no-verbose --import -v %f"
+set pgp_import_command="/usr/bin/gpg --no-verbose --import %f"
# export a key from the public key ring
set pgp_export_command="/usr/bin/gpg --no-verbose --export --armor %r"
diff -urN mutt-1.5.3.orig/PATCHES mutt-1.5.3/PATCHES
--- mutt-1.5.3.orig/PATCHES 2002-12-17 10:47:20.000000000 +0100
+++ mutt-1.5.3/PATCHES 2002-12-30 04:16:53.000000000 +0100
@@ -1,0 +1 @@
+patch-1.5.3.Md.gpg_status_fd
diff -urN mutt-1.5.3.orig/contrib/gpg.rc mutt-1.5.3/contrib/gpg.rc
--- mutt-1.5.3.orig/contrib/gpg.rc 2002-03-26 23:23:58.000000000 +0100
+++ mutt-1.5.3/contrib/gpg.rc 2002-12-30 04:16:22.000000000 +0100
@@ -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_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 -urN mutt-1.5.3.orig/pgp.c mutt-1.5.3/pgp.c
--- mutt-1.5.3.orig/pgp.c 2002-12-16 16:27:26.000000000 +0100
+++ mutt-1.5.3/pgp.c 2002-12-30 04:14:21.000000000 +0100
@@ -120,6 +120,8 @@
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);
}
diff -urNp mutt-1.5.4.orig/PATCHES mutt-1.5.4/PATCHES
--- mutt-1.5.4.orig/PATCHES 2002-12-09 18:44:54.000000000 +0100
+++ mutt-1.5.4/PATCHES 2003-02-14 16:42:20.000000000 +0100
@@ -1,0 +1 @@
+patch-1.3.23.1.ametzler.pgp_good_sign
diff -urNp mutt-1.5.4.orig/pgp.c mutt-1.5.4/pgp.c
--- mutt-1.5.4.orig/pgp.c 2003-02-13 10:50:00.000000000 +0100
+++ mutt-1.5.4/pgp.c 2003-02-14 16:45:01.000000000 +0100
@@ -331,7 +331,13 @@ void pgp_application_pgp_handler (BODY *
if (s->flags & M_DISPLAY)
{
if (rc == 0) have_any_sigs = 1;
- if (rc || rv) maybe_goodsig = 0;
+/*
+ * Sig is bad if
+ * gpg_good_sign-pattern did not match || pgp_decode_command returned not 0
+ * Sig _is_ correct if
+ * gpg_good_sign="" && pgp_decode_command returned 0
+ */
+ if (rc == -1 || rv) maybe_goodsig = 0;
state_putc ('\n', s);
state_attach_puts (_("[-- End of PGP output --]\n\n"), s);
--- mutt-1.4.orig/pgpewrap.c.ORIG 2003-01-14 15:31:05.000000000 -0500
+++ mutt-1.4/pgpewrap.c 2003-01-14 15:33:28.000000000 -0500
@@ -10,10 +10,19 @@
#include <unistd.h>
#include <string.h>
+void print_usage(const char *progname) {
+ fprintf(stderr, "Command line usage: %s [flags] -- prefix
[recipients]\n", progname);
+ exit(1);
+}
+
int main(int argc, char **argv) {
char **opts, **opt, *pfx;
int i;
+ if (argc <= 1) {
+ print_usage(argv[0]);
+ }
+
opts = malloc((2 * argc + 1) * sizeof (* opts)); /*
__MEM_CHECKED__ */
if(!opts) {
perror(argv[0]);
@@ -28,8 +37,7 @@
if(!strcmp(argv[i], "--")) {
i += 2;
if(i > argc) {
- fprintf(stderr, "Command line usage: %s [flags]
-- prefix [recipients]\n", argv[0]);
- return 1;
+ print_usage(argv[0]);
}
pfx = argv[i-1];
}