From 0a8e9c0fe2492538d3cf96799c1b8a776bdae857 Mon Sep 17 00:00:00 2001 From: Cole Miller Date: Tue, 7 Jan 2025 10:00:11 -0500 Subject: [PATCH] Use a temporary fork of oo7 (#22751) Release Notes: - N/A --- Cargo.lock | 3 +-- crates/gpui/Cargo.toml | 2 +- crates/gpui/src/platform/linux/platform.rs | 10 ++-------- 3 files changed, 4 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9d10fe090a..cc77ab6e8e 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8408,8 +8408,7 @@ checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" [[package]] name = "oo7" version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8fc6ce4692fbfd044ce22ca07dcab1a30fa12432ca2aa5b1294eca50d3332a24" +source = "git+https://github.com/zed-industries/oo7?branch=avoid-crypto-panic#9d5d5fcd7e4e0add9b420ffb58f67661b0b37568" dependencies = [ "aes", "async-fs 2.1.2", diff --git a/crates/gpui/Cargo.toml b/crates/gpui/Cargo.toml index 63aac122a8..952fed02fe 100644 --- a/crates/gpui/Cargo.toml +++ b/crates/gpui/Cargo.toml @@ -148,7 +148,7 @@ pathfinder_geometry = "0.5" [target.'cfg(any(target_os = "linux", target_os = "freebsd"))'.dependencies] # Always used flume = "0.11" -oo7 = "0.3.0" +oo7 = { git = "https://github.com/zed-industries/oo7", branch = "avoid-crypto-panic" } # Used in both windowing options ashpd = { workspace = true, optional = true } diff --git a/crates/gpui/src/platform/linux/platform.rs b/crates/gpui/src/platform/linux/platform.rs index 52b7e7e8d3..e897b5eb48 100644 --- a/crates/gpui/src/platform/linux/platform.rs +++ b/crates/gpui/src/platform/linux/platform.rs @@ -1,6 +1,5 @@ use std::{ env, - panic::AssertUnwindSafe, path::{Path, PathBuf}, process::Command, rc::Rc, @@ -18,7 +17,7 @@ use std::{ use anyhow::{anyhow, Context as _}; use async_task::Runnable; use calloop::{channel::Channel, LoopSignal}; -use futures::{channel::oneshot, future::FutureExt}; +use futures::channel::oneshot; use util::ResultExt as _; #[cfg(any(feature = "wayland", feature = "x11"))] use xkbcommon::xkb::{self, Keycode, Keysym, State}; @@ -485,12 +484,7 @@ impl Platform for P { let username = attributes .get("username") .ok_or_else(|| anyhow!("Cannot find username in stored credentials"))?; - // oo7 panics if the retrieved secret can't be decrypted due to - // unexpected padding. - let secret = AssertUnwindSafe(item.secret()) - .catch_unwind() - .await - .map_err(|_| anyhow!("oo7 panicked while trying to read credentials"))??; + let secret = item.secret().await?; // we lose the zeroizing capabilities at this boundary, // a current limitation GPUI's credentials api