diff --git a/Cargo.lock b/Cargo.lock index 1392b60b..bc2d2c33 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3046,9 +3046,9 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.103.9" +version = "0.103.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7df23109aa6c1567d1c575b9952556388da57401e4ace1d15f79eedad0d8f53" +checksum = "61c429a8649f110dddef65e2a5ad240f747e85f7758a6bccc7e5777bd33f756e" dependencies = [ "ring", "rustls-pki-types", diff --git a/Cargo.nix b/Cargo.nix index c3518d07..5ccb72e6 100644 --- a/Cargo.nix +++ b/Cargo.nix @@ -1180,7 +1180,7 @@ rec { "cert-tools" = rec { crateName = "cert-tools"; version = "0.1.1"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "cert-tools"; @@ -8109,7 +8109,7 @@ rec { "p12" = rec { crateName = "p12"; version = "0.0.0-dev"; - edition = "2021"; + edition = "2024"; src = lib.cleanSourceWith { filter = sourceFilter; src = ./rust/p12; }; authors = [ "hjiayz " @@ -10364,9 +10364,9 @@ rec { }; "rustls-webpki" = rec { crateName = "rustls-webpki"; - version = "0.103.9"; + version = "0.103.13"; edition = "2021"; - sha256 = "0lwg1nnyv7pp2lfwwjhy81bxm233am99jnsp3iymdhd6k8827pyp"; + sha256 = "0vkm7z9pnxz5qz66p2kmyy2pwx0g4jnsbqk5xzfhs4czcjl2ki31"; libName = "webpki"; dependencies = [ { @@ -11677,7 +11677,7 @@ rec { "stackable-krb5-provision-keytab" = rec { crateName = "stackable-krb5-provision-keytab"; version = "0.0.0-dev"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "stackable-krb5-provision-keytab"; @@ -11967,7 +11967,7 @@ rec { "stackable-secret-operator" = rec { crateName = "stackable-secret-operator"; version = "0.0.0-dev"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "stackable-secret-operator"; @@ -12152,7 +12152,7 @@ rec { "stackable-secret-operator-olm-deployer" = rec { crateName = "stackable-secret-operator-olm-deployer"; version = "0.0.0-dev"; - edition = "2021"; + edition = "2024"; crateBin = [ { name = "stackable-secret-operator-olm-deployer"; @@ -12217,7 +12217,7 @@ rec { "stackable-secret-operator-utils" = rec { crateName = "stackable-secret-operator-utils"; version = "0.0.0-dev"; - edition = "2021"; + edition = "2024"; src = lib.cleanSourceWith { filter = sourceFilter; src = ./rust/utils; }; libName = "stackable_secret_operator_utils"; authors = [ diff --git a/Cargo.toml b/Cargo.toml index ebeba896..0737c162 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -7,7 +7,7 @@ resolver = "2" version = "0.0.0-dev" authors = ["Stackable GmbH "] license = "OSL-3.0" -edition = "2021" +edition = "2024" repository = "https://github.com/stackabletech/secret-operator" [workspace.dependencies] diff --git a/rust/krb5-provision-keytab/src/credential_cache.rs b/rust/krb5-provision-keytab/src/credential_cache.rs index 01f9d498..44d1a9b0 100644 --- a/rust/krb5-provision-keytab/src/credential_cache.rs +++ b/rust/krb5-provision-keytab/src/credential_cache.rs @@ -94,10 +94,9 @@ impl CredentialCache { .expect("key was just confirmed to exist in cache"))) } else { tracing::info!("credential not found in cache, generating..."); - match mk_value(Ctx { + match TryFutureExt::into_future(mk_value(Ctx { cache_ref: self.cache_ref.clone(), - }) - .into_future() + })) .await { Ok(value) => { diff --git a/rust/operator-binary/src/crd/secret_class/v1alpha1_impl.rs b/rust/operator-binary/src/crd/secret_class/v1alpha1_impl.rs index 2c9b80fe..75c0dcbd 100644 --- a/rust/operator-binary/src/crd/secret_class/v1alpha1_impl.rs +++ b/rust/operator-binary/src/crd/secret_class/v1alpha1_impl.rs @@ -20,7 +20,7 @@ impl SecretClassBackend { pub fn refers_to_config_map( &self, config_map: &PartialObjectMeta, - ) -> impl Iterator { + ) -> impl Iterator + use<> { let cm_namespace = config_map.metadata.namespace.as_deref(); match self { Self::K8sSearch(backend) => { @@ -40,7 +40,7 @@ impl SecretClassBackend { pub fn refers_to_secret( &self, secret: &PartialObjectMeta, - ) -> impl Iterator { + ) -> impl Iterator + use<> { match self { Self::AutoTls(backend) => { (backend.ca.secret == *secret).then_some(SearchNamespaceMatchCondition::True) diff --git a/rust/operator-binary/src/crd/secret_class/v1alpha2_impl.rs b/rust/operator-binary/src/crd/secret_class/v1alpha2_impl.rs index dc644750..22aaedf6 100644 --- a/rust/operator-binary/src/crd/secret_class/v1alpha2_impl.rs +++ b/rust/operator-binary/src/crd/secret_class/v1alpha2_impl.rs @@ -26,7 +26,7 @@ impl SecretClassBackend { pub fn refers_to_config_map( &self, config_map: &PartialObjectMeta, - ) -> impl Iterator { + ) -> impl Iterator + use<> { let cm_namespace = config_map.metadata.namespace.as_deref(); match self { Self::K8sSearch(backend) => { @@ -46,7 +46,7 @@ impl SecretClassBackend { pub fn refers_to_secret( &self, secret: &PartialObjectMeta, - ) -> impl Iterator { + ) -> impl Iterator + use<> { match self { Self::AutoTls(backend) => { (backend.ca.secret == *secret).then_some(SearchNamespaceMatchCondition::True) diff --git a/rust/operator-binary/src/utils.rs b/rust/operator-binary/src/utils.rs index 637377be..f7cb91aa 100644 --- a/rust/operator-binary/src/utils.rs +++ b/rust/operator-binary/src/utils.rs @@ -123,14 +123,19 @@ pub fn error_full_message(err: &dyn std::error::Error) -> String { /// Propagates `Ok(true)` and `Err(_)` from `stream`, otherwise returns `Ok(false)`. pub async fn trystream_any>, E>(stream: S) -> Result { pin_mut!(stream); - while let Some(value) = stream.next().await { - if let Ok(true) | Err(_) = value { - return value; + loop { + let next_item = stream.next().await; + match next_item { + Some(value) => { + if let Ok(true) | Err(_) = value { + return value; + } + } + None => break, } } Ok(false) } - /// Concatenate chunks of bytes, short-circuiting on [`Err`]. /// /// This is a byte-oriented equivalent to [`Iterator::collect::>`](`Iterator::collect`). diff --git a/rust/p12/Cargo.toml b/rust/p12/Cargo.toml index 21706521..d4e5ac58 100644 --- a/rust/p12/Cargo.toml +++ b/rust/p12/Cargo.toml @@ -2,14 +2,14 @@ name = "p12" version.workspace = true authors = ["hjiayz ", "Marc-Antoine Perennou "] -edition = "2021" +edition.workspace = true keywords = ["pkcs12", "pkcs"] description = "pure rust pkcs12 tool (Stackable fork)" homepage = "https://github.com/hjiayz/p12" repository = "https://github.com/hjiayz/p12" readme = "README.md" license = "MIT OR Apache-2.0" -rust-version = "1.56.0" +rust-version = "1.85.0" # Dependencies are tracked inline for now, to minimize divergence from upstream diff --git a/rust/p12/src/lib.rs b/rust/p12/src/lib.rs index 30a2006b..d8869f1a 100644 --- a/rust/p12/src/lib.rs +++ b/rust/p12/src/lib.rs @@ -644,12 +644,12 @@ fn pbepkcs12sha1(pass: &[u8], salt: &[u8], iterations: u64, id: u8, size: u64) - let d = [id; V as usize]; fn get_len(s: usize) -> usize { let s = s as u64; - (V * ((s + V - 1) / V)) as usize + (V * s.div_ceil(V)) as usize } let s = salt.iter().cycle().take(get_len(salt.len())); let p = pass.iter().cycle().take(get_len(pass.len())); let mut i: Vec = s.chain(p).cloned().collect(); - let c = (size + U - 1) / U; + let c = size.div_ceil(U); let mut a: Vec = vec![]; for _ in 1..c { let ai = pbepkcs12sha1core(&d, &i, &mut a, r);