From 0b1150d20f49eb0ec82b57ab3fac727f346c0da0 Mon Sep 17 00:00:00 2001 From: Gluzskiy Alexandr Date: Tue, 24 Apr 2018 12:01:36 +0300 Subject: libs: updated libsignal-c protocols: jabber: omemo: used 31bit device id instead of 32bit (32bit conflicts with conversations, not xep compliant) --- protocols/JabberG/src/jabber_omemo.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'protocols/JabberG/src/jabber_omemo.cpp') diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp index 4a9f876d66..2add226562 100755 --- a/protocols/JabberG/src/jabber_omemo.cpp +++ b/protocols/JabberG/src/jabber_omemo.cpp @@ -512,7 +512,7 @@ namespace omemo { struct omemo_device { - unsigned int id; + uint32_t id; ratchet_identity_key_pair *device_key; }; @@ -523,6 +523,7 @@ namespace omemo { { Utils_GetRandom((void*)&(dev->id), 4); } + dev->id &= ~0x80000000; if (signal_protocol_key_helper_generate_identity_key_pair(&(dev->device_key), global_context)) { @@ -656,7 +657,7 @@ namespace omemo { unsigned int device_id; CJabberProto *proto; }; - int load_session_func(signal_buffer **record, const signal_protocol_address *address, void *user_data) + int load_session_func(signal_buffer **record, signal_buffer ** /*user_data_storage*/, const signal_protocol_address *address, void *user_data) { /** * Returns a copy of the serialized session record corresponding to the @@ -771,7 +772,7 @@ namespace omemo { return array_size; } - int store_session_func(const signal_protocol_address *address, uint8_t *record, size_t record_len, void *user_data) + int store_session_func(const signal_protocol_address *address, uint8_t *record, size_t record_len, uint8_t * /*user_record*/, size_t /*user_record_len*/, void *user_data) { /** * Commit to storage the session record for a given @@ -2193,7 +2194,7 @@ void CJabberProto::OmemoOnIqResultGetBundle(HXML iqNode, CJabberIqInfo *pInfo) const wchar_t *signedPreKeyId = XmlGetAttrValue(XmlGetChild(bundle, L"signedPreKeyPublic"), L"signedPreKeyId"); if (!signedPreKeyId) { - debugLogA("Jabber OMEMO: error: device bundle does not contain signedPreKeyPublic node"); + debugLogA("Jabber OMEMO: error: device bundle does not contain signedPreKeyId attr"); return; } const wchar_t *signedPreKeySignature = XmlGetText(XmlGetChild(bundle, L"signedPreKeySignature")); -- cgit v1.2.3