On Tue, 21 Aug 2007, Mark Martinec wrote:
The signature seems correct, I verified canonification with Mail::DKIM (count is exact to the end of the original message), and signature verifies with Mail::DKIM as well as with dkim-milter 1.2.0.

It looks like the reworked canonicalization code has two places where the length limit is enforced, and the first one got it wrong. The attached patch removes the first one and lets the second one get it right.

(...or at least 0.msg verifies with this patch)

-MSK
Index: dkim-canon.c
===================================================================
RCS file: /cvs/libdkim/dkim-canon.c,v
retrieving revision 1.19
diff -u -r1.19 dkim-canon.c
--- dkim-canon.c        20 Aug 2007 17:02:13 -0000      1.19
+++ dkim-canon.c        20 Aug 2007 22:49:47 -0000
@@ -4,7 +4,7 @@
 */
 
 #ifndef lint
-static char dkim_canon_c_id[] = "@(#)$Id: dkim-canon.c,v 1.19 2007/08/20 
17:02:13 msk Exp $";
+static char dkim_canon_c_id[] = "@(#)$Id: dkim-canon.c,v 1.18 2007/08/13 
13:18:16 msk Exp $";
 #endif /* !lint */
 
 /* system includes */
@@ -1080,7 +1080,6 @@
 DKIM_STAT
 dkim_canon_bodychunk(DKIM *dkim, u_char *buf, size_t buflen)
 {
-       off_t remain;
        u_int wlen;
        DKIM_CANON *cur;
        u_char *p;
@@ -1101,12 +1100,7 @@
                if (cur->canon_remain == 0)
                        continue;
 
-               if (cur->canon_remain == (off_t) -1)
-                       remain = buflen;
-               else
-                       remain = MIN(buflen, cur->canon_remain);
-
-               eob = buf + remain - 1;
+               eob = buf + buflen - 1;
                wrote = buf;
                wlen = 0;
 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
dkim-milter-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/dkim-milter-discuss

Reply via email to