[106959] trunk/dports/mail/mutt-devel

snc at macports.org snc at macports.org
Wed Jun 12 10:46:35 PDT 2013


Revision: 106959
          https://trac.macports.org/changeset/106959
Author:   snc at macports.org
Date:     2013-06-12 10:46:35 -0700 (Wed, 12 Jun 2013)
Log Message:
-----------
mutt-devel: patch to better handle S/MIME, #39362, maintainer timeout

Modified Paths:
--------------
    trunk/dports/mail/mutt-devel/Portfile

Added Paths:
-----------
    trunk/dports/mail/mutt-devel/files/patch-1.5.20.crypt.c.diff
    trunk/dports/mail/mutt-devel/files/patch-smime_keys.diff
    trunk/dports/mail/mutt-devel/files/patch-thunderbird-fix.diff

Modified: trunk/dports/mail/mutt-devel/Portfile
===================================================================
--- trunk/dports/mail/mutt-devel/Portfile	2013-06-12 17:39:36 UTC (rev 106958)
+++ trunk/dports/mail/mutt-devel/Portfile	2013-06-12 17:46:35 UTC (rev 106959)
@@ -5,7 +5,7 @@
 
 name                mutt-devel
 version             1.5.21 
-revision            3
+revision            4
 categories          mail
 platforms           darwin
 license             GPL-2
@@ -38,6 +38,13 @@
 patchfiles          1a4c43138685.diff
 # fix build with automake 1.12 and 1.13
 patchfiles-append   patch-automake.diff
+# Fix handling of smime
+# http://dev.mutt.org/trac/ticket/3639
+patchfiles-append   patch-1.5.20.crypt.c.diff
+# Fix for handling emails from bad clients w.r.t smime
+patchfiles-append   patch-thunderbird-fix.diff
+# Fix smime_keys
+patchfiles-append   patch-smime_keys.diff
 
 configure.args      --disable-warnings \
                     --mandir=${prefix}/share/man \

