Skip to content

Commit a91689c

Browse files
authored
update dependencies rand (#707)
1 parent 4b2974b commit a91689c

File tree

28 files changed

+60
-55
lines changed

28 files changed

+60
-55
lines changed

Cargo.lock

Lines changed: 23 additions & 15 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dtls/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ rand_core = "0.6"
1717
hkdf = "0.12"
1818
p256 = { version = "0.13", features = ["default", "ecdh", "ecdsa"] }
1919
p384 = "0.13"
20-
rand = "0.8"
20+
rand = "0.9"
2121
hmac = "0.12"
2222
sec1 = { version = "0.7", features = ["std"] }
2323
sha1 = "0.10"

dtls/src/conn/conn_test.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1793,7 +1793,7 @@ async fn test_server_timeout() -> Result<()> {
17931793
.init();*/
17941794

17951795
let mut cookie = vec![0u8; 20];
1796-
rand::thread_rng().fill(cookie.as_mut_slice());
1796+
rand::rng().fill(cookie.as_mut_slice());
17971797

17981798
let random_bytes = [0u8; RANDOM_BYTES_LENGTH];
17991799
let gmt_unix_time = SystemTime::UNIX_EPOCH
@@ -1951,7 +1951,7 @@ async fn test_protocol_version_validation() -> Result<()> {
19511951
.init();*/
19521952

19531953
let mut cookie = vec![0; 20];
1954-
rand::thread_rng().fill(cookie.as_mut_slice());
1954+
rand::rng().fill(cookie.as_mut_slice());
19551955

19561956
let random_bytes = [0u8; RANDOM_BYTES_LENGTH];
19571957
let gmt_unix_time = SystemTime::UNIX_EPOCH
@@ -2266,7 +2266,7 @@ async fn test_multiple_hello_verify_request() -> Result<()> {
22662266
let mut packets = vec![];
22672267
for i in 0..2 {
22682268
let mut cookie = vec![0; 20];
2269-
rand::thread_rng().fill(cookie.as_mut_slice());
2269+
rand::rng().fill(cookie.as_mut_slice());
22702270
cookies.push(cookie.clone());
22712271

22722272
let mut handshake = Handshake::new(HandshakeMessage::HelloVerifyRequest(

dtls/src/crypto/crypto_cbc.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ impl CryptoCbc {
6868
payload.extend_from_slice(&mac);
6969

7070
let mut iv: Vec<u8> = vec![0; Self::BLOCK_SIZE];
71-
rand::thread_rng().fill(iv.as_mut_slice());
71+
rand::rng().fill(iv.as_mut_slice());
7272

7373
let write_cbc = Aes256CbcEnc::new_from_slices(&self.local_key, &iv)?;
7474
let encrypted = write_cbc.encrypt_padded_vec_mut::<DtlsPadding>(&payload);

dtls/src/crypto/crypto_ccm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ impl CryptoCcm {
109109

110110
let mut nonce = vec![0u8; CRYPTO_CCM_NONCE_LENGTH];
111111
nonce[..4].copy_from_slice(&self.local_write_iv[..4]);
112-
rand::thread_rng().fill(&mut nonce[4..]);
112+
rand::rng().fill(&mut nonce[4..]);
113113
let nonce = GenericArray::from_slice(&nonce);
114114

115115
let additional_data = generate_aead_additional_data(pkt_rlh, payload.len());

dtls/src/crypto/crypto_gcm.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ impl CryptoGcm {
5757

5858
let mut nonce = vec![0u8; CRYPTO_GCM_NONCE_LENGTH];
5959
nonce[..4].copy_from_slice(&self.local_write_iv[..4]);
60-
rand::thread_rng().fill(&mut nonce[4..]);
60+
rand::rng().fill(&mut nonce[4..]);
6161
let nonce = GenericArray::from_slice(&nonce);
6262

6363
let additional_data = generate_aead_additional_data(pkt_rlh, payload.len());

dtls/src/crypto/padding.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ pub mod tests {
6060
for original_length in 0..128 {
6161
for padding_length in 0..(256 - original_length) {
6262
let mut block = vec![0; original_length + padding_length + 1];
63-
rand::thread_rng().fill(&mut block[0..original_length]);
63+
rand::rng().fill(&mut block[0..original_length]);
6464
let original = block[0..original_length].to_vec();
6565
DtlsPadding::raw_pad(&mut block, original_length);
6666

dtls/src/flight/flight0.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@ impl Flight for Flight0 {
194194
) -> Result<Vec<Packet>, (Option<Alert>, Option<Error>)> {
195195
// Initialize
196196
state.cookie = vec![0; COOKIE_LENGTH];
197-
rand::thread_rng().fill(state.cookie.as_mut_slice());
197+
rand::rng().fill(state.cookie.as_mut_slice());
198198

199199
//TODO: figure out difference between golang's atom store and rust atom store
200200
let zero_epoch = 0;

dtls/src/handshake/handshake_random.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,6 @@ impl HandshakeRandom {
6666
// may be called multiple times
6767
pub fn populate(&mut self) {
6868
self.gmt_unix_time = SystemTime::now();
69-
rand::thread_rng().fill(&mut self.random_bytes);
69+
rand::rng().fill(&mut self.random_bytes);
7070
}
7171
}

examples/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ serde = { version = "1", features = ["derive"] }
2828
serde_json = "1"
2929
bytes = "1"
3030
lazy_static = "1"
31-
rand = "0.8"
31+
rand = "0.9"
3232

3333
memchr = "2.1.1"
3434

0 commit comments

Comments
 (0)