QrCode: WIP
This commit is contained in:
parent
8659216955
commit
d8d465f70b
|
@ -687,6 +687,7 @@ internal class DefaultVerificationService @Inject constructor(
|
||||||
cryptoStore,
|
cryptoStore,
|
||||||
qrCodeData.sharedSecret,
|
qrCodeData.sharedSecret,
|
||||||
qrCodeData.toUrl(),
|
qrCodeData.toUrl(),
|
||||||
|
userId,
|
||||||
deviceId ?: "",
|
deviceId ?: "",
|
||||||
false)
|
false)
|
||||||
|
|
||||||
|
@ -1011,7 +1012,6 @@ internal class DefaultVerificationService @Inject constructor(
|
||||||
result.add(VERIFICATION_METHOD_QR_CODE_SHOW)
|
result.add(VERIFICATION_METHOD_QR_CODE_SHOW)
|
||||||
result.add(VERIFICATION_METHOD_RECIPROCATE)
|
result.add(VERIFICATION_METHOD_RECIPROCATE)
|
||||||
|
|
||||||
// Create the pending request, to display the QR code
|
|
||||||
// Create the pending transaction
|
// Create the pending transaction
|
||||||
val tx = DefaultQrCodeVerificationTransaction(
|
val tx = DefaultQrCodeVerificationTransaction(
|
||||||
transactionId,
|
transactionId,
|
||||||
|
@ -1021,6 +1021,7 @@ internal class DefaultVerificationService @Inject constructor(
|
||||||
cryptoStore,
|
cryptoStore,
|
||||||
qrCodeData.sharedSecret,
|
qrCodeData.sharedSecret,
|
||||||
qrCodeData.toUrl(),
|
qrCodeData.toUrl(),
|
||||||
|
userId,
|
||||||
deviceId ?: "",
|
deviceId ?: "",
|
||||||
false)
|
false)
|
||||||
|
|
||||||
|
|
|
@ -38,6 +38,7 @@ internal class DefaultQrCodeVerificationTransaction(
|
||||||
private val cryptoStore: IMXCryptoStore,
|
private val cryptoStore: IMXCryptoStore,
|
||||||
private val myGeneratedSecret: String,
|
private val myGeneratedSecret: String,
|
||||||
override val qrCodeText: String,
|
override val qrCodeText: String,
|
||||||
|
val userId: String,
|
||||||
val deviceId: String,
|
val deviceId: String,
|
||||||
override val isIncoming: Boolean
|
override val isIncoming: Boolean
|
||||||
) : DefaultVerificationTransaction(transactionId, otherUserId, otherDeviceId, isIncoming), QrCodeVerificationTransaction {
|
) : DefaultVerificationTransaction(transactionId, otherUserId, otherDeviceId, isIncoming), QrCodeVerificationTransaction {
|
||||||
|
@ -71,7 +72,7 @@ internal class DefaultQrCodeVerificationTransaction(
|
||||||
}
|
}
|
||||||
|
|
||||||
// check master key
|
// check master key
|
||||||
if (qrCodeData.otherUserKey != crossSigningService.getUserCrossSigningKeys(otherUserId)?.masterKey()?.unpaddedBase64PublicKey) {
|
if (qrCodeData.otherUserKey != crossSigningService.getUserCrossSigningKeys(userId)?.masterKey()?.unpaddedBase64PublicKey) {
|
||||||
return CancelCode.MismatchedKeys
|
return CancelCode.MismatchedKeys
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -46,6 +46,7 @@ import im.vector.riotx.core.di.HasScreenInjector
|
||||||
import im.vector.riotx.core.platform.EmptyViewEvents
|
import im.vector.riotx.core.platform.EmptyViewEvents
|
||||||
import im.vector.riotx.core.platform.VectorViewModel
|
import im.vector.riotx.core.platform.VectorViewModel
|
||||||
import im.vector.riotx.core.utils.LiveEvent
|
import im.vector.riotx.core.utils.LiveEvent
|
||||||
|
import timber.log.Timber
|
||||||
|
|
||||||
data class VerificationBottomSheetViewState(
|
data class VerificationBottomSheetViewState(
|
||||||
val otherUserMxItem: MatrixItem? = null,
|
val otherUserMxItem: MatrixItem? = null,
|
||||||
|
@ -175,6 +176,11 @@ class VerificationBottomSheetViewModel @AssistedInject constructor(@Assisted ini
|
||||||
.getExistingTransaction(action.otherUserId, action.transactionId) as? QrCodeVerificationTransaction
|
.getExistingTransaction(action.otherUserId, action.transactionId) as? QrCodeVerificationTransaction
|
||||||
existingTransaction
|
existingTransaction
|
||||||
?.userHasScannedRemoteQrCode(action.scannedData)
|
?.userHasScannedRemoteQrCode(action.scannedData)
|
||||||
|
?.let { cancelCode ->
|
||||||
|
// Something went wrong
|
||||||
|
Timber.w("## Something is not right: $cancelCode")
|
||||||
|
// TODO
|
||||||
|
}
|
||||||
}
|
}
|
||||||
is VerificationAction.SASMatchAction -> {
|
is VerificationAction.SASMatchAction -> {
|
||||||
(session.getVerificationService()
|
(session.getVerificationService()
|
||||||
|
|
Loading…
Reference in New Issue