From 0215e89ff8476a71b21130610009965b41ded49f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 10 Apr 2020 09:57:10 +0200 Subject: [PATCH] crypto: Use an UUID for the to-device requests for session sharing. --- src/crypto/machine.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/crypto/machine.rs b/src/crypto/machine.rs index 4fa6cb24..1bdf2bf2 100644 --- a/src/crypto/machine.rs +++ b/src/crypto/machine.rs @@ -18,6 +18,7 @@ use std::convert::TryInto; use std::path::Path; use std::result::Result as StdResult; use std::sync::Arc; +use uuid::Uuid; use super::error::{OlmError, Result, SignatureError, VerificationResult}; use super::olm::{Account, InboundGroupSession, OutboundGroupSession, Session}; @@ -1009,7 +1010,7 @@ impl OlmMachine { message_vec.push(ToDeviceRequest { event_type: "m.room.encrypted".to_owned(), - txn_id: format!("{}-{}", session_id, i), + txn_id: Uuid::new_v4().to_string(), messages, }); }