0
0
Fork 0
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:
Neil Alexander 2022-04-25 17:25:27 +01:00
parent aad81b7b4d
commit e94b989f37
No known key found for this signature in database
GPG key ID: A02A2019A2BB0944

View file

@ -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(