Safer way to handle secret information of cli_wallet #1171
This commit is contained in:
parent
ab9b4a234e
commit
59ad7300ec
1 changed files with 9 additions and 0 deletions
|
|
@ -327,6 +327,15 @@ void cli::getline( const std::string& prompt, std::string& line)
|
|||
line = line_read;
|
||||
// we don't need here to add line in editline's history, cause it will be doubled
|
||||
free(line_read);
|
||||
if (cli_check_secret(line_read)) {
|
||||
el_no_echo = 1;
|
||||
line_read = readline("Enter password: ");
|
||||
el_no_echo = 0;
|
||||
if( line_read == nullptr )
|
||||
FC_THROW_EXCEPTION( fc::eof_exception, "" );
|
||||
line = line + ' ' + line_read;
|
||||
}
|
||||
free(line_read);
|
||||
}).wait();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue