mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-23 03:18:49 +03:00
Make error case with unverified master key more descriptive
This commit is contained in:
parent
bf9601018d
commit
99f3296a64
1 changed files with 13 additions and 7 deletions
|
@ -4442,13 +4442,19 @@ Cache::verificationStatus_(const std::string &user_id, lmdb::txn &txn)
|
||||||
// Update verified devices count to count without cross-signing
|
// Update verified devices count to count without cross-signing
|
||||||
updateUnverifiedDevices(theirKeys->device_keys);
|
updateUnverifiedDevices(theirKeys->device_keys);
|
||||||
|
|
||||||
if (!mtx::crypto::ed25519_verify_signature(
|
{
|
||||||
olm::client()->identity_keys().ed25519,
|
auto &mk = ourKeys->master_keys;
|
||||||
json(ourKeys->master_keys),
|
std::string dev_id = "ed25519:" + http::client()->device_id();
|
||||||
ourKeys->master_keys.signatures.at(local_user)
|
if (!mk.signatures.count(local_user) ||
|
||||||
.at("ed25519:" + http::client()->device_id()))) {
|
!mk.signatures.at(local_user).count(dev_id) ||
|
||||||
verification_storage.status[user_id] = status;
|
!mtx::crypto::ed25519_verify_signature(
|
||||||
return status;
|
olm::client()->identity_keys().ed25519,
|
||||||
|
json(mk),
|
||||||
|
mk.signatures.at(local_user).at(dev_id))) {
|
||||||
|
nhlog::crypto()->debug("We have not verified our own master key");
|
||||||
|
verification_storage.status[user_id] = status;
|
||||||
|
return status;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
auto master_keys = ourKeys->master_keys.keys;
|
auto master_keys = ourKeys->master_keys.keys;
|
||||||
|
|
Loading…
Reference in a new issue