HEX
Server: LiteSpeed
System: Linux php-prod-1.spaceapp.ru 5.15.0-157-generic #167-Ubuntu SMP Wed Sep 17 21:35:53 UTC 2025 x86_64
User: sport3497 (1034)
PHP: 8.1.33
Disabled: NONE
Upload Files
File: //usr/local/CyberCP/lib64/python3.10/site-packages/asyncssh/__pycache__/gss_win32.cpython-310.pyc
o

�h��@s�dZddlmZmZmZddlmZmZddlmZ	ddl
mZmZm
Z
ddl
mZmZddl
mZmZddl
mZmZdd	l
mZd
dlmZmZd
dlmZeed
��ZGdd�d�ZGdd�de�ZGdd�de�ZGdd�de�ZdS)zGSSAPI wrapper for Windows�)�Optional�Sequence�Union)�
ClientAuth�
ServerAuth)�error)�ISC_REQ_DELEGATE�ISC_REQ_INTEGRITY�ISC_REQ_MUTUAL_AUTH)�ISC_RET_INTEGRITY�ISC_RET_MUTUAL_AUTH)�ASC_REQ_INTEGRITY�ASC_REQ_MUTUAL_AUTH)�ASC_RET_INTEGRITY�ASC_RET_MUTUAL_AUTH)�SECPKG_ATTR_NATIVE_NAMES�)�ObjectIdentifier�
der_encode)�BytesOrStrDictz1.2.840.113554.1.2.2c@s�eZdZdZdZdZdefdd�Zede	e
fdd��Zedefd	d
��Z
edefdd��Zedefd
d��Zedefdd��Zedefdd��Zddd�Zd dee
dee
fdd�Zde
de
fdd�Zde
de
defdd�ZdS)!�GSSBasezGSS base classr�hostcCs*d|vr||_nd||_d|_d|_dS)N�@zhost/)�_host�_ctx�_init_token)�selfr�r�E/usr/local/CyberCP/lib/python3.10/site-packages/asyncssh/gss_win32.py�__init__3s


zGSSBase.__init__�returncCstgS)z-Return GSS mechanisms available for this host)�	_krb5_oid�rrrr�mechs<sz
GSSBase.mechscCs|jdusJ�|jjS)z1Return whether or not GSS negotiation is completeN)r�
authenticatedr"rrr�completeBszGSSBase.completecC� |jdusJ�t|jj|j@�S)zAReturn whether or not this context provides mutual authenticationN)r�bool�	ctxt_attr�_mutual_auth_flagr"rrr�provides_mutual_authJ�zGSSBase.provides_mutual_authcCr&)z@Return whether or not this context provides integrity protectionN)rr'r(�_integrity_flagr"rrr�provides_integrityRr+zGSSBase.provides_integritycC�$|jdusJ�|jj�t�}|dS)z2Return user principal associated with this contextNr�r�ctxt�QueryContextAttributesr�r�namesrrr�userZ�zGSSBase.usercCr.)z2Return host principal associated with this contextNrr/r2rrrrcr5zGSSBase.hostNcCs"|jdusJ�|j��d|_dS)zReset GSS security contextN)r�resetrr"rrrr6ls

z
GSSBase.reset�tokenc
Csh|jdusJ�|jr|j}d|_|Sz|j�|�\}}|djWSty3}zt|jd�d�d}~ww)z*Perform next step in GSS security exchangeNr��details)rr�	authorize�Buffer�	SSPIError�GSSError�strerror)rr7�_�buf�excrrr�stepts��zGSSBase.step�datac
CsD|jdusJ�z|j�|�WSty!}zt|jd�d�d}~ww)zSign a block of dataNr8)r�signr<r=r>)rrCrArrrrD�s��zGSSBase.sign�sigcCs8|jdusJ�z
|j�||�WdStyYdSw)z&Verify a signature for a block of dataNTF)r�verifyr<)rrCrErrrrF�s�zGSSBase.verify)r N�N)�__name__�
__module__�__qualname__�__doc__r)r,�strr�propertyr�bytesr#r'r%r*r-r4rr6rrBrDrFrrrrr,s*	

rcs:eZdZdZeZeZdede	e
def�fdd�Z�Z
S)�	GSSClientz
GSS clientr�store�delegate_credsc
s�|dur	tdd��t��|�ttB}|r|tO}ztd|j|d�|_Wnt	y9}z	tdd|j
d�d�d}~ww|�d�|_dS)N�"GSS store not supported on Windowsr8�Kerberos)�	targetspn�scflagsr)
r=�superrr
r	rrrrr<r>rBr)rrrPrQ�flagsrA��	__class__rrr�s
���zGSSClient.__init__)rHrIrJrKrr)rr,rLrrr'r�
__classcell__rrrXrrO�s�rOcs6eZdZdZeZeZdede	e
f�fdd�Z�ZS)�	GSSServerz
GSS serverrrPc
sj|dur	tdd��t��|�ttB}ztd|j|d�|_WdSty4}z	tdd|j	d�d�d}~ww)NrRr8rS)�spnrUr)
r=rVrrr
rrrr<r>)rrrPrWrArXrrr�s
��zGSSServer.__init__)
rHrIrJrKrr)rr,rLrrrrZrrrXrr[�s
"r[c	s<eZdZdZ		ddededeedef�fd	d
�
Z�Z	S)r=zClass for reporting GSS errorsrN��maj_code�min_coder7r9cs"t��|�||_||_||_dSrG)rVrr^r_r7)rr^r_r7r9rXrrr�s
zGSSError.__init__)rrNr])
rHrIrJrK�intrrNrLrrZrrrXrr=�s���r=N) rK�typingrrr�sspirrrr<�sspiconrr	r
rrr
rrrr�asn1rr�miscrr!rrOr[�	Exceptionr=rrrr�<module>s n