Skip to content

Commit 22d9125

Browse files
committed
Resolve trust when checking if key sharing is allowed
1 parent 04072cb commit 22d9125

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mautrix/bridge/e2ee.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -132,9 +132,9 @@ async def allow_key_share(self, device: DeviceIdentity, request: RequestedKeyInf
132132
f"Rejecting key request from blacklisted device "
133133
f"{device.user_id}/{device.device_id}",
134134
code=RoomKeyWithheldCode.BLACKLISTED,
135-
reason="You have been blacklisted by this device",
135+
reason="Your device has been blacklisted by the bridge",
136136
)
137-
elif device.trust >= self.crypto.share_keys_min_trust:
137+
elif await self.crypto.resolve_trust(device) >= self.crypto.share_keys_min_trust:
138138
portal = await self.bridge.get_portal(request.room_id)
139139
if portal is None:
140140
raise RejectKeyShare(
@@ -161,7 +161,7 @@ async def allow_key_share(self, device: DeviceIdentity, request: RequestedKeyInf
161161
f"Rejecting key request from unverified device "
162162
f"{device.user_id}/{device.device_id}",
163163
code=RoomKeyWithheldCode.UNVERIFIED,
164-
reason="You have not been verified by this device",
164+
reason="Your device is not trusted by the bridge",
165165
)
166166

167167
def _ignore_user(self, user_id: str) -> bool:

0 commit comments

Comments
 (0)