-
-
Notifications
You must be signed in to change notification settings - Fork 373
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 mimepart with only newline #221
Comments
I don't have the raw body, I only have the MIME tree structure and have to reserialize. |
This issue should already be fixed in git master, but I have not made a release yet. |
isn't this the same bug as #213 ? |
never mind, I see the difference. I'll test it out and make sure this works. |
This is fixed now. |
Thank you very much for your prompt response/fix. |
No prob. Thanks for submitting these bug reports, they are very helpful in ironing out the kinks. FWIW, this re-serialization logic needs to work for S/MIME and OpenPGP as well, and there's no way I could just stream the complete raw messages through a filter to verify those signatures since it they only apply to subsections of the message. |
I pushed MimeKit 1.2.20 to nuget last night with this fix. |
DKIM body hash calculation fails when there is a mimepart with only a newline as content.
Example:
----_com.android.email_0000000000000000
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64
[CR][LF]
[CR][LF]
----_com.android.email_0000000000000000--
The body hash is calculated over:
----_com.android.email_0000000000000000
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: base64
[CR][LF]
----_com.android.email_0000000000000000--
While there have been several issues before with reserialization of mimeparts, I was wondering why you do not chose for DKIM to use the raw body and perform the canonicalization on that. Thus using the body as-is without all the hassle of breaking the body up into the mimeparts and then reserialize them to get the original body. Imho this would make body hash calculation more simple with less chance for errors.
The text was updated successfully, but these errors were encountered: