chore(deps): update rust crate getrandom to 0.3 (#13685)

Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: FabianLars <github@fabianlars.de>
This commit is contained in:
renovate[bot]
2025-06-25 23:05:29 +02:00
committed by GitHub
parent 6a4ea10274
commit 560067cd7e
12 changed files with 15 additions and 15 deletions

4
Cargo.lock generated
View File

@@ -8377,7 +8377,7 @@ dependencies = [
"dirs 6.0.0",
"dunce",
"embed_plist",
"getrandom 0.2.15",
"getrandom 0.3.3",
"glob",
"gtk",
"heck 0.5.0",
@@ -8810,7 +8810,7 @@ dependencies = [
"cargo_metadata",
"ctor",
"dunce",
"getrandom 0.2.15",
"getrandom 0.3.3",
"glob",
"html5ever",
"http 1.3.1",

View File

@@ -30,7 +30,7 @@ quote = { version = "1", optional = true }
schemars = { version = "0.8.21", features = ["url", "uuid1"], optional = true }
serde_with = "3"
aes-gcm = { version = "0.10", optional = true }
getrandom = { version = "0.2", optional = true, features = ["std"] }
getrandom = { version = "0.3", optional = true, features = ["std"] }
serialize-to-javascript = { version = "=0.1.1", optional = true }
ctor = "0.2"
json5 = { version = "0.4", optional = true }
@@ -55,7 +55,7 @@ http = "1"
swift-rs = { version = "1", optional = true, features = ["build"] }
[dev-dependencies]
getrandom = { version = "0.2", features = ["std"] }
getrandom = { version = "0.3", features = ["std"] }
serial_test = "3"
[features]

View File

@@ -9,7 +9,7 @@ use std::string::FromUtf8Error;
use aes_gcm::aead::Aead;
use aes_gcm::{Aes256Gcm, KeyInit, Nonce};
use getrandom::{getrandom, Error as CsprngError};
use getrandom::Error as CsprngError;
use serialize_to_javascript::{default_template, Template};
/// The style for the isolation iframe.
@@ -56,7 +56,7 @@ impl Debug for AesGcmPair {
impl AesGcmPair {
fn new() -> Result<Self, Error> {
let mut raw = [0u8; 32];
getrandom(&mut raw)?;
getrandom::fill(&mut raw)?;
let key = aes_gcm::Key::<Aes256Gcm>::from_slice(&raw);
Ok(Self {
raw,

View File

@@ -328,7 +328,7 @@ mod tests {
fn setup_test_dirs() {
let mut random = [0; 1];
getrandom::getrandom(&mut random).unwrap();
getrandom::fill(&mut random).unwrap();
let temp = std::env::temp_dir();
let temp = temp.join(format!("tauri_resource_paths_iter_test_{}", random[0]));

View File

@@ -62,7 +62,7 @@ tauri-utils = { version = "2.5.0", features = [
"resources",
], path = "../tauri-utils" }
tauri-runtime-wry = { version = "2.7.0", path = "../tauri-runtime-wry", default-features = false, optional = true }
getrandom = "0.2"
getrandom = "0.3"
serde_repr = "0.1"
http = "1"
dirs = "6"

View File

@@ -658,7 +658,7 @@ mod tests {
};
let mut nonce = [0u8; 12];
getrandom::getrandom(&mut nonce).unwrap();
getrandom::fill(&mut nonce).unwrap();
let body_raw = vec![1, 41, 65, 12, 78];
let body_bytes = crypto_keys.aes_gcm().encrypt(&nonce, &body_raw).unwrap();

View File

@@ -1260,6 +1260,6 @@ mod z85 {
/// [Z85]: https://rfc.zeromq.org/spec/32/
pub(crate) fn generate_invoke_key() -> Result<String> {
let mut bytes = [0u8; 16];
getrandom::getrandom(&mut bytes)?;
getrandom::fill(&mut bytes)?;
Ok(z85::encode(&bytes))
}

View File

@@ -135,7 +135,7 @@ fn replace_csp_nonce(
let mut raw = [0u8; 4];
#[cfg(target_pointer_width = "16")]
let mut raw = [0u8; 2];
getrandom::getrandom(&mut raw).expect("failed to get random bytes");
getrandom::fill(&mut raw).expect("failed to get random bytes");
let nonce = usize::from_ne_bytes(raw);
nonces.push(nonce);
nonce.to_string()

View File

@@ -225,7 +225,7 @@ fn get_response(
fn random_boundary() -> String {
let mut x = [0_u8; 30];
getrandom::getrandom(&mut x).expect("failed to get random bytes");
getrandom::fill(&mut x).expect("failed to get random bytes");
(x[..])
.iter()
.map(|&x| format!("{x:x}"))

View File

@@ -80,7 +80,7 @@ pub struct ResourceTable {
impl ResourceTable {
fn new_random_rid() -> u32 {
let mut bytes = [0_u8; 4];
getrandom::getrandom(&mut bytes).expect("failed to get random bytes");
getrandom::fill(&mut bytes).expect("failed to get random bytes");
u32::from_ne_bytes(bytes)
}

View File

@@ -139,7 +139,7 @@ impl<'a, R: Runtime, M: Manager<R>> WebviewWindowBuilder<'a, R, M> {
/// let mut conf = app.config().app.windows.iter().find(|c| c.label == "template-for-multiwindow").unwrap().clone();
/// // This should be a unique label for all windows. For example, we can use a random suffix:
/// let mut buf = [0u8; 1];
/// assert_eq!(getrandom::getrandom(&mut buf), Ok(()));
/// assert_eq!(getrandom::fill(&mut buf), Ok(()));
/// conf.label = format!("my-multiwindow-{}", buf[0]);
/// let webview_window = tauri::WebviewWindowBuilder::from_config(&app, &conf)
/// .unwrap()

View File

@@ -152,7 +152,7 @@ fn get_stream_response(
fn random_boundary() -> String {
let mut x = [0_u8; 30];
getrandom::getrandom(&mut x).expect("failed to get random bytes");
getrandom::fill(&mut x).expect("failed to get random bytes");
(x[..])
.iter()
.map(|&x| format!("{x:x}"))