diff --git a/stackable-certs/src/ca/k8s.rs b/stackable-certs/src/ca/k8s.rs index 374178fb2..cebf3b8e0 100644 --- a/stackable-certs/src/ca/k8s.rs +++ b/stackable-certs/src/ca/k8s.rs @@ -52,13 +52,15 @@ where key_private_key: &str, ) -> Result { let name = secret.name_any(); - let data = secret.data.with_context(|_| NoSecretDataSnafu { + let data = secret.data.with_context(|| NoSecretDataSnafu { secret: name.clone(), })?; - let certificate_data = data.get(key_certificate).with_context(|_| NoCertificateDataSnafu { - secret: name.clone(), - })?; + let certificate_data = + data.get(key_certificate) + .with_context(|| NoCertificateDataSnafu { + secret: name.clone(), + })?; let certificate = Certificate::load_pem_chain(&certificate_data.0) .with_context(|_| ReadChainSnafu { @@ -66,9 +68,11 @@ where })? .remove(0); - let private_key_data = data.get(key_private_key).with_context(|_| NoPrivateKeyDataSnafu { - secret: name.clone(), - })?; + let private_key_data = + data.get(key_private_key) + .with_context(|| NoPrivateKeyDataSnafu { + secret: name.clone(), + })?; let private_key_data = std::str::from_utf8(&private_key_data.0).context(DecodeUtf8StringSnafu)?; diff --git a/stackable-certs/src/ca/mod.rs b/stackable-certs/src/ca/mod.rs index 85da0c2ae..239202bc6 100644 --- a/stackable-certs/src/ca/mod.rs +++ b/stackable-certs/src/ca/mod.rs @@ -5,7 +5,7 @@ use std::{collections::HashSet, path::Path, str::FromStr}; use const_oid::db::rfc5280::{ID_KP_CLIENT_AUTH, ID_KP_SERVER_AUTH}; use snafu::{ResultExt, Snafu}; use stackable_operator::time::Duration; -use tracing::{info, instrument}; +use tracing::{debug, instrument}; use x509_cert::{ builder::{Builder, CertificateBuilder, Profile}, der::{pem::LineEnding, referenced::OwnedToRef, DecodePem}, @@ -285,7 +285,7 @@ where .add_extension(&aki) .context(AddCertificateExtensionSnafu)?; - info!("create and sign leaf certificate"); + debug!("create and sign leaf certificate"); let certificate = builder.build().context(BuildCertificateSnafu)?; Ok(CertificatePair { diff --git a/stackable-certs/src/keys/ecdsa.rs b/stackable-certs/src/keys/ecdsa.rs index 16657291b..7a9f6e0ac 100644 --- a/stackable-certs/src/keys/ecdsa.rs +++ b/stackable-certs/src/keys/ecdsa.rs @@ -27,11 +27,11 @@ impl SigningKey { #[instrument(name = "create_ecdsa_signing_key")] pub fn new() -> Result { let mut csprng = OsRng; - Self::new_with(&mut csprng) + Self::new_with_rng(&mut csprng) } #[instrument(name = "create_ecdsa_signing_key_custom_rng", skip_all)] - pub fn new_with(csprng: &mut R) -> Result + pub fn new_with_rng(csprng: &mut R) -> Result where R: CryptoRngCore + Sized, { diff --git a/stackable-certs/src/keys/rsa.rs b/stackable-certs/src/keys/rsa.rs index 501aa1f4b..98a642251 100644 --- a/stackable-certs/src/keys/rsa.rs +++ b/stackable-certs/src/keys/rsa.rs @@ -39,7 +39,7 @@ impl SigningKey { #[instrument(name = "create_rsa_signing_key")] pub fn new(bit_size: Option) -> Result { let mut csprng = OsRng; - Self::new_with(&mut csprng, bit_size) + Self::new_with_rng(&mut csprng, bit_size) } #[instrument(name = "create_rsa_signing_key_custom_rng", skip_all)]