lieser / dkim_verifier

DKIM Verifier Extension for Mozilla Thunderbird
MIT License
210 stars 35 forks source link

Unsupported canonicalization algorithm for body #4

Closed Stexxen closed 11 years ago

Stexxen commented 11 years ago

This error was generated by emails from domain moneysavingexpert.com I'm not sure if it is a problem with the addOn or the DKIM Cert in the header. Let me know if you need more info than I've provided below Error Msg

Timestamp: 05/06/2013 20:55:31
Error: DKIM Signature Error: Unsupported canonicalization algorithm for body
parseDKIMSignature@chrome://dkim_verifier/content/dkim.js:380
verifySignaturePart1@chrome://dkim_verifier/content/dkim.js:812
that.messageLoaded@chrome://dkim_verifier/content/dkim.js:1078
messageHeaderSink.onEndHeaders@chrome://messenger/content/msgHdrViewOverlay.js:471
messageHeaderSink.processHeaders@chrome://messenger/content/msgHdrViewOverlay.js:565

Source File: chrome://dkim_verifier/content/dkim.js
Line: 840

Header

DomainKey-Signature: a=rsa-sha1;
 c=nofws;
 s=sm2;
 d=moneysavingexpert.com;
 q=dns;
 b=CPQ3wVKKcV1QunaoGEF+AojaphS/pasmax4UXdLygNjDlRLiMoX1iOcGIiG5PGXEWdn20BJuqRkIN0iACy0nYKBFzMcFfE12VziTl9Hiho1f5iT2mmZdtc2ijqM6VbvegCkhNAd1oMkCICsd7fAs5R0G0mpp1QLtOLlWx5BFTQk=
DKIM-Signature: v=1; a=rsa-sha1; c=simple;
    d=moneysavingexpert.com; s=sm2; i=@moneysavingexpert.com; h=Content-Transfer-Encoding:
    Content-Type:Reply-To:MIME-Version:Message-ID:Subject:Date:To:
    From; bh=pjqBmVZ2upsptprW5M1vqT1n4Yg=; b=FfrICRBLP4w/EQx8UucBTky
    7tpPcNM7Z9YzmEmw165RlFmFjG+AwuqXipsOX4HWlEasoM3ydfU8t3oejH4xb5S3
    r3iGMkjm2azSvA80wPM8A/JE1c9R7k3YJMIO8stsvYN64wXxPk5I03Q4h5AtBrsp
    2E3RYyXkYvMAi+MGNzPw=
lieser commented 11 years ago

Thanks for reporting, it was a bug in the addon. Will be fixed in version 0.3.4. I will wait with adding it to AMO until 0.3.3 is reviewed (otherwise the position in the review queue is lost). Until then, you will have to download it here from github and pack it yourself, if the bug fix is important for you.

ionum commented 11 years ago

Issue is no fixed if c=relaxed:

if (msCanonTag[3] === undefined) { DKIMSignature.c_body = "simple";

should be: if (msCanonTag[3] === undefined) { DKIMSignature.c_body = DKIMSignature.c_header;

lieser commented 11 years ago

Nice to see that were are people who not only use it, but also take a look at the source code.

But in this case, I think you are wrong. If you look at Section 3.5 of RFC 6376 (Description of the DKIM-Signature Header Field), it states in the part for the c-tag:

If only one algorithm is named, that algorithm is used for the header and "simple" is used for the body. For example, "c=relaxed" is treated the same as "c=relaxed/simple".