From 28de8c37d518f613c57db6259bcf4532b4d25955 Mon Sep 17 00:00:00 2001 From: ihciah Date: Tue, 12 Dec 2023 17:15:50 +0000 Subject: [PATCH] chore: update depencencies --- Cargo.lock | 646 +++++++++++++++++++++++------------------------ Cargo.toml | 11 +- Dockerfile | 2 +- src/client.rs | 120 +++++---- src/helper_v2.rs | 177 ++++++------- src/main.rs | 5 +- src/server.rs | 31 ++- src/util.rs | 16 +- tests/sni.rs | 8 +- 9 files changed, 478 insertions(+), 538 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6993182..779f71b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,70 +2,78 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "aho-corasick" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +dependencies = [ + "memchr", +] + [[package]] name = "anstream" -version = "0.3.2" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ca84f3628370c59db74ee214b3263d58f9aadd9b4fe7e711fd87dc452b7f163" +checksum = "d664a92ecae85fd0a7392615844904654d1d5f5514837f471ddef4a057aba1b6" dependencies = [ "anstyle", "anstyle-parse", "anstyle-query", "anstyle-wincon", "colorchoice", - "is-terminal", "utf8parse", ] [[package]] name = "anstyle" -version = "1.0.0" +version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41ed9a86bf92ae6580e0a31281f65a1b1d867c0cc68d5346e2ae128dddfa6a7d" +checksum = "7079075b41f533b8c61d2a4d073c4676e1f8b249ff94a393b0595db304e0dd87" [[package]] name = "anstyle-parse" -version = "0.2.0" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e765fd216e48e067936442276d1d57399e37bce53c264d6fefbe298080cb57ee" +checksum = "c75ac65da39e5fe5ab759307499ddad880d724eed2f6ce5b5e8a26f4f387928c" dependencies = [ "utf8parse", ] [[package]] name = "anstyle-query" -version = "1.0.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ca11d4be1bab0c8bc8734a9aa7bf4ee8316d462a08c6ac5052f888fef5b494b" +checksum = "e28923312444cdd728e4738b3f9c9cac739500909bb3d3c94b43551b16517648" dependencies = [ - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anstyle-wincon" -version = "1.0.1" +version = "3.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "180abfa45703aebe0093f79badacc01b8fd4ea2e35118747e5811127f926e188" +checksum = "1cd54b81ec8d6180e24654d0b371ad22fc3dd083b6ff8ba325b72e00c87660a7" dependencies = [ "anstyle", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] name = "anyhow" -version = "1.0.71" +version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c7d0618f0e0b7e8ff11427422b64564d5fb0be1940354bfe2e0529b18a9d9b8" +checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" [[package]] name = "auto-const-array" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "336c4771be12bbacae182a5ad2a788bfa27d2c21c5837731480ab5cf161c0e04" +checksum = "62f7df18977a1ee03650ee4b31b4aefed6d56bac188760b6e37610400fe8d4bb" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -80,6 +88,12 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" +[[package]] +name = "bitflags" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "327762f6e5a765692301e5bb513e0d9fef63be86bbc14528052b1cd3e6f03e07" + [[package]] name = "block-buffer" version = "0.10.4" @@ -91,27 +105,30 @@ dependencies = [ [[package]] name = "bumpalo" -version = "3.12.2" +version = "3.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c6ed94e98ecff0c12dd1b04c15ec0d7d9458ca8fe806cea6f12954efe74c63b" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" [[package]] name = "byteorder" -version = "1.4.3" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.4.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" +checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" [[package]] name = "cc" -version = "1.0.79" +version = "1.0.83" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] [[package]] name = "cfg-if" @@ -121,45 +138,43 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" [[package]] name = "clap" -version = "4.2.7" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34d21f9bf1b425d2968943631ec91202fe5e837264063503708b83013f8fc938" +checksum = "bfaff671f6b22ca62406885ece523383b9b64022e341e53e009a62ebc47a45f2" dependencies = [ "clap_builder", "clap_derive", - "once_cell", ] [[package]] name = "clap_builder" -version = "4.2.7" +version = "4.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914c8c79fb560f238ef6429439a30023c862f7a28e688c58f7203f12b29970bd" +checksum = "a216b506622bb1d316cd51328dce24e07bdff4a6128a47c7e7fad11878d5adbb" dependencies = [ "anstream", "anstyle", - "bitflags", "clap_lex", "strsim", ] [[package]] name = "clap_derive" -version = "4.2.0" +version = "4.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9644cd56d6b87dbe899ef8b053e331c0637664e9e21a33dfcdc36093f5c5c4" +checksum = "cf9804afaaf59a91e75b022a30fb7229a7901f60c755489cc61c9b423b836442" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.16", + "syn", ] [[package]] name = "clap_lex" -version = "0.4.1" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a2dd5a6fe8c6e3502f568a6353e5273bbb15193ad9a89e457b9970798efbea1" +checksum = "702fc72eb24e5a1e48ce58027a675bc24edd52096d5397d4aea7c6dd9eca0bd1" [[package]] name = "colorchoice" @@ -169,9 +184,9 @@ checksum = "acbf1af155f9b9ef647e42cdc158db4b64a1b61f743629225fde6f3e0be2a7c7" [[package]] name = "cpufeatures" -version = "0.2.7" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" +checksum = "ce420fe07aecd3e67c5f910618fe65e94158f6dcc0adf44e00d69ce2bdfe0fd0" dependencies = [ "libc", ] @@ -188,46 +203,25 @@ dependencies = [ [[package]] name = "ctrlc" -version = "3.2.5" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbcf33c2a618cbe41ee43ae6e9f2e48368cd9f9db2896f10167d8d762679f639" +checksum = "82e95fbd621905b854affdc67943b043a0fbb6ed7385fd5a25650d19a8a6cfdf" dependencies = [ - "nix 0.26.2", - "windows-sys 0.45.0", + "nix 0.27.1", + "windows-sys 0.48.0", ] [[package]] name = "digest" -version = "0.10.6" +version = "0.10.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer", "crypto-common", "subtle", ] -[[package]] -name = "errno" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys 0.48.0", -] - -[[package]] -name = "errno-dragonfly" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" -dependencies = [ - "cc", - "libc", -] - [[package]] name = "flume" version = "0.10.14" @@ -243,27 +237,27 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" +checksum = "eb1d22c66e66d9d72e1758f0bd7d4fd0bee04cad842ee34587d68c07e45d088c" [[package]] name = "futures-sink" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" +checksum = "e36d3378ee38c2a36ad710c5d30c2911d752cb941c00c72dbabfb786a7970817" [[package]] name = "futures-task" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" +checksum = "efd193069b0ddadc69c46389b740bbccdd97203899b48d09c5f7969591d6bae2" [[package]] name = "futures-util" -version = "0.3.28" +version = "0.3.29" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" +checksum = "a19526d624e703a3179b3d322efec918b6246ea0fa51d41124525f00f1cc8104" dependencies = [ "futures-core", "futures-task", @@ -292,9 +286,9 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.9" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "js-sys", @@ -311,18 +305,9 @@ checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" [[package]] name = "hermit-abi" -version = "0.2.6" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7" -dependencies = [ - "libc", -] - -[[package]] -name = "hermit-abi" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286" +checksum = "d77f7ec81a6d05a3abb01ab6eb7590f6083d08449fe5a1c8b1e620283546ccb7" [[package]] name = "hmac" @@ -333,50 +318,27 @@ dependencies = [ "digest", ] -[[package]] -name = "io-lifetimes" -version = "1.0.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c66c74d2ae7e79a5a8f7ac924adbe38ee42a859c6539ad869eb51f0b52dc220" -dependencies = [ - "hermit-abi 0.3.1", - "libc", - "windows-sys 0.48.0", -] - [[package]] name = "io-uring" -version = "0.5.13" +version = "0.6.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd1e1a01cfb924fd8c5c43b6827965db394f5a3a16c599ce03452266e1cf984c" +checksum = "460648e47a07a43110fbfa2e0b14afb2be920093c31e5dccc50e49568e099762" dependencies = [ - "bitflags", + "bitflags 1.3.2", "libc", ] -[[package]] -name = "is-terminal" -version = "0.4.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adcf93614601c8129ddf72e2d5633df827ba6551541c6d8c59520a371475be1f" -dependencies = [ - "hermit-abi 0.3.1", - "io-lifetimes", - "rustix", - "windows-sys 0.48.0", -] - [[package]] name = "itoa" -version = "1.0.6" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" [[package]] name = "js-sys" -version = "0.3.63" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" dependencies = [ "wasm-bindgen", ] @@ -389,21 +351,15 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.144" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" - -[[package]] -name = "linux-raw-sys" -version = "0.3.7" +version = "0.2.151" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ece97ea872ece730aed82664c424eb4c8291e1ff2480247ccf7409044bc6479f" +checksum = "302d7ab3130588088d277783b1e2d2e10c9e9e4a16dd9050e6ec93fb3e7048f4" [[package]] name = "local-sync" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5271fc029f75f74ab28194c9bd8580a1b953a8c3896e70b2a61b8dceb3667e79" +checksum = "3865cc3ed16dd99f3b89098478647a558a5a2f6dc5f0b45d7867d75da80050ef" dependencies = [ "futures-core", "futures-sink", @@ -412,9 +368,9 @@ dependencies = [ [[package]] name = "lock_api" -version = "0.4.9" +version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" dependencies = [ "autocfg", "scopeguard", @@ -422,12 +378,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.17" +version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if", -] +checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" [[package]] name = "matchers" @@ -435,34 +388,41 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8263075bb86c5a1b1427b5ae862e8889656f126e9f77c484496e8b47cf5c5558" dependencies = [ - "regex-automata", + "regex-automata 0.1.10", ] +[[package]] +name = "memchr" +version = "2.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" + [[package]] name = "memoffset" -version = "0.6.5" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" +checksum = "5de893c32cde5f383baa4c04c5d6dbdd735cfd4a794b0debdb2bb1b421da5ff4" dependencies = [ "autocfg", ] [[package]] name = "mio" -version = "0.8.6" +version = "0.8.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +checksum = "8f3d0b296e374a4e6f3c7b0a1f5a51d748a0d34c85e7dc48fc3fa9a87657fe09" dependencies = [ "libc", "log", "wasi", - "windows-sys 0.45.0", + "windows-sys 0.48.0", ] [[package]] name = "monoio" -version = "0.1.3" -source = "git+https://github.com/bytedance/monoio?branch=master#5902eb8a6f4bd9ec65da4407efaaedfdaf5493f2" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c91a9bcc2622991bc92f3b6d7dc495329c4863e4dc530d1748529b009bb2170a" dependencies = [ "auto-const-array", "bytes", @@ -472,30 +432,42 @@ dependencies = [ "libc", "mio", "monoio-macros", - "nix 0.25.1", + "nix 0.26.4", "pin-project-lite", "socket2", "threadpool", + "windows-sys 0.48.0", +] + +[[package]] +name = "monoio-io-wrapper" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4bcfaa76e5daf87cc4d31b4d1b6bc93c12db59c19df50b9200afdbde42077655" +dependencies = [ + "monoio", ] [[package]] name = "monoio-macros" -version = "0.0.3" -source = "git+https://github.com/bytedance/monoio?branch=master#5902eb8a6f4bd9ec65da4407efaaedfdaf5493f2" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "176a5f5e69613d9e88337cf2a65e11135332b4efbcc628404a7c555e4452084c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn", ] [[package]] name = "monoio-rustls-fork-shadow-tls" -version = "0.1.1-mod.0" +version = "0.3.0-mod.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14f265b573714c395dfb0dae82b8090a81922d1399bcb30a210c69cec3b5fd06" +checksum = "6e24e3f4f85c39e9d009ab7feb304fdf8e8465d8039e59335fd73be80141d930" dependencies = [ "bytes", "monoio", + "monoio-io-wrapper", "rustls-fork-shadow-tls", "thiserror", ] @@ -511,12 +483,11 @@ dependencies = [ [[package]] name = "nix" -version = "0.25.1" +version = "0.26.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" +checksum = "598beaf3cc6fdd9a5dfb1630c2800c7acd31df7aaf0f565796fba2b53ca1af1b" dependencies = [ - "autocfg", - "bitflags", + "bitflags 1.3.2", "cfg-if", "libc", "memoffset", @@ -525,14 +496,13 @@ dependencies = [ [[package]] name = "nix" -version = "0.26.2" +version = "0.27.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfdda3d196821d6af13126e40375cdf7da646a96114af134d5f417a9a1dc8e1a" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" dependencies = [ - "bitflags", + "bitflags 2.4.1", "cfg-if", "libc", - "static_assertions", ] [[package]] @@ -547,19 +517,19 @@ dependencies = [ [[package]] name = "num_cpus" -version = "1.15.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b" +checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" dependencies = [ - "hermit-abi 0.2.6", + "hermit-abi", "libc", ] [[package]] name = "once_cell" -version = "1.17.1" +version = "1.19.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" +checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92" [[package]] name = "overload" @@ -569,29 +539,29 @@ checksum = "b15813163c1d831bf4a13c3610c05c0d03b39feb07f7e09fa234dac9b15aaf39" [[package]] name = "pin-project" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c95a7476719eab1e366eaf73d0260af3021184f18177925b07f54b30089ceead" +checksum = "fda4ed1c6c173e3fc7a83629421152e01d7b1f9b7f65fb301e490e8cfc656422" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.0" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "39407670928234ebc5e6e580247dd567ad73a3578460c5990f9503df207e8f07" +checksum = "4359fd9c9171ec6e8c62926d6faaf553a8dc3f64e1507e76da7911b4f6a04405" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn", ] [[package]] name = "pin-project-lite" -version = "0.2.9" +version = "0.2.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" +checksum = "8afb450f006bf6385ca15ef45d71d2288452bc3683ce2e2cacc0d18e4be60b58" [[package]] name = "pin-utils" @@ -607,18 +577,18 @@ checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.58" +version = "1.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa1fb82fc0c281dd9671101b66b771ebbe1eaf967b96ac8740dcba4b70005ca8" +checksum = "39278fbbf5fb4f646ce651690877f89d1c5811a3d4acb27700c1cb3cdb78fd3b" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.27" +version = "1.0.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" +checksum = "5267fca4496028628a95160fc423a33e8b2e6af8a5302579e322e4b520293cae" dependencies = [ "proc-macro2", ] @@ -655,11 +625,14 @@ dependencies = [ [[package]] name = "regex" -version = "1.8.1" +version = "1.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af83e617f331cc6ae2da5443c602dfa5af81e517212d9d611a5b3ba1777b5370" +checksum = "380b951a9c5e80ddfd6136919eef32310721aa4aacd4889a8d39124b026ab343" dependencies = [ - "regex-syntax 0.7.1", + "aho-corasick", + "memchr", + "regex-automata 0.4.3", + "regex-syntax 0.8.2", ] [[package]] @@ -671,6 +644,17 @@ dependencies = [ "regex-syntax 0.6.29", ] +[[package]] +name = "regex-automata" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f804c7828047e88b2d32e2d7fe5a105da8ee3264f01902f796c8e067dc2483f" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax 0.8.2", +] + [[package]] name = "regex-syntax" version = "0.6.29" @@ -679,9 +663,9 @@ checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" [[package]] name = "regex-syntax" -version = "0.7.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5996294f19bd3aae0453a862ad728f60e6600695733dd5df01da90c54363a3c" +checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" [[package]] name = "ring" @@ -693,31 +677,31 @@ dependencies = [ "libc", "once_cell", "spin 0.5.2", - "untrusted", + "untrusted 0.7.1", "web-sys", "winapi", ] [[package]] -name = "rustc-hash" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" - -[[package]] -name = "rustix" -version = "0.37.19" +name = "ring" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d" +checksum = "688c63d65483050968b2a8937f7995f443e27041a0f7700aa59b0822aedebb74" dependencies = [ - "bitflags", - "errno", - "io-lifetimes", + "cc", + "getrandom", "libc", - "linux-raw-sys", + "spin 0.9.8", + "untrusted 0.9.0", "windows-sys 0.48.0", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustls-fork-shadow-tls" version = "0.20.9-mod.2" @@ -725,58 +709,64 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a095c00ed7b7606a456667abd022d50437f66bd2b6db1d90c93227e8f329dec8" dependencies = [ "log", - "ring", + "ring 0.16.20", "sct", "webpki", ] +[[package]] +name = "rustls-pki-types" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7673e0aa20ee4937c6aacfc12bb8341cfbf054cdd21df6bec5fd0629fe9339b" + [[package]] name = "ryu" -version = "1.0.13" +version = "1.0.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" [[package]] name = "scopeguard" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "sct" -version = "0.7.0" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53dcdb7c9f8158937a7981b48accfd39a43af418591a5d008c7b22b5e1b7ca4" +checksum = "da046153aa2352493d6cb7da4b6e5c0c057d8a1d0a9aa8560baffdd945acd414" dependencies = [ - "ring", - "untrusted", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] name = "serde" -version = "1.0.163" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2113ab51b87a539ae008b5c6c02dc020ffa39afd2d83cffcb3f4eb2722cebec2" +checksum = "25dd9975e68d0cb5aa1120c288333fc98731bd1dd12f561e468ea4728c042b89" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.163" +version = "1.0.193" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c805777e3930c8883389c602315a24224bcc738b63905ef87cd1420353ea93e" +checksum = "43576ca501357b9b071ac53cdc7da8ef0cbd9493d8df094cd821777ea6e894d3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn", ] [[package]] name = "serde_json" -version = "1.0.96" +version = "1.0.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "057d394a50403bcac12672b2b18fb387ab6d289d957dab67dd201875391e52f1" +checksum = "3d1c7e3eac408d115102c4c24ad393e0821bb3a5df4d506a80f85f7a742a526b" dependencies = [ "itoa", "ryu", @@ -785,9 +775,9 @@ dependencies = [ [[package]] name = "sha1" -version = "0.10.5" +version = "0.10.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +checksum = "e3bf829a2d51ab4a5ddf1352d8470c140cadc8301b2ae1789db023f01cedd6ba" dependencies = [ "cfg-if", "cpufeatures", @@ -796,9 +786,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.6" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" dependencies = [ "cfg-if", "cpufeatures", @@ -807,7 +797,7 @@ dependencies = [ [[package]] name = "shadow-tls" -version = "0.2.23" +version = "0.2.24" dependencies = [ "anyhow", "byteorder", @@ -832,24 +822,24 @@ dependencies = [ [[package]] name = "sharded-slab" -version = "0.1.4" +version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" +checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" dependencies = [ "lazy_static", ] [[package]] name = "smallvec" -version = "1.10.0" +version = "1.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" [[package]] name = "socket2" -version = "0.5.3" +version = "0.5.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2538b18701741680e0322a2302176d3253a35388e2e62f172f64f4f16605f877" +checksum = "7b5fac59a5cb5dd637972e5fca70daf0523c9067fcdc4842f053dae04a18f8e9" dependencies = [ "libc", "windows-sys 0.48.0", @@ -870,12 +860,6 @@ dependencies = [ "lock_api", ] -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - [[package]] name = "strsim" version = "0.10.0" @@ -884,26 +868,15 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] name = "syn" -version = "1.0.109" +version = "2.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6f671d4b5ffdb8eadec19c0ae67fe2639df8684bd7bc4b83d986b8db549cf01" +checksum = "13fa70a4ee923979ffb522cacce59d34421ebdea5625e1073c4326ef9d2dd42e" dependencies = [ "proc-macro2", "quote", @@ -912,22 +885,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +checksum = "f9a7210f5c9a7156bb50aa36aed4c95afb51df0df00713949448cf9e97d382d2" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.40" +version = "1.0.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +checksum = "266b2e40bc00e5a6c09c3584011e08b06f123c00362c92b975ba9843aaaa14b8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn", ] [[package]] @@ -951,11 +924,10 @@ dependencies = [ [[package]] name = "tracing" -version = "0.1.37" +version = "0.1.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +checksum = "c3523ab5a71916ccf420eebdf5521fcef02141234bbc0b8a49f2fdc4544364ef" dependencies = [ - "cfg-if", "pin-project-lite", "tracing-attributes", "tracing-core", @@ -963,20 +935,20 @@ dependencies = [ [[package]] name = "tracing-attributes" -version = "0.1.24" +version = "0.1.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f57e3ca2a01450b1a921183a9c9cbfda207fd822cef4ccb00a65402cbba7a74" +checksum = "34704c8d6ebcbc939824180af020566b01a7c01f80641264eba0999f6c2b6be7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn", ] [[package]] name = "tracing-core" -version = "0.1.31" +version = "0.1.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "c06d3da6113f116aaee68e4d601191614c9053067f9ab7f6edbcb161237daa54" dependencies = [ "once_cell", "valuable", @@ -984,20 +956,20 @@ dependencies = [ [[package]] name = "tracing-log" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78ddad33d2d10b1ed7eb9d1f518a5674713876e97e5bb9b7345a7984fbb4f922" +checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" dependencies = [ - "lazy_static", "log", + "once_cell", "tracing-core", ] [[package]] name = "tracing-subscriber" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30a651bc37f915e81f087d86e62a18eec5f79550c7faff886f7090b4ea757c77" +checksum = "ad0f048c97dbd9faa9b7df56362b8ebcaa52adb06b498c050d2f4e32f90a7a8b" dependencies = [ "matchers", "nu-ansi-term", @@ -1013,15 +985,15 @@ dependencies = [ [[package]] name = "typenum" -version = "1.16.0" +version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" [[package]] name = "unicode-ident" -version = "1.0.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" +checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" [[package]] name = "untrusted" @@ -1029,6 +1001,12 @@ version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a156c684c91ea7d62626509bce3cb4e1d9ed5c4d978f7b4352658f96a4c26b4a" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "utf8parse" version = "0.2.1" @@ -1055,9 +1033,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wasm-bindgen" -version = "0.2.86" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" dependencies = [ "cfg-if", "wasm-bindgen-macro", @@ -1065,24 +1043,24 @@ dependencies = [ [[package]] name = "wasm-bindgen-backend" -version = "0.2.86" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" dependencies = [ "bumpalo", "log", "once_cell", "proc-macro2", "quote", - "syn 2.0.16", + "syn", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-macro" -version = "0.2.86" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -1090,28 +1068,28 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.86" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" dependencies = [ "proc-macro2", "quote", - "syn 2.0.16", + "syn", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.86" +version = "0.2.89" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" [[package]] name = "web-sys" -version = "0.3.63" +version = "0.3.66" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3bdd9ef4e984da1187bf8110c5cf5b845fbc87a23602cdf912386a76fcd3a7c2" +checksum = "50c24a44ec86bb68fbecd1b3efed7e85ea5621b39b35ef2766b66cd984f8010f" dependencies = [ "js-sys", "wasm-bindgen", @@ -1119,21 +1097,21 @@ dependencies = [ [[package]] name = "webpki" -version = "0.22.0" +version = "0.22.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f095d78192e208183081cc07bc5515ef55216397af48b873e5edcd72637fa1bd" +checksum = "ed63aea5ce73d0ff405984102c42de94fc55a6b75765d621c65262469b3c9b53" dependencies = [ - "ring", - "untrusted", + "ring 0.17.7", + "untrusted 0.9.0", ] [[package]] name = "webpki-roots" -version = "0.22.6" +version = "0.26.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" +checksum = "0de2cfda980f21be5a7ed2eadb3e6fe074d56022bea2cdeb1a62eb220fc04188" dependencies = [ - "webpki", + "rustls-pki-types", ] [[package]] @@ -1160,132 +1138,132 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-sys" -version = "0.45.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" dependencies = [ - "windows-targets 0.42.2", + "windows-targets 0.48.5", ] [[package]] name = "windows-sys" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.48.0", + "windows-targets 0.52.0", ] [[package]] name = "windows-targets" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" dependencies = [ - "windows_aarch64_gnullvm 0.42.2", - "windows_aarch64_msvc 0.42.2", - "windows_i686_gnu 0.42.2", - "windows_i686_msvc 0.42.2", - "windows_x86_64_gnu 0.42.2", - "windows_x86_64_gnullvm 0.42.2", - "windows_x86_64_msvc 0.42.2", + "windows_aarch64_gnullvm 0.48.5", + "windows_aarch64_msvc 0.48.5", + "windows_i686_gnu 0.48.5", + "windows_i686_msvc 0.48.5", + "windows_x86_64_gnu 0.48.5", + "windows_x86_64_gnullvm 0.48.5", + "windows_x86_64_msvc 0.48.5", ] [[package]] name = "windows-targets" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +checksum = "8a18201040b24831fbb9e4eb208f8892e1f50a37feb53cc7ff887feb8f50e7cd" dependencies = [ - "windows_aarch64_gnullvm 0.48.0", - "windows_aarch64_msvc 0.48.0", - "windows_i686_gnu 0.48.0", - "windows_i686_msvc 0.48.0", - "windows_x86_64_gnu 0.48.0", - "windows_x86_64_gnullvm 0.48.0", - "windows_x86_64_msvc 0.48.0", + "windows_aarch64_gnullvm 0.52.0", + "windows_aarch64_msvc 0.52.0", + "windows_i686_gnu 0.52.0", + "windows_i686_msvc 0.52.0", + "windows_x86_64_gnu 0.52.0", + "windows_x86_64_gnullvm 0.52.0", + "windows_x86_64_msvc 0.52.0", ] [[package]] name = "windows_aarch64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" +checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +checksum = "cb7764e35d4db8a7921e09562a0304bf2f93e0a51bfccee0bd0bb0b666b015ea" [[package]] name = "windows_aarch64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" +checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "bbaa0368d4f1d2aaefc55b6fcfee13f41544ddf36801e793edbbfd7d7df075ef" [[package]] name = "windows_i686_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" +checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "a28637cb1fa3560a16915793afb20081aba2c92ee8af57b4d5f28e4b3e7df313" [[package]] name = "windows_i686_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" +checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "ffe5e8e31046ce6230cc7215707b816e339ff4d4d67c65dffa206fd0f7aa7b9a" [[package]] name = "windows_x86_64_gnu" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" +checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "3d6fa32db2bc4a2f5abeacf2b69f7992cd09dca97498da74a151a3132c26befd" [[package]] name = "windows_x86_64_gnullvm" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" +checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "1a657e1e9d3f514745a572a6846d3c7aa7dbe1658c056ed9c3344c4109a6949e" [[package]] name = "windows_x86_64_msvc" -version = "0.42.2" +version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" +checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.48.0" +version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "dff9641d1cd4be8d1a070daf9e3773c5f67e78b4d9d42263020c057706765c04" diff --git a/Cargo.toml b/Cargo.toml index df8408a..76e08f4 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,11 +7,11 @@ license = "MIT/Apache-2.0" name = "shadow-tls" readme = "README.md" repository = "https://github.com/ihciah/shadow-tls" -version = "0.2.23" +version = "0.2.24" [dependencies] -monoio = { version = "0.1.3", features = ["sync"] } -monoio-rustls-fork-shadow-tls = { version = "0.1.1-mod.0" } +monoio = { version = "0.2.0", features = ["sync"] } +monoio-rustls-fork-shadow-tls = { version = "0.3.0-mod.2" } rustls-fork-shadow-tls = { version = "0.20.9-mod.2", default-features = false } anyhow = "1" @@ -27,13 +27,10 @@ sha1 = "0.10" sha2 = "0.10" tracing = "0.1" tracing-subscriber = { version = "0.3", features = ["env-filter"] } -webpki-roots = "0.22" +webpki-roots = "0.26" serde = { version = "1", features = ["derive"] } serde_json = "1" [profile.release] lto = true opt-level = 3 - -[patch.crates-io] -monoio = { git = "https://github.com/bytedance/monoio", branch = "master" } diff --git a/Dockerfile b/Dockerfile index 2fd9c33..7899c7a 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM rust:1.67-alpine as builder +FROM rust:1.74-alpine as builder WORKDIR /usr/src/shadow-tls RUN apk add --no-cache musl-dev libressl-dev diff --git a/src/client.rs b/src/client.rs index 6b704ab..b124149 100644 --- a/src/client.rs +++ b/src/client.rs @@ -1,4 +1,5 @@ use std::{ + future::Future, ptr::{copy, copy_nonoverlapping}, rc::Rc, sync::Arc, @@ -10,6 +11,7 @@ use monoio::{ buf::IoBufMut, io::{AsyncReadRent, AsyncReadRentExt, AsyncWriteRent, AsyncWriteRentExt, Splitable}, net::{TcpConnectOpts, TcpStream}, + BufResult, }; use monoio_rustls_fork_shadow_tls::TlsConnector; use rand::{prelude::Distribution, seq::SliceRandom, Rng}; @@ -159,11 +161,11 @@ impl ShadowTlsClient { v3: V3Mode, ) -> anyhow::Result { let mut root_store = RootCertStore::empty(); - root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| { + root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, + ta.subject.as_ref(), + ta.subject_public_key_info.as_ref(), + ta.name_constraints.as_ref().map(|n| n.as_ref()), ) })); // TLS 1.2 and TLS 1.3 is enabled. @@ -217,12 +219,12 @@ impl ShadowTlsClient { } /// Main relay for V2 protocol. - async fn relay_v2(&self, mut in_stream: TcpStream) -> anyhow::Result<()> { - let (mut out_stream, hash, session) = self.connect_v2().await?; + async fn relay_v2(&self, in_stream: TcpStream) -> anyhow::Result<()> { + let (out_stream, hash, session) = self.connect_v2().await?; let mut hash_8b = [0; 8]; unsafe { std::ptr::copy_nonoverlapping(hash.as_ptr(), hash_8b.as_mut_ptr(), 8) }; - let (out_r, mut out_w) = out_stream.split(); - let (mut in_r, mut in_w) = in_stream.split(); + let (out_r, mut out_w) = out_stream.into_split(); + let (mut in_r, mut in_w) = in_stream.into_split(); let mut session_filtered_out_r = crate::helper_v2::SessionFilterStream::new(session, out_r); let (a, b) = monoio::join!( copy_without_application_data(&mut session_filtered_out_r, &mut in_w), @@ -469,78 +471,72 @@ impl StreamWrapper { } impl AsyncWriteRent for StreamWrapper { - type WriteFuture<'a, T> = S::WriteFuture<'a, T> where - T: monoio::buf::IoBuf + 'a, Self: 'a; - type WritevFuture<'a, T>= S::WritevFuture<'a, T> where - T: monoio::buf::IoVecBuf + 'a, Self: 'a; - type FlushFuture<'a> = S::FlushFuture<'a> where Self: 'a; - type ShutdownFuture<'a> = S::ShutdownFuture<'a> where Self: 'a; - - fn write(&mut self, buf: T) -> Self::WriteFuture<'_, T> { + #[inline] + fn write( + &mut self, + buf: T, + ) -> impl Future> { self.raw.write(buf) } - fn writev(&mut self, buf_vec: T) -> Self::WritevFuture<'_, T> { + #[inline] + fn writev( + &mut self, + buf_vec: T, + ) -> impl Future> { self.raw.writev(buf_vec) } - fn flush(&mut self) -> Self::FlushFuture<'_> { + #[inline] + fn flush(&mut self) -> impl Future> { self.raw.flush() } - fn shutdown(&mut self) -> Self::ShutdownFuture<'_> { + #[inline] + fn shutdown(&mut self) -> impl Future> { self.raw.shutdown() } } impl AsyncReadRent for StreamWrapper { - type ReadFuture<'a, B> = impl std::future::Future> +'a where - B: monoio::buf::IoBufMut + 'a, S: 'a; - type ReadvFuture<'a, B> = impl std::future::Future> +'a where - B: monoio::buf::IoVecBufMut + 'a, S: 'a; - // uncancelable - fn read(&mut self, mut buf: T) -> Self::ReadFuture<'_, T> { - async move { - loop { - let owned_buf = self.read_buf.as_mut().unwrap(); - let data_len = owned_buf.len() - self.read_pos; - // there is enough data to copy - if data_len > 0 { - let to_copy = buf.bytes_total().min(data_len); - unsafe { - copy_nonoverlapping( - owned_buf.as_ptr().add(self.read_pos), - buf.write_ptr(), - to_copy, - ); - buf.set_init(to_copy); - }; - self.read_pos += to_copy; - return (Ok(to_copy), buf); - } + async fn read(&mut self, mut buf: T) -> BufResult { + loop { + let owned_buf = self.read_buf.as_mut().unwrap(); + let data_len = owned_buf.len() - self.read_pos; + // there is enough data to copy + if data_len > 0 { + let to_copy = buf.bytes_total().min(data_len); + unsafe { + copy_nonoverlapping( + owned_buf.as_ptr().add(self.read_pos), + buf.write_ptr(), + to_copy, + ); + buf.set_init(to_copy); + }; + self.read_pos += to_copy; + return (Ok(to_copy), buf); + } - // no data now - match self.feed_data().await { - Ok(0) => return (Ok(0), buf), - Ok(_) => continue, - Err(e) => return (Err(e), buf), - } + // no data now + match self.feed_data().await { + Ok(0) => return (Ok(0), buf), + Ok(_) => continue, + Err(e) => return (Err(e), buf), } } } - fn readv(&mut self, mut buf: T) -> Self::ReadvFuture<'_, T> { - async move { - let slice = match monoio::buf::IoVecWrapperMut::new(buf) { - Ok(slice) => slice, - Err(buf) => return (Ok(0), buf), - }; - - let (result, slice) = self.read(slice).await; - buf = slice.into_inner(); - if let Ok(n) = result { - unsafe { buf.set_init(n) }; - } - (result, buf) + async fn readv(&mut self, mut buf: T) -> BufResult { + let slice = match monoio::buf::IoVecWrapperMut::new(buf) { + Ok(slice) => slice, + Err(buf) => return (Ok(0), buf), + }; + + let (result, slice) = self.read(slice).await; + buf = slice.into_inner(); + if let Ok(n) = result { + unsafe { buf.set_init(n) }; } + (result, buf) } } diff --git a/src/helper_v2.rs b/src/helper_v2.rs index 917e8b5..965aa01 100644 --- a/src/helper_v2.rs +++ b/src/helper_v2.rs @@ -19,6 +19,7 @@ use monoio::{ as_fd::{AsReadFd, AsWriteFd}, AsyncReadRent, AsyncReadRentExt, AsyncWriteRent, AsyncWriteRentExt, }, + BufResult, }; use crate::util::prelude::*; @@ -97,10 +98,6 @@ impl HashedWriteStream { }) } - pub(crate) fn into_inner(self) -> S { - self.raw - } - pub(crate) fn hash(&self) -> [u8; 20] { self.hmac .borrow() @@ -145,127 +142,103 @@ impl HashedStream for HashedWriteStream { } impl AsyncReadRent for HashedReadStream { - type ReadFuture<'a, B> = impl std::future::Future> +'a where - B: monoio::buf::IoBufMut + 'a, S: 'a; - type ReadvFuture<'a, B> = impl std::future::Future> +'a where - B: monoio::buf::IoVecBufMut + 'a, S: 'a; - - fn read(&mut self, mut buf: T) -> Self::ReadFuture<'_, T> { - async move { - let ptr = buf.write_ptr(); - let (result, buf) = self.raw.read(buf).await; - if let Ok(n) = result { - // Safety: we can make sure the ptr and n are valid. - self.hmac - .update(unsafe { std::slice::from_raw_parts(ptr, n) }); - } - (result, buf) + async fn read(&mut self, mut buf: T) -> BufResult { + let ptr = buf.write_ptr(); + let (result, buf) = self.raw.read(buf).await; + if let Ok(n) = result { + // Safety: we can make sure the ptr and n are valid. + self.hmac + .update(unsafe { std::slice::from_raw_parts(ptr, n) }); } + (result, buf) } - fn readv(&mut self, mut buf: T) -> Self::ReadvFuture<'_, T> { - async move { - let slice = match IoVecWrapperMut::new(buf) { - Ok(slice) => slice, - Err(buf) => return (Ok(0), buf), - }; + async fn readv(&mut self, mut buf: T) -> BufResult { + let slice = match IoVecWrapperMut::new(buf) { + Ok(slice) => slice, + Err(buf) => return (Ok(0), buf), + }; - let (result, slice) = self.read(slice).await; - buf = slice.into_inner(); - if let Ok(n) = result { - unsafe { buf.set_init(n) }; - } - (result, buf) + let (result, slice) = self.read(slice).await; + buf = slice.into_inner(); + if let Ok(n) = result { + unsafe { buf.set_init(n) }; } + (result, buf) } } impl AsyncWriteRent for HashedReadStream { - type WriteFuture<'a, T> = S::WriteFuture<'a, T> where - T: monoio::buf::IoBuf + 'a, Self: 'a; - - type WritevFuture<'a, T>= S::WritevFuture<'a, T> where - T: monoio::buf::IoVecBuf + 'a, Self: 'a; - - type FlushFuture<'a> = S::FlushFuture<'a> where Self: 'a; - - type ShutdownFuture<'a> = S::ShutdownFuture<'a> where Self: 'a; - - fn write(&mut self, buf: T) -> Self::WriteFuture<'_, T> { + fn write( + &mut self, + buf: T, + ) -> impl Future> { self.raw.write(buf) } - fn writev(&mut self, buf_vec: T) -> Self::WritevFuture<'_, T> { + fn writev( + &mut self, + buf_vec: T, + ) -> impl Future> { self.raw.writev(buf_vec) } - fn flush(&mut self) -> Self::FlushFuture<'_> { + fn flush(&mut self) -> impl Future> { self.raw.flush() } - fn shutdown(&mut self) -> Self::ShutdownFuture<'_> { + fn shutdown(&mut self) -> impl Future> { self.raw.shutdown() } } impl AsyncReadRent for HashedWriteStream { - type ReadFuture<'a, T> = ::ReadFuture<'a, T> where - T: monoio::buf::IoBufMut + 'a, Self: 'a; - type ReadvFuture<'a, T> = ::ReadvFuture<'a, T> where - T: monoio::buf::IoVecBufMut + 'a, Self: 'a; - - fn read(&mut self, buf: T) -> Self::ReadFuture<'_, T> { + #[inline] + fn read( + &mut self, + buf: T, + ) -> impl Future> { self.raw.read(buf) } - fn readv(&mut self, buf: T) -> Self::ReadvFuture<'_, T> { + #[inline] + fn readv( + &mut self, + buf: T, + ) -> impl Future> { self.raw.readv(buf) } } impl AsyncWriteRent for HashedWriteStream { - type WriteFuture<'a, T> = impl std::future::Future> +'a where - T: monoio::buf::IoBuf + 'a, S: 'a; - - type WritevFuture<'a, T> = impl std::future::Future> +'a where - T: monoio::buf::IoVecBuf + 'a, S: 'a; - - type FlushFuture<'a> = S::FlushFuture<'a> where Self: 'a; - - type ShutdownFuture<'a> = S::ShutdownFuture<'a> where Self: 'a; - - fn write(&mut self, buf: T) -> Self::WriteFuture<'_, T> { - async move { - let ptr = buf.read_ptr(); - let (result, buf) = self.raw.write(buf).await; - if let Ok(n) = result { - let mut eh = self.hmac.borrow_mut(); - if eh.0 { - // Safety: we can make sure the ptr and n are valid. - eh.1.update(unsafe { std::slice::from_raw_parts(ptr, n) }); - } + async fn write(&mut self, buf: T) -> BufResult { + let ptr = buf.read_ptr(); + let (result, buf) = self.raw.write(buf).await; + if let Ok(n) = result { + let mut eh = self.hmac.borrow_mut(); + if eh.0 { + // Safety: we can make sure the ptr and n are valid. + eh.1.update(unsafe { std::slice::from_raw_parts(ptr, n) }); } - (result, buf) } + (result, buf) } - fn writev(&mut self, buf: T) -> Self::WritevFuture<'_, T> { - async move { - let slice = match IoVecWrapper::new(buf) { - Ok(slice) => slice, - Err(buf) => return (Ok(0), buf), - }; + async fn writev(&mut self, buf: T) -> BufResult { + let slice = match IoVecWrapper::new(buf) { + Ok(slice) => slice, + Err(buf) => return (Ok(0), buf), + }; - let (result, slice) = self.write(slice).await; - (result, slice.into_inner()) - } + let (result, slice) = self.write(slice).await; + (result, slice.into_inner()) } - fn flush(&mut self) -> Self::FlushFuture<'_> { + fn flush(&mut self) -> impl Future> { self.raw.flush() } - fn shutdown(&mut self) -> Self::ShutdownFuture<'_> { + fn shutdown(&mut self) -> impl Future> { self.raw.shutdown() } } @@ -303,12 +276,10 @@ where + std::ops::Deref> + 'static, { - type ReadFuture<'a, B> = impl std::future::Future> +'a where - B: monoio::buf::IoBufMut + 'a, S: 'a; - type ReadvFuture<'a, B> = impl std::future::Future> +'a where - B: monoio::buf::IoVecBufMut + 'a, S: 'a; - - fn read(&mut self, mut buf: T) -> Self::ReadFuture<'_, T> { + fn read( + &mut self, + mut buf: T, + ) -> impl Future> { const HEADER_BUF_SIZE: usize = 5; async move { @@ -379,20 +350,18 @@ where } } - fn readv(&mut self, mut buf: T) -> Self::ReadvFuture<'_, T> { - async move { - let slice = match IoVecWrapperMut::new(buf) { - Ok(slice) => slice, - Err(buf) => return (Ok(0), buf), - }; + async fn readv(&mut self, mut buf: T) -> BufResult { + let slice = match IoVecWrapperMut::new(buf) { + Ok(slice) => slice, + Err(buf) => return (Ok(0), buf), + }; - let (result, slice) = self.read(slice).await; - buf = slice.into_inner(); - if let Ok(n) = result { - unsafe { buf.set_init(n) }; - } - (result, buf) + let (result, slice) = self.read(slice).await; + buf = slice.into_inner(); + if let Ok(n) = result { + unsafe { buf.set_init(n) }; } + (result, buf) } } @@ -559,7 +528,7 @@ where loop { let (read_res, buf_read) = reader.read(buf).await; match read_res { - Ok(n) if n == 0 => { + Ok(0) => { // read closed break; } @@ -619,7 +588,7 @@ where 'r: loop { let (read_res, buf_read) = reader.read(buf).await; match read_res { - Ok(n) if n == 0 => { + Ok(0) => { // read closed break; } diff --git a/src/main.rs b/src/main.rs index 5f607cf..bee6db0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -220,7 +220,7 @@ pub(crate) fn get_sip003_arg() -> Option { match std::env::var($key).ok() { None => return None, Some(val) if val.is_empty() => { - $fail_fn(); + $fail_fn; return None; } Some(val) => val, @@ -242,7 +242,8 @@ pub(crate) fn get_sip003_arg() -> Option { let ss_remote_port = env!("SS_REMOTE_PORT"); let ss_local_host = env!("SS_LOCAL_HOST"); let ss_local_port = env!("SS_LOCAL_PORT"); - let ss_plugin_options = env!("SS_PLUGIN_OPTIONS", || { + #[allow(unreachable_code)] + let ss_plugin_options = env!("SS_PLUGIN_OPTIONS", { tracing::error!("need SS_PLUGIN_OPTIONS when as SIP003 plugin"); exit(-1); }); diff --git a/src/server.rs b/src/server.rs index 4cca553..844b0dd 100644 --- a/src/server.rs +++ b/src/server.rs @@ -196,7 +196,7 @@ impl ShadowTlsServer { true => (Vec::new(), None), false => extract_sni_v2(&mut in_stream).await?, }; - let mut prefixed_io = PrefixedReadIo::new(&mut in_stream, std::io::Cursor::new(prefix)); + let prefixed_io = PrefixedReadIo::new(&mut in_stream, std::io::Cursor::new(prefix)); tracing::debug!("server name extracted from SNI extention: {server_name:?}"); // choose handshake server addr and connect @@ -212,8 +212,8 @@ impl ShadowTlsServer { tracing::debug!("handshake server connected: {addr}"); // copy stage 1 - let (mut out_r, mut out_w) = out_stream.split(); - let (mut in_r, mut in_w) = prefixed_io.split(); + let (mut out_r, mut out_w) = out_stream.into_split(); + let (mut in_r, mut in_w) = prefixed_io.into_split(); let (switch, cp) = FirstRetGroup::new( copy_until_handshake_finished(&mut in_r, &mut out_w, &hmac), Box::pin(copy_until_eof(&mut out_r, &mut in_w)), @@ -226,17 +226,17 @@ impl ShadowTlsServer { match switch { SwitchResult::Switch(data_left) => { drop(cp); - let mut in_stream = in_stream.into_inner(); - let (mut in_r, mut in_w) = in_stream.split(); + let in_stream = unsafe { in_r.reunite(in_w).unwrap_unchecked() }; + let in_stream = in_stream.into_inner(); + let (mut in_r, mut in_w) = in_stream.into_split(); // connect our data server - let _ = out_stream.shutdown().await; - drop(out_stream); + let _ = out_r.reunite(out_w).unwrap().shutdown().await; let mut data_stream = TcpStream::connect_addr(resolve(&self.target_addr).await?).await?; mod_tcp_conn(&mut data_stream, true, self.nodelay); tracing::debug!("data server connected, start relay"); - let (mut data_r, mut data_w) = data_stream.split(); + let (mut data_r, mut data_w) = data_stream.into_split(); let (result, _) = data_w.write(data_left).await; result?; ErrGroup::new( @@ -280,7 +280,7 @@ impl ShadowTlsServer { if !client_hello_pass { // if client verify failed, bidirectional copy and return tracing::warn!("ClientHello verify failed, will work as a SNI proxy"); - copy_bidirectional(&mut in_stream, &mut handshake_stream).await; + copy_bidirectional(in_stream, handshake_stream).await; return Ok(()); } tracing::debug!("ClientHello verify success"); @@ -294,7 +294,7 @@ impl ShadowTlsServer { None => { // we cannot extract server random, bidirectional copy and return tracing::warn!("ServerRandom extract failed, will copy bidirectional"); - copy_bidirectional(&mut in_stream, &mut handshake_stream).await; + copy_bidirectional(in_stream, handshake_stream).await; return Ok(()); } }; @@ -305,7 +305,7 @@ impl ShadowTlsServer { tracing::error!( "V3 strict enabled and TLS 1.3 is not supported, will copy bidirectional" ); - copy_bidirectional(&mut in_stream, &mut handshake_stream).await; + copy_bidirectional(in_stream, handshake_stream).await; return Ok(()); } @@ -316,9 +316,9 @@ impl ShadowTlsServer { // stage 1.3.2: copy ShadowTLS Client -> Handshake Server until hamc matches // stage 1.3.3: copy and modify Handshake Server -> ShadowTLS Client until 1.3.2 stops + let (mut c_read, mut c_write) = in_stream.into_split(); let pure_data = { - let (mut c_read, mut c_write) = in_stream.split(); - let (mut h_read, mut h_write) = handshake_stream.split(); + let (mut h_read, mut h_write) = handshake_stream.into_split(); let (mut sender, mut recevier) = local_sync::oneshot::channel::<()>(); let key = kdf(&self.password, &server_random); let (maybe_pure, _) = monoio::join!( @@ -351,7 +351,6 @@ impl ShadowTlsServer { tracing::debug!("handshake relay finished"); // early drop useless resources - drop(handshake_stream); drop(first_server_frame); // stage 2.2: copy ShadowTLS Client -> Data Server @@ -362,7 +361,7 @@ impl ShadowTlsServer { res?; verified_relay( data_stream, - in_stream, + unsafe { c_read.reunite(c_write).unwrap_unchecked() }, hmac_sr_s, hmac_sr_c, None, @@ -843,7 +842,7 @@ async fn copy_by_frame_with_modification( ) -> std::io::Result<()> { let mut g_buffer = Vec::new(); let stop = stop.closed(); - monoio::pin!(stop); + let mut stop = std::pin::pin!(stop); loop { monoio::select! { diff --git a/src/util.rs b/src/util.rs index af7101c..1b69e79 100644 --- a/src/util.rs +++ b/src/util.rs @@ -114,9 +114,9 @@ where Ok(()) } -pub(crate) async fn copy_bidirectional(l: &mut TcpStream, r: &mut TcpStream) { - let (lr, lw) = l.split(); - let (rr, rw) = r.split(); +pub(crate) async fn copy_bidirectional(l: TcpStream, r: TcpStream) { + let (lr, lw) = l.into_split(); + let (rr, rw) = r.into_split(); let _ = monoio::join!(copy_until_eof(lr, rw), copy_until_eof(rr, lw)); } @@ -182,16 +182,16 @@ pub(crate) fn kdf(password: &str, server_random: &[u8]) -> Vec { } pub(crate) async fn verified_relay( - mut raw: TcpStream, - mut tls: TcpStream, + raw: TcpStream, + tls: TcpStream, mut hmac_add: Hmac, mut hmac_verify: Hmac, mut hmac_ignore: Option, alert_enabled: bool, ) { tracing::debug!("verified relay started"); - let (mut tls_read, mut tls_write) = tls.split(); - let (mut raw_read, mut raw_write) = raw.split(); + let (mut tls_read, mut tls_write) = tls.into_split(); + let (mut raw_read, mut raw_write) = raw.into_split(); let (mut notfied, mut notifier) = local_sync::oneshot::channel::<()>(); let _ = monoio::join!( async { @@ -323,7 +323,7 @@ async fn copy_add_appdata( buffer.extend_from_slice(&DEFAULT_DATA); let alert_notified = alert_notified.closed(); - monoio::pin!(alert_notified); + let mut alert_notified = std::pin::pin!(alert_notified); loop { monoio::select! { diff --git a/tests/sni.rs b/tests/sni.rs index c8504f4..8fc5ac6 100644 --- a/tests/sni.rs +++ b/tests/sni.rs @@ -16,11 +16,11 @@ use utils::{CAPTIVE_HTTP_REQUEST, CAPTIVE_HTTP_RESP}; async fn sni() { // construct tls connector let mut root_store = RootCertStore::empty(); - root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.0.iter().map(|ta| { + root_store.add_server_trust_anchors(webpki_roots::TLS_SERVER_ROOTS.iter().map(|ta| { OwnedTrustAnchor::from_subject_spki_name_constraints( - ta.subject, - ta.spki, - ta.name_constraints, + ta.subject.as_ref(), + ta.subject_public_key_info.as_ref(), + ta.name_constraints.as_ref().map(|n| n.as_ref()), ) })); let tls_config = rustls_fork_shadow_tls::ClientConfig::builder()