ok

Mini Shell

Direktori : /proc/self/root/lib64/python2.7/site-packages/M2Crypto/
Upload File :
Current File : //proc/self/root/lib64/python2.7/site-packages/M2Crypto/BIO.pyo

�

�1Mc@s�dZddlZddlmZddlmZdefd��YZeje�ddd��YZ	d	e	fd
��YZ
de	fd��YZd
d�Zde	fd��YZ
de	fd��YZde	fd��YZdS(scM2Crypto wrapper for OpenSSL BIO API.

Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.i����N(tbio_do_handshake(tStringIOtBIOErrorcBseZRS((t__name__t
__module__(((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyRstBIOcBs�eZdZejZdddd�Zd�Zd�Z	e	Z
d�Zd�Zdd�Z
dd	�Zd
d�Zd�Zd
�Zd�Zd�Zd�Zd�Zd�Zd�Zd�ZRS(s)Abstract object interface to the BIO API.icCs1||_||_||_d|_d|_dS(Ni(tbiot_pyfreet	_close_cbtclosedtwrite_closed(tselfRRR((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyt__init__s
				cCs |jr|j|j�ndS(N(Rtm2_bio_freeR(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyt__del__s	cCs|jS(N(R(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyt_ptr!scCstj|j�S(N(tm2t
bio_get_fdR(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytfileno'scCs|jS(N(R	(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytreadable*scCs�|j�std�n|dkrit�}x/tj|jd�}|sOPn|j|�q0|j�S|dkrydS|dkr�t	d�ntj|j|�SdS(Nscannot readiitsread count is negative(
RtIOErrortNoneRRtbio_readRtwritetgetvaluet
ValueError(Rtsizetbuftdata((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytread-s	
icCs1|j�std�ntj|j|�}|S(Nscannot read(RRRtbio_getsR(RRR((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytreadline>stignoredcCsZ|j�std�ng}x5tj|jd�}|dkrFPn|j|�q!|S(Nscannot readi(RRRRRRtappend(RtsizehinttlinesR((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyt	readlinesDscCs|jo|jS(N(R	R
(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyt	writeableOscCs+|j�std�ntj|j|�S(Nscannot write(R&RRt	bio_writeR(RR((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyRRscCs
d|_dS(Ni(R
(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytwrite_closeWscCstj|j�dS(N(Rt	bio_flushR(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytflushZscCstj|j�S(s3
        Sets the bio to its initial state
        (Rt	bio_resetR(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytreset]scCs#d|_|jr|j�ndS(Ni(R	R(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytclosecs		cCstj|j�S(si
        Can the call be attempted again, or was there an error
        ie do_handshake 
       
        (Rtbio_should_retryR(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytshould_retryhscCstj|j�S(se
        Returns whether the cause of the condition is the bio
        should read more data
        (Rtbio_should_readR(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytshould_readpscCstj|j�S(sf
        Returns whether the cause of the condition is the bio
        should write more data
        (Rtbio_should_writeR(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytshould_writewsN(RRt__doc__Rtbio_freeR
RRRRtbio_ptrRRRR R%R&RR(R*R,R-R/R1R3(((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyRs(													tMemoryBuffercBsHeZdZdd�Zd�Zdd�ZeZZd�Z	e	Z
RS(sw
    Object interface to BIO_s_mem. 
    
    Empirical testing suggests that this class performs less well than cStringIO, 
    because cStringIO is implemented in C, whereas this class is implemented in 
    Python. Thus, the recommended practice is to use cStringIO for regular work and 
    convert said cStringIO object to a MemoryBuffer object only when necessary.
    cCsTtj|�tjtj��|_d|_|dk	rPtj|j|�ndS(Ni(	RRRtbio_newt	bio_s_memRRRR'(RR((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR�s

	cCstj|j�S(N(Rtbio_ctrl_pendingR(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyt__len__�sicCsT|j�std�n|r1tj|j|�Stj|jtj|j��SdS(Nscannot read(RRRRRR:(RR((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR�s
cCs d|_tj|jd�dS(Nii(R
Rtbio_set_mem_eof_returnR(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR(�s	N(RRR4RRR;RRtread_allR(R-(((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR7~s			
	tFilecBs#eZdZdd�Zd�ZRS(s�
    Object interface to BIO_s_fp. 
    
    This class interfaces Python to OpenSSL functions that expect BIO *. For
    general file manipulation in Python, use Python's builtin file object.
    icCs>tj|dd�||_||_tj|d�|_dS(NRii(RRtpyfiletclose_pyfileRt
bio_new_fpR(RR?R@((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR�s		cCs&d|_|jr"|jj�ndS(Ni(R	R@R?R-(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR-�s		(RRR4RR-(((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR>�strbcCstt||��S(N(R>topen(tfilenametmode((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytopenfile�stIOBuffercBsAeZdZejZejZddd�Zd�Z	d�Z
RS(s�
    Object interface to BIO_f_buffer. 
    
    Its principal function is to be BIO_push()'ed on top of a BIO_f_ssl, so
    that makefile() of said underlying SSL socket works.
    trwbicCswtj|d|�tjtj��|_tj|j|j��|_||_	d|krjd|_
n	d|_
dS(NRtwii(RRRR8tbio_f_buffertiotbio_pushRRt
_under_bioR
(Rt	under_bioRER((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR�s	cCs9t|dd�r%|j|j�n|j|j�dS(NRi(tgetattrt
m2_bio_popRR
RK(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR�scCstj|�dS(N(RR-(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR-�s(RRR4Rtbio_popRPR5R
RRR-(((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyRG�s			tCipherStreamcBsVeZdZejZejZejZ	d�Z
d�Zd�Zd�Z
d�ZRS(s+
    Object interface to BIO_f_cipher.
    cCsAtj|dd�||_tjtj��|_d|_dS(NRii(RRtobioRR8tbio_f_cipherRR	(RRS((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR�s	cCs#t|dd�s|j�ndS(NR	i(ROR-(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR�scCs-|j|j�|j|j�d|_dS(Ni(RPRR
R	(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR-�scCs|jj�dS(N(RSR((R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR(�scCsott|d�}|dkr0td|f�ntj|j|�|||�tj|j|jj��dS(Nsunknown cipher(	RORRRtbio_set_cipherRRLRSR(Rtalgotkeytivtoptcipher((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyt
set_cipher�s
(RRR4RtPKCS5_SALT_LENtSALT_LENRQRPR5R
RRR-R(R[(((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyRR�s							tSSLBiocBs2eZdZdd�Zejd�Zd�ZRS(s(
    Object interface to BIO_f_ssl 
    icCs5tj||�tjtj��|_d|_dS(Ni(RRRR8t	bio_f_sslRR	(RR((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyRscCsHd|_tj|j|j|�|tjkrD|jtj�ndS(sh
        Sets the bio to the SSL pointer which is
        contained in the connection object.  
        iN(RRtbio_set_sslRtssltbio_noclosetset_ssl_close_flagt	bio_close(Rtconnt
close_flag((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytset_ssls	cCstj|j�S(s�
        Do the handshake.
        
        Return 1 if the handshake completes
        Return 0 or a negative number if there is a problem
        (RRR(R((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pytdo_handshakes(RRR4RRRbRgRh(((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyR^s
((R4RRtbio_do_ssl_handshaket	cStringIORt	ExceptionRtbio_initRR7R>RFRGRRR^(((s2/usr/lib64/python2.7/site-packages/M2Crypto/BIO.pyt<module>s
n' %

Zerion Mini Shell 1.0