mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Fix bugs
This commit is contained in:
parent
3c94028251
commit
ce5d9ecd3b
|
|
@ -66,8 +66,8 @@ func GetUserDevices(
|
||||||
Keys: key,
|
Keys: key,
|
||||||
}
|
}
|
||||||
|
|
||||||
if targetUser, ok := sigRes.Signatures[dev.UserID]; ok {
|
if targetUser, ok := sigRes.Signatures[userID]; ok {
|
||||||
if targetKey, ok := targetUser[gomatrixserverlib.KeyID(dev.DeviceID)]; !ok {
|
if targetKey, ok := targetUser[gomatrixserverlib.KeyID(dev.DeviceID)]; ok {
|
||||||
for sourceUserID, forSourceUser := range targetKey {
|
for sourceUserID, forSourceUser := range targetKey {
|
||||||
for sourceKeyID, sourceKey := range forSourceUser {
|
for sourceKeyID, sourceKey := range forSourceUser {
|
||||||
if _, ok := device.Keys.Signatures[sourceUserID]; !ok {
|
if _, ok := device.Keys.Signatures[sourceUserID]; !ok {
|
||||||
|
|
|
||||||
|
|
@ -17,6 +17,7 @@ package internal
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"crypto/ed25519"
|
"crypto/ed25519"
|
||||||
|
"database/sql"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
"fmt"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
@ -466,6 +467,9 @@ func (a *KeyInternalAPI) QuerySignatures(ctx context.Context, req *api.QuerySign
|
||||||
for _, targetKeyID := range forTargetUser {
|
for _, targetKeyID := range forTargetUser {
|
||||||
keyMap, err := a.DB.CrossSigningSigsForTarget(ctx, targetUserID, targetKeyID)
|
keyMap, err := a.DB.CrossSigningSigsForTarget(ctx, targetUserID, targetKeyID)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
if err == sql.ErrNoRows {
|
||||||
|
continue
|
||||||
|
}
|
||||||
res.Error = &api.KeyError{
|
res.Error = &api.KeyError{
|
||||||
Err: fmt.Sprintf("a.DB.CrossSigningSigsForTarget: %s", err),
|
Err: fmt.Sprintf("a.DB.CrossSigningSigsForTarget: %s", err),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue