コード例 #1
0
ファイル: SSH2Packet.cs プロジェクト: yoshikixxxx/poderosa
        private void ProcessBuffer()
        {
            // buffer may contains multiple packet data
            while (ConstructPacket())
            {
                if (IsMsgNewKeys(_packet))
                {
                    // next packet must be decrypted with the new key
                    _cipher     = null;
                    _mac        = null;
                    _macEnabled = false;
                    _head       = null;

                    _pending = true;    // retain trailing packets in the buffer
                    _keyErrorDetectionTimeout = DateTime.MaxValue;

                    SSH2MsgNewKeys newKeysPacket =
                        new SSH2MsgNewKeys(_packet, new SSH2MsgNewKeys.Handler(OnMsgNewKeysDequeued));

                    _inner_handler.OnData(newKeysPacket);
                    break;
                }

                _inner_handler.OnData(_packet);
            }
        }
コード例 #2
0
ファイル: SSH2Packet.cs プロジェクト: yoshikixxxx/poderosa
        public override DataFragment Isolate()
        {
            // The new instance returned from this method will be queued into the packet queue.
            // Need to pass delegate object to the new instance to process "dequeued" event.
            DataFragment   newData       = base.Isolate();
            SSH2MsgNewKeys newMsgNewKeys = new SSH2MsgNewKeys(newData, _onDequeued);

            _onDequeued = null;
            return(newMsgNewKeys);
        }
コード例 #3
0
ファイル: SSH2Packet.cs プロジェクト: FNKGino/poderosa
        private void ProcessBuffer()
        {
            // buffer may contains multiple packet data
            while (ConstructPacket()) {
                if (IsMsgNewKeys(_packet)) {
                    // next packet must be decrypted with the new key
                    _cipher = null;
                    _mac = null;
                    _macEnabled = false;
                    _head = null;

                    _pending = true;    // retain trailing packets in the buffer
                    _keyErrorDetectionTimeout = DateTime.MaxValue;

                    SSH2MsgNewKeys newKeysPacket =
                        new SSH2MsgNewKeys(_packet, new SSH2MsgNewKeys.Handler(OnMsgNewKeysDequeued));

                    _inner_handler.OnData(newKeysPacket);
                    break;
                }

                _inner_handler.OnData(_packet);
            }
        }
コード例 #4
0
ファイル: SSH2Packet.cs プロジェクト: FNKGino/poderosa
 public override DataFragment Isolate()
 {
     // The new instance returned from this method will be queued into the packet queue.
     // Need to pass delegate object to the new instance to process "dequeued" event.
     DataFragment newData = base.Isolate();
     SSH2MsgNewKeys newMsgNewKeys = new SSH2MsgNewKeys(newData, _onDequeued);
     _onDequeued = null;
     return newMsgNewKeys;
 }