diff options
author | George Hazan <ghazan@miranda.im> | 2022-10-15 19:23:01 +0300 |
---|---|---|
committer | George Hazan <ghazan@miranda.im> | 2022-10-15 19:23:01 +0300 |
commit | 6306fdef595a68df4cdfeadf0545e3a59a321ab3 (patch) | |
tree | a3a1a5fac16b8f3680a69d92b4886e172c9e9b45 /protocols | |
parent | 2292ef20cf0378346f4fa857ca7cdc501c52794d (diff) |
minor code cleaning
Diffstat (limited to 'protocols')
-rw-r--r-- | protocols/JabberG/src/jabber_omemo.cpp | 2 | ||||
-rw-r--r-- | protocols/WhatsAppWeb/src/signal.cpp | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/protocols/JabberG/src/jabber_omemo.cpp b/protocols/JabberG/src/jabber_omemo.cpp index 43195cc1f5..b8042b0a55 100644 --- a/protocols/JabberG/src/jabber_omemo.cpp +++ b/protocols/JabberG/src/jabber_omemo.cpp @@ -2001,7 +2001,7 @@ int CJabberProto::OmemoEncryptMessage(XmlNode &msg, const char *msg_text, MCONTA int tmp_len = 0, outl;
//EVP_EncryptUpdate(ctx, nullptr, &outl, aad, _countof(aad));
unsigned char *out = (unsigned char*)mir_alloc(inl + _countof(key) - 1);
- EVP_EncryptUpdate(ctx, out, &outl, (unsigned char*)msg_text, inl);
+ EVP_EncryptUpdate(ctx, out, &outl, (unsigned char*)msg_text, (int)inl);
tmp_len += outl;
EVP_EncryptFinal(ctx, (unsigned char*)(out + tmp_len), &outl);
diff --git a/protocols/WhatsAppWeb/src/signal.cpp b/protocols/WhatsAppWeb/src/signal.cpp index 6523dec0c0..14f09d20ef 100644 --- a/protocols/WhatsAppWeb/src/signal.cpp +++ b/protocols/WhatsAppWeb/src/signal.cpp @@ -175,7 +175,7 @@ static int contains_pre_key(uint32_t pre_key_id, void *user_data) { auto *pStore = (MSignalStore *)user_data; - CMStringA szSetting(FORMAT, "%s_%d", "PreKey", pre_key_id); + CMStringA szSetting(FORMAT, "%s%d", "PreKey", pre_key_id); MBinBuffer blob(pStore->pProto->getBlob(szSetting)); return (blob.data() != 0); } @@ -184,7 +184,7 @@ static int load_pre_key(signal_buffer **record, uint32_t pre_key_id, void *user_ { auto *pStore = (MSignalStore *)user_data; - CMStringA szSetting(FORMAT, "%s_%d", "PreKey", pre_key_id); + CMStringA szSetting(FORMAT, "%s%d", "PreKey", pre_key_id); MBinBuffer blob(pStore->pProto->getBlob(szSetting)); if (blob.data() == 0) return SG_ERR_INVALID_KEY_ID; @@ -197,7 +197,7 @@ static int remove_pre_key(uint32_t pre_key_id, void *user_data) { auto *pStore = (MSignalStore *)user_data; - CMStringA szSetting(FORMAT, "%s_%d", "PreKey", pre_key_id); + CMStringA szSetting(FORMAT, "%s%d", "PreKey", pre_key_id); pStore->pProto->delSetting(szSetting); szSetting.Format("PreKey%uPublic", pre_key_id); @@ -212,7 +212,7 @@ static int store_pre_key(uint32_t pre_key_id, uint8_t *record, size_t record_len { auto *pStore = (MSignalStore *)user_data; - CMStringA szSetting(FORMAT, "%s_%d", "PreKey", pre_key_id); + CMStringA szSetting(FORMAT, "%s%d", "PreKey", pre_key_id); db_set_blob(0, pStore->pProto->m_szModuleName, szSetting, record, (unsigned int)record_len); session_pre_key *prekey = nullptr; |