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/__pycache__/auth_log_ncalrpc.cpython-310.pyc
o

�/a��@sbdZddlZddlmZddlmZddlmZddl	Zddl
mZmZGdd�dej
jj�ZdS)	z&Tests for the Auth and AuthZ logging.
�N)�DONT_USE_KERBEROS)�AS_SYSTEM_MAGIC_PATH_TOKEN)�samr)�EVT_ID_SUCCESSFUL_LOGON�EVT_LOGON_NETWORKcsHeZdZ�fdd�Z�fdd�Zdd�Zdd�Zd	d
�Zdd�Z�Z	S)
�AuthLogTestsNcalrpccstt|���t|_dS�N)�superr�setUpr�
remoteAddress��self��	__class__��>/usr/lib/python3/dist-packages/samba/tests/auth_log_ncalrpc.pyr
"s
zAuthLogTestsNcalrpc.setUpcstt|���dSr)r	r�tearDownrrrrr&szAuthLogTestsNcalrpc.tearDowncsJ��fdd�}|r
d|}t�d||��|�|�|�}||���dS)Ncs@|ddko|dddko|dd�dko|dd�kS)N�type�
Authorization�serviceDescription�DCE/RPC�authTyper�transportProtectionr)�msg��	authTypes�
protectionrr�isLastExpectedMessage,s���zEAuthLogTestsNcalrpc._test_rpc_ncaclrpc.<locals>.isLastExpectedMessagez[%s]z
ncalrpc:%s)r�get_loadparm�waitForMessages)r
r�binding�credsr�
checkFunctionr�messagesrrr�_test_rpc_ncaclrpc)s
z&AuthLogTestsNcalrpc._test_rpc_ncaclrpccCst|�}|�|t|�d�|d}|�d|d�|�d|dd�|�|d|dd�|�d	|dd
�|�|�|dd��|d}|�d|d�|�d
|dd�|�d|dd�|�|d|dd�|�t|dd�|�t|dd�dS)Nz/Did not receive the expected number of messagesrrrrr�r�NONEr�	sessionId�Authentication�NT_STATUS_OK�status��authDescription�eventId�	logonType)�len�assertEqual�
assertTrue�is_guidrr)r
r#rr�expected_messagesrrrr�rpc_ncacn_np_ntlm_check:s8�
�
�

�
�
�z+AuthLogTestsNcalrpc.rpc_ncacn_np_ntlm_checkcC�.|j|��td�}|�gd�d|d|j�dS)N��template�kerberos_state��NTLMSSP�ncalrpcr:��SIGN��insta_creds�get_credentialsrr$r4�r
r!rrr�test_ncalrpc_ntlm_dns_signW�
�
�z.AuthLogTestsNcalrpc.test_ncalrpc_ntlm_dns_signcCr5)Nr6r9�seal�SEALr>rArrr�test_ncalrpc_ntlm_dns_sealarCz.AuthLogTestsNcalrpc.test_ncalrpc_ntlm_dns_seal)
�__name__�
__module__�__qualname__r
rr$r4rBrF�
__classcell__rrrrr s
r)�__doc__�samba.tests�samba�samba.credentialsr�samba.dcerpc.dcerpcr�samba.dcerpcr�samba.tests.auth_log_base�samba.dcerpc.windows_event_idsrr�tests�
auth_log_base�AuthLogTestBaserrrrr�<module>s