mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 20:48:52 +03:00
Add additional check for invalid megolm sessions
This commit is contained in:
parent
d46f916cc1
commit
4dd5f9841d
3 changed files with 6 additions and 2 deletions
|
@ -385,7 +385,7 @@ if(USE_BUNDLED_MTXCLIENT)
|
||||||
FetchContent_Declare(
|
FetchContent_Declare(
|
||||||
MatrixClient
|
MatrixClient
|
||||||
GIT_REPOSITORY https://github.com/Nheko-Reborn/mtxclient.git
|
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_EXAMPLES OFF CACHE INTERNAL "")
|
||||||
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")
|
set(BUILD_LIB_TESTS OFF CACHE INTERNAL "")
|
||||||
|
|
|
@ -163,7 +163,7 @@ modules:
|
||||||
buildsystem: cmake-ninja
|
buildsystem: cmake-ninja
|
||||||
name: mtxclient
|
name: mtxclient
|
||||||
sources:
|
sources:
|
||||||
- commit: b452a984b0fc522c21bb8df7d320bf13960974d0
|
- commit: 4a598632f432953f4dbfacf6cfed4f85a1c59c5a
|
||||||
type: git
|
type: git
|
||||||
url: https://github.com/Nheko-Reborn/mtxclient.git
|
url: https://github.com/Nheko-Reborn/mtxclient.git
|
||||||
- config-opts:
|
- config-opts:
|
||||||
|
|
|
@ -1129,6 +1129,10 @@ decryptEvent(const MegolmSessionIndex &index,
|
||||||
std::string msg_str;
|
std::string msg_str;
|
||||||
try {
|
try {
|
||||||
auto session = cache::client()->getInboundMegolmSession(index);
|
auto session = cache::client()->getInboundMegolmSession(index);
|
||||||
|
if (!session) {
|
||||||
|
return {DecryptionErrorCode::MissingSession, std::nullopt, std::nullopt};
|
||||||
|
}
|
||||||
|
|
||||||
auto sessionData =
|
auto sessionData =
|
||||||
cache::client()->getMegolmSessionData(index).value_or(GroupSessionData{});
|
cache::client()->getMegolmSessionData(index).value_or(GroupSessionData{});
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue