Skip to content

Commit

Permalink
fix(ffi): check that our own device is cross-signed before responding…
Browse files Browse the repository at this point in the history
… to incoming user verification requests
  • Loading branch information
stefanceriu committed Feb 11, 2025
1 parent 654885a commit 2999d10
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion bindings/matrix-sdk-ffi/src/session_verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ use matrix_sdk::{
Account,
};
use ruma::UserId;
use tracing::error;
use tracing::{error, warn};

use super::RUNTIME;
use crate::{client::UserProfile, error::ClientError, utils::Timestamp};
Expand Down Expand Up @@ -235,6 +235,15 @@ impl SessionVerificationController {
sender: &UserId,
flow_id: impl AsRef<str>,
) {
if sender != self.user_identity.user_id() {
if let Some(status) = self.encryption.cross_signing_status().await {
if !status.is_complete() {
warn!("Cannot verify other users until our own device's cross-signing status is complete: {:?}", status);
return;
}
}
}

let Some(request) = self.encryption.get_verification_request(sender, flow_id).await else {
error!("Failed retrieving verification request");
return;
Expand Down

0 comments on commit 2999d10

Please sign in to comment.