Skip to content

Commit

Permalink
Deprecate MXLegacyCrypto
Browse files Browse the repository at this point in the history
  • Loading branch information
Anderas committed Apr 18, 2023
1 parent 1e292eb commit 11d2dee
Show file tree
Hide file tree
Showing 30 changed files with 66 additions and 928 deletions.
23 changes: 12 additions & 11 deletions Config/CommonConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ class CommonConfiguration: NSObject, Configurable {

sdkOptions.enableNewClientInformationFeature = RiotSettings.shared.enableClientInformationFeature

// Configure Crypto SDK feature deciding which crypto module to use
sdkOptions.cryptoSDKFeature = CryptoSDKFeature.shared
sdkOptions.cryptoMigrationDelegate = self
}

private func makeASCIIUserAgent() -> String? {
Expand Down Expand Up @@ -168,14 +167,16 @@ class CommonConfiguration: NSObject, Configurable {
if RiotSettings.shared.allowStunServerFallback, let stunServerFallback = BuildSettings.stunServerFallbackUrlString {
callManager.fallbackSTUNServer = stunServerFallback
}
}
}

extension CommonConfiguration: MXCryptoV2MigrationDelegate {
var needsVerificationUpgrade: Bool {
get {
RiotSettings.shared.showVerificationUpgradeAlert
}
set {
RiotSettings.shared.showVerificationUpgradeAlert = newValue
}
}


// MARK: - Per loaded matrix session settings

func setupSettingsWhenLoaded(for matrixSession: MXSession) {
// Do not warn for unknown devices. We have cross-signing now
(matrixSession.crypto as? MXLegacyCrypto)?.warnOnUnknowDevices = false
}

}
3 changes: 0 additions & 3 deletions Config/Configurable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,4 @@ import MatrixSDK

// MARK: - Per matrix session settings
func setupSettings(for matrixSession: MXSession)

// MARK: - Per loaded matrix session settings
func setupSettingsWhenLoaded(for matrixSession: MXSession)
}
4 changes: 2 additions & 2 deletions Podfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ use_frameworks!
# - `{ :specHash => {sdk spec hash}` to depend on specific pod options (:git => …, :podspec => …) for MatrixSDK repo. Used by Fastfile during CI
#
# Warning: our internal tooling depends on the name of this variable name, so be sure not to change it
$matrixSDKVersion = '= 0.26.7'
# $matrixSDKVersion = :local
# '= 0.26.7'
$matrixSDKVersion = :local
# $matrixSDKVersion = { :branch => 'develop'}
# $matrixSDKVersion = { :specHash => { git: 'https://git.io/fork123', branch: 'fix' } }

Expand Down
19 changes: 11 additions & 8 deletions Podfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -45,14 +45,14 @@ PODS:
- AFNetworking (~> 4.0.0)
- GZIP (~> 1.3.0)
- libbase58 (~> 0.1.4)
- MatrixSDKCrypto (= 0.3.3)
- MatrixSDKCrypto (= 0.3.4)
- OLMKit (~> 3.2.5)
- Realm (= 10.27.0)
- SwiftyBeaver (= 1.9.5)
- MatrixSDK/JingleCallStack (0.26.7):
- JitsiMeetSDKLite (= 7.0.1-lite)
- MatrixSDK/Core
- MatrixSDKCrypto (0.3.3)
- MatrixSDKCrypto (0.3.4)
- OLMKit (3.2.12):
- OLMKit/olmc (= 3.2.12)
- OLMKit/olmcpp (= 3.2.12)
Expand Down Expand Up @@ -102,8 +102,8 @@ DEPENDENCIES:
- KeychainAccess (~> 4.2.2)
- KTCenterFlowLayout (~> 1.3.1)
- libPhoneNumber-iOS (~> 0.9.13)
- MatrixSDK (= 0.26.7)
- MatrixSDK/JingleCallStack (= 0.26.7)
- MatrixSDK (from `../matrix-ios-sdk/MatrixSDK.podspec`)
- MatrixSDK/JingleCallStack (from `../matrix-ios-sdk/MatrixSDK.podspec`)
- OLMKit
- PostHog (~> 2.0.0)
- ReadMoreTextView (~> 3.0.1)
Expand Down Expand Up @@ -144,7 +144,6 @@ SPEC REPOS:
- libPhoneNumber-iOS
- LoggerAPI
- Logging
- MatrixSDK
- MatrixSDKCrypto
- OLMKit
- PostHog
Expand All @@ -165,6 +164,10 @@ SPEC REPOS:
- zxcvbn-ios
- ZXingObjC

