mirror of
https://github.com/matrix-org/matrix-rust-sdk.git
synced 2026-05-08 07:56:55 -04:00
fix(indexeddb): correctly encode Olm session keys
When we store an Olm session in the database, we encode the sender key and session ID using the store cipher. That means that we also need to encode them when we look them up, otherwise we won't find them.
This commit is contained in:
committed by
GitHub
parent
b9b00743c9
commit
5dbee7dcdc
@@ -639,13 +639,7 @@ impl IndexeddbCryptoStore {
|
||||
let account_info = self.get_account_info().ok_or(CryptoStoreError::AccountUnset)?;
|
||||
|
||||
if self.session_cache.get(sender_key).is_none() {
|
||||
let range = sender_key.encode_to_range().map_err(|e| {
|
||||
IndexeddbCryptoStoreError::DomException {
|
||||
code: 0,
|
||||
name: "IdbKeyRangeMakeError".to_owned(),
|
||||
message: e,
|
||||
}
|
||||
})?;
|
||||
let range = self.encode_to_range(KEYS::SESSION, sender_key)?;
|
||||
let sessions: Vec<Session> = self
|
||||
.inner
|
||||
.transaction_on_one_with_mode(KEYS::SESSION, IdbTransactionMode::Readonly)?
|
||||
|
||||
Reference in New Issue
Block a user