forked from mirror/grapevine
Fix bug when retrieving keys for an event.
It's possible for a server to have multiple associated public keys. This can happen when a Matrix server is set up on a particular domain, its key is lost, and the server continues running on the domain. Now there will be two keys associated to the domain. The old logic wouldn't fetch the new key if we already had the old key cached. The new logic will fetch any keys we don't have that we need, rather than just fetching one key per server.
This commit is contained in:
parent
2db3b18ce8
commit
1b13d7f7ab
1 changed files with 6 additions and 1 deletions
|
@ -1682,8 +1682,13 @@ impl Service {
|
|||
)
|
||||
})?;
|
||||
|
||||
// check that we have the server in our list already, or
|
||||
// all `signature_ids` are in pub_key_map
|
||||
// if yes, we don't have to do anything
|
||||
if servers.contains_key(origin)
|
||||
|| pub_key_map.contains_key(origin.as_str())
|
||||
|| pub_key_map
|
||||
.get(origin.as_str())
|
||||
.is_some_and(contains_all_ids)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue