Skip to content

fix(indexeddb): Fix implementation of SafeEncode for tuple of 5 elements #1490

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Feb 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions bindings/matrix-sdk-crypto-ffi/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,9 @@

#![warn(missing_docs)]
#![allow(unused_qualifications)]
// Triggers false positives.
// See <https://github.com/rust-lang/rust-clippy/issues/10319>.
#![allow(clippy::extra_unused_type_parameters)]

mod backup_recovery_key;
mod device;
Expand Down
6 changes: 5 additions & 1 deletion bindings/matrix-sdk-crypto-js/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,11 @@
#![doc = include_str!("../README.md")]
#![cfg_attr(docsrs, feature(doc_auto_cfg))]
#![warn(missing_docs, missing_debug_implementations)]
#![allow(clippy::drop_non_drop)] // triggered by wasm_bindgen code
// triggered by wasm_bindgen code
#![allow(clippy::drop_non_drop)]
// Triggers false positives.
// See <https://github.com/rust-lang/rust-clippy/issues/10319>.
#![allow(clippy::extra_unused_type_parameters)]

pub mod attachment;
pub mod device;
Expand Down
3 changes: 3 additions & 0 deletions bindings/matrix-sdk-ffi/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
// TODO: target-os conditional would be good.

#![allow(unused_qualifications)]
// Triggers false positives.
// See <https://github.com/rust-lang/rust-clippy/issues/10319>.
#![allow(clippy::extra_unused_type_parameters)]

macro_rules! unwrap_or_clone_arc_into_variant {
(
Expand Down
30 changes: 10 additions & 20 deletions crates/matrix-sdk-indexeddb/src/safe_encode.rs
Original file line number Diff line number Diff line change
Expand Up @@ -230,30 +230,20 @@ where

fn as_secure_string(&self, table_name: &str, store_cipher: &StoreCipher) -> String {
[
&base64_encode(
store_cipher.hash_key(table_name, self.0.as_encoded_string().as_bytes()),
&STANDARD_NO_PAD,
),
&STANDARD_NO_PAD
.encode(store_cipher.hash_key(table_name, self.0.as_encoded_string().as_bytes())),
KEY_SEPARATOR,
&base64_encode(
store_cipher.hash_key(table_name, self.1.as_encoded_string().as_bytes()),
&STANDARD_NO_PAD,
),
&STANDARD_NO_PAD
.encode(store_cipher.hash_key(table_name, self.1.as_encoded_string().as_bytes())),
KEY_SEPARATOR,
&base64_encode(
store_cipher.hash_key(table_name, self.2.as_encoded_string().as_bytes()),
&STANDARD_NO_PAD,
),
&STANDARD_NO_PAD
.encode(store_cipher.hash_key(table_name, self.2.as_encoded_string().as_bytes())),
KEY_SEPARATOR,
&base64_encode(
store_cipher.hash_key(table_name, self.3.as_encoded_string().as_bytes()),
&STANDARD_NO_PAD,
),
&STANDARD_NO_PAD
.encode(store_cipher.hash_key(table_name, self.3.as_encoded_string().as_bytes())),
KEY_SEPARATOR,
&base64_encode(
store_cipher.hash_key(table_name, self.4.as_encoded_string().as_bytes()),
&STANDARD_NO_PAD,
),
&STANDARD_NO_PAD
.encode(store_cipher.hash_key(table_name, self.4.as_encoded_string().as_bytes())),
]
.concat()
}
Expand Down