__  __    __   __  _____      _            _          _____ _          _ _ 
 |  \/  |   \ \ / / |  __ \    (_)          | |        / ____| |        | | |
 | \  / |_ __\ V /  | |__) | __ ___   ____ _| |_ ___  | (___ | |__   ___| | |
 | |\/| | '__|> <   |  ___/ '__| \ \ / / _` | __/ _ \  \___ \| '_ \ / _ \ | |
 | |  | | |_ / . \  | |   | |  | |\ V / (_| | ||  __/  ____) | | | |  __/ | |
 |_|  |_|_(_)_/ \_\ |_|   |_|  |_| \_/ \__,_|\__\___| |_____/|_| |_|\___V 2.1
 if you need WebShell for Seo everyday contact me on Telegram
 Telegram Address : @jackleet
        
        
For_More_Tools: Telegram: @jackleet | Bulk Smtp support mail sender | Business Mail Collector | Mail Bouncer All Mail | Bulk Office Mail Validator | Html Letter private



Upload:

Command:

[email protected]: ~ $
�

�|�g���v�SrSSKrSSKrSSKrSSKrSSKrSSKrSSKJrJ	r	J
r
Jr SSKJ
r
 SSKJrJrJrJr SSKrSSKJr SSKJrJr SSKJr SS	KJr SS
KJrJrJrJ r J!r!J"r"J#r#J$r$J%r%J&r&J'r'J(r(J)r)J*r*J+r+J,r,J-r-J.r.J/r/J0r0J1r1J2r2J3r3J4r4J5r5J6r6J7r7J8r8J9r9J:r:J;r;J<r<J=r=J>r>J?r?J@r@JArAJBrBJCrCJDrDJErEJFrFJGrGJHrHJIrIJJrJJKrKJLrLJMrMJNrN SSKOJPrPJQrQ SSKRJSrS SS
KTJUrU SSKVJWrW SSKXJYrYJZrZ SSK[J\r\ SSK]J^r^J_r_ SSK`Jara SSKbJcrcJdrdJere SSKfJgrgJhrhJiri SSKjJkrk SSKlJmrmJnrn SSKoJprp SSKqJrrr SSKsJtrt SSKuJvrv SSKwJxrx SSKyJzrzJ{r{J|r|J}r}J~r~Jr SSK�J�r�J�r�J�r� SSK�J�r� /r�Sr�SSK�r�\�GR"\�5 "S S!\GR\�5r�"S"S#5r�"S$S%5r�"S&S'\�5r�g!\�a	 SSK�J�r� Naf=f)(z
Core protocol implementation
�N)�md5�sha1�sha256�sha512)�default_backend)�
algorithms�Cipher�modes�aead)�util)�AuthHandler�AuthOnlyHandler)�GSSAuth)�Channel)2�	xffffffff�cMSG_CHANNEL_OPEN�cMSG_IGNORE�cMSG_GLOBAL_REQUEST�DEBUG�MSG_KEXINIT�
MSG_IGNORE�MSG_DISCONNECT�	MSG_DEBUG�ERROR�WARNING�cMSG_UNIMPLEMENTED�INFO�cMSG_KEXINIT�cMSG_NEWKEYS�MSG_NEWKEYS�cMSG_REQUEST_SUCCESS�cMSG_REQUEST_FAILURE�CONNECTION_FAILED_CODE�'OPEN_FAILED_ADMINISTRATIVELY_PROHIBITED�OPEN_SUCCEEDED�cMSG_CHANNEL_OPEN_FAILURE�cMSG_CHANNEL_OPEN_SUCCESS�MSG_GLOBAL_REQUEST�MSG_REQUEST_SUCCESS�MSG_REQUEST_FAILURE�cMSG_SERVICE_REQUEST�MSG_SERVICE_ACCEPT�MSG_CHANNEL_OPEN_SUCCESS�MSG_CHANNEL_OPEN_FAILURE�MSG_CHANNEL_OPEN�MSG_CHANNEL_SUCCESS�MSG_CHANNEL_FAILURE�MSG_CHANNEL_DATA�MSG_CHANNEL_EXTENDED_DATA�MSG_CHANNEL_WINDOW_ADJUST�MSG_CHANNEL_REQUEST�MSG_CHANNEL_EOF�MSG_CHANNEL_CLOSE�MIN_WINDOW_SIZE�MIN_PACKET_SIZE�MAX_WINDOW_SIZE�DEFAULT_WINDOW_SIZE�DEFAULT_MAX_PACKET_SIZE�HIGHEST_USERAUTH_MESSAGE_ID�MSG_UNIMPLEMENTED�	MSG_NAMES�MSG_EXT_INFO�
cMSG_EXT_INFO�byte_ord)�ZlibCompressor�ZlibDecompressor)�DSSKey)�
Ed25519Key)�
KexCurve25519)�KexGex�KexGexSHA256)�	KexGroup1)�
KexGroup14�KexGroup14SHA256)�KexGroup16SHA512)�KexNistp256�KexNistp384�KexNistp521)�	KexGSSGex�KexGSSGroup1�
KexGSSGroup14)�Message)�
Packetizer�NeedRekeyException)�ModulusPack)�RSAKey)�ECDSAKey)�ServerInterface)�
SFTPClient)�BadAuthenticationType�ChannelException�IncompatiblePeer�MessageOrderError�ProxyCommandFailure�SSHException)�ClosingContextManager�clamp_value�b)�	TripleDESc�>�[HnUR5 M g�N)�_active_threads�stop_thread)�thrs �4/usr/lib/python3/dist-packages/paramiko/transport.py�_join_lingering_threadsrl�s���������c�B�\rSrSrSr\"5r\"5rSrSR\
R5rSr
SrSrSrSr\R&"5(aS	\-rS
rSr\R.\R2SSS
.\R.\R2SSS
.\R.\R2SSS
.\R.\R4SSS
.\R.\R4SSS
.\R.\R4SSS
.\\R4SSS
.\R:SSSSS.\R:SSSSS.S.	r\SS.\SS.\ SS.\ SS.\!SS.\!SS.\"SS.\"SS.S.r#0S\$_S\$_S\$_S\$_S\$_S\$_S\%_S\%_S \&_S!\&_S"\&_S#\&_S$\&_S%\&_S&\'_S'\'_r(\)\*\+\,\-\.\/\0\1\2\3\4S(.r5\R&"5(a\\5S)'\6\74\6\74S*S+.r8S,r9S-r:\;\<S.SS,SSS,4S/jr=S0r>\?S15r@\?S25rA\?S35rB\?S45rC\?S55rD\?S65rES7rFS8rGS9rHS�S:jrIS*S;jrJS*S<jrKS=rLS>rM\NS�S?j5rOS@rPSArQSBrRS�SCjrSS�SDjrTSErUSFrVS�SGjrWS�SHjrXSIrYSJrZS�SKjr[SLr\SMr]S�SNjr^S�SOjr_S�SPjr`SQraSRrbSSrcSTrdSUreSVrfS�SWjrgS�SXjrhS�SYjriS�SZjrjS[rkS\rlS]rmS^rnS_roS`rpS�SajrqSbrrScrsSdrtSeruSfrvSgrwShrxSirySjrzSkr{Slr|Smr}S�Snjr~SorSpr�Sqr�Srr�Ssr�Str�Sur�Svr�Swr�Sxr�Syr�Szr�S�S{jr�S|r�S}r�S~r�Sr�S�r�S�r�S�r�S�r�S�r�S�r�S�r�S�r�S�r�S�r�S�r�S�r�\�\�GR<\�\�GR@\�\�GRD\�\�GRH\�\�GRL\�\�GRP\�\�GRT\�\�GRX0r�S�r�g,)��	Transport�ah
An SSH Transport attaches to a stream (usually a socket), negotiates an
encrypted session, authenticates, and then creates stream tunnels, called
`channels <.Channel>`, across the session.  Multiple channels can be
multiplexed across a single session (and often are, in the case of port
forwardings).