EXTERNAL SOURCES:
MatrixSDK:
:path: "../matrix-ios-sdk/MatrixSDK.podspec"

SPEC CHECKSUMS:
AFNetworking: 3bd23d814e976cd148d7d44c3ab78017b744cd58
BlueCryptor: b0aee3d9b8f367b49b30de11cda90e1735571c24
Expand All @@ -187,8 +190,8 @@ SPEC CHECKSUMS:
libPhoneNumber-iOS: 0a32a9525cf8744fe02c5206eb30d571e38f7d75
LoggerAPI: ad9c4a6f1e32f518fdb43a1347ac14d765ab5e3d
Logging: beeb016c9c80cf77042d62e83495816847ef108b
MatrixSDK: 1de7cd06bef00fabf5693eabcdcdbf2aa1978063
MatrixSDKCrypto: 427dbb126a3e3f97cadf9fc407abf17d365b4b39
MatrixSDK: b24a0e77df2de64dd50618b3e5888ac56414ec3d
MatrixSDKCrypto: ac805c22c24f79f349cdbfa065855c73a4c81b51
OLMKit: da115f16582e47626616874e20f7bb92222c7a51
PostHog: 660ec6c9d80cec17b685e148f17f6785a88b597d
ReadMoreTextView: 19147adf93abce6d7271e14031a00303fe28720d
Expand All @@ -208,6 +211,6 @@ SPEC CHECKSUMS:
zxcvbn-ios: fef98b7c80f1512ff0eec47ac1fa399fc00f7e3c
ZXingObjC: fdbb269f25dd2032da343e06f10224d62f537bdb

PODFILE CHECKSUM: c063d05ddb39617ab9a259c4c9c6b57da2e6d8b6
PODFILE CHECKSUM: ccacb7939764ab02a745ac665eb9aa77d7a7c47a

COCOAPODS: 1.11.3
37 changes: 15 additions & 22 deletions Riot.xcodeproj/xcshareddata/xcschemes/Riot.xcscheme
Original file line number Diff line number Diff line change
@@ -1,11 +1,10 @@
<?xml version="1.0" encoding="UTF-8"?>
<Scheme
LastUpgradeVersion = "1200"
version = "1.7">
version = "1.3">
<BuildAction
parallelizeBuildables = "YES"
buildImplicitDependencies = "YES"
runPostActionsOnFailure = "NO">
buildImplicitDependencies = "YES">
<BuildActionEntries>
<BuildActionEntry
buildForTesting = "YES"
Expand All @@ -16,7 +15,7 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "57B13CC4586E9D43ED24DE1E"
BuildableName = "Riot.app"
BuildableName = "Element.app"
BlueprintName = "Riot"
ReferencedContainer = "container:Riot.xcodeproj">
</BuildableReference>
Expand All @@ -35,11 +34,20 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "57B13CC4586E9D43ED24DE1E"
BuildableName = "Riot.app"
BuildableName = "Element.app"
BlueprintName = "Riot"
ReferencedContainer = "container:Riot.xcodeproj">
</BuildableReference>
</MacroExpansion>
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "57B13CC4586E9D43ED24DE1E"
BuildableName = "Element.app"
BlueprintName = "Riot"
ReferencedContainer = "container:Riot.xcodeproj">
</BuildableReference>
</CodeCoverageTargets>
<Testables>
<TestableReference
skipped = "NO">
Expand All @@ -52,17 +60,6 @@
</BuildableReference>
</TestableReference>
</Testables>
<CommandLineArguments>
</CommandLineArguments>
<CodeCoverageTargets>
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "57B13CC4586E9D43ED24DE1E"
BuildableName = "Riot.app"
BlueprintName = "Riot"
ReferencedContainer = "container:Riot.xcodeproj">
</BuildableReference>
</CodeCoverageTargets>
</TestAction>
<LaunchAction
buildConfiguration = "Debug"
Expand All @@ -80,13 +77,11 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "57B13CC4586E9D43ED24DE1E"
BuildableName = "Riot.app"
BuildableName = "Element.app"
BlueprintName = "Riot"
ReferencedContainer = "container:Riot.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</LaunchAction>
<ProfileAction
buildConfiguration = "Release"
Expand All @@ -99,13 +94,11 @@
<BuildableReference
BuildableIdentifier = "primary"
BlueprintIdentifier = "57B13CC4586E9D43ED24DE1E"
BuildableName = "Riot.app"
BuildableName = "Element.app"
BlueprintName = "Riot"
ReferencedContainer = "container:Riot.xcodeproj">
</BuildableReference>
</BuildableProductRunnable>
<CommandLineArguments>
</CommandLineArguments>
</ProfileAction>
<AnalyzeAction
buildConfiguration = "Debug">
Expand Down
3 changes: 0 additions & 3 deletions Riot/Assets/en.lproj/Vector.strings
Original file line number Diff line number Diff line change
Expand Up @@ -807,9 +807,6 @@ Tap the + to start adding people.";
"settings_labs_enable_new_app_layout" = "New Application Layout";
"settings_labs_enable_wysiwyg_composer" = "Try out the rich text editor";
"settings_labs_enable_voice_broadcast" = "Voice broadcast";
"settings_labs_enable_crypto_sdk" = "Rust end-to-end encryption";
"settings_labs_confirm_crypto_sdk" = "Please be advised that as this feature is still in its experimental stage, it may not function as expected and could potentially have unintended consequences. To revert the feature, simply log out and log back in. Use at your own discretion and with caution.";
"settings_labs_disable_crypto_sdk" = "Rust end-to-end encryption (log out to disable)";

