From 4f1651874fa4ac6674dbb777779c3702996232fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rodolphe=20Br=C3=A9ard?= Date: Sat, 15 Apr 2023 23:13:16 +0200 Subject: [PATCH] Fix the DKIM header CRLF --- src/signature.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/signature.rs b/src/signature.rs index 481947c..6392c27 100644 --- a/src/signature.rs +++ b/src/signature.rs @@ -71,8 +71,10 @@ impl Signature { hasher.update(&header); } } - let dkim_header = self.get_header(); - let dkim_header = self.canonicalization.process_header(dkim_header.as_bytes()); + let dkim_header = format!("{}\r\n", self.get_header()); + let mut dkim_header = self.canonicalization.process_header(dkim_header.as_bytes()); + dkim_header.pop(); + dkim_header.pop(); hasher.update(dkim_header); hasher.finalize().to_vec() }