crypto: Add a fixme to the sqlite store since it's not storing forwarding chains.

master
Damir Jelić 2020-09-02 15:08:24 +02:00
parent cc236a8765
commit d86c05efb3
2 changed files with 12 additions and 1 deletions

View File

@ -162,6 +162,7 @@ impl InboundGroupSession {
sender_key: self.sender_key.to_string(), sender_key: self.sender_key.to_string(),
signing_key: self.signing_key.to_string(), signing_key: self.signing_key.to_string(),
room_id: (&*self.room_id).clone(), room_id: (&*self.room_id).clone(),
forwarding_chains: self.forwarding_chains.lock().await.clone(),
} }
} }
@ -189,7 +190,7 @@ impl InboundGroupSession {
sender_key: Arc::new(pickle.sender_key), sender_key: Arc::new(pickle.sender_key),
signing_key: Arc::new(pickle.signing_key), signing_key: Arc::new(pickle.signing_key),
room_id: Arc::new(pickle.room_id), room_id: Arc::new(pickle.room_id),
forwarding_chains: Arc::new(Mutex::new(None)), forwarding_chains: Arc::new(Mutex::new(pickle.forwarding_chains)),
}) })
} }
@ -292,6 +293,9 @@ pub struct PickledInboundGroupSession {
pub signing_key: String, pub signing_key: String,
/// The id of the room that the session is used in. /// The id of the room that the session is used in.
pub room_id: RoomId, pub room_id: RoomId,
/// The list of claimed ed25519 that forwarded us this key. Will be None if
/// we dirrectly received this session.
pub forwarding_chains: Option<Vec<String>>,
} }
/// The typed representation of a base64 encoded string of the GroupSession pickle. /// The typed representation of a base64 encoded string of the GroupSession pickle.

View File

@ -399,6 +399,9 @@ impl SqliteStore {
sender_key, sender_key,
signing_key, signing_key,
room_id: RoomId::try_from(room_id)?, room_id: RoomId::try_from(room_id)?,
// Fixme we need to store/restore these once we get support
// for key requesting/forwarding.
forwarding_chains: None,
}; };
Ok(InboundGroupSession::from_pickle( Ok(InboundGroupSession::from_pickle(
@ -791,6 +794,10 @@ impl CryptoStore for SqliteStore {
let mut connection = self.connection.lock().await; let mut connection = self.connection.lock().await;
let session_id = session.session_id(); let session_id = session.session_id();
// FIXME we need to store/restore the forwarding chains.
// FIXME this should be converted so it accepts an array of sessions for
// the key import feature.
query( query(
"INSERT INTO inbound_group_sessions ( "INSERT INTO inbound_group_sessions (
session_id, account_id, sender_key, signing_key, session_id, account_id, sender_key, signing_key,