From af7309033cbd387b84d840a66658a1ebe51f41d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Damir=20Jeli=C4=87?= Date: Fri, 10 Apr 2020 14:44:25 +0200 Subject: [PATCH] crypto: Rename the session creation method. --- src/crypto/machine.rs | 2 +- src/crypto/olm.rs | 2 +- src/crypto/store/sqlite.rs | 5 +++-- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/crypto/machine.rs b/src/crypto/machine.rs index 431a0890..1037bc1d 100644 --- a/src/crypto/machine.rs +++ b/src/crypto/machine.rs @@ -703,7 +703,7 @@ impl OlmMachine { OlmMessage::Message(_) => return Err(OlmError::SessionWedged), OlmMessage::PreKey(m) => { let account = self.account.lock().await; - account.create_inbound_session_from(sender_key, m.clone())? + account.create_inbound_session(sender_key, m.clone())? } }; diff --git a/src/crypto/olm.rs b/src/crypto/olm.rs index 819ad4ed..7ba0951e 100644 --- a/src/crypto/olm.rs +++ b/src/crypto/olm.rs @@ -166,7 +166,7 @@ impl Account { /// /// * `message` - A pre-key Olm message that was sent to us by the other /// account. - pub fn create_inbound_session_from( + pub fn create_inbound_session( &self, their_identity_key: &str, message: PreKeyMessage, diff --git a/src/crypto/store/sqlite.rs b/src/crypto/store/sqlite.rs index 8cfcb3a9..32742326 100644 --- a/src/crypto/store/sqlite.rs +++ b/src/crypto/store/sqlite.rs @@ -437,6 +437,7 @@ impl std::fmt::Debug for SqliteStore { #[cfg(test)] mod test { + use crate::crypto::olm::GroupSessionKey; use olm_rs::outbound_group_session::OlmOutboundGroupSession; use ruma_client_api::r0::keys::SignedKey; use std::collections::HashMap; @@ -631,7 +632,7 @@ mod test { identity_keys.curve25519(), identity_keys.ed25519(), &RoomId::try_from("!test:localhost").unwrap(), - &outbound_session.session_key(), + GroupSessionKey(outbound_session.session_key()), ) .expect("Can't create session"); @@ -652,7 +653,7 @@ mod test { identity_keys.curve25519(), identity_keys.ed25519(), &RoomId::try_from("!test:localhost").unwrap(), - &outbound_session.session_key(), + GroupSessionKey(outbound_session.session_key()), ) .expect("Can't create session");