mirror of
https://github.com/matrix-org/dendrite
synced 2025-01-19 00:31:59 +01:00
Find the complete key ID when uploading signatures
This commit is contained in:
parent
aad81b7b4d
commit
e94b989f37
1 changed files with 12 additions and 0 deletions
|
@ -362,6 +362,12 @@ func (a *KeyInternalAPI) processSelfSignatures(
|
|||
for targetKeyID, signature := range forTargetUserID {
|
||||
switch sig := signature.CrossSigningBody.(type) {
|
||||
case *gomatrixserverlib.CrossSigningKey:
|
||||
for keyID := range sig.Keys {
|
||||
if gomatrixserverlib.KeyID(strings.SplitN(string(keyID), ":", 1)[1]) == keyID {
|
||||
targetKeyID = keyID // contains the ed25519: or other scheme
|
||||
break
|
||||
}
|
||||
}
|
||||
for originUserID, forOriginUserID := range sig.Signatures {
|
||||
for originKeyID, originSig := range forOriginUserID {
|
||||
if err := a.DB.StoreCrossSigningSigsForTarget(
|
||||
|
@ -373,6 +379,12 @@ func (a *KeyInternalAPI) processSelfSignatures(
|
|||
}
|
||||
|
||||
case *gomatrixserverlib.DeviceKeys:
|
||||
for keyID := range sig.Keys {
|
||||
if gomatrixserverlib.KeyID(strings.SplitN(string(keyID), ":", 1)[1]) == keyID {
|
||||
targetKeyID = keyID // contains the ed25519: or other scheme
|
||||
break
|
||||
}
|
||||
}
|
||||
for originUserID, forOriginUserID := range sig.Signatures {
|
||||
for originKeyID, originSig := range forOriginUserID {
|
||||
if err := a.DB.StoreCrossSigningSigsForTarget(
|
||||
|
|
Loading…
Add table
Reference in a new issue