diff --git a/Cargo.lock b/Cargo.lock index 26f0e8ac3dbd..a3f8103b7157 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -376,9 +376,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.6.1" +version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a12916984aab3fa6e39d655a33e09c0071eb36d6ab3aea5c2d78551f1df6d952" +checksum = "8318a53db07bb3f8dca91a600466bdb3f2eaadeedfdbcf02e1accbad9271ba50" [[package]] name = "camellia" @@ -432,6 +432,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fd16c4719339c4530435d38e511904438d07cce7950afa3718a84ac36c10e89e" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chacha20" version = "0.9.1" @@ -466,7 +472,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -869,6 +875,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "displaydoc" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "duct" version = "0.13.7" @@ -984,7 +1001,7 @@ dependencies = [ "quote", "rustversion", "syn 1.0.109", - "synstructure", + "synstructure 0.12.6", ] [[package]] @@ -1507,9 +1524,9 @@ dependencies = [ [[package]] name = "httparse" -version = "1.8.0" +version = "1.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" +checksum = "0fcc0b4a115bf80b728eb8ea024ad5bd707b615bfed49e0665b6e0f86fd082d9" [[package]] name = "httpdate" @@ -1549,9 +1566,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.3.1" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe575dd17d0862a9a33781c8c4696a55c320909004a67a00fb286ba8b1bc496d" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" dependencies = [ "bytes", "futures-channel", @@ -1603,6 +1620,124 @@ dependencies = [ "cc", ] +[[package]] +name = "icu_collections" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_locid" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +dependencies = [ + "displaydoc", + "litemap", + "tinystr", + "writeable", + "zerovec", +] + +[[package]] +name = "icu_locid_transform" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_locid_transform_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_locid_transform_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" + +[[package]] +name = "icu_normalizer" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_normalizer_data", + "icu_properties", + "icu_provider", + "smallvec", + "utf16_iter", + "utf8_iter", + "write16", + "zerovec", +] + +[[package]] +name = "icu_normalizer_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" + +[[package]] +name = "icu_properties" +version = "1.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +dependencies = [ + "displaydoc", + "icu_collections", + "icu_locid_transform", + "icu_properties_data", + "icu_provider", + "tinystr", + "zerovec", +] + +[[package]] +name = "icu_properties_data" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" + +[[package]] +name = "icu_provider" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +dependencies = [ + "displaydoc", + "icu_locid", + "icu_provider_macros", + "stable_deref_trait", + "tinystr", + "writeable", + "yoke", + "zerofrom", + "zerovec", +] + +[[package]] +name = "icu_provider_macros" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "ident_case" version = "1.0.1" @@ -1629,6 +1764,18 @@ dependencies = [ "unicode-normalization", ] +[[package]] +name = "idna" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd69211b9b519e98303c015e21a007e293db403b6c85b9b124e133d25e242cdd" +dependencies = [ + "icu_normalizer", + "icu_properties", + "smallvec", + "utf8_iter", +] + [[package]] name = "indexmap" version = "1.9.3" @@ -1890,9 +2037,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.153" +version = "0.2.158" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "d8adc4bb1803a324070e64a98ae98f38934d91957a99cfb3a43dcbc01bc56439" [[package]] name = "libdbus-sys" @@ -1934,7 +2081,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if", - "windows-targets 0.52.5", + "windows-targets 0.48.5", ] [[package]] @@ -1965,6 +2112,12 @@ version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "01cda141df6706de531b6c46c3a33ecca755538219bd484262fa09410c13539c" +[[package]] +name = "litemap" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "643cb0b8d4fcc284004d5fd0d67ccf61dfffadb7f75e1e71bc420f4688a3a704" + [[package]] name = "lock_api" version = "0.4.11" @@ -2112,6 +2265,18 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "mio" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80e04d1dcff3aae0704555fe5fee3bcfaf3d1fdf8a7e521d5b9d2b42acb52cec" +dependencies = [ + "hermit-abi", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.52.0", +] + [[package]] name = "mnl" version = "0.2.2" @@ -2180,7 +2345,7 @@ dependencies = [ "talpid-types", "thiserror", "tokio", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "winres", ] @@ -2225,7 +2390,7 @@ dependencies = [ "tokio-stream", "winapi", "windows-service", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "winres", ] @@ -2325,7 +2490,7 @@ dependencies = [ "once_cell", "thiserror", "widestring", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -2347,7 +2512,7 @@ dependencies = [ "thiserror", "tokio", "uuid", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "winres", ] @@ -2547,11 +2712,23 @@ checksum = "ab2156c4fce2f8df6c499cc1c763e4394b7482525bf2a9701c9d79d215f519e4" dependencies = [ "bitflags 2.5.0", "cfg-if", - "cfg_aliases", + "cfg_aliases 0.1.1", "libc", "memoffset 0.9.1", ] +[[package]] +name = "nix" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71e2746dc3a24dd78b3cfcb7be93368c6de9963d30f43a6a73998a9cf4b17b46" +dependencies = [ + "bitflags 2.5.0", + "cfg-if", + "cfg_aliases 0.2.1", + "libc", +] + [[package]] name = "no-std-net" version = "0.6.0" @@ -2572,7 +2749,7 @@ dependencies = [ "kqueue", "libc", "log", - "mio", + "mio 0.8.11", "walkdir", "windows-sys 0.48.0", ] @@ -2593,16 +2770,6 @@ dependencies = [ "libm", ] -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - [[package]] name = "objc" version = "0.2.7" @@ -3583,9 +3750,8 @@ dependencies = [ [[package]] name = "shadowsocks" -version = "1.18.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5edddeff89d9874fa59366cfc506b53525410f129bbf13064ab36de15374e6" +version = "1.20.2" +source = "git+https://github.com/mullvad/shadowsocks-rust?rev=bf17d5a19f969910b8fdda1342857b9dd0267908#bf17d5a19f969910b8fdda1342857b9dd0267908" dependencies = [ "arc-swap", "async-trait", @@ -3613,7 +3779,7 @@ dependencies = [ "tokio", "tokio-tfo", "url", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3638,9 +3804,8 @@ dependencies = [ [[package]] name = "shadowsocks-service" -version = "1.18.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7be0ae9c02adf5fb2a91cdee6b3d6e3610d88411114080280e816d817fe437c8" +version = "1.20.4" +source = "git+https://github.com/mullvad/shadowsocks-rust?rev=bf17d5a19f969910b8fdda1342857b9dd0267908#bf17d5a19f969910b8fdda1342857b9dd0267908" dependencies = [ "arc-swap", "async-trait", @@ -3650,15 +3815,16 @@ dependencies = [ "cfg-if", "futures", "http-body-util", - "hyper 1.3.1", - "idna 0.5.0", + "httparse", + "hyper 1.4.1", + "idna 1.0.2", "ipnet", "iprange", "json5", "libc", "log", "lru_time_cache", - "nix 0.28.0", + "nix 0.29.0", "once_cell", "pin-project", "rand 0.8.5", @@ -3669,7 +3835,7 @@ dependencies = [ "spin", "thiserror", "tokio", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -3772,6 +3938,12 @@ dependencies = [ "der", ] +[[package]] +name = "stable_deref_trait" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" + [[package]] name = "strsim" version = "0.11.1" @@ -3849,6 +4021,17 @@ dependencies = [ "unicode-xid", ] +[[package]] +name = "synstructure" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] + [[package]] name = "system-configuration" version = "0.5.1" @@ -3920,7 +4103,7 @@ dependencies = [ "which", "widestring", "windows-service", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "winreg 0.51.0", ] @@ -3979,7 +4162,7 @@ dependencies = [ "triggered", "uuid", "widestring", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "winreg 0.51.0", ] @@ -4000,7 +4183,7 @@ dependencies = [ "tonic-build", "tower", "winapi", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "winres", ] @@ -4010,7 +4193,7 @@ version = "0.0.0" dependencies = [ "rs-release", "talpid-dbus", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4033,7 +4216,7 @@ dependencies = [ "thiserror", "tokio", "widestring", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4062,7 +4245,7 @@ dependencies = [ "thiserror", "tokio", "tun", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4081,7 +4264,7 @@ dependencies = [ "tonic", "tonic-build", "tower", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "zeroize", ] @@ -4108,7 +4291,7 @@ dependencies = [ "socket2", "talpid-types", "thiserror", - "windows-sys 0.52.0", + "windows-sys 0.59.0", ] [[package]] @@ -4150,7 +4333,7 @@ dependencies = [ "tokio-stream", "tunnel-obfuscation", "widestring", - "windows-sys 0.52.0", + "windows-sys 0.59.0", "wireguard-go-rs", "zeroize", ] @@ -4215,6 +4398,16 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +[[package]] +name = "tinystr" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +dependencies = [ + "displaydoc", + "zerovec", +] + [[package]] name = "tinyvec" version = "1.6.0" @@ -4232,21 +4425,20 @@ checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" [[package]] name = "tokio" -version = "1.37.0" +version = "1.39.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "9babc99b9923bfa4804bd74722ff02c0381021eafa4db9949217e3be8e84fff5" dependencies = [ "backtrace", "bytes", "libc", - "mio", - "num_cpus", + "mio 1.0.2", "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", "tokio-macros", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4261,9 +4453,9 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.2.0" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", @@ -4305,9 +4497,9 @@ dependencies = [ [[package]] name = "tokio-tfo" -version = "0.2.2" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b433f102de6c9b0546dc73398ba3d38d8a556f29f731268451e0b1b3aab9e" +checksum = "3fb4382c6371e29365853d2b71e915d5398df46312a2158097d8bb3f54d0f1b4" dependencies = [ "cfg-if", "futures", @@ -4317,7 +4509,7 @@ dependencies = [ "pin-project", "socket2", "tokio", - "windows-sys 0.48.0", + "windows-sys 0.52.0", ] [[package]] @@ -4599,6 +4791,18 @@ dependencies = [ "serde", ] +[[package]] +name = "utf16_iter" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" + +[[package]] +name = "utf8_iter" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6c140620e7ffbb22c2dee59cafe6084a59b5ffc27a8859a5f0d494b5d52b6be" + [[package]] name = "utf8parse" version = "0.2.1" @@ -4770,7 +4974,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", ] [[package]] @@ -4821,7 +5025,16 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.5", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-sys" +version = "0.59.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" +dependencies = [ + "windows-targets 0.52.6", ] [[package]] @@ -4856,18 +5069,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f0713a46559409d202e70e28227288446bf7841d3211583a4b53e3f6d96e7eb" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.5", - "windows_aarch64_msvc 0.52.5", - "windows_i686_gnu 0.52.5", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", "windows_i686_gnullvm", - "windows_i686_msvc 0.52.5", - "windows_x86_64_gnu 0.52.5", - "windows_x86_64_gnullvm 0.52.5", - "windows_x86_64_msvc 0.52.5", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -4884,9 +5097,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7088eed71e8b8dda258ecc8bac5fb1153c5cffaf2578fc8ff5d61e23578d3263" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -4908,9 +5121,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9985fd1504e250c615ca5f281c3f7a6da76213ebd5ccc9561496568a2752afb6" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -4932,15 +5145,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "88ba073cf16d5372720ec942a8ccbf61626074c6d4dd2e745299726ce8b89670" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87f4261229030a858f36b459e748ae97545d6f1ec60e5e0d6a3d32e0dc232ee9" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -4962,9 +5175,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db3c2bf3d13d5b658be73463284eaf12830ac9a26a90c717b7f771dfe97487bf" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -4986,9 +5199,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4e4246f76bdeff09eb48875a0fd3e2af6aada79d409d33011886d3e1581517d9" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -5004,9 +5217,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "852298e482cd67c356ddd9570386e2862b5673c85bd5f88df9ab6802b334c596" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -5028,9 +5241,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bec47e5bfd1bff0eeaf6d8b485cc1074891a197ab4225d504cb7a1ab88b02bf0" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winreg" @@ -5072,6 +5285,18 @@ dependencies = [ "zeroize", ] +[[package]] +name = "write16" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" + +[[package]] +name = "writeable" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" + [[package]] name = "x25519-dalek" version = "2.0.1" @@ -5084,6 +5309,30 @@ dependencies = [ "zeroize", ] +[[package]] +name = "yoke" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c5b1314b079b0930c31e3af543d8ee1757b1951ae1e1565ec704403a7240ca5" +dependencies = [ + "serde", + "stable_deref_trait", + "yoke-derive", + "zerofrom", +] + +[[package]] +name = "yoke-derive" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28cc31741b18cb6f1d5ff12f5b7523e3d6eb0852bbbad19d73905511d9849b95" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", + "synstructure 0.13.1", +] + [[package]] name = "zerocopy" version = "0.7.32" @@ -5104,6 +5353,27 @@ dependencies = [ "syn 2.0.60", ] +[[package]] +name = "zerofrom" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ec111ce797d0e0784a1116d0ddcdbea84322cd79e5d5ad173daeba4f93ab55" +dependencies = [ + "zerofrom-derive", +] + +[[package]] +name = "zerofrom-derive" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ea7b4a3637ea8669cedf0f1fd5c286a17f3de97b8dd5a70a6c167a1730e63a5" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", + "synstructure 0.13.1", +] + [[package]] name = "zeroize" version = "1.8.1" @@ -5123,3 +5393,25 @@ dependencies = [ "quote", "syn 2.0.60", ] + +[[package]] +name = "zerovec" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +dependencies = [ + "yoke", + "zerofrom", + "zerovec-derive", +] + +[[package]] +name = "zerovec-derive" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.60", +] diff --git a/Cargo.toml b/Cargo.toml index 1317951f6549..2577d1be3b5e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -76,10 +76,10 @@ env_logger = "0.10.0" thiserror = "1.0.57" log = "0.4" -shadowsocks = { version = "1.16" } -shadowsocks-service = { version = "1.16" } +shadowsocks = { rev = "bf17d5a19f969910b8fdda1342857b9dd0267908", git = "https://github.com/mullvad/shadowsocks-rust" } +shadowsocks-service = { rev = "bf17d5a19f969910b8fdda1342857b9dd0267908", git = "https://github.com/mullvad/shadowsocks-rust" } -windows-sys = "0.52.0" +windows-sys = "0.59.0" chrono = { version = "0.4.26", default-features = false } clap = { version = "4.4.18", features = ["cargo", "derive"] } diff --git a/test/Cargo.toml b/test/Cargo.toml index 4f8b1931be84..bfc9a4b95682 100644 --- a/test/Cargo.toml +++ b/test/Cargo.toml @@ -68,10 +68,10 @@ log = "0.4" colored = "2.0.0" # Proxy protocols -shadowsocks = { version = "1.16" } -shadowsocks-service = { version = "1.16" } +shadowsocks = { rev = "bf17d5a19f969910b8fdda1342857b9dd0267908", git = "https://github.com/mullvad/shadowsocks-rust" } +shadowsocks-service = { rev = "bf17d5a19f969910b8fdda1342857b9dd0267908", git = "https://github.com/mullvad/shadowsocks-rust" } -windows-sys = "0.52.0" +windows-sys = "0.59.0" chrono = { version = "0.4.26", default-features = false } clap = { version = "4.2.7", features = ["cargo", "derive"] } once_cell = "1.16.0" diff --git a/tunnel-obfuscation/src/shadowsocks.rs b/tunnel-obfuscation/src/shadowsocks.rs index 0f7492a3cac9..b5d6bdd996bc 100644 --- a/tunnel-obfuscation/src/shadowsocks.rs +++ b/tunnel-obfuscation/src/shadowsocks.rs @@ -33,6 +33,9 @@ pub enum Error { /// Failed to connect to Shadowsocks endpoint #[error("Failed to connect to Shadowsocks endpoint")] ConnectShadowsocks(#[from] ProxySocketError), + /// Failed to receive remote socket descriptor + #[error("Failed to receive remote socket descriptor")] + ReceiveRemoteFd, } pub struct Shadowsocks { @@ -40,6 +43,8 @@ pub struct Shadowsocks { server: tokio::task::JoinHandle>, // The receiver will implicitly shut down when this is dropped _shutdown_tx: oneshot::Sender<()>, + #[cfg(target_os = "android")] + outbound_fd: i32, } #[derive(Debug)] @@ -58,20 +63,29 @@ impl Shadowsocks { create_local_udp_socket(settings.shadowsocks_endpoint.is_ipv4()).await?; let (shutdown_tx, shutdown_rx) = oneshot::channel(); + #[cfg(target_os = "android")] + let (outbound_fd_tx, outbound_fd_rx) = oneshot::channel(); let server = tokio::spawn(run_obfuscation( local_udp_socket, settings.shadowsocks_endpoint, settings.wireguard_endpoint, shutdown_rx, + #[cfg(target_os = "android")] + outbound_fd_tx, #[cfg(target_os = "linux")] settings.fwmark, )); + #[cfg(target_os = "android")] + let outbound_fd = outbound_fd_rx.await.map_err(|_| Error::ReceiveRemoteFd)?; + Ok(Shadowsocks { udp_client_addr, server, _shutdown_tx: shutdown_tx, + #[cfg(target_os = "android")] + outbound_fd, }) } } @@ -81,12 +95,9 @@ async fn run_obfuscation( shadowsocks_endpoint: SocketAddr, wireguard_endpoint: SocketAddr, shutdown_rx: oneshot::Receiver<()>, + #[cfg(target_os = "android")] outbound_fd_tx: oneshot::Sender, #[cfg(target_os = "linux")] fwmark: Option, ) -> Result<()> { - wait_for_local_udp_client(&local_udp_socket) - .await - .map_err(Error::WaitForUdpClient)?; - let shadowsocks = create_shadowsocks_client( shadowsocks_endpoint, #[cfg(target_os = "linux")] @@ -94,6 +105,13 @@ async fn run_obfuscation( ) .await?; + #[cfg(target_os = "android")] + let _ = outbound_fd_tx.send(shadowsocks.get_outbound_raw_fd()); + + wait_for_local_udp_client(&local_udp_socket) + .await + .map_err(Error::WaitForUdpClient)?; + let local_udp = Arc::new(local_udp_socket); let shadowsocks = Arc::new(shadowsocks); @@ -235,7 +253,7 @@ impl Obfuscator for Shadowsocks { #[cfg(target_os = "android")] fn remote_socket_fd(&self) -> std::os::unix::io::RawFd { - todo!("return remote socket fd") + self.outbound_fd } }