diff --git a/.github/workflows/autofix.yml b/.github/workflows/autofix.yml index 436a321a..e05e79ab 100644 --- a/.github/workflows/autofix.yml +++ b/.github/workflows/autofix.yml @@ -11,7 +11,7 @@ concurrency: cancel-in-progress: true env: - MSRV: "1.88" # Minimum Supported Rust Version + MSRV: "1.95" # Minimum Supported Rust Version jobs: protobuf: diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6d34dd69..971d4796 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,13 +22,13 @@ jobs: matrix: include: - os: windows-latest - rust: "1.88" # MSRV - can't use variables here. + rust: "1.95" # MSRV - can't use variables here. args: --exclude mitmproxy-linux-ebpf - os: macos-latest - rust: "1.88" # MSRV - can't use variables here. + rust: "1.95" # MSRV - can't use variables here. args: --exclude mitmproxy-linux-ebpf - os: ubuntu-22.04 - rust: "1.88" # MSRV - can't use variables here. + rust: "1.95" # MSRV - can't use variables here. args: --exclude mitmproxy-linux-ebpf - os: ubuntu-latest rust: stable diff --git a/Cargo.lock b/Cargo.lock index efeb64b6..2b317d60 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -36,12 +36,6 @@ dependencies = [ "cc", ] -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - [[package]] name = "anes" version = "0.1.6" @@ -137,28 +131,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "async-stream" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b5a71a6f37880a80d1d7f19efd781e4b5de42c88f0722cc13bcb6cc2cfe8476" -dependencies = [ - "async-stream-impl", - "futures-core", - "pin-project-lite", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-task" version = "4.7.1" @@ -188,74 +160,27 @@ version = "1.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f2032f911046de80f0a198e0901378627c33f59ea0ac00e363d481118bd70a53" -[[package]] -name = "axum" -version = "0.7.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "edca88bc138befd0323b20752846e6587272d3b03b0343c8ea28a6f819e6e71f" -dependencies = [ - "async-trait", - "axum-core 0.4.5", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "itoa", - "matchit 0.7.3", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper", - "tower 0.5.3", - "tower-layer", - "tower-service", -] - [[package]] name = "axum" version = "0.8.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "31b698c5f9a010f6573133b09e0de5408834d0c82f8d7475a89fc1867a71cd90" dependencies = [ - "axum-core 0.5.6", + "axum-core", "bytes", "futures-util", "http", "http-body", "http-body-util", "itoa", - "matchit 0.8.4", + "matchit", "memchr", "mime", "percent-encoding", "pin-project-lite", "serde_core", "sync_wrapper", - "tower 0.5.3", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09f2bd6146b97ae3359fa0cc6d6b376d9539582c7b4220f041a33ec24c226199" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "http-body-util", - "mime", - "pin-project-lite", - "rustversion", - "sync_wrapper", + "tower", "tower-layer", "tower-service", ] @@ -280,38 +205,41 @@ dependencies = [ [[package]] name = "aya" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d18bc4e506fbb85ab7392ed993a7db4d1a452c71b75a246af4a80ab8c9d2dd50" +checksum = "66e644424fada9fff4fdc63848db1732fb69b626e8328202ef55c03df1f4d939" dependencies = [ "assert_matches", "aya-obj", "bitflags 2.13.1", - "bytes", + "hashbrown", "libc", "log", "object", "once_cell", - "thiserror 1.0.69", - "tokio", + "scopeguard", + "thiserror 2.0.18", ] [[package]] name = "aya-build" -version = "0.1.3" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59bc42f3c5ddacc34eca28a420b47e3cbb3f0f484137cb2bf1ad2153d0eae52a" +checksum = "609b414caa508f04d2dbbc9481ad6869f43ab9ab1dc9abd237fca27c0818f663" dependencies = [ "anyhow", "cargo_metadata", + "rustc_version", + "which 8.0.5", ] [[package]] name = "aya-ebpf" -version = "0.1.1" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8dbaf5409a1a0982e5c9bdc0f499a55fe5ead39fe9c846012053faf0d404f73" +checksum = "eace5970943931fea46a8cbdca208a8f6a9e0413d85a5a6c4e168f0b909570bc" dependencies = [ + "aya-build", "aya-ebpf-bindings", "aya-ebpf-cty", "aya-ebpf-macros", @@ -320,9 +248,9 @@ dependencies = [ [[package]] name = "aya-ebpf-bindings" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71ee8e6a617f040d8da7565ec4010aea75e33cda4662f64c019c66ee97d17889" +checksum = "cf1f19286ebbda6673099b68d049034838f08e4939cef66c998a8d3e62825d76" dependencies = [ "aya-build", "aya-ebpf-cty", @@ -330,18 +258,18 @@ dependencies = [ [[package]] name = "aya-ebpf-cty" -version = "0.2.3" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6f33396742e7fd0f519c1e0de5141d84e1a8df69146a557c08cc222b0ceace4" +checksum = "0884264bc8a51a49fed03df8feada3a21d703cf501dae33c28bdba5d2313ef33" dependencies = [ "aya-build", ] [[package]] name = "aya-ebpf-macros" -version = "0.1.2" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96fd02363736177e7e91d6c95d7effbca07be87502c7b5b32fc194aed8b177a0" +checksum = "23e3a7f86e914df106dd00f9d757bc93f7d5c93380c51eead23d8d2ccd15a87a" dependencies = [ "proc-macro2", "proc-macro2-diagnostics", @@ -351,32 +279,30 @@ dependencies = [ [[package]] name = "aya-log" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b600d806c1d07d3b81ab5f4a2a95fd80f479a0d3f1d68f29064d660865f85f02" +checksum = "476912cd6322ecf481a48f9db82207406a472563875eef014e927800522aac5c" dependencies = [ "aya", "aya-log-common", - "bytes", "log", - "thiserror 1.0.69", - "tokio", + "thiserror 2.0.18", ] [[package]] name = "aya-log-common" -version = "0.1.15" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "befef9fe882e63164a2ba0161874e954648a72b0e1c4b361f532d590638c4eec" +checksum = "d14c56374a63b20cb1d76108bf9ff2a75e137d47f57f32f2841ef74153b2186a" dependencies = [ "num_enum", ] [[package]] name = "aya-log-ebpf" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a10bbadd0829895a91eb1cd2bb02d7af145704087f03812bed60cb9fe65dbb3" +checksum = "9d6b48fdc4454a2474f89970d6c6fdd1f9a9da5190d3c824d9341c6666831316" dependencies = [ "aya-ebpf", "aya-log-common", @@ -385,9 +311,9 @@ dependencies = [ [[package]] name = "aya-log-ebpf-macros" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6d8251a75f56077db51892041aa6b77c70ef2723845d7a210979700b2f01bc4" +checksum = "13a22cc8e903fb5241357d2f48f26afc3fb9dcb7febe54405e94707cf73e5918" dependencies = [ "aya-log-common", "aya-log-parser", @@ -398,33 +324,25 @@ dependencies = [ [[package]] name = "aya-log-parser" -version = "0.1.13" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14b102eb5c88c9aa0b49102d3fbcee08ecb0dfa81014f39b373311de7a7032cb" +checksum = "f52d032162a42a191cd9b4ac35a212848c08b9335d2c9a92eaef8f281792757a" dependencies = [ "aya-log-common", ] [[package]] name = "aya-obj" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c51b96c5a8ed8705b40d655273bc4212cbbf38d4e3be2788f36306f154523ec7" +checksum = "8c76b9c75d9cdc155ff8f6a06d61e873f67bf47be8cfa92a3b5aaea43f4b4077" dependencies = [ "bytes", - "core-error", - "hashbrown 0.15.5", "log", "object", - "thiserror 1.0.69", + "thiserror 2.0.18", ] -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - [[package]] name = "base64" version = "0.21.7" @@ -491,11 +409,12 @@ dependencies = [ [[package]] name = "boringtun" -version = "0.6.0" -source = "git+https://github.com/cloudflare/boringtun?rev=2f3c85f5c4a601018c10b464b1ca890d9504bf6e#2f3c85f5c4a601018c10b464b1ca890d9504bf6e" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "15dd6a8a89cbe8997f37ca0cf035e6ea4d64cd2ecea4aed83ffb9f99f7126939" dependencies = [ "aead", - "base64 0.13.1", + "base64 0.22.1", "blake2", "chacha20poly1305", "hex", @@ -503,8 +422,9 @@ dependencies = [ "ip_network", "ip_network_table", "libc", - "nix 0.25.1", + "nix 0.31.3", "parking_lot", + "portable-atomic", "rand_core 0.6.4", "ring", "tracing", @@ -611,7 +531,18 @@ checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if", "cipher", - "cpufeatures", + "cpufeatures 0.2.17", +] + +[[package]] +name = "chacha20" +version = "0.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d524456ba66e72eb8b115ff89e01e497f8e6d11d78b70b1aa13c0fbd97540a81" +dependencies = [ + "cfg-if", + "cpufeatures 0.3.0", + "rand_core 0.10.1", ] [[package]] @@ -621,7 +552,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ "aead", - "chacha20", + "chacha20 0.9.1", "cipher", "poly1305", "zeroize", @@ -699,25 +630,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" [[package]] -name = "concurrent-queue" -version = "2.5.0" +name = "combine" +version = "4.6.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" +checksum = "ba5a308b75df32fe02788e748662718f03fde005016435c444eea572398219fd" dependencies = [ - "crossbeam-utils", + "bytes", + "memchr", ] [[package]] -name = "console-api" -version = "0.8.1" +name = "concurrent-queue" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8030735ecb0d128428b64cd379809817e620a40e5001c54465b99ec5feec2857" +checksum = "4ca0197aee26d1ae37445ee532fefce43251d24cc7c166799f4d46817f1d3973" dependencies = [ - "futures-core", - "prost 0.13.5", - "prost-types 0.13.5", - "tonic 0.12.3", - "tracing-core", + "crossbeam-utils", ] [[package]] @@ -727,60 +655,34 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8599749b6667e2f0c910c1d0dff6901163ff698a52d5a39720f61b5be4b20d3" dependencies = [ "futures-core", - "prost 0.14.4", - "prost-types 0.14.4", - "tonic 0.14.6", + "prost", + "prost-types", + "tonic", "tonic-prost", "tracing-core", ] -[[package]] -name = "console-subscriber" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6539aa9c6a4cd31f4b1c040f860a1eac9aa80e7df6b05d506a6e7179936d6a01" -dependencies = [ - "console-api 0.8.1", - "crossbeam-channel", - "crossbeam-utils", - "futures-task", - "hdrhistogram", - "humantime", - "hyper-util", - "prost 0.13.5", - "prost-types 0.13.5", - "serde", - "serde_json", - "thread_local", - "tokio", - "tokio-stream", - "tonic 0.12.3", - "tracing", - "tracing-core", - "tracing-subscriber", -] - [[package]] name = "console-subscriber" version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fb4915b7d8dd960457a1b6c380114c2944f728e7c65294ab247ae6b6f1f37592" dependencies = [ - "console-api 0.9.0", + "console-api", "crossbeam-channel", "crossbeam-utils", "futures-task", "hdrhistogram", "humantime", "hyper-util", - "prost 0.14.4", - "prost-types 0.14.4", + "prost", + "prost-types", "serde", "serde_json", "thread_local", "tokio", "tokio-stream", - "tonic 0.14.6", + "tonic", "tracing", "tracing-core", "tracing-subscriber", @@ -793,12 +695,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d8a42181e0652c2997ae4d217f25b63c5337a52fd2279736e97b832fa0a3cff" [[package]] -name = "core-error" -version = "0.0.0" +name = "core-foundation" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "efcdb2972eb64230b4c50646d8498ff73f5128d196a90c7236eec4cbe8619b8f" +checksum = "91e195e091a93c46f7102ec7818a2aa394e1e1771c3ab4825963fa03e45afb8f" dependencies = [ - "version_check", + "core-foundation-sys", + "libc", ] [[package]] @@ -824,7 +727,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "064badf302c3194842cf2c5d61f56cc88e54a759313879cdf03abdd27d0c3b97" dependencies = [ "bitflags 2.13.1", - "core-foundation", + "core-foundation 0.10.1", "core-graphics-types", "foreign-types", "libc", @@ -837,7 +740,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d44a101f213f6c4cdc1853d4b78aef6db6bdfa3468798cc1d9912f4735013eb" dependencies = [ "bitflags 2.13.1", - "core-foundation", + "core-foundation 0.10.1", "libc", ] @@ -851,35 +754,21 @@ dependencies = [ ] [[package]] -name = "crc32fast" -version = "1.5.0" +name = "cpufeatures" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" +checksum = "8b2a41393f66f16b0823bb79094d54ac5fbd34ab292ddafb9a0456ac9f87d201" dependencies = [ - "cfg-if", + "libc", ] [[package]] -name = "criterion" -version = "0.7.0" +name = "crc32fast" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1c047a62b0cc3e145fa84415a3191f628e980b194c2755aa12300a4e6cbd928" +checksum = "9481c1c90cbf2ac953f07c8d4a58aa3945c425b7185c9154d67a65e4230da511" dependencies = [ - "anes", - "cast", - "ciborium", - "clap", - "criterion-plot 0.6.0", - "itertools", - "num-traits", - "oorandom", - "plotters", - "rayon", - "regex", - "serde", - "serde_json", - "tinytemplate", - "walkdir", + "cfg-if", ] [[package]] @@ -893,7 +782,7 @@ dependencies = [ "cast", "ciborium", "clap", - "criterion-plot 0.8.2", + "criterion-plot", "itertools", "num-traits", "oorandom", @@ -907,16 +796,6 @@ dependencies = [ "walkdir", ] -[[package]] -name = "criterion-plot" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b1bcc0dc7dfae599d84ad0b1a55f80cde8af3725da8313b528da95ef783e338" -dependencies = [ - "cast", - "itertools", -] - [[package]] name = "criterion-plot" version = "0.8.2" @@ -991,7 +870,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" dependencies = [ "cfg-if", - "cpufeatures", + "cpufeatures 0.2.17", "curve25519-dalek-derive", "fiat-crypto", "rustc_version", @@ -1100,18 +979,6 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91622ff5e7162018101f2fea40d6ebf4a78bbe5a49736a2020649edf9693679e" -[[package]] -name = "enum-as-inner" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1e6a265c649f3f5979b601d26f1d05ada116434c87741c9493cb56218f76cbc" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "env_filter" version = "2.0.0" @@ -1242,9 +1109,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.5" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" +checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" [[package]] name = "foreign-types" @@ -1401,18 +1268,6 @@ dependencies = [ "wasi", ] -[[package]] -name = "getrandom" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "899def5c37c4fd7b2664648c28120ecec138e4d395b459e5ca34f9cce2dd77fd" -dependencies = [ - "cfg-if", - "libc", - "r-efi 5.3.0", - "wasip2", -] - [[package]] name = "getrandom" version = "0.4.3" @@ -1421,7 +1276,8 @@ checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" dependencies = [ "cfg-if", "libc", - "r-efi 6.0.0", + "r-efi", + "rand_core 0.10.1", ] [[package]] @@ -1436,7 +1292,7 @@ dependencies = [ "futures-core", "futures-sink", "http", - "indexmap 2.14.0", + "indexmap", "slab", "tokio", "tokio-util", @@ -1465,27 +1321,14 @@ dependencies = [ [[package]] name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.15.5" +version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" dependencies = [ - "allocator-api2", "equivalent", "foldhash", ] -[[package]] -name = "hashbrown" -version = "0.17.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" - [[package]] name = "hdrhistogram" version = "7.5.4" @@ -1501,9 +1344,9 @@ dependencies = [ [[package]] name = "heapless" -version = "0.8.0" +version = "0.9.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfb9eb618601c89945a70e254898da93b13be0388091d42117462b265bb3fad" +checksum = "25ba4bd83f9415b58b4ed8dc5714c76e626a105be4646c02630ad730ad3b5aa4" dependencies = [ "hash32", "stable_deref_trait", @@ -1522,47 +1365,71 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" [[package]] -name = "hickory-proto" -version = "0.25.2" +name = "hickory-net" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8a6fe56c0038198998a6f217ca4e7ef3a5e51f46163bd6dd60b5c71ca6c6502" +checksum = "e2295ed2f9c31e471e1428a8f88a3f0e1f4b27c15049592138d1eebe9c35b183" dependencies = [ "async-trait", "cfg-if", "data-encoding", - "enum-as-inner", "futures-channel", "futures-io", "futures-util", + "hickory-proto", "idna", "ipnet", + "jni", + "rand", + "thiserror 2.0.18", + "tinyvec", + "tokio", + "tracing", + "url", +] + +[[package]] +name = "hickory-proto" +version = "0.26.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0bab31817bfb44672a252e97fe81cd0c18d1b2cf892108922f6818820df8c643" +dependencies = [ + "data-encoding", + "idna", + "ipnet", + "jni", "once_cell", - "rand 0.9.5", + "prefix-trie", + "rand", "ring", "serde", "thiserror 2.0.18", "tinyvec", - "tokio", "tracing", "url", ] [[package]] name = "hickory-resolver" -version = "0.25.2" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc62a9a99b0bfb44d2ab95a7208ac952d31060efc16241c87eaf36406fecf87a" +checksum = "f0d58d28879ceecde6607729660c2667a081ccdc082e082675042793960f178c" dependencies = [ "cfg-if", "futures-util", + "hickory-net", "hickory-proto", "ipconfig", + "ipnet", + "jni", "moka", + "ndk-context", "once_cell", "parking_lot", - "rand 0.9.5", + "rand", "resolv-conf", "smallvec", + "system-configuration", "thiserror 2.0.18", "tokio", "tracing", @@ -1570,16 +1437,16 @@ dependencies = [ [[package]] name = "hickory-server" -version = "0.25.2" +version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d53e5fe811b941c74ee46b8818228bfd2bc2688ba276a0eaeb0f2c95ea3b2585" +checksum = "130236ba6abba90da6a7acf7a87b27d862b592c3145dc74bc47bf86d8ff198ec" dependencies = [ "async-trait", "bytes", "cfg-if", "data-encoding", - "enum-as-inner", "futures-util", + "hickory-net", "hickory-proto", "ipnet", "prefix-trie", @@ -1709,7 +1576,7 @@ dependencies = [ "hyper", "libc", "pin-project-lite", - "socket2 0.6.5", + "socket2", "tokio", "tower-service", "tracing", @@ -1832,16 +1699,6 @@ dependencies = [ "tiff", ] -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - [[package]] name = "indexmap" version = "2.14.0" @@ -1849,16 +1706,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d466e9454f08e4a911e14806c24e16fba1b4c121d1ea474396f396069cf949d9" dependencies = [ "equivalent", - "hashbrown 0.17.1", -] - -[[package]] -name = "indoc" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79cf5c93f93228cf8efb3ba362535fb11199ac548a09ce117c9b1adc3030d706" -dependencies = [ - "rustversion", + "hashbrown", ] [[package]] @@ -1878,9 +1726,9 @@ checksum = "fc6d6206008e25125b1f97fbe5d309eb7b85141cf9199d52dbd3729a1584dd16" [[package]] name = "internet-packet" -version = "0.2.3" +version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6cfb28f710b057e47c991776879091bd1c706318cc724ce65c932474cd95e95" +checksum = "5b2fd1d512bb84f06807e5640cb02302f7e29dcc6b6b81b3c0322fb272e008f0" dependencies = [ "internet-checksum", "smoltcp", @@ -1923,10 +1771,10 @@ version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4d40460c0ce33d6ce4b0630ad68ff63d6661961c48b6dba35e5a4d81cfb48222" dependencies = [ - "socket2 0.6.5", + "socket2", "widestring", "windows-registry", - "windows-result 0.4.1", + "windows-result", "windows-sys 0.61.2", ] @@ -1985,6 +1833,55 @@ dependencies = [ "syn", ] +[[package]] +name = "jni" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efd9a482cf3a427f00d6b35f14332adc7902ce91efb778580e180ff90fa3498" +dependencies = [ + "cfg-if", + "combine", + "jni-macros", + "jni-sys", + "log", + "simd_cesu8", + "thiserror 2.0.18", + "walkdir", + "windows-link", +] + +[[package]] +name = "jni-macros" +version = "0.22.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a00109accc170f0bdb141fed3e393c565b6f5e072365c3bd58f5b062591560a3" +dependencies = [ + "proc-macro2", + "quote", + "rustc_version", + "simd_cesu8", + "syn", +] + +[[package]] +name = "jni-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6377a88cb3910bee9b0fa88d4f42e1d2da8e79915598f65fb0c7ee14c878af2" +dependencies = [ + "jni-sys-macros", +] + +[[package]] +name = "jni-sys-macros" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38c0b942f458fe50cdac086d2f946512305e5631e720728f2a61aabcd47a6264" +dependencies = [ + "quote", + "syn", +] + [[package]] name = "js-sys" version = "0.3.103" @@ -2015,7 +1912,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "754ca22de805bb5744484a5b151a9e1a8e837d5dc232c2d7d8c2e3492edc8b60" dependencies = [ "cfg-if", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -2079,12 +1976,6 @@ dependencies = [ "regex-automata", ] -[[package]] -name = "matchit" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e7465ac9959cc2b1404e8e2367b43684a6d13790fe23056cc8c6c5a6b7bcb94" - [[package]] name = "matchit" version = "0.8.4" @@ -2097,15 +1988,6 @@ version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" -[[package]] -name = "memoffset" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "488016bfae457b036d996092f6cb448677611ce4449e970ceaf42695203f218a" -dependencies = [ - "autocfg", -] - [[package]] name = "mime" version = "0.3.17" @@ -2156,10 +2038,10 @@ version = "0.13.0-dev" dependencies = [ "anyhow", "boringtun", - "console-subscriber 0.4.1", - "core-foundation", + "console-subscriber", + "core-foundation 0.10.1", "core-graphics", - "criterion 0.7.0", + "criterion", "data-encoding", "env_logger", "futures-util", @@ -2169,20 +2051,20 @@ dependencies = [ "internet-packet", "log", "lru_time_cache", - "nix 0.30.1", + "nix 0.31.3", "objc2-app-kit", "pretty-hex", - "prost 0.14.4", - "rand 0.9.5", + "prost", + "rand", "security-framework", "smoltcp", - "socket2 0.6.5", + "socket2", "sysinfo", "tempfile", "tokio", "tokio-util", "tun", - "windows 0.61.3", + "windows 0.62.2", ] [[package]] @@ -2190,7 +2072,7 @@ name = "mitmproxy-contentviews" version = "0.13.0-dev" dependencies = [ "anyhow", - "criterion 0.8.2", + "criterion", "data-encoding", "flate2", "log", @@ -2209,7 +2091,7 @@ name = "mitmproxy-highlight" version = "0.13.0-dev" dependencies = [ "anyhow", - "criterion 0.8.2", + "criterion", "tree-sitter", "tree-sitter-css", "tree-sitter-highlight", @@ -2237,7 +2119,7 @@ dependencies = [ "mitmproxy-linux-ebpf", "mitmproxy-linux-ebpf-common", "netlink-packet-route", - "prost 0.14.4", + "prost", "rtnetlink", "tokio", "tun", @@ -2266,7 +2148,7 @@ version = "0.13.0-dev" dependencies = [ "anyhow", "boringtun", - "console-subscriber 0.5.0", + "console-subscriber", "data-encoding", "env_logger", "log", @@ -2309,6 +2191,12 @@ dependencies = [ "pxfm", ] +[[package]] +name = "ndk-context" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "27b02d87554356db9e9a873add8782d4ea6e3e58ea071a9adb9a2e8ddb884a8b" + [[package]] name = "netlink-packet-core" version = "0.8.1" @@ -2357,18 +2245,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "nix" -version = "0.25.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f346ff70e7dbfd675fe90590b92d59ef2de15a8779ae305ebcbfd3f0caf59be4" -dependencies = [ - "autocfg", - "bitflags 1.3.2", - "cfg-if", - "libc", -] - [[package]] name = "nix" version = "0.30.1" @@ -2597,6 +2473,17 @@ dependencies = [ "objc2-core-foundation", ] +[[package]] +name = "objc2-open-directory" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb82bed227edf5201dfedf072bba4015a33d3d4a98519837295a90f0a23f676d" +dependencies = [ + "objc2", + "objc2-core-foundation", + "objc2-foundation", +] + [[package]] name = "objc2-quartz-core" version = "0.3.2" @@ -2610,13 +2497,13 @@ dependencies = [ [[package]] name = "object" -version = "0.36.7" +version = "0.39.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" +checksum = "2e5a6c098c7a3b6547378093f5cc30bc54fd361ce711e05293a5cc589562739b" dependencies = [ "crc32fast", - "hashbrown 0.15.5", - "indexmap 2.14.0", + "hashbrown", + "indexmap", "memchr", ] @@ -2684,7 +2571,7 @@ dependencies = [ "libc", "redox_syscall", "smallvec", - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -2783,7 +2670,7 @@ version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ - "cpufeatures", + "cpufeatures 0.2.17", "opaque-debug", "universal-hash", ] @@ -2818,21 +2705,13 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - [[package]] name = "prefix-trie" -version = "0.7.0" +version = "0.8.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85cf4c7c25f1dd66c76b451e9041a8cfce26e4ca754934fa7aed8d5a59a01d20" +checksum = "4cf6e3177f0684016a5c209b00882e15f8bdd3f3bb48f0491df10cd102d0c6e7" dependencies = [ + "either", "ipnet", "num-traits", ] @@ -2864,16 +2743,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "prost" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" -dependencies = [ - "bytes", - "prost-derive 0.13.5", -] - [[package]] name = "prost" version = "0.14.4" @@ -2881,20 +2750,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "528ac67416ff8646872a3c02cad9cc4ee5dc9f9540c9b10771855c95cb2e5ae1" dependencies = [ "bytes", - "prost-derive 0.14.4", -] - -[[package]] -name = "prost-derive" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" -dependencies = [ - "anyhow", - "itertools", - "proc-macro2", - "quote", - "syn", + "prost-derive", ] [[package]] @@ -2910,22 +2766,13 @@ dependencies = [ "syn", ] -[[package]] -name = "prost-types" -version = "0.13.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "52c2c1bf36ddb1a1c396b3601a3cec27c2462e45f07c386894ec3ccf5332bd16" -dependencies = [ - "prost 0.13.5", -] - [[package]] name = "prost-types" version = "0.14.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f94967dc7688f3054c7fac87473ffae4cc4c3904800e2d9f5b857246d8963b0a" dependencies = [ - "prost 0.14.4", + "prost", ] [[package]] @@ -2946,7 +2793,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b4aeaa1f2460f1d348eeaeed86aea999ce98c1bded6f089ff8514c9d9dbdc973" dependencies = [ "anyhow", - "indexmap 2.14.0", + "indexmap", "log", "protobuf", "protobuf-support", @@ -2972,30 +2819,28 @@ checksum = "d55d956fa96f5ec02be2e13af0e20391a5aa83d6a074e3ad368959d0fab299ea" [[package]] name = "pyo3" -version = "0.25.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8970a78afe0628a3e3430376fc5fd76b6b45c4d43360ffd6cdd40bdde72b682a" +checksum = "cd274650b21d4bfc26a0a47587962c1edb425f69287324355cd040c3ea66071c" dependencies = [ "anyhow", - "indoc", "libc", - "memoffset", "once_cell", "portable-atomic", "pyo3-build-config", "pyo3-ffi", "pyo3-macros", - "unindent", ] [[package]] name = "pyo3-async-runtimes" -version = "0.25.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d73cc6b1b7d8b3cef02101d37390dbdfe7e450dfea14921cae80a9534ba59ef2" +checksum = "b3ef68daa7316a3fac65e5e18b2203f010346de1c1c53456811a2624673ab046" dependencies = [ "clap", - "futures", + "futures-channel", + "futures-util", "inventory", "once_cell", "pin-project-lite", @@ -3006,9 +2851,9 @@ dependencies = [ [[package]] name = "pyo3-async-runtimes-macros" -version = "0.25.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca31e43a0f205f2960208938135e37e579e61e10b36b4e7f49b0e8f60fab5b83" +checksum = "faf75ff3922e6830adcaa30f3a359ce861326f6161f16a13d97adb40ba6a744a" dependencies = [ "proc-macro2", "quote", @@ -3017,19 +2862,18 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.25.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "458eb0c55e7ece017adeba38f2248ff3ac615e53660d7c71a238d7d2a01c7598" +checksum = "c5e2a7d2f0d013342f295c048ad19237add5154a55b1c5a254c0ec93d4109078" dependencies = [ - "once_cell", "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.25.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7114fe5457c61b276ab77c5055f206295b812608083644a5c5b2640c3102565c" +checksum = "ca85c467da1bbc8d866eea5deff9cf29ea5f7785054a17da36e65bda9c05845b" dependencies = [ "libc", "pyo3-build-config", @@ -3037,9 +2881,9 @@ dependencies = [ [[package]] name = "pyo3-log" -version = "0.12.4" +version = "0.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45192e5e4a4d2505587e27806c7b710c231c40c56f3bfc19535d0bb25df52264" +checksum = "f64083bd3a16a353d9d62335808e8e13d0552d2a2b83fdb084496192dcfa9fcd" dependencies = [ "arc-swap", "log", @@ -3048,9 +2892,9 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.25.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8725c0a622b374d6cb051d11a0983786448f7785336139c3c94f5aa6bef7e50" +checksum = "9ac53762fd065daa3194dd09337a38bd793a188100fd1a9304c4ab312d901771" dependencies = [ "proc-macro2", "pyo3-macros-backend", @@ -3060,13 +2904,12 @@ dependencies = [ [[package]] name = "pyo3-macros-backend" -version = "0.25.1" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4109984c22491085343c05b0dbc54ddc405c3cf7b4374fc533f5c3313a572ccc" +checksum = "4ca3a1557399783172dc5bf39cfca835157732532cba56b71d2292161e53b362" dependencies = [ "heck", "proc-macro2", - "pyo3-build-config", "quote", "syn", ] @@ -3086,12 +2929,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "r-efi" -version = "5.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cdb34c158ceb288df11e18b4bd39de994f6657d83847bdffdbd7f346754b0f" - [[package]] name = "r-efi" version = "6.0.0" @@ -3100,43 +2937,13 @@ checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" [[package]] name = "rand" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22f6172bdec972074665ed81ed53b71da00bfc44b65a753cfde883ec4c702a1a" -dependencies = [ - "libc", - "rand_chacha 0.3.1", - "rand_core 0.6.4", -] - -[[package]] -name = "rand" -version = "0.9.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ef1d0d795eb7d84685bca4f72f3649f064e6641543d3a8c415898726a57b41" -dependencies = [ - "rand_chacha 0.9.0", - "rand_core 0.9.5", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" +version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "c7f5fa3a058cd35567ef9bfa5e75732bee0f9e4c55fa90477bef2dfcdbc4be80" dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_chacha" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" -dependencies = [ - "ppv-lite86", - "rand_core 0.9.5", + "chacha20 0.10.1", + "getrandom 0.4.3", + "rand_core 0.10.1", ] [[package]] @@ -3150,12 +2957,9 @@ dependencies = [ [[package]] name = "rand_core" -version = "0.9.5" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76afc826de14238e6e8c374ddcc1fa19e374fd8dd986b0d2af0d02377261d83c" -dependencies = [ - "getrandom 0.3.4", -] +checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" [[package]] name = "rayon" @@ -3341,7 +3145,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b7f4bc775c73d9a02cde8bf7b2ec4c9d12743edf609006c7facc23998404cd1d" dependencies = [ "bitflags 2.13.1", - "core-foundation", + "core-foundation 0.10.1", "core-foundation-sys", "libc", "security-framework-sys", @@ -3403,7 +3207,7 @@ version = "1.0.150" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e8014e44b4736ed0538adeecded0fce2a272f22dc9578a7eb6b2d9993c74cfb9" dependencies = [ - "indexmap 2.14.0", + "indexmap", "itoa", "memchr", "serde", @@ -3417,7 +3221,7 @@ version = "0.9.34+deprecated" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a8b1a1a2ebf674015cc02edccce75287f1a0130d394307b36743c2f5d504b47" dependencies = [ - "indexmap 2.14.0", + "indexmap", "itoa", "ryu", "serde", @@ -3455,6 +3259,22 @@ version = "0.3.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3a219298ac11a56ea9a6d2120044824d6f01aeb034955e7af7bc16858527deea" +[[package]] +name = "simd_cesu8" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11031e251abf8611c80f460e19dbdeb54a66db918e49c65a7065b46ac7aec520" +dependencies = [ + "rustc_version", + "simdutf8", +] + +[[package]] +name = "simdutf8" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3a9fe34e3e7a50316060351f37187a3f546bce95496156754b601a5fa71b76e" + [[package]] name = "slab" version = "0.4.12" @@ -3469,9 +3289,9 @@ checksum = "8ed6a63f02c8539c91a8685a86f4099661ba3da017932f6ebbea6de3f0fa7c90" [[package]] name = "smoltcp" -version = "0.12.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad095989c1533c1c266d9b1e8d70a1329dd3723c3edac6d03bbd67e7bf6f4bb" +checksum = "5f73d40463bba65efc9adc6370b56df76d563cc46e2482bba58351b4afb7535e" dependencies = [ "bitflags 1.3.2", "byteorder", @@ -3483,16 +3303,6 @@ dependencies = [ "managed", ] -[[package]] -name = "socket2" -version = "0.5.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e22376abed350d73dd1cd119b57ffccad95b4e585a7cda43e286245ce23c0678" -dependencies = [ - "libc", - "windows-sys 0.52.0", -] - [[package]] name = "socket2" version = "0.6.5" @@ -3557,16 +3367,38 @@ dependencies = [ [[package]] name = "sysinfo" -version = "0.36.1" +version = "0.39.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "252800745060e7b9ffb7b2badbd8b31cfa4aa2e61af879d0a3bf2a317c20217d" +checksum = "d2071df9448915b71c4fe6d25deaf1c22f12bd234f01540b77312bb8e41361e6" dependencies = [ "libc", "memchr", "ntapi", "objc2-core-foundation", "objc2-io-kit", - "windows 0.61.3", + "objc2-open-directory", + "windows 0.62.2", +] + +[[package]] +name = "system-configuration" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a13f3d0daba03132c0aa9767f98351b3488edc2c100cda2d2ec2b04f3d8d3c8b" +dependencies = [ + "bitflags 2.13.1", + "core-foundation 0.9.4", + "system-configuration-sys", +] + +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", ] [[package]] @@ -3733,7 +3565,7 @@ dependencies = [ "mio", "pin-project-lite", "signal-hook-registry", - "socket2 0.6.5", + "socket2", "tokio-macros", "tracing", "windows-sys 0.61.2", @@ -3783,36 +3615,6 @@ dependencies = [ "serde", ] -[[package]] -name = "tonic" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "877c5b330756d856ffcc4553ab34a5684481ade925ecc54bcd1bf02b1d0d4d52" -dependencies = [ - "async-stream", - "async-trait", - "axum 0.7.9", - "base64 0.22.1", - "bytes", - "h2", - "http", - "http-body", - "http-body-util", - "hyper", - "hyper-timeout", - "hyper-util", - "percent-encoding", - "pin-project", - "prost 0.13.5", - "socket2 0.5.10", - "tokio", - "tokio-stream", - "tower 0.4.13", - "tower-layer", - "tower-service", - "tracing", -] - [[package]] name = "tonic" version = "0.14.6" @@ -3820,7 +3622,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac2a5518c70fa84342385732db33fb3f44bc4cc748936eb5833d2df34d6445ef" dependencies = [ "async-trait", - "axum 0.8.9", + "axum", "base64 0.22.1", "bytes", "h2", @@ -3832,11 +3634,11 @@ dependencies = [ "hyper-util", "percent-encoding", "pin-project", - "socket2 0.6.5", + "socket2", "sync_wrapper", "tokio", "tokio-stream", - "tower 0.5.3", + "tower", "tower-layer", "tower-service", "tracing", @@ -3849,28 +3651,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50849f68853be452acf590cde0b146665b8d507b3b8af17261df47e02c209ea0" dependencies = [ "bytes", - "prost 0.14.4", - "tonic 0.14.6", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "indexmap 1.9.3", - "pin-project", - "pin-project-lite", - "rand 0.8.7", - "slab", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", + "prost", + "tonic", ] [[package]] @@ -3881,7 +3663,7 @@ checksum = "ebe5ef63511595f1344e2d5cfa636d973292adc0eec1f0ad45fae9f0851ab1d4" dependencies = [ "futures-core", "futures-util", - "indexmap 2.14.0", + "indexmap", "pin-project-lite", "slab", "sync_wrapper", @@ -3953,9 +3735,9 @@ dependencies = [ [[package]] name = "tree-sitter" -version = "0.25.10" +version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78f873475d258561b06f1c595d93308a7ed124d9977cb26b148c2084a4a3cc87" +checksum = "af1c71c1c4cc0920b20d6b0f6572e7682cd07a6a2faec71067a31fa394c586df" dependencies = [ "cc", "regex", @@ -3977,9 +3759,9 @@ dependencies = [ [[package]] name = "tree-sitter-highlight" -version = "0.25.10" +version = "0.26.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc5f880ad8d8f94e88cb81c3557024cf1a8b75e3b504c50481ed4f5a6006ff3" +checksum = "cd7a0c48d503cf4e0a57a2453424eaef2fce4b4269f13e3579e52f0d0c9e5cc8" dependencies = [ "regex", "streaming-iterator", @@ -4063,12 +3845,6 @@ version = "1.0.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6e4313cd5fcd3dad5cafa179702e2b244f760991f45397d14d4ebf38247da75" -[[package]] -name = "unindent" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7264e107f553ccae879d21fbea1d6724ac785e8c3bfc762137959b5802826ef3" - [[package]] name = "universal-hash" version = "0.5.1" @@ -4164,15 +3940,6 @@ version = "0.11.1+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" -[[package]] -name = "wasip2" -version = "1.0.4+wasi-0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b67efb37e106e55ce722a510d6b5f9c17f083e5fc79afc2badeb12cc313d9487" -dependencies = [ - "wit-bindgen", -] - [[package]] name = "wasm-bindgen" version = "0.2.126" @@ -4326,47 +4093,46 @@ dependencies = [ [[package]] name = "windows" -version = "0.61.3" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9babd3a767a4c1aef6900409f85f5d53ce2544ccdfaa86dad48c91782c6d6893" +checksum = "527fadee13e0c05939a6a05d5bd6eec6cd2e3dbd648b9f8e447c6518133d8580" dependencies = [ "windows-collections", "windows-core", "windows-future", - "windows-link 0.1.3", "windows-numerics", ] [[package]] name = "windows-collections" -version = "0.2.0" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3beeceb5e5cfd9eb1d76b381630e82c4241ccd0d27f1a39ed41b2760b255c5e8" +checksum = "23b2d95af1a8a14a3c7367e1ed4fc9c20e0a26e79551b1454d72583c97cc6610" dependencies = [ "windows-core", ] [[package]] name = "windows-core" -version = "0.61.2" +version = "0.62.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +checksum = "b8e83a14d34d0623b51dce9581199302a221863196a1dde71a7663a4c2be9deb" dependencies = [ "windows-implement", "windows-interface", - "windows-link 0.1.3", - "windows-result 0.3.4", - "windows-strings 0.4.2", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] name = "windows-future" -version = "0.2.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc6a41e98427b19fe4b73c550f060b59fa592d7d686537eebf9385621bfbad8e" +checksum = "e1d6f90251fe18a279739e78025bd6ddc52a7e22f921070ccdc67dde84c605cb" dependencies = [ "windows-core", - "windows-link 0.1.3", + "windows-link", "windows-threading", ] @@ -4392,12 +4158,6 @@ dependencies = [ "syn", ] -[[package]] -name = "windows-link" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" - [[package]] name = "windows-link" version = "0.2.1" @@ -4406,12 +4166,12 @@ checksum = "f0805222e57f7521d6a62e36fa9163bc891acd422f971defe97d64e70d0a4fe5" [[package]] name = "windows-numerics" -version = "0.2.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9150af68066c4c5c07ddc0ce30421554771e528bde427614c61038bc2c92c2b1" +checksum = "6e2e40844ac143cdb44aead537bbf727de9b044e107a0f1220392177d15b0f26" dependencies = [ "windows-core", - "windows-link 0.1.3", + "windows-link", ] [[package]] @@ -4425,7 +4185,7 @@ dependencies = [ "log", "lru_time_cache", "mitmproxy", - "prost 0.14.4", + "prost", "tokio", "windivert", "winres", @@ -4437,18 +4197,9 @@ version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "02752bf7fbdcce7f2a27a742f798510f3e5ad88dbe84871e5168e2120c3d5720" dependencies = [ - "windows-link 0.2.1", - "windows-result 0.4.1", - "windows-strings 0.5.1", -] - -[[package]] -name = "windows-result" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" -dependencies = [ - "windows-link 0.1.3", + "windows-link", + "windows-result", + "windows-strings", ] [[package]] @@ -4457,16 +4208,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7781fa89eaf60850ac3d2da7af8e5242a5ea78d1a11c49bf2910bb5a73853eb5" dependencies = [ - "windows-link 0.2.1", -] - -[[package]] -name = "windows-strings" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" -dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] @@ -4475,7 +4217,7 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7837d08f69c77cf6b07689544538e017c1bfcf57e34b4c0ff58e6c2cd3b37091" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -4502,7 +4244,7 @@ version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ae137229bcbd6cdf0f7b80a31df61766145077ddf49416a728b02cb3921ff3fc" dependencies = [ - "windows-link 0.2.1", + "windows-link", ] [[package]] @@ -4538,11 +4280,11 @@ dependencies = [ [[package]] name = "windows-threading" -version = "0.1.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b66463ad2e0ea3bbf808b7f1d371311c80e115c0b71d60efc142cafbcfb057a6" +checksum = "3949bd5b99cafdf1c7ca86b43ca564028dfe27d66958f2470940f73d86d75b37" dependencies = [ - "windows-link 0.1.3", + "windows-link", ] [[package]] @@ -4658,12 +4400,6 @@ dependencies = [ "windows-sys 0.61.2", ] -[[package]] -name = "wit-bindgen" -version = "0.57.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ebf944e87a7c253233ad6766e082e3cd714b5d03812acc24c318f549614536e" - [[package]] name = "writeable" version = "0.6.3" diff --git a/Cargo.toml b/Cargo.toml index 637f3fde..df54cb34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -32,13 +32,13 @@ version = "0.13.0-dev" publish = false repository = "https://github.com/mitmproxy/mitmproxy-rs" edition = "2024" -rust-version = "1.88" # MSRV +rust-version = "1.95" # MSRV [workspace.dependencies] -aya = { version = "0.13.0", default-features = false } -aya-ebpf = { version = "0.1.1", default-features = false } -aya-log = { version = "0.2.1", default-features = false } -aya-log-ebpf = { version = "0.1.0", default-features = false } +aya = { version = "0.14.0", default-features = false } +aya-ebpf = { version = "0.2.1", default-features = false } +aya-log = { version = "0.3.0", default-features = false } +aya-log-ebpf = { version = "0.2.0", default-features = false } tun = { version = "0.8.8" } [workspace.lints.clippy] @@ -58,26 +58,23 @@ publish.workspace = true anyhow = { version = "1.0.97", features = ["backtrace"] } log = "0.4.27" pretty-hex = "0.4.1" -smoltcp = "0.12" +smoltcp = "0.13.1" tokio = { version = "1.47.1", features = ["macros", "net", "rt-multi-thread", "sync", "time", "io-util", "process"] } -boringtun = { version = "0.6", default-features = false } -console-subscriber = { version = "0.4.1", optional = true } +boringtun = { version = "0.7.1", default-features = false } +console-subscriber = { version = "0.5.0", optional = true } image = { version = "0.25.10", default-features = false, features = ["png", "tiff"] } prost = "0.14.1" tokio-util = { version = "0.7.14", features = ["codec"] } futures-util = { version = "0.3.31", features = ["sink"] } lru_time_cache = "0.11.11" -internet-packet = { version = "0.2.3", features = ["smoltcp"] } +internet-packet = { version = "0.2.4", features = ["smoltcp"] } data-encoding = "2.8.0" -hickory-resolver = "0.25.2" +hickory-resolver = "0.26.1" socket2 = "0.6.0" -[patch.crates-io] -# tokio = { path = "../tokio/tokio" } -boringtun = { git = 'https://github.com/cloudflare/boringtun', rev = '2f3c85f5c4a601018c10b464b1ca890d9504bf6e' } [target.'cfg(windows)'.dependencies.windows] -version = "0.61.3" +version = "0.62.2" features = [ "Win32_Foundation", "Win32_Graphics_Dwm", @@ -94,22 +91,22 @@ features = [ [target.'cfg(target_os = "macos")'.dependencies] security-framework = "3.2.0" -nix = { version = "0.30.1", default-features = false, features = ["fs"] } +nix = { version = "0.31.3", default-features = false, features = ["fs"] } core-graphics = "0.25" core-foundation = "0.10" objc2-app-kit = { version = "0.3.2", features = ["NSRunningApplication", "NSImage", "libc"] } -sysinfo = "0.36.1" +sysinfo = "0.39.6" [target.'cfg(target_os = "linux")'.dependencies] tun = { workspace = true, features = ["async"] } tempfile = "3.20.0" -sysinfo = "0.36.1" +sysinfo = "0.39.6" [dev-dependencies] env_logger = "0.11" -rand = "0.9" -criterion = "0.7.0" -hickory-server = "0.25.2" +rand = "0.10.2" +criterion = "0.8.2" +hickory-server = "0.26.1" [[bench]] name = "process" diff --git a/mitmproxy-highlight/Cargo.toml b/mitmproxy-highlight/Cargo.toml index 6342b0ac..a64fdf66 100644 --- a/mitmproxy-highlight/Cargo.toml +++ b/mitmproxy-highlight/Cargo.toml @@ -13,9 +13,9 @@ workspace = true [dependencies] anyhow = { version = "1.0.102", features = ["backtrace"] } -tree-sitter = "0.25.10" +tree-sitter = "0.26.11" tree-sitter-css = "0.25.0" -tree-sitter-highlight = "0.25.10" +tree-sitter-highlight = "0.26.11" tree-sitter-javascript = "0.25.0" tree-sitter-xml = "0.7.0" tree-sitter-yaml = "0.7.2" diff --git a/mitmproxy-linux/Cargo.toml b/mitmproxy-linux/Cargo.toml index 553e2ac6..a23b4e13 100644 --- a/mitmproxy-linux/Cargo.toml +++ b/mitmproxy-linux/Cargo.toml @@ -34,7 +34,7 @@ netlink-packet-route = "0.30.0" [target.'cfg(target_os = "linux")'.build-dependencies] anyhow = { version = "1.0.102", features = ["backtrace"] } -aya-build = "0.1.3" +aya-build = "0.2.0" mitmproxy-linux-ebpf = { path = "../mitmproxy-linux-ebpf" } cargo_metadata = { version = "0.23.1", default-features = false } diff --git a/mitmproxy-linux/src/main2.rs b/mitmproxy-linux/src/main2.rs index b3ea60ef..9f6227a1 100644 --- a/mitmproxy-linux/src/main2.rs +++ b/mitmproxy-linux/src/main2.rs @@ -44,10 +44,11 @@ fn load_bpf(device_index: u32) -> Result { ); let mut ebpf = EbpfLoader::new() .btf(Btf::from_sys_fs().ok().as_ref()) - .set_global("INTERFACE_ID", &device_index, true) + .override_global("INTERFACE_ID", &device_index, true) .load(BPF_PROG) .context("failed to load eBPF program")?; - if let Err(e) = aya_log::EbpfLogger::init(&mut ebpf) { + let logger = aya_log::EbpfLogger::init(&mut ebpf); + if let Err(e) = &logger { // This can happen if you remove all log statements from your eBPF program. warn!("failed to initialize eBPF logger: {e}"); } diff --git a/mitmproxy-rs/Cargo.toml b/mitmproxy-rs/Cargo.toml index 2573fcf3..390f0d97 100644 --- a/mitmproxy-rs/Cargo.toml +++ b/mitmproxy-rs/Cargo.toml @@ -22,12 +22,12 @@ mitmproxy-contentviews = { path = "../mitmproxy-contentviews" } anyhow = { version = "1.0.102", features = ["backtrace"] } data-encoding = "2.11.0" log = "0.4.31" -pyo3 = { version = "0.25", features = ["abi3", "abi3-py312", "anyhow"] } -pyo3-async-runtimes = { version = "0.25", features = ["tokio-runtime", "testing", "attributes"] } -pyo3-log = "0.12" +pyo3 = { version = "0.29.0", features = ["abi3", "abi3-py312", "anyhow"] } +pyo3-async-runtimes = { version = "0.29.0", features = ["tokio-runtime", "testing", "attributes"] } +pyo3-log = "0.13.4" rand_core = { version = "0.6.4", features = ["getrandom"] } # https://github.com/dalek-cryptography/curve25519-dalek/issues/731 tokio = { version = "1.52", features = ["macros", "net", "rt-multi-thread", "sync"] } -boringtun = "0.6" +boringtun = "0.7.1" tar = "0.4.46" console-subscriber = { version = "0.5.0", optional = true } diff --git a/mitmproxy-rs/pytests/test_task.rs b/mitmproxy-rs/pytests/test_task.rs index 0c29d4be..5437525c 100644 --- a/mitmproxy-rs/pytests/test_task.rs +++ b/mitmproxy-rs/pytests/test_task.rs @@ -65,7 +65,7 @@ mod tests { let (event_tx, event_rx) = mpsc::channel(1); let (shutdown_tx, shutdown_rx) = shutdown::channel(); - let (tcp_handler, udp_handler) = Python::with_gil(|py| { + let (tcp_handler, udp_handler) = Python::attach(|py| { let locals = PyDict::new(py); let code = CString::new(code).unwrap(); py.run(&code, None, Some(&locals)).unwrap(); diff --git a/mitmproxy-rs/src/contentviews.rs b/mitmproxy-rs/src/contentviews.rs index 8da1f62e..82daebfe 100644 --- a/mitmproxy-rs/src/contentviews.rs +++ b/mitmproxy-rs/src/contentviews.rs @@ -77,9 +77,10 @@ impl Metadata for PythonMetadata<'_> { } } -impl<'py> FromPyObject<'py> for PythonMetadata<'py> { - fn extract_bound(ob: &Bound<'py, PyAny>) -> PyResult { - Ok(PythonMetadata::new(ob.clone())) +impl<'a, 'py> FromPyObject<'a, 'py> for PythonMetadata<'py> { + type Error = PyErr; + fn extract(ob: Borrowed<'a, 'py, PyAny>) -> PyResult { + Ok(PythonMetadata::new(ob.to_owned())) } } @@ -121,7 +122,7 @@ impl Contentview { self.0.syntax_highlight().as_str() } - fn __lt__(&self, py: Python<'_>, other: PyObject) -> PyResult { + fn __lt__(&self, py: Python<'_>, other: Py) -> PyResult { Ok(self.name() < other.getattr(py, "name")?.extract::(py)?.as_str()) } diff --git a/mitmproxy-rs/src/dns_resolver.rs b/mitmproxy-rs/src/dns_resolver.rs index fff0dd2c..c9259176 100644 --- a/mitmproxy-rs/src/dns_resolver.rs +++ b/mitmproxy-rs/src/dns_resolver.rs @@ -1,4 +1,4 @@ -use mitmproxy::dns::{DNS_SERVERS, ResolveError}; +use mitmproxy::dns::{DNS_SERVERS, NetError}; use pyo3::exceptions::socket::gaierror; use pyo3::prelude::*; use pyo3::types::PyAny; @@ -84,7 +84,7 @@ impl AddrInfoErrorConst { } fn get(&self) -> isize { *self.1.get_or_init(|| { - Python::with_gil(|py| { + Python::attach(|py| { py.import("socket") .and_then(|m| m.getattr(self.0)) .and_then(|m| m.extract()) @@ -101,7 +101,7 @@ static EAI_AGAIN: AddrInfoErrorConst = AddrInfoErrorConst::new("EAI_AGAIN"); static EAI_NONAME: AddrInfoErrorConst = AddrInfoErrorConst::new("EAI_NONAME"); static EAI_NODATA: AddrInfoErrorConst = AddrInfoErrorConst::new("EAI_NODATA"); -fn resolve_result_to_py(resolved: Result, ResolveError>) -> Result, PyErr> { +fn resolve_result_to_py(resolved: Result, NetError>) -> Result, PyErr> { match resolved { Ok(resp) => Ok(resp .into_iter() diff --git a/mitmproxy-rs/src/process_info.rs b/mitmproxy-rs/src/process_info.rs index b0009f21..ce209325 100644 --- a/mitmproxy-rs/src/process_info.rs +++ b/mitmproxy-rs/src/process_info.rs @@ -70,7 +70,7 @@ pub fn active_executables() -> PyResult> { /// *Availability: Windows, macOS* #[pyfunction] #[allow(unused_variables)] -pub fn executable_icon(py: Python<'_>, path: PathBuf) -> PyResult { +pub fn executable_icon(py: Python<'_>, path: PathBuf) -> PyResult> { #[cfg(any(windows, target_os = "macos"))] { let mut icon_cache = processes::ICON_CACHE.lock().unwrap(); diff --git a/mitmproxy-rs/src/server/base.rs b/mitmproxy-rs/src/server/base.rs index cd559d48..6619f82d 100644 --- a/mitmproxy-rs/src/server/base.rs +++ b/mitmproxy-rs/src/server/base.rs @@ -38,8 +38,8 @@ impl Server { /// Set up and initialize a new WireGuard server. pub async fn init( packet_source_conf: T, - py_tcp_handler: PyObject, - py_udp_handler: PyObject, + py_tcp_handler: Py, + py_udp_handler: Py, ) -> Result<(Self, T::Data)> where T: PacketSourceConf, diff --git a/mitmproxy-rs/src/server/local_redirector.rs b/mitmproxy-rs/src/server/local_redirector.rs index 7384026f..72577ef5 100644 --- a/mitmproxy-rs/src/server/local_redirector.rs +++ b/mitmproxy-rs/src/server/local_redirector.rs @@ -98,8 +98,8 @@ impl LocalRedirector { #[allow(unused_variables)] pub fn start_local_redirector( py: Python<'_>, - handle_tcp_stream: PyObject, - handle_udp_stream: PyObject, + handle_tcp_stream: Py, + handle_udp_stream: Py, ) -> PyResult> { #[cfg(windows)] { diff --git a/mitmproxy-rs/src/server/tun.rs b/mitmproxy-rs/src/server/tun.rs index 01f7b02e..49571675 100644 --- a/mitmproxy-rs/src/server/tun.rs +++ b/mitmproxy-rs/src/server/tun.rs @@ -64,8 +64,8 @@ impl TunInterface { #[pyo3(signature = (handle_tcp_stream, handle_udp_stream, tun_name=None))] pub fn create_tun_interface( py: Python<'_>, - handle_tcp_stream: PyObject, - handle_udp_stream: PyObject, + handle_tcp_stream: Py, + handle_udp_stream: Py, tun_name: Option, ) -> PyResult> { #[cfg(target_os = "linux")] diff --git a/mitmproxy-rs/src/server/udp.rs b/mitmproxy-rs/src/server/udp.rs index 54dc08e3..87d15fde 100644 --- a/mitmproxy-rs/src/server/udp.rs +++ b/mitmproxy-rs/src/server/udp.rs @@ -57,7 +57,7 @@ pub fn start_udp_server( py: Python<'_>, host: IpAddr, port: u16, - handle_udp_stream: PyObject, + handle_udp_stream: Py, ) -> PyResult> { let conf = UdpConf { listen_addr: SocketAddr::from((host, port)), diff --git a/mitmproxy-rs/src/server/wireguard.rs b/mitmproxy-rs/src/server/wireguard.rs index 42ae57f8..29d6bbcd 100644 --- a/mitmproxy-rs/src/server/wireguard.rs +++ b/mitmproxy-rs/src/server/wireguard.rs @@ -67,8 +67,8 @@ pub fn start_wireguard_server( port: u16, private_key: String, peer_public_keys: Vec, - handle_tcp_stream: PyObject, - handle_udp_stream: PyObject, + handle_tcp_stream: Py, + handle_udp_stream: Py, ) -> PyResult> { let private_key = string_to_key(private_key)?; let peer_public_keys = peer_public_keys diff --git a/mitmproxy-rs/src/stream.rs b/mitmproxy-rs/src/stream.rs index e9a226c5..f22e8433 100644 --- a/mitmproxy-rs/src/stream.rs +++ b/mitmproxy-rs/src/stream.rs @@ -151,8 +151,8 @@ impl Stream { &self, py: Python, name: String, - default: Option, - ) -> PyResult { + default: Option>, + ) -> PyResult> { match name.as_str() { "transport_protocol" => { let proto = if self.connection_id.is_tcp() { diff --git a/mitmproxy-rs/src/task.rs b/mitmproxy-rs/src/task.rs index e233a4d6..0e3dcdef 100644 --- a/mitmproxy-rs/src/task.rs +++ b/mitmproxy-rs/src/task.rs @@ -16,8 +16,8 @@ pub struct PyInteropTask { locals: TaskLocals, transport_commands: mpsc::UnboundedSender, transport_events: mpsc::Receiver, - py_tcp_handler: PyObject, - py_udp_handler: PyObject, + py_tcp_handler: Py, + py_udp_handler: Py, shutdown: shutdown::Receiver, } @@ -26,12 +26,12 @@ impl PyInteropTask { pub fn new( transport_commands: mpsc::UnboundedSender, transport_events: mpsc::Receiver, - py_tcp_handler: PyObject, - py_udp_handler: PyObject, + py_tcp_handler: Py, + py_udp_handler: Py, shutdown: shutdown::Receiver, ) -> Result { // Note: The current asyncio event loop needs to be determined here on the main thread. - let locals = Python::with_gil(|py| -> Result { + let locals = Python::attach(|py| -> Result { let py_loop = pyo3_async_runtimes::tokio::get_current_loop(py)?; TaskLocals::new(py_loop).copy_context(py) }) @@ -82,7 +82,7 @@ impl PyInteropTask { let mut conns = active_streams.lock().await; // spawn connection handler coroutine - if let Err(err) = Python::with_gil(|py| -> Result<(), PyErr> { + if let Err(err) = Python::attach(|py| -> Result<(), PyErr> { // calling Python coroutine object yields an awaitable object let coro = if connection_id.is_tcp() { @@ -99,7 +99,7 @@ impl PyInteropTask { let active_streams = active_streams.clone(); tokio::spawn(async move { if let Err(err) = future.await { - let is_cancelled = Python::with_gil(|py| err.is_instance_of::(py)); + let is_cancelled = Python::attach(|py| err.is_instance_of::(py)); if !is_cancelled { log::error!("TCP connection handler coroutine raised an exception:\n{err}"); } diff --git a/mitmproxy-rs/src/util.rs b/mitmproxy-rs/src/util.rs index c60218c0..f347573f 100644 --- a/mitmproxy-rs/src/util.rs +++ b/mitmproxy-rs/src/util.rs @@ -25,7 +25,7 @@ where .ok_or_else(|| PyValueError::new_err("Invalid key.")) } -pub fn socketaddr_to_py(py: Python, s: SocketAddr) -> PyResult { +pub fn socketaddr_to_py(py: Python, s: SocketAddr) -> PyResult> { (s.ip().to_string(), s.port()).into_py_any(py) } diff --git a/src/dns.rs b/src/dns.rs index 074181b2..90e869a1 100644 --- a/src/dns.rs +++ b/src/dns.rs @@ -1,26 +1,28 @@ -pub use hickory_resolver::ResolveError; use hickory_resolver::TokioResolver; -use hickory_resolver::config::NameServerConfig; use hickory_resolver::config::ResolverConfig; +use hickory_resolver::config::{ConnectionConfig, NameServerConfig, ProtocolConfig}; use hickory_resolver::config::{LookupIpStrategy, ResolveHosts}; use hickory_resolver::lookup_ip::LookupIp; -use hickory_resolver::name_server::TokioConnectionProvider; -use hickory_resolver::proto::ProtoError; +pub use hickory_resolver::net::NetError; +use hickory_resolver::net::runtime::TokioRuntimeProvider; pub use hickory_resolver::proto::op::Query; pub use hickory_resolver::proto::op::ResponseCode; -use hickory_resolver::proto::xfer::Protocol; use hickory_resolver::system_conf::read_system_conf; use std::net::IpAddr; use std::net::SocketAddr; use std::sync::LazyLock; -pub static DNS_SERVERS: LazyLock, ResolveError>> = LazyLock::new(|| { +pub static DNS_SERVERS: LazyLock, NetError>> = LazyLock::new(|| { let (config, _opts) = read_system_conf()?; Ok(config .name_servers() .iter() - .filter(|ns| ns.protocol == Protocol::Udp) - .map(|ns| ns.socket_addr.ip().to_string()) + .filter(|ns| { + ns.connections + .iter() + .any(|c| matches!(c.protocol, ProtocolConfig::Udp)) + }) + .map(|ns| ns.ip.to_string()) .collect::>()) }); @@ -30,15 +32,19 @@ impl DnsResolver { pub fn new( name_servers: Option>, use_hosts_file: bool, - ) -> Result { + ) -> Result { let (config, mut opts) = if let Some(ns) = name_servers { // Try to get opts from system, but fall back gracefully if that is unavailable. let opts = read_system_conf().map(|r| r.1).unwrap_or_default(); - let mut conf = ResolverConfig::new(); + let mut conf = ResolverConfig::from_parts(None, vec![], vec![]); for addr in ns.into_iter() { - conf.add_name_server(NameServerConfig::new(addr, Protocol::Udp)); - conf.add_name_server(NameServerConfig::new(addr, Protocol::Tcp)); + let port = addr.port(); + let mut udp = ConnectionConfig::new(ProtocolConfig::Udp); + udp.port = port; + let mut tcp = ConnectionConfig::new(ProtocolConfig::Tcp); + tcp.port = port; + conf.add_name_server(NameServerConfig::new(addr.ip(), true, vec![udp, tcp])); } (conf, opts) } else { @@ -51,12 +57,12 @@ impl DnsResolver { }; opts.ip_strategy = LookupIpStrategy::Ipv4AndIpv6; let mut builder = - TokioResolver::builder_with_config(config, TokioConnectionProvider::default()); + TokioResolver::builder_with_config(config, TokioRuntimeProvider::default()); *builder.options_mut() = opts; - Ok(Self(builder.build())) + Ok(Self(builder.build()?)) } - pub async fn lookup_ip(&self, host: String) -> Result, ResolveError> { + pub async fn lookup_ip(&self, host: String) -> Result, NetError> { self.0.lookup_ip(host).await.map(_interleave_addrinfos) } @@ -64,15 +70,15 @@ impl DnsResolver { // so we instead filter addresses returned from lookup_ip for now // // https://github.com/hickory-dns/hickory-dns/pull/2149 - pub async fn lookup_ipv4(&self, host: String) -> Result, ResolveError> { + pub async fn lookup_ipv4(&self, host: String) -> Result, NetError> { self.lookup_ipvx(host, IpAddr::is_ipv4).await } - pub async fn lookup_ipv6(&self, host: String) -> Result, ResolveError> { + pub async fn lookup_ipv6(&self, host: String) -> Result, NetError> { self.lookup_ipvx(host, IpAddr::is_ipv6).await } - async fn lookup_ipvx(&self, host: String, filter: F) -> Result, ResolveError> + async fn lookup_ipvx(&self, host: String, filter: F) -> Result, NetError> where F: FnMut(&IpAddr) -> bool, { @@ -80,16 +86,8 @@ impl DnsResolver { let addrs: Vec = lookup.iter().filter(filter).collect(); if addrs.is_empty() { - Err(ProtoError::nx_error( - Box::new(lookup.query().clone()), - None, - None, - None, - ResponseCode::NoError, - true, - None, - ) - .into()) + use hickory_resolver::net::NoRecords; + Err(NoRecords::new(lookup.query().clone(), ResponseCode::NoError).into()) } else { Ok(addrs) } @@ -97,7 +95,7 @@ impl DnsResolver { } fn _interleave_addrinfos(lookup_ip: LookupIp) -> Vec { - let mut addrs: Vec = lookup_ip.into_iter().collect(); + let mut addrs: Vec = lookup_ip.iter().collect(); interleave_inplace(&mut addrs, |a| a.is_ipv4()); addrs } @@ -135,16 +133,14 @@ where #[cfg(test)] mod tests { - use hickory_resolver::config::NameServerConfig; - use hickory_server::proto::rr::rdata::{A, AAAA}; - use hickory_server::proto::rr::{DNSClass, Name, RData, Record}; + use hickory_server::proto::rr::{Name, RData, Record}; use std::net::SocketAddr; use std::str::FromStr; use std::sync::Arc; - use hickory_server::authority::ZoneType; - use hickory_server::store::in_memory::InMemoryAuthority; + use hickory_server::store::in_memory::InMemoryZoneHandler; + use hickory_server::zone_handler::{AxfrPolicy, ZoneType}; use super::*; @@ -157,8 +153,6 @@ mod tests { async fn resolver() -> anyhow::Result<()> { let listen_addr = test_server().await?; - let mut config = ResolverConfig::new(); - config.add_name_server(NameServerConfig::new(listen_addr, Protocol::Udp)); let resolver = DnsResolver::new(Some(vec![listen_addr]), false)?; let mut results = resolver.lookup_ip("example.com.".to_string()).await?; @@ -187,11 +181,10 @@ mod tests { let listen_addr = sock.local_addr()?; let origin: Name = Name::parse("example.com.", None).unwrap(); - let mut records = InMemoryAuthority::empty(origin.clone(), ZoneType::Primary, false); + let mut records: InMemoryZoneHandler = + InMemoryZoneHandler::empty(origin.clone(), ZoneType::Primary, AxfrPolicy::Deny); records.upsert_mut( - Record::from_rdata(origin.clone(), 86400, RData::A(A::new(93, 184, 215, 14))) - .set_dns_class(DNSClass::IN) - .clone(), + Record::from_rdata(origin.clone(), 86400, RData::A(A::new(93, 184, 215, 14))), 0, ); records.upsert_mut( @@ -201,16 +194,14 @@ mod tests { RData::AAAA(AAAA::new( 0x2606, 0x2800, 0x21f, 0xcb07, 0x6820, 0x80da, 0xaf6b, 0x8b2c, )), - ) - .set_dns_class(DNSClass::IN) - .clone(), + ), 0, ); - let mut catalog = hickory_server::authority::Catalog::new(); + let mut catalog = hickory_server::zone_handler::Catalog::new(); catalog.upsert(Name::root().into(), vec![Arc::new(records)]); - let mut server = hickory_server::ServerFuture::new(catalog); + let mut server = hickory_server::Server::new(catalog); server.register_socket(sock); tokio::spawn(async move { server.block_until_done().await }); diff --git a/src/packet_sources/windows.rs b/src/packet_sources/windows.rs index 4023b15f..3ba5f366 100755 --- a/src/packet_sources/windows.rs +++ b/src/packet_sources/windows.rs @@ -80,7 +80,7 @@ impl PacketSourceConf for WindowsConf { if cfg!(debug_assertions) { if result.0 as u32 <= 32 { - let err = windows::core::Error::from_win32(); + let err = windows::core::Error::from_thread(); log::warn!("Failed to start child process: {err}"); } } else if result.0 as u32 == SE_ERR_ACCESSDENIED { @@ -88,7 +88,7 @@ impl PacketSourceConf for WindowsConf { "Failed to start the interception process as administrator." )); } else if result.0 as u32 <= 32 { - let err = windows::core::Error::from_win32(); + let err = windows::core::Error::from_thread(); return Err(anyhow!("Failed to start the executable: {err}")); } diff --git a/src/processes/windows_list.rs b/src/processes/windows_list.rs index 86ffb3d3..51d64851 100644 --- a/src/processes/windows_list.rs +++ b/src/processes/windows_list.rs @@ -113,7 +113,7 @@ pub fn get_display_name(executable: &Path) -> Result { let version_info_size = { let size = GetFileVersionInfoSizeW(PCWSTR::from_raw(executable_path.as_ptr()), None); if size == 0 { - return Err(windows::core::Error::from_win32().into()); + return Err(windows::core::Error::from_thread().into()); } size }; diff --git a/wireguard-test-client/Cargo.toml b/wireguard-test-client/Cargo.toml index 39099236..0dba353e 100644 --- a/wireguard-test-client/Cargo.toml +++ b/wireguard-test-client/Cargo.toml @@ -15,6 +15,6 @@ workspace = true [dependencies] anyhow = "1.0.102" data-encoding = "2.11.0" -boringtun = "0.6" +boringtun = "0.7.1" hex = "0.4" -smoltcp = "0.12" +smoltcp = "0.13.1"