From b83d19d67e894508dbac3d9e86f57243264d4679 Mon Sep 17 00:00:00 2001 From: Andre Popovitch Date: Fri, 17 Jan 2025 14:17:02 -0600 Subject: [PATCH] Use DFX-compatible identity and network --- Cargo.lock | 1068 ++++++++++++++++++++++++++++++++++----- rs/sns/cli/BUILD.bazel | 1 + rs/sns/cli/Cargo.toml | 1 + rs/sns/cli/src/lib.rs | 59 ++- rs/sns/cli/src/main.rs | 2 +- rs/sns/cli/src/utils.rs | 38 +- 6 files changed, 1037 insertions(+), 132 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 4681e48185d..c99d5dde66e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -257,6 +257,43 @@ dependencies = [ "generic-array", ] +[[package]] +name = "aes" +version = "0.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e8b47f52ea9bae42228d07ec09eb676433d7c4ed1ebdf0f1d1c29ed446f1ab8" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.3.0", + "cpufeatures", + "opaque-debug", +] + +[[package]] +name = "aes" +version = "0.8.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b169f7a6d4742236a0a00c541b845991d0ac43e546831af1249753ab4c3aa3a0" +dependencies = [ + "cfg-if 1.0.0", + "cipher 0.4.4", + "cpufeatures", +] + +[[package]] +name = "aes-gcm" +version = "0.10.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "831010a0f742e1209b3bcea8fab6a8e149051ba6099432c8cb2cc117dec3ead1" +dependencies = [ + "aead", + "aes 0.8.4", + "cipher 0.4.4", + "ctr", + "ghash", + "subtle", +] + [[package]] name = "ahash" version = "0.7.8" @@ -476,6 +513,17 @@ version = "1.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" +[[package]] +name = "argon2" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "db4ce4441f99dbd377ca8a8f57b698c44d0d6e712d8329b5040da5a64aa1ce73" +dependencies = [ + "base64ct", + "blake2", + "password-hash", +] + [[package]] name = "arrayvec" version = "0.5.2" @@ -666,25 +714,54 @@ dependencies = [ "log", ] +[[package]] +name = "async-io" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fc5b45d93ef0529756f812ca52e44c221b35341892d3dcc34132ac02f3dd2af" +dependencies = [ + "async-lock 2.8.0", + "autocfg 1.4.0", + "cfg-if 1.0.0", + "concurrent-queue", + "futures-lite 1.13.0", + "log", + "parking", + "polling 2.8.0", + "rustix 0.37.27", + "slab", + "socket2 0.4.10", + "waker-fn", +] + [[package]] name = "async-io" version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "43a2b323ccce0a1d90b449fd71f2a06ca7faa7c54c2751f06c9bd851fc061059" dependencies = [ - "async-lock", + "async-lock 3.4.0", "cfg-if 1.0.0", "concurrent-queue", "futures-io", - "futures-lite", + "futures-lite 2.5.0", "parking", - "polling", - "rustix", + "polling 3.7.4", + "rustix 0.38.42", "slab", "tracing", "windows-sys 0.59.0", ] +[[package]] +name = "async-lock" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "287272293e9d8c41773cec55e365490fe034813a2f172f502d6ddcf75b2f582b" +dependencies = [ + "event-listener 2.5.3", +] + [[package]] name = "async-lock" version = "3.4.0" @@ -702,9 +779,9 @@ version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b948000fad4873c1c9339d60f2623323a0cfd3816e5181033c6a5cb68b2accf7" dependencies = [ - "async-io", + "async-io 2.4.0", "blocking", - "futures-lite", + "futures-lite 2.5.0", ] [[package]] @@ -901,7 +978,7 @@ dependencies = [ "axum", "axum-core", "bytes", - "fastrand", + "fastrand 2.3.0", "futures-util", "headers 0.4.0", "http 1.2.0", @@ -959,7 +1036,7 @@ version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d67782c3f868daa71d3533538e98a8e13713231969def7536e8039606fc46bf0" dependencies = [ - "fastrand", + "fastrand 2.3.0", "futures-core", "pin-project", "tokio", @@ -986,6 +1063,12 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d27c3610c36aee21ce8ac510e6224498de4228ad772a171ed65643a24693a5a8" +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + [[package]] name = "base16ct" version = "0.2.0" @@ -1145,17 +1228,35 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "bip32" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30ed1d6f8437a487a266c8293aeb95b61a23261273e3e02912cdb8b68bf798b" +dependencies = [ + "bs58 0.4.0", + "hmac 0.12.1", + "k256 0.11.6", + "once_cell", + "pbkdf2 0.11.0", + "rand_core 0.6.4", + "ripemd", + "sha2 0.10.8", + "subtle", + "zeroize", +] + [[package]] name = "bip32" version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "aa13fae8b6255872fd86f7faf4b41168661d7d78609f7bfe6771b85c6739a15b" dependencies = [ - "bs58", - "hmac", - "k256", + "bs58 0.5.1", + "hmac 0.12.1", + "k256 0.13.4", "once_cell", - "pbkdf2", + "pbkdf2 0.12.2", "rand_core 0.6.4", "ripemd", "sha2 0.10.8", @@ -1353,6 +1454,15 @@ dependencies = [ "wyz", ] +[[package]] +name = "blake2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46502ad458c9a52b69d4d4d32775c788b7a1b85e8bc9d482d92250fc0e3f8efe" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "block-buffer" version = "0.9.0" @@ -1371,6 +1481,22 @@ dependencies = [ "generic-array", ] +[[package]] +name = "block-modes" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cb03d1bed155d89dce0f845b7899b18a9a163e148fd004e1c28421a783e2d8e" +dependencies = [ + "block-padding", + "cipher 0.3.0", +] + +[[package]] +name = "block-padding" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" + [[package]] name = "blocking" version = "1.6.1" @@ -1380,7 +1506,7 @@ dependencies = [ "async-channel 2.3.1", "async-task", "futures-io", - "futures-lite", + "futures-lite 2.5.0", "piper", ] @@ -1401,7 +1527,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2593a3b8b938bd68373196c9832f516be11fa487ef4ae745eb282e6a56a7244" dependencies = [ "once_cell", - "proc-macro-crate", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.90", @@ -1439,6 +1565,15 @@ dependencies = [ "alloc-stdlib", ] +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +dependencies = [ + "sha2 0.9.9", +] + [[package]] name = "bs58" version = "0.5.1" @@ -2050,7 +2185,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c3613f74bd2eac03dad61bd53dbe620703d4371614fe0bc3b9f04dd36fe4e818" dependencies = [ "cfg-if 1.0.0", - "cipher", + "cipher 0.4.4", "cpufeatures", ] @@ -2062,7 +2197,7 @@ checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ "aead", "chacha20", - "cipher", + "cipher 0.4.4", "poly1305", "zeroize", ] @@ -2109,6 +2244,15 @@ dependencies = [ "half 2.4.1", ] +[[package]] +name = "cipher" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ee52072ec15386f770805afd189a01c8841be8696bed250fa2f13c4c0d6dfb7" +dependencies = [ + "generic-array", +] + [[package]] name = "cipher" version = "0.4.4" @@ -2128,7 +2272,7 @@ checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", - "libloading", + "libloading 0.8.6", ] [[package]] @@ -2938,6 +3082,18 @@ version = "0.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -2961,6 +3117,16 @@ dependencies = [ "typenum", ] +[[package]] +name = "crypto-mac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "25fab6889090c8133f3deb8f73ba3c65a7f456f66436fc012a1b1e272b1e103e" +dependencies = [ + "generic-array", + "subtle", +] + [[package]] name = "cssparser" version = "0.31.2" @@ -3005,6 +3171,15 @@ dependencies = [ "memchr", ] +[[package]] +name = "ctr" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" +dependencies = [ + "cipher 0.4.4", +] + [[package]] name = "ctrlc" version = "3.4.5" @@ -3026,7 +3201,7 @@ dependencies = [ "curve25519-dalek-derive", "digest 0.10.7", "fiat-crypto", - "group", + "group 0.13.0", "rand_core 0.6.4", "rustc_version", "subtle", @@ -3258,6 +3433,17 @@ dependencies = [ "cargo_metadata", ] +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "pem-rfc7468 0.6.0", + "zeroize", +] + [[package]] name = "der" version = "0.7.9" @@ -3267,7 +3453,7 @@ dependencies = [ "const-oid", "der_derive", "flagset", - "pem-rfc7468", + "pem-rfc7468 0.7.0", "zeroize", ] @@ -3306,6 +3492,17 @@ dependencies = [ "serde", ] +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "derive-new" version = "0.7.0" @@ -3455,6 +3652,64 @@ dependencies = [ "prost 0.13.4", ] +[[package]] +name = "dfx-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d4c1fc71b04f661131afa7bc99056c73f4e4018923dd3eedbca246a1e9bfdec" +dependencies = [ + "aes-gcm", + "argon2", + "backoff", + "bip32 0.4.0", + "byte-unit", + "bytes", + "candid", + "clap 4.5.23", + "dialoguer", + "directories-next", + "dunce", + "flate2", + "handlebars", + "hex", + "humantime-serde", + "ic-agent", + "ic-identity-hsm", + "ic-utils 0.39.0", + "itertools 0.10.5", + "k256 0.11.6", + "keyring", + "lazy_static", + "reqwest 0.12.9", + "ring 0.16.20", + "schemars", + "sec1 0.3.0", + "semver", + "serde", + "serde_json", + "sha2 0.10.8", + "slog", + "tar", + "tempfile", + "thiserror 1.0.69", + "time", + "tiny-bip39", + "url", +] + +[[package]] +name = "dialoguer" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" +dependencies = [ + "console 0.15.10", + "shell-words", + "tempfile", + "thiserror 1.0.69", + "zeroize", +] + [[package]] name = "diff" version = "0.1.13" @@ -3488,6 +3743,16 @@ dependencies = [ "subtle", ] +[[package]] +name = "directories-next" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "339ee130d97a610ea5a5872d2bbb130fdf68884ff09d3028b81bec8a1ac23bbc" +dependencies = [ + "cfg-if 1.0.0", + "dirs-sys-next", +] + [[package]] name = "diroid" version = "0.1.0" @@ -3577,24 +3842,42 @@ dependencies = [ "dtoa", ] +[[package]] +name = "dunce" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "92773504d58c093f6de2459af4af33faa518c13451eb8f2b5698ed3d36e7c813" + [[package]] name = "dyn-clone" version = "1.0.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0d6ef0072f8a535281e4876be788938b528e9a1d43900b82c2569af7da799125" +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der 0.6.1", + "elliptic-curve 0.12.3", + "rfc6979 0.3.1", + "signature 1.6.4", +] + [[package]] name = "ecdsa" version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der", + "der 0.7.9", "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", - "spki", + "elliptic-curve 0.13.8", + "rfc6979 0.4.0", + "signature 2.2.0", + "spki 0.7.3", ] [[package]] @@ -3616,8 +3899,8 @@ version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" dependencies = [ - "pkcs8", - "signature", + "pkcs8 0.10.2", + "signature 2.2.0", ] [[package]] @@ -3647,7 +3930,7 @@ dependencies = [ "rand_core 0.6.4", "serde", "sha2 0.10.8", - "signature", + "signature 2.2.0", "subtle", "zeroize", ] @@ -3676,22 +3959,43 @@ version = "1.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct 0.1.1", + "crypto-bigint 0.4.9", + "der 0.6.1", + "digest 0.10.7", + "ff 0.12.1", + "generic-array", + "group 0.12.1", + "pem-rfc7468 0.6.0", + "pkcs8 0.9.0", + "rand_core 0.6.4", + "sec1 0.3.0", + "subtle", + "zeroize", +] + [[package]] name = "elliptic-curve" version = "0.13.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" dependencies = [ - "base16ct", - "crypto-bigint", + "base16ct 0.2.0", + "crypto-bigint 0.5.5", "digest 0.10.7", - "ff", + "ff 0.13.0", "generic-array", - "group", - "pem-rfc7468", - "pkcs8", + "group 0.13.0", + "pem-rfc7468 0.7.0", + "pkcs8 0.10.2", "rand_core 0.6.4", - "sec1", + "sec1 0.7.3", "subtle", "zeroize", ] @@ -3787,6 +4091,27 @@ dependencies = [ "syn 2.0.90", ] +[[package]] +name = "enumflags2" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83c8d82922337cd23a15f88b70d8e4ef5f11da38dd7cdb55e84dd5de99695da0" +dependencies = [ + "enumflags2_derive", + "serde", +] + +[[package]] +name = "enumflags2_derive" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "946ee94e3dbf58fdd324f9ce245c7b238d46a66f00e86a020b71996349e46cce" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "env-file-reader" version = "0.3.0" @@ -3953,10 +4278,10 @@ dependencies = [ "bytes", "chrono", "const-hex", - "elliptic-curve", + "elliptic-curve 0.13.8", "ethabi", "generic-array", - "k256", + "k256 0.13.4", "num_enum", "open-fastrlp", "rand 0.8.5", @@ -4139,6 +4464,15 @@ version = "0.1.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7360491ce676a36bf9bb3c56c1aa791658183a54d2744120f27285738d90465a" +[[package]] +name = "fastrand" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" +dependencies = [ + "instant", +] + [[package]] name = "fastrand" version = "2.3.0" @@ -4157,6 +4491,16 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "ff" version = "0.13.0" @@ -4386,13 +4730,28 @@ version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" +[[package]] +name = "futures-lite" +version = "1.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49a9d51ce47660b1e808d3c990b4709f2f415d928835a17dfd16991515c46bce" +dependencies = [ + "fastrand 1.9.0", + "futures-core", + "futures-io", + "memchr", + "parking", + "pin-project-lite", + "waker-fn", +] + [[package]] name = "futures-lite" version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" dependencies = [ - "fastrand", + "fastrand 2.3.0", "futures-core", "futures-io", "parking", @@ -4527,6 +4886,16 @@ dependencies = [ "wasm-bindgen", ] +[[package]] +name = "ghash" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0d8a4362ccb29cb0b265253fb0a2728f592895ee6854fd9bc13f2ffda266ff1" +dependencies = [ + "opaque-debug", + "polyval", +] + [[package]] name = "gimli" version = "0.26.2" @@ -4575,13 +4944,24 @@ dependencies = [ "spinning_top", ] +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff 0.12.1", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff", + "ff 0.13.0", "rand_core 0.6.4", "subtle", ] @@ -4654,6 +5034,20 @@ dependencies = [ "crunchy", ] +[[package]] +name = "handlebars" +version = "4.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "faa67bab9ff362228eb3d00bd024a4965d8231bbb7921167f0cfa66c6626b225" +dependencies = [ + "log", + "pest", + "pest_derive", + "serde", + "serde_json", + "thiserror 1.0.69", +] + [[package]] name = "hashbrown" version = "0.12.3" @@ -4885,13 +5279,33 @@ dependencies = [ "webpki-roots 0.25.4", ] +[[package]] +name = "hkdf" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "01706d578d5c281058480e673ae4086a9f4710d8df1ad80a5b03e39ece5f886b" +dependencies = [ + "digest 0.9.0", + "hmac 0.11.0", +] + [[package]] name = "hkdf" version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7b5f8eb2ad728638ea2c7d47a21db23b7b58a72ed6a38256b8a1849f15fbbdf7" dependencies = [ - "hmac", + "hmac 0.12.1", +] + +[[package]] +name = "hmac" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2a2320eb7ec0ebe8da8f744d7812d9fc4cb4d09344ac01898dbcb6a20ae69b" +dependencies = [ + "crypto-mac", + "digest 0.9.0", ] [[package]] @@ -5364,16 +5778,16 @@ checksum = "1ba408987ca48fc3eee6a613e760d076a9046cccbbb5ba29efbada339ab28ed9" dependencies = [ "arc-swap", "async-channel 1.9.0", - "async-lock", + "async-lock 3.4.0", "async-trait", "async-watch", "backoff", "cached 0.52.0", "candid", - "der", - "ecdsa", + "der 0.7.9", + "ecdsa 0.16.9", "ed25519-consensus", - "elliptic-curve", + "elliptic-curve 0.13.8", "futures-util", "hex", "http 1.2.0", @@ -5381,16 +5795,16 @@ dependencies = [ "ic-certification 3.0.2", "ic-transport-types", "ic-verify-bls-signature 0.5.0", - "k256", + "k256 0.13.4", "leb128", "p256", "pem 3.0.4", - "pkcs8", + "pkcs8 0.10.2", "rand 0.8.5", "rangemap", "reqwest 0.12.9", "ring 0.17.8", - "sec1", + "sec1 0.7.3", "serde", "serde_bytes", "serde_cbor", @@ -5764,7 +6178,7 @@ dependencies = [ "ic-registry-subnet-type", "ic-system-test-driver", "indoc", - "k256", + "k256 0.13.4", "pem 1.1.1", "rand 0.8.5", "rand_chacha 0.3.1", @@ -6540,7 +6954,7 @@ dependencies = [ "async-trait", "bech32 0.9.1", "bitcoin 0.28.2", - "bs58", + "bs58 0.5.1", "candid", "candid_parser", "canister-test", @@ -6962,7 +7376,7 @@ dependencies = [ "ic-test-utilities-time", "ic-types", "ic-types-test-utils", - "k256", + "k256 0.13.4", "maplit", "mockall", "parking_lot 0.12.3", @@ -6989,7 +7403,7 @@ version = "0.9.0" dependencies = [ "hex", "hex-literal", - "hmac", + "hmac 0.12.1", "ic-crypto-sha2", "ic-crypto-test-utils-reproducible-rng", "lazy_static", @@ -7012,7 +7426,7 @@ dependencies = [ "ed25519-dalek", "hex", "hex-literal", - "hkdf", + "hkdf 0.12.4", "pem 1.1.1", "rand 0.8.5", "rand_chacha 0.3.1", @@ -7205,7 +7619,7 @@ dependencies = [ "ic-types", "num-bigint 0.4.6", "num-traits", - "pkcs8", + "pkcs8 0.10.2", "rsa", "serde", "serde_json", @@ -7481,12 +7895,12 @@ name = "ic-crypto-internal-threshold-sig-canister-threshold-sig" version = "0.9.0" dependencies = [ "assert_matches", - "bip32", + "bip32 0.5.2", "criterion", "curve25519-dalek", "ed25519-dalek", "fe-derive", - "group", + "group 0.13.0", "hex", "hex-literal", "ic-crypto-internal-hmac", @@ -7497,7 +7911,7 @@ dependencies = [ "ic-crypto-sha2", "ic-crypto-test-utils-reproducible-rng", "ic-types", - "k256", + "k256 0.13.4", "lazy_static", "num-traits", "p256", @@ -7523,7 +7937,7 @@ dependencies = [ "ic-crypto-internal-threshold-sig-canister-threshold-sig", "ic-crypto-sha2", "ic-types", - "k256", + "k256 0.13.4", "p256", "rand 0.8.5", "secp256k1 0.22.2", @@ -7641,12 +8055,12 @@ dependencies = [ name = "ic-crypto-secp256k1" version = "0.9.0" dependencies = [ - "bip32", + "bip32 0.5.2", "bitcoin 0.28.2", "hex", "hex-literal", - "hmac", - "k256", + "hmac 0.12.1", + "k256 0.13.4", "lazy_static", "num-bigint 0.4.6", "pem 1.1.1", @@ -7931,10 +8345,10 @@ dependencies = [ "ic-registry-keys", "ic-registry-proto-data-provider", "ic-types", - "pkcs8", + "pkcs8 0.10.2", "rand 0.8.5", "rustls 0.23.20", - "signature", + "signature 2.2.0", "time", "tokio", "tokio-rustls 0.26.1", @@ -8352,7 +8766,7 @@ dependencies = [ "maplit", "memory_tracker", "more-asserts", - "num-rational", + "num-rational 0.2.4", "num-traits", "phantom_newtype", "prometheus", @@ -9097,6 +9511,20 @@ dependencies = [ "serde", ] +[[package]] +name = "ic-identity-hsm" +version = "0.39.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0ebb94d7cb5be09bed47655008f0c2968a3a3253dcf680297f3e8475e4b317c4" +dependencies = [ + "hex", + "ic-agent", + "pkcs11", + "sha2 0.10.8", + "simple_asn1", + "thiserror 2.0.8", +] + [[package]] name = "ic-image-upgrader" version = "0.9.0" @@ -11763,6 +12191,7 @@ dependencies = [ "base64 0.13.1", "candid", "clap 4.5.23", + "dfx-core", "futures", "hex", "ic-agent", @@ -12723,7 +13152,7 @@ dependencies = [ "icrc-ledger-types", "itertools 0.12.1", "json5", - "k256", + "k256 0.13.4", "k8s-openapi", "kube", "lazy_static", @@ -13110,7 +13539,7 @@ dependencies = [ "icp-ledger", "icrc-ledger-agent", "icrc-ledger-types", - "k256", + "k256 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "registry-canister", @@ -13687,8 +14116,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "22c65787944f32af084dffd0c68c1e544237b76e215654ddea8cd9f527dd8b69" dependencies = [ "digest 0.10.7", - "ff", - "group", + "ff 0.13.0", + "group 0.13.0", "pairing", "rand_core 0.6.4", "subtle", @@ -13719,7 +14148,7 @@ dependencies = [ "ic-registry-subnet-type", "ic-system-test-driver", "itertools 0.12.1", - "k256", + "k256 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "rate-limits-api", @@ -13824,7 +14253,7 @@ dependencies = [ "ic_consensus_system_test_catch_up_test_common", "ic_consensus_system_test_liveness_test_common", "ic_consensus_system_test_utils", - "k256", + "k256 0.13.4", "rand 0.8.5", "rand_chacha 0.3.1", "registry-canister", @@ -13862,7 +14291,7 @@ dependencies = [ "ic-system-test-driver", "ic-types", "ic-types-test-utils", - "k256", + "k256 0.13.4", "registry-canister", "serde", "sha2 0.10.8", @@ -13884,7 +14313,7 @@ dependencies = [ "ic-types", "ic-universal-canister", "ic_consensus_system_test_utils", - "k256", + "k256 0.13.4", "rand 0.8.5", "reqwest 0.12.9", "serde_bytes", @@ -14455,6 +14884,17 @@ dependencies = [ "serde", ] +[[package]] +name = "io-lifetimes" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" +dependencies = [ + "hermit-abi 0.3.9", + "libc", + "windows-sys 0.48.0", +] + [[package]] name = "ipconfig" version = "0.3.2" @@ -14651,6 +15091,19 @@ dependencies = [ "serde_json", ] +[[package]] +name = "k256" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +dependencies = [ + "cfg-if 1.0.0", + "ecdsa 0.14.8", + "elliptic-curve 0.12.3", + "sha2 0.10.8", + "sha3", +] + [[package]] name = "k256" version = "0.13.4" @@ -14658,11 +15111,11 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" dependencies = [ "cfg-if 1.0.0", - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "once_cell", "sha2 0.10.8", - "signature", + "signature 2.2.0", ] [[package]] @@ -14687,6 +15140,18 @@ dependencies = [ "cpufeatures", ] +[[package]] +name = "keyring" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba264b266563c1363dcce004776cbf198d7422a4262f77f4ca285bf26ae30955" +dependencies = [ + "byteorder", + "secret-service", + "security-framework 2.11.1", + "winapi 0.3.9", +] + [[package]] name = "kube" version = "0.93.1" @@ -15044,6 +15509,16 @@ dependencies = [ "rle-decode-fast", ] +[[package]] +name = "libloading" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2b111a074963af1d37a139918ac6d49ad1d0d5e47f72fd55388619691a7d753" +dependencies = [ + "cc", + "winapi 0.3.9", +] + [[package]] name = "libloading" version = "0.8.6" @@ -15167,6 +15642,12 @@ version = "0.5.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0717cef1bc8b636c6e1c1bbdefc09e6322da8a9321966e8928ef80d20f7f770f" +[[package]] +name = "linux-raw-sys" +version = "0.3.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" + [[package]] name = "linux-raw-sys" version = "0.4.14" @@ -15451,7 +15932,7 @@ version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b2cffa4ad52c6f791f4f8b15f0c05f9824b2ced1160e88cc393d64fff9a8ac64" dependencies = [ - "rustix", + "rustix 0.38.42", ] [[package]] @@ -15709,7 +16190,7 @@ version = "0.12.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32cf62eb4dd975d2dde76432fb1075c49e3ee2331cf36f1f8fd4b66550d32b6f" dependencies = [ - "async-lock", + "async-lock 3.4.0", "async-trait", "crossbeam-channel", "crossbeam-epoch", @@ -15774,6 +16255,16 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "defc4c55412d89136f966bbb339008b474350e5e6e78d2714439c386b3137a03" +[[package]] +name = "nb-connect" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1bb540dc6ef51cfe1916ec038ce7a620daf3a111e2502d745197cd53d6bca15" +dependencies = [ + "libc", + "socket2 0.4.10", +] + [[package]] name = "neli" version = "0.6.4" @@ -15901,6 +16392,19 @@ dependencies = [ "thiserror 1.0.69", ] +[[package]] +name = "nix" +version = "0.22.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4916f159ed8e5de0082076562152a76b7a1f64a01fd9d1e0fea002c37624faf" +dependencies = [ + "bitflags 1.3.2", + "cc", + "cfg-if 1.0.0", + "libc", + "memoffset 0.6.5", +] + [[package]] name = "nix" version = "0.24.3" @@ -16040,7 +16544,7 @@ dependencies = [ "ic-system-test-driver", "ic_consensus_system_test_utils", "indoc", - "k256", + "k256 0.13.4", "registry-canister", "slog", "tokio", @@ -16095,6 +16599,20 @@ dependencies = [ "winapi 0.3.9", ] +[[package]] +name = "num" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "35bd024e8b2ff75562e5f34e7f4905839deb4b22955ef5e73d2fea1b9813cb23" +dependencies = [ + "num-bigint 0.4.6", + "num-complex", + "num-integer", + "num-iter", + "num-rational 0.4.2", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.2.6" @@ -16135,6 +16653,15 @@ dependencies = [ "zeroize", ] +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", +] + [[package]] name = "num-conv" version = "0.1.0" @@ -16183,6 +16710,17 @@ dependencies = [ "num-traits", ] +[[package]] +name = "num-rational" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" +dependencies = [ + "num-bigint 0.4.6", + "num-integer", + "num-traits", +] + [[package]] name = "num-traits" version = "0.2.19" @@ -16218,7 +16756,7 @@ version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.90", @@ -16649,8 +17187,8 @@ version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" dependencies = [ - "ecdsa", - "elliptic-curve", + "ecdsa 0.16.9", + "elliptic-curve 0.13.8", "primeorder", "sha2 0.10.8", ] @@ -16661,7 +17199,7 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81fec4625e73cf41ef4bb6846cafa6d44736525f442ba45e407c4a000a13996f" dependencies = [ - "group", + "group 0.13.0", ] [[package]] @@ -16684,7 +17222,7 @@ version = "3.6.12" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d830939c76d294956402033aee57a6da7b438f2294eb94864c37b0569053a42c" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 1.0.109", @@ -16764,12 +17302,32 @@ dependencies = [ "which 6.0.3", ] +[[package]] +name = "password-hash" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7676374caaee8a325c9e7a2ae557f216c5563a171d6997b0ef8a65af35147700" +dependencies = [ + "base64ct", + "rand_core 0.6.4", + "subtle", +] + [[package]] name = "paste" version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.7", +] + [[package]] name = "pbkdf2" version = "0.12.2" @@ -16777,7 +17335,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" dependencies = [ "digest 0.10.7", - "hmac", + "hmac 0.12.1", ] [[package]] @@ -16827,6 +17385,15 @@ dependencies = [ "serde", ] +[[package]] +name = "pem-rfc7468" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d159833a9105500e0398934e205e0773f0b27529557134ecfc51c27646adac" +dependencies = [ + "base64ct", +] + [[package]] name = "pem-rfc7468" version = "0.7.0" @@ -17054,7 +17621,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96c8c490f422ef9a4efd2cb5b42b76c8613d7e7dfc1caf667b8a3350a5acc066" dependencies = [ "atomic-waker", - "fastrand", + "fastrand 2.3.0", "futures-io", ] @@ -17064,9 +17631,29 @@ version = "0.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c8ffb9f10fa047879315e6625af03c164b16962a5368d724ed16323b68ace47f" dependencies = [ - "der", - "pkcs8", - "spki", + "der 0.7.9", + "pkcs8 0.10.2", + "spki 0.7.3", +] + +[[package]] +name = "pkcs11" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3aca6d67e4c8613bfe455599d0233d00735f85df2001f6bfd9bb7ac0496b10af" +dependencies = [ + "libloading 0.5.2", + "num-bigint 0.2.6", +] + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der 0.6.1", + "spki 0.6.0", ] [[package]] @@ -17075,8 +17662,8 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der", - "spki", + "der 0.7.9", + "spki 0.7.3", ] [[package]] @@ -17140,7 +17727,7 @@ dependencies = [ "ic-certification 3.0.2", "ic-error-types", "ic-transport-types", - "k256", + "k256 0.13.4", "lazy_static", "reqwest 0.12.9", "schemars", @@ -17264,6 +17851,22 @@ dependencies = [ "serde_bytes", ] +[[package]] +name = "polling" +version = "2.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b2d323e8ca7996b3e23126511a523f7e62924d93ecd5ae73b333815b0eb3dce" +dependencies = [ + "autocfg 1.4.0", + "bitflags 1.3.2", + "cfg-if 1.0.0", + "concurrent-queue", + "libc", + "log", + "pin-project-lite", + "windows-sys 0.48.0", +] + [[package]] name = "polling" version = "3.7.4" @@ -17274,7 +17877,7 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix", + "rustix 0.38.42", "tracing", "windows-sys 0.59.0", ] @@ -17290,6 +17893,18 @@ dependencies = [ "universal-hash", ] +[[package]] +name = "polyval" +version = "0.6.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1fe60d06143b2430aa532c94cfe9e29783047f06c0d7fd359a9a51b729fa25" +dependencies = [ + "cfg-if 1.0.0", + "cpufeatures", + "opaque-debug", + "universal-hash", +] + [[package]] name = "portable-atomic" version = "1.10.0" @@ -17445,7 +18060,7 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" dependencies = [ - "elliptic-curve", + "elliptic-curve 0.13.8", ] [[package]] @@ -17473,13 +18088,32 @@ dependencies = [ "serde", ] +[[package]] +name = "proc-macro-crate" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d6ea3c4595b96363c13943497db34af4460fb474a95c43f4446ad341b8c9785" +dependencies = [ + "toml", +] + +[[package]] +name = "proc-macro-crate" +version = "1.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" +dependencies = [ + "once_cell", + "toml_edit 0.19.15", +] + [[package]] name = "proc-macro-crate" version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" dependencies = [ - "toml_edit", + "toml_edit 0.22.22", ] [[package]] @@ -17545,7 +18179,7 @@ dependencies = [ "hex", "lazy_static", "procfs-core", - "rustix", + "rustix 0.38.42", ] [[package]] @@ -18115,7 +18749,7 @@ dependencies = [ "candid", "clap 4.5.23", "ic-agent", - "k256", + "k256 0.13.4", "rate-limits-api", "regex", "serde", @@ -18590,13 +19224,24 @@ dependencies = [ "serde", ] +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac 0.12.1", + "zeroize", +] + [[package]] name = "rfc6979" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" dependencies = [ - "hmac", + "hmac 0.12.1", "subtle", ] @@ -18828,11 +19473,11 @@ dependencies = [ "num-integer", "num-traits", "pkcs1", - "pkcs8", + "pkcs8 0.10.2", "rand_core 0.6.4", "sha2 0.10.8", - "signature", - "spki", + "signature 2.2.0", + "spki 0.7.3", "subtle", "zeroize", ] @@ -18983,6 +19628,20 @@ dependencies = [ "nom", ] +[[package]] +name = "rustix" +version = "0.37.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fea8ca367a3a01fe35e6943c400addf443c0f57670e6ec51196f71a4b8762dd2" +dependencies = [ + "bitflags 1.3.2", + "errno 0.3.10", + "io-lifetimes", + "libc", + "linux-raw-sys 0.3.8", + "windows-sys 0.48.0", +] + [[package]] name = "rustix" version = "0.38.42" @@ -18992,7 +19651,7 @@ dependencies = [ "bitflags 2.6.0", "errno 0.3.10", "libc", - "linux-raw-sys", + "linux-raw-sys 0.4.14", "windows-sys 0.59.0", ] @@ -19045,7 +19704,7 @@ version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "54f05935c0b1d7c5981c40b768c5d5ed96a43f5cb5166f8f5be09779c5825697" dependencies = [ - "async-io", + "async-io 2.4.0", "async-trait", "async-web-client", "base64 0.22.1", @@ -19216,7 +19875,7 @@ version = "2.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6630024bf739e2179b91fb424b28898baf819414262c5d376677dbff1fe7ebf" dependencies = [ - "proc-macro-crate", + "proc-macro-crate 3.2.0", "proc-macro2", "quote", "syn 2.0.90", @@ -19323,16 +19982,30 @@ version = "4.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c107b6f4780854c8b126e228ea8869f4d7b71260f962fefb57b996b8959ba6b" +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct 0.1.1", + "der 0.6.1", + "generic-array", + "pkcs8 0.9.0", + "subtle", + "zeroize", +] + [[package]] name = "sec1" version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ - "base16ct", - "der", + "base16ct 0.2.0", + "der 0.7.9", "generic-array", - "pkcs8", + "pkcs8 0.10.2", "subtle", "zeroize", ] @@ -19407,6 +20080,26 @@ dependencies = [ "zeroize", ] +[[package]] +name = "secret-service" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1da5c423b8783185fd3fecd1c8796c267d2c089d894ce5a93c280a5d3f780a2" +dependencies = [ + "aes 0.7.5", + "block-modes", + "hkdf 0.11.0", + "lazy_static", + "num", + "rand 0.8.5", + "serde", + "sha2 0.9.9", + "zbus", + "zbus_macros", + "zvariant", + "zvariant_derive", +] + [[package]] name = "security-framework" version = "2.11.1" @@ -19814,6 +20507,12 @@ dependencies = [ "lazy_static", ] +[[package]] +name = "shell-words" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" + [[package]] name = "shlex" version = "1.3.0" @@ -19850,6 +20549,16 @@ dependencies = [ "libc", ] +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.7", + "rand_core 0.6.4", +] + [[package]] name = "signature" version = "2.2.0" @@ -20150,6 +20859,16 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der 0.6.1", +] + [[package]] name = "spki" version = "0.7.3" @@ -20157,7 +20876,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der", + "der 0.7.9", ] [[package]] @@ -20621,9 +21340,9 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" dependencies = [ "cfg-if 1.0.0", - "fastrand", + "fastrand 2.3.0", "once_cell", - "rustix", + "rustix 0.38.42", "windows-sys 0.59.0", ] @@ -20897,6 +21616,25 @@ dependencies = [ "time-core", ] +[[package]] +name = "tiny-bip39" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62cc94d358b5a1e84a5cb9109f559aa3c4d634d2b1b4de3d0fa4adc7c78e2861" +dependencies = [ + "anyhow", + "hmac 0.12.1", + "once_cell", + "pbkdf2 0.11.0", + "rand 0.8.5", + "rustc-hash 1.1.0", + "sha2 0.10.8", + "thiserror 1.0.69", + "unicode-normalization", + "wasm-bindgen", + "zeroize", +] + [[package]] name = "tiny-keccak" version = "2.0.2" @@ -21147,12 +21885,32 @@ dependencies = [ "tokio", ] +[[package]] +name = "toml" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + [[package]] name = "toml_datetime" version = "0.6.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +[[package]] +name = "toml_edit" +version = "0.19.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1b5bb770da30e5cbfde35a2d7b9b8a2c4b8ef89548a7a6aeab5c9a576e3e7421" +dependencies = [ + "indexmap 2.7.0", + "toml_datetime", + "winnow 0.5.40", +] + [[package]] name = "toml_edit" version = "0.22.22" @@ -21161,7 +21919,7 @@ checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" dependencies = [ "indexmap 2.7.0", "toml_datetime", - "winnow", + "winnow 0.6.20", ] [[package]] @@ -21917,6 +22675,12 @@ dependencies = [ "libc", ] +[[package]] +name = "waker-fn" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317211a0dc0ceedd78fb2ca9a44aed3d7b9b26f81870d485c07122b4350673b7" + [[package]] name = "walkdir" version = "2.5.0" @@ -22219,7 +22983,7 @@ dependencies = [ "psm", "pulley-interpreter", "rayon", - "rustix", + "rustix 0.38.42", "serde", "serde_derive", "smallvec", @@ -22325,7 +23089,7 @@ dependencies = [ "anyhow", "cc", "cfg-if 1.0.0", - "rustix", + "rustix 0.38.42", "wasmtime-asm-macros", "wasmtime-versioned-export-macros", "windows-sys 0.59.0", @@ -22489,7 +23253,7 @@ dependencies = [ "either", "home", "once_cell", - "rustix", + "rustix 0.38.42", ] [[package]] @@ -22500,7 +23264,7 @@ checksum = "b4ee928febd44d98f2f459a4a79bd4d928591333a494a10a868418ac1b39cf1f" dependencies = [ "either", "home", - "rustix", + "rustix 0.38.42", "winsafe", ] @@ -22751,6 +23515,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "0.5.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f593a95398737aeed53e489c785df13f3618e41dbcd6718c6addbf1395aa6876" +dependencies = [ + "memchr", +] + [[package]] name = "winnow" version = "0.6.20" @@ -22845,10 +23618,10 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1301e935010a701ae5f8655edc0ad17c44bad3ac5ce8c39185f75453b720ae94" dependencies = [ "const-oid", - "der", + "der 0.7.9", "sha1", - "signature", - "spki", + "signature 2.2.0", + "spki 0.7.3", "tls_codec", ] @@ -22876,8 +23649,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8da84f1a25939b27f6820d92aed108f83ff920fdf11a7b19366c27c4cda81d4f" dependencies = [ "libc", - "linux-raw-sys", - "rustix", + "linux-raw-sys 0.4.14", + "rustix 0.38.42", ] [[package]] @@ -22974,6 +23747,41 @@ dependencies = [ "synstructure", ] +[[package]] +name = "zbus" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cbeb2291cd7267a94489b71376eda33496c1b9881adf6b36f26cc2779f3fc49" +dependencies = [ + "async-io 1.13.0", + "byteorder", + "derivative", + "enumflags2", + "fastrand 1.9.0", + "futures", + "nb-connect", + "nix 0.22.3", + "once_cell", + "polling 2.8.0", + "scoped-tls", + "serde", + "serde_repr", + "zbus_macros", + "zvariant", +] + +[[package]] +name = "zbus_macros" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fa3959a7847cf95e3d51e312856617c5b1b77191176c65a79a5f14d778bbe0a6" +dependencies = [ + "proc-macro-crate 0.1.5", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "zerocopy" version = "0.7.35" @@ -23085,3 +23893,29 @@ dependencies = [ "cc", "pkg-config", ] + +[[package]] +name = "zvariant" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a68c7b55f2074489b7e8e07d2d0a6ee6b4f233867a653c664d8020ba53692525" +dependencies = [ + "byteorder", + "enumflags2", + "libc", + "serde", + "static_assertions", + "zvariant_derive", +] + +[[package]] +name = "zvariant_derive" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e4ca5e22593eb4212382d60d26350065bf2a02c34b85bc850474a74b589a3de9" +dependencies = [ + "proc-macro-crate 1.3.1", + "proc-macro2", + "quote", + "syn 1.0.109", +] diff --git a/rs/sns/cli/BUILD.bazel b/rs/sns/cli/BUILD.bazel index 4b71f72f1a7..b0039f0d4ac 100644 --- a/rs/sns/cli/BUILD.bazel +++ b/rs/sns/cli/BUILD.bazel @@ -23,6 +23,7 @@ DEPENDENCIES = [ "@crate_index//:base64", "@crate_index//:candid", "@crate_index//:clap", + "@crate_index//:dfx-core", "@crate_index//:futures", "@crate_index//:hex", "@crate_index//:ic-agent", diff --git a/rs/sns/cli/Cargo.toml b/rs/sns/cli/Cargo.toml index 6df0cf7bd47..36a7847602f 100644 --- a/rs/sns/cli/Cargo.toml +++ b/rs/sns/cli/Cargo.toml @@ -18,6 +18,7 @@ anyhow = { workspace = true } base64 = { workspace = true } candid = { workspace = true } clap = { workspace = true } +dfx-core = { workspace = true } futures = { workspace = true } hex = { workspace = true } ic-agent = { workspace = true } diff --git a/rs/sns/cli/src/lib.rs b/rs/sns/cli/src/lib.rs index fd5f82d58c2..a7d2805e5a5 100644 --- a/rs/sns/cli/src/lib.rs +++ b/rs/sns/cli/src/lib.rs @@ -5,7 +5,7 @@ use crate::{ }; use anyhow::{anyhow, bail, Context, Result}; use candid::{CandidType, Decode, Encode, IDLArgs}; -use clap::Parser; +use clap::{ArgGroup, Args, Parser}; use ic_agent::Agent; use ic_base_types::PrincipalId; use ic_crypto_sha2::Sha256; @@ -38,7 +38,7 @@ pub mod prepare_canisters; pub mod propose; mod table; pub mod unit_helpers; -mod utils; +pub mod utils; #[cfg(test)] mod tests; @@ -57,6 +57,47 @@ const TEST_NEURON_1_OWNER_DFX_IDENTITY_NAME: &str = pub struct CliArgs { #[clap(subcommand)] pub sub_command: SubCommand, + + /// The user identity to run this command as. It contains your principal as well as some things DFX associates with it like the wallet. + #[arg(long, env = "DFX_IDENTITY", global = true)] + identity: Option, + + #[command(flatten)] + network: NetworkOpt, +} + +#[derive(Args, Clone, Debug, Default)] +#[clap( +group(ArgGroup::new("network-select").multiple(false)), +)] +pub struct NetworkOpt { + /// Override the compute network to connect to. By default, the local network is used. + /// A valid URL (starting with `http:` or `https:`) can be used here, and a special + /// ephemeral network will be created specifically for this request. E.g. + /// "http://localhost:12345/" is a valid network name. + #[arg(long, global(true), group = "network-select")] + network: Option, + + /// Shorthand for --network=playground. + /// Borrows short-lived canisters on the real IC network instead of creating normal canisters. + #[clap(long, global(true), group = "network-select")] + playground: bool, + + /// Shorthand for --network=ic. + #[clap(long, global(true), group = "network-select")] + ic: bool, +} + +impl NetworkOpt { + pub fn to_network_name(&self) -> Option { + if self.playground { + Some("playground".to_string()) + } else if self.ic { + Some("ic".to_string()) + } else { + self.network.clone() + } + } } #[derive(Debug, Parser)] @@ -83,8 +124,18 @@ pub enum SubCommand { } impl CliArgs { - pub fn agent(&self) -> Result { - crate::utils::get_mainnet_agent() + pub async fn agent(&self) -> Result { + let network = match self.network.to_network_name() { + Some(network) => network, + None => { + eprintln!( + "No network specified. Defaulting to the local network. To connect to the mainnet IC instead, try passing `--network=ic`" + ); + "local".to_string() + } + }; + + crate::utils::get_agent(&network, self.identity.clone()).await } } diff --git a/rs/sns/cli/src/main.rs b/rs/sns/cli/src/main.rs index 564cd638991..efd35da9080 100644 --- a/rs/sns/cli/src/main.rs +++ b/rs/sns/cli/src/main.rs @@ -17,7 +17,7 @@ async fn main() -> Result<()> { } }; - let agent = args.agent()?; + let agent = args.agent().await?; match args.sub_command { SubCommand::DeployTestflight(args) => deploy_testflight(args), diff --git a/rs/sns/cli/src/utils.rs b/rs/sns/cli/src/utils.rs index cc2782b123a..310e7c928c2 100644 --- a/rs/sns/cli/src/utils.rs +++ b/rs/sns/cli/src/utils.rs @@ -1,21 +1,39 @@ -use anyhow::{anyhow, Result}; +use anyhow::Context; +use anyhow::Result; +use dfx_core::interface::{builder::IdentityPicker, dfx::DfxInterface}; use futures::{stream, StreamExt}; use ic_agent::Agent; use ic_nervous_system_agent::sns::Sns; use itertools::Itertools; use serde::{Deserialize, Serialize}; -fn get_agent(ic_url: &str) -> Result { - Agent::builder() - .with_url(ic_url) - .with_verify_query_signatures(false) - .build() - .map_err(|e| anyhow!(e)) +/// Gets the dfx_core interface +pub async fn dfx_interface(network_name: &str, identity: Option) -> Result { + let interface_builder = { + let identity = identity + .clone() + .map(IdentityPicker::Named) + .unwrap_or(IdentityPicker::Selected); + DfxInterface::builder() + .with_identity(identity) + .with_network_named(network_name) + }; + let interface = interface_builder.build().await.context(format!( + "Failed to build dfx interface with network `{network_name}` and identity `{identity:?}`" + ))?; + if !interface.network_descriptor().is_ic { + interface.agent().fetch_root_key().await.context(format!( + "Failed to fetch root key from network `{network_name}`." + ))?; + } + Ok(interface) } -pub fn get_mainnet_agent() -> Result { - let ic_url = "https://ic0.app/"; - get_agent(ic_url) +pub async fn get_agent(network_name: &str, identity: Option) -> Result { + let interface = dfx_interface(network_name, identity) + .await + .context("Failed to get dfx interface")?; + Ok(interface.agent().clone()) } #[derive(Debug, Serialize, Deserialize)]