diff --git a/MatrixSDK.podspec b/MatrixSDK.podspec index 628de5285..a6733af0c 100644 --- a/MatrixSDK.podspec +++ b/MatrixSDK.podspec @@ -44,7 +44,7 @@ Pod::Spec.new do |s| # Requirements for e2e encryption ss.dependency 'Realm', '10.27.0' ss.dependency 'libbase58', '~> 0.1.4' - ss.dependency 'MatrixSDKCrypto', '0.11.1', :configurations => ["DEBUG", "RELEASE"], :inhibit_warnings => true + ss.dependency 'MatrixSDKCrypto', '0.17.0', :configurations => ["DEBUG", "RELEASE"], :inhibit_warnings => true end s.subspec 'JingleCallStack' do |ss| diff --git a/MatrixSDK/ContentScan/PKMessageWrapper.swift b/MatrixSDK/ContentScan/PKMessageWrapper.swift index 05aa716b0..3806c85df 100644 --- a/MatrixSDK/ContentScan/PKMessageWrapper.swift +++ b/MatrixSDK/ContentScan/PKMessageWrapper.swift @@ -35,7 +35,11 @@ import MatrixSDKCrypto @objc public static func encryptMessage(_ message: String, usingKey key: String) -> PKMessageWrapper? { do { let pkEncryption = try PkEncryption.fromBase64(key: key) - return PKMessageWrapper(pkMessage: pkEncryption.encrypt(plaintext: message)) + guard let pkMessage = pkEncryption.encrypt(plaintext: message) else { + MXLog.error("[PKMessageWrapper] message didn't encrypt") + return nil + } + return PKMessageWrapper(pkMessage: pkMessage) } catch { MXLog.error("[PKMessageWrapper] failed to create pkEncryption", context: error) return nil diff --git a/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift b/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift index bbbf4c521..075cc0ab8 100644 --- a/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift +++ b/MatrixSDK/Crypto/CryptoMachine/MXCryptoMachine.swift @@ -202,7 +202,8 @@ extension MXCryptoMachine: MXCryptoSyncing { deviceChanges: deviceChanges, keyCounts: keyCounts, unusedFallbackKeys: unusedFallbackKeys, - nextBatchToken: nextBatchToken + nextBatchToken: nextBatchToken, + decryptionSettings: .init(senderDeviceTrustRequirement: .untrusted) ) var deserialisedToDeviceEvents = [Any]() diff --git a/MatrixSDK/Crypto/Dehydration/DehydrationService.swift b/MatrixSDK/Crypto/Dehydration/DehydrationService.swift index d1a894dac..e9401f286 100644 --- a/MatrixSDK/Crypto/Dehydration/DehydrationService.swift +++ b/MatrixSDK/Crypto/Dehydration/DehydrationService.swift @@ -203,7 +203,8 @@ public class DehydrationService: NSObject { repeat { let response = try await retrieveToDeviceEvents(deviceId: deviceId, nextBatch: dehydratedDeviceEventsResponse?.nextBatch) - try rehydratedDevice.receiveEvents(events: MXTools.serialiseJSONObject(response.events)) + try rehydratedDevice.receiveEvents(events: MXTools.serialiseJSONObject(response.events), + decryptionSettings: .init(senderDeviceTrustRequirement: .untrusted)) dehydratedDeviceEventsResponse = response } while !(dehydratedDeviceEventsResponse?.events.isEmpty ?? true) diff --git a/Podfile b/Podfile index 77ddd6558..08ac47401 100644 --- a/Podfile +++ b/Podfile @@ -1,4 +1,4 @@ -source 'https://cdn.cocoapods.org/' +source 'https://github.com/CocoaPods/Specs.git' # Uncomment this line to define a global platform for your project @@ -15,7 +15,7 @@ abstract_target 'MatrixSDK' do pod 'Realm', '10.27.0' pod 'libbase58', '~> 0.1.4' - pod 'MatrixSDKCrypto', '0.11.1', :inhibit_warnings => true + pod 'MatrixSDKCrypto', '0.17.0', :inhibit_warnings => true target 'MatrixSDK-iOS' do platform :ios, '13.0' diff --git a/Podfile.lock b/Podfile.lock index 48f3238e9..a5eab9e08 100644 --- a/Podfile.lock +++ b/Podfile.lock @@ -16,7 +16,7 @@ PODS: - AFNetworking/NSURLSession - GZIP (1.3.2) - libbase58 (0.1.4) - - MatrixSDKCrypto (0.11.1) + - MatrixSDKCrypto (0.17.0) - OHHTTPStubs (9.1.0): - OHHTTPStubs/Default (= 9.1.0) - OHHTTPStubs/Core (9.1.0) @@ -39,17 +39,18 @@ DEPENDENCIES: - AFNetworking (~> 4.0.0) - GZIP (~> 1.3.0) - libbase58 (~> 0.1.4) - - MatrixSDKCrypto (= 0.11.1) + - MatrixSDKCrypto (= 0.17.0) - OHHTTPStubs (~> 9.1.0) - Realm (= 10.27.0) - SwiftyBeaver (= 1.9.5) SPEC REPOS: + https://github.com/CocoaPods/Specs.git: + - MatrixSDKCrypto trunk: - AFNetworking - GZIP - libbase58 - - MatrixSDKCrypto - OHHTTPStubs - Realm - SwiftyBeaver @@ -58,11 +59,11 @@ SPEC CHECKSUMS: AFNetworking: 3bd23d814e976cd148d7d44c3ab78017b744cd58 GZIP: 3c0abf794bfce8c7cb34ea05a1837752416c8868 libbase58: 7c040313537b8c44b6e2d15586af8e21f7354efd - MatrixSDKCrypto: e44608012cae9befc52f13cd8e56c6f51ac83702 + MatrixSDKCrypto: aa38e272e573c7798aa3cd761b2b61ec5c7731b8 OHHTTPStubs: 90eac6d8f2c18317baeca36698523dc67c513831 Realm: 9ca328bd7e700cc19703799785e37f77d1a130f2 SwiftyBeaver: 84069991dd5dca07d7069100985badaca7f0ce82 -PODFILE CHECKSUM: 43b5fd9b5489fc93ff6f9121742d30463242345f +PODFILE CHECKSUM: 58cba3b80f4adf96e8094c94a44857a15799e7a4 COCOAPODS: 1.16.2