From 296824fef4bd83d89e1983fe8c31a44cee65c995 Mon Sep 17 00:00:00 2001 From: Lambda Date: Fri, 13 Sep 2024 14:49:41 +0000 Subject: [PATCH] Always use local keypair instead of trying to find our own keys in cache --- book/changelog.md | 5 +++++ src/service/globals.rs | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/book/changelog.md b/book/changelog.md index 3b0f49b3..aadaf9d1 100644 --- a/book/changelog.md +++ b/book/changelog.md @@ -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 diff --git a/src/service/globals.rs b/src/service/globals.rs index dad08d32..b4ccba9d 100644 --- a/src/service/globals.rs +++ b/src/service/globals.rs @@ -435,9 +435,11 @@ impl Service { &self, origin: &ServerName, ) -> Result> { - 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