diff --git a/Riot/AppDelegate.m b/Riot/AppDelegate.m index 881604cb0..bfc43f50c 100644 --- a/Riot/AppDelegate.m +++ b/Riot/AppDelegate.m @@ -2719,8 +2719,8 @@ NSString *const AppDelegateDidValidateEmailNotificationClientSecretKey = @"AppDe } } - // Do not warn for unknown devices if cross-signing is enabled - mxSession.crypto.warnOnUnknowDevices = !RiotSettings.shared.enableCrossSigning; + // Do not warn for unknown devices. We have cross-signing now + mxSession.crypto.warnOnUnknowDevices = NO; // Register to user new device sign in notification [self registerUserDidSignInOnNewDeviceNotificationForSession:mxSession]; diff --git a/Riot/Assets/en.lproj/Vector.strings b/Riot/Assets/en.lproj/Vector.strings index 20d5606cb..3087b16ab 100644 --- a/Riot/Assets/en.lproj/Vector.strings +++ b/Riot/Assets/en.lproj/Vector.strings @@ -478,7 +478,6 @@ "settings_labs_room_members_lazy_loading_error_message" = "Your homeserver does not support lazy loading of room members yet. Try later."; "settings_labs_create_conference_with_jitsi" = "Create conference calls with jitsi"; "settings_labs_message_reaction" = "React to messages with emoji"; -"settings_labs_enable_cross_signing" = "Enable cross-signing to verify per-user instead of per-device (in development)"; "settings_version" = "Version %@"; "settings_olm_version" = "Olm Version %@"; diff --git a/Riot/Generated/Strings.swift b/Riot/Generated/Strings.swift index eed0fca04..a9f919120 100644 --- a/Riot/Generated/Strings.swift +++ b/Riot/Generated/Strings.swift @@ -3250,10 +3250,6 @@ internal enum VectorL10n { internal static var settingsLabsE2eEncryptionPromptMessage: String { return VectorL10n.tr("Vector", "settings_labs_e2e_encryption_prompt_message") } - /// Enable cross-signing to verify per-user instead of per-device (in development) - internal static var settingsLabsEnableCrossSigning: String { - return VectorL10n.tr("Vector", "settings_labs_enable_cross_signing") - } /// React to messages with emoji internal static var settingsLabsMessageReaction: String { return VectorL10n.tr("Vector", "settings_labs_message_reaction") diff --git a/Riot/Managers/Settings/RiotSettings.swift b/Riot/Managers/Settings/RiotSettings.swift index 21dd9ec1a..271c053bf 100644 --- a/Riot/Managers/Settings/RiotSettings.swift +++ b/Riot/Managers/Settings/RiotSettings.swift @@ -32,7 +32,6 @@ final class RiotSettings: NSObject { static let pinRoomsWithUnreadMessages = "pinRoomsWithUnread" static let allowStunServerFallback = "allowStunServerFallback" static let stunServerFallback = "stunServerFallback" - static let enableCrossSigning = "enableCrossSigning" static let enableDMKeyVerification = "enableDMKeyVerification" } @@ -117,14 +116,6 @@ final class RiotSettings: NSObject { } } - var enableCrossSigning: Bool { - get { - return UserDefaults.standard.bool(forKey: UserDefaultsKeys.enableCrossSigning) - } set { - UserDefaults.standard.set(newValue, forKey: UserDefaultsKeys.enableCrossSigning) - } - } - // MARK: Calls /// Indicate if `allowStunServerFallback` settings has been set once. diff --git a/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m b/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m index 2736c15be..3f4399f55 100644 --- a/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m +++ b/Riot/Modules/Room/Members/Detail/RoomMemberDetailsViewController.m @@ -32,7 +32,6 @@ #define TABLEVIEW_ROW_CELL_HEIGHT 46 #define TABLEVIEW_SECTION_HEADER_HEIGHT 28 -#define TABLEVIEW_SECTION_HEADER_HEIGHT_WHEN_HIDDEN 0.01f @interface RoomMemberDetailsViewController () { @@ -453,37 +452,6 @@ [directChatsArray addObject:directRoomId]; } } - - // Retrieve member's devices - __weak typeof(self) weakSelf = self; - - if (!RiotSettings.shared.enableCrossSigning) - { - [self.mxRoom.mxSession.crypto downloadKeys:@[userId] forceDownload:NO success:^(MXUsersDevicesMap *usersDevicesInfoMap, NSDictionary *crossSigningKeysMap) { - - if (weakSelf) - { - // Restore the status bar - typeof(self) self = weakSelf; - self->devicesArray = usersDevicesInfoMap.map[userId].allValues; - // Reload the full table to take into account a potential change on a device status. - [super updateMemberInfo]; - } - - } failure:^(NSError *error) { - - NSLog(@"[RoomMemberDetailsVC] Crypto failed to download device info for user: %@", userId); - if (weakSelf) - { - // Restore the status bar - typeof(self) self = weakSelf; - // Notify the end user - NSString *myUserId = self.mainSession.myUser.userId; - [[NSNotificationCenter defaultCenter] postNotificationName:kMXKErrorNotification object:error userInfo:myUserId ? @{kMXKErrorUserIdKey: myUserId} : nil]; - } - - }]; - } } // Complete data update and reload table view @@ -705,18 +673,15 @@ } } - if (RiotSettings.shared.enableCrossSigning) + if (self.mxRoom.summary.isEncrypted) { - if (self.mxRoom.summary.isEncrypted) - { - securityActionsArray = @[@(MXKRoomMemberDetailsActionSecurity), - @(MXKRoomMemberDetailsActionSecurityInformation)]; - - } - else - { - securityActionsArray = @[@(MXKRoomMemberDetailsActionSecurity)]; - } + securityActionsArray = @[@(MXKRoomMemberDetailsActionSecurity), + @(MXKRoomMemberDetailsActionSecurityInformation)]; + + } + else + { + securityActionsArray = @[@(MXKRoomMemberDetailsActionSecurity)]; } securityIndex = adminToolsIndex = otherActionsIndex = directChatsIndex = devicesIndex = -1; @@ -785,7 +750,7 @@ { return NSLocalizedStringFromTable(@"room_participants_action_section_admin_tools", @"Vector", nil); } - else if (RiotSettings.shared.enableCrossSigning && section == otherActionsIndex) + else if (section == otherActionsIndex) { return NSLocalizedStringFromTable(@"room_participants_action_section_other", @"Vector", nil); } @@ -1053,11 +1018,6 @@ - (CGFloat)tableView:(UITableView *)tableView heightForHeaderInSection:(NSInteger)section { - if (!RiotSettings.shared.enableCrossSigning && section == otherActionsIndex) - { - return TABLEVIEW_SECTION_HEADER_HEIGHT_WHEN_HIDDEN; - } - return TABLEVIEW_SECTION_HEADER_HEIGHT; } diff --git a/Riot/Modules/Settings/SettingsViewController.m b/Riot/Modules/Settings/SettingsViewController.m index dd5c79285..57a8af177 100644 --- a/Riot/Modules/Settings/SettingsViewController.m +++ b/Riot/Modules/Settings/SettingsViewController.m @@ -135,7 +135,6 @@ enum { LABS_USE_ROOM_MEMBERS_LAZY_LOADING_INDEX = 0, LABS_USE_JITSI_WIDGET_INDEX, - LABS_CROSS_SIGNING_INDEX, LABS_COUNT }; @@ -2184,19 +2183,6 @@ SettingsIdentityServerCoordinatorBridgePresenterDelegate> [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleJitsiForConference:) forControlEvents:UIControlEventTouchUpInside]; - cell = labelAndSwitchCell; - } - else if (row == LABS_CROSS_SIGNING_INDEX) - { - MXKTableViewCellWithLabelAndSwitch* labelAndSwitchCell = [self getLabelAndSwitchCell:tableView forIndexPath:indexPath]; - - labelAndSwitchCell.mxkLabel.text = NSLocalizedStringFromTable(@"settings_labs_enable_cross_signing", @"Vector", nil); - labelAndSwitchCell.mxkSwitch.on = RiotSettings.shared.enableCrossSigning; - labelAndSwitchCell.mxkSwitch.onTintColor = ThemeService.shared.theme.tintColor; - labelAndSwitchCell.mxkSwitch.enabled = YES; - - [labelAndSwitchCell.mxkSwitch addTarget:self action:@selector(toggleLabsCrossSigning:) forControlEvents:UIControlEventTouchUpInside]; - cell = labelAndSwitchCell; } } @@ -3050,15 +3036,6 @@ SettingsIdentityServerCoordinatorBridgePresenterDelegate> [self.tableView reloadData]; } } - -- (void)toggleLabsCrossSigning:(id)sender -{ - UISwitch *switchButton = (UISwitch*)sender; - - RiotSettings.shared.enableCrossSigning = switchButton.isOn; - - self.mainSession.crypto.warnOnUnknowDevices = !RiotSettings.shared.enableCrossSigning; -} - (void)togglePinRoomsWithMissedNotif:(id)sender {