summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaxime “pep” Buquet <pep@bouah.net>2019-08-23 10:13:05 +0200
committerMaxime “pep” Buquet <pep@bouah.net>2019-12-27 18:57:33 +0100
commit687f360797248d80cc17d1311d03697d8773cd23 (patch)
tree1e6337ce239ad17772e266aef404791c79a9bab7
parent83e83055540f9d6cdda1b4e4ee7fdd0057d885cc (diff)
downloadpoezio-687f360797248d80cc17d1311d03697d8773cd23.tar.gz
poezio-687f360797248d80cc17d1311d03697d8773cd23.tar.bz2
poezio-687f360797248d80cc17d1311d03697d8773cd23.tar.xz
poezio-687f360797248d80cc17d1311d03697d8773cd23.zip
omemo: ensure whitelist includes encryption tag in the correct format
Signed-off-by: Maxime “pep” Buquet <pep@bouah.net>
-rw-r--r--poezio/plugin_e2ee.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py
index 624a36f2..75ce6fd0 100644
--- a/poezio/plugin_e2ee.py
+++ b/poezio/plugin_e2ee.py
@@ -70,7 +70,7 @@ class E2EEPlugin(BasePlugin):
stanza_encryption = False
#: Whitelist applied to messages when `stanza_encryption` is `False`.
- tag_whitelist = list(map(lambda x: '{%s}%s' % (x[0], x[1]), [
+ tag_whitelist = [
(JCLIENT_NS, 'body'),
(EME_NS, EME_TAG),
(HINTS_NS, 'store'),
@@ -78,7 +78,7 @@ class E2EEPlugin(BasePlugin):
(HINTS_NS, 'no-store'),
(HINTS_NS, 'no-permanent-store'),
# TODO: Add other encryption mechanisms tags here
- ]))
+ ]
#: Replaces body with `eme <https://xmpp.org/extensions/xep-0380.html>`_
#: if set. Should be suitable for most plugins except those using
@@ -269,6 +269,8 @@ class E2EEPlugin(BasePlugin):
if self.encrypted_tags is not None:
whitelist += self.encrypted_tags
+ whitelist = {'{%s}%s' % tag for tag in whitelist}
+
for elem in message.xml[:]:
if elem.tag not in whitelist:
message.xml.remove(elem)