Radish alpha
h
rad:z3gqcJUoA1n9HaHKufZs5FCSGazv5
Radicle Heartwood Protocol & Stack
Radicle
Git
profile: Treat empty passphrase as no passphrase
Merged lorenz opened 1 year ago
1 file changed +6 -0 d39ba83c 1d57778f
modified radicle/src/profile.rs
@@ -104,6 +104,12 @@ pub mod env {
        let Ok(passphrase) = var(RAD_PASSPHRASE) else {
            return None;
        };
+
        if passphrase.is_empty() {
+
            // `ssh-keygen` treats the empty string as no passphrase,
+
            // so we do the same.
+
            log::trace!(target: "radicle", "Treating empty passphrase as no passphrase.");
+
            return None;
+
        }
        Some(super::Passphrase::from(passphrase))
    }