anchor.diff:      Config.
   
   
  -init_per_testcase(erlang_server_openssh_client_public_key_dsa, Config) ->
  -    chk_key(sshc, 'ssh-dss', ".ssh/id_dsa", Config);
  -init_per_testcase(erlang_server_openssh_client_public_key_rsa, Config) ->
  -    chk_key(sshc, 'ssh-rsa', ".ssh/id_rsa", Config);
  -init_per_testcase(erlang_client_openssh_server_publickey_dsa, Config) ->
  -    chk_key(sshd, 'ssh-dss', ".ssh/id_dsa", Config);
  -init_per_testcase(erlang_client_openssh_server_publickey_rsa, Config) ->
  -    chk_key(sshd, 'ssh-rsa', ".ssh/id_rsa", Config);
  -
   init_per_testcase(erlang_server_openssh_client_renegotiate, Config) ->
       case os:type() of
   	{unix,_} -> ssh:start(), Config;
  
positive.code: 	throw:{skip,R} -> {skip,R}
      end.
  
  %%--------------------------------------------------------------------
  erlang_client_openssh_server_renegotiate(_Config) ->
      process_flag(trap_exit, true),
      IO = ssh_test_lib:start_io_server(),
      Ref = make_ref(),
      Parent = self(),
  
      Shell = 
  	spawn_link(
  	  fun() ->
  		  Host = ssh_test_lib:hostname(),
  		  Options = [{user_interaction, false},
  			     {silently_accept_hosts,true}],
  		  group_leader(IO, self()),
  		  {ok, ConnRef} = ssh:connect(Host, ?SSH_DEFAULT_PORT, Options),
                    ct:log("Parent = ~p, IO = ~p, Shell = ~p, ConnRef = ~p~n",[Parent, IO, self(), ConnRef]),
  		  case ssh_connection:session_channel(ConnRef, infinity) of
  		      {ok,ChannelId}  ->
  			  success = ssh_connection:ptty_alloc(ConnRef, ChannelId, []),
  			  Args = [{channel_cb, ssh_shell},
  				  {init_args,[ConnRef, ChannelId]},
  				  {cm, ConnRef}, {channel_id, ChannelId}],
  			  {ok, State} = ssh_channel:init([Args]),
  			  Parent ! {ok, Ref, ConnRef},
  			  ssh_channel:enter_loop(State);
  		      Error ->
  			  Parent ! {error, Ref, Error}
  		  end,
  		  receive
  		      nothing -> ok
  		  end
  	  end),
  
      receive
  	{error, Ref, Error} ->
  	    ct:fail("Error=~p",[Error]);
  	{ok, Ref, ConnectionRef} ->
  	    IO ! {input, self(), "echo Hej1\n"},
  	    receive_data("Hej1", ConnectionRef),
  	    Kex1 = ssh_test_lib:get_kex_init(ConnectionRef),
  	    ssh_connection_handler:renegotiate(ConnectionRef),
  	    IO ! {input, self(), "echo Hej2\n"},
  	    receive_data("Hej2", ConnectionRef),
  	    Kex2 = ssh_test_lib:get_kex_init(ConnectionRef),
  	    IO ! {input, self(), "exit\n"},
  	    receive_logout(),
  	    receive_normal_exit(Shell),
  	    true = (Kex1 =/= Kex2)
      end.
  
  %%--------------------------------------------------------------------
  erlang_client_openssh_server_password() ->
      [{doc, "Test client password option"}].
  erlang_client_openssh_server_password(Config) when is_list(Config) ->
      %% to make sure we don't public-key-auth
      UserDir = proplists:get_value(data_dir, Config),
      {error, Reason0} =
  	ssh:connect(any, ?SSH_DEFAULT_PORT, [{silently_accept_hosts, true},
  					     {user, "foo"},
  					     {password, "morot"},
  					     {user_interaction, false},
  					     {user_dir, UserDir}]),
      
      ct:log("Test of user foo that does not exist. "
  		       "Error msg: ~p~n", [Reason0]),
  
      User = string:strip(os:cmd("whoami"), right, $\n),
  
      case length(string:tokens(User, " ")) of
  	1 ->
  	    {error, Reason1} =
  		ssh:connect(any, ?SSH_DEFAULT_PORT,
  			    [{silently_accept_hosts, true},
  			     {user, User},
  			     {password, "foo"},
  			     {user_interaction, false},
  			     {user_dir, UserDir}]),
  	    ct:log("Test of wrong Pasword.  "
  			       "Error msg: ~p~n", [Reason1]);
  	_ ->
  	    ct:log("Whoami failed reason: ~n", [])
  	end.
  
  %%--------------------------------------------------------------------
  
  erlang_client_openssh_server_nonexistent_subsystem() ->
      [{doc, "Test client password option"}].
  erlang_client_openssh_server_nonexistent_subsystem(Config) when is_list(Config) ->
  
      ConnectionRef = ssh_test_lib:connect(?SSH_DEFAULT_PORT,
  					 [{user_interaction, false},
  					  silently_accept_hosts]),
  
      {ok, ChannelId} = ssh_connection:session_channel(ConnectionRef, infinity),
  
      failure = ssh_connection:subsystem(ConnectionRef, ChannelId, "foo", infinity).
  
  %%--------------------------------------------------------------------
  %
  %% Not possible to send password with openssh without user interaction
  %%
  %%--------------------------------------------------------------------
  %%--------------------------------------------------------------------
  %%% Internal functions -----------------------------------------------
  %%--------------------------------------------------------------------
  
negative.code:     end.
  
  groups() -> 
      [{erlang_client, [], [erlang_shell_client_openssh_server
  			 ]},
       {erlang_server, [], [erlang_server_openssh_client_renegotiate
  			 ]}
      ].
  
  