fix correct AMS header selection

When we are verifying the ARC seal we need to fetch the raw AMS header
from the header list. But it's not enough to return the first one we
find, since we may be interested in a different arc seal, we need
to search for the correct ARC index.
This commit is contained in:
André Cruz
2023-03-30 16:02:46 +01:00
parent 71119c956e
commit 264230308c
+3 -1
View File
@@ -1293,7 +1293,9 @@ class ARC(DomainSigner):
# we can't use the AMS provided above, as it's already been canonicalized relaxed
# for use in validating the AS. However the AMS is included in the AMS itself,
# and this can use simple canonicalization
raw_ams_header = [(x, y) for (x, y) in self.headers if x.lower() == b'arc-message-signature'][0]
raw_ams_header = [
(x, y) for (x, y) in self.headers if x.lower() == b'arc-message-signature' and b" i="+sig[b'i']+b";" in y.lower()
][0]
# Only relaxed canonicalization used by ARC
if b'c' not in sig: