User verification: Check cross-signing bootstrap before start.

This commit is contained in:
SBiOSoftWhare
2020-03-13 19:01:04 +01:00
parent b07f08142e
commit 82632ec2f6
@@ -62,6 +62,11 @@ final class UserVerificationCoordinator: NSObject, UserVerificationCoordinatorTy
return
}
guard self.session.crypto.crossSigning.isBootstrapped else {
self.presentBootstrapNotSetup()
return
}
let rootCoordinator: Coordinator & Presentable
if let deviceId = self.deviceId {
@@ -123,6 +128,18 @@ final class UserVerificationCoordinator: NSObject, UserVerificationCoordinatorTy
self.remove(childCoordinator: deviceVerificationCoordinator)
})
}
private func presentBootstrapNotSetup() {
let alert = UIAlertController(title: VectorL10n.keyVerificationBootstrapNotSetupTitle,
message: VectorL10n.keyVerificationBootstrapNotSetupMessage,
preferredStyle: .alert)
let cancelAction = UIAlertAction(title: Bundle.mxk_localizedString(forKey: "ok"), style: .cancel, handler: { _ in
})
alert.addAction(cancelAction)
self.presenter.toPresentable().present(alert, animated: true, completion: nil)
}
}
// MARK: - UserVerificationSessionsStatusCoordinatorDelegate