e2ee should not hinder verification#1598
e2ee should not hinder verification#1598BillCarsonFr wants to merge 1 commit intomatrix-org:developfrom
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## develop #1598 +/- ##
===========================================
- Coverage 13.48% 13.48% -0.01%
===========================================
Files 541 541
Lines 86690 86712 +22
Branches 36828 36842 +14
===========================================
Hits 11693 11693
- Misses 74555 74577 +22
Partials 442 442 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
| @return a MXHTTPOperation instance. May be nil if all required materials is already in place. | ||
| */ | ||
| - (MXHTTPOperation*)ensureSessionForUsers:(NSArray<NSString*>*)users | ||
| - (MXHTTPOperation*)ensureSessionForUsers:(NSArray<NSString*>*)users forceDistributeToUnverified: (BOOL) forceDistributeToUnverified |
There was a problem hiding this comment.
Sadly we don't have obj-c style checker / formatter to check this automatically, but to aligh the style:
- no spaces between type and parameter, i.e.
forceDistributeToUnverified: (BOOL) forceDistributeToUnverified=>forceDistributeToUnverified:(BOOL)forceDistributeToUnverified(across the whole PR) - if some parameters are on multiple lines (e.g.
successandfailure), then all should be, inclforceDistributeToUnverified, and aligned vertically by the double colon
| @@ -166,6 +190,7 @@ - (BOOL)isSessionSharingHistory:(MXOutboundSessionInfo *)session | |||
| @param failure A block object called when the operation fails. | |||
| */ | |||
| - (MXHTTPOperation *)getDevicesInRoom:(NSArray<NSString*>*)users | |||
There was a problem hiding this comment.
This method includes documentation above so would be good to include the new parameter. Also perhaps just a matter of personal preference, but the method getDevicesInRoom does not suggest anything about distributing keys so perhaps the new parameter would be clearer as includeUnverifiedUsers rather than forceDistributeToUnverified
|
|
||
| if (deviceInfo.trustLevel.localVerificationStatus == MXDeviceBlocked | ||
| || (!deviceInfo.trustLevel.isVerified && encryptToVerifiedDevicesOnly)) | ||
| || (!deviceInfo.trustLevel.isVerified && encryptToVerifiedDevicesOnly && !forceDistributeToUnverified)) |
There was a problem hiding this comment.
I think it would be better / cleaner to include this extra condition in the BOOL encryptToVerifiedDevicesOnly = declaration.
| } | ||
|
|
||
| - (MXHTTPOperation*)ensureSessionForUsers:(NSArray<NSString*>*)users | ||
| - (BOOL) isVerificationEvent:(MXEventTypeString) eventType eventContent:(NSDictionary*)eventContent |
There was a problem hiding this comment.
Optionally this whole method could be moved into MXTools, as [MXTools isVerificationEvent], which will make it easier to unit test
Pull Request Checklist
Fixes #6519
Verification events sent in e2ee rooms should bypass the encrypt to verified devices only option. If not it renders verification impossible.
Motivation and context
As per spec: