Correct signature in ARC-Seal on LF as linesep (LP: #2052720) - Thanks to Nikolay Vizovitin for the report and the fix

This commit is contained in:
Scott Kitterman
2024-06-23 17:26:31 -04:00
parent 71f5d118e6
commit 1ffa2cb090
3 changed files with 7 additions and 7 deletions
+4 -6
View File
@@ -1119,14 +1119,12 @@ class ARC(DomainSigner):
# Compute ARC-Authentication-Results
aar_value = ("i=%d; " % instance).encode('utf-8') + auth_results.rstrip() + self.linesep
canon_policy = CanonicalizationPolicy.from_c_value(b'relaxed/relaxed')
new_arc_set.append(b"ARC-Authentication-Results: " + aar_value)
self.headers.insert(0, (b"arc-authentication-results", aar_value))
arc_headers.insert(0, (b"ARC-Authentication-Results", aar_value))
self.headers = canon_policy.canonicalize_headers(arc_headers[:1]) + self.headers
# Compute bh=
canon_policy = CanonicalizationPolicy.from_c_value(b'relaxed/relaxed')
self.hasher = HASH_ALGORITHMS[self.signature_algorithm]
h = HashThrough(self.hasher(), self.debug_content)
h.update(canon_policy.canonicalize_body(self.body))
@@ -1154,8 +1152,8 @@ class ARC(DomainSigner):
b"ARC-Message-Signature", pk, standardize)
new_arc_set.append(b"ARC-Message-Signature: " + res)
self.headers.insert(0, (b"ARC-Message-Signature", res))
arc_headers.insert(0, (b"ARC-Message-Signature", res))
self.headers = canon_policy.canonicalize_headers(arc_headers[:1]) + self.headers
# Compute ARC-Seal
as_fields = [x for x in [
@@ -1183,8 +1181,8 @@ class ARC(DomainSigner):
b"ARC-Seal", pk, standardize)
new_arc_set.append(b"ARC-Seal: " + res)
self.headers.insert(0, (b"ARC-Seal", res))
arc_headers.insert(0, (b"ARC-Seal", res))
self.headers = canon_policy.canonicalize_headers(arc_headers[:1]) + self.headers
new_arc_set.reverse()