From 12c5310e5b5c0da40f507c60bc9d1b28479b3bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maxime=20=E2=80=9Cpep=E2=80=9D=20Buquet?= Date: Tue, 2 Jul 2019 01:12:22 +0200 Subject: poezio/plugin_e2ee: Use encrypted_tags attribute to complete whitelist filtering on encryption MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maxime “pep” Buquet --- poezio/plugin_e2ee.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'poezio/plugin_e2ee.py') diff --git a/poezio/plugin_e2ee.py b/poezio/plugin_e2ee.py index 91b1a22e..357a9678 100644 --- a/poezio/plugin_e2ee.py +++ b/poezio/plugin_e2ee.py @@ -251,8 +251,12 @@ class E2EEPlugin(BasePlugin): # Filter stanza with the whitelist. Plugins doing stanza encryption # will have to include these in their encrypted container beforehand. + whitelist = self.tag_whitelist + if self.encrypted_tags is not None: + whitelist += self.encrypted_tags + for elem in message.xml[:]: - if elem.tag not in self.tag_whitelist: + if elem.tag not in whitelist: message.xml.remove(elem) log.debug('Encrypted %s message: %r', self.encryption_name, message) -- cgit v1.2.3