From 454b6a88393b99b99e7b22a36ce1b031e91b3ca1 Mon Sep 17 00:00:00 2001 From: Nathan Mc Grath Date: Thu, 2 Feb 2023 01:12:52 +0100 Subject: [PATCH] test: fix wasm-pack test compatibility issues with ic-crypto packages --- .github/workflows/pull-request.yml | 4 - Cargo.lock | 2262 +---------------- .../Cargo.toml | 18 +- .../src/asset_tree.rs | 3 +- .../src/certificate.rs | 318 ++- .../src/encoding.rs | 14 + packages/ic-response-verification/Cargo.lock | 1209 --------- packages/ic-response-verification/Cargo.toml | 2 - .../src/validation/common_validation.rs | 100 +- 9 files changed, 475 insertions(+), 3455 deletions(-) delete mode 100644 packages/ic-response-verification/Cargo.lock diff --git a/.github/workflows/pull-request.yml b/.github/workflows/pull-request.yml index 27b3132e..54de44f9 100644 --- a/.github/workflows/pull-request.yml +++ b/.github/workflows/pull-request.yml @@ -24,10 +24,6 @@ jobs: target/ key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} - # Needed because of the IC monorepo dependencies - - name: Install Protoc - uses: arduino/setup-protoc@v1 - - name: Setup Rust uses: actions-rs/toolchain@v1 with: diff --git a/Cargo.lock b/Cargo.lock index 76eedeee..c866e553 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -32,12 +32,6 @@ version = "1.0.68" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" -[[package]] -name = "arc-swap" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bddcadddf5e9015d310179a59bb28c4d4b9920ad0f11e8e14dbadf654890c9a6" - [[package]] name = "arrayvec" version = "0.5.2" @@ -53,27 +47,6 @@ dependencies = [ "term", ] -[[package]] -name = "async-stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dad5c83079eae9969be7fadefe640a1c566901f05ff91ab221de4b6f68d9507e" -dependencies = [ - "async-stream-impl", - "futures-core", -] - -[[package]] -name = "async-stream-impl" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10f203db73a71dfa2fb6dd22763990fa26f3d2625a6da2da900d23b87d26be27" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "async-trait" version = "0.1.61" @@ -96,74 +69,19 @@ dependencies = [ "winapi", ] -[[package]] -name = "autocfg" -version = "0.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dde43e75fd43e8a1bf86103336bc699aa8d17ad1be60c76c0bdfd4828e19b78" -dependencies = [ - "autocfg 1.1.0", -] - [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "axum" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5694b64066a2459918d8074c2ce0d5a88f409431994c2356617c8ae0c4721fc" -dependencies = [ - "async-trait", - "axum-core", - "bitflags", - "bytes", - "futures-util", - "http", - "http-body", - "hyper", - "itoa", - "matchit", - "memchr", - "mime", - "percent-encoding", - "pin-project-lite", - "rustversion", - "serde", - "sync_wrapper", - "tower", - "tower-http", - "tower-layer", - "tower-service", -] - -[[package]] -name = "axum-core" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1cae3e661676ffbacb30f1a824089a8c9150e71017f7e1e38f2aa32009188d34" -dependencies = [ - "async-trait", - "bytes", - "futures-util", - "http", - "http-body", - "mime", - "rustversion", - "tower-layer", - "tower-service", -] - [[package]] name = "backoff" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b62ddb9cb1ec0a098ad4bbf9344d0713fa193ae1a80af55febcff2627b6a00c1" dependencies = [ - "getrandom 0.2.8", + "getrandom", "instant", "rand", ] @@ -263,18 +181,6 @@ version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" -[[package]] -name = "bitvec" -version = "0.19.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55f93d0ef3363c364d5976646a38f04cf67cfe1d4c8d160cdea02cab2c116b33" -dependencies = [ - "funty", - "radium", - "tap", - "wyz", -] - [[package]] name = "block-buffer" version = "0.9.0" @@ -303,7 +209,7 @@ dependencies = [ "ff", "group", "pairing", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -421,45 +327,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "clap" -version = "3.2.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" -dependencies = [ - "atty", - "bitflags", - "clap_derive", - "clap_lex", - "indexmap", - "once_cell", - "strsim", - "termcolor", - "textwrap", -] - -[[package]] -name = "clap_derive" -version = "3.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ea0c8bce528c4be4da13ea6fead8965e95b6073585a2f05204bd8f4119f82a65" -dependencies = [ - "heck 0.4.0", - "proc-macro-error", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "clap_lex" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" -dependencies = [ - "os_str_bytes", -] - [[package]] name = "codespan-reporting" version = "0.11.1" @@ -571,25 +438,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "crossbeam-channel" -version = "0.5.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c2dd04ddaf88237dc3b8d8f9a3c1004b506b54b3313403944054d23c0870c521" -dependencies = [ - "cfg-if 1.0.0", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb766fa798726286dbbb842f174001dab8abc7b627a1dd86e0b7222a95d929f" -dependencies = [ - "cfg-if 1.0.0", -] - [[package]] name = "crunchy" version = "0.2.2" @@ -603,7 +451,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ "generic-array", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -628,32 +476,6 @@ dependencies = [ "syn", ] -[[package]] -name = "curve25519-dalek" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", - "subtle", - "zeroize", -] - -[[package]] -name = "curve25519-dalek-ng" -version = "4.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c359b7249347e46fb28804470d071c921156ad62b3eef5d34e2ba867533dec8" -dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.6.4", - "subtle-ng", - "zeroize", -] - [[package]] name = "cvt" version = "0.1.1" @@ -759,31 +581,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "der-oid-macro" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a4cccf60bb98c0fca115a581f894aed0e43fa55bf289fdac5599bec440bb4fd6" -dependencies = [ - "nom 6.1.2", - "num-bigint", - "num-traits", - "syn", -] - -[[package]] -name = "der-parser" -version = "5.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d7ededb7525bb4114bc209685ce7894edc2965f4914312a1ea578a645a237f0" -dependencies = [ - "der-oid-macro", - "nom 6.1.2", - "num-bigint", - "num-traits", - "rusticata-macros", -] - [[package]] name = "derive_more" version = "0.99.8-alpha.0" @@ -794,28 +591,6 @@ dependencies = [ "syn", ] -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case 0.4.0", - "proc-macro2", - "quote", - "rustc_version", - "syn", -] - -[[package]] -name = "dfn_core" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-base-types", - "on_wire", -] - [[package]] name = "diff" version = "0.1.13" @@ -875,33 +650,6 @@ dependencies = [ "signature", ] -[[package]] -name = "ed25519-consensus" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c8465edc8ee7436ffea81d21a019b16676ee3db267aa8d5a8d729581ecf998b" -dependencies = [ - "curve25519-dalek-ng", - "hex", - "rand_core 0.6.4", - "serde", - "sha2 0.9.9", - "thiserror", - "zeroize", -] - -[[package]] -name = "educe" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0188e3c3ba8df5753894d54461f0e39bc91741dc5b22e1c46999ec2c71f4e4" -dependencies = [ - "enum-ordinalize", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "either" version = "1.8.0" @@ -923,7 +671,7 @@ dependencies = [ "group", "pem-rfc7468", "pkcs8", - "rand_core 0.6.4", + "rand_core", "sec1", "subtle", "zeroize", @@ -947,20 +695,6 @@ dependencies = [ "cfg-if 1.0.0", ] -[[package]] -name = "enum-ordinalize" -version = "3.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bb1df8b45ecb7ffa78dca1c17a438fb193eb083db0b1b494d2a61bcb5096a" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "rustc_version", - "syn", -] - [[package]] name = "erased-serde" version = "0.3.24" @@ -970,28 +704,6 @@ dependencies = [ "serde", ] -[[package]] -name = "fastrand" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a407cfaa3385c4ae6b23e84623d48c2798d06e3e6a1878f7f59f17b3f86499" -dependencies = [ - "instant", -] - -[[package]] -name = "fe-derive" -version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "hex", - "num-bigint-dig 0.8.2", - "num-traits", - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "features" version = "0.10.0" @@ -1007,7 +719,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1066,27 +778,6 @@ dependencies = [ "percent-encoding", ] -[[package]] -name = "funty" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fed34cd105917e91daa4da6b3728c47b068749d6a62c59811f06ed2ac71d9da7" - -[[package]] -name = "futures" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "38390104763dc37a5145a53c29c63c1290b5d316d6086ec32c293f6736051bb0" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - [[package]] name = "futures-channel" version = "0.3.25" @@ -1094,7 +785,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "52ba265a92256105f45b719605a571ffe2d1f0fea3807304b522c1d778f79eed" dependencies = [ "futures-core", - "futures-sink", ] [[package]] @@ -1103,17 +793,6 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "04909a7a7e4633ae6c4a9ab280aeb86da1236243a77b694a49eacd659a4bd3ac" -[[package]] -name = "futures-executor" -version = "0.3.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7acc85df6714c176ab5edf386123fafe217be88c0840ec11f199441134a074e2" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - [[package]] name = "futures-io" version = "0.3.25" @@ -1149,11 +828,9 @@ version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "197676987abd2f9cadff84926f410af1c183608d36641465df73ae8211dc65d6" dependencies = [ - "futures-channel", "futures-core", "futures-io", "futures-macro", - "futures-sink", "futures-task", "memchr", "pin-project-lite", @@ -1171,17 +848,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "getrandom" -version = "0.1.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc3cb4d91f53b50155bdcfd23f6a4c39ae1969c2ae85982b135750cccaf5fce" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi 0.9.0+wasi-snapshot-preview1", -] - [[package]] name = "getrandom" version = "0.2.8" @@ -1189,8 +855,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" dependencies = [ "cfg-if 1.0.0", + "js-sys", "libc", "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", ] [[package]] @@ -1200,7 +868,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ "ff", - "rand_core 0.6.4", + "rand_core", "subtle", ] @@ -1274,12 +942,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hex-literal" -version = "0.3.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ebdb29d2ea9ed0083cd8cece49bbd968021bd99b0849edb4a9a7ee0fdf6a4e0" - [[package]] name = "hmac" version = "0.12.1" @@ -1311,12 +973,6 @@ dependencies = [ "pin-project-lite", ] -[[package]] -name = "http-range-header" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0bfe8eed0a9285ef776bb792479ea3834e8b94e13d615c2f66d03dd50a435a29" - [[package]] name = "httparse" version = "1.8.0" @@ -1329,12 +985,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" -[[package]] -name = "humantime" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" - [[package]] name = "hyper" version = "0.14.23" @@ -1368,30 +1018,18 @@ dependencies = [ "http", "hyper", "log", - "rustls 0.20.8", + "rustls", "rustls-native-certs", "tokio", - "tokio-rustls 0.23.4", + "tokio-rustls", "webpki-roots", ] [[package]] -name = "hyper-timeout" -version = "0.4.1" +name = "iana-time-zone" +version = "0.1.53" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" -dependencies = [ - "hyper", - "pin-project-lite", - "tokio", - "tokio-io-timeout", -] - -[[package]] -name = "iana-time-zone" -version = "0.1.53" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" +checksum = "64c122667b287044802d6ce17ee2ddf13207ed924c712de9a66a5814d5b64765" dependencies = [ "android_system_properties", "core-foundation-sys", @@ -1411,33 +1049,6 @@ dependencies = [ "cxx-build", ] -[[package]] -name = "ic-adapter-metrics" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-adapter-metrics-service", - "ic-async-utils", - "prometheus", - "protobuf", - "slog", - "slog-async", - "tokio", - "tonic", - "tower", -] - -[[package]] -name = "ic-adapter-metrics-service" -version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "prost", - "prost-build", - "tonic", - "tonic-build", -] - [[package]] name = "ic-agent" version = "0.23.0" @@ -1460,42 +1071,23 @@ dependencies = [ "k256", "leb128", "mime", - "pem 1.1.1", + "pem", "pkcs8", "rand", "reqwest", "ring", - "rustls 0.20.8", + "rustls", "sec1", "serde", "serde_bytes", "serde_cbor", "sha2 0.10.6", - "simple_asn1 0.6.2", + "simple_asn1", "thiserror", "tokio", "url", ] -[[package]] -name = "ic-async-utils" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "async-stream", - "byte-unit", - "derive_more 0.99.17", - "futures", - "futures-util", - "hyper", - "ic-types", - "prometheus", - "slog", - "tokio", - "tonic", - "tower", -] - [[package]] name = "ic-base-types" version = "0.8.0" @@ -1538,21 +1130,6 @@ dependencies = [ "serde_bytes", ] -[[package]] -name = "ic-certification" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "hex", - "ic-crypto-tree-hash", - "ic-crypto-utils-threshold-sig", - "ic-crypto-utils-threshold-sig-der", - "ic-types", - "serde", - "serde_cbor", - "tree-deserializer", -] - [[package]] name = "ic-certification" version = "0.23.0" @@ -1576,24 +1153,6 @@ dependencies = [ "sha2 0.10.6", ] -[[package]] -name = "ic-certification-test-utils" -version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-crypto-internal-seed", - "ic-crypto-internal-threshold-sig-bls12381", - "ic-crypto-internal-types", - "ic-crypto-tree-hash", - "ic-crypto-utils-threshold-sig-der", - "ic-interfaces", - "ic-types", - "leb128", - "rand", - "serde", - "serde_cbor", -] - [[package]] name = "ic-certified-map" version = "0.3.2" @@ -1605,225 +1164,17 @@ dependencies = [ "sha2 0.10.6", ] -[[package]] -name = "ic-config" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "ic-base-types", - "ic-protobuf", - "ic-registry-subnet-type", - "ic-sys", - "ic-types", - "json5", - "serde", - "slog", - "tempfile", - "url", -] - [[package]] name = "ic-constants" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -[[package]] -name = "ic-context-logger" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "slog", -] - -[[package]] -name = "ic-crypto" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "arrayvec", - "async-trait", - "base64 0.11.0", - "bincode", - "clap", - "ed25519-consensus", - "hex", - "ic-base-types", - "ic-config", - "ic-crypto-internal-basic-sig-ed25519", - "ic-crypto-internal-basic-sig-iccsa", - "ic-crypto-internal-csp", - "ic-crypto-internal-logmon", - "ic-crypto-internal-multi-sig-bls12381", - "ic-crypto-internal-seed", - "ic-crypto-internal-test-vectors", - "ic-crypto-internal-threshold-sig-bls12381", - "ic-crypto-internal-threshold-sig-ecdsa", - "ic-crypto-internal-types", - "ic-crypto-node-key-generation", - "ic-crypto-tls-cert-validation", - "ic-crypto-tls-interfaces", - "ic-crypto-utils-basic-sig", - "ic-crypto-utils-time", - "ic-interfaces", - "ic-interfaces-registry", - "ic-logger", - "ic-metrics", - "ic-protobuf", - "ic-registry-client-fake", - "ic-registry-client-helpers", - "ic-registry-keys", - "ic-registry-proto-data-provider", - "ic-types", - "ic-utils 0.8.0", - "lazy_static", - "num-integer", - "openssl", - "parking_lot 0.12.1", - "prometheus", - "prost", - "prost-build", - "rand", - "rand_chacha", - "serde", - "serde_bytes", - "serde_cbor", - "simple_asn1 0.6.2", - "slog", - "strum 0.23.0", - "strum_macros 0.23.1", - "tempfile", - "tokio", - "tokio-openssl", - "tokio-rustls 0.22.0", - "zeroize", -] - [[package]] name = "ic-crypto-getrandom-for-wasm" version = "0.1.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "getrandom 0.2.8", -] - -[[package]] -name = "ic-crypto-internal-basic-sig-cose" -version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-crypto-internal-basic-sig-der-utils", - "ic-crypto-internal-basic-sig-ecdsa-secp256r1", - "ic-crypto-internal-basic-sig-rsa-pkcs1", - "ic-types", - "serde", - "serde_cbor", - "simple_asn1 0.6.2", -] - -[[package]] -name = "ic-crypto-internal-basic-sig-der-utils" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "hex", - "ic-types", - "simple_asn1 0.6.2", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-basic-sig-ecdsa-secp256k1" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "hex", - "ic-crypto-internal-basic-sig-der-utils", - "ic-crypto-internal-types", - "ic-crypto-secrets-containers", - "ic-types", - "openssl", - "serde", - "serde_bytes", - "simple_asn1 0.6.2", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-basic-sig-ecdsa-secp256r1" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "hex", - "ic-crypto-internal-basic-sig-der-utils", - "ic-crypto-internal-types", - "ic-crypto-secrets-containers", - "ic-types", - "openssl", - "p256", - "rand", - "serde", - "serde_bytes", - "simple_asn1 0.6.2", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-basic-sig-ed25519" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "curve25519-dalek", - "ed25519-consensus", - "hex", - "ic-crypto-internal-basic-sig-der-utils", - "ic-crypto-internal-seed", - "ic-crypto-internal-types", - "ic-crypto-secrets-containers", - "ic-protobuf", - "ic-types", - "rand", - "rand_chacha", - "serde", - "simple_asn1 0.6.2", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-basic-sig-iccsa" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "hex", - "ic-certification 0.8.0", - "ic-crypto-internal-basic-sig-der-utils", - "ic-crypto-internal-types", - "ic-crypto-sha", - "ic-crypto-tree-hash", - "ic-types", - "serde", - "serde_bytes", - "serde_cbor", - "simple_asn1 0.6.2", -] - -[[package]] -name = "ic-crypto-internal-basic-sig-rsa-pkcs1" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-crypto-internal-basic-sig-der-utils", - "ic-crypto-sha", - "ic-types", - "num-bigint", - "num-traits", - "rsa", - "serde", - "simple_asn1 0.6.2", + "getrandom", ] [[package]] @@ -1839,598 +1190,161 @@ dependencies = [ "paste", "rand", "rand_chacha", - "sha2 0.9.9", - "subtle", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-csp" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "async-trait", - "base64 0.11.0", - "hex", - "ic-config", - "ic-crypto-internal-basic-sig-cose", - "ic-crypto-internal-basic-sig-der-utils", - "ic-crypto-internal-basic-sig-ecdsa-secp256k1", - "ic-crypto-internal-basic-sig-ecdsa-secp256r1", - "ic-crypto-internal-basic-sig-ed25519", - "ic-crypto-internal-basic-sig-iccsa", - "ic-crypto-internal-basic-sig-rsa-pkcs1", - "ic-crypto-internal-logmon", - "ic-crypto-internal-multi-sig-bls12381", - "ic-crypto-internal-seed", - "ic-crypto-internal-test-vectors", - "ic-crypto-internal-threshold-sig-bls12381", - "ic-crypto-internal-threshold-sig-ecdsa", - "ic-crypto-internal-tls", - "ic-crypto-internal-types", - "ic-crypto-secrets-containers", - "ic-crypto-sha", - "ic-crypto-tls-interfaces", - "ic-crypto-utils-time", - "ic-interfaces", - "ic-logger", - "ic-metrics", - "ic-protobuf", - "ic-types", - "ic-utils 0.8.0", - "openssl", - "parking_lot 0.12.1", - "prost", - "rand", - "rand_chacha", - "serde", - "serde_cbor", - "simple_asn1 0.6.2", - "slog", - "strum 0.23.0", - "strum_macros 0.23.1", - "tarpc", - "tempfile", - "threadpool", - "tokio", - "tokio-openssl", - "tokio-serde", - "tokio-util", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-hmac" -version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-crypto-internal-sha2", -] - -[[package]] -name = "ic-crypto-internal-logmon" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "convert_case 0.6.0", - "ic-metrics", - "prometheus", - "strum 0.23.0", - "strum_macros 0.23.1", -] - -[[package]] -name = "ic-crypto-internal-multi-sig-bls12381" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "hex", - "ic-crypto-internal-bls12-381-type", - "ic-crypto-internal-types", - "ic-crypto-sha", - "ic-protobuf", - "ic-types", - "rand", - "rand_chacha", - "serde", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-seed" -version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "hex", - "ic-crypto-sha", - "ic-types", - "rand", - "rand_chacha", - "serde", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-sha2" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "openssl", - "sha2 0.9.9", -] - -[[package]] -name = "ic-crypto-internal-test-vectors" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "hex", - "strum 0.23.0", - "strum_macros 0.23.1", -] - -[[package]] -name = "ic-crypto-internal-threshold-sig-bls12381" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "arrayvec", - "base64 0.11.0", - "cached", - "hex", - "ic-crypto-internal-bls12-381-type", - "ic-crypto-internal-seed", - "ic-crypto-internal-threshold-sig-bls12381-der", - "ic-crypto-internal-types", - "ic-crypto-sha", - "ic-types", - "lazy_static", - "parking_lot 0.12.1", - "rand", - "rand_chacha", - "serde", - "serde_bytes", - "serde_cbor", - "strum_macros 0.23.1", - "subtle", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-threshold-sig-bls12381-der" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "simple_asn1 0.6.2", -] - -[[package]] -name = "ic-crypto-internal-threshold-sig-ecdsa" -version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "fe-derive", - "hex", - "hex-literal", - "ic-crypto-internal-hmac", - "ic-crypto-internal-seed", - "ic-crypto-internal-types", - "ic-crypto-sha", - "ic-types", - "k256", - "lazy_static", - "p256", - "paste", - "rand", - "rand_chacha", - "serde", - "serde_bytes", - "serde_cbor", - "subtle", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-tls" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "ic-crypto-internal-basic-sig-ed25519", - "ic-crypto-secrets-containers", - "ic-types", - "openssl", - "rand", - "serde", - "serde_bytes", - "zeroize", -] - -[[package]] -name = "ic-crypto-internal-types" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "arrayvec", - "base64 0.11.0", - "hex", - "ic-protobuf", - "phantom_newtype", - "serde", - "serde_cbor", - "strum 0.23.0", - "strum_macros 0.23.1", - "thiserror", - "zeroize", -] - -[[package]] -name = "ic-crypto-node-key-generation" -version = "0.1.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-config", - "ic-crypto-internal-csp", - "ic-crypto-internal-logmon", - "ic-crypto-internal-threshold-sig-ecdsa", - "ic-crypto-internal-types", - "ic-crypto-tls-interfaces", - "ic-crypto-utils-basic-sig", - "ic-interfaces", - "ic-interfaces-registry", - "ic-protobuf", - "ic-types", - "tokio", -] - -[[package]] -name = "ic-crypto-secrets-containers" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "serde", - "zeroize", -] - -[[package]] -name = "ic-crypto-sha" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-crypto-internal-sha2", -] - -[[package]] -name = "ic-crypto-tls-cert-validation" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "chrono", - "dfn_core", - "hex", - "ic-base-types", - "ic-crypto-internal-basic-sig-ed25519", - "ic-crypto-internal-types", - "ic-protobuf", - "ic-types", - "x509-parser", -] - -[[package]] -name = "ic-crypto-tls-interfaces" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "async-trait", - "ic-protobuf", - "ic-types", - "openssl", - "serde", - "tokio", - "tokio-rustls 0.22.0", -] - -[[package]] -name = "ic-crypto-tree-hash" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-crypto-internal-types", - "ic-crypto-sha", - "ic-protobuf", - "serde", - "serde_bytes", -] - -[[package]] -name = "ic-crypto-utils-basic-sig" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "ed25519-consensus", - "ic-base-types", - "ic-crypto-internal-basic-sig-der-utils", - "ic-crypto-internal-basic-sig-ed25519", - "ic-crypto-internal-types", - "ic-protobuf", - "simple_asn1 0.6.2", -] - -[[package]] -name = "ic-crypto-utils-threshold-sig" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "ic-crypto-internal-threshold-sig-bls12381", - "ic-crypto-internal-types", - "ic-types", -] - -[[package]] -name = "ic-crypto-utils-threshold-sig-der" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "base64 0.11.0", - "ic-crypto-internal-threshold-sig-bls12381-der", - "ic-crypto-internal-types", - "ic-types", -] - -[[package]] -name = "ic-crypto-utils-time" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-interfaces", - "ic-logger", - "ic-types", - "slog", -] - -[[package]] -name = "ic-error-types" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "serde", - "strum 0.23.0", - "strum_macros 0.23.1", -] - -[[package]] -name = "ic-ic00-types" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "candid", - "float-cmp", - "ic-base-types", - "ic-btc-types", - "ic-btc-types-internal", - "ic-error-types", - "ic-protobuf", - "num-traits", - "serde", - "serde_bytes", - "serde_cbor", - "strum 0.23.0", - "strum_macros 0.23.1", -] - -[[package]] -name = "ic-interfaces" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "async-trait", - "derive_more 0.99.8-alpha.0", - "ic-base-types", - "ic-crypto-tree-hash", - "ic-error-types", - "ic-ic00-types", - "ic-interfaces-state-manager", - "ic-protobuf", - "ic-registry-provisional-whitelist", - "ic-registry-subnet-type", - "ic-sys", - "ic-types", - "ic-utils 0.8.0", - "ic-wasm-types", - "prost", - "rand", - "serde", - "serde_bytes", - "thiserror", - "tower", -] - -[[package]] -name = "ic-interfaces-registry" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-types", - "prost", - "serde", -] - -[[package]] -name = "ic-interfaces-state-manager" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-crypto-tree-hash", - "ic-types", - "phantom_newtype", - "thiserror", -] - -[[package]] -name = "ic-logger" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "chrono", - "ic-config", - "ic-context-logger", - "ic-protobuf", - "serde", - "slog", - "slog-async", - "slog-json", - "slog-scope", - "slog-term", -] - -[[package]] -name = "ic-metrics" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "futures", - "ic-adapter-metrics", - "ic-logger", - "libc", - "procfs", - "prometheus", - "slog", - "slog-async", - "tokio", + "sha2 0.9.9", + "subtle", + "zeroize", ] [[package]] -name = "ic-protobuf" -version = "0.8.0" +name = "ic-crypto-internal-seed" +version = "0.1.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "bincode", - "candid", - "erased-serde", - "maplit", - "prost", + "hex", + "ic-crypto-sha", + "ic-types", + "rand", + "rand_chacha", "serde", - "serde_json", - "slog", + "zeroize", ] [[package]] -name = "ic-registry-client-fake" +name = "ic-crypto-internal-sha2" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "ic-interfaces-registry", - "ic-types", + "openssl", + "sha2 0.9.9", ] [[package]] -name = "ic-registry-client-helpers" +name = "ic-crypto-internal-threshold-sig-bls12381" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "ic-ic00-types", - "ic-interfaces-registry", - "ic-protobuf", - "ic-registry-common-proto", - "ic-registry-keys", - "ic-registry-provisional-whitelist", - "ic-registry-routing-table", - "ic-registry-subnet-features", + "arrayvec", + "base64 0.11.0", + "cached", + "hex", + "ic-crypto-internal-bls12-381-type", + "ic-crypto-internal-seed", + "ic-crypto-internal-threshold-sig-bls12381-der", + "ic-crypto-internal-types", + "ic-crypto-sha", "ic-types", + "lazy_static", + "parking_lot", + "rand", + "rand_chacha", + "serde", + "serde_bytes", "serde_cbor", + "strum_macros 0.23.1", + "subtle", + "zeroize", ] [[package]] -name = "ic-registry-common-proto" +name = "ic-crypto-internal-threshold-sig-bls12381-der" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "prost", + "simple_asn1", ] [[package]] -name = "ic-registry-keys" +name = "ic-crypto-internal-types" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "candid", - "ic-base-types", - "ic-ic00-types", - "ic-types", + "arrayvec", + "base64 0.11.0", + "hex", + "ic-protobuf", + "phantom_newtype", "serde", + "serde_cbor", + "strum 0.23.0", + "strum_macros 0.23.1", + "thiserror", + "zeroize", ] [[package]] -name = "ic-registry-proto-data-provider" +name = "ic-crypto-sha" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "bytes", - "ic-interfaces-registry", - "ic-registry-common-proto", - "ic-registry-transport", - "ic-types", - "ic-utils 0.8.0", - "thiserror", + "ic-crypto-internal-sha2", ] [[package]] -name = "ic-registry-provisional-whitelist" +name = "ic-crypto-tree-hash" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "ic-base-types", + "ic-crypto-internal-types", + "ic-crypto-sha", "ic-protobuf", + "serde", + "serde_bytes", ] [[package]] -name = "ic-registry-routing-table" +name = "ic-crypto-utils-threshold-sig-der" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "candid", - "ic-base-types", - "ic-protobuf", - "serde", + "base64 0.11.0", + "ic-crypto-internal-threshold-sig-bls12381-der", + "ic-crypto-internal-types", + "ic-types", ] [[package]] -name = "ic-registry-subnet-features" +name = "ic-error-types" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "candid", - "ic-ic00-types", - "ic-protobuf", "serde", + "strum 0.23.0", + "strum_macros 0.23.1", ] [[package]] -name = "ic-registry-subnet-type" +name = "ic-ic00-types" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ "candid", + "float-cmp", + "ic-base-types", + "ic-btc-types", + "ic-btc-types-internal", + "ic-error-types", "ic-protobuf", + "num-traits", "serde", + "serde_bytes", + "serde_cbor", "strum 0.23.0", "strum_macros 0.23.1", ] [[package]] -name = "ic-registry-transport" +name = "ic-protobuf" version = "0.8.0" source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" dependencies = [ - "bytes", + "bincode", "candid", - "ic-protobuf", + "erased-serde", + "maplit", "prost", "serde", + "serde_json", + "slog", ] [[package]] @@ -2449,7 +1363,7 @@ dependencies = [ "js-sys", "leb128", "miracl_core_bls12381", - "nom 7.1.1", + "nom", "serde", "serde_cbor", "sha2 0.10.6", @@ -2464,13 +1378,20 @@ name = "ic-response-verification-test-utils" version = "0.0.0" dependencies = [ "base64 0.21.0", + "getrandom", "hex", "ic-base-types", - "ic-certification 0.23.0 (git+https://github.com/dfinity/agent-rs?rev=815ee1f)", - "ic-certification-test-utils", "ic-certified-map", - "ic-crypto", + "ic-crypto-internal-seed", + "ic-crypto-internal-threshold-sig-bls12381", + "ic-crypto-internal-types", "ic-crypto-tree-hash", + "ic-crypto-utils-threshold-sig-der", + "ic-types", + "leb128", + "rand", + "serde", + "serde_cbor", "sha256", ] @@ -2511,7 +1432,7 @@ dependencies = [ "bincode", "candid", "chrono", - "derive_more 0.99.8-alpha.0", + "derive_more", "hex", "http", "ic-base-types", @@ -2593,18 +1514,6 @@ dependencies = [ "sha2 0.9.9", ] -[[package]] -name = "ic-wasm-types" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-crypto-sha", - "ic-protobuf", - "ic-sys", - "ic-utils 0.8.0", - "serde", -] - [[package]] name = "ic_bls12_381" version = "0.7.1" @@ -2615,7 +1524,7 @@ dependencies = [ "ff", "group", "pairing", - "rand_core 0.6.4", + "rand_core", "subtle", "zeroize", ] @@ -2642,7 +1551,7 @@ version = "1.9.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" dependencies = [ - "autocfg 1.1.0", + "autocfg", "hashbrown", ] @@ -2685,17 +1594,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "json5" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b0db21af676c1ce64250b5f40f3ce2cf27e4e47cb91ed91eb6fe9350b430c1" -dependencies = [ - "pest", - "pest_derive", - "serde", -] - [[package]] name = "k256" version = "0.11.6" @@ -2745,9 +1643,6 @@ name = "lazy_static" version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin", -] [[package]] name = "leb128" @@ -2755,31 +1650,12 @@ version = "0.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" -[[package]] -name = "lexical-core" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6607c62aa161d23d17a9072cc5da0be67cdfc89d3afb1e8d9c842bebc2525ffe" -dependencies = [ - "arrayvec", - "bitflags", - "cfg-if 1.0.0", - "ryu", - "static_assertions", -] - [[package]] name = "libc" version = "0.2.138" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db6d7e329c562c5dfab7a46a2afabc8b987ab9a4834c9d1ca04dc54c1546cef8" -[[package]] -name = "libm" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "348108ab3fba42ec82ff6e9564fc4ca0247bdccdc68dd8af9764bbc79c3c8ffb" - [[package]] name = "link-cplusplus" version = "1.0.8" @@ -2795,7 +1671,7 @@ version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" dependencies = [ - "autocfg 1.1.0", + "autocfg", "scopeguard", ] @@ -2837,12 +1713,6 @@ version = "1.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d" -[[package]] -name = "matchit" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b87248edafb776e59e6ee64a79086f65890d3510f2c656c000bf2a7e8a0aea40" - [[package]] name = "memchr" version = "2.5.0" @@ -2855,7 +1725,7 @@ version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aa361d4faea93603064a027415f07bd8e1d5c88c9fbf68bf56a285428fd79ce" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -2903,12 +1773,6 @@ version = "4.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d07cbe42e2a8dd41df582fb8e00fc24d920b5561cc301fcb6d14e2e0434b500f" -[[package]] -name = "multimap" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ce46fe64a9d73be07dcbe690a38ce1b293be448fd8ce1e6c1b8062c9f72c6a" - [[package]] name = "new_debug_unreachable" version = "1.0.4" @@ -2928,19 +1792,6 @@ dependencies = [ "memoffset", ] -[[package]] -name = "nom" -version = "6.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7413f999671bd4745a7b624bd370a569fb6bc574b23c83a3c5ed2e453f3d5e2" -dependencies = [ - "bitvec", - "funty", - "lexical-core", - "memchr", - "version_check", -] - [[package]] name = "nom" version = "7.1.1" @@ -2957,45 +1808,10 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" dependencies = [ - "autocfg 1.1.0", - "num-integer", - "num-traits", - "serde", -] - -[[package]] -name = "num-bigint-dig" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4547ee5541c18742396ae2c895d0717d0f886d8823b8399cdaf7b07d63ad0480" -dependencies = [ - "autocfg 0.1.8", - "byteorder", - "lazy_static", - "libm", - "num-integer", - "num-iter", - "num-traits", - "rand", - "smallvec", - "zeroize", -] - -[[package]] -name = "num-bigint-dig" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2399c9463abc5f909349d8aa9ba080e0b88b3ce2885389b60b993f39b1a56905" -dependencies = [ - "byteorder", - "lazy_static", - "libm", + "autocfg", "num-integer", - "num-iter", "num-traits", - "rand", "serde", - "smallvec", ] [[package]] @@ -3004,18 +1820,7 @@ version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ - "autocfg 1.1.0", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg 1.1.0", - "num-integer", + "autocfg", "num-traits", ] @@ -3025,8 +1830,7 @@ version = "0.2.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" dependencies = [ - "autocfg 1.1.0", - "libm", + "autocfg", ] [[package]] @@ -3060,29 +1864,6 @@ dependencies = [ "syn", ] -[[package]] -name = "num_threads" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" -dependencies = [ - "libc", -] - -[[package]] -name = "oid-registry" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6aae73e474f83beacd8ae2179e328e03d63d9223949d97e1b7c108059a34715" -dependencies = [ - "der-parser", -] - -[[package]] -name = "on_wire" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" - [[package]] name = "once_cell" version = "1.16.0" @@ -3133,38 +1914,13 @@ version = "0.9.80" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "23bbbf7854cd45b83958ebe919f0e8e516793727652e27fda10a8384cfc790b7" dependencies = [ - "autocfg 1.1.0", + "autocfg", "cc", "libc", "pkg-config", "vcpkg", ] -[[package]] -name = "opentelemetry" -version = "0.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6105e89802af13fdf48c49d7646d3b533a70e536d818aae7e78ba0433d01acb8" -dependencies = [ - "async-trait", - "crossbeam-channel", - "futures-channel", - "futures-executor", - "futures-util", - "js-sys", - "lazy_static", - "percent-encoding", - "pin-project", - "rand", - "thiserror", -] - -[[package]] -name = "os_str_bytes" -version = "6.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b7820b9daea5457c9f21c69448905d723fbd21136ccf521748f23fd49e723ee" - [[package]] name = "output_vt100" version = "0.1.3" @@ -3174,17 +1930,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "p256" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "51f44edd08f51e2ade572f141051021c5af22677e42b7dd28a88155151c33594" -dependencies = [ - "ecdsa", - "elliptic-curve", - "sha2 0.10.6", -] - [[package]] name = "pairing" version = "0.22.0" @@ -3195,38 +1940,13 @@ dependencies = [ ] [[package]] -name = "parking_lot" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" -dependencies = [ - "instant", - "lock_api", - "parking_lot_core 0.8.6", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core 0.9.5", -] - -[[package]] -name = "parking_lot_core" -version = "0.8.6" +name = "parking_lot" +version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" dependencies = [ - "cfg-if 1.0.0", - "instant", - "libc", - "redox_syscall", - "smallvec", - "winapi", + "lock_api", + "parking_lot_core", ] [[package]] @@ -3248,17 +1968,6 @@ version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf1c2c742266c2f1041c914ba65355a83ae8747b05f208319784083583494b4b" -[[package]] -name = "pem" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd56cbd21fea48d0c440b41cd69c589faacade08c992d9a54e471b79d0fd13eb" -dependencies = [ - "base64 0.13.1", - "once_cell", - "regex", -] - [[package]] name = "pem" version = "1.1.1" @@ -3283,50 +1992,6 @@ version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "478c572c3d73181ff3c2539045f6eb99e5491218eae919370993b890cdbdd98e" -[[package]] -name = "pest" -version = "2.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ab62d2fa33726dbe6321cc97ef96d8cde531e3eeaf858a058de53a8a6d40d8f" -dependencies = [ - "thiserror", - "ucd-trie", -] - -[[package]] -name = "pest_derive" -version = "2.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bf026e2d0581559db66d837fe5242320f525d85c76283c61f4d51a1238d65ea" -dependencies = [ - "pest", - "pest_generator", -] - -[[package]] -name = "pest_generator" -version = "2.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b27bd18aa01d91c8ed2b61ea23406a676b42d82609c6e2581fba42f0c15f17f" -dependencies = [ - "pest", - "pest_meta", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "pest_meta" -version = "2.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f02b677c1859756359fc9983c2e56a0237f18624a3789528804406b7e915e5d" -dependencies = [ - "once_cell", - "pest", - "sha2 0.10.6", -] - [[package]] name = "petgraph" version = "0.6.2" @@ -3362,26 +2027,6 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" -[[package]] -name = "pin-project" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad29a609b6bcd67fee905812e544992d216af9d755757c05ed2d0e15a74c6ecc" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.0.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "069bdb1e05adc7a8990dce9cc75370895fbe4e3d58b9b73bf1aee56359344a55" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "pin-project-lite" version = "0.2.9" @@ -3444,16 +2089,6 @@ dependencies = [ "yansi", ] -[[package]] -name = "prettyplease" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e97e3215779627f01ee256d2fad52f3d95e8e1c11e9fc6fd08f7cd455d5d5c78" -dependencies = [ - "proc-macro2", - "syn", -] - [[package]] name = "proc-macro-crate" version = "1.2.1" @@ -3465,30 +2100,6 @@ dependencies = [ "toml", ] -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - [[package]] name = "proc-macro2" version = "1.0.47" @@ -3498,37 +2109,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "procfs" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ab8809e0c18450a2db0f236d2a44ec0b4c1412d0eb936233579f0990faa5d5cd" -dependencies = [ - "bitflags", - "byteorder", - "flate2", - "hex", - "lazy_static", - "libc", -] - -[[package]] -name = "prometheus" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5986aa8d62380092d2f50f8b1cdba9cb9b6731ffd4b25b51fd126b6c3e05b99c" -dependencies = [ - "cfg-if 1.0.0", - "fnv", - "lazy_static", - "libc", - "memchr", - "parking_lot 0.11.2", - "procfs", - "protobuf", - "thiserror", -] - [[package]] name = "prost" version = "0.11.6" @@ -3539,28 +2119,6 @@ dependencies = [ "prost-derive", ] -[[package]] -name = "prost-build" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3f8ad728fb08fe212df3c05169e940fbb6d9d16a877ddde14644a983ba2012e" -dependencies = [ - "bytes", - "heck 0.4.0", - "itertools", - "lazy_static", - "log", - "multimap", - "petgraph", - "prettyplease", - "prost", - "prost-types", - "regex", - "syn", - "tempfile", - "which", -] - [[package]] name = "prost-derive" version = "0.11.6" @@ -3574,22 +2132,6 @@ dependencies = [ "syn", ] -[[package]] -name = "prost-types" -version = "0.11.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a5e0526209433e96d83d750dd81a99118edbc55739e7e61a46764fd2ad537788" -dependencies = [ - "bytes", - "prost", -] - -[[package]] -name = "protobuf" -version = "2.28.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "106dd99e98437432fed6519dedecfade6a06a73bb7b2a1e019fdd2bee5778d94" - [[package]] name = "quote" version = "1.0.21" @@ -3599,12 +2141,6 @@ dependencies = [ "proc-macro2", ] -[[package]] -name = "radium" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "941ba9d78d8e2f7ce474c015eea4d9c6d25b6a3327f9832ee29a4de27f91bbb8" - [[package]] name = "rand" version = "0.8.5" @@ -3613,7 +2149,7 @@ checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ "libc", "rand_chacha", - "rand_core 0.6.4", + "rand_core", ] [[package]] @@ -3623,16 +2159,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ "ppv-lite86", - "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", + "rand_core", ] [[package]] @@ -3641,7 +2168,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" dependencies = [ - "getrandom 0.2.8", + "getrandom", ] [[package]] @@ -3659,7 +2186,7 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" dependencies = [ - "getrandom 0.2.8", + "getrandom", "redox_syscall", "thiserror", ] @@ -3681,15 +2208,6 @@ version = "0.6.28" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" -[[package]] -name = "remove_dir_all" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7" -dependencies = [ - "winapi", -] - [[package]] name = "reqwest" version = "0.11.13" @@ -3713,13 +2231,13 @@ dependencies = [ "once_cell", "percent-encoding", "pin-project-lite", - "rustls 0.20.8", + "rustls", "rustls-pemfile", "serde", "serde_json", "serde_urlencoded", "tokio", - "tokio-rustls 0.23.4", + "tokio-rustls", "tokio-util", "tower-service", "url", @@ -3756,26 +2274,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "rsa" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68ef841a26fc5d040ced0417c6c6a64ee851f42489df11cdf0218e545b6f8d28" -dependencies = [ - "byteorder", - "digest 0.9.0", - "lazy_static", - "num-bigint-dig 0.7.0", - "num-integer", - "num-iter", - "num-traits", - "pem 0.8.3", - "rand", - "simple_asn1 0.5.4", - "subtle", - "zeroize", -] - [[package]] name = "rust" version = "0.1.0" @@ -3787,37 +2285,6 @@ dependencies = [ "serde_bytes", ] -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rusticata-macros" -version = "3.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbee512c633ecabd4481c40111b6ded03ddd9ab10ba6caa5a74e14c889921ad" -dependencies = [ - "nom 6.1.2", -] - -[[package]] -name = "rustls" -version = "0.19.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35edb675feee39aec9c99fa5ff985081995a06d594114ae14cbe797ad7b7a6d7" -dependencies = [ - "base64 0.13.1", - "log", - "ring", - "sct 0.6.1", - "webpki 0.21.4", -] - [[package]] name = "rustls" version = "0.20.8" @@ -3826,8 +2293,8 @@ checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", - "sct 0.7.0", - "webpki 0.22.0", + "sct", + "webpki", ] [[package]] @@ -3896,16 +2363,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddccb15bcce173023b3fedd9436f882a0739b8dfb45e4f6b6002bee5929f61b2" -[[package]] -name = "sct" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b362b83898e0e69f38515b82ee15aa80636befe47c3b6d3d89a911e78fc228ce" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "sct" version = "0.7.0" @@ -4077,15 +2534,6 @@ dependencies = [ "sha2 0.9.9", ] -[[package]] -name = "sharded-slab" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "900fba806f70c630b0a382d0d825e17a0f19fcd059a2ade1ff237bcddf446b31" -dependencies = [ - "lazy_static", -] - [[package]] name = "signal-hook-registry" version = "1.4.0" @@ -4102,19 +2550,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ "digest 0.10.6", - "rand_core 0.6.4", -] - -[[package]] -name = "simple_asn1" -version = "0.5.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8eb4ea60fb301dc81dfc113df680571045d375ab7345d171c5dc7d7e13107a80" -dependencies = [ - "chrono", - "num-bigint", - "num-traits", - "thiserror", + "rand_core", ] [[package]] @@ -4141,7 +2577,7 @@ version = "0.4.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4614a76b2a8be0058caa9dbbaf66d988527d86d003c11a94fbd335d7661edcef" dependencies = [ - "autocfg 1.1.0", + "autocfg", ] [[package]] @@ -4153,55 +2589,6 @@ dependencies = [ "erased-serde", ] -[[package]] -name = "slog-async" -version = "2.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "766c59b252e62a34651412870ff55d8c4e6d04df19b43eecb2703e417b097ffe" -dependencies = [ - "crossbeam-channel", - "slog", - "take_mut", - "thread_local", -] - -[[package]] -name = "slog-json" -version = "2.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e1e53f61af1e3c8b852eef0a9dee29008f55d6dd63794f3f12cef786cf0f219" -dependencies = [ - "erased-serde", - "serde", - "serde_json", - "slog", - "time 0.3.17", -] - -[[package]] -name = "slog-scope" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f95a4b4c3274cd2869549da82b57ccc930859bdbf5bcea0424bc5f140b3c786" -dependencies = [ - "arc-swap", - "lazy_static", - "slog", -] - -[[package]] -name = "slog-term" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87d29185c55b7b258b4f120eab00f48557d4d9bc814f41713f449d35b0f8977c" -dependencies = [ - "atty", - "slog", - "term", - "thread_local", - "time 0.3.17", -] - [[package]] name = "smallvec" version = "1.10.0" @@ -4231,14 +2618,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" dependencies = [ "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + "der", +] [[package]] name = "string_cache" @@ -4248,7 +2629,7 @@ checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" dependencies = [ "new_debug_unreachable", "once_cell", - "parking_lot 0.12.1", + "parking_lot", "phf_shared", "precomputed-hash", ] @@ -4303,12 +2684,6 @@ version = "2.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" -[[package]] -name = "subtle-ng" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "734676eb262c623cec13c3155096e08d1f8f29adce39ba17948b18dad1e54142" - [[package]] name = "syn" version = "1.0.105" @@ -4320,12 +2695,6 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "sync_wrapper" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20518fe4a4c9acf048008599e464deb21beeae3d3578418951a189c235a7a9a8" - [[package]] name = "synstructure" version = "0.12.6" @@ -4338,67 +2707,6 @@ dependencies = [ "unicode-xid", ] -[[package]] -name = "take_mut" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f764005d11ee5f36500a149ace24e00e3da98b0158b3e2d53a7495660d3f4d60" - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tarpc" -version = "0.31.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "71a98cc1a0a9013e8df3900d09c597dd65cfc6ea4d42968629b1b9ea949acf8f" -dependencies = [ - "anyhow", - "fnv", - "futures", - "humantime", - "opentelemetry", - "pin-project", - "rand", - "serde", - "static_assertions", - "tarpc-plugins", - "thiserror", - "tokio", - "tokio-serde", - "tokio-util", - "tracing", - "tracing-opentelemetry", -] - -[[package]] -name = "tarpc-plugins" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ee42b4e559f17bce0385ebf511a7beb67d5cc33c12c96b7f4e9789919d9c10f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tempfile" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5cdb1ef4eaeeaddc8fbd371e5017057064af0911902ef36b39801f67cc6d79e4" -dependencies = [ - "cfg-if 1.0.0", - "fastrand", - "libc", - "redox_syscall", - "remove_dir_all", - "winapi", -] - [[package]] name = "term" version = "0.7.0" @@ -4419,12 +2727,6 @@ dependencies = [ "winapi-util", ] -[[package]] -name = "textwrap" -version = "0.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" - [[package]] name = "thiserror" version = "1.0.38" @@ -4451,24 +2753,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3bf63baf9f5039dadc247375c29eb13706706cfde997d0330d05aa63a77d8820" -[[package]] -name = "thread_local" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5516c27b78311c50bf42c071425c560ac799b11c30b31f87e3081965fe5e0180" -dependencies = [ - "once_cell", -] - -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" -dependencies = [ - "num_cpus", -] - [[package]] name = "time" version = "0.1.45" @@ -4487,8 +2771,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a561bf4617eebd33bca6434b988f39ed798e527f51a1e797d0ee4f61c0a38376" dependencies = [ "itoa", - "libc", - "num_threads", "serde", "time-core", "time-macros", @@ -4539,13 +2821,13 @@ version = "1.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d9f76183f91ecfb55e1d7d5602bd1d979e38a3a522fe900241cf195624d67ae" dependencies = [ - "autocfg 1.1.0", + "autocfg", "bytes", "libc", "memchr", "mio", "num_cpus", - "parking_lot 0.12.1", + "parking_lot", "pin-project-lite", "signal-hook-registry", "socket2", @@ -4553,16 +2835,6 @@ dependencies = [ "windows-sys", ] -[[package]] -name = "tokio-io-timeout" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30b74022ada614a1b4834de765f9bb43877f910cc8ce4be40e89042c9223a8bf" -dependencies = [ - "pin-project-lite", - "tokio", -] - [[package]] name = "tokio-macros" version = "1.8.2" @@ -4574,65 +2846,15 @@ dependencies = [ "syn", ] -[[package]] -name = "tokio-openssl" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08f9ffb7809f1b20c1b398d92acf4cc719874b3b2b2d9ea2f09b4a80350878a" -dependencies = [ - "futures-util", - "openssl", - "openssl-sys", - "tokio", -] - -[[package]] -name = "tokio-rustls" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc6844de72e57df1980054b38be3a9f4702aba4858be64dd700181a8a6d0e1b6" -dependencies = [ - "rustls 0.19.1", - "tokio", - "webpki 0.21.4", -] - [[package]] name = "tokio-rustls" version = "0.23.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c43ee83903113e03984cb9e5cebe6c04a5116269e900e3ddba8f068a62adda59" dependencies = [ - "rustls 0.20.8", - "tokio", - "webpki 0.22.0", -] - -[[package]] -name = "tokio-serde" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "911a61637386b789af998ee23f50aa30d5fd7edcec8d6d3dedae5e5815205466" -dependencies = [ - "bincode", - "bytes", - "educe", - "futures-core", - "futures-sink", - "pin-project", - "serde", - "serde_json", -] - -[[package]] -name = "tokio-stream" -version = "0.1.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d660770404473ccd7bc9f8b28494a811bc18542b915c0855c51e8f419d5223ce" -dependencies = [ - "futures-core", - "pin-project-lite", + "rustls", "tokio", + "webpki", ] [[package]] @@ -4645,7 +2867,6 @@ dependencies = [ "futures-core", "futures-sink", "pin-project-lite", - "slab", "tokio", "tracing", ] @@ -4659,96 +2880,6 @@ dependencies = [ "serde", ] -[[package]] -name = "tonic" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f219fad3b929bef19b1f86fbc0358d35daed8f2cac972037ac0dc10bbb8d5fb" -dependencies = [ - "async-stream", - "async-trait", - "axum", - "base64 0.13.1", - "bytes", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-timeout", - "percent-encoding", - "pin-project", - "prost", - "prost-derive", - "tokio", - "tokio-stream", - "tokio-util", - "tower", - "tower-layer", - "tower-service", - "tracing", - "tracing-futures", -] - -[[package]] -name = "tonic-build" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bf5e9b9c0f7e0a7c027dcfaba7b2c60816c7049171f679d99ee2ff65d0de8c4" -dependencies = [ - "prettyplease", - "proc-macro2", - "prost-build", - "quote", - "syn", -] - -[[package]] -name = "tower" -version = "0.4.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8fa9be0de6cf49e536ce1851f987bd21a43b771b09473c3549a6c853db37c1c" -dependencies = [ - "futures-core", - "futures-util", - "indexmap", - "pin-project", - "pin-project-lite", - "rand", - "slab", - "tokio", - "tokio-util", - "tower-layer", - "tower-service", - "tracing", -] - -[[package]] -name = "tower-http" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f873044bf02dd1e8239e9c1293ea39dad76dc594ec16185d0a1bf31d8dc8d858" -dependencies = [ - "bitflags", - "bytes", - "futures-core", - "futures-util", - "http", - "http-body", - "http-range-header", - "pin-project-lite", - "tower", - "tower-layer", - "tower-service", -] - -[[package]] -name = "tower-layer" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c20c8dbed6283a09604c3e69b4b7eeb54e298b8a600d4d5ecb5ad39de609f1d0" - [[package]] name = "tower-service" version = "0.3.2" @@ -4762,23 +2893,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" dependencies = [ "cfg-if 1.0.0", - "log", "pin-project-lite", - "tracing-attributes", "tracing-core", ] -[[package]] -name = "tracing-attributes" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4017f8f45139870ca7e672686113917c71c7a6e02d4924eda67186083c03081a" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - [[package]] name = "tracing-core" version = "0.1.30" @@ -4786,51 +2904,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24eb03ba0eab1fd845050058ce5e616558e8f8d8fca633e6b163fe25c797213a" dependencies = [ "once_cell", - "valuable", -] - -[[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 = "tracing-opentelemetry" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbbe89715c1dbbb790059e2565353978564924ee85017b5fff365c872ff6721f" -dependencies = [ - "once_cell", - "opentelemetry", - "tracing", - "tracing-core", - "tracing-subscriber", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a6176eae26dd70d0c919749377897b54a9276bd7061339665dd68777926b5a70" -dependencies = [ - "sharded-slab", - "thread_local", - "tracing-core", -] - -[[package]] -name = "tree-deserializer" -version = "0.8.0" -source = "git+https://github.com/dfinity/ic?rev=a533346f63f4091eb64692891de0d5b2ffd5b22a#a533346f63f4091eb64692891de0d5b2ffd5b22a" -dependencies = [ - "ic-crypto-tree-hash", - "leb128", - "serde", ] [[package]] @@ -4851,12 +2924,6 @@ version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" -[[package]] -name = "ucd-trie" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e79c4d996edb816c91e4308506774452e55e95c3c9de07b6729e17e15a5ef81" - [[package]] name = "unicode-bidi" version = "0.3.8" @@ -4920,12 +2987,6 @@ version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5190c9442dcdaf0ddd50f37420417d219ae5261bbf5db120d0f9bab996c9cba1" -[[package]] -name = "valuable" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" - [[package]] name = "vcpkg" version = "0.2.15" @@ -4948,12 +3009,6 @@ dependencies = [ "try-lock", ] -[[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.10.0+wasi-snapshot-preview1" @@ -5066,16 +3121,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "webpki" -version = "0.21.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8e38c0608262c46d4a56202ebabdeb094cef7e560ca7a226c6bf055188aa4ea" -dependencies = [ - "ring", - "untrusted", -] - [[package]] name = "webpki" version = "0.22.0" @@ -5092,7 +3137,7 @@ version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.0", + "webpki", ] [[package]] @@ -5107,17 +3152,6 @@ dependencies = [ "winapi", ] -[[package]] -name = "which" -version = "4.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" -dependencies = [ - "either", - "libc", - "once_cell", -] - [[package]] name = "winapi" version = "0.3.9" @@ -5221,30 +3255,6 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dab7ac864710bdea6594becbea5b5050333cf34fefb0dc319567eb347950d4" -[[package]] -name = "wyz" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85e60b0d1b5f99db2556934e21937020776a5d31520bf169e851ac44e6420214" - -[[package]] -name = "x509-parser" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64abca276c58f8341ddc13fd4bd6ae75993cc669043f5b34813c90f7dff04771" -dependencies = [ - "base64 0.13.1", - "chrono", - "data-encoding", - "der-parser", - "lazy_static", - "nom 6.1.2", - "oid-registry", - "rusticata-macros", - "rustversion", - "thiserror", -] - [[package]] name = "yansi" version = "0.5.1" diff --git a/packages/ic-response-verification-test-utils/Cargo.toml b/packages/ic-response-verification-test-utils/Cargo.toml index 59c9b46f..a7f43131 100644 --- a/packages/ic-response-verification-test-utils/Cargo.toml +++ b/packages/ic-response-verification-test-utils/Cargo.toml @@ -6,10 +6,20 @@ edition = "2021" [dependencies] base64 = "0.21.0" hex = "0.4.3" -ic-certification-test-utils = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } -ic-crypto = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } -ic-crypto-tree-hash = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } +ic-types = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } ic-base-types = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } +ic-crypto-internal-threshold-sig-bls12381 = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } +ic-crypto-internal-types = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } +ic-crypto-utils-threshold-sig-der = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } +ic-crypto-internal-seed = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } +ic-crypto-tree-hash = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } ic-certified-map = "0.3.2" -ic-certification = { git = "https://github.com/dfinity/agent-rs", rev = "815ee1f" } sha256 = "1.1.1" +serde_cbor = "0.11.2" +leb128 = "0.2.5" +serde = { version = "1.0.152", features = ["derive"]} + +# https://github.com/rust-random/rand#wasm-support +# https://docs.rs/getrandom/latest/getrandom/#webassembly-support +rand = "0.8.5" +getrandom = { version = "0.2.8", features = ["js"] } diff --git a/packages/ic-response-verification-test-utils/src/asset_tree.rs b/packages/ic-response-verification-test-utils/src/asset_tree.rs index a6cab6d7..671cc75d 100644 --- a/packages/ic-response-verification-test-utils/src/asset_tree.rs +++ b/packages/ic-response-verification-test-utils/src/asset_tree.rs @@ -1,6 +1,5 @@ use crate::hash::hash; -use crate::hash_from_hex; -use ic_certification_test_utils::serialize_to_cbor; +use crate::{hash_from_hex, serialize_to_cbor}; use ic_certified_map::{labeled, labeled_hash, AsHashTree, Hash, HashTree, RbTree}; use ic_crypto_tree_hash::Digest; diff --git a/packages/ic-response-verification-test-utils/src/certificate.rs b/packages/ic-response-verification-test-utils/src/certificate.rs index 11d98ba6..17251487 100644 --- a/packages/ic-response-verification-test-utils/src/certificate.rs +++ b/packages/ic-response-verification-test-utils/src/certificate.rs @@ -1,65 +1,283 @@ -use crate::AssetTree; -use ic_base_types::CanisterId; -use ic_certification_test_utils::CertificateData::{CanisterData, CustomTree}; -use ic_certification_test_utils::{Certificate, CertificateBuilder}; -use ic_crypto::threshold_sig_public_key_to_der; -use ic_crypto_tree_hash::{Digest, LabeledTree}; +use crate::{leb_encode_timestamp, serialize_to_cbor, AssetTree}; +use ic_crypto_internal_seed::Seed; +use ic_crypto_internal_threshold_sig_bls12381::api::{ + combine_signatures, combined_public_key, generate_threshold_key, sign_message, +}; +use ic_crypto_internal_threshold_sig_bls12381::types::SecretKeyBytes; +use ic_crypto_internal_types::sign::threshold_sig::public_key::bls12_381::PublicKeyBytes; +use ic_crypto_internal_types::sign::threshold_sig::public_key::CspThresholdSigPublicKey; +use ic_crypto_tree_hash::{ + flatmap, Digest, HashTreeBuilder, HashTreeBuilderImpl, Label, LabeledTree, MixedHashTree, + WitnessGenerator, +}; +use ic_crypto_utils_threshold_sig_der::public_key_to_der; +use ic_types::messages::Blob; +use ic_types::{ + consensus::certification::CertificationContent, + crypto::Signable, + crypto::{threshold_sig::ThresholdSigPublicKey, CryptoHash}, + crypto::{CombinedThresholdSig, CombinedThresholdSigOf}, + CanisterId, CryptoHashOfPartialState, NumberOfNodes, SubnetId, +}; +use rand::{thread_rng, Rng}; use std::str::FromStr; +pub fn threshold_sig_public_key_to_der(pk: ThresholdSigPublicKey) -> Vec { + let pk = PublicKeyBytes(pk.into_bytes()); + public_key_to_der(&pk.0).unwrap() +} + pub fn create_canister_id(canister_id: &str) -> CanisterId { CanisterId::from_str(canister_id).unwrap() } -pub struct CreateCertificateOptions { - pub certificate_time: Option, - pub canister_id: Option, - pub certified_data: Option, +pub fn create_certificate_header(tree: &String, certificate: &String) -> String { + format!("certificate=:{}:, tree=:{}:", certificate, tree) +} + +const DEFAULT_CERTIFICATE_TIME: u128 = 1651142233000005031; + +#[derive(serde::Serialize)] +pub struct Certificate { + tree: MixedHashTree, + signature: Blob, + #[serde(skip_serializing_if = "Option::is_none")] + pub delegation: Option, } -pub fn create_certificate( - options: Option, -) -> (Certificate, Vec, Vec) { - let default_certificate_time = 1651142233000005031; - let certificate_time = options - .as_ref() - .and_then(|options| options.certificate_time) - .unwrap_or(default_certificate_time); - - let default_canister_id = CanisterId::from_str("qoctq-giaaa-aaaaa-aaaea-cai").unwrap(); - let canister_id = options - .as_ref() - .and_then(|options| options.canister_id) - .unwrap_or(default_canister_id); - - let default_certified_data = AssetTree::new().get_certified_data(); - let certified_data = options - .as_ref() - .and_then(|options| options.certified_data.clone()) - .unwrap_or(default_certified_data); - - let (certificate, root_key, cbor_encoded_certificate) = CertificateBuilder::new(CanisterData { - canister_id, - certified_data, - }) - .with_time(u64::try_from(certificate_time).unwrap()) - .build(); - - let der_encoded_key = threshold_sig_public_key_to_der(root_key).unwrap(); - - (certificate, der_encoded_key, cbor_encoded_certificate) +#[derive(serde::Serialize, Debug, Clone)] +pub struct CertificateDelegation { + pub subnet_id: Blob, + pub certificate: Blob, } -pub fn create_custom_tree_certificate( - tree: LabeledTree>, -) -> (Certificate, Vec, Vec) { - let (certificate, root_key, cbor_encoded_certificate) = - CertificateBuilder::new(CustomTree(tree)).build(); +#[derive(Debug, Clone)] +pub struct CanisterData { + pub canister_id: CanisterId, + pub certified_data: Digest, +} - let der_encoded_key = threshold_sig_public_key_to_der(root_key).unwrap(); +impl Default for CanisterData { + fn default() -> Self { + let canister_id = CanisterId::from_str("qoctq-giaaa-aaaaa-aaaea-cai").unwrap(); + let certified_data = AssetTree::new().get_certified_data(); - (certificate, der_encoded_key, cbor_encoded_certificate) + Self { + canister_id, + certified_data, + } + } } -pub fn create_certificate_header(tree: &String, certificate: &String) -> String { - format!("certificate=:{}:, tree=:{}:", certificate, tree) +impl CanisterData { + pub fn with_canister_id(mut self, canister_id: CanisterId) -> Self { + self.canister_id = canister_id; + + self + } + + pub fn with_certified_data(mut self, certified_data: Digest) -> Self { + self.certified_data = certified_data; + + self + } +} + +#[derive(Debug, Clone)] +pub enum CertificateData { + CustomTree(LabeledTree>), + CanisterData(CanisterData), + SubnetData { + subnet_id: SubnetId, + canister_id_ranges: Vec<(CanisterId, CanisterId)>, + }, +} + +impl CertificateData { + fn get_tree( + &self, + subnet_pub_key: Option, + time: u128, + ) -> LabeledTree> { + let encoded_time = leb_encode_timestamp(time); + match self { + CertificateData::CustomTree(tree) => tree.clone(), + CertificateData::CanisterData(CanisterData { + canister_id, + certified_data, + }) => LabeledTree::SubTree(flatmap![ + Label::from("canister") => LabeledTree::SubTree(flatmap![ + Label::from(canister_id.get_ref().to_vec()) => LabeledTree::SubTree(flatmap![ + Label::from("certified_data") => LabeledTree::Leaf(certified_data.to_vec()), + ]) + ]), + Label::from("time") => LabeledTree::Leaf(encoded_time) + ]), + CertificateData::SubnetData { + subnet_id, + canister_id_ranges, + } => { + let public_key = subnet_pub_key.expect("no delegation public_key. Note: Subnet data cannot be used at the lowest certificate level"); + LabeledTree::SubTree(flatmap![ + Label::from("subnet") => LabeledTree::SubTree(flatmap![ + Label::from(subnet_id.get_ref().to_vec()) => LabeledTree::SubTree(flatmap![ + Label::from("canister_ranges") => LabeledTree::Leaf(serialize_to_cbor(canister_id_ranges)), + Label::from("public_key") => LabeledTree::Leaf(public_key_to_der(&public_key.into_bytes()).unwrap()), + ]) + ]), + Label::from("time") => LabeledTree::Leaf(encoded_time) + ]) + } + } + } +} + +#[derive(Debug, Clone)] +pub struct CertificateBuilder { + public_key: ThresholdSigPublicKey, + secret_key: SecretKeyBytes, + data: CertificateData, + override_sig: Option, + delegatee_pub_key: Option, + subnet_id: Option, + delegation: Option>, + time: u128, +} + +impl CertificateBuilder { + pub fn new(data: CertificateData) -> Self { + let mut seed: [u8; 32] = [0; 32]; + thread_rng().fill(&mut seed); + + let (public_coefficients, secret_key_bytes) = generate_threshold_key( + Seed::from_bytes(&seed), + NumberOfNodes::new(1), + NumberOfNodes::new(1), + ) + .unwrap(); + let public_key = ThresholdSigPublicKey::from(CspThresholdSigPublicKey::from( + combined_public_key(&public_coefficients).unwrap(), + )); + + CertificateBuilder { + public_key, + secret_key: secret_key_bytes.get(0).unwrap().clone(), + data, + delegatee_pub_key: None, + override_sig: None, + subnet_id: None, + delegation: None, + time: DEFAULT_CERTIFICATE_TIME, + } + } + + pub fn with_time(mut self, time: u128) -> Self { + self.time = time; + self + } + + pub fn with_delegation_subnet_id(mut self, subnet_id: SubnetId) -> Self { + self.subnet_id = Some(subnet_id); + self + } + + pub fn with_invalid_sig(mut self) -> Self { + self.override_sig = Some(CombinedThresholdSig( + b"invalid sig -----padding to get to 48 bytes-----".to_vec(), + )); + self + } + + pub fn with_sig(mut self, sig: CombinedThresholdSig) -> Self { + self.override_sig = Some(sig); + self + } + + pub fn with_delegation(mut self, mut delegation_builder: CertificateBuilder) -> Self { + delegation_builder.delegatee_pub_key = Some(self.public_key); + self.delegation = Some(Box::from(delegation_builder)); + self + } + + pub fn get_root_public_key(&self) -> ThresholdSigPublicKey { + match &self.delegation { + None => self.public_key, + Some(delegation) => delegation.get_root_public_key(), + } + } + + pub fn build(&self) -> (Certificate, Vec, Vec) { + let mut b = HashTreeBuilderImpl::new(); + let tree = &self.data.get_tree(self.delegatee_pub_key, self.time); + hash_full_tree(&mut b, tree); + + let witness_gen = b.witness_generator().unwrap(); + let hash_tree_digest = witness_gen.hash_tree().digest(); + let mixed_tree = witness_gen.mixed_hash_tree(tree).unwrap(); + let root_hash = CryptoHashOfPartialState::from(CryptoHash(hash_tree_digest.to_vec())); + + let sig = if let Some(override_sig) = &self.override_sig { + CombinedThresholdSigOf::from(override_sig.clone()) + } else { + self.sign(&CertificationContent::new(root_hash)) + }; + + let certificate = Certificate { + tree: mixed_tree, + signature: Blob(sig.get().0), + delegation: self.build_delegation(), + }; + let cert_cbor = serialize_to_cbor(&certificate); + + let root_key = threshold_sig_public_key_to_der(self.get_root_public_key()); + + (certificate, root_key, cert_cbor) + } + + fn sign(&self, message: &T) -> CombinedThresholdSigOf { + let signature_bytes = + Some(sign_message(message.as_signed_bytes().as_slice(), &self.secret_key).unwrap()); + let signature = combine_signatures(&[signature_bytes], NumberOfNodes::new(1)).unwrap(); + CombinedThresholdSigOf::from(CombinedThresholdSig(signature.0.to_vec())) + } + + fn get_subnet_id(&self) -> SubnetId { + if let Some(subnet_id) = self.subnet_id { + return subnet_id; + } + if let Some(delegation_builder) = &self.delegation { + if let CertificateData::SubnetData { subnet_id, .. } = delegation_builder.data { + return subnet_id; + } + } + panic!("No subnet_id present. Either set a delegation with SubnetData or set the subnet_id manually using 'with_delegation_subnet_id'") + } + + fn build_delegation(&self) -> Option { + self.delegation + .as_ref() + .map(|builder| builder.build()) + .map(|(cert, _, _)| CertificateDelegation { + certificate: Blob(serialize_to_cbor(&cert)), + subnet_id: Blob(self.get_subnet_id().get().to_vec()), + }) + } +} + +fn hash_full_tree(b: &mut HashTreeBuilderImpl, t: &LabeledTree>) { + match t { + LabeledTree::Leaf(bytes) => { + b.start_leaf(); + b.write_leaf(&bytes[..]); + b.finish_leaf(); + } + LabeledTree::SubTree(map) => { + b.start_subtree(); + for (l, child) in map.iter() { + b.new_edge(l.clone()); + hash_full_tree(b, child); + } + b.finish_subtree(); + } + } } diff --git a/packages/ic-response-verification-test-utils/src/encoding.rs b/packages/ic-response-verification-test-utils/src/encoding.rs index c970ece6..c8a75789 100644 --- a/packages/ic-response-verification-test-utils/src/encoding.rs +++ b/packages/ic-response-verification-test-utils/src/encoding.rs @@ -1,4 +1,5 @@ use base64::{engine::general_purpose, Engine as _}; +use serde::Serialize; pub fn base64_encode(data: &T) -> String where @@ -6,3 +7,16 @@ where { general_purpose::STANDARD.encode(data) } + +pub fn serialize_to_cbor(payload: &T) -> Vec { + let mut serializer = serde_cbor::Serializer::new(Vec::new()); + serializer.self_describe().unwrap(); + payload.serialize(&mut serializer).unwrap(); + serializer.into_inner() +} + +pub fn leb_encode_timestamp(timestamp: u128) -> Vec { + let mut encoded_time = vec![]; + leb128::write::unsigned(&mut encoded_time, timestamp as u64).unwrap(); + encoded_time +} diff --git a/packages/ic-response-verification/Cargo.lock b/packages/ic-response-verification/Cargo.lock deleted file mode 100644 index fded39a4..00000000 --- a/packages/ic-response-verification/Cargo.lock +++ /dev/null @@ -1,1209 +0,0 @@ -# This file is automatically @generated by Cargo. -# It is not intended for manual editing. -version = 3 - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aho-corasick" -version = "0.7.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" -dependencies = [ - "memchr", -] - -[[package]] -name = "anyhow" -version = "1.0.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cb2f989d18dd141ab8ae82f64d1a8cdd37e0840f73a406896cf5e99502fab61" - -[[package]] -name = "arrayvec" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23b62fc65de8e4e7f52534fb52b0f3ed04746ae267519eef2a83941e8085068b" - -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] - -[[package]] -name = "atty" -version = "0.2.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" -dependencies = [ - "hermit-abi", - "libc", - "winapi", -] - -[[package]] -name = "autocfg" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" - -[[package]] -name = "base64" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" - -[[package]] -name = "beef" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a8241f3ebb85c056b509d4327ad0358fbbba6ffb340bf388f26350aeda225b1" - -[[package]] -name = "binread" -version = "2.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16598dfc8e6578e9b597d9910ba2e73618385dc9f4b1d43dd92c349d6be6418f" -dependencies = [ - "binread_derive", - "lazy_static", - "rustversion", -] - -[[package]] -name = "binread_derive" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d9672209df1714ee804b1f4d4f68c8eb2a90b1f7a07acf472f88ce198ef1fed" -dependencies = [ - "either", - "proc-macro2", - "quote", - "syn", -] - -[[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 = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "block-buffer" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "69cce20737498f97b993470a6e536b8523f0af7892a4f928cceb1ac5e52ebe7e" -dependencies = [ - "generic-array", -] - -[[package]] -name = "bumpalo" -version = "3.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfb24e866b15a1af2a1b663f10c6b6b8f397a84aadb828f12e5b289ec23a3a3c" - -[[package]] -name = "candid" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "244005a1917bb7614cd775ca8a5d59efeb5ac74397bb14ba29a19347ebd78591" -dependencies = [ - "anyhow", - "binread", - "byteorder", - "candid_derive", - "codespan-reporting", - "crc32fast", - "data-encoding", - "hex", - "lalrpop", - "lalrpop-util", - "leb128", - "logos", - "num-bigint", - "num-traits", - "num_enum", - "paste", - "pretty", - "serde", - "serde_bytes", - "sha2", - "thiserror", -] - -[[package]] -name = "candid_derive" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58f1f4db7c7d04b87b70b3a35c5dc5c2c9dd73cef8bdf6760e2f18a0d45350dd" -dependencies = [ - "lazy_static", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "cfg-if" -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 = "codespan-reporting" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3538270d33cc669650c4b093848450d380def10c331d38c768e34cac80576e6e" -dependencies = [ - "termcolor", - "unicode-width", -] - -[[package]] -name = "console_error_panic_hook" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a06aeb73f470f66dcdbf7223caeebb85984942f22f1adb2a088cf9668146bbbc" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen", -] - -[[package]] -name = "cpufeatures" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" -dependencies = [ - "libc", -] - -[[package]] -name = "crc32fast" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b540bd8bc810d3885c6ea91e2018302f68baba2129ab3e88f32389ee9370880d" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-common" -version = "0.1.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" -dependencies = [ - "generic-array", - "typenum", -] - -[[package]] -name = "data-encoding" -version = "2.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23d8666cb01533c39dde32bcbab8e227b4ed6679b2c925eba05feabea39508fb" - -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - -[[package]] -name = "digest" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" -dependencies = [ - "block-buffer", - "crypto-common", -] - -[[package]] -name = "dirs-next" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if 1.0.0", - "dirs-sys-next", -] - -[[package]] -name = "dirs-sys-next" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" -dependencies = [ - "libc", - "redox_users", - "winapi", -] - -[[package]] -name = "either" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90e5c1c8368803113bf0c9584fc495a58b86dc8a29edbf8fe877d21d9507e797" - -[[package]] -name = "ena" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7402b94a93c24e742487327a7cd839dc9d36fec9de9fb25b09f2dae459f36c3" -dependencies = [ - "log", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "flate2" -version = "1.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8a2db397cb1c8772f31494cb8917e48cd1e64f0fa7efac59fbd741a0a8ce841" -dependencies = [ - "crc32fast", - "miniz_oxide", -] - -[[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.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" -dependencies = [ - "typenum", - "version_check", -] - -[[package]] -name = "getrandom" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "wasi", -] - -[[package]] -name = "half" -version = "1.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eabb4a44450da02c90444cf74558da904edde8fb4e9035a9a6a4e15445af0bd7" - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hermit-abi" -version = "0.1.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" -dependencies = [ - "libc", -] - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" - -[[package]] -name = "http" -version = "0.2.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75f43d41e26995c17e71ee126451dd3941010b0514a81a9d11f3b341debc2399" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "ic-certification" -version = "0.23.0" -source = "git+https://github.com/dfinity/agent-rs?rev=815ee1f#815ee1f523d498d8777a8941acf1a6042f959afc" -dependencies = [ - "hex", - "serde", - "serde_bytes", - "sha2", -] - -[[package]] -name = "ic-response-verification" -version = "0.0.0" -dependencies = [ - "base64", - "candid", - "console_error_panic_hook", - "flate2", - "hex", - "http", - "ic-certification", - "js-sys", - "leb128", - "miracl_core_bls12381", - "nom", - "serde", - "serde_cbor", - "sha2", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-test", - "wee_alloc", -] - -[[package]] -name = "indexmap" -version = "1.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" -dependencies = [ - "autocfg", - "hashbrown", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fad582f4b9e86b6caa621cabeb0963332d92eea04729ab12892c2533951e6440" - -[[package]] -name = "js-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49409df3e3bf0856b916e2ceaca09ee28e6871cf7d9ce97a692cacfdb2a25a47" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "lalrpop" -version = "0.19.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30455341b0e18f276fa64540aff54deafb54c589de6aca68659c63dd2d5d823" -dependencies = [ - "ascii-canvas", - "atty", - "bit-set", - "diff", - "ena", - "itertools", - "lalrpop-util", - "petgraph", - "pico-args", - "regex", - "regex-syntax", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", -] - -[[package]] -name = "lalrpop-util" -version = "0.19.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcf796c978e9b4d983414f4caedc9273aa33ee214c5b887bd55fde84c85d2dc4" -dependencies = [ - "regex", -] - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" - -[[package]] -name = "leb128" -version = "0.2.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "884e2677b40cc8c339eaefcb701c32ef1fd2493d71118dc0ca4b6a736c93bd67" - -[[package]] -name = "libc" -version = "0.2.139" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "201de327520df007757c1f0adce6e827fe8562fbc28bfd9c15571c66ca1f5f79" - -[[package]] -name = "lock_api" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "435011366fe56583b16cf956f9df0095b405b82d76425bc8981c0e22e60ec4df" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" -dependencies = [ - "cfg-if 1.0.0", -] - -[[package]] -name = "logos" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf8b031682c67a8e3d5446840f9573eb7fe26efe7ec8d195c9ac4c0647c502f1" -dependencies = [ - "logos-derive", -] - -[[package]] -name = "logos-derive" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d849148dbaf9661a6151d1ca82b13bb4c4c128146a88d05253b38d4e2f496c" -dependencies = [ - "beef", - "fnv", - "proc-macro2", - "quote", - "regex-syntax", - "syn", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memory_units" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8452105ba047068f40ff7093dd1d9da90898e63dd61736462e9cdda6a90ad3c3" - -[[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.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b275950c28b37e794e8c55d88aeb5e139d0ce23fdbbeda68f8d7174abdf9e8fa" -dependencies = [ - "adler", -] - -[[package]] -name = "miracl_core_bls12381" -version = "4.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d07cbe42e2a8dd41df582fb8e00fc24d920b5561cc301fcb6d14e2e0434b500f" - -[[package]] -name = "new_debug_unreachable" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "nom8" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae01545c9c7fc4486ab7debaf2aad7003ac19431791868fb2e8066df97fad2f8" -dependencies = [ - "memchr", -] - -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", - "serde", -] - -[[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-traits" -version = "0.2.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_enum" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf5395665662ef45796a4ff5486c5d41d29e0c09640af4c5f17fd94ee2c119c9" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.5.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3b0498641e53dd6ac1a4f22547548caa6864cc4933784319cd1775271c5a46ce" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "once_cell" -version = "1.17.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6f61fba1741ea2b3d6a1e3178721804bb716a68a6aeba1149b5d52e3d464ea66" - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1ef8814b5c993410bb3adfad7a5ed269563e4a2f90c41f5d85be7fb47133bf" -dependencies = [ - "cfg-if 1.0.0", - "libc", - "redox_syscall", - "smallvec", - "windows-sys", -] - -[[package]] -name = "paste" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d01a5bd0424d00070b0098dd17ebca6f961a959dead1dbcbbbc1d1cd8d3deeba" - -[[package]] -name = "petgraph" -version = "0.6.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5014253a1331579ce62aa67443b4a658c5e7dd03d4bc6d302b94474888143" -dependencies = [ - "fixedbitset", - "indexmap", -] - -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pico-args" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db8bcd96cb740d03149cbad5518db9fd87126a10ab519c011893b1754134c468" - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "pretty" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad9940b913ee56ddd94aec2d3cd179dd47068236f42a1a6415ccf9d880ce2a61" -dependencies = [ - "arrayvec", - "typed-arena", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66618389e4ec1c7afe67d51a9bf34ff9236480f8d51e7489b7d5ab0303c13f34" -dependencies = [ - "once_cell", - "toml_edit", -] - -[[package]] -name = "proc-macro2" -version = "1.0.50" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ef7d57beacfaf2d8aee5937dab7b7f28de3cb8b1828479bb5de2a7106f2bae2" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8856d8364d252a14d474036ea1358d63c9e6965c8e5c1885c18f73d70bff9c7b" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags", -] - -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom", - "redox_syscall", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48aaa5748ba571fb95cd2c85c09f629215d3a6ece942baa100950af03a34f733" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax", -] - -[[package]] -name = "regex-syntax" -version = "0.6.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "456c603be3e8d448b072f410900c09faf164fbce2d480456f50eea6e25f9c848" - -[[package]] -name = "rustversion" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5583e89e108996506031660fe09baa5011b9dd0341b89029313006d1fb508d70" - -[[package]] -name = "scoped-tls" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1cf6437eb19a8f4a6cc0f7dca544973b0b78843adbfeb3683d1a94a0024a294" - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "serde" -version = "1.0.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb7d1f0d3021d347a83e556fc4683dea2ea09d87bccdf88ff5c12545d89d5efb" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_bytes" -version = "0.11.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "718dc5fff5b36f99093fc49b280cfc96ce6fc824317783bff5a1fed0c7a64819" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_cbor" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2bef2ebfde456fb76bbcf9f59315333decc4fda0b2b44b420243c11e0f5ec1f5" -dependencies = [ - "half", - "serde", -] - -[[package]] -name = "serde_derive" -version = "1.0.152" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "af487d118eecd09402d70a5d72551860e788df87b464af30e5ea6a38c75c541e" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "sha2" -version = "0.10.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" -dependencies = [ - "cfg-if 1.0.0", - "cpufeatures", - "digest", -] - -[[package]] -name = "siphasher" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" - -[[package]] -name = "smallvec" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a507befe795404456341dfab10cef66ead4c041f62b8b11bbb92bffe5d0953e0" - -[[package]] -name = "string_cache" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213494b7a2b503146286049378ce02b482200519accc31872ee8be91fa820a08" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared", - "precomputed-hash", -] - -[[package]] -name = "syn" -version = "1.0.107" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f4064b5b16e03ae50984a5a8ed5d4f8803e6bc1fd170a3cda91a1be4b18e3f5" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - -[[package]] -name = "termcolor" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "thiserror" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6a9cd18aa97d5c45c6603caea1da6628790b37f7a34b6ca89522331c5180fed0" -dependencies = [ - "thiserror-impl", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.38" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fb327af4685e4d03fa8cbcf1716380da910eeb2bb8be417e7f9fd3fb164f36f" -dependencies = [ - "proc-macro2", - "quote", - "syn", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "toml_datetime" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4553f467ac8e3d374bc9a177a26801e5d0f9b211aa1673fb137a403afd1c9cf5" - -[[package]] -name = "toml_edit" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "729bfd096e40da9c001f778f5cdecbd2957929a24e10e5883d9392220a751581" -dependencies = [ - "indexmap", - "nom8", - "toml_datetime", -] - -[[package]] -name = "typed-arena" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6af6ae20167a9ece4bcb41af5b80f8a1f1df981f6391189ce00fd257af04126a" - -[[package]] -name = "typenum" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" - -[[package]] -name = "unicode-ident" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84a22b9f218b40614adcb3f4ff08b703773ad44fa9423e4e0d346d5db86e4ebc" - -[[package]] -name = "unicode-width" -version = "0.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0edd1e5b14653f783770bce4a4dabb4a5108a5370a5f5d8cfe8710c361f6c8b" - -[[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" - -[[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.11.0+wasi-snapshot-preview1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" - -[[package]] -name = "wasm-bindgen" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eaf9f5aceeec8be17c128b2e93e031fb8a4d469bb9c4ae2d7dc1888b26887268" -dependencies = [ - "cfg-if 1.0.0", - "wasm-bindgen-macro", -] - -[[package]] -name = "wasm-bindgen-backend" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8ffb332579b0557b52d268b91feab8df3615f265d5270fec2a8c95b17c1142" -dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-futures" -version = "0.4.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23639446165ca5a5de86ae1d8896b737ae80319560fbaa4c2887b7da6e7ebd7d" -dependencies = [ - "cfg-if 1.0.0", - "js-sys", - "wasm-bindgen", - "web-sys", -] - -[[package]] -name = "wasm-bindgen-macro" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "052be0f94026e6cbc75cdefc9bae13fd6052cdcaf532fa6c45e7ae33a1e6c810" -dependencies = [ - "quote", - "wasm-bindgen-macro-support", -] - -[[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07bc0c051dc5f23e307b13285f9d75df86bfdf816c5721e573dec1f9b8aa193c" -dependencies = [ - "proc-macro2", - "quote", - "syn", - "wasm-bindgen-backend", - "wasm-bindgen-shared", -] - -[[package]] -name = "wasm-bindgen-shared" -version = "0.2.83" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c38c045535d93ec4f0b4defec448e4291638ee608530863b1e2ba115d4fff7f" - -[[package]] -name = "wasm-bindgen-test" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d2fff962180c3fadf677438054b1db62bee4aa32af26a45388af07d1287e1d" -dependencies = [ - "console_error_panic_hook", - "js-sys", - "scoped-tls", - "wasm-bindgen", - "wasm-bindgen-futures", - "wasm-bindgen-test-macro", -] - -[[package]] -name = "wasm-bindgen-test-macro" -version = "0.3.33" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4683da3dfc016f704c9f82cf401520c4f1cb3ee440f7f52b3d6ac29506a49ca7" -dependencies = [ - "proc-macro2", - "quote", -] - -[[package]] -name = "web-sys" -version = "0.3.60" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bcda906d8be16e728fd5adc5b729afad4e444e106ab28cd1c7256e54fa61510f" -dependencies = [ - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "wee_alloc" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dbb3b5a6b2bb17cb6ad44a2e68a43e8d2722c997da10e928665c72ec6c0a0b8e" -dependencies = [ - "cfg-if 0.1.10", - "libc", - "memory_units", - "winapi", -] - -[[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-util" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" -dependencies = [ - "winapi", -] - -[[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-sys" -version = "0.42.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a3e1820f08b8513f676f7ab6c1f99ff312fb97b553d30ff4dd86f9f15728aa7" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] - -[[package]] -name = "windows_aarch64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c9864e83243fdec7fc9c5444389dcbbfd258f745e7853198f365e3c4968a608" - -[[package]] -name = "windows_aarch64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c8b1b673ffc16c47a9ff48570a9d85e25d265735c503681332589af6253c6c7" - -[[package]] -name = "windows_i686_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3887528ad530ba7bdbb1faa8275ec7a1155a45ffa57c37993960277145d640" - -[[package]] -name = "windows_i686_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf4d1122317eddd6ff351aa852118a2418ad4214e6613a50e0191f7004372605" - -[[package]] -name = "windows_x86_64_gnu" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1040f221285e17ebccbc2591ffdc2d44ee1f9186324dd3e84e99ac68d699c45" - -[[package]] -name = "windows_x86_64_gnullvm" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "628bfdf232daa22b0d64fdb62b09fcc36bb01f05a3939e20ab73aaf9470d0463" - -[[package]] -name = "windows_x86_64_msvc" -version = "0.42.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "447660ad36a13288b1db4d4248e857b510e8c3a225c822ba4fb748c0aafecffd" diff --git a/packages/ic-response-verification/Cargo.toml b/packages/ic-response-verification/Cargo.toml index 0a8fc827..6e0b156b 100644 --- a/packages/ic-response-verification/Cargo.toml +++ b/packages/ic-response-verification/Cargo.toml @@ -48,6 +48,4 @@ ic-certification = { git = "https://github.com/dfinity/agent-rs", rev = "815ee1f candid = "0.8.4" serde = "1.0.152" ic-response-verification-test-utils = { path = "../ic-response-verification-test-utils" } - -[target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] ic-crypto-tree-hash = { git = "https://github.com/dfinity/ic", rev = "a533346f63f4091eb64692891de0d5b2ffd5b22a" } diff --git a/packages/ic-response-verification/src/validation/common_validation.rs b/packages/ic-response-verification/src/validation/common_validation.rs index 1a862743..b2e9256a 100644 --- a/packages/ic-response-verification/src/validation/common_validation.rs +++ b/packages/ic-response-verification/src/validation/common_validation.rs @@ -166,8 +166,8 @@ mod tests { use ic_certification::hash_tree::HashTree; use ic_crypto_tree_hash::{flatmap, Label, LabeledTree}; use ic_response_verification_test_utils::{ - create_canister_id, create_certificate, create_certified_data, - create_custom_tree_certificate, AssetTree, CreateCertificateOptions, + create_canister_id, create_certified_data, AssetTree, CanisterData, CertificateBuilder, + CertificateData, }; use std::ops::{Add, Sub}; use std::time::{Duration, SystemTime, UNIX_EPOCH}; @@ -180,23 +180,13 @@ mod tests { time.duration_since(UNIX_EPOCH).unwrap().as_nanos() } - fn leb_encode_timestamp(timestamp: u128) -> [u8; 1024] { - let mut buf = [0; 1024]; - let mut writable = &mut buf[..]; - leb128::write::unsigned(&mut writable, timestamp as u64).unwrap(); - - buf - } - #[test] fn verify_certificate() { let canister_id = create_canister_id("rdmx6-jaaaa-aaaaa-aaadq-cai"); - let (_, root_key, cbor_encoded_certificate) = - create_certificate(Some(CreateCertificateOptions { - canister_id: Some(canister_id), - certified_data: None, - certificate_time: None, - })); + let (_, root_key, cbor_encoded_certificate) = CertificateBuilder::new( + CertificateData::CanisterData(CanisterData::default().with_canister_id(canister_id)), + ) + .build(); let certificate = Certificate::from_cbor(&cbor_encoded_certificate).unwrap(); @@ -207,11 +197,10 @@ mod tests { fn verify_certificate_should_fail() { let wrong_ic_key: &[u8] = b"\x30\x81\x82\x30\x1d\x06\x0d\x2b\x06\x01\x04\x01\x82\xdc\x7c\x05\x03\x01\x02\x01\x06\x0c\x2b\x06\x01\x04\x01\x82\xdc\x7c\x05\x03\x02\x01\x03\x61\x00\x81\x4c\x0e\x6e\xc7\x1f\xab\x58\x3b\x08\xbd\x81\x37\x3c\x25\x5c\x3c\x37\x1b\x2e\x84\x86\x3c\x98\xa4\xf1\xe0\x8b\x74\x23\x5d\x14\xfb\x5d\x9c\x0c\xd5\x46\xd9\x68\x5f\x91\x3a\x0c\x0b\x2c\xc5\x34\x15\x83\xbf\x4b\x43\x92\xe4\x67\xdb\x96\xd6\x5b\x9b\xb4\xcb\x71\x71\x12\xf8\x47\x2e\x0d\x5a\x4d\x14\x50\x5f\xfd\x74\x84\xb0\x12\x91\x09\x1c\x5f\x87\xb9\x88\x83\x46\x3f\x98\x08\x1a\x0b\xaa\xae"; let canister_id = create_canister_id("rdmx6-jaaaa-aaaaa-aaadq-cai"); - let (_, _, cbor_encoded_certificate) = create_certificate(Some(CreateCertificateOptions { - canister_id: Some(canister_id), - certified_data: None, - certificate_time: None, - })); + let (_, _, cbor_encoded_certificate) = CertificateBuilder::new( + CertificateData::CanisterData(CanisterData::default().with_canister_id(canister_id)), + ) + .build(); let certificate = Certificate::from_cbor(&cbor_encoded_certificate).unwrap(); @@ -228,12 +217,10 @@ mod tests { let current_time = SystemTime::now(); let current_timestamp = get_timestamp(current_time); - let certificate_options = CreateCertificateOptions { - certificate_time: Some(current_timestamp), - canister_id: None, - certified_data: None, - }; - let (_, _, cbor_encoded_certificate) = create_certificate(Some(certificate_options)); + let (_, _, cbor_encoded_certificate) = + CertificateBuilder::new(CertificateData::CanisterData(CanisterData::default())) + .with_time(current_timestamp) + .build(); let certificate = Certificate::from_cbor(&cbor_encoded_certificate).unwrap(); validate_certificate_time(&certificate, ¤t_timestamp, &MAX_CERT_TIME_OFFSET_NS) @@ -248,12 +235,10 @@ mod tests { let future_time = current_time.add(Duration::new(301, 0)); let future_timestamp = get_timestamp(future_time); - let certificate_options = CreateCertificateOptions { - certificate_time: Some(future_timestamp), - canister_id: None, - certified_data: None, - }; - let (_, _, cbor_encoded_certificate) = create_certificate(Some(certificate_options)); + let (_, _, cbor_encoded_certificate) = + CertificateBuilder::new(CertificateData::CanisterData(CanisterData::default())) + .with_time(future_timestamp) + .build(); let certificate = Certificate::from_cbor(&cbor_encoded_certificate).unwrap(); assert!(matches!( @@ -271,12 +256,10 @@ mod tests { let past_time = current_time.sub(Duration::new(301, 0)); let past_timestamp = get_timestamp(past_time); - let certificate_options = CreateCertificateOptions { - certificate_time: Some(past_timestamp), - canister_id: None, - certified_data: None, - }; - let (_, _, cbor_encoded_certificate) = create_certificate(Some(certificate_options)); + let (_, _, cbor_encoded_certificate) = + CertificateBuilder::new(CertificateData::CanisterData(CanisterData::default())) + .with_time(past_timestamp) + .build(); let certificate = Certificate::from_cbor(&cbor_encoded_certificate).unwrap(); assert!(matches!( @@ -292,12 +275,12 @@ mod tests { let tree = AssetTree::default(); let certified_data = tree.get_certified_data(); - let certificate_options = CreateCertificateOptions { - certificate_time: None, - canister_id: Some(canister_id), - certified_data: Some(certified_data), - }; - let (_, _, cbor_encoded_certificate) = create_certificate(Some(certificate_options)); + let (_, _, cbor_encoded_certificate) = + CertificateBuilder::new(CertificateData::CanisterData(CanisterData { + canister_id, + certified_data, + })) + .build(); let certificate = Certificate::from_cbor(&cbor_encoded_certificate).unwrap(); let tree = HashTree::from_cbor(&tree.serialize_to_cbor(None)).unwrap(); @@ -314,12 +297,12 @@ mod tests { "8160c07b45d617dba08a20eaa71ace28b5962965034b7539e42ebdb80da729a9", ); - let certificate_options = CreateCertificateOptions { - certificate_time: None, - canister_id: Some(canister_id), - certified_data: Some(certified_data), - }; - let (_, _, cbor_encoded_certificate) = create_certificate(Some(certificate_options)); + let (_, _, cbor_encoded_certificate) = + CertificateBuilder::new(CertificateData::CanisterData(CanisterData { + canister_id, + certified_data, + })) + .build(); let certificate = Certificate::from_cbor(&cbor_encoded_certificate).unwrap(); let tree = HashTree::from_cbor(&tree.serialize_to_cbor(None)).unwrap(); @@ -335,12 +318,12 @@ mod tests { let tree = AssetTree::default(); let certified_data = tree.get_certified_data(); - let certificate_options = CreateCertificateOptions { - certificate_time: None, - canister_id: Some(other_canister_id), - certified_data: Some(certified_data), - }; - let (_, _, cbor_encoded_certificate) = create_certificate(Some(certificate_options)); + let (_, _, cbor_encoded_certificate) = + CertificateBuilder::new(CertificateData::CanisterData(CanisterData { + canister_id: other_canister_id, + certified_data, + })) + .build(); let certificate = Certificate::from_cbor(&cbor_encoded_certificate).unwrap(); let tree = HashTree::from_cbor(&tree.serialize_to_cbor(None)).unwrap(); @@ -364,7 +347,8 @@ mod tests { ]) ]), ]); - let (_, _, cbor_encoded_certificate) = create_custom_tree_certificate(certificate_tree); + let (_, _, cbor_encoded_certificate) = + CertificateBuilder::new(CertificateData::CustomTree(certificate_tree)).build(); let certificate = Certificate::from_cbor(&cbor_encoded_certificate).unwrap(); let tree = HashTree::from_cbor(&tree.serialize_to_cbor(None)).unwrap();