Skip to content

Commit

Permalink
Merge branch 'release/0.23.18/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
gulekismail committed Sep 7, 2022
2 parents 49a7cc2 + 6755cf8 commit bacba64
Show file tree
Hide file tree
Showing 39 changed files with 1,217 additions and 429 deletions.
36 changes: 36 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,39 @@
## Changes in 0.23.18 (2022-09-07)

✨ Features

- MXKeyBackup: Add support for symmetric key backups. ([#1542](https://github.com/matrix-org/matrix-ios-sdk/pull/1542))
- CryptoSDK: Outgoing SAS User Verification Flow ([#6443](https://github.com/vector-im/element-ios/issues/6443))
- CryptoV2: Self-verification flow ([#6589](https://github.com/vector-im/element-ios/issues/6589))

🙌 Improvements

- Allow setting room alias regardless of join rule ([#1559](https://github.com/matrix-org/matrix-ios-sdk/pull/1559))
- Crypto: Cache inbound group sessions when decrypting ([#1566](https://github.com/matrix-org/matrix-ios-sdk/pull/1566))
- Crypto: Create lazy in-memory room encryptors ([#1570](https://github.com/matrix-org/matrix-ios-sdk/pull/1570))
- App Layout: Increased store version to force clear cache ([#6616](https://github.com/vector-im/element-ios/issues/6616))

🐛 Bugfixes

- Fix incoming calls sometimes ringing after being answered on another client ([#6614](https://github.com/vector-im/element-ios/issues/6614))

🧱 Build

- Xcode project(s) updated via Xcode recommended setting ([#1543](https://github.com/matrix-org/matrix-ios-sdk/pull/1543))
- MXLog: Ensure MXLogLevel.none works if it is set after another log level has already been configured. ([#1550](https://github.com/matrix-org/matrix-ios-sdk/issues/1550))

📄 Documentation

- README: Update the badge header ([#1569](https://github.com/matrix-org/matrix-ios-sdk/pull/1569))
- Update README for correct Swift usage. ([#1552](https://github.com/matrix-org/matrix-ios-sdk/issues/1552))

Others

- Crypto: User and device identity objects ([#1531](https://github.com/matrix-org/matrix-ios-sdk/pull/1531))
- Analytics: Log all errors to analytics ([#1558](https://github.com/matrix-org/matrix-ios-sdk/pull/1558))
- Improve MXLog file formatting and fix log message format ([#1564](https://github.com/matrix-org/matrix-ios-sdk/pull/1564))


## Changes in 0.23.17 (2022-08-31)

🙌 Improvements
Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK.podspec
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Pod::Spec.new do |s|

s.name = "MatrixSDK"
s.version = "0.23.17"
s.version = "0.23.18"
s.summary = "The iOS SDK to build apps compatible with Matrix (https://www.matrix.org)"

s.description = <<-DESC
Expand Down
6 changes: 6 additions & 0 deletions MatrixSDK.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -1907,6 +1907,8 @@
EDD578EA2881C37C006739DD /* MXCryptoUserIdentityWrapper.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDD578E02881C37C006739DD /* MXCryptoUserIdentityWrapper.swift */; };
EDD578EC2881C38C006739DD /* MXCrossSigningV2.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDD578EB2881C38C006739DD /* MXCrossSigningV2.swift */; };
EDD578ED2881C38C006739DD /* MXCrossSigningV2.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDD578EB2881C38C006739DD /* MXCrossSigningV2.swift */; };
EDE1B13B28B7BEAB000DEEE8 /* MXCrossSigningV2UnitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDE1B13A28B7BEAB000DEEE8 /* MXCrossSigningV2UnitTests.swift */; };
EDE1B13C28B7BEAB000DEEE8 /* MXCrossSigningV2UnitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDE1B13A28B7BEAB000DEEE8 /* MXCrossSigningV2UnitTests.swift */; };
EDF1B6902876CD2C00BBBCEE /* MXTaskQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDF1B68F2876CD2C00BBBCEE /* MXTaskQueue.swift */; };
EDF1B6912876CD2C00BBBCEE /* MXTaskQueue.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDF1B68F2876CD2C00BBBCEE /* MXTaskQueue.swift */; };
EDF1B6932876CD8600BBBCEE /* MXTaskQueueUnitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EDF1B6922876CD8600BBBCEE /* MXTaskQueueUnitTests.swift */; };
Expand Down Expand Up @@ -2963,6 +2965,7 @@
EDD578DF2881C37C006739DD /* MXCryptoDeviceWrapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MXCryptoDeviceWrapper.swift; sourceTree = "<group>"; };
EDD578E02881C37C006739DD /* MXCryptoUserIdentityWrapper.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MXCryptoUserIdentityWrapper.swift; sourceTree = "<group>"; };
EDD578EB2881C38C006739DD /* MXCrossSigningV2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = MXCrossSigningV2.swift; sourceTree = "<group>"; };
EDE1B13A28B7BEAB000DEEE8 /* MXCrossSigningV2UnitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MXCrossSigningV2UnitTests.swift; sourceTree = "<group>"; };
EDF1B68F2876CD2C00BBBCEE /* MXTaskQueue.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MXTaskQueue.swift; sourceTree = "<group>"; };
EDF1B6922876CD8600BBBCEE /* MXTaskQueueUnitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MXTaskQueueUnitTests.swift; sourceTree = "<group>"; };
EDF4678627E3331D00435913 /* EventsEnumeratorDataSourceStub.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EventsEnumeratorDataSourceStub.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -5259,6 +5262,7 @@
children = (
ED8F1D1528857FDA00F897E7 /* Data */,
ED8F1D242885A39800F897E7 /* MXCrossSigningInfoSourceUnitTests.swift */,
EDE1B13A28B7BEAB000DEEE8 /* MXCrossSigningV2UnitTests.swift */,
);
path = CrossSigning;
sourceTree = "<group>";
Expand Down Expand Up @@ -6945,6 +6949,7 @@
32792BE12296C64200F4FC9D /* MXAggregatedEditsTests.m in Sources */,
329571931B0240CE00ABB3BA /* MXVoIPTests.m in Sources */,
ED8F1D322885AC5700F897E7 /* Device+Stub.swift in Sources */,
EDE1B13B28B7BEAB000DEEE8 /* MXCrossSigningV2UnitTests.swift in Sources */,
EC746C56274E5197002AD24C /* MXThreadingServiceUnitTests.swift in Sources */,
ED8F1D252885A39800F897E7 /* MXCrossSigningInfoSourceUnitTests.swift in Sources */,
32A27D1F19EC335300BAFADE /* MXRoomTests.m in Sources */,
Expand Down Expand Up @@ -7543,6 +7548,7 @@
B1E09A332397FD750057C069 /* MXRoomStateTests.m in Sources */,
18937E7D273A5AE500902626 /* MXPollRelationTests.m in Sources */,
B1E09A352397FD7D0057C069 /* MXEventTests.m in Sources */,
EDE1B13C28B7BEAB000DEEE8 /* MXCrossSigningV2UnitTests.swift in Sources */,
A816248525F60D0300A46F05 /* MXDeviceListOperationsPoolUnitTests.swift in Sources */,
EC746C57274E5197002AD24C /* MXThreadingServiceUnitTests.swift in Sources */,
B1E09A312397FD750057C069 /* MXSessionTests.m in Sources */,
Expand Down
2 changes: 1 addition & 1 deletion MatrixSDK/Contrib/Swift/MXSession.swift
Original file line number Diff line number Diff line change
Expand Up @@ -163,6 +163,7 @@ public extension MXSession {
let parameters = MXRoomCreationParameters()
parameters.name = name
parameters.topic = topic
parameters.roomAlias = aliasLocalPart

let stateEventBuilder = MXRoomInitialStateEventBuilder()

Expand All @@ -173,7 +174,6 @@ public extension MXSession {
}
parameters.preset = kMXRoomPresetPublicChat
parameters.visibility = kMXRoomDirectoryVisibilityPublic
parameters.roomAlias = aliasLocalPart
let guestAccessStateEvent = stateEventBuilder.buildGuestAccessEvent(withAccess: .canJoin)
parameters.addOrUpdateInitialStateEvent(guestAccessStateEvent)
let historyVisibilityStateEvent = stateEventBuilder.buildHistoryVisibilityEvent(withVisibility: .worldReadable)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#import "MXCrossSigningKey.h"

#import "MXKey.h"
#import "MXCryptoConstants.h"


#pragma mark - Constants
Expand Down
1 change: 1 addition & 0 deletions MatrixSDK/Crypto/CrossSigning/MXCrossSigningTools.m
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

#import "MXCryptoTools.h"
#import "MXKey.h"
#import "MXCryptoConstants.h"


#pragma mark - Constants
Expand Down
46 changes: 36 additions & 10 deletions MatrixSDK/Crypto/CrossSigning/MXCrossSigningV2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,17 @@ class MXCrossSigningV2: MXCrossSigning {
}

override var state: MXCrossSigningState {
log.debug("Only partial implementation")
return hasAllPrivateKeys ? .canCrossSign : .notBootstrapped
if hasAllPrivateKeys {
return .canCrossSign
} else if let info = info {
if info.trustLevel.isVerified {
return .trustCrossSigning
} else {
return .crossSigningExists
}
} else {
return .notBootstrapped
}
}

override var canTrustCrossSigning: Bool {
Expand All @@ -46,16 +55,20 @@ class MXCrossSigningV2: MXCrossSigning {
}

override var hasAllPrivateKeys: Bool {
let status = machine.crossSigningStatus()
let status = crossSigning.crossSigningStatus()
return status.hasMaster && status.hasSelfSigning && status.hasUserSigning
}

private let machine: MXCryptoMachine
private let crossSigning: MXCryptoCrossSigning
private let infoSource: MXCrossSigningInfoSource
private var info: MXCrossSigningInfo?
private let restClient: MXRestClient

private let log = MXNamedLog(name: "MXCrossSigningV2")

init(machine: MXCryptoMachine, restClient: MXRestClient) {
self.machine = machine
init(crossSigning: MXCryptoCrossSigning, restClient: MXRestClient) {
self.crossSigning = crossSigning
self.infoSource = MXCrossSigningInfoSource(source: crossSigning)
self.restClient = restClient
}

Expand All @@ -67,7 +80,7 @@ class MXCrossSigningV2: MXCrossSigning {
Task {
do {
let authParams = try await authParameters(password: password)
try await machine.bootstrapCrossSigning(authParams: authParams)
try await crossSigning.bootstrapCrossSigning(authParams: authParams)
await MainActor.run {
success()
}
Expand All @@ -87,7 +100,7 @@ class MXCrossSigningV2: MXCrossSigning {
) {
Task {
do {
try await machine.bootstrapCrossSigning(authParams: authParams)
try await crossSigning.bootstrapCrossSigning(authParams: authParams)
await MainActor.run {
success()
}
Expand All @@ -104,8 +117,21 @@ class MXCrossSigningV2: MXCrossSigning {
success: ((Bool) -> Void)?,
failure: ((Swift.Error) -> Void)? = nil
) {
log.debug("Not implemented")
success?(true)
Task {
do {
try await crossSigning.downloadKeys(users: [crossSigning.userId])
info = infoSource.crossSigningInfo(userId: crossSigning.userId)

await MainActor.run {
success?(true)
}
} catch {
log.error("Cannot refresh cross signing state", context: error)
await MainActor.run {
failure?(error)
}
}
}
}

override func crossSignDevice(
Expand Down
Loading

0 comments on commit bacba64

Please sign in to comment.