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

Audit freshly generated passwords #761

Merged
merged 1 commit into from May 4, 2018

Conversation

muesli
Copy link
Contributor

@muesli muesli commented May 3, 2018

Even generated passwords should be audited, since nothing stops the random
generator from creating one called "password" (if you only try long enough or
are particularly unlucky).

@dominikschulz dominikschulz self-requested a review May 4, 2018 08:28
@dominikschulz dominikschulz added the feature Enhancements and new features label May 4, 2018
var password string

validator := crunchy.NewValidator()
for i := 0; i < 3 && validator.Check(password) != nil; i++ {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You rely on the fact that the validator complains if the inital password is empty?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct. Could be done "cleaner" with a couple more lines of code, but then I'm not sure it's actually more readable. What do you think?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it's fine. Just wanted to understand your reasoning.

@codecov
Copy link

codecov bot commented May 4, 2018

Codecov Report

Merging #761 into master will increase coverage by 0.02%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #761      +/-   ##
==========================================
+ Coverage   64.03%   64.05%   +0.02%     
==========================================
  Files         166      166              
  Lines        8882     8888       +6     
==========================================
+ Hits         5687     5693       +6     
  Misses       2514     2514              
  Partials      681      681
Impacted Files Coverage Δ
pkg/pwgen/pwgen.go 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 38a71e0...eaa48bd. Read the comment docs.

Copy link
Member

@dominikschulz dominikschulz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Even generated passwords should be audited, since nothing stops the random
generator from creating one called "password" (if you only try long enough or
are particularly unlucky).
@dominikschulz dominikschulz merged commit 61451ec into gopasspw:master May 4, 2018
kpitt pushed a commit to kpitt/gopass that referenced this pull request Jul 21, 2022
Even generated passwords should be audited, since nothing stops the random
generator from creating one called "password" (if you only try long enough or
are particularly unlucky).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Enhancements and new features
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants