crypto: Improve the logging for deserialization failures
parent
544881f11c
commit
6cc03d1c19
|
@ -809,12 +809,16 @@ impl OlmMachine {
|
|||
let mut events = Vec::new();
|
||||
|
||||
for event_result in &to_device_events.events {
|
||||
let mut event = if let Ok(e) = event_result.deserialize() {
|
||||
e
|
||||
} else {
|
||||
// Skip invalid events.
|
||||
warn!("Received an invalid to-device event {:?}", event_result);
|
||||
continue;
|
||||
let mut event = match event_result.deserialize() {
|
||||
Ok(e) => e,
|
||||
Err(e) => {
|
||||
// Skip invalid events.
|
||||
warn!(
|
||||
"Received an invalid to-device event {:?} {:?}",
|
||||
e, event_result
|
||||
);
|
||||
continue;
|
||||
}
|
||||
};
|
||||
|
||||
info!("Received a to-device event {:?}", event);
|
||||
|
@ -931,7 +935,10 @@ impl OlmMachine {
|
|||
// TODO check if this is from a verified device.
|
||||
let (decrypted_event, _) = session.decrypt(event).await?;
|
||||
|
||||
trace!("Successfully decrypted Megolm event {:?}", decrypted_event);
|
||||
trace!(
|
||||
"Successfully decrypted a Megolm event {:?}",
|
||||
decrypted_event
|
||||
);
|
||||
// TODO set the encryption info on the event (is it verified, was it
|
||||
// decrypted, sender key...)
|
||||
|
||||
|
|
|
@ -349,7 +349,7 @@ impl Account {
|
|||
(SessionType::New(session), plaintext)
|
||||
};
|
||||
|
||||
trace!("Successfully decrypted a Olm message: {}", plaintext);
|
||||
trace!("Successfully decrypted an Olm message: {}", plaintext);
|
||||
|
||||
let (event, signing_key) = match self.parse_decrypted_to_device_event(sender, &plaintext) {
|
||||
Ok(r) => r,
|
||||
|
|
Loading…
Reference in New Issue