dkim-dev
[Top] [All Lists]

[dkim-dev] Having trouble with FWS in the DKIM header

2008-06-22 11:25:35
(I hope this won't get sent twice, I sent the first from an account that 
wasn't subscribed to the list.)


Hello,
I am trying to work up a signing method for use with Greg Hewgill's
pyDKIM.  The signature itself seems to work fine, but only if it is all
on the same header line.  If the signature is folded, it fails.

I've tried folding by two methods: using python's add_header, or doing
it myself. I can see perhaps why add_header fails, since it leaves the
b= line as a run-on.  (since it can't know that WS is ignored within the
signature)  Why my own method is failing is more a mystery.  I've looked
at the signature sent to me from other systems and I can't see a
difference between the folded headers I generate versus the ones they do.

I'm extremely confused!  I must be doing something quite simple.  If I
take a message that is failing because of the wrapping and put the
signature all on one line and use Greg's dkim_verify, it now passes.  It
did occur to me maybe that the little script he provided doesn't work
with folder headers, but that doesn't explain why testing.dkim.org also
rejects it.  I'm at a loss...

Jeff


Examples follow.

########################## pass canonical
Message-ID:'20'<485E542E(_dot_)2040204(_at_)finity(_dot_)org>'0d''0a'
Date:'20'Sun,'20'22'20'Jun'20'2008'20'07:31:26'20'-0600'0d''0a'
From:'20'Jeffrey'20'Rice'20''0d''0a'
MIME-Version:'20'1.0'0d''0a'
To:'20'dkim-test(_at_)testing(_dot_)dkim(_dot_)org'0d''0a'
Subject:'20'Testig'0d''0a'
Content-Type:'20'text/plain;'20'charset=ISO-8859-1;'20'format=flowed'0d''0a'
Content-Transfer-Encoding:'20'7bit'0d''0a'
DKIM-Signature:'20'v=1;'20'a=rsa-sha256;'20'c=simple/simple;'20'd=finity.org;'20'i=(_at_)finity(_dot_)org;'20'q=dns/txt;'20's=selector1;'20't=1214141487;'20'h=Message-ID'20':'20'Date'20':'20'From'20':'20'MIME-Version'20':'20'To'20':'20'Subject'20':'20'Content-Type'20':'20'Content-Transfer-Encoding;'20'bh=15pFrAvOGi+eHKJgB6psh6iIBCbvYSuhPj+wQn6C7Ss=;'20'b=

testing'0d''0a'

############ pass original
 From jeffrice(_at_)finity(_dot_)XXX Sun Jun 22 08:59:33 2008
Received: from finity.org (www.finity.org [207.210.209.47])
        by testing.dkim.org (8.12.11/8.12.10) with ESMTP id m5MFxXj7022226
        for ; Sun, 22 Jun 2008 08:59:33 -0700
Received: from finity.org (localhost [127.0.0.1])
        by reinject.finity.org (Postfix) with ESMTP id 368AC4031F
        for ; Sun, 22 Jun 2008 10:06:43 -0600 (MDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=finity.org;
i=(_at_)finity(_dot_)org; q=dns/txt; s=selector1; t=1214150803; h=Message-ID : 
Date
: From : MIME-Version : To : Subject : Content-Type :
Content-Transfer-Encoding;
bh=M1xeQGxpTcsrKCOl450/mzu7Y4EoXjV0vKbNqLD+oAs=;
b=crBTmhNssnByqyOVMkCpFAdd2+9zum1zuIPPoPbvJ1uxH4c4EV2x9zs7Fqpp+fpBjtTC6Y3ERZ8ZF7Ooe06ijQLvJM62e531avyTXR6Sfa4FZBs80QFMaaDqm/3pEoKC+KRqCDKkUMO1zEP7YnCBoXlsn5eb1NxJ9zlwQSxQdj8=
Received: from Peregrine.local (c-71-196-209-163.hsd1.co.comcast.net
[71.196.209.163])
        (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
        (No client certificate requested)
        by finity.org (Postfix) with ESMTPSA id 3E25140316
        for ; Sun, 22 Jun 2008 10:06:42 -0600 (MDT)
Message-ID: <485E788C(_dot_)6040804(_at_)finity(_dot_)org>
Date: Sun, 22 Jun 2008 10:06:36 -0600
From: Jeffrey Rice
MIME-Version: 1.0
To: dkim-test(_at_)testing(_dot_)dkim(_dot_)org
Subject: nofws
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: ClamAV 0.93.1/7532/Sun Jun 22 07:52:49 2008 on finity.org
X-Virus-Status: Clean
Authentication-Results: testing.dkim.org; v=0.1; dkim=pass,
header(_dot_)i=jeffrice(_at_)finity(_dot_)org (
        sig from finity.org/selector1 verified; );
         ssp=pass, header(_dot_)From=jeffrice(_at_)finity(_dot_)XXX

nofold

############ Failed canonical
Message-ID:'20'<485E7CF8(_dot_)1000808(_at_)finity(_dot_)org>'0d''0a'
Date:'20'Sun,'20'22'20'Jun'20'2008'20'10:25:28'20'-0600'0d''0a'
From:'20'Jeffrey'20'Rice'20''0d''0a'
MIME-Version:'20'1.0'0d''0a'
To:'20'dkim-test(_at_)testing(_dot_)dkim(_dot_)org'0d''0a'
Subject:'20'still'20'mightly'20'confused'0d''0a'
Content-Type:'20'text/plain;'20'charset=ISO-8859-1;'20'format=flowed'0d''0a'
Content-Transfer-Encoding:'20'7bit'0d''0a'
DKIM-Signature:'20'v=1;'20'a=rsa-sha256;'20'c=simple/simple;'20'd=finity.org;'20'i=(_at_)finity(_dot_)org;'0d''0a'
'20''20''20''20''20''20''20''20'q=dns/txt;'20's=selector1;'20't=1214151973;'0d''0a'
'20''20''20''20''20''20''20''20'h=Message-ID'20':'20'Date'20':'20'From'20':'20'MIME-Version'20':'20'To'20':'20'Subject'20':'20'Content-Type'20':'20'Content-Transfer-Encoding;'0d''0a'
'20''20''20''20''20''20''20''20'bh=Fh9Lr5jmJ5tRjFvwGAwKAnN71H9Q/NRVKBHaFt/3BMY=;'0d''0a'
'20''20''20''20''20''20''20''20'b=;

huh?'0d''0a'

### Failed original
 From jeffrice(_at_)finity(_dot_)XXX Sun Jun 22 09:19:03 2008
Received: from finity.org (www.finity.org [207.210.209.47])
        by testing.dkim.org (8.12.11/8.12.10) with ESMTP id m5MGJ3IC023162
        for ; Sun, 22 Jun 2008 09:19:03 -0700
Received: from finity.org (localhost [127.0.0.1])
        by reinject.finity.org (Postfix) with ESMTP id 37E0740321
        for ; Sun, 22 Jun 2008 10:26:13 -0600 (MDT)
DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=finity.org;
i=(_at_)finity(_dot_)org;
         q=dns/txt; s=selector1; t=1214151973;
         h=Message-ID : Date : From : MIME-Version : To : Subject :
Content-Type : Content-Transfer-Encoding;
         bh=Fh9Lr5jmJ5tRjFvwGAwKAnN71H9Q/NRVKBHaFt/3BMY=;
         b=CwH4ThfWqD7A8j/UbGIWh3VI1P8uE31UJjCalOD+4/AexiymcshgSpp
         dIOKN36AkFNsRiG3MXfPP46JgKdN0uFh28pM3Iei4aM9Mt67oEm22V+
         UnABwSoPSQgyVo3lfLSybTtyr1N5Qz0pLAn3SIXoEnybLWcCd7/tfNg
         gqtsXs=;
Received: from Peregrine.local (c-71-196-209-163.hsd1.co.comcast.net
[71.196.209.163])
        (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
        (No client certificate requested)
        by finity.org (Postfix) with ESMTPSA id BB229402B1
        for ; Sun, 22 Jun 2008 10:25:34 -0600 (MDT)
Message-ID: <485E7CF8(_dot_)1000808(_at_)finity(_dot_)org>
Date: Sun, 22 Jun 2008 10:25:28 -0600
From: Jeffrey Rice
MIME-Version: 1.0
To: dkim-test(_at_)testing(_dot_)dkim(_dot_)org
Subject: still mightly confused
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-Virus-Scanned: ClamAV 0.93.1/7532/Sun Jun 22 07:52:49 2008 on finity.org
X-Virus-Status: Clean
Authentication-Results: testing.dkim.org; v=0.1; dkim=fail,
header(_dot_)i=(_at_)finity(_dot_)org (
        RSA-128 err: hdrdiffs=none; bodyvfy=yes; finity.org/selector
        1 fail; );
         ssp=neutral, header(_dot_)From=jeffrice(_at_)finity(_dot_)XXX

huh?

_______________________________________________
dkim-dev mailing list
dkim-dev(_at_)mipassoc(_dot_)org
http://mipassoc.org/mailman/listinfo/dkim-dev