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 :  /lib/python3/dist-packages/twisted/internet/test/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


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

Current File : /lib/python3/dist-packages/twisted/internet/test/__pycache__/test_newtls.cpython-310.pyc
o

�b��@sdZddlmZddlmZmZddlmZddlm	Z	ddl
mZmZm
Z
mZddlmZzddlmZdd	lmZWneyGd
ZYnweZddlmZGdd
�d
ej�ZGdd�d�Zeej�Gdd�de��ZGdd�deee�Ze��e� ��d
S)z(
Tests for L{twisted.internet._newtls}.
�)�
interfaces)�ConnectableProtocol�runProtocolsWithReactor)�ReactorBuilder)�
TCPCreator)�ContextGeneratingMixin�
SSLCreator�StartTLSClientCreator�TLSMixin)�unittest)�_newtls)�tlsN)�implementerc@s eZdZdZes
dZdd�ZdS)�BypassTLSTestsz4
    Tests for the L{_newtls._BypassTLS} class.
    z<Couldn't import _newtls, perhaps pyOpenSSL is old or missingcsft��g�G��fdd�d�}t�||��}|��|���g�t�}|�|�|���|g�dS)z�
        C{_BypassTLS.loseConnection} calls C{loseConnection} on the base
        class, while preserving any default argument in the base class'
        C{loseConnection} implementation.
        cseZdZ�f�fdd�	ZdS)zDBypassTLSTests.test_loseConnectionPassThrough.<locals>.FakeTransportcs��|�dS�N)�append)�self�	_connDone)�result��C/usr/lib/python3/dist-packages/twisted/internet/test/test_newtls.py�loseConnection4szSBypassTLSTests.test_loseConnectionPassThrough.<locals>.FakeTransport.loseConnectionN)�__name__�
__module__�__qualname__rr��defaultrrr�
FakeTransport3srN)�objectr�
_BypassTLSr�assertEqual)rr�bypass�
notDefaultrrr�test_loseConnectionPassThrough*s
z-BypassTLSTests.test_loseConnectionPassThroughN)rrr�__doc__r�skipr#rrrrr"s
rc@s(eZdZdZdd�Zdd�Zdd�ZdS)	�FakeProducerz'
    A producer that does nothing.
    cC�dSrr�rrrr�pauseProducingH�zFakeProducer.pauseProducingcCr'rrr(rrr�resumeProducingKr*zFakeProducer.resumeProducingcCr'rrr(rrr�
stopProducingNr*zFakeProducer.stopProducingN)rrrr$r)r+r,rrrrr&Cs
r&c@s eZdZdZdd�Zdd�ZdS)�ProducerProtocolzy
    Register a producer, unregister it, and verify the producer hooks up to
    innards of C{TLSMemoryBIOProtocol}.
    cCs||_||_dSr)�producerr)rr.rrrr�__init__Ys
zProducerProtocol.__init__cCsft|jjtj�std��|j�|jd�|j�	|jjj
j
�|j��|j�	|jjj
�|j��dS)Nz#TLSMemoryBIOProtocol not hooked up.T)
�
isinstance�	transport�protocolr
�TLSMemoryBIOProtocol�RuntimeError�registerProducerr.rr�	_producer�unregisterProducerrr(rrr�handshakeCompleted]s
z#ProducerProtocol.handshakeCompletedN)rrrr$r/r8rrrrr-Rsr-c@s@eZdZdZes
dZdd�Zdd�Zdd�Zd	d
�Z	dd�Z
d
S)�ProducerTestsMixinzM
    Test the new TLS code integrates C{TLSMemoryBIOProtocol} correctly.
    z)Could not import twisted.internet._newtlscC�6g}t�}t|t�t||�t��|�||dg�dS)z�
        C{registerProducer} and C{unregisterProducer} on TLS transports
        created as SSL from the get go are passed to the
        C{TLSMemoryBIOProtocol}, not the underlying transport directly.
        N)r&rrr-rr �rrr.rrr�test_producerSSLFromStartt��z,ProducerTestsMixin.test_producerSSLFromStartcCr:)z�
        C{registerProducer} and C{unregisterProducer} on TLS transports
        created by C{startTLS} are passed to the C{TLSMemoryBIOProtocol}, not
        the underlying transport directly.
        N)r&rrr-r	r r;rrr�test_producerAfterStartTLS�r=z-ProducerTestsMixin.test_producerAfterStartTLScsp|���|���g�t��G����fdd�dt�}G�fdd�dt�}t||�|�t��|����g�dS)z�
        When a producer is registered, and then startTLS is called,
        the producer is re-registered with the C{TLSMemoryBIOProtocol}.
        cseZdZ����fdd�ZdS)zMProducerTestsMixin.startTLSAfterRegisterProducer.<locals>.RegisterTLSProtocolcs�|j����|j����r!��|jjjj���|jjj�n��|jjjjj���|jjjj�|j��|j��dSr)	r1r5�startTLSrr2r6r.r7rr(�r.r�
serverContext�	streamingrr�connectionMade�s
z\ProducerTestsMixin.startTLSAfterRegisterProducer.<locals>.RegisterTLSProtocol.connectionMadeN�rrrrCrr@rr�RegisterTLSProtocol�srEcseZdZ�fdd�ZdS)zJProducerTestsMixin.startTLSAfterRegisterProducer.<locals>.StartTLSProtocolcs|j���dSr)r1r?r(��
clientContextrrrC�szYProducerTestsMixin.startTLSAfterRegisterProducer.<locals>.StartTLSProtocol.connectionMadeNrDrrFrr�StartTLSProtocol�srHN)�getClientContext�getServerContextr&rrrr )rrBrErHr)rGr.rrArBr�startTLSAfterRegisterProducer�s�z0ProducerTestsMixin.startTLSAfterRegisterProducercC�|�d�dS)z�
        When a streaming producer is registered, and then startTLS is called,
        the producer is re-registered with the C{TLSMemoryBIOProtocol}.
        TN�rKr(rrr�+test_startTLSAfterRegisterProducerStreaming�sz>ProducerTestsMixin.test_startTLSAfterRegisterProducerStreamingcCrL)z�
        When a non-streaming producer is registered, and then startTLS is
        called, the producer is re-registered with the
        C{TLSMemoryBIOProtocol}.
        FNrMr(rrr�.test_startTLSAfterRegisterProducerNonStreaming�szAProducerTestsMixin.test_startTLSAfterRegisterProducerNonStreamingN)rrrr$rr%r<r>rKrNrOrrrrr9ls$r9)!r$�twisted.internetr�&twisted.internet.test.connectionmixinsrr�#twisted.internet.test.reactormixinsr�twisted.internet.test.test_tcpr�twisted.internet.test.test_tlsrrr	r
�
twisted.trialrr�__newtls�twisted.protocolsr
�ImportError�zope.interfacer�TestCaserr&�IHandshakeListenerr-r9�globals�update�makeTestCaseClassesrrrr�<module>s*�!^

Anon7 - 2022
AnonSec Team