mirror of
https://github.com/chatmail/core.git
synced 2026-04-26 01:46:34 +03:00
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:
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user