From c4581462777ec3faf67e0075762c37648a5051b3 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 2 May 2017 13:24:46 +0300 Subject: jabber: omemo: basic implementation done omemo now works, done basic testing with miranda<>miranda but not ready for use, incompatible with gajim (due to upstream regression in libsignal ?, or some my own bugs), storage backend still missing few functions (which is crutical in some situations) fixed crash in libsignal-c crypto backend implementation few small changes in aes-gcm encrypt/decrypt implementation (auth tag verification still fails), but decryption looks ok more strict type check for device id to avoid overflow (it must be 4byte size unsigned integer) finished basic implementation of 4.7 4.5 return error and does not send anything if no sessions available --- protocols/JabberG/src/jabber_proto.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'protocols/JabberG/src/jabber_proto.cpp') diff --git a/protocols/JabberG/src/jabber_proto.cpp b/protocols/JabberG/src/jabber_proto.cpp index 4635288ee8..f5df6dbc9a 100755 --- a/protocols/JabberG/src/jabber_proto.cpp +++ b/protocols/JabberG/src/jabber_proto.cpp @@ -964,7 +964,13 @@ int __cdecl CJabberProto::SendMsg(MCONTACT hContact, int, const char* pszSrc) if(m_options.UseOMEMO && OmemoIsEnabled(hContact) && !mir_wstrcmp(msgType, L"chat")) //omemo enabled in options, omemo enabled for contact { - OmemoEncryptMessage(m, msg, hContact); + //TODO: check if message encrypted for at least one session and return error if not + if (!OmemoEncryptMessage(m, msg, hContact)) + { + TFakeAckParams *param = new TFakeAckParams(hContact, Translate("OMEMO no valid sessions exists")); + ForkThread(&CJabberProto::SendMessageAckThread, param); + return 0; + } } else { -- cgit v1.2.3