crypto: Rename the session creation method.
parent
d04c7e0190
commit
af7309033c
|
@ -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())?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -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,
|
||||||
|
|
|
@ -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");
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue