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_unix.cpython-310.pyc
o

�h>�@s�dZddlmZmZmZmZddlmZmZm	Z	m
Z
ddlmZmZddl
mZddlmZddlmZd	e
d
efdd�ZGd
d�d�ZGdd�de�ZGdd�de�ZdS)zGSSAPI wrapper for UNIX�)�Optional�Sequence�
SupportsBytes�cast)�Credentials�Name�NameType�OID)�RequirementFlag�SecurityContext)�GSSError�)�OBJECT_IDENTIFIER)�BytesOrStrDict�mech�returncCs"ttt|��}ttt|�f�|S)zEReturn a DER-encoded OID corresponding to the requested GSS mechanism)�bytesrrr�len)r�
mech_bytes�r�D/usr/local/CyberCP/lib/python3.10/site-packages/asyncssh/gss_unix.py�_mech_to_oid!src@seZdZdZdedeefdd�Zede	fdd��Z
d#d
d�Zedee
fdd
��Zedefdd��Zedefdd��Zedefdd��Zedefdd��Zedefdd��Zd#dd�Zd$dee
dee
fdd�Zde
de
fdd�Zde
d e
defd!d"�Zd	S)%�GSSBasezGSS base class�host�storecCsJd|vr
t|�|_n	td|tj�|_||_dd�|jjD�|_d|_dS)N�@zhost@cSsg|]}t|��qSr)r)�.0rrrr�
<listcomp>3sz$GSSBase.__init__.<locals>.<listcomp>)	r�_hostr�hostbased_service�_store�_creds�mechs�_mechs�_ctx)�selfrrrrr�__init__+s
zGSSBase.__init__rcC�t�)�,Abstract method to construct GSS credentials��NotImplementedError�r%rrrr!6szGSSBase._credsNcCr')z1Abstract method to construct GSS security contextr)r+rrr�
_init_context<szGSSBase._init_contextcCs|jS)z-Return GSS mechanisms available for this host)r#r+rrrr"Asz
GSSBase.mechscCs|jr|jjSdS)z1Return whether or not GSS negotiation is completeF)r$�completer+rrrr-G�zGSSBase.completecC� |jdusJ�t|jjtj@�S)zAReturn whether or not this context provides mutual authenticationN)r$�bool�actual_flagsr
�mutual_authenticationr+rrr�provides_mutual_authMs�zGSSBase.provides_mutual_authcCr/)z@Return whether or not this context provides integrity protectionN)r$r0r1r
�	integrityr+rrr�provides_integrityVszGSSBase.provides_integritycC�|jdusJ�t|jj�S)z2Return user principal associated with this contextN)r$�str�initiator_namer+rrr�user^�zGSSBase.usercCr6)z2Return host principal associated with this contextN)r$r7�target_namer+rrrrfr:zGSSBase.hostcCs
d|_dS)zReset GSS security contextN)r$r+rrr�resetns
z
GSSBase.reset�tokencCs(|js|��|jdusJ�|j�|�S)z*Perform next step in GSS security exchangeN)r$r,�step)r%r=rrrr>sszGSSBase.step�datacCs|jdusJ�|j�|�S)zSign a block of dataN)r$�
get_signature)r%r?rrr�sign}szGSSBase.sign�sigcCs8|jdusJ�z
|j�||�WdStyYdSw)z&Verify a signature for a block of dataNTF)r$�verify_signaturer)r%r?rBrrr�verify�s�zGSSBase.verify�rN�N)�__name__�
__module__�__qualname__�__doc__r7rrr&�propertyrr!r,rrr"r0r-r3r5r9rr<r>rArDrrrrr(s,


rcsNeZdZdZdedeedef�fdd�Ze	de
fdd	��Zd
dd�Z�Z
S)�	GSSClientz
GSS clientrr�delegate_credscs2t��||�tjtjB}|r|tjO}||_dSrF)�superr&r
r2r4�delegate_to_peer�_flags)r%rrrM�flags��	__class__rrr&�s�

zGSSClient.__init__rcCstd|jd�S)r(�initiate)�usager)rr r+rrrr!�szGSSClient._credsNcCst|j|j|jd�|_dS)z%Construct GSS client security context)�name�credsrQN)rrr!rPr$r+rrrr,�s
�zGSSClient._init_contextrE)rGrHrIrJr7rrr0r&rKrr!r,�
__classcell__rrrRrrL�s�rLc@s,eZdZdZedefdd��Zddd�ZdS)	�	GSSServerz
GSS serverrcCst|jd|jd�S)r(�accept)rVrUr)rrr r+rrrr!�r.zGSSServer._credsNcCst|jd�|_dS)z%Construct GSS server security context)rWN)rr!r$r+rrrr,�szGSSServer._init_contextrE)rGrHrIrJrKrr!r,rrrrrY�s
rYN)rJ�typingrrrr�gssapirrrr	r
r�gssapi.exceptionsr�asn1r�miscrrrrrLrYrrrr�<module>sh