"settings_version" = "Version %@";
"settings_olm_version" = "Olm Version %@";
Expand Down
1 change: 0 additions & 1 deletion Riot/Categories/MXBugReportRestClient+Riot.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ extension MXBugReportRestClient {

// SDKs
userInfo["matrix_sdk_version"] = MatrixSDKVersion
userInfo["crypto_module"] = MXSDKOptions.sharedInstance().cryptoModuleId
if let crypto = mainAccount?.mxSession?.crypto {
userInfo["crypto_module_version"] = crypto.version
}
Expand Down
116 changes: 0 additions & 116 deletions Riot/Experiments/CryptoSDKFeature.swift

This file was deleted.

12 changes: 0 additions & 12 deletions Riot/Generated/Strings.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7647,18 +7647,10 @@ public class VectorL10n: NSObject {
public static var settingsLabs: String {
return VectorL10n.tr("Vector", "settings_labs")
}
/// Please be advised that as this feature is still in its experimental stage, it may not function as expected and could potentially have unintended consequences. To revert the feature, simply log out and log back in. Use at your own discretion and with caution.
public static var settingsLabsConfirmCryptoSdk: String {
return VectorL10n.tr("Vector", "settings_labs_confirm_crypto_sdk")
}
/// Create conference calls with jitsi
public static var settingsLabsCreateConferenceWithJitsi: String {
return VectorL10n.tr("Vector", "settings_labs_create_conference_with_jitsi")
}
/// Rust end-to-end encryption (log out to disable)
public static var settingsLabsDisableCryptoSdk: String {
return VectorL10n.tr("Vector", "settings_labs_disable_crypto_sdk")
}
/// End-to-End Encryption
public static var settingsLabsE2eEncryption: String {
return VectorL10n.tr("Vector", "settings_labs_e2e_encryption")
Expand All @@ -7671,10 +7663,6 @@ public class VectorL10n: NSObject {
public static var settingsLabsEnableAutoReportDecryptionErrors: String {
return VectorL10n.tr("Vector", "settings_labs_enable_auto_report_decryption_errors")
}
/// Rust end-to-end encryption
public static var settingsLabsEnableCryptoSdk: String {
return VectorL10n.tr("Vector", "settings_labs_enable_crypto_sdk")
}
/// Live location sharing - share current location (active development, and temporarily, locations persist in room history)
public static var settingsLabsEnableLiveLocationSharing: String {
return VectorL10n.tr("Vector", "settings_labs_enable_live_location_sharing")
Expand Down
2 changes: 1 addition & 1 deletion Riot/Modules/Analytics/Analytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ extension Analytics {
func trackE2EEError(_ reason: DecryptionFailureReason, context: String) {
let event = AnalyticsEvent.Error(
context: context,
cryptoModule: MXSDKOptions.sharedInstance().enableCryptoSDK ? .Rust : .Native,
cryptoModule: .Rust,
domain: .E2EE,
name: reason.errorName
)
Expand Down
3 changes: 0 additions & 3 deletions Riot/Modules/Analytics/SentryMonitoringClient.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,9 +46,6 @@ struct SentryMonitoringClient {
if let message = event.message?.formatted {
event.fingerprint = [message]
}
event.tags = [
"crypto_module": MXSDKOptions.sharedInstance().cryptoModuleId
]
MXLog.debug("[SentryMonitoringClient] Issue detected: \(event)")
return event
}
Expand Down
Loading

0 comments on commit 11d2dee

Please sign in to comment.