diff options
| author | mat <git@matdoes.dev> | 2025-06-15 10:09:47 -1030 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-06-15 10:09:47 -1030 |
| commit | a06b79a6c1642847862d142946ef2ef2883fbf31 (patch) | |
| tree | 45f3520e536b6d9b6be29dab29dfb04cf52697fd /azalea-crypto | |
| parent | 1a983beec10fe80d3bca1e5a9ee0b63c0de24117 (diff) | |
| download | azalea-drasl-a06b79a6c1642847862d142946ef2ef2883fbf31.tar.xz | |
update deps
Diffstat (limited to 'azalea-crypto')
| -rw-r--r-- | azalea-crypto/Cargo.toml | 2 | ||||
| -rw-r--r-- | azalea-crypto/src/lib.rs | 4 | ||||
| -rw-r--r-- | azalea-crypto/src/signing.rs | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/azalea-crypto/Cargo.toml b/azalea-crypto/Cargo.toml index e055f6aa..f55bc6bf 100644 --- a/azalea-crypto/Cargo.toml +++ b/azalea-crypto/Cargo.toml @@ -14,7 +14,7 @@ aes.workspace = true azalea-buf = { path = "../azalea-buf", version = "0.12.0" } cfb8.workspace = true num-bigint.workspace = true -rand = { workspace = true, features = ["getrandom"] } +rand = { workspace = true, features = ["os_rng"] } rsa = { workspace = true, features = ["sha2"] } rsa_public_encrypt_pkcs1.workspace = true sha-1.workspace = true diff --git a/azalea-crypto/src/lib.rs b/azalea-crypto/src/lib.rs index 4f780431..738c4899 100644 --- a/azalea-crypto/src/lib.rs +++ b/azalea-crypto/src/lib.rs @@ -6,13 +6,13 @@ use aes::{ Aes128, cipher::{BlockDecryptMut, BlockEncryptMut, KeyIvInit, inout::InOutBuf}, }; -use rand::{RngCore, rngs::OsRng}; +use rand::{TryRngCore, rngs::OsRng}; use sha1::{Digest, Sha1}; pub use signing::*; fn generate_secret_key() -> [u8; 16] { let mut key = [0u8; 16]; - OsRng.fill_bytes(&mut key); + OsRng.try_fill_bytes(&mut key).unwrap(); key } diff --git a/azalea-crypto/src/signing.rs b/azalea-crypto/src/signing.rs index 05fa1810..8d21a2f2 100644 --- a/azalea-crypto/src/signing.rs +++ b/azalea-crypto/src/signing.rs @@ -83,7 +83,7 @@ pub fn sign_chat_message(opts: &SignChatMessageOptions) -> MessageSignature { // ... not implemented yet let signing_key = rsa::pkcs1v15::SigningKey::<Sha256>::new(opts.private_key.clone()); - let mut rng = rand::thread_rng(); + let mut rng = rand::rng(); let signature = signing_key .sign_with_rng(&mut rng, &data_to_sign) .to_bytes(); |
