From 6661a587701b51c2b27fdb6aa227124c89960ec4 Mon Sep 17 00:00:00 2001 From: timvisee Date: Tue, 14 Feb 2023 13:59:41 +0100 Subject: [PATCH] Revert "Use shorter passphrase words, make them less than 32-characters long" This reverts commit fdf8ae9201ec02afb17775b09e6dda3e9bf5c696. This is reverted because the password length limit is now set much higher, see: https://github.com/timvisee/send/pull/147 --- src/cmd/arg/gen_passphrase.rs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/cmd/arg/gen_passphrase.rs b/src/cmd/arg/gen_passphrase.rs index 9e83cc1..751c5e0 100644 --- a/src/cmd/arg/gen_passphrase.rs +++ b/src/cmd/arg/gen_passphrase.rs @@ -1,11 +1,8 @@ -use chbs::{config::BasicConfig, prelude::*, word::WordList}; +use chbs; use clap::Arg; use super::{CmdArg, CmdArgFlag}; -/// How many words the passphrase should consist of. -const PASSPHRASE_WORDS: usize = 5; - /// The passphrase generation argument. pub struct ArgGenPassphrase {} @@ -13,10 +10,7 @@ impl ArgGenPassphrase { /// Generate a cryptographically secure passphrase that is easily /// remembered using diceware. pub fn gen_passphrase() -> String { - let mut config = BasicConfig::default(); - config.words = PASSPHRASE_WORDS; - config.word_provider = WordList::builtin_eff_general_short().sampler(); - config.to_scheme().generate() + chbs::passphrase() } }