protected override void OnLoad(SshDataWorker reader)
        {
            base.OnLoad(reader);

            if (MethodName != "password")
            {
                throw new ArgumentException(string.Format("Method name {0} is not valid.", MethodName));
            }

            var isFalse = reader.ReadBoolean();

            Password = reader.ReadString(Encoding.ASCII);
        }
Пример #2
0
 protected override void OnLoad(SshDataWorker reader)
 {
     Cookie = reader.ReadBinary(16);
     KeyExchangeAlgorithms               = reader.ReadString(Encoding.ASCII).Split(',');
     ServerHostKeyAlgorithms             = reader.ReadString(Encoding.ASCII).Split(',');
     EncryptionAlgorithmsClientToServer  = reader.ReadString(Encoding.ASCII).Split(',');
     EncryptionAlgorithmsServerToClient  = reader.ReadString(Encoding.ASCII).Split(',');
     MacAlgorithmsClientToServer         = reader.ReadString(Encoding.ASCII).Split(',');
     MacAlgorithmsServerToClient         = reader.ReadString(Encoding.ASCII).Split(',');
     CompressionAlgorithmsClientToServer = reader.ReadString(Encoding.ASCII).Split(',');
     CompressionAlgorithmsServerToClient = reader.ReadString(Encoding.ASCII).Split(',');
     LanguagesClientToServer             = reader.ReadString(Encoding.ASCII).Split(',');
     LanguagesServerToClient             = reader.ReadString(Encoding.ASCII).Split(',');
     FirstKexPacketFollows               = reader.ReadBoolean();
     Reserved = reader.ReadUInt32();
 }
Пример #3
0
 protected override void OnLoad(SshDataWorker reader)
 {
     Cookie = reader.ReadBinary(16);
     KeyExchangeAlgorithms = reader.ReadString(Encoding.ASCII).Split(',');
     ServerHostKeyAlgorithms = reader.ReadString(Encoding.ASCII).Split(',');
     EncryptionAlgorithmsClientToServer = reader.ReadString(Encoding.ASCII).Split(',');
     EncryptionAlgorithmsServerToClient = reader.ReadString(Encoding.ASCII).Split(',');
     MacAlgorithmsClientToServer = reader.ReadString(Encoding.ASCII).Split(',');
     MacAlgorithmsServerToClient = reader.ReadString(Encoding.ASCII).Split(',');
     CompressionAlgorithmsClientToServer = reader.ReadString(Encoding.ASCII).Split(',');
     CompressionAlgorithmsServerToClient = reader.ReadString(Encoding.ASCII).Split(',');
     LanguagesClientToServer = reader.ReadString(Encoding.ASCII).Split(',');
     LanguagesServerToClient = reader.ReadString(Encoding.ASCII).Split(',');
     FirstKexPacketFollows = reader.ReadBoolean();
     Reserved = reader.ReadUInt32();
 }
Пример #4
0
        protected override void OnLoad(SshDataWorker reader)
        {
            base.OnLoad(reader);

            if (MethodName != "publickey")
                throw new ArgumentException(string.Format("Method name {0} is not valid.", MethodName));

            HasSignature = reader.ReadBoolean();
            KeyAlgorithmName = reader.ReadString(Encoding.ASCII);
            PublicKey = reader.ReadBinary();

            if (HasSignature)
            {
                Signature = reader.ReadBinary();
                PayloadWithoutSignature = RawBytes.Take(RawBytes.Length - Signature.Length - 5).ToArray();
            }
        }
Пример #5
0
        protected override void OnLoad(SshDataWorker reader)
        {
            base.OnLoad(reader);

            if (MethodName != "publickey")
            {
                throw new ArgumentException(string.Format("Method name {0} is not valid.", MethodName));
            }

            HasSignature     = reader.ReadBoolean();
            KeyAlgorithmName = reader.ReadString(Encoding.ASCII);
            PublicKey        = reader.ReadBinary();

            if (HasSignature)
            {
                Signature = reader.ReadBinary();
                PayloadWithoutSignature = RawBytes.Take(RawBytes.Length - Signature.Length - 5).ToArray();
            }
        }
Пример #6
0
        protected override void OnLoad(SshDataWorker reader)
        {
            base.OnLoad(reader);

            if (this.MethodName != "publickey")
            {
                throw new ArgumentException($"Method name {this.MethodName} is not valid.");
            }

            this.HasSignature     = reader.ReadBoolean();
            this.KeyAlgorithmName = reader.ReadString(Encoding.ASCII);
            this.PublicKey        = reader.ReadBinary();

            if (!this.HasSignature)
            {
                return;
            }
            this.Signature = reader.ReadBinary();
            this.PayloadWithoutSignature = this.RawBytes.Take(this.RawBytes.Length - this.Signature.Length - 5).ToArray();
        }
Пример #7
0
 protected override void OnLoad(SshDataWorker reader)
 {
     this.RecipientChannel = reader.ReadUInt32();
     this.RequestType      = reader.ReadString(Encoding.ASCII);
     this.WantReply        = reader.ReadBoolean();
 }
Пример #8
0
 protected override void OnLoad(SshDataWorker reader)
 {
     RecipientChannel = reader.ReadUInt32();
     RequestType = reader.ReadString(Encoding.ASCII);
     WantReply = reader.ReadBoolean();
 }
Пример #9
0
 protected override void OnLoad(SshDataWorker reader)
 {
     base.OnLoad(reader);
     reader.ReadBoolean();
     this.Password = reader.ReadString(Encoding.UTF8);
 }
Пример #10
0
 protected override void OnLoad(SshDataWorker reader)
 {
     this.RequestType = reader.ReadString(Encoding.UTF8);
     this.WantReply   = reader.ReadBoolean();
 }