build: update rand to 0.9

We already have both rand 0.8 and rand 0.9
in our dependency tree.

We still need rand 0.8 because
public APIs of rPGP 0.17.0 and Iroh 0.35.0
use rand 0.8 types in public APIs,
so it is imported as rand_old.
This commit is contained in:
link2xt
2025-10-26 00:54:26 +00:00
committed by l
parent 0e30dd895f
commit f428033d95
15 changed files with 22 additions and 31 deletions

View File

@@ -13,7 +13,6 @@ use anyhow::{Context as _, Result};
use base64::Engine as _;
use pgp::crypto::aead::{AeadAlgorithm, ChunkSize};
use pgp::crypto::sym::SymmetricKeyAlgorithm;
use rand::thread_rng;
use tokio::sync::RwLock;
use crate::context::Context;
@@ -80,8 +79,7 @@ pub(crate) fn encrypt_device_token(device_token: &str) -> Result<String> {
.first()
.context("No encryption subkey found")?;
let padded_device_token = pad_device_token(device_token);
let mut rng = thread_rng();
let mut rng = rand_old::thread_rng();
let mut msg = pgp::composed::MessageBuilder::from_bytes("", padded_device_token).seipd_v2(
&mut rng,
SymmetricKeyAlgorithm::AES128,