From f4517c150c3df9040b4bb07841a85dccaed92407 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Mon, 3 Aug 2020 14:51:04 +0200 Subject: [PATCH] crypto: Add more log lines to the SAS code. --- matrix_sdk_crypto/src/verification/sas/mod.rs | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/matrix_sdk_crypto/src/verification/sas/mod.rs b/matrix_sdk_crypto/src/verification/sas/mod.rs index 8404e64e..38462f6e 100644 --- a/matrix_sdk_crypto/src/verification/sas/mod.rs +++ b/matrix_sdk_crypto/src/verification/sas/mod.rs @@ -184,13 +184,34 @@ impl Sas { if let Some(device) = device { if device.keys() == self.other_device.keys() { + trace!( + "Marking device {} {} as verified.", + device.user_id(), + device.device_id() + ); + device.set_trust_state(TrustState::Verified); self.store.read().await.save_devices(&[device]).await?; + Ok(true) } else { + warn!( + "The device keys of {} {} have changed while an interactive \ + verification was going on, not marking the device as verified.", + device.user_id(), + device.device_id() + ); Ok(false) } } else { + let device = self.other_device(); + + info!( + "The device {} {} was deleted while a interactive \ + verification was going on.", + device.user_id(), + device.device_id() + ); Ok(false) } }