Skip to content

Commit fa9ee66

Browse files
authored
Merge pull request #1881 from matrix-org/release/0.27.14/release
2 parents 1f3fa5a + f4df1d5 commit fa9ee66

File tree

19 files changed

+107
-39
lines changed

19 files changed

+107
-39
lines changed

.github/workflows/ci-integration-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,17 +70,17 @@ jobs:
7070
run: bundle exec fastlane test testplan:AllWorkingTests
7171

7272
# Store artifacts
73-
- uses: actions/upload-artifact@v2
73+
- uses: actions/upload-artifact@v4
7474
if: always()
7575
with:
7676
name: report.html
7777
path: build/test/report.html
78-
- uses: actions/upload-artifact@v2
78+
- uses: actions/upload-artifact@v4
7979
if: always()
8080
with:
8181
name: report.junit
8282
path: build/test/report.junit
83-
- uses: actions/upload-artifact@v2
83+
- uses: actions/upload-artifact@v4
8484
if: always()
8585
with:
8686
name: MatrixSDK-macOS.xcresult

.github/workflows/ci-unit-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,15 +50,15 @@ jobs:
5050
run: bundle exec fastlane test testplan:UnitTests
5151

5252
# Store artifacts
53-
- uses: actions/upload-artifact@v2
53+
- uses: actions/upload-artifact@v4
5454
with:
5555
name: report.html
5656
path: build/test/report.html
57-
- uses: actions/upload-artifact@v2
57+
- uses: actions/upload-artifact@v4
5858
with:
5959
name: report.junit
6060
path: build/test/report.junit
61-
- uses: actions/upload-artifact@v2
61+
- uses: actions/upload-artifact@v4
6262
with:
6363
name: MatrixSDK-macOS.xcresult
6464
path: build/test/MatrixSDK-macOS.xcresult/

CHANGES.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
## Changes in 0.27.14 (2024-09-17)
2+
3+
No significant changes.
4+
5+
16
## Changes in 0.27.13 (2024-08-20)
27

38
🙌 Improvements

MatrixSDK.podspec

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Pod::Spec.new do |s|
22

33
s.name = "MatrixSDK"
4-
s.version = "0.27.13"
4+
s.version = "0.27.14"
55
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"
66

77
s.description = <<-DESC
@@ -45,7 +45,7 @@ Pod::Spec.new do |s|
4545
ss.dependency 'OLMKit', '~> 3.2.5'
4646
ss.dependency 'Realm', '10.27.0'
4747
ss.dependency 'libbase58', '~> 0.1.4'
48-
ss.dependency 'MatrixSDKCrypto', '0.4.2', :configurations => ["DEBUG", "RELEASE"], :inhibit_warnings => true
48+
ss.dependency 'MatrixSDKCrypto', '0.4.3', :configurations => ["DEBUG", "RELEASE"], :inhibit_warnings => true
4949
end
5050

5151
s.subspec 'JingleCallStack' do |ss|

