From 911b461e5d25a30fea1174e6d9b7b9303a21e011 Mon Sep 17 00:00:00 2001 From: Nicolas Werner Date: Tue, 20 Oct 2020 21:35:49 +0200 Subject: [PATCH] Fix corrupt channel + add additional debugging --- CMakeLists.txt | 2 +- io.github.NhekoReborn.Nheko.json | 2 +- src/Olm.cpp | 9 +++++++++ 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4f6a6a38..2fa839be 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -340,7 +340,7 @@ if(USE_BUNDLED_MTXCLIENT) FetchContent_Declare( MatrixClient GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git - GIT_TAG da9958e14e035fbf22d498074d381b2ea0092a9d + GIT_TAG 6432e89a3465e58ed838dd2abdcb0f91bd4f05b0 ) FetchContent_MakeAvailable(MatrixClient) else() diff --git a/io.github.NhekoReborn.Nheko.json b/io.github.NhekoReborn.Nheko.json index 5f08dee0..c461ceaa 100644 --- a/io.github.NhekoReborn.Nheko.json +++ b/io.github.NhekoReborn.Nheko.json @@ -146,7 +146,7 @@ "name": "mtxclient", "sources": [ { - "commit": "da9958e14e035fbf22d498074d381b2ea0092a9d", + "commit": "6432e89a3465e58ed838dd2abdcb0f91bd4f05b0", "type": "git", "url": "https://github.com/Nheko-Reborn/mtxclient.git" } diff --git a/src/Olm.cpp b/src/Olm.cpp index 79b00774..d6e8c10b 100644 --- a/src/Olm.cpp +++ b/src/Olm.cpp @@ -246,6 +246,8 @@ handle_pre_key_olm_message(const std::string &sender, nhlog::crypto()->debug("decrypted message: \n {}", plaintext.dump(2)); try { + nhlog::crypto()->debug("New olm session: {}", + mtx::crypto::session_id(inbound_session.get())); cache::saveOlmSession( sender_key, std::move(inbound_session), QDateTime::currentMSecsSinceEpoch()); } catch (const lmdb::error &e) { @@ -315,6 +317,8 @@ try_olm_decryption(const std::string &sender_key, const mtx::events::msg::OlmCip try { text = olm::client()->decrypt_message(session->get(), msg.type, msg.body); + nhlog::crypto()->debug("Updated olm session: {}", + mtx::crypto::session_id(session->get())); cache::saveOlmSession( id, std::move(session.value()), QDateTime::currentMSecsSinceEpoch()); } catch (const mtx::crypto::olm_exception &e) { @@ -651,6 +655,8 @@ send_encrypted_to_device_messages(const std::map(); try { + nhlog::crypto()->debug("Updated olm session: {}", + mtx::crypto::session_id(session->get())); cache::saveOlmSession(d.keys.at("curve25519:" + device), std::move(*session), QDateTime::currentMSecsSinceEpoch()); @@ -722,6 +728,9 @@ send_encrypted_to_device_messages(const std::map(); try { + nhlog::crypto()->debug( + "Updated olm session: {}", + mtx::crypto::session_id(session.get())); cache::saveOlmSession( id_key, std::move(session),