Safer way to handle secret information of cli_wallet #1171

This commit is contained in:
Valera Cogut 2018-11-21 15:49:36 +02:00
parent ab9b4a234e
commit 59ad7300ec

View file

@ -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();
}
}