mirror of
https://github.com/1f349/dendrite.git
synced 2024-11-22 11:41:38 +00:00
Tweak /key/v2/server
This commit is contained in:
parent
9b8bb55430
commit
deddf686b9
@ -146,10 +146,10 @@ func localKeys(cfg *config.FederationAPI, serverName gomatrixserverlib.ServerNam
|
|||||||
var keys gomatrixserverlib.ServerKeys
|
var keys gomatrixserverlib.ServerKeys
|
||||||
var virtualHost *config.VirtualHost
|
var virtualHost *config.VirtualHost
|
||||||
for _, v := range cfg.Matrix.VirtualHosts {
|
for _, v := range cfg.Matrix.VirtualHosts {
|
||||||
if v.ServerName != serverName {
|
if v.ServerName == serverName {
|
||||||
continue
|
|
||||||
}
|
|
||||||
virtualHost = v
|
virtualHost = v
|
||||||
|
break
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if virtualHost == nil {
|
if virtualHost == nil {
|
||||||
@ -188,14 +188,15 @@ func localKeys(cfg *config.FederationAPI, serverName gomatrixserverlib.ServerNam
|
|||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
keys.Raw, err = gomatrixserverlib.SignJSON(
|
identity, err := cfg.Matrix.SigningIdentityFor(serverName)
|
||||||
string(serverName), cfg.Matrix.KeyID, cfg.Matrix.PrivateKey, toSign,
|
|
||||||
)
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, err
|
return nil, err
|
||||||
}
|
}
|
||||||
|
|
||||||
return &keys, nil
|
keys.Raw, err = gomatrixserverlib.SignJSON(
|
||||||
|
string(identity.ServerName), identity.KeyID, identity.PrivateKey, toSign,
|
||||||
|
)
|
||||||
|
return &keys, err
|
||||||
}
|
}
|
||||||
|
|
||||||
func NotaryKeys(
|
func NotaryKeys(
|
||||||
|
Loading…
Reference in New Issue
Block a user