mirror of
https://github.com/profanity-im/profanity.git
synced 2025-02-02 15:08:15 -05:00
OMEMO Logging
This commit is contained in:
parent
49a0d97a43
commit
879a47c71b
@ -825,7 +825,7 @@ omemo_on_message_send(ProfWin* win, const char* const message, gboolean request_
|
|||||||
res = session_cipher_encrypt(cipher, key_tag, AES128_GCM_KEY_LENGTH + AES128_GCM_TAG_LENGTH, &ciphertext);
|
res = session_cipher_encrypt(cipher, key_tag, AES128_GCM_KEY_LENGTH + AES128_GCM_TAG_LENGTH, &ciphertext);
|
||||||
session_cipher_free(cipher);
|
session_cipher_free(cipher);
|
||||||
if (res != SG_SUCCESS ) {
|
if (res != SG_SUCCESS ) {
|
||||||
log_error("[OMEMO][SEND] cannot encrypt key for %s device id %d - code: %d", address.name, address.device_id,res);
|
log_info("[OMEMO][SEND] cannot encrypt key for %s device id %d - code: %d", address.name, address.device_id,res);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
signal_buffer* buffer = ciphertext_message_get_serialized(ciphertext);
|
signal_buffer* buffer = ciphertext_message_get_serialized(ciphertext);
|
||||||
@ -855,6 +855,7 @@ omemo_on_message_send(ProfWin* win, const char* const message, gboolean request_
|
|||||||
// Encrypt keys for the sender
|
// Encrypt keys for the sender
|
||||||
if (!muc) {
|
if (!muc) {
|
||||||
GList* sender_device_id = g_hash_table_lookup(omemo_ctx.device_list, jid->barejid);
|
GList* sender_device_id = g_hash_table_lookup(omemo_ctx.device_list, jid->barejid);
|
||||||
|
|
||||||
for (device_ids_iter = sender_device_id; device_ids_iter != NULL; device_ids_iter = device_ids_iter->next) {
|
for (device_ids_iter = sender_device_id; device_ids_iter != NULL; device_ids_iter = device_ids_iter->next) {
|
||||||
int res;
|
int res;
|
||||||
ciphertext_message* ciphertext;
|
ciphertext_message* ciphertext;
|
||||||
@ -864,7 +865,7 @@ omemo_on_message_send(ProfWin* win, const char* const message, gboolean request_
|
|||||||
.name_len = strlen(jid->barejid),
|
.name_len = strlen(jid->barejid),
|
||||||
.device_id = GPOINTER_TO_INT(device_ids_iter->data)
|
.device_id = GPOINTER_TO_INT(device_ids_iter->data)
|
||||||
};
|
};
|
||||||
log_debug("[OMEMO][SEND] Sending to device %d for %s ", address.device_id, address.name);
|
log_debug("[OMEMO][SEND][Sender] Sending to device %d for %s ", address.device_id, address.name);
|
||||||
// Don't encrypt for this device (according to
|
// Don't encrypt for this device (according to
|
||||||
// <https://xmpp.org/extensions/xep-0384.html#encrypt>).
|
// <https://xmpp.org/extensions/xep-0384.html#encrypt>).
|
||||||
if (address.device_id == omemo_ctx.device_id) {
|
if (address.device_id == omemo_ctx.device_id) {
|
||||||
@ -873,14 +874,14 @@ omemo_on_message_send(ProfWin* win, const char* const message, gboolean request_
|
|||||||
|
|
||||||
res = session_cipher_create(&cipher, omemo_ctx.store, &address, omemo_ctx.signal);
|
res = session_cipher_create(&cipher, omemo_ctx.store, &address, omemo_ctx.signal);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
log_error("[OMEMO][SEND] cannot create cipher for %s device id %d", address.name, address.device_id);
|
log_info("[OMEMO][SEND][Sender] cannot create cipher for %s device id %d", address.name, address.device_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
res = session_cipher_encrypt(cipher, key_tag, AES128_GCM_KEY_LENGTH + AES128_GCM_TAG_LENGTH, &ciphertext);
|
res = session_cipher_encrypt(cipher, key_tag, AES128_GCM_KEY_LENGTH + AES128_GCM_TAG_LENGTH, &ciphertext);
|
||||||
session_cipher_free(cipher);
|
session_cipher_free(cipher);
|
||||||
if (res != 0) {
|
if (res != 0) {
|
||||||
log_error("[OMEMO][SEND] cannot encrypt key for %s device id %d", address.name, address.device_id);
|
log_info("[OMEMO][SEND][Sender] cannot encrypt key for %s device id %d", address.name, address.device_id);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
signal_buffer* buffer = ciphertext_message_get_serialized(ciphertext);
|
signal_buffer* buffer = ciphertext_message_get_serialized(ciphertext);
|
||||||
|
@ -85,7 +85,7 @@ load_session(signal_buffer** record, signal_buffer** user_record,
|
|||||||
device_store = g_hash_table_lookup(session_store, address->name);
|
device_store = g_hash_table_lookup(session_store, address->name);
|
||||||
if (!device_store) {
|
if (!device_store) {
|
||||||
*record = NULL;
|
*record = NULL;
|
||||||
log_warning("[OMEMO][STORE] No device store for %s found", address->name);
|
log_info("[OMEMO][STORE] No device store for %s found", address->name);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user