Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DKIM body hash with fails with trailing line with space #187

Closed
nitinag opened this issue Nov 9, 2015 · 3 comments
Closed

DKIM body hash with fails with trailing line with space #187

nitinag opened this issue Nov 9, 2015 · 3 comments
Labels
bug Something isn't working

Comments

@nitinag
Copy link

nitinag commented Nov 9, 2015

When signing a message with a body having a trailing line with only a WSP (space or tab) in it with body DkimCanonicalizationAlgorithm.Relaxed algorithm, DKIM verification fails as "body hash did not verify" (tested at gmail).

I'm guessing since it's a blank line with space at the end of the message, the canonicalization algorithm is not removing what should now be an additional CRLF at the end of the message with no spaces as part of step b. at https://tools.ietf.org/html/rfc6376#section-3.4.4.

message.Body = new TextPart("plain")
{
    Text = @"Hello!

"}

(Github won't show the extra space on the second line of the code example so you'll need to add it)

@jstedfast
Copy link
Owner

If you find any more of these, could you provide a unit test? It would make it easier to illustrate the issue.

It took me a while to figure out what you meant by whitespace at the end. I think I figured it out, but I'm still not 100% sure I understand you correctly.

@jstedfast jstedfast added the bug Something isn't working label Nov 9, 2015
@nitinag
Copy link
Author

nitinag commented Nov 9, 2015

Sure, will try to do unit tests as I get more familiar with the library.

Just to provide some clarification:
text = "Hello!\r\n \r\n\r\n";
expected = "Hello!\r\n";
That's what doesn't verify. i.e. two spaces on the second line

However, the following verifies just fine:
text = "Hello!\r\n \r\nTest\r\n\r\n";
expected = "Hello!\r\n\r\nTest\r\n";

jstedfast added a commit that referenced this issue Nov 9, 2015
@jstedfast
Copy link
Owner

I've released MimeKit 1.2.15 to nuget.org with a fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants