remove mail-auth dep

The only remaining usage was in a benchmark
This commit is contained in:
Wez Furlong
2023-08-22 17:30:26 -07:00
parent 05e52d4ce6
commit dff9e50882
3 changed files with 23 additions and 224 deletions
Generated
+22 -194
View File
@@ -17,17 +17,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe"
[[package]]
name = "aes"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2"
dependencies = [
"cfg-if",
"cipher",
"cpufeatures",
]
[[package]]
name = "ahash"
version = "0.7.6"
@@ -39,18 +28,6 @@ dependencies = [
"version_check",
]
[[package]]
name = "ahash"
version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f"
dependencies = [
"cfg-if",
"getrandom",
"once_cell",
"version_check",
]
[[package]]
name = "aho-corasick"
version = "0.7.20"
@@ -430,10 +407,10 @@ dependencies = [
"http-body",
"hyper",
"pin-project-lite",
"rustls 0.21.6",
"rustls",
"rustls-pemfile",
"tokio",
"tokio-rustls 0.24.1",
"tokio-rustls",
"tower-service",
]
@@ -621,16 +598,6 @@ version = "1.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be"
[[package]]
name = "bzip2"
version = "0.4.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bdb116a6ef3f6c3698828873ad02c3014b3c85cadb88496095628e3ef1e347f8"
dependencies = [
"bzip2-sys",
"libc",
]
[[package]]
name = "bzip2-sys"
version = "0.1.11+1.0.8"
@@ -704,7 +671,6 @@ dependencies = [
"futures",
"indexmap 1.9.3",
"k9",
"mail-auth",
"mailparse",
"memchr",
"nom 7.1.3",
@@ -976,12 +942,6 @@ version = "0.9.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f"
[[package]]
name = "constant_time_eq"
version = "0.1.5"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "245097e9a4535ee1e3e3931fcfcd55a796a44c643e8596ff6566d68f09b87bbc"
[[package]]
name = "cookie-factory"
version = "0.3.2"
@@ -1861,7 +1821,7 @@ version = "0.12.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888"
dependencies = [
"ahash 0.7.6",
"ahash",
]
[[package]]
@@ -2046,9 +2006,9 @@ dependencies = [
"futures-util",
"http",
"hyper",
"rustls 0.21.6",
"rustls",
"tokio",
"tokio-rustls 0.24.1",
"tokio-rustls",
]
[[package]]
@@ -2183,7 +2143,7 @@ dependencies = [
"kumo-api-types",
"kumo-log-types",
"lipsum",
"mail-builder 0.2.5",
"mail-builder",
"maildir",
"mailparse",
"nix 0.26.2",
@@ -2193,7 +2153,7 @@ dependencies = [
"tempfile",
"textwrap 0.16.0",
"tokio",
"zstd 0.12.4",
"zstd",
]
[[package]]
@@ -2431,7 +2391,7 @@ dependencies = [
"once_cell",
"prometheus",
"rcgen",
"rustls 0.21.6",
"rustls",
"rustls-pemfile",
"serde",
"serde_json",
@@ -2518,7 +2478,7 @@ dependencies = [
"kumo-server-runtime",
"lazy_static",
"lruttl",
"mail-builder 0.2.5",
"mail-builder",
"mail-parser",
"maildir",
"maplit",
@@ -2533,7 +2493,7 @@ dependencies = [
"prometheus",
"rand",
"rfc5321",
"rustls 0.21.6",
"rustls",
"self_cell",
"serde",
"serde_json",
@@ -2543,12 +2503,12 @@ dependencies = [
"throttle",
"timeq",
"tokio",
"tokio-rustls 0.24.1",
"tokio-rustls",
"tracing",
"uuid",
"version-info",
"webpki-roots 0.22.6",
"zstd 0.12.4",
"zstd",
]
[[package]]
@@ -2775,27 +2735,6 @@ dependencies = [
"libc",
]
[[package]]
name = "mail-auth"
version = "0.3.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c6b0969bac270a60560d3a6f89c812b3e39b2f4b3ca8d866063f482030d14f19"
dependencies = [
"ahash 0.8.3",
"flate2",
"lru-cache",
"mail-builder 0.3.0",
"mail-parser",
"parking_lot",
"quick-xml",
"ring",
"rustls-pemfile",
"serde",
"serde_json",
"trust-dns-resolver",
"zip",
]
[[package]]
name = "mail-builder"
version = "0.2.5"
@@ -2805,15 +2744,6 @@ dependencies = [
"gethostname 0.4.3",
]
[[package]]
name = "mail-builder"
version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "765969f4385f88a62738e8ed63e2fa630571d7ed6fd96ca6932d699513dd8c28"
dependencies = [
"gethostname 0.4.3",
]
[[package]]
name = "mail-parser"
version = "0.8.2"
@@ -2983,7 +2913,7 @@ version = "0.20.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7b9b8653cec6897f73b519a43fba5ee3d50f62fe9af80b428accdcc093b4a849"
dependencies = [
"ahash 0.7.6",
"ahash",
"metrics-macros",
"portable-atomic 0.3.20",
]
@@ -3170,7 +3100,7 @@ version = "0.1.0"
dependencies = [
"anyhow",
"config",
"mail-builder 0.2.5",
"mail-builder",
"mailparse",
"mlua",
"reqwest",
@@ -3611,35 +3541,12 @@ dependencies = [
"regex",
]
[[package]]
name = "password-hash"
version = "0.4.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700"
dependencies = [
"base64ct",
"rand_core",
"subtle",
]
[[package]]
name = "paste"
version = "1.0.14"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c"
[[package]]
name = "pbkdf2"
version = "0.11.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917"
dependencies = [
"digest",
"hmac",
"password-hash",
"sha2",
]
[[package]]
name = "peeking_take_while"
version = "0.1.2"
@@ -4025,15 +3932,6 @@ version = "2.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a993555f31e5a609f617c12db6250dedcac1b0a85076912c436e6fc9b2c8e6a3"
[[package]]
name = "quick-xml"
version = "0.28.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ce5e73202a820a31f8a0ee32ada5e21029c81fd9e3ebf668a40832e4219d9d1"
dependencies = [
"memchr",
]
[[package]]
name = "quote"
version = "0.6.13"
@@ -4300,13 +4198,13 @@ dependencies = [
"once_cell",
"percent-encoding",
"pin-project-lite",
"rustls 0.21.6",
"rustls",
"rustls-pemfile",
"serde",
"serde_json",
"serde_urlencoded",
"tokio",
"tokio-rustls 0.24.1",
"tokio-rustls",
"tower-service",
"url",
"wasm-bindgen",
@@ -4337,7 +4235,7 @@ dependencies = [
"serde",
"thiserror",
"tokio",
"tokio-rustls 0.24.1",
"tokio-rustls",
"tracing",
"webpki-roots 0.22.6",
]
@@ -4471,18 +4369,6 @@ dependencies = [
"windows-sys 0.48.0",
]
[[package]]
name = "rustls"
version = "0.20.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f"
dependencies = [
"log",
"ring",
"sct",
"webpki",
]
[[package]]
name = "rustls"
version = "0.21.6"
@@ -4502,7 +4388,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "060bcc1795b840d0e56d78f3293be5f652aa1611d249b0e63ffe19f4a8c9ae23"
dependencies = [
"log",
"rustls 0.21.6",
"rustls",
"rustls-native-certs",
"rustls-webpki",
]
@@ -5056,7 +4942,7 @@ dependencies = [
"serde",
"serde_json",
"thiserror",
"zstd-safe 6.0.6",
"zstd-safe",
]
[[package]]
@@ -5367,24 +5253,13 @@ dependencies = [
"tokio-stream",
]
[[package]]
name = "tokio-rustls"
version = "0.23.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59"
dependencies = [
"rustls 0.20.8",
"tokio",
"webpki",
]
[[package]]
name = "tokio-rustls"
version = "0.24.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "c28327cf380ac148141087fbfb9de9d7bd4e84ab5d2c28fbc911d753de8a7081"
dependencies = [
"rustls 0.21.6",
"rustls",
"tokio",
]
@@ -5645,18 +5520,13 @@ dependencies = [
"ipnet",
"lazy_static",
"rand",
"ring",
"rustls 0.20.8",
"rustls-pemfile",
"serde",
"smallvec 1.11.0",
"thiserror",
"tinyvec",
"tokio",
"tokio-rustls 0.23.4",
"tracing",
"url",
"webpki",
]
[[package]]
@@ -5672,15 +5542,12 @@ dependencies = [
"lru-cache",
"parking_lot",
"resolv-conf",
"rustls 0.20.8",
"serde",
"smallvec 1.11.0",
"thiserror",
"tokio",
"tokio-rustls 0.23.4",
"tracing",
"trust-dns-proto",
"webpki-roots 0.22.6",
]
[[package]]
@@ -5717,7 +5584,7 @@ dependencies = [
"tikv-jemalloc-sys",
"tikv-jemallocator",
"tokio",
"tokio-rustls 0.24.1",
"tokio-rustls",
"toml",
"toml_edit",
"tracing",
@@ -6285,52 +6152,13 @@ version = "1.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9"
[[package]]
name = "zip"
version = "0.6.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "760394e246e4c28189f19d488c058bf16f564016aefac5d32bb1f3b51d5e9261"
dependencies = [
"aes",
"byteorder",
"bzip2",
"constant_time_eq",
"crc32fast",
"crossbeam-utils",
"flate2",
"hmac",
"pbkdf2",
"sha1",
"time",
"zstd 0.11.2+zstd.1.5.2",
]
[[package]]
name = "zstd"
version = "0.11.2+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "20cc960326ece64f010d2d2107537f26dc589a6573a316bd5b1dba685fa5fde4"
dependencies = [
"zstd-safe 5.0.2+zstd.1.5.2",
]
[[package]]
name = "zstd"
version = "0.12.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a27595e173641171fc74a1232b7b1c7a7cb6e18222c11e9dfb9888fa424c53c"
dependencies = [
"zstd-safe 6.0.6",
]
[[package]]
name = "zstd-safe"
version = "5.0.2+zstd.1.5.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1d2a5585e04f9eea4b2a3d1eca508c4dee9592a89ef6f450c11719da0726f4db"
dependencies = [
"libc",
"zstd-sys",
"zstd-safe",
]
[[package]]
-1
View File
@@ -39,7 +39,6 @@ trust-dns-resolver = {workspace=true}
[dev-dependencies]
criterion = "0.3"
k9 = "0.11"
mail-auth = "0.3"
regex = "1"
tokio = { workspace=true, features = ["macros"] }
+1 -29
View File
@@ -109,33 +109,5 @@ pub fn criterion_benchmark(c: &mut Criterion) {
}
}
pub fn mail_auth_benchmark(c: &mut Criterion) {
let email_text = email_text();
use mail_auth::common::crypto::{RsaKey, Sha256};
use mail_auth::dkim::{Canonicalization, DkimSigner};
for canon in [Canonicalization::Simple, Canonicalization::Relaxed] {
let key_data = std::fs::read_to_string("./test/keys/2022.private").unwrap();
let key = RsaKey::<Sha256>::from_rsa_pem(&key_data).unwrap();
let signer = DkimSigner::from_key(key)
.domain("example.com")
.selector("s20")
.headers(["From", "Subject"])
.header_canonicalization(canon)
.body_canonicalization(canon);
let mut group = c.benchmark_group("mail-auth signing");
group.sampling_mode(SamplingMode::Flat);
group.throughput(Throughput::Bytes(email_text.len() as u64));
group.bench_function(&format!("sign {canon:?}"), |b| {
b.iter(|| signer.sign(black_box(email_text.as_bytes())).unwrap())
});
group.finish();
}
}
criterion_group!(benches, criterion_benchmark);
criterion_group!(mail_auth, mail_auth_benchmark);
criterion_main!(benches, mail_auth);
criterion_main!(benches);