16 Commits

Author SHA1 Message Date
Scott Kitterman 1ffa2cb090 Correct signature in ARC-Seal on LF as linesep (LP: #2052720) - Thanks to Nikolay Vizovitin for the report and the fix 2024-06-23 17:26:31 -04:00
Jonathan Bastien-Filiatrault 882d14c514 Avoid making a fresh slice of the whole email on each iteration.
An update to yesterday's patch. Should avoid copying the mail byte
string more than once.

Tested on Python 2.7 and 3.6.
2018-12-12 13:41:48 -05:00
Jonathan Bastien-Filiatrault 7dee16a5b1 Refactor canonicalization.py strip_trailing_lines to avoid using re for more consistent processing across python versions 2018-12-11 14:34:34 -05:00
Scott Kitterman 3c2beaf70e - Python 3.7 compatibility fixup for dkim.canonicalization.
strip_trailing_lines due to changed RE.sub() processing (LP: #1800313)
2018-10-29 19:53:12 -04:00
Scott Kitterman 16f5bd693c Fix empty body canonicalization for relaxed canonicalization (LP: #1727319) 2017-11-21 07:13:01 -05:00
Matthew Palmer 6de4fa79cd Fix relaxed body canoncalization & introduce further unit tests for both simple and relaxed mode 2017-10-25 13:06:00 +01:00
William Grant e9d01800de Canonicalizationpolicy.from_c_value() now raise InvalidCanonicalizationPolicyErrors instead of logging and returning None. 2011-06-04 15:51:14 +10:00
William Grant 3008ad76a7 Capitalise and unexport dkim.canonicalization.algorithms. 2011-06-04 14:38:29 +10:00
William Grant 6b4b98478b Add CanonicalizationPolicy.to_c_value(). 2011-06-04 14:37:07 +10:00
William Grant 206c860890 Pull c= value parsing out into Canonicalizationpolicy.from_c_value. 2011-06-04 14:30:19 +10:00
William Grant 7b1a3f70dc Add CanonicalizationPolicy, which encapsulates the combined hybrid simple/relaxed schemes. 2011-06-04 14:05:54 +10:00
William Grant b78a41d6bf Add an __all__. 2011-06-03 22:04:21 +10:00
William Grant 5da23e5856 rstrip header field names in relaxed, as the spec says. 2011-06-03 22:03:41 +10:00
William Grant 61cd0e1080 Factor out all the canonicalization regexps. 2011-06-03 22:03:14 +10:00
William Grant 28aaa6f2f2 dkim.canonicalization now has an algorithms dict mapping names to algorithms. Use it. 2011-06-03 21:52:33 +10:00
William Grant 589853aee5 Split out dkim.canonicalization, and test it. Note that test_wsp_strips_headers is correctly failing, as trailing whitespace is not stripped from header names. 2011-06-03 21:16:31 +10:00