mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-05 20:09:04 +00:00
Enable database encryption for new logins on Nightly/PR builds. (#2328)
- Slightly reworks where the pusher client ID is generated.
This commit is contained in:
@@ -14,24 +14,13 @@
|
||||
// limitations under the License.
|
||||
//
|
||||
|
||||
import CryptoKit
|
||||
import Foundation
|
||||
|
||||
import MatrixRustSDK
|
||||
|
||||
struct RestorationToken: Codable, Equatable {
|
||||
let session: MatrixRustSDK.Session
|
||||
let passphrase: String?
|
||||
let pusherNotificationClientIdentifier: String?
|
||||
|
||||
init(session: MatrixRustSDK.Session) {
|
||||
self.session = session
|
||||
if let data = session.userId.data(using: .utf8) {
|
||||
let digest = SHA256.hash(data: data)
|
||||
pusherNotificationClientIdentifier = digest.compactMap { String(format: "%02x", $0) }.joined()
|
||||
} else {
|
||||
pusherNotificationClientIdentifier = nil
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension MatrixRustSDK.Session: Codable {
|
||||
|
||||
Reference in New Issue
Block a user