mirror of
https://github.com/hoernschen/dendrite.git
synced 2025-07-31 21:32:46 +00:00
Remove TLS fingerprints, improve perspective unmarshal handling (#1452)
* Add prefer_direct_fetch option * Update gomatrixserverlib * Update gomatrixserverlib * Update gomatrixserverlib * Don't deal in TLS fingerprints anymore
This commit is contained in:
parent
43cdba9a69
commit
f290e92a34
10 changed files with 34 additions and 58 deletions
|
@ -191,7 +191,7 @@ func (s *ServerKeyAPI) handleFetcherKeys(
|
|||
// Try to fetch the keys.
|
||||
fetcherResults, err := fetcher.FetchKeys(fetcherCtx, requests)
|
||||
if err != nil {
|
||||
return err
|
||||
return fmt.Errorf("fetcher.FetchKeys: %w", err)
|
||||
}
|
||||
|
||||
// Build a map of the results that we want to commit to the
|
||||
|
|
|
@ -51,15 +51,26 @@ func NewInternalAPI(
|
|||
ServerKeyValidity: cfg.Matrix.KeyValidityPeriod,
|
||||
FedClient: fedClient,
|
||||
OurKeyRing: gomatrixserverlib.KeyRing{
|
||||
KeyFetchers: []gomatrixserverlib.KeyFetcher{
|
||||
&gomatrixserverlib.DirectKeyFetcher{
|
||||
Client: fedClient,
|
||||
},
|
||||
},
|
||||
KeyFetchers: []gomatrixserverlib.KeyFetcher{},
|
||||
KeyDatabase: serverKeyDB,
|
||||
},
|
||||
}
|
||||
|
||||
addDirectFetcher := func() {
|
||||
internalAPI.OurKeyRing.KeyFetchers = append(
|
||||
internalAPI.OurKeyRing.KeyFetchers,
|
||||
&gomatrixserverlib.DirectKeyFetcher{
|
||||
Client: fedClient,
|
||||
},
|
||||
)
|
||||
}
|
||||
|
||||
if cfg.PreferDirectFetch {
|
||||
addDirectFetcher()
|
||||
} else {
|
||||
defer addDirectFetcher()
|
||||
}
|
||||
|
||||
var b64e = base64.StdEncoding.WithPadding(base64.NoPadding)
|
||||
for _, ps := range cfg.KeyPerspectives {
|
||||
perspective := &gomatrixserverlib.PerspectiveKeyFetcher{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue