GithubHelp home page GithubHelp logo

Comments (2)

tintinweb avatar tintinweb commented on May 28, 2024

Hi @hsl123,

Fixed the attrib error in ssl_tls.py#L930 length_of="dns" should read length_of="ca_dns".

It's in master already. Please give it a try and report back.

cheers,
tin

class TLSCertificateRequest(Packet):
    name = "TLS Certificate Request"
    fields_desc = [XFieldLenField("type_length", None, length_of="types", fmt="B"),
                   PacketListField("types", TLSCertificateType(), TLSCertificateType, length_from=lambda x: x.type_length),
                   XFieldLenField("alg_length", None, length_of="algs", fmt="H"),
                   ReprFieldListField("algs", DEFAULT_SIG_SCHEME_LIST, ShortEnumField("alg", None, TLS_SIGNATURE_SCHEMES),
                                      length_from=lambda x: x.alg_length),
                   XFieldLenField("dn_length", None, length_of="dns", fmt="H"),
                   PacketListField("ca_dns", None, TLSCADistinguishedName, length_from=lambda x: x.dn_length)]

example (did not fully test it):

>>> (TLSRecord()/TLSHandshakes(handshakes=[TLSHandshake()/TLSCertificateRequest(ca_dns=TLSCADistinguishedName(ca_dn="hi"))])).show()
###[ TLS Record ]###
  content_type= handshake
  version   = TLS_1_0
  length    = None
###[ TLS Handshakes ]###
     \handshakes\
      |###[ TLS Handshake ]###
      |  type      = certificate_request
      |  length    = None
      |###[ TLS Certificate Request ]###
      |     type_length= None
      |     \types     \
      |      |###[ TLS Certificate Type ]###
      |      |  type      = rsa_sign
      |     alg_length= None
      |     algs      = ['ecdsa_secp521r1_sha512', 'ecdsa_secp384r1_sha384', 'ecdsa_secp256r1_sha256', 'rsa_pkcs1_sha512', 'rsa_pkcs1_sha384', 'rsa_pkcs1_sha256', 'rsa_pkcs1_sha1']
      |     dn_length = None
      |     \ca_dns    \
      |      |###[ TLS CA Distinguished Name ]###
      |      |  length    = None
      |      |  ca_dn     = 'hi'

from scapy-ssl_tls.

hsl123 avatar hsl123 commented on May 28, 2024

from scapy-ssl_tls.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.