forked from Mirrors/gomuks
hicli/profile: check device signature for own cross-signing keys
This commit is contained in:
parent
544bd17a1d
commit
838a9ce106
1 changed files with 7 additions and 5 deletions
|
@ -140,13 +140,15 @@ func (h *HiClient) GetProfileView(ctx context.Context, roomID id.RoomID, userID
|
||||||
addError(fmt.Errorf("failed to get devices: %w", err))
|
addError(fmt.Errorf("failed to get devices: %w", err))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
if ownUserSigningKey != "" && theirMasterKey.Key != "" {
|
if userID == h.Account.UserID {
|
||||||
|
resp.UserTrusted, err = h.CryptoStore.IsKeySignedBy(ctx, userID, theirMasterKey.Key, userID, h.Crypto.OwnIdentity().SigningKey)
|
||||||
|
} else if ownUserSigningKey != "" && theirMasterKey.Key != "" {
|
||||||
resp.UserTrusted, err = h.CryptoStore.IsKeySignedBy(ctx, userID, theirMasterKey.Key, h.Account.UserID, ownUserSigningKey)
|
resp.UserTrusted, err = h.CryptoStore.IsKeySignedBy(ctx, userID, theirMasterKey.Key, h.Account.UserID, ownUserSigningKey)
|
||||||
|
}
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Err(err).Msg("Failed to check if user is trusted")
|
log.Err(err).Msg("Failed to check if user is trusted")
|
||||||
addError(fmt.Errorf("failed to check if user is trusted: %w", err))
|
addError(fmt.Errorf("failed to check if user is trusted: %w", err))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
resp.Devices = make([]*ProfileViewDevice, len(devices))
|
resp.Devices = make([]*ProfileViewDevice, len(devices))
|
||||||
i := 0
|
i := 0
|
||||||
for _, device := range devices {
|
for _, device := range devices {
|
||||||
|
|
Loading…
Add table
Reference in a new issue