Skip to content

Commit

Permalink
fix(indexeddb): Fix implementation of SafeEncode for tuple of 5 elements
Browse files Browse the repository at this point in the history
Regression introduced by merging commit 9707d73 after efdeba7

Signed-off-by: Kévin Commaille <[email protected]>
  • Loading branch information
zecakeh authored and jplatte committed Feb 13, 2023
1 parent 0d4fac5 commit 63fa645
Showing 1 changed file with 10 additions and 20 deletions.
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

0 comments on commit 63fa645

Please sign in to comment.