diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/QrCodeVerification.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/QrCodeVerification.kt
index de06691f93..bb6af2a48c 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/QrCodeVerification.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/QrCodeVerification.kt
@@ -174,14 +174,20 @@ internal class QrCodeVerification(
*/
@Throws(CryptoStoreErrorException::class)
private suspend fun confirm() {
- val request = withContext(Dispatchers.IO)
+ val result = withContext(Dispatchers.IO)
{
machine.confirmVerification(request.otherUser(), request.flowId())
}
- if (request != null) {
- this.sender.sendVerificationRequest(request)
+ if (result != null) {
+ this.sender.sendVerificationRequest(result.request)
dispatchTxUpdated()
+
+ val signatureRequest = result.signatureRequest
+
+ if (signatureRequest != null) {
+ this.sender.sendSignatureUpload(signatureRequest)
+ }
}
}
diff --git a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/SasVerification.kt b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/SasVerification.kt
index 4756ac5b1c..61e366ea94 100644
--- a/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/SasVerification.kt
+++ b/matrix-sdk-android/src/main/java/org/matrix/android/sdk/internal/crypto/SasVerification.kt
@@ -204,12 +204,19 @@ internal class SasVerification(
@Throws(CryptoStoreErrorException::class)
private suspend fun confirm() {
- val request = withContext(Dispatchers.IO) {
+ val result = withContext(Dispatchers.IO) {
machine.confirmVerification(inner.otherUserId, inner.flowId)
}
- if (request != null) {
- this.sender.sendVerificationRequest(request)
+
+ if (result != null) {
+ this.sender.sendVerificationRequest(result.request)
dispatchTxUpdated()
+
+ val signatureRequest = result.signatureRequest
+
+ if (signatureRequest != null) {
+ this.sender.sendSignatureUpload(signatureRequest)
+ }
}
}
diff --git a/rust-sdk/src/lib.rs b/rust-sdk/src/lib.rs
index 41842f7b6d..7d93ac22b4 100644
--- a/rust-sdk/src/lib.rs
+++ b/rust-sdk/src/lib.rs
@@ -29,7 +29,7 @@ pub use responses::{
pub use users::UserIdentity;
pub use verification::{
CancelInfo, QrCode, RequestVerificationResult, Sas, ScanResult, StartSasResult, Verification,
- VerificationRequest,
+ VerificationRequest, ConfirmVerificationResult,
};
/// Callback that will be passed over the FFI to report progress
diff --git a/rust-sdk/src/machine.rs b/rust-sdk/src/machine.rs
index 0be6f0fde1..701baa0602 100644
--- a/rust-sdk/src/machine.rs
+++ b/rust-sdk/src/machine.rs
@@ -38,10 +38,10 @@ use matrix_sdk_crypto::{
use crate::{
error::{CryptoStoreError, DecryptionError, SecretImportError, SignatureError},
responses::{response_from_string, OutgoingVerificationRequest, OwnedResponse},
- BootstrapCrossSigningResult, CrossSigningKeyExport, CrossSigningStatus, DecryptedEvent, Device,
- DeviceLists, KeyImportError, KeysImportResult, ProgressListener, QrCode, Request, RequestType,
- RequestVerificationResult, ScanResult, SignatureUploadRequest, StartSasResult, UserIdentity,
- Verification, VerificationRequest,
+ BootstrapCrossSigningResult, ConfirmVerificationResult, CrossSigningKeyExport,
+ CrossSigningStatus, DecryptedEvent, Device, DeviceLists, KeyImportError, KeysImportResult,
+ ProgressListener, QrCode, Request, RequestType, RequestVerificationResult, ScanResult,
+ SignatureUploadRequest, StartSasResult, UserIdentity, Verification, VerificationRequest,
};
/// A high level state machine that handles E2EE for Matrix.
@@ -945,18 +945,26 @@ impl OlmMachine {
&self,
user_id: &str,
flow_id: &str,
- ) -> Result