This commit is contained in:
Neil Alexander 2022-10-24 09:49:48 +01:00
parent 9205681d58
commit 5cd2632f39
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -257,8 +257,6 @@ func (a *KeyInternalAPI) QueryKeys(ctx context.Context, req *api.QueryKeysReques
res.UserSigningKeys = make(map[string]gomatrixserverlib.CrossSigningKey) res.UserSigningKeys = make(map[string]gomatrixserverlib.CrossSigningKey)
res.Failures = make(map[string]interface{}) res.Failures = make(map[string]interface{})
logrus.Print("QueryKeys:", req.UserID, req.Timeout, req.UserToDevices)
// make a map from domain to device keys // make a map from domain to device keys
domainToDeviceKeys := make(map[string]map[string][]string) domainToDeviceKeys := make(map[string]map[string][]string)
domainToCrossSigningKeys := make(map[string]map[string]struct{}) domainToCrossSigningKeys := make(map[string]map[string]struct{})
@ -335,7 +333,8 @@ func (a *KeyInternalAPI) QueryKeys(ctx context.Context, req *api.QueryKeysReques
a.queryRemoteKeys(ctx, req.Timeout, res, domainToDeviceKeys, domainToCrossSigningKeys) a.queryRemoteKeys(ctx, req.Timeout, res, domainToDeviceKeys, domainToCrossSigningKeys)
} }
// get cross-signing keys from the database // Now that we've done the potentially expensive work of asking the federation,
// try filling the cross-signing keys from the database that we know about.
a.crossSigningKeysFromDatabase(ctx, req, res) a.crossSigningKeysFromDatabase(ctx, req, res)
// Finally, append signatures that we know about // Finally, append signatures that we know about