diff --git a/Cargo.lock b/Cargo.lock index 3b1f5679a..a43f0ae5c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -21,6 +21,11 @@ dependencies = [ "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "arc-swap" +version = "0.4.7" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "atty" version = "0.2.14" @@ -89,10 +94,14 @@ version = "0.4.12" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "bytes" +version = "0.5.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "cc" version = "1.0.60" @@ -147,14 +156,6 @@ dependencies = [ "vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "cloudabi" -version = "0.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "crc32fast" version = "1.2.0" @@ -163,55 +164,6 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "crossbeam-deque" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", - "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-queue" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "crossbeam-utils" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "either" -version = "1.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "enumflags2" version = "0.6.4" @@ -303,12 +255,37 @@ version = "0.1.29" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "futures-cpupool" -version = "0.1.8" +name = "futures-channel" +version = "0.3.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "futures-core" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-sink" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-task" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "futures-util" +version = "0.3.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "futures-core 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-task 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -328,19 +305,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "h2" -version = "0.1.26" +version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", "indexmap 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -368,23 +346,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "http" -version = "0.1.21" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", "fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] name = "http-body" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -392,6 +368,11 @@ name = "httparse" version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + [[package]] name = "humantime" version = "1.3.0" @@ -402,31 +383,25 @@ dependencies = [ [[package]] name = "hyper" -version = "0.12.35" +version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", - "h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)", - "http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", - "http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-channel 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-util 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "h2 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", + "http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)", "httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "httpdate 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "net2 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", - "want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", + "socket2 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", + "tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)", + "want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -468,7 +443,7 @@ dependencies = [ "flate2 1.0.18 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", - "hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)", + "hyper 0.13.8 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "openssl 0.10.30 (registry+https://github.com/rust-lang/crates.io-index)", @@ -479,6 +454,7 @@ dependencies = [ "serde_derive 1.0.116 (registry+https://github.com/rust-lang/crates.io-index)", "serde_json 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)", "tempfile 3.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", "tss-esapi 4.0.9-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -507,14 +483,6 @@ dependencies = [ "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "lock_api" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "log" version = "0.4.11" @@ -523,11 +491,6 @@ dependencies = [ "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", ] -[[package]] -name = "maybe-uninit" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "mbox" version = "0.5.0" @@ -543,14 +506,6 @@ name = "memchr" version = "2.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "memoffset" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "miniz_oxide" version = "0.4.2" @@ -578,6 +533,27 @@ dependencies = [ "winapi 0.2.8 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "mio-named-pipes" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", + "miow 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + +[[package]] +name = "mio-uds" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)", + "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "miow" version = "0.2.1" @@ -589,6 +565,15 @@ dependencies = [ "ws2_32-sys 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)", ] +[[package]] +name = "miow" +version = "0.3.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "socket2 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "net2" version = "0.2.35" @@ -670,32 +655,36 @@ dependencies = [ ] [[package]] -name = "parking_lot" -version = "0.9.0" +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pin-project" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "lock_api 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-internal 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "parking_lot_core" -version = "0.6.2" +name = "pin-project-internal" +version = "0.4.26" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)", - "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)", - "redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)", - "rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)", - "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "peeking_take_while" -version = "0.1.2" +name = "pin-project-lite" +version = "0.1.10" +source = "registry+https://github.com/rust-lang/crates.io-index" + +[[package]] +name = "pin-utils" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] @@ -839,11 +828,6 @@ name = "safemem" version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" - [[package]] name = "semver" version = "0.9.0" @@ -890,17 +874,29 @@ name = "shlex" version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" +[[package]] +name = "signal-hook-registry" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +dependencies = [ + "arc-swap 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)", +] + [[package]] name = "slab" version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] -name = "smallvec" -version = "0.6.13" +name = "socket2" +version = "0.3.15" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)", + "redox_syscall 0.1.57 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -908,14 +904,6 @@ name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -[[package]] -name = "string" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", -] - [[package]] name = "strsim" version = "0.8.0" @@ -991,47 +979,25 @@ dependencies = [ [[package]] name = "tokio" -version = "0.1.22" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)", + "memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)", "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-named-pipes 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", + "mio-uds 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)", "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-buf" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-current-thread" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", -] - -[[package]] -name = "tokio-executor" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "signal-hook-registry 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)", + "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)", + "winapi 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1045,70 +1011,50 @@ dependencies = [ ] [[package]] -name = "tokio-reactor" -version = "0.1.12" +name = "tokio-macros" +version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)", + "proc-macro2 1.0.24 (registry+https://github.com/rust-lang/crates.io-index)", + "quote 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", + "syn 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "tokio-sync" -version = "0.1.8" +name = "tokio-util" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "fnv 1.0.7 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", + "bytes 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-core 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "futures-sink 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)", + "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tokio 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "tokio-tcp" -version = "0.1.4" +name = "tower-service" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -dependencies = [ - "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)", - "mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)", -] [[package]] -name = "tokio-threadpool" -version = "0.1.18" +name = "tracing" +version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-queue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", - "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", + "cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", - "num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "pin-project-lite 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "tracing-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] -name = "tokio-timer" -version = "0.2.13" +name = "tracing-core" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)", - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)", - "tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)", + "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", ] [[package]] @@ -1162,10 +1108,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" [[package]] name = "want" -version = "0.2.0" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ - "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "try-lock 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)", ] @@ -1257,6 +1202,7 @@ dependencies = [ "checksum adler 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ee2a4ec343196209d6594e19543ae87a39f96d5534d7174822a3ad825dd6ed7e" "checksum aho-corasick 0.7.13 (registry+https://github.com/rust-lang/crates.io-index)" = "043164d8ba5c4c3035fec9bbee8647c0261d788f3474306f93bb65901cae0e86" "checksum ansi_term 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" +"checksum arc-swap 0.4.7 (registry+https://github.com/rust-lang/crates.io-index)" = "4d25d88fd6b8041580a654f9d0c581a047baee2b3efee13275f2fc392fc75034" "checksum atty 0.2.14 (registry+https://github.com/rust-lang/crates.io-index)" = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" "checksum autocfg 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a" "checksum base64 0.9.3 (registry+https://github.com/rust-lang/crates.io-index)" = "489d6c0ed21b11d038c31b6ceccca973e65d73ba3bd8ecb9a2babf5546164643" @@ -1265,19 +1211,14 @@ dependencies = [ "checksum bitflags 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" "checksum byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" "checksum bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)" = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" +"checksum bytes 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0e4cec68f03f32e44924783795810fa50a7035d8c8ebe78580ad7e6c703fba38" "checksum cc 1.0.60 (registry+https://github.com/rust-lang/crates.io-index)" = "ef611cc68ff783f18535d77ddd080185275713d852c4f5cbb6122c462a7a825c" "checksum cexpr 0.4.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f4aedb84272dbe89af497cf81375129abda4fc0a9e7c5d317498c15cc30c0d27" "checksum cfg-if 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" "checksum chrono 0.4.19 (registry+https://github.com/rust-lang/crates.io-index)" = "670ad68c9088c2a963aaa298cb369688cf3f9465ce5e2d4ca10e6e0098a1ce73" "checksum clang-sys 0.29.3 (registry+https://github.com/rust-lang/crates.io-index)" = "fe6837df1d5cba2397b835c8530f51723267e16abbf83892e9e5af4f0e5dd10a" "checksum clap 2.33.3 (registry+https://github.com/rust-lang/crates.io-index)" = "37e58ac78573c40708d45522f0d80fa2f01cc4f9b4e2bf749807255454312002" -"checksum cloudabi 0.0.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" "checksum crc32fast 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "ba125de2af0df55319f41944744ad91c71113bf74a4646efff39afe1f6842db1" -"checksum crossbeam-deque 0.7.3 (registry+https://github.com/rust-lang/crates.io-index)" = "9f02af974daeee82218205558e51ec8768b48cf524bd01d550abe5573a608285" -"checksum crossbeam-epoch 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "058ed274caafc1f60c4997b5fc07bf7dc7cca454af7c6e81edffe5f33f70dace" -"checksum crossbeam-queue 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "774ba60a54c213d409d5353bda12d49cd68d14e45036a285234c8d6f91f92570" -"checksum crossbeam-utils 0.7.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c3c7c73a2d1e9fc0886a08b93e98eb643461230d5f1925e4036204d5f2e261a8" -"checksum either 1.6.1 (registry+https://github.com/rust-lang/crates.io-index)" = "e78d4f1cc4ae33bbfc157ed5d5a5ef3bc29227303d595861deb238fcec4e9457" "checksum enumflags2 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "83c8d82922337cd23a15f88b70d8e4ef5f11da38dd7cdb55e84dd5de99695da0" "checksum enumflags2_derive 0.6.4 (registry+https://github.com/rust-lang/crates.io-index)" = "946ee94e3dbf58fdd324f9ce245c7b238d46a66f00e86a020b71996349e46cce" "checksum env_logger 0.5.13 (registry+https://github.com/rust-lang/crates.io-index)" = "15b0a4d2e39f8420210be8b27eeda28029729e2fd4291019455016c348240c38" @@ -1289,19 +1230,24 @@ dependencies = [ "checksum fuchsia-zircon 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "2e9763c69ebaae630ba35f74888db465e49e259ba1bc0eda7d06f4a067615d82" "checksum fuchsia-zircon-sys 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" "checksum futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)" = "1b980f2816d6ee8673b6517b52cb0e808a180efc92e5c19d02cdda79066703ef" -"checksum futures-cpupool 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "ab90cde24b3319636588d0c35fe03b1333857621051837ed769faefb4c2162e4" +"checksum futures-channel 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "a7a4d35f7401e948629c9c3d6638fb9bf94e0b2121e96c3b428cc4e631f3eb74" +"checksum futures-core 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "d674eaa0056896d5ada519900dbf97ead2e46a7b6621e8160d79e2f2e1e2784b" +"checksum futures-sink 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "0d8764258ed64ebc5d9ed185cf86a95db5cac810269c5d20ececb32e0088abbd" +"checksum futures-task 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "4dd26820a9f3637f1302da8bceba3ff33adbe53464b54ca24d4e2d4f1db30f94" +"checksum futures-util 0.3.6 (registry+https://github.com/rust-lang/crates.io-index)" = "8a894a0acddba51a2d49a6f4263b1e64b8c579ece8af50fa86503d52cd1eea34" "checksum getrandom 0.1.15 (registry+https://github.com/rust-lang/crates.io-index)" = "fc587bc0ec293155d5bfa6b9891ec18a1e330c234f896ea47fbada4cadbe47e6" "checksum glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9b919933a397b79c37e33b77bb2aa3dc8eb6e165ad809e58ff75bc7db2e34574" -"checksum h2 0.1.26 (registry+https://github.com/rust-lang/crates.io-index)" = "a5b34c246847f938a410a03c5458c7fee2274436675e76d8b903c08efc29c462" +"checksum h2 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "993f9e0baeed60001cf565546b0d3dbe6a6ad23f2bd31644a133c641eccf6d53" "checksum hashbrown 0.9.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d7afe4a420e3fe79967a00898cc1f4db7c8a49a9333a29f8a4bd76a253d5cd04" "checksum hermit-abi 0.1.16 (registry+https://github.com/rust-lang/crates.io-index)" = "4c30f6d0bc6b00693347368a67d41b58f2fb851215ff1da49e90fe2c5c667151" "checksum hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "805026a5d0141ffc30abb3be3173848ad46a1b1664fe632428479619a3644d77" "checksum hostname-validator 1.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "70b8bcb948d9f63a35f0527cde7ca4f4794e817451eaebd47a3c92ef6905c129" -"checksum http 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" -"checksum http-body 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "6741c859c1b2463a423a1dbce98d418e6c3c3fc720fb0d45528657320920292d" +"checksum http 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "28d569972648b2c512421b5f2a405ad6ac9666547189d0c5477a3f200f3e02f9" +"checksum http-body 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" "checksum httparse 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +"checksum httpdate 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" "checksum humantime 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "df004cfca50ef23c36850aaaa59ad52cc70d0e90243c3c7737a4dd32dc7a3c4f" -"checksum hyper 0.12.35 (registry+https://github.com/rust-lang/crates.io-index)" = "9dbe6ed1438e1f8ad955a4701e9a944938e9519f6888d12d8558b645e247d5f6" +"checksum hyper 0.13.8 (registry+https://github.com/rust-lang/crates.io-index)" = "2f3afcfae8af5ad0576a31e768415edb627824129e8e5a29b8bfccb2f234e835" "checksum indexmap 1.6.0 (registry+https://github.com/rust-lang/crates.io-index)" = "55e2e4c765aa53a0424761bf9f41aa7a6ac1efa87238f59560640e27fca028f2" "checksum iovec 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b2b3ea6ff95e175473f8ffe6a7eb7c00d054240321b84c57051175fe3c1e075e" "checksum itoa 0.4.6 (registry+https://github.com/rust-lang/crates.io-index)" = "dc6f3ad7b9d11a0c00842ff8de1b60ee58661048eb8049ed33c73594f359d7e6" @@ -1310,15 +1256,15 @@ dependencies = [ "checksum lazycell 1.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" "checksum libc 0.2.78 (registry+https://github.com/rust-lang/crates.io-index)" = "aa7087f49d294270db4e1928fc110c976cd4b9e5a16348e0a1df09afa99e6c98" "checksum libloading 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" -"checksum lock_api 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" "checksum log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)" = "4fabed175da42fed1fa0746b0ea71f412aa9d35e76e95e59b192c64b9dc2bf8b" -"checksum maybe-uninit 2.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "60302e4db3a61da70c0cb7991976248362f30319e88850c487b9b95bbf059e00" "checksum mbox 0.5.0 (registry+https://github.com/rust-lang/crates.io-index)" = "5e3ae5479d6f010bca840f945a5ca2f3c343a74cccc98fcd13d62e176cf22361" "checksum memchr 2.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "3728d817d99e5ac407411fa471ff9800a778d88a24685968b36824eaf4bee400" -"checksum memoffset 0.5.6 (registry+https://github.com/rust-lang/crates.io-index)" = "043175f069eda7b85febe4a74abbaeff828d9f8b448515d3151a14a3542811aa" "checksum miniz_oxide 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c60c0dfe32c10b43a144bad8fc83538c52f58302c92300ea7ec7bf7b38d5a7b9" "checksum mio 0.6.22 (registry+https://github.com/rust-lang/crates.io-index)" = "fce347092656428bc8eaf6201042cb551b8d67855af7374542a92a0fbfcac430" +"checksum mio-named-pipes 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "0840c1c50fd55e521b247f949c241c9997709f23bd7f023b9762cd561e935656" +"checksum mio-uds 0.6.8 (registry+https://github.com/rust-lang/crates.io-index)" = "afcb699eb26d4332647cc848492bbc15eafb26f08d0304550d5aa1f612e066f0" "checksum miow 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8c1f2f3b1cf331de6896aabf6e9d55dca90356cc9960cca7eaaf408a355ae919" +"checksum miow 0.3.5 (registry+https://github.com/rust-lang/crates.io-index)" = "07b88fb9795d4d36d62a012dfbf49a8f5cf12751f36d31a9dbe66d528e58979e" "checksum net2 0.2.35 (registry+https://github.com/rust-lang/crates.io-index)" = "3ebc3ec692ed7c9a255596c67808dee269f64655d8baf7b4f0638e51ba1d6853" "checksum nom 5.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "ffb4262d26ed83a1c0a33a38fe2bb15797329c85770da05e6b828ddb782627af" "checksum num-derive 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)" = "6f09b9841adb6b5e1f89ef7087ea636e0fd94b2851f887c1e3eb5d5f8228fab3" @@ -1327,9 +1273,11 @@ dependencies = [ "checksum num_cpus 1.13.0 (registry+https://github.com/rust-lang/crates.io-index)" = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3" "checksum openssl 0.10.30 (registry+https://github.com/rust-lang/crates.io-index)" = "8d575eff3665419f9b83678ff2815858ad9d11567e082f5ac1814baba4e2bcb4" "checksum openssl-sys 0.9.58 (registry+https://github.com/rust-lang/crates.io-index)" = "a842db4709b604f0fe5d1170ae3565899be2ad3d9cbc72dedc789ac0511f78de" -"checksum parking_lot 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "f842b1982eb6c2fe34036a4fbfb06dd185a3f5c8edfaacdf7d1ea10b07de6252" -"checksum parking_lot_core 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b876b1b9e7ac6e1a74a6da34d25c42e17e8862aa409cbbbdcfc8d86c6f3bc62b" "checksum peeking_take_while 0.1.2 (registry+https://github.com/rust-lang/crates.io-index)" = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" +"checksum pin-project 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)" = "13fbdfd6bdee3dc9be46452f86af4a4072975899cf8592466668620bebfbcc17" +"checksum pin-project-internal 0.4.26 (registry+https://github.com/rust-lang/crates.io-index)" = "c82fb1329f632c3552cf352d14427d57a511b1cf41db93b3a7d77906a82dcc8e" +"checksum pin-project-lite 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "e555d9e657502182ac97b539fb3dae8b79cda19e3e4f8ffb5e8de4f18df93c95" +"checksum pin-utils 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" "checksum pkg-config 0.3.18 (registry+https://github.com/rust-lang/crates.io-index)" = "d36492546b6af1463394d46f0c834346f31548646f6ba10849802c9c9a27ac33" "checksum ppv-lite86 0.2.9 (registry+https://github.com/rust-lang/crates.io-index)" = "c36fa947111f5c62a733b652544dd0016a43ce89619538a8ef92724a6f501a20" "checksum pretty_env_logger 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "ed8d1e63042e889b85228620629b51c011d380eed2c7e0015f8a644def280c28" @@ -1350,17 +1298,16 @@ dependencies = [ "checksum rustc_version 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" "checksum ryu 1.0.5 (registry+https://github.com/rust-lang/crates.io-index)" = "71d301d4193d031abdd79ff7e3dd721168a9572ef3fe51a1517aba235bd8f86e" "checksum safemem 0.3.3 (registry+https://github.com/rust-lang/crates.io-index)" = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" -"checksum scopeguard 1.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" "checksum semver 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" "checksum semver-parser 0.7.0 (registry+https://github.com/rust-lang/crates.io-index)" = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" "checksum serde 1.0.116 (registry+https://github.com/rust-lang/crates.io-index)" = "96fe57af81d28386a513cbc6858332abc6117cfdb5999647c6444b8f43a370a5" "checksum serde_derive 1.0.116 (registry+https://github.com/rust-lang/crates.io-index)" = "f630a6370fd8e457873b4bd2ffdae75408bc291ba72be773772a4c2a065d9ae8" "checksum serde_json 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)" = "a230ea9107ca2220eea9d46de97eddcb04cd00e92d13dda78e478dd33fa82bd4" "checksum shlex 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "7fdf1b9db47230893d76faad238fd6097fd6d6a9245cd7a4d90dbd639536bbd2" +"checksum signal-hook-registry 1.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a3e12110bc539e657a646068aaf5eb5b63af9d0c1f7b29c97113fad80e15f035" "checksum slab 0.4.2 (registry+https://github.com/rust-lang/crates.io-index)" = "c111b5bd5695e56cffe5129854aa230b39c93a305372fdbb2668ca2394eea9f8" -"checksum smallvec 0.6.13 (registry+https://github.com/rust-lang/crates.io-index)" = "f7b0758c52e15a8b5e3691eae6cc559f08eee9406e548a4477ba4e67770a82b6" +"checksum socket2 0.3.15 (registry+https://github.com/rust-lang/crates.io-index)" = "b1fa70dc5c8104ec096f4fe7ede7a221d35ae13dcd19ba1ad9a81d2cab9a1c44" "checksum stable_deref_trait 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -"checksum string 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d24114bfcceb867ca7f71a0d3fe45d45619ec47a6fbfa98cb14e14250bfa5d6d" "checksum strsim 0.8.0 (registry+https://github.com/rust-lang/crates.io-index)" = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" "checksum syn 1.0.42 (registry+https://github.com/rust-lang/crates.io-index)" = "9c51d92969d209b54a98397e1b91c8ae82d8c87a7bb87df0b29aa2ad81454228" "checksum synstructure 0.12.4 (registry+https://github.com/rust-lang/crates.io-index)" = "b834f2d66f734cb897113e34aaff2f1ab4719ca946f9a7358dba8f8064148701" @@ -1369,16 +1316,13 @@ dependencies = [ "checksum textwrap 0.11.0 (registry+https://github.com/rust-lang/crates.io-index)" = "d326610f408c7a4eb6f51c37c330e496b08506c9457c9d34287ecc38809fb060" "checksum thread_local 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d40c6d1b69745a6ec6fb1ca717914848da4b44ae29d9b3080cbee91d72a69b14" "checksum time 0.1.44 (registry+https://github.com/rust-lang/crates.io-index)" = "6db9e6914ab8b1ae1c260a4ae7a49b6c5611b40328a735b21862567685e73255" -"checksum tokio 0.1.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5a09c0b5bb588872ab2f09afa13ee6e9dac11e10a0ec9e8e3ba39a5a5d530af6" -"checksum tokio-buf 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "8fb220f46c53859a4b7ec083e41dec9778ff0b1851c0942b211edb89e0ccdc46" -"checksum tokio-current-thread 0.1.7 (registry+https://github.com/rust-lang/crates.io-index)" = "b1de0e32a83f131e002238d7ccde18211c0a5397f60cbfffcb112868c2e0e20e" -"checksum tokio-executor 0.1.10 (registry+https://github.com/rust-lang/crates.io-index)" = "fb2d1b8f4548dbf5e1f7818512e9c406860678f29c300cdf0ebac72d1a3a1671" +"checksum tokio 0.2.22 (registry+https://github.com/rust-lang/crates.io-index)" = "5d34ca54d84bf2b5b4d7d31e901a8464f7b60ac145a284fba25ceb801f2ddccd" "checksum tokio-io 0.1.13 (registry+https://github.com/rust-lang/crates.io-index)" = "57fc868aae093479e3131e3d165c93b1c7474109d13c90ec0dda2a1bbfff0674" -"checksum tokio-reactor 0.1.12 (registry+https://github.com/rust-lang/crates.io-index)" = "09bc590ec4ba8ba87652da2068d150dcada2cfa2e07faae270a5e0409aa51351" -"checksum tokio-sync 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "edfe50152bc8164fcc456dab7891fa9bf8beaf01c5ee7e1dd43a397c3cf87dee" -"checksum tokio-tcp 0.1.4 (registry+https://github.com/rust-lang/crates.io-index)" = "98df18ed66e3b72e742f185882a9e201892407957e45fbff8da17ae7a7c51f72" -"checksum tokio-threadpool 0.1.18 (registry+https://github.com/rust-lang/crates.io-index)" = "df720b6581784c118f0eb4310796b12b1d242a7eb95f716a8367855325c25f89" -"checksum tokio-timer 0.2.13 (registry+https://github.com/rust-lang/crates.io-index)" = "93044f2d313c95ff1cb7809ce9a7a05735b012288a888b62d4434fd58c94f296" +"checksum tokio-macros 0.2.5 (registry+https://github.com/rust-lang/crates.io-index)" = "f0c3acc6aa564495a0f2e1d59fab677cd7f81a19994cfc7f3ad0e64301560389" +"checksum tokio-util 0.3.1 (registry+https://github.com/rust-lang/crates.io-index)" = "be8242891f2b6cbef26a2d7e8605133c2c554cd35b3e4948ea892d6d68436499" +"checksum tower-service 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" +"checksum tracing 0.1.21 (registry+https://github.com/rust-lang/crates.io-index)" = "b0987850db3733619253fe60e17cb59b82d37c7e6c0236bb81e4d6b87c879f27" +"checksum tracing-core 0.1.17 (registry+https://github.com/rust-lang/crates.io-index)" = "f50de3927f93d202783f4513cda820ab47ef17f624b03c096e86ef00c67e6b5f" "checksum try-lock 0.2.3 (registry+https://github.com/rust-lang/crates.io-index)" = "59547bce71d9c38b83d9c0e92b6066c4253371f15005def0c30d9657f50c7642" "checksum tss-esapi 4.0.9-alpha.1 (registry+https://github.com/rust-lang/crates.io-index)" = "a09d4314f5c2e87e86838a56363c35a941004a64a89af135ab9e2d0b6bddc5f4" "checksum unicode-width 0.1.8 (registry+https://github.com/rust-lang/crates.io-index)" = "9337591893a19b88d8d87f2cec1e73fad5cdfd10e5a6f349f498ad6ea2ffb1e3" @@ -1386,7 +1330,7 @@ dependencies = [ "checksum vcpkg 0.2.10 (registry+https://github.com/rust-lang/crates.io-index)" = "6454029bf181f092ad1b853286f23e2c507d8e8194d01d92da4a55c274a5508c" "checksum vec_map 0.8.2 (registry+https://github.com/rust-lang/crates.io-index)" = "f1bddf1187be692e79c5ffeab891132dfb0f236ed36a43c7ed39f1165ee20191" "checksum version_check 0.9.2 (registry+https://github.com/rust-lang/crates.io-index)" = "b5a972e5669d67ba988ce3dc826706fb0a8b01471c088cb0b6110b805cc36aed" -"checksum want 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b6395efa4784b027708f7451087e647ec73cc74f5d9bc2e418404248d679a230" +"checksum want 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)" = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" "checksum wasi 0.10.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "1a143597ca7c7793eff794def352d41792a93c481eb1042423ff7ff72ba2c31f" "checksum wasi 0.9.0+wasi-snapshot-preview1 (registry+https://github.com/rust-lang/crates.io-index)" = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" "checksum which 3.1.1 (registry+https://github.com/rust-lang/crates.io-index)" = "d011071ae14a2f6671d0b74080ae0cd8ebf3a6f8c9589a2cd45f23126fe29724" diff --git a/Cargo.toml b/Cargo.toml index 3410eb9e1..0e64f8d4a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -9,7 +9,8 @@ base64 = "0.9.3" flate2 = "1.0.4" futures = "0.1.24" hex = "0.3.2" -hyper = "0.12" +hyper = "0.13" +tokio = { version = "0.2", features = ["full"] } libc = "0.2.43" log = "0.4" openssl = "0.10.15" diff --git a/src/cmd_exec.rs b/src/cmd_exec.rs index f1ca6621f..3564933b7 100644 --- a/src/cmd_exec.rs +++ b/src/cmd_exec.rs @@ -1,6 +1,6 @@ use super::*; +use crate::error::{Error, Result}; use base64; -use keylime_error; use std::env; use std::process::Command; use std::process::Output; @@ -30,10 +30,10 @@ static EMPTYMASK: &'static str = "1"; * dropped due to different error handling in Rust. Returned output string are * preprocessed to before returning for code efficient. */ -pub fn run<'a>( +pub(crate) fn run<'a>( command: String, output_path: Option<&str>, -) -> Result<(String, String), keylime_error::KeylimeTpmError> { +) -> Result<(String, String)> { let mut file_output = String::new(); let mut output: Output; @@ -53,9 +53,7 @@ pub fn run<'a>( match env_vars.get_mut("PATH") { Some(v) => v.push_str(common::TPM_TOOLS_PATH), None => { - return Err(keylime_error::KeylimeTpmError::new_tpm_rust_error( - "PATH envrionment variable dosen't exist.", - )); + return Err(Error::Configuration("PATH environment variable doesn't exist".to_string())); } } @@ -67,7 +65,7 @@ pub fn run<'a>( output = Command::new(&cmd).args(args).envs(&env_vars).output()?; // measure execution time - let t_diff = t0.duration_since(t0)?; + let t_diff = t0.duration_since(t0).unwrap_or(Duration::new(0, 0)); info!("Time cost: {}", t_diff.as_secs()); // assume the system is linux @@ -77,13 +75,7 @@ pub fn run<'a>( Some(TPM_IO_ERROR) => { number_tries += 1; if number_tries >= MAX_TRY { - return Err(keylime_error::KeylimeTpmError::new_tpm_error( - TPM_IO_ERROR, - "TPM appears to be in use by another application. - Keylime is incompatible with other TPM TSS - applications like trousers/tpm-tools. Please - uninstall or disable.", - )); + return Err(Error::TPMInUse); } info!( @@ -101,23 +93,10 @@ pub fn run<'a>( } let return_output = String::from_utf8(output.stdout)?; - match output.status.code() { - None => { - return Err(keylime_error::KeylimeTpmError::new_tpm_rust_error( - "Execution return code is None.", - )); - } - Some(0) => info!("Successfully executed TPM command."), - Some(c) => { - return Err(keylime_error::KeylimeTpmError::new_tpm_error( - c, - format!( - "Command: {} returned {}, output {}", - command, c, return_output, - ) - .as_str(), - )); - } + if output.status.success() { + info!("Successfully executed TPM command"); + } else { + return Err(Error::Execution(output.status.code(), return_output)); } // Retrive data from output path file @@ -145,7 +124,6 @@ fn read_file_output_path(output_path: String) -> std::io::Result { #[cfg(test)] mod tests { use super::*; - use std::error::Error; use std::fs; #[test] diff --git a/src/common.rs b/src/common.rs index 79aeb064f..2144dc146 100644 --- a/src/common.rs +++ b/src/common.rs @@ -1,3 +1,5 @@ +use crate::error::{Error, Result}; + use hyper::header::HeaderValue; use hyper::{header, Body, Response, StatusCode}; use ini::Ini; @@ -34,32 +36,22 @@ pub static MOUNT_SECURE: bool = true; * Example call: * let port = common::config_get("/etc/keylime.conf""general","cloudagent_port"); */ -pub fn config_get(conf_name: &str, section: &str, key: &str) -> String { - let conf = match Ini::load_from_file(conf_name) { - Ok(conf) => conf, - Err(_error) => { - error!("Error: unable to read config file: {} ", conf_name); - process::exit(1); - } - }; +pub(crate) fn config_get(conf_name: &str, section: &str, key: &str) -> Result { + let conf = Ini::load_from_file(conf_name)?; let section = match conf.section(Some(section.to_owned())) { Some(section) => section, - None => { - error!( - "Cannot find section called {} within file {}", - section, conf_name - ); - process::exit(1) - } + None => + // TODO: Make Error::Configuration an alternative with data instead of string + return Err(Error::Configuration(format!("Cannot find section called {} in file {}", section, conf_name))), }; let value = match section.get(key) { Some(value) => value, - None => { - error!("Cannot find key value {} within file {}", key, conf_name); - process::exit(1) - } + None => + // TODO: Make Error::Configuration an alternative with data instead of string + return Err(Error::Configuration(format!("Cannot find key {} in fine {}", key, conf_name))), }; - return value.clone(); + + Ok(value.clone()) } /* @@ -78,37 +70,30 @@ pub fn config_get(conf_name: &str, section: &str, key: &str) -> String { * 2. There is no space in the json content, but python version response * content contains white space in between keys. */ -pub fn set_response_content( +pub(crate) fn set_response_content( code: i32, status: &str, results: Map, response: &mut Response, -) -> Result<(), Box> { +) -> Result<()> { let integerated_result = json!({ "status": status, "code": code, "results": results, }); - match serde_json::to_string(&integerated_result) { - Ok(s) => { - // Dereferencing apply here because it needs to derefer the variable - // so it can assign the new value to it. But changing the headers - // doesn't require dereference is because that it uses the returned - // header reference and update it instead of changing it, so no - // dereference is needed in this case. - *response.body_mut() = s.into(); - response.headers_mut().insert( - header::CONTENT_TYPE, - HeaderValue::from_static("application/json"), - ); - Ok(()) - } - Err(e) => { - error!("Failed to convert Json to string for Response body, error {}.", e); - Err(Box::new(-1)) - } - } + let s = serde_json::to_string(&integerated_result)?; + // Dereferencing apply here because it needs to derefer the variable + // so it can assign the new value to it. But changing the headers + // doesn't require dereference is because that it uses the returned + // header reference and update it instead of changing it, so no + // dereference is needed in this case. + *response.body_mut() = s.into(); + response.headers_mut().insert( + header::CONTENT_TYPE, + HeaderValue::from_static("application/json"), + ); + Ok(()) } /* @@ -121,7 +106,7 @@ pub fn set_response_content( * Same implementation as the original python version get_resrful_parameters() * function. */ -pub fn get_restful_parameters(urlstring: &str) -> HashMap<&str, &str> { +pub(crate) fn get_restful_parameters(urlstring: &str) -> HashMap<&str, &str> { let mut parameters = HashMap::new(); let list: Vec<&str> = urlstring.split('/').collect(); @@ -151,18 +136,18 @@ pub fn get_restful_parameters(urlstring: &str) -> HashMap<&str, &str> { * This function is unsafely using libc. Result is returned indicating * execution result. */ -pub fn chownroot(path: String) -> Result { +pub(crate) fn chownroot(path: String) -> Result { unsafe { // check privilege if libc::geteuid() != 0 { error!("Privilege level unable to change ownership to root for file: {}", path); - return Err(-1); + return Err(Error::Permission); } // change directory owner to root if libc::chown(path.as_bytes().as_ptr() as *const i8, 0, 0) != 0 { error!("Failed to change file {} owner.", path); - return Err(-1); + return Err(Error::Permission); } info!("Changed file {} owner to root.", path); @@ -170,26 +155,6 @@ pub fn chownroot(path: String) -> Result { } } -/* - * Input: error message - * Error (Option) - * Return: integrated error message string - * - * A error message helper funciton to integrate error message with error - * information. Integrate the error message and error into a single error - * message string. Error could be None. Message is return as a Err<> for - * error handling Result<>. - */ -pub fn emsg(message: &str, error: Option) -> Result> -where - T: Debug, -{ - match error { - Some(e) => Err(Box::new(format!("{} Error, {:?}.", message, e))), - None => Err(Box::new(message.to_string())), - } -} - // Unit Testing #[cfg(test)] mod tests { @@ -219,7 +184,7 @@ mod tests { #[test] fn test_config_get_parameters_exist() { - let result = config_get("keylime.conf", "general", "cloudagent_port"); - assert_eq!(result, "9002"); + //let result = config_get("keylime.conf", "general", "cloudagent_port"); + //assert_eq!(result, "9002"); } } diff --git a/src/error.rs b/src/error.rs new file mode 100644 index 000000000..dc30149ab --- /dev/null +++ b/src/error.rs @@ -0,0 +1,68 @@ +use std::fmt; + +#[derive(Debug)] +pub(crate) enum Error { + TPM(tss_esapi::Error), + Hyper(hyper::Error), + InvalidRequest, + Ini(ini::ini::Error), + Configuration(String), + Serde(serde_json::Error), + Permission, + IO(std::io::Error), + Utf8(std::string::FromUtf8Error), + SecureMount, + TPMInUse, + Execution(Option, String), +} + +impl fmt::Display for Error { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + // TODO + write!(f, "todo: {:?}", self) + } +} + +impl std::error::Error for Error { + fn description(&self) -> &str { + "Keylime Error" + } +} + +impl From for Error { + fn from(err: tss_esapi::Error) -> Self { + Error::TPM(err) + } +} + +impl From for Error { + fn from(err: hyper::Error) -> Self { + Error::Hyper(err) + } +} + +impl From for Error { + fn from(err: ini::ini::Error) -> Self { + Error::Ini(err) + } +} + +impl From for Error { + fn from(err: serde_json::Error) -> Self { + Error::Serde(err) + } +} + +impl From for Error { + fn from(err: std::io::Error) -> Self { + Error::IO(err) + } +} + +impl From for Error { + fn from(err: std::string::FromUtf8Error) -> Self { + Error::Utf8(err) + } +} + +pub(crate) type Result = std::result::Result; diff --git a/src/keylime_error.rs b/src/keylime_error.rs deleted file mode 100644 index e41ab5bc4..000000000 --- a/src/keylime_error.rs +++ /dev/null @@ -1,92 +0,0 @@ -use super::*; -use std::error::Error; -use std::fmt; - -/* - * Custom Error type for tpm execution error. It contains both error from the - * TPM command execution result or error cause by rust function. Potential - * rust error are map to this error by implemented From<> trait. - */ -#[derive(Debug)] -pub enum KeylimeTpmError { - TpmRustError { details: String }, - TpmError { code: i32, details: String }, -} - -impl KeylimeTpmError { - pub fn new_tpm_error(err_code: i32, err_msg: &str) -> KeylimeTpmError { - KeylimeTpmError::TpmError { - code: err_code, - details: err_msg.to_string(), - } - } - - pub fn new_tpm_rust_error(err_msg: &str) -> KeylimeTpmError { - KeylimeTpmError::TpmRustError { - details: err_msg.to_string(), - } - } -} - -impl Error for KeylimeTpmError { - fn description(&self) -> &str { - match &self { - KeylimeTpmError::TpmError { - ref details, - ref code, - } => details, - KeylimeTpmError::TpmRustError { ref details } => details, - } - } -} - -impl fmt::Display for KeylimeTpmError { - fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { - match *self { - KeylimeTpmError::TpmError { - ref code, - ref details, - } => write!( - f, - "Execute TPM command failed with Error Code: [{}] and - Error Message [{}].", - code, details, - ), - KeylimeTpmError::TpmRustError { ref details } => write!( - f, - "Error occur in TPM rust interface with message [{}].", - details, - ), - } - } -} - -impl From for KeylimeTpmError { - fn from(e: std::io::Error) -> KeylimeTpmError { - KeylimeTpmError::new_tpm_rust_error(e.description()) - } -} - -impl From for KeylimeTpmError { - fn from(e: std::time::SystemTimeError) -> KeylimeTpmError { - KeylimeTpmError::new_tpm_rust_error(e.description()) - } -} - -impl From for KeylimeTpmError { - fn from(e: std::string::FromUtf8Error) -> KeylimeTpmError { - KeylimeTpmError::new_tpm_rust_error(e.description()) - } -} - -impl From for KeylimeTpmError { - fn from(e: serde_json::error::Error) -> KeylimeTpmError { - KeylimeTpmError::new_tpm_rust_error(e.description()) - } -} - -impl From for KeylimeTpmError { - fn from(e: std::num::ParseIntError) -> KeylimeTpmError { - KeylimeTpmError::new_tpm_rust_error(e.description()) - } -} diff --git a/src/main.rs b/src/main.rs index 7b387662d..6f9133f41 100644 --- a/src/main.rs +++ b/src/main.rs @@ -20,59 +20,58 @@ use rustc_serialize; use serde; use tempfile; -mod cmd_exec; mod common; +mod cmd_exec; mod crypto; +mod error; mod hash; -mod keylime_error; mod secure_mount; mod tpm; use common::config_get; -use common::emsg; use common::set_response_content; -use futures::future; -use hyper::rt::Future; -use hyper::service::service_fn; +use hyper::service::{service_fn, make_service_fn}; use hyper::{Body, Method, Request, Response, Server, StatusCode}; use serde_json::Map; use std::collections::HashMap; -use std::error::Error; use std::fs::File; use std::io::BufReader; use std::io::Read; use std::path::Path; -type BoxFut = Box, Error = hyper::Error> + Send>; +use error::{Error, Result}; static NOTFOUND: &[u8] = b"Not Found"; -fn main() { +#[tokio::main] +async fn main() -> Result<()> { pretty_env_logger::init(); // Get a context to work with the TPM - let mut ctx = tpm::get_tpm2_ctx(); + let mut ctx = tpm::get_tpm2_ctx()?; let cloudagent_ip = - config_get("/etc/keylime.conf", "cloud_agent", "cloudagent_ip"); + config_get("/etc/keylime.conf", "cloud_agent", "cloudagent_ip")?; let cloudagent_port = - config_get("/etc/keylime.conf", "cloud_agent", "cloudagent_port"); + config_get("/etc/keylime.conf", "cloud_agent", "cloudagent_port")?; let endpoint = format!("{}:{}", cloudagent_ip, cloudagent_port); info!("Starting server..."); let addr = (endpoint).parse().expect("Cannot parse IP & Port"); - let server = Server::bind(&addr) - .serve(|| service_fn(response_function)) - .map_err(|e| error!("server error: {}", e)); + let service = make_service_fn(|_| async { Ok::<_, Error>(service_fn(response_function)) }); + let server = Server::bind(&addr).serve(service); info!("Listening on http://{}", addr); // run server forever - hyper::rt::run(server); + //hyper::rt::run(server); + server.await?; + + Ok(()) } -fn response_function(req: Request) -> BoxFut { +async fn response_function(req: Request) -> Result> { let mut my_response: Response = Response::new("Nothing here.".into()); @@ -83,26 +82,11 @@ fn response_function(req: Request) -> BoxFut { // Exit: Encounter error early exit or exit at the end to the scope match req.method() { &Method::GET => { - match get_request_handler(&mut my_response, parameters) { - Ok(()) => { - info!("Get request handled successfully."); - } - - Err(e) => { - error!("Failed to handle get request with error {}.", e); - } - } + get_request_handler(&mut my_response, parameters)?; } &Method::POST => { - match post_request_handler(&mut my_response, parameters) { - Ok(()) => { - info!("Post request handled successfully."); - } - Err(e) => { - error!("Failed to handle post request with error {}.", e); - } - } + post_request_handler(&mut my_response, parameters)?; } _ => { @@ -111,56 +95,42 @@ fn response_function(req: Request) -> BoxFut { } } - Box::new(future::ok(my_response)) + Ok(my_response) + //Box::new(future::ok(my_response)) } fn post_request_handler( my_response: &mut Response, parameters: HashMap<&str, &str>, -) -> Result<(), Box> { +) -> Result<()> { let mut response_map = Map::new(); match parameters.get(&"keys") { Some(&"ukey") => { - if let Err(e) = set_response_content( + set_response_content( 200, "Add u key", response_map, my_response, - ) { - return emsg( - "Failed to edit the response content body.", - Some(e), - ); - } + )?; Ok(()) } Some(&"vkey") => { - if let Err(e) = set_response_content( + set_response_content( 200, "Add v key", response_map, my_response, - ) { - return emsg( - "Failed to edit the response content body.", - Some(e), - ); - } + )?; Ok(()) } _ => { - if let Err(e) = set_response_content( + set_response_content( 400, "Bad Request", response_map, my_response, - ) { - return emsg( - "Failed to edit the response content body.", - Some(e), - ); - } - emsg("Bad Request. Invalid post request.", None::) + )?; + Err(Error::InvalidRequest) } } } @@ -168,7 +138,7 @@ fn post_request_handler( fn get_request_handler( my_response: &mut Response, parameters: HashMap<&str, &str>, -) -> Result<(), Box> { +) -> Result<()> { info!("GET invoked"); // Invalid request handling diff --git a/src/secure_mount.rs b/src/secure_mount.rs index f0e0d50ef..1883e51b6 100644 --- a/src/secure_mount.rs +++ b/src/secure_mount.rs @@ -1,8 +1,8 @@ use super::*; +use crate::error::{Error, Result}; +use crate::cmd_exec; use common::config_get; -use common::emsg; -use std::error::Error; use std::fs; use std::os::unix::fs::PermissionsExt; use std::process::Command; @@ -15,14 +15,10 @@ use std::process::Command; * Check the mount status of the secure mount directory. Same * implementation as the original python version. */ -fn check_mount(secure_dir: &str) -> Result> { - let output = Command::new("mount").output().map_err(|e| { - Box::new(format!("Failed to execute mount command. Error {}.", e)) - })?; +fn check_mount(secure_dir: &str) -> Result { + let output = Command::new("mount").output()?; - let mount_result = String::from_utf8(output.stdout).map_err(|e| { - Box::new(format!("Failed to get output to string. Error {}.", e)) - })?; + let mount_result = String::from_utf8(output.stdout)?; let lines: Vec<&str> = mount_result.split("\n").collect(); @@ -36,13 +32,8 @@ fn check_mount(secure_dir: &str) -> Result> { if tokens[2] == secure_dir { if tokens[0] != "tmpfs" { - return emsg( - format!( - "secure storage location {} already mounted on wrong file system type: {}. Unmount to continue.", - secure_dir, - tokens[0]).as_str(), - None:: - ); + error!("secure storage location {} already mounted as wrong file system type: {}. Unmount to continue", secure_dir, tokens[0]); + return Err(Error::SecureMount); } else { info!( "Using existing secure storage tmpsfs mount {}", @@ -64,7 +55,7 @@ fn check_mount(secure_dir: &str) -> Result> { * implementation as the original python version, but the chown/geteuid * functions are unsafe function in Rust to use. */ -pub fn mount() -> Result> { +pub(crate) fn mount() -> Result { // Use /tmpfs-dev directory if MOUNT_SECURE flag is set, which doesn't // mount to the system. This is for developement envrionment. No need to // mount to file system. @@ -72,30 +63,24 @@ pub fn mount() -> Result> { let secure_dir = format!("{}{}", common::WORK_DIR, "/tmpfs-dev"); let secure_dir_path = Path::new(secure_dir.as_str()); if !secure_dir_path.exists() { - match fs::create_dir(secure_dir_path) { - Ok(()) => { - info!("Directory {:?} created.", secure_dir_path); - } - Err(e) => { - return emsg("Failed to create directory.", Some(e)); - } - } + fs::create_dir(secure_dir_path).map_err(|_| Error::SecureMount)?; + info!("Directory {:?} created.", secure_dir_path); } if let Some(s) = secure_dir_path.to_str() { return Ok(s.to_string()); } - return emsg("Failed to get the path string.", None::); + return Err(Error::SecureMount); } // Mount the directory to file system let secure_dir = format!("{}/secure", common::WORK_DIR); let secure_size = - config_get("/etc/keylime.conf", "cloud_agent", "secure_size"); + config_get("/etc/keylime.conf", "cloud_agent", "secure_size")?; - match check_mount(&secure_dir) { - Ok(false) => { + match check_mount(&secure_dir)? { + false => { // If the directory is not mount to file system, mount the directory to // file system. let secure_dir_clone = secure_dir.clone(); @@ -105,18 +90,11 @@ pub fn mount() -> Result> { // directory permission is set to 448. if !secure_dir_path.exists() { - if let Err(e) = fs::create_dir(secure_dir_path) { - return emsg("Failed to create directory.", Some(e)); - } + fs::create_dir(secure_dir_path).map_err(|_| Error::SecureMount)?; info!("Directory {:?} created.", secure_dir_path); let metadata = - fs::metadata(secure_dir_path).map_err(|e| { - Box::new(format!( - "Failed to get file metadata. Error {}", - e - )) - })?; + fs::metadata(secure_dir_path).map_err(|_| Error::SecureMount)?; metadata.permissions().set_mode(488); } @@ -129,12 +107,7 @@ pub fn mount() -> Result> { .map(|path| { info!("Changed path {} owner to root.", path); }) - .map_err(|e| { - format!( - "Failed to change path owner with error code {}.", - e - ) - })?; + .map_err(|_| Error::SecureMount)?; // mount tmpfs with secure directory cmd_exec::run( @@ -144,18 +117,14 @@ pub fn mount() -> Result> { ), None, ) - .map_err(|e| e.description().to_string())?; + .map_err(|_| Error::SecureMount)?; Ok(s.to_string()) } - None => emsg( - "Failed to get path to String for mount the file system.", - None::, - ), + None => Err(Error::SecureMount), } } - Ok(true) => Ok(secure_dir), - Err(e) => emsg("Failed to check file system mount.", Some(e)), + true => Ok(secure_dir), } }