├── .github └── workflows │ ├── rust.yml │ └── semgrep.yml ├── .gitignore ├── Cargo.lock ├── Cargo.toml ├── LICENSE ├── README.md ├── src ├── config.rs ├── dns_utils.rs └── main.rs └── tests ├── config.toml └── integration_test.rs /.github/workflows/rust.yml: -------------------------------------------------------------------------------- 1 | name: Rust 2 | 3 | on: 4 | push: 5 | branches: [ master ] 6 | pull_request: 7 | branches: [ master ] 8 | 9 | env: 10 | CARGO_TERM_COLOR: always 11 | 12 | jobs: 13 | build: 14 | 15 | runs-on: ubuntu-latest 16 | 17 | steps: 18 | - uses: actions/checkout@v2 19 | - name: Formatting 20 | run: cargo fmt -- --check 21 | - name: Clippy 22 | run: cargo clippy -- -D warnings 23 | - name: Build 24 | run: cargo build --verbose 25 | - name: Run tests 26 | run: cargo test --verbose 27 | -------------------------------------------------------------------------------- /.github/workflows/semgrep.yml: -------------------------------------------------------------------------------- 1 | 2 | on: 3 | pull_request: {} 4 | workflow_dispatch: {} 5 | push: 6 | branches: 7 | - main 8 | - master 9 | schedule: 10 | - cron: '0 0 * * *' 11 | name: Semgrep config 12 | jobs: 13 | semgrep: 14 | name: semgrep/ci 15 | runs-on: ubuntu-20.04 16 | env: 17 | SEMGREP_APP_TOKEN: ${{ secrets.SEMGREP_APP_TOKEN }} 18 | SEMGREP_URL: https://cloudflare.semgrep.dev 19 | SEMGREP_APP_URL: https://cloudflare.semgrep.dev 20 | SEMGREP_VERSION_CHECK_URL: https://cloudflare.semgrep.dev/api/check-version 21 | container: 22 | image: returntocorp/semgrep 23 | steps: 24 | - uses: actions/checkout@v3 25 | - run: semgrep ci 26 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | /target 2 | -------------------------------------------------------------------------------- /Cargo.lock: -------------------------------------------------------------------------------- 1 | # This file is automatically @generated by Cargo. 2 | # It is not intended for manual editing. 3 | [[package]] 4 | name = "aead" 5 | version = "0.3.2" 6 | source = "registry+https://github.com/rust-lang/crates.io-index" 7 | checksum = "7fc95d1bdb8e6666b2b217308eeeb09f2d6728d104be3e31916cc74d15420331" 8 | dependencies = [ 9 | "generic-array", 10 | ] 11 | 12 | [[package]] 13 | name = "aes" 14 | version = "0.6.0" 15 | source = "registry+https://github.com/rust-lang/crates.io-index" 16 | checksum = "884391ef1066acaa41e766ba8f596341b96e93ce34f9a43e7d24bf0a0eaf0561" 17 | dependencies = [ 18 | "aes-soft", 19 | "aesni", 20 | "cipher", 21 | ] 22 | 23 | [[package]] 24 | name = "aes-gcm" 25 | version = "0.8.0" 26 | source = "registry+https://github.com/rust-lang/crates.io-index" 27 | checksum = "5278b5fabbb9bd46e24aa69b2fdea62c99088e0a950a9be40e3e0101298f88da" 28 | dependencies = [ 29 | "aead", 30 | "aes", 31 | "cipher", 32 | "ctr", 33 | "ghash", 34 | "subtle", 35 | ] 36 | 37 | [[package]] 38 | name = "aes-soft" 39 | version = "0.6.3" 40 | source = "registry+https://github.com/rust-lang/crates.io-index" 41 | checksum = "4e8bdbc97ba3854ecf597a3b69d7bd30a719dee72d22ce6313c84dbf2c8f2694" 42 | dependencies = [ 43 | "cipher", 44 | "opaque-debug", 45 | ] 46 | 47 | [[package]] 48 | name = "aesni" 49 | version = "0.10.0" 50 | source = "registry+https://github.com/rust-lang/crates.io-index" 51 | checksum = "ea2e11f5e94c2f7d386164cc2aa1f97823fed6f259e486940a71c174dd01b0ce" 52 | dependencies = [ 53 | "cipher", 54 | "opaque-debug", 55 | ] 56 | 57 | [[package]] 58 | name = "aho-corasick" 59 | version = "0.7.13" 60 | source = "registry+https://github.com/rust-lang/crates.io-index" 61 | checksum = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" 62 | dependencies = [ 63 | "memchr", 64 | ] 65 | 66 | [[package]] 67 | name = "ansi_term" 68 | version = "0.11.0" 69 | source = "registry+https://github.com/rust-lang/crates.io-index" 70 | checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" 71 | dependencies = [ 72 | "winapi", 73 | ] 74 | 75 | [[package]] 76 | name = "anyhow" 77 | version = "1.0.33" 78 | source = "registry+https://github.com/rust-lang/crates.io-index" 79 | checksum = "a1fd36ffbb1fb7c834eac128ea8d0e310c5aeb635548f9d58861e1308d46e71c" 80 | 81 | [[package]] 82 | name = "arc-swap" 83 | version = "0.4.7" 84 | source = "registry+https://github.com/rust-lang/crates.io-index" 85 | checksum = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" 86 | 87 | [[package]] 88 | name = "assert_cmd" 89 | version = "1.0.2" 90 | source = "registry+https://github.com/rust-lang/crates.io-index" 91 | checksum = "3dc1679af9a1ab4bea16f228b05d18f8363f8327b1fa8db00d2760cfafc6b61e" 92 | dependencies = [ 93 | "doc-comment", 94 | "predicates", 95 | "predicates-core", 96 | "predicates-tree", 97 | "wait-timeout", 98 | ] 99 | 100 | [[package]] 101 | name = "async-stream" 102 | version = "0.3.0" 103 | source = "registry+https://github.com/rust-lang/crates.io-index" 104 | checksum = "3670df70cbc01729f901f94c887814b3c68db038aad1329a418bae178bc5295c" 105 | dependencies = [ 106 | "async-stream-impl", 107 | "futures-core", 108 | ] 109 | 110 | [[package]] 111 | name = "async-stream-impl" 112 | version = "0.3.0" 113 | source = "registry+https://github.com/rust-lang/crates.io-index" 114 | checksum = "a3548b8efc9f8e8a5a0a2808c5bd8451a9031b9e5b879a79590304ae928b0a70" 115 | dependencies = [ 116 | "proc-macro2", 117 | "quote", 118 | "syn", 119 | ] 120 | 121 | [[package]] 122 | name = "async-trait" 123 | version = "0.1.41" 124 | source = "registry+https://github.com/rust-lang/crates.io-index" 125 | checksum = "b246867b8b3b6ae56035f1eb1ed557c1d8eae97f0d53696138a50fa0e3a3b8c0" 126 | dependencies = [ 127 | "proc-macro2", 128 | "quote", 129 | "syn", 130 | ] 131 | 132 | [[package]] 133 | name = "atty" 134 | version = "0.2.14" 135 | source = "registry+https://github.com/rust-lang/crates.io-index" 136 | checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" 137 | dependencies = [ 138 | "hermit-abi", 139 | "libc", 140 | "winapi", 141 | ] 142 | 143 | [[package]] 144 | name = "autocfg" 145 | version = "1.0.1" 146 | source = "registry+https://github.com/rust-lang/crates.io-index" 147 | checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" 148 | 149 | [[package]] 150 | name = "base-x" 151 | version = "0.2.6" 152 | source = "registry+https://github.com/rust-lang/crates.io-index" 153 | checksum = "1b20b618342cf9891c292c4f5ac2cde7287cc5c87e87e9c769d617793607dec1" 154 | 155 | [[package]] 156 | name = "base64" 157 | version = "0.13.0" 158 | source = "registry+https://github.com/rust-lang/crates.io-index" 159 | checksum = "904dfeac50f3cdaba28fc6f57fdcddb75f49ed61346676a78c4ffe55877802fd" 160 | 161 | [[package]] 162 | name = "bitflags" 163 | version = "1.2.1" 164 | source = "registry+https://github.com/rust-lang/crates.io-index" 165 | checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" 166 | 167 | [[package]] 168 | name = "bitvec" 169 | version = "0.18.4" 170 | source = "registry+https://github.com/rust-lang/crates.io-index" 171 | checksum = "1d2838fdd79e8776dbe07a106c784b0f8dda571a21b2750a092cc4cbaa653c8e" 172 | dependencies = [ 173 | "funty", 174 | "radium", 175 | "wyz", 176 | ] 177 | 178 | [[package]] 179 | name = "block-buffer" 180 | version = "0.9.0" 181 | source = "registry+https://github.com/rust-lang/crates.io-index" 182 | checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" 183 | dependencies = [ 184 | "generic-array", 185 | ] 186 | 187 | [[package]] 188 | name = "bumpalo" 189 | version = "3.4.0" 190 | source = "registry+https://github.com/rust-lang/crates.io-index" 191 | checksum = "2e8c087f005730276d1096a652e92a8bacee2e2472bcc9715a74d2bec38b5820" 192 | 193 | [[package]] 194 | name = "byteorder" 195 | version = "1.4.3" 196 | source = "registry+https://github.com/rust-lang/crates.io-index" 197 | checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" 198 | 199 | [[package]] 200 | name = "bytes" 201 | version = "0.5.6" 202 | source = "registry+https://github.com/rust-lang/crates.io-index" 203 | checksum = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" 204 | 205 | [[package]] 206 | name = "bytes" 207 | version = "1.0.1" 208 | source = "registry+https://github.com/rust-lang/crates.io-index" 209 | checksum = "b700ce4376041dcd0a327fd0097c41095743c4c8af8887265942faf1100bd040" 210 | 211 | [[package]] 212 | name = "cc" 213 | version = "1.0.60" 214 | source = "registry+https://github.com/rust-lang/crates.io-index" 215 | checksum = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" 216 | 217 | [[package]] 218 | name = "cfg-if" 219 | version = "0.1.10" 220 | source = "registry+https://github.com/rust-lang/crates.io-index" 221 | checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" 222 | 223 | [[package]] 224 | name = "cfg-if" 225 | version = "1.0.0" 226 | source = "registry+https://github.com/rust-lang/crates.io-index" 227 | checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" 228 | 229 | [[package]] 230 | name = "chacha20" 231 | version = "0.6.0" 232 | source = "registry+https://github.com/rust-lang/crates.io-index" 233 | checksum = "ed8738f14471a99f0e316c327e68fc82a3611cc2895fcb604b89eedaf8f39d95" 234 | dependencies = [ 235 | "cipher", 236 | "zeroize", 237 | ] 238 | 239 | [[package]] 240 | name = "chacha20poly1305" 241 | version = "0.7.1" 242 | source = "registry+https://github.com/rust-lang/crates.io-index" 243 | checksum = "af1fc18e6d90c40164bf6c317476f2a98f04661e310e79830366b7e914c58a8e" 244 | dependencies = [ 245 | "aead", 246 | "chacha20", 247 | "cipher", 248 | "poly1305", 249 | "zeroize", 250 | ] 251 | 252 | [[package]] 253 | name = "chrono" 254 | version = "0.4.19" 255 | source = "registry+https://github.com/rust-lang/crates.io-index" 256 | checksum = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" 257 | dependencies = [ 258 | "libc", 259 | "num-integer", 260 | "num-traits", 261 | "time 0.1.44", 262 | "winapi", 263 | ] 264 | 265 | [[package]] 266 | name = "cipher" 267 | version = "0.2.5" 268 | source = "registry+https://github.com/rust-lang/crates.io-index" 269 | checksum = "12f8e7987cbd042a63249497f41aed09f8e65add917ea6566effbc56578d6801" 270 | dependencies = [ 271 | "generic-array", 272 | ] 273 | 274 | [[package]] 275 | name = "clap" 276 | version = "2.33.3" 277 | source = "registry+https://github.com/rust-lang/crates.io-index" 278 | checksum = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" 279 | dependencies = [ 280 | "ansi_term", 281 | "atty", 282 | "bitflags", 283 | "strsim", 284 | "textwrap", 285 | "unicode-width", 286 | "vec_map", 287 | ] 288 | 289 | [[package]] 290 | name = "const_fn" 291 | version = "0.4.2" 292 | source = "registry+https://github.com/rust-lang/crates.io-index" 293 | checksum = "ce90df4c658c62f12d78f7508cf92f9173e5184a539c10bfe54a3107b3ffd0f2" 294 | 295 | [[package]] 296 | name = "cookie" 297 | version = "0.14.2" 298 | source = "registry+https://github.com/rust-lang/crates.io-index" 299 | checksum = "1373a16a4937bc34efec7b391f9c1500c30b8478a701a4f44c9165cc0475a6e0" 300 | dependencies = [ 301 | "percent-encoding", 302 | "time 0.2.22", 303 | "version_check", 304 | ] 305 | 306 | [[package]] 307 | name = "cookie_store" 308 | version = "0.12.0" 309 | source = "registry+https://github.com/rust-lang/crates.io-index" 310 | checksum = "3818dfca4b0cb5211a659bbcbb94225b7127407b2b135e650d717bfb78ab10d3" 311 | dependencies = [ 312 | "cookie", 313 | "idna", 314 | "log", 315 | "publicsuffix", 316 | "serde", 317 | "serde_json", 318 | "time 0.2.22", 319 | "url", 320 | ] 321 | 322 | [[package]] 323 | name = "core-foundation" 324 | version = "0.7.0" 325 | source = "registry+https://github.com/rust-lang/crates.io-index" 326 | checksum = "57d24c7a13c43e870e37c1556b74555437870a04514f7685f5b354e090567171" 327 | dependencies = [ 328 | "core-foundation-sys", 329 | "libc", 330 | ] 331 | 332 | [[package]] 333 | name = "core-foundation-sys" 334 | version = "0.7.0" 335 | source = "registry+https://github.com/rust-lang/crates.io-index" 336 | checksum = "b3a71ab494c0b5b860bdc8407ae08978052417070c2ced38573a9157ad75b8ac" 337 | 338 | [[package]] 339 | name = "cpuid-bool" 340 | version = "0.1.2" 341 | source = "registry+https://github.com/rust-lang/crates.io-index" 342 | checksum = "8aebca1129a03dc6dc2b127edd729435bbc4a37e1d5f4d7513165089ceb02634" 343 | 344 | [[package]] 345 | name = "crypto-mac" 346 | version = "0.10.0" 347 | source = "registry+https://github.com/rust-lang/crates.io-index" 348 | checksum = "4857fd85a0c34b3c3297875b747c1e02e06b6a0ea32dd892d8192b9ce0813ea6" 349 | dependencies = [ 350 | "generic-array", 351 | "subtle", 352 | ] 353 | 354 | [[package]] 355 | name = "ctr" 356 | version = "0.6.0" 357 | source = "registry+https://github.com/rust-lang/crates.io-index" 358 | checksum = "fb4a30d54f7443bf3d6191dcd486aca19e67cb3c49fa7a06a319966346707e7f" 359 | dependencies = [ 360 | "cipher", 361 | ] 362 | 363 | [[package]] 364 | name = "curve25519-dalek" 365 | version = "3.0.2" 366 | source = "registry+https://github.com/rust-lang/crates.io-index" 367 | checksum = "f627126b946c25a4638eec0ea634fc52506dea98db118aae985118ce7c3d723f" 368 | dependencies = [ 369 | "byteorder", 370 | "digest", 371 | "rand_core 0.5.1", 372 | "subtle", 373 | "zeroize", 374 | ] 375 | 376 | [[package]] 377 | name = "data-encoding" 378 | version = "2.3.0" 379 | source = "registry+https://github.com/rust-lang/crates.io-index" 380 | checksum = "d4d0e2d24e5ee3b23a01de38eefdcd978907890701f08ffffd4cb457ca4ee8d6" 381 | 382 | [[package]] 383 | name = "difference" 384 | version = "2.0.0" 385 | source = "registry+https://github.com/rust-lang/crates.io-index" 386 | checksum = "524cbf6897b527295dff137cec09ecf3a05f4fddffd7dfcd1585403449e74198" 387 | 388 | [[package]] 389 | name = "digest" 390 | version = "0.9.0" 391 | source = "registry+https://github.com/rust-lang/crates.io-index" 392 | checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" 393 | dependencies = [ 394 | "generic-array", 395 | ] 396 | 397 | [[package]] 398 | name = "discard" 399 | version = "1.0.4" 400 | source = "registry+https://github.com/rust-lang/crates.io-index" 401 | checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" 402 | 403 | [[package]] 404 | name = "doc-comment" 405 | version = "0.3.3" 406 | source = "registry+https://github.com/rust-lang/crates.io-index" 407 | checksum = "fea41bba32d969b513997752735605054bc0dfa92b4c56bf1189f2e174be7a10" 408 | 409 | [[package]] 410 | name = "elliptic-curve" 411 | version = "0.8.4" 412 | source = "registry+https://github.com/rust-lang/crates.io-index" 413 | checksum = "592b1c857559479c056b73a3053c717108a70e4dce320ad28c79c63f5c2e62ba" 414 | dependencies = [ 415 | "bitvec", 416 | "ff", 417 | "generic-array", 418 | "group", 419 | "rand_core 0.5.1", 420 | "subtle", 421 | "zeroize", 422 | ] 423 | 424 | [[package]] 425 | name = "encoding_rs" 426 | version = "0.8.24" 427 | source = "registry+https://github.com/rust-lang/crates.io-index" 428 | checksum = "a51b8cf747471cb9499b6d59e59b0444f4c90eba8968c4e44874e92b5b64ace2" 429 | dependencies = [ 430 | "cfg-if 0.1.10", 431 | ] 432 | 433 | [[package]] 434 | name = "endian-type" 435 | version = "0.1.2" 436 | source = "registry+https://github.com/rust-lang/crates.io-index" 437 | checksum = "c34f04666d835ff5d62e058c3995147c06f42fe86ff053337632bca83e42702d" 438 | 439 | [[package]] 440 | name = "enum-as-inner" 441 | version = "0.3.3" 442 | source = "registry+https://github.com/rust-lang/crates.io-index" 443 | checksum = "7c5f0096a91d210159eceb2ff5e1c4da18388a170e1e3ce948aac9c8fdbbf595" 444 | dependencies = [ 445 | "heck", 446 | "proc-macro2", 447 | "quote", 448 | "syn", 449 | ] 450 | 451 | [[package]] 452 | name = "error-chain" 453 | version = "0.12.4" 454 | source = "registry+https://github.com/rust-lang/crates.io-index" 455 | checksum = "2d2f06b9cac1506ece98fe3231e3cc9c4410ec3d5b1f24ae1c8946f0742cdefc" 456 | dependencies = [ 457 | "version_check", 458 | ] 459 | 460 | [[package]] 461 | name = "ff" 462 | version = "0.8.0" 463 | source = "registry+https://github.com/rust-lang/crates.io-index" 464 | checksum = "01646e077d4ebda82b73f1bca002ea1e91561a77df2431a9e79729bcc31950ef" 465 | dependencies = [ 466 | "bitvec", 467 | "rand_core 0.5.1", 468 | "subtle", 469 | ] 470 | 471 | [[package]] 472 | name = "fnv" 473 | version = "1.0.7" 474 | source = "registry+https://github.com/rust-lang/crates.io-index" 475 | checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" 476 | 477 | [[package]] 478 | name = "foreign-types" 479 | version = "0.3.2" 480 | source = "registry+https://github.com/rust-lang/crates.io-index" 481 | checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" 482 | dependencies = [ 483 | "foreign-types-shared", 484 | ] 485 | 486 | [[package]] 487 | name = "foreign-types-shared" 488 | version = "0.1.1" 489 | source = "registry+https://github.com/rust-lang/crates.io-index" 490 | checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" 491 | 492 | [[package]] 493 | name = "form_urlencoded" 494 | version = "1.0.0" 495 | source = "registry+https://github.com/rust-lang/crates.io-index" 496 | checksum = "ece68d15c92e84fa4f19d3780f1294e5ca82a78a6d515f1efaabcc144688be00" 497 | dependencies = [ 498 | "matches", 499 | "percent-encoding", 500 | ] 501 | 502 | [[package]] 503 | name = "funty" 504 | version = "1.1.0" 505 | source = "registry+https://github.com/rust-lang/crates.io-index" 506 | checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" 507 | 508 | [[package]] 509 | name = "futures" 510 | version = "0.3.6" 511 | source = "registry+https://github.com/rust-lang/crates.io-index" 512 | checksum = "5d8e3078b7b2a8a671cb7a3d17b4760e4181ea243227776ba83fd043b4ca034e" 513 | dependencies = [ 514 | "futures-channel", 515 | "futures-core", 516 | "futures-executor", 517 | "futures-io", 518 | "futures-sink", 519 | "futures-task", 520 | "futures-util", 521 | ] 522 | 523 | [[package]] 524 | name = "futures-channel" 525 | version = "0.3.6" 526 | source = "registry+https://github.com/rust-lang/crates.io-index" 527 | checksum = "a7a4d35f7401e948629c9c3d6638fb9bf94e0b2121e96c3b428cc4e631f3eb74" 528 | dependencies = [ 529 | "futures-core", 530 | "futures-sink", 531 | ] 532 | 533 | [[package]] 534 | name = "futures-core" 535 | version = "0.3.6" 536 | source = "registry+https://github.com/rust-lang/crates.io-index" 537 | checksum = "d674eaa0056896d5ada519900dbf97ead2e46a7b6621e8160d79e2f2e1e2784b" 538 | 539 | [[package]] 540 | name = "futures-executor" 541 | version = "0.3.6" 542 | source = "registry+https://github.com/rust-lang/crates.io-index" 543 | checksum = "cc709ca1da6f66143b8c9bec8e6260181869893714e9b5a490b169b0414144ab" 544 | dependencies = [ 545 | "futures-core", 546 | "futures-task", 547 | "futures-util", 548 | ] 549 | 550 | [[package]] 551 | name = "futures-io" 552 | version = "0.3.6" 553 | source = "registry+https://github.com/rust-lang/crates.io-index" 554 | checksum = "5fc94b64bb39543b4e432f1790b6bf18e3ee3b74653c5449f63310e9a74b123c" 555 | 556 | [[package]] 557 | name = "futures-macro" 558 | version = "0.3.7" 559 | source = "registry+https://github.com/rust-lang/crates.io-index" 560 | checksum = "e36fccf3fc58563b4a14d265027c627c3b665d7fed489427e88e7cc929559efe" 561 | dependencies = [ 562 | "proc-macro-hack", 563 | "proc-macro2", 564 | "quote", 565 | "syn", 566 | ] 567 | 568 | [[package]] 569 | name = "futures-sink" 570 | version = "0.3.6" 571 | source = "registry+https://github.com/rust-lang/crates.io-index" 572 | checksum = "0d8764258ed64ebc5d9ed185cf86a95db5cac810269c5d20ececb32e0088abbd" 573 | 574 | [[package]] 575 | name = "futures-task" 576 | version = "0.3.6" 577 | source = "registry+https://github.com/rust-lang/crates.io-index" 578 | checksum = "4dd26820a9f3637f1302da8bceba3ff33adbe53464b54ca24d4e2d4f1db30f94" 579 | dependencies = [ 580 | "once_cell", 581 | ] 582 | 583 | [[package]] 584 | name = "futures-util" 585 | version = "0.3.6" 586 | source = "registry+https://github.com/rust-lang/crates.io-index" 587 | checksum = "8a894a0acddba51a2d49a6f4263b1e64b8c579ece8af50fa86503d52cd1eea34" 588 | dependencies = [ 589 | "futures-channel", 590 | "futures-core", 591 | "futures-io", 592 | "futures-macro", 593 | "futures-sink", 594 | "futures-task", 595 | "memchr", 596 | "pin-project 0.4.26", 597 | "pin-utils", 598 | "proc-macro-hack", 599 | "proc-macro-nested", 600 | "slab", 601 | ] 602 | 603 | [[package]] 604 | name = "generic-array" 605 | version = "0.14.4" 606 | source = "registry+https://github.com/rust-lang/crates.io-index" 607 | checksum = "501466ecc8a30d1d3b7fc9229b122b2ce8ed6e9d9223f1138d4babb253e51817" 608 | dependencies = [ 609 | "typenum", 610 | "version_check", 611 | ] 612 | 613 | [[package]] 614 | name = "getrandom" 615 | version = "0.1.15" 616 | source = "registry+https://github.com/rust-lang/crates.io-index" 617 | checksum = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" 618 | dependencies = [ 619 | "cfg-if 0.1.10", 620 | "libc", 621 | "wasi 0.9.0+wasi-snapshot-preview1", 622 | ] 623 | 624 | [[package]] 625 | name = "getrandom" 626 | version = "0.2.2" 627 | source = "registry+https://github.com/rust-lang/crates.io-index" 628 | checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8" 629 | dependencies = [ 630 | "cfg-if 1.0.0", 631 | "libc", 632 | "wasi 0.10.0+wasi-snapshot-preview1", 633 | ] 634 | 635 | [[package]] 636 | name = "ghash" 637 | version = "0.3.0" 638 | source = "registry+https://github.com/rust-lang/crates.io-index" 639 | checksum = "d6e27f0689a6e15944bdce7e45425efb87eaa8ab0c6e87f11d0987a9133e2531" 640 | dependencies = [ 641 | "polyval", 642 | ] 643 | 644 | [[package]] 645 | name = "group" 646 | version = "0.8.0" 647 | source = "registry+https://github.com/rust-lang/crates.io-index" 648 | checksum = "cc11f9f5fbf1943b48ae7c2bf6846e7d827a512d1be4f23af708f5ca5d01dde1" 649 | dependencies = [ 650 | "ff", 651 | "rand_core 0.5.1", 652 | "subtle", 653 | ] 654 | 655 | [[package]] 656 | name = "h2" 657 | version = "0.3.0" 658 | source = "registry+https://github.com/rust-lang/crates.io-index" 659 | checksum = "6b67e66362108efccd8ac053abafc8b7a8d86a37e6e48fc4f6f7485eb5e9e6a5" 660 | dependencies = [ 661 | "bytes 1.0.1", 662 | "fnv", 663 | "futures-core", 664 | "futures-sink", 665 | "futures-util", 666 | "http", 667 | "indexmap", 668 | "slab", 669 | "tokio", 670 | "tokio-util", 671 | "tracing", 672 | "tracing-futures", 673 | ] 674 | 675 | [[package]] 676 | name = "hashbrown" 677 | version = "0.9.1" 678 | source = "registry+https://github.com/rust-lang/crates.io-index" 679 | checksum = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" 680 | 681 | [[package]] 682 | name = "heck" 683 | version = "0.3.1" 684 | source = "registry+https://github.com/rust-lang/crates.io-index" 685 | checksum = "20564e78d53d2bb135c343b3f47714a56af2061f1c928fdb541dc7b9fdd94205" 686 | dependencies = [ 687 | "unicode-segmentation", 688 | ] 689 | 690 | [[package]] 691 | name = "hermit-abi" 692 | version = "0.1.17" 693 | source = "registry+https://github.com/rust-lang/crates.io-index" 694 | checksum = "5aca5565f760fb5b220e499d72710ed156fdb74e631659e99377d9ebfbd13ae8" 695 | dependencies = [ 696 | "libc", 697 | ] 698 | 699 | [[package]] 700 | name = "hex" 701 | version = "0.4.2" 702 | source = "registry+https://github.com/rust-lang/crates.io-index" 703 | checksum = "644f9158b2f133fd50f5fb3242878846d9eb792e445c893805ff0e3824006e35" 704 | 705 | [[package]] 706 | name = "hkdf" 707 | version = "0.10.0" 708 | source = "registry+https://github.com/rust-lang/crates.io-index" 709 | checksum = "51ab2f639c231793c5f6114bdb9bbe50a7dbbfcd7c7c6bd8475dec2d991e964f" 710 | dependencies = [ 711 | "digest", 712 | "hmac", 713 | ] 714 | 715 | [[package]] 716 | name = "hmac" 717 | version = "0.10.1" 718 | source = "registry+https://github.com/rust-lang/crates.io-index" 719 | checksum = "c1441c6b1e930e2817404b5046f1f989899143a12bf92de603b69f4e0aee1e15" 720 | dependencies = [ 721 | "crypto-mac", 722 | "digest", 723 | ] 724 | 725 | [[package]] 726 | name = "hpke" 727 | version = "0.5.1" 728 | source = "registry+https://github.com/rust-lang/crates.io-index" 729 | checksum = "dee10a1b0e80de6480856bcd0addb21dd0f52c982c7809bde53754b7c1a9d74d" 730 | dependencies = [ 731 | "aead", 732 | "aes-gcm", 733 | "byteorder", 734 | "chacha20poly1305", 735 | "digest", 736 | "generic-array", 737 | "hkdf", 738 | "p256", 739 | "rand 0.8.3", 740 | "sha2", 741 | "subtle", 742 | "x25519-dalek", 743 | "zeroize", 744 | ] 745 | 746 | [[package]] 747 | name = "http" 748 | version = "0.2.1" 749 | source = "registry+https://github.com/rust-lang/crates.io-index" 750 | checksum = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" 751 | dependencies = [ 752 | "bytes 0.5.6", 753 | "fnv", 754 | "itoa", 755 | ] 756 | 757 | [[package]] 758 | name = "http-body" 759 | version = "0.4.0" 760 | source = "registry+https://github.com/rust-lang/crates.io-index" 761 | checksum = "2861bd27ee074e5ee891e8b539837a9430012e249d7f0ca2d795650f579c1994" 762 | dependencies = [ 763 | "bytes 1.0.1", 764 | "http", 765 | ] 766 | 767 | [[package]] 768 | name = "httparse" 769 | version = "1.3.4" 770 | source = "registry+https://github.com/rust-lang/crates.io-index" 771 | checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" 772 | 773 | [[package]] 774 | name = "httpdate" 775 | version = "0.3.2" 776 | source = "registry+https://github.com/rust-lang/crates.io-index" 777 | checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" 778 | 779 | [[package]] 780 | name = "hyper" 781 | version = "0.14.2" 782 | source = "registry+https://github.com/rust-lang/crates.io-index" 783 | checksum = "12219dc884514cb4a6a03737f4413c0e01c23a1b059b0156004b23f1e19dccbe" 784 | dependencies = [ 785 | "bytes 1.0.1", 786 | "futures-channel", 787 | "futures-core", 788 | "futures-util", 789 | "h2", 790 | "http", 791 | "http-body", 792 | "httparse", 793 | "httpdate", 794 | "itoa", 795 | "pin-project 1.0.4", 796 | "socket2", 797 | "tokio", 798 | "tower-service", 799 | "tracing", 800 | "want", 801 | ] 802 | 803 | [[package]] 804 | name = "hyper-tls" 805 | version = "0.5.0" 806 | source = "registry+https://github.com/rust-lang/crates.io-index" 807 | checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" 808 | dependencies = [ 809 | "bytes 1.0.1", 810 | "hyper", 811 | "native-tls", 812 | "tokio", 813 | "tokio-native-tls", 814 | ] 815 | 816 | [[package]] 817 | name = "idna" 818 | version = "0.2.0" 819 | source = "registry+https://github.com/rust-lang/crates.io-index" 820 | checksum = "02e2673c30ee86b5b96a9cb52ad15718aa1f966f5ab9ad54a8b95d5ca33120a9" 821 | dependencies = [ 822 | "matches", 823 | "unicode-bidi", 824 | "unicode-normalization", 825 | ] 826 | 827 | [[package]] 828 | name = "indexmap" 829 | version = "1.6.0" 830 | source = "registry+https://github.com/rust-lang/crates.io-index" 831 | checksum = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" 832 | dependencies = [ 833 | "autocfg", 834 | "hashbrown", 835 | ] 836 | 837 | [[package]] 838 | name = "instant" 839 | version = "0.1.9" 840 | source = "registry+https://github.com/rust-lang/crates.io-index" 841 | checksum = "61124eeebbd69b8190558df225adf7e4caafce0d743919e5d6b19652314ec5ec" 842 | dependencies = [ 843 | "cfg-if 1.0.0", 844 | ] 845 | 846 | [[package]] 847 | name = "ipnet" 848 | version = "2.3.0" 849 | source = "registry+https://github.com/rust-lang/crates.io-index" 850 | checksum = "47be2f14c678be2fdcab04ab1171db51b2762ce6f0a8ee87c8dd4a04ed216135" 851 | 852 | [[package]] 853 | name = "itoa" 854 | version = "0.4.6" 855 | source = "registry+https://github.com/rust-lang/crates.io-index" 856 | checksum = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" 857 | 858 | [[package]] 859 | name = "js-sys" 860 | version = "0.3.45" 861 | source = "registry+https://github.com/rust-lang/crates.io-index" 862 | checksum = "ca059e81d9486668f12d455a4ea6daa600bd408134cd17e3d3fb5a32d1f016f8" 863 | dependencies = [ 864 | "wasm-bindgen", 865 | ] 866 | 867 | [[package]] 868 | name = "lazy_static" 869 | version = "1.4.0" 870 | source = "registry+https://github.com/rust-lang/crates.io-index" 871 | checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" 872 | 873 | [[package]] 874 | name = "libc" 875 | version = "0.2.82" 876 | source = "registry+https://github.com/rust-lang/crates.io-index" 877 | checksum = "89203f3fba0a3795506acaad8ebce3c80c0af93f994d5a1d7a0b1eeb23271929" 878 | 879 | [[package]] 880 | name = "lock_api" 881 | version = "0.4.2" 882 | source = "registry+https://github.com/rust-lang/crates.io-index" 883 | checksum = "dd96ffd135b2fd7b973ac026d28085defbe8983df057ced3eb4f2130b0831312" 884 | dependencies = [ 885 | "scopeguard", 886 | ] 887 | 888 | [[package]] 889 | name = "log" 890 | version = "0.4.11" 891 | source = "registry+https://github.com/rust-lang/crates.io-index" 892 | checksum = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" 893 | dependencies = [ 894 | "cfg-if 0.1.10", 895 | ] 896 | 897 | [[package]] 898 | name = "matches" 899 | version = "0.1.8" 900 | source = "registry+https://github.com/rust-lang/crates.io-index" 901 | checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" 902 | 903 | [[package]] 904 | name = "memchr" 905 | version = "2.3.3" 906 | source = "registry+https://github.com/rust-lang/crates.io-index" 907 | checksum = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" 908 | 909 | [[package]] 910 | name = "mime" 911 | version = "0.3.16" 912 | source = "registry+https://github.com/rust-lang/crates.io-index" 913 | checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" 914 | 915 | [[package]] 916 | name = "mio" 917 | version = "0.7.7" 918 | source = "registry+https://github.com/rust-lang/crates.io-index" 919 | checksum = "e50ae3f04d169fcc9bde0b547d1c205219b7157e07ded9c5aff03e0637cb3ed7" 920 | dependencies = [ 921 | "libc", 922 | "log", 923 | "miow", 924 | "ntapi", 925 | "winapi", 926 | ] 927 | 928 | [[package]] 929 | name = "miow" 930 | version = "0.3.6" 931 | source = "registry+https://github.com/rust-lang/crates.io-index" 932 | checksum = "5a33c1b55807fbed163481b5ba66db4b2fa6cde694a5027be10fb724206c5897" 933 | dependencies = [ 934 | "socket2", 935 | "winapi", 936 | ] 937 | 938 | [[package]] 939 | name = "native-tls" 940 | version = "0.2.4" 941 | source = "registry+https://github.com/rust-lang/crates.io-index" 942 | checksum = "2b0d88c06fe90d5ee94048ba40409ef1d9315d86f6f38c2efdaad4fb50c58b2d" 943 | dependencies = [ 944 | "lazy_static", 945 | "libc", 946 | "log", 947 | "openssl", 948 | "openssl-probe", 949 | "openssl-sys", 950 | "schannel", 951 | "security-framework", 952 | "security-framework-sys", 953 | "tempfile", 954 | ] 955 | 956 | [[package]] 957 | name = "nibble_vec" 958 | version = "0.1.0" 959 | source = "registry+https://github.com/rust-lang/crates.io-index" 960 | checksum = "77a5d83df9f36fe23f0c3648c6bbb8b0298bb5f1939c8f2704431371f4b84d43" 961 | dependencies = [ 962 | "smallvec", 963 | ] 964 | 965 | [[package]] 966 | name = "ntapi" 967 | version = "0.3.6" 968 | source = "registry+https://github.com/rust-lang/crates.io-index" 969 | checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44" 970 | dependencies = [ 971 | "winapi", 972 | ] 973 | 974 | [[package]] 975 | name = "num-integer" 976 | version = "0.1.43" 977 | source = "registry+https://github.com/rust-lang/crates.io-index" 978 | checksum = "8d59457e662d541ba17869cf51cf177c0b5f0cbf476c66bdc90bf1edac4f875b" 979 | dependencies = [ 980 | "autocfg", 981 | "num-traits", 982 | ] 983 | 984 | [[package]] 985 | name = "num-traits" 986 | version = "0.2.12" 987 | source = "registry+https://github.com/rust-lang/crates.io-index" 988 | checksum = "ac267bcc07f48ee5f8935ab0d24f316fb722d7a1292e2913f0cc196b29ffd611" 989 | dependencies = [ 990 | "autocfg", 991 | ] 992 | 993 | [[package]] 994 | name = "num_cpus" 995 | version = "1.13.0" 996 | source = "registry+https://github.com/rust-lang/crates.io-index" 997 | checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" 998 | dependencies = [ 999 | "hermit-abi", 1000 | "libc", 1001 | ] 1002 | 1003 | [[package]] 1004 | name = "odoh-client-rs" 1005 | version = "1.0.0" 1006 | dependencies = [ 1007 | "anyhow", 1008 | "assert_cmd", 1009 | "clap", 1010 | "futures", 1011 | "hex", 1012 | "lazy_static", 1013 | "odoh-rs", 1014 | "rand 0.8.3", 1015 | "regex", 1016 | "reqwest", 1017 | "serde", 1018 | "tokio", 1019 | "toml", 1020 | "trust-dns-client", 1021 | "trust-dns-proto", 1022 | "url", 1023 | ] 1024 | 1025 | [[package]] 1026 | name = "odoh-rs" 1027 | version = "1.0.0-alpha.1" 1028 | source = "registry+https://github.com/rust-lang/crates.io-index" 1029 | checksum = "9fa43633ab3b53ce1faae165041fc715625bcb7bf5162bd59a102cfaeb1db413" 1030 | dependencies = [ 1031 | "aes-gcm", 1032 | "bytes 1.0.1", 1033 | "hkdf", 1034 | "hpke", 1035 | "rand 0.8.3", 1036 | "thiserror", 1037 | ] 1038 | 1039 | [[package]] 1040 | name = "once_cell" 1041 | version = "1.5.2" 1042 | source = "registry+https://github.com/rust-lang/crates.io-index" 1043 | checksum = "13bd41f508810a131401606d54ac32a467c97172d74ba7662562ebba5ad07fa0" 1044 | 1045 | [[package]] 1046 | name = "opaque-debug" 1047 | version = "0.3.0" 1048 | source = "registry+https://github.com/rust-lang/crates.io-index" 1049 | checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" 1050 | 1051 | [[package]] 1052 | name = "openssl" 1053 | version = "0.10.30" 1054 | source = "registry+https://github.com/rust-lang/crates.io-index" 1055 | checksum = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" 1056 | dependencies = [ 1057 | "bitflags", 1058 | "cfg-if 0.1.10", 1059 | "foreign-types", 1060 | "lazy_static", 1061 | "libc", 1062 | "openssl-sys", 1063 | ] 1064 | 1065 | [[package]] 1066 | name = "openssl-probe" 1067 | version = "0.1.2" 1068 | source = "registry+https://github.com/rust-lang/crates.io-index" 1069 | checksum = "77af24da69f9d9341038eba93a073b1fdaaa1b788221b00a69bce9e762cb32de" 1070 | 1071 | [[package]] 1072 | name = "openssl-sys" 1073 | version = "0.9.58" 1074 | source = "registry+https://github.com/rust-lang/crates.io-index" 1075 | checksum = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" 1076 | dependencies = [ 1077 | "autocfg", 1078 | "cc", 1079 | "libc", 1080 | "pkg-config", 1081 | "vcpkg", 1082 | ] 1083 | 1084 | [[package]] 1085 | name = "p256" 1086 | version = "0.7.2" 1087 | source = "registry+https://github.com/rust-lang/crates.io-index" 1088 | checksum = "7ca0196a204bb3f33305ba4a48b38f6e6e621cba8603a4e0650e6532e0949de4" 1089 | dependencies = [ 1090 | "elliptic-curve", 1091 | ] 1092 | 1093 | [[package]] 1094 | name = "parking_lot" 1095 | version = "0.11.1" 1096 | source = "registry+https://github.com/rust-lang/crates.io-index" 1097 | checksum = "6d7744ac029df22dca6284efe4e898991d28e3085c706c972bcd7da4a27a15eb" 1098 | dependencies = [ 1099 | "instant", 1100 | "lock_api", 1101 | "parking_lot_core", 1102 | ] 1103 | 1104 | [[package]] 1105 | name = "parking_lot_core" 1106 | version = "0.8.2" 1107 | source = "registry+https://github.com/rust-lang/crates.io-index" 1108 | checksum = "9ccb628cad4f84851442432c60ad8e1f607e29752d0bf072cbd0baf28aa34272" 1109 | dependencies = [ 1110 | "cfg-if 1.0.0", 1111 | "instant", 1112 | "libc", 1113 | "redox_syscall", 1114 | "smallvec", 1115 | "winapi", 1116 | ] 1117 | 1118 | [[package]] 1119 | name = "percent-encoding" 1120 | version = "2.1.0" 1121 | source = "registry+https://github.com/rust-lang/crates.io-index" 1122 | checksum = "d4fd5641d01c8f18a23da7b6fe29298ff4b55afcccdf78973b24cf3175fee32e" 1123 | 1124 | [[package]] 1125 | name = "pin-project" 1126 | version = "0.4.26" 1127 | source = "registry+https://github.com/rust-lang/crates.io-index" 1128 | checksum = "13fbdfd6bdee3dc9be46452f86af4a4072975899cf8592466668620bebfbcc17" 1129 | dependencies = [ 1130 | "pin-project-internal 0.4.26", 1131 | ] 1132 | 1133 | [[package]] 1134 | name = "pin-project" 1135 | version = "1.0.4" 1136 | source = "registry+https://github.com/rust-lang/crates.io-index" 1137 | checksum = "95b70b68509f17aa2857863b6fa00bf21fc93674c7a8893de2f469f6aa7ca2f2" 1138 | dependencies = [ 1139 | "pin-project-internal 1.0.4", 1140 | ] 1141 | 1142 | [[package]] 1143 | name = "pin-project-internal" 1144 | version = "0.4.26" 1145 | source = "registry+https://github.com/rust-lang/crates.io-index" 1146 | checksum = "c82fb1329f632c3552cf352d14427d57a511b1cf41db93b3a7d77906a82dcc8e" 1147 | dependencies = [ 1148 | "proc-macro2", 1149 | "quote", 1150 | "syn", 1151 | ] 1152 | 1153 | [[package]] 1154 | name = "pin-project-internal" 1155 | version = "1.0.4" 1156 | source = "registry+https://github.com/rust-lang/crates.io-index" 1157 | checksum = "caa25a6393f22ce819b0f50e0be89287292fda8d425be38ee0ca14c4931d9e71" 1158 | dependencies = [ 1159 | "proc-macro2", 1160 | "quote", 1161 | "syn", 1162 | ] 1163 | 1164 | [[package]] 1165 | name = "pin-project-lite" 1166 | version = "0.1.10" 1167 | source = "registry+https://github.com/rust-lang/crates.io-index" 1168 | checksum = "e555d9e657502182ac97b539fb3dae8b79cda19e3e4f8ffb5e8de4f18df93c95" 1169 | 1170 | [[package]] 1171 | name = "pin-project-lite" 1172 | version = "0.2.4" 1173 | source = "registry+https://github.com/rust-lang/crates.io-index" 1174 | checksum = "439697af366c49a6d0a010c56a0d97685bc140ce0d377b13a2ea2aa42d64a827" 1175 | 1176 | [[package]] 1177 | name = "pin-utils" 1178 | version = "0.1.0" 1179 | source = "registry+https://github.com/rust-lang/crates.io-index" 1180 | checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" 1181 | 1182 | [[package]] 1183 | name = "pkg-config" 1184 | version = "0.3.18" 1185 | source = "registry+https://github.com/rust-lang/crates.io-index" 1186 | checksum = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" 1187 | 1188 | [[package]] 1189 | name = "poly1305" 1190 | version = "0.6.1" 1191 | source = "registry+https://github.com/rust-lang/crates.io-index" 1192 | checksum = "22ce46de8e53ee414ca4d02bfefac75d8c12fba948b76622a40b4be34dfce980" 1193 | dependencies = [ 1194 | "universal-hash", 1195 | ] 1196 | 1197 | [[package]] 1198 | name = "polyval" 1199 | version = "0.4.1" 1200 | source = "registry+https://github.com/rust-lang/crates.io-index" 1201 | checksum = "a5884790f1ce3553ad55fec37b5aaac5882e0e845a2612df744d6c85c9bf046c" 1202 | dependencies = [ 1203 | "cfg-if 0.1.10", 1204 | "universal-hash", 1205 | ] 1206 | 1207 | [[package]] 1208 | name = "ppv-lite86" 1209 | version = "0.2.9" 1210 | source = "registry+https://github.com/rust-lang/crates.io-index" 1211 | checksum = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" 1212 | 1213 | [[package]] 1214 | name = "predicates" 1215 | version = "1.0.5" 1216 | source = "registry+https://github.com/rust-lang/crates.io-index" 1217 | checksum = "96bfead12e90dccead362d62bb2c90a5f6fc4584963645bc7f71a735e0b0735a" 1218 | dependencies = [ 1219 | "difference", 1220 | "predicates-core", 1221 | ] 1222 | 1223 | [[package]] 1224 | name = "predicates-core" 1225 | version = "1.0.0" 1226 | source = "registry+https://github.com/rust-lang/crates.io-index" 1227 | checksum = "06075c3a3e92559ff8929e7a280684489ea27fe44805174c3ebd9328dcb37178" 1228 | 1229 | [[package]] 1230 | name = "predicates-tree" 1231 | version = "1.0.0" 1232 | source = "registry+https://github.com/rust-lang/crates.io-index" 1233 | checksum = "8e63c4859013b38a76eca2414c64911fba30def9e3202ac461a2d22831220124" 1234 | dependencies = [ 1235 | "predicates-core", 1236 | "treeline", 1237 | ] 1238 | 1239 | [[package]] 1240 | name = "proc-macro-hack" 1241 | version = "0.5.18" 1242 | source = "registry+https://github.com/rust-lang/crates.io-index" 1243 | checksum = "99c605b9a0adc77b7211c6b1f722dcb613d68d66859a44f3d485a6da332b0598" 1244 | 1245 | [[package]] 1246 | name = "proc-macro-nested" 1247 | version = "0.1.6" 1248 | source = "registry+https://github.com/rust-lang/crates.io-index" 1249 | checksum = "eba180dafb9038b050a4c280019bbedf9f2467b61e5d892dcad585bb57aadc5a" 1250 | 1251 | [[package]] 1252 | name = "proc-macro2" 1253 | version = "1.0.24" 1254 | source = "registry+https://github.com/rust-lang/crates.io-index" 1255 | checksum = "1e0704ee1a7e00d7bb417d0770ea303c1bccbabf0ef1667dae92b5967f5f8a71" 1256 | dependencies = [ 1257 | "unicode-xid", 1258 | ] 1259 | 1260 | [[package]] 1261 | name = "publicsuffix" 1262 | version = "1.5.4" 1263 | source = "registry+https://github.com/rust-lang/crates.io-index" 1264 | checksum = "3bbaa49075179162b49acac1c6aa45fb4dafb5f13cf6794276d77bc7fd95757b" 1265 | dependencies = [ 1266 | "error-chain", 1267 | "idna", 1268 | "lazy_static", 1269 | "regex", 1270 | "url", 1271 | ] 1272 | 1273 | [[package]] 1274 | name = "quote" 1275 | version = "1.0.7" 1276 | source = "registry+https://github.com/rust-lang/crates.io-index" 1277 | checksum = "aa563d17ecb180e500da1cfd2b028310ac758de548efdd203e18f283af693f37" 1278 | dependencies = [ 1279 | "proc-macro2", 1280 | ] 1281 | 1282 | [[package]] 1283 | name = "radium" 1284 | version = "0.4.1" 1285 | source = "registry+https://github.com/rust-lang/crates.io-index" 1286 | checksum = "64de9a0c5361e034f1aefc9f71a86871ec870e766fe31a009734a989b329286a" 1287 | 1288 | [[package]] 1289 | name = "radix_trie" 1290 | version = "0.2.1" 1291 | source = "registry+https://github.com/rust-lang/crates.io-index" 1292 | checksum = "c069c179fcdc6a2fe24d8d18305cf085fdbd4f922c041943e203685d6a1c58fd" 1293 | dependencies = [ 1294 | "endian-type", 1295 | "nibble_vec", 1296 | ] 1297 | 1298 | [[package]] 1299 | name = "rand" 1300 | version = "0.7.3" 1301 | source = "registry+https://github.com/rust-lang/crates.io-index" 1302 | checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" 1303 | dependencies = [ 1304 | "getrandom 0.1.15", 1305 | "libc", 1306 | "rand_chacha 0.2.2", 1307 | "rand_core 0.5.1", 1308 | "rand_hc 0.2.0", 1309 | ] 1310 | 1311 | [[package]] 1312 | name = "rand" 1313 | version = "0.8.3" 1314 | source = "registry+https://github.com/rust-lang/crates.io-index" 1315 | checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e" 1316 | dependencies = [ 1317 | "libc", 1318 | "rand_chacha 0.3.0", 1319 | "rand_core 0.6.1", 1320 | "rand_hc 0.3.0", 1321 | ] 1322 | 1323 | [[package]] 1324 | name = "rand_chacha" 1325 | version = "0.2.2" 1326 | source = "registry+https://github.com/rust-lang/crates.io-index" 1327 | checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" 1328 | dependencies = [ 1329 | "ppv-lite86", 1330 | "rand_core 0.5.1", 1331 | ] 1332 | 1333 | [[package]] 1334 | name = "rand_chacha" 1335 | version = "0.3.0" 1336 | source = "registry+https://github.com/rust-lang/crates.io-index" 1337 | checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d" 1338 | dependencies = [ 1339 | "ppv-lite86", 1340 | "rand_core 0.6.1", 1341 | ] 1342 | 1343 | [[package]] 1344 | name = "rand_core" 1345 | version = "0.5.1" 1346 | source = "registry+https://github.com/rust-lang/crates.io-index" 1347 | checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" 1348 | dependencies = [ 1349 | "getrandom 0.1.15", 1350 | ] 1351 | 1352 | [[package]] 1353 | name = "rand_core" 1354 | version = "0.6.1" 1355 | source = "registry+https://github.com/rust-lang/crates.io-index" 1356 | checksum = "c026d7df8b298d90ccbbc5190bd04d85e159eaf5576caeacf8741da93ccbd2e5" 1357 | dependencies = [ 1358 | "getrandom 0.2.2", 1359 | ] 1360 | 1361 | [[package]] 1362 | name = "rand_hc" 1363 | version = "0.2.0" 1364 | source = "registry+https://github.com/rust-lang/crates.io-index" 1365 | checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" 1366 | dependencies = [ 1367 | "rand_core 0.5.1", 1368 | ] 1369 | 1370 | [[package]] 1371 | name = "rand_hc" 1372 | version = "0.3.0" 1373 | source = "registry+https://github.com/rust-lang/crates.io-index" 1374 | checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73" 1375 | dependencies = [ 1376 | "rand_core 0.6.1", 1377 | ] 1378 | 1379 | [[package]] 1380 | name = "redox_syscall" 1381 | version = "0.1.57" 1382 | source = "registry+https://github.com/rust-lang/crates.io-index" 1383 | checksum = "41cc0f7e4d5d4544e8861606a285bb08d3e70712ccc7d2b84d7c0ccfaf4b05ce" 1384 | 1385 | [[package]] 1386 | name = "regex" 1387 | version = "1.3.9" 1388 | source = "registry+https://github.com/rust-lang/crates.io-index" 1389 | checksum = "9c3780fcf44b193bc4d09f36d2a3c87b251da4a046c87795a0d35f4f927ad8e6" 1390 | dependencies = [ 1391 | "aho-corasick", 1392 | "memchr", 1393 | "regex-syntax", 1394 | "thread_local", 1395 | ] 1396 | 1397 | [[package]] 1398 | name = "regex-syntax" 1399 | version = "0.6.18" 1400 | source = "registry+https://github.com/rust-lang/crates.io-index" 1401 | checksum = "26412eb97c6b088a6997e05f69403a802a92d520de2f8e63c2b65f9e0f47c4e8" 1402 | 1403 | [[package]] 1404 | name = "remove_dir_all" 1405 | version = "0.5.3" 1406 | source = "registry+https://github.com/rust-lang/crates.io-index" 1407 | checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" 1408 | dependencies = [ 1409 | "winapi", 1410 | ] 1411 | 1412 | [[package]] 1413 | name = "reqwest" 1414 | version = "0.11.0" 1415 | source = "registry+https://github.com/rust-lang/crates.io-index" 1416 | checksum = "fd281b1030aa675fb90aa994d07187645bb3c8fc756ca766e7c3070b439de9de" 1417 | dependencies = [ 1418 | "base64", 1419 | "bytes 1.0.1", 1420 | "cookie", 1421 | "cookie_store", 1422 | "encoding_rs", 1423 | "futures-core", 1424 | "futures-util", 1425 | "http", 1426 | "http-body", 1427 | "hyper", 1428 | "hyper-tls", 1429 | "ipnet", 1430 | "js-sys", 1431 | "lazy_static", 1432 | "log", 1433 | "mime", 1434 | "native-tls", 1435 | "percent-encoding", 1436 | "pin-project-lite 0.2.4", 1437 | "serde", 1438 | "serde_urlencoded", 1439 | "time 0.2.22", 1440 | "tokio", 1441 | "tokio-native-tls", 1442 | "url", 1443 | "wasm-bindgen", 1444 | "wasm-bindgen-futures", 1445 | "web-sys", 1446 | "winreg", 1447 | ] 1448 | 1449 | [[package]] 1450 | name = "rustc_version" 1451 | version = "0.2.3" 1452 | source = "registry+https://github.com/rust-lang/crates.io-index" 1453 | checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" 1454 | dependencies = [ 1455 | "semver", 1456 | ] 1457 | 1458 | [[package]] 1459 | name = "ryu" 1460 | version = "1.0.5" 1461 | source = "registry+https://github.com/rust-lang/crates.io-index" 1462 | checksum = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" 1463 | 1464 | [[package]] 1465 | name = "schannel" 1466 | version = "0.1.19" 1467 | source = "registry+https://github.com/rust-lang/crates.io-index" 1468 | checksum = "8f05ba609c234e60bee0d547fe94a4c7e9da733d1c962cf6e59efa4cd9c8bc75" 1469 | dependencies = [ 1470 | "lazy_static", 1471 | "winapi", 1472 | ] 1473 | 1474 | [[package]] 1475 | name = "scopeguard" 1476 | version = "1.1.0" 1477 | source = "registry+https://github.com/rust-lang/crates.io-index" 1478 | checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" 1479 | 1480 | [[package]] 1481 | name = "security-framework" 1482 | version = "0.4.4" 1483 | source = "registry+https://github.com/rust-lang/crates.io-index" 1484 | checksum = "64808902d7d99f78eaddd2b4e2509713babc3dc3c85ad6f4c447680f3c01e535" 1485 | dependencies = [ 1486 | "bitflags", 1487 | "core-foundation", 1488 | "core-foundation-sys", 1489 | "libc", 1490 | "security-framework-sys", 1491 | ] 1492 | 1493 | [[package]] 1494 | name = "security-framework-sys" 1495 | version = "0.4.3" 1496 | source = "registry+https://github.com/rust-lang/crates.io-index" 1497 | checksum = "17bf11d99252f512695eb468de5516e5cf75455521e69dfe343f3b74e4748405" 1498 | dependencies = [ 1499 | "core-foundation-sys", 1500 | "libc", 1501 | ] 1502 | 1503 | [[package]] 1504 | name = "semver" 1505 | version = "0.9.0" 1506 | source = "registry+https://github.com/rust-lang/crates.io-index" 1507 | checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" 1508 | dependencies = [ 1509 | "semver-parser", 1510 | ] 1511 | 1512 | [[package]] 1513 | name = "semver-parser" 1514 | version = "0.7.0" 1515 | source = "registry+https://github.com/rust-lang/crates.io-index" 1516 | checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" 1517 | 1518 | [[package]] 1519 | name = "serde" 1520 | version = "1.0.116" 1521 | source = "registry+https://github.com/rust-lang/crates.io-index" 1522 | checksum = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5" 1523 | dependencies = [ 1524 | "serde_derive", 1525 | ] 1526 | 1527 | [[package]] 1528 | name = "serde_derive" 1529 | version = "1.0.116" 1530 | source = "registry+https://github.com/rust-lang/crates.io-index" 1531 | checksum = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8" 1532 | dependencies = [ 1533 | "proc-macro2", 1534 | "quote", 1535 | "syn", 1536 | ] 1537 | 1538 | [[package]] 1539 | name = "serde_json" 1540 | version = "1.0.58" 1541 | source = "registry+https://github.com/rust-lang/crates.io-index" 1542 | checksum = "a230ea9107ca2220eea9d46de97eddcb04cd00e92d13dda78e478dd33fa82bd4" 1543 | dependencies = [ 1544 | "itoa", 1545 | "ryu", 1546 | "serde", 1547 | ] 1548 | 1549 | [[package]] 1550 | name = "serde_urlencoded" 1551 | version = "0.7.0" 1552 | source = "registry+https://github.com/rust-lang/crates.io-index" 1553 | checksum = "edfa57a7f8d9c1d260a549e7224100f6c43d43f9103e06dd8b4095a9b2b43ce9" 1554 | dependencies = [ 1555 | "form_urlencoded", 1556 | "itoa", 1557 | "ryu", 1558 | "serde", 1559 | ] 1560 | 1561 | [[package]] 1562 | name = "sha1" 1563 | version = "0.6.0" 1564 | source = "registry+https://github.com/rust-lang/crates.io-index" 1565 | checksum = "2579985fda508104f7587689507983eadd6a6e84dd35d6d115361f530916fa0d" 1566 | 1567 | [[package]] 1568 | name = "sha2" 1569 | version = "0.9.1" 1570 | source = "registry+https://github.com/rust-lang/crates.io-index" 1571 | checksum = "2933378ddfeda7ea26f48c555bdad8bb446bf8a3d17832dc83e380d444cfb8c1" 1572 | dependencies = [ 1573 | "block-buffer", 1574 | "cfg-if 0.1.10", 1575 | "cpuid-bool", 1576 | "digest", 1577 | "opaque-debug", 1578 | ] 1579 | 1580 | [[package]] 1581 | name = "signal-hook-registry" 1582 | version = "1.2.1" 1583 | source = "registry+https://github.com/rust-lang/crates.io-index" 1584 | checksum = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" 1585 | dependencies = [ 1586 | "arc-swap", 1587 | "libc", 1588 | ] 1589 | 1590 | [[package]] 1591 | name = "slab" 1592 | version = "0.4.2" 1593 | source = "registry+https://github.com/rust-lang/crates.io-index" 1594 | checksum = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" 1595 | 1596 | [[package]] 1597 | name = "smallvec" 1598 | version = "1.6.1" 1599 | source = "registry+https://github.com/rust-lang/crates.io-index" 1600 | checksum = "fe0f37c9e8f3c5a4a66ad655a93c74daac4ad00c441533bf5c6e7990bb42604e" 1601 | 1602 | [[package]] 1603 | name = "socket2" 1604 | version = "0.3.19" 1605 | source = "registry+https://github.com/rust-lang/crates.io-index" 1606 | checksum = "122e570113d28d773067fab24266b66753f6ea915758651696b6e35e49f88d6e" 1607 | dependencies = [ 1608 | "cfg-if 1.0.0", 1609 | "libc", 1610 | "winapi", 1611 | ] 1612 | 1613 | [[package]] 1614 | name = "standback" 1615 | version = "0.2.11" 1616 | source = "registry+https://github.com/rust-lang/crates.io-index" 1617 | checksum = "f4e0831040d2cf2bdfd51b844be71885783d489898a192f254ae25d57cce725c" 1618 | dependencies = [ 1619 | "version_check", 1620 | ] 1621 | 1622 | [[package]] 1623 | name = "stdweb" 1624 | version = "0.4.20" 1625 | source = "registry+https://github.com/rust-lang/crates.io-index" 1626 | checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" 1627 | dependencies = [ 1628 | "discard", 1629 | "rustc_version", 1630 | "stdweb-derive", 1631 | "stdweb-internal-macros", 1632 | "stdweb-internal-runtime", 1633 | "wasm-bindgen", 1634 | ] 1635 | 1636 | [[package]] 1637 | name = "stdweb-derive" 1638 | version = "0.5.3" 1639 | source = "registry+https://github.com/rust-lang/crates.io-index" 1640 | checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" 1641 | dependencies = [ 1642 | "proc-macro2", 1643 | "quote", 1644 | "serde", 1645 | "serde_derive", 1646 | "syn", 1647 | ] 1648 | 1649 | [[package]] 1650 | name = "stdweb-internal-macros" 1651 | version = "0.2.9" 1652 | source = "registry+https://github.com/rust-lang/crates.io-index" 1653 | checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" 1654 | dependencies = [ 1655 | "base-x", 1656 | "proc-macro2", 1657 | "quote", 1658 | "serde", 1659 | "serde_derive", 1660 | "serde_json", 1661 | "sha1", 1662 | "syn", 1663 | ] 1664 | 1665 | [[package]] 1666 | name = "stdweb-internal-runtime" 1667 | version = "0.1.5" 1668 | source = "registry+https://github.com/rust-lang/crates.io-index" 1669 | checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" 1670 | 1671 | [[package]] 1672 | name = "strsim" 1673 | version = "0.8.0" 1674 | source = "registry+https://github.com/rust-lang/crates.io-index" 1675 | checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" 1676 | 1677 | [[package]] 1678 | name = "subtle" 1679 | version = "2.4.0" 1680 | source = "registry+https://github.com/rust-lang/crates.io-index" 1681 | checksum = "1e81da0851ada1f3e9d4312c704aa4f8806f0f9d69faaf8df2f3464b4a9437c2" 1682 | 1683 | [[package]] 1684 | name = "syn" 1685 | version = "1.0.60" 1686 | source = "registry+https://github.com/rust-lang/crates.io-index" 1687 | checksum = "c700597eca8a5a762beb35753ef6b94df201c81cca676604f547495a0d7f0081" 1688 | dependencies = [ 1689 | "proc-macro2", 1690 | "quote", 1691 | "unicode-xid", 1692 | ] 1693 | 1694 | [[package]] 1695 | name = "synstructure" 1696 | version = "0.12.4" 1697 | source = "registry+https://github.com/rust-lang/crates.io-index" 1698 | checksum = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" 1699 | dependencies = [ 1700 | "proc-macro2", 1701 | "quote", 1702 | "syn", 1703 | "unicode-xid", 1704 | ] 1705 | 1706 | [[package]] 1707 | name = "tempfile" 1708 | version = "3.1.0" 1709 | source = "registry+https://github.com/rust-lang/crates.io-index" 1710 | checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" 1711 | dependencies = [ 1712 | "cfg-if 0.1.10", 1713 | "libc", 1714 | "rand 0.7.3", 1715 | "redox_syscall", 1716 | "remove_dir_all", 1717 | "winapi", 1718 | ] 1719 | 1720 | [[package]] 1721 | name = "textwrap" 1722 | version = "0.11.0" 1723 | source = "registry+https://github.com/rust-lang/crates.io-index" 1724 | checksum = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" 1725 | dependencies = [ 1726 | "unicode-width", 1727 | ] 1728 | 1729 | [[package]] 1730 | name = "thiserror" 1731 | version = "1.0.21" 1732 | source = "registry+https://github.com/rust-lang/crates.io-index" 1733 | checksum = "318234ffa22e0920fe9a40d7b8369b5f649d490980cf7aadcf1eb91594869b42" 1734 | dependencies = [ 1735 | "thiserror-impl", 1736 | ] 1737 | 1738 | [[package]] 1739 | name = "thiserror-impl" 1740 | version = "1.0.21" 1741 | source = "registry+https://github.com/rust-lang/crates.io-index" 1742 | checksum = "cae2447b6282786c3493999f40a9be2a6ad20cb8bd268b0a0dbf5a065535c0ab" 1743 | dependencies = [ 1744 | "proc-macro2", 1745 | "quote", 1746 | "syn", 1747 | ] 1748 | 1749 | [[package]] 1750 | name = "thread_local" 1751 | version = "1.0.1" 1752 | source = "registry+https://github.com/rust-lang/crates.io-index" 1753 | checksum = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" 1754 | dependencies = [ 1755 | "lazy_static", 1756 | ] 1757 | 1758 | [[package]] 1759 | name = "time" 1760 | version = "0.1.44" 1761 | source = "registry+https://github.com/rust-lang/crates.io-index" 1762 | checksum = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" 1763 | dependencies = [ 1764 | "libc", 1765 | "wasi 0.10.0+wasi-snapshot-preview1", 1766 | "winapi", 1767 | ] 1768 | 1769 | [[package]] 1770 | name = "time" 1771 | version = "0.2.22" 1772 | source = "registry+https://github.com/rust-lang/crates.io-index" 1773 | checksum = "55b7151c9065e80917fbf285d9a5d1432f60db41d170ccafc749a136b41a93af" 1774 | dependencies = [ 1775 | "const_fn", 1776 | "libc", 1777 | "standback", 1778 | "stdweb", 1779 | "time-macros", 1780 | "version_check", 1781 | "winapi", 1782 | ] 1783 | 1784 | [[package]] 1785 | name = "time-macros" 1786 | version = "0.1.1" 1787 | source = "registry+https://github.com/rust-lang/crates.io-index" 1788 | checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" 1789 | dependencies = [ 1790 | "proc-macro-hack", 1791 | "time-macros-impl", 1792 | ] 1793 | 1794 | [[package]] 1795 | name = "time-macros-impl" 1796 | version = "0.1.1" 1797 | source = "registry+https://github.com/rust-lang/crates.io-index" 1798 | checksum = "e5c3be1edfad6027c69f5491cf4cb310d1a71ecd6af742788c6ff8bced86b8fa" 1799 | dependencies = [ 1800 | "proc-macro-hack", 1801 | "proc-macro2", 1802 | "quote", 1803 | "standback", 1804 | "syn", 1805 | ] 1806 | 1807 | [[package]] 1808 | name = "tinyvec" 1809 | version = "0.3.4" 1810 | source = "registry+https://github.com/rust-lang/crates.io-index" 1811 | checksum = "238ce071d267c5710f9d31451efec16c5ee22de34df17cc05e56cbc92e967117" 1812 | 1813 | [[package]] 1814 | name = "tinyvec" 1815 | version = "1.2.0" 1816 | source = "registry+https://github.com/rust-lang/crates.io-index" 1817 | checksum = "5b5220f05bb7de7f3f53c7c065e1199b3172696fe2db9f9c4d8ad9b4ee74c342" 1818 | dependencies = [ 1819 | "tinyvec_macros", 1820 | ] 1821 | 1822 | [[package]] 1823 | name = "tinyvec_macros" 1824 | version = "0.1.0" 1825 | source = "registry+https://github.com/rust-lang/crates.io-index" 1826 | checksum = "cda74da7e1a664f795bb1f8a87ec406fb89a02522cf6e50620d016add6dbbf5c" 1827 | 1828 | [[package]] 1829 | name = "tokio" 1830 | version = "1.1.0" 1831 | source = "registry+https://github.com/rust-lang/crates.io-index" 1832 | checksum = "8efab2086f17abcddb8f756117665c958feee6b2e39974c2f1600592ab3a4195" 1833 | dependencies = [ 1834 | "autocfg", 1835 | "bytes 1.0.1", 1836 | "libc", 1837 | "memchr", 1838 | "mio", 1839 | "num_cpus", 1840 | "once_cell", 1841 | "parking_lot", 1842 | "pin-project-lite 0.2.4", 1843 | "signal-hook-registry", 1844 | "tokio-macros", 1845 | "winapi", 1846 | ] 1847 | 1848 | [[package]] 1849 | name = "tokio-macros" 1850 | version = "1.0.0" 1851 | source = "registry+https://github.com/rust-lang/crates.io-index" 1852 | checksum = "42517d2975ca3114b22a16192634e8241dc5cc1f130be194645970cc1c371494" 1853 | dependencies = [ 1854 | "proc-macro2", 1855 | "quote", 1856 | "syn", 1857 | ] 1858 | 1859 | [[package]] 1860 | name = "tokio-native-tls" 1861 | version = "0.3.0" 1862 | source = "registry+https://github.com/rust-lang/crates.io-index" 1863 | checksum = "f7d995660bd2b7f8c1568414c1126076c13fbb725c40112dc0120b78eb9b717b" 1864 | dependencies = [ 1865 | "native-tls", 1866 | "tokio", 1867 | ] 1868 | 1869 | [[package]] 1870 | name = "tokio-stream" 1871 | version = "0.1.2" 1872 | source = "registry+https://github.com/rust-lang/crates.io-index" 1873 | checksum = "76066865172052eb8796c686f0b441a93df8b08d40a950b062ffb9a426f00edd" 1874 | dependencies = [ 1875 | "futures-core", 1876 | "pin-project-lite 0.2.4", 1877 | "tokio", 1878 | ] 1879 | 1880 | [[package]] 1881 | name = "tokio-util" 1882 | version = "0.6.2" 1883 | source = "registry+https://github.com/rust-lang/crates.io-index" 1884 | checksum = "feb971a26599ffd28066d387f109746df178eff14d5ea1e235015c5601967a4b" 1885 | dependencies = [ 1886 | "async-stream", 1887 | "bytes 1.0.1", 1888 | "futures-core", 1889 | "futures-sink", 1890 | "log", 1891 | "pin-project-lite 0.2.4", 1892 | "tokio", 1893 | "tokio-stream", 1894 | ] 1895 | 1896 | [[package]] 1897 | name = "toml" 1898 | version = "0.5.6" 1899 | source = "registry+https://github.com/rust-lang/crates.io-index" 1900 | checksum = "ffc92d160b1eef40665be3a05630d003936a3bc7da7421277846c2613e92c71a" 1901 | dependencies = [ 1902 | "serde", 1903 | ] 1904 | 1905 | [[package]] 1906 | name = "tower-service" 1907 | version = "0.3.0" 1908 | source = "registry+https://github.com/rust-lang/crates.io-index" 1909 | checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" 1910 | 1911 | [[package]] 1912 | name = "tracing" 1913 | version = "0.1.21" 1914 | source = "registry+https://github.com/rust-lang/crates.io-index" 1915 | checksum = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27" 1916 | dependencies = [ 1917 | "cfg-if 0.1.10", 1918 | "pin-project-lite 0.1.10", 1919 | "tracing-core", 1920 | ] 1921 | 1922 | [[package]] 1923 | name = "tracing-core" 1924 | version = "0.1.17" 1925 | source = "registry+https://github.com/rust-lang/crates.io-index" 1926 | checksum = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" 1927 | dependencies = [ 1928 | "lazy_static", 1929 | ] 1930 | 1931 | [[package]] 1932 | name = "tracing-futures" 1933 | version = "0.2.4" 1934 | source = "registry+https://github.com/rust-lang/crates.io-index" 1935 | checksum = "ab7bb6f14721aa00656086e9335d363c5c8747bae02ebe32ea2c7dece5689b4c" 1936 | dependencies = [ 1937 | "pin-project 0.4.26", 1938 | "tracing", 1939 | ] 1940 | 1941 | [[package]] 1942 | name = "treeline" 1943 | version = "0.1.0" 1944 | source = "registry+https://github.com/rust-lang/crates.io-index" 1945 | checksum = "a7f741b240f1a48843f9b8e0444fb55fb2a4ff67293b50a9179dfd5ea67f8d41" 1946 | 1947 | [[package]] 1948 | name = "trust-dns-client" 1949 | version = "0.20.1" 1950 | source = "registry+https://github.com/rust-lang/crates.io-index" 1951 | checksum = "87b05ceb7459ea5c9242da2b92cc221b65b2849d4ff3c19313485ce468c62096" 1952 | dependencies = [ 1953 | "cfg-if 1.0.0", 1954 | "chrono", 1955 | "data-encoding", 1956 | "futures-channel", 1957 | "futures-util", 1958 | "lazy_static", 1959 | "log", 1960 | "radix_trie", 1961 | "rand 0.8.3", 1962 | "thiserror", 1963 | "tokio", 1964 | "trust-dns-proto", 1965 | ] 1966 | 1967 | [[package]] 1968 | name = "trust-dns-proto" 1969 | version = "0.20.1" 1970 | source = "registry+https://github.com/rust-lang/crates.io-index" 1971 | checksum = "8d57e219ba600dd96c2f6d82eb79645068e14edbc5c7e27514af40436b88150c" 1972 | dependencies = [ 1973 | "async-trait", 1974 | "cfg-if 1.0.0", 1975 | "data-encoding", 1976 | "enum-as-inner", 1977 | "futures-channel", 1978 | "futures-io", 1979 | "futures-util", 1980 | "idna", 1981 | "ipnet", 1982 | "lazy_static", 1983 | "log", 1984 | "rand 0.8.3", 1985 | "smallvec", 1986 | "thiserror", 1987 | "tinyvec 1.2.0", 1988 | "tokio", 1989 | "url", 1990 | ] 1991 | 1992 | [[package]] 1993 | name = "try-lock" 1994 | version = "0.2.3" 1995 | source = "registry+https://github.com/rust-lang/crates.io-index" 1996 | checksum = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" 1997 | 1998 | [[package]] 1999 | name = "typenum" 2000 | version = "1.12.0" 2001 | source = "registry+https://github.com/rust-lang/crates.io-index" 2002 | checksum = "373c8a200f9e67a0c95e62a4f52fbf80c23b4381c05a17845531982fa99e6b33" 2003 | 2004 | [[package]] 2005 | name = "unicode-bidi" 2006 | version = "0.3.4" 2007 | source = "registry+https://github.com/rust-lang/crates.io-index" 2008 | checksum = "49f2bd0c6468a8230e1db229cff8029217cf623c767ea5d60bfbd42729ea54d5" 2009 | dependencies = [ 2010 | "matches", 2011 | ] 2012 | 2013 | [[package]] 2014 | name = "unicode-normalization" 2015 | version = "0.1.13" 2016 | source = "registry+https://github.com/rust-lang/crates.io-index" 2017 | checksum = "6fb19cf769fa8c6a80a162df694621ebeb4dafb606470b2b2fce0be40a98a977" 2018 | dependencies = [ 2019 | "tinyvec 0.3.4", 2020 | ] 2021 | 2022 | [[package]] 2023 | name = "unicode-segmentation" 2024 | version = "1.6.0" 2025 | source = "registry+https://github.com/rust-lang/crates.io-index" 2026 | checksum = "e83e153d1053cbb5a118eeff7fd5be06ed99153f00dbcd8ae310c5fb2b22edc0" 2027 | 2028 | [[package]] 2029 | name = "unicode-width" 2030 | version = "0.1.8" 2031 | source = "registry+https://github.com/rust-lang/crates.io-index" 2032 | checksum = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" 2033 | 2034 | [[package]] 2035 | name = "unicode-xid" 2036 | version = "0.2.1" 2037 | source = "registry+https://github.com/rust-lang/crates.io-index" 2038 | checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" 2039 | 2040 | [[package]] 2041 | name = "universal-hash" 2042 | version = "0.4.0" 2043 | source = "registry+https://github.com/rust-lang/crates.io-index" 2044 | checksum = "8326b2c654932e3e4f9196e69d08fdf7cfd718e1dc6f66b347e6024a0c961402" 2045 | dependencies = [ 2046 | "generic-array", 2047 | "subtle", 2048 | ] 2049 | 2050 | [[package]] 2051 | name = "url" 2052 | version = "2.2.0" 2053 | source = "registry+https://github.com/rust-lang/crates.io-index" 2054 | checksum = "5909f2b0817350449ed73e8bcd81c8c3c8d9a7a5d8acba4b27db277f1868976e" 2055 | dependencies = [ 2056 | "form_urlencoded", 2057 | "idna", 2058 | "matches", 2059 | "percent-encoding", 2060 | ] 2061 | 2062 | [[package]] 2063 | name = "vcpkg" 2064 | version = "0.2.10" 2065 | source = "registry+https://github.com/rust-lang/crates.io-index" 2066 | checksum = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" 2067 | 2068 | [[package]] 2069 | name = "vec_map" 2070 | version = "0.8.2" 2071 | source = "registry+https://github.com/rust-lang/crates.io-index" 2072 | checksum = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" 2073 | 2074 | [[package]] 2075 | name = "version_check" 2076 | version = "0.9.2" 2077 | source = "registry+https://github.com/rust-lang/crates.io-index" 2078 | checksum = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" 2079 | 2080 | [[package]] 2081 | name = "wait-timeout" 2082 | version = "0.2.0" 2083 | source = "registry+https://github.com/rust-lang/crates.io-index" 2084 | checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" 2085 | dependencies = [ 2086 | "libc", 2087 | ] 2088 | 2089 | [[package]] 2090 | name = "want" 2091 | version = "0.3.0" 2092 | source = "registry+https://github.com/rust-lang/crates.io-index" 2093 | checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" 2094 | dependencies = [ 2095 | "log", 2096 | "try-lock", 2097 | ] 2098 | 2099 | [[package]] 2100 | name = "wasi" 2101 | version = "0.9.0+wasi-snapshot-preview1" 2102 | source = "registry+https://github.com/rust-lang/crates.io-index" 2103 | checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" 2104 | 2105 | [[package]] 2106 | name = "wasi" 2107 | version = "0.10.0+wasi-snapshot-preview1" 2108 | source = "registry+https://github.com/rust-lang/crates.io-index" 2109 | checksum = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" 2110 | 2111 | [[package]] 2112 | name = "wasm-bindgen" 2113 | version = "0.2.68" 2114 | source = "registry+https://github.com/rust-lang/crates.io-index" 2115 | checksum = "1ac64ead5ea5f05873d7c12b545865ca2b8d28adfc50a49b84770a3a97265d42" 2116 | dependencies = [ 2117 | "cfg-if 0.1.10", 2118 | "serde", 2119 | "serde_json", 2120 | "wasm-bindgen-macro", 2121 | ] 2122 | 2123 | [[package]] 2124 | name = "wasm-bindgen-backend" 2125 | version = "0.2.68" 2126 | source = "registry+https://github.com/rust-lang/crates.io-index" 2127 | checksum = "f22b422e2a757c35a73774860af8e112bff612ce6cb604224e8e47641a9e4f68" 2128 | dependencies = [ 2129 | "bumpalo", 2130 | "lazy_static", 2131 | "log", 2132 | "proc-macro2", 2133 | "quote", 2134 | "syn", 2135 | "wasm-bindgen-shared", 2136 | ] 2137 | 2138 | [[package]] 2139 | name = "wasm-bindgen-futures" 2140 | version = "0.4.18" 2141 | source = "registry+https://github.com/rust-lang/crates.io-index" 2142 | checksum = "b7866cab0aa01de1edf8b5d7936938a7e397ee50ce24119aef3e1eaa3b6171da" 2143 | dependencies = [ 2144 | "cfg-if 0.1.10", 2145 | "js-sys", 2146 | "wasm-bindgen", 2147 | "web-sys", 2148 | ] 2149 | 2150 | [[package]] 2151 | name = "wasm-bindgen-macro" 2152 | version = "0.2.68" 2153 | source = "registry+https://github.com/rust-lang/crates.io-index" 2154 | checksum = "6b13312a745c08c469f0b292dd2fcd6411dba5f7160f593da6ef69b64e407038" 2155 | dependencies = [ 2156 | "quote", 2157 | "wasm-bindgen-macro-support", 2158 | ] 2159 | 2160 | [[package]] 2161 | name = "wasm-bindgen-macro-support" 2162 | version = "0.2.68" 2163 | source = "registry+https://github.com/rust-lang/crates.io-index" 2164 | checksum = "f249f06ef7ee334cc3b8ff031bfc11ec99d00f34d86da7498396dc1e3b1498fe" 2165 | dependencies = [ 2166 | "proc-macro2", 2167 | "quote", 2168 | "syn", 2169 | "wasm-bindgen-backend", 2170 | "wasm-bindgen-shared", 2171 | ] 2172 | 2173 | [[package]] 2174 | name = "wasm-bindgen-shared" 2175 | version = "0.2.68" 2176 | source = "registry+https://github.com/rust-lang/crates.io-index" 2177 | checksum = "1d649a3145108d7d3fbcde896a468d1bd636791823c9921135218ad89be08307" 2178 | 2179 | [[package]] 2180 | name = "web-sys" 2181 | version = "0.3.45" 2182 | source = "registry+https://github.com/rust-lang/crates.io-index" 2183 | checksum = "4bf6ef87ad7ae8008e15a355ce696bed26012b7caa21605188cfd8214ab51e2d" 2184 | dependencies = [ 2185 | "js-sys", 2186 | "wasm-bindgen", 2187 | ] 2188 | 2189 | [[package]] 2190 | name = "winapi" 2191 | version = "0.3.9" 2192 | source = "registry+https://github.com/rust-lang/crates.io-index" 2193 | checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" 2194 | dependencies = [ 2195 | "winapi-i686-pc-windows-gnu", 2196 | "winapi-x86_64-pc-windows-gnu", 2197 | ] 2198 | 2199 | [[package]] 2200 | name = "winapi-i686-pc-windows-gnu" 2201 | version = "0.4.0" 2202 | source = "registry+https://github.com/rust-lang/crates.io-index" 2203 | checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" 2204 | 2205 | [[package]] 2206 | name = "winapi-x86_64-pc-windows-gnu" 2207 | version = "0.4.0" 2208 | source = "registry+https://github.com/rust-lang/crates.io-index" 2209 | checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" 2210 | 2211 | [[package]] 2212 | name = "winreg" 2213 | version = "0.7.0" 2214 | source = "registry+https://github.com/rust-lang/crates.io-index" 2215 | checksum = "0120db82e8a1e0b9fb3345a539c478767c0048d842860994d96113d5b667bd69" 2216 | dependencies = [ 2217 | "winapi", 2218 | ] 2219 | 2220 | [[package]] 2221 | name = "wyz" 2222 | version = "0.2.0" 2223 | source = "registry+https://github.com/rust-lang/crates.io-index" 2224 | checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" 2225 | 2226 | [[package]] 2227 | name = "x25519-dalek" 2228 | version = "1.1.0" 2229 | source = "registry+https://github.com/rust-lang/crates.io-index" 2230 | checksum = "bc614d95359fd7afc321b66d2107ede58b246b844cf5d8a0adcca413e439f088" 2231 | dependencies = [ 2232 | "curve25519-dalek", 2233 | "rand_core 0.5.1", 2234 | "zeroize", 2235 | ] 2236 | 2237 | [[package]] 2238 | name = "zeroize" 2239 | version = "1.2.0" 2240 | source = "registry+https://github.com/rust-lang/crates.io-index" 2241 | checksum = "81a974bcdd357f0dca4d41677db03436324d45a4c9ed2d0b873a5a360ce41c36" 2242 | dependencies = [ 2243 | "zeroize_derive", 2244 | ] 2245 | 2246 | [[package]] 2247 | name = "zeroize_derive" 2248 | version = "1.0.1" 2249 | source = "registry+https://github.com/rust-lang/crates.io-index" 2250 | checksum = "c3f369ddb18862aba61aa49bf31e74d29f0f162dec753063200e1dc084345d16" 2251 | dependencies = [ 2252 | "proc-macro2", 2253 | "quote", 2254 | "syn", 2255 | "synstructure", 2256 | ] 2257 | -------------------------------------------------------------------------------- /Cargo.toml: -------------------------------------------------------------------------------- 1 | [package] 2 | name = "odoh-client-rs" 3 | version = "1.0.0" 4 | authors = [ "Tanya Verma " ] 5 | edition = "2018" 6 | license = "BSD-2-Clause" 7 | description = "Rust client for Oblivious DNS over HTTPS (ODoH) protocol version 1" 8 | repository = "https://github.com/cloudflare/odoh-client-rs/" 9 | keywords = [ "odoh", "protocols", "dns", "doh", "privacy" ] 10 | categories = [ "network-programming", "cryptography" ] 11 | 12 | [dependencies] 13 | anyhow = "1" 14 | clap = "2.33" 15 | futures = "0.3" 16 | hex = "0.4" 17 | lazy_static = "1.4" 18 | odoh-rs = "=1.0.0-alpha.1" 19 | rand = { version = "0.8", features = [ "std_rng" ], default-features = false } 20 | regex = "1" 21 | reqwest = { version = "0.11", features = [ "cookies" ] } 22 | serde = { version = "1.0", features = [ "derive" ] } 23 | tokio = { version = "1", features = [ "full" ] } 24 | toml = "0.5" 25 | trust-dns-client = "0.20.1" 26 | trust-dns-proto = "0.20.1" 27 | url = "2.2" 28 | 29 | [dev-dependencies] 30 | assert_cmd = "1" 31 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | BSD 2-Clause License 2 | 3 | Copyright (c) 2020, Cloudflare, Inc. 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | 1. Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | 2. Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 17 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 18 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 19 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 20 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 21 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 22 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 23 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 24 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 25 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 26 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # odoh-client-rs 2 | 3 | [![Latest Version]][crates.io] 4 | 5 | [Latest Version]: https://img.shields.io/crates/v/odoh-client-rs.svg 6 | [crates.io]: https://crates.io/crates/odoh-client-rs 7 | 8 | [odoh-client-rs] is a CLI Rust client that can be used to access resolvers running the [Oblivious DNS over HTTPS (ODoH) protocol draft-06]. It is built using the [odoh-rs] library. It is mainly intended for testing as it can only send one request at a time. 9 | 10 | [odoh-client-rs]: https://github.com/cloudflare/odoh-client-rs/ 11 | [Oblivious DNS over HTTPS (ODoH) protocol draft-06]: https://tools.ietf.org/html/draft-pauly-dprive-oblivious-doh-06 12 | [odoh-rs]: https://github.com/cloudflare/odoh-rs/ 13 | 14 | # Example usage 15 | 16 | The proxy and resolver are configured using the file specified by the `-c` flag, e.g., `-c config.toml`. The default configuration can be found at `tests/config.toml`. It uses https://odoh.cloudflare-dns.com, i.e., 1.1.1.1, as the target resolver, and a well known endpoint to retrieve the configs via `GET` requests. 17 | 18 | ```bash 19 | $ cargo run -- example.com AAAA 20 | ``` -------------------------------------------------------------------------------- /src/config.rs: -------------------------------------------------------------------------------- 1 | use anyhow::Result; 2 | use serde::Deserialize; 3 | use std::fs::File; 4 | use std::io::prelude::*; 5 | use std::path::Path; 6 | 7 | // Encapsulates various configuration parameters 8 | #[derive(Clone, Deserialize, Default, Debug)] 9 | #[serde(default)] 10 | pub struct Config { 11 | pub server: Server, 12 | } 13 | 14 | #[derive(Clone, Deserialize, Default, Debug)] 15 | #[serde(default)] 16 | pub struct Server { 17 | pub proxy: Option, 18 | pub target: String, 19 | } 20 | 21 | impl Config { 22 | pub fn from_path>(path: P) -> Result { 23 | let mut fd = File::open(path)?; 24 | let mut toml = String::new(); 25 | fd.read_to_string(&mut toml)?; 26 | Self::from_string(&toml) 27 | } 28 | 29 | pub fn from_string(toml: &str) -> Result { 30 | let c: Config = toml::from_str(toml)?; 31 | Ok(c) 32 | } 33 | } 34 | -------------------------------------------------------------------------------- /src/dns_utils.rs: -------------------------------------------------------------------------------- 1 | use anyhow::{anyhow, Result}; 2 | use lazy_static::lazy_static; 3 | use regex::Regex; 4 | use std::str::FromStr; 5 | use trust_dns_client::rr::{DNSClass, Name, RecordType}; 6 | use trust_dns_proto::op::{message::Message, query::Query}; 7 | 8 | /// Matches "TYPExxx..", where x is a number, returns xxx... parsed as u16 9 | /// Example: "TYPE45" returns 45 10 | fn parse_unknown_qtype(qtype: &str) -> Result { 11 | lazy_static! { 12 | pub static ref RE: Regex = Regex::new(r"^(TYPE)(\d+)$").unwrap(); 13 | } 14 | if RE.is_match(qtype) { 15 | let mut captures = RE.captures_iter(qtype); 16 | return Ok(captures.next().unwrap()[2].parse::()?); 17 | } 18 | Err(anyhow!("Not a valid qtype")) 19 | } 20 | 21 | /// Creates a DNS query from a given domain and query type 22 | pub fn create_dns_query(domain: &str, query_type: &str) -> Result> { 23 | let name = Name::from_str(domain)?; 24 | let mut query = Query::query(name, get_qtype(query_type)?); 25 | query.set_query_class(DNSClass::IN); 26 | let mut msg = Message::new(); 27 | msg.add_query(query); 28 | msg.set_recursion_desired(true); 29 | let id: u16 = rand::random(); 30 | msg.set_id(id); 31 | let msg_as_bytes = msg.to_vec()?; 32 | Ok(msg_as_bytes) 33 | } 34 | 35 | /// Parses a DNS answer from bytes and prints it 36 | pub fn parse_dns_answer(msg: &[u8]) -> Result<()> { 37 | let result = Message::from_vec(msg)?; 38 | println!("Response: {:?}", result.answers()); 39 | Ok(()) 40 | } 41 | 42 | /// Parse record type enum from &str 43 | fn get_qtype(qtype: &str) -> Result { 44 | let rtype = match qtype { 45 | "A" => RecordType::A, 46 | "AAAA" => RecordType::AAAA, 47 | "ANAME" => RecordType::ANAME, 48 | "ANY" => RecordType::ANY, 49 | "AXFR" => RecordType::AXFR, 50 | "CAA" => RecordType::CAA, 51 | "CNAME" => RecordType::CNAME, 52 | "HINFO" => RecordType::HINFO, 53 | "HTTPS" => RecordType::HTTPS, 54 | "IXFR" => RecordType::IXFR, 55 | "MX" => RecordType::MX, 56 | "NAPTR" => RecordType::NAPTR, 57 | "NS" => RecordType::NS, 58 | "NULL" => RecordType::NULL, 59 | "OPENPGPKEY" => RecordType::OPENPGPKEY, 60 | "OPT" => RecordType::OPT, 61 | "PTR" => RecordType::PTR, 62 | "SOA" => RecordType::SOA, 63 | "SRV" => RecordType::SRV, 64 | "SSHFP" => RecordType::SSHFP, 65 | "SVCB" => RecordType::SVCB, 66 | "TLSA" => RecordType::TLSA, 67 | "TXT" => RecordType::TXT, 68 | "ZERO" => RecordType::ZERO, 69 | _ => match parse_unknown_qtype(qtype) { 70 | Ok(n) => RecordType::Unknown(n), 71 | Err(_) => return Err(anyhow!("Record type is invalid")), 72 | }, 73 | }; 74 | Ok(rtype) 75 | } 76 | -------------------------------------------------------------------------------- /src/main.rs: -------------------------------------------------------------------------------- 1 | pub mod config; 2 | pub mod dns_utils; 3 | use anyhow::{anyhow, Context, Result}; 4 | use clap::{App, Arg}; 5 | use config::Config; 6 | use dns_utils::{create_dns_query, parse_dns_answer}; 7 | use odoh_rs::*; 8 | use rand::rngs::StdRng; 9 | use rand::SeedableRng; 10 | use reqwest::{ 11 | header::{HeaderMap, ACCEPT, CACHE_CONTROL, CONTENT_TYPE}, 12 | Client, Response, StatusCode, 13 | }; 14 | use std::env; 15 | use url::Url; 16 | 17 | const PKG_NAME: &str = env!("CARGO_PKG_NAME"); 18 | const PKG_AUTHORS: &str = env!("CARGO_PKG_AUTHORS"); 19 | const PKG_VERSION: &str = env!("CARGO_PKG_VERSION"); 20 | const PKG_DESCRIPTION: &str = env!("CARGO_PKG_DESCRIPTION"); 21 | 22 | const QUERY_PATH: &str = "/dns-query"; 23 | const WELL_KNOWN: &str = "/.well-known/odohconfigs"; 24 | 25 | #[derive(Clone, Debug)] 26 | struct ClientSession { 27 | pub client: Client, 28 | pub target: Url, 29 | pub proxy: Option, 30 | pub client_secret: Option<[u8; 16]>, 31 | pub target_config: ObliviousDoHConfigContents, 32 | pub query: Option, 33 | } 34 | 35 | impl ClientSession { 36 | /// Create a new ClientSession 37 | pub async fn new(config: Config) -> Result { 38 | let mut target = Url::parse(&config.server.target)?; 39 | target.set_path(QUERY_PATH); 40 | let proxy = if let Some(p) = &config.server.proxy { 41 | Url::parse(p).ok() 42 | } else { 43 | None 44 | }; 45 | 46 | // fetch `odohconfigs` by querying well known endpoint using GET request 47 | let mut odohconfigs = reqwest::get(&format!("{}{}", config.server.target, WELL_KNOWN)) 48 | .await? 49 | .bytes() 50 | .await?; 51 | let configs: ObliviousDoHConfigs = parse(&mut odohconfigs).context("invalid configs")?; 52 | let target_config = configs 53 | .into_iter() 54 | .next() 55 | .context("no available config")? 56 | .into(); 57 | 58 | Ok(Self { 59 | client: Client::new(), 60 | target, 61 | proxy, 62 | client_secret: None, 63 | target_config, 64 | query: None, 65 | }) 66 | } 67 | 68 | /// Create an oblivious query from a domain and query type 69 | pub fn create_request(&mut self, domain: &str, qtype: &str) -> Result> { 70 | // create a DNS message 71 | let dns_msg = create_dns_query(domain, qtype)?; 72 | let query = ObliviousDoHMessagePlaintext::new(&dns_msg, 1); 73 | self.query = Some(query.clone()); 74 | let mut rng = StdRng::from_entropy(); 75 | let (oblivious_query, client_secret) = encrypt_query(&query, &self.target_config, &mut rng) 76 | .context("failed to encrypt query")?; 77 | let query_body = compose(&oblivious_query) 78 | .context("failed to compose query body")? 79 | .freeze(); 80 | self.client_secret = Some(client_secret); 81 | Ok(query_body.to_vec()) 82 | } 83 | 84 | /// Set headers and build an HTTP request to send the oblivious query to the proxy/target. 85 | /// If a proxy is specified, the request will be sent to the proxy. However, if a proxy is absent, 86 | /// it will be sent directly to the target. Note that not specifying a proxy effectively nullifies 87 | /// the entire purpose of using ODoH. 88 | pub async fn send_request(&mut self, request: &[u8]) -> Result { 89 | let mut headers = HeaderMap::new(); 90 | headers.insert(CONTENT_TYPE, ODOH_HTTP_HEADER.parse()?); 91 | headers.insert(ACCEPT, ODOH_HTTP_HEADER.parse()?); 92 | headers.insert(CACHE_CONTROL, "no-cache, no-store".parse()?); 93 | let query = [ 94 | ( 95 | "targethost", 96 | self.target 97 | .host_str() 98 | .context("Target host is not a valid host string")?, 99 | ), 100 | ("targetpath", QUERY_PATH), 101 | ]; 102 | let builder = if let Some(p) = &self.proxy { 103 | self.client.post(p.clone()).headers(headers).query(&query) 104 | } else { 105 | self.client.post(self.target.clone()).headers(headers) 106 | }; 107 | let resp = builder.body(request.to_vec()).send().await?; 108 | Ok(resp) 109 | } 110 | 111 | /// Parse the received response from the resolver and print the answer. 112 | pub async fn parse_response(&self, resp: Response) -> Result<()> { 113 | if resp.status() != StatusCode::OK { 114 | return Err(anyhow!( 115 | "query failed with response status code {}", 116 | resp.status().as_u16() 117 | )); 118 | } 119 | let mut data = resp.bytes().await?; 120 | let response_body = parse(&mut data).context("failed to parse response body")?; 121 | let response = decrypt_response( 122 | &self.query.clone().unwrap(), 123 | &response_body, 124 | self.client_secret.clone().unwrap(), 125 | ) 126 | .context("failed to decrypt response")?; 127 | parse_dns_answer(&response.into_msg())?; 128 | Ok(()) 129 | } 130 | } 131 | 132 | #[tokio::main] 133 | async fn main() -> Result<()> { 134 | let matches = App::new(PKG_NAME) 135 | .version(PKG_VERSION) 136 | .author(PKG_AUTHORS) 137 | .about(PKG_DESCRIPTION) 138 | .arg( 139 | Arg::with_name("config_file") 140 | .short("c") 141 | .long("config") 142 | .value_name("FILE") 143 | .help("Path to the config.toml config file") 144 | .takes_value(true), 145 | ) 146 | .arg( 147 | Arg::with_name("domain") 148 | .help("Domain to query") 149 | .required(true) 150 | .index(1), 151 | ) 152 | .arg( 153 | Arg::with_name("type") 154 | .help("Query type") 155 | .required(true) 156 | .index(2), 157 | ) 158 | .get_matches(); 159 | 160 | let config_file = matches 161 | .value_of("config_file") 162 | .unwrap_or("tests/config.toml"); 163 | let config = Config::from_path(config_file)?; 164 | let domain = matches.value_of("domain").unwrap(); 165 | let qtype = matches.value_of("type").unwrap(); 166 | let mut session = ClientSession::new(config.clone()).await?; 167 | let request = session.create_request(domain, qtype)?; 168 | let response = session.send_request(&request).await?; 169 | session.parse_response(response).await?; 170 | Ok(()) 171 | } 172 | -------------------------------------------------------------------------------- /tests/config.toml: -------------------------------------------------------------------------------- 1 | [server] 2 | # proxy can be commented out, however this will defeat the purpose of using ODoH. 3 | proxy = "https://odoh1.surfdomeinen.nl/proxy" 4 | target = "https://odoh.cloudflare-dns.com" -------------------------------------------------------------------------------- /tests/integration_test.rs: -------------------------------------------------------------------------------- 1 | #[cfg(test)] 2 | mod tests { 3 | use assert_cmd::Command; 4 | 5 | #[test] 6 | fn integration_test() { 7 | let mut cmd = Command::cargo_bin("odoh-client-rs").unwrap(); 8 | let assert = cmd.args(&["google.com", "A"]).assert(); 9 | assert.success(); 10 | } 11 | } 12 | --------------------------------------------------------------------------------