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/Context.pyc
mò
låìPc@szdZdklZdkZdklZlZlZlZl	Z	l
Z
dfd„ƒYZd„Zdfd„ƒYZ
dS(	sRM2Crypto.SSL.Context

Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.(sWeakValueDictionaryN(sutilsBIOsErrsRSAsm2sX509t_ctxmapcBs2tZdZd„Zd„Zd„Zd„ZRS(NcCstƒ|_dS(N(tWeakValueDictionarytselftmap(R((t:/usr/lib64/python2.4/site-packages/M2Crypto/SSL/Context.pyt__init__
scCs|i|S(N(RRtkey(RR((Rt__getitem__scCs||i|<dS(N(tvalueRRR(RRR((Rt__setitem__scCs|i|=dS(N(RRR(RR((Rt__delitem__s(t__name__t
__module__tNonet	singletonRRR	R
(((RRs
			cCs'tidjotƒt_ntiS(N(RRR
(((RRstContextcBsJtZdZeiZdeed„Zd„Zd„Z	ee
id„Zee
id„Z
d„ZeZZeed„ZeZd	„Zd
„Zd„Zed„Zd
„Zd„Zd„Zed„Zd„Zed„Zeid„Zd„Z d„Z!d„Z"d„Z#d„Z$d„Z%d„Z&d„Z'd„Z(RS(s'Context' for SSL connections.tsslv23cCsÎtt|ddƒ}|djotd|‚nti|ƒƒ|_d|_	||_
|tƒt|iƒ<ti
|idƒ|djo9|djo|ititiBƒn|idƒndS(Nt_methodsno such protocol '%s'il€Rs!ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH(tgetattrtm2tprotocolR
tprotot
ValueErrortssl_ctx_newRtctxtallow_unknown_catpost_connection_checkRtlongtssl_ctx_set_cache_sizetweak_cryptotset_optionst
SSL_OP_ALLtSSL_OP_NO_SSLv2tset_cipher_list(RRRRR((RR%s
		

cCs+t|ddƒo|i|iƒndS(NR(RRR
tm2_ssl_ctx_freeR(R((Rt__del__4scCstƒt|iƒ=dS(N(RRRR(R((Rtclose8scCsnti|i|ƒti|i|ƒ|p
|}nti|i|ƒti	|iƒp
t
d‚ndS(swLoad certificate and private key into the context.
        
        @param certfile: File that contains the PEM-encoded certificate.
        @type certfile:  str
        @param keyfile:  File that contains the PEM-encoded private key.
                         Default value of None indicates that the private key
                         is to be found in 'certfile'.
        @type keyfile:   str

        @param callback: Callable object to be invoked if the private key is
                         passphrase-protected. Default callback provides a
                         simple terminal-style input for the passphrase.
        spublic/private key mismatchN(Rtssl_ctx_passphrase_callbackRRtcallbacktssl_ctx_use_certtcertfiletkeyfiletssl_ctx_use_privkeytssl_ctx_check_privkeyR(RR(R)R&((Rt	load_cert;s

cCsnti|i|ƒti|i|ƒ|p
|}nti|i|ƒti	|iƒp
t
d‚ndS(süLoad certificate chain and private key into the context.
        
        @param certchainfile: File object containing the PEM-encoded
                              certificate chain.
        @type  certchainfile: str
        @param keyfile:       File object containing the PEM-encoded private
                              key. Default value of None indicates that the
                              private key is to be found in 'certchainfile'.
        @type keyfile:        str  

        @param callback:      Callable object to be invoked if the private key
                              is passphrase-protected. Default callback 
                              provides a simple terminal-style input for the
                              passphrase.
        spublic/private key mismatchN(RR%RRR&tssl_ctx_use_cert_chaint
certchainfileR)R*R+R(RR.R)R&((Rtload_cert_chainQs
cCsti|i|ƒdS(s Load CA certs into the context. These CA certs are sent to the
        peer during *SSLv3 certificate request*.
        
        @param cafile: File object containing one or more PEM-encoded CA
                       certificates concatenated together.
        @type cafile:  str
        N(Rt$ssl_ctx_set_client_CA_list_from_fileRRtcafile(RR1((Rtset_client_CA_list_from_fileiscCs;|djo
|djp
td‚ti|i||ƒS(s¦Load CA certs into the context. These CA certs are used during
        verification of the peer's certificate.

        @param cafile: File containing one or more PEM-encoded CA certificates
                       concatenated together.
        @type cafile:  str
        @param capath: Directory containing PEM-encoded CA certificates
                       (one certificate per file).
        @type capath:  str
        scafile and capath are None.N(R1R
tcapathtAssertionErrorRtssl_ctx_load_verify_locationsRR(RR1R3((Rtload_verify_locationsvs
%cCs<ti|i|ƒ}|ptitiƒdƒ‚ndS(Nt(	Rtssl_ctx_set_session_id_contextRRtidtrettErrtSSLErrortget_error_code(RR9R:((Rtset_session_id_ctx‡scCs
||_dS(sÅSet the context to accept/reject a peer certificate if the 
        certificate's CA is unknown.

        @param ok:       True to accept, False to reject.
        @type ok:        boolean
        N(tokRR(RR?((Rtset_allow_unknown_caŒscCs|iS(svGet the context's setting that accepts/rejects a peer
        certificate if the certificate's CA is unknown.
        N(RR(R((Rtget_allow_unknown_ca•scCsQ|djoti|i|ƒnti|i||ƒti|i|ƒdS(s®
        Set verify options. Most applications will need to call this
        method with the right options to make a secure SSL connection.
        
        @param mode:     The verification mode to use. Typically at least
                         SSL.verify_peer is used. Clients would also typically
                         add SSL.verify_fail_if_no_peer_cert.
        @param mode:     int                 
        @param depth:    The maximum allowed depth of the certificate chain
                         returned by the peer.
        @type depth:     int
        @param callback: Callable that can be used to specify custom
                         verification checks.
        N(
R&R
Rtssl_ctx_set_verify_defaultRRtmodetssl_ctx_set_verifytssl_ctx_set_verify_depthtdepth(RRCRFR&((Rt
set_verify›s

cCsti|iƒS(N(Rtssl_ctx_get_verify_modeRR(R((Rtget_verify_mode°scCsti|iƒS(N(Rtssl_ctx_get_verify_depthRR(R((Rtget_verify_depth³scCs7ti|ƒ}ti|iƒƒ}ti|i
|ƒS(s»Load ephemeral DH parameters into the context.

        @param dhpfile: File object containing the PEM-encoded DH 
                        parameters.
        @type dhpfile:  str
        N(tBIOtopenfiletdhpfiletfRtdh_read_parameterstbio_ptrtdhptssl_ctx_set_tmp_dhRR(RRNRORR((Rt
set_tmp_dh¶scCs(|dj	oti|i|ƒndS(N(R&R
Rtssl_ctx_set_tmp_dh_callbackRR(RR&((Rtset_tmp_dh_callbackÁs
cCsAt|tiƒoti|i|iƒSntd|f‚dS(saLoad ephemeral RSA key into the context.

        @param rsa: M2Crypto.RSA.RSA instance.
        s(Expected an instance of RSA.RSA, got %s.N(t
isinstancetrsatRSARtssl_ctx_set_tmp_rsaRRt	TypeError(RRX((Rtset_tmp_rsaÅscCs(|dj	oti|i|ƒndS(N(R&R
Rtssl_ctx_set_tmp_rsa_callbackRR(RR&((Rtset_tmp_rsa_callbackÏs
cCsti|i|ƒdS(s
        Set a callback function that can be used to get state information
        about the SSL connections that are created from this context.
        
        @param callback: Callback function. The default prints information to
                         stderr.
        N(Rtssl_ctx_set_info_callbackRRR&(RR&((Rtset_info_callbackÓscCsti|i|ƒS(N(Rtssl_ctx_set_cipher_listRRtcipher_list(RRb((RR!ÝscCsti|i|iƒƒS(N(Rtssl_ctx_add_sessionRRtsessiont_ptr(RRd((Rtadd_sessionàscCsti|i|iƒƒS(N(Rtssl_ctx_remove_sessionRRRdRe(RRd((Rtremove_sessionãscCsti|iƒS(N(Rtssl_ctx_get_session_timeoutRR(R((Rtget_session_timeoutæscCsti|i|ƒS(N(Rtssl_ctx_set_session_timeoutRRttimeout(RRl((Rtset_session_timeoutéscCsti|i|ƒS(N(Rtssl_ctx_set_session_cache_modeRRRC(RRC((Rtset_session_cache_modeìscCsti|iƒS(N(Rtssl_ctx_get_session_cache_modeRR(R((Rtget_session_cache_modeïscCsti|i|ƒS(N(Rtssl_ctx_set_optionsRRtop(RRs((RRòscCstiti|iƒƒS(sÝ
        Get the certificate store associated with this context.
        
        @warning: The store is NOT refcounted, and as such can not be relied
        to be valid once the context goes away or is changed.
        N(tX509t
X509_StoreRtssl_ctx_get_cert_storeRR(R((Rtget_cert_storeõs()RRt__doc__Rtssl_ctx_freeR"R
RR#R$tutiltpassphrase_callbackR,R/R2tload_client_CAtload_client_caR6tload_verify_infoR>R@RARGRIRKRTRVR\R^tcbtssl_info_callbackR`R!RfRhRjRmRoRqRRw(((RRs>				
								

								(RxtweakrefRRtM2CryptoRzRLR;RYRRtRRR(RzR;RLRtRRRYRRRR((Rt?s
	+	

Anon7 - 2021