Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes15kdownloads
tls.cpython-313.pyc65 linesDownload Raw Back to __pycache__
1�

2��j����SSKrSSKJr SSKJr SSKJr SSKJr SSK	J3r4 SSK	Jr SSKJ
r
 SS	KJr "S5S5r\"SS
55r\"SS55rg)�N)�	dataclass)�KaitaiStream)�SSL)�6connection)�dtls_client_hello)�tls_client_hello)�check)�contextc���\rSrSr%Sr\\S'SS\S\4SjjrSS\S\4S	jjr	\7S\\4S8j5r
\9S\S-4Sj5r\10S\\4S
j5r\11S\\\\44Sj5rSrSrg)�ClientHello�zP12A TLS ClientHello is the first message sent by the client when initiating TLS.13�14_raw_bytes�raw_client_hello�dtlsc��XlU(a9[R"[[R15"U555Ulg[R"[[R16"U555Ulg)z/Create a TLS ClientHello object from raw bytes.N)	rr�DtlsClientHellor�io�BytesIO�
_client_hellor�TlsClientHello)�selfrrs   �SD:\code\apps\devtools\python\user_packages\Python313\site-packages\mitmproxy/tls.py�__init__�ClientHello.__init__sV��*���!2�!B�!B��R�Z�Z�(8�9�:�"�D��"2�!@�!@��R�Z�Z�(8�9�:�"�D���wrap_in_record�returnc�@�[UR[R5(a[eU(a]S[UR5S-RSSS9-S-[UR5RSSS9-UR-$UR$)a/17The raw ClientHello bytes as seen on the wire.18 19If `wrap_in_record` is True, the ClientHello will be wrapped in a synthetic TLS record20(`0x160303 + len(chm) + 0x01 + len(ch)`), which is the format expected by some tools.21The synthetic record assumes TLS version (`0x0303`), which may be different from what has been sent over the22wire. JA3 hashes are unaffected by this as they only use the TLS version from the ClientHello data structure.23 24A future implementation may return not just the exact ClientHello, but also the exact record(s) as seen on the25wire.26s���big)�	byteorder��)�27isinstancerrr�NotImplementedError�lenr�to_bytes)rrs  r�	raw_bytes�ClientHello.raw_bytes!s����d�(�(�*;�*K�*K�L�L�%�%�� ��t���'�!�+�5�5�a�5�5�I�J��	�28�d�o�o�&�/�/��U�/�C�D���� �
��?�?�"rc�B�URRR$)z6The cipher suites offered by the client (as raw ints).)r�
cipher_suites�rs rr,�ClientHello.cipher_suites@s���!�!�/�/�=�=�=rNc�"�[URSS5=n(a�URH�nURS:H=(a� [	UR29R5S:H=(ad UR30RSRS:H=(a7 [R"UR31RSR5nU(dM�UR32RSRRS5s $ g)z�33The [Server Name Indication](https://en.wikipedia.org/wiki/Server_Name_Indication),34which indicates which hostname the client wants to connect to.35�36extensionsNr��ascii)�getattrrr0�typer'�body�server_names�	name_typer	�
is_valid_host�	host_name�decode)r�ext�	extension�is_valid_sni_extensions    r�sni�ClientHello.sniEs����$�,�,�l�D�A�A�3�A� �^�^�	��N�N�d�*�V��I�N�N�7�7�8�A�=�V�!���3�3�A�6�@�@�A�E�V��+�+�I�N�N�,G�,G��,J�,T�,T�U�	'�*�)�$�>�>�6�6�q�9�C�C�J�J�7�S�S�,�rc���[URSS5=n(aKURH;nURS:XdM[	SUR37R55s $ /$)z�38The application layer protocols offered by the client as part of the39[ALPN](https://en.wikipedia.org/wiki/Application-Layer_Protocol_Negotiation) TLS extension.40r0N�c3�8# �UHoRv� M g7f)N)�name)�.0�xs  r�	<genexpr>�-ClientHello.alpn_protocols.<locals>.<genexpr>`s���N�0M�1���0M�s�)r3rr0r4�listr5�alpn_protocols)rr;r<s   rrI�ClientHello.alpn_protocolsWsZ���$�,�,�l�D�A�A�3�A� �^�^�	��>�>�T�)��N�	���0M�0M�N�N�N�,��	rc���/n[URSS5=n(aGURH7n[USUR5nUR	UR41U45 M9 U$)zOThe raw list of extensions in the form of `(extension_type, raw_bytes)` tuples.r0N�	_raw_body)r3rr0r5�appendr4)r�retr;r<r5s     rr0�ClientHello.extensionscs_�����$�,�,�l�D�A�A�3�A� �^�^�	��y�+�y�~�~�F���42�43�I�N�N�D�1�2�,��44rc�<�SURSURS3$)NzClientHello(sni: z, alpn_protocols: �))r>rIr-s r�__repr__�ClientHello.__repr__ms$��"�4�8�8�*�,>�t�?R�?R�>S�ST�U�Ur)rr)F)T)�__name__�45__module__�__qualname__�__firstlineno__�__doc__�bytes�__annotations__�boolrr)�propertyrH�intr,�strr>rI�tupler0rR�__static_attributes__�rrrrs������46��47�d�48�#��#��#�>�>�t�C�y�>��>���S�4�Z����"�	��U��	��	���D��s�E�z�!2�3����Vrrc�d�\rSrSr%Sr\R\S'\\S'Sr	\49\S'Sr\50\S'Srg	)51�ClientHelloData�qz/52Event data for `tls_clienthello` event hooks.53r54�client_helloF�ignore_connection�establish_server_tls_firstraN)
rTrUrVrWrXr55�ContextrZrrfr[rgr`rarrrcrcqsA����_�_��1���,�#��t�#��(-���,�rrcc��\rSrSr%Sr\R\S'\R\S'Sr56\RS-\S'Sr\
\S'S	rg)57�TlsData�zY58Event data for `tls_start_client`, `tls_start_server`, and `tls_handshake` event hooks.59�connr60N�ssl_connF�is_dtlsra)rTrUrVrWrXr�61ConnectionrZr62rhrmrrnr[r`rarrrjrj�sN����63�64��"�
�_�_��1�&*�H�c�n�n�t�#�*���G�T��rrj)r�dataclassesr�kaitaistructr�OpenSSLr�	mitmproxyr�mitmproxy.contrib.kaitaistructrr�
mitmproxy.netr	�mitmproxy.proxyr65rrcrjrarr�<module>rwsa��	�!�%�� �<�;��#�`V�`V�F�����(����r
codekingpro/portable-devtools · Team Ai