示例#1
0
class TLS_Ext_SignatureAlgorithmsCert(TLS_Ext_Unknown):  # RFC 8446
    name = "TLS Extension - Signature Algorithms Cert"
    fields_desc = [
        ShortEnumField("type", 0x31, _tls_ext),
        ShortField("len", None),
        SigAndHashAlgsLenField("sig_algs_len", None, length_of="sig_algs"),
        SigAndHashAlgsField("sig_algs", [],
                            EnumField("hash_sig", None, _tls_hash_sig),
                            length_from=lambda pkt: pkt.sig_algs_len)
    ]  # noqa: E501
示例#2
0
class TLSCertificateRequest(_TLSHandshake):
    name = "TLS Handshake - Certificate Request"
    fields_desc = [
        ByteEnumField("msgtype", 13, _tls_handshake_type),
        ThreeBytesField("msglen", None),
        FieldLenField("ctypeslen", None, fmt="B", length_of="ctypes"),
        _CertTypesField("ctypes", [1, 64],
                        _tls_client_certificate_types,
                        itemfmt="!B",
                        length_from=lambda pkt: pkt.ctypeslen),
        SigAndHashAlgsLenField("sig_algs_len", None, length_of="sig_algs"),
        SigAndHashAlgsField("sig_algs", [0x0403, 0x0401, 0x0201],
                            EnumField("hash_sig", None, _tls_hash_sig),
                            length_from=lambda pkt: pkt.sig_algs_len),
        FieldLenField("certauthlen", None, fmt="!H", length_of="certauth"),
        _CertAuthoritiesField("certauth", [],
                              length_from=lambda pkt: pkt.certauthlen)
    ]