diff options
author | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2017-05-02 13:24:46 +0300 |
---|---|---|
committer | Gluzskiy Alexandr <sss@sss.chaoslab.ru> | 2017-05-02 13:42:05 +0300 |
commit | c4581462777ec3faf67e0075762c37648a5051b3 (patch) | |
tree | 492021c23183fd568c1726b632a003675a76fc0f /protocols/JabberG/src/jabber_proto.cpp | |
parent | 7e9fed6f96da5954b8e1d65d51c6bb89c552ff16 (diff) |
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
Diffstat (limited to 'protocols/JabberG/src/jabber_proto.cpp')
-rwxr-xr-x | protocols/JabberG/src/jabber_proto.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
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
{
|