diff --git a/Cargo.lock b/Cargo.lock index f8390bd4a..bc86c2a0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -165,6 +165,12 @@ dependencies = [ "syn 2.0.32", ] +[[package]] +name = "atomic-waker" +version = "1.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" + [[package]] name = "atty" version = "0.2.14" @@ -222,6 +228,12 @@ version = "0.21.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9d297deb1925b89f2ccc13d7635fa0714f12c87adce1c75356b39ca9b7178567" +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + [[package]] name = "bincode" version = "1.3.3" @@ -376,9 +388,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.5.0" +version = "1.7.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +checksum = "428d9aa8fbc0670b7b8d6030a7fadd0f86151cae55e4dbbece15f3780a3dfaf3" [[package]] name = "cbindgen" @@ -436,7 +448,7 @@ dependencies = [ "iana-time-zone", "num-traits", "serde", - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -681,9 +693,9 @@ dependencies = [ [[package]] name = "crypto-mac" -version = "0.11.1" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1d1a86f49236c215f271d40892d5fc950490551400b02ef360692c29815c714" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" dependencies = [ "generic-array 0.14.7", "subtle", @@ -737,7 +749,7 @@ dependencies = [ "nix 0.27.1", "rand 0.8.5", "retry", - "semver 1.0.22", + "semver", "serde", ] @@ -927,7 +939,7 @@ dependencies = [ "openssl", "pretty_env_logger", "rand 0.8.5", - "reqwest", + "reqwest 0.11.27", "serde", "serde_yaml", "time", @@ -976,7 +988,7 @@ dependencies = [ "byteorder", "ciborium", "hex", - "http", + "http 0.2.12", "log", "maplit", "num-derive 0.3.3", @@ -1019,7 +1031,7 @@ dependencies = [ "log", "openssl", "pretty_env_logger", - "reqwest", + "reqwest 0.11.27", "serde", "thiserror", "time", @@ -1108,6 +1120,7 @@ dependencies = [ "hex", "log", "openssl", + "reqwest 0.12.7", "serde", "serde_yaml", "tokio", @@ -1410,7 +1423,26 @@ dependencies = [ "futures-core", "futures-sink", "futures-util", - "http", + "http 0.2.12", + "indexmap 2.2.5", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "h2" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "524e8ac6999421f49a846c2d4411f337e53497d8ec55d67753beffa43c5d9205" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.1.0", "indexmap 2.2.5", "slab", "tokio", @@ -1458,7 +1490,7 @@ dependencies = [ "base64 0.21.7", "bytes", "headers-core", - "http", + "http 0.2.12", "httpdate", "mime", "sha1", @@ -1470,7 +1502,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http", + "http 0.2.12", ] [[package]] @@ -1506,7 +1538,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" dependencies = [ - "crypto-mac 0.11.1", + "crypto-mac 0.11.0", "digest 0.9.0", ] @@ -1536,6 +1568,17 @@ dependencies = [ "itoa", ] +[[package]] +name = "http" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +dependencies = [ + "bytes", + "fnv", + "itoa", +] + [[package]] name = "http-body" version = "0.4.6" @@ -1543,7 +1586,30 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7ceab25649e9960c0311ea418d17bee82c0dcec1bd053b5f9a66e265a693bed2" dependencies = [ "bytes", - "http", + "http 0.2.12", + "pin-project-lite", +] + +[[package]] +name = "http-body" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" +dependencies = [ + "bytes", + "http 1.1.0", +] + +[[package]] +name = "http-body-util" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +dependencies = [ + "bytes", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", "pin-project-lite", ] @@ -1581,9 +1647,9 @@ dependencies = [ "futures-channel", "futures-core", "futures-util", - "h2", - "http", - "http-body", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", "httparse", "httpdate", "itoa", @@ -1595,6 +1661,43 @@ dependencies = [ "want", ] +[[package]] +name = "hyper" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50dfd22e0e76d0f662d429a5f80fcaf3855009297eab6a0a9f8543834744ba05" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "httparse", + "itoa", + "pin-project-lite", + "smallvec", + "tokio", + "want", +] + +[[package]] +name = "hyper-rustls" +version = "0.27.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +dependencies = [ + "futures-util", + "http 1.1.0", + "hyper 1.4.1", + "hyper-util", + "rustls", + "rustls-pki-types", + "tokio", + "tokio-rustls", + "tower-service", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -1602,10 +1705,45 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper", + "hyper 0.14.28", + "native-tls", + "tokio", + "tokio-native-tls", +] + +[[package]] +name = "hyper-tls" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" +dependencies = [ + "bytes", + "http-body-util", + "hyper 1.4.1", + "hyper-util", "native-tls", "tokio", "tokio-native-tls", + "tower-service", +] + +[[package]] +name = "hyper-util" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "41296eb09f183ac68eec06e03cdbea2e759633d4067b2f6552fc2e009bcad08b" +dependencies = [ + "bytes", + "futures-channel", + "futures-util", + "http 1.1.0", + "http-body 1.0.1", + "hyper 1.4.1", + "pin-project-lite", + "socket2", + "tokio", + "tower-service", + "tracing", ] [[package]] @@ -1692,7 +1830,7 @@ dependencies = [ "pem", "pretty_assertions", "regex", - "reqwest", + "reqwest 0.11.27", "serde", "serde_cbor", "serde_json", @@ -1775,7 +1913,7 @@ dependencies = [ "libcryptsetup-rs-sys", "log", "pkg-config", - "semver 1.0.22", + "semver", "serde_json", "uuid", ] @@ -1789,7 +1927,7 @@ dependencies = [ "bindgen 0.68.1", "cc", "pkg-config", - "semver 1.0.22", + "semver", ] [[package]] @@ -1799,7 +1937,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c2a198fb6b0eada2a8df47933734e6d35d350665a33a3593d7164fa52c75c19" dependencies = [ "cfg-if 1.0.0", - "windows-targets 0.52.4", + "windows-targets 0.48.5", ] [[package]] @@ -1848,19 +1986,12 @@ checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" [[package]] name = "mbox" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9efb73102e7bed0647af358182fba033b32c9c57a744cdff05ea2c0f8a1e9c2e" +checksum = "26d142aeadbc4e8c679fc6d93fbe7efe1c021fa7d80629e615915b519e3bc6de" dependencies = [ "libc", - "once_cell", - "pest", - "proc-macro2", - "rustc_version", "stable_deref_trait", - "syn 1.0.107", - "thiserror", - "ucd-trie", ] [[package]] @@ -1929,7 +2060,7 @@ dependencies = [ "bytes", "encoding_rs", "futures-util", - "http", + "http 0.2.12", "httparse", "log", "memchr", @@ -2057,9 +2188,12 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.14.0" +version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f7254b99e31cad77da24b08ebf628882739a608578bb1bcdfc1f9c21260d7c0" +checksum = "82881c4be219ab5faaf2ad5e5e5ecdff8c66bd7402ca3160975c93b24961afd1" +dependencies = [ + "portable-atomic", +] [[package]] name = "opaque-debug" @@ -2368,6 +2502,12 @@ version = "0.3.30" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" +[[package]] +name = "portable-atomic" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc9c68a3f6da06753e9335d63e27f6b9754dd1920d941135b7ea8224f141adb2" + [[package]] name = "powerfmt" version = "0.2.0" @@ -2573,11 +2713,11 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-tls", + "h2 0.3.26", + "http 0.2.12", + "http-body 0.4.6", + "hyper 0.14.28", + "hyper-tls 0.5.0", "ipnet", "js-sys", "log", @@ -2586,12 +2726,12 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "serde", "serde_json", "serde_urlencoded", - "sync_wrapper", - "system-configuration", + "sync_wrapper 0.1.2", + "system-configuration 0.5.1", "tokio", "tokio-native-tls", "tower-service", @@ -2602,12 +2742,71 @@ dependencies = [ "winreg", ] +[[package]] +name = "reqwest" +version = "0.12.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8f4955649ef5c38cc7f9e8aa41761d48fb9677197daea9984dc54f56aad5e63" +dependencies = [ + "base64 0.22.1", + "bytes", + "encoding_rs", + "futures-channel", + "futures-core", + "futures-util", + "h2 0.4.6", + "http 1.1.0", + "http-body 1.0.1", + "http-body-util", + "hyper 1.4.1", + "hyper-rustls", + "hyper-tls 0.6.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "rustls-pemfile 2.1.3", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.1", + "system-configuration 0.6.1", + "tokio", + "tokio-native-tls", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "windows-registry", +] + [[package]] name = "retry" version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ac95c60a949a63fd2822f4964939662d8f2c16c4fa0624fd954bc6e703b9a3f6" +[[package]] +name = "ring" +version = "0.17.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +dependencies = [ + "cc", + "cfg-if 1.0.0", + "getrandom", + "libc", + "spin", + "untrusted", + "windows-sys 0.52.0", +] + [[package]] name = "ron" version = "0.7.1" @@ -2641,15 +2840,6 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0dfe2087c51c460008730de8b57e6a320782fbfb312e1f4d520e6c6fae155ee" -dependencies = [ - "semver 0.11.0", -] - [[package]] name = "rustix" version = "0.38.32" @@ -2663,6 +2853,19 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "rustls" +version = "0.23.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dabaac7466917e566adb06783a81ca48944c6898a1b08b9374106dd671f4c8" +dependencies = [ + "once_cell", + "rustls-pki-types", + "rustls-webpki", + "subtle", + "zeroize", +] + [[package]] name = "rustls-pemfile" version = "1.0.4" @@ -2672,6 +2875,33 @@ dependencies = [ "base64 0.21.7", ] +[[package]] +name = "rustls-pemfile" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "196fe16b00e106300d3e45ecfcb764fa292a535d7326a29a5875c579c7417425" +dependencies = [ + "base64 0.22.1", + "rustls-pki-types", +] + +[[package]] +name = "rustls-pki-types" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e696e35370c65c9c541198af4543ccd580cf17fc25d8e05c5a242b202488c55" + +[[package]] +name = "rustls-webpki" +version = "0.102.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +dependencies = [ + "ring", + "rustls-pki-types", + "untrusted", +] + [[package]] name = "ryu" version = "1.0.17" @@ -2749,30 +2979,12 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f301af10236f6df4160f7c3f04eec6dbc70ace82d23326abad5edee88801c6b6" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.22" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "92d43fe69e652f3df9bdc2b85b2854a0825b86e4fb76bc44d945137d053639ca" -[[package]] -name = "semver-parser" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0bef5b7f9e0df16536d3961cfb6e84331c065b4066afb39768d0e319411f7" -dependencies = [ - "pest", -] - [[package]] name = "serde" version = "1.0.193" @@ -3026,9 +3238,9 @@ checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" [[package]] name = "subtle" -version = "2.4.1" +version = "2.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" @@ -3058,6 +3270,15 @@ version = "0.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" +dependencies = [ + "futures-core", +] + [[package]] name = "sys-info" version = "0.9.1" @@ -3076,7 +3297,18 @@ checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", "core-foundation", - "system-configuration-sys", + "system-configuration-sys 0.5.0", +] + +[[package]] +name = "system-configuration" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c879d448e9d986b661742763247d3693ed13609438cf3d006f51f5368a5ba6b" +dependencies = [ + "bitflags 2.5.0", + "core-foundation", + "system-configuration-sys 0.6.0", ] [[package]] @@ -3089,6 +3321,16 @@ dependencies = [ "libc", ] +[[package]] +name = "system-configuration-sys" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e1d1b10ced5ca923a1fcb8d03e96b8d3268065d724548c0211415ff6ac6bac4" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "tar" version = "0.4.41" @@ -3271,6 +3513,17 @@ dependencies = [ "tokio", ] +[[package]] +name = "tokio-rustls" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +dependencies = [ + "rustls", + "rustls-pki-types", + "tokio", +] + [[package]] name = "tokio-stream" version = "0.1.15" @@ -3351,9 +3604,9 @@ checksum = "e421abadd41a4225275504ea4d6566923418b7f05506fbc9c0fe86ba7396114b" [[package]] name = "tss-esapi" -version = "7.5.0" +version = "7.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d36722a0888ff29225d11ea205f10319d6cb4d072ef3c91bf3509f7f476d89e3" +checksum = "a9ba6594ded739cb539f8ffcd3713f6c21d4525c47314bbc6de15c0cd251aedf" dependencies = [ "bitfield", "enumflags2", @@ -3392,7 +3645,7 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http", + "http 0.2.12", "httparse", "log", "rand 0.8.5", @@ -3509,6 +3762,12 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "673aac59facbab8a9007c7f6108d11f63b603f7cabff99fabf650fea5c32b861" +[[package]] +name = "untrusted" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecb6da28b8a351d773b68d5825ac39017e680750f980f3a1a85cd8dd28a47c1" + [[package]] name = "url" version = "2.5.0" @@ -3582,15 +3841,15 @@ dependencies = [ "futures-channel", "futures-util", "headers", - "http", - "hyper", + "http 0.2.12", + "hyper 0.14.28", "log", "mime", "mime_guess", "multer", "percent-encoding", "pin-project", - "rustls-pemfile", + "rustls-pemfile 1.0.4", "scoped-tls", "serde", "serde_json", @@ -3611,7 +3870,7 @@ checksum = "555042eb78480c0d25586d53d85a60769c9d3dc7296e1db6371724e54b7662a1" dependencies = [ "async-session", "async-trait", - "http", + "http 0.2.12", "serde", "tokio", "warp", @@ -3748,7 +4007,37 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-registry" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +dependencies = [ + "windows-result", + "windows-strings", + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-result" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +dependencies = [ + "windows-targets 0.52.6", +] + +[[package]] +name = "windows-strings" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +dependencies = [ + "windows-result", + "windows-targets 0.52.6", ] [[package]] @@ -3766,7 +4055,7 @@ version = "0.52.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "282be5f36a8ce781fad8c8ae18fa3f9beff57ec1b52cb3de0789201425d9a33d" dependencies = [ - "windows-targets 0.52.4", + "windows-targets 0.52.6", ] [[package]] @@ -3786,17 +4075,18 @@ dependencies = [ [[package]] name = "windows-targets" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dd37b7e5ab9018759f893a1952c9420d060016fc19a472b4bb20d1bdd694d1b" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "windows_aarch64_gnullvm 0.52.4", - "windows_aarch64_msvc 0.52.4", - "windows_i686_gnu 0.52.4", - "windows_i686_msvc 0.52.4", - "windows_x86_64_gnu 0.52.4", - "windows_x86_64_gnullvm 0.52.4", - "windows_x86_64_msvc 0.52.4", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] @@ -3807,9 +4097,9 @@ checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" [[package]] name = "windows_aarch64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf46cf4c365c6f2d1cc93ce535f2c8b244591df96ceee75d8e83deb70a9cac9" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] name = "windows_aarch64_msvc" @@ -3819,9 +4109,9 @@ checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" [[package]] name = "windows_aarch64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da9f259dd3bcf6990b55bffd094c4f7235817ba4ceebde8e6d11cd0c5633b675" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_i686_gnu" @@ -3831,9 +4121,15 @@ checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" [[package]] name = "windows_i686_gnu" -version = "0.52.4" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b474d8268f99e0995f25b9f095bc7434632601028cf86590aea5c8a5cb7801d3" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" [[package]] name = "windows_i686_msvc" @@ -3843,9 +4139,9 @@ checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" [[package]] name = "windows_i686_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1515e9a29e5bed743cb4415a9ecf5dfca648ce85ee42e15873c3cd8610ff8e02" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_x86_64_gnu" @@ -3855,9 +4151,9 @@ checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" [[package]] name = "windows_x86_64_gnu" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eee091590e89cc02ad514ffe3ead9eb6b660aedca2183455434b93546371a03" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" [[package]] name = "windows_x86_64_gnullvm" @@ -3867,9 +4163,9 @@ checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" [[package]] name = "windows_x86_64_gnullvm" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ca79f2451b49fa9e2af39f0747fe999fcda4f5e241b2898624dca97a1f2177" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_msvc" @@ -3879,9 +4175,9 @@ checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" [[package]] name = "windows_x86_64_msvc" -version = "0.52.4" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32b752e52a2da0ddfbdbcc6fceadfeede4c939ed16d13e648833a61dfb611ed8" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winreg" diff --git a/manufacturing-server/src/main.rs b/manufacturing-server/src/main.rs index cb1237044..168201173 100644 --- a/manufacturing-server/src/main.rs +++ b/manufacturing-server/src/main.rs @@ -273,9 +273,52 @@ async fn main() -> Result<()> { }); // Initialize handlers - let hello = warp::get().map(|| "Hello from the manufacturing server"); + let hello = warp::path::end().map(|| "Hello from the manufacturing server"); let ud = user_data.clone(); - let handler_export = warp::get() + let handler_ovs = warp::path!("ov" / String) + .map(move |guid| (guid, ud.clone())) + .and_then( + |(guid, ud): (String, Arc)| async move { + let typed_guid = match Guid::from_str(&guid) { + Ok(v) => v, + Err(e) => { + return Err(Rejection::from(fdo_http_wrapper::server::Error::new( + ErrorCode::InternalServerError, + fdo_data_formats::constants::MessageType::Invalid, + &e.to_string(), + ))) + } + }; + let ov = match ud.ownership_voucher_store.load_data(&typed_guid).await { + Ok(ov) => ov.unwrap(), + Err(e) => { + return Err(Rejection::from(fdo_http_wrapper::server::Error::new( + ErrorCode::InternalServerError, + fdo_data_formats::constants::MessageType::Invalid, + &format!("Error loading ownership voucher with guid {}: {}", guid, e), + ))) + } + }; + let ov_pem = match ov.to_pem() { + Ok(v) => v, + Err(e) => { + return Err(Rejection::from(fdo_http_wrapper::server::Error::new( + ErrorCode::InternalServerError, + fdo_data_formats::constants::MessageType::Invalid, + &format!("Error converting ownership voucher to pem: {}", e), + ))) + } + }; + let mut res = Response::new(ov_pem.into()); + res.headers_mut().insert( + "Content-Type", + warp::http::header::HeaderValue::from_static("application/x-pem-file"), + ); + Ok(res) + }, + ); + let ud = user_data.clone(); + let handler_export = warp::post() .and(warp::path("export").map(move || (ud.clone())).and_then( |ud: Arc| async move { match ud.ownership_voucher_store.load_all_data().await { @@ -371,6 +414,7 @@ async fn main() -> Result<()> { .or(handler_diun_provide_key), ) .or(handler_export) + .or(handler_ovs) .recover(fdo_http_wrapper::server::handle_rejection) .with(warp::log("manufacturing-server")); diff --git a/owner-tool/Cargo.toml b/owner-tool/Cargo.toml index 46e1d1a20..a91d1c4a9 100644 --- a/owner-tool/Cargo.toml +++ b/owner-tool/Cargo.toml @@ -15,6 +15,7 @@ serde = { version = "1", features = ["derive"] } serde_yaml = "0.9" tokio = { version = "1", features = ["full"] } tss-esapi = { version = "7.4", features = ["generate-bindings"] } +reqwest = { version = "0.12.7", features = ["blocking"] } fdo-util = { path = "../util", version = "0.5.0" } fdo-data-formats = { path = "../data-formats", version = "0.5.0" } diff --git a/owner-tool/src/main.rs b/owner-tool/src/main.rs index bf8294b35..c214b6d3d 100644 --- a/owner-tool/src/main.rs +++ b/owner-tool/src/main.rs @@ -1,3 +1,5 @@ +use std::io::Cursor; +use std::path::PathBuf; use std::{convert::TryFrom, env, fs, io::Write, path::Path, str::FromStr}; use anyhow::{bail, Context, Error, Result}; @@ -6,7 +8,6 @@ use fdo_db::models::ManufacturerOV; use fdo_db::postgres::PostgresOwnerDB; use fdo_db::sqlite::SqliteOwnerDB; use fdo_db::DBStoreOwner; -use fdo_db::{postgres::PostgresManufacturerDB, sqlite::SqliteManufacturerDB, DBStoreManufacturer}; use openssl::{ asn1::{Asn1Integer, Asn1Time}, bn::BigNum, @@ -111,14 +112,14 @@ struct ExtendOwnershipVoucherArguments { #[derive(Args)] struct ExportManufacturerVouchersArguments { - /// Type of the Manufacturer DB holding the OVs - db_type: DBType, - /// DB connection URL or path to the DB file - db_url: String, - /// Path to dir where the OVs will be exported - path: String, + /// Manufacturer server URL + manufacturer_server_url: String, /// GUID of the voucher to be exported, if no GUID is given all the OVs will be exported - guid: Option, + #[clap(long, action = ArgAction::Set)] + device_guid: Option, + /// Path to dir where the OVs will be exported, or the current working directory + #[clap(long, action = ArgAction::Set)] + path: Option, } #[derive(Copy, Clone, ValueEnum)] @@ -147,7 +148,7 @@ async fn main() -> Result<()> { Commands::DumpOwnershipVoucher(args) => dump_voucher(&args), Commands::DumpDeviceCredential(args) => dump_devcred(&args), Commands::ExtendOwnershipVoucher(args) => extend_voucher(&args), - Commands::ExportManufacturerVouchers(args) => export_manufacturer_vouchers(&args), + Commands::ExportManufacturerVouchers(args) => export_manufacturer_vouchers(&args).await, Commands::ImportOwnershipVouchers(args) => import_ownership_vouchers(&args), } } @@ -634,48 +635,38 @@ fn _write_ov_to_disk(db_ov: &ManufacturerOV, path: &Path) -> Result<()> { Ok(()) } -fn export_manufacturer_vouchers(args: &ExportManufacturerVouchersArguments) -> Result<()> { - let path = Path::new(&args.path); +async fn export_manufacturer_vouchers(args: &ExportManufacturerVouchersArguments) -> Result<()> { + let path = &args.path.clone().unwrap_or(env::current_dir()?); if !path.is_dir() { bail!("Please provide a path to a valid directory."); } - match &args.guid { - Some(guid) => { - // export single - let db_ov = match args.db_type { - DBType::Sqlite => { - let pool = SqliteManufacturerDB::get_conn_pool(args.db_url.clone()); - let conn = &mut pool.get()?; - SqliteManufacturerDB::get_ov(guid, conn)? - } - DBType::Postgres => { - let pool = PostgresManufacturerDB::get_conn_pool(args.db_url.clone()); - let conn = &mut pool.get()?; - PostgresManufacturerDB::get_ov(guid, conn)? - } - }; - _write_ov_to_disk(&db_ov, path)?; - println!("OV {guid} exported.") - } - None => { - // export all - let db_ovs = match args.db_type { - DBType::Sqlite => { - let pool = SqliteManufacturerDB::get_conn_pool(args.db_url.clone()); - let conn = &mut pool.get()?; - SqliteManufacturerDB::get_all_ovs(conn)? - } - DBType::Postgres => { - let pool = PostgresManufacturerDB::get_conn_pool(args.db_url.clone()); - let conn = &mut pool.get()?; - PostgresManufacturerDB::get_all_ovs(conn)? - } - }; - for db_ov in db_ovs { - _write_ov_to_disk(&db_ov, path)?; - } - println!("OV/s exported."); - } + let client = reqwest::Client::new(); + if let Some(device_guid) = &args.device_guid { + let ov_path = path.join(device_guid); + let mut ov_file = File::create(ov_path)?; + let ov = client + .get(format!( + "{}/ov/{}", + &args.manufacturer_server_url, device_guid + )) + .send() + .await? + .text() + .await?; + ov_file.write_all(ov.as_bytes())?; + println!("OV {device_guid} exported.") + } else { + let ovs_tar_path = path.join("export.tar"); + let mut ovs_tar = File::create(ovs_tar_path)?; + let ovs = client + .post(format!("{}/export", &args.manufacturer_server_url)) + .send() + .await? + .bytes() + .await?; + let mut content = Cursor::new(ovs); + std::io::copy(&mut content, &mut ovs_tar)?; + println!("OV/s exported."); } Ok(()) } diff --git a/test/fdo-postgres.sh b/test/fdo-postgres.sh index 274576866..65075f822 100755 --- a/test/fdo-postgres.sh +++ b/test/fdo-postgres.sh @@ -160,7 +160,9 @@ sudo podman run \ --privileged \ -v "$PWD"/export-ov:/export-ov:z \ localhost/clients \ - fdo-owner-tool export-manufacturer-vouchers postgres "postgresql://${POSTGRES_USERNAME}:${POSTGRES_PASSWORD}@${POSTGRES_IP}/${POSTGRES_DB}" /export-ov/ | grep "exported" + fdo-owner-tool export-manufacturer-vouchers "http://${FDO_MANUFACTURING_ADDRESS}:8080" --path /export-ov | grep "exported" +sudo tar xvf "$PWD"/export-ov/export.tar -C "$PWD"/export-ov +sudo rm -rf "$PWD"/export-ov/export.tar EXPORTED_FILE=$(ls -1 export-ov) greenprint "🔧 Import OV into owner db" sudo podman run \ @@ -194,5 +196,5 @@ sudo podman ps -a greenprint "🔧 Collecting container logs" sudo podman logs rendezvous-server -rm -rf initdb export-ov +sudo rm -rf initdb export-ov exit 0 diff --git a/test/fmf/tests/onboarding/run-onboarding.sh b/test/fmf/tests/onboarding/run-onboarding.sh index c4959e32e..50c72dee4 100755 --- a/test/fmf/tests/onboarding/run-onboarding.sh +++ b/test/fmf/tests/onboarding/run-onboarding.sh @@ -172,7 +172,9 @@ export_import_vouchers() { MANUFACTURER_EXPORT_DIR="${STORES_DIR}/manufacturer_export_dir" rm -rf "${MANUFACTURER_EXPORT_DIR}" mkdir -p "${MANUFACTURER_EXPORT_DIR}" - fdo-owner-tool export-manufacturer-vouchers "$(tr [:upper:] [:lower:] <<< ${OV_STORE_DRIVER})" "${DATABASE_URL}" "${MANUFACTURER_EXPORT_DIR}" + fdo-owner-tool export-manufacturer-vouchers "http://${PRIMARY_IP}:8080" --path "${MANUFACTURER_EXPORT_DIR}" + sudo tar xvf "${MANUFACTURER_EXPORT_DIR}"/export.tar -C "${MANUFACTURER_EXPORT_DIR}" + sudo rm -rf "${MANUFACTURER_EXPORT_DIR}"/export.tar fdo-owner-tool import-ownership-vouchers "$(tr [:upper:] [:lower:] <<< ${OV_STORE_DRIVER})" "${DATABASE_URL}" "${MANUFACTURER_EXPORT_DIR}" }