HEX
Server: Apache/2.4.52 (Ubuntu)
System: Linux spn-python 5.15.0-89-generic #99-Ubuntu SMP Mon Oct 30 20:42:41 UTC 2023 x86_64
User: arjun (1000)
PHP: 8.1.2-1ubuntu2.20
Disabled: NONE
Upload Files
File: //lib/python3/dist-packages/samba/tests/dcerpc/__pycache__/binding.cpython-310.pyc
o

�/a��@sndZddlZddlmZmZddlmZddlmm	Z	ddl
mZmZm
Z
ddlmZGdd�de�ZdS)	z8Tests for samba.dcerpc., credentials and binding strings�N)�RpcInterfaceTestCase�TestCase)�lsa)�Credentials�SMB_ENCRYPTION_REQUIRED�SMB_ENCRYPTION_OFF)�
NTSTATUSErrorcsDeZdZ�fdd�Zdd�Zdd�Zdd�Zd	d
�Zdd�Z�Z	S)
�RpcBindingTestscstt|���dS)N)�superr	�setUp)�self��	__class__��</usr/lib/python3/dist-packages/samba/tests/dcerpc/binding.pyrszRpcBindingTests.setUpcCsTt�}|��tj�d�}tj�d�}tj�d�}|�|�|�|�|�|�|S)N�DOMAIN�USERNAME�PASSWORD)r�guess�samba�tests�env_get_var_value�
set_domain�set_username�set_password)r�c�domain�username�passwordrrr�get_user_creds s


zRpcBindingTests.get_user_credscC�|��}|�t�|��}|�dd�|�dd�dtj�d�}t�	|||�}|�
|���t��}t�
�|_|�d|tj�}|�|�dS�N�client ipc max protocol�SMB3�client ipc min protocol�ncacn_np:%s�SERVER�)r�set_smb_encryptionr�get_loadparm�setrrrr�lsarpc�assertFalse�transport_encrypted�ObjectAttribute�QosInfo�sec_qos�OpenPolicy2�security�SEC_FLAG_MAXIMUM_ALLOWED�assertIsNotNone�r�creds�lp�binding_string�lsa_conn�
objectAttr�
pol_handlerrr�test_smb3_dcerpc_no_encryption+�

�z.RpcBindingTests.test_smb3_dcerpc_no_encryptioncCr r!)rr(rr)r*rrrrr+�
assertTruer-r.r/r0r1r2r3r4r5rrr�test_smb3_dcerpc_encryption?r=z+RpcBindingTests.test_smb3_dcerpc_encryptioncC�Z|��}|�t�|��}|�dd�|�dd�dtj�d�}|�t	t
j|||�dS)Nr"�SMB2r$r%r&�rr(rr)r*rrr�assertRaisesrrr+�rr6r7r8rrr�test_smb2_dcerpc_encryptionS�
z+RpcBindingTests.test_smb2_dcerpc_encryptioncCr@)Nr"�NT1r$r%r&rBrDrrr�test_smb1_dcerpc_encryption^rFz+RpcBindingTests.test_smb1_dcerpc_encryption)
�__name__�
__module__�__qualname__rrr<r?rErH�
__classcell__rrr
rr	sr	)�__doc__�samba.testsrrr�samba.dcerpcr�samba.dcerpc.security�dcerpcr2�samba.credentialsrrrrr	rrrr�<module>s