Keyboard-interactive authentication support for SSHSocket.
Exemplo n.º 1
0
 public void OnKeyboardInteractiveAuthenticationStarted()
 {
     _keyboardInteractiveAuthHanlder =
         new KeyboardInteractiveAuthHanlder(
             (data) => {
         if (_channelHandler != null)
         {
             _channelHandler.OnData(new DataFragment(data, 0, data.Length));
         }
     });
 }
Exemplo n.º 2
0
        public void OnKeyboardInteractiveAuthenticationCompleted(bool success, Exception error)
        {
            _keyboardInteractiveAuthHanlder = null;
            try {
                if (!success)
                {
                    ForceDisposed();
                    throw new Exception(PEnv.Strings.GetString("Message.SSHSocket.AuthenticationFailed"));
                }

                OpenShell();
            }
            catch (Exception e) {
                // FIXME:
                //  the message will not be displayed...
                OnAbnormalTerminationCore(e.Message);
            }
        }
Exemplo n.º 3
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; //まだ利用可能でない
     }
 }
Exemplo n.º 4
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; //まだ利用可能でない
            }
        }
Exemplo n.º 5
0
 public void OnKeyboardInteractiveAuthenticationStarted()
 {
     _keyboardInteractiveAuthHanlder =
         new KeyboardInteractiveAuthHanlder(
             (data) => {
                 if (_channelHandler != null) {
                     _channelHandler.OnData(new DataFragment(data, 0, data.Length));
                 }
             });
 }
Exemplo n.º 6
0
        public void OnKeyboardInteractiveAuthenticationCompleted(bool success, Exception error)
        {
            _keyboardInteractiveAuthHanlder = null;
            try {
                if (!success) {
                    ForceDisposed();
                    throw new Exception(PEnv.Strings.GetString("Message.SSHSocket.AuthenticationFailed"));
                }

                OpenShell();
            }
            catch (Exception e) {
                // FIXME:
                //  the message will not be displayed...
                OnAbnormalTerminationCore(e.Message);
            }
        }