zkemail/zk-regex

support many canonicalization algorithms

Divide-By-0 opened this issue · 0 comments

Email headers with c=simple/simple: fail. simple/simple means that instead of \r\n it might be either all \n or \r, and have weird spacing.

Specifically for one of the emails zkp2p looked at, they found:

  • DKIM-Signature isnt lowercased
  • the space afterDKIM-Signature: is preserved
  • allow for \r\n between header fields, whereas relaxed gets rid of them. for example, bh starts on a new line in the garanti email
  • allows tabs in addition to spaces

Info:

  • The first simple refers to the header canonicalization algorithm. simple means that the line ending type (CR, LF, CRLF) must match exactly from the sender to the receiver. It also means that whitespace at the end of header lines is not ignored.
  • The second simple refers to the body canonicalization algorithm. simple means that the line ending type must match exactly from the sender to the receiver. It also means that trailing empty lines at the end of the message body are not ignored.
    The other option for these values is relaxed. If relaxed is used, then whitespace at the end of lines and all empty lines are ignored, and all whitespace characters within a line are treated as a single space. Also, line endings can be CR, LF, or CRLF, and they will all be treated as the same.

gpt4 says this; so basically i think