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

�\e|�@s�dZddlZddlmZmZddlZddlmZ	ddlm
Zddlm
Z
ddlZddlmZmZddlmZdd	lmZdd
lmZddlmZmZmZmZmZddlZGdd
�d
ejjj �Z!dS)z&Tests for the Auth and AuthZ logging.
�N)�srvsvc�	dnsserver)�libsmb_samba_internal)�param)�SamDB)�DONT_USE_KERBEROS�MUST_USE_KERBEROS)�
NTSTATUSError)�call)�LdbError)�EVT_ID_SUCCESSFUL_LOGON�EVT_ID_UNSUCCESSFUL_LOGON�EVT_LOGON_NETWORK�EVT_LOGON_INTERACTIVE�EVT_LOGON_NETWORK_CLEAR_TEXTcs�eZdZ�fdd�Z�fdd�Z		dudd�Zd	d
�Zdd�Zd
d�Zdd�Z	dd�Z
dd�Zdd�Zdd�Z
dd�Zdd�Zdd�Zdd �Zd!d"�Zd#d$�Zd%d&�Zd'd(�Zd)d*�Zd+d,�Zd-d.�Zd/d0�Zd1d2�Zd3d4�Zd5d6�Zd7d8�Zd9d:�Zd;d<�Zd=d>�Z d?d@�Z!dAdB�Z"dCdD�Z#dEdF�Z$dGdH�Z%dIdJ�Z&dKdL�Z'dMdN�Z(dOdP�Z)dQdR�Z*dSdT�Z+dUdV�Z,dWdX�Z-dYdZ�Z.d[d\�Z/d]d^�Z0d_d`�Z1dadb�Z2dcdd�Z3dedf�Z4dgdh�Z5didj�Z6dkdl�Z7dmdn�Z8dodp�Z9dqdr�Z:dsdt�Z;�Z<S)v�AuthLogTestscstt|���tjd|_dS)N�	CLIENT_IP)�superr�setUp�os�environ�
remoteAddress��self��	__class__��6/usr/lib/python3/dist-packages/samba/tests/auth_log.pyr+szAuthLogTests.setUpcstt|���dS�N)rr�tearDownrrrrr/szAuthLogTests.tearDown�yesFcCsJ|��}t��}|�|j�|�d|�|�d|�tj|jd|||d�S)Nzclient use spnegozclient ntlmv2 auth�sysvol)�lp�creds�
force_smb1)	�get_loadparm�s3param�get_context�load�
configfile�set�libsmb�Conn�server)rr#�
use_spnego�ntlmv2_authr$r"�s3_lprrr�smb_connection2s�zAuthLogTests.smb_connectionc
s����fdd�}|rd|}�dkr!t�d|j|f|��|�}n�dkr3t�d|j|f|��|�}|�||�}	||	��|��dS)NcsP|ddko'|dddkp|dd�ko'|dd�dko'|dd�kS�N�type�
Authorization�serviceDescription�DCE/RPC�authTyper�transportProtectionr��msg��	authTypes�
protection�servicerr�isLastExpectedMessageBs���z>AuthLogTests._test_rpc_ncacn_np.<locals>.isLastExpectedMessage�[%s]rz
ncacn_np:%s%sr�rr-r%r�waitForMessages)
rr<r#r>�bindingr=�
checkFunctionr?�x�messagesrr;r�_test_rpc_ncacn_np@s��zAuthLogTests._test_rpc_ncacn_npcCsbttdd�t�d��|���}d|vr|�|d�dSd|vr'|�|d�dS|�|ddg�dS)NcSs|Srr)rErrr�<lambda>_szBAuthLogTests._assert_ncacn_np_serviceDescription.<locals>.<lambda>z[\[,\]]�smb2�SMB2�smb1�SMB)�list�filter�re�compile�split�assertEqual�assertIn)rrCr5�binding_listrrr�#_assert_ncacn_np_serviceDescriptionZs�z0AuthLogTests._assert_ncacn_np_serviceDescriptionc	s�t|�}|�|t|�d�|d}|�d|d�|�d|dd�|�t|dd�|�t|dd�|�||dd	�|�|d
|dd�|d
}|�d|d�|�||dd	�|�|d
|dd�|�d|dd�|�|�|dd��|dkr҇fdd�}|d
}|�d|d�|�d|dd�|�||dd	��|�|d|dd�|�t|dd�|�t|dd�dSdS)N�/Did not receive the expected number of messagesr�Authenticationr3�NT_STATUS_OK�status�eventId�	logonTyper5��authDescriptionr4�r7rLr8�	sessionId�cs|dkp|�kS)Nr6r)�desc�r>rr�checkServiceDescription�szEAuthLogTests.rpc_ncacn_np_ntlm_check.<locals>.checkServiceDescription���lenrRrrrU�
assertTrue�is_guid)	rrFr<r>rCr=�expected_messagesr:rcrrbr�rpc_ncacn_np_ntlm_checkis`����

��
��

����z$AuthLogTests.rpc_ncacn_np_ntlm_checkcCs�t|�}|�|t|�d�|d}|�d|d�|�d|dd�|�d|dd�|�|d	|dd
�|�t|dd�|�t|dd�|d	}|�d|d�|�d|dd�|�d|dd�|�|d
|dd
�|�t|dd�|�t|dd�|d
}|�d|d�|�||dd�|�|d|dd�|�d|dd�|�|�|dd��dS)NrVrrWr3rXrY�Kerberos KDCr5r\r]rZr[r^r4rdr7rLr8r_re�rrFr<r>rCr=rir:rrr�rpc_ncacn_np_krb5_check�sV�
�

���
�

����z$AuthLogTests.rpc_ncacn_np_krb5_checkcC�0|j|��td�}|�gd�|ddd|j�dS)N��template�kerberos_state��NTLMSSPrsrsrsr�sign�SIGN��insta_creds�get_credentialsrrGrj�rr#rrr�test_rpc_ncacn_np_ntlm_dns_sign��
�
�z,AuthLogTests.test_rpc_ncacn_np_ntlm_dns_signcCrn)Nrorrrrtrurvryrrr�test_rpc_ncacn_np_ntlm_srv_sign�r{z,AuthLogTests.test_rpc_ncacn_np_ntlm_srv_signcCrn)Nro��ncacn_nprsrsr�rLrvryrrr�test_rpc_ncacn_np_ntlm_dns��
�
�z'AuthLogTests.test_rpc_ncacn_np_ntlm_dnscCrn)Nror}rrrLrvryrrr�test_rpc_ncacn_np_ntlm_srv�r�z'AuthLogTests.test_rpc_ncacn_np_ntlm_srvcCrn)Nro��krb5�ENC-TS Pre-authenticationr�r�rrtru�rwrxrrGrmryrrr�test_rpc_ncacn_np_krb_dns_sign�r{z+AuthLogTests.test_rpc_ncacn_np_krb_dns_signcCrn)Nror�rrtrur�ryrrr�test_rpc_ncacn_np_krb_srv_sign�r{z+AuthLogTests.test_rpc_ncacn_np_krb_srv_signcCrn)Nro�r~r�r�r�rrrLr�ryrrr�test_rpc_ncacn_np_krb_dns	r{z&AuthLogTests.test_rpc_ncacn_np_krb_dnscCrn)Nror�rrIrLr�ryrrr�test_rpc_ncacn_np_krb_dns_smb2r{z+AuthLogTests.test_rpc_ncacn_np_krb_dns_smb2cCrn)Nror�rrrLr�ryrrr�test_rpc_ncacn_np_krb_srvr{z&AuthLogTests.test_rpc_ncacn_np_krb_srvc
s���fdd�}|r
d|}|dkr t�d|j|f|��|�}n|dkr2t�d|j|f|��|�}|�||�}	||	�||��dS)Ncs@|ddko|dddko|dd�dko|dd�kSr2rr9�r<r=rrr?)s���zBAuthLogTests._test_rpc_ncacn_ip_tcp.<locals>.isLastExpectedMessager@rzncacn_ip_tcp:%s%srrA)
rr<r#r>rCr=rDr?�connrFrr�r�_test_rpc_ncacn_ip_tcp's ��z#AuthLogTests._test_rpc_ncacn_ip_tcpcCst|�}|�|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)NrVrr4r3r6r5r\r7�NONEr8r_rWrXrYr^r]rZr[�rfrRrgrhrrrlrrr�rpc_ncacn_ip_tcp_ntlm_check?s8�
�
�

���z(AuthLogTests.rpc_ncacn_ip_tcp_ntlm_checkcCs�t|�}|�|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�|d}|�d|d�|�d
|dd�|�d|dd�|�|d|dd�|�t|dd�|�t|dd�dS)NrVrr4r3r6r5r\r7r�r8r_rWrXrYrkr^r]rZr[r�rlrrr�rpc_ncacn_ip_tcp_krb5_check]sV�
�
�

���
�

���z(AuthLogTests.rpc_ncacn_ip_tcp_krb5_checkcCrn)Nro�rs�ncacn_ip_tcprsrrtru�rwrxrr�r�ryrrr�#test_rpc_ncacn_ip_tcp_ntlm_dns_sign�r�z0AuthLogTests.test_rpc_ncacn_ip_tcp_ntlm_dns_signcCrn)Nro�r�r�r�r�rrtru�rwrxrr�r�ryrrr�#test_rpc_ncacn_ip_tcp_krb5_dns_sign�r{z0AuthLogTests.test_rpc_ncacn_ip_tcp_krb5_dns_signcCrn)Nror�rrrur�ryrrr�test_rpc_ncacn_ip_tcp_ntlm_dns�r�z+AuthLogTests.test_rpc_ncacn_ip_tcp_ntlm_dnscCrn)Nror�rrrur�ryrrr�test_rpc_ncacn_ip_tcp_krb5_dns�r{z+AuthLogTests.test_rpc_ncacn_ip_tcp_krb5_dnscCrn)Nror�r�connectr�r�ryrrr�&test_rpc_ncacn_ip_tcp_ntlm_dns_connect�r�z3AuthLogTests.test_rpc_ncacn_ip_tcp_ntlm_dns_connectcCrn)Nror�rr�r�r�ryrrr�&test_rpc_ncacn_ip_tcp_krb5_dns_connect�r{z3AuthLogTests.test_rpc_ncacn_ip_tcp_krb5_dns_connectcCrn)Nror�r�seal�SEALr�ryrrr�#test_rpc_ncacn_ip_tcp_ntlm_dns_seal�r�z0AuthLogTests.test_rpc_ncacn_ip_tcp_ntlm_dns_sealcCrn)Nror�rr�r�r�ryrrr�#test_rpc_ncacn_ip_tcp_krb5_dns_seal�r{z0AuthLogTests.test_rpc_ncacn_ip_tcp_krb5_dns_sealcCsndd�}tdtjd|��|��d�|_|�|�}|�dt|�d�|d}|�d	|d
�|�d|d	d�|�d
|d	d�|�d|d	d�|�	|d	ddk�|�t
|d	d�|�t|d	d�|d}|�d	|d
�|�d|d	d�|�d
|d	d�|�d|d	d�|�	|d	ddk�|�t
|d	d�|�t|d	d�dS)NcS�<|ddko|dddko|dddko|dddkS)	Nr3r4r5�LDAPr8r�r7r�rr9rrrr?�����z5AuthLogTests.test_ldap.<locals>.isLastExpectedMessage�	ldap://%s�SERVER��urlr"�credentialsrdrVrrWr3rXrYrkr5r�r]�durationrZr[r\�rrrr%rx�samdbrBrRrfrgrr�rr?rFr:rrr�	test_ldap�sT�
�
�
���
�
���zAuthLogTests.test_ldapcCs�dd�}tdtjd|��|��d�|_|�|�}|�dt|�d�|d}|�d	|d
�|�d|d	d�|�d
|d	d�|�d|d	d�|�	|d	ddk�|�t
|d	d�|�t|d	d�dS)NcSr�)	Nr3r4r5r�r8r�r7rsrr9rrrr?r�z:AuthLogTests.test_ldap_ntlm.<locals>.isLastExpectedMessager��	SERVER_IPr�r^rVrrWr3rXrYr�r5rsr]r�rZr[r�r�rrr�test_ldap_ntlms0�
�
���zAuthLogTests.test_ldap_ntlmcCs�dd�}|j|��d�}|�d|��|��f�tdtjd|��|d�|_	|�
|�}|�dt|�d	�|d
}|�d|d�|�d
|dd�|�d|dd�|�d|dd�|�t
|dd�|�t|dd�dS)NcSr�)	Nr3r4r5r�r8�TLSr7zsimple bindrr9rrrr?r�zAAuthLogTests.test_ldap_simple_bind.<locals>.isLastExpectedMessage�rp�%s\%s�
ldaps://%sr�r�r^rVrrWr3rXrYr�r5�simple bind/TLSr]rZr[)rwrx�set_bind_dn�
get_domain�get_usernamerrrr%r�rBrRrfrr�rr?r#rFr:rrr�test_ldap_simple_binds:��
�
�
���z"AuthLogTests.test_ldap_simple_bindcCs�dd�}|j|��d�}|�d�|�d|��|��f�d}ztdtjd|�	�|d	�|_
Wnty<d
}Ynw|�|d
�|�
|�}|�dt|�d�dS)
NcS�\|ddko-|dddko-|dddko-|dddko-|dd	tko-|dd
tkS)Nr3rWr5r�rY�NT_STATUS_WRONG_PASSWORDr]r�rZr[�r
rr9rrrr?@�&�
��
��
��
��zNAuthLogTests.test_ldap_simple_bind_bad_password.<locals>.isLastExpectedMessager��badPasswordr�Fr�r�r�Tr\rV)rwrx�set_passwordr�r�r�rrrr%r�rrRrBrf�rr?r#�thrownrFrrr�"test_ldap_simple_bind_bad_password?s*
���
�z/AuthLogTests.test_ldap_simple_bind_bad_passwordcC�dd�}|j|��d�}|�d|��df�d}ztdtjd|��|d	�|_Wnt	y5d
}Ynw|�
|d
�|�|�}|�
dt|�d�dS)
NcSr��Nr3rWr5r�rY�NT_STATUS_NO_SUCH_USERr]r�rZr[r�r9rrrr?`r�zJAuthLogTests.test_ldap_simple_bind_bad_user.<locals>.isLastExpectedMessager�r��badUserFr�r�r�Tr\rV�
rwrxr�r�rrrr%r�rrRrBrfr�rrr�test_ldap_simple_bind_bad_user_�$��
�z+AuthLogTests.test_ldap_simple_bind_bad_usercCr�)
NcSr�r�r�r9rrrr?~r�zRAuthLogTests.test_ldap_simple_bind_unparseable_user.<locals>.isLastExpectedMessager�r��abdcefFr�r�r�Tr\rVr�r�rrr�&test_ldap_simple_bind_unparseable_user}r�z3AuthLogTests.test_ldap_simple_bind_unparseable_usercCs^dd�}|j|��d�}|��tdtjd|��|d�|_|�|�}|�	dt
|�d�dS)	NcSsdS)NTrr9rrrr?�szPAuthLogTests.test_ldap_anonymous_access_bind_only.<locals>.isLastExpectedMessager�r�r�r�rrV)rwrx�
set_anonymousrrrr%r�rBrRrf�rr?r#rFrrr�$test_ldap_anonymous_access_bind_only�s�
�z1AuthLogTests.test_ldap_anonymous_access_bind_onlycCs�dd�}|j|��d�}|��tdtjd|��|d�|_z|jj|j�	�d�|�
d�Wn	ty9Ynw|�|�}|�
d	t|�d
�dS)NcS�L|ddko%|dddko%|dddko%|dddko%|dd	d
kS)Nr3r4r5r�r8r��account�ANONYMOUS LOGONr7zno bindrr9rrrr?������zFAuthLogTests.test_ldap_anonymous_access.<locals>.isLastExpectedMessager�r�r�r�)�basezExpected an LdbError exceptionr\rV)rwrxr�rrrr%r��search�	domain_dn�failrrBrRrfr�rrr�test_ldap_anonymous_access�s$��
�z'AuthLogTests.test_ldap_anonymous_accesscCs:dd�}|j|��d�}|�|�|�|�}|�dt|�d�|d}|�d|d�|�d	|dd
�|�d|dd�|�d
|dd�|�t|dd�|�t|dd�|d}|�d|d�|�d	|dd
�|�d|dd�|�d
|dd�|�t|dd�|�t|dd�dS)NcS�<|ddkod|ddvo|dddko|dddkS)Nr3r4rLr5r7r�r8rr9rrrr?�r�z4AuthLogTests.test_smb.<locals>.isLastExpectedMessager�rdrVrrWr3rXrYrkr5r�r]rZr[r\)rwrxr1rBrRrfrrr�rrr�test_smb�sL

