https://t.me/AnonymousX5
Server : Apache
System : Linux cvar2.toservers.com 3.10.0-962.3.2.lve1.5.73.el7.x86_64 #1 SMP Wed Aug 24 21:31:23 UTC 2022 x86_64
User : njnconst ( 1116)
PHP Version : 8.4.18
Disable Function : NONE
Directory :  /proc/self/root/usr/lib/python2.7/site-packages/paramiko/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/self/root/usr/lib/python2.7/site-packages/paramiko/packet.pyc
�
x�\c@s dZddlZddlZddlZddlZddlZddlZddlmZddl	m
Z
ddlmZm
Z
mZmZmZmZmZddlmZmZddlmZmZddlmZd	�Zd
efd��YZd�Zd
efd��YZ dS(s
Packet handling
i����N(tHMAC(tutil(t
linefeed_bytet
cr_byte_valuetasbytest	MSG_NAMEStDEBUGt	xfffffffft	zero_byte(tutbyte_ord(tSSHExceptiontProxyCommandFailure(tMessagecCst|||�j�S(N(Rtdigest(tkeytmessagetdigest_class((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytcompute_hmac.stNeedRekeyExceptioncBseZdZRS(s1
    Exception indicating a rekey is needed.
    (t__name__t
__module__t__doc__(((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyR2scCsDd}t|j�tkr@t|j�dkr@|jd}n|S(Ni(tNonettypetargsttupletlen(tetarg((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyt	first_arg:s*t
PacketizercBsReZdZedd�Zedd�Zedd�Zedd�Zd�Ze	d��Z
d�Zed�Z
d�Zd�Zd	�Zd
�Zd�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�Zed�Zd�Zd�Zd�Zd�Z d�Z!d�Z"d�Z#d�Z$d�Z%RS(s9
    Implementation of the base SSH packet protocol.
    iicCsT||_d|_t|_t|_t|_d|_t�|_	d|_
d|_d|_d|_
d|_d|_d|_d|_d|_d|_d|_d|_t|_d|_d|_t�|_t�|_d|_d|_d|_d|_tj �|_!d|_"t#j#�|_$d|_%d|_&t|_'t|_(dS(Nii()t_Packetizer__socketRt_Packetizer__loggertFalset_Packetizer__closedt_Packetizer__dump_packetst_Packetizer__need_rekeyt_Packetizer__init_counttbytest_Packetizer__remaindert_Packetizer__sent_bytest_Packetizer__sent_packetst_Packetizer__received_bytest_Packetizer__received_packetst$_Packetizer__received_bytes_overflowt&_Packetizer__received_packets_overflowt_Packetizer__block_size_outt_Packetizer__block_size_int_Packetizer__mac_size_outt_Packetizer__mac_size_int_Packetizer__block_engine_outt_Packetizer__block_engine_int_Packetizer__sdctr_outt_Packetizer__mac_engine_outt_Packetizer__mac_engine_int_Packetizer__mac_key_outt_Packetizer__mac_key_int _Packetizer__compress_engine_outt_Packetizer__compress_engine_int _Packetizer__sequence_number_outt_Packetizer__sequence_number_int	threadingtRLockt_Packetizer__write_lockt_Packetizer__keepalive_intervalttimet_Packetizer__keepalive_lastt_Packetizer__keepalive_callbackt_Packetizer__timert_Packetizer__handshake_completet_Packetizer__timer_expired(tselftsocket((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyt__init__QsF																													cCs|jS(N(R#(RH((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytclosedscCs
||_dS(s?
        Set the Python log object to use for logging.
        N(R!(RHtlog((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytset_log�scCs||_||_||_||_||_||_d|_d|_|jdO_|jdkr{d|_t	|_
ndS(s.
        Switch outbound data cipher.
        iiiN(R3R5R/R6R1R8R)R*R&R"R%(RHtblock_enginet
block_sizet
mac_enginetmac_sizetmac_keytsdctr((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytset_outbound_cipher�s									cCs�||_||_||_||_||_d|_d|_d|_d|_|j	dO_	|j	dkr�d|_	t
|_ndS(s-
        Switch inbound data cipher.
        iiiN(R4R0R7R2R9R+R,R-R.R&R"R%(RHRNRORPRQRR((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytset_inbound_cipher�s										cCs
||_dS(N(R:(RHt
compressor((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytset_outbound_compressor�scCs
||_dS(N(R;(RHRV((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytset_inbound_compressor�scCst|_|jj�dS(N(tTrueR#R tclose(RH((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyRZ�s	cCs
||_dS(N(R$(RHthexdump((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytset_hexdump�scCs|jS(N(R$(RH((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytget_hexdump�scCs|jS(N(R2(RH((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytget_mac_size_in�scCs|jS(N(R1(RH((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytget_mac_size_out�scCs|jS(s�
        Returns ``True`` if a new set of keys needs to be negotiated.  This
        will be triggered during a packet read or write, so it should be
        checked after every read or write, or at least after every few.
        (R%(RH((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyt
need_rekey�scCs%||_||_tj�|_dS(s�
        Turn on/off the callback keepalive.  If ``interval`` seconds pass with
        no data read from or written to the socket, the callback will be
        executed and the timer will be reset.
        N(RARDRBRC(RHtintervaltcallback((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyt
set_keepalive�s		cCs
t|_dS(N(RYRG(RH((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyt
read_timer�scCs;|js7tjt|�|j�|_|jj�ndS(s�
        Tells `Packetizer` that the handshake process started.
        Starts a book keeping timer that can signal a timeout in the
        handshake process.

        :param float timeout: amount of seconds to wait before timing out
        N(RER>tTimertfloatRdtstart(RHttimeout((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytstart_handshake�s	cCs!|js
tS|jrtS|jS(sR
        Checks if the handshake has timed out.

        If `start_handshake` wasn't called before the call to this function,
        the return value will always be `False`. If the handshake completed
        before a timeout was reached, the return value will be `False`

        :return: handshake time out status, as a `bool`
        (RER"RFRG(RH((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pythandshake_timed_out�s

		cCs/|jr+|jj�t|_t|_ndS(sF
        Tells `Packetizer` that the handshake has completed.
        N(REtcancelR"RGRYRF(RH((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytcomplete_handshakes	
	cCs�t�}t|j�dkrN|j| }|j||_|t|�8}nxQ|dkr�t}|j�r{t��nyN|jj|�}t|�dkr�t��n||7}|t|�8}Wn}tj	k
r�t
}ndtjk
rH}t|�}|t
jkrt
}qI|t
jkr-qI|jrBt��qI�nX|rQ|jrdt��n|r�t|�dkr�|jr�t��n|j�qQqQW|S(s&
        Read as close to N bytes as possible, blocking as long as necessary.

        :param int n: number of bytes to read
        :return: the data read, as a `str`

        :raises:
            ``EOFError`` -- if the socket was closed before all the bytes could
            be read
        i(R'RR(R"RjtEOFErrorR trecvRIRhRYterrorRterrnotEAGAINtEINTRR#R%Rt_check_keepalive(RHtntcheck_rekeytouttgot_timeouttxRR((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytread_all
sB	

				!cCsotj�|_d}xSt|�dkrjt}y|jj|�}Wn�tjk
rbt}n�tj	k
r�}t
|�}|tjkr�t}q�|tj
kr�t}q�d}n*tk
r��ntk
r�d}nX|rd}|jr/d}q/n+|dkr%|dkr%d}n|d7}|dkrGt��n|t|�kr]Pn||}qWdS(Nii����i
i(RBRCRR"R tsendRIRhRYRoRRpRqRrRt	ExceptionR#Rm(RHRvt#iteration_with_zero_as_return_valuetretry_writeRtRR((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyt	write_all=s@				


		
cCs�|j}x#t|kr.||j|�7}qW|jt�}||d|_|| }t|�dkr�|dtkr�|d }nt|�S(s�
        Read a line from the socket.  We assume no data is pending after the
        line, so it's okay to attempt large reads.
        iii����(R(Rt
_read_timeouttindexRRR	(RHRhtbufRt((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytreadlinehs	
"
c
Cs"t|�}t|d�}|tkr5t|}ndj|�}t|�}|jj�z�|jdk	r�|j|�}n|j	|�}|j
r�|jtdj||��|jtt
j|d��n|jdk	r�|jj|�}n|}|jdk	rLtjd|j�|}|t|j||j�|j 7}n|jdt@|_|j|�|jt|�7_|jd7_|j|jkp�|j|jk}|r|jrd}	|jt|	j|j|j��d|_d|_ |j!�nWd|jj"�XdS(	sR
        Write a block of data using the current cipher, as an SSH block.
        is${:x}sWrite packet <{}>, length {}sOUT: s>Iis(Rekeying (hit {} packets, {} bytes sent)N(#RR
RtformatRR@tacquireR:Rt
_build_packetR$t_logRRt
format_binaryR3tupdatetstructtpackR<RR8R6R1RR~R)R*t
REKEY_PACKETStREKEY_BYTESR%R-R.t_trigger_rekeytrelease(
RHtdatatcmdtcmd_nametorig_lentpacketRvtpayloadt
sent_too_muchtmsg((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytsend_messagewsN

	


		cCs�|j|jdt�}|jdk	r<|jj|�}n|jrd|jtt	j
|d��ntjd|d �d}|d}|t
|�|jdkr�td��n|j||jt
|��}||t
|� }||t
|�}|jdk	r |jj|�}n|jrH|jtt	j
|d��n||}|jdkr�||j }tjd|j|�|}t|j||j�|j }	t	j|	|�s�td��q�nt|d�}
|d	||
!}|jr|jtd
j||
��n|jdk	r7|j|�}nt|d	�}|j|_|jd	t@|_||jd}
|j|
7_|jd	7_|jr�|j|
7_|j d	7_ |j |j!ks�|j|j"kr^td��q^nk|j|j#ks|j|j$kr^d}|jt|j|j|j��d|_d|_ |j%�nt|d�}|t&kr�t&|}nd
j|�}|jr�|jtdj|t
|���n||fS(s�
        Only one thread should ever be in this function (no other locking is
        done).

        :raises: `.SSHException` -- if the packet is mangled
        :raises: `.NeedRekeyException` -- if the transport should rekey
        RusIN: s>IiisInvalid packet blockings>IIsMismatched MACis"Got payload ({} bytes, {} padding)s+Remote transport is ignoring rekey requestss,Rekeying (hit {} packets, {} bytes received)s${:x}sRead packet <{}>, length {}N('RyR0RYR4RR�R$R�RRR�R�tunpackRRR2R�R=RR9R7tconstant_time_bytes_eqR
R�R;R
tseqnoRR+R,R%R-R.tREKEY_PACKETS_OVERFLOW_MAXtREKEY_BYTES_OVERFLOW_MAXR�R�R�R(RHtheadertpacket_sizetleftoverR�R�tpost_packettmactmac_payloadtmy_mactpaddingR�R�traw_packet_sizeterrR�R�((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pytread_message�s�	
 	


				

	cCsf|jdkrdStt|�t�rOx7|D]}|jj||�q/Wn|jj||�dS(N(R!Rt
issubclassRtlistRL(RHtlevelR�tm((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyR�s
cCs]|js|js|jr!dStj�}||j|jkrY|j�||_ndS(N(RAR3R%RBRCRD(RHtnow((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyRs s

	
cCs�tj�}x�tr�y5|jjd�}t|�dkrHt��nPWnAtjk
r`n.tk
r�}t	|�t
jkr�q��nX|jr�t��ntj�}|||krtj��qqW|S(Ni�i(
RBRYR RnRRmRIRhtEnvironmentErrorRRpRrR#(RHRhRgRxRR�((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyR-s&		cCs�|j}d|t|�d|}tjdt|�|d|�}||7}|jsj|jdkr{|t|7}n|tj	|�7}|S(Niis>IBi(
R/RR�R�R5R3RRtosturandom(RHR�tbsizeR�R�((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyR�Cs	#
cCs
t|_dS(N(RYR%(RH((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyR�Rs(&RRRtpowR�R�R�R�RJtpropertyRKRMR"RTRURWRXRZR\R]R^R_R`RcRdRiRjRlRyR~R�R�R�R�RsRR�R�(((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyRAsB	.	
										
					3	+		:	f			
		(!RRpR�RIR�R>RBthmacRtparamikoRtparamiko.commonRRRRRRRtparamiko.py3compatR	R
tparamiko.ssh_exceptionRRtparamiko.messageR
RR{RRtobjectR(((s3/tmp/pip-install-A1qMVe/paramiko/paramiko/packet.pyt<module>s 4			

https://t.me/AnonymousX5 - 2025