Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crypto/src/mls/credential/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ mod tests {
let new_pki_kp = PkiKeypair::rand_unchecked(case.signature_scheme());

let eve_key = CertificatePrivateKey {
value: new_pki_kp.signing_key_bytes(),
value: new_pki_kp.signing_key_bytes().into(),
signature_scheme: case.ciphersuite().signature_algorithm(),
};
let cb = CertificateBundle {
Expand Down
10 changes: 4 additions & 6 deletions crypto/src/mls/credential/x509.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,19 +10,17 @@ use openmls_x509_credential::CertificateKeyPair;
use wire_e2e_identity::prelude::{HashAlgorithm, WireIdentityReader};
#[cfg(test)]
use x509_cert::der::Encode;
use zeroize::Zeroize;
use zeroize::Zeroizing;

use super::{Error, Result};
#[cfg(test)]
use crate::test_utils::x509::X509Certificate;
use crate::{ClientId, Credential, CredentialType, MlsError, RecursiveError, e2e_identity::id::WireQualifiedClientId};

#[derive(core_crypto_macros::Debug, Clone, Zeroize)]
#[zeroize(drop)]
#[derive(core_crypto_macros::Debug, Clone)]
pub struct CertificatePrivateKey {
#[sensitive]
pub(crate) value: Vec<u8>,
#[zeroize(skip)]
pub(crate) value: Zeroizing<Vec<u8>>,
pub(crate) signature_scheme: SignatureScheme,
}

Expand Down Expand Up @@ -210,7 +208,7 @@ impl CertificateBundle {
Self {
certificate_chain: vec![cert.certificate.to_der().unwrap(), issuer.certificate.to_der().unwrap()],
private_key: CertificatePrivateKey {
value: cert.pki_keypair.signing_key_bytes(),
value: cert.pki_keypair.signing_key_bytes().into(),
signature_scheme: cert.signature_scheme,
},
}
Expand Down
1 change: 0 additions & 1 deletion crypto/src/mls/session/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ pub(crate) use error::{Error, Result};
pub use history_observer::HistoryObserver;
use identities::Identities;
use key_package::KEYPACKAGE_DEFAULT_LIFETIME;
use log::debug;
use mls_crypto_provider::{EntropySeed, MlsCryptoProvider};
use openmls_traits::{OpenMlsCryptoProvider, types::SignatureScheme};

Expand Down
3 changes: 1 addition & 2 deletions crypto/src/test_utils/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@ macro_rules! innermost_source_matches {
outcome
}};
}
pub(crate) use innermost_source_matches;

use crate::{RecursiveError::Test, ephemeral::HistorySecret, test_utils::TestError::ImplementationError};

Expand Down Expand Up @@ -208,7 +207,7 @@ impl SessionContext {
certificate_chain: vec![cert_der],
private_key: crate::mls::credential::x509::CertificatePrivateKey {
signature_scheme,
value: actor_cert.pki_keypair.signing_key_bytes(),
value: actor_cert.pki_keypair.signing_key_bytes().into(),
},
}
}
Expand Down
2 changes: 1 addition & 1 deletion crypto/src/transaction_context/e2e_identity/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ impl TransactionContext {
let crl_new_distribution_points = self.extract_dp_on_init(&certificate_chain[..]).await?;

let private_key = CertificatePrivateKey {
value: sk,
value: sk.into(),
signature_scheme: cs.signature_algorithm(),
};

Expand Down
2 changes: 1 addition & 1 deletion crypto/src/transaction_context/e2e_identity/rotate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -155,7 +155,7 @@ impl TransactionContext {
.map_err(RecursiveError::e2e_identity("getting certificate response"))?;

let private_key = CertificatePrivateKey {
value: sk,
value: sk.into(),
signature_scheme,
};

Expand Down
1 change: 1 addition & 0 deletions obfuscate/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ openmls = { workspace = true, optional = true }
openmls_basic_credential = { workspace = true, optional = true }
rand.workspace = true
sha2.workspace = true
zeroize.workspace = true

[lints]
workspace = true
Expand Down
11 changes: 10 additions & 1 deletion obfuscate/src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use std::{fmt::Formatter, sync::LazyLock};
use std::{fmt::Formatter, ops::Deref, sync::LazyLock};

use derive_more::From;
use log::kv::{ToValue, Value};
Expand Down Expand Up @@ -50,3 +50,12 @@ impl<'a, T: Obfuscate> ToValue for Obfuscated<'a, T> {
Value::from_debug(self)
}
}

impl<T> Obfuscate for zeroize::Zeroizing<T>
where
T: Obfuscate + zeroize::Zeroize,
{
fn obfuscate(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
self.deref().obfuscate(f)
}
}
2 changes: 1 addition & 1 deletion rust-toolchain.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[toolchain]
channel = "nightly-2025-08-24"
channel = "nightly-2025-11-25"
components = [
"rust-analyzer",
"cargo",
Expand Down
Loading