Inheritance: SSHConnectionEventReceiverBase, IPoderosaSocket, ITerminalOutput, IKeyboardInteractiveAuthenticationHandler
Ejemplo n.º 1
0
        public SSHTerminalConnection(ISSHLoginParameter ssh)
            : base((ITCPParameter)ssh.GetAdapter(typeof(ITCPParameter)))
        {
            _sshLoginParameter = ssh;
            SSHSocket s = new SSHSocket(this);

            _sshSocket      = s;
            _socket         = s;
            _terminalOutput = s;
        }
Ejemplo n.º 2
0
        //シェルを開き、イベントレシーバを書き換える
        private void SuccessfullyExit()
        {
            SSHSocket sshsocket = new SSHSocket(_parent);

            sshsocket.SetSSHConnection(_connection);
            sshsocket.RepeatAsyncRead(_callback); //_callbackから先の処理は同じ
            _connection.EventReceiver = sshsocket;
            _parent.ReplaceSSHSocket(sshsocket);
            sshsocket.OpenShell();
        }
Ejemplo n.º 3
0
 public void AttachTransmissionSide(ISSHConnection con, AuthenticationStatus authStatus)
 {
     _sshSocket.SetSSHConnection(con);
     if (authStatus == AuthenticationStatus.Success)
     {
         SSHSocket ss = (SSHSocket)_sshSocket;
         ss.OpenShell();
     }
     else if (authStatus == AuthenticationStatus.NeedKeyboardInput)
     {
         SSHSocket ss = (SSHSocket)_sshSocket;
         ss.OpenKeyboardInteractiveShell();
     }
 }
Ejemplo n.º 4
0
 public void AttachTransmissionSide(SSHConnection con)
 {
     _sshSocket.SetSSHConnection(con);
     if (con.AuthenticationResult == AuthenticationResult.Success)
     {
         SSHSocket ss = (SSHSocket)_sshSocket; //Keyboard-Interactiveがらみでちょっと不自然になってるな
         ISSHSubsystemParameter subsystem = (ISSHSubsystemParameter)_sshLoginParameter.GetAdapter(typeof(ISSHSubsystemParameter));
         if (subsystem != null)
         {
             ss.OpenSubsystem(subsystem.SubsystemName);
         }
         else //ふつうのシェル
         {
             ss.OpenShell();
         }
     }
 }
Ejemplo n.º 5
0
 public SSHTerminalConnection(ISSHLoginParameter ssh)
     : base((ITCPParameter)ssh.GetAdapter(typeof(ITCPParameter)))
 {
     _sshLoginParameter = ssh;
     if (ssh.AuthenticationType != AuthenticationType.KeyboardInteractive)
     {
         SSHSocket s = new SSHSocket(this);
         _sshSocket      = s;
         _socket         = s;
         _terminalOutput = s;
     }
     else
     {
         KeyboardInteractiveAuthHanlder s = new KeyboardInteractiveAuthHanlder(this);
         _sshSocket      = s;
         _socket         = s;
         _terminalOutput = null; //まだ利用可能でない
     }
 }
 //�V�F����J���A�C�x���g���V�[�o�����������
 private void SuccessfullyExit()
 {
     SSHSocket sshsocket = new SSHSocket(_parent);
     sshsocket.SetSSHConnection(_connection);
     sshsocket.RepeatAsyncRead(_callback); //_callback�����̏����͓���
     _connection.EventReceiver = sshsocket;
     _parent.ReplaceSSHSocket(sshsocket);
     sshsocket.OpenShell();
 }
Ejemplo n.º 7
0
 //Keyboard-interactiveの場合、認証成功後にこれを実行
 internal void ReplaceSSHSocket(SSHSocket sshsocket)
 {
     _sshSocket      = sshsocket;
     _socket         = sshsocket;
     _terminalOutput = sshsocket;
 }
Ejemplo n.º 8
0
 public SSHTerminalConnection(ISSHLoginParameter ssh)
     : base((ITCPParameter)ssh.GetAdapter(typeof(ITCPParameter)))
 {
     _sshLoginParameter = ssh;
     SSHSocket s = new SSHSocket(this);
     _sshSocket = s;
     _socket = s;
     _terminalOutput = s;
 }
Ejemplo n.º 9
0
 //Keyboard-interactiveの場合、認証成功後にこれを実行
 internal void ReplaceSSHSocket(SSHSocket sshsocket)
 {
     _sshSocket = sshsocket;
     _socket = sshsocket;
     _terminalOutput = sshsocket;
 }
Ejemplo n.º 10
0
        private SSHConnectionEventReceiverBase _sshSocket; //Keyboard-interactiveのときの認証中のみ_sshSocketはKeyboardInteractiveAuthHanlder

        #endregion Fields

        #region Constructors

        public SSHTerminalConnection(ISSHLoginParameter ssh)
            : base((ITCPParameter)ssh.GetAdapter(typeof(ITCPParameter)))
        {
            _sshLoginParameter = ssh;
            if (ssh.AuthenticationType != AuthenticationType.KeyboardInteractive) {
                SSHSocket s = new SSHSocket(this);
                _sshSocket = s;
                _socket = s;
                _terminalOutput = s;
            }
            else {
                KeyboardInteractiveAuthHanlder s = new KeyboardInteractiveAuthHanlder(this);
                _sshSocket = s;
                _socket = s;
                _terminalOutput = null; //まだ利用可能でない
            }
        }