mirror of
https://github.com/netbirdio/IronRDP.git
synced 2026-05-22 18:43:12 -07:00
build(deps): bump rand to 0.9
Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
This commit is contained in:
committed by
Benoît Cortier
parent
8d09e327a1
commit
de0877188c
Generated
+2
-2
@@ -2345,7 +2345,7 @@ dependencies = [
|
||||
"ironrdp-svc",
|
||||
"opus",
|
||||
"pico-args",
|
||||
"rand 0.8.5",
|
||||
"rand 0.9.2",
|
||||
"sspi",
|
||||
"tokio-rustls",
|
||||
"tracing",
|
||||
@@ -2494,7 +2494,7 @@ dependencies = [
|
||||
"picky",
|
||||
"picky-asn1-der",
|
||||
"picky-asn1-x509",
|
||||
"rand_core 0.6.4",
|
||||
"rand 0.9.2",
|
||||
"sspi",
|
||||
"tracing",
|
||||
"url",
|
||||
|
||||
@@ -26,7 +26,7 @@ ironrdp-pdu = { path = "../ironrdp-pdu", version = "0.5", features = ["std"] } #
|
||||
arbitrary = { version = "1", features = ["derive"], optional = true } # public
|
||||
sspi = "0.16" # public
|
||||
url = "2.5" # public
|
||||
rand_core = { version = "0.6", features = ["std"] } # TODO: dependency injection?
|
||||
rand = { version = "0.9", features = ["std"] } # TODO: dependency injection?
|
||||
tracing = { version = "0.1", features = ["log"] }
|
||||
picky-asn1-der = "0.5"
|
||||
picky-asn1-x509 = "0.14"
|
||||
|
||||
@@ -7,7 +7,7 @@ use std::sync::Arc;
|
||||
use ironrdp_core::WriteBuf;
|
||||
use ironrdp_pdu::rdp::server_license::{self, LicenseInformation, LicensePdu, ServerLicenseError};
|
||||
use ironrdp_pdu::PduHint;
|
||||
use rand_core::{OsRng, RngCore as _};
|
||||
use rand::prelude::*;
|
||||
|
||||
use super::{legacy, ConnectorError, ConnectorErrorExt};
|
||||
use crate::{encode_send_data_request, ConnectorResult, ConnectorResultExt as _, Sequence, State, Written};
|
||||
@@ -134,11 +134,12 @@ impl Sequence for LicenseExchangeSequence {
|
||||
|
||||
match license_pdu {
|
||||
LicensePdu::ServerLicenseRequest(license_request) => {
|
||||
let mut rng = rand::rng();
|
||||
let mut client_random = [0u8; server_license::RANDOM_NUMBER_SIZE];
|
||||
OsRng.fill_bytes(&mut client_random);
|
||||
rng.fill_bytes(&mut client_random);
|
||||
|
||||
let mut premaster_secret = [0u8; server_license::PREMASTER_SECRET_SIZE];
|
||||
OsRng.fill_bytes(&mut premaster_secret);
|
||||
rng.fill_bytes(&mut premaster_secret);
|
||||
|
||||
let license_info = license_request
|
||||
.scope_list
|
||||
|
||||
@@ -63,7 +63,7 @@ sspi = { version = "0.16", features = ["network_client"] }
|
||||
tracing = { version = "0.1", features = ["log"] }
|
||||
tracing-subscriber = { version = "0.3", features = ["env-filter"] }
|
||||
tokio-rustls = "0.26"
|
||||
rand = "0.8"
|
||||
rand = "0.9"
|
||||
opus = "0.3"
|
||||
|
||||
[package.metadata.docs.rs]
|
||||
|
||||
@@ -157,12 +157,12 @@ struct DisplayUpdates;
|
||||
impl RdpServerDisplayUpdates for DisplayUpdates {
|
||||
async fn next_update(&mut self) -> Option<DisplayUpdate> {
|
||||
sleep(Duration::from_millis(100)).await;
|
||||
let mut rng = thread_rng();
|
||||
let mut rng = rand::rng();
|
||||
|
||||
let y: u16 = rng.gen_range(0..HEIGHT);
|
||||
let height = NonZeroU16::new(rng.gen_range(1..=HEIGHT.checked_sub(y).unwrap())).unwrap();
|
||||
let x: u16 = rng.gen_range(0..WIDTH);
|
||||
let width = NonZeroU16::new(rng.gen_range(1..=WIDTH.checked_sub(x).unwrap())).unwrap();
|
||||
let y: u16 = rng.random_range(0..HEIGHT);
|
||||
let height = NonZeroU16::new(rng.random_range(1..=HEIGHT.checked_sub(y).unwrap())).unwrap();
|
||||
let x: u16 = rng.random_range(0..WIDTH);
|
||||
let width = NonZeroU16::new(rng.random_range(1..=WIDTH.checked_sub(x).unwrap())).unwrap();
|
||||
let capacity = usize::from(width.get())
|
||||
.checked_mul(usize::from(height.get()))
|
||||
.unwrap()
|
||||
@@ -170,9 +170,9 @@ impl RdpServerDisplayUpdates for DisplayUpdates {
|
||||
.unwrap();
|
||||
let mut data = Vec::with_capacity(capacity);
|
||||
for _ in 0..(data.capacity() / 4) {
|
||||
data.push(rng.r#gen());
|
||||
data.push(rng.r#gen());
|
||||
data.push(rng.r#gen());
|
||||
data.push(rng.random());
|
||||
data.push(rng.random());
|
||||
data.push(rng.random());
|
||||
data.push(255);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user