�
�
�
�
�
�
�
�
�zAuthLogTests.test_smbcC�dd�}|j|��d�}|�t�|�d�d}z|�|�Wnty*d}Ynw|�|d�|�|�}|�dt	|�d�dS)	NcSr�)	Nr3rWr5rkrYr�r]r�rr9rrrr?�s
��
��
��zAAuthLogTests.test_smb_bad_password.<locals>.isLastExpectedMessager�r�FTr\rV)
rwrx�set_kerberos_staterr�r1r	rRrBrfr�rrr�test_smb_bad_password�s 	

�
�z"AuthLogTests.test_smb_bad_passwordcCr�)	NcSr�)Nr3rWr5rkrYr�r]r�rZr[�r
rr9rrrr?s*
��
��
��
��
	��z=AuthLogTests.test_smb_bad_user.<locals>.isLastExpectedMessager�r�FTr\rV)
rwrxr�r�set_usernamer1r	rRrBrfr�rrr�test_smb_bad_user
s 

�
�zAuthLogTests.test_smb_bad_usercC�dd�}tjd}d|}d}td||ddg�|�|�}|�d	t|�d
�|d}|�d|d
�|�d|dd�|�d|dd�|�d|dd�|�d|dd�|�t|dd�|�t|dd�|d}|�d|d
�|�d|dd�|�d|dd�|�d|dd�|�d|dd�|�d|dd�|�t|dd�|�t|dd�dS)NcSsL|ddko%|dddko%|dddko%|dddko%|dd	dkS)
Nr3r4r5rLr7rsr�r�r8rr9rrrr?,r�z?AuthLogTests.test_smb1_anonymous.<locals>.isLastExpectedMessager��	//%s/IPC$�-N�
bin/smbclientz-mNT1�-c quitrdrVrrWr3r�rYrLr5rsr]�No-Password�passwordTyperZr[r\rXr��
becameAccount�	rrr
rBrRrfr
rr�rr?r-�path�authrFr:rrr�test_smb1_anonymous+�j

�
�
�
�
�
�
�
�
�
�
�
�
�
�z AuthLogTests.test_smb1_anonymouscCr�)NcSr�)Nr3r4r5rJr7rsr�r�r8rLrr9rrrr?ar�z?AuthLogTests.test_smb2_anonymous.<locals>.isLastExpectedMessager�r�r�r�z-mSMB3r�rdrVrrWr3r�rYrJr5rsr]r�r�rZr[r\rXr�r�r�r�rrr�test_smb2_anonymous`r�z AuthLogTests.test_smb2_anonymouscCs�dd�}|j|��td�}|�|�|�|�}|�dt|�d�|d}|�d|d�|�d	|dd
�|�|dddd
g�|�d|dd�|�d|dd�|�t|dd�|�t	|dd�dS)NcSr�)Nr3r4rLr5r7rsr8rr9rrrr?�r�zBAuthLogTests.test_smb_no_krb_spnego.<locals>.isLastExpectedMessageror^rVrrWr3rXrYr5rLrJrsr]�NTLMv2r�rZr[)
rwrxrr1rBrRrfrSrrr�rrr�test_smb_no_krb_spnego�s8
�

��
�
�
�
�z#AuthLogTests.test_smb_no_krb_spnegocC�zdd�}|j|��td�}|�d�d}z|�|�Wnty&d}Ynw|�|d�|�|�}|�dt|�d�dS)	NcS�l|ddko5d|ddvo5|dddko5|dddko5|dd	d
ko5|ddtko5|ddtkS)
Nr3rWrLr5r]rsr�r�rYr�rZr[r�r9rrrr?��&���
��
��
��zOAuthLogTests.test_smb_no_krb_spnego_bad_password.<locals>.isLastExpectedMessageror�FTr\rV�	rwrxrr�r1r	rRrBrfr�rrr�#test_smb_no_krb_spnego_bad_password��"
�
�
�z0AuthLogTests.test_smb_no_krb_spnego_bad_passwordcCr�)	NcSr�)
Nr3rWrLr5r]rsr�r�rYr�rZr[r�r9rrrr?�r�zKAuthLogTests.test_smb_no_krb_spnego_bad_user.<locals>.isLastExpectedMessageror�FTr\rV�	rwrxrr�r1r	rRrBrfr�rrr�test_smb_no_krb_spnego_bad_user�r�z,AuthLogTests.test_smb_no_krb_spnego_bad_usercCs�dd�}|j|��td�}|j|dddd�|�|�}|�dt|�d�|d	}|�d
|d�|�d|d
d
�|�d|d
d�|�d|d
d�|�d|d
d�|�t|d
d�|�t|d
d�dS)NcSs<|ddko|dddko|dddko|dddkS)Nr3r4r5rLr7�	bare-NTLMr8rr9rrrr?�r�zOAuthLogTests.test_smb_no_krb_no_spnego_no_ntlmv2.<locals>.isLastExpectedMessageroT�no�r$r/r.r^rVrrWr3rXrYrLr5r�r]�NTLMv1r�rZr[)	rwrxrr1rBrRrfrrr�rrr�#test_smb_no_krb_no_spnego_no_ntlmv2�s@
��
�
�
�
�
�
�z0AuthLogTests.test_smb_no_krb_no_spnego_no_ntlmv2cC�dd�}|j|��td�}|�d�d}z|j|dddd�Wnty*d}Ynw|�|d�|�|�}|�d	t|�d
�dS)NcS�l|ddko5|dddko5|dddko5|dddko5|dd	d
ko5|ddtko5|ddtkS)
Nr3rWr5rLr]r�r�r�rYr�rZr[r�r9rrrr?r�z\AuthLogTests.test_smb_no_krb_no_spnego_no_ntlmv2_bad_password.<locals>.isLastExpectedMessageror�FTr�r�r\rVr�r�rrr�0test_smb_no_krb_no_spnego_no_ntlmv2_bad_password�*
�

��
�z=AuthLogTests.test_smb_no_krb_no_spnego_no_ntlmv2_bad_passwordcCr)NcSr)
Nr3rWr5rLr]r�r�r�rYr�rZr[r�r9rrrr?/r�zXAuthLogTests.test_smb_no_krb_no_spnego_no_ntlmv2_bad_user.<locals>.isLastExpectedMessageror�FTr�r�r\rVr�r�rrr�,test_smb_no_krb_no_spnego_no_ntlmv2_bad_user.rz9AuthLogTests.test_smb_no_krb_no_spnego_no_ntlmv2_bad_userc�d��fdd�}tjd}tjd}tjd}d||�df}td	d
|d|g�|�|�}|�|�}t|�}|�d|d
kp@|dkd�dS)Nrc�p|ddko7|dddko7|dddko7|dddko7|dd	d
�ko7|ddtko7|ddtkS)
Nr3rWr5�SamLogonr]�interactiverYrX�workstation�\\%srZr[)rrr9�r
rrr?Rs.
��
���
��
��

��zEAuthLogTests.test_samlogon_interactive.<locals>.isLastExpectedMessager��USERNAME�PASSWORD�samlogon %s %s %s %dr\�
bin/rpcclient�-c�-U%Tr`�rV�rrr
rB�remove_netlogon_messagesrf�assertIs�rr?r-�user�password�samlogonrF�receivedrrr�test_samlogon_interactiveNs




�z&AuthLogTests.test_samlogon_interactivec�d��fdd�}tjd}tjd}d}d||�df}td	d
|d|g�|�|�}|�|�}t|�}|�d|d
kp=|dkd�dS)Nrcr)
Nr3rWr5rr]r	rYr�r
rrZr[�r
rr9rrrr?r�2
��
��
��
��
	��
��zRAuthLogTests.test_samlogon_interactive_bad_password.<locals>.isLastExpectedMessager�r
r�rr\rrrTr`rrVrrrrr�&test_samlogon_interactive_bad_passwordns



�z3AuthLogTests.test_samlogon_interactive_bad_passwordc�d��fdd�}tjd}d}tjd}d||�df}td	d
|d|g�|�|�}|�|�}t|�}|�d|d
kp=|dkd�dS)Nrcr)
Nr3rWr5rr]r	rYr�r
rrZr[rr9rrrr?�rzNAuthLogTests.test_samlogon_interactive_bad_user.<locals>.isLastExpectedMessager�r�rrr\rrrTr`rrVrrrrr�"test_samlogon_interactive_bad_user�s



�z/AuthLogTests.test_samlogon_interactive_bad_usercr)Nrcr�
Nr3rWr5rr]�networkrYrXr
rrZr[�rrr9rrrr?��*
����
��
��
	��zAAuthLogTests.test_samlogon_network.<locals>.isLastExpectedMessager�r
rrr^rrrTr`rrVrrrrr�test_samlogon_network�s




�z"AuthLogTests.test_samlogon_networkcr)Nrcr)
Nr3rWr5rr]r$rYr�r
rrZr[r�r9rrrr?��.
���
��
��
��

��zNAuthLogTests.test_samlogon_network_bad_password.<locals>.isLastExpectedMessager�r
r�rr^rrrTr`rrVrrrrr�"test_samlogon_network_bad_password�s



�z/AuthLogTests.test_samlogon_network_bad_passwordcr!)Nrcr)
Nr3rWr5rr]r$rYr�r
rrZr[r�r9rrrr?�r(zJAuthLogTests.test_samlogon_network_bad_user.<locals>.isLastExpectedMessager�r�rrr^rrrTr`rrVrrrrr�test_samlogon_network_bad_user�s



�z+AuthLogTests.test_samlogon_network_bad_usercr)Nrc�|ddko?|dddko?|dddko?|dddko?|dd	d
ko?|ddd�ko?|dd
tko?|ddtkS)Nr3rWr5rr]r$rYrXr��MSCHAPv2r
rrZr[r%r9rrrr?s.
�����
��
��

��zHAuthLogTests.test_samlogon_network_mschap.<locals>.isLastExpectedMessager�r
r�samlogon %s %s %s %d 0x00010000r^rrrTr`rrVrrrrr�test_samlogon_network_mschaps 


�

�z)AuthLogTests.test_samlogon_network_mschapcr)Nrcr+)Nr3rWr5rr]r$rYr�r�r,r
rrZr[r�r9rrrr?4�2
���
���
��
	��
��zUAuthLogTests.test_samlogon_network_mschap_bad_password.<locals>.isLastExpectedMessager�r
r�r-r^rrrTr`rrVrrrrr�)test_samlogon_network_mschap_bad_password0s 

�

�z6AuthLogTests.test_samlogon_network_mschap_bad_passwordcr!)Nrcr+)Nr3rWr5rr]r$rYr�r�r,r
rrZr[r�r9rrrr?Vr/zQAuthLogTests.test_samlogon_network_mschap_bad_user.<locals>.isLastExpectedMessager�r�rr-r^rrrTr`rrVrrrrr�%test_samlogon_network_mschap_bad_userRs 

�

�z2AuthLogTests.test_samlogon_network_mschap_bad_userc	��d��fdd�}tjd}tjd}tjd}d||�f}tdd	|d
|g�|�|�}|�|�}t|�}|�d|dkp?|d
kd�|d}|�d|d�|�d|dd�|�d|dd�|�d|dd�|�|�	|dd��dS)Nrcrr#r%r9rrrr?xr&zGAuthLogTests.test_samlogon_schannel_seal.<locals>.isLastExpectedMessager�r
rzschannel;samlogon %s %s %srrrTr`rrV���r4r3r6r5�schannelr7r�r8r_�
rrr
rBrrfrrRrgrh�	rr?r-rrrrFrr:rrr�test_samlogon_schannel_sealts,




�
�z(AuthLogTests.test_samlogon_schannel_sealc	r2)Nrcrr#r%r9rrrr?�r&zGAuthLogTests.test_samlogon_schannel_sign.<locals>.isLastExpectedMessager�r
rzschannelsign;samlogon %s %s %srrrTr`rrVr3r4r3r6r5r4r7r�r8r_r5r6rrr�test_samlogon_schannel_sign�s0


�

�
�z(AuthLogTests.test_samlogon_schannel_sign)r r F)=�__name__�
__module__�__qualname__rrr1rGrUrjrmrzr|r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�r�rrrrr r"r'r)r*r.r0r1r7r8�
__classcell__rrrrr)sx
�24

		




+	
	
	
	
-! "(55!   !!  !""*r)"�__doc__�samba.tests�samba�samba.dcerpcrrr�samba.samba3rr+rr&�samba.samdbr�samba.tests.auth_log_base�samba.credentialsrrr	�
subprocessr
�ldbr�samba.dcerpc.windows_event_idsrr
rrrrO�tests�
auth_log_base�AuthLogTestBaserrrrr�<module>s