Example #1
0
            private void _read()
            {
                _type = m_io.ReadU2be();
                _len  = m_io.ReadU2be();
                switch (Type)
                {
                case 0: {
                    __raw_body = m_io.ReadBytes(Len);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new Sni(io___raw_body, this, m_root);
                    break;
                }

                case 16: {
                    __raw_body = m_io.ReadBytes(Len);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new Alpn(io___raw_body, this, m_root);
                    break;
                }

                default: {
                    _body = m_io.ReadBytes(Len);
                    break;
                }
                }
            }
Example #2
0
        public SslStreamBase(Stream stream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (!stream.CanRead || !stream.CanWrite)
            {
                throw new ArgumentException("Stream must allow read and write capabilities", "stream");
            }
            innerStream = stream;

            sniExt = new Sni(srvName);
        }
Example #3
0
        public SslStreamBase(Stream stream, bool ownStream)
        {
            if (stream == null)
            {
                throw new ArgumentNullException("stream");
            }
            if (!stream.CanRead || !stream.CanWrite)
            {
                throw new ArgumentException("Stream must allow read and write capabilities", "stream");
            }
            innerStream = stream;

            this.ownStream = ownStream;
            read_buffer    = new byte[16384];
            //inHandshakeLoop = false;
            decrypted_data_stream = new MemoryStream();
            sniExt = new Sni(srvName);
        }
 CompareSniDictionaries(Sni, other.Sni) &&
Example #5
0
 public ServerName(KaitaiStream io, Sni parent = null, TlsRecord root = null) : base(io)
 {
     m_parent = parent;
     m_root   = root;
     _parse();
 }