Instances of this class may be used as context managers.
�2.0zparamiko_{})	z
aes128-ctrz
aes192-ctrz
aes256-ctrz
aes128-cbcz
aes192-cbcz
aes256-cbcz3des-cbcz[email protected][email protected])�
hmac-sha2-256�
hmac-sha2-512�[email protected]�[email protected]�	hmac-sha1�hmac-md5�hmac-sha1-96�hmac-md5-96)�ssh-ed25519�ecdsa-sha2-nistp256�ecdsa-sha2-nistp384�ecdsa-sha2-nistp521�rsa-sha2-512�rsa-sha2-256�ssh-rsa�ssh-dss)	�ecdh-sha2-nistp256�ecdh-sha2-nistp384�ecdh-sha2-nistp521�diffie-hellman-group16-sha512�$diffie-hellman-group-exchange-sha256�diffie-hellman-group14-sha256�"diffie-hellman-group-exchange-sha1�diffie-hellman-group14-sha1�diffie-hellman-group1-sha1)�[email protected])�%gss-gex-sha1-toWM5Slw5Ew8Mqkay+al2g==�)gss-group14-sha1-toWM5Slw5Ew8Mqkay+al2g==�(gss-group1-sha1-toWM5Slw5Ew8Mqkay+al2g==��none�)�class�mode�
block-size�key-size�� ��T)r�r��iv-sizer��is_aead�)r��size�@)rvrxrrrtrsrurwryr�z[email protected][email protected]~[email protected]�z[email protected]{z([email protected]|z([email protected]}z([email protected]z [email protected])r�r�r�r�r�r�r�r�r�r�r�r�r�)NN��[email protected]�zlibr�N皙�����?Fc
�
�SUlSUl0UlX�lSUl[U[5(aFURSS5n
U
SUl[U
5S:XaU
SS4nOU
S[U
S54n[U5[La�Uup�X�lSn
[R"X�[R[R5nUHYunnnnnU[R:XdMUn[R"U[R5nUR!X�45  O [%SR'X�55e[(R*R-U5 S	UlXlUR0R3UR45 U	=(d [6"U5UlS
UR:-S-UR<-UlSUl S=Ul!Ul"S=Ul#Ul$S=Ul%Ul&S=Ul'Ul(SUl)SUl*SUl+X@l,SUl-SUl.SUl/URX(a/[aS
U5Ul.URbURd-Ul2SUl3SUl4SUl5SUl6SUl7SUl8[5Ul9[(Rt"5Ul;[y5Ul=0Ul>0Ul?SUl@X0lAX lBSUlCSUlDSUlESUlF[(R�"5UlH[(Rt"5UlISUlJSUlK[�R�"UR�5UlNUR8R�UR�5 SUlPSUlQSUlRSUlSSUlTSUlUSUlVU=(d 0UlWXplXSUlYSUlZ0Ul[/Ul\[(R�"URv5Ul^0Ul_[�UR�[�UR�[�UR�[�UR�[�UR�[�UR�[�UR�[�UR�[�UR�0	Ulrg![R"an[
U5n
SnAGM-SnAff=f)aM
Create a new SSH session over an existing socket, or socket-like
object.  This only creates the `.Transport` object; it doesn't begin
the SSH session yet.  Use `connect` or `start_client` to begin a client
session, or `start_server` to begin a server session.

If the object is not actually a socket, it must have the following
methods:

- ``send(bytes)``: Writes from 1 to ``len(bytes)`` bytes, and returns
  an int representing the number of bytes written.  Returns
  0 or raises ``EOFError`` if the stream has been closed.
- ``recv(int)``: Reads from 1 to ``int`` bytes and returns them as a
  string.  Returns 0 or raises ``EOFError`` if the stream has been
  closed.
- ``close()``: Closes the socket.
- ``settimeout(n)``: Sets a (float) timeout on I/O operations.

For ease of use, you may also pass in an address (as a tuple) or a host
string as the ``sock`` argument.  (A host string is a hostname with an
optional port (separated by ``":"``) which will be converted into a
tuple of ``(hostname, port)``.)  A socket will be connected to this
address and used for communication.  Exceptions from the ``socket``
call may be thrown in this case.

.. note::
    Modifying the the window and packet sizes might have adverse
    effects on your channels created from this transport. The default
    values are the same as in the OpenSSH code base and have been
    battle tested.

:param socket sock:
    a socket or socket-like object to create the session over.
:param int default_window_size:
    sets the default window size on the transport. (defaults to
    2097152)
:param int default_max_packet_size:
    sets the default max packet size on the transport. (defaults to
    32768)
:param bool gss_kex:
    Whether to enable GSSAPI key exchange when GSSAPI is in play.
    Default: ``False``.
:param bool gss_deleg_creds:
    Whether to enable GSSAPI credential delegation when GSSAPI is in
    play. Default: ``True``.
:param dict disabled_algorithms:
    If given, must be a dictionary mapping algorithm type to an
    iterable of algorithm identifiers, which will be disabled for the
    lifetime of the transport.

    Keys should match the last word in the class' builtin algorithm
    tuple attributes, such as ``"ciphers"`` to disable names within
    ``_preferred_ciphers``; or ``"kex"`` to disable something defined
    inside ``_preferred_kex``. Values should exactly match members of
    the matching attribute.

    For example, if you need to disable
    ``diffie-hellman-group16-sha512`` key exchange (perhaps because
    your code talks to a server which implements it differently from
    Paramiko), specify ``disabled_algorithms={"kex":
    ["diffie-hellman-group16-sha512"]}``.
:param bool server_sig_algs:
    Whether to send an extra message to compatible clients, in server
    mode, with a list of supported pubkey algorithms. Default:
    ``True``.
:param bool strict_kex:
    Whether to advertise (and implement, if client also advertises
    support for) a "strict kex" mode for safer handshaking. Default:
    ``True``.
:param packetizer_class:
    Which class to use for instantiating the internal packet handler.
    Default: ``None`` (i.e.: use `Packetizer` as normal).

.. versionchanged:: 1.15
    Added the ``default_window_size`` and ``default_max_packet_size``
    arguments.
.. versionchanged:: 1.15
    Added the ``gss_kex`` and ``gss_deleg_creds`` kwargs.
.. versionchanged:: 2.6
    Added the ``disabled_algorithms`` kwarg.
.. versionchanged:: 2.9
    Added the ``server_sig_algs`` kwarg.
.. versionchanged:: 3.4
    Added the ``strict_kex`` kwarg.
.. versionchanged:: 3.4
    Added the ``packetizer_class`` kwarg.
FN�:�r�zNo suitable address familyzUnable to connect to {}: {}T�SSH-�-�zgssapi-keyexg>@zparamiko.transport��i)s�active�hostname�server_extensions�advertise_strict_kex�agreed_on_strict_kex�
isinstance�str�split�len�int�type�tuple�socket�getaddrinfo�	AF_UNSPEC�SOCK_STREAM�connect�errorra�format�	threading�Thread�__init__�daemon�sock�
settimeout�_active_check_timeoutrU�
packetizer�	_PROTO_ID�
_CLIENT_ID�
local_version�remote_version�local_cipher�
remote_cipher�local_kex_init�remote_kex_init�	local_mac�
remote_mac�local_compression�remote_compression�
session_id�
host_key_type�host_key�use_gss_kex�gss_kex_used�kexgss_ctxt�gss_hostr�_preferred_gsskex�_preferred_kex�
kex_engine�H�K�initial_kex_done�in_kex�
authenticated�_expected_packet�Lock�lock�
ChannelMap�	_channels�channel_events�
channels_seen�_channel_counter�default_max_packet_size�default_window_size�_forward_agent_handler�_x11_handler�_tcp_handler�saved_exception�Event�
clear_to_send�clear_to_send_lock�clear_to_send_timeout�log_namer�
get_logger�logger�set_log�auth_handler�global_response�completion_event�banner_timeout�handshake_timeout�auth_timeout�channel_timeout�disabled_algorithms�server_sig_algs�server_mode�
server_object�server_key_dict�server_accepts�	Condition�server_accept_cv�subsystem_tabler@�_parse_ext_infor �_parse_newkeysr(�_parse_global_requestr)�_parse_request_successr*�_parse_request_failurer-�_parse_channel_open_successr.�_parse_channel_open_failurer/�_parse_channel_openr�_negotiate_keys�_handler_table)�selfr�r�r��gss_kex�gss_deleg_credsr�r�
strict_kex�packetizer_class�hlr��port�reason�	addrinfos�family�socktype�proto�	canonname�sockaddr�af�es                      rkr��Transport.__init__lsa��F�����
�!#���$.�!�$)��!��d�C� � ����C��#�B��q�E�D�M��2�w�!�|��1��r�{���1��s�2�a�5�z�*����:���!�N�H�$�M�1�F��*�*��� 0� 0�&�2D�2D��I�AJ�<���%��H��v�1�1�1��B�!�=�=��V�-?�-?�@�D�����h�%5�6��AJ�#�1�8�8��J���	���!�!�$�'�����	�	
�	�	���T�7�7�8�,�9�z�9�4�@���#�d�n�n�4�s�:�T�_�_�L��� ���13�3���D�.�59�9���d�2�+/�/�����;?�?����!8����!�����
�#��!��������
����&�~��G�D��"&�"8�"8�4�;N�;N�"N�D����������� %������"��� %�����N�N�$��	�$���� ������ !���'>�$�#6� �&*��#� ��� ���#���&�_�_�.���"+�.�.�"2���%)��"�,��
��o�o�d�m�m�4�����������,� ���#��� $��� ���"$������&���#6�#<�"�� �.��!���!���!��� ��� )� 3� 3�D�I�I� >���!���

�$�.�.���,�,��� :� :���!<�!<���!<�!<�$�d�&F�&F�$�d�&F�&F��d�6�6���-�-�

����"�<�<�(�!$�Q����(�s�S�T�-S?�?Tc�h^^�[TSRT55n[UU4SjU55$)Nz
_preferred_{}c3�l># �UH)nUTRRT/5;dM%Uv� M+ g7frg)r��get)�.0�xr�type_s  ��rk�	<genexpr>�.Transport._filter_algorithm.<locals>.<genexpr>[s5����
�����0�0�4�4�U�B�?�?�
�A��s�$4�	4)�getattrr�r�)rr(�defaults`` rk�_filter_algorithm�Transport._filter_algorithmYs4����$�� 6� 6�u� =�>���
��
�
�	
rmc�$�URS5$)N�ciphers�r-�rs rk�preferred_ciphers�Transport.preferred_ciphersa����%�%�i�0�0rmc�$�URS5$)N�macsr1r2s rk�preferred_macs�Transport.preferred_macses���%�%�f�-�-rmc�`�URS5n[U[SU55-5$)N�keysc3�D# �UHnSRU5v� M g7f)z{}[email protected])r�)r&r's  rkr)�+Transport.preferred_keys.<locals>.<genexpr>rs���J��A�-�4�4�Q�7�7��s� )r-r�)r�filtereds  rk�preferred_keys�Transport.preferred_keysis8���)�)�&�1�����J��J�J�
K�
�	
rmc�$�URS5$)N�pubkeysr1r2s rk�preferred_pubkeys�Transport.preferred_pubkeysur5rmc�$�URS5$)N�kexr1r2s rk�
preferred_kex�Transport.preferred_kexys���%�%�e�,�,rmc�$�URS5$)N�compressionr1r2s rk�preferred_compression�Transport.preferred_compression}s���%�%�m�4�4rmc���[[U5[-5nSRU5nUR(dUS-
nO�UR
S:wa<USRUR
URUR
SS-5-
nUR5(a(USR[UR55-
nOUR(aUS-
nOUS	-
nUS
-
nU$)�@
Returns a string representation of this object, for debugging.
z<paramiko.Transport at {}z (unconnected)r�z (cipher {}, {:d} bits)r�r�z (active; {} open channel(s))z (connected; awaiting auth)z
 (connecting)�>)�hex�idrr�r�r��_cipher_info�is_authenticatedr�r�r�)r�id_�outs   rk�__repr__�Transport.__repr__�s����"�T�(�Y�&�'��)�0�0��5���{�{��#�#�C�� � �B�&��0�7�7��%�%��%�%�d�&7�&7�8��D�q�H�����$�$�&�&��6�=�=�����'�����&�&��4�4����&���s�
���
rmc�X�URR5 UR5 g)an
Terminate this Transport without closing the session.  On posix
systems, if a Transport is open during process forking, both parent
and child will share the underlying socket, but only one process can
use the connection (without corrupting the session).  Use this method
to clean up a Transport object without disrupting the other process.

.. versionadded:: 1.5.3
N)r��closer2s rk�atfork�Transport.atfork�s��	
�	�	�����
�
�rmc��[U5$)z�
Return a `.SecurityOptions` object which can be used to tweak the
encryption algorithms this transport will permit (for encryption,
digest/hash operations, public keys, and key exchanges) and the order
of preference for them.
)�SecurityOptionsr2s rk�get_security_options�Transport.get_security_options�s���t�$�$rmc�~�U(dgUcURnU(aUb[R"U5nXlg)am
Normalize/canonicalize ``self.gss_host`` depending on various factors.

:param str gss_host:
    The explicitly requested GSS-oriented hostname to connect to (i.e.
    what the host's name is in the Kerberos database.) Defaults to
    ``self.hostname`` (which will be the 'real' target hostname and/or
    host portion of given socket object.)
:param bool trust_dns:
    Indicates whether or not DNS is trusted; if true, DNS will be used
    to canonicalize the GSS hostname (which again will either be
    ``gss_host`` or the transport's default hostname.)
    (Defaults to True due to backwards compatibility.)
:param bool gssapi_requested:
    Whether GSSAPI key exchange or authentication was even requested.
    If not, this is a no-op and nothing happens
    (and ``self.gss_host`` is not set.)
    (Defaults to True due to backwards compatibility.)
:returns: ``None``.
N)r�r��getfqdnr�)rr��	trust_dns�gssapi_requesteds    rk�set_gss_host�Transport.set_gss_host�s6��, �����}�}�H���-��~�~�h�/�H� �
rmc���SUlUbXlUR5 g[R"5=UlnUR5 Ub[
R
"5U-OSnUR
S5 UR(d UR5nUbUe[S5eUR5(dUb[
R
"5U:�agMv)a�
Negotiate a new SSH2 session as a client.  This is the first step after
creating a new `.Transport`.  A separate thread is created for protocol
negotiation.

If an event is passed in, this method returns immediately.  When
negotiation is done (successful or not), the given ``Event`` will
be triggered.  On failure, `is_active` will return ``False``.

(Since 1.4) If ``event`` is ``None``, this method will not return until
negotiation is done.  On success, the method returns normally.
Otherwise an SSHException is raised.

After a successful negotiation, you will usually want to authenticate,
calling `auth_password <Transport.auth_password>` or
`auth_publickey <Transport.auth_publickey>`.

.. note:: `connect` is a simpler method for connecting as a client.

.. note::
    After calling this method (or `start_server` or `connect`), you
    should no longer directly read from or write to the original socket
    object.

:param .threading.Event event:
    an event to trigger when negotiation is complete (optional)

:param float timeout:
    a timeout, in seconds, for SSH2 session negotiation (optional)

:raises:
    `.SSHException` -- if negotiation fails (and no ``event`` was
    passed in)
TNr��Negotiation failed.)
r�r��startr�r��time�wait�
get_exceptionra�is_set)r�event�timeout�max_timer!s     rk�start_client�Transport.start_client�s���F�����$)�!��J�J�L��)2���(9�9�����
�
��,3�,?�4�9�9�;��(�T����J�J�s�O��;�;��&�&�(���=��G�"�#8�9�9��|�|�~�~��#��	�	��x�(?��rmc��Uc
[5nSUlX lSUlUbXlUR5 g[R"5=UlnUR5 URS5 UR(d UR5nUbUe[S5eUR5(agMZ)ah
Negotiate a new SSH2 session as a server.  This is the first step after
creating a new `.Transport` and setting up your server host key(s).  A
separate thread is created for protocol negotiation.

If an event is passed in, this method returns immediately.  When
negotiation is done (successful or not), the given ``Event`` will
be triggered.  On failure, `is_active` will return ``False``.

(Since 1.4) If ``event`` is ``None``, this method will not return until
negotiation is done.  On success, the method returns normally.
Otherwise an SSHException is raised.

After a successful negotiation, the client will need to authenticate.
Override the methods `get_allowed_auths
<.ServerInterface.get_allowed_auths>`, `check_auth_none
<.ServerInterface.check_auth_none>`, `check_auth_password
<.ServerInterface.check_auth_password>`, and `check_auth_publickey
<.ServerInterface.check_auth_publickey>` in the given ``server`` object
to control the authentication process.

After a successful authentication, the client should request to open a
channel.  Override `check_channel_request
<.ServerInterface.check_channel_request>` in the given ``server``
object to allow channels to be opened.

.. note::
    After calling this method (or `start_client` or `connect`), you
    should no longer directly read from or write to the original socket
    object.

:param .threading.Event event:
    an event to trigger when negotiation is complete.
:param .ServerInterface server:
    an object used to perform authentication and create `channels
    <.Channel>`

:raises:
    `.SSHException` -- if negotiation fails (and no ``event`` was
    passed in)
NTr�rg)rZrrr�r�rhr�r�rjrkrarl)rrm�serverr!s    rk�start_server�Transport.start_servers���T�>�$�&�F����#�������$)�!��J�J�L��)2���(9�9�����
�
����J�J�s�O��;�;��&�&�(���=��G�"�#8�9�9��|�|�~�~��rmc��XRUR5'[U[5(aXRS'XRS'gg)a�
Add a host key to the list of keys used for server mode.  When behaving
as a server, the host key is used to sign certain packets during the
SSH2 negotiation, so that the client can trust that we are who we say
we are.  Because this is used for signing, the key must contain private
key info, not just the public half.  Only one key of each type (RSA or
DSS) is kept.

:param .PKey key:
    the host key to add, usually an `.RSAKey` or `.DSSKey`.
rr~N)r�get_namer�rX)r�keys  rk�add_server_key�Transport.add_server_keyNsH��03���S�\�\�^�,��c�6�"�"�36� � ��0�36� � ��0�#rmc�V�URUR$![a gf=f)a�
Return the active host key, in server mode.  After negotiating with the
client, this method will return the negotiated host key.  If only one
type of host key was set with `add_server_key`, that's the only key
that will ever be returned.  But in cases where you have set more than
one type of host key (for example, an RSA key and a DSS key), the key
type will be negotiated by the client, and this method will return the
key of the type agreed on.  If the host key has not been negotiated
yet, ``None`` is returned.  In client mode, the behavior is undefined.

:return:
    host key (`.PKey`) of the type negotiated by the client, or
    ``None``.
N)rr��KeyErrorr2s rk�get_server_key�Transport.get_server_keybs3��	��'�'��(:�(:�;�;���	���	�s��
(�(c���[5[lSS/nUbURSU5 UH#n[RR	U5  g S[lg![
a M@f=f)a�
(optional)
Load a file of prime moduli for use in doing group-exchange key
negotiation in server mode.  It's a rather obscure option and can be
safely ignored.

In server mode, the remote client may request "group-exchange" key
negotiation, which asks the server to send a random prime number that
fits certain criteria.  These primes are pretty difficult to compute,
so they can't be generated on demand.  But many systems contain a file
of suitable primes (usually named something like ``/etc/ssh/moduli``).
If you call `load_server_moduli` and it returns ``True``, then this
file of primes has been loaded and we will support "group-exchange" in
server mode.  Otherwise server mode will just claim that it doesn't
support that method of key negotiation.

:param str filename:
    optional path to the moduli file, if you happen to know that it's
    not in a standard location.
:return:
    True if a moduli file was successfully loaded; False otherwise.

.. note:: This has no effect when used in client mode.
z/etc/ssh/moduliz/usr/local/etc/moduliNrTF)rWro�
_modulus_pack�insert�	read_file�IOError)�filename�	file_list�fns   rk�load_server_moduli�Transport.load_server_moduliwsv��4#.�-�	��&�(?�@�	������Q��)��B�
��'�'�1�1�"�5���#'�	����	�
��
�s�A"�"
A0�/A0c���UR(dgUR5 [URR	55HnUR5 M URR5 g)z@
Close this session, and any open channels that are tied to it.
N)r�ri�listr��values�_unlinkr�rY)r�chans  rkrY�Transport.close�sM���{�{����������.�.�0�1�D��L�L�N�2��	�	���rmc�t�UR(aUR(d[S5eUR$)at
Return the host key of the server (in client mode).

.. note::
    Previously this call returned a tuple of ``(key type, key
    string)``. You can get the same effect by calling `.PKey.get_name`
    for the key type, and ``str(key)`` for the key string.

:raises: `.SSHException` -- if no session is currently active.

:return: public key (`.PKey`) of the remote server
�No existing session)r�r�rar�r2s rk�get_remote_server_key�Transport.get_remote_server_key�s)�����T�%:�%:��4�5�5��}�}�rmc��UR$)z�
Return true if this session is active (open).

:return:
    True if the session is still active (open); False if the session is
    closed
)r�r2s rk�	is_active�Transport.is_active�s���{�{�rmc�&�URSUUUS9$)a

Request a new channel to the server, of type ``"session"``.  This is
just an alias for calling `open_channel` with an argument of
``"session"``.

.. note:: Modifying the the window and packet sizes might have adverse
    effects on the session created. The default values are the same
    as in the OpenSSH code base and have been battle tested.

:param int window_size:
    optional window size for this session.
:param int max_packet_size:
    optional max packet size for this session.

:return: a new `.Channel`

:raises:
    `.SSHException` -- if the request is rejected or the session ends
    prematurely

.. versionchanged:: 1.13.4/1.14.3/1.15.3
    Added the ``timeout`` argument.
.. versionchanged:: 1.15
    Added the ``window_size`` and ``max_packet_size`` arguments.
�session)�window_size�max_packet_sizern��open_channel)rr�r�rns    rk�open_session�Transport.open_session�s(��8� � ��#�+��	!�
�	
rmc�"�URSUS9$)aq
Request a new channel to the client, of type ``"x11"``.  This
is just an alias for ``open_channel('x11', src_addr=src_addr)``.

:param tuple src_addr:
    the source address (``(str, int)``) of the x11 server (port is the
    x11 port, ie. 6010)
:return: a new `.Channel`

:raises:
    `.SSHException` -- if the request is rejected or the session ends
    prematurely
�x11)�src_addrr�)rr�s  rk�open_x11_channel�Transport.open_x11_channel�s��� � ��� �:�:rmc�$�URS5$)a

Request a new channel to the client, of type
``"[email protected]"``.

This is just an alias for ``open_channel('[email protected]')``.

:return: a new `.Channel`

:raises: `.SSHException` --
    if the request is rejected or the session ends prematurely
�[email protected]�r2s rk�open_forward_agent_channel�$Transport.open_forward_agent_channel�s��� � �!9�:�:rmc�&�URSX!5$)a
Request a new channel back to the client, of type ``forwarded-tcpip``.

This is used after a client has requested port forwarding, for sending
incoming connections back to the client.

:param src_addr: originator's address
:param dest_addr: local (server) connected address
�forwarded-tcpipr�)rr��	dest_addrs   rk�open_forwarded_tcpip_channel�&Transport.open_forwarded_tcpip_channels��� � �!2�I�H�Hrmc��UR(d[S5eUcUROUnURR	5 URU5nUR
U5nUR5n[5nUR[5 URU5 URU5 URU5 URU5 US:XdUS:XaQURUS5 URUS5 URUS5 URUS5 O.US:Xa(URUS5 URUS5 [U5n	URRXy5 [ R""5=UR$U'n
SUR&U'U	R)U5 U	R+XE5 URR-5 UR/U5 [0R0"5nU
R3S5 UR(d UR55nUc[S	5nUeU
R75(aO(X�-[0R0"5:a[S
5eM�URR9U5n	U	bU	$UR55nUc[S	5nUe!URR-5 f=f)a�
Request a new channel to the server. `Channels <.Channel>` are
socket-like objects used for the actual transfer of data across the
session. You may only request a channel after negotiating encryption
(using `connect` or `start_client`) and authenticating.

.. note:: Modifying the the window and packet sizes might have adverse
    effects on the channel created. The default values are the same
    as in the OpenSSH code base and have been battle tested.

:param str kind:
    the kind of channel requested (usually ``"session"``,
    ``"forwarded-tcpip"``, ``"direct-tcpip"``, or ``"x11"``)
:param tuple dest_addr:
    the destination address (address + port tuple) of this port
    forwarding, if ``kind`` is ``"forwarded-tcpip"`` or
    ``"direct-tcpip"`` (ignored for other channel types)
:param src_addr: the source address of this port forwarding, if
    ``kind`` is ``"forwarded-tcpip"``, ``"direct-tcpip"``, or ``"x11"``
:param int window_size:
    optional window size for this session.
:param int max_packet_size:
    optional max packet size for this session.
:param float timeout:
    optional timeout opening a channel, default 3600s (1h)

:return: a new `.Channel` on success

:raises:
    `.SSHException` -- if the request is rejected, the session ends
    prematurely or there is a timeout opening a channel

.. versionchanged:: 1.15
    Added the ``window_size`` and ``max_packet_size`` arguments.
�SSH session not activer��direct-tcpiprr�r�Tr�zUnable to open channel.zTimeout opening channel.)r�rar�r��acquire�_sanitize_window_size�_sanitize_packet_size�
_next_channelrT�add_byter�
add_string�add_intrr��putr�r�r�r��_set_transport�_set_window�release�_send_user_messagerirjrkrlr%)
r�kindr�r�r�r�rn�chanid�mr�rm�start_tsr!s
             rkr��Transport.open_channelss��X�{�{��7�8�8�*1�/�$�&�&�w���	�	����	 ��4�4�[�A�K�"�8�8��I�O��'�'�)�F��	�A�
�J�J�(�)�
�L�L���
�I�I�f��
�I�I�k�"�
�I�I�o�&��)�)�t�~�/E����Y�q�\�*��	�	�)�A�,�'����X�a�[�)��	�	�(�1�+�&�������X�a�[�)��	�	�(�1�+�&��6�?�D��N�N���v�,�2;�/�/�2C�C�D����'�%�)-�D���v�&�����%����[�:��I�I��������"��9�9�;����J�J�s�O��;�;��&�&�(���9�$�%>�?�A����|�|�~�~���#�d�i�i�k�1�"�#=�>�>���~�~�!�!�&�)�����K���� ���9��6�7�A����)
�I�I����s
�	FK%�%Lc��^�TR(d[S5e[U5nTRSX4SS9nUc[S5eUS:XaUR	5nUcU4SjnUnUTlU$)a�
Ask the server to forward TCP connections from a listening port on
the server, across this SSH session.

If a handler is given, that handler is called from a different thread
whenever a forwarded connection arrives.  The handler parameters are::

    handler(
        channel,
        (origin_addr, origin_port),
        (server_addr, server_port),
    )

where ``server_addr`` and ``server_port`` are the address and port that
the server was listening on.

If no handler is set, the default behavior is to send new incoming
forwarded connections into the accept queue, to be picked up via
`accept`.

:param str address: the address to bind when forwarding
:param int port:
    the port to forward, or 0 to ask the server to allocate any port
:param callable handler:
    optional handler for incoming forwarded connections, of the form
    ``func(Channel, (str, int), (str, int))``.

:return: the port number (`int`) allocated by the server

:raises:
    `.SSHException` -- if the server refused the TCP forward request
r��
tcpip-forwardT�rjzTCP forwarding request deniedrc�(>�TRU5 grg��_queue_incoming_channel)�channelr��dest_addr_portrs   �rk�default_handler�7Transport.request_port_forward.<locals>.default_handler�s����,�,�W�5rm)r�rar��global_request�get_intr�)r�addressr�handler�responser�s`     rk�request_port_forward�Transport.request_port_forwardrs����B�{�{��7�8�8��4�y���&�&��g�_�4�'�
�����>�?�?��1�9��#�#�%�D��?�
6�
&�G�#����rmc�Z�UR(dgSUlURSX4SS9 g)z�
Ask the server to cancel a previous port-forwarding request.  No more
connections to the given address & port will be forwarded across this
ssh connection.

:param str address: the address to stop forwarding
:param int port: the port to stop forwarding
N�cancel-tcpip-forwardTr�)r�r�r�)rr�rs   rk�cancel_port_forward�Transport.cancel_port_forward�s.���{�{�� ������2�W�O�$��Ormc�.�[R"U5$)a

Create an SFTP client channel from an open transport.  On success, an
SFTP session will be opened with the remote host, and a new
`.SFTPClient` object will be returned.

:return:
    a new `.SFTPClient` referring to an sftp session (channel) across
    this transport
)r[�from_transportr2s rk�open_sftp_client�Transport.open_sftp_client�s���(�(��.�.rmc��[5nUR[5 Uc%[[R
"S55S-S-nUR
[R
"U55 URU5 g)aq
Send a junk packet across the encrypted link.  This is sometimes used
to add "noise" to a connection to confuse would-be attackers.  It can
also be used as a keep-alive for long lived connections traversing
firewalls.

:param int byte_count:
    the number of random bytes to send in the payload of the ignored
    packet -- defaults to a random number from 10 to 41.
Nr�r��
)rTr�rrB�os�urandom�	add_bytesr�)r�
byte_countr�s   rk�send_ignore�Transport.send_ignore�s\��
�I��	�
�
�;����"�2�:�:�a�=�1�B�6�"�<�J�	���B�J�J�z�*�+�����"rmc�6�[R"5UlUR5 URR	S5 UR
(d UR
5nUbUe[S5eURR5(agMo)a�
Force this session to switch to new keys.  Normally this is done
automatically after the session hits a certain number of packets or
bytes sent or received, but this method gives you the option of forcing
new keys whenever you want.  Negotiating new keys causes a pause in
traffic both ways as the two sides swap keys and do computations.  This
method returns when the session has switched to new keys.

:raises:
    `.SSHException` -- if the key renegotiation failed (which causes
    the session to end)
r�Nrg)	r�r�r��_send_kex_initrjr�rkrarl�rr!s  rk�renegotiate_keys�Transport.renegotiate_keys�s���!*��� 1���������!�!�&�&�s�+��;�;��&�&�(���=��G�"�#8�9�9��$�$�+�+�-�-���rmc�n�[R"U54SjnURRX5 g)a�
Turn on/off keepalive packets (default is off).  If this is set, after
``interval`` seconds without sending any data over the connection, a
"keepalive" packet will be sent (and ignored by the remote host).  This
can be useful to keep connections alive over a NAT, for example.

:param int interval:
    seconds to wait before sending a keepalive packet (or
    0 to disable keepalives).
c�"�URSSS9$)Nz[email protected]�)r�)r's rk�_request�)Transport.set_keepalive.<locals>._request�s���#�#�$7�e�#�D�DrmN)�weakref�proxyr��
set_keepalive)r�intervalr�s   rkr��Transport.set_keepalive�s*���}�}�T�*�	E�	
���%�%�h�9rmc��U(a[R"5Ul[5nUR	[
5 UR
U5 URU5 UbUR"U6 UR[SRU55 URU5 U(dgURRS5 UR(dgURR5(a
UR $M[)a
Make a global request to the remote host.  These are normally
extensions to the SSH2 protocol.

:param str kind: name of the request.
:param tuple data:
    an optional tuple containing additional data to attach to the
    request.
:param bool wait:
    ``True`` if this method should not return until a response is
    received; ``False`` otherwise.
:return:
    a `.Message` containing possible additional data if the request was
    successful (or an empty `.Message` if ``wait`` was ``False``);
    ``None`` if the request was denied.
NzSending global request "{}"r�)r�r�r�rTr�rr��add_boolean�add�_logrr�r�rjr�rlr�)rr��datarjr�s     rkr��Transport.global_request�s���"�$-�O�O�$5�D�!��I��	�
�
�&�'�	���T��	�
�
�d����
�E�E�4�L��	�	�%�6�=�=�d�C�D�����"�����!�!�&�&�s�+��;�;���$�$�+�+�-�-���#�#�#�
rmc��URR5 [UR5S:�aURR	S5nORUR
R
U5 [UR5S:�aURR	S5nOSnURR5 U$!URR5 f=f)a
Return the next channel opened by the client over this transport, in
server mode.  If no channel is opened before the given timeout,
``None`` is returned.

:param int timeout:
    seconds to wait for a channel, or ``None`` to wait forever
:return: a new `.Channel` opened by the client
rN)r�r�r�r�poprrjr�)rrnr�s   rk�accept�Transport.accept$s���	
�	�	����	 ��4�&�&�'�!�+��*�*�.�.�q�1���%�%�*�*�7�3��t�*�*�+�a�/��.�.�2�2�1�5�D� �D��I�I�������
�I�I����s�BB?�?Cc

��Ub5[U[5(a
/SQUlOUR5/UlUR	UU	U=(d US9 UR5 UGbFU(Gd>UR
5n
U
R5UR5:wd"U
R5UR5:wa�UR[S5 UR[SRUR5[UR5555 UR[SRU
R5[U
R5555 [S5eUR[SRUR555 UcUcU(dU(a�U(a3UR[S5 URX RU5 gU(a(UR[S	5 URU5 gUb(UR[S
5 UR!X$5 gUR[S5 UR#X#5 g)a�
Negotiate an SSH2 session, and optionally verify the server's host key
and authenticate using a password or private key.  This is a shortcut
for `start_client`, `get_remote_server_key`, and
`Transport.auth_password` or `Transport.auth_publickey`.  Use those
methods if you want more control.

You can use this method immediately after creating a Transport to
negotiate encryption with a server.  If it fails, an exception will be
thrown.  On success, the method will return cleanly, and an encrypted
session exists.  You may immediately call `open_channel` or
`open_session` to get a `.Channel` object, which is used for data
transfer.

.. note::
    If you fail to supply a password or private key, this method may
    succeed, but a subsequent `open_channel` or `open_session` call may
    fail because you haven't authenticated yet.

:param .PKey hostkey:
    the host key expected from the server, or ``None`` if you don't
    want to do host key verification.
:param str username: the username to authenticate as.
:param str password:
    a password to use for authentication, if you want to use password
    authentication; otherwise ``None``.
:param .PKey pkey:
    a private key to use for authentication, if you want to use private
    key authentication; otherwise ``None``.
:param str gss_host:
    The target's name in the kerberos database. Default: hostname
:param bool gss_auth:
    ``True`` if you want to use GSS-API authentication.
:param bool gss_kex:
    Perform GSS-API Key Exchange and user authentication.
:param bool gss_deleg_creds:
    Whether to delegate GSS-API client credentials.
:param gss_trust_dns:
    Indicates whether or not the DNS is trusted to securely
    canonicalize the name of the host being connected to (default
    ``True``).

:raises: `.SSHException` -- if the SSH2 negotiation fails, the host key
    supplied by the server is incorrect, or authentication fails.

.. versionchanged:: 2.3
    Added the ``gss_trust_dns`` argument.
N)r~rr�)r�rbrczBad host key from serverzExpected: {}: {}zGot     : {}: {}zHost key verified ({})z,Attempting GSS-API auth... (gssapi-with-mic)z)Attempting GSS-API auth... (gssapi-keyex)zAttempting public-key auth...zAttempting password auth...)r�rX�_preferred_keysrwrdrpr��asbytesr�rr��reprra�auth_gssapi_with_micr��auth_gssapi_keyex�auth_publickey�
auth_password)r�hostkey�username�password�pkeyr��gss_authrr�
gss_trust_dnsrxs           rkr��Transport.connect=s��x���'�6�*�*�(��$�)0�(8�(8�(:�';��$�����#�$�0��	�	
�	
����

����,�,�.�C�����'�"2�"2�"4�4��;�;�=�G�O�O�$5�5��	�	�%�!;�<��	�	��&�-�-��(�(�*�D����1B�,C����	�	��&�-�-������S�[�[�]�(;���#�#=�>�>��I�I��/�6�6�w�7G�7G�7I�J�
�
��(�"6�8�w���	�	��I���)�)��m�m�_��	���	�	�%�!L�M��&�&�x�0�	��!��	�	�%�!@�A��#�#�H�3�
	��	�	�%�!>�?��"�"�8�6�rmc���URR5 URnSUlUURR5 $!URR5 f=f)a9
Return any exception that happened during the last server request.
This can be used to fetch more specific error information after using
calls like `start_client`.  The exception (if any) is cleared after
this call.

:return:
    an exception, or ``None`` if there is no stored exception.

.. versionadded:: 1.1
N)r�r�r�r�r�s  rkrk�Transport.get_exception�sP��	
�	�	����	 ��$�$�A�#'�D� ���I�I�����D�I�I������A�A'c���URR5 X#U4URU'URR5 g!URR5 f=f)a�
Set the handler class for a subsystem in server mode.  If a request
for this subsystem is made on an open ssh channel later, this handler
will be constructed and called -- see `.SubsystemHandler` for more
detailed documentation.

Any extra parameters (including keyword arguments) are saved and
passed to the `.SubsystemHandler` constructor later.

:param str name: name of the subsystem.
:param handler:
    subclass of `.SubsystemHandler` that handles this subsystem.
N�r�r�rr�)r�namer��args�kwargss     rk�set_subsystem_handler�Transport.set_subsystem_handler�sM��	 ��I�I����*1��)@�D� � ��&��I�I�����D�I�I����s�+A�A$c��UR=(a/ URSL=(a URR5$)z�
Return true if this session is active and authenticated.

:return:
    True if the session is still open and has been authenticated
    successfully; False if authentication failed and/or the session is
    closed.
N)r�r�rSr2s rkrS�Transport.is_authenticated�s:��
�K�K�
5��!�!��-�
5��!�!�2�2�4�	
rmc�t�UR(a
URcgURR5$)z�
Return the username this connection is authenticated for.  If the
session is not authenticated (or authentication failed), this method
returns ``None``.

:return: username that was authenticated (a `str`), or ``None``.
N)r�r��get_usernamer2s rkr�Transport.get_username�s.���{�{�t�0�0�8��� � �-�-�/�/rmc�l�UR(a
URcgURR$)z�
Return the banner supplied by the server upon connect. If no banner is
supplied, this method returns ``None``.

:returns: server supplied banner (`str`), or ``None``.

.. versionadded:: 1.13
N)r�r��bannerr2s rk�
get_banner�Transport.get_banners+���{�{�t�0�0�8��� � �'�'�'rmc��UR(aUR(d[S5e[R"5n[U5UlURRX5 URRU5$)at
Try to authenticate to the server using no authentication at all.
This will almost always fail.  It may be useful for determining the
list of authentication types supported by the server, by catching the
`.BadAuthenticationType` exception raised.

:param str username: the username to authenticate as
:return:
    list of auth types permissible for the next stage of
    authentication (normally empty)

:raises:
    `.BadAuthenticationType` -- if "none" authentication isn't allowed
    by the server for this user
:raises:
    `.SSHException` -- if the authentication failed due to a network
    error

.. versionadded:: 1.5
r�)	r�r�rar�r�r
r��	auth_none�wait_for_response�rr�my_events   rkr�Transport.auth_none
sc��*���T�%:�%:��4�5�5��?�?�$��'��-������#�#�H�7�� � �2�2�8�<�<rmc��^�UR(aUR(d[S5eUc[R"5nOUn[U5UlURRUTU5 Ub/$URRU5$![aJnU(aSUR;aeU4SjnURX5sSnA$![a Uef=fSnAff=f)aX
Authenticate to the server using a password.  The username and password
are sent over an encrypted link.

If an ``event`` is passed in, this method will return immediately, and
the event will be triggered once authentication succeeds or fails.  On
success, `is_authenticated` will return ``True``.  On failure, you may
use `get_exception` to get more detailed error information.

Since 1.1, if no event is passed, this method will block until the
authentication succeeds or fails.  On failure, an exception is raised.
Otherwise, the method simply returns.

Since 1.5, if no event is passed and ``fallback`` is ``True`` (the
default), if the server doesn't support plain password authentication
but does support so-called "keyboard-interactive" mode, an attempt
will be made to authenticate using this interactive mode.  If it fails,
the normal exception will be thrown as if the attempt had never been
made.  This is useful for some recent Gentoo and Debian distributions,
which turn off plain password authentication in a misguided belief
that interactive authentication is "more secure".  (It's not.)

If the server requires multi-step authentication (which is very rare),
this method will return a list of auth types permissible for the next
step.  Otherwise, in the normal case, an empty list is returned.

:param str username: the username to authenticate as
:param basestring password: the password to authenticate with
:param .threading.Event event:
    an event to trigger when the authentication attempt is complete
    (whether it was successful or not)
:param bool fallback:
    ``True`` if an attempt at an automated "interactive" password auth
    should be made if the server doesn't support normal password auth
:return:
    list of auth types permissible for the next stage of
    authentication (normally empty)

:raises:
    `.BadAuthenticationType` -- if password authentication isn't
    allowed by the server for this user (and no event was passed in)
:raises:
    `.AuthenticationException` -- if the authentication failed (and no
    event was passed in)
:raises: `.SSHException` -- if there was a network error
r�N�keyboard-interactivec�`>�[U5S:�a[S5e[U5S:Xa/$T/$�Nr�zFallback authentication failed.r�r�ra��title�instructions�fieldsrs   �rkr��(Transport.auth_password.<locals>.handlern�5����6�{�Q��*�+L�M�M��6�{�a�'�
 "�	�$�:�%rm)r�r�rar�r�r
r�rrr\�
allowed_types�auth_interactive)rrrrm�fallbackrr!r�s  `     rkr�Transport.auth_password)s����^���T�%:�%:��4�5�5��=� ���(�H��H�'��-������'�'��(�H�E����I�	��$�$�6�6�x�@�@��$�	�� 6�a�o�o� M��
�	&��,�,�X�?�?���
���
��'	�s0�=B�
C,�"C'�;C�C,�
C$�$C'�'C,c�*�UR(aUR(d[S5eUc[R"5nOUn[U5UlURRXU5 Ub/$URRU5$)a�
Authenticate to the server using a private key.  The key is used to
sign data from the server, so it must include the private part.

If an ``event`` is passed in, this method will return immediately, and
the event will be triggered once authentication succeeds or fails.  On
success, `is_authenticated` will return ``True``.  On failure, you may
use `get_exception` to get more detailed error information.

Since 1.1, if no event is passed, this method will block until the
authentication succeeds or fails.  On failure, an exception is raised.
Otherwise, the method simply returns.

If the server requires multi-step authentication (which is very rare),
this method will return a list of auth types permissible for the next
step.  Otherwise, in the normal case, an empty list is returned.

:param str username: the username to authenticate as
:param .PKey key: the private key to authenticate with
:param .threading.Event event:
    an event to trigger when the authentication attempt is complete
    (whether it was successful or not)
:return:
    list of auth types permissible for the next stage of
    authentication (normally empty)

:raises:
    `.BadAuthenticationType` -- if public-key authentication isn't
    allowed by the server for this user (and no event was passed in)
:raises:
    `.AuthenticationException` -- if the authentication failed (and no
    event was passed in)
:raises: `.SSHException` -- if there was a network error
r�)	r�r�rar�r�r
r�r�r)rrrxrmrs     rkr��Transport.auth_publickey~s{��F���T�%:�%:��4�5�5��=� ���(�H��H�'��-������(�(���A����I�� � �2�2�8�<�<rmc��UR(aUR(d[S5e[R"5n[U5UlURRXXC5 URRU5$)a�
Authenticate to the server interactively.  A handler is used to answer
arbitrary questions from the server.  On many servers, this is just a
dumb wrapper around PAM.

This method will block until the authentication succeeds or fails,
periodically calling the handler asynchronously to get answers to
authentication questions.  The handler may be called more than once
if the server continues to ask questions.

The handler is expected to be a callable that will handle calls of the
form: ``handler(title, instructions, prompt_list)``.  The ``title`` is
meant to be a dialog-window title, and the ``instructions`` are user
instructions (both are strings).  ``prompt_list`` will be a list of
prompts, each prompt being a tuple of ``(str, bool)``.  The string is
the prompt and the boolean indicates whether the user text should be
echoed.

A sample call would thus be:
``handler('title', 'instructions', [('Password:', False)])``.

The handler should return a list or tuple of answers to the server's
questions.

If the server requires multi-step authentication (which is very rare),
this method will return a list of auth types permissible for the next
step.  Otherwise, in the normal case, an empty list is returned.

:param str username: the username to authenticate as
:param callable handler: a handler for responding to server questions
:param str submethods: a string list of desired submethods (optional)
:return:
    list of auth types permissible for the next stage of
    authentication (normally empty).

:raises: `.BadAuthenticationType` -- if public-key authentication isn't
    allowed by the server for this user
:raises: `.AuthenticationException` -- if the authentication failed
:raises: `.SSHException` -- if there was a network error

.. versionadded:: 1.5
r�)	r�r�rar�r�r
r�r-r)rrr��
submethodsrs     rkr-�Transport.auth_interactive�sk��V���T�%:�%:��4�5�5��?�?�$��'��-������*�*��x�	
�� � �2�2�8�<�<rmc�:�U(dSnURXU5$)z�
Authenticate to the server interactively but dumber.
Just print the prompt and / or instructions to stdout and send back
the response. This is good for situations where partial auth is
achieved by key and then the user has to enter a 2fac token.
c��/nU(a[UR55 U(a[UR55 UH6upE[UR5SS9 UR[55 M8 U$�N� )�end��print�strip�append�input�r'r(�prompt_list�answers�prompt�
show_inputs      rkr��0Transport.auth_interactive_dumb.<locals>.handler��^������%�+�+�-�(���,�,�,�.�/�*5�&�F��&�,�,�.�c�2��N�N�5�7�+�+6��rm)r-�rrr�r3s    rk�auth_interactive_dumb�Transport.auth_interactive_dumb�s!���	
��$�$�X�
�C�Crmc��UR(aUR(d[S5e[R"5n[U5UlURRXX45 URRU5$)aD
Authenticate to the Server using GSS-API / SSPI.

:param str username: The username to authenticate as
:param str gss_host: The target host
:param bool gss_deleg_creds: Delegate credentials or not
:return: list of auth types permissible for the next stage of
         authentication (normally empty)
:raises: `.BadAuthenticationType` -- if gssapi-with-mic isn't
    allowed by the server (and no event was passed in)
:raises:
    `.AuthenticationException` -- if the authentication failed (and no
    event was passed in)
:raises: `.SSHException` -- if there was a network error
r�)	r�r�rar�r�r
r�r�r)rrr�rrs     rkr��Transport.auth_gssapi_with_mic�sj�� ���T�%:�%:��4�5�5��?�?�$��'��-������.�.���	
�� � �2�2�8�<�<rmc��UR(aUR(d[S5e[R"5n[U5UlURRX5 URRU5$)a�
Authenticate to the server with GSS-API/SSPI if GSS-API kex is in use.

:param str username: The username to authenticate as.
:returns:
    a list of auth types permissible for the next stage of
    authentication (normally empty)
:raises: `.BadAuthenticationType` --
    if GSS-API Key Exchange was not performed (and no event was passed
    in)
:raises: `.AuthenticationException` --
    if the authentication failed (and no event was passed in)
:raises: `.SSHException` -- if there was a network error
r�)	r�r�rar�r�r
r�r�rrs   rkr��Transport.auth_gssapi_keyexsc�����T�%:�%:��4�5�5��?�?�$��'��-������+�+�H�?�� � �2�2�8�<�<rmc��Xl[R"U5UlURRUR5 g)a/
Set the channel for this transport's logging.  The default is
``"paramiko.transport"`` but it can be set to anything you want. (See
the `.logging` module for more info.)  SSH Channels will log to a
sub-channel of the one specified.

:param str name: new channel name for logging

.. versionadded:: 1.1
N)r�rr�r�r�r��rr
s  rk�set_log_channel�Transport.set_log_channel,s/���
��o�o�d�+�����������,rmc��UR$)zu
Return the channel name used for this transport's logging.

:return: channel name as a `str`

.. versionadded:: 1.2
)r�r2s rk�get_log_channel�Transport.get_log_channel;s���}�}�rmc�:�URRU5 g)a)
Turn on/off logging a hex dump of protocol traffic at DEBUG level in
the logs.  Normally you would want this off (which is the default),
but if you are debugging something, it may be useful.

:param bool hexdump:
    ``True`` to log protocol traffix (in hex) to the log; ``False``
    otherwise.
N)r��set_hexdump)r�hexdumps  rkrU�Transport.set_hexdumpEs��	
���#�#�G�,rmc�6�URR5$)z�
Return ``True`` if the transport is currently logging hex dumps of
protocol traffic.

:return: ``True`` if hex dumps are being logged, else ``False``.

.. versionadded:: 1.4
)r��get_hexdumpr2s rkrY�Transport.get_hexdumpQs�����*�*�,�,rmc�0�U(aSUlgSUlg)ac
Turn on/off compression.  This will only have an affect before starting
the transport (ie before calling `connect`, etc).  By default,
compression is off since it negatively affects interactive sessions.

:param bool compress:
    ``True`` to ask the remote client/server to compress traffic;
    ``False`` to refuse compression

.. versionadded:: 1.5.2
r�r�N)�_preferred_compression)r�compresss  rk�use_compression�Transport.use_compression\s���*N�D�'�*3�D�'rmc�F�[URSS5nUcgU"5$)aM
Return the address of the remote side of this Transport, if possible.

This is effectively a wrapper around ``getpeername`` on the underlying
socket.  If the socket-like object has no ``getpeername`` method, then
``("unknown", 0)`` is returned.

:return:
    the address of the remote host, if known, as a ``(str, int)``
    tuple.
�getpeernameN)�unknownr)r+r�)r�gps  rkra�Transport.getpeernamems%���T�Y�Y�
�t�
4��
�:���t�rmc��SUlURR5 UR5(a�U[R
"5La�URR(d�URR(dzURS5 UR5(aSU[R
"5La:URR(dURR(dMvgggggggg)NFr�)
r�r�rY�is_aliver��current_threadr��_closed�closed�joinr2s rkri�Transport.stop_thread~s������������
�M�M�O�O��I�4�4�6�6��I�I�%�%��O�O�*�*��I�I�c�N�
�M�M�O�O��I�4�4�6�6��I�I�%�%��O�O�*�*�*�&�7�
�+�&�7�
rmc���[[U5[5(a%UHnURR	X5 M  gURR"X/UQ76 grg)�
issubclassr�r�r��log)r�level�msgrr�s     rkr��Transport._log�sD���d�3�i��&�&���������)��
�K�K�O�O�E�.��.rmc��UR$)z0used by KexGex to find primes for group exchange)r�r2s rk�_get_modulus_pack�Transport._get_modulus_pack�s���!�!�!rmc��URnURRU5bAURS-S-UlURnURRU5bMAURS-S-UlU$)zyou are holding the lockr�i���)r�r�r%�rr�s  rkr��Transport._next_channel�s{���&�&���n�n� � ��(�4�%)�%:�%:�Q�%>�(�$J�D�!��*�*�F��n�n� � ��(�4�"&�!6�!6��!:�h� F����
rmc�:�URRU5 g)z?used by a Channel to remove itself from the active channel listN)r��deletervs  rk�_unlink_channel�Transport._unlink_channel�s�������f�%rmc�:�URRU5 grg)r��send_message)rr�s  rk�
_send_message�Transport._send_message�s�����$�$�T�*rmc�X�[R"5nURRS5 UR(dUR	[
S5 gURR5 URR5(aOLURR5 [R"5X R-:�a[S5eM�URU5 URR5 g!URR5 f=f)zc
send a message, but block if we're in key negotiation.  this is used
for user-initiated requests.
r�z0Dropping user packet because connection is dead.Nz2Key-exchange timed out waiting for key negotiation)
rir�rjr�r�rr�r�rlr�r�rar~)rr�rhs   rkr��Transport._send_user_message�s���
�	�	�������#�#�C�(��;�;��	�	��M����#�#�+�+�-��!�!�(�(�*�*���#�#�+�+�-��y�y�{�U�%?�%?�?�?�"�H����	.����t�$��#�#�+�+�-��D�#�#�+�+�-�s�!D
�
D)c�D�XlX lURcX lgg)zB
Used by a kex obj to set the K (root key) and H (exchange hash).
N)r�r�r�)r�k�hs   rk�_set_K_H�Transport._set_K_H�s"�������?�?�"��O�#rmc�$�[U5Ulg)zG
Used by a kex obj to register the next packet type it expects to see.
N)r�r�)r�ptypess  rk�_expect_packet�Transport._expect_packet�s��!&�f�
��rmc��URUR"[U55nUc[S5eUR	UR
[U55(d$[SR
UR55eX0lg)NzUnknown host key typez#Signature verification ({}) failed.)�	_key_infor�rTra�verify_ssh_sigr�r�r�)rr��sigrxs    rk�_verify_key�Transport._verify_key�sw���n�n�T�/�/�0���1B�C���;��6�7�7��!�!�$�&�&�'�#�,�7�7��5�<�<��&�&���
�
�
rmc��[5nURUR5 URUR5 UR[
U55 URUR5 [URSS5nSRURRRU5nUc[nUS-
n[US5(d#UR[ U5 [#USS5 U"UR%55R'5=pg[)U5U:a�[5nURUR5 URUR5 URU5 U"UR%55R'5nXh-
nXx-
n[)U5U:aM�USU$)z0id is 'A' - 'F' for the various keys used by ssh�	hash_algoNz&kex engine {} specified hash_algo {!r}z, falling back to sha1�_logged_hash_selectionT)rT�	add_mpintr�r�r�r�rdr�r+r�r��	__class__�__name__r�hasattrr�r�setattrr��digestr�)	rrQ�nbytesr�r��hash_select_msgrU�sofarr�s	         rk�_compute_key�Transport._compute_key�sa���I��	���D�F�F��	���D�F�F��	�
�
�1�R�5��	���D�O�O�$��D�O�O�[�$�?�	�B�I�I��O�O�%�%�.�.�	�
�����I��7�7�O��t�5�6�6��I�I�e�_�-��D�2�D�9���	�	��,�3�3�5�5���#�h����	�A�
�K�K�����
�K�K�����
�K�K����q�y�y�{�+�2�2�4�F��M�C��O�E��#�h����7�F�|�rmc��XR;a[SU-5eURUnUS"U5nU(aU$[UUS"U5[5S9nX@RLaUR5$UR
5$)NzUnknown cipher r�r�)�	algorithmr��backend)rRrar	r�_ENCRYPT�	encryptor�	decryptor)	rr
rx�iv�	operationr�infor��ciphers	         rk�_get_engine�Transport._get_engines����(�(�(��0�4�7�8�8�� � ��&����M�#�&�	�������f��b�!�#�%�	
���
�
�%��#�#�%�%��#�#�%�%rmc�6^�UcU4SjnUTlgUTlg)Nc�(>�TRU5 grgr�)r�rs �rkr��=Transport._set_forward_agent_handler.<locals>.default_handler�����,�,�W�5rm)r��rr�r�s`  rk�_set_forward_agent_handler�$Transport._set_forward_agent_handlers����?�
6�+:�D�'�*1�D�'rmc�6^�UcU4SjnUTlgUTlg)Nc�(>�TRU5 grgr�)r��
src_addr_portrs  �rkr��3Transport._set_x11_handler.<locals>.default_handler$r�rm)r�r�s`  rk�_set_x11_handler�Transport._set_x11_handler s����?�
6�!0�D�� '�D�rmc��URR5 URRU5 URR5 URR
5 g!URR
5 f=frg)r�r�rr=r�notifyr�)rr�s  rkr��!Transport._queue_incoming_channel+s^���	�	����	 ����&�&�w�/��!�!�(�(�*��I�I�����D�I�I����s�5A,�,Bc�J�UcURn[[U[5$rg)r�rcr8r:)rr�s  rkr��Transport._sanitize_window_size3s"�����2�2�K��?�K��I�Irmc�J�UcURn[[U[5$rg)r�rcr9r:)rr�s  rkr��Transport._sanitize_packet_size8s"���"�"�:�:�O��?�O�_�M�Mrmc���UR(aU[::dUR5(ag[5nU[:XaUR[5 U$U[:Xa}UR5nUR5nUR[5 URU5 UR[5 URS5 URS5 U$)a?
Checks message type against current auth state.

If server mode, and auth has not succeeded, and the message is of a
post-auth type (channel open or global request) an appropriate error
response Message is crafted and returned to caller for sending.

Otherwise (client mode, authed, or pre-auth message) returns None.
Nr��en)rr=rSrTr(r�r"r/�get_textr�r&r�r$r�)r�ptype�message�replyr�r�s      rk�_ensure_authed�Transport._ensure_authed=s���� � ��3�3��$�$�&�&���	���&�&��N�N�/�0����&�
&��#�#�%�D��_�_�&�F��N�N�4�5��M�M�&�!��M�M�A�B����R� ����T�"��rmc��UR(a<UR(d*[R"USU35n[	SU<S35egg)z�
Conditionally raise `MessageOrderError` during strict initial kex.

This method should only be called inside code that handles non-KEXINIT
messages; it does not interrogate ``ptype`` besides using it to log
more accurately.
zmsg z!In strict-kex mode, but was sent �!N)r�r�r?r%r_)rr�r
s   rk�_enforce_strict_kex�Transport._enforce_strict_kexcsM���$�$�T�-B�-B��=�=��$�u�g��7�D�#�3�D�8�1�=��
�.C�$rmc���[Ul[RU5 [[	U5[
-5nUR(a&UR[SRU55 O%UR[SRU55 URR[URS-55 UR[SRUR55 UR5 URRUR 5 UR#5 UR%[&5 UR((Ga~URR+5(a!UR,(dUR#5 URR/5up#U[2:XaUR5U5 M�U[6:XaUR9U5 GO�U[::Xa$UR5U5 UR=U5 M�[?UR@5S:�a�X R@;a?[BnURD(a[FnU"SRUR@U55e[I5Ul US:�a$US::aURJRMX#5 GMwX RN;aBURQX#5nU(aURSU5 GO�URNU"U5 GO�X RT;a�URW5nURXR[U5nUbURTU"Xs5 GOFX`R\;a'UR[S	RU55 GOUR[^S
RU55 GOUR`bWX R`RN;a>UR`RNUnU"U5 [?UR@5S:�aGM�O�[bUn	SRX)5n
UR[dU
5 U[f:waK[i5nURk[l5 URoURp5 URSU5 URRs5 UR((aGM~[R�U5 [�URXR�55HnUR�5 M UR((a�SUlURR�5 UR�bUR�R�5 UR`bUR`R�5 UR�R�5HnUR�5 M UR�R�5 UR�R�5 UR�R�5 UR�R�5 g![0a GMf=f![BasnUR[^SRUR(aS
OSU55 UR[^[tRv"55 X�l<SnAGN�SnAf[za'nUR[S5 X�l<SnAGN#SnAf[|R~a�n[�UR�5[HLa\UR�(a-SRUR�SUR�S5n
O*[�U5=(d [�U5n
OUR�n
UR[^SU
-5 X�l<SnAGN�SnAf[�a\nUR[^S[�U5-5 UR[^[tRv"55 X�l<SnAGNGSnAff=f!UR�R�5 f=f! URR�beg=f)Nz!starting thread (server mode): {}z!starting thread (client mode): {}z
zLocal version/idstring: {}rz$Expecting packet from {!r}, got {:d}r��)z&Ignoring message for dead channel {:d}z(Channel request for unknown channel {:d}zOops, unhandled type {} ({!r})zException ({}): {}rs�clientzEOF in transport threadz	{} ({:d})r�zSocket exception: zUnknown exception: F)U�sysrhr=rPrQrrr�rr�r��	write_allrdr��
_check_banner�start_handshaker�r�r�rr��
need_rekeyr��read_messagerVrr�r�_parse_disconnectr�_parse_debugr�r�rar�r_r�r��
parse_nextrr�r~�_channel_handler_tabler�r�r%r�rr�r?rr>rTr�rr��seqno�complete_handshaker�
tb_stringsr��EOFErrorr�r�r�rr�r��	Exception�remover�r�r�rYr��set�abortr�r�r�rr�r�r��modules)r�tidr�r��	exc_class�	error_msgr�r�r�r
�warningrpr!�emsgrms               rk�run�
Transport.runqsV�����	���t�$��"�T�(�Y�&�'������I�I�e�@�G�G��L�M��I�I�e�@�G�G��L�M�Y	�
)����)�)�!�D�,>�,>��,G�*H�I��	�	��0�7�7��8J�8J�K���"�"�$����/�/��0F�0F�G��#�#�%��#�#�K�0��k�k�k����1�1�3�3�D�K�K��+�+�-�!�#'�?�?�#?�#?�#A����
�*��0�0��7� ��.�0��.�.�q�1���)�+��0�0��7��)�)�!�,� ��4�0�0�1�A�5� �(=�(=�=�(4�I�#�8�8�,=�	�"+� F� M� M�$(�$9�$9�5�!"�#��
16���-�"�R�K�e�r�k� �O�O�6�6�u�@�$�� 3� 3�3�$(�$7�$7��$A�	�$� �.�.�y�9� �/�/��6�q�9��"=�"=�=�!"�����#�~�~�1�1�&�9���+� �7�7��>�t�G�#�'9�'9�9� �I�I� %� H� O� O�$*�!"��!�I�I� %� J� Q� Q�$*�!"��"��)�)�5�!�%6�%6�%E�%E�E�"&�"3�"3�"B�"B�5�"I����
��t�4�4�5��9�$�:� )��/��"B�"I�"I�!�#���	�	�'�7�3� �$5�5�")�)�C��L�L�);�<��K�K����0� �.�.�s�3��O�O�6�6�8�g�k�k�k�\
�"�"�4�(��T�^�^�2�2�4�5������6��{�{�#������%�%�'��(�(�4��)�)�-�-�/��$�$�0��%�%�+�+�-�!�0�0�7�7�9�E��I�I�K�:�(��I�I�%�%�'��)�)�0�0�2��I�I�%�%�'��I�I�O�O���u.�!� �!��^ �
)��	�	��(�/�/�$(�$4�$4��(�A����	�	�%����!2�3�'(�$�$���
)��	�	�%�!:�;�'(�$�$���<�<�	
)�����<�5�(��v�v�*�1�1�!�&�&��)�Q�V�V�A�Y�G��"�1�v�0��a����6�6�D��	�	�%�!5��!<�=�'(�$�$���
)��	�	�%�!6��Q��!?�@��	�	�%����!2�3�'(�$�$��
)��(�I�I�%�%�'��	�
�x�x���+��,�s��DY �'Y�8Y �;a�=GY �a�
DY �$Da�%4`3�4a�
Y�Y �Y�Y � 
`0�*A([�a�
`0�%\�a�`0�B#_�a�
`0�A`+�%a�+`0�0a�3a�a�a.c��SRU5nX#:XaXB-
nOUSRX#5-
nUR[U5 g)Nz{}: zlocal={}, remote={})r�r�r)r�which�local�remoterps     rk�_log_agreement�Transport._log_agreement	sB���m�m�E�"���?��L�C��(�/�/��>�>�C��	�	�%��rmc�p�URR5 URR5 URR	5 UR
cUR
5 URU5 URR5 g!URR	5 f=frg)
r�r�r��clearr�r�r��_parse_kex_initr��	start_kex�rr�s  rkr�Transport._negotiate_keys*	s������'�'�)�	.����$�$�&��#�#�+�+�-����&����!����Q�����!�!�#��
�#�#�+�+�-�s�B�B5c��[S5HXnUS:Xa
URnOSnURRU5nUSSS:Xa OUR[SU-5 MZ WSSS:wa[
SU-S	-5eX0l
UR[S
RU55 URS5nUS:�aUSUnURSS5n[U5S
:a[
S5eUSnUSnUS:wa"US:waSn[URU55eSRXg5nUR[ U5 g![a e[
an[
S[U5-5eSnAff=f)N�dr�z!Error reading SSH protocol banner�r�zBanner: z!Indecipherable protocol version "�"zRemote version/idstring: {}r8r��zInvalid SSH bannerr�z1.99rqz(Incompatible version ({} instead of 2.0)z!Connected (version {}, client {}))�ranger�r��readliner`r�rar�r�rr�r��findr�r�r^r)	r�irn�bufr!�segs�versionr�rps	         rkr��Transport._check_banner7	s����s��A��A�v��-�-����
��o�o�.�.�w�7���2�A�w�&� ���I�I�e�Z�#�-�.�#�$�r��7�f���B�S�H�3�N�O�O�!���	�	�%�6�=�=�c�B�C�
�H�H�S�M����6��b�q�'�C��y�y��a� ���t�9�q�=��3�4�4��q�'���a����f���E�!1�<�C�"�3�:�:�g�#6�7�7�1�8�8��I���	�	�$����='�
���
�"�7�#�a�&�@����
�s�E�E?�#E:�:E?c���URR5 URR5 URR	5 SUlSUl[UR5nUR(a�SnUVs/sHo3RU5(dMUPM nnURce[U5S:�aVUR5RVs/sHnURU5(aMUPM nnXPR5l[[[UR R#55R$UR&55nOUR&nUR)S5 UR*(a*UR(aSOSnUR)S	US
35 [-5nUR/[05 UR3[4R6"S55 UR9U5 UR9U5 UR9UR:5 UR9UR:5 UR9UR<5 UR9UR<5 UR9UR>5 UR9UR>5 URA[C55 URA[C55 URES5 URGS5 URI5=Ul%Ul&UROU5 g!URR	5 f=fs snfs snf)zk
announce to the other side that we'd like to negotiate keys, and what
kind of key negotiation we support.
FTz!diffie-hellman-group-exchange-shaNr�
ext-info-c�s�c�kex-strict-�[email protected]�)(r�r�r�r�r�r�r�r�rGr�
startswithr�r�r^rF�filterrr;�__contains__r?r=r�rTr�rr�r�r��add_listr3r8rKr��bytesr�r�r�r��_latest_kex_initr~)	r�	kex_algos�mp_required_prefixr��kex_mp�pkex�available_server_keysr�r�s	         rkr��Transport._send_kex_initb	s���
	
���'�'�)�	.����$�$�&��#�#�+�+�-�!��������+�+�,�	����!D��!*�O��A�l�l�;M�.N�a��F�O��"�"�*��V��q��
"�6�6�8�<�<��<���<�<�(:�;��<���
37�)�)�+�/�$(����-�-�2�2�4�5�B�B��'�'��
%�!�%)�$7�$7�!�

���\�*��$�$��+�+�C��E����{�5�'�1A�B�C��I��	�
�
�<� �	���B�J�J�r�N�#�	�
�
�9��	�
�
�(�)�	�
�
�4�)�)�*�	�
�
�4�)�)�*�	�
�
�4�&�&�'�	�
�
�4�&�&�'�	�
�
�4�-�-�.�	�
�
�4�-�-�.�	���U�W��	���U�W��	�
�
�e��	�	�	�!��67�i�i�k�A���d�3����1���{
�#�#�+�+�-��P��s#�M�
M-�'M-�'M2�M2�M*c��0nU(aUR5 URS5 UR5US'UR5US'UR5US'UR5US'UR5US'UR5US'UR5US'UR5US	'UR5US
'UR5US'UR5US'UR	5 U$)
Nr��
kex_algo_list�server_key_algo_list�client_encrypt_algo_list�server_encrypt_algo_list�client_mac_algo_list�server_mac_algo_list�client_compress_algo_list�server_compress_algo_list�client_lang_list�server_lang_list�kex_follows)�get_byte�	get_bytes�get_list�get_booleanr�)rr��ignore_first_byte�parseds    rk�_really_parse_kex_init� Transport._really_parse_kex_init�	s������
�J�J�L�	���B��"#�*�*�,����)*�����%�&�-.�Z�Z�\��)�*�-.�Z�Z�\��)�*�)*�����%�&�)*�����%�&�./�j�j�l��*�+�./�j�j�l��*�+�%&�Z�Z�\��!�"�%&�Z�Z�\��!�"� !�
�
���}��	�	�	���
rmc�H�UR[UR5SS9$)NT)r$)r&rTr
r2s rk�_get_latest_kex_init�Transport._get_latest_kex_init�	s+���*�*��D�)�)�*�"�+�
�	
rmc�F�URU5nUSnUSnUSnUSnUSnUSnUSn	USn
US	nUS
nUSn
UR[S5 S
U4SU4SU4SU4SU4SU4SU	4SU
4SU4SU44
HEup�US/:XaS/nSRU5nUR[SR	X�55 MG UR[SR	U
55 UR[S5 SUlSUl/n[U5H�unnURS5(aUUlURSU5 M7URS5(dMOUR(aS OS!nSUS"3nUU:H=(a URUlUR[S#UR35 URSU5 M� UHnURU5 M UR(a,UR(dURS:wa[!S$5eUR(a*[#[%UR&R(U55nO)[#[%UR(UR&55n[+U5S:Xa[-S%5eUR.US"U5UlUR[S&R	US55 UR(aj[#[%[#UR2R555R(UR655n[#[%UR(U55nO)[#[%UR(UR655n[+U5S:Xa[-S'5eUSUlUR(aUR;5c[-S(5eUR=S)USUS5 UR(aS[#[%UR>R(U55n[#[%UR>R(U55nOR[#[%UR(UR>55n[#[%UR(UR>55n[+U5S:Xd[+U5S:Xa[-S*5eUSUl USUl!UR=S+UR@URBS,9 UR(aS[#[%URDR(U55n[#[%URDR(U55nOR[#[%UR(URD55n[#[%UR(URD55n[+U5S:Xd[+U5S:Xa[-S-5eUSUl#USUl$UR=S.URFURHS,9 UR(aS[#[%URJR(U	55n[#[%URJR(U
55nOR[#[%U	R(URJ55n[#[%U
R(URJ55n[+U5S:Xd[+U5S:Xa-S/nUS0-
n[-UR	UUURJ55eUSUl&USUl'UR=S1URLURNS,9 UR[S25 [PURS5-Ul*g)3Nrrrrrrrrrrrz"=== Key exchange possibilities ===z	kex algosz
server keyzclient encryptzserver encryptz
client macz
server maczclient compresszserver compresszclient langzserver langr�z<none>z, z{}: {}zkex follows: {}z=== Key exchange agreements ===z	ext-info-rrrrrzStrict kex mode: z9In strict-kex mode, but KEXINIT was not the first packet!z3Incompatible ssh peer (no acceptable kex algorithm)zKex: {}z.Incompatible ssh peer (no acceptable host key)z;Incompatible ssh peer (can't match requested host key type)�HostKeyz/Incompatible ssh server (no acceptable ciphers)r	)r�r�z,Incompatible ssh server (no acceptable macs)�MACz3Incompatible ssh server (no acceptable compression)z {!r} {!r} {!r}�Compressionz=== End of kex handshake ===)+r&r�rrjr��_remote_ext_info�_remote_strict_kex�	enumeraterr�rr�r�r�r�r�r_r�r	rGr
r�r^�	_kex_infor�rr;r?r�r}r�r3r�r�r8r�r�rKr�r�r�
get_so_farr�)rr�r%rrrrrrrrrrr�prefix�value�to_popr��algor��expected�
agreed_kexr�agreed_keys�agreed_local_ciphers�agreed_remote_ciphers�agreed_remote_macs�agreed_local_macs�agreed_remote_compression�agreed_local_compressionrps                               rkr��Transport._parse_kex_init�	s����,�,�Q�/����/�
�%�&<�=��#)�*D�#E� �#)�*D�#E� �%�&<�=��%�&<�=��$*�+F�$G�!�$*�+F�$G�!�!�"4�5��!�"4�5���]�+���	�	�%�=�>�
�-�(�
�/�0��7�8�
�7�8�
�/�0�
�/�0�
� 9�:�
� 9�:�
�,�-�
�,�-�

�M�F����}�!�
���I�I�e�$�E��I�I�e�X�_�_�V�;�<�#

�$	
�	�	�%�*�1�1�+�>�?��	�	�%�:�;�!%���"&����� ��/�G�A�t����{�+�+�(,��%��
�
�a��#�����/�/�#�/�/��S��(���/?�@���H�$�B��)B�)B��)��	�	��.�t�/H�/H�.I�J���
�
�a��#�0� �A����a� ��
�%�%��)�)����1��#�K��
������t�)�)�6�6�
�F��J���}�1�1�4�3E�3E�F��J��z�?�a��#�E��
��.�.��A��7��=����	�	�%��)�)�*�Q�-�8�9����$(����-�-�2�2�4�5�B�B��'�'��%�!���)�6�6�8L���K���+�8�8�$�:M�:M�N��K��{��q� �"�@��
�)��^�������!4�!4�!6�!>�"�M��
�	
���I�{�1�~�{�1�~�F����#'���*�*�7�7�,��$� �%)���*�*�7�7�,��%�!�$(��,�9�9��*�*��$� �%)��,�9�9��*�*��%�!��#�$��)�S�1F�-G�1�-L�"�A��
�1��3���2�1�5�������D�-�-�d�6H�6H�	�	
����!%��t�*�*�7�7�9M�N�"��!%��t�*�*�7�7�9M�N�!��!%��+�8�8�$�:M�:M�N�!��"&��+�8�8�$�:M�:M�N�"��
�!�"�a�'�S�1C�-D��-I�"�>��
�+�1�-���,�Q�/�������������	�	
����(,���.�.�;�;�-��)�%�(,���.�.�;�;�-��(�$�(,��-�:�:��.�.��(�$�)-��-�:�:��.�.��)�%�
�(�)�Q�.��,�-��2�G�C��$�$�C�"��
�
�,�-��.�.���
�":�!�!<���";�A�">��������(�(��*�*�	�	
�
	
�	�	�%�7�8� ,�a�l�l�n�<��rmc���URURnURSS5nUSnUSnURSU5nUR(a%UR	SU5nUR	SU5nO$UR	SU5nUR	S	U5nURURUUURUS
9nU(+=(a SUR;n	URURSn
URURS
nUR(a"UR	SU"5R5nO!UR	SU"5R5nURRUUU(aSOUU(aSOU
U(aSOUU	UU(aUOSS9 URURSn
U
bWURS:wdUR(a6UR[ S5 URR#U
"55 UR$(a1UR[ S5 URR'5 gg)zDswitch on newly negotiated encryption parameters for
inbound trafficr�Fr�r�r��A�C�B�D�r
rxr�r�r�[email protected]�r��E�FNr�)�block_engine�
block_size�
mac_engine�mac_size�mac_key�etmr�iv_inr�r��$Switching on inbound compression ...z8Resetting inbound seqno after NEWKEYS due to strict mode)rRr�r%rr�r��_DECRYPTr��	_mac_info�digest_sizer��set_inbound_cipher�_compression_infor�r�r�r�set_inbound_compressorr��reset_seqno_in)rr�rrL�key_size�iv_sizerQ�key_in�enginerPrNrMrO�compress_ins              rk�_activate_inbound�Transport._activate_inbound�
s ��� � ��!3�!3�4���x�x�	�5�)���,�'�
��
�#���(�(�9�j�1������%�%�c�7�3�E��&�&�s�H�5�F��%�%�c�7�3�E��&�&�s�H�5�F��!�!��#�#����m�m��"�
���x�A�.�$�/�/�A���>�>�$�/�/�2�6�:���^�^�D�O�O�4�W�=�
�����'�'��Z�\�-E�-E�F�G��'�'��Z�\�-E�-E�F�G����*�*��!�#�t���R�X� �D�g����%�T�	+�		
��,�,�T�-D�-D�E�a�H���"��#�#�'9�9�T�=O�=O��I�I�e�C�D��O�O�2�2�;�=�A��$�$��I�I��J�
�
�O�O�*�*�,�%rmc��[5nUR[5 URU5 UR(a0UR[S5 URR5 URURnURSS5nUSnUSnURSU5nUR(a%URSU5nURSU5nO$URS	U5nURS
U5nURURUUURUS9n	U(+=(a SUR ;n
UR"UR S
nUR"UR SnUR(a"URSU"5R$5n
O!URSU"5R$5n
URR'S5nURR)U	UU(aSOUU(aSOUU(aSOU
UU
UU(aUOSS9	 UR*UR,SnUbWUR,S:wdUR.(a6UR[S5 URR1U"55 URR35(dSUlUR(a�UR6(a�UR8S:Xa�SSR;UR<50n[5nUR[>5 URA[CU55 [EURG55H(unnURIU5 URIU5 M* URU5 URK[L5 g)zEswitch on newly negotiated encryption parameters for
outbound trafficz9Resetting outbound seqno after NEWKEYS due to strict moder�Fr�r�r�rErFrCrDrGrHr�r�rJrIz-ctrNr�)	rKrLrMrNrO�sdctrrPr�iv_outrr��%Switching on outbound compression ...rzserver-sig-algs�,)'rTr�rr~r�r�rr��reset_seqno_outrRr�r%rr�r�r�r�rTrU�endswith�set_outbound_cipherrWr�r��set_outbound_compressorr�r�rr/rjrCrAr�r��sorted�itemsr�r�r )rr�r�rrLrZr[rc�key_outr]rPrNrMrOrb�compress_out�
extensionsr
r5s                   rk�_activate_outbound�Transport._activate_outbound�
s��
�I��	�
�
�<� ����1���$�$��I�I��K�
�
�O�O�+�+�-�� � ��!2�!2�3���x�x�	�5�)���,�'�
��
�#���(�(�9�j�1������&�&�s�G�4�F��'�'��X�6�G��&�&�s�G�4�F��'�'��X�6�G��!�!��"�"����m�m��"�
���x�@�.�$�.�.�@���>�>�$�.�.�1�&�9���^�^�D�N�N�3�G�<�
�����'�'��Z�\�-E�-E�F�G��'�'��Z�\�-E�-E�F�G��!�!�*�*�6�2�����+�+��!�#�t���R�X� �D�g����!�6�t�	,�
	
��-�-�d�.D�.D�E�a�H���#��"�"�&8�8�D�<N�<N��I�I�e�D�E��O�O�3�3�L�N�C����)�)�+�+��D�K�
����$�$��%�%��5�+�S�X�X�d�6L�6L�-M�N�J��	�A�
�J�J�}�%�
�I�I�c�*�o�&�%�j�&6�&6�&8�9���e����T�"����U�#� :�
���q�!����K�(rmc��SUlURS:XaRURURSnUR[S5 UR
R
U"55 URS:XaSURURSnUR[S5 UR
RU"55 gg)NTr�rrdr�rR)	r�r�rWr�rr�rir�rX)rrmr^s   rk�
_auth_trigger�Transport._auth_trigger8s���!����!�!�%7�7��1�1�$�2H�2H�I�!�L�L��I�I�e�D�E��O�O�3�3�L�N�C��"�"�&8�8��0�0��1H�1H�I�!�L�K��I�I�e�C�D��O�O�2�2�;�=�A�9rmc���0n[UR55H'nUR5nUR5nXRU'M) UR	[
SR
U55 X lg)NzGot EXT_INFO: {})r�r�r��
get_stringr�rr�r�)rrprn�_r
r5s      rkr�Transport._parse_ext_infoDsa���
��s�{�{�}�%�A��<�<�>�D��N�N�$�E�$�t��&�	
�	�	�%�+�2�2�:�>�?�",�rmc��UR[S5 UR5 S=UlUlSUlSUlUR(aURc[U5UlUR(dS=Ul
URlURbURR5 URR5(dSUlUR"R%5 UR&R5 UR"R)5 g!UR"R)5 f=f)NzSwitch to new keys ...TF)r�rr_r�r�r�r�rr�r
r�r��_initial_kex_doner�r�r�r�r�r�r�r�r�s  rkr	�Transport._parse_newkeysRs	���	�	�%�1�2���� �59�9���d�2�����������!2�!2�!:� +�D� 1�D���$�$�IM�L�D�!�D�O�O�$E�� � �,��!�!�%�%�'����)�)�+�+��D�K����'�'�)�	.����"�"�$��#�#�+�+�-���
�#�#�+�+�-�s�D7�7Ec��UR5nUR5nUR[SR	X#55 g)NzDisconnect (code {:d}): {})r�r�r�rr�)rr��code�descs    rkr��Transport._parse_disconnectns2���y�y�{���z�z�|���	�	�$�4�;�;�D�G�Hrmc�N�UR5nUR[SRU55 UR	5nUR
(d(UR[SRU55 SnO�US:XaFUR5nUR
5nURRXV5nU(aU4nO_US:Xa>UR5nUR
5nURRXV5 SnOURRX!5nSn[U5[LaUnSnU(a][5nU(a%UR[5 UR "U6 OUR["5 UR%U5 gg)NzReceived global request "{}"z*Rejecting "{}" global request from server.Fr�r�T�)r�r�rr�r#rr�r�check_port_forward_request�cancel_port_forward_request�check_global_requestr�r�rTr�r!r�r"r~)	rr�r��
want_reply�okr�r�extrarps	         rkr
�Transport._parse_global_requestssL���z�z�|���	�	�%�7�>�>�t�D�E��]�]�_�
�����I�I��<�C�C�D�I�
��B�
�_�
$��j�j�l�G��9�9�;�D��#�#�>�>�w�M�B���U���
�+�
+��j�j�l�G��9�9�;�D����:�:�7�I��B��#�#�8�8��A�B�����8�u���E��B���)�C�����1�2���������1�2����s�#�rmc��UR[S5 XlURbURR	5 gg)NzGlobal request successful.�r�rr�r�r�r�s  rkr� Transport._parse_request_success�s:���	�	�%�5�6� ��� � �,��!�!�%�%�'�-rmc��UR[S5 SUlURbURR	5 gg)NzGlobal request denied.r�r�s  rkr� Transport._parse_request_failure�s<���	�	�%�1�2�#���� � �,��!�!�%�%�'�-rmc�v�UR5nUR5nUR5nUR5nURRU5nUcUR[S5 gUR
R
5 URX4U5 UR[SRU55 X R;a*URUR5 URU	UR
R5 g!UR
R5 f=f)Nz%Success for unrequested channel! [??]zSecsh channel {:d} opened.)
r�r�r%r�rr�r��_set_remote_channelrr�r�r�r�)rr�r��
server_chanid�server_window_size�server_max_packet_sizer�s       rkr
�%Transport._parse_channel_open_success�s���������	�	��
��Y�Y�[��!"������~�~�!�!�&�)���<��I�I�g�F�G���	�	����		 ��$�$��3I�
�
�I�I�e�9�@�@��H�I��,�,�,��#�#�F�+�/�/�1��'�'��/��I�I������
�I�I����s
�A0D�D8c��UR5nUR5nUR5nUR5 [R"US5nUR	[
SR
X$U55 URR5 [X55Ul
X R;aTURRU5 X R;a*URUR5 URU	URR5 g!URR5 f=f)Nz(unknown code)z&Secsh channel {:d} open FAILED: {}: {})r�r�r#r%r�rr�r�r�r]r�r�r�ryr�r�)rr�r�r�
reason_str�reason_texts      rkr�%Transport._parse_channel_open_failure�s��������������Z�Z�\�
�	�
�
��,�0�0��9I�J���	�	��4�;�;��K�
�	
�	
�	�	����	 �#3�F�#H�D� ��,�,�,����%�%�f�-��0�0�0��'�'��/�3�3�5��+�+�F�3��I�I������
�I�I����s
�A3D'�'Ec�T�UR5nUR5nUR5nUR5nSnUS:XajURb]UR[S5 UR
R
5 UR5nUR
R5 GO�US:Xa�URb�UR5nUR5n	UR[SRX�55 UR
R
5 UR5nUR
R5 GO�US:Xa�URb�UR5n
UR5nUR5nUR5n	UR[SRX�55 UR
R
5 UR5nUR
R5 GO6UR(d.UR[SRU55 S	n[nO�UR
R
5 UR5nUR
R5 US
:Xa`UR5n
UR5nUR5nUR5n	URRUX�4X�45nOURR!X'5nU[":wa'UR[SRU55 S	nU(au[%5nUR'[(5 UR+U5 UR+W5 UR-S5 UR-S
5 UR/U5 g[1W5nUR
R
5 UR2R5UU5 S	UR6U'UR9U5 UR;UR<UR>5 URAX4U5 UR
R5 [%5nUR'[B5 UR+U5 UR+U5 UR+UR<5 UR+UR>5 UR/U5 UR[SRXr55 US:XaURU5 gUS:XaURUWW	45 gUS:Xa WW	4Ul"URUX�4W
W45 gURGU5 g!UR
R5 f=f!UR
R5 f=f!UR
R5 f=f!UR
R5 f=f!UR
R5 f=f)NFr�z!Incoming forward agent connectionr�z$Incoming x11 connection from {}:{:d}r�z.Incoming tcp forwarded connection from {}:{:d}z+Rejecting "{}" channel request from server.Tr�z+Rejecting "{}" channel request from client.r�r�zSecsh channel {:d} ({}) opened.)$r�r�r�r�rr�r�r�r�r�r�r�rr$r�"check_channel_direct_tcpip_request�check_channel_requestr%rTr�r&r�r�r~rr�r�r�r�r�r�r�r�r'�origin_addrr�)rr�r�r��initial_window_sizer��reject�	my_chanidr��origin_port�server_addr�server_portrr��	dest_portrpr�s                 rkr�Transport._parse_channel_open�s����z�z�|��������i�i�k���)�)�+�����,�,��+�+�7��I�I�e�@�A��I�I����
$� �.�.�0�	��	�	�!�!�#��e�m�$�"3�"3�"?��*�*�,�K��)�)�+�K��I�I��6�=�=���
�
�I�I����
$� �.�.�0�	��	�	�!�!�#��'�'�d�.?�.?�.K��*�*�,�K��)�)�+�K��*�*�,�K��)�)�+�K��I�I��@�G�G���
�
�I�I����
$� �.�.�0�	��	�	�!�!�#��!�!��I�I��=�D�D�T�J�
��F�<�F��I�I����
$� �.�.�0�	��	�	�!�!�#��~�%��J�J�L�	��I�I�K�	��j�j�l���i�i�k���+�+�N�N�� �.��*����+�+�A�A������'��	�	��A�H�H��N������)�C��L�L�2�3��K�K����K�K����N�N�2���N�N�4� ����s�#���y�!���	�	����	 ��N�N���y�$�/�,0�D���y�)�����%�����(�(�$�*F�*F�
�
�$�$��_�
�
�I�I�����I��	�
�
�,�-�	�	�	�&��	�	�	�)��	�	�	�$�*�*�+�	�	�	�$�.�.�/����1���	�	��4�;�;�I�L�	
��+�+��'�'��-�
�U�]����d�[�+�$>�?�
�&�
&� +�[�9�D������{�0�;��2L�
�
�(�(��.��[�	�	�!�!�#���	�	�!�!�#�� �	�	�!�!�#���	�	�!�!�#��Z
�I�I����s=�V�&V.�%W
�+W,�)A4X�V+�.W
�
W)�,X�X'c���UR5 UR5nUR5 UR[SR	[
R"U555 g)Nz
Debug msg: {})r#rur�rr�r�safe_string)rr�rps   rkr��Transport._parse_debugOsC��	�
�
���l�l�n��	�����	�	�%��/�/��0@�0@��0E�F�Grmc�$�URR5 XR;aS/04URR5 $URUURR5 $!URR5 f=frgrrNs  rk�_get_subsystem_handler� Transport._get_subsystem_handlerUso��	 ��I�I�����/�/�/��R��|�
�I�I�����'�'��-��I�I�����D�I�I����s�-A3�
A3�3B)Gr�r�r�r�r�r�rr
r\r�r�r/r0r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrr�rrrrr�r�rr�r�)TTrg)NNN)NNNNN)NT)	Nr�NNNFFTT�r��Nr��T)NNF)F)�r��
__module__�__qualname__�__firstlineno__�__doc__�objectr�rSr�r��paramiko�__version__r��_preferred_ciphers�_preferred_macsr��_preferred_pubkeysr�rG�is_availabler�r\r�AESr
�CTR�CBCrer�AESGCMrRrrrrrTrXrErYrFr�rJrKrHrIrLrMrRrSrQrNrOrPr2rCrDrWr�r�r;r<r�r-�propertyr3r8r?rCrGrKrVrZr^rdrprtryr}�staticmethodr�rYr�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rkrrSrrrrr�r-rGr�r�rOrRrUrYr^rarir�rsr�rzr~r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rr�r�r&r)r�r_rorrrr	r�r
rrr
rrr�r�r0r�_request_successr1�_request_failedr2�_feedr3�_feed_extendedr4�_window_adjustr5�_handle_requestr6�_handle_eofr7�
_handle_closer��__static_attributes__r�rmrkroro�s
����x�H��x�H��I��%�%�h�&:�&:�;�J�
��	�O�	�O�	��
�N��!�!�#�#�:�^�K����
'�� �^�^��I�I���	
� �^�^��I�I���	
� �^�^��I�I���	
� �^�^��I�I���	
� �^�^��I�I���	
� �^�^��I�I���	
���I�I���	
��[�[�����#
��[�[�����#
�e9�L�x $�R�0�"&��3�#)�2�6�39�2�)F�#)�2�6�39�2�)F�!�2�.�!$�b�1�	�I��
	�6��	'��
�	���	,�V��	���	,�V��	�6��	'���	�x��	3�H��	�x�� 	3�H�!�"	�x�#�$	3�H�%�&	�z�'�(	+�J�)�I�0'0�'1�.4�0<�)9�)9�4@�5B�1:�)�)�)�
�I��!�!�#�#�4A�	�0�1�,�-=�>��!1�2��
���M���
0� 7��� ����k
�Z
��1��1��.��.��	
��	
��1��1��-��-��5��5��2�%� !�D8�t@�D7�(�*�&��&�P	��"�?C�!
�F;� ;�
I������]�~4�lP�
/�#�$�4:�"#$�J�6���
������~�@ �( �(

�
0�(�=�8S�j/=�b3=�jD�.=�4=�.
-��
-�	-�4�"�"�*/�"��&�+�.�4 �.�
��<&�*2�	(� �J�
N�
$�L�j�X	�$�)�VF�P�&
�h=�T8-�tO)�b
B�,��8I�
"$�H(�(��,�0|/�|H� �	�W�5�5��W�4�4��'�-�-�!�7�#9�#9�!�7�#9�#9��W�4�4���,�,��7�0�0�	�rmroc�2�\rSrSrSrSrSrSrSr\	S5r
\
RS5r
\	S	5r\RS
5r\	S5r
\
RS5r
\	S
5r\RS5r\	S5r\RS5rSrg)r]ima
Simple object containing the security preferences of an ssh transport.
These are tuples of acceptable ciphers, digests, key types, and key
exchange algorithms, listed in order of preference.

Changing the contents and/or order of these fields affects the underlying
`.Transport` (but only if you change them before starting the session).
If you try to add an algorithm that paramiko doesn't recognize,
``ValueError`` will be raised.  If you try to assign something besides a
tuple to one of the fields, ``TypeError`` will be raised.
�
_transportc��Xlgrg�r�)r�	transports  rkr��SecurityOptions.__init__|s��#�rmc�8�SRUR5$)rNz#<paramiko.SecurityOptions for {!r}>)r�r�r2s rkrV�SecurityOptions.__repr__s��5�;�;�D�O�O�L�Lrmc�n�[U5[La[U5n[U5[La[S5e[[	UR
U5R
55nUVs/sHoUU;dM
UPM nn[U5S:�a[S5e[UR
X5 gs snf)Nzexpected tuple or listrzunknown cipher)
r�r�r��	TypeErrorr+r�r;r��
ValueErrorr�)rr
�origr'�possible�n�	forbiddens       rk�_set�SecurityOptions._set�s�����7�d�?��a��A���7�%���4�5�5�������6�;�;�=�>�� !�7��1�h�%6�Q��	�7��y�>�A���-�.�.������)��8s�,	B2�9B2c�.�URR$)zSymmetric encryption ciphers)r�r�r2s rkr0�SecurityOptions.ciphers�s�����1�1�1rmc�*�URSSU5 g)Nr�rR�r��rr's  rkr0r��s���	�	�&���:rmc�.�URR$)z Digest (one-way hash) algorithms)r�r�r2s rk�digests�SecurityOptions.digests�������.�.�.rmc�*�URSSU5 g)Nr�rTr�r�s  rkr�r������	�	�#�[�!�4rmc�.�URR$)zPublic-key algorithms)r�r�r2s rk�	key_types�SecurityOptions.key_types�r�rmc�*�URSSU5 g)Nr�r�r�r�s  rkr�r��r�rmc�.�URR$)zKey exchange algorithms)r�r�r2s rkrF�SecurityOptions.kex�s�����-�-�-rmc�*�URSSU5 g)Nr�r2r�r�s  rkrFr��s���	�	�"�K��3rmc�.�URR$)zCompression algorithms)r�r\r2s rkrJ�SecurityOptions.compression�s�����5�5�5rmc�*�URSSU5 g)Nr\rWr�r�s  rkrJr��s���	�	�*�,?��Crmr�N)r�r�r�r�r��	__slots__r�rVr�r�r0�setterr�r�rFrJr�r�rmrkr]r]ms��
��I�$�M�	*��2��2�
�^�^�;��;��/��/�
�^�^�5��5��/��/����5��5��.��.�	�Z�Z�4��4��6��6����D��Drmr]c�8�\rSrSrSrSrSrSrSrSr	Sr
g	)
r�i�c�l�[R"5Ul[R"5Ulgrg)r��WeakValueDictionary�_mapr�r��_lockr2s rkr��ChannelMap.__init__�s ���/�/�1��	��^�^�%��
rmc���URR5 X RU'URR5 g!URR5 f=frg)r�r�r�r�)rr�r�s   rkr��ChannelMap.put�sD���
�
����	!� $�I�I�f���J�J��� ��D�J�J��� �s�A�A!c���URR5 URRUS5URR	5 $!URR	5 f=frg)r�r�r�r%r�rvs  rkr%�ChannelMap.get�sJ���
�
����	!��9�9�=�=���.��J�J��� ��D�J�J��� �s�A�A.c���URR5 URU	URR	5 g![a N'f=f!URR	5 f=frg)r�r�r�r|r�rvs  rkry�ChannelMap.delete�sa���
�
����	!�
��I�I�f�%�
�J�J��� ���
��
��
�J�J��� �s#�
A�
A�A�A�A�A1c���URR5 [URR	55URR5 $!URR5 f=frg)r�r�r�r�r�r�r2s rkr��ChannelMap.values�sM���
�
����	!���	�	�(�(�*�+��J�J��� ��D�J�J��� �s�"A�A5c���URR5 [UR5URR	5 $!URR	5 f=frg)r�r�r�r�r�r2s rk�__len__�ChannelMap.__len__�sC���
�
����	!��t�y�y�>��J�J��� ��D�J�J��� �r
)r�r�N)r�r�r�r�r�r�r%ryr�r�r�r�rmrkr�r��s ��&�
!�!�!�!�!rmr�c�t^�\rSrSrSrU4SjrSrSrSrSr	SSjr
S	rSS
jrSSjr
SrS
rSrU=r$)�ServiceRequestingTransporti�zX
Transport, but also handling service requests, like it oughtta!

.. versionadded:: 3.2
c�n>�[TU]"U0UD6 SUlURUR[
'g)NF)�superr��_service_userauth_accepted�_parse_service_acceptrr,)rrrr�s   �rkr��#ServiceRequestingTransport.__init__�s4���
���$�)�&�)�*/��'�26�2L�2L����.�/rmc��UR5nUS:wa&UR[SRU55 gSUlUR[S5 g)N�ssh-userauthz!Service request "{}" accepted (?)Tz+MSG_SERVICE_ACCEPT received; auth may begin)r�r�rr�r)rr��services   rkr�0ServiceRequestingTransport._parse_service_accept�sT���*�*�,���n�$�
�I�I��:�A�A�'�J�
�
�+/��'��	�	�%�F�Grmc���UR(aUR(d[S5eUR(ag[	5nUR[5 URS5 UR[S5 URU5 UR(d)[R"S5 UR(dM)UR5Ulg)Nr�rz)Sending MSG_SERVICE_REQUEST: ssh-userauthr�)r�r�rarrTr�r+r�r�rr~ri�sleep�get_auth_handlerr�r�s  rk�ensure_session�)ServiceRequestingTransport.ensure_session
s������T�%:�%:��4�5�5��*�*���I��	�
�
�'�(�	���^�$��	�	�%�D�E����1���1�1�
�J�J�s�O��1�1�1�!�1�1�3��rmc��[U5$rg)rr2s rkr�+ServiceRequestingTransport.get_auth_handler4
s
���t�$�$rmc�X�UR5 URRU5$rg)r
r�r�rrs  rkr�$ServiceRequestingTransport.auth_none8
s%������� � �*�*�8�4�4rmc�^�UR5 URRUT5$![aJnU(aSUR;aeU4SjnURX5sSnA$![a Uef=fSnAff=f)Nr"c�`>�[U5S:�a[S5e[U5S:Xa/$T/$r$r%r&s   �rkr��9ServiceRequestingTransport.auth_password.<locals>.handlerI
r+rm)r
r�rr\r,r-ra)rrrr.r!r�s  `   rkr�(ServiceRequestingTransport.auth_password=
s��������	��$�$�2�2�8�X�F�F��$�	�� 6�a�o�o� M��
�	&��,�,�X�?�?���
���
��'	�s,�/�
B�A>�A.�(B�.
A;�;A>�>Bc�X�UR5 URRX5$rg)r
r�r�)rrrxs   rkr��)ServiceRequestingTransport.auth_publickeyY
s%������� � �/�/��>�>rmc�Z�UR5 URRXU5$rg)r
r�r-rFs    rkr-�+ServiceRequestingTransport.auth_interactive^
s,������� � �1�1��z�
�	
rmc�Z�UR5 U(dSnURXU5$)Nc��/nU(a[UR55 U(a[UR55 UH6upE[UR5SS9 UR[55 M8 U$r7r:r?s      rkr��AServiceRequestingTransport.auth_interactive_dumb.<locals>.handlerm
rErm)r
r-rFs    rkrG�0ServiceRequestingTransport.auth_interactive_dumbe
s-��
	
�����	
��$�$�X�
�C�Crmc��UR5 UR5UlURRXU5$rg)r
rr�r�)rrr�rs    rkr��/ServiceRequestingTransport.auth_gssapi_with_micz
s=������ �1�1�3���� � �5�5���
�	
rmc��UR5 UR5UlURRU5$rg)r
rr�r�rs  rkr��,ServiceRequestingTransport.auth_gssapi_keyex�
s6������ �1�1�3���� � �2�2�8�<�<rm)rr�r�r�r�)r�r�r�r�r�r�rr
rrrr�r-rGr�r�r��
__classcell__)r�s@rkrr�sH����M�
H�*"4�H%�5�
�8?�

�D�*
�=�=rmr)�r�r�r�r�r�rir��hashlibrrrr�cryptography.hazmat.backendsr�&cryptography.hazmat.primitives.ciphersrr	r
rr�r�paramiko.auth_handlerr
r�paramiko.ssh_gssr�paramiko.channelr�paramiko.commonrrrrrrrrrrrrrrrr r!r"r#r$r%r&r'r(r)r*r+r,r-r.r/r0r1r2r3r4r5r6r7r8r9r:r;r<r=r>r?r@rArB�paramiko.compressrCrD�paramiko.dsskeyrE�paramiko.ed25519keyrF�paramiko.kex_curve25519rG�paramiko.kex_gexrHrI�paramiko.kex_group1rJ�paramiko.kex_group14rKrL�paramiko.kex_group16rM�paramiko.kex_ecdh_nistrNrOrP�paramiko.kex_gssrQrRrS�paramiko.messagerT�paramiko.packetrUrV�paramiko.primesrW�paramiko.rsakeyrX�paramiko.ecdsakeyrY�paramiko.serverrZ�paramiko.sftp_clientr[�paramiko.ssh_exceptionr\r]r^r_r`ra�
paramiko.utilrbrcrd�/cryptography.hazmat.decrepit.ciphers.algorithmsre�ImportError�1cryptography.hazmat.primitives.ciphers.algorithmsrhrl�atexit�registerr�ror]r�rr�rmrk�<module>rDsS��(�
�
�
����-�-�8�����>�$�$�3�3�3�3�3�3�3�3�3�3�3�3�3�h?�"�*�1�1�)�=�1�H�H�C�C�$�:�'�"�&�+�+�����L�I����
����'�(�J/�	� � �"7�J/�`^ND�ND�b*!�*!�Z[=��[=��Ac�L�K�L�s�F)�)F8�7F8

Filemanager

Name Type Size Permission Actions
__init__.cpython-313.pyc File 3.64 KB 0644
_version.cpython-313.pyc File 292 B 0644
_winapi.cpython-313.pyc File 16.39 KB 0644
agent.cpython-313.pyc File 22.25 KB 0644
auth_handler.cpython-313.pyc File 45.82 KB 0644
auth_strategy.cpython-313.pyc File 11.99 KB 0644
ber.cpython-313.pyc File 6.06 KB 0644
buffered_pipe.cpython-313.pyc File 8.82 KB 0644
channel.cpython-313.pyc File 58.82 KB 0644
client.cpython-313.pyc File 30.79 KB 0644
common.cpython-313.pyc File 7 KB 0644
compress.cpython-313.pyc File 1.57 KB 0644
config.cpython-313.pyc File 22.72 KB 0644
dsskey.cpython-313.pyc File 10.98 KB 0644
ecdsakey.cpython-313.pyc File 14.82 KB 0644
ed25519key.cpython-313.pyc File 8.15 KB 0644
file.cpython-313.pyc File 19.55 KB 0644
hostkeys.cpython-313.pyc File 16.65 KB 0644
kex_curve25519.cpython-313.pyc File 7.82 KB 0644
kex_ecdh_nist.cpython-313.pyc File 8.58 KB 0644
kex_gex.cpython-313.pyc File 13.47 KB 0644
kex_group1.cpython-313.pyc File 7.4 KB 0644
kex_group14.cpython-313.pyc File 1.26 KB 0644
kex_group16.cpython-313.pyc File 1.29 KB 0644
kex_gss.cpython-313.pyc File 29.75 KB 0644
message.cpython-313.pyc File 11.6 KB 0644
packet.cpython-313.pyc File 26.31 KB 0644
pipe.cpython-313.pyc File 6.4 KB 0644
pkey.cpython-313.pyc File 35.02 KB 0644
primes.cpython-313.pyc File 4.23 KB 0644
proxy.cpython-313.pyc File 5.03 KB 0644
rsakey.cpython-313.pyc File 9.43 KB 0644
server.cpython-313.pyc File 29.38 KB 0644
sftp.cpython-313.pyc File 7.11 KB 0644
sftp_attr.cpython-313.pyc File 10.42 KB 0644
sftp_client.cpython-313.pyc File 38.72 KB 0644
sftp_file.cpython-313.pyc File 23.91 KB 0644
sftp_handle.cpython-313.pyc File 7.51 KB 0644
sftp_server.cpython-313.pyc File 22.36 KB 0644
sftp_si.cpython-313.pyc File 11.78 KB 0644
ssh_exception.cpython-313.pyc File 9.38 KB 0644
ssh_gss.cpython-313.pyc File 27.47 KB 0644
transport.cpython-313.pyc File 134.97 KB 0644
util.cpython-313.pyc File 12.42 KB 0644
win_openssh.cpython-313.pyc File 2.36 KB 0644
win_pageant.cpython-313.pyc File 4.82 KB 0644
Filemanager