aboutsummaryrefslogtreecommitdiff
path: root/xmpp-vala/src/module/xep/0384_omemo
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2021-11-04 17:33:08 +0100
committerfiaxh <git@lightrise.org>2021-11-10 11:05:34 +0100
commit26d10d1dcb95f11b65611473c9840e13683cb5ec (patch)
treefb09e36aba28ff1b971ea11ad3da2dd3d92f31d4 /xmpp-vala/src/module/xep/0384_omemo
parent38944d702331bb9d7a91d8ed05a33c935562e3c0 (diff)
downloaddino-26d10d1dcb95f11b65611473c9840e13683cb5ec.tar.gz
dino-26d10d1dcb95f11b65611473c9840e13683cb5ec.zip
Add multiparty call support to libdino and xmpp-vala
Diffstat (limited to 'xmpp-vala/src/module/xep/0384_omemo')
-rw-r--r--xmpp-vala/src/module/xep/0384_omemo/omemo_decryptor.vala15
1 files changed, 12 insertions, 3 deletions
diff --git a/xmpp-vala/src/module/xep/0384_omemo/omemo_decryptor.vala b/xmpp-vala/src/module/xep/0384_omemo/omemo_decryptor.vala
index 8e3213ae..a8ca5016 100644
--- a/xmpp-vala/src/module/xep/0384_omemo/omemo_decryptor.vala
+++ b/xmpp-vala/src/module/xep/0384_omemo/omemo_decryptor.vala
@@ -18,16 +18,25 @@ namespace Xmpp.Xep.Omemo {
ParsedData ret = new ParsedData();
StanzaNode? header_node = encrypted_node.get_subnode("header");
- if (header_node == null) return null;
+ if (header_node == null) {
+ warning("Can't parse OMEMO node: No header node");
+ return null;
+ }
ret.sid = header_node.get_attribute_int("sid", -1);
- if (ret.sid == -1) return null;
+ if (ret.sid == -1) {
+ warning("Can't parse OMEMO node: No sid");
+ return null;
+ }
string? payload_str = encrypted_node.get_deep_string_content("payload");
if (payload_str != null) ret.ciphertext = Base64.decode(payload_str);
string? iv_str = header_node.get_deep_string_content("iv");
- if (iv_str == null) return null;
+ if (iv_str == null) {
+ warning("Can't parse OMEMO node: No iv");
+ return null;
+ }
ret.iv = Base64.decode(iv_str);
foreach (StanzaNode key_node in header_node.get_subnodes("key")) {