KGRKJGETMRETU895U-589TY5MIGM5JGB5SDFESFREWTGR54TY
Server : Apache/2.2.17 (Unix) mod_ssl/2.2.17 OpenSSL/0.9.8e-fips-rhel5 DAV/2 PHP/5.2.17
System : Linux localhost 2.6.18-419.el5 #1 SMP Fri Feb 24 22:47:42 UTC 2017 x86_64
User : nobody ( 99)
PHP Version : 5.2.17
Disable Function : NONE
Directory :  /usr/lib64/python2.4/site-packages/M2Crypto/SSL/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib64/python2.4/site-packages/M2Crypto/SSL/TwistedProtocolWrapper.pyo
mò
låìPc@s5dZdkiiZdkZdklZdklZdk	l
Z
dkZdklZl
Z
dklZdZd„Zd	deiieiƒd
„Zd	deiieiƒd„Zdd
eiied„Zdd
eiidd„Zdfd„ƒYZdfd„ƒYZdefd„ƒYZdS(sx
M2Crypto.SSL.TwistedProtocolWrapper

Copyright (c) 2004-2005 Open Source Applications Foundation.
All rights reserved.
N(sProtocolWrapper(s
ITLSTransport(s
implements(sm2sX509(sCheckericCsdS(Ni((tpeerX509texpectedHost((tI/usr/lib64/python2.4/site-packages/M2Crypto/SSL/TwistedProtocolWrapper.pyt"_alwaysSucceedsPostConnectionChecksic	s:ti|ƒ}‡‡d†|_|i|||||ƒS(s~
    A convenience function to start an SSL/TLS connection using Twisted.
    
    See IReactorSSL interface in Twisted. 
    cs%t||dddddˆdˆƒS(NtstartPassThroughitclientitcontextFactorytpostConnectionCheck(tTLSProtocolWrappertfactorytwrappedProtocolRR(R	R
(RR(Rt<lambda>#s
N(tpoliciestWrappingFactoryR	twrappingFactorytprotocoltreactort
connectTCPthosttportttimeouttbindAddress(	RRR	RRRRRR((RRRt
connectSSLscs7ti|ƒ}‡d†|_|i|||||ƒS(s¶
    A convenience function to start a TCP connection using Twisted. 

    NOTE: You must call startTLS(ctx) to go into SSL/TLS mode.

    See IReactorTCP interface in Twisted. 
    cs%t||dddddddˆƒS(NRiRRR(RR	R
tNoneR(R	R
(R(RR8s
N(RR
R	RRRRRRRR(RRR	RRRRR((RRR-s	itcs7ti|ƒ}‡‡d†|_|i||||ƒS(s~
    A convenience function to listen for SSL/TLS connections using Twisted. 

    See IReactorSSL interface in Twisted. 
    cs%t||dddddˆdˆƒS(NRiRRR(RR	R
RR(R	R
(RR(RRKs
N(
RR
R	RRRt	listenTCPRtbacklogt	interface(RR	RRRRRR((RRRt	listenSSLBscs4ti|ƒ}‡d†|_|i||||ƒS(s¾
    A convenience function to listen for TCP connections using Twisted. 
    
    NOTE: You must call startTLS(ctx) to go into SSL/TLS mode.

    See IReactorTCP interface in Twisted. 
    cs%t||dddddddˆƒS(NRiRiRR(RR	R
RR(R	R
(R(RR`s
N(
RR
R	RRRRRRR(RR	RRRRR((RRRUs	t_SSLBioProxycBs2tZdZeiZd„Zd„Zd„ZRS(s
    The purpose of this class is to eliminate the __del__ method from
    TLSProtocolWrapper, and thus letting it be garbage collected.
    cCs
||_dS(N(tsslBiotself(RR((Rt__init__rscCs|iS(N(RR(R((Rt_ptruscCs(|idj	o|i|iƒndS(N(RRRtm2_bio_free_all(R((Rt__del__xs(	t__name__t
__module__t__doc__tm2tbio_free_allR"R R!R#(((RRjs
			t	_SSLProxycBs2tZdZeiZd„Zd„Zd„ZRS(s
    The purpose of this class is to eliminate the __del__ method from
    TLSProtocolWrapper, and thus letting it be garbage collected.
    cCs
||_dS(N(tsslR(RR*((RR …scCs|iS(N(RR*(R((RR!ˆscCs(|idj	o|i|iƒndS(N(RR*Rtm2_ssl_free(R((RR#‹s(	R$R%R&R'tssl_freeR+R R!R#(((RR)}s
			RcBsºtZdZeeƒd„Zd„Zd„Zd„Zd„Z	d„Z
d„Zd„Zd	„Z
d
„Zd„Zd„Zd
„Zd„Zd„Zddd„Zdd„ZRS(sä
    A SSL/TLS protocol wrapper to be used with Twisted. Typically
    you would not use this class directly. Use connectTCP, 
    connectSSL, listenTCP, listenSSL functions defined above,
    which will hook in this class.
    cCsto	dGHn||_||_d|_d|_d|_d|_||_	d|_
|djo
t
|_n
||_|p|i|iƒƒndS(sŽ
        @param factory:
        @param wrappedProtocol:
        @param startPassThrough:    If true we won't encrypt at all. Need to
                                    call startTLS() later to switch to SSL/TLS.
        @param client:              True if this should be a client protocol.
        @param contextFactory:      Factory that creates SSL.Context objects.
                                    The called function is getContext().
        @param postConnectionCheck: The post connection check callback that
                                    will be called just after connection has
                                    been established but before any real data
                                    has been exchanged. The first argument to
                                    this function is an X509 object, the second
                                    is the expected host name string.
        sTwistedProtocolWrapper.__init__RiN(tdebugR	RR
tdatat	encryptedt
tlsStartedtcheckedRtisClientt	helloDoneRRRRtstartTLSRt
getContext(RR	R
RRRR((RR šs 										

	cCs…to	dGHnt|ddƒo(d|_d|_d|_d|_nd|_d|_	d|_
d|_d|_d|_
dS(sI
        Clear this instance, after which it is ready for reuse.
        sTwistedProtocolWrapper.clearR0iRiN(R-tgetattrRRRR*tinternalBiot
networkBioR.R/R0R1R2R3(R((RtclearÉs				
					cCs¨|io
td‚nto	dGHn||_titiƒƒ|_ti	|idƒtitiƒƒ|_
ti	|i
dƒti|i|i
ƒttiti
ƒƒƒ|_tti|iiƒƒ|_|ioti|iiƒƒnti|iiƒƒti|iiƒ|i|iƒti|iiƒ|iiƒtiƒti|iiƒƒ}ti|iiƒ|tiBtiBƒd|_dS(sq
        Start SSL/TLS. If this is not called, this instance just passes data
        through untouched.
        sTLS already startedsTwistedProtocolWrapper.startTLSiiN(RR0t	ExceptionR-tctxR'tbio_newt	bio_s_bioR7tbio_set_write_buf_sizeR8tbio_make_bio_pairRt	bio_f_sslRR)tssl_newR*R2tssl_set_connect_stateR!tssl_set_accept_statetssl_set_biotbio_set_ssltbio_noclosetssl_get_modetmodetssl_set_modetSSL_MODE_ENABLE_PARTIAL_WRITEt#SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER(RR;RH((RR4Ýs,

		
"(cCs$to	dGHnti||ƒdS(Ns%TwistedProtocolWrapper.makeConnection(R-tProtocolWrappertmakeConnectionRt	transport(RRN((RRMs	cCs®to	dGHn|ipti||ƒdSny,|i|ƒ}ti||ƒd|_WnIt	i
ij
o7}t
i|iiƒƒ|idf|_|‚nXdS(NsTwistedProtocolWrapper.writeii(R-RR0RLtwriteR.t_encryptt
encryptedDataR3tM2CryptotBIOtBIOErrorteR'tssl_get_verify_resultR*R!targs(RR.RURQ((RRO
s	

(cCsUto	dGHn|ip!ti|di|ƒƒdSn|idi|ƒƒdS(Ns$TwistedProtocolWrapper.writeSequenceR(R-RR0RLt
writeSequencetjoinR.RO(RR.((RRXs	
cCs!to	dGHnti|ƒdS(Ns%TwistedProtocolWrapper.loseConnection(R-RLtloseConnectionR(R((RRZ's	cCs'to	dGHnti|||ƒdS(Ns'TwistedProtocolWrapper.registerProducer(R-RLtregisterProducerRtproducert	streaming(RR\R]((RR[-s	cCs!to	dGHnti|ƒdS(Ns)TwistedProtocolWrapper.unregisterProducer(R-RLtunregisterProducerR(R((RR^2s	cCs!to	dGHnti|ƒdS(Ns$TwistedProtocolWrapper.stopConsuming(R-RLt
stopConsumingR(R((RR_7s	cCsNto	dGHnti|ƒ|io#|io|io|iƒndS(Ns%TwistedProtocolWrapper.connectionMade(R-RLtconnectionMadeRR0R2R3t_clientHello(R((RR`<s
	
cCsþto	dGHn|ipti||ƒdSn|i|7_ymxf|iƒ}|i	ƒ|i
ƒ}ti||ƒti||ƒ|djo|djoPqGqGWWnIt
iij
o7}ti|iiƒƒ|idf|_|‚nXdS(Ns#TwistedProtocolWrapper.dataReceivediRi(R-RR0RLtdataReceivedR.R/t_decryptt
decryptedDatat_checkRPRQRORRRSRTRUR'RVR*R!RW(RR.RURdRQ((RRbCs&	

(cCs.to	dGHn|iƒti||ƒdS(Ns%TwistedProtocolWrapper.connectionLost(R-RR9RLtconnectionLosttreason(RRg((RRf_s	
cCsÓto	dGHn|io´ti|iiƒƒo›ti|iiƒƒ}|ot	i	|dƒ}nd}|io|i
id}n|i
iƒi}|i||ƒptid‚nd|_ndS(NsTwistedProtocolWrapper._checkiispost connection check(R-RR1R'tssl_is_init_finishedR*R!tssl_get_peer_certtxtX509tx509RR2RNtaddrRtgetPeerRtCheckertSSLVerificationError(RRlRRj((RRees	$
cCsto	dGHny/|iddƒ}ti||ƒd|_WnItii	j
o7}ti|i
iƒƒ|idf|_|‚nXdS(Ns#TwistedProtocolWrapper._clientHellotclientHelloii(R-RRPRQRLROR3RRRSRTRUR'RVR*R!RW(RRURQ((RRaws	
(RicCsî|i|7_ti|iiƒƒ}|djo|idjp|oCti|iiƒ|iƒ}|djoqŽ|i||_nd}xSti|iƒ}|o4ti|i|ƒ}|dj	o||7}qåq—Pq—W|S(NiRi(RR.R'tbio_ctrl_get_write_guaranteeRR!tgRqt	bio_writetrRQtbio_ctrl_pendingR8tpendingtbio_readtdR(RR.RqRyRsRuRQRw((RRP‡s&$

cCsç|i|7_ti|iƒ}|djoM|idjo=ti|i|iƒ}|djoq{|i||_nd}x_ti
|iiƒƒ}|o:ti|iiƒ|ƒ}|dj	o||7}qÞq„Pq„W|S(NiRi(RR/R.R'RrR8RsRtRuRdRvRR!RwRxRyR(RR.RyRsRdRuRw((RRc¡s$

(R$R%R&t
implementst
ITLSTransportR R9R4RMRORXRZR[R^R_R`RbRfReRaRPRc(((RRs&
	/		+													(R&ttwisted.protocols.policiest	protocolsRttwisted.internet.reactorttwistedRLttwisted.internet.interfacesR{tzope.interfaceRzRRR'RktM2Crypto.SSLRoR-RRtinternetRRRRRRR)R(RzRRRRRRRkR{RRoRLRRRR'R-RR)((Rt?s"	


	
	!!

Anon7 - 2021