diff options
author | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-08-13 18:01:16 +0200 |
---|---|---|
committer | Nicolas Werner <nicolas.werner@hotmail.de> | 2022-08-13 18:01:16 +0200 |
commit | 1cfbac4c92cca260f7c272ea9e0c74d6817820a8 (patch) | |
tree | b2bc2804373c0f4611117da7907a32871973d369 /src | |
parent | Fix crash when fetching global profile (diff) | |
download | nheko-1cfbac4c92cca260f7c272ea9e0c74d6817820a8.tar.xz |
Fix crash when device has no keys to verify
Diffstat (limited to 'src')
-rw-r--r-- | src/Cache.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/Cache.cpp b/src/Cache.cpp index c2c59066..558eb334 100644 --- a/src/Cache.cpp +++ b/src/Cache.cpp @@ -4381,6 +4381,14 @@ Cache::updateUserKeys(const std::string &sync_token, const mtx::responses::Query nhlog::crypto()->warn("device {}:{} has no signature", user, device_id); continue; } + if (!device_keys.keys.count(device_signing_key) || + !device_keys.keys.count("curve25519:" + device_id)) { + nhlog::crypto()->warn( + "Device key has no curve25519 or ed25519 key {}:{}", + user, + device_id); + continue; + } if (!mtx::crypto::ed25519_verify_signature( device_keys.keys.at(device_signing_key), |