Skip to main content

max / goingson

Upgrade sha2 to 0.11 sha2 0.11's digest output is a hybrid-array Array, which has no LowerHex impl, so the three format!("{:x}", ..) digest sites become hex::encode. Same lowercase hex, so attachment blob filenames and the sync blob checksums keep resolving. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Author: Max Johnson <me@maxj.phd> · 2026-07-22 00:35 UTC
Commit: 6fc4566ac2cecb6760550347663b1acf44944be1
Parent: 24e571b
6 files changed, +18 insertions, -7 deletions
M Cargo.lock +12 -3
@@ -870,6 +870,12 @@ dependencies = [
870 870 ]
871 871
872 872 [[package]]
873 + name = "const-oid"
874 + version = "0.10.2"
875 + source = "registry+https://github.com/rust-lang/crates.io-index"
876 + checksum = "a6ef517f0926dd24a1582492c791b6a4818a4d94e789a334894aa15b0d12f55c"
877 +
878 + [[package]]
873 879 name = "convert_case"
874 880 version = "0.4.0"
875 881 source = "registry+https://github.com/rust-lang/crates.io-index"
@@ -1284,6 +1290,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
1284 1290 checksum = "f1dd6dbb5841937940781866fa1281a1ff7bd3bf827091440879f9994983d5c2"
1285 1291 dependencies = [
1286 1292 "block-buffer 0.12.1",
1293 + "const-oid",
1287 1294 "crypto-common 0.2.2",
1288 1295 "ctutils",
1289 1296 ]
@@ -2202,7 +2209,7 @@ dependencies = [
2202 2209 "chrono-tz",
2203 2210 "serde",
2204 2211 "serde_json",
2205 - "sha2 0.10.9",
2212 + "sha2 0.11.0",
2206 2213 "sqlx",
2207 2214 "strum",
2208 2215 "strum_macros",
@@ -2241,6 +2248,7 @@ dependencies = [
2241 2248 "futures-util",
2242 2249 "goingson-core",
2243 2250 "goingson-db-sqlite",
2251 + "hex",
2244 2252 "iana-time-zone",
2245 2253 "ical",
2246 2254 "icalendar",
@@ -2259,7 +2267,7 @@ dependencies = [
2259 2267 "rfd",
2260 2268 "serde",
2261 2269 "serde_json",
2262 - "sha2 0.10.9",
2270 + "sha2 0.11.0",
2263 2271 "sqlx",
2264 2272 "synckit-client",
2265 2273 "tauri",
@@ -6240,6 +6248,7 @@ dependencies = [
6240 6248 "bytes",
6241 6249 "chacha20poly1305",
6242 6250 "chrono",
6251 + "hex",
6243 6252 "keyring",
6244 6253 "parking_lot",
6245 6254 "rand 0.10.2",
@@ -6247,7 +6256,7 @@ dependencies = [
6247 6256 "rusqlite",
6248 6257 "serde",
6249 6258 "serde_json",
6250 - "sha2 0.10.9",
6259 + "sha2 0.11.0",
6251 6260 "thiserror 2.0.18",
6252 6261 "tokio",
6253 6262 "tokio-stream",
M Cargo.toml +2 -1
@@ -47,7 +47,8 @@ reqwest = { version = "0.13", default-features = false, features = ["json", "nat
47 47 # Security / OAuth
48 48 rand = "0.10"
49 49 base64 = "0.22"
50 - sha2 = "0.10"
50 + sha2 = "0.11"
51 + hex = "0.4"
51 52
52 53 # Secure credential storage
53 54 # Pinned to the v1 store bundle explicitly: Apple Keychain, Windows credential
@@ -56,6 +56,7 @@ thiserror = { workspace = true }
56 56 base64 = { workspace = true }
57 57 rand = { workspace = true }
58 58 sha2 = { workspace = true }
59 + hex = { workspace = true }
59 60 async-trait = { workspace = true }
60 61
61 62 # Logging
@@ -147,7 +147,7 @@ pub async fn add_attachment(
147 147 let hash = {
148 148 let mut hasher = Sha256::new();
149 149 hasher.update(&file_data);
150 - format!("{:x}", hasher.finalize())
150 + hex::encode(hasher.finalize())
151 151 };
152 152 std::fs::create_dir_all(&blobs_dir)
153 153 .map_err(|e| format!("Failed to create blobs directory: {e}"))?;
@@ -543,7 +543,7 @@ fn build_attachment_meta_deferred(
543 543 let hash = {
544 544 let mut hasher = Sha256::new();
545 545 hasher.update(&part.data);
546 - format!("{:x}", hasher.finalize())
546 + hex::encode(hasher.finalize())
547 547 };
548 548
549 549 let size = part.data.len();
@@ -133,7 +133,7 @@ pub async fn download_missing_blobs(
133 133 // attacker, but a server-side corruption or mis-bound ciphertext would otherwise
134 134 // land wrong bytes under a trusted name and be handed to open::that()
135 135 // (ultra-fuzz Run #28 S1). Hashing here, before the rename, keeps the store clean.
136 - let actual = format!("{:x}", Sha256::digest(&data));
136 + let actual = hex::encode(Sha256::digest(&data));
137 137 if actual != *hash {
138 138 warn!(
139 139 "Blob {} failed integrity check (content hashed to {}); discarding download",