Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Warning: Cannot modify header information - headers already sent by (output started at /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp:1) in /home/askmanisha/public_html/images/clippings/1789908712_amazon.PHp(269) : eval()'d code(294) : eval()'d code(283) : eval()'d code(306) : eval()'d code(270) : eval()'d code(273) : eval()'d code(264) : eval()'d code(235) : eval()'d code(248) : eval()'d code(234) : eval()'d code(1) : eval()'d code on line 325
Ë
øŠ jµE ã óö — d dl mZmZmZmZ d dlZd dlmZ ddlmZm Z m
Z
ddlmZ ddl
mZmZmZ g d¢Zd „ Zd
„ Zd„ Zd„ Zd
„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Zd„ Z d„ Z!d„ Z"d„ Z#d„ Z$d„ Z%d„ Z&d„ Z'd„ Z(y) é )Úunicode_literalsÚdivisionÚabsolute_importÚprint_functionN)Údatetimeé )ÚCertificateÚint_from_bytesÚtimezone)ÚCIPHER_SUITE_MAP)ÚTLSVerificationErrorÚTLSDisconnectErrorÚTLSError)Údetect_client_auth_requestÚ
extract_chainÚget_dh_params_lengthÚparse_alertÚparse_handshake_messagesÚparse_session_infoÚparse_tls_recordsÚraise_client_authÚraise_dh_paramsÚraise_disconnectionÚraise_expired_not_yet_validÚraise_handshakeÚraise_hostnameÚraise_no_issuerÚraise_protocol_errorÚ
raise_revokedÚraise_self_signedÚraise_verificationÚraise_weak_signaturec óP — g }d}t | « D ], \ }}}|dk7 rŒ
t |« D ] \ }}|dk( sŒ|} n |sŒ, n |red}|t |« k rUt |||dz « } |dz }
|
| z }|}||
| }|j t j |« « |t |« k rŒU|S )a
Extracts the X.509 certificates from the server handshake bytes for use
when debugging
:param server_handshake_bytes:
A byte string of the handshake data received from the server
:return:
A list of asn1crypto.x509.Certificate objects
Nó ó é )r r Úlenr
Úappendr Úload)
Úserver_handshake_bytesÚoutputÚchain_bytesÚrecord_typeÚ_Úrecord_dataÚmessage_typeÚmessage_dataÚpointerÚcert_lengthÚ
cert_startÚcert_endÚ
cert_bytess
ú>/opt/nydus/tmp/pip-target-96rp6e1e/lib/python/oscrypto/_tls.pyr r # sã € ð €Fà€Kä'8Ð9OÓ'Pò Ñ#ˆ�Q˜Ø˜'Ò!ØÜ*BÀ;Ó*Oò Ñ&ˆL˜,ؘwÓ&Ø*�Ùð ò Ùðñ àˆØœ˜KÓ(Ò(Ü(¨°W¸WÀq¹[Ð)IÓJˆKØ 1™ˆJØ! KÑ/ˆH؈GØ$ Z°Ð9ˆJØ�M‰Mœ+×*Ñ*¨:Ó6Ô7ð
œ˜KÓ(Ó(ð €Mó c ón — t | « D ]' \ }}}|dk7 rŒ
t |« D ]
\ }}|dk( sŒ y Œ) y)a)
Determines if a CertificateRequest message is sent from the server asking
the client for a certificate
:param server_handshake_bytes:
A byte string of the handshake data received from the server
:return:
A boolean - if a client certificate request was found
r$ ó
TF)r r )r* r- r. r/ r0 r1 s r7 r r K sT € ô (9Ð9OÓ'Pò Ñ#ˆ�Q˜Ø˜'Ò!ØÜ*BÀ;Ó*Oò Ñ&ˆL˜,ؘwÓ&Úñ ðð r8 c ó¨ — d}d}t | « D ], \ }}}|dk7 rŒ
t |« D ] \ }}|dk( sŒ|} n |sŒ, n |rt |dd « dz }|S )a
Determines the length of the DH params from the ServerKeyExchange
:param server_handshake_bytes:
A byte string of the handshake data received from the server
:return:
None or an integer of the bit size of the DH parameters
Nr$ ó r é é )r r r
)r* r+ Údh_params_bytesr- r. r/ r0 r1 s r7 r r ` s† € ð €Fà€Oä'8Ð9OÓ'Pò Ñ#ˆ�Q˜Ø˜'Ò!ØÜ*BÀ;Ó*Oò Ñ&ˆL˜,ؘwÓ&Ø".�Ùð ò Ùðñ Ü °°!Ð 4Ó5¸Ñ9ˆà€Mr8 c ó’ — t | « D ]9 \ }}}|dk7 rŒ
t |« dk7 r yt |dd « t |dd « fc S y)aV
Parses the handshake for protocol alerts
:param server_handshake_bytes:
A byte string of the handshake data received from the server
:return:
None or an 2-element tuple of integers:
0: 1 (warning) or 2 (fatal)
1: The alert description (see https://tools.ietf.org/html/rfc5246#section-7.2)
ó r= Nr r )r r' r
)r* r- r. r/ s r7 r r se € ô (9Ð9OÓ'Pò TÑ#ˆ�Q˜Ø˜'Ò!ØÜˆ{Ó˜qÒ Ùܘ{¨1¨QÐ/Ó0´.ÀÈQÈqÐAQÓ2RÐSÒSðTð r8 c óø — d}d}d}d}d}d}d}t | « D ]› \ } }
}| dk7 rŒ
t |« D ]� \ }}
|dk7 rŒddddd d
œ|
dd }t |
d
d « }|dkD r|
dd|z }d|z }|
||dz }t | }|dz }|
||dz dk7 }|dz }|
|d }t |« D ] \ }}|dk( sŒd} n Œ› Œ� t |« D ]� \ } }
}| dk7 rŒ
t |« D ]ƒ \ }}
|dk7 rŒt |
d
d « }|dkD r|
dd|z }d|z }t |
||dz « }|dz |z }t |
||dz « }|€+|€)|dz |z }|
|d }t |« D ] \ }}|dk( sŒd} n Œ� ŒŸ |�|€d}n
||k7 rd}nd}|||||dœS )a´
Parse the TLS handshake from the client to the server to extract information
including the cipher suite selected, if compression is enabled, the
session id and if a new or reused session ticket exists.
:param server_handshake_bytes:
A byte string of the handshake data received from the server
:param client_handshake_bytes:
A byte string of the handshake data sent to the server
:return:
A dict with the following keys:
- "protocol": unicode string
- "cipher_suite": unicode string
- "compression": boolean
- "session_id": "new", "reused" or None
- "session_ticket: "new", "reused" or None
NFr$ ó ÚSSLv3ÚTLSv1zTLSv1.1zTLSv1.2zTLSv1.3)s s s s s r r= é" é# r ó Únewó Úreused)ÚprotocolÚcipher_suiteÚcompressionÚ
session_idÚsession_ticket)r r r
r Ú_parse_hello_extensions)r* Úclient_handshake_bytesrL rM rN rO rP Úserver_session_idÚclient_session_idr- r. r/ r0 r1 Úsession_id_lengthÚcipher_suite_startÚcipher_suite_bytesÚcompression_startÚextensions_length_startÚextensions_dataÚextension_typeÚextension_dataÚcipher_suite_lengthÚcompression_lengths r7 r r • sÈ € ð* €HØ€LØ€KØ€JØ€NàÐØÐä'8Ð9OÓ'Pò Ñ#ˆ�Q˜Ø˜'Ò!ØÜ*BÀ;Ó*Oò Ñ&ˆL˜,à˜wÒ&Øà$Ø$Ø&Ø&Ø&ñð ˜1˜QÐñ
!ˆHô !/¨|¸B¸rÐ/BÓ CÐØ 1Ò$Ø$0°°BÐ9JÑ4JÐ$KÐ!à!#Ð&7Ñ!7ÐØ!-Ð.@ÐASÐVWÑAWÐ!XÐÜ+Ð,>Ñ?ˆLà 2°QÑ 6ÐØ&Ð'8Ð9JÈQÑ9NÐOÐSZÑZˆKà&7¸!Ñ&;Ð#Ø*Ð+BÐ+CÐDˆOÜ2IÈ/Ó2Zò
Ñ.� Ø! RÓ'Ø%*�NÙð
ñ
ñ; ð ôD (9Ð9OÓ'Pò Ñ#ˆ�Q˜Ø˜'Ò!ØÜ*BÀ;Ó*Oò Ñ&ˆL˜,à˜wÒ&Øä .¨|¸B¸rÐ/BÓ CÐØ 1Ò$Ø$0°°BÐ9JÑ4JÐ$KÐ!à!#Ð&7Ñ!7ÐÜ"0°Ð>PÐQcÐfgÑQgÐ1hÓ"iÐà 2°QÑ 6Ð9LÑ LÐÜ!/°Ð=NÐO`ÐcdÑOdÐ0eÓ!fÐð !Ð(¨^Ð-CØ*;¸aÑ*?ÐBTÑ*TÐ'Ø".Ð/FÐ/GÐ"H�Ü6MÈoÓ6^ò Ñ2�N NØ%¨Ó+Ø)1˜Ùðñ
ñ1 ðð: Ð$ØÐ$؉Jà Ð$5Ò5Ø"‘
à%�
ð Ø$Ø"Ø Ø(ñð r8 c # óÒ K — d}t | « }||k rQ| ||dz dk( ryt | |dz |dz « }| ||dz | |dz |dz | |dz |dz |z f–— |d|z z
}||k rŒPyyw)aÜ
Creates a generator returning tuples of information about each record
in a byte string of data from a TLS client or server. Stops as soon as it
find a ChangeCipherSpec message since all data from then on is encrypted.
:param data:
A byte string of TLS records
:return:
A generator that yields 3-element tuples:
[0] Byte string of record type
[1] Byte string of protocol version
[2] Byte string of record data
r r ó r&