§
    ÌtºfŠ  ã                   ó¦   — d dl Z d dlmZ d dlmZ d dlZd dlmZ d dlmZ dZ	dde
dee         d	efd
„Zdej        j        d	efd„Zd„ Zde
d	efd„ZdS )é    N)ÚPopen)ÚOptional)Úsleep)ÚTransportDetails)r   Úpeer2strÚtransport_channel_idÚcreate_transport_detailsÚ	is_serverÚchannel_id_typeÚreturnc                 ó¼  — |€dS |dvr"t          d                     |¦  «        ¦  «        ‚|                      d¦  «        }|€t          d¦  «        ‚t          |d¦  «        st          d¦  «        ‚|                     d	¬
¦  «        }t          |¦  «        t          k    rdS t          j        ¦   «         }| 	                    |¦  «         | 
                    ¦   «         }|S )a’  
    Application-layer user authentication protocols are vulnerable to generic
    credential forwarding attacks, where an authentication credential sent by
    a client C to a server M may then be used by M to impersonate C at another
    server S. To prevent such credential forwarding attacks, modern authentication
    protocols rely on channel bindings. For example, WAMP-cryptosign can use
    the tls-unique channel identifier provided by the TLS layer to strongly bind
    authentication credentials to the underlying channel, so that a credential
    received on one TLS channel cannot be forwarded on another.

    :param transport: The asyncio TLS transport to extract the TLS channel ID from.
    :param is_server: Flag indicating the transport is for a server.
    :param channel_id_type: TLS channel ID type, currently only "tls-unique" is supported.
    :returns: The TLS channel id (32 bytes).
    Ns                                    )ú
tls-uniquezinvalid channel ID type {}Ú
ssl_objectzUTLS transport channel_id for tls-unique requested, but ssl_obj not found on transportÚget_channel_bindingz_TLS transport channel_id for tls-unique requested, but get_channel_binding not found on ssl_objr   )Úcb_type)Ú	ExceptionÚformatÚget_extra_infoÚhasattrr   ÚtypeÚbytesÚhashlibÚsha256ÚupdateÚdigest)Ú	transportr
   r   Ússl_objÚtls_finished_msgÚmÚ
channel_ids          úT/var/www/surfInsights/venv3-11/lib/python3.11/site-packages/autobahn/asyncio/util.pyr   r   +   sè   € ð  ÐØˆ|ð ˜nÐ,Ð,ÝÐ4×;Ò;¸OÑLÔLÑMÔMÐMà×&Ò& |Ñ4Ô4€GØ€ÝÐoÑpÔpÐpå�7Ð1Ñ2Ô2ð {ÝÐyÑzÔzÐzð &×9Ò9À,Ð9ÑOÔOÐåÐÑÔ¥Ò&Ð&Øˆ|åŒNÑÔˆØ	�ŠÐ!Ñ"Ô"Ð"Ø—X’X‘Z”Zˆ
ØÐó    r   c                 ó.  — 	 |                       d¦  «        }t          |t          ¦  «        r:t          |¦  «        dk    rdnd}d                     |d         |d         |¦  «        S t          |t
          ¦  «        rd                     |¦  «        S d	                     |¦  «        S #  Y nxY w	 |                       d
¦  «        }d                     |j        ¦  «        S #  Y nxY w	 |                       d¦  «        }d                     |¦  «        S #  Y nxY wdS )NÚpeernameé   é   é   ztcp{2}:{0}:{1}r   é   zunix:{0}z?:{0}Ú
subprocessz
process:{}Úpipezpipe:{}Úunknown)r   Ú
isinstanceÚtupleÚlenr   ÚstrÚpid)r   ÚpeerÚip_verÚprocr*   s        r!   r   r   V   s&  € ð
Ø×'Ò'¨
Ñ3Ô3ˆÝ�d�EÑ"Ô"ð 	(Ý˜d™)œ) qš.˜.�Q�Q¨aˆFØ#×*Ò*¨4°¬7°D¸´G¸VÑDÔDÐDÝ˜�cÑ"Ô"ð 	(Ø×$Ò$ TÑ*Ô*Ð*à—>’> $Ñ'Ô'Ð'øðØˆøøøðØ×.Ò.¨|Ñ<Ô<ˆà×"Ò" 4¤8Ñ,Ô,Ð,øðØˆøøøðØ×'Ò'¨Ñ/Ô/ˆØ×Ò Ñ%Ô%Ð%øðØˆøøøð ˆ9s0   ‚A#B% Á&)B% ÂB% Â%B)Â-.C ÃC Ã$)D ÄDc            	      óz   ‡— ddl mŠ g d¢} t          t          d„ t	          ˆfd„| ¦  «        ¦  «        ¦  «        } | S )Nr   )Ú
serializer)ÚCBORSerializerÚMsgPackSerializerÚUBJSONSerializerÚJsonSerializerc                 ó   — | S ©N© )Úxs    r!   ú<lambda>z!get_serializers.<locals>.<lambda>z   s   € ¨€ r"   c                 óH   •— t          ‰| ¦  «        rt          ‰| ¦  «        nd S r;   )r   Úgetattr)Úsr5   s    €r!   r>   z!get_serializers.<locals>.<lambda>z   s.   ø€ ÕSZÐ[eÐghÑSiÔSið :9½ÀÈQÑ9OÔ9OÐ9OØ48ð r"   )Úautobahn.wampr5   ÚlistÚfilterÚmap)Úserializersr5   s    @r!   Úget_serializersrG   v   sn   ø€ Ø(Ð(Ð(Ð(Ð(Ð(à_Ð_Ð_€KÝ•v˜k˜k­3ð 09ð 09ð 09ð 09Ø:Eñ,Gô ,Gñ Hô Hñ Iô I€KàÐr"   c           	      óü   — t          | ¦  «        }|                      dd ¦  «        d u}|r"dt          | |d¦  «        i}t          j        }d }ni }t          j        }d }t          j        }t          |||||||¬¦  «        S )NÚpeercertr   )Úchannel_typeÚchannel_framingr1   r
   Ú	is_securer    Ú	peer_cert)r   r   r   r   ÚCHANNEL_TYPE_TLSÚCHANNEL_TYPE_TCPÚCHANNEL_FRAMING_WEBSOCKET)r   r
   r1   rL   r    rJ   rM   rK   s           r!   r	   r	      s¢   € å�IÑÔ€Dð ×(Ò(¨°TÑ:Ô:À$ÐF€IØð 	àÕ.¨y¸)À\ÑRÔRð
ˆ
õ (Ô8ˆØˆ	ˆ	àˆ
Ý'Ô8ˆØˆ	Ý&Ô@€Oå¨ÀØ!%°ÀiØ'1¸YðHñ Hô Hð Hr"   r;   )r   r)   r   Útypingr   Úasyncior   Úautobahn.wamp.typesr   Ú__allÚboolr/   r   r   Ú
transportsÚBaseTransportr   rG   r	   r<   r"   r!   ú<module>rX      s	  ðð6 €€€Ø Ð Ð Ð Ð Ð Ø Ð Ð Ð Ð Ð Ø €€€Ø Ð Ð Ð Ð Ð à 0Ð 0Ð 0Ð 0Ð 0Ð 0ð	€ð(ð (¨tð (ÀhÈsÄmð (Ð_dð (ð (ð (ð (ðV˜Ô*Ô8ð ¸Sð ð ð ð ð@ð ð ðH°4ð HÐ<Lð Hð Hð Hð Hð Hð Hr"   