This commit is contained in:
Neil Alexander 2021-08-06 14:39:19 +01:00
parent c180fea5db
commit 0c131bf333
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -432,14 +432,11 @@ func (a *KeyInternalAPI) processOtherSignatures(
// For each key ID, write the signatures. Maybe there'll be more // For each key ID, write the signatures. Maybe there'll be more
// than one algorithm in the future so it's best not to focus on // than one algorithm in the future so it's best not to focus on
// everything being ed25519:. // everything being ed25519:.
var targetKeyID gomatrixserverlib.KeyID for targetKeyID, suppliedKeyData := range sig.Keys {
for keyID, suppliedKeyData := range sig.Keys {
targetKeyID = keyID
// The master key will be supplied in the request, but we should // The master key will be supplied in the request, but we should
// make sure that it matches what we think the master key should // make sure that it matches what we think the master key should
// actually be. // actually be.
localKeyData, lok := masterKey.Keys[keyID] localKeyData, lok := masterKey.Keys[targetKeyID]
if !lok { if !lok {
return fmt.Errorf("uploaded master key for user %q doesn't match local copy", targetUserID) return fmt.Errorf("uploaded master key for user %q doesn't match local copy", targetUserID)
} else if !bytes.Equal(suppliedKeyData, localKeyData) { } else if !bytes.Equal(suppliedKeyData, localKeyData) {