From edae706b9a462f0f950eb49d7a589fcd3d1c03d8 Mon Sep 17 00:00:00 2001 From: Fabian Kaczmarczyck Date: Thu, 29 Oct 2026 09:48:52 +0000 Subject: [PATCH] Unifies compiled syn versions onto 2.0.117 Bumps enum-iterator, arbitrary, and libfuzzer-sys so all compiled proc-macro dependencies across workspace and fuzz lockfiles share syn 2.0.117 instead of pulling in syn 1.0. --- libraries/cbor/fuzz/Cargo.lock | 51 +++++++++++++++-- libraries/cbor/fuzz/Cargo.toml | 2 +- libraries/opensk/Cargo.lock | 37 +++++------- libraries/opensk/Cargo.toml | 4 +- libraries/opensk/fuzz/Cargo.lock | 60 +++++++++++++------- libraries/opensk/fuzz/Cargo.toml | 2 +- libraries/opensk/fuzz/fuzz_helper/Cargo.toml | 2 +- libraries/opensk/src/api/persist.rs | 6 +- libraries/opensk/src/ctap/client_pin.rs | 16 +++--- libraries/opensk/src/ctap/command.rs | 6 +- libraries/opensk/src/ctap/data_formats.rs | 22 +++---- libraries/opensk/src/ctap/hid/mod.rs | 6 +- libraries/opensk/src/ctap/token_state.rs | 6 +- 13 files changed, 134 insertions(+), 86 deletions(-) diff --git a/libraries/cbor/fuzz/Cargo.lock b/libraries/cbor/fuzz/Cargo.lock index c1287ffb..5e812550 100644 --- a/libraries/cbor/fuzz/Cargo.lock +++ b/libraries/cbor/fuzz/Cargo.lock @@ -1,12 +1,12 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 [[package]] name = "arbitrary" -version = "0.4.7" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db55d72333851e17d572bec876e390cd3b11eb1ef53ae821dd9f3b653d2b4569" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" [[package]] name = "cc" @@ -14,19 +14,60 @@ version = "1.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0fc897dc1e865cc67c0e05a836d9d3f1df3cbe442aa4a9473b18e12624a4951" dependencies = [ + "jobserver", + "libc", "shlex", ] +[[package]] +name = "cfg-if" +version = "1.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600" + +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi", +] + +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom", + "libc", +] + +[[package]] +name = "libc" +version = "0.2.191" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a" + [[package]] name = "libfuzzer-sys" -version = "0.3.5" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf184a4b6b274f82a5df6b357da6055d3e82272327bba281c28bbba6f1664ef" +checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2" dependencies = [ "arbitrary", "cc", ] +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + [[package]] name = "shlex" version = "1.3.0" diff --git a/libraries/cbor/fuzz/Cargo.toml b/libraries/cbor/fuzz/Cargo.toml index 136e4701..5efdce0f 100644 --- a/libraries/cbor/fuzz/Cargo.toml +++ b/libraries/cbor/fuzz/Cargo.toml @@ -10,7 +10,7 @@ edition = "2024" cargo-fuzz = true [dependencies] -libfuzzer-sys = "0.3" +libfuzzer-sys = "0.4" [dependencies.sk-cbor] path = ".." diff --git a/libraries/opensk/Cargo.lock b/libraries/opensk/Cargo.lock index 1a1da190..f23e556c 100644 --- a/libraries/opensk/Cargo.lock +++ b/libraries/opensk/Cargo.lock @@ -15,9 +15,9 @@ dependencies = [ [[package]] name = "arbitrary" -version = "0.4.7" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db55d72333851e17d572bec876e390cd3b11eb1ef53ae821dd9f3b653d2b4569" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" dependencies = [ "derive_arbitrary", ] @@ -171,13 +171,13 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "0.4.7" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a012b5e473dc912f0db0546a1c9c6a194ce8494feb66fa0237160926f9e0e6" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.117", ] [[package]] @@ -236,22 +236,22 @@ dependencies = [ [[package]] name = "enum-iterator" -version = "0.6.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c79a6321a1197d7730510c7e3f6cb80432dfefecb32426de8cea0aa19b4bb8d7" +checksum = "a4549325971814bda7a44061bf3fe7e487d447cba01e4220a4b454d630d7a016" dependencies = [ "enum-iterator-derive", ] [[package]] name = "enum-iterator-derive" -version = "0.6.0" +version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e94aa31f7c0dc764f57896dc615ddd76fc13b0d5dca7eb6cc5e018a5a09ec06" +checksum = "685adfa4d6f3d765a26bc5dbc936577de9abf756c1feeb3089b01dd395034842" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.117", ] [[package]] @@ -540,20 +540,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.101" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -618,5 +607,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.117", ] diff --git a/libraries/opensk/Cargo.toml b/libraries/opensk/Cargo.toml index 82db6391..877ab998 100644 --- a/libraries/opensk/Cargo.toml +++ b/libraries/opensk/Cargo.toml @@ -17,7 +17,7 @@ sk-cbor = { path = "../cbor", version = "0.2.0" } byteorder = { version = "1", default-features = false } arrayref = "0.3.6" subtle = { version = "2.2", default-features = false, features = ["nightly"] } -arbitrary = { version = "0.4.7", features = ["derive"], optional = true } +arbitrary = { version = "1.4.2", features = ["derive"], optional = true } ed25519-compact = { version = "1", default-features = false, optional = true } rand_core = "0.10.1" rand = { version = "0.10.1", default-features = false, optional = true } @@ -49,4 +49,4 @@ software_crypto_ed25519 = ["software_crypto", "ed25519", "ed25519-compact"] fingerprint = [] [dev-dependencies] -enum-iterator = "0.6.0" +enum-iterator = "2.3.0" diff --git a/libraries/opensk/fuzz/Cargo.lock b/libraries/opensk/fuzz/Cargo.lock index 4be382f7..511e7cb5 100644 --- a/libraries/opensk/fuzz/Cargo.lock +++ b/libraries/opensk/fuzz/Cargo.lock @@ -15,9 +15,9 @@ dependencies = [ [[package]] name = "arbitrary" -version = "0.4.7" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db55d72333851e17d572bec876e390cd3b11eb1ef53ae821dd9f3b653d2b4569" +checksum = "c3d036a3c4ab069c7b410a2ce876bd74808d2d0888a82667669f8e783a898bf1" dependencies = [ "derive_arbitrary", ] @@ -76,6 +76,8 @@ version = "1.2.25" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d0fc897dc1e865cc67c0e05a836d9d3f1df3cbe442aa4a9473b18e12624a4951" dependencies = [ + "jobserver", + "libc", "shlex", ] @@ -180,13 +182,13 @@ dependencies = [ [[package]] name = "derive_arbitrary" -version = "0.4.7" +version = "1.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1a012b5e473dc912f0db0546a1c9c6a194ce8494feb66fa0237160926f9e0e6" +checksum = "1e567bd82dcff979e4b03460c307b3cdc9e96fde3d73bed1496d2bc75d9dd62a" dependencies = [ "proc-macro2", "quote", - "syn 1.0.109", + "syn 2.0.117", ] [[package]] @@ -263,6 +265,17 @@ dependencies = [ "sk-cbor", ] +[[package]] +name = "getrandom" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "300e883d756b2e4ec94e02791f39b04b522276138852cfc41d9fb7e904106099" +dependencies = [ + "cfg-if", + "libc", + "r-efi", +] + [[package]] name = "group" version = "0.14.0" @@ -312,6 +325,16 @@ dependencies = [ "hybrid-array", ] +[[package]] +name = "jobserver" +version = "0.1.35" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c00acbd29eabad4a2392fa0e921c874934dbbf4194312ad20f04a0ed67a3cb3" +dependencies = [ + "getrandom", + "libc", +] + [[package]] name = "libc" version = "0.2.172" @@ -320,9 +343,9 @@ checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" [[package]] name = "libfuzzer-sys" -version = "0.3.5" +version = "0.4.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fcf184a4b6b274f82a5df6b357da6055d3e82272327bba281c28bbba6f1664ef" +checksum = "a9fd2f41a1cba099f79a0b6b6c35656cf7c03351a7bae8ff0f28f25270f929d2" dependencies = [ "arbitrary", "cc", @@ -434,6 +457,12 @@ dependencies = [ "proc-macro2", ] +[[package]] +name = "r-efi" +version = "6.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" + [[package]] name = "rand" version = "0.10.3" @@ -562,20 +591,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.101" +version = "2.0.117" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" +checksum = "e665b8803e7b1d2a727f4023456bbbbe74da67099c585258af0ad9c5013b9b99" dependencies = [ "proc-macro2", "quote", @@ -640,5 +658,5 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.101", + "syn 2.0.117", ] diff --git a/libraries/opensk/fuzz/Cargo.toml b/libraries/opensk/fuzz/Cargo.toml index 11f9dd53..d7ee236f 100644 --- a/libraries/opensk/fuzz/Cargo.toml +++ b/libraries/opensk/fuzz/Cargo.toml @@ -9,7 +9,7 @@ edition = "2024" cargo-fuzz = true [dependencies] -libfuzzer-sys = { version = "0.3" } +libfuzzer-sys = { version = "0.4" } fuzz_helper = { path = "fuzz_helper" } # Prevent this from interfering with workspaces diff --git a/libraries/opensk/fuzz/fuzz_helper/Cargo.toml b/libraries/opensk/fuzz/fuzz_helper/Cargo.toml index a150ac8d..195fc97b 100644 --- a/libraries/opensk/fuzz/fuzz_helper/Cargo.toml +++ b/libraries/opensk/fuzz/fuzz_helper/Cargo.toml @@ -9,4 +9,4 @@ edition = "2024" arrayref = "0.3.6" opensk = { path = "../..", features = ["fuzz"] } sk-cbor = { path = "../../../cbor" } -arbitrary = { version = "0.4.7", features = ["derive"] } +arbitrary = { version = "1.4.2", features = ["derive"] } diff --git a/libraries/opensk/src/api/persist.rs b/libraries/opensk/src/api/persist.rs index ab2a7df3..5a533860 100644 --- a/libraries/opensk/src/api/persist.rs +++ b/libraries/opensk/src/api/persist.rs @@ -30,7 +30,7 @@ use alloc::vec::Vec; use core::cmp; use core::convert::TryFrom; #[cfg(test)] -use enum_iterator::IntoEnumIterator; +use enum_iterator::{Sequence, all}; use sk_cbor as cbor; use sk_cbor::destructure_cbor_map; @@ -616,7 +616,7 @@ const VALUE_LENGTH: usize = 1023; /// Identifies an attestation. #[derive(Clone, Copy, Debug, PartialEq, Eq)] -#[cfg_attr(test, derive(IntoEnumIterator))] +#[cfg_attr(test, derive(Sequence))] pub enum AttestationId { Batch = 0x01, Enterprise = 0x02, @@ -683,7 +683,7 @@ mod test { #[test] fn test_from_into_attestation_id() { - for id in AttestationId::into_enum_iter() { + for id in all::() { assert_eq!(id, AttestationId::try_from(id as u8).unwrap()); } assert_eq!( diff --git a/libraries/opensk/src/ctap/client_pin.rs b/libraries/opensk/src/ctap/client_pin.rs index 31abee6c..cbce4a1a 100644 --- a/libraries/opensk/src/ctap/client_pin.rs +++ b/libraries/opensk/src/ctap/client_pin.rs @@ -39,7 +39,7 @@ use alloc::string::String; use alloc::vec::Vec; use arrayref::array_ref; #[cfg(test)] -use enum_iterator::IntoEnumIterator; +use enum_iterator::{Sequence, all}; use subtle::ConstantTimeEq; /// The prefix length of the PIN hash that is stored and compared. @@ -130,7 +130,7 @@ pub(crate) fn check_pin_uv_auth_protocol( Ok(()) } -#[cfg_attr(test, derive(IntoEnumIterator))] +#[cfg_attr(test, derive(Sequence))] pub enum PinPermission { // All variants should use integers with a single bit set. MakeCredential = 0x01, @@ -1754,7 +1754,7 @@ mod test { let mut env = TestEnv::default(); let mut client_pin = ClientPin::::new(&mut env); client_pin.pin_uv_auth_token_state.set_permissions(0x7F); - for permission in PinPermission::into_enum_iter() { + for permission in all::() { assert_eq!( client_pin .pin_uv_auth_token_state @@ -1763,7 +1763,7 @@ mod test { ); } client_pin.pin_uv_auth_token_state.set_permissions(0x00); - for permission in PinPermission::into_enum_iter() { + for permission in all::() { assert_eq!( client_pin .pin_uv_auth_token_state @@ -1980,7 +1980,7 @@ mod test { &token_v2, client_pin.pin_protocol_v2.get_pin_uv_auth_token() ); - for permission in PinPermission::into_enum_iter() { + for permission in all::() { assert_eq!( client_pin.has_permission(permission), Err(Ctap2StatusCode::CTAP2_ERR_PIN_AUTH_INVALID) @@ -2010,7 +2010,7 @@ mod test { .process_command(&mut env, params, DUMMY_CHANNEL) .is_ok() ); - for permission in PinPermission::into_enum_iter() { + for permission in all::() { #[cfg(not(feature = "config_command"))] if matches!(permission, PinPermission::AuthenticatorConfiguration) { continue; @@ -2032,7 +2032,7 @@ mod test { env.clock().advance(30001); client_pin.update_timeouts(&mut env); - for permission in PinPermission::into_enum_iter() { + for permission in all::() { assert_eq!( client_pin .pin_uv_auth_token_state @@ -2070,7 +2070,7 @@ mod test { .process_command(&mut env, params, DUMMY_CHANNEL) .is_ok() ); - for permission in PinPermission::into_enum_iter() { + for permission in all::() { #[cfg(not(feature = "config_command"))] if matches!(permission, PinPermission::AuthenticatorConfiguration) { continue; diff --git a/libraries/opensk/src/ctap/command.rs b/libraries/opensk/src/ctap/command.rs index ae09dadc..2be4fd84 100644 --- a/libraries/opensk/src/ctap/command.rs +++ b/libraries/opensk/src/ctap/command.rs @@ -33,7 +33,7 @@ use alloc::vec::Vec; use arbitrary::Arbitrary; use core::convert::TryFrom; #[cfg(all(test, feature = "fingerprint"))] -use enum_iterator::IntoEnumIterator; +use enum_iterator::{Sequence, all}; use sk_cbor as cbor; #[cfg(feature = "fingerprint")] use sk_cbor::cbor_map_options; @@ -444,7 +444,7 @@ impl TryFrom for AuthenticatorBioEnrollmentParameters { #[cfg(feature = "fingerprint")] #[derive(Clone, Copy, Debug, PartialEq, Eq)] -#[cfg_attr(test, derive(IntoEnumIterator))] +#[cfg_attr(test, derive(Sequence))] pub enum BioEnrollmentSubCommand { EnrollBegin = 0x01, EnrollCaptureNextSample = 0x02, @@ -983,7 +983,7 @@ mod test { let created_cbor: cbor::Value = sub_command.unwrap().into(); assert_eq!(created_cbor, cbor_sub_command); - for command in BioEnrollmentSubCommand::into_enum_iter() { + for command in all::() { let created_cbor: cbor::Value = command.into(); let reconstructed = BioEnrollmentSubCommand::try_from(created_cbor).unwrap(); assert_eq!(command, reconstructed); diff --git a/libraries/opensk/src/ctap/data_formats.rs b/libraries/opensk/src/ctap/data_formats.rs index b6ae37a9..4b5b3075 100644 --- a/libraries/opensk/src/ctap/data_formats.rs +++ b/libraries/opensk/src/ctap/data_formats.rs @@ -28,7 +28,7 @@ use alloc::vec::Vec; use arbitrary::Arbitrary; use core::convert::TryFrom; #[cfg(test)] -use enum_iterator::IntoEnumIterator; +use enum_iterator::{Sequence, all}; use sk_cbor as cbor; use sk_cbor::{cbor_array_vec, cbor_map_options, destructure_cbor_map}; @@ -203,7 +203,7 @@ impl From for cbor::Value { // https://www.w3.org/TR/webauthn/#enumdef-authenticatortransport #[derive(Clone, Debug, PartialEq, Eq)] -#[cfg_attr(test, derive(IntoEnumIterator))] +#[cfg_attr(test, derive(Sequence))] #[cfg_attr(feature = "fuzz", derive(Arbitrary))] pub enum AuthenticatorTransport { Usb, @@ -562,7 +562,7 @@ impl TryFrom for SignatureAlgorithm { /// The credProtect extension's policies for resident credentials. #[derive(Clone, Copy, Debug, PartialEq, Eq, PartialOrd)] -#[cfg_attr(test, derive(IntoEnumIterator))] +#[cfg_attr(test, derive(Sequence))] #[allow(clippy::enum_variant_names)] #[cfg_attr(feature = "fuzz", derive(Arbitrary))] pub enum CredentialProtectionPolicy { @@ -950,7 +950,7 @@ impl TryFrom for PinUvAuthProtocol { } #[derive(Clone, Debug, PartialEq, Eq)] -#[cfg_attr(test, derive(IntoEnumIterator))] +#[cfg_attr(test, derive(Sequence))] #[cfg_attr(feature = "fuzz", derive(Arbitrary))] pub enum ClientPinSubCommand { GetPinRetries = 0x01, @@ -989,7 +989,7 @@ impl TryFrom for ClientPinSubCommand { } #[derive(Clone, Copy, Debug, PartialEq, Eq)] -#[cfg_attr(test, derive(IntoEnumIterator))] +#[cfg_attr(test, derive(Sequence))] pub enum ConfigSubCommand { EnableEnterpriseAttestation = 0x01, ToggleAlwaysUv = 0x02, @@ -1122,7 +1122,7 @@ impl TryFrom for EnterpriseAttestationMode { } #[derive(Clone, Copy, Debug, PartialEq, Eq)] -#[cfg_attr(test, derive(IntoEnumIterator))] +#[cfg_attr(test, derive(Sequence))] pub enum CredentialManagementSubCommand { GetCredsMetadata = 0x01, EnumerateRpsBegin = 0x02, @@ -1671,7 +1671,7 @@ mod test { let expected_error = Err(Ctap2StatusCode::CTAP2_ERR_CBOR_UNEXPECTED_TYPE); assert_eq!(policy_error, expected_error); - for policy in CredentialProtectionPolicy::into_enum_iter() { + for policy in all::() { let created_cbor: cbor::Value = policy.into(); let reconstructed = CredentialProtectionPolicy::try_from(created_cbor).unwrap(); assert_eq!(policy, reconstructed); @@ -1691,7 +1691,7 @@ mod test { let created_cbor: cbor::Value = authenticator_transport.unwrap().into(); assert_eq!(created_cbor, cbor_authenticator_transport); - for transport in AuthenticatorTransport::into_enum_iter() { + for transport in all::() { let created_cbor: cbor::Value = transport.clone().into(); let reconstructed = AuthenticatorTransport::try_from(created_cbor).unwrap(); assert_eq!(transport, reconstructed); @@ -2135,7 +2135,7 @@ mod test { let created_cbor: cbor::Value = sub_command.unwrap().into(); assert_eq!(created_cbor, cbor_sub_command); - for command in ClientPinSubCommand::into_enum_iter() { + for command in all::() { let created_cbor: cbor::Value = command.clone().into(); let reconstructed = ClientPinSubCommand::try_from(created_cbor).unwrap(); assert_eq!(command, reconstructed); @@ -2151,7 +2151,7 @@ mod test { let created_cbor: cbor::Value = sub_command.unwrap().into(); assert_eq!(created_cbor, cbor_sub_command); - for command in ConfigSubCommand::into_enum_iter() { + for command in all::() { let created_cbor: cbor::Value = command.into(); let reconstructed = ConfigSubCommand::try_from(created_cbor).unwrap(); assert_eq!(command, reconstructed); @@ -2261,7 +2261,7 @@ mod test { let created_cbor: cbor::Value = sub_command.unwrap().into(); assert_eq!(created_cbor, cbor_sub_command); - for command in CredentialManagementSubCommand::into_enum_iter() { + for command in all::() { let created_cbor: cbor::Value = command.into(); let reconstructed = CredentialManagementSubCommand::try_from(created_cbor).unwrap(); assert_eq!(command, reconstructed); diff --git a/libraries/opensk/src/ctap/hid/mod.rs b/libraries/opensk/src/ctap/hid/mod.rs index 20834c7b..fd020b75 100644 --- a/libraries/opensk/src/ctap/hid/mod.rs +++ b/libraries/opensk/src/ctap/hid/mod.rs @@ -30,7 +30,7 @@ use alloc::vec; use alloc::vec::Vec; use arrayref::{array_ref, array_refs}; #[cfg(test)] -use enum_iterator::IntoEnumIterator; +use enum_iterator::{Sequence, all}; // We implement CTAP 2.1 from 2021-06-15. Please see section // 11.2. USB Human Interface Device (USB HID) @@ -53,7 +53,7 @@ pub type ChannelID = [u8; 4]; /// /// See section 11.2.9. of FIDO 2.1 (2021-06-15). #[derive(Clone, Copy, Debug, PartialEq, Eq)] -#[cfg_attr(test, derive(IntoEnumIterator))] +#[cfg_attr(test, derive(Sequence))] pub enum CtapHidCommand { Ping = 0x01, Msg = 0x03, @@ -695,7 +695,7 @@ mod test { fn test_from_ctap_hid_command() { // 0x3E is unassigned. assert_eq!(CtapHidCommand::from(0x3E), CtapHidCommand::Error); - for command in CtapHidCommand::into_enum_iter() { + for command in all::() { assert_eq!(CtapHidCommand::from(command as u8), command); } } diff --git a/libraries/opensk/src/ctap/token_state.rs b/libraries/opensk/src/ctap/token_state.rs index 5c44d283..d1316820 100644 --- a/libraries/opensk/src/ctap/token_state.rs +++ b/libraries/opensk/src/ctap/token_state.rs @@ -169,7 +169,7 @@ impl PinUvAuthTokenState { mod test { use super::*; use crate::env::test::TestEnv; - use enum_iterator::IntoEnumIterator; + use enum_iterator::all; #[test] fn test_observer() { @@ -199,7 +199,7 @@ mod test { fn test_permissions() { let mut token_state = PinUvAuthTokenState::::new(); token_state.set_permissions(0xFF); - for permission in PinPermission::into_enum_iter() { + for permission in all::() { assert_eq!(token_state.has_permission(permission), Ok(())); } token_state.clear_pin_uv_auth_token_permissions_except_lbw(); @@ -212,7 +212,7 @@ mod test { Ok(()) ); token_state.stop_using_pin_uv_auth_token(); - for permission in PinPermission::into_enum_iter() { + for permission in all::() { assert_eq!( token_state.has_permission(permission), Err(Ctap2StatusCode::CTAP2_ERR_PIN_AUTH_INVALID)