void secure_session_test(){
      std::string mes("the test message");
      callback client_callbacks;
      std::string client_id("client");
      std::string server_id("server");
      
      themispp::secure_session_t client(std::vector<uint8_t>(client_id.c_str(), client_id.c_str()+client_id.length()), std::vector<uint8_t>(client_priv, client_priv+sizeof(client_priv)), &client_callbacks);

      callback server_callbacks;
      themispp::secure_session_t server(std::vector<uint8_t>(server_id.c_str(), server_id.c_str()+server_id.length()), std::vector<uint8_t>(server_priv, server_priv+sizeof(server_priv)), &server_callbacks);

      std::vector<uint8_t> control_msg1=client.init();
      std::vector<uint8_t> control_msg2=server.unwrap(control_msg1);
      std::vector<uint8_t> control_msg3=client.unwrap(control_msg2);
      std::vector<uint8_t> control_msg4=server.unwrap(control_msg3);
      std::vector<uint8_t> control_msg5=client.unwrap(control_msg4);
      sput_fail_unless(server.is_established(), "server ready", __LINE__);
      sput_fail_unless(client.is_established(), "client ready", __LINE__);

      std::vector<uint8_t> msg1=client.wrap(std::vector<uint8_t>(mes.c_str(), mes.c_str()+mes.length()+1));
      std::vector<uint8_t> msg2=server.unwrap(msg1);
      sput_fail_unless(strcmp(mes.c_str(), (const char*)(&msg2[0]))==0, "server get message", __LINE__);

      std::vector<uint8_t> msg3=server.wrap(std::vector<uint8_t>(mes.c_str(), mes.c_str()+mes.length()+1));
      std::vector<uint8_t> msg4=client.unwrap(msg3);
      sput_fail_unless(strcmp(mes.c_str(), (const char*)(&msg4[0]))==0, "client get message", __LINE__);
    }
Exemple #2
0
void Game_Manager::print_server_info(void) {
	Server_Manager::print_server_info();
	LOG_INFO("Game_Server server_id:%d player_pool_ free = %d, used = %d", server_id(), player_pool_.free_obj_list_size(), player_pool_.used_obj_list_size());
}