コード例 #1
0
        private Cipher _tCipher;                            //cipher for transmission

        // exec command for SCP
        //private bool _executingExecCmd = false;

        public SSH1Connection(SSHConnectionParameter param, AbstractGranadosSocket s, ISSHConnectionEventReceiver er, string serverversion, string clientversion) : base(param, s, er) {
            _cInfo = new SSH1ConnectionInfo();
            _cInfo._serverVersionString = serverversion;
            _cInfo._clientVersionString = clientversion;
            _shellID = -1;
            _packetReceiver = new SynchronizedPacketReceiver(this);
            _packetBuilder = new SSH1PacketBuilder(_packetReceiver);
        }
コード例 #2
0
ファイル: SSH2Connection.cs プロジェクト: Ricordanza/poderosa
        private readonly object _transmitSync = new object();   // for keeping correct packet order

        internal SSH2Connection(SSHConnectionParameter param, AbstractGranadosSocket strm, ISSHConnectionEventReceiver r, string serverversion, string clientversion)
            : base(param, strm, r) {
            _cInfo = new SSH2ConnectionInfo();
            _cInfo._serverVersionString = serverversion;
            _cInfo._clientVersionString = clientversion;

            _packetReceiver = new SynchronizedPacketReceiver(this);
            _packetBuilder = new SSH2PacketBuilder(_packetReceiver);
        }
コード例 #3
0
        protected bool _execCmdWaitFlag;  // wait response flag for sending exec command to server

        protected SSHConnection(SSHConnectionParameter param, AbstractGranadosSocket strm, ISSHConnectionEventReceiver receiver) {
            _param = (SSHConnectionParameter)param.Clone();
            _stream = strm;
            _eventReceiver = receiver;
            _channel_collection = new ChannelCollection();
            _autoDisconnect = true;
            _execCmd = null;
            _execCmdWaitFlag = true;
        }
コード例 #4
0
ファイル: SSH1Packet.cs プロジェクト: FNKGino/poderosa
        /**
        * writes to encrypted stream
        */
        public void WriteTo(AbstractGranadosSocket output, Cipher cipher)
        {
            byte[] image = BuildImage();
            //dumpBA(image);
            byte[] encrypted = new byte[image.Length - 4];
            cipher.Encrypt(image, 4, image.Length - 4, encrypted, 0); //length field must not be encrypted

            Array.Copy(encrypted, 0, image, 4, encrypted.Length);
            output.Write(image, 0, image.Length);
        }
コード例 #5
0
ファイル: SSH1Packet.cs プロジェクト: FNKGino/poderosa
 /**
 * writes to plain stream
 */
 public void WriteTo(AbstractGranadosSocket output)
 {
     byte[] image = BuildImage();
     output.Write(image, 0, image.Length);
 }
コード例 #6
0
ファイル: Socket.cs プロジェクト: takano32/poderosa
 public VersionExchangeHandler(SSHConnectionParameter param, AbstractGranadosSocket socket)
     : base(socket)
 {
     _param = param;
 }
コード例 #7
0
ファイル: Socket.cs プロジェクト: takano32/poderosa
 public SynchronizedDataHandler(AbstractGranadosSocket socket)
 {
     _socket  = socket;
     _event   = new ManualResetEvent(false);
     _results = new Queue();
 }
コード例 #8
0
 internal DummySSHConnection(SSHConnectionParameter param, AbstractGranadosSocket strm, ISSHConnectionEventReceiver receiver)
     : base(param, strm, receiver)
 {
 }
コード例 #9
0
ファイル: ConnectionRoot.cs プロジェクト: FNKGino/poderosa
        private static SSHConnection ConnectMain(SSHConnectionParameter param, ISSHConnectionEventReceiver receiver, VersionExchangeHandler pnh, AbstractGranadosSocket s)
        {
            DataFragment data = pnh.WaitResponse();
            string sv = pnh.ServerVersion;

            SSHConnection con = null;
            if (param.Protocol == SSHProtocol.SSH1)
                con = new SSH1Connection(param, s, receiver, sv, SSHUtil.ClientVersionString(param.Protocol));
            else
                con = new SSH2Connection(param, s, receiver, sv, SSHUtil.ClientVersionString(param.Protocol));

            con.TraceReceptionEvent("server version-string", sv.Trim());
            pnh.Close();
            s.SetHandler(con.PacketBuilder);
            con.SendMyVersion(param);

            if (con.Connect() != AuthenticationResult.Failure) {
                return con;
            }
            else {
                s.Close();
                return null;
            }
        }
コード例 #10
0
ファイル: Socket.cs プロジェクト: Ricordanza/poderosa
 public VersionExchangeHandler(SSHConnectionParameter param, AbstractGranadosSocket socket)
     : base(socket) {
     _param = param;
 }
コード例 #11
0
ファイル: Socket.cs プロジェクト: Ricordanza/poderosa
 public SynchronizedDataHandler(AbstractGranadosSocket socket) {
     _socket = socket;
     _event = new ManualResetEvent(false);
     _results = new Queue();
 }