From dc58a7878faf1ee567e0f1239d8c8869502fd03d Mon Sep 17 00:00:00 2001 From: Rory& Date: Fri, 5 Dec 2025 13:49:02 +0100 Subject: Federation work --- .../Controllers/Spec/FederationKeysController.cs | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'Utilities/LibMatrix.FederationTest/Controllers/Spec') diff --git a/Utilities/LibMatrix.FederationTest/Controllers/Spec/FederationKeysController.cs b/Utilities/LibMatrix.FederationTest/Controllers/Spec/FederationKeysController.cs index 6516415..d96bef5 100644 --- a/Utilities/LibMatrix.FederationTest/Controllers/Spec/FederationKeysController.cs +++ b/Utilities/LibMatrix.FederationTest/Controllers/Spec/FederationKeysController.cs @@ -23,18 +23,19 @@ public class FederationKeysController(FederationTestConfiguration config, Federa if (_cachedServerKeysResponse == null || _cachedServerKeysResponse.TypedContent.ValidUntil < DateTime.Now + TimeSpan.FromSeconds(30)) { var keys = keyStore.GetCurrentSigningKey(); _cachedServerKeysResponse = new ServerKeysResponse() { - ValidUntil = DateTime.Now + TimeSpan.FromMinutes(1), + ValidUntil = DateTime.Now + TimeSpan.FromMinutes(5), ServerName = config.ServerName, OldVerifyKeys = [], VerifyKeysById = new() { { - new() { Algorithm = "ed25519", KeyId = "0" }, new ServerKeysResponse.CurrentVerifyKey() { - Key = keys.publicKey.ToUnpaddedBase64(), + keys.CurrentSigningKey.KeyId, new ServerKeysResponse.CurrentVerifyKey() { + Key = keys.CurrentSigningKey.PublicKey //.ToUnpaddedBase64(), } } } - }.Sign(config.ServerName, new VersionedKeyId() { Algorithm = "ed25519", KeyId = "0" }, keys.privateKey); + }.Sign(keys.CurrentSigningKey); } + _serverKeyCacheLock.Release(); return _cachedServerKeysResponse; -- cgit 1.5.1