Procházet zdrojové kódy

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
timvisee před 2 roky
rodič
revize
6661a58770
1 změnil soubory, kde provedl 2 přidání a 8 odebrání
  1. 2 8
      src/cmd/arg/gen_passphrase.rs

+ 2 - 8
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()
     }
 }