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:
@@ -6,6 +6,8 @@ UNRELEASED Version 1.1.7
|
|||||||
report and the fix
|
report and the fix
|
||||||
- Correct line separtor after AAR header field (LP: #2049018) - Thanks to
|
- Correct line separtor after AAR header field (LP: #2049018) - Thanks to
|
||||||
Nikolay Vizovitin for the report and the fix
|
Nikolay Vizovitin for the report and the fix
|
||||||
|
- Correct signature in ARC-Seal on LF as linesep (LP: #2052720) - Thanks to
|
||||||
|
Nikolay Vizovitin for the report and the fix
|
||||||
|
|
||||||
2024-04-14 Version 1.1.6
|
2024-04-14 Version 1.1.6
|
||||||
- Use raw byte string for regex; fixes SyntaxWarning in Python 3.12 due to
|
- Use raw byte string for regex; fixes SyntaxWarning in Python 3.12 due to
|
||||||
|
|||||||
+4
-6
@@ -1119,14 +1119,12 @@ class ARC(DomainSigner):
|
|||||||
|
|
||||||
# Compute ARC-Authentication-Results
|
# Compute ARC-Authentication-Results
|
||||||
aar_value = ("i=%d; " % instance).encode('utf-8') + auth_results.rstrip() + self.linesep
|
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)
|
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))
|
arc_headers.insert(0, (b"ARC-Authentication-Results", aar_value))
|
||||||
|
self.headers = canon_policy.canonicalize_headers(arc_headers[:1]) + self.headers
|
||||||
|
|
||||||
# Compute bh=
|
# Compute bh=
|
||||||
canon_policy = CanonicalizationPolicy.from_c_value(b'relaxed/relaxed')
|
|
||||||
|
|
||||||
self.hasher = HASH_ALGORITHMS[self.signature_algorithm]
|
self.hasher = HASH_ALGORITHMS[self.signature_algorithm]
|
||||||
h = HashThrough(self.hasher(), self.debug_content)
|
h = HashThrough(self.hasher(), self.debug_content)
|
||||||
h.update(canon_policy.canonicalize_body(self.body))
|
h.update(canon_policy.canonicalize_body(self.body))
|
||||||
@@ -1154,8 +1152,8 @@ class ARC(DomainSigner):
|
|||||||
b"ARC-Message-Signature", pk, standardize)
|
b"ARC-Message-Signature", pk, standardize)
|
||||||
|
|
||||||
new_arc_set.append(b"ARC-Message-Signature: " + res)
|
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))
|
arc_headers.insert(0, (b"ARC-Message-Signature", res))
|
||||||
|
self.headers = canon_policy.canonicalize_headers(arc_headers[:1]) + self.headers
|
||||||
|
|
||||||
# Compute ARC-Seal
|
# Compute ARC-Seal
|
||||||
as_fields = [x for x in [
|
as_fields = [x for x in [
|
||||||
@@ -1183,8 +1181,8 @@ class ARC(DomainSigner):
|
|||||||
b"ARC-Seal", pk, standardize)
|
b"ARC-Seal", pk, standardize)
|
||||||
|
|
||||||
new_arc_set.append(b"ARC-Seal: " + res)
|
new_arc_set.append(b"ARC-Seal: " + res)
|
||||||
self.headers.insert(0, (b"ARC-Seal", res))
|
|
||||||
arc_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()
|
new_arc_set.reverse()
|
||||||
|
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ def strip_trailing_lines(content):
|
|||||||
return content[:end]
|
return content[:end]
|
||||||
|
|
||||||
def unfold_header_value(content):
|
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):
|
def correct_empty_body(content):
|
||||||
|
|||||||
Reference in New Issue
Block a user