summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorEmīls <emils@mullvad.net>2023-08-28 15:06:48 +0200
committerEmīls <emils@mullvad.net>2023-08-28 16:14:35 +0200
commitbf580ba569df244881a08761741b04c90033e420 (patch)
treef886814e78e1644851f348dbe8ed58ec90d8d894
parentfbecf69350f41c585b372cc92cd8d4f37de569f2 (diff)
downloadmullvadvpn-bf580ba569df244881a08761741b04c90033e420.tar.xz
mullvadvpn-bf580ba569df244881a08761741b04c90033e420.zip
Update trust-dns
-rw-r--r--Cargo.lock247
-rw-r--r--talpid-core/Cargo.toml3
-rw-r--r--talpid-core/src/resolver.rs12
3 files changed, 114 insertions, 148 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 513b81e700..9e89540123 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -382,7 +382,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a6358dedf60f4d9b8db43ad187391afe959746101346fe51bb978126bec61dfb"
dependencies = [
"heck",
- "indexmap",
+ "indexmap 1.7.0",
"log",
"proc-macro2",
"quote",
@@ -390,7 +390,7 @@ dependencies = [
"serde_json",
"syn 1.0.100",
"tempfile",
- "toml",
+ "toml 0.5.8",
]
[[package]]
@@ -879,6 +879,15 @@ dependencies = [
]
[[package]]
+name = "drain"
+version = "0.1.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2f1a0abf3fcefad9b4dd0e414207a7408e12b68414a01e6bb19b897d5bd7632d"
+dependencies = [
+ "tokio",
+]
+
+[[package]]
name = "duct"
version = "0.13.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -934,24 +943,6 @@ dependencies = [
]
[[package]]
-name = "endian-type"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d"
-
-[[package]]
-name = "enum-as-inner"
-version = "0.5.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c9720bba047d567ffc8a3cba48bf19126600e249ab7f128e9233e6376976a116"
-dependencies = [
- "heck",
- "proc-macro2",
- "quote",
- "syn 1.0.100",
-]
-
-[[package]]
name = "enum-as-inner"
version = "0.6.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -987,6 +978,12 @@ dependencies = [
]
[[package]]
+name = "equivalent"
+version = "1.0.1"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5"
+
+[[package]]
name = "err-context"
version = "0.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1279,7 +1276,7 @@ dependencies = [
"futures-sink",
"futures-util",
"http",
- "indexmap",
+ "indexmap 1.7.0",
"slab",
"tokio",
"tokio-util",
@@ -1293,6 +1290,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ab5ef0d4909ef3724cc8cce6ccc8572c5c817592e9285f5464f8e86f8bd3726e"
[[package]]
+name = "hashbrown"
+version = "0.14.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a"
+
+[[package]]
name = "heck"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1475,17 +1478,6 @@ checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39"
[[package]]
name = "idna"
-version = "0.2.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "418a0a6fab821475f634efe3ccc45c013f742efe03d853e8d3355d5cb850ecf8"
-dependencies = [
- "matches",
- "unicode-bidi",
- "unicode-normalization",
-]
-
-[[package]]
-name = "idna"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c"
@@ -1501,7 +1493,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "bc633605454125dec4b66843673f01c7df2b89479b32e0ed634e43a91cff62a5"
dependencies = [
"autocfg",
- "hashbrown",
+ "hashbrown 0.11.2",
+]
+
+[[package]]
+name = "indexmap"
+version = "2.0.0"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d"
+dependencies = [
+ "equivalent",
+ "hashbrown 0.14.0",
]
[[package]]
@@ -1840,12 +1842,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ffbee8634e0d45d258acb448e7eaab3fce7a0a467395d4d9f228e3c1f01fb2e4"
[[package]]
-name = "matches"
-version = "0.1.10"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2532096657941c2fea9c289d370a250971c689d4f143798ff67113ec042024a5"
-
-[[package]]
name = "matchit"
version = "0.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2298,15 +2294,6 @@ dependencies = [
]
[[package]]
-name = "nibble_vec"
-version = "0.1.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43"
-dependencies = [
- "smallvec",
-]
-
-[[package]]
name = "nix"
version = "0.23.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -2598,7 +2585,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143"
dependencies = [
"fixedbitset",
- "indexmap",
+ "indexmap 1.7.0",
]
[[package]]
@@ -2888,16 +2875,6 @@ dependencies = [
]
[[package]]
-name = "radix_trie"
-version = "0.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd"
-dependencies = [
- "endian-type",
- "nibble_vec",
-]
-
-[[package]]
name = "rand"
version = "0.7.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3242,6 +3219,15 @@ dependencies = [
]
[[package]]
+name = "serde_spanned"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186"
+dependencies = [
+ "serde",
+]
+
+[[package]]
name = "serde_urlencoded"
version = "0.7.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -3316,7 +3302,7 @@ dependencies = [
"thiserror",
"tokio",
"tokio-tfo",
- "trust-dns-resolver 0.23.0",
+ "trust-dns-resolver",
"url",
"windows-sys 0.48.0",
]
@@ -3365,7 +3351,7 @@ dependencies = [
"cfg-if",
"futures",
"hyper",
- "idna 0.4.0",
+ "idna",
"ipnet",
"iprange",
"json5",
@@ -3628,6 +3614,7 @@ dependencies = [
"tokio",
"tonic-build",
"triggered",
+ "trust-dns-proto",
"trust-dns-server",
"which",
"widestring",
@@ -4010,6 +3997,40 @@ dependencies = [
]
[[package]]
+name = "toml"
+version = "0.7.6"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542"
+dependencies = [
+ "serde",
+ "serde_spanned",
+ "toml_datetime",
+ "toml_edit",
+]
+
+[[package]]
+name = "toml_datetime"
+version = "0.6.3"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b"
+dependencies = [
+ "serde",
+]
+
+[[package]]
+name = "toml_edit"
+version = "0.19.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "f8123f27e969974a3dfba720fdb560be359f57b44302d280ba72e76a74480e8a"
+dependencies = [
+ "indexmap 2.0.0",
+ "serde",
+ "serde_spanned",
+ "toml_datetime",
+ "winnow",
+]
+
+[[package]]
name = "tonic"
version = "0.8.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4062,7 +4083,7 @@ checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c"
dependencies = [
"futures-core",
"futures-util",
- "indexmap",
+ "indexmap 1.7.0",
"pin-project",
"pin-project-lite",
"rand 0.8.5",
@@ -4167,52 +4188,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "ce148eae0d1a376c1b94ae651fc3261d9cb8294788b962b7382066376503a2d1"
[[package]]
-name = "trust-dns-client"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6c408c32e6a9dbb38037cece35740f2cf23c875d8ca134d33631cec83f74d3fe"
-dependencies = [
- "cfg-if",
- "data-encoding",
- "futures-channel",
- "futures-util",
- "lazy_static",
- "radix_trie",
- "rand 0.8.5",
- "thiserror",
- "time",
- "tokio",
- "tracing",
- "trust-dns-proto 0.22.0",
-]
-
-[[package]]
-name = "trust-dns-proto"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4f7f83d1e4a0e4358ac54c5c3681e5d7da5efc5a7a632c90bb6d6669ddd9bc26"
-dependencies = [
- "async-trait",
- "cfg-if",
- "data-encoding",
- "enum-as-inner 0.5.1",
- "futures-channel",
- "futures-io",
- "futures-util",
- "idna 0.2.3",
- "ipnet",
- "lazy_static",
- "rand 0.8.5",
- "serde",
- "smallvec",
- "thiserror",
- "tinyvec",
- "tokio",
- "tracing",
- "url",
-]
-
-[[package]]
name = "trust-dns-proto"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4221,14 +4196,15 @@ dependencies = [
"async-trait",
"cfg-if",
"data-encoding",
- "enum-as-inner 0.6.0",
+ "enum-as-inner",
"futures-channel",
"futures-io",
"futures-util",
- "idna 0.4.0",
+ "idna",
"ipnet",
"once_cell",
"rand 0.8.5",
+ "serde",
"smallvec",
"thiserror",
"tinyvec",
@@ -4239,27 +4215,6 @@ dependencies = [
[[package]]
name = "trust-dns-resolver"
-version = "0.22.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aff21aa4dcefb0a1afbfac26deb0adc93888c7d295fb63ab273ef276ba2b7cfe"
-dependencies = [
- "cfg-if",
- "futures-util",
- "ipconfig",
- "lazy_static",
- "lru-cache",
- "parking_lot",
- "resolv-conf",
- "serde",
- "smallvec",
- "thiserror",
- "tokio",
- "tracing",
- "trust-dns-proto 0.22.0",
-]
-
-[[package]]
-name = "trust-dns-resolver"
version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2dff7aed33ef3e8bf2c9966fccdfed93f93d46f432282ea875cd66faabc6ef2f"
@@ -4272,34 +4227,35 @@ dependencies = [
"parking_lot",
"rand 0.8.5",
"resolv-conf",
+ "serde",
"smallvec",
"thiserror",
"tokio",
"tracing",
- "trust-dns-proto 0.23.0",
+ "trust-dns-proto",
]
[[package]]
name = "trust-dns-server"
-version = "0.22.1"
+version = "0.23.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "99022f9befa6daec2a860be68ac28b1f0d9d7ccf441d8c5a695e35a58d88840d"
+checksum = "0f2863cefc06d1d5605ea937bfd8939e23687bb44dd5d136217ad9378582f9cc"
dependencies = [
"async-trait",
"bytes",
"cfg-if",
- "enum-as-inner 0.5.1",
+ "drain",
+ "enum-as-inner",
"futures-executor",
"futures-util",
"serde",
"thiserror",
"time",
"tokio",
- "toml",
+ "toml 0.7.6",
"tracing",
- "trust-dns-client",
- "trust-dns-proto 0.22.0",
- "trust-dns-resolver 0.22.0",
+ "trust-dns-proto",
+ "trust-dns-resolver",
]
[[package]]
@@ -4421,7 +4377,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "143b538f18257fac9cad154828a57c6bf5157e1aa604d4816b5995bf6de87ae5"
dependencies = [
"form_urlencoded",
- "idna 0.4.0",
+ "idna",
"percent-encoding",
"serde",
]
@@ -4752,6 +4708,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
[[package]]
+name = "winnow"
+version = "0.5.15"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "7c2e3184b9c4e92ad5167ca73039d0c42476302ab603e2fec4487511f38ccefc"
+dependencies = [
+ "memchr",
+]
+
+[[package]]
name = "winreg"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -4776,7 +4741,7 @@ version = "0.1.12"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "b68db261ef59e9e52806f688020631e987592bd83619edccda9c47d42cde4f6c"
dependencies = [
- "toml",
+ "toml 0.5.8",
]
[[package]]
diff --git a/talpid-core/Cargo.toml b/talpid-core/Cargo.toml
index ec8031415b..83654288ca 100644
--- a/talpid-core/Cargo.toml
+++ b/talpid-core/Cargo.toml
@@ -47,7 +47,8 @@ talpid-dbus = { path = "../talpid-dbus" }
[target.'cfg(target_os = "macos")'.dependencies]
pfctl = "0.4.4"
system-configuration = "0.5.1"
-trust-dns-server = { version = "0.22.0", features = ["resolver"] }
+trust-dns-server = { version = "0.23.0", features = ["resolver"] }
+trust-dns-proto = "0.23.0"
subslice = "0.2"
async-trait = "0.1"
diff --git a/talpid-core/src/resolver.rs b/talpid-core/src/resolver.rs
index bf2480e69b..666fc10c0e 100644
--- a/talpid-core/src/resolver.rs
+++ b/talpid-core/src/resolver.rs
@@ -13,17 +13,17 @@ use futures::{
};
use once_cell::sync::Lazy;
+use trust_dns_proto::{
+ op::LowerQuery,
+ rr::{LowerName, RecordType},
+};
use trust_dns_server::{
authority::{
EmptyLookup, LookupObject, MessageRequest, MessageResponse, MessageResponseBuilder,
},
- client::{
- op::LowerQuery,
- rr::{LowerName, RecordType},
- },
proto::{
op::{header::MessageType, op_code::OpCode, Header},
- rr::{domain::Name, record_data::RData, Record},
+ rr::{domain::Name, rdata, record_data::RData, Record},
},
resolver::lookup::Lookup,
server::{Request, RequestHandler, ResponseHandler, ResponseInfo},
@@ -162,7 +162,7 @@ impl FilteringResolver {
return_query.query_type(),
TTL_SECONDS,
);
- return_record.set_data(Some(RData::A(RESOLVED_ADDR)));
+ return_record.set_data(Some(RData::A(rdata::A(RESOLVED_ADDR))));
let lookup = Lookup::new_with_deadline(
return_query,