crypto: Rename the session creation method.

master
Damir Jelić 2020-04-10 14:44:25 +02:00
parent d04c7e0190
commit af7309033c
3 changed files with 5 additions and 4 deletions

View File

@ -703,7 +703,7 @@ impl OlmMachine {
OlmMessage::Message(_) => return Err(OlmError::SessionWedged), OlmMessage::Message(_) => return Err(OlmError::SessionWedged),
OlmMessage::PreKey(m) => { OlmMessage::PreKey(m) => {
let account = self.account.lock().await; let account = self.account.lock().await;
account.create_inbound_session_from(sender_key, m.clone())? account.create_inbound_session(sender_key, m.clone())?
} }
}; };

View File

@ -166,7 +166,7 @@ impl Account {
/// ///
/// * `message` - A pre-key Olm message that was sent to us by the other /// * `message` - A pre-key Olm message that was sent to us by the other
/// account. /// account.
pub fn create_inbound_session_from( pub fn create_inbound_session(
&self, &self,
their_identity_key: &str, their_identity_key: &str,
message: PreKeyMessage, message: PreKeyMessage,

View File

@ -437,6 +437,7 @@ impl std::fmt::Debug for SqliteStore {
#[cfg(test)] #[cfg(test)]
mod test { mod test {
use crate::crypto::olm::GroupSessionKey;
use olm_rs::outbound_group_session::OlmOutboundGroupSession; use olm_rs::outbound_group_session::OlmOutboundGroupSession;
use ruma_client_api::r0::keys::SignedKey; use ruma_client_api::r0::keys::SignedKey;
use std::collections::HashMap; use std::collections::HashMap;
@ -631,7 +632,7 @@ mod test {
identity_keys.curve25519(), identity_keys.curve25519(),
identity_keys.ed25519(), identity_keys.ed25519(),
&RoomId::try_from("!test:localhost").unwrap(), &RoomId::try_from("!test:localhost").unwrap(),
&outbound_session.session_key(), GroupSessionKey(outbound_session.session_key()),
) )
.expect("Can't create session"); .expect("Can't create session");
@ -652,7 +653,7 @@ mod test {
identity_keys.curve25519(), identity_keys.curve25519(),
identity_keys.ed25519(), identity_keys.ed25519(),
&RoomId::try_from("!test:localhost").unwrap(), &RoomId::try_from("!test:localhost").unwrap(),
&outbound_session.session_key(), GroupSessionKey(outbound_session.session_key()),
) )
.expect("Can't create session"); .expect("Can't create session");