From b60e027a612775b5501539755b546c5fb42eeb0a Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Tue, 9 May 2023 00:40:56 +0200 Subject: [PATCH 1/3] hidapi-async: update libusb/hidapi submodule of the hidapi dep This fixes https://github.com/digitalbitbox/bitbox-bridge/issues/43 - a regression where libusb/hidapi would report the interface number of both (HWW and U2F) as 0 instead of 0 and 1 on macOS 13.3. The fix is to pull the upstream fix: https://github.com/libusb/hidapi/pull/534. hidapi-rs was forked to benma/hidapi-rs to pull in the latest libusb/hidapi that contains the fix. This also led me down a rabbit-hole of updating the Docker base image and all sorts of dependencies. Code changes are clippy fixes. libusb dep was changed to libudev, as hidapi-rs switched to the hidraw hidapi backend by default (was libusb backend before) in https://github.com/ruabmbua/hidapi-rs/commit/bbb7f3eb4ef91f71cbe2b39b4960019aa110112e. Docker base image updated from 16.04 to 20.04 as as 16.04 and 18.04 reached end-of-life. --- .cargo/config | 8 +- .github/workflows/ci.yml | 10 +- Cargo.lock | 1089 ++++++++++++----------- README.md | 2 +- bitbox-bridge/Cargo.toml | 8 +- bitbox-bridge/release/Dockerfile | 30 +- bitbox-bridge/release/darwin/release.sh | 4 +- bitbox-bridge/src/daemon/windows.rs | 2 + bitbox-bridge/src/main.rs | 2 +- bitbox-bridge/src/usb.rs | 2 +- bitbox-bridge/src/web.rs | 2 +- hidapi-async/Cargo.toml | 3 +- hidapi-async/src/lib.rs | 4 +- u2fframing/src/lib.rs | 30 +- 14 files changed, 628 insertions(+), 568 deletions(-) diff --git a/.cargo/config b/.cargo/config index 061b9e4..99916d3 100644 --- a/.cargo/config +++ b/.cargo/config @@ -1,10 +1,10 @@ [target.x86_64-apple-darwin] -linker = "x86_64-apple-darwin20.2-clang" -ar = "x86_64-apple-darwin20.2-ar" +linker = "x86_64-apple-darwin21.4-clang" +ar = "x86_64-apple-darwin21.4-ar" [target.aarch64-apple-darwin] -linker = "aarch64-apple-darwin20.2-clang" -ar = "aarch64-apple-darwin20.2-ar" +linker = "aarch64-apple-darwin21.4-clang" +ar = "aarch64-apple-darwin21.4-ar" [target.x86_64-pc-windows-gnu] linker = "x86_64-w64-mingw32-gcc" diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9aab570..5c83ca4 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: override: true - name: Install system package deps - run: sudo apt-get install libusb-1.0-0-dev + run: sudo apt-get install libudev-dev - name: Run cargo check uses: actions-rs/cargo@v1 @@ -44,7 +44,7 @@ jobs: components: rustfmt, clippy - name: Install system package deps - run: sudo apt-get install libusb-1.0-0-dev + run: sudo apt-get install libudev-dev - name: Run cargo fmt uses: actions-rs/cargo@v1 @@ -73,7 +73,7 @@ jobs: override: true - name: Install system package deps - run: sudo apt-get install libusb-1.0-0-dev + run: sudo apt-get install libudev-dev - name: Run cargo test uses: actions-rs/cargo@v1 @@ -95,7 +95,7 @@ jobs: override: true - name: Install package deps - run: sudo apt-get install libusb-1.0-0-dev -y + run: sudo apt-get install libudev-dev -y - name: Run cargo build uses: actions-rs/cargo@v1 @@ -125,7 +125,7 @@ jobs: - name: Install package deps run: > - sudo apt-get install libusb-1.0-0-dev -y; + sudo apt-get install libudev-dev -y; sudo apt-get install ruby -y; sudo gem install --no-doc fpm; cargo install toml-echo diff --git a/Cargo.lock b/Cargo.lock index 432dc04..7e61c81 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -17,7 +17,7 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee49baf6cb617b853aa8d93bf420db2383fab46d314482ca2803b40d5fde979b" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -34,13 +34,13 @@ dependencies = [ "futures-io", "futures-timer", "kv-log-macro", - "log 0.4.8", + "log", "memchr", - "mio", + "mio 0.6.21", "mio-uds", "num_cpus", "once_cell", - "pin-project-lite", + "pin-project-lite 0.1.4", "pin-utils", "slab", ] @@ -52,7 +52,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ac2c016b079e771204030951c366db398864f5026f84a44dafb0ff20f02085d" dependencies = [ "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -63,7 +63,7 @@ checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" dependencies = [ "hermit-abi", "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -74,9 +74,9 @@ checksum = "1d49d90015b3c36167a20fe2810c5cd875ad504b39cff3d4eae7977e6b7c1cb2" [[package]] name = "autocfg" -version = "1.0.0" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8aac770f1885fd7e387acedd76065302551364496e46b3dd00860b2f8359b9d" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" [[package]] name = "base64" @@ -84,6 +84,18 @@ version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b41b7ea54a0c9d92199de89e20e58d49f02f8e699814ef3fdf266f6f748d15c7" +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.21.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" + [[package]] name = "bitbox-bridge" version = "1.5.0" @@ -95,7 +107,7 @@ dependencies = [ "futures-util", "hidapi-async", "hyper", - "log 0.4.8", + "log", "percent-encoding", "tera", "thiserror", @@ -107,9 +119,9 @@ dependencies = [ [[package]] name = "bitflags" -version = "1.2.1" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "block-buffer" @@ -120,7 +132,16 @@ dependencies = [ "block-padding", "byte-tools", "byteorder", - "generic-array", + "generic-array 0.12.3", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array 0.14.7", ] [[package]] @@ -141,16 +162,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "buf_redux" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b953a6887648bb07a535631f2bc00fbdb2a2216f135552cb3f534ed136b9c07f" -dependencies = [ - "memchr", - "safemem", -] - [[package]] name = "byte-tools" version = "0.3.1" @@ -165,19 +176,15 @@ checksum = "08c48aae112d48ed9f069b33538ea9e3e90aa263cfa3d1c24309612b1f7472de" [[package]] name = "bytes" -version = "0.4.12" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "206fdffcfa2df7cbe15601ef46c813fce0965eb3286db6b56c583b814b51c81c" -dependencies = [ - "byteorder", - "iovec", -] +checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" [[package]] name = "bytes" -version = "0.5.4" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "130aac562c0dd69c56b3b1cc8ffd2e17be31d0b6c25b61c96b76231aa23e39e1" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" [[package]] name = "c2-chacha" @@ -200,6 +207,12 @@ version = "0.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4785bdd1c96b2a846b2bd7cc02e86b6b3dbf14e7e53446c4f54c92a361040822" +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + [[package]] name = "chrono" version = "0.4.11" @@ -237,12 +250,12 @@ dependencies = [ ] [[package]] -name = "cloudabi" -version = "0.0.3" +name = "cpufeatures" +version = "0.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddfc5b9aa5d4507acaf872de71051dfd0e309860e88966e1051e462a077aac4f" +checksum = "3e4c1eaa2012c47becbbad2ab175484c2a84d1185b566fb2cc5b8707343dfe58" dependencies = [ - "bitflags", + "libc", ] [[package]] @@ -271,7 +284,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5064ebdbf05ce3cb95e45c8b086f72263f4166b29b97f6baff7ef7fe047b55ac" dependencies = [ "autocfg 0.1.7", - "cfg-if", + "cfg-if 0.1.10", "crossbeam-utils", "lazy_static", "memoffset", @@ -285,10 +298,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ce446db02cdc3165b94ae73111e570793400d0794e46125cc4056c81cbb039f4" dependencies = [ "autocfg 0.1.7", - "cfg-if", + "cfg-if 0.1.10", "lazy_static", ] +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array 0.14.7", + "typenum", +] + [[package]] name = "deunicode" version = "0.4.3" @@ -301,14 +324,27 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f3d0c8c8752312f9713efd397ff63acb9f85585afbf179282e720e7704954dd5" dependencies = [ - "generic-array", + "generic-array 0.12.3", ] [[package]] -name = "dtoa" -version = "0.4.5" +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", +] + +[[package]] +name = "encoding_rs" +version = "0.8.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4358a9e11b9a09cf52383b451b49a169e8d797b68aa02301ff586d70d9661ea3" +checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +dependencies = [ + "cfg-if 1.0.0", +] [[package]] name = "env_logger" @@ -318,25 +354,11 @@ checksum = "44533bbbb3bb3c1fa17d9f2e4e38bbbaf8396ba82193c4cb1b6445d711445d36" dependencies = [ "atty", "humantime", - "log 0.4.8", + "log", "regex", "termcolor", ] -[[package]] -name = "err-derive" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b41487fadaa500d02a819eefcde5f713599a01dd51626ef25d2d72d87115667b" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "rustc_version", - "syn", - "synstructure", -] - [[package]] name = "fake-simd" version = "0.1.2" @@ -350,10 +372,14 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fad85553e09a6f881f739c29f0b00b0f01357c743266d478b68951ce23285f3" [[package]] -name = "fuchsia-cprng" -version = "0.1.1" +name = "form_urlencoded" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06f77d526c1a601b7c4cdd98f54b5eaabffc14d5f2f0296febdc7f357c6d3ba" +checksum = "5fc25a87fa4fd2094bffb06925852034d90a17f0d1e05197d4956d3555752191" +dependencies = [ + "matches", + "percent-encoding", +] [[package]] name = "fuchsia-zircon" @@ -373,9 +399,9 @@ checksum = "3dcaa9ae7725d12cdb85b3ad99a434db70b468c09ded17e012d86b5c1010f7a7" [[package]] name = "futures" -version = "0.3.4" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c329ae8753502fb44ae4fc2b622fa2a94652c41e795143765ba0927f92ab780" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ "futures-channel", "futures-core", @@ -388,9 +414,9 @@ dependencies = [ [[package]] name = "futures-channel" -version = "0.3.4" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0c77d04ce8edd9cb903932b608268b3fffec4163dc053b3b402bf47eac1f1a8" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ "futures-core", "futures-sink", @@ -398,15 +424,15 @@ dependencies = [ [[package]] name = "futures-core" -version = "0.3.4" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f25592f769825e89b92358db00d26f965761e094951ac44d3663ef25b7ac464a" +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] name = "futures-executor" -version = "0.3.4" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f674f3e1bcb15b37284a90cedf55afdba482ab061c407a9c0ebbd0f3109741ba" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ "futures-core", "futures-task", @@ -415,33 +441,32 @@ dependencies = [ [[package]] name = "futures-io" -version = "0.3.4" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a638959aa96152c7a4cddf50fcb1e3fede0583b27157c26e67d6f99904090dc6" +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] name = "futures-macro" -version = "0.3.4" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a5081aa3de1f7542a794a397cde100ed903b0630152d0973479018fd85423a7" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ - "proc-macro-hack", "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] name = "futures-sink" -version = "0.3.4" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3466821b4bc114d95b087b850a724c6f83115e929bc88f1fa98a3304a944c8a6" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] name = "futures-task" -version = "0.3.4" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b0a34e53cf6cdcd0178aa573aed466b646eb3db769570841fda0c7ede375a27" +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] name = "futures-timer" @@ -451,9 +476,9 @@ checksum = "a1de7508b218029b0f01662ed8f61b1c964b3ae99d6f25462d0f55a595109df6" [[package]] name = "futures-util" -version = "0.3.4" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22766cf25d64306bedf0384da004d05c9974ab104fcc4528f1236181c18004c5" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ "futures-channel", "futures-core", @@ -462,9 +487,8 @@ dependencies = [ "futures-sink", "futures-task", "memchr", + "pin-project-lite 0.2.9", "pin-utils", - "proc-macro-hack", - "proc-macro-nested", "slab", ] @@ -477,15 +501,36 @@ dependencies = [ "typenum", ] +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", +] + [[package]] name = "getrandom" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7abc8dd8451921606d809ba32e95b6111925cd2906060d2dcc29c070220503eb" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", - "wasi", + "wasi 0.9.0+wasi-snapshot-preview1", +] + +[[package]] +name = "getrandom" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c85e1d9ab2eadba7e5040d4e09cbd6d072b76a557ad64e797c2cb9d4da21d7e4" +dependencies = [ + "cfg-if 1.0.0", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", ] [[package]] @@ -497,7 +542,7 @@ dependencies = [ "aho-corasick", "bstr", "fnv", - "log 0.4.8", + "log", "regex", ] @@ -513,21 +558,22 @@ dependencies = [ [[package]] name = "h2" -version = "0.2.1" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9433d71e471c1736fd5a61b671fc0b148d7a2992f666c958d03cd8feb3b88d1" +checksum = "6b67e66362108efccd8ac053abafc8b7a8d86a37e6e48fc4f6f7485eb5e9e6a5" dependencies = [ - "bytes 0.5.4", + "bytes 1.4.0", "fnv", "futures-core", "futures-sink", "futures-util", - "http 0.2.0", + "http", "indexmap", - "log 0.4.8", "slab", "tokio", - "tokio-util", + "tokio-util 0.6.10", + "tracing", + "tracing-futures", ] [[package]] @@ -536,12 +582,12 @@ version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a72b4bd7cbbf0c22190e82f02517f456a6b9be24c25a6827b5802e478b8c2d70" dependencies = [ - "base64", + "base64 0.11.0", "bitflags", "bytes 0.5.4", "headers-core", - "http 0.2.0", - "mime 0.3.16", + "http", + "mime", "sha-1", "time", ] @@ -552,7 +598,7 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e7f66481bfee273957b1f20485a4ff3362987f85b2c236580d81b4eb7a326429" dependencies = [ - "http 0.2.0", + "http", ] [[package]] @@ -566,13 +612,13 @@ dependencies = [ [[package]] name = "hidapi" -version = "1.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81e07da7e8614133e88b3a93b7352eb3729e3ccd82d5ab661adf23bef1761bf8" +version = "2.3.1" +source = "git+https://github.com/benma/hidapi-rs.git?branch=update-hidapi#2daa7b7d782c6611ffd2fac036f76e6010be26ae" dependencies = [ "cc", "libc", "pkg-config", + "winapi 0.3.9", ] [[package]] @@ -582,21 +628,10 @@ dependencies = [ "async-std", "futures", "hidapi", - "log 0.4.8", + "log", "thiserror", ] -[[package]] -name = "http" -version = "0.1.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6ccf5ede3a895d8856620237b2f02972c1bbc78d2965ad7fe8838d4a0ed41f0" -dependencies = [ - "bytes 0.4.12", - "fnv", - "itoa", -] - [[package]] name = "http" version = "0.2.0" @@ -605,17 +640,18 @@ checksum = "b708cc7f06493459026f53b9a61a7a121a5d1ec6238dee58ea4941132b30156b" dependencies = [ "bytes 0.5.4", "fnv", - "itoa", + "itoa 0.4.5", ] [[package]] name = "http-body" -version = "0.3.1" +version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13d5ff830006f7646652e057693569bfe0d51760c0085a071769d142a205111b" +checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" dependencies = [ - "bytes 0.5.4", - "http 0.2.0", + "bytes 1.4.0", + "http", + "pin-project-lite 0.2.9", ] [[package]] @@ -624,6 +660,12 @@ version = "1.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cd179ae861f0c2e53da70d892f5f3029f9594be0c41dc5269cd371691b1dc2f9" +[[package]] +name = "httpdate" +version = "0.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "494b4d60369511e7dea41cf646832512a94e542f68bb9c49e54518e0f468eb47" + [[package]] name = "humansize" version = "1.1.0" @@ -641,25 +683,25 @@ dependencies = [ [[package]] name = "hyper" -version = "0.13.2" +version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa1c527bbc634be72aa7ba31e4e4def9bbb020f5416916279b7c705cd838893e" +checksum = "8bf09f61b52cfcf4c00de50df88ae423d6c02354e385a86341133b5338630ad1" dependencies = [ - "bytes 0.5.4", + "bytes 1.4.0", "futures-channel", "futures-core", "futures-util", "h2", - "http 0.2.0", + "http", "http-body", "httparse", - "itoa", - "log 0.4.8", - "net2", + "httpdate", + "itoa 0.4.5", "pin-project", - "time", + "socket2", "tokio", "tower-service", + "tracing", "want", ] @@ -684,7 +726,7 @@ dependencies = [ "crossbeam-utils", "globset", "lazy_static", - "log 0.4.8", + "log", "memchr", "regex", "same-file", @@ -699,16 +741,7 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "076f042c5b7b98f31d205f1249267e12a6518c1481e9dae9764af19b707d2292" dependencies = [ - "autocfg 1.0.0", -] - -[[package]] -name = "input_buffer" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e1b822cc844905551931d6f81608ed5f50a79c1078a4e2b4d42dbc7c1eedfbf" -dependencies = [ - "bytes 0.4.12", + "autocfg 1.1.0", ] [[package]] @@ -726,6 +759,12 @@ version = "0.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b8b7a7c0c47db5545ed3fef7468ee7bb5b74691498139e4b3f6a20685dc6dd8e" +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + [[package]] name = "kernel32-sys" version = "0.2.2" @@ -742,7 +781,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c54d9f465d530a752e6ebdc217e081a7a614b48cb200f6f0aee21ba6bc9aabb" dependencies = [ - "log 0.4.8", + "log", ] [[package]] @@ -753,18 +792,9 @@ checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" [[package]] name = "libc" -version = "0.2.66" +version = "0.2.144" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d515b1f41455adea1313a4a2ac8a8a477634fbae63cc6100e3aebb207ce61558" - -[[package]] -name = "log" -version = "0.3.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" -dependencies = [ - "log 0.4.8", -] +checksum = "2b00cc1c228a6782d0f076e7b232802e0c5689d41bb5df366f2a6b6621cfdfe1" [[package]] name = "log" @@ -772,7 +802,7 @@ version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14b6052be84e6b71ab17edffc2eeabf5c2c3ae1fdb464aae35ac50c67a44e1f7" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", ] [[package]] @@ -789,9 +819,9 @@ checksum = "7ffc5c5338469d4d3ea17d269fa8ea3512ad247247c30bd2df69e68309ed0a08" [[package]] name = "memchr" -version = "2.3.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3197e20c7edb283f87c071ddfc7a2cca8f8e0b888c242959846a6fce03c72223" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] name = "memoffset" @@ -802,41 +832,20 @@ dependencies = [ "rustc_version", ] -[[package]] -name = "mime" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba626b8a6de5da682e1caa06bdb42a335aee5a84db8e5046a3e8ab17ba0a3ae0" -dependencies = [ - "log 0.3.9", -] - [[package]] name = "mime" version = "0.3.16" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2a60c7ce501c71e03a9c9c0d35b861413ae925bd979cc7a4e30d060069aaac8d" -[[package]] -name = "mime_guess" -version = "1.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d977de9ee851a0b16e932979515c0f3da82403183879811bc97d50bd9cc50f7" -dependencies = [ - "mime 0.2.6", - "phf", - "phf_codegen", - "unicase 1.4.2", -] - [[package]] name = "mime_guess" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1a0ed03949aef72dbdf3116a383d7b38b4768e6f960528cd6a6044aa9ed68599" dependencies = [ - "mime 0.3.16", - "unicase 2.6.0", + "mime", + "unicase", ] [[package]] @@ -845,19 +854,31 @@ version = "0.6.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "302dec22bcf6bae6dfb69c647187f4b4d0fb6f535521f7bc022430ce8e12008f" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "fuchsia-zircon", "fuchsia-zircon-sys", "iovec", "kernel32-sys", "libc", - "log 0.4.8", + "log", "miow", "net2", "slab", "winapi 0.2.8", ] +[[package]] +name = "mio" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b9d9a46eff5b4ff64b45a9e316a6d1e0bc719ef429cbec4dc630684212bfdf9" +dependencies = [ + "libc", + "log", + "wasi 0.11.0+wasi-snapshot-preview1", + "windows-sys 0.45.0", +] + [[package]] name = "mio-uds" version = "0.6.7" @@ -866,7 +887,7 @@ checksum = "966257a94e196b11bb43aca423754d87429960a768de9414f3691d6957abf125" dependencies = [ "iovec", "libc", - "mio", + "mio 0.6.21", ] [[package]] @@ -882,21 +903,21 @@ dependencies = [ ] [[package]] -name = "multipart" -version = "0.16.1" +name = "multer" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "136eed74cadb9edd2651ffba732b19a450316b680e4f48d6c79e905799e19d01" +checksum = "01acbdc23469fd8fe07ab135923371d5f5a422fbf9c522158677c8eb15bc51c2" dependencies = [ - "buf_redux", + "bytes 1.4.0", + "encoding_rs", + "futures-util", + "http", "httparse", - "log 0.4.8", - "mime 0.2.6", - "mime_guess 1.8.7", - "quick-error", - "rand 0.6.5", - "safemem", - "tempfile", - "twoway", + "log", + "memchr", + "mime", + "spin", + "version_check", ] [[package]] @@ -905,9 +926,9 @@ version = "0.2.33" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42550d9fb7b6684a6d404d9fa7250c2eb2646df731d1c06afc06dcee9e1bcf88" dependencies = [ - "cfg-if", + "cfg-if 0.1.10", "libc", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -916,7 +937,7 @@ version = "0.1.42" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f6ea62e9d81a77cd3ee9a2a5b9b609447857f3d358704331e4ef39eb247fcba" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.1.0", "num-traits", ] @@ -926,7 +947,7 @@ version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c62be47e61d1842b9170f0fdeec8eba98e60e90e5446449a0545e5152acd7096" dependencies = [ - "autocfg 1.0.0", + "autocfg 1.1.0", ] [[package]] @@ -941,9 +962,9 @@ dependencies = [ [[package]] name = "once_cell" -version = "1.3.1" +version = "1.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c601810575c99596d4afc46f78a678c80105117c379eb3650cf99b8a21ce5b" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" [[package]] name = "opaque-debug" @@ -995,7 +1016,7 @@ dependencies = [ "pest_meta", "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1009,63 +1030,24 @@ dependencies = [ "sha-1", ] -[[package]] -name = "phf" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3da44b85f8e8dfaec21adae67f95d93244b2ecf6ad2a692320598dcc8e6dd18" -dependencies = [ - "phf_shared", -] - -[[package]] -name = "phf_codegen" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b03e85129e324ad4166b06b2c7491ae27fe3ec353af72e72cd1654c7225d517e" -dependencies = [ - "phf_generator", - "phf_shared", -] - -[[package]] -name = "phf_generator" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09364cc93c159b8b06b1f4dd8a4398984503483891b0c26b867cf431fb132662" -dependencies = [ - "phf_shared", - "rand 0.6.5", -] - -[[package]] -name = "phf_shared" -version = "0.7.24" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "234f71a15de2288bcb7e3b6515828d22af7ec8598ee6d24c3b526fa0a80b67a0" -dependencies = [ - "siphasher", - "unicase 1.4.2", -] - [[package]] name = "pin-project" -version = "0.4.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7804a463a8d9572f13453c516a5faea534a2403d7ced2f0c7e100eeff072772c" +checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "0.4.8" +version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "385322a45f2ecf3410c68d2a549a4a2685e8051d0f278e39743ff4e451cb9b3f" +checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 1.0.109", ] [[package]] @@ -1074,11 +1056,17 @@ version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "237844750cfbb86f67afe27eee600dfbbcb6188d734139b534cbfbf4f96792ae" +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + [[package]] name = "pin-utils" -version = "0.1.0-alpha.4" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5894c618ce612a3fa23881b152b608bafb8c56cfc22f434a3ba3120b40f7b587" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] name = "pkg-config" @@ -1088,45 +1076,17 @@ checksum = "05da548ad6865900e60eaba7f589cc0783590a92e940c26953ff81ddbab2d677" [[package]] name = "ppv-lite86" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74490b50b9fbe561ac330df47c08f3f33073d2d00c150f719147d7c54522fa1b" - -[[package]] -name = "proc-macro-error" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aeccfe4d5d8ea175d5f0e4a2ad0637e0f4121d63bd99d356fb1f39ab2e7c6097" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "proc-macro-hack" -version = "0.5.11" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ecd45702f76d6d3c75a80564378ae228a85f0b59d2f3ed43c91b4a69eb2ebfc5" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "proc-macro-nested" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "369a6ed065f249a159e06c45752c780bda2fb53c995718f9e484d08daa9eb42e" +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] name = "proc-macro2" -version = "1.0.8" +version = "1.0.56" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acb317c6ff86a4e579dfa00fc5e6cca91ecbb4e7eb2df0468805b674eb88548" +checksum = "2b63bdb0cd06f1f4dedf69b254734f9b45af66e4a031e42a7480257d9898b435" dependencies = [ - "unicode-xid", + "unicode-ident", ] [[package]] @@ -1137,53 +1097,35 @@ checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] name = "quote" -version = "1.0.2" +version = "1.0.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "053a8c8bcc71fcce321828dc897a98ab9760bef03a4fc36693c231e5b3216cfe" +checksum = "8f4f29d145265ec1c483c7c654450edde0bfe043d3938d6972630663356d9500" dependencies = [ "proc-macro2", ] -[[package]] -name = "rand" -version = "0.6.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d71dacdc3c88c1fde3885a3be3fbab9f35724e6ce99467f7d9c5026132184ca" -dependencies = [ - "autocfg 0.1.7", - "libc", - "rand_chacha 0.1.1", - "rand_core 0.4.2", - "rand_hc 0.1.0", - "rand_isaac", - "rand_jitter", - "rand_os", - "rand_pcg", - "rand_xorshift", - "winapi 0.3.8", -] - [[package]] name = "rand" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" dependencies = [ - "getrandom", + "getrandom 0.1.14", "libc", "rand_chacha 0.2.1", "rand_core 0.5.1", - "rand_hc 0.2.0", + "rand_hc", ] [[package]] -name = "rand_chacha" -version = "0.1.1" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "556d3a1ca6600bfcbab7c7c91ccb085ac7fbbcd70e008a98742e7847f4f7bcef" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "autocfg 0.1.7", - "rand_core 0.3.1", + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", ] [[package]] @@ -1197,36 +1139,31 @@ dependencies = [ ] [[package]] -name = "rand_core" +name = "rand_chacha" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6fdeb83b075e8266dcc8762c22776f6877a63111121f5f8c7411e5be7eed4b" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "rand_core 0.4.2", + "ppv-lite86", + "rand_core 0.6.4", ] -[[package]] -name = "rand_core" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c33a3c44ca05fa6f1807d8e6743f3824e8509beca625669633be0acbdf509dc" - [[package]] name = "rand_core" version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" dependencies = [ - "getrandom", + "getrandom 0.1.14", ] [[package]] -name = "rand_hc" -version = "0.1.0" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b40677c7be09ae76218dc623efbf7b18e34bced3f38883af07bb75630a21bc4" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "rand_core 0.3.1", + "getrandom 0.2.9", ] [[package]] @@ -1238,68 +1175,6 @@ dependencies = [ "rand_core 0.5.1", ] -[[package]] -name = "rand_isaac" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded997c9d5f13925be2a6fd7e66bf1872597f759fd9dd93513dd7e92e5a5ee08" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rand_jitter" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1166d5c91dc97b88d1decc3285bb0a99ed84b05cfd0bc2341bdf2d43fc41e39b" -dependencies = [ - "libc", - "rand_core 0.4.2", - "winapi 0.3.8", -] - -[[package]] -name = "rand_os" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b75f676a1e053fc562eafbb47838d67c84801e38fc1ba459e8f180deabd5071" -dependencies = [ - "cloudabi", - "fuchsia-cprng", - "libc", - "rand_core 0.4.2", - "rdrand", - "winapi 0.3.8", -] - -[[package]] -name = "rand_pcg" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abf9b09b01790cfe0364f52bf32995ea3c39f4d2dd011eac241d2914146d0b44" -dependencies = [ - "autocfg 0.1.7", - "rand_core 0.4.2", -] - -[[package]] -name = "rand_xorshift" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf7e9e623549b0e21f6e97cf8ecf247c1a8fd2e8a992ae265314300b2455d5c" -dependencies = [ - "rand_core 0.3.1", -] - -[[package]] -name = "rdrand" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "678054eb77286b51581ba43620cc911abf02758c91f93f479767aed0f90458b2" -dependencies = [ - "rand_core 0.3.1", -] - [[package]] name = "redox_syscall" version = "0.1.56" @@ -1324,15 +1199,6 @@ version = "0.6.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b28dfe3fe9badec5dbf0a79a9cccad2cfc2ab5484bdb3e44cbd1ae8b3ba2be06" -[[package]] -name = "remove_dir_all" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a83fa3702a688b9359eccba92d153ac33fd2e8462f9e0e3fdf155239ea7792e" -dependencies = [ - "winapi 0.3.8", -] - [[package]] name = "rustc_version" version = "0.2.3" @@ -1343,16 +1209,19 @@ dependencies = [ ] [[package]] -name = "ryu" +name = "rustls-pemfile" version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" +checksum = "d194b56d58803a43635bdc398cd17e383d6f71f9182b9a192c127ca42494a59b" +dependencies = [ + "base64 0.21.0", +] [[package]] -name = "safemem" -version = "0.3.3" +name = "ryu" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef703b7cb59335eae2eb93ceb664c0eb7ea6bf567079d843e09420219668e072" +checksum = "bfa8506c1de11c9c4e4c38863ccbe02a305c8188e85a05a784c9e11e1c3910c8" [[package]] name = "same-file" @@ -1402,21 +1271,21 @@ version = "1.0.47" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "15913895b61e0be854afd32fd4163fcd2a3df34142cf2cb961b310ce694cbf90" dependencies = [ - "itoa", + "itoa 0.4.5", "ryu", "serde", ] [[package]] name = "serde_urlencoded" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9ec5d77e2d4c73717816afac02670d5c4f534ea95ed430442cad02e7a6e32c97" +checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" dependencies = [ - "dtoa", - "itoa", + "form_urlencoded", + "itoa 1.0.6", + "ryu", "serde", - "url", ] [[package]] @@ -1425,17 +1294,22 @@ version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f7d94d0bede923b3cea61f3f1ff57ff8cdfd77b400fb8f9998949e0cf04163df" dependencies = [ - "block-buffer", - "digest", + "block-buffer 0.7.3", + "digest 0.8.1", "fake-simd", "opaque-debug", ] [[package]] -name = "siphasher" -version = "0.2.3" +name = "sha1" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b8de496cf83d4ed58b6be86c3a275b8602f6ffe98d3024a869e124147a9a3ac" +checksum = "f04293dc80c3993519f2d7f6f511707ee7094fe0c6d3406feb330cdb3540eba3" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "digest 0.10.6", +] [[package]] name = "slab" @@ -1458,6 +1332,22 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5c2fb2ec9bcd216a5b0d0ccf31ab17b5ed1d627960edff65bbe95d3ce221cefc" +[[package]] +name = "socket2" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" +dependencies = [ + "libc", + "winapi 0.3.9", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + [[package]] name = "strsim" version = "0.8.0" @@ -1466,39 +1356,24 @@ checksum = "8ea5119cdb4c55b55d432abb513a0429384878c15dde60cc77b1c99de1a95a6a" [[package]] name = "syn" -version = "1.0.14" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af6f3550d8dff9ef7dc34d384ac6f107e5d31c8f57d9f28e0081503f547ac8f5" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ "proc-macro2", "quote", - "unicode-xid", + "unicode-ident", ] [[package]] -name = "synstructure" -version = "0.12.3" +name = "syn" +version = "2.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67656ea1dc1b41b1451851562ea232ec2e5a80242139f7e679ceccfb5d61f545" +checksum = "a34fcf3e8b60f57e6a14301a2e916d323af98b0ea63c599441eec8558660c822" dependencies = [ "proc-macro2", "quote", - "syn", - "unicode-xid", -] - -[[package]] -name = "tempfile" -version = "3.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a6e24d9338a0a5be79593e2fa15a648add6138caa803e2d5bc782c371732ca9" -dependencies = [ - "cfg-if", - "libc", - "rand 0.7.3", - "redox_syscall", - "remove_dir_all", - "winapi 0.3.8", + "unicode-ident", ] [[package]] @@ -1543,22 +1418,22 @@ dependencies = [ [[package]] name = "thiserror" -version = "1.0.10" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "205684fd018ca14432b12cce6ea3d46763311a571c3d294e71ba3f01adcf1aad" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" dependencies = [ "thiserror-impl", ] [[package]] name = "thiserror-impl" -version = "1.0.10" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57e4d2e50ca050ed44fb58309bdce3efa79948f84f9993ad1978de5eebdce5a7" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", ] [[package]] @@ -1578,49 +1453,84 @@ checksum = "db8dcfca086c1143c9270ac42a2bbd8a7ee477b78ac8e45b19abfb0cbede4b6f" dependencies = [ "libc", "redox_syscall", - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] name = "tokio" -version = "0.2.11" +version = "1.28.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fdd17989496f49cdc57978c96f0c9fe5e4a58a8bddc6813c449a4624f6a030b" +checksum = "c3c786bf8134e5a3a166db9b29ab8f48134739014a3eca7bc6bfa95d673b136f" dependencies = [ - "bytes 0.5.4", - "fnv", - "futures-core", - "iovec", - "lazy_static", - "memchr", - "mio", - "pin-project-lite", - "slab", + "autocfg 1.1.0", + "bytes 1.4.0", + "libc", + "mio 0.8.6", + "num_cpus", + "pin-project-lite 0.2.9", + "socket2", "tokio-macros", + "windows-sys 0.48.0", ] [[package]] name = "tokio-macros" -version = "0.2.4" +version = "2.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4b1e7ed7d5d4c2af3d999904b0eebe76544897cdbfb2b9684bed2174ab20f7c" +checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" dependencies = [ "proc-macro2", "quote", - "syn", + "syn 2.0.15", +] + +[[package]] +name = "tokio-stream" +version = "0.1.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "397c988d37662c7dda6d2208364a706264bf3d6138b11d436cbac0ad38832842" +dependencies = [ + "futures-core", + "pin-project-lite 0.2.9", + "tokio", +] + +[[package]] +name = "tokio-tungstenite" +version = "0.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "54319c93411147bced34cb5609a80e0a8e44c5999c93903a81cd866630ec0bfd" +dependencies = [ + "futures-util", + "log", + "tokio", + "tungstenite", ] [[package]] name = "tokio-util" -version = "0.2.0" +version = "0.6.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "571da51182ec208780505a32528fc5512a8fe1443ab960b3f2f3ef093cd16930" +checksum = "36943ee01a6d67977dd3f84a5a1d2efeb4ada3a1ae771cadfaa535d9d9fc6507" dependencies = [ - "bytes 0.5.4", + "bytes 1.4.0", "futures-core", "futures-sink", - "log 0.4.8", - "pin-project-lite", + "log", + "pin-project-lite 0.2.9", + "tokio", +] + +[[package]] +name = "tokio-util" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" +dependencies = [ + "bytes 1.4.0", + "futures-core", + "futures-sink", + "pin-project-lite 0.2.9", "tokio", ] @@ -1630,6 +1540,37 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e987b6bf443f4b5b3b6f38704195592cca41c5bb7aedd3c3693c7081f8289860" +[[package]] +name = "tracing" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a400e31aa60b9d44a52a8ee0343b5b18566b03a8321e0d321f695cf56e940160" +dependencies = [ + "cfg-if 1.0.0", + "log", + "pin-project-lite 0.2.9", + "tracing-core", +] + +[[package]] +name = "tracing-core" +version = "0.1.30" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" +dependencies = [ + "once_cell", +] + +[[package]] +name = "tracing-futures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +dependencies = [ + "pin-project", + "tracing", +] + [[package]] name = "try-lock" version = "0.2.2" @@ -1638,44 +1579,35 @@ checksum = "e604eb7b43c06650e854be16a2a03155743d3752dd1c943f6829e26b7a36e382" [[package]] name = "tungstenite" -version = "0.9.2" +version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a0c2bd5aeb7dcd2bb32e472c8872759308495e5eccc942e929a513cd8d36110" +checksum = "30ee6ab729cd4cf0fd55218530c4522ed30b7b6081752839b68fcec8d0960788" dependencies = [ - "base64", + "base64 0.13.1", "byteorder", - "bytes 0.4.12", - "http 0.1.21", + "bytes 1.4.0", + "http", "httparse", - "input_buffer", - "log 0.4.8", - "rand 0.7.3", - "sha-1", + "log", + "rand 0.8.5", + "sha1", + "thiserror", "url", "utf-8", ] -[[package]] -name = "twoway" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "59b11b2b5241ba34be09c3cc85a36e56e48f9888862e19cedf23336d35316ed1" -dependencies = [ - "memchr", -] - [[package]] name = "typenum" -version = "1.11.2" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6d2783fe2d6b8c1101136184eb41be8b1ad379e4657050b8aaff0c79ee7575f9" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] name = "u2fframing" version = "0.1.0" dependencies = [ "byteorder", - "log 0.4.8", + "log", ] [[package]] @@ -1734,22 +1666,13 @@ dependencies = [ "unic-common", ] -[[package]] -name = "unicase" -version = "1.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4765f83163b74f957c797ad9253caf97f103fb064d3999aea9568d09fc8a33" -dependencies = [ - "version_check 0.1.5", -] - [[package]] name = "unicase" version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6" dependencies = [ - "version_check 0.9.1", + "version_check", ] [[package]] @@ -1761,6 +1684,12 @@ dependencies = [ "matches", ] +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + [[package]] name = "unicode-normalization" version = "0.1.12" @@ -1776,12 +1705,6 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "caaa9d531767d1ff2150b9332433f32a24622147e5ebb1f26409d5da67afd479" -[[package]] -name = "unicode-xid" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "826e7639553986605ec5979c7dd957c7895e93eabed50ab2ffa7f6128a75097c" - [[package]] name = "url" version = "2.1.1" @@ -1793,12 +1716,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "urlencoding" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3df3561629a8bb4c57e5a2e4c43348d9e29c7c29d9b1c4c1f47166deca8f37ed" - [[package]] name = "utf-8" version = "0.7.5" @@ -1811,12 +1728,6 @@ version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "05c78687fb1a80548ae3250346c3db86a80a7cdd77bda190189f2d0a0987c81a" -[[package]] -name = "version_check" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "914b1a6776c4c929a602fafd8bc742e06365d4bcbe48c30f9cca5824f70dc9dd" - [[package]] name = "version_check" version = "0.9.1" @@ -1830,7 +1741,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "777182bc735b6424e1a57516d35ed72cb8019d85c8c9bf536dccb3445c1a2f7d" dependencies = [ "same-file", - "winapi 0.3.8", + "winapi 0.3.9", "winapi-util", ] @@ -1840,34 +1751,39 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1ce8a968cb1cd110d136ff8b819a556d6fb6d919363c61534f6860c7eb172ba0" dependencies = [ - "log 0.4.8", + "log", "try-lock", ] [[package]] name = "warp" -version = "0.2.1" +version = "0.3.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce153bc4ad61ed81c255cad4f1bf2474a1d284b482b20eecaefb152d0675fb1b" +checksum = "ba431ef570df1287f7f8b07e376491ad54f84d26ac473489427231e1718e1f69" dependencies = [ - "bytes 0.5.4", - "futures", + "bytes 1.4.0", + "futures-channel", + "futures-util", "headers", - "http 0.2.0", + "http", "hyper", - "log 0.4.8", - "mime 0.3.16", - "mime_guess 2.0.1", - "multipart", + "log", + "mime", + "mime_guess", + "multer", + "percent-encoding", "pin-project", + "rustls-pemfile", "scoped-tls", "serde", "serde_json", "serde_urlencoded", "tokio", + "tokio-stream", + "tokio-tungstenite", + "tokio-util 0.7.8", "tower-service", - "tungstenite", - "urlencoding", + "tracing", ] [[package]] @@ -1876,11 +1792,17 @@ version = "0.9.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cccddf32554fecc6acb585f82a32a72e28b48f8c4c1883ddfeeeaa96f7d8e519" +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + [[package]] name = "widestring" -version = "0.3.0" +version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a212922ea58fbf5044f83663aa4fc6281ff890f1fd7546c0c3f52f5290831781" +checksum = "653f141f39ec16bba3c5abe400a0c60da7468261cc2cbf36805022876bc721a8" [[package]] name = "winapi" @@ -1890,9 +1812,9 @@ checksum = "167dc9d6949a9b857f3451275e911c3f44255842c1f7a76f33c55103a909087a" [[package]] name = "winapi" -version = "0.3.8" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8093091eeb260906a183e6ae1abdba2ef5ef2257a21801128899c3fc699229c6" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ "winapi-i686-pc-windows-gnu", "winapi-x86_64-pc-windows-gnu", @@ -1916,7 +1838,7 @@ version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4ccfbf554c6ad11084fb7517daca16cfdcaccbdadba4fc336f032a8b12c2ad80" dependencies = [ - "winapi 0.3.8", + "winapi 0.3.9", ] [[package]] @@ -1927,16 +1849,147 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-service" -version = "0.2.0" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048b185a91d03beafe88c5db975c42c12b9462bc939f92ca863c88785a33a6ab" +checksum = "cd9db37ecb5b13762d95468a2fc6009d4b2c62801243223aabd44fca13ad13c8" dependencies = [ "bitflags", - "err-derive", "widestring", - "winapi 0.3.8", + "windows-sys 0.45.0", ] +[[package]] +name = "windows-sys" +version = "0.45.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75283be5efb2831d37ea142365f009c02ec203cd29a3ebecbc093d52315b66d0" +dependencies = [ + "windows-targets 0.42.2", +] + +[[package]] +name = "windows-sys" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" +dependencies = [ + "windows-targets 0.48.0", +] + +[[package]] +name = "windows-targets" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e5180c00cd44c9b1c88adb3693291f1cd93605ded80c250a75d472756b4d071" +dependencies = [ + "windows_aarch64_gnullvm 0.42.2", + "windows_aarch64_msvc 0.42.2", + "windows_i686_gnu 0.42.2", + "windows_i686_msvc 0.42.2", + "windows_x86_64_gnu 0.42.2", + "windows_x86_64_gnullvm 0.42.2", + "windows_x86_64_msvc 0.42.2", +] + +[[package]] +name = "windows-targets" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5" +dependencies = [ + "windows_aarch64_gnullvm 0.48.0", + "windows_aarch64_msvc 0.48.0", + "windows_i686_gnu 0.48.0", + "windows_i686_msvc 0.48.0", + "windows_x86_64_gnu 0.48.0", + "windows_x86_64_gnullvm 0.48.0", + "windows_x86_64_msvc 0.48.0", +] + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "597a5118570b68bc08d8d59125332c54f1ba9d9adeedeef5b99b02ba2b0698f8" + +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e08e8864a60f06ef0d0ff4ba04124db8b0fb3be5776a5cd47641e942e58c4d43" + +[[package]] +name = "windows_aarch64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" + +[[package]] +name = "windows_i686_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c61d927d8da41da96a81f029489353e68739737d3beca43145c8afec9a31a84f" + +[[package]] +name = "windows_i686_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" + +[[package]] +name = "windows_i686_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44d840b6ec649f480a41c8d80f9c65108b92d89345dd94027bfe06ac444d1060" + +[[package]] +name = "windows_i686_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8de912b8b8feb55c064867cf047dda097f92d51efad5b491dfb98f6bbb70cb36" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "26d41b46a36d453748aedef1486d5c7a85db22e56aff34643984ea85514e94a3" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.42.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aec5da331524158c6d1a4ac0ab1541149c0b9505fde06423b02f5ef0106b9f0" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.48.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" + [[package]] name = "ws2_32-sys" version = "0.2.1" diff --git a/README.md b/README.md index 8cdfedc..8473b6d 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ There are installers for Windows/OSX and linux under [releases](https://github.c Go to [rustup](https://rustup.rs/) and get at least version 1.38 of the stable rust compiler. -You need `libusb-1.0-0-dev` to compile the examples (`apt install libusb-1.0-0-dev`). Cargo will +You need `libudev-dev` to compile the examples (`apt install libudev-dev`). Cargo will compile libhidapi and link to it statically. There are also docker build containers for every supported target in [bitbox-bridge/release](bitbox-bridge/release). diff --git a/bitbox-bridge/Cargo.toml b/bitbox-bridge/Cargo.toml index 7e89567..f4acc67 100644 --- a/bitbox-bridge/Cargo.toml +++ b/bitbox-bridge/Cargo.toml @@ -10,14 +10,14 @@ byteorder = "1.3" env_logger = "0.7" futures = "0.3" futures-util = "0.3" -hyper = "0.13" +hyper = "0.14" log = "0.4.8" percent-encoding = "2.1" thiserror = "1.0" -tokio = {version="0.2", features=["time", "macros"]} -windows-service = "0.2.0" +tokio = { version="1.28", features = ["time", "macros", "rt-multi-thread"] } +windows-service = "0.6.0" clap = "2.33" -warp = "0.2.1" +warp = "0.3.5" tera = "1.1.0" [dependencies.u2fframing] diff --git a/bitbox-bridge/release/Dockerfile b/bitbox-bridge/release/Dockerfile index 07029d8..2ec7ac3 100644 --- a/bitbox-bridge/release/Dockerfile +++ b/bitbox-bridge/release/Dockerfile @@ -1,4 +1,7 @@ -FROM ubuntu:16.04 +# If you change this, also change the llvm repo below. +FROM ubuntu:20.04 + +ARG DEBIAN_FRONTEND=noninteractive RUN apt-get update -y && apt-get upgrade -y @@ -11,7 +14,8 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \ wget \ software-properties-common \ apt-transport-https \ - ca-certificates + ca-certificates \ + gpg-agent ############################## @@ -31,20 +35,20 @@ RUN gem install --no-document fpm ############################## -# llvm 11 (needed because some rust crates compile C code) +# llvm (needed because some rust crates compile C code). See https://apt.llvm.org/. RUN wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | apt-key add - -RUN add-apt-repository 'deb http://apt.llvm.org/xenial llvm-toolchain-xenial-11 main' +RUN add-apt-repository 'deb http://apt.llvm.org/focal llvm-toolchain-focal-16 main' RUN apt-get update -y && apt-get install -y --no-install-recommends \ - llvm-11 \ - clang-11 -RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-11 100 -RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-11 100 + llvm-16 \ + clang-16 +RUN update-alternatives --install /usr/bin/clang clang /usr/bin/clang-16 100 +RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-16 100 ############################## # bitbox-bridge linux dependencies RUN apt-get update -y && apt-get install -y --no-install-recommends \ - libusb-1.0-0-dev + libudev-dev ############################## @@ -63,16 +67,16 @@ RUN apt-get update -y && apt-get install -y --no-install-recommends \ libssl-dev # SDK RUN git clone https://github.com/tpoechtrager/osxcross /opt/osxcross -RUN cd /opt/osxcross && wget -nc https://github.com/joseluisq/macosx-sdks/releases/download/11.1/MacOSX11.1.sdk.tar.xz -RUN cd /opt/osxcross && mv MacOSX11.1.sdk.tar.xz tarballs/ -RUN cd /opt/osxcross && UNATTENDED=yes OSX_VERSION_MIN=10.9 ./build.sh +RUN cd /opt/osxcross && wget -nc https://github.com/joseluisq/macosx-sdks/releases/download/12.3/MacOSX12.3.sdk.tar.xz +RUN cd /opt/osxcross && mv MacOSX12.3.sdk.tar.xz tarballs/ +RUN cd /opt/osxcross && UNATTENDED=yes OSX_VERSION_MIN=10.16 ./build.sh ############################## # Rust compiler ENV PATH /opt/cargo/bin:$PATH ENV RUSTUP_HOME=/opt/rustup -RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | CARGO_HOME=/opt/cargo sh -s -- --profile minimal --default-toolchain 1.51.0 -y +RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | CARGO_HOME=/opt/cargo sh -s -- --profile minimal --default-toolchain 1.69.0 -y RUN rustup target add x86_64-pc-windows-gnu RUN rustup target add x86_64-apple-darwin RUN rustup target add aarch64-apple-darwin diff --git a/bitbox-bridge/release/darwin/release.sh b/bitbox-bridge/release/darwin/release.sh index 4c2a92d..d6342a9 100755 --- a/bitbox-bridge/release/darwin/release.sh +++ b/bitbox-bridge/release/darwin/release.sh @@ -5,12 +5,12 @@ set -e PATH="/opt/osxcross/target/bin:$PATH" \ CARGO_HOME=/tmp/cargo \ -TARGET_CC=x86_64-apple-darwin20.2-clang \ +TARGET_CC=x86_64-apple-darwin21.4-clang \ cargo build --target x86_64-apple-darwin --release PATH="/opt/osxcross/target/bin:$PATH" \ CARGO_HOME=/tmp/cargo \ -TARGET_CC=aarch64-apple-darwin20.2-clang \ +TARGET_CC=aarch64-apple-darwin21.4-clang \ cargo build --target aarch64-apple-darwin --release ( diff --git a/bitbox-bridge/src/daemon/windows.rs b/bitbox-bridge/src/daemon/windows.rs index 2ef9529..e86d0dd 100644 --- a/bitbox-bridge/src/daemon/windows.rs +++ b/bitbox-bridge/src/daemon/windows.rs @@ -62,6 +62,7 @@ fn run_service(_args: Vec) -> Result<(), windows_service::Error> { checkpoint: 0, // Only used for pending states, otherwise must be zero wait_hint: Duration::default(), + process_id: None, })?; // Poll shutdown event. @@ -75,6 +76,7 @@ fn run_service(_args: Vec) -> Result<(), windows_service::Error> { exit_code: ServiceExitCode::Win32(0), checkpoint: 0, wait_hint: Duration::default(), + process_id: None, })?; Ok(()) diff --git a/bitbox-bridge/src/main.rs b/bitbox-bridge/src/main.rs index d2e6189..320c7c2 100644 --- a/bitbox-bridge/src/main.rs +++ b/bitbox-bridge/src/main.rs @@ -64,7 +64,7 @@ fn main() -> Result<(), Box> { // Unwrap shouldn't happen since it has a default value let port = matches.value_of("port").unwrap(); // Create an async runtime for spawning futures on - let mut rt = Runtime::new()?; + let rt = Runtime::new()?; // Create the global state that can be shared between threads let usb_devices = UsbDevices::new()?; diff --git a/bitbox-bridge/src/usb.rs b/bitbox-bridge/src/usb.rs index 24ab564..d717ddd 100644 --- a/bitbox-bridge/src/usb.rs +++ b/bitbox-bridge/src/usb.rs @@ -142,7 +142,7 @@ impl UsbDevices { } else { last_seen = None; } - tokio::time::delay_for(Duration::from_millis(200)).await; + tokio::time::sleep(Duration::from_millis(200)).await; } } } diff --git a/bitbox-bridge/src/web.rs b/bitbox-bridge/src/web.rs index 2e42c79..7dcf3e8 100644 --- a/bitbox-bridge/src/web.rs +++ b/bitbox-bridge/src/web.rs @@ -101,7 +101,7 @@ async fn ws_upgrade( let (usb_devices, mut tx) = usb_devices_tx; notify(&mut tx); let (mut dev_tx, mut dev_rx) = usb_devices - .acquire_device(&*path) + .acquire_device(&path) .await .map_err(|_e| warp::reject::custom(WebError::NoSuchDevice))? .ok_or_else(|| warp::reject::custom(WebError::NoSuchDevice))?; diff --git a/hidapi-async/Cargo.toml b/hidapi-async/Cargo.toml index 4b7ce55..02d9cda 100644 --- a/hidapi-async/Cargo.toml +++ b/hidapi-async/Cargo.toml @@ -12,6 +12,7 @@ repository = "https://github.com/digitalbitbox/bitbox-bridge" [dependencies] futures = "0.3.1" log = "0.4.8" -hidapi = "1.2.6" +# Can be switched back to upstream once https://github.com/ruabmbua/hidapi-rs/issues/115 is fixed. +hidapi = { git ="https://github.com/benma/hidapi-rs.git", branch="update-hidapi" } async-std = "1.2.0" thiserror = "1.0.9" diff --git a/hidapi-async/src/lib.rs b/hidapi-async/src/lib.rs index 6053c15..14a9bb5 100644 --- a/hidapi-async/src/lib.rs +++ b/hidapi-async/src/lib.rs @@ -68,7 +68,7 @@ pub struct Device { impl Clone for Device { fn clone(&self) -> Self { Device { - inner: self.inner.as_ref().map(|dev| Arc::clone(dev)), + inner: self.inner.as_ref().map(Arc::clone), } } } @@ -187,7 +187,7 @@ impl AsyncWrite for Device { // The hidapi API requires that you put the report ID in the first byte. // If you don't use report IDs you must put a 0 there. let mut buf_with_report_id = [0u8; 1 + 64]; - (&mut buf_with_report_id[1..1 + max_len]).copy_from_slice(&buf[..max_len]); + buf_with_report_id[1..1 + max_len].copy_from_slice(&buf[..max_len]); //let this: &mut Self = &mut self; debug!("Will write {:?}", &buf_with_report_id[..]); diff --git a/u2fframing/src/lib.rs b/u2fframing/src/lib.rs index fe22f08..fc660e9 100644 --- a/u2fframing/src/lib.rs +++ b/u2fframing/src/lib.rs @@ -266,7 +266,7 @@ impl U2FFraming for U2fHid { let len = usize::min(57, len as usize); res.extend_from_slice(&buf[HEADER_INIT_LEN..HEADER_INIT_LEN + len]); buf = &buf[HEADER_INIT_LEN + len..]; - left -= len as usize; + left -= len; while left > 0 { let len = usize::min(59, left); @@ -292,7 +292,7 @@ mod tests { let len = codec.encode(b"\x01\x02\x03\x04", &mut data[..]).unwrap(); assert_eq!(len, 64); let mut expect = [0u8; 64]; - &expect[..11].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x04\x01\x02\x03\x04"); + expect[..11].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x04\x01\x02\x03\x04"); assert_eq!(&data[..len], &expect[..]); } @@ -304,10 +304,10 @@ mod tests { let len = codec.encode(&payload[..], &mut data[..]).unwrap(); assert_eq!(len, 128); let mut expect = [0u8; 128]; - &expect[..7].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x41"); - &expect[7..64].copy_from_slice(&payload[..57]); - &expect[64..69].copy_from_slice(b"\xEE\xEE\xEE\xEE\x00"); - &expect[69..77].copy_from_slice(&payload[57..]); + expect[..7].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x41"); + expect[7..64].copy_from_slice(&payload[..57]); + expect[64..69].copy_from_slice(b"\xEE\xEE\xEE\xEE\x00"); + expect[69..77].copy_from_slice(&payload[57..]); assert_eq!(&data[..len], &expect[..]); } @@ -315,7 +315,7 @@ mod tests { fn test_u2fhid_decode_single() { let mut codec = U2fHid::with_cid(0xEEEEEEEE, 0x55); let mut raw = [0u8; 64]; - &raw[..11].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x04\x01\x02\x03\x04"); + raw[..11].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x04\x01\x02\x03\x04"); let data = codec.decode(&raw[..]).unwrap().unwrap(); assert_eq!(&data[..], b"\x01\x02\x03\x04"); } @@ -325,10 +325,10 @@ mod tests { let payload: Vec = (0..65u8).collect(); let mut codec = U2fHid::with_cid(0xEEEEEEEE, 0x55); let mut raw = [0u8; 128]; - &raw[..7].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x41"); - &raw[7..64].copy_from_slice(&payload[..57]); - &raw[64..69].copy_from_slice(b"\xEE\xEE\xEE\xEE\x00"); - &raw[69..77].copy_from_slice(&payload[57..]); + raw[..7].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x41"); + raw[7..64].copy_from_slice(&payload[..57]); + raw[64..69].copy_from_slice(b"\xEE\xEE\xEE\xEE\x00"); + raw[69..77].copy_from_slice(&payload[57..]); let data = codec.decode(&raw[..]).unwrap().unwrap(); assert_eq!(&data[..], &payload[..]); } @@ -353,8 +353,8 @@ mod tests { let len = codec.encode(&payload[..], &mut data[..]).unwrap(); assert_eq!(len, 72); let mut expect = [0u8; 72]; - &expect[..7].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x41"); - &expect[7..72].copy_from_slice(&payload[..]); + expect[..7].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x41"); + expect[7..72].copy_from_slice(&payload[..]); assert_eq!(&data[..len], &expect[..]); } @@ -373,8 +373,8 @@ mod tests { let payload: Vec = (0..65u8).collect(); let mut codec = U2fWs::with_cid(0xEEEEEEEE, 0x55); let mut raw = [0u8; 128]; - &raw[..7].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x41"); - &raw[7..72].copy_from_slice(&payload[..]); + raw[..7].copy_from_slice(b"\xEE\xEE\xEE\xEE\x55\x00\x41"); + raw[7..72].copy_from_slice(&payload[..]); let data = codec.decode(&raw[..]).unwrap().unwrap(); assert_eq!(&data[..], &payload[..]); } From 696d630a0e803b22fb50117351491289ec450697 Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Tue, 9 May 2023 02:57:41 +0200 Subject: [PATCH 2/3] bump version to 1.5.1 --- CHANGELOG.md | 4 ++++ Cargo.lock | 2 +- bitbox-bridge/Cargo.toml | 3 ++- bitbox-bridge/release/windows/wix/Product.wxs | 2 +- 4 files changed, 8 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 59cbe83..121a012 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 1.5.1 +- Fix bug where on macOS 13.3, the bridge would register one BitBox02 twice +- Release built using the `shiftcrypto/bitbox-bridge:1` Docker image + ## 1.5.0 - Whitelist adalite.io diff --git a/Cargo.lock b/Cargo.lock index 7e61c81..1eb9c62 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -98,7 +98,7 @@ checksum = "a4a4ddaa51a5bc52a6948f74c06d20aaaddb71924eab79b8c97a8c556e942d6a" [[package]] name = "bitbox-bridge" -version = "1.5.0" +version = "1.5.1" dependencies = [ "byteorder", "clap", diff --git a/bitbox-bridge/Cargo.toml b/bitbox-bridge/Cargo.toml index f4acc67..c1b0cac 100644 --- a/bitbox-bridge/Cargo.toml +++ b/bitbox-bridge/Cargo.toml @@ -1,6 +1,7 @@ [package] name = "bitbox-bridge" -version = "1.5.0" +# If you bump this, also change the ProductCode in bitbox-bridge/release/windows/wix/Product.wxs. +version = "1.5.1" authors = ["Niklas Claesson "] edition = "2018" license = "Apache-2.0" diff --git a/bitbox-bridge/release/windows/wix/Product.wxs b/bitbox-bridge/release/windows/wix/Product.wxs index fbfdd15..c0fd0b0 100644 --- a/bitbox-bridge/release/windows/wix/Product.wxs +++ b/bitbox-bridge/release/windows/wix/Product.wxs @@ -2,7 +2,7 @@ - + From 06ef3543309715e529d523c25c2f06f4dbeb04bc Mon Sep 17 00:00:00 2001 From: Marko Bencun Date: Thu, 11 May 2023 05:38:14 +0200 Subject: [PATCH 3/3] github: fix CI by updating Ubuntu Ubuntu 18 is not supported anymore by GitHub actions. --- .github/workflows/ci.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5c83ca4..eb6f3d7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,7 +8,7 @@ on: [push, pull_request] jobs: check: name: Check - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - name: Checkout sources uses: actions/checkout@v2 @@ -30,7 +30,7 @@ jobs: lint: name: Lint - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - name: Checkout sources uses: actions/checkout@v2 @@ -60,7 +60,7 @@ jobs: test: name: Test Suite - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - name: Checkout sources uses: actions/checkout@v2 @@ -82,7 +82,7 @@ jobs: build-linux: name: Build linux release - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - name: Checkout sources uses: actions/checkout@v2 @@ -111,7 +111,7 @@ jobs: release-linux: name: Release linux - runs-on: ubuntu-18.04 + runs-on: ubuntu-22.04 steps: - name: Checkout sources uses: actions/checkout@v2