mirror of
https://github.com/SchildiChat/SchildiChat-android.git
synced 2024-11-22 17:35:54 +03:00
Handle master key trust during E2EE set up
This commit is contained in:
parent
de4232dff5
commit
e439b72e48
1 changed files with 11 additions and 4 deletions
|
@ -176,10 +176,17 @@ class Rendezvous(
|
|||
crypto.setDeviceVerification(DeviceTrustLevel(locallyVerified = true, crossSigningVerified = false), userId, verifyingDeviceId)
|
||||
|
||||
// TODO: what do we do with the master key?
|
||||
// verificationResponse.master_key ?.let {
|
||||
// // set master key as trusted
|
||||
// crypto.setDeviceVerification(DeviceTrustLevel(locallyVerified = true, crossSigningVerified = false), userId, it)
|
||||
// }
|
||||
verificationResponse.master_key ?.let { masterKeyFromVerifyingDevice ->
|
||||
// set master key as trusted
|
||||
crypto.crossSigningService().getMyCrossSigningKeys()?.masterKey()?.let { localMasterKey ->
|
||||
if (localMasterKey.unpaddedBase64PublicKey == masterKeyFromVerifyingDevice) {
|
||||
Timber.tag(TAG).i("Setting master key as trusted")
|
||||
crypto.crossSigningService().markMyMasterKeyAsTrusted()
|
||||
} else {
|
||||
Timber.tag(TAG).w("Master key from verifying device doesn't match: $masterKeyFromVerifyingDevice vs $localMasterKey")
|
||||
}
|
||||
} ?: Timber.tag(TAG).i("No local master key")
|
||||
} ?: Timber.tag(TAG).i("No master key given by verifying device")
|
||||
|
||||
// request secrets from the verifying device
|
||||
Timber.tag(TAG).i("Requesting secrets from $verifyingDeviceId")
|
||||
|
|
Loading…
Reference in a new issue