Added: trunk/dports/mail/mutt-devel/files/patch-1.5.20.crypt.c.diff
===================================================================
--- trunk/dports/mail/mutt-devel/files/patch-1.5.20.crypt.c.diff	                        (rev 0)
+++ trunk/dports/mail/mutt-devel/files/patch-1.5.20.crypt.c.diff	2013-06-12 17:46:35 UTC (rev 106959)
@@ -0,0 +1,41 @@
+--- mutt-1.5.20/crypt.c	Sat Feb 23 03:12:43 2013 +0000
++++ mutt-1.5.20/crypt.c	Mon Mar 04 16:43:09 2013 -0800
+@@ -766,6 +766,29 @@
+ 
+ 
+ /*
++ * This routine addresses inconsistencies in the protocol of
++ * "multipart/signed" messages and the Content-Type of their 
++ * parts.
++ */
++
++int mutt_xless_strcasecmp(const char *a, const char *b)
++{
++  const char* aPrime;
++  const char* bPrime;
++  if (strcasestr(NONULL(a), "x-") == a)
++    aPrime = a + 2;
++  else
++    aPrime = a;
++  if (strcasestr(NONULL(b), "x-") == b)
++    bPrime = b + 2;
++  else
++    bPrime = b;
++
++  return strcasecmp(NONULL(aPrime), NONULL(bPrime));
++}
++
++
++/*
+  * This routine verifies a  "multipart/signed"  body.
+  */
+ 
+@@ -808,7 +831,7 @@
+   /* consistency check */
+ 
+   if (!(a && a->next && a->next->type == protocol_major && 
+-      !mutt_strcasecmp (a->next->subtype, protocol_minor)))
++      !mutt_xless_strcasecmp (a->next->subtype, protocol_minor)))
+   {
+     state_attach_puts (_("[-- Error: "
+                          "Inconsistent multipart/signed structure! --]\n\n"),

Added: trunk/dports/mail/mutt-devel/files/patch-smime_keys.diff
===================================================================
--- trunk/dports/mail/mutt-devel/files/patch-smime_keys.diff	                        (rev 0)
+++ trunk/dports/mail/mutt-devel/files/patch-smime_keys.diff	2013-06-12 17:46:35 UTC (rev 106959)
@@ -0,0 +1,75 @@
+--- a/smime_keys.pl	2005-05-10 17:02:54.000000000 -0500
++++ b/smime_keys.pl	2005-11-01 16:02:42.000000000 -0600
+@@ -80,6 +80,29 @@
+ # OPS
+ #
+ 
++sub get_certs {
++    my $file = shift;
++    return undef unless (defined($file) && -e $file);
++
++    open IN, "<$file";
++
++    my @certs = ();
++    my $in_cert = 0;
++    my $cert = q{};
++    while ( <IN> ) {
++        $in_cert = 1 if ( /^-----BEGIN CERTIFICATE-----$/ );
++        $cert .= $_;
++
++        if ( /^-----END CERTIFICATE-----$/ )  {
++            push @certs, $cert;
++            $cert = q{};
++            $in_cert = 0;
++        }
++    }
++
++    return @certs;
++}
++
+ if(@ARGV == 1 and $ARGV[0] eq "init") {
+     init_paths;
+ }
+@@ -90,13 +113,26 @@
+     change_label($ARGV[1]);
+ }
+ elsif(@ARGV == 2 and $ARGV[0] eq "add_cert") {
+-    my $format = -B $ARGV[1] ? 'DER' : 'PEM'; 
+-    my $cmd = "$opensslbin x509 -noout -hash -in $ARGV[1] -inform $format";
++    foreach my $cert ( get_certs( $ARGV[1] ) ) {
++
++        my $file = sprintf( '/tmp/smime-%d.%d', $$, int(rand( 999999 ) ) );
++        print STDERR "TMPFILE: $file\n";
++        if ( -e $file ) {
++            die( "ERROR: TMPFILE $file existss?!?!" );
++        }
++        open OUT, ">$file";
++        print OUT $cert;
++        close OUT;
++
++        my $format = -B $file ? 'DER' : 'PEM'; 
++        my $cmd = "$opensslbin x509 -noout -hash -in $file -inform $format";
+     my $cert_hash = `$cmd`;
+     $? and die "'$cmd' returned $?";
+     chomp($cert_hash); 
+     my $label = query_label;
+-    &add_certificate($ARGV[1], \$cert_hash, 1, $label, '?');
++        &add_certificate($file, \$cert_hash, 1, $label, '?');
++        unlink $file;
++    }
+ }
+ elsif(@ARGV == 2 and $ARGV[0] eq "add_pem") {
+     -e $ARGV[1] and -s $ARGV[1] or die("$ARGV[1] is nonexistent or empty.");
+@@ -380,9 +416,10 @@
+     print "the key ID. This has to be _one_ word (no whitespaces).\n\n";
+ 
+     print "Enter label: ";
+-    chomp($input = <STDIN>);
++    $input = <STDIN>;
++    chomp($input) if ( defined($input) );
+ 
+-    my ($label, $junk) = split(/\s/, $input, 2);     
++    my ($label, $junk) = split(/\s/, $input, 2) if ( defined($input) );
+     
+     defined $junk 
+         and print "\nUsing '$label' as label; ignoring '$junk'\n";

Added: trunk/dports/mail/mutt-devel/files/patch-thunderbird-fix.diff
===================================================================
--- trunk/dports/mail/mutt-devel/files/patch-thunderbird-fix.diff	                        (rev 0)
+++ trunk/dports/mail/mutt-devel/files/patch-thunderbird-fix.diff	2013-06-12 17:46:35 UTC (rev 106959)
@@ -0,0 +1,18 @@
+--- a/crypt.c	2009-01-05 11:20:53.000000000 -0800
++++ b/crypt.c	2009-06-29 16:55:12.000000000 -0700
+@@ -393,7 +393,14 @@
+        */
+       if (!ascii_strcasecmp (m->description, "S/MIME Encrypted Message"))
+ 	return SMIMEENCRYPT;
+-      complain = 1;
++
++      /* Thunderbird 2.0.0.19 doesn't seem to be adding a Content-Description
++       * If we make it all the way here, we know it's not signed as Thunderbird
++       * sets the signed-data correctly, so we're going to assuming it's
++       * encrypted
++       */
++
++      return SMIMEENCRYPT;
+     }
+     else if (ascii_strcasecmp (m->subtype, "octet-stream"))
+       return 0;
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.macosforge.org/pipermail/macports-changes/attachments/20130612/e1e08ed2/attachment.html>


More information about the macports-changes mailing list