-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cli: some improvements for password #122
Conversation
This will probably fix brxken128#103, but I can't check it.
#[cfg(target_family = "windows")] | ||
let input = | ||
read_password_from_stdin_windows("Password: ").context("Unable to read password")?; | ||
let input = read_password_from_stdin("Password: ").context("Unable to read password")?; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I had no clue this could be determined dynamically, that's awesome!
@@ -98,14 +89,20 @@ pub fn get_password(pass_state: &PasswordState) -> Result<Protected<Vec<u8>>> { | |||
// this passphrase should provide adequate protection, while not being too hard to remember | |||
pub fn generate_passphrase() -> Protected<String> { | |||
let collection = include_str!("wordlist.lst"); | |||
let words = collection.split('\n').collect::<Vec<&str>>(); | |||
let words = collection.lines().collect::<Vec<_>>(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this automatically strip the newline from the end of the word? If so, that's pretty cool. I can spin up a VM and give it a test too :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because lines
uses split_terminator under hood
Nice work as usual my friend, thank you so much for all of these improvements! |
I believe this did fix #103 - it seems to work now at least. Good catch :) |
This will probably fix #103, but I can't check it.