Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
poezio
poezio
Commits
a2721b20
Commit
a2721b20
authored
Jul 01, 2019
by
Maxime Buquet
Browse files
e2ee-api: Always remove non-whitelisted subelements of messages
Signed-off-by:
Maxime “pep” Buquet
<
pep@bouah.net
>
parent
2fb0cdbb
Changes
1
Hide whitespace changes
Inline
Side-by-side
poezio/plugin_e2ee.py
View file @
a2721b20
...
...
@@ -207,11 +207,11 @@ class E2EEPlugin(BasePlugin):
if
self
.
replace_body_with_eme
:
self
.
core
.
xmpp
[
'xep_0380'
].
replace_body_with_eme
(
message
)
# Filter stanza with the whitelist
if we don't do
stanza encryption
if
not
self
.
stanza_encryption
:
for
elem
in
message
.
xml
[:]:
if
elem
.
tag
not
in
self
.
tag_whitelist
:
message
.
xml
.
remove
(
elem
)
# Filter stanza with the whitelist
. Plugins doing
stanza encryption
# will have to include these in their encrypted container beforehand.
for
elem
in
message
.
xml
[:]:
if
elem
.
tag
not
in
self
.
tag_whitelist
:
message
.
xml
.
remove
(
elem
)
log
.
debug
(
'Encrypted %s message: %r'
,
self
.
encryption_name
,
message
[
'body'
])
return
message
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment