Add additional check for invalid megolm sessions

pull/755/head
Nicolas Werner 3 years ago
parent d46f916cc1
commit 4dd5f9841d
No known key found for this signature in database
GPG Key ID: C8D75E610773F2D9
  1. 2
      CMakeLists.txt
  2. 2
      io.github.NhekoReborn.Nheko.yaml
  3. 4
      src/Olm.cpp

@ -385,7 +385,7 @@ if(USE_BUNDLED_MTXCLIENT)
FetchContent_Declare(
MatrixClient
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
GIT_TAG b452a984b0fc522c21bb8df7d320bf13960974d0
GIT_TAG 4a598632f432953f4dbfacf6cfed4f85a1c59c5a
)
set(BUILD_LIB_EXAMPLES OFF CACHE INTERNAL "")
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")

@ -163,7 +163,7 @@ modules:
buildsystem: cmake-ninja
name: mtxclient
sources:
- commit: b452a984b0fc522c21bb8df7d320bf13960974d0
- commit: 4a598632f432953f4dbfacf6cfed4f85a1c59c5a
type: git
url: https://github.com/Nheko-Reborn/mtxclient.git
- config-opts:

@ -1129,6 +1129,10 @@ decryptEvent(const MegolmSessionIndex &index,
std::string msg_str;
try {
auto session = cache::client()->getInboundMegolmSession(index);
if (!session) {
return {DecryptionErrorCode::MissingSession, std::nullopt, std::nullopt};
}
auto sessionData =
cache::client()->getMegolmSessionData(index).value_or(GroupSessionData{});

Loading…
Cancel
Save