aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-11-09 16:37:04 -0500
committerKonstantin Ryabitsev <konstantin@linuxfoundation.org>2021-11-09 16:37:04 -0500
commitac3ee85ec79360524f4f78f19b52c33dea7ffff6 (patch)
tree134e60b6fadc56c281f2bfb7ba527bfe3f59f538
parenta7ec0c10429bb1e14591e33c08baf3aee28c26dd (diff)
downloadpatatt-ac3ee85ec79360524f4f78f19b52c33dea7ffff6.tar.gz
Always set the i= field
If the From: header matched the identity on the key, we skipped adding the i= field to the signature, however there are good reasons to always have it in place. For example, a remailer service could be replacing the From header with their own list header and moving the original From: into X-Original-From. If we don't have the i= field present, then we have no easy way to figure out who the signature belongs to. Signed-off-by: Konstantin Ryabitsev <konstantin@linuxfoundation.org>
-rw-r--r--patatt/__init__.py5
1 files changed, 3 insertions, 2 deletions
diff --git a/patatt/__init__.py b/patatt/__init__.py
index 5b4acbc..de69d91 100644
--- a/patatt/__init__.py
+++ b/patatt/__init__.py
@@ -489,8 +489,9 @@ class PatattMessage:
ds.set_headers(self.canon_headers, mode='sign')
ds.set_body(self.canon_body)
ds.set_field('l', str(len(self.canon_body)))
- if identity and identity != self.canon_identity:
- ds.set_field('i', identity)
+ if not identity:
+ identity = self.canon_identity
+ ds.set_field('i', identity)
if selector:
ds.set_field('s', selector)