Always use local keypair instead of trying to find our own keys in cache

This commit is contained in:
Lambda 2024-09-13 14:49:41 +00:00
parent 458a7458dc
commit 296824fef4
2 changed files with 10 additions and 3 deletions

View file

@ -171,6 +171,11 @@ This will be the first release of Grapevine since it was forked from Conduit
16. Fix bug where signing keys would not be fetched when joining a room if we
hadn't previously seen any signing keys from that server.
([!87](https://gitlab.computer.surgery/matrix/grapevine-fork/-/merge_requests/87))
17. Fixed bug
([#48](https://gitlab.computer.surgery/matrix/grapevine-fork/-/issues/48))
that caused us to attempt to fetch our own signing keys from ourselves over
federation, and fail ("Won't send federation request to ourselves").
([!96](https://gitlab.computer.surgery/matrix/grapevine-fork/-/merge_requests/96))
### Added

View file

@ -435,9 +435,11 @@ impl Service {
&self,
origin: &ServerName,
) -> Result<Option<SigningKeys>> {
Ok(self.db.signing_keys_for(origin)?.or_else(|| {
(origin == self.server_name()).then(SigningKeys::load_own_keys)
}))
if origin == self.server_name() {
Ok(Some(SigningKeys::load_own_keys()))
} else {
self.db.signing_keys_for(origin)
}
}
/// Filters the key map of multiple servers down to keys that should be