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:
+4
-6
@@ -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()
|
||||
|
||||
|
||||
@@ -58,7 +58,7 @@ def strip_trailing_lines(content):
|
||||
return content[:end]
|
||||
|
||||
def unfold_header_value(content):
|
||||
return re.sub(b"\r\n", b"", content)
|
||||
return re.sub(b"\r?\n", b"", content)
|
||||
|
||||
|
||||
def correct_empty_body(content):
|
||||
|
||||
Reference in New Issue
Block a user