From ab38ee7b7cfea9725bd35b0534d8c78e3afe9d5c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philipp=20H=C3=B6rist?= Date: Sat, 21 Apr 2018 14:06:05 +0200 Subject: [PATCH] [omemo] Fail with log output on invalid stanza --- omemo/omemo_connection.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/omemo/omemo_connection.py b/omemo/omemo_connection.py index b01517e..213c845 100644 --- a/omemo/omemo_connection.py +++ b/omemo/omemo_connection.py @@ -227,6 +227,10 @@ class OMEMOConnection: from_jid = app.get_jid_without_resource(from_jid) msg_dict = unpack_encrypted(omemo_encrypted_tag) + if msg_dict is None: + log.error('Invalid omemo message received:\n%s', msg.msg_) + msg.encrypted = 'drop' + return msg_dict['sender_jid'] = from_jid