Skip to content

Commit 80e0c78

Browse files
committed
chore: adapt to new rand interfaces
1 parent 7284ca2 commit 80e0c78

File tree

4 files changed

+7
-11
lines changed

4 files changed

+7
-11
lines changed

e2e-identity/tests/utils/idp/authelia/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::net::SocketAddr;
22

33
use argon2::{
44
Algorithm, Argon2, ParamsBuilder, Version,
5-
password_hash::{PasswordHasher, SaltString, rand_core::OsRng},
5+
password_hash::{PasswordHasher, SaltString},
66
};
77
use http::header;
88
use oauth2::{CsrfToken, PkceCodeChallenge, RedirectUrl, Scope};

mls-provider/src/crypto_provider.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ use openmls_traits::{
1414
HpkeKemType, SignatureScheme,
1515
},
1616
};
17-
use rand_core::{RngCore, SeedableRng};
17+
use rand::{SeedableRng as _, TryRngCore as _};
1818
use sha2::{Digest, Sha256, Sha384, Sha512};
1919
use signature::digest::typenum::Unsigned;
2020
use tls_codec::SecretVLBytes;
@@ -29,7 +29,7 @@ pub struct RustCrypto {
2929
impl Default for RustCrypto {
3030
fn default() -> Self {
3131
Self {
32-
rng: Arc::new(rand_chacha::ChaCha20Rng::from_entropy().into()),
32+
rng: Arc::new(rand_chacha::ChaCha20Rng::from_os_rng().into()),
3333
}
3434
}
3535
}
@@ -617,7 +617,7 @@ mod hpke_core {
617617
info: &[u8],
618618
aad: &[u8],
619619
plaintext: &[u8],
620-
csprng: &mut impl rand_core::CryptoRngCore,
620+
csprng: &mut impl rand::CryptoRng,
621621
) -> Result<HpkeCiphertext, CryptoError> {
622622
use hpke::{Deserializable as _, Serializable as _};
623623
let key = Kem::PublicKey::from_bytes(public_key).map_err(|_| CryptoError::HpkeEncryptionError)?;
@@ -633,7 +633,7 @@ mod hpke_core {
633633

634634
#[allow(dead_code)]
635635
pub(crate) fn hpke_gen_keypair<Kem: hpke::Kem>(
636-
csprng: &mut impl rand_core::CryptoRngCore,
636+
csprng: &mut impl rand::CryptoRng,
637637
) -> Result<HpkeKeyPair, CryptoError> {
638638
use hpke::Serializable as _;
639639
let (sk, pk) = Kem::gen_keypair(csprng);
@@ -676,7 +676,7 @@ mod hpke_core {
676676
info: &[u8],
677677
export_info: &[u8],
678678
export_len: usize,
679-
csprng: &mut impl rand_core::CryptoRngCore,
679+
csprng: &mut impl rand::CryptoRng,
680680
) -> Result<(Vec<u8>, Vec<u8>), CryptoError> {
681681
use hpke::{Deserializable as _, Serializable as _};
682682
let key = Kem::PublicKey::from_bytes(tx_public_key).map_err(|_| CryptoError::SenderSetupError)?;

mls-provider/src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,6 @@ use openmls_traits::{
1717
};
1818
pub use pki::{CertProfile, CertificateGenerationArgs, PkiEnvironmentProvider, PkiKeypair};
1919

20-
pub mod reexports {
21-
pub use rand_core;
22-
}
23-
2420
/// 32-byte raw entropy seed
2521
pub type RawEntropySeed = <rand_chacha::ChaCha20Rng as rand::SeedableRng>::Seed;
2622

obfuscate/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub fn compute_hash(bytes: &[u8]) -> [u8; 10] {
1818
static SALT: LazyLock<[u8; 32]> = LazyLock::new(|| {
1919
use rand::Rng as _;
2020
let mut salt = [0; _];
21-
rand::thread_rng().fill(&mut salt);
21+
rand::rng().fill(&mut salt);
2222
salt
2323
});
2424

0 commit comments

Comments
 (0)