mirror of
https://github.com/tulir/gomuks.git
synced 2025-04-20 10:33:41 -05:00
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))
|
||||
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)
|
||||
}
|
||||
if err != nil {
|
||||
log.Err(err).Msg("Failed to check if user is trusted")
|
||||
addError(fmt.Errorf("failed to check if user is trusted: %w", err))
|
||||
}
|
||||
}
|
||||
resp.Devices = make([]*ProfileViewDevice, len(devices))
|
||||
i := 0
|
||||
for _, device := range devices {
|
||||
|
|
Loading…
Add table
Reference in a new issue