diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 87de06b..ab674bb 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -16,4 +16,4 @@ jobs: - run: shellcheck usr/lib/cryptographic_id/* usr/bin/* usr/lib/initcpio/install/cryptographic-id usr/lib/dracut/modules.d/90cryptographic-id/module-setup.sh - - run: dbus-run-session bash tests/run_test.sh + - run: dbus-run-session bash tests/run_test.sh -- --include-ignored diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 38fd62e..450eb82 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -9,7 +9,7 @@ test: - shellcheck usr/lib/cryptographic_id/* usr/bin/* usr/lib/initcpio/install/cryptographic-id usr/lib/dracut/modules.d/90cryptographic-id/module-setup.sh - - dbus-run-session bash tests/run_test.sh + - dbus-run-session bash tests/run_test.sh -- --include-ignored codespell: image: ubuntu diff --git a/Cargo.lock b/Cargo.lock index 80c4903..e67eb0c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2,6 +2,18 @@ # It is not intended for manual editing. version = 3 +[[package]] +name = "ab_glyph_rasterizer" +version = "0.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71b1793ee61086797f5c80b6efa2b8ffa6d5dd703f118545808a7f2e27f7046" + +[[package]] +name = "adler" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" + [[package]] name = "aho-corasick" version = "1.1.2" @@ -11,12 +23,36 @@ dependencies = [ "memchr", ] +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + [[package]] name = "anyhow" version = "1.0.75" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a4668cab20f66d8d020e1fbc0ebe47217433c1b6c8f2040faf858554e394ace6" +[[package]] +name = "approx" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" +dependencies = [ + "num-traits", +] + [[package]] name = "asn1-rs" version = "0.5.2" @@ -79,6 +115,50 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bindgen" +version = "0.65.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfdf7b466f9a4903edc73f95d6d2bcd5baf8ae620638762244d3f60143643cc5" +dependencies = [ + "bitflags 1.3.2", + "cexpr", + "clang-sys", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "syn 2.0.39", + "which", +] + +[[package]] +name = "bit-set" +version = "0.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +dependencies = [ + "bit-vec", +] + +[[package]] +name = "bit-vec" +version = "0.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" + +[[package]] +name = "bit_field" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc827186963e592360843fb5ba4b973e145841266c1357f7180c43526f2e5b61" + [[package]] name = "bitfield" version = "0.13.2" @@ -106,12 +186,48 @@ dependencies = [ "generic-array", ] +[[package]] +name = "bumpalo" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f30e7476521f6f8af1a1c4c0b8cc94f0bee37d91763d0ca2665f299b6cd8aec" + +[[package]] +name = "bytemuck" +version = "1.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "374d28ec25809ee0e23827c2ab573d729e293f281dfe393500e7ad618baa61c6" + +[[package]] +name = "byteorder" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" + [[package]] name = "bytes" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2bd12c1caf447e69cd4528f47f94d203fd2582878ecb9e9465484c4148a8223" +[[package]] +name = "cc" +version = "1.0.83" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1174fb0b6ec23863f8b971027804a42614e347eafb0a95bf0b12cdae21fc4d0" +dependencies = [ + "libc", +] + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" @@ -124,12 +240,89 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17cc5e6b5ab06331c33589842070416baa137e8b0eb912b008cfd4a78ada7919" +[[package]] +name = "chrono" +version = "0.4.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f2c685bad3eb3d45a01354cedb7d5faa66194d1d58ba6e267a8de788f79db38" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "js-sys", + "num-traits", + "wasm-bindgen", + "windows-targets", +] + +[[package]] +name = "chrono-tz" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e23185c0e21df6ed832a12e2bda87c7d1def6842881fb634a8511ced741b0d76" +dependencies = [ + "chrono", + "chrono-tz-build", + "phf", +] + +[[package]] +name = "chrono-tz-build" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "433e39f13c9a060046954e0592a8d0a4bcb1040125cbf91cb8ee58964cfb350f" +dependencies = [ + "parse-zoneinfo", + "phf", + "phf_codegen", +] + +[[package]] +name = "clang-sys" +version = "1.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c688fc74432808e3eb684cae8830a86be1d66a2bd58e1f248ed0960a590baf6f" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "codepage-437" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e40c1169585d8d08e5675a39f2fc056cd19a258fc4cba5e3bbf4a9c1026de535" +dependencies = [ + "csv", +] + +[[package]] +name = "color_quant" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3d7b894f5411737b7867f4827955924d7c254fc9f4d91a6aad6b097804b1018b" + [[package]] name = "const-oid" version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" +[[package]] +name = "conv" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "78ff10625fd0ac447827aa30ea8b861fead473bb60aeb73af6c1c58caf0d1299" +dependencies = [ + "custom_derive", +] + +[[package]] +name = "core-foundation-sys" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "06ea2b9bc92be3c2baa9334a323ebca2d6f074ff852cd1d7b11064035cd3868f" + [[package]] name = "cpufeatures" version = "0.2.11" @@ -139,6 +332,53 @@ dependencies = [ "libc", ] +[[package]] +name = "crc32fast" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crossbeam-deque" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fca89a0e215bab21874660c67903c5f143333cab1da83d041c7ded6053774751" +dependencies = [ + "cfg-if", + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d2fe95351b870527a5d09bf563ed3c97c0cffb87cf1c78a591bf48bb218d9aa" +dependencies = [ + "autocfg", + "cfg-if", + "crossbeam-utils", + "memoffset", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06d96137f14f244c37f989d9fff8f95e6c18b918e71f36638f8c49112e4c78f" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -146,7 +386,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -168,16 +408,39 @@ dependencies = [ "asn1-rs", "base64", "ed25519-dalek", + "nix", "p256", "prost", "prost-build", "qrcode", - "rand", + "qrcode_scanner", + "rand 0.8.5", "sha2", "tempfile", "tss-esapi", ] +[[package]] +name = "csv" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac574ff4d437a7b5ad237ef331c17ccca63c46479e5b5453eb8e10bb99a759fe" +dependencies = [ + "csv-core", + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "csv-core" +version = "0.1.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5efa2b3d7902f4b634a20cae3c9c4e6209dc4779feb6863329607560143efa70" +dependencies = [ + "memchr", +] + [[package]] name = "curve25519-dalek" version = "4.1.1" @@ -206,6 +469,12 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "custom_derive" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef8ae57c4978a2acd8b869ce6b9ca1dfe817bff704c220209fdef2c0b75a01b9" + [[package]] name = "der" version = "0.7.8" @@ -272,7 +541,7 @@ checksum = "1f628eaec48bfd21b865dc2950cfa014450c01d2fa2b69a86c2fd5844ec523c0" dependencies = [ "curve25519-dalek", "ed25519", - "rand_core", + "rand_core 0.6.4", "serde", "sha2", "subtle", @@ -299,12 +568,76 @@ dependencies = [ "group", "pem-rfc7468", "pkcs8", - "rand_core", + "rand_core 0.6.4", "sec1", "subtle", "zeroize", ] +[[package]] +name = "encoding" +version = "0.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b0d943856b990d12d3b55b359144ff341533e516d94098b1d3fc1ac666d36ec" +dependencies = [ + "encoding-index-japanese", + "encoding-index-korean", + "encoding-index-simpchinese", + "encoding-index-singlebyte", + "encoding-index-tradchinese", +] + +[[package]] +name = "encoding-index-japanese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04e8b2ff42e9a05335dbf8b5c6f7567e5591d0d916ccef4e0b1710d32a0d0c91" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-korean" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dc33fb8e6bcba213fe2f14275f0963fd16f0a02c878e3095ecfdf5bee529d81" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-simpchinese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d87a7194909b9118fc707194baa434a4e3b0fb6a5a757c73c3adb07aa25031f7" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-singlebyte" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3351d5acffb224af9ca265f435b859c7c01537c0849754d3db3fdf2bfe2ae84a" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding-index-tradchinese" +version = "1.20141219.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd0e20d5688ce3cab59eb3ef3a2083a5c77bf496cb798dc6fcdb75f323890c18" +dependencies = [ + "encoding_index_tests", +] + +[[package]] +name = "encoding_index_tests" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a246d82be1c9d791c5dfde9a2bd045fc3cbba3fa2b11ad558f27d01712f00569" + [[package]] name = "enumflags2" version = "0.7.8" @@ -341,22 +674,76 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "exr" +version = "1.71.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "832a761f35ab3e6664babfbdc6cef35a4860e816ec3916dcfd0882954e98a8a8" +dependencies = [ + "bit_field", + "flume", + "half", + "lebe", + "miniz_oxide", + "rayon-core", + "smallvec", + "zune-inflate", +] + +[[package]] +name = "fancy-regex" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b95f7c0680e4142284cf8b22c14a476e87d61b004a3a0861872b32ef7ead40a2" +dependencies = [ + "bit-set", + "regex", +] + [[package]] name = "fastrand" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25cbce373ec4653f1a01a31e8a5e5ec0c622dc27ff9c4e6606eefef5cbbed4a5" +[[package]] +name = "fdeflate" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "64d6dafc854908ff5da46ff3f8f473c6984119a2876a383a860246dd7841a868" +dependencies = [ + "simd-adler32", +] + [[package]] name = "ff" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] +[[package]] +name = "ffimage" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed0a72fa07ae1c1c2d50f9caeb30890b23596b73d1c2f6cd229a2ae658a15d36" +dependencies = [ + "num-traits", +] + +[[package]] +name = "ffimage_yuv" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cf7ab943a8157f1f133a07ae728d5844b30d982e43f24c1098d6dc6cf38efb3" +dependencies = [ + "ffimage", + "num-traits", +] + [[package]] name = "fiat-crypto" version = "0.2.5" @@ -369,6 +756,31 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" +[[package]] +name = "flate2" +version = "1.0.28" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46303f565772937ffe1d394a4fac6f411c6013172fadde9dcdb1e147a086940e" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + +[[package]] +name = "flume" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55ac459de2512911e4b674ce33cf20befaba382d05b62b008afc1c8b57cbf181" +dependencies = [ + "spin", +] + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + [[package]] name = "generic-array" version = "0.14.7" @@ -380,6 +792,17 @@ dependencies = [ "zeroize", ] +[[package]] +name = "getrandom" +version = "0.1.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" +dependencies = [ + "cfg-if", + "libc", + "wasi 0.9.0+wasi-snapshot-preview1", +] + [[package]] name = "getrandom" version = "0.2.11" @@ -388,9 +811,25 @@ checksum = "fe9006bed769170c11f845cf00c7c1e9092aeb3f268e007c3e760ac68008070f" dependencies = [ "cfg-if", "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", +] + +[[package]] +name = "gif" +version = "0.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "80792593675e051cf94a4b111980da2ba60d4a83e43e0048c5693baab3977045" +dependencies = [ + "color_quant", + "weezl", ] +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + [[package]] name = "group" version = "0.13.0" @@ -398,10 +837,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ "ff", - "rand_core", + "rand_core 0.6.4", "subtle", ] +[[package]] +name = "half" +version = "2.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02b4af3693f1b705df946e9fe5631932443781d0aabb423b62fcd4d73f6d2fd0" +dependencies = [ + "crunchy", +] + [[package]] name = "hashbrown" version = "0.14.2" @@ -438,6 +886,66 @@ version = "1.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f558a64ac9af88b5ba400d99b579451af0d39c6d360980045b91aac966d705e2" +[[package]] +name = "iana-time-zone" +version = "0.1.58" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8326b86b6cff230b97d0d312a6c40a60726df3332e721f72a1b035f451663b20" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "image" +version = "0.24.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6f3dfdbdd72063086ff443e297b61695500514b1e41095b6fb9a5ab48a70a711" +dependencies = [ + "bytemuck", + "byteorder", + "color_quant", + "exr", + "gif", + "jpeg-decoder", + "num-rational", + "num-traits", + "png", + "qoi", + "tiff", +] + +[[package]] +name = "imageproc" +version = "0.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aee993351d466301a29655d628bfc6f5a35a0d062b6160ca0808f425805fd7" +dependencies = [ + "approx", + "conv", + "image", + "itertools 0.10.5", + "nalgebra", + "num", + "rand 0.7.3", + "rand_distr", + "rayon", + "rusttype", +] + [[package]] name = "indexmap" version = "2.1.0" @@ -448,6 +956,15 @@ dependencies = [ "hashbrown", ] +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.11.0" @@ -457,24 +974,96 @@ dependencies = [ "either", ] +[[package]] +name = "itoa" +version = "1.0.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1a46d1a171d865aa5f83f92695765caa047a9b4cbae2cbf37dbd613a793fd4c" + +[[package]] +name = "jpeg-decoder" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc0000e42512c92e31c2252315bda326620a4e034105e900c98ec492fa077b3e" +dependencies = [ + "rayon", +] + +[[package]] +name = "js-sys" +version = "0.3.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cee9c64da59eae3b50095c18d3e74f8b73c0b86d2792824ff01bbce68ba229ca" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "lebe" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "03087c2bad5e1034e8cace5926dec053fb3790248370865f5117a7d0213354c8" + [[package]] name = "libc" version = "0.2.150" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "89d92a4743f9a61002fae18374ed11e7973f530cb3a3255fb354818118b2203c" +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + [[package]] name = "linux-raw-sys" version = "0.4.11" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "969488b55f8ac402214f3f5fd243ebb7206cf82de60d3172994707a4bcc2b829" +[[package]] +name = "lock_api" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +dependencies = [ + "autocfg", + "scopeguard", +] + [[package]] name = "log" version = "0.4.20" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +[[package]] +name = "matrixmultiply" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7574c1cf36da4798ab73da5b215bbf444f50718207754cb522201d78d1cd0ff2" +dependencies = [ + "autocfg", + "rawpointer", +] + [[package]] name = "mbox" version = "0.6.0" @@ -492,18 +1081,72 @@ version = "2.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f665ee40bc4a3c5590afb1e9677db74a508659dfd71e126420da8274909a0167" +[[package]] +name = "memoffset" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" +dependencies = [ + "autocfg", +] + [[package]] name = "minimal-lexical" version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" +[[package]] +name = "miniz_oxide" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" +dependencies = [ + "adler", + "simd-adler32", +] + [[package]] name = "multimap" version = "0.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" +[[package]] +name = "multimap" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1a5d38b9b352dbd913288736af36af41c48d61b1a8cd34bcecd727561b7d511" +dependencies = [ + "serde", +] + +[[package]] +name = "nalgebra" +version = "0.30.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fb2d0de08694bed883320212c18ee3008576bfe8c306f4c3c4a58b4876998be" +dependencies = [ + "approx", + "matrixmultiply", + "num-complex", + "num-rational", + "num-traits", + "simba", + "typenum", +] + +[[package]] +name = "nix" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eb04e9c688eff1c89d72b407f168cf79bb9e867a9d3323ed6c01519eb9cc053" +dependencies = [ + "bitflags 2.4.1", + "cfg-if", + "libc", +] + [[package]] name = "nom" version = "7.1.3" @@ -514,6 +1157,40 @@ dependencies = [ "minimal-lexical", ] +[[package]] +name = "num" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b05180d69e3da0e530ba2a1dae5110317e49e3b7f3d41be227dc5f92e49ee7af" +dependencies = [ + "num-bigint", + "num-complex", + "num-integer", + "num-iter", + "num-rational", + "num-traits", +] + +[[package]] +name = "num-bigint" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "608e7659b5c3d7cba262d894801b9ec9d00de989e8a82bd4bef91d08da45cdc0" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-complex" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1ba157ca0885411de85d6ca030ba7e2a83a28636056c7c699b07c8b6f7383214" +dependencies = [ + "num-traits", +] + [[package]] name = "num-derive" version = "0.3.3" @@ -525,6 +1202,39 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-iter" +version = "0.1.43" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + +[[package]] +name = "num-rational" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" +dependencies = [ + "autocfg", + "num-bigint", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.17" @@ -549,6 +1259,15 @@ version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" +[[package]] +name = "owned_ttf_parser" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05e6affeb1632d6ff6a23d2cd40ffed138e82f1532571a26f527c8a284bb2fbb" +dependencies = [ + "ttf-parser", +] + [[package]] name = "p256" version = "0.13.2" @@ -561,6 +1280,27 @@ dependencies = [ "sha2", ] +[[package]] +name = "parse-zoneinfo" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c705f256449c60da65e11ff6626e0c16a0a0b96aaa348de61376b249bc340f41" +dependencies = [ + "regex", +] + +[[package]] +name = "paste" +version = "1.0.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -591,6 +1331,44 @@ dependencies = [ "indexmap", ] +[[package]] +name = "phf" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" +dependencies = [ + "phf_shared", +] + +[[package]] +name = "phf_codegen" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e8d39688d359e6b34654d328e262234662d16cc0f60ec8dcbe5e718709342a5a" +dependencies = [ + "phf_generator", + "phf_shared", +] + +[[package]] +name = "phf_generator" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" +dependencies = [ + "phf_shared", + "rand 0.8.5", +] + +[[package]] +name = "phf_shared" +version = "0.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" +dependencies = [ + "siphasher", +] + [[package]] name = "picky-asn1" version = "0.8.0" @@ -648,6 +1426,19 @@ version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "14e6ab3f592e6fb464fc9712d8d6e6912de6473954635fd76a589d832cffcbb0" +[[package]] +name = "png" +version = "0.17.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd75bf2d8dd3702b9707cdbc56a5b9ef42cec752eb8b3bafc01234558442aa64" +dependencies = [ + "bitflags 1.3.2", + "crc32fast", + "fdeflate", + "flate2", + "miniz_oxide", +] + [[package]] name = "ppv-lite86" version = "0.2.17" @@ -700,9 +1491,9 @@ checksum = "1fa3d084c8704911bfefb2771be2f9b6c5c0da7343a71e0021ee3c665cada738" dependencies = [ "bytes", "heck", - "itertools", + "itertools 0.11.0", "log", - "multimap", + "multimap 0.8.3", "once_cell", "petgraph", "prettyplease", @@ -721,7 +1512,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "065717a5dfaca4a83d2fe57db3487b311365200000551d7a364e715dbf4346bc" dependencies = [ "anyhow", - "itertools", + "itertools 0.11.0", "proc-macro2", "quote", "syn 2.0.39", @@ -736,6 +1527,15 @@ dependencies = [ "prost", ] +[[package]] +name = "qoi" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f6d64c71eb498fe9eae14ce4ec935c555749aef511cca85b5568910d6e48001" +dependencies = [ + "bytemuck", +] + [[package]] name = "qrcode" version = "0.12.0" @@ -745,6 +1545,20 @@ dependencies = [ "checked_int_cast", ] +[[package]] +name = "qrcode_scanner" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38025598469028aa0e4fb862878e44bfbbea6a2d5dc4cf1b494793665372f25a" +dependencies = [ + "ffimage", + "ffimage_yuv", + "image", + "log", + "rxing", + "v4l", +] + [[package]] name = "quote" version = "1.0.33" @@ -754,6 +1568,19 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "rand" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a6b1679d49b24bbfe0c803429aa1874472f50d9b363131f0e89fc356b544d03" +dependencies = [ + "getrandom 0.1.16", + "libc", + "rand_chacha 0.2.2", + "rand_core 0.5.1", + "rand_hc", +] + [[package]] name = "rand" version = "0.8.5" @@ -761,8 +1588,18 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", - "rand_chacha", - "rand_core", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4c8ed856279c9737206bf725bf36935d8666ead7aa69b52be55af369d193402" +dependencies = [ + "ppv-lite86", + "rand_core 0.5.1", ] [[package]] @@ -772,7 +1609,16 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" +dependencies = [ + "getrandom 0.1.16", ] [[package]] @@ -781,7 +1627,51 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom", + "getrandom 0.2.11", +] + +[[package]] +name = "rand_distr" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "96977acbdd3a6576fb1d27391900035bf3863d4a16422973a409b488cf29ffb2" +dependencies = [ + "rand 0.7.3", +] + +[[package]] +name = "rand_hc" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca3129af7b92a17112d59ad498c6f81eaf463253766b90396d39ea7a39d6613c" +dependencies = [ + "rand_core 0.5.1", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" +dependencies = [ + "either", + "rayon-core", +] + +[[package]] +name = "rayon-core" +version = "1.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" +dependencies = [ + "crossbeam-deque", + "crossbeam-utils", ] [[package]] @@ -832,6 +1722,12 @@ dependencies = [ "subtle", ] +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + [[package]] name = "rustc_version" version = "0.3.3" @@ -872,6 +1768,71 @@ dependencies = [ "windows-sys", ] +[[package]] +name = "rusttype" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ff8374aa04134254b7995b63ad3dc41c7f7236f69528b28553da7d72efaa967" +dependencies = [ + "ab_glyph_rasterizer", + "owned_ttf_parser", +] + +[[package]] +name = "rxing" +version = "0.4.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2053f6ad096825a54510c3002a9077ae6604dd95361cbf08ed21f18fd6e33a04" +dependencies = [ + "chrono", + "chrono-tz", + "codepage-437", + "encoding", + "fancy-regex", + "image", + "imageproc", + "multimap 0.9.1", + "num", + "once_cell", + "regex", + "rxing-one-d-proc-derive", + "thiserror", + "unicode-segmentation", + "uriparse", + "urlencoding", +] + +[[package]] +name = "rxing-one-d-proc-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "110aacbea4a739b897ea5eb9ee6b14309ebc62bf5059138f9fd80d52a29ed11f" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ryu" +version = "1.0.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f98d2aa92eebf49b69786be48e4477826b256916e84a57ff2a4f21923b48eb4c" + +[[package]] +name = "safe_arch" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f398075ce1e6a179b46f51bd88d0598b92b00d3551f1a2d4ac49e771b56ac354" +dependencies = [ + "bytemuck", +] + +[[package]] +name = "scopeguard" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" + [[package]] name = "sec1" version = "0.7.3" @@ -950,6 +1911,12 @@ dependencies = [ "digest", ] +[[package]] +name = "shlex" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7cee0529a6d40f580e7a5e6c495c8fbfe21b7b52795ed4bb5e62cdf92bc6380" + [[package]] name = "signature" version = "2.2.0" @@ -957,7 +1924,47 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest", - "rand_core", + "rand_core 0.6.4", +] + +[[package]] +name = "simba" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f3fd720c48c53cace224ae62bef1bbff363a70c68c4802a78b5cc6159618176" +dependencies = [ + "approx", + "num-complex", + "num-traits", + "paste", + "wide", +] + +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + +[[package]] +name = "siphasher" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "38b58827f4464d87d377d175e90bf58eb00fd8716ff0a62f80356b5e61555d0d" + +[[package]] +name = "smallvec" +version = "1.11.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4dccd0940a2dcdf68d092b8cbab7dc0ad8fa938bf95787e1b916b0e3d0e8e970" + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", ] [[package]] @@ -1055,6 +2062,17 @@ dependencies = [ "syn 2.0.39", ] +[[package]] +name = "tiff" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6d172b0f4d3fba17ba89811858b9d3d97f928aece846475bbda076ca46736211" +dependencies = [ + "flate2", + "jpeg-decoder", + "weezl", +] + [[package]] name = "tss-esapi" version = "7.1.0" @@ -1087,6 +2105,12 @@ dependencies = [ "target-lexicon", ] +[[package]] +name = "ttf-parser" +version = "0.15.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7b3e06c9b9d80ed6b745c7159c40b311ad2916abb34a49e9be2653b90db0d8dd" + [[package]] name = "typenum" version = "1.17.0" @@ -1105,24 +2129,132 @@ version = "1.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +[[package]] +name = "unicode-segmentation" +version = "1.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dd624098567895118886609431a7c3b8f516e41d30e0643f03d94592a147e36" + [[package]] name = "unicode-xid" version = "0.2.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +[[package]] +name = "uriparse" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0200d0fc04d809396c2ad43f3c95da3582a2556eba8d453c1087f4120ee352ff" +dependencies = [ + "fnv", + "lazy_static", +] + +[[package]] +name = "urlencoding" +version = "2.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "daf8dba3b7eb870caf1ddeed7bc9d2a049f3cfdfae7cb521b087cc33ae4c49da" + +[[package]] +name = "v4l" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8fbfea44a46799d62c55323f3c55d06df722fbe577851d848d328a1041c3403" +dependencies = [ + "bitflags 1.3.2", + "libc", + "v4l2-sys-mit", +] + +[[package]] +name = "v4l2-sys-mit" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6779878362b9bacadc7893eac76abe69612e8837ef746573c4a5239daf11990b" +dependencies = [ + "bindgen", +] + [[package]] name = "version_check" version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +[[package]] +name = "wasi" +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 = "wasm-bindgen" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ed0d4f68a3015cc185aff4db9506a015f4b96f95303897bfa23f846db54064e" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b56f625e64f3a1084ded111c4d5f477df9f8c92df113852fa5a374dbda78826" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 2.0.39", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0162dbf37223cd2afce98f3d0785506dcb8d266223983e4b5b525859e6e182b2" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0eb82fcb7930ae6219a7ecfd55b217f5f0893484b7a13022ebb2b2bf20b5283" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.39", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.89" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ab9b36309365056cd639da3134bf87fa8f3d86008abf99e612384a6eecd459f" + +[[package]] +name = "weezl" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9193164d4de03a926d909d3bc7c30543cecb35400c02114792c2cae20d5e2dbb" + [[package]] name = "which" version = "4.4.2" @@ -1135,6 +2267,47 @@ dependencies = [ "rustix", ] +[[package]] +name = "wide" +version = "0.7.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c68938b57b33da363195412cfc5fc37c9ed49aa9cfe2156fde64b8d2c9498242" +dependencies = [ + "bytemuck", + "safe_arch", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" +dependencies = [ + "windows-targets", +] + [[package]] name = "windows-sys" version = "0.48.0" @@ -1220,3 +2393,12 @@ dependencies = [ "quote", "syn 2.0.39", ] + +[[package]] +name = "zune-inflate" +version = "0.2.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73ab332fe2f6680068f3582b16a24f90ad7096d5d39b974d1c0aff0125116f02" +dependencies = [ + "simd-adler32", +] diff --git a/Cargo.toml b/Cargo.toml index 930d8e6..9f0251a 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,9 +8,11 @@ edition = "2021" asn1-rs = "0.5" base64 = "0.21" ed25519-dalek = { version = "2.0", features = ["rand_core"] } +nix = { version = "0.27", features = ["signal"] } p256 = "0.13" prost = "0.12" qrcode = { version = "0.12", default-features = false } +qrcode_scanner = "0.3" rand = "0.8" sha2 = "0.10" tss-esapi = { git = "https://github.com/parallaxsecond/rust-tss-esapi.git", rev = "21d426354a8f3cf40f3727388f9c74cd8828e0cd" } diff --git a/Readme.md b/Readme.md index 314ed98..a255b21 100644 --- a/Readme.md +++ b/Readme.md @@ -26,6 +26,14 @@ B3:0B:43:3D:7F:21:95:31 86:59:43:68:54:D9:BA:C7 ``` + +TODO document measure (environment variables, config file, add config file to Makefile) +what it does, how to enable, how it works + +Document apt-get install libtss2-dev dependency + + + If you don't want to store the sensitive portion of the tpm2-object, you can only save a handle. Keep in mind, if another tool removes the handle from the tpm2, the private-key is lost. ```bash # cryptographic_id_add_initramfs tpm2 KEY_NAME2 --handle-only diff --git a/src/actions.rs b/src/actions.rs new file mode 100644 index 0000000..99adde2 --- /dev/null +++ b/src/actions.rs @@ -0,0 +1,46 @@ +use crate::scan; +use crate::tpm2; +use rand; +use rand::Rng; +use std::sync::atomic::AtomicBool; + +pub fn tpm2_scan_and_measure( + cam_path: String, + pcr_str: String, + stopper: &AtomicBool, +) -> i32 { + let pcr = match tpm2::str_to_pcrhandle(&pcr_str) { + Ok(p) => p, + Err(e) => { + println!("Failed to parse pcr {}: {}", pcr_str, e); + return -3; + } + }; + let mut camera = match scan::create_camera(cam_path) { + Ok(c) => c, + Err(e) => { + println!("{}", e); + return -1; + } + }; + let mut context = match tpm2::create_context() { + Ok(c) => c, + Err(e) => { + println!("Failed to open tpm2: {}", e); + return -1; + } + }; + match scan::scan_and_measure( + &mut camera, + &mut context, + pcr, + stopper, + |x| rand::thread_rng().gen_range(x), + ) { + Ok(_) => return 0, + Err(e) => { + println!("Failed to scan and measure: {}", e); + return -4; + } + }; +} diff --git a/src/main.rs b/src/main.rs index 53461a9..0a8f547 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,22 +1,35 @@ use std::env; use std::path::PathBuf; +use std::sync::atomic::{AtomicBool, Ordering}; +use nix::libc; +use nix::sys::signal; + +mod actions; mod conv; mod ed25519; mod error; mod fs; mod message; mod qrcode; +mod scan; mod sign; mod time; mod tpm2; use message::cryptographic_id::PublicKeyType; mod prime256v1; +static RECEIVED_SIGNAL: AtomicBool = AtomicBool::new(false); + +extern "C" fn handle_signal(_signal: libc::c_int) { + RECEIVED_SIGNAL.store(true, Ordering::Relaxed); +} + enum Action { CreateKey(PathBuf), ShowPublicKey(PathBuf), SignWithKey(PathBuf, String), + TPM2ScanAndMeasure, } fn print_help() { @@ -30,17 +43,28 @@ fn print_help() { \tcreate Create a private key\n\ \tsign Sign own id with message\n\ \tshow Show public key in hex format\n\ + \tscan_and_measure\n\ + \t Scans a QR-code and measures it into a PCR\n\ + \t Environment variables:\n\ + \t EXTEND_PCR: PCR to use\n\ + \t VIDEO: camera to use (/dev/video0)\n\ ", exe = args[0] ); } fn parse_args(args: &Vec) -> Result { - if args.len() < 3 { + if args.len() < 2 { return Err(()); } - let key_path = fs::to_path_buf(&args[2]); let action = &args[1]; + if args.len() == 2 { + if action == "scan_and_measure" { + return Ok(Action::TPM2ScanAndMeasure); + } + return Err(()); + } + let key_path = fs::to_path_buf(&args[2]); if args.len() == 3 { if action == "create" { return Ok(Action::CreateKey(key_path)); @@ -163,6 +187,40 @@ fn parse_args_and_execute(args: &Vec) -> i32 { } }; } + Action::TPM2ScanAndMeasure => { + let handler = + signal::SigHandler::Handler(handle_signal); + match unsafe { + signal::signal(signal::Signal::SIGINT, handler) + } { + Ok(_) => {} + Err(e) => { + println!( + "Failed to setup signal \ + handler: {}", + e + ); + return 6; + } + }; + + let pcr_str = match env::var("EXTEND_PCR") { + Ok(s) => s, + Err(e) => { + println!("EXTEND_PCR not set: {}", e); + return 5; + } + }; + let cam = match env::var("VIDEO") { + Ok(s) => s, + Err(_) => "/dev/video0".to_string(), + }; + return actions::tpm2_scan_and_measure( + cam, + pcr_str, + &RECEIVED_SIGNAL, + ); + } }; } diff --git a/src/scan.rs b/src/scan.rs new file mode 100644 index 0000000..0b3b36d --- /dev/null +++ b/src/scan.rs @@ -0,0 +1,305 @@ +use crate::error::DynError; +use crate::message; +use crate::message::CryptographicId; +use crate::time; +use crate::tpm2; + +use std::{ + io, + io::Write, + ops::Range, + sync::atomic::{AtomicBool, Ordering}, +}; + +use qrcode_scanner::QRScanStream; + +const MESSAGE_VALID: u64 = time::ONE_MINUTE_IN_MILLIS; + +pub fn create_camera<'a>(path: String) -> Result, DynError> { + return Ok(qrcode_scanner::QRScanStream::new(path)?); +} + +pub fn scan_id( + qr_stream: &mut QRScanStream, + stopper: &AtomicBool, + mut gen_range: impl FnMut(Range) -> u64, + output: &mut impl Write, +) -> Result { + let mut exp_msg = "".to_string(); + let mut msg_timestamp = 0; + let mut print = |msg: String| { + output.write_all(msg.as_bytes())?; + return Ok::<(), io::Error>(()); + }; + loop { + if stopper.load(Ordering::Relaxed) { + return Err("Scan aborted".into()); + } + let now = time::now()?; + if msg_timestamp + MESSAGE_VALID < now { + msg_timestamp = now; + let exp_num = gen_range(0..1000000); + exp_msg = format!("{:0>6}", exp_num); + print(format!("Send message: {}\n", exp_msg))?; + } + let results = match qr_stream.decode_next() { + Ok(r) => r, + Err(e) => { + print(format!( + "Failed to decode image: {}\n", + e + ))?; + continue; + } + }; + for res in results { + let msg = match message::from_base64(res) { + Ok(b) => b, + Err(e) => { + print(format!( + "Failed to decode: \ + {:?}\n", + e + ))?; + continue; + } + }; + match message::verify_current_with_msg(&msg, &exp_msg) { + Ok(()) => (), + Err(s) => { + print(format!("{}\n", s))?; + continue; + } + }; + return Ok(msg); + } + } +} + +pub fn scan_and_measure<'a>( + qr_stream: &mut QRScanStream<'a>, + tpm2_ctx: &mut tpm2::Context, + pcr: tpm2::PcrHandle, + stopper: &AtomicBool, + mut gen_range: impl FnMut(Range) -> u64, +) -> Result<(), DynError> { + let (hash, err) = match scan_id( + qr_stream, + stopper, + &mut gen_range, + &mut io::stdout(), + ) { + Ok(msg) => match message::fingerprint(&msg) { + Ok(f) => (f, Ok(())), + // Error case should not happen, the signing key + // is correct, since the signature was checked + Err(e) => (vec![0xf0; 32], Err(e)), + }, + Err(e) => { + println!("Failed to scan id: {}", e); + (vec![0xf0; 32], Err(e)) + } + }; + tpm2::pcr_extend(tpm2_ctx, pcr, hash)?; + // always meassure something in case of error + err?; + return Ok(()); +} + +#[cfg(test)] +mod tests { + use crate::error::DynError; + use crate::fs; + use crate::message; + use crate::sign::SigningConfig; + use crate::time; + use crate::tpm2; + use qrcode_scanner::QRScanStream; + use std::collections::VecDeque; + use std::sync::atomic::{AtomicBool, Ordering}; + use std::{thread, time::Duration}; + use tss_esapi::structures::{Digest, PcrSlot}; + + fn load_test_key() -> Result { + let file = fs::to_path_buf("tests/files/scan/signing_key"); + return Ok(SigningConfig::load(&file)?); + } + + fn example_msg() -> message::CryptographicId { + let key_type = crate::PublicKeyType::Ed25519 as i32; + return message::CryptographicId { + public_key: vec![], + timestamp: 0, + msg: "Testmessage".as_bytes().to_vec(), + public_key_type: key_type, + signature: Vec::new(), + personal_information: Vec::new(), + }; + } + + #[test] + #[ignore] + fn scan_id() -> Result<(), DynError> { + let mut key = load_test_key()?; + let mut output: Vec = Vec::new(); + let mut msg = example_msg(); + let code1 = 444444; + let code2 = 123456; + let sleep = super::MESSAGE_VALID; + let after_sleep = time::now()? + sleep; + + // correct code 2, when code 1 + msg.msg = code2.to_string().as_bytes().to_vec(); + msg.timestamp = after_sleep - 1; + message::sign(&mut msg, &mut key)?; + let res1 = message::to_base64(&msg)?; + // message in the past + msg.timestamp = after_sleep - super::MESSAGE_VALID - 1; + msg.msg = code2.to_string().as_bytes().to_vec(); + message::sign(&mut msg, &mut key)?; + let res2 = message::to_base64(&msg)?; + // correct mesage + msg.timestamp = after_sleep - 1; + message::sign(&mut msg, &mut key)?; + let res3 = message::to_base64(&msg)?; + + let data = VecDeque::from([ + Ok(vec![res1.clone(), "broken qrcode".to_string()]), + Ok(vec![res1.clone(), res2.clone()]), + Ok(vec![res2.clone(), res3.clone()]), + ]); + let mut scanner = QRScanStream::with_test_results(data)?; + let mut first_run = true; + + let result = super::scan_id( + &mut scanner, + &super::AtomicBool::new(false), + |_| { + if first_run { + first_run = false; + thread::sleep(Duration::from_millis( + sleep + 1, + )); + code1 + } else { + code2 + } + }, + &mut output, + )?; + assert_eq!(result, msg); + assert_eq!( + std::str::from_utf8(&output)?, + "Send message: 444444\n\ + Wrong message, please share 444444\n\ + Failed to decode: Base64Error(InvalidLength)\n\ + Send message: 123456\n" + ); + return Ok(()); + } + + static SCAN_ID_TEST_BOOL: AtomicBool = AtomicBool::new(false); + + #[test] + fn scan_id_stopper() -> Result<(), DynError> { + let mut output: Vec = Vec::new(); + let msg = example_msg(); + let res1 = message::to_base64(&msg)?; + + let data = VecDeque::from([ + Ok(vec![res1.clone()]), + Ok(vec![res1.clone()]), + Ok(vec![res1.clone()]), + ]); + let mut scanner = QRScanStream::with_test_results(data)?; + + let result = super::scan_id( + &mut scanner, + &SCAN_ID_TEST_BOOL, + |_| { + SCAN_ID_TEST_BOOL + .store(true, Ordering::Relaxed); + 987654 + }, + &mut output, + ); + assert!(matches!( + result, + Err(e) if format!("{}", e) == "Scan aborted")); + assert_eq!( + std::str::from_utf8(&output)?, + "Send message: 987654\n\ + Wrong message, please share 987654\n" + ); + return Ok(()); + } + + #[test] + fn scan_and_measure() -> Result<(), DynError> { + let mut key = load_test_key()?; + let mut msg = example_msg(); + let code = 765432; + msg.msg = code.to_string().as_bytes().to_vec(); + msg.timestamp = time::now()?; + message::sign(&mut msg, &mut key)?; + let res = message::to_base64(&msg)?; + + let data = VecDeque::from([Ok(vec![res.clone()])]); + let mut scanner = QRScanStream::with_test_results(data)?; + let mut tpm2_ctx = tpm2::create_context()?; + super::scan_and_measure( + &mut scanner, + &mut tpm2_ctx, + super::tpm2::PcrHandle::Pcr8, + &AtomicBool::new(false), + |_| code, + )?; + let sha1 = Digest::try_from(vec![ + 211, 76, 155, 19, 129, 231, 47, 147, 60, 85, 161, 27, + 224, 255, 120, 56, 136, 122, 161, 212, + ])?; + let sha256 = Digest::try_from(vec![ + 69, 118, 210, 215, 174, 24, 252, 210, 145, 250, 146, + 34, 123, 169, 90, 53, 251, 122, 191, 11, 29, 10, 50, 3, + 3, 57, 167, 67, 255, 241, 250, 51, + ])?; + tpm2::tests::assert_pcr_bank( + &mut tpm2_ctx, + PcrSlot::Slot8, + vec![sha1, sha256], + )?; + return Ok(()); + } + + #[test] + fn scan_and_measure_error() -> Result<(), DynError> { + let data = VecDeque::from([Ok(vec![])]); + let mut scanner = QRScanStream::with_test_results(data)?; + let mut tpm2_ctx = tpm2::create_context()?; + let result = super::scan_and_measure( + &mut scanner, + &mut tpm2_ctx, + super::tpm2::PcrHandle::Pcr9, + &AtomicBool::new(true), + |_| 555, + ); + assert!(matches!( + result, + Err(e) if format!("{}", e) == "Scan aborted")); + let sha1 = Digest::try_from(vec![ + 55, 2, 26, 169, 90, 41, 122, 229, 93, 119, 203, 95, + 120, 25, 36, 2, 150, 209, 87, 179, + ])?; + let sha256 = Digest::try_from(vec![ + 69, 181, 67, 179, 102, 148, 197, 253, 15, 144, 223, + 198, 7, 191, 146, 161, 115, 87, 16, 48, 7, 86, 67, 251, + 31, 177, 224, 221, 19, 171, 117, 141, + ])?; + tpm2::tests::assert_pcr_bank( + &mut tpm2_ctx, + PcrSlot::Slot9, + vec![sha1, sha256], + )?; + return Ok(()); + } +} diff --git a/src/tpm2/common.rs b/src/tpm2/common.rs index b06f58f..7db9b95 100644 --- a/src/tpm2/common.rs +++ b/src/tpm2/common.rs @@ -2,11 +2,9 @@ use crate::conv; use crate::error::DynError; use crate::prime256v1; use std::path::PathBuf; -pub use tss_esapi::Error; use tss_esapi::{ attributes::ObjectAttributesBuilder, constants::{CapabilityType, SessionType}, - handles::PcrHandle, interface_types::{ algorithm::{HashingAlgorithm, PublicAlgorithm, SymmetricMode}, ecc::EccCurve, @@ -17,12 +15,13 @@ use tss_esapi::{ structures::{ CapabilityData, CreatePrimaryKeyResult, Digest, DigestValues, EccPoint, EccScheme, KeyDerivationFunctionScheme, MaxBuffer, - PcrSelectionListBuilder, PcrSlot, Public, PublicBuilder, + PcrSelectionListBuilder, Public, PublicBuilder, PublicEccParametersBuilder, SymmetricDefinition, SymmetricDefinitionObject, }, - Context, TctiNameConf, WrapperErrorKind, + TctiNameConf, WrapperErrorKind, }; +pub use tss_esapi::{handles::PcrHandle, structures::PcrSlot, Context, Error}; pub fn to_private_file(dir: &PathBuf) -> PathBuf { let mut p = dir.clone(); @@ -233,7 +232,7 @@ pub fn pcr_extend( } #[cfg(test)] -mod tests { +pub mod tests { use crate::error::DynError; use crate::fs; use crate::tpm2; @@ -503,7 +502,7 @@ mod tests { return Ok(()); } - fn assert_pcr_bank( + pub fn assert_pcr_bank( context: &mut Context, slot: PcrSlot, exp_res: Vec, diff --git a/tests/files/scan/signing_key b/tests/files/scan/signing_key new file mode 100644 index 0000000..2841892 --- /dev/null +++ b/tests/files/scan/signing_key @@ -0,0 +1 @@ +/®9Œ¶Ãï%·N I#Å#&b“çÒz½á àòÃÉVµGœ"ögbë‚~ò m°Vvß™Ù!!öRs \ No newline at end of file