message: Add valid filename check
diff: @@ -17,6 +17,12 @@ std::string gen_password() {
  }
  +bool valid_filename(const string& name) {
  + if (name.empty()) return false;
  + if (std::find_if(name.begin(), name.end(), !boost::algorithm::is_alnum() && !boost::algorithm::is_any_of("._")) != name.end()) return false;
  + return boost::filesystem::path(name).filename().string() == name;
  +}
  +
  void wallet_manager::set_timeout(const std::chrono::seconds& t) {
  timeout = t;
  timeout_time = std::chrono::system_clock::now() + timeout;
  @@ -34,7 +40,8 @@ void wallet_manager::check_timeout() {
  std::string wallet_manager::create(const std::string& name) {
  check_timeout();
  - std::string password = gen_password();
  +
  + EOS_ASSERT(valid_filename(name), wallet_exception, "Invalid filename, path not allowed in wallet name ${n}", ("n", name));
  auto wallet_filename = dir / (name + file_ext);
  @@ -42,6 +49,7 @@ std::string wallet_manager::create(const std::string& name) {
  EOS_THROW(chain::wallet_exist_exception, "Wallet with name: '${n}' already exists at ${path}", ("n", name)("path",fc::path(wallet_filename)));
  }
  + std::string password = gen_password();
  wallet_data d;
  auto wallet = make_unique<wallet_api>(d);
  wallet->set_password(password);
  @@ -65,6 +73,9 @@ std::string wallet_manager::create(const std::string& name) {
  void wallet_manager::open(const std::string& name) {
  check_timeout();
  +
  + EOS_ASSERT(valid_filename(name), wallet_exception, "Invalid filename, path not allowed in wallet name ${n}", ("n", name));
  +
  wallet_data d;
  auto wallet = std::make_unique<wallet_api>(d);
  auto wallet_filename = dir / (name + file_ext);
  