Skip to content

Commit 1109293

Browse files
authored
Update Rust to 1.84.1 (#5508)
- also update the crates - add necessary modifications for `rand` upgrade - `small_rng` is enabled by default now
1 parent 3c29f82 commit 1109293

8 files changed

+167
-85
lines changed

Cargo.lock

+151-69
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

+5-5
Original file line numberDiff line numberDiff line change
@@ -75,21 +75,21 @@ tokio = { version = "1.43.0", features = ["rt-multi-thread", "fs", "io-util", "p
7575

7676
# A generic serialization/deserialization framework
7777
serde = { version = "1.0.217", features = ["derive"] }
78-
serde_json = "1.0.137"
78+
serde_json = "1.0.138"
7979

8080
# A safe, extensible ORM and Query builder
81-
diesel = { version = "2.2.6", features = ["chrono", "r2d2", "numeric"] }
81+
diesel = { version = "2.2.7", features = ["chrono", "r2d2", "numeric"] }
8282
diesel_migrations = "2.2.0"
8383
diesel_logger = { version = "0.4.0", optional = true }
8484

8585
derive_more = { version = "1.0.0", features = ["from", "into", "as_ref", "deref", "display"] }
8686
diesel-derive-newtype = "2.1.2"
8787

8888
# Bundled/Static SQLite
89-
libsqlite3-sys = { version = "0.30.1", features = ["bundled"], optional = true }
89+
libsqlite3-sys = { version = "0.31.0", features = ["bundled"], optional = true }
9090

9191
# Crypto-related libraries
92-
rand = { version = "0.8.5", features = ["small_rng"] }
92+
rand = "0.9.0"
9393
ring = "0.17.8"
9494

9595
# UUID generation
@@ -147,7 +147,7 @@ cookie = "0.18.1"
147147
cookie_store = "0.21.1"
148148

149149
# Used by U2F, JWT and PostgreSQL
150-
openssl = "0.10.68"
150+
openssl = "0.10.69"
151151

152152
# CLI argument parsing
153153
pico-args = "0.5.0"

docker/DockerSettings.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ vault_image_digest: "sha256:cb6b2095a4afc1d9d243a33f6d09211f40e3d82c7ae829fd025d
55
# We use the linux/amd64 platform shell scripts since there is no difference between the different platform scripts
66
# https://github.com/tonistiigi/xx | https://hub.docker.com/r/tonistiigi/xx/tags
77
xx_image_digest: "sha256:9c207bead753dda9430bdd15425c6518fc7a03d866103c516a2c6889188f5894"
8-
rust_version: 1.84.0 # Rust version to be used
8+
rust_version: 1.84.1 # Rust version to be used
99
debian_version: bookworm # Debian release name to be used
1010
alpine_version: "3.21" # Alpine version to be used
1111
# For which platforms/architectures will we try to build images

docker/Dockerfile.alpine

+4-4
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ FROM --platform=linux/amd64 docker.io/vaultwarden/web-vault@sha256:cb6b2095a4afc
3232
########################## ALPINE BUILD IMAGES ##########################
3333
## NOTE: The Alpine Base Images do not support other platforms then linux/amd64
3434
## And for Alpine we define all build images here, they will only be loaded when actually used
35-
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:x86_64-musl-stable-1.84.0 AS build_amd64
36-
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:aarch64-musl-stable-1.84.0 AS build_arm64
37-
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:armv7-musleabihf-stable-1.84.0 AS build_armv7
38-
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:arm-musleabi-stable-1.84.0 AS build_armv6
35+
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:x86_64-musl-stable-1.84.1 AS build_amd64
36+
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:aarch64-musl-stable-1.84.1 AS build_arm64
37+
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:armv7-musleabihf-stable-1.84.1 AS build_armv7
38+
FROM --platform=linux/amd64 ghcr.io/blackdex/rust-musl:arm-musleabi-stable-1.84.1 AS build_armv6
3939

4040
########################## BUILD IMAGE ##########################
4141
# hadolint ignore=DL3006

docker/Dockerfile.debian

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ FROM --platform=linux/amd64 docker.io/tonistiigi/xx@sha256:9c207bead753dda9430bd
3636

3737
########################## BUILD IMAGE ##########################
3838
# hadolint ignore=DL3006
39-
FROM --platform=$BUILDPLATFORM docker.io/library/rust:1.84.0-slim-bookworm AS build
39+
FROM --platform=$BUILDPLATFORM docker.io/library/rust:1.84.1-slim-bookworm AS build
4040
COPY --from=xx / /
4141
ARG TARGETARCH
4242
ARG TARGETVARIANT

rust-toolchain.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "1.84.0"
2+
channel = "1.84.1"
33
components = [ "rustfmt", "clippy" ]
44
profile = "minimal"

src/api/core/accounts.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -925,9 +925,9 @@ async fn password_hint(data: Json<PasswordHintData>, mut conn: DbConn) -> EmptyR
925925
// paths that send mail take noticeably longer than ones that
926926
// don't. Add a randomized sleep to mitigate this somewhat.
927927
use rand::{rngs::SmallRng, Rng, SeedableRng};
928-
let mut rng = SmallRng::from_entropy();
928+
let mut rng = SmallRng::from_os_rng();
929929
let delta: i32 = 100;
930-
let sleep_ms = (1_000 + rng.gen_range(-delta..=delta)) as u64;
930+
let sleep_ms = (1_000 + rng.random_range(-delta..=delta)) as u64;
931931
tokio::time::sleep(tokio::time::Duration::from_millis(sleep_ms)).await;
932932
Ok(())
933933
} else {

src/crypto.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,11 +56,11 @@ pub fn encode_random_bytes<const N: usize>(e: Encoding) -> String {
5656
pub fn get_random_string(alphabet: &[u8], num_chars: usize) -> String {
5757
// Ref: https://rust-lang-nursery.github.io/rust-cookbook/algorithms/randomness.html
5858
use rand::Rng;
59-
let mut rng = rand::thread_rng();
59+
let mut rng = rand::rng();
6060

6161
(0..num_chars)
6262
.map(|_| {
63-
let i = rng.gen_range(0..alphabet.len());
63+
let i = rng.random_range(0..alphabet.len());
6464
alphabet[i] as char
6565
})
6666
.collect()

0 commit comments

Comments
 (0)