-
Notifications
You must be signed in to change notification settings - Fork 512
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
Passphrase fixups #906
Passphrase fixups #906
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,13 +142,12 @@ func (s *GenericKeyStore) AddKey(keyInfo KeyInfo, privKey data.PrivateKey) error | |
name := filepath.Join(keyInfo.Gun, privKey.ID()) | ||
for attempts := 0; ; attempts++ { | ||
chosenPassphrase, giveup, err = s.PassRetriever(name, keyInfo.Role, true, attempts) | ||
if err != nil { | ||
continue | ||
if err == nil { | ||
break | ||
} | ||
if giveup || attempts > 10 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Non-blocking: wondering if we should decrease this number to 3 or some such? That would give the user 5 tries. (currently it fails out after 12 tries - I was wondering whether that's too many) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree. 10 is feeling like too many. Also would be good to move the exact number to a const. |
||
return ErrAttemptsExceeded{} | ||
} | ||
break | ||
} | ||
|
||
if chosenPassphrase != "" { | ||
|
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.
Yeah, this is a good reason for us to switch to crypto/terminal in the future. Better API for retrieving passwords from the terminal.