-
Notifications
You must be signed in to change notification settings - Fork 216
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'release/0.23.16/master'
- Loading branch information
Showing
143 changed files
with
6,190 additions
and
1,478 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
MatrixSDK.xcodeproj/xcshareddata/xcschemes/MatrixSDK-iOS.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
MatrixSDK.xcodeproj/xcshareddata/xcschemes/MatrixSDK-macOS.xcscheme
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
65 changes: 65 additions & 0 deletions
65
MatrixSDK/Crypto/CrossSigning/Data/MXCryptoUserIdentityWrapper.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
// | ||
// Copyright 2022 The Matrix.org Foundation C.I.C | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// | ||
|
||
import Foundation | ||
|
||
#if DEBUG && os(iOS) | ||
|
||
import MatrixSDKCrypto | ||
|
||
/// Convenience wrapper around `MatrixSDKCrypto`'s `UserIdentity` | ||
/// which can be used to create `MatrixSDK`s `MXCrossSigningInfo` | ||
/// | ||
/// Note: The class is marked as final with internal initializer, | ||
/// meaning it cannot be created or subclassed from outside the SDK. | ||
@objcMembers public final class MXCryptoUserIdentityWrapper: NSObject { | ||
public let userId: String | ||
public let masterKeys: MXCrossSigningKey? | ||
public let selfSignedKeys: MXCrossSigningKey? | ||
public let userSignedKeys: MXCrossSigningKey? | ||
public let trustLevel: MXUserTrustLevel | ||
|
||
internal init(identity: UserIdentity, isVerified: Bool) { | ||
switch identity { | ||
case .own(let userId, _, let masterKey, let selfSigningKey, let userSigningKey): | ||
self.userId = userId | ||
// Note: `trustsOurOwnDevice` is not currently used, instead using second `isVerified` parameter | ||
self.masterKeys = .init(jsonString: masterKey) | ||
self.selfSignedKeys = .init(jsonString: selfSigningKey) | ||
self.userSignedKeys = .init(jsonString: userSigningKey) | ||
case .other(let userId, let masterKey, let selfSigningKey): | ||
self.userId = userId | ||
self.masterKeys = .init(jsonString: masterKey) | ||
self.selfSignedKeys = .init(jsonString: selfSigningKey) | ||
self.userSignedKeys = nil | ||
} | ||
trustLevel = MXUserTrustLevel( | ||
crossSigningVerified: isVerified, | ||
locallyVerified: false // Note: Local verification not yet implemented | ||
) | ||
} | ||
} | ||
|
||
private extension MXCrossSigningKey { | ||
convenience init?(jsonString: String) { | ||
guard let json = MXTools.deserialiseJSONString(jsonString) as? [AnyHashable: Any] else { | ||
return nil | ||
} | ||
self.init(fromJSON: json) | ||
} | ||
} | ||
|
||
#endif |
Oops, something went wrong.