Skip to content
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

Merged
merged 1 commit into from
Jul 13, 2022

Conversation

pleshevskiy
Copy link
Contributor

This will probably fix #103, but I can't check it.

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")?;
Copy link
Owner

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<_>>();
Copy link
Owner

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 :)

Copy link
Contributor Author

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

@brxken128
Copy link
Owner

Nice work as usual my friend, thank you so much for all of these improvements!

@brxken128 brxken128 merged commit 89fe842 into brxken128:master Jul 13, 2022
@brxken128
Copy link
Owner

I believe this did fix #103 - it seems to work now at least.

Good catch :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] --auto parameter
2 participants