diff options
author | DebXWoody <stefan@debxwoody.de> | 2021-06-28 20:02:22 +0200 |
---|---|---|
committer | DebXWoody <stefan@debxwoody.de> | 2021-06-28 20:02:22 +0200 |
commit | 879a47c71b82cd2a5dcea0212ed70e0c75c6e7c1 (patch) | |
tree | 5a947c103312b8b0f0332f60051c842fab6a2fcd | |
parent | 49a0d97a433da21fa6cd3c85401f76523471c115 (diff) | |
download | profani-tty-879a47c71b82cd2a5dcea0212ed70e0c75c6e7c1.tar.gz |
OMEMO Logging
-rw-r--r-- | src/omemo/omemo.c | 9 | ||||
-rw-r--r-- | src/omemo/store.c | 2 |
2 files changed, 6 insertions, 5 deletions
diff --git a/src/omemo/omemo.c b/src/omemo/omemo.c index efc3dbfe..b0d2d8aa 100644 --- a/src/omemo/omemo.c +++ b/src/omemo/omemo.c @@ -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); session_cipher_free(cipher); 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; } 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 if (!muc) { 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) { int res; ciphertext_message* ciphertext; @@ -864,7 +865,7 @@ omemo_on_message_send(ProfWin* win, const char* const message, gboolean request_ .name_len = strlen(jid->barejid), .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 // <https://xmpp.org/extensions/xep-0384.html#encrypt>). 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); 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; } res = session_cipher_encrypt(cipher, key_tag, AES128_GCM_KEY_LENGTH + AES128_GCM_TAG_LENGTH, &ciphertext); session_cipher_free(cipher); 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; } signal_buffer* buffer = ciphertext_message_get_serialized(ciphertext); diff --git a/src/omemo/store.c b/src/omemo/store.c index d5ee521c..70fd91d3 100644 --- a/src/omemo/store.c +++ b/src/omemo/store.c @@ -85,7 +85,7 @@ load_session(signal_buffer** record, signal_buffer** user_record, device_store = g_hash_table_lookup(session_store, address->name); if (!device_store) { *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; } |