MatrixSDK.xcodeproj/project.pbxproj

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -752,6 +752,8 @@
752752
A780624F27B2CE74005780C0 /* FileManager+Backup.swift in Sources */ = {isa = PBXBuildFile; fileRef = A780624C27B2CE74005780C0 /* FileManager+Backup.swift */; };
753753
A780625027B2CE74005780C0 /* FileManager+AppGroupContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = A780624D27B2CE74005780C0 /* FileManager+AppGroupContainer.swift */; };
754754
A780625127B2CE74005780C0 /* FileManager+AppGroupContainer.swift in Sources */ = {isa = PBXBuildFile; fileRef = A780624D27B2CE74005780C0 /* FileManager+AppGroupContainer.swift */; };
755+
A7BB11982C933677002F7FA5 /* PKMessageWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BB11972C933677002F7FA5 /* PKMessageWrapper.swift */; };
756+
A7BB11992C933677002F7FA5 /* PKMessageWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = A7BB11972C933677002F7FA5 /* PKMessageWrapper.swift */; };
755757
A816247C25F60C7700A46F05 /* MXDeviceListOperationsPoolUnitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A816247B25F60C7700A46F05 /* MXDeviceListOperationsPoolUnitTests.swift */; };
756758
A816248525F60D0300A46F05 /* MXDeviceListOperationsPoolUnitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = A816247B25F60C7700A46F05 /* MXDeviceListOperationsPoolUnitTests.swift */; };
757759
B105CD9D261E0B70006EB204 /* MXSpaceChildrenSummary.swift in Sources */ = {isa = PBXBuildFile; fileRef = B105CD9C261E0B70006EB204 /* MXSpaceChildrenSummary.swift */; };
@@ -2713,6 +2715,7 @@
27132715
A75CAD6B2A97970500F06072 /* MXWellKnownAuthentication.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MXWellKnownAuthentication.h; sourceTree = "<group>"; };
27142716
A780624C27B2CE74005780C0 /* FileManager+Backup.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FileManager+Backup.swift"; sourceTree = "<group>"; };
27152717
A780624D27B2CE74005780C0 /* FileManager+AppGroupContainer.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "FileManager+AppGroupContainer.swift"; sourceTree = "<group>"; };
2718+
A7BB11972C933677002F7FA5 /* PKMessageWrapper.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PKMessageWrapper.swift; sourceTree = "<group>"; };
27162719
A816247B25F60C7700A46F05 /* MXDeviceListOperationsPoolUnitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MXDeviceListOperationsPoolUnitTests.swift; sourceTree = "<group>"; };
27172720
B105CD9C261E0B70006EB204 /* MXSpaceChildrenSummary.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MXSpaceChildrenSummary.swift; sourceTree = "<group>"; };
27182721
B105CDD4261F54C8006EB204 /* MXSpaceChildContent.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = MXSpaceChildContent.h; sourceTree = "<group>"; };
@@ -3290,6 +3293,7 @@
32903293
02CAD435217DD12F0074700B /* Data */,
32913294
B146D50021A5C6D600D8C2C6 /* MXScanManager.h */,
32923295
B146D50121A5C6D600D8C2C6 /* MXScanManager.m */,
3296+
A7BB11972C933677002F7FA5 /* PKMessageWrapper.swift */,
32933297
);
32943298
path = ContentScan;
32953299
sourceTree = "<group>";
@@ -7292,6 +7296,7 @@
72927296
EC8A53AF25B1BC77004E0802 /* MXCallAnswerEventContent.m in Sources */,
72937297
B1432B51282AB29A00737CA6 /* MXBeaconInfoSummaryAllRoomListener.swift in Sources */,
72947298
32A30B191FB4813400C8309E /* MXIncomingRoomKeyRequestManager.m in Sources */,
7299+
A7BB11982C933677002F7FA5 /* PKMessageWrapper.swift in Sources */,
72957300
323F3F9320D3F0C700D26D6A /* MXRoomEventFilter.m in Sources */,
72967301
3275FD9921A6B53300B9C13D /* MXLoginPolicyData.m in Sources */,
72977302
EC1848C92686176D00865E16 /* MXiOSAudioOutputRouterDelegate.swift in Sources */,
@@ -7964,6 +7969,7 @@
79647969
B14EF25C2397E90400758AF0 /* MXRoomTombStoneContent.m in Sources */,
79657970
B1432B52282AB29A00737CA6 /* MXBeaconInfoSummaryAllRoomListener.swift in Sources */,
79667971
B14EF25D2397E90400758AF0 /* MXImage.swift in Sources */,
7972+
A7BB11992C933677002F7FA5 /* PKMessageWrapper.swift in Sources */,
79677973
B14EF25E2397E90400758AF0 /* (null) in Sources */,
79687974
32B090E3261F709B002924AA /* MXAsyncTaskQueue.swift in Sources */,
79697975
B14EF25F2397E90400758AF0 /* MXServerNoticeContent.m in Sources */,

MatrixSDK/ContentScan/Data/MXContentScanEncryptedBody.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616

1717
#import "MXJSONModel.h"
1818

19-
@class OLMPkMessage;
19+
@class PKMessageWrapper;
2020

2121
/**
2222
`MXContentScanEncryptedBody` contains the encrypted body use to scan an encrypted content.
@@ -39,11 +39,11 @@
3939
@property (nonatomic) NSString *ephemeral;
4040

4141
/**
42-
Create a model instance from a OLMPkMessage instance.
42+
Create a model instance from a PKMessageWrapper instance.
4343
44-
@param OLMPkMessage the encrypted message.
44+
@param PKMessageWrapper the encrypted message.
4545
@return the newly created instance.
4646
*/
47-
+ (id)modelFromOLMPkMessage:(OLMPkMessage *)OLMPkMessage;
47+
+ (id)modelFromPKMessage:(PKMessageWrapper *)pkMessage;
4848

4949
@end

MatrixSDK/ContentScan/Data/MXContentScanEncryptedBody.m

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
*/
1616

1717
#import "MXContentScanEncryptedBody.h"
18-
#import <OLMKit/OLMKit.h>
18+
19+
#import "MatrixSDKSwiftHeader.h"
1920

2021
@implementation MXContentScanEncryptedBody
2122

@@ -31,14 +32,14 @@ + (id)modelFromJSON:(NSDictionary *)JSONDictionary
3132
return contentScanEncryptedBody;
3233
}
3334

34-
+ (id)modelFromOLMPkMessage:(OLMPkMessage *)OLMPkMessage
35+
+ (id)modelFromPKMessage:(PKMessageWrapper *)pkMessage
3536
{
3637
MXContentScanEncryptedBody *contentScanEncryptedBody = [[MXContentScanEncryptedBody alloc] init];
3738
if (contentScanEncryptedBody)
3839
{
39-
contentScanEncryptedBody.ciphertext = OLMPkMessage.ciphertext;
40-
contentScanEncryptedBody.mac = OLMPkMessage.mac;
41-
contentScanEncryptedBody.ephemeral = OLMPkMessage.ephemeralKey;
40+
contentScanEncryptedBody.ciphertext = pkMessage.ciphertext;
41+
contentScanEncryptedBody.mac = pkMessage.mac;
42+
contentScanEncryptedBody.ephemeral = pkMessage.ephemeralKey;
4243
}
4344
return contentScanEncryptedBody;
4445
}

MatrixSDK/ContentScan/MXScanManager.m

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
*/
1616

1717
#import "MXScanManager.h"
18-
#import <OLMKit/OLMKit.h>
1918

2019
#import "MXMediaScanStore.h"
2120
#import "MXRealmMediaScanStore.h"
@@ -29,6 +28,8 @@
2928
#import "MXTools.h"
3029
#import "MXScanRealmFileProvider.h"
3130

31+
#import "MatrixSDKSwiftHeader.h"
32+
3233
#pragma mark - Defines & Constants
3334

3435
NSString *const MXScanManagerEventScanDidChangeNotification = @"MXScanManagerEventScanDidChangeNotification";
@@ -331,11 +332,17 @@ - (void)encryptRequestBody:(nonnull NSDictionary *)requestBody completion:(void
331332
[self getAntivirusServerPublicKey:^(NSString * _Nullable publicKey) {
332333
if (publicKey.length)
333334
{
334-
OLMPkEncryption *olmPkEncryption = [OLMPkEncryption new];
335-
[olmPkEncryption setRecipientKey:publicKey];
335+
336336
NSString *message = [MXTools serialiseJSONObject:requestBody];
337-
OLMPkMessage *olmPkMessage = [olmPkEncryption encryptMessage:message error:nil];
338-
completion([MXContentScanEncryptedBody modelFromOLMPkMessage:olmPkMessage]);
337+
PKMessageWrapper *pkMessage = [PKMessageWrapper encryptMessage:message usingKey:publicKey];
338+
if (pkMessage)
339+
{
340+
completion([MXContentScanEncryptedBody modelFromPKMessage:pkMessage]);
341+
}
342+
else
343+
{
344+
completion(nil);
345+
}
339346
}
340347
else
341348
{
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
//
2+
// Copyright 2024 The Matrix.org Foundation C.I.C
3+
//
4+
// Licensed under the Apache License, Version 2.0 (the "License");
5+
// you may not use this file except in compliance with the License.
6+
// You may obtain a copy of the License at
7+
//
8+
// http://www.apache.org/licenses/LICENSE-2.0
9+
//
10+
// Unless required by applicable law or agreed to in writing, software
11+
// distributed under the License is distributed on an "AS IS" BASIS,
12+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
// See the License for the specific language governing permissions and
14+
// limitations under the License.
15+
//
16+
17+
import Foundation
18+
import MatrixSDKCrypto
19+
20+
@objc public class PKMessageWrapper: NSObject {
21+
private let pkMessage: PkMessage
22+
23+
@objc public var ciphertext: String {
24+
pkMessage.ciphertext
25+
}
26+
27+
@objc public var mac: String {
28+
pkMessage.mac
29+
}
30+
31+
@objc public var ephemeralKey: String {
32+
pkMessage.ephemeralKey
33+
}
34+
35+
@objc public static func encryptMessage(_ message: String, usingKey key: String) -> PKMessageWrapper? {
36+
do {
37+
let pkEncryption = try PkEncryption.fromBase64(key: key)
38+
return PKMessageWrapper(pkMessage: pkEncryption.encrypt(plaintext: message))
39+
} catch {
40+
MXLog.error("[PKMessageWrapper] failed to create pkEncryption", context: error)
41+
return nil
42+
}
43+
}
44+
45+
private init(pkMessage: PkMessage) {
46+
self.pkMessage = pkMessage
47+
}
48+
}

MatrixSDK/Crypto/Algorithms/RoomEvent/MXRoomEventEncryption.swift

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,8 @@ struct MXRoomEventEncryption: MXRoomEventEncrypting {
184184
rotationPeriodMsgs: UInt64(Self.keyRotationPeriodMsgs),
185185
// If not set, history visibility defaults to `joined` as the most restrictive setting
186186
historyVisibility: state.historyVisibility?.visibility ?? .joined,
187-
onlyAllowTrustedDevices: onlyTrustedDevices(in: roomId)
187+
onlyAllowTrustedDevices: onlyTrustedDevices(in: roomId),
188+
errorOnVerifiedUserProblem: false
188189
)
189190
}
190191

0 commit comments

Comments
 (0)