-
Notifications
You must be signed in to change notification settings - Fork 89
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
Safer way to handle secret information of cli_wallet #1171 #97
Safer way to handle secret information of cli_wallet #1171 #97
Conversation
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 like this approach much better.
src/rpc/cli.cpp
Outdated
@@ -250,6 +249,12 @@ void cli::getline( const fc::string& prompt, fc::string& line) | |||
FC_THROW_EXCEPTION( fc::eof_exception, "" ); | |||
line = line_read; | |||
// we don't need here to add line in editline's history, cause it will be doubled | |||
if (cli_check_secret(line_read)) { | |||
el_no_echo = 1; | |||
line_read = readline("Enter 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.
Must free(line_read)
before re-using it
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.
done
src/rpc/cli.cpp
Outdated
el_no_echo = 1; | ||
line_read = readline("Enter password: "); | ||
el_no_echo = 0; | ||
line = line + ' ' + line_read; |
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.
Must add check for null
like above
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.
done
@cogutvalera do you have time to continue the work on this? |
yes sure |
@cogutvalera any estimate when you do this? |
I will try to do it till the end of this week, was unplanned busy |
…for nullptr read_line before using it
60bb2ee
to
22d9ce2
Compare
22d9ce2
to
7208054
Compare
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.
Thanks!
This PR is for fixing bitshares/bitshares-core#1171 issue
Safer way to handle secret information of cli_wallet
Depends on already merged PRs: