diff --git a/Cargo.lock b/Cargo.lock index d1ae0931..0c65a866 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4,26 +4,26 @@ version = 3 [[package]] name = "aho-corasick" -version = "1.1.2" +version = "1.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2969dcb958b36655471fc61f7e416fa76033bdd4bfed0678d8fee1e2d07a1f0" +checksum = "8e60d3430d3a69478ad0993f19238d2df97c507009a52b3c10addcd7f6bcb916" dependencies = [ "memchr", ] [[package]] name = "autocfg" -version = "1.1.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" [[package]] name = "bindgen" -version = "0.70.1" +version = "0.72.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f49d8fed880d473ea71efb9bf597651e77201bdd4893efe54c9e5d65ae04ce6f" +checksum = "4f72209734318d0b619a5e0f5129918b848c416e122a3c4ce054e03cb87b726f" dependencies = [ - "bitflags 2.4.2", + "bitflags", "cexpr", "clang-sys", "itertools", @@ -34,20 +34,14 @@ dependencies = [ "regex", "rustc-hash", "shlex", - "syn 2.0.50", + "syn", ] [[package]] name = "bitflags" -version = "1.3.2" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed570934406eb16438a4e976b1b4500774099c13b8cb96eec99f620f05090ddf" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "cexpr" @@ -60,15 +54,15 @@ dependencies = [ [[package]] name = "cfg-if" -version = "1.0.0" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" [[package]] name = "clang-sys" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67523a3b4be3ce1989d607a828d036249522dd9c1c8de7f4dd2dae43a37369d1" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" dependencies = [ "glob", "libc", @@ -79,12 +73,10 @@ dependencies = [ name = "cryptoki" version = "0.10.0" dependencies = [ - "bitflags 1.3.2", + "bitflags", "cryptoki-sys", - "hex", "libloading", "log", - "num-traits", "paste", "secrecy", "serial_test", @@ -101,67 +93,123 @@ dependencies = [ [[package]] name = "either" -version = "1.10.0" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11157ac094ffbdde99aa67b23417ebdd801842852b500e395a45a9c0aac03e4a" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" [[package]] -name = "glob" -version = "0.3.1" +name = "futures" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "65bc07b1a8bc7c85c5f2e110c476c7389b4554ba72af57d8445ea63a576b0876" +dependencies = [ + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] [[package]] -name = "hex" -version = "0.4.3" +name = "futures-channel" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +checksum = "2dff15bf788c671c1934e366d07e30c1814a8ef514e1af724a602e8a2fbe1b10" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05f29059c0c2090612e8d742178b0580d2dc940c837851ad723096f87af6663e" [[package]] -name = "instant" -version = "0.1.12" +name = "futures-executor" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" +checksum = "1e28d1d997f585e54aebc3f97d39e72338912123a67330d723fdbb564d646c9f" dependencies = [ - "cfg-if", + "futures-core", + "futures-task", + "futures-util", ] [[package]] -name = "itertools" -version = "0.12.1" +name = "futures-io" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" + +[[package]] +name = "futures-sink" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e575fab7d1e0dcb8d0c7bcf9a63ee213816ab51902e6d244a95819acacf1d4f7" + +[[package]] +name = "futures-task" +version = "0.3.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +checksum = "f90f7dce0722e95104fcb095585910c0977252f286e354b5e3bd38902cd99988" + +[[package]] +name = "futures-util" +version = "0.3.31" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fa08315bb612088cc391249efdc3bc77536f16c91f6cf495e6fbe85b20a4a81" dependencies = [ - "either", + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", ] [[package]] -name = "lazy_static" -version = "1.4.0" +name = "glob" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" + +[[package]] +name = "itertools" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" +dependencies = [ + "either", +] [[package]] name = "libc" -version = "0.2.153" +version = "0.2.174" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c198f91728a82281a64e1f4f9eeb25d82cb32a5de251c6bd1b5154d63a8e7bd" +checksum = "1171693293099992e19cddea4e8b849964e9846f4acee11b3948bcc337be8776" [[package]] name = "libloading" -version = "0.8.6" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fc2f4eb4bc735547cfed7c0a4922cbd04a4655978c09b54f1f7b228750664c34" +checksum = "07033963ba89ebaf1584d767badaa2e8fcec21aedea6b8c0346d487d49c28667" dependencies = [ "cfg-if", - "windows-targets", + "windows-targets 0.53.2", ] [[package]] name = "lock_api" -version = "0.4.11" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c168f8615b12bc01f9c17e2eb0cc07dcae1940121185446edc3744920e8ef45" +checksum = "96936507f153605bddfcda068dd804796c84324ed2510809e5b2a624c81da765" dependencies = [ "autocfg", "scopeguard", @@ -169,15 +217,15 @@ dependencies = [ [[package]] name = "log" -version = "0.4.20" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5e6163cb8c49088c2c36f57875e58ccd8c87c7427f7fbd50ea6710b2f3f2e8f" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" [[package]] name = "memchr" -version = "2.7.1" +version = "2.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "523dc4f511e55ab87b694dc30d0f820d60906ef06413f93d4d7a1385599cc149" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" [[package]] name = "minimal-lexical" @@ -196,87 +244,94 @@ dependencies = [ ] [[package]] -name = "num-traits" -version = "0.2.18" +name = "once_cell" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0df0e5185db44f69b44f26786fe401b6c293d1907744beaa7fa62b2e5a517a" -dependencies = [ - "autocfg", -] +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "parking_lot" -version = "0.11.2" +version = "0.12.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d17b78036a60663b797adeaee46f5c9dfebb86948d1255007a1d6be0271ff99" +checksum = "70d58bf43669b5795d1576d0641cfb6fbb2057bf629506267a92807158584a13" dependencies = [ - "instant", "lock_api", "parking_lot_core", ] [[package]] name = "parking_lot_core" -version = "0.8.6" +version = "0.9.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a2cfe6f0ad2bfc16aefa463b497d5c7a5ecd44a23efa72aa342d90177356dc" +checksum = "bc838d2a56b5b1a6c25f55575dfc605fabb63bb2365f6c2353ef9159aa69e4a5" dependencies = [ "cfg-if", - "instant", "libc", "redox_syscall", "smallvec", - "winapi", + "windows-targets 0.52.6", ] [[package]] name = "paste" -version = "1.0.14" +version = "1.0.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "de3145af08024dea9fa9914f381a17b8fc6034dfb00f3a84013f7ff43f29ed4c" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] -name = "prettyplease" +name = "pin-project-lite" version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a41cf62165e97c7f814d2221421dbb9afcbcdb0a88068e5ea206e19951c2cbb5" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "prettyplease" +version = "0.2.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "061c1221631e079b26479d25bbf2275bfe5917ae8419cd7e34f13bfc2aa7539a" dependencies = [ "proc-macro2", - "syn 2.0.50", + "syn", ] [[package]] name = "proc-macro2" -version = "1.0.78" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2422ad645d89c99f8f3e6b88a9fdeca7fabeac836b1002371c4367c8f984aae" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "quote" -version = "1.0.35" +version = "1.0.40" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "291ec9ab5efd934aaf503a6466c5d5251535d108ee747472c3977cc5acc868ef" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" dependencies = [ "proc-macro2", ] [[package]] name = "redox_syscall" -version = "0.2.16" +version = "0.5.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" +checksum = "0d04b7d0ee6b4a0207a0a7adb104d23ecb0b47d6beae7152d0fa34b692b29fd6" dependencies = [ - "bitflags 1.3.2", + "bitflags", ] [[package]] name = "regex" -version = "1.10.3" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b62dbe01f0b06f9d8dc7d49e05a0785f153b00b2c227856282f671e0318c9b15" +checksum = "b544ef1b4eac5dc2db33ea63606ae9ffcfac26c1416a2806ae0bf5f56b201191" dependencies = [ "aho-corasick", "memchr", @@ -286,9 +341,9 @@ dependencies = [ [[package]] name = "regex-automata" -version = "0.4.5" +version = "0.4.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5bb987efffd3c6d0d8f5f89510bb458559eab11e4f869acb20bf845e016259cd" +checksum = "809e8dc61f6de73b46c85f4c96486310fe304c434cfa43669d7b40f711150908" dependencies = [ "aho-corasick", "memchr", @@ -297,15 +352,24 @@ dependencies = [ [[package]] name = "regex-syntax" -version = "0.8.2" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c08c74e62047bb2de4ff487b251e4a92e24f48745648451635cec7d591162d9f" +checksum = "2b15c43186be67a4fd63bee50d0303afffcef381492ebe2c5d87f324e1b8815c" [[package]] name = "rustc-hash" -version = "1.1.0" +version = "2.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + +[[package]] +name = "scc" +version = "2.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "22b2d775fb28f245817589471dd49c5edf64237f4a19d10ce9a92ff4651a27f4" +dependencies = [ + "sdd", +] [[package]] name = "scopeguard" @@ -313,6 +377,12 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" +[[package]] +name = "sdd" +version = "3.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "584e070911c7017da6cb2eb0788d09f43d789029b5877d3e5ecc8acf86ceee21" + [[package]] name = "secrecy" version = "0.10.3" @@ -325,44 +395,47 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.197" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3fb1c873e1b9b056a4dc4c0c198b24c3ffa059243875552b2bd0933b1aee4ce2" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] [[package]] name = "serde_derive" -version = "1.0.197" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7eb0b34b42edc17f6b7cac84a52a1c5f0e1bb2227e997ca9011ea3dd34e8610b" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.50", + "syn", ] [[package]] name = "serial_test" -version = "0.5.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0bccbcf40c8938196944a3da0e133e031a33f4d6b72db3bda3cc556e361905d" +checksum = "1b258109f244e1d6891bf1053a55d63a5cd4f8f4c30cf9a1280989f80e7a1fa9" dependencies = [ - "lazy_static", + "futures", + "log", + "once_cell", "parking_lot", + "scc", "serial_test_derive", ] [[package]] name = "serial_test_derive" -version = "0.5.1" +version = "3.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2acd6defeddb41eb60bb468f8825d0cfd0c2a76bc03bfd235b6a1dc4f6a1ad5" +checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn", ] [[package]] @@ -372,27 +445,22 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] -name = "smallvec" -version = "1.13.1" +name = "slab" +version = "0.4.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6ecd384b10a64542d77071bd64bd7b231f4ed5940fba55e98c3de13824cf3d7" +checksum = "04dc19736151f35336d325007ac991178d504a119863a2fcb3758cdb5e52c50d" [[package]] -name = "syn" -version = "1.0.109" +name = "smallvec" +version = "1.15.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" [[package]] name = "syn" -version = "2.0.50" +version = "2.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "74f1bdc9872430ce9b75da68329d1c1746faf50ffac5f19e02b71e37ff881ffb" +checksum = "17b6f705963418cdb9927482fa304bc562ece2fdd4f616084c50b7023b435a40" dependencies = [ "proc-macro2", "quote", @@ -407,91 +475,140 @@ checksum = "614b328ff036a4ef882c61570f72918f7e9c5bee1da33f8e7f91e01daee7e56c" [[package]] name = "unicode-ident" -version = "1.0.12" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3354b9ac3fae1ff6755cb6db53683adb661634f67557942dea4facebec0fee4b" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] -name = "winapi" -version = "0.3.9" +name = "windows-targets" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "9b724f72796e036ab90c1021d4780d4d3d648aca59e491e6b98e725b84e99973" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "windows_aarch64_gnullvm 0.52.6", + "windows_aarch64_msvc 0.52.6", + "windows_i686_gnu 0.52.6", + "windows_i686_gnullvm 0.52.6", + "windows_i686_msvc 0.52.6", + "windows_x86_64_gnu 0.52.6", + "windows_x86_64_gnullvm 0.52.6", + "windows_x86_64_msvc 0.52.6", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "windows-targets" +version = "0.53.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "c66f69fcc9ce11da9966ddb31a40968cad001c5bedeb5c2b82ede4253ab48aef" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "windows_aarch64_gnullvm" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" [[package]] -name = "windows-targets" -version = "0.48.5" +name = "windows_aarch64_gnullvm" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9a2fa6e2155d7247be68c096456083145c183cbbbc2764150dda45a87197940c" -dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", -] +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" [[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.5" +name = "windows_aarch64_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b38e32f0abccf9987a4e3079dfb67dcd799fb61361e53e2882c3cbaf0d905d8" +checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" [[package]] name = "windows_aarch64_msvc" -version = "0.48.5" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + +[[package]] +name = "windows_i686_gnu" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc35310971f3b2dbbf3f0690a219f40e2d9afcf64f9ab7cc1be722937c26b4bc" +checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" [[package]] name = "windows_i686_gnu" -version = "0.48.5" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" + +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + +[[package]] +name = "windows_i686_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a75915e7def60c94dcef72200b9a8e58e5091744960da64ec734a6c6e9b3743e" +checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" [[package]] name = "windows_i686_msvc" -version = "0.48.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f55c233f70c4b27f66c523580f78f1004e8b5a8b659e05a4eb49d4166cca406" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" [[package]] name = "windows_x86_64_gnu" -version = "0.48.5" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "53d40abd2583d23e4718fddf1ebec84dbff8381c07cae67ff7768bbf19c6718e" +checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" + +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.52.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" [[package]] name = "windows_x86_64_gnullvm" -version = "0.48.5" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + +[[package]] +name = "windows_x86_64_msvc" +version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b7b52767868a23d5bab768e390dc5f5c55825b6d30b86c844ff2dc7414044cc" +checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "windows_x86_64_msvc" -version = "0.48.5" +version = "0.53.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ed94fce61571a4006852b7389a063ab983c02eb1bb37b47f8272ce92d06d9538" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" [[package]] name = "zeroize" -version = "1.7.0" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "525b4ec142c6b68a2d10f01f7bbf6755599ca3f81ea53b8431b7dd348f5fdb2d" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" diff --git a/cryptoki-sys/Cargo.toml b/cryptoki-sys/Cargo.toml index 1c7ff23d..b3436e0e 100644 --- a/cryptoki-sys/Cargo.toml +++ b/cryptoki-sys/Cargo.toml @@ -13,10 +13,10 @@ documentation = "https://docs.rs/crate/cryptoki-sys" rust-version = "1.77" [build-dependencies] -bindgen = { version = "0.70.1", optional = true } +bindgen = { version = "0.72.0", optional = true } [dependencies] -libloading = "0.8.6" +libloading = "0.8.8" [features] generate-bindings = ["bindgen"] diff --git a/cryptoki/Cargo.toml b/cryptoki/Cargo.toml index fcf1d1ca..e03cefb3 100644 --- a/cryptoki/Cargo.toml +++ b/cryptoki/Cargo.toml @@ -13,17 +13,15 @@ documentation = "https://docs.rs/crate/cryptoki" rust-version = "1.77" [dependencies] -bitflags = "1.3" -libloading = "0.8.6" -log = "0.4.14" +bitflags = "2.9.1" +libloading = "0.8.8" +log = "0.4.27" cryptoki-sys = { path = "../cryptoki-sys", version = "0.4.0" } -paste = "1.0.6" +paste = "1.0.15" secrecy = "0.10.3" [dev-dependencies] -num-traits = "0.2.14" -hex = "0.4.3" -serial_test = "0.5.1" +serial_test = "3.2.0" testresult = "0.4.1" [features] diff --git a/cryptoki/src/context/mod.rs b/cryptoki/src/context/mod.rs index 0da1e320..c4cc7b65 100644 --- a/cryptoki/src/context/mod.rs +++ b/cryptoki/src/context/mod.rs @@ -93,8 +93,8 @@ impl Pkcs11Impl { impl Drop for Pkcs11Impl { fn drop(&mut self) { - if let Err(e) = self.finalize() { - error!("Failed to finalize: {}", e); + if let Err(err) = self.finalize() { + error!("Failed to finalize: {err}"); } } } diff --git a/cryptoki/src/error/rv.rs b/cryptoki/src/error/rv.rs index 32b74a5c..1572853f 100644 --- a/cryptoki/src/error/rv.rs +++ b/cryptoki/src/error/rv.rs @@ -119,8 +119,7 @@ impl From for Rv { CKR_VENDOR_DEFINED => Rv::Error(RvError::VendorDefined), other => { error!( - "Can not find a corresponding error for {}, converting to GeneralError.", - other + "Can not find a corresponding error for {other}, converting to GeneralError." ); Rv::Error(RvError::GeneralError) } diff --git a/cryptoki/src/mechanism/mechanism_info.rs b/cryptoki/src/mechanism/mechanism_info.rs index d20b957d..57b58131 100644 --- a/cryptoki/src/mechanism/mechanism_info.rs +++ b/cryptoki/src/mechanism/mechanism_info.rs @@ -7,6 +7,7 @@ use cryptoki_sys::*; use std::fmt::{Debug, Formatter}; bitflags! { + #[derive(Debug, Clone, Copy)] struct MechanismInfoFlags: CK_FLAGS { const HW = CKF_HW; const ENCRYPT = CKF_ENCRYPT; @@ -25,7 +26,6 @@ bitflags! { const EC_F_P = CKF_EC_F_P; const EC_F_2M = CKF_EC_F_2M; const EC_ECPARAMETERS = CKF_EC_ECPARAMETERS; - const EC_NAMEDCURVE = CKF_EC_NAMEDCURVE; const EC_OID = CKF_EC_OID; const EC_UNCOMPRESS = CKF_EC_UNCOMPRESS; const EC_COMPRESS = CKF_EC_COMPRESS; @@ -35,6 +35,12 @@ bitflags! { } } +impl MechanismInfoFlags { + /// `CKF_EC_NAMEDCURVE` is deprecated with `PKCS#11 3.00`. It is replaced by [`CKF_EC_OID`](MechanismInfoFlags::EC_OID). + #[deprecated = "use `EC_OID` instead"] + pub const EC_NAMEDCURVE: Self = Self::from_bits_retain(CKF_EC_NAMEDCURVE); +} + /// Information about a particular mechanism #[derive(Debug, Clone, Copy)] pub struct MechanismInfo { @@ -199,6 +205,7 @@ impl MechanismInfo { /// [`ec_from_named_curve`](Self::ec_from_named_curve) must be `true` #[deprecated = "use `ec_from_oid` instead"] pub fn ec_from_named_curve(&self) -> bool { + #[allow(deprecated)] self.flags.contains(MechanismInfoFlags::EC_NAMEDCURVE) } @@ -286,15 +293,24 @@ impl From for MechanismInfo { #[cfg(test)] mod test { use super::{MechanismInfo, MechanismInfoFlags}; + use cryptoki_sys::CK_FLAGS; + + #[test] + fn deprecated_flags() { + let ec_oid_bits: CK_FLAGS = MechanismInfoFlags::EC_OID.bits(); + #[allow(deprecated)] + let ec_namedcurve_bits: CK_FLAGS = MechanismInfoFlags::EC_NAMEDCURVE.bits(); + assert_eq!(ec_oid_bits, ec_namedcurve_bits); + } #[test] fn debug_flags_all() { - let expected = "\ -HW | ENCRYPT | DECRYPT | DIGEST | SIGN | SIGN_RECOVER | VERIFY | \ -VERIFY_RECOVER | GENERATE | GENERATE_KEY_PAIR | WRAP | UNWRAP | DERIVE | \ -EXTENSION | EC_F_P | EC_F_2M | EC_ECPARAMETERS | EC_NAMEDCURVE | \ -EC_OID | EC_UNCOMPRESS | EC_COMPRESS | MESSAGE_ENCRYPT | MESSAGE_DECRYPT | \ -MULTI_MESSAGE"; + let expected = "MechanismInfoFlags( + HW | ENCRYPT | DECRYPT | DIGEST | SIGN | SIGN_RECOVER | VERIFY | \ + VERIFY_RECOVER | GENERATE | GENERATE_KEY_PAIR | WRAP | UNWRAP | DERIVE | \ + EXTENSION | EC_F_P | EC_F_2M | EC_ECPARAMETERS | EC_OID | EC_UNCOMPRESS | \ + EC_COMPRESS | MESSAGE_ENCRYPT | MESSAGE_DECRYPT | MULTI_MESSAGE, +)"; let all = MechanismInfoFlags::all(); let observed = format!("{all:#?}"); println!("{observed}"); @@ -311,7 +327,9 @@ MULTI_MESSAGE"; let expected = r#"MechanismInfo { min_key_size: 16, max_key_size: 4096, - flags: (empty), + flags: MechanismInfoFlags( + 0x0, + ), }"#; let observed = format!("{info:#?}"); assert_eq!(observed, expected); diff --git a/cryptoki/src/mechanism/mod.rs b/cryptoki/src/mechanism/mod.rs index e5086dca..1e4663c8 100644 --- a/cryptoki/src/mechanism/mod.rs +++ b/cryptoki/src/mechanism/mod.rs @@ -823,7 +823,7 @@ impl TryFrom for MechanismType { CKM_SP800_108_FEEDBACK_KDF => Ok(MechanismType::SP800_108_FEEDBACK_KDF), CKM_SP800_108_DOUBLE_PIPELINE_KDF => Ok(MechanismType::SP800_108_DOUBLE_PIPELINE_KDF), other => { - error!("Mechanism type {} is not supported.", other); + error!("Mechanism type {other} is not supported."); Err(Error::NotSupported) } } diff --git a/cryptoki/src/mechanism/rsa.rs b/cryptoki/src/mechanism/rsa.rs index 30717070..b37419f3 100644 --- a/cryptoki/src/mechanism/rsa.rs +++ b/cryptoki/src/mechanism/rsa.rs @@ -66,10 +66,7 @@ impl TryFrom for PkcsMgfType { CKG_MGF1_SHA384 => Ok(PkcsMgfType::MGF1_SHA384), CKG_MGF1_SHA512 => Ok(PkcsMgfType::MGF1_SHA512), other => { - error!( - "Mask Generation Function type {} is not one of the valid values.", - other - ); + error!("Mask Generation Function type {other} is not one of the valid values."); Err(Error::InvalidValue) } } diff --git a/cryptoki/src/object.rs b/cryptoki/src/object.rs index a8c30e1a..906d206f 100644 --- a/cryptoki/src/object.rs +++ b/cryptoki/src/object.rs @@ -411,7 +411,7 @@ impl TryFrom for AttributeType { CKA_WRAP_WITH_TRUSTED => Ok(AttributeType::WrapWithTrusted), CKA_VENDOR_DEFINED..=MAX_CU_ULONG => Ok(AttributeType::VendorDefined(attribute_type)), attr_type => { - error!("Attribute type {} not supported.", attr_type); + error!("Attribute type {attr_type} not supported."); Err(Error::NotSupported) } } @@ -1088,7 +1088,7 @@ impl TryFrom for ObjectClass { CKO_OTP_KEY => Ok(ObjectClass::OTP_KEY), _ => { - error!("Object class {} is not supported.", object_class); + error!("Object class {object_class} is not supported."); Err(Error::NotSupported) } } @@ -1373,7 +1373,7 @@ impl TryFrom for KeyType { CKK_HKDF => Ok(KeyType::HKDF), CKK_VENDOR_DEFINED..=MAX_CU_ULONG => KeyType::new_vendor_defined(key_type), _ => { - error!("Key type {} is not supported.", key_type); + error!("Key type {key_type} is not supported."); Err(Error::NotSupported) } } @@ -1449,7 +1449,7 @@ impl TryFrom for CertificateType { CKC_X_509_ATTR_CERT => Ok(CertificateType::X_509_ATTR), CKC_WTLS => Ok(CertificateType::WTLS), _ => { - error!("Certificate type {} is not supported.", certificate_type); + error!("Certificate type {certificate_type} is not supported."); Err(Error::NotSupported) } } diff --git a/cryptoki/src/session/object_management.rs b/cryptoki/src/session/object_management.rs index 3cec80d3..d3bdae1c 100644 --- a/cryptoki/src/session/object_management.rs +++ b/cryptoki/src/session/object_management.rs @@ -197,8 +197,8 @@ impl Drop for ObjectHandleIterator<'_> { if let Some(f) = get_pkcs11_func!(self.session.client(), C_FindObjectsFinal) { // swallow the return value, as we can't do anything about it, // but log the error - if let Rv::Error(error) = Rv::from(unsafe { f(self.session.handle()) }) { - log::error!("C_FindObjectsFinal() failed with error: {:?}", error); + if let Rv::Error(err) = Rv::from(unsafe { f(self.session.handle()) }) { + log::error!("C_FindObjectsFinal() failed with error: {err:?}"); } } else { // bark but pass if C_FindObjectsFinal() is not implemented diff --git a/cryptoki/src/session/session_info.rs b/cryptoki/src/session/session_info.rs index b8981c68..abd5dc4c 100644 --- a/cryptoki/src/session/session_info.rs +++ b/cryptoki/src/session/session_info.rs @@ -11,6 +11,7 @@ use std::fmt::Debug; bitflags! { /// Collection of flags defined for [`CK_SESSION_INFO`] + #[derive(Debug, Clone, Copy)] struct SessionInfoFlags: CK_FLAGS { const RW_SESSION = CKF_RW_SESSION; const SERIAL_SESSION = CKF_SERIAL_SESSION; @@ -109,7 +110,9 @@ mod test { #[test] fn debug_flags_all() { - let expected = "RW_SESSION | SERIAL_SESSION"; + let expected = "SessionInfoFlags( + RW_SESSION | SERIAL_SESSION, +)"; let all = SessionInfoFlags::all(); let observed = format!("{all:#?}"); assert_eq!(observed, expected); @@ -128,7 +131,9 @@ mod test { slot_id: 100, }, state: RoPublic, - flags: (empty), + flags: SessionInfoFlags( + 0x0, + ), device_error: 0, }"#; let observed = format!("{info:#?}"); diff --git a/cryptoki/src/session/session_management.rs b/cryptoki/src/session/session_management.rs index c5f22b03..40839ad7 100644 --- a/cryptoki/src/session/session_management.rs +++ b/cryptoki/src/session/session_management.rs @@ -26,8 +26,8 @@ impl Drop for Session { } } - if let Err(e) = close(self) { - error!("Failed to close session: {}", e); + if let Err(err) = close(self) { + error!("Failed to close session: {err}"); } } } diff --git a/cryptoki/src/slot/slot_info.rs b/cryptoki/src/slot/slot_info.rs index 50e74891..40d6b8d1 100644 --- a/cryptoki/src/slot/slot_info.rs +++ b/cryptoki/src/slot/slot_info.rs @@ -9,6 +9,7 @@ use std::fmt::Debug; bitflags! { /// Collection of flags defined for [`CK_SLOT_INFO`] + #[derive(Debug, Clone, Copy)] struct SlotInfoFlags: CK_FLAGS { const TOKEN_PRESENT = CKF_TOKEN_PRESENT; const REMOVABLE_DEVICE = CKF_REMOVABLE_DEVICE; @@ -98,7 +99,9 @@ mod test { #[test] fn debug_flags_all() { - let expected = "TOKEN_PRESENT | REMOVABLE_DEVICE | HW_SLOT"; + let expected = "SlotInfoFlags( + TOKEN_PRESENT | REMOVABLE_DEVICE | HW_SLOT, +)"; let all = SlotInfoFlags::all(); let observed = format!("{all:#?}"); assert_eq!(observed, expected); @@ -116,7 +119,9 @@ mod test { let expected = r#"SlotInfo { slot_description: "Slot Description", manufacturer_id: "Manufacturer ID", - flags: (empty), + flags: SlotInfoFlags( + 0x0, + ), hardware_version: Version { major: 0, minor: 255, diff --git a/cryptoki/src/slot/token_info.rs b/cryptoki/src/slot/token_info.rs index 9653c9b4..90021151 100644 --- a/cryptoki/src/slot/token_info.rs +++ b/cryptoki/src/slot/token_info.rs @@ -13,6 +13,7 @@ use std::fmt::Debug; bitflags! { /// Collection of flags defined for [`CK_TOKEN_INFO`] + #[derive(Debug, Clone, Copy)] struct TokenInfoFlags: CK_FLAGS { const RNG = CKF_RNG; const WRITE_PROTECTED = CKF_WRITE_PROTECTED; @@ -463,13 +464,14 @@ mod test { #[test] fn debug_flags_all() { - let expected = "\ -RNG | WRITE_PROTECTED | LOGIN_REQUIRED | USER_PIN_INITIALIZED | \ -RESTORE_KEY_NOT_NEEDED | CLOCK_ON_TOKEN | PROTECTED_AUTHENTICATION_PATH | \ -DUAL_CRYPTO_OPERATIONS | TOKEN_INITIALIZED | SECONDARY_AUTHENTICATION | \ -USER_PIN_COUNT_LOW | USER_PIN_FINAL_TRY | USER_PIN_LOCKED | \ -USER_PIN_TO_BE_CHANGED | SO_PIN_COUNT_LOW | SO_PIN_FINAL_TRY | SO_PIN_LOCKED | \ -SO_PIN_TO_BE_CHANGED | ERROR_STATE"; + let expected = "TokenInfoFlags( + RNG | WRITE_PROTECTED | LOGIN_REQUIRED | USER_PIN_INITIALIZED | \ + RESTORE_KEY_NOT_NEEDED | CLOCK_ON_TOKEN | PROTECTED_AUTHENTICATION_PATH | \ + DUAL_CRYPTO_OPERATIONS | TOKEN_INITIALIZED | SECONDARY_AUTHENTICATION | \ + USER_PIN_COUNT_LOW | USER_PIN_FINAL_TRY | USER_PIN_LOCKED | \ + USER_PIN_TO_BE_CHANGED | SO_PIN_COUNT_LOW | SO_PIN_FINAL_TRY | SO_PIN_LOCKED | \ + SO_PIN_TO_BE_CHANGED | ERROR_STATE, +)"; let all = TokenInfoFlags::all(); let observed = format!("{all:#?}"); assert_eq!(observed, expected); @@ -509,7 +511,9 @@ SO_PIN_TO_BE_CHANGED | ERROR_STATE"; manufacturer_id: "Manufacturer ID", model: "Token Model", serial_number: "Serial Number", - flags: (empty), + flags: TokenInfoFlags( + 0x0, + ), max_session_count: Max( 100, ), diff --git a/cryptoki/tests/basic.rs b/cryptoki/tests/basic.rs index 41c20ace..60d05d81 100644 --- a/cryptoki/tests/basic.rs +++ b/cryptoki/tests/basic.rs @@ -1190,7 +1190,7 @@ fn get_session_info_test() -> TestResult { let session_info = session.get_session_info()?; assert!(session_info.read_write()); assert_eq!(session_info.slot_id(), slot); - assert!(matches!(session_info.session_state(), SessionState::RwUser,)); + assert!(matches!(session_info.session_state(), SessionState::RwUser)); session.logout()?; session.login(UserType::So, Some(&AuthPin::new(SO_PIN.into())))?; let session_info = session.get_session_info()?;