AnonSec Shell
Server IP : 209.38.156.173  /  Your IP : 216.73.216.122   [ Reverse IP ]
Web Server : Apache/2.4.52 (Ubuntu)
System : Linux lakekumayuhotel 5.15.0-136-generic #147-Ubuntu SMP Sat Mar 15 15:53:30 UTC 2025 x86_64
User : root ( 0)
PHP Version : 8.1.2-1ubuntu2.22
Disable Function : NONE
Domains : 2 Domains
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3/dist-packages/twisted/cred/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ HOME ]     [ BACKUP SHELL ]     [ JUMPING ]     [ MASS DEFACE ]     [ SCAN ROOT ]     [ SYMLINK ]     

Current File : /usr/lib/python3/dist-packages/twisted/cred/test/__pycache__/test_cramauth.cpython-310.pyc
o

�b��@sTdZddlZddlmZddlmZddlmZmZddl	m
Z
Gdd�de
�ZdS)	z9
Tests for L{twisted.cred}'s implementation of CRAM-MD5.
�N)�hexlify)�HMAC)�CramMD5Credentials�IUsernameHashedPassword)�TestCasec@s@eZdZdZdd�Zdd�Zdd�Zdd	�Zd
d�Zdd
�Z	dS)�CramMD5CredentialsTestsz*
    Tests for L{CramMD5Credentials}.
    cCs"t�}|��}|�||���dS)z�
        The same L{CramMD5Credentials} will always provide the same challenge,
        no matter how many times it is called.
        N)r�getChallenge�assertEqual��self�c�chal�r�A/usr/lib/python3/dist-packages/twisted/cred/test/test_cramauth.py�test_idempotentChallengesz0CramMD5CredentialsTests.test_idempotentChallengecCs<t�}|��}ttd|tjd����|_|�|�	d��dS)a2
        When a valid response (which is a hex digest of the challenge that has
        been encrypted by the user's shared secret) is set on the
        L{CramMD5Credentials} that created the challenge, and C{checkPassword}
        is called with the user's shared secret, it will return L{True}.
        �secret��	digestmodN)
rrrr�hashlib�md5�digest�response�
assertTrue�
checkPasswordr
rrr�test_checkPasswordsz*CramMD5CredentialsTests.test_checkPasswordcCst�}|�|�d��dS)zg
        When there is no response set, calling C{checkPassword} will return
        L{False}.
        rN)r�assertFalser)rrrrr�test_noResponse+sz'CramMD5CredentialsTests.test_noResponsecCs<t�}|��}ttd|tjd����|_|�|�	d��dS)a 
        When an invalid response is set on the L{CramMD5Credentials} (one that
        is not the hex digest of the challenge, encrypted with the user's shared
        secret) and C{checkPassword} is called with the user's correct shared
        secret, it will return L{False}.
        sthewrongsecretrrN)
rrrrrrrrrrr
rrr�test_wrongPassword3s�z*CramMD5CredentialsTests.test_wrongPasswordcCsXt�}|��}|�d�dttd|tjd����f��|�	|�
d��|�|jd�dS)z�
        When C{setResponse} is called with a string that is the username and
        the hashed challenge separated with a space, they will be set on the
        L{CramMD5Credentials}.
        � ssquirrelssupersecretrN)
rr�setResponse�joinrrrrrrrr	�usernamer
rrr�test_setResponseAs���z(CramMD5CredentialsTests.test_setResponsecCs|�t�t��dS)zd
        L{CramMD5Credentials} implements the L{IUsernameHashedPassword}
        interface.
        N)rr�
implementedByr)rrrr�test_interfaceTsz&CramMD5CredentialsTests.test_interfaceN)
�__name__�
__module__�__qualname__�__doc__rrrrr"r$rrrrrs	r)r(r�binasciir�hmacr�twisted.cred.credentialsrr�twisted.trial.unittestrrrrrr�<module>s

Anon7 - 2022
AnonSec Team