From 89b357350d47dba1bdea1be19d26516f1cbd91ac Mon Sep 17 00:00:00 2001 From: John Smith Date: Sat, 19 Aug 2023 15:16:51 -0400 Subject: [PATCH] upgrade dependencies and fix cargo locks --- Cargo.lock | 592 +++++++----------- veilid-core/Cargo.toml | 164 ++--- veilid-core/src/crypto/blake3digest512.rs | 81 ++- veilid-core/src/crypto/vld0/mod.rs | 50 +- veilid-core/src/network_manager/native/mod.rs | 19 +- veilid-tools/Cargo.toml | 93 ++- veilid-tools/src/callback_state_machine.rs | 102 --- veilid-tools/src/lib.rs | 2 - 8 files changed, 441 insertions(+), 662 deletions(-) delete mode 100644 veilid-tools/src/callback_state_machine.rs diff --git a/Cargo.lock b/Cargo.lock index e3f3eb22..aceaa7e4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -19,10 +19,11 @@ checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" [[package]] name = "aead" -version = "0.4.3" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b613b8e1e3cf911a086f53f03bf286f52fd7a7258e4fa606f0ef220d39d8877" +checksum = "d122413f284cf2d62fb1b7db97e02edb8cda96d769b16e443a4f6195e35662b0" dependencies = [ + "crypto-common", "generic-array 0.14.7", ] @@ -87,18 +88,19 @@ checksum = "0942ffc6dcaadf03badf6e6a2d0228460359d5e34b57ccdc720b7382dfbd5ec5" [[package]] name = "android-logd-logger" -version = "0.2.2" +version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53eff4527d2f64c8374a3bbe1d280ce660203e8c83e4a893231037a488639a7b" +checksum = "89d7b9303373a56714732e3371513edd14d12987d04ff4f48527444e804bc3ae" dependencies = [ "bytes 1.4.0", - "env_logger 0.8.4", + "env_logger 0.10.0", "lazy_static", "libc", "log", - "redox_syscall 0.2.16", + "parking_lot 0.12.1", + "redox_syscall 0.3.5", "thiserror", - "time 0.2.27", + "time 0.3.25", "winapi", ] @@ -439,19 +441,6 @@ version = "4.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ecc7ab41815b3c653ccd2978ec3255c81349336702dfdf62ee6f7069b12a3aae" -[[package]] -name = "async-tls" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2f23d769dbf1838d5df5156e7b1ad404f4c463d1ac2c6aeb6cd943630f8a8400" -dependencies = [ - "futures-core", - "futures-io", - "rustls 0.19.1", - "webpki 0.21.4", - "webpki-roots 0.21.1", -] - [[package]] name = "async-tls" version = "0.12.0" @@ -460,9 +449,9 @@ checksum = "cfeefd0ca297cbbb3bd34fd6b228401c2a5177038257afd751bc29f0a2da4795" dependencies = [ "futures-core", "futures-io", - "rustls 0.20.8", - "rustls-pemfile 1.0.3", - "webpki 0.22.0", + "rustls", + "rustls-pemfile", + "webpki", "webpki-roots 0.22.6", ] @@ -496,7 +485,7 @@ version = "0.23.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1e9efbe14612da0a19fb983059a0b621e9cf6225d7018ecab4f9988215540dc" dependencies = [ - "async-tls 0.12.0", + "async-tls", "futures-io", "futures-util", "log", @@ -517,7 +506,7 @@ dependencies = [ "futures-timer", "futures-util", "pin-project 1.1.3", - "rustc_version 0.4.0", + "rustc_version", "tokio", "wasm-bindgen-futures", ] @@ -530,7 +519,7 @@ checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" dependencies = [ "futures", "pharos", - "rustc_version 0.4.0", + "rustc_version", ] [[package]] @@ -634,12 +623,6 @@ dependencies = [ "rustc-demangle", ] -[[package]] -name = "base-x" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cbbc9d0964165b47557570cce6c952866c2678457aca742aafc9fb771d30270" - [[package]] name = "base64" version = "0.12.3" @@ -914,18 +897,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chacha20" -version = "0.8.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c80e5460aa66fe3b91d40bcbdab953a597b60053e34d684ac6903f863b680a6" -dependencies = [ - "cfg-if 1.0.0", - "cipher 0.3.0", - "cpufeatures", - "zeroize", -] - [[package]] name = "chacha20" version = "0.9.1" @@ -939,13 +910,13 @@ dependencies = [ [[package]] name = "chacha20poly1305" -version = "0.9.1" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18446b09be63d457bbec447509e85f662f32952b035ce892290396bc0b0cff5" +checksum = "10cd79432192d1c0f4e1a0fef9527696cc039165d729fb41b3f4f4f354c2dc35" dependencies = [ "aead", - "chacha20 0.8.2", - "cipher 0.3.0", + "chacha20", + "cipher 0.4.4", "poly1305", "zeroize", ] @@ -982,6 +953,7 @@ checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" dependencies = [ "crypto-common", "inout", + "zeroize", ] [[package]] @@ -1205,10 +1177,10 @@ dependencies = [ ] [[package]] -name = "const_fn" -version = "0.4.9" +name = "const-oid" +version = "0.9.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fbdcdcb6d86f71c5e97409ad45898af11cbc995b4ee8112d59095a28d376c935" +checksum = "28c122c3980598d243d63d9a704629a2d748d101f278052ff068be5a4423ab6f" [[package]] name = "constant_time_eq" @@ -1341,6 +1313,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" dependencies = [ "generic-array 0.14.7", + "rand_core 0.6.4", "typenum", ] @@ -1393,7 +1366,7 @@ dependencies = [ "flexi_logger", "lazy_static", "log", - "time 0.3.26", + "time 0.3.25", "unicode-width", ] @@ -1435,7 +1408,7 @@ dependencies = [ "owning_ref", "serde_json", "serde_yaml", - "time 0.3.26", + "time 0.3.25", "tokio", "toml 0.7.6", "unicode-segmentation", @@ -1454,17 +1427,32 @@ dependencies = [ [[package]] name = "curve25519-dalek" -version = "3.2.1" +version = "4.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90f9d052967f590a76e62eb387bd0bbb1b000182c3cefe5364db6b7211651bc0" +checksum = "f711ade317dd348950a9910f81c5947e3d8907ebd2b83f76203ff1807e6a2bc2" dependencies = [ - "byteorder", - "digest 0.9.0", - "rand_core 0.5.1", + "cfg-if 1.0.0", + "cpufeatures", + "curve25519-dalek-derive", + "digest 0.10.7", + "fiat-crypto", + "platforms", + "rustc_version", "subtle", "zeroize", ] +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83fdaf97f4804dcebfa5862639bc9ce4121e82140bec2a987ac5140294865b5b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + [[package]] name = "daemonize" version = "0.5.0" @@ -1562,6 +1550,16 @@ version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2e66c9d817f1720209181c316d28635c050fa304f9c79e47a520882661b7308" +[[package]] +name = "der" +version = "0.7.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fffa369a668c8af7dbf8b5e56c9f744fbd399949ed171606040001947de40b1c" +dependencies = [ + "const-oid", + "zeroize", +] + [[package]] name = "deranged" version = "0.3.7" @@ -1605,7 +1603,16 @@ version = "4.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f51c5d4ddabd36886dd3e1438cb358cdcb0d7c499cb99cb4ac2e38e18b5cb210" dependencies = [ - "dirs-sys", + "dirs-sys 0.3.7", +] + +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys 0.4.1", ] [[package]] @@ -1620,10 +1627,16 @@ dependencies = [ ] [[package]] -name = "discard" -version = "1.0.4" +name = "dirs-sys" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "212d0f5754cb6769937f4501cc0e67f4f4483c8d2c3e1e922ee9edbe4ab4c7c0" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] [[package]] name = "dlv-list" @@ -1639,23 +1652,26 @@ checksum = "bbfc4744c1b8f2a09adc0e55242f60b1af195d88596bd8700be74418c056c555" [[package]] name = "ed25519" -version = "1.5.3" +version = "2.2.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +checksum = "60f6d271ca33075c88028be6f04d502853d63a5ece419d269c15315d4fc1cf1d" dependencies = [ + "pkcs8", "signature", ] [[package]] name = "ed25519-dalek" -version = "1.0.1" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +checksum = "7277392b266383ef8396db7fdeb1e77b6c52fed775f5df15bb24f35b72156980" dependencies = [ "curve25519-dalek", "ed25519", - "rand 0.7.3", - "sha2 0.9.9", + "rand_core 0.6.4", + "serde", + "sha2 0.10.7", + "signature", "zeroize", ] @@ -1740,16 +1756,6 @@ dependencies = [ "syn 2.0.29", ] -[[package]] -name = "env_logger" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a19187fea3ac7e84da7dacf48de0c45d63c6a76f9490dae389aead16c243fce3" -dependencies = [ - "log", - "regex", -] - [[package]] name = "env_logger" version = "0.9.3" @@ -1894,6 +1900,12 @@ dependencies = [ "log", ] +[[package]] +name = "fiat-crypto" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e825f6987101665dea6ec934c09ec6d721de7bc1bf92248e1d5810c8cd636b77" + [[package]] name = "fixedbitset" version = "0.4.2" @@ -1925,7 +1937,7 @@ dependencies = [ "regex", "rustversion", "thiserror", - "time 0.3.26", + "time 0.3.25", ] [[package]] @@ -2763,7 +2775,7 @@ dependencies = [ "cfg-if 1.0.0", "core-foundation 0.9.3", "core-foundation-sys 0.8.4", - "directories", + "directories 4.0.1", "fs4", "jni 0.20.0", "keychain-services", @@ -3542,6 +3554,12 @@ dependencies = [ "tokio-stream", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "ordered-multimap" version = "0.4.3" @@ -3754,7 +3772,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" dependencies = [ "futures", - "rustc_version 0.4.0", + "rustc_version", ] [[package]] @@ -3809,12 +3827,28 @@ version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + [[package]] name = "pkg-config" version = "0.3.27" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" +[[package]] +name = "platforms" +version = "3.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e3d7ddaed09e0eb771a79ab0fd64609ba0afb0a8366421957936ad14cbd13630" + [[package]] name = "png" version = "0.17.10" @@ -3846,9 +3880,9 @@ dependencies = [ [[package]] name = "poly1305" -version = "0.7.2" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "048aeb476be11a4b6ca432ca569e375810de9294ae78f4774e78ea98a9246ede" +checksum = "8159bd90725d2df49889a078b54f4f79e87f1f8a8444194cdca81d38f5393abf" dependencies = [ "cpufeatures", "opaque-debug", @@ -3890,12 +3924,6 @@ dependencies = [ "toml_edit", ] -[[package]] -name = "proc-macro-hack" -version = "0.5.20+deprecated" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc375e1527247fe1a97d8b7156678dfe7c1af2fc075c9a4db3690ecd2a148068" - [[package]] name = "proc-macro2" version = "1.0.66" @@ -4223,25 +4251,6 @@ dependencies = [ "smallvec", ] -[[package]] -name = "rust-fsm" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "021d7de715253e45ad24a2fbb0725a0f7f271fd8d3163b130bd65ce2816a860d" -dependencies = [ - "rust-fsm-dsl", -] - -[[package]] -name = "rust-fsm-dsl" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a66b1273014079e4cf2b04aad1f3a2849e26e9a106f0411be2b1c15c23a791a" -dependencies = [ - "quote", - "syn 1.0.109", -] - [[package]] name = "rust-ini" version = "0.18.0" @@ -4264,22 +4273,13 @@ version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" -[[package]] -name = "rustc_version" -version = "0.2.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "138e3e0acb6c9fb258b19b67cb8abd63c00679d2851805ea151465464fe9030a" -dependencies = [ - "semver 0.9.0", -] - [[package]] name = "rustc_version" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" dependencies = [ - "semver 1.0.18", + "semver", ] [[package]] @@ -4309,19 +4309,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[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" @@ -4330,17 +4317,8 @@ checksum = "fff78fc74d175294f4e83b28343315ffcfb114b156f0185e9741cb5570f50e2f" dependencies = [ "log", "ring", - "sct 0.7.0", - "webpki 0.22.0", -] - -[[package]] -name = "rustls-pemfile" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5eebeaeb360c87bfb72e84abdb3447159c0eaececf1bef2aecd65a8be949d1c9" -dependencies = [ - "base64 0.13.1", + "sct", + "webpki", ] [[package]] @@ -4409,16 +4387,6 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" -[[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" @@ -4472,27 +4440,12 @@ dependencies = [ "libc", ] -[[package]] -name = "semver" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d7eb9ef2c18661902cc47e535f9bc51b78acd254da71d375c2f6720d9a40403" -dependencies = [ - "semver-parser", -] - [[package]] name = "semver" version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b0293b4b29daaf487284529cc2f5675b8e57c61f70167ba415a463651fd6a918" -[[package]] -name = "semver-parser" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "388a1df253eca08550bef6c72392cfe7c30914bf41df5269b68cbd6ff8f570a3" - [[package]] name = "send_wrapper" version = "0.4.0" @@ -4510,9 +4463,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.171" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" +checksum = "32ac8da02677876d532745a130fc9d8e6edfa81a269b107c5b00829b91d8eb3c" dependencies = [ "serde_derive", ] @@ -4538,9 +4491,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.171" +version = "1.0.183" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" +checksum = "aafe972d60b0b9bee71a91b92fee2d4fb3c9d7e8f6b179aa99f27203d99a4816" dependencies = [ "proc-macro2", "quote", @@ -4613,7 +4566,21 @@ dependencies = [ "lazy_static", "log", "parking_lot 0.12.1", - "serial_test_derive", + "serial_test_derive 0.10.0", +] + +[[package]] +name = "serial_test" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0e56dd856803e253c8f298af3f4d7eb0ae5e23a737252cd90bb4f3b435033b2d" +dependencies = [ + "dashmap", + "futures", + "lazy_static", + "log", + "parking_lot 0.12.1", + "serial_test_derive 2.0.0", ] [[package]] @@ -4627,6 +4594,17 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "serial_test_derive" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91d129178576168c589c9ec973feedf7d3126c01ac2bf08795109aa35b69fb8f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.29", +] + [[package]] name = "sha-1" version = "0.9.8" @@ -4640,15 +4618,6 @@ dependencies = [ "opaque-debug", ] -[[package]] -name = "sha1" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1da05c97445caa12d05e848c4a4fcbbea29e748ac28f7e80e9b010392063770" -dependencies = [ - "sha1_smol", -] - [[package]] name = "sha1" version = "0.10.5" @@ -4660,12 +4629,6 @@ dependencies = [ "digest 0.10.7", ] -[[package]] -name = "sha1_smol" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae1a47186c03a32177042e55dbc5fd5aee900b8e0069a8d70fba96a9375cd012" - [[package]] name = "sha2" version = "0.9.9" @@ -4761,9 +4724,12 @@ dependencies = [ [[package]] name = "signature" -version = "1.6.4" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +checksum = "8fe458c98333f9c8152221191a77e2a44e8325d0193484af2e9421a53019e57d" +dependencies = [ + "digest 0.10.7", +] [[package]] name = "simd-adler32" @@ -4779,7 +4745,7 @@ checksum = "acee08041c5de3d5048c8b3f6f13fafb3026b24ba43c6a695a0c76179b844369" dependencies = [ "log", "termcolor", - "time 0.3.26", + "time 0.3.25", ] [[package]] @@ -4842,76 +4808,28 @@ dependencies = [ "lock_api", ] +[[package]] +name = "spki" +version = "0.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" +dependencies = [ + "base64ct", + "der", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a8f112729512f8e442d81f95a8a7ddf2b7c6b8a1a6f509a95864142b30cab2d3" -[[package]] -name = "standback" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e113fb6f3de07a243d434a56ec6f186dfd51cb08448239fe7bcae73f87ff28ff" -dependencies = [ - "version_check 0.9.4", -] - [[package]] name = "static_assertions" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" -[[package]] -name = "stdweb" -version = "0.4.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d022496b16281348b52d0e30ae99e01a73d737b2f45d38fed4edf79f9325a1d5" -dependencies = [ - "discard", - "rustc_version 0.2.3", - "stdweb-derive", - "stdweb-internal-macros", - "stdweb-internal-runtime", - "wasm-bindgen", -] - -[[package]] -name = "stdweb-derive" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c87a60a40fccc84bef0652345bbbbbe20a605bf5d0ce81719fc476f5c03b50ef" -dependencies = [ - "proc-macro2", - "quote", - "serde", - "serde_derive", - "syn 1.0.109", -] - -[[package]] -name = "stdweb-internal-macros" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58fa5ff6ad0d98d1ffa8cb115892b6e69d67799f6763e162a1c9db421dc22e11" -dependencies = [ - "base-x", - "proc-macro2", - "quote", - "serde", - "serde_derive", - "serde_json", - "sha1 0.6.1", - "syn 1.0.109", -] - -[[package]] -name = "stdweb-internal-runtime" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "213701ba3370744dcd1a12960caa4843b3d68b4d1c0a5d575e0d65b2ee9d16c0" - [[package]] name = "stop-token" version = "0.7.0" @@ -5093,24 +5011,9 @@ dependencies = [ [[package]] name = "time" -version = "0.2.27" +version = "0.3.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4752a97f8eebd6854ff91f1c1824cd6160626ac4bd44287f7f4ea2035a02a242" -dependencies = [ - "const_fn", - "libc", - "standback", - "stdweb", - "time-macros 0.1.1", - "version_check 0.9.4", - "winapi", -] - -[[package]] -name = "time" -version = "0.3.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a79d09ac6b08c1ab3906a2f7cc2e81a0e27c7ae89c63812df75e52bef0751e07" +checksum = "b0fdd63d58b18d663fbdf70e049f00a22c8e42be082203be7f26589213cd75ea" dependencies = [ "deranged", "itoa", @@ -5118,7 +5021,7 @@ dependencies = [ "num_threads", "serde", "time-core", - "time-macros 0.2.12", + "time-macros", ] [[package]] @@ -5129,36 +5032,13 @@ checksum = "7300fbefb4dadc1af235a9cef3737cea692a9d97e1b9cbcd4ebdae6f8868e6fb" [[package]] name = "time-macros" -version = "0.1.1" +version = "0.2.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "957e9c6e26f12cb6d0dd7fc776bb67a706312e7299aed74c8dd5b17ebb27e2f1" -dependencies = [ - "proc-macro-hack", - "time-macros-impl", -] - -[[package]] -name = "time-macros" -version = "0.2.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75c65469ed6b3a4809d987a41eb1dc918e9bc1d92211cbad7ae82931846f7451" +checksum = "eb71511c991639bb078fd5bf97757e03914361c48100d52878b8e52b46fb92cd" dependencies = [ "time-core", ] -[[package]] -name = "time-macros-impl" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fd3c141a1b43194f3f56a1411225df8646c55781d5f26db825b3d98507eb482f" -dependencies = [ - "proc-macro-hack", - "proc-macro2", - "quote", - "standback", - "syn 1.0.109", -] - [[package]] name = "tinyvec" version = "1.6.0" @@ -5409,7 +5289,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09d48f71a791638519505cefafe162606f706c25592e4bde4d97600c0195312e" dependencies = [ "crossbeam-channel", - "time 0.3.26", + "time 0.3.25", "tracing-subscriber", ] @@ -5628,7 +5508,7 @@ dependencies = [ "httparse", "log", "rand 0.8.5", - "sha1 0.10.5", + "sha1", "thiserror", "url", "utf-8", @@ -5693,11 +5573,11 @@ checksum = "39ec24b3121d976906ece63c9daad25b85969647682eee313cb5779fdd69e14e" [[package]] name = "universal-hash" -version = "0.4.1" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f214e8f697e925001e66ec2c6e37a4ef93f0f78c2eed7814394e10c62025b05" +checksum = "fc1de2c688dc15305988b563c3854064043356019f97a4b46276fe734c4f07ea" dependencies = [ - "generic-array 0.14.7", + "crypto-common", "subtle", ] @@ -5777,7 +5657,7 @@ dependencies = [ "cursive_buffered_backend", "cursive_table_view", "data-encoding", - "directories", + "directories 4.0.1", "flexi_logger", "flume", "futures", @@ -5788,7 +5668,7 @@ dependencies = [ "parking_lot 0.12.1", "serde", "serde_derive", - "serial_test", + "serial_test 0.10.0", "stop-token", "thiserror", "tokio", @@ -5805,7 +5685,7 @@ dependencies = [ "async-lock", "async-std", "async-std-resolver", - "async-tls 0.11.0", + "async-tls", "async-tungstenite 0.23.0", "async_executors", "backtrace", @@ -5814,14 +5694,14 @@ dependencies = [ "capnp", "capnpc", "cfg-if 1.0.0", - "chacha20 0.9.1", + "chacha20", "chacha20poly1305", "chrono", "config", "console_error_panic_hook", "curve25519-dalek", "data-encoding", - "directories", + "directories 5.0.1", "ed25519-dalek", "enum-as-inner", "enumset", @@ -5859,14 +5739,14 @@ dependencies = [ "range-set-blaze", "rtnetlink", "rusqlite", - "rustls 0.19.1", - "rustls-pemfile 0.2.1", + "rustls", + "rustls-pemfile", "schemars", "send_wrapper 0.6.0", "serde", "serde-big-array", "serde_json", - "serial_test", + "serial_test 2.0.0", "shell-words", "simplelog", "socket2 0.5.3", @@ -5889,11 +5769,11 @@ dependencies = [ "wasm-logger", "weak-table", "web-sys", - "webpki 0.22.0", + "webpki", "webpki-roots 0.25.2", "wee_alloc", "winapi", - "windows 0.38.0", + "windows 0.51.1", "windows-permissions", "ws_stream_wasm", "x25519-dalek", @@ -5944,7 +5824,7 @@ dependencies = [ "console-subscriber", "ctrlc", "daemonize", - "directories", + "directories 4.0.1", "flume", "futures-util", "hostname", @@ -5959,7 +5839,7 @@ dependencies = [ "serde", "serde_derive", "serde_yaml", - "serial_test", + "serial_test 0.10.0", "signal-hook", "signal-hook-async-std", "stop-token", @@ -6006,12 +5886,12 @@ dependencies = [ "once_cell", "oslog", "paranoid-android", - "parking_lot 0.11.2", - "rand 0.7.3", + "parking_lot 0.12.1", + "rand 0.8.5", + "rand_core 0.6.4", "range-set-blaze", - "rust-fsm", "send_wrapper 0.6.0", - "serial_test", + "serial_test 2.0.0", "simplelog", "static_assertions", "stop-token", @@ -6227,16 +6107,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" @@ -6247,22 +6117,13 @@ dependencies = [ "untrusted", ] -[[package]] -name = "webpki-roots" -version = "0.21.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aabe153544e473b775453675851ecc86863d2a81d786d741f6b76778f2a48940" -dependencies = [ - "webpki 0.21.4", -] - [[package]] name = "webpki-roots" version = "0.22.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6c71e40d7d2c34a5106301fb632274ca37242cd0c9d3e64dbece371a40a2d87" dependencies = [ - "webpki 0.22.0", + "webpki", ] [[package]] @@ -6365,22 +6226,28 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows" -version = "0.38.0" +version = "0.48.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c47017195a790490df51a3e27f669a7d4f285920d90d03ef970c5d886ef0af1" +checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" dependencies = [ - "windows_aarch64_msvc 0.38.0", - "windows_i686_gnu 0.38.0", - "windows_i686_msvc 0.38.0", - "windows_x86_64_gnu 0.38.0", - "windows_x86_64_msvc 0.38.0", + "windows-targets 0.48.5", ] [[package]] name = "windows" -version = "0.48.0" +version = "0.51.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e686886bc078bc1b0b600cac0147aadb815089b6e4da64016cbd754b6342700f" +checksum = "ca229916c5ee38c2f2bc1e9d8f04df975b4bd93f9955dc69fabb5d91270045c9" +dependencies = [ + "windows-core", + "windows-targets 0.48.5", +] + +[[package]] +name = "windows-core" +version = "0.51.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1f8cf84f35d2db49a46868f947758c7a1138116f7fac3bc844f43ade1292e64" dependencies = [ "windows-targets 0.48.5", ] @@ -6466,12 +6333,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" -[[package]] -name = "windows_aarch64_msvc" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b12add87e2fb192fff3f4f7e4342b3694785d79f3a64e2c20d5ceb5ccbcfc3cd" - [[package]] name = "windows_aarch64_msvc" version = "0.42.2" @@ -6484,12 +6345,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" -[[package]] -name = "windows_i686_gnu" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c98f2db372c23965c5e0f43896a8f0316dc0fbe48d1aa65bea9bdd295d43c15" - [[package]] name = "windows_i686_gnu" version = "0.42.2" @@ -6502,12 +6357,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" -[[package]] -name = "windows_i686_msvc" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cdf0569be0f2863ab6a12a6ba841fcfa7d107cbc7545a3ebd57685330db0a3ff" - [[package]] name = "windows_i686_msvc" version = "0.42.2" @@ -6520,12 +6369,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" -[[package]] -name = "windows_x86_64_gnu" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "905858262c8380a36f32cb8c1990d7e7c3b7a8170e58ed9a98ca6d940b7ea9f1" - [[package]] name = "windows_x86_64_gnu" version = "0.42.2" @@ -6550,12 +6393,6 @@ version = "0.48.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" -[[package]] -name = "windows_x86_64_msvc" -version = "0.38.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "890c3c6341d441ffb38f705f47196e3665dc6dd79f6d72fa185d937326730561" - [[package]] name = "windows_x86_64_msvc" version = "0.42.2" @@ -6598,7 +6435,7 @@ dependencies = [ "js-sys", "log", "pharos", - "rustc_version 0.4.0", + "rustc_version", "send_wrapper 0.6.0", "thiserror", "wasm-bindgen", @@ -6630,12 +6467,13 @@ dependencies = [ [[package]] name = "x25519-dalek" -version = "1.2.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2392b6b94a576b4e2bf3c5b2757d63f10ada8020a2e4d08ac849ebcf6ea8e077" +checksum = "fb66477291e7e8d2b0ff1bcb900bf29489a9692816d79874bea351e7a8b6de96" dependencies = [ "curve25519-dalek", - "rand_core 0.5.1", + "rand_core 0.6.4", + "serde", "zeroize", ] @@ -6706,9 +6544,9 @@ dependencies = [ [[package]] name = "zeroize" -version = "1.3.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4756f7db3f7b5574938c3eb1c117038b8e07f95ee6718c0efad4ac21508f1efd" +checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" dependencies = [ "zeroize_derive", ] diff --git a/veilid-core/Cargo.toml b/veilid-core/Cargo.toml index e7651ac0..e5a4f0cf 100644 --- a/veilid-core/Cargo.toml +++ b/veilid-core/Cargo.toml @@ -37,60 +37,60 @@ network-result-extra = ["veilid-tools/network-result-extra"] # Tools veilid-tools = { path = "../veilid-tools", features = [ "tracing" ] } -paste = "1.0.12" -once_cell = "^1" -owning_ref = "^0" -backtrace = { version = "^0" } +paste = "1.0.14" +once_cell = "1.18.0" +owning_ref = "0.4.1" +backtrace = "0.3.68" num-traits = "0.2.15" shell-words = "1.1.0" -static_assertions = "^1" -cfg-if = "^1" -hex = "^0" -lazy_static = "^1" -directories = "^4" +static_assertions = "1.1.0" +cfg-if = "1.0.0" +hex = "0.4.3" +lazy_static = "1.4.0" +directories = "5.0.1" # Logging -tracing = { version = "^0", features = ["log", "attributes"] } -tracing-subscriber = "^0" -tracing-error = "^0" -eyre = "^0" -thiserror = "^1" +tracing = { version = "0.1.37", features = ["log", "attributes"] } +tracing-subscriber = "0.3.17" +tracing-error = "0.2.0" +eyre = "0.6.8" +thiserror = "1.0.47" # Data structures -enumset = { version= "^1", features = ["serde"] } +enumset = { version= "1.1.2", features = ["serde"] } keyvaluedb = { path = "../external/keyvaluedb/keyvaluedb" } -range-set-blaze = "0.1.5" +range-set-blaze = "0.1.9" weak-table = "0.3.2" -generic-array = "^0" +generic-array = "0.14.7" hashlink = { path = "../external/hashlink", features = ["serde_impl"] } # System -futures-util = { version = "^0", default_features = false, features = ["alloc"] } -flume = { version = "^0", features = ["async"] } -parking_lot = "^0" -stop-token = { version = "^0", default-features = false } +futures-util = { version = "0.3.28", default_features = false, features = ["alloc"] } +flume = { version = "0.11.0", features = ["async"] } +parking_lot = "0.12.1" +stop-token = { version = "0.7.0", default-features = false } # Crypto -ed25519-dalek = { version = "^1", default_features = false, features = ["alloc", "u64_backend"] } -x25519-dalek = { version = "^1", default_features = false, features = ["u64_backend"] } -curve25519-dalek = { version = "^3", default_features = false, features = ["alloc", "u64_backend"] } -blake3 = { version = "^1" } -chacha20poly1305 = "^0" -chacha20 = "^0" -argon2 = "0.5.0" +ed25519-dalek = { version = "2.0.0", default_features = false, features = ["alloc", "rand_core", "digest"] } +x25519-dalek = { version = "2.0.0", default_features = false, features = ["alloc", "static_secrets"] } +curve25519-dalek = { version = "4.0.0", default_features = false, features = ["alloc"] } +blake3 = { version = "1.4.1" } +chacha20poly1305 = "0.10.1" +chacha20 = "0.9.1" +argon2 = "0.5.1" # Network -async-std-resolver = { version = "^0", optional = true } -trust-dns-resolver = { version = "^0", optional = true } +async-std-resolver = { version = "0.22.0", optional = true } +trust-dns-resolver = { version = "0.22.0", optional = true } enum-as-inner = "=0.5.1" # temporary fix for trust-dns-resolver v0.22.0 # Serialization -capnp = { version = "^0", default_features = false } -serde = { version = "^1", features = ["derive" ] } -serde_json = { version = "^1" } -serde-big-array = "^0" -json = "^0" -data-encoding = { version = "^2" } +capnp = { version = "0.17.2", default_features = false } +serde = { version = "1.0.183", features = ["derive" ] } +serde_json = { version = "1.0.105" } +serde-big-array = "0.5.1" +json = "0.12.4" +data-encoding = { version = "2.4.0" } schemars = "0.8.12" lz4_flex = { version = "0.11.1", default-features = false, features = ["safe-encode", "safe-decode"] } @@ -99,61 +99,61 @@ lz4_flex = { version = "0.11.1", default-features = false, features = ["safe-enc [target.'cfg(not(target_arch = "wasm32"))'.dependencies] # Tools -config = { version = "^0", features = ["yaml"] } +config = { version = "0.13.3", features = ["yaml"] } bugsalot = { git = "https://github.com/crioux/bugsalot.git" } -chrono = "^0" -libc = "^0" -nix = "^0" +chrono = "0.4.26" +libc = "0.2.147" +nix = "0.26.2" # System -async-std = { version = "^1", features = ["unstable"], optional = true} -tokio = { version = "^1", features = ["full"], optional = true} -tokio-util = { version = "^0", features = ["compat"], optional = true} -tokio-stream = { version = "^0", features = ["net"], optional = true} -async-io = { version = "^1" } -futures-util = { version = "^0", default-features = false, features = ["async-await", "sink", "std", "io"] } +async-std = { version = "1.12.0", features = ["unstable"], optional = true} +tokio = { version = "1.32.0", features = ["full"], optional = true} +tokio-util = { version = "0.7.8", features = ["compat"], optional = true} +tokio-stream = { version = "0.1.14", features = ["net"], optional = true} +async-io = { version = "1.13.0" } +futures-util = { version = "0.3.28", default-features = false, features = ["async-await", "sink", "std", "io"] } # Data structures keyring-manager = { path = "../external/keyring-manager" } keyvaluedb-sqlite = { path = "../external/keyvaluedb/keyvaluedb-sqlite" } # Network -async-tungstenite = { version = "^0", features = ["async-tls"] } +async-tungstenite = { version = "0.23.0", features = ["async-tls"] } igd = { path = "../external/rust-igd" } -async-tls = "^0.11" -webpki = "^0" -webpki-roots = "^0" -rustls = "^0.19" -rustls-pemfile = "^0.2" -socket2 = { version = "^0", features = ["all"] } +async-tls = "0.12.0" +webpki = "0.22.0" +webpki-roots = "0.25.2" +rustls = "0.20.8" +rustls-pemfile = "1.0.3" +socket2 = { version = "0.5.3", features = ["all"] } # Dependencies for WASM builds only [target.'cfg(target_arch = "wasm32")'.dependencies] # Tools -getrandom = { version = "^0", features = ["js"] } +getrandom = { version = "0.2.4", features = ["js"] } # System -async_executors = { version = "^0", default-features = false, features = [ "bindgen", "timer" ]} -async-lock = "^2" -wasm-bindgen = "^0" -js-sys = "^0" -wasm-bindgen-futures = "^0" -send_wrapper = { version = "^0", features = ["futures"] } +async_executors = { version = "0.7.0", default-features = false, features = [ "bindgen", "timer" ]} +async-lock = "2.8.0" +wasm-bindgen = "0.2.87" +js-sys = "0.3.64" +wasm-bindgen-futures = "0.4.37" +send_wrapper = { version = "0.6.0", features = ["futures"] } # Network -ws_stream_wasm = "^0" +ws_stream_wasm = "0.7.4" # Logging -wasm-logger = "^0" -tracing-wasm = "^0" +wasm-logger = "0.2.0" +tracing-wasm = "0.2.1" # Data Structures keyvaluedb-web = { path = "../external/keyvaluedb/keyvaluedb-web" } ### Configuration for WASM32 'web-sys' crate [target.'cfg(target_arch = "wasm32")'.dependencies.web-sys] -version = "^0" +version = "0.3.64" features = [ 'Document', 'HtmlDocument', @@ -169,15 +169,15 @@ features = [ # Dependencies for Android [target.'cfg(target_os = "android")'.dependencies] -jni = "^0" -jni-sys = "^0" -ndk = { version = "^0.7" } -ndk-glue = { version = "^0.7", features = ["logger"] } -paranoid-android = { version = "^0", optional = true } +jni = "0.21.1" +jni-sys = "0.3.0" +ndk = { version = "0.7.0" } +ndk-glue = { version = "0.7.0", features = ["logger"] } +paranoid-android = { version = "0.2.1", optional = true } # Dependenices for all Unix (Linux, Android, MacOS, iOS) [target.'cfg(unix)'.dependencies] -ifstructs = "^0" +ifstructs = "0.1.1" # Dependencies for Linux or Android [target.'cfg(any(target_os = "android", target_os = "linux"))'.dependencies] @@ -187,38 +187,38 @@ netlink-packet-route = { version = "=0.17.0" } # Dependencies for Windows [target.'cfg(target_os = "windows")'.dependencies] -winapi = { version = "^0", features = [ "iptypes", "iphlpapi" ] } -windows = { version = "^0", features = [ "Win32_NetworkManagement_Dns", "Win32_Foundation", "alloc" ]} -windows-permissions = "^0" +winapi = { version = "0.3.9", features = [ "iptypes", "iphlpapi" ] } +windows = { version = "0.51.1", features = [ "Win32_NetworkManagement_Dns", "Win32_Foundation" ]} +windows-permissions = "0.2.4" # Dependencies for iOS [target.'cfg(target_os = "ios")'.dependencies] -tracing-oslog = { version = "^0", optional = true } +tracing-oslog = { version = "0.1.2", optional = true } # Rusqlite configuration to ensure platforms that don't come with sqlite get it bundled # Except WASM which doesn't use sqlite [target.'cfg(all(not(target_os = "ios"),not(target_os = "android"),not(target_arch = "wasm32")))'.dependencies.rusqlite] -version = "^0" +version = "0.29.0" features = ["bundled"] ### DEV DEPENDENCIES [dev-dependencies] -serial_test = "^0" +serial_test = "2.0.0" [target.'cfg(not(target_arch = "wasm32"))'.dev-dependencies] -simplelog = { version = "^0", features=["test"] } +simplelog = { version = "0.12.1", features=["test"] } [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -wasm-bindgen-test = "^0" -console_error_panic_hook = "^0" -wee_alloc = "^0" -wasm-logger = "^0" +wasm-bindgen-test = "0.3.37" +console_error_panic_hook = "0.1.7" +wee_alloc = "0.4.5" +wasm-logger = "0.2.0" ### BUILD OPTIONS [build-dependencies] -capnpc = "^0" +capnpc = "0.17.2" [package.metadata.wasm-pack.profile.release] wasm-opt = ["-O", "--enable-mutable-globals"] diff --git a/veilid-core/src/crypto/blake3digest512.rs b/veilid-core/src/crypto/blake3digest512.rs index 1334f313..3acf65bc 100644 --- a/veilid-core/src/crypto/blake3digest512.rs +++ b/veilid-core/src/crypto/blake3digest512.rs @@ -1,29 +1,66 @@ use curve25519_dalek::digest::generic_array::typenum::U64; -use curve25519_dalek::digest::{Digest, Output}; +use curve25519_dalek::digest::{ + Digest, FixedOutput, FixedOutputReset, Output, OutputSizeUser, Reset, Update, +}; use generic_array::GenericArray; pub struct Blake3Digest512 { dig: blake3::Hasher, } -impl Digest for Blake3Digest512 { +impl OutputSizeUser for Blake3Digest512 { type OutputSize = U64; +} +impl Update for Blake3Digest512 { + fn update(&mut self, data: &[u8]) { + self.dig.update(data); + } +} + +impl FixedOutput for Blake3Digest512 { + fn finalize_into(self, out: &mut Output) { + let mut b = [0u8; 64]; + self.dig.finalize_xof().fill(&mut b); + for n in 0..64 { + out[n] = b[n]; + } + } +} + +impl Reset for Blake3Digest512 { + fn reset(&mut self) { + self.dig.reset(); + } +} + +impl FixedOutputReset for Blake3Digest512 { + fn finalize_into_reset(&mut self, out: &mut Output) { + let mut b = [0u8; 64]; + self.dig.finalize_xof().fill(&mut b); + for n in 0..64 { + out[n] = b[n]; + } + self.dig.reset(); + } +} + +impl Digest for Blake3Digest512 { fn new() -> Self { Self { dig: blake3::Hasher::new(), } } - fn update(&mut self, data: impl AsRef<[u8]>) { - self.dig.update(data.as_ref()); + fn new_with_prefix(data: impl AsRef<[u8]>) -> Self { + Self::new().chain_update(data) } - fn chain(mut self, data: impl AsRef<[u8]>) -> Self + fn chain_update(mut self, data: impl AsRef<[u8]>) -> Self where Self: Sized, { - self.update(data); + ::update(&mut self, data.as_ref()); self } @@ -44,21 +81,17 @@ impl Digest for Blake3Digest512 { for n in 0..64 { out[n] = b[n]; } - self.reset(); - out - } - - fn reset(&mut self) { self.dig.reset(); + out } fn output_size() -> usize { 64 } - fn digest(data: &[u8]) -> Output { + fn digest(data: impl AsRef<[u8]>) -> Output { let mut dig = blake3::Hasher::new(); - dig.update(data); + dig.update(data.as_ref()); let mut b = [0u8; 64]; dig.finalize_xof().fill(&mut b); let mut out = GenericArray::::default(); @@ -67,4 +100,26 @@ impl Digest for Blake3Digest512 { } out } + + fn update(&mut self, data: impl AsRef<[u8]>) { + ::update(self, data.as_ref()) + } + + fn finalize_into(self, out: &mut Output) { + ::finalize_into(self, out) + } + + fn finalize_into_reset(&mut self, out: &mut Output) + where + Self: FixedOutputReset, + { + ::finalize_into_reset(self, out) + } + + fn reset(&mut self) + where + Self: Reset, + { + ::reset(self); + } } diff --git a/veilid-core/src/crypto/vld0/mod.rs b/veilid-core/src/crypto/vld0/mod.rs index e13ec49d..acc36fa4 100644 --- a/veilid-core/src/crypto/vld0/mod.rs +++ b/veilid-core/src/crypto/vld0/mod.rs @@ -7,9 +7,9 @@ use argon2::{ use chacha20::cipher::{KeyIvInit, StreamCipher}; use chacha20::XChaCha20; use chacha20poly1305 as ch; -use chacha20poly1305::aead::{AeadInPlace, NewAead}; +use chacha20poly1305::aead::AeadInPlace; +use chacha20poly1305::KeyInit; use core::convert::TryInto; -use curve25519_dalek as cd; use curve25519_dalek::digest::Digest; use ed25519_dalek as ed; use x25519_dalek as xd; @@ -17,27 +17,27 @@ use x25519_dalek as xd; const AEAD_OVERHEAD: usize = 16; pub const CRYPTO_KIND_VLD0: CryptoKind = FourCC(*b"VLD0"); -fn ed25519_to_x25519_pk(key: &ed::PublicKey) -> VeilidAPIResult { - let bytes = key.to_bytes(); - let compressed = cd::edwards::CompressedEdwardsY(bytes); - let point = compressed - .decompress() - .ok_or_else(|| VeilidAPIError::internal("ed25519_to_x25519_pk failed"))?; - let mp = point.to_montgomery(); +fn ed25519_to_x25519_pk(key: &ed::VerifyingKey) -> VeilidAPIResult { + let mp = key.to_montgomery(); Ok(xd::PublicKey::from(mp.to_bytes())) } -fn ed25519_to_x25519_sk(key: &ed::SecretKey) -> VeilidAPIResult { - let exp = ed::ExpandedSecretKey::from(key); - let bytes: [u8; ed::EXPANDED_SECRET_KEY_LENGTH] = exp.to_bytes(); - let lowbytes: [u8; 32] = bytes[0..32].try_into().map_err(VeilidAPIError::internal)?; - Ok(xd::StaticSecret::from(lowbytes)) +fn ed25519_to_x25519_sk(key: &ed::SigningKey) -> VeilidAPIResult { + Ok(xd::StaticSecret::from(*key.to_scalar().as_bytes())) } pub fn vld0_generate_keypair() -> KeyPair { let mut csprng = VeilidRng {}; - let keypair = ed::Keypair::generate(&mut csprng); - let dht_key = PublicKey::new(keypair.public.to_bytes()); - let dht_key_secret = SecretKey::new(keypair.secret.to_bytes()); + let keypair = ed::SigningKey::generate(&mut csprng); + let dht_key = PublicKey::new( + keypair.to_keypair_bytes()[ed::SECRET_KEY_LENGTH..] + .try_into() + .expect("should fit"), + ); + let dht_key_secret = SecretKey::new( + keypair.to_keypair_bytes()[0..ed::SECRET_KEY_LENGTH] + .try_into() + .expect("should fit"), + ); KeyPair::new(dht_key, dht_key_secret) } @@ -130,9 +130,9 @@ impl CryptoSystem for CryptoSystemVLD0 { SharedSecret::new(s) } fn compute_dh(&self, key: &PublicKey, secret: &SecretKey) -> VeilidAPIResult { - let pk_ed = ed::PublicKey::from_bytes(&key.bytes).map_err(VeilidAPIError::internal)?; + let pk_ed = ed::VerifyingKey::from_bytes(&key.bytes).map_err(VeilidAPIError::internal)?; let pk_xd = ed25519_to_x25519_pk(&pk_ed)?; - let sk_ed = ed::SecretKey::from_bytes(&secret.bytes).map_err(VeilidAPIError::internal)?; + let sk_ed = ed::SigningKey::from_bytes(&secret.bytes); let sk_xd = ed25519_to_x25519_sk(&sk_ed)?; Ok(SharedSecret::new(sk_xd.diffie_hellman(&pk_xd).to_bytes())) } @@ -197,7 +197,7 @@ impl CryptoSystem for CryptoSystemVLD0 { kpb[..SECRET_KEY_LENGTH].copy_from_slice(&dht_key_secret.bytes); kpb[SECRET_KEY_LENGTH..].copy_from_slice(&dht_key.bytes); - let keypair = ed::Keypair::from_bytes(&kpb) + let keypair = ed::SigningKey::from_keypair_bytes(&kpb) .map_err(|e| VeilidAPIError::parse_error("Keypair is invalid", e))?; let mut dig = Blake3Digest512::new(); @@ -219,11 +219,9 @@ impl CryptoSystem for CryptoSystemVLD0 { data: &[u8], signature: &Signature, ) -> VeilidAPIResult<()> { - let pk = ed::PublicKey::from_bytes(&dht_key.bytes) + let pk = ed::VerifyingKey::from_bytes(&dht_key.bytes) .map_err(|e| VeilidAPIError::parse_error("Public key is invalid", e))?; - let sig = ed::Signature::from_bytes(&signature.bytes) - .map_err(|e| VeilidAPIError::parse_error("Signature is invalid", e))?; - + let sig = ed::Signature::from_bytes(&signature.bytes); let mut dig = Blake3Digest512::new(); dig.update(data); @@ -302,7 +300,7 @@ impl CryptoSystem for CryptoSystemVLD0 { nonce: &[u8; NONCE_LENGTH], shared_secret: &SharedSecret, ) { - let mut cipher = XChaCha20::new(&shared_secret.bytes.into(), nonce.into()); + let mut cipher = ::new(&shared_secret.bytes.into(), nonce.into()); cipher.apply_keystream(body); } @@ -313,7 +311,7 @@ impl CryptoSystem for CryptoSystemVLD0 { nonce: &[u8; NONCE_LENGTH], shared_secret: &SharedSecret, ) { - let mut cipher = XChaCha20::new(&shared_secret.bytes.into(), nonce.into()); + let mut cipher = ::new(&shared_secret.bytes.into(), nonce.into()); cipher.apply_keystream_b2b(in_buf, out_buf).unwrap(); } diff --git a/veilid-core/src/network_manager/native/mod.rs b/veilid-core/src/network_manager/native/mod.rs index 4611dc3b..6dec051e 100644 --- a/veilid-core/src/network_manager/native/mod.rs +++ b/veilid-core/src/network_manager/native/mod.rs @@ -17,12 +17,10 @@ pub use protocol::*; use async_tls::TlsAcceptor; use futures_util::StreamExt; -use std::io; -// xxx: rustls ^0.20 -//use rustls::{server::NoClientAuth, Certificate, PrivateKey, ServerConfig}; -use rustls::{Certificate, NoClientAuth, PrivateKey, ServerConfig}; +use rustls::{Certificate, PrivateKey, ServerConfig}; use rustls_pemfile::{certs, pkcs8_private_keys, rsa_private_keys}; use std::fs::File; +use std::io; use std::io::BufReader; use std::path::{Path, PathBuf}; @@ -295,15 +293,10 @@ impl Network { return Err(io::Error::new(io::ErrorKind::InvalidInput, format!("Private key at {} could not be loaded.\nEnsure it is unencrypted and in RSA or PKCS8 format, beginning with '-----BEGIN RSA PRIVATE KEY-----' or '-----BEGIN PRIVATE KEY-----'",c.network.tls.private_key_path))); } - // xxx: rustls ^0.20 - // let mut config = ServerConfig::builder() - // .with_safe_defaults() - // .with_no_client_auth() - // .with_single_cert(certs, keys.remove(0)) - // .map_err(|err| io::Error::new(io::ErrorKind::InvalidInput, err))?; - let mut config = ServerConfig::new(NoClientAuth::new()); - config - .set_single_cert(certs, keys.remove(0)) + let config = ServerConfig::builder() + .with_safe_defaults() + .with_no_client_auth() + .with_single_cert(certs, keys.remove(0)) .map_err(|err| io::Error::new(io::ErrorKind::InvalidInput, err))?; Ok(config) diff --git a/veilid-tools/Cargo.toml b/veilid-tools/Cargo.toml index fdd23963..cc227617 100644 --- a/veilid-tools/Cargo.toml +++ b/veilid-tools/Cargo.toml @@ -22,54 +22,54 @@ network-result-extra = [] network-result-info = [] [dependencies] -tracing = { version = "^0", features = ["log", "attributes"], optional = true } -tracing-subscriber = { version = "^0", optional = true } -log = { version = "^0" } -eyre = "^0" -static_assertions = "^1" -cfg-if = "^1" -thiserror = "^1" -futures-util = { version = "^0", default_features = false, features = ["alloc"] } -parking_lot = "^0" -once_cell = "^1" -stop-token = { version = "^0", default-features = false } -rand = "^0.7" -rust-fsm = "^0" -backtrace = "^0" -fn_name = "^0" -range-set-blaze = "0.1.5" -flume = { version = "^0", features = ["async"] } +tracing = { version = "0.1.37", features = ["log", "attributes"], optional = true } +tracing-subscriber = { version = "0.3.17", optional = true } +log = { version = "0.4.20" } +eyre = "0.6.8" +static_assertions = "1.1.0" +cfg-if = "1.0.0" +thiserror = "1.0.47" +futures-util = { version = "0.3.28", default_features = false, features = ["alloc"] } +parking_lot = "0.12.1" +once_cell = "1.18.0" +stop-token = { version = "0.7.0", default-features = false } +rand = "0.8.5" +rand_core = "0.6.4" +backtrace = "0.3.68" +fn_name = "0.1.0" +range-set-blaze = "0.1.9" +flume = { version = "0.11.0", features = ["async"] } # Dependencies for native builds only # Linux, Windows, Mac, iOS, Android [target.'cfg(not(target_arch = "wasm32"))'.dependencies] -async-std = { version = "^1", features = ["unstable"], optional = true} -tokio = { version = "^1", features = ["full"], optional = true} -tokio-util = { version = "^0", features = ["compat"], optional = true} -futures-util = { version = "^0", default-features = false, features = ["async-await", "sink", "std", "io"] } -chrono = "^0" +async-std = { version = "1.12.0", features = ["unstable"], optional = true} +tokio = { version = "1.32.0", features = ["full"], optional = true} +tokio-util = { version = "0.7.8", features = ["compat"], optional = true} +futures-util = { version = "0.3.28", default-features = false, features = ["async-await", "sink", "std", "io"] } +chrono = "0.4.26" -libc = "^0" -nix = "^0" +libc = "0.2.147" +nix = "0.26.2" # Dependencies for WASM builds only [target.'cfg(target_arch = "wasm32")'.dependencies] -wasm-bindgen = "^0" -js-sys = "^0" -wasm-bindgen-futures = "^0" -async_executors = { version = "^0", default-features = false} -async-lock = "^2" -send_wrapper = { version = "^0.6", features = ["futures"] } +wasm-bindgen = "0.2.87" +js-sys = "0.3.64" +wasm-bindgen-futures = "0.4.37" +async_executors = { version = "0.7.0", default-features = false} +async-lock = "2.8.0" +send_wrapper = { version = "0.6.0", features = ["futures"] } # Dependencies for Android [target.'cfg(target_os = "android")'.dependencies] -jni = "^0" -jni-sys = "^0" -ndk = { version = "^0.7" } -ndk-glue = { version = "^0.7", features = ["logger"] } -lazy_static = "^1.4.0" -paranoid-android = { version = "^0", optional = true } -android-logd-logger = "0.2.1" +jni = "0.21.1" +jni-sys = "0.3.0" +ndk = { version = "0.7.0" } +ndk-glue = { version = "0.7.0", features = ["logger"] } +lazy_static = "1.4.0" +paranoid-android = { version = "0.2.1", optional = true } +android-logd-logger = "0.4.2" # Dependencies for Windows # [target.'cfg(target_os = "windows")'.dependencies] @@ -78,22 +78,21 @@ android-logd-logger = "0.2.1" # Dependencies for iOS [target.'cfg(target_os = "ios")'.dependencies] -oslog = { version = "^0", optional = true } -tracing-oslog = { version = "^0", optional = true } +oslog = { version = "0.2.0", optional = true } +tracing-oslog = { version = "0.1.2", optional = true } ### DEV DEPENDENCIES [dev-dependencies] -serial_test = "^0" -simplelog = { version = "^0.12", features = [ "test" ] } +serial_test = "^2.0.0" +simplelog = { version = "0.12.1", features = [ "test" ] } [target.'cfg(target_arch = "wasm32")'.dev-dependencies] -console_error_panic_hook = "^0" -wasm-bindgen-test = "^0" -wee_alloc = "^0" -wasm-logger = "^0" -tracing-wasm = { version = "^0" } -parking_lot = { version = "^0", features = ["wasm-bindgen"]} +console_error_panic_hook = "0.1.7" +wasm-bindgen-test = "0.3.37" +wee_alloc = "0.4.5" +wasm-logger = "0.2.0" +tracing-wasm = { version = "0.2.1" } ### BUILD OPTIONS diff --git a/veilid-tools/src/callback_state_machine.rs b/veilid-tools/src/callback_state_machine.rs deleted file mode 100644 index 238ac43f..00000000 --- a/veilid-tools/src/callback_state_machine.rs +++ /dev/null @@ -1,102 +0,0 @@ -use super::*; -pub use rust_fsm; -pub use rust_fsm::*; - -pub type StateChangeCallback = Arc< - dyn Fn(::State, ::State) + Send + Sync + 'static, ->; - -struct CallbackStateMachineInner -where - T: StateMachineImpl, - T::State: Copy + Unpin + core::fmt::Debug, -{ - state: T::State, - callback: Option>, - eventual: EventualValueClone, -} - -impl core::fmt::Debug for CallbackStateMachineInner -where - T: StateMachineImpl, - T::State: Copy + Unpin + core::fmt::Debug, -{ - fn fmt(&self, f: &mut ::core::fmt::Formatter<'_>) -> ::core::fmt::Result { - write!(f, "CallbackStateMachineInner(state: {:?})", self.state) - } -} - -#[derive(Debug, Clone)] -pub struct CallbackStateMachine -where - T: StateMachineImpl, - T::State: Copy + Unpin + core::fmt::Debug, -{ - inner: Arc>>, -} - -impl CallbackStateMachine -where - T: StateMachineImpl, - T::State: Copy + Unpin + core::fmt::Debug, -{ - pub fn new() -> Self { - Self { - inner: Arc::new(Mutex::new(CallbackStateMachineInner { - state: T::INITIAL_STATE, - callback: None, - eventual: EventualValueClone::new(), - })), - } - } - - pub fn set_state_change_callback(&self, callback: StateChangeCallback) { - self.inner.lock().callback = Some(callback); - } - - pub fn clear_state_change_callback(&self) { - self.inner.lock().callback = None; - } - - pub fn state_eventual_instance(&self) -> (T::State, EventualValueCloneFuture) { - let inner = self.inner.lock(); - (inner.state, inner.eventual.instance()) - } - - pub async fn consume(&self, input: &T::Input) -> Result, ()> { - let current_state = self.inner.lock().state; - - if let Some(new_state) = T::transition(¤t_state, input) { - let output = T::output(¤t_state, input); - let old_state = current_state; - let (callback, eventual) = { - let mut inner = self.inner.lock(); - inner.state = new_state; - let eventual = - core::mem::replace(&mut inner.eventual, EventualValueClone::::new()); - (inner.callback.clone(), eventual) - }; - if let Some(cb) = callback { - cb(old_state, new_state); - } - eventual.resolve(new_state).await; - Ok(output) - } else { - Err(()) - } - } - - pub fn state(&self) -> T::State { - self.inner.lock().state - } -} - -impl Default for CallbackStateMachine -where - T: StateMachineImpl, - T::State: Copy + Unpin + core::fmt::Debug, -{ - fn default() -> Self { - Self::new() - } -} diff --git a/veilid-tools/src/lib.rs b/veilid-tools/src/lib.rs index a2844887..55a0a6dc 100644 --- a/veilid-tools/src/lib.rs +++ b/veilid-tools/src/lib.rs @@ -2,7 +2,6 @@ mod assembly_buffer; mod async_peek_stream; mod async_tag_lock; -mod callback_state_machine; mod clone_stream; mod eventual; mod eventual_base; @@ -92,7 +91,6 @@ cfg_if! { pub use assembly_buffer::*; pub use async_peek_stream::*; pub use async_tag_lock::*; -pub use callback_state_machine::*; pub use clone_stream::*; pub use eventual::*; pub use eventual_base::{EventualCommon, EventualResolvedFuture};