示例#1
0
 private void _parse()
 {
     _certLength        = new TlsLength(m_io, this, m_root);
     __raw_certificates = new List <byte[]>();
     _certificates      = new List <Certificate>();
     while (!m_io.IsEof)
     {
         __raw_certificates.Add(m_io.ReadBytes(CertLength.Value));
         var io___raw_certificates = new KaitaiStream(__raw_certificates[__raw_certificates.Count - 1]);
         _certificates.Add(new Certificate(io___raw_certificates, this, m_root));
     }
 }
示例#2
0
 private void _read()
 {
     _certLength = new TlsLength(m_io, this, m_root);
     _body       = m_io.ReadBytes(CertLength.Value);
 }
示例#3
0
            private void _read()
            {
                _msgType = ((TlsPacket.TlsHandshakeType)m_io.ReadU1());
                _length  = new TlsLength(m_io, this, m_root);
                switch (MsgType)
                {
                case TlsPacket.TlsHandshakeType.HelloRequest: {
                    __raw_body = m_io.ReadBytes(Length.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsHelloRequest(io___raw_body, this, m_root);
                    break;
                }

                case TlsPacket.TlsHandshakeType.Certificate: {
                    __raw_body = m_io.ReadBytes(Length.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsCertificate(io___raw_body, this, m_root);
                    break;
                }

                case TlsPacket.TlsHandshakeType.CertificateVerify: {
                    __raw_body = m_io.ReadBytes(Length.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsCertificateVerify(io___raw_body, this, m_root);
                    break;
                }

                case TlsPacket.TlsHandshakeType.ServerKeyExchange: {
                    __raw_body = m_io.ReadBytes(Length.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsServerKeyExchange(io___raw_body, this, m_root);
                    break;
                }

                case TlsPacket.TlsHandshakeType.ClientHello: {
                    __raw_body = m_io.ReadBytes(Length.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsClientHello(io___raw_body, this, m_root);
                    break;
                }

                case TlsPacket.TlsHandshakeType.ClientKeyExchange: {
                    __raw_body = m_io.ReadBytes(Length.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsClientKeyExchange(io___raw_body, this, m_root);
                    break;
                }

                case TlsPacket.TlsHandshakeType.ServerHello: {
                    __raw_body = m_io.ReadBytes(Length.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsServerHello(io___raw_body, this, m_root);
                    break;
                }

                case TlsPacket.TlsHandshakeType.CertificateRequest: {
                    __raw_body = m_io.ReadBytes(Length.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsCertificateRequest(io___raw_body, this, m_root);
                    break;
                }

                case TlsPacket.TlsHandshakeType.ServerHelloDone: {
                    __raw_body = m_io.ReadBytes(Length.Value);
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsServerHelloDone(io___raw_body, this, m_root);
                    break;
                }

                default: {
                    _body = m_io.ReadBytes(Length.Value);
                    break;
                }
                }
            }
示例#4
0
            private void _parse()
            {
                _handshakeType = ((TlsRecord.TlsHandshakeType)m_io.ReadU1());
                _bodyLength    = new TlsLength(m_io, this, m_root);
                switch (HandshakeType)
                {
                case TlsRecord.TlsHandshakeType.HelloRequest: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsEmpty(io___raw_body, this, m_root);
                    break;
                }

                case TlsRecord.TlsHandshakeType.Certificate: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsCertificate(io___raw_body, this, m_root);
                    break;
                }

                case TlsRecord.TlsHandshakeType.CertificateVerify: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsCertificateVerify(io___raw_body, this, m_root);
                    break;
                }

                case TlsRecord.TlsHandshakeType.ServerKeyExchange: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsServerKeyExchange(io___raw_body, this, m_root);
                    break;
                }

                case TlsRecord.TlsHandshakeType.ClientHello: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsClientHello(io___raw_body, this, m_root);
                    break;
                }

                case TlsRecord.TlsHandshakeType.Finished: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsFinished(io___raw_body, this, m_root);
                    break;
                }

                case TlsRecord.TlsHandshakeType.ClientKeyExchange: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsClientKeyExchange(io___raw_body, this, m_root);
                    break;
                }

                case TlsRecord.TlsHandshakeType.ServerHello: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsServerHello(io___raw_body, this, m_root);
                    break;
                }

                case TlsRecord.TlsHandshakeType.CertificateRequest: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsCertificateRequest(io___raw_body, this, m_root);
                    break;
                }

                case TlsRecord.TlsHandshakeType.ServerHelloDone: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsServerHelloDone(io___raw_body, this, m_root);
                    break;
                }

                default: {
                    __raw_body = m_io.ReadBytes((M_Parent.Length - 4));
                    var io___raw_body = new KaitaiStream(__raw_body);
                    _body = new TlsEncryptedMessage(io___raw_body, this, m_root);
                    break;
                }
                }
            }