mirror of
https://github.com/chatmail/core.git
synced 2026-10-02 03:00:40 +03:00
refactor: rename _ex() -> _ext()
"ex" means "used to be, but no longer is". "ext" means "extended", which is the intended meaning. "Ext" is more common not only in the Rust ecosystem but in general. We already had several people (myself included) asking what "ex" is supposed to mean. To reproduce this commit, search and replace `_ex(?!\w)` -> `_ext`. But don't change `list_transports_ex` because it's public API.
This commit is contained in:
+9
-5
@@ -687,15 +687,19 @@ mod tests {
|
||||
salt: [1; 8],
|
||||
};
|
||||
|
||||
test_dont_decrypt_expensive_message_ex(s2k, false, None).await
|
||||
test_dont_decrypt_expensive_message_ext(s2k, false, None).await
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
async fn test_dont_decrypt_expensive_message_bad_s2k() -> Result<()> {
|
||||
let s2k = StringToKey::new_default(&mut thread_rng()); // Default is IteratedAndSalted
|
||||
|
||||
test_dont_decrypt_expensive_message_ex(s2k, false, Some("unsupported string2key algorithm"))
|
||||
.await
|
||||
test_dont_decrypt_expensive_message_ext(
|
||||
s2k,
|
||||
false,
|
||||
Some("unsupported string2key algorithm"),
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
#[tokio::test(flavor = "multi_thread", worker_threads = 2)]
|
||||
@@ -707,7 +711,7 @@ mod tests {
|
||||
|
||||
// This error message is actually not great,
|
||||
// but grepping for it will lead to the correct code
|
||||
test_dont_decrypt_expensive_message_ex(s2k, true, Some("decrypt_the_ring: missing key"))
|
||||
test_dont_decrypt_expensive_message_ext(s2k, true, Some("decrypt_the_ring: missing key"))
|
||||
.await
|
||||
}
|
||||
|
||||
@@ -716,7 +720,7 @@ mod tests {
|
||||
/// with an expensive string2key algorithm
|
||||
/// or multiple shared secrets.
|
||||
/// This is to prevent possible DOS attacks on the app.
|
||||
async fn test_dont_decrypt_expensive_message_ex(
|
||||
async fn test_dont_decrypt_expensive_message_ext(
|
||||
s2k: StringToKey,
|
||||
encrypt_twice: bool,
|
||||
expected_error_msg: Option<&str>,
|
||||
|
||||
Reference in New Issue
Block a user