Skip to content

Commit

Permalink
crypto(verification): pass a copy of the other DeviceData in betwee…
Browse files Browse the repository at this point in the history
…n the (Requested, Ready) and (Created, Ready) states
  • Loading branch information
stefanceriu committed Oct 24, 2024
1 parent ef8d3f9 commit 142d420
Show file tree
Hide file tree
Showing 4 changed files with 90 additions and 92 deletions.
2 changes: 1 addition & 1 deletion bindings/matrix-sdk-crypto-ffi/src/verification.rs
Original file line number Diff line number Diff line change
Expand Up @@ -752,7 +752,7 @@ impl VerificationRequest {
RustVerificationRequestState::Ready {
their_methods,
our_methods,
other_device_id: _,
other_device_data: _,
} => VerificationRequestState::Ready {
their_methods: their_methods.iter().map(|m| m.to_string()).collect(),
our_methods: our_methods.iter().map(|m| m.to_string()).collect(),
Expand Down
8 changes: 7 additions & 1 deletion crates/matrix-sdk-crypto/src/verification/machine.rs
Original file line number Diff line number Diff line change
Expand Up @@ -412,7 +412,13 @@ impl VerificationMachine {
};

if request.flow_id() == &flow_id {
request.receive_ready(event.sender(), c);
if let Some(device_data) =
self.store.get_device(event.sender(), c.from_device()).await?
{
request.receive_ready(event.sender(), c, device_data);
} else {
warn!("Could not retrieve the data for the accepting device, ignoring it");
}
} else {
flow_id_mismatch();
}
Expand Down
Loading

0 comments on commit 142d420

Please sign in to comment.