summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLinus Färnstrand <linus@mullvad.net>2018-02-01 14:42:49 +0100
committerLinus Färnstrand <linus@mullvad.net>2018-02-01 14:42:49 +0100
commit533ec796b0c0a23ae9c40cadbb711c6d03bd1ca6 (patch)
tree9b8f1832f5a81bd91702f30127f1b3299b4beb73
parent32ba7bc9490bfeda3cf686947aa9c86953b8bd8b (diff)
parenteb1799c0bdf8c3ef6e2b39abf18571fc8f6670c8 (diff)
downloadmullvadvpn-533ec796b0c0a23ae9c40cadbb711c6d03bd1ca6.tar.xz
mullvadvpn-533ec796b0c0a23ae9c40cadbb711c6d03bd1ca6.zip
Merge branch 'use-published-system-configuration'
-rw-r--r--Cargo.lock116
-rw-r--r--talpid-core/Cargo.toml4
-rw-r--r--talpid-core/src/firewall/macos/dns.rs55
3 files changed, 40 insertions, 135 deletions
diff --git a/Cargo.lock b/Cargo.lock
index bedbdb76f0..074ddd624d 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -77,24 +77,6 @@ dependencies = [
]
[[package]]
-name = "bindgen"
-version = "0.31.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "cexpr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "clang-sys 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "clap 2.29.1 (registry+https://github.com/rust-lang/crates.io-index)",
- "env_logger 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)",
- "peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "quote 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)",
- "regex 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)",
- "which 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "bitflags"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -129,14 +111,6 @@ version = "1.0.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
-name = "cexpr"
-version = "0.2.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "cfg-if"
version = "0.1.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -152,16 +126,6 @@ dependencies = [
]
[[package]]
-name = "clang-sys"
-version = "0.21.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)",
- "libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
- "libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "clap"
version = "2.29.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -186,10 +150,10 @@ dependencies = [
[[package]]
name = "core-foundation"
-version = "0.4.6"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "core-foundation-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
]
@@ -203,7 +167,7 @@ dependencies = [
[[package]]
name = "core-foundation-sys"
-version = "0.4.6"
+version = "0.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
"libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -345,11 +309,6 @@ dependencies = [
]
[[package]]
-name = "glob"
-version = "0.2.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
name = "globset"
version = "0.1.4"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -556,11 +515,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "lazy_static"
-version = "0.2.11"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
-name = "lazy_static"
version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -580,16 +534,6 @@ version = "0.2.35"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
-name = "libloading"
-version = "0.4.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)",
- "lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)",
- "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "log"
version = "0.3.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -788,14 +732,6 @@ dependencies = [
]
[[package]]
-name = "nom"
-version = "3.2.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "memchr 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "num"
version = "0.1.41"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -915,11 +851,6 @@ dependencies = [
]
[[package]]
-name = "peeking_take_while"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-
-[[package]]
name = "percent-encoding"
version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1179,20 +1110,18 @@ dependencies = [
[[package]]
name = "system-configuration"
version = "0.1.0"
-source = "git+https://github.com/mullvad/system-configuration-rs#cfda5c348acbbc9ca9c9f621c29d2661604b4af9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "core-foundation-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
- "system-configuration-sys 0.1.0 (git+https://github.com/mullvad/system-configuration-rs)",
+ "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
+ "system-configuration-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
name = "system-configuration-sys"
version = "0.1.0"
-source = "git+https://github.com/mullvad/system-configuration-rs#cfda5c348acbbc9ca9c9f621c29d2661604b4af9"
+source = "registry+https://github.com/rust-lang/crates.io-index"
dependencies = [
- "bindgen 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "core-foundation-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
]
[[package]]
@@ -1204,7 +1133,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
name = "talpid-core"
version = "0.1.0"
dependencies = [
- "core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)",
+ "core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)",
"duct 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)",
"error-chain 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)",
"jsonrpc-core 7.1.1 (git+https://github.com/paritytech/jsonrpc?tag=v7.1.1)",
@@ -1215,7 +1144,7 @@ dependencies = [
"openvpn-plugin 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)",
"pfctl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)",
"shell-escape 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)",
- "system-configuration 0.1.0 (git+https://github.com/mullvad/system-configuration-rs)",
+ "system-configuration 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)",
"talpid-ipc 0.1.0",
"talpid-types 0.1.0",
"tokio-core 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)",
@@ -1456,14 +1385,6 @@ version = "1.0.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
-name = "which"
-version = "1.0.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-dependencies = [
- "libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)",
-]
-
-[[package]]
name = "winapi"
version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1532,22 +1453,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum backtrace 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ebbbf59b1c43eefa8c3ede390fcc36820b4999f7914104015be25025e0d62af2"
"checksum backtrace-sys 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "44585761d6161b0f57afc49482ab6bd067e4edef48c12a152c237eb0203f7661"
"checksum base64 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "229d032f1a99302697f10b27167ae6d03d49d032e6a8e2550e8d3fc13356d2b4"
-"checksum bindgen 0.31.3 (registry+https://github.com/rust-lang/crates.io-index)" = "57253399c086f4f29e57ffd3b5cdbc23a806a00292619351aa4cfa39cb49d4ea"
"checksum bitflags 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "aad18937a628ec6abcd26d1489012cc0e18c21798210f491af69ded9b881106d"
"checksum bitflags 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "4efd02e230a02e18f92fc2735f44597385ed02ad8f831e7c1c1156ee5e1ab3a5"
"checksum bitflags 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "b3c30d3802dfb7281680d6285f2ccdaa8c2d8fee41f93805dba5c4cf50dc23cf"
"checksum byteorder 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "652805b7e73fada9d85e9a6682a4abd490cb52d96aeecc12e33a0de34dfd0d23"
"checksum bytes 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "1b7db437d718977f6dc9b2e3fd6fc343c02ac6b899b73fdd2179163447bd9ce9"
"checksum cc 1.0.4 (registry+https://github.com/rust-lang/crates.io-index)" = "deaf9ec656256bb25b404c51ef50097207b9cbb29c933d31f92cae5a8a0ffee0"
-"checksum cexpr 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "cdbb21df6ff3497a61df5059994297f746267020ba38ce237aad9c875f7b4313"
"checksum cfg-if 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "d4c819a1287eb618df47cc647173c5c4c66ba19d888a6e50d605672aed3140de"
"checksum chrono 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7c20ebe0b2b08b0aeddba49c609fe7957ba2e33449882cb186a180bc60682fa9"
-"checksum clang-sys 0.21.1 (registry+https://github.com/rust-lang/crates.io-index)" = "00048189ee171715296dfe3b2fcfd439563c7bfec0d98d3976ce3402d62c8f07"
"checksum clap 2.29.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8f4a2b3bb7ef3c672d7c13d15613211d5a6976b6892c598b0fcb5d40765f19c2"
"checksum core-foundation 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "25bfd746d203017f7d5cbd31ee5d8e17f94b6521c7af77ece6c9e4b2d4b16c67"
-"checksum core-foundation 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8047f547cd6856d45b1cdd75ef8d2f21f3d0e4bf1dab0a0041b0ae9a5dda9c0e"
+"checksum core-foundation 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "286e0b41c3a20da26536c6000a280585d519fd07b3956b43aed8a79e9edce980"
"checksum core-foundation-sys 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "065a5d7ffdcbc8fa145d6f0746f3555025b9097a9e9cda59f7467abae670c78d"
-"checksum core-foundation-sys 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "152195421a2e6497a8179195672e9d4ee8e45ed8c465b626f1606d27a08ebcd5"
+"checksum core-foundation-sys 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "716c271e8613ace48344f723b60b900a93150271e5be206212d052bbc0883efa"
"checksum crypt32-sys 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e34988f7e069e0b2f3bfc064295161e489b2d4e04a2e4248fb94360cdf00b4ec"
"checksum ctrlc 3.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "df391ea008fca636e41e40863a0b39a850e2ab26b0cdeed0c3657fd05a66d44c"
"checksum derive_builder 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c998e6ab02a828dd9735c18f154e14100e674ed08cb4e1938f0e4177543f439"
@@ -1565,7 +1483,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7"
"checksum futures 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "118b49cac82e04121117cbd3121ede3147e885627d82c4546b87c702debb90c1"
"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4"
-"checksum glob 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "8be18de09a56b60ed0edf84bc9df007e30040691af7acd1c41874faac5895bfb"
"checksum globset 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "90d069fe6beb9be359ef505650b3f73228c5591a3c4b1f32be2f4f44459ffa3a"
"checksum httparse 1.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "af2f2dd97457e8fb1ae7c5a420db346af389926e36f43768b96f101546b04a07"
"checksum hyper 0.11.12 (registry+https://github.com/rust-lang/crates.io-index)" = "856a5eb897fbc26890ddf8760ad4bbfc6bd777233522d9c48379ca9563d40517"
@@ -1586,12 +1503,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum kernel32-sys 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "7507624b29483431c0ba2d82aece8ca6cdba9382bff4ddd0f7490560c056098d"
"checksum language-tags 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)" = "a91d884b6667cd606bb5a69aa0c99ba811a115fc68915e7056ec08a46e93199a"
"checksum lazy_static 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "cf186d1a8aa5f5bee5fd662bc9c1b949e0259e1bcc379d1f006847b0080c7417"
-"checksum lazy_static 0.2.11 (registry+https://github.com/rust-lang/crates.io-index)" = "76f033c7ad61445c5b347c7382dd1237847eb1bce590fe50365dcb33d546be73"
"checksum lazy_static 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "c8f31047daa365f19be14b47c29df4f7c3b581832407daabe6ae77397619237d"
"checksum lazycell 0.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "3b585b7a6811fb03aa10e74b278a0f00f8dd9b45dc681f148bb29fa5cb61859b"
"checksum lazycell 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a6f08839bc70ef4a3fe1d566d5350f519c5912ea86be0df1740a7d247c7fc0ef"
"checksum libc 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)" = "96264e9b293e95d25bfcbbf8a88ffd1aedc85b754eba8b7d78012f638ba220eb"
-"checksum libloading 0.4.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fd38073de8f7965d0c17d30546d4bb6da311ab428d1c7a3fc71dff7f9d4979b9"
"checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b"
"checksum log 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)" = "89f010e843f2b1a31dbd316b3b8d443758bc634bed37aabade59c686d644e0a2"
"checksum matches 0.1.6 (registry+https://github.com/rust-lang/crates.io-index)" = "100aabe6b8ff4e4a7e32c1c13523379802df0772b82466207ac25b013f193376"
@@ -1604,7 +1519,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum net2 0.2.31 (registry+https://github.com/rust-lang/crates.io-index)" = "3a80f842784ef6c9a958b68b7516bc7e35883c614004dd94959a4dca1b716c09"
"checksum nix 0.8.1 (registry+https://github.com/rust-lang/crates.io-index)" = "47e49f6982987135c5e9620ab317623e723bd06738fd85377e8d55f57c8b6487"
"checksum nix 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a2c5afeb0198ec7be8569d666644b574345aad2e95a53baf3a532da3e0f3fb32"
-"checksum nom 3.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "05aec50c70fd288702bcd93284a8444607f3292dbdf2a30de5ea5dcdbe72287b"
"checksum num 0.1.41 (registry+https://github.com/rust-lang/crates.io-index)" = "cc4083e14b542ea3eb9b5f33ff48bd373a92d78687e74f4cc0a30caeb754f0ca"
"checksum num-integer 0.1.35 (registry+https://github.com/rust-lang/crates.io-index)" = "d1452e8b06e448a07f0e6ebb0bb1d92b8890eea63288c0b627331d53514d0fba"
"checksum num-iter 0.1.34 (registry+https://github.com/rust-lang/crates.io-index)" = "7485fcc84f85b4ecd0ea527b14189281cf27d60e583ae65ebc9c088b13dffe01"
@@ -1618,7 +1532,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum owning_ref 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "cdf84f41639e037b484f93433aa3897863b561ed65c6e59c7073d7c561710f37"
"checksum parking_lot 0.4.8 (registry+https://github.com/rust-lang/crates.io-index)" = "149d8f5b97f3c1133e3cfcd8886449959e856b557ff281e292b733d7c69e005e"
"checksum parking_lot_core 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "9f35048d735bb93dd115a0030498785971aab3234d311fbe273d020084d26bd8"
-"checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099"
"checksum percent-encoding 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "31010dd2e1ac33d5b46a5b413495239882813e0369f8ed8a5e266f173602f831"
"checksum pfctl 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "926afe7bf541b9a8f6156272ebe4ad3d3a1bf6eb31303ac1a6ab13a706ea30f6"
"checksum pkg-config 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "3a8b4c6b8165cd1a1cd4b9b120978131389f64bdaf456435caa41e630edba903"
@@ -1653,8 +1566,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum strsim 0.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b4d15c810519a91cf877e7e36e63fe068815c678181439f2f29e2562147c3694"
"checksum syn 0.11.11 (registry+https://github.com/rust-lang/crates.io-index)" = "d3b891b9015c88c576343b9b3e41c2c11a51c219ef067b264bd9c8aa9b441dad"
"checksum synom 0.11.3 (registry+https://github.com/rust-lang/crates.io-index)" = "a393066ed9010ebaed60b9eafa373d4b1baac186dd7e008555b0f702b51945b6"
-"checksum system-configuration 0.1.0 (git+https://github.com/mullvad/system-configuration-rs)" = "<none>"
-"checksum system-configuration-sys 0.1.0 (git+https://github.com/mullvad/system-configuration-rs)" = "<none>"
+"checksum system-configuration 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "2646789845add5fa0adcbe7684cb89509ae98c404284471bf4f9faf995d88a58"
+"checksum system-configuration-sys 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "7d8b463ff8bb4585b46e3e23f44dd41b3f52d0ad09b6b9cf03aae55c74d74cff"
"checksum take 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b157868d8ac1f56b64604539990685fa7611d8fa9e5476cf0c02cf34d32917c5"
"checksum tempdir 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "87974a6f5c1dfb344d733055601650059a3363de2a6104819293baff662132d6"
"checksum termion 1.5.1 (registry+https://github.com/rust-lang/crates.io-index)" = "689a3bdfaab439fd92bc87df5c4c78417d3cbe537487274e9b0b2dce76e92096"
@@ -1680,7 +1593,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
"checksum vec_map 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "887b5b631c2ad01628bbbaa7dd4c869f80d3186688f8d0b6f58774fbe324988c"
"checksum version_check 0.1.3 (registry+https://github.com/rust-lang/crates.io-index)" = "6b772017e347561807c1aa192438c5fd74242a670a6cffacc40f2defd1dc069d"
"checksum void 1.0.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6a02e4885ed3bc0f2de90ea6dd45ebcbb66dacffe03547fadbb0eeae2770887d"
-"checksum which 1.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "4be6cfa54dab45266e98b5d7be2f8ce959ddd49abd141a05d52dce4b07f803bb"
"checksum winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)" = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a"
"checksum winapi 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "b09fb3b6f248ea4cd42c9a65113a847d612e17505d6ebd1f7357ad68a8bf8693"
"checksum winapi-build 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "2d315eee3b34aca4797b2da6b13ed88266e6d612562a0c46390af8299fc699bc"
diff --git a/talpid-core/Cargo.toml b/talpid-core/Cargo.toml
index 511647883b..e51a16c390 100644
--- a/talpid-core/Cargo.toml
+++ b/talpid-core/Cargo.toml
@@ -24,6 +24,6 @@ libc = "0.2.20"
[target.'cfg(target_os = "macos")'.dependencies]
pfctl = "0.1"
-system-configuration = { git = "https://github.com/mullvad/system-configuration-rs", version = "0.1.0" }
-core-foundation = "0.4.6"
+system-configuration = "0.1"
+core-foundation = "0.5"
tokio-core = "0.1"
diff --git a/talpid-core/src/firewall/macos/dns.rs b/talpid-core/src/firewall/macos/dns.rs
index 60141273ae..c9b7f415f3 100644
--- a/talpid-core/src/firewall/macos/dns.rs
+++ b/talpid-core/src/firewall/macos/dns.rs
@@ -1,11 +1,12 @@
extern crate core_foundation;
extern crate system_configuration;
-use self::core_foundation::array::{CFArray, CFArrayRef};
+use self::core_foundation::array::CFArray;
use self::core_foundation::base::{CFType, TCFType};
use self::core_foundation::dictionary::CFDictionary;
+use self::core_foundation::propertylist::CFPropertyList;
use self::core_foundation::runloop::{CFRunLoop, kCFRunLoopCommonModes};
-use self::core_foundation::string::{CFString, CFStringRef};
+use self::core_foundation::string::CFString;
use self::system_configuration::dynamic_store::{SCDynamicStore, SCDynamicStoreBuilder,
SCDynamicStoreCallBackContext};
@@ -178,11 +179,10 @@ fn dns_change_callback_internal(
None => {
trace!("Not injecting DNS at this time");
}
- Some(ref mut state) => for path_ptr in changed_keys.as_untyped().iter() {
- let path = unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) };
+ Some(ref mut state) => for path in changed_keys.iter() {
let should_set_dns = match read_dns(&store, path.clone()) {
None => {
- debug!("Detected DNS removed for {}", path);
+ debug!("Detected DNS removed for {}", *path);
state.backup.insert(path.to_string(), None);
true
}
@@ -190,7 +190,7 @@ fn dns_change_callback_internal(
debug!(
"Detected DNS changed to [{}] for {}",
servers.join(", "),
- path
+ *path
);
state.backup.insert(path.to_string(), Some(servers));
true
@@ -200,7 +200,7 @@ fn dns_change_callback_internal(
};
if should_set_dns {
set_dns(&store, path.clone(), &state.desired_dns)
- .chain_err(|| format!("Failed changing DNS for {}", path))?;
+ .chain_err(|| format!("Failed changing DNS for {}", *path))?;
// If we changed a state DNS, also set the corresponding setup DNS.
if let Some(setup_path_str) = state_to_setup_path(&path.to_string()) {
let setup_path = CFString::new(&setup_path_str);
@@ -230,7 +230,7 @@ fn set_dns(store: &SCDynamicStore, path: CFString, servers: &[DnsServer]) -> Res
let dns_dictionary =
CFDictionary::from_CFType_pairs(&[(server_addresses_key, server_addresses_value)]);
- if store.set(path, &dns_dictionary) {
+ if store.set(path, dns_dictionary) {
Ok(())
} else {
bail!(ErrorKind::SettingDnsFailed)
@@ -242,22 +242,20 @@ fn read_all_dns(store: &SCDynamicStore) -> HashMap<ServicePath, Option<Vec<DnsSe
let mut backup = HashMap::new();
// Backup all "state" DNS, and all corresponding "setup" DNS even if they don't exist
if let Some(paths) = store.get_keys(STATE_PATH_PATTERN) {
- for path_ptr in paths.as_untyped().iter() {
- let state_path = unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) };
+ for state_path in paths.iter() {
let state_path_str = state_path.to_string();
let setup_path_str = state_to_setup_path(&state_path_str).unwrap();
let setup_path = CFString::new(&setup_path_str);
- backup.insert(state_path_str, read_dns(store, state_path));
+ backup.insert(state_path_str, read_dns(store, state_path.clone()));
backup.insert(setup_path_str, read_dns(store, setup_path));
}
}
// Backup all "setup" DNS not already covered
if let Some(paths) = store.get_keys(SETUP_PATH_PATTERN) {
- for path_ptr in paths.as_untyped().iter() {
- let setup_path = unsafe { CFString::wrap_under_get_rule(path_ptr as CFStringRef) };
+ for setup_path in paths.iter() {
let setup_path_str = setup_path.to_string();
if !backup.contains_key(&setup_path_str) {
- backup.insert(setup_path_str, read_dns(store, setup_path));
+ backup.insert(setup_path_str, read_dns(store, setup_path.clone()));
}
}
}
@@ -277,36 +275,31 @@ fn state_to_setup_path(state_path: &str) -> Option<String> {
fn read_dns(store: &SCDynamicStore, path: CFString) -> Option<Vec<DnsServer>> {
store
.get(path.clone())
- .and_then(|property_list| property_list.downcast::<_, CFDictionary>())
+ .and_then(CFPropertyList::downcast_into::<CFDictionary>)
.and_then(|dictionary| {
dictionary
.find2(&CFString::from_static_string("ServerAddresses"))
.map(|array_ptr| unsafe { CFType::wrap_under_get_rule(array_ptr) })
})
- .and_then(|addresses: CFType| {
- if addresses.instance_of::<_, CFArray>() {
- let addresses_array = unsafe {
- CFArray::wrap_under_get_rule(addresses.as_concrete_TypeRef() as CFArrayRef)
- };
- parse_cf_string_array(addresses_array)
+ .and_then(|addresses| {
+ if let Some(array) = addresses.downcast::<CFArray<CFType>>() {
+ parse_cf_array_to_strings(array)
} else {
- error!("DNS settings is not an array: {:?}", addresses);
+ error!("DNS ServerAddresess is not an array: {:?}", addresses);
None
}
})
}
-/// Parses a CFArray into a Rust vector of Rust strings, if the array contains CFString instances,
-/// otherwise `None` is returned.
-fn parse_cf_string_array(array: CFArray) -> Option<Vec<String>> {
+/// Parses a CFArray into a Rust vector of Rust strings, if the array contains CFString instances
+/// only, otherwise `None` is returned.
+fn parse_cf_array_to_strings(array: CFArray<CFType>) -> Option<Vec<String>> {
let mut strings = Vec::new();
- for string_ptr in array.iter() {
- let cf_type = unsafe { CFType::wrap_under_get_rule(string_ptr) };
- if cf_type.instance_of::<_, CFString>() {
- let address = unsafe { CFString::wrap_under_get_rule(string_ptr as CFStringRef) };
- strings.push(address.to_string());
+ for item in array.iter() {
+ if let Some(string) = item.downcast::<CFString>() {
+ strings.push(string.to_string());
} else {
- error!("DNS server entry is not a string: {:?}", cf_type);
+ error!("DNS server entry is not a string: {:?}", item);
return None;
};
}