M2Crypto-0.31.0/0000755000175000001440000000000013371124434013533 5ustar matejusers00000000000000M2Crypto-0.31.0/.gitignore0000644000175000001440000000024113305463044015520 0ustar matejusers00000000000000*.pyc *~ /build /dist /M2Crypto/*_m2crypto*.so /M2Crypto.egg-info /.eggs/ /EGG-INFO /tests/randpool.dat /tests/sig.p7 /tests/sig.p7s /tests/tmpcert.der MANIFEST M2Crypto-0.31.0/.gitlab-ci.yml0000644000175000001440000000460113371123417016170 0ustar matejusers00000000000000.python26: image: yarara/python-2.6.9:v1 when: always script: - python setup.py clean build test centos6: image: centos:6 when: always script: - yum upgrade -y - yum groupinstall -y "Development tools" - yum install -y https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm - yum install -y python-devel openssl-devel openssl python-setuptools python-twisted python-unittest2 - python setup.py clean build test python27: image: python:2.7 when: always script: - apt-get update -q -y - apt-get install -y swig libssl1.0-dev python-dev openssl python-twisted python-setuptools - python setup.py clean build test python34: image: python:3.4 when: always script: - echo 'deb http://ftp.debian.org/debian jessie-backports main' > /etc/apt/sources.list.d/backports-jessie.list - apt-get update -q -y - apt-get install -y swig libssl-dev python3-dev openssl python3-setuptools python3-twisted - python3 setup.py clean build test python3: image: python:3 when: always script: - echo 'deb http://ftp.debian.org/debian jessie-backports main' >/etc/apt/sources.list.d/backports-jessie.list - apt-get update -q -y - apt-get install -y swig libssl-dev python3-dev openssl python3-setuptools python3-twisted - python3 setup.py clean build test fedora: image: fedora:26 when: always script: # - dnf upgrade --refresh -y - dnf install --refresh -y @development-tools fedora-packager rpmdevtools - dnf install -y swig python-devel openssl-devel openssl python-setuptools python-twisted - python setup.py clean build test fedora3: image: fedora:26 when: always script: # - dnf upgrade --refresh -y - dnf install --refresh -y @development-tools fedora-packager rpmdevtools - dnf install -y swig python3-devel openssl-devel openssl python3-setuptools python3-twisted - python3 setup.py clean build test opensuse: image: opensuse/tumbleweed when: always script: - zypper refresh - zypper install -y pattern:devel_rpm_build pattern:devel_C_C++ osc - zypper install -y swig python3-devel libopenssl-1_1-devel python3-service_identity python3-setuptools python3-Twisted - python3 setup.py clean build test M2Crypto-0.31.0/.travis.yml0000644000175000001440000000077513355123234015654 0ustar matejusers00000000000000language: python addons: apt: packages: - swig - libssl-dev - libssl1.0.0 - python-setuptools - python-twisted sudo: false python: - "2.6" - "2.7" - "3.4" - "3.5" - "3.6" - "3.7" - "nightly" matrix: allow_failures: - python: "3.7" - python: "nightly" install: - if [[ $TRAVIS_PYTHON_VERSION == '2.6' ]]; then travis_retry pip install Twisted==15.0.0 ; else travis_retry pip install Twisted ; fi - python setup.py install script: python setup.py test M2Crypto-0.31.0/CHANGES0000644000175000001440000006632613371124050014535 0ustar matejusers000000000000000.31.0 - 2018-11-08 ------------------- - Compatibility with OpenSSL 1.1.1 (partly workaround, maybe requires further investigation) - Fixes for Windows builds - Fixes of installs on AWS Lambda - Fixes of Mac OS X related failures - Fix Python 2.6 compatibility issues 0.30.1 - 2018-04-29 ------------------- - Fix packaging (missed packaging testing file) 0.30.0 - 2018-04-25 ------------------- - Various small typos (Windows builds, Fix SSL.Connection.__del__) - The project is now Linux-distribution agnostic - Replace all old-style classes with the new ones (it shouldn't cause any problems, but feel free to file an issue, if it does) - Do not by-pass a potential transfer decoding in m2urllib2 - Update M2Crypto.six with 1.11.0 and replace our local workarounds with new functions. - SSLv3 just removed. - Don't support Python 2.6 on Windows anymore. Windows users don't have python as a system package, so they are usually more likely to upgrade anyway. 0.29.0 - 2018-02-23 ------------------- - Fix building on Windows (all tests fix on Win32 and Win64 on all supported combinations of versions of OpenSSL and Python) - Fixes of some small bugs 0.28.0 - 2018-02-08 ------------------- - Mainly port to Python 3 (supporting 2.6, 2.7, 3.3, 3.4, 3.5, 3.6) - Some lame efforts to make setup.py build --openssl work better (needs more real testing on Mac OS X) - Fix licence: it is MIT, not BSD - Fix and add tests for SWIG/_aes.i module - Improve somehow situation on Mac OS X (some testing, improve setup.py, testsuite should fully pass) - Bundle-in unittest2 for Python 2.6 (dealing with the need for specific version of unittest2 package was too complicated) - Remove all PGP modules 0.27.0 - 2017-10-05 ------------------- - Fix licence: it is MIT, not BSD - At least minimal support of SNI in httpslib. - Small bugfixes and cleanups. - More effort to make build system more robust (now should work even on Debian LTS). - Restore m2.rsa_set_e() and m2.rsa_set_n(). - Make sure that every exceptional return throws and exception and vice versa. 0.26.4 - 2017-09-26 ------------------- - Proper fix of deprecation warning for OpenSSL 1.1.0 - Small mostly stylistic bugfixes - Emergency release to fix FTBFS. 0.26.3 - 2017-09-22 ------------------- - Fix a syntax typo. 0.26.2 - 2017-09-20 ------------------- - port to support OpenSSL 1.1.0 API - add generated Sphinx documentation - another set of cleanups 0.26.0 - 2017-03-21 ------------------- - Fix packaging on RHEL-6 - Replace ASN1_UTCTIME with ASN1_TIME which supports both UTCTime and GeneralizedTime - Add possibility to sign PKCS7 with a non-default digest. - Add possibility to set custom callback for X509 verification. - Clean up imports and PEP8ization - A lot of cleanups on the way towards Python 3 - Other small bugfixes 0.25.1 - 2016-07-25 ------------------- - Actually do check, whether we have SSLv2 compiled in, and don't run test for it. 0.25.0 - 2016-03-21 ------------------- - More cleanups, removal of obsolete stuff, and moves towards py3k compatibility. - Add support for EC.get_builtin_curves() and use it for testing. - Enable AES CTR mode - Bundle-in six module v. 1.10.0 - add rand_file_name and rand_status - remove all LHASH fiddling - Extend Travis and GitLab CI configuration to test also py3k (with allowed_failures) and CentOS6 (on GitLab CI). - Add CONTRIBUTORS.rst. Thank you! - Add PEP-484 type hints in comments to all Python files (except for tests) - Use context managers for file handling wherever possible instead of leaking open file descriptors. - Improve defaults handling for SSL_CTX_new(). - Fix PGP tests to actually run 0.24.0 - 2016-03-21 ------------------- - More cleanups, removal of obsolete stuff, and moves towards py3k compatibility. - Add DSA.pub_key_from_params() factory function (and m2.dsa_set_pub()). - Allow import/export of EC public key with binary values - Add EVP.load_key_string_pubkey() function, as well as helper functions - Add EVP.get_digestbyname() functionality. - Convert documentation to rST (and add instructions for building on Mac OS X) - Another round of fixing multiarch building. - Disable tests with weak ciphers on some platforms (Debain) 0.23.0 - 2016-01-29 ------------------- - Add Travis and GitLab CI configurations - Allow building without SSLv2 - More cleanups and removing obsolete code - Fix README - Fix buffer overflow in pkcs5_pbkdf2_hmac_sha1 - First moves towards Python 3 compatibility - Removed rather large and completely unmaintained demo/ subdirectory (now in a separate repo https://gitlab.com/m2crypto/m2crypto_demo) - Automatically generated test data files - Finally fix building on multiarch systems - All objects derived from BIO.BIO now could work as context managers - Switch setup.py to setuptools 0.22.5 - 2015-10-13 ------------------- - Add forgoteen SWIG/*.h among distributed files. 0.22.4 - 2015-10-13 ------------------- - Matěj Cepl takes over leadership of the upstream maintenance - Fedora/RHEL distribution patches merged to the main development (mainly, but not only, upgrading to the more recent versions of OpenSSL, swig which is now at 3.0.5, but anything above 2.0.4 is supported as well, and python which now has to be at least 2.6). - Tons of cleaning up the code for obsolete constructs, PEP8ization, etc. 0.22.3 - 2014-01-22 ------------------- (released by Martin Paljak, later development started on top of 0.21.1 with his improvements cherry picked to the new development branch) 0.21.1 - 2011-01-15 ------------------- - Distribution fix 0.21 - 2011-01-12 ----------------- - Support OpenSSL 1.0. Thanks to Miloslav Trmac for figuring out how to fix test_smime.py - Rename m2.engine_init to engine_init_error so that ENGINE_init and ENGINE_finish can be exposed, thanks to Erlo - 0.20 started releasing Python locks even around some operations that interacted with the Python runtime, potentially causing crashes and other weirdness, fix by Miloslav Trmac - Make httpslib.ProxyHTTPSConnection work with Python 2.3 0.20.2 - 2009-10-06 ------------------- - (Re)Enable configuration and use with OpenSSL 0.9.7g and older by disabling RSA PSS methods when using such old OpenSSL, thanks to Stef Walter 0.20.1 - 2009-08-27 ------------------- - Fix regression in httpslib.ProxyHTTPSConnection, by Miloslav Trmac 0.20 - 2009-08-10 ----------------- - Deprecated M2Crypto.PGP subpackage since nobody seems to be using it nor is it being maintained (if you do use it, please let me know) - Added fedora_setup.sh to help work around differences on Fedora Core -based distributions (RedHat, CentOS, ...); thanks to Miloslav Trmac - Added X509.load_request_bio and load_request_string, by Hartmut Goebel and Pavel Shramov - Added alias X509.Request.set_subject for set_subject_name to match X509.X509, by Pavel Shramov - OBJ_* wrappers did not work properly with OpenSSL 0.9.8a and earlier, fix by Pavel Shramov - Added ASN1_UTCTIME.get_datetime and set_datetime, by Pavel Shramov - Fixed obj_obj2txt, which returned nonsense, fix by Barney Stratford - m2urllib did not close sockets properly, fix by Miloslav Trmac - Allow SSL peer certificate to have subjectAltName without dNSName and use commonName for hostname check, fix by Miloslav Trmac - threading_locking_callback did not block on a lock when the lock was held by another thread, by Miloslav Trmac - Allow more blocking OpenSSL functions to run without GIL, by Miloslav Trmac - Fixed httpslib to send only the path+query+fragment part of the URL when using CONNECT proxy, by James Bowes - SSLServer.__init__ now takes optional bind_and_activate parameter and initializes by calling SocketServer.BaseServer.__init__, which are Python 2.6 compatibility fixes, by Christian - ftpslib now works with Python 2.6, by Theodore A. Roth - httpslib.ProxyHTTPSConnection needs to cast port into integer, by John M. Schanck - Added support for RSASSA-PSS signing and verifying, by Chris Collis - Added support for disabling padding when using RSA encryption, by Chris Collis - ASN1_INTEGERs can now be larger than fits in an int, for example to support X509 certificates with large serial numbers, patch by Mikhail Vorozhtsov and testcase by Barry G. - Reverted a change done in 0.17 to m2urllib2 which changed urls to include host when it should stay as it was - httpslib no longer uses urllib; instead it uses urlparse for url parsing - SMIME.text_crlf and text_crlf_bio were always raising TypeError; fixed - EVP.load_key and load_key_bio fixed to raise EVP.EVPError and BIO.BIOError instead of str (str exceptions not allowed in Python 2.6 and later) - SSL.Session.load_session fixed to raise SSL.SSLError instead of str - SMIME.load_pkcs7, load_pkcs7_bio, smime_load_pkcs7, smime_load_pkcs7_bio, text_crlf, text_crlf_bio fixed to raise BIO.BIOError, SMIME.PKCS7_Error and SMIME.SMIME_Error as appropriate instead of str - Added FIPS mode to unit tests, and used FIPS-compliant key sizes in other tests, by Miloslav Trmac. Note that tests run much slower because of this! - Unit tests cover 80% of the code 0.19.1 - 2008-10-12 ------------------- - Re-enable building when OpenSSL built without EC support, by Miloslav Trmac - Remove shebang from Engine.py since it is not executable, by Miloslav Trmac 0.19 - 2008-10-05 ----------------- - OpenSSL OBJ_* functions wrapped by Pavel Shramov - OpenSSL ENGINE interface wrapped, providing support for smart cards, by Martin Paljak and Pavel Shramov - EVP.PKey.get_rsa() now returns RSA_pub, which fixes segmentation fault when trying to encrypt using public key from X509 certificate, by Ben Timby - httpslib.ProxyHTTPSConnection now sends the required Host header, by Karl Grindley - Use the proxied User-Agent value in CONNECT requests, by James Antill and Miloslav Trmac - Fixed m2urllib.build_opener when optional handlers were in use, affected Python 2.5 and later, by Miloslav Trmac - Reverted the incorrect GIL change done in 0.18 to m2.passphrase_callback, which caused a deadlock when called from mod_python for example. Thanks to Michal Kochel and Keith Jackson. - SSL.Connection.accept() passed wrong certificate to postConnectionCheck callback - httpslib.HTTPSConnection now raises ValueError for illegal keyword argument - m2.pkey_write_pem[_no_cipher] changed to use the recommended (more secure) PEM_write_bio_PKCS8PrivateKey (used by PEM_write_bio_PrivateKey). - X509.load_cert, load_cert_bio, load_cert_der_string, new_stack_from_der, load_request and load_crl now raise X509Error for invalid data. Previously some of these raised a string as an error, some did not raise but caused strange errors later, for example x509.verify() would return -1. - Fixed SSL.Connection.get_socket_read_timeout and set_socket_read_timeout on 64bit platforms by adding SSL.timeout.struct_size() and using it instead of hardcoded size for socket.getsockopt - X509_Store.load_info now returns the value from the underlying m2.x509_store_load_locations call, and in case of error raises X509Error - Fixed SMIME.verify to raise the correct PKCS7_Error (used to raise SMIME_Error) when verification fails with Python 2.6 0.18.2 - 2007-10-12 ------------------- - typedef Py_ssize_t was insufficiently guarded, now follows PEP 353. This prevented building on at least Red Hat Linux and Debian Linux (unstable). 0.18.1 - 2007-10-08 ------------------- - Redo build fix when OpenSSL configured without Elliptic Curves (EC), see also INSTALL file 0.18 - 2007-07-26 ----------------- - Added EVP.pbkdf2 to derive key from password - X509_Store_Context.get1_chain added - Added X509_Name.__iter__, __getitem__, get_entries_by_nid which allow iterating over all X509_Name_Entries or getting just all commonName entries, for example - Added X509_Name_Entry.get_object, get_data, set_data - Added back PKCS7.get0_signers (was removed in 0.16) - X509_Extension.get_value accepts flag and indent parameters. - support multiple dNSName fields in subjectAltName - support multiple commonName fields for SSL peer hostname checking - Checking for erroneous returns from more OpenSSL EVP_* functions, which means that certain things that used to fail silently will now raise an EVP.EVPError; affected m2 functions are: digest_final, cipher_init, cipher_update, cipher_final and sign_update. sign_final will now raise EVP.EVPError instead of SystemError as well. - Fixed Pkey.verify_final to take a sign parameter - If a subjectAltName extension of type dNSName is present in peer certificate, use only the dNSNames when checking peer certificate hostname, as specified by RFC 2818. If no dNSNames are present, use subject commonName. - Fixed memory leaks in m2 functions ec_key_new_by_curve_name, pkey_get_modulus, ecdsa_verify, threading_init and X509.X509.verify, X509.X509_Stack (which manifested for example when calling X509.new_stack_from_der), SSL.Connection (which manifested with some connection errors or when connect was never called), twisted wrapper, SSL.Connection.makefile (in BIO.IOBuffer really) - Fixed threading regressions introduced in 0.16, by Aaron Reizes and Keith Jackson - Added SSL session caching support to HTTPSConnection, by Keith Jackson - Added the ability to save and load DER formatted X509 certificates and certificate requests, by Keith Jackson - m2xmlrpclib.py fixed to work with Python 2.5, by Miloslav Trmac - 64-bit correctness fixes, by Miloslav Trmac - Added X509_Name.as_hash, by Thomas Uram - Moved --openssl option from general setup.py option to build_ext option, meaning you need to do: python setup.py build build_ext --openssl=/path, by Philip Kershaw - Fixed build problem affecting certain systems where OpenSSL was built without EC support - M2CRYPTO_TEST_SSL_SLEEP environment variable controls how long to sleep after starting the test SSL server. Default is 0.5, but 0.1 or even 0.05 might work with modern computers. Makes tests finish significantly faster. 0.17 - 2006-12-20 ----------------- - setup.py has new test command to run unit tests (requires setuptools) - Added m2urllib2, by James Bowes (python 2.4 and later, at least for now) - Added CONNECT proxy for httpslib and m2urllib2, by James Bowes - Added PKey.get_modulus, X509.get_fingerprint, X509_Name.as_der and m2.bn_to_hex, by Thomas Uram - Prevent Connection.makefile from freeing bio redundantly, by Thomas Uram - Added Err.peek_error_code, by Thomas Uram - Fixed m2urllib.open_https to return the response headers, otherwise code that relied on that would break (for example msnlib-3.5), by Arno bakker - Fixed twisted wrapper to work with >16kb BIO buffers, by Martin Paljak - Added support for remaining ECs, by Larry Bugbee - Fixed DSA.save_key and DSA_.save_pub_key, by Larry Bugbee - SSL.Context.load_verify_locations raises ValueError if cafile and capath are both None - Fixed X509.check_purpose() (was always raising exceptions) - smime_read_pkcs7 was changed to automatically call BIO_set_mem_eof_return on memory BIOs because otherwise the read would fail with "SMIME_Error: not enough data" - X509.new_extension('subjectKeyIdentifier', 'hash') raises ValueError instead of crashing Python 0.16 - 2006-07-05 ----------------- - Minimum requirements updated: Python 2.3+, OpenSSL 0.9.7+, SWIG 1.3.24+ - Optional features from OpenSSL 0.9.8 and newer - Enhancements to EVP and X509 to allow proxy certificate handling, by Matt Rodriguez - SSLBio and related additions to help do SSL with BIOs directly, by Matt Rodriguez - Added --openssl option to build command which can be used to specify where OpenSSL is installed, by Matt Rodriguez - Added sign and verify to RSA class, and get_rsa to PKey class, by Matt Rodriguez - ECDSA signatures and ECDH key agreement, requires OpenSSL 0.9.8+, by Arno Bakker - Fix non-hashable type problems in SSL._ctxmap and users, by Michael Weiser - Fixed SSLServer.handle_error to take the correct number of arguments, by Dan Williams - Various DSA enhancements by Larry Bugbee - Added sha224, sha256, sha384 and sha512, by Larry Bugbee - Added serialNumber, SN, surname, GN and givenName fields to X509_Name, by Martin Paljak - m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT is the fourth certificate verification error that will be allowed when unknown CAs are allowed - post connection checks in Connection.accept() and connect() fixed (these were broken in 0.15) - Fixed EVP.Cipher to work with aes_* ciphers (used to crash Python). The actual problem was in m2.bytes_to_key. - SMIME methods and functions raise correct exceptions - Raise ValueError instead of AttributeError when a non-existing hash algorithm or SSL version is asked for - ssl_ctx_set_tmp_(dh|rsa) now return value, and the rsa version calls the rsa function instead of the dh function - digest_update and verify_update return type changed to int, which allows better error reporting; EVP.MessageDigest.update and EVP.PKey.verify_update likewise changed - X509_Name and ASN1_String as_text (new for ASN1_String) take optional parameters to control formatting. - Cipher_Stack, X509_Stack and X509_Extension_Stack are iterable - EVP.MessageDigest now properly cleans up the underlying data when the object gets deleted - It is now possible to set and get non-nid values to X509_Name (previously only set worked) - SSL.Connection.set_client_CA_list_from_file now uses the actual implementd function instead of raising exception - Multithreaded SSL no longer uses the SSL_set/get_app_data to set and restore thread state, but uses the standard PyGILState_STATE instead. - m2urllib no longer outputs the HTTP headers (there was an erronous call to set_debuglevel(1)) - Removed RCS_id, RCS_ID and _RCS_id from Python files - All known memory leaks fixed - SWIG and compiler warning fixes - More and better Epydoc formatted docstrings - More than doubled the number of unit tests, also made many demos into tests 0.15 - 2005-08-17 ----------------- - Support OpenSSL 0.9.8, Python 2.4.1, SWIG 1.3.24 - Fixed multiple memory leaks - Twisted integration - Safer defaults for SSL context and post connection check for clients - Eliminated C pointers from interfaces (some may still remain in callbacks) - Many cases where Python interpreter crashed have been fixed - Improved thread safety of many callbacks - And of course more of the OpenSSL API is covered, new docstrings and tests have been written Changes since 0.13 -------------------- - Fixed memory leak due to circular reference in SSL.Connection. Thanks to Michael Dunstan. Oops, patch is ZServerSSL-specific. Andre Reitz provided a generalised fix. Thanks Andre. - Fixed __getattr__ error in DSA. Thanks to Igor Belyi. - Added rand_poll, rand_screen and rand_win32_event functions to M2Crypto.Rand. - Updated ZServerSSL files to match Zope 2.7.0 versions. - Integrated (overlapping) patches by Peter Teniz and Heikki Toivonen covering operations on X.509-related structures that gives M2Crypto PKI functionality. Thanks Peter and Heikki. - Peter Teniz contributed demo2004/pki/x509auth.py. - Created demo2004/ directory that will contain new or updated demos. - Added verify_[init|update|final] in _evp.i. Patch by Zachery Corbiere. Thanks Zac. Changes since 0.12/0.11 ------------------------- - Patches from Artur Frysiak . Thanks Artur. = Allow using a passphrase callback in class SMIME. = Added method get0_signers to class PKCS7, which retrieves signers' certificates from a PKCS7 blob. = Added methods as_pem and save_pem to class X509. = Added file version.py. = Allow SSL.Context.load_verify_locations to accept both 'cafile' and 'capath'. - Fixed BIO.read() not reading until EOF. Thanks to Egil Muller for suggestion. - Honour 'mode' parameter in SSL.Connection.makefile. Thanks again to Egil Muller. - Roger Binns contributed epydoc-generated docs for M2Crypto. Thanks Roger. - Peter Teniz contributed patches to create X.509 requests and certificates. Thanks Peter. - Updated Medusa to 0.54. - Make various OpenSSL bignum functions (written long ago) available to Python. Changes since 0.11 -------------------- - ZServerSSL with client certificate-based authentication rides again. - Created Makefile for Python 2.3. - Modified LICENCE: changed my name to the generic "the author" in the all-caps disclaimer paragraph. - Allow to save RSA key pair in the clear. - ZServerSSL for Zope 2.7. - Excluded RC5. IDEA was taken out several releases ago. This should allow M2Crypto to build with stock OpenSSL on various Linuxen. - Added ssl_set_tmp_dh_callback. - Added ssl_set_tmp_rsa and ssl_set_tmp_rsa_callback to support weak-cipher browsers. - ZServerSSL exports SSL_CIPHER request header (a la mod_ssl) to Zope applications. - Perform distutils's SWIG .i search path tweaking within setup.py. setup.py should now work "out of the box". - Added contrib/smimeplus.py, a high-level S/MIME interface, contributed by Bernard Yue . Thanks Bernard. - Added in long forms of nid's in X509_Name. Thanks to William K Volkman for patch. - Updated Mac OS X build instructions. Thanks to Larry Bugbee Changes since 0.10 -------------------- - Dave Berkeley contributed fixes to SSL.Context-related memory leaks and code to set the size of the SSL session cache. - Brent Chun contributed the following: + Fixes to memory leaks. + Code to expose X.509 certificate chain operations. + Code to expose set/get operations on the SSL session cache. - Changed swig/ to SWIG/, for the convenience of people who don't read INSTALL. Some Makefiles may break because of this. setup.py continues to work, of course. - ZServerSSL tested with Zope 2.6.1. There is now a HOWTO. - Updated README and INSTALL. - Filled doc/ with stuff that went missing in several past releases. Changes since 0.09 -------------------- - Updated to OpenSSL 0.9.7. Thanks to Toby Allsopp for patches. - Added functionality to create a basic certificate request. Also contributed by Toby Allsopp. - Finally, AES! Changes since 0.08 -------------------- - Replaced demo/Zope/ZServer/__init__.py with the correct version for Zope 2.6.0. - Added a sample starts.bat for ZServerSSL. - Incoporated a patch by prashanth@jibe.biz that handled the new-in-Python-2.2.2 "strict" parameter for the various HTTP[S] connection classes in httplib.py. Thanks prashanth. This fixes M2Crypto's XMLRPC support for Python 2.2.2. (Apparently it was working for Python 2.2.1.) - Incorporated some cosmetic patches from Adam Karpierz . Thanks Adam. Changes since 0.07 snapshot #3 -------------------------------- - Updated to SWIG 1.3.17. - Excluded IDEA. - Tested with OpenSSL 0.9.6h. - ZServerSSL rides again for Zope 2.6.0. - setup.py does! - Removed Makefiles for Windows and Unix. (Makefile.osx remains.) - Included in contrib/ Isaac Salzberg's application of Mihai Ibanescu's patch that allows IIS interoperability thru an authenticating proxy. Thanks Isaac. - Included in contrib/ patch by Dave Brueck that has smarter non-blocking behaviour. Thanks Dave. Changes since 0.06 ----------------------- - test_ssl_win.py. (Requires Mark Hammond's Win32 extensions.) - Renamed demo/https to demo/medusa; updated Medusa to 2001 Jun release. - Improved _ssl.i's and M2Crypto.SSL.Connection's accept/connect methods. - M2Crypto.ftpslib for client-side FTP/TLS. - demo/medusa/ftps_server.py for server-side FTP/TLS. - Improved thread-safety. - Cleaned up echo client and servers. - Fixed missing import in m2urllib. - Fixed m2urllib to handle HTTP redirects. - Python 2.2 compatibility. - AuthCookie - secure authenticator cookies. Changes since 0.05 ----------------------- - Handled the cases where Python callbacks raised exceptions. - Fixed a NULL-deref bug in _ssl.i which crashes Medusa https when IE or Opera comes a-calling. - ZServerSSL rides again - a more robust ZServerSSL for Zope 2.3.0. - Added the MIME type 'application/x-x509-ca-cert' to demo/ssl/https_srv.py. This facilitates installing self-generated certificates into your browser. - ZSmime and GuardedFile bundled. - Documentation! A HOWTO on operating your own CA. - Documentation! A HOWTO on S/MIME. Examples are in demo/smime.howto. - Python 2.1 compatibility. - Fixed demo/https/https_server.py's CPU-spinning. (As per ZServerSSL.) - Fixed m2urllib's unexpected eof - demo/ssl/urllib_cli.py now works. - Renamed xmlrpclib2.py to m2xmlrpclib.py. - Kludged SSL.ssl_dispatcher to do blocking connect()'s: see demo/ssl/https_cli_async.py. - SWIG 1.3.6 does! Thanks to Keith Jackson . Changes since 0.04 ----------------------- - Fixed a silly reversed-logic bug in M2Crypto.SSL.Connection.setblocking(). - Fixed yet more memory leaks. Thanks to Ray Suorsa . - Build instructions for Borland BC++ 5.5 free compiler suite. - Bundles the June 2000 unencumbered release of Medusa. - SSL callback thread-safety. Thanks again to Ray Suorsa for insights and patches. - Renamed M2Crypto.M2Crypto to M2Crypto.m2 to prevent package/module loading confusion. - SSL.Session and a demo in demo/ssl/sess.py. - https_srv.py, an enhanced, https version of SimpleHTTPServer.py. - Interface change: SMIME.load_pkcs7_bio() is renamed SMIME.smime_load_pkcs7_bio(), similarly SMIME.load_pkcs7() to SMIME.smime_load_pkcs7(); these load PKCS7 objects generated by S/MIME. - Interface change: SMIME.load_pkcs7_bio() now loads a PKCS7 PEM file, i.e., a file of the format "-----BEGIN PKCS7-----". - Works with both Python 2.0 and Python 1.5.2. - OpenSSL 0.9.6. (Possibly incompatible with earlier OpenSSL releases.) - Unit tests with PyUnit. - Improved C code: = Custom Python exceptions. = Diligent error checking. = Fixed memory leaks. - Renamed M2Crypto.urllib2 to M2Crypto.m2urllib. - HTTPS clients of Python 1.5.2's and Python 2.0's httplib and urllib. Changes since 0.03 ----------------------- - SSL certificate-based authentication with Python callback. - More robust SSL.Connection - raises exceptions, not dumps core. - Fixed (some) memory leaks and multiple-free()s. - Cleaned up EVP.HMAC and EVP.PKey. - More X.509 certificate manipulation. - An interface to create SSL sessions. - Unified SSL read() and write() for synchronous and asynchronous operation. - S/MIME and PKCS #7. - Integrated with OpenSSL 0.9.5. - Enhanced the PRNG interface. Changes since 0.02 ----------------------- 1. Ephemeral DH for SSL. 2. ThreadingSSLServer now does. 3. XMLrpc over https. 4. ZServerSSL for Zope 2.1.3. 5. Encrypting monitor for Zope 2.1.3. 6. Beginnings of PGP2 support. 7. Replaced eval() calls with other (hopefully) safe ones. 8. Miscellaneous enhancements and bug fixes. Changes since 0.01 ----------------------- 1. Beginnings of SSL support. For building servers, blocking i/o: - An SSLServer modeled after SocketServer. - A ForkingSSLServer that seems to work well. - A ThreadingSSLServer that runs one thread at a time. (!) ;-) For building servers, nonblocking i/o: - An ssl_dispatcher modeled after asyncore.dispatcher. A HTTPS server based on Medusa. For client-side web programming: - httpslib - urllib2 2. Support for some BIO objects. 3. Reduced per-module name space pollution. 4. Have Swig check for NULL pointers: reduced .i cut-&-paste. 5. Standardise on MPINT for passing big integers between Python and OpenSSL. 6. Removed MD5, SHA1, RIPEMD160. Just use EVP.MessageDigest. 7. Removed HMAC. Just use EVP.HMAC. M2Crypto-0.31.0/CONTRIBUTORS.rst0000664000175000001440000000346513165756570016251 0ustar matejusers00000000000000* The original project was created inside of the huge `Chandler project`_ where it was mostly work of Ng Pheng Siong [#]_ . * Then for a log time it was maintained and extended to the large part by Heikki Toivonen. With 247 and 415 commits, respectively, these two first maintainers provided by far the biggest amount of work on the project. Thank you. * An attempt to restart the project was made by Martin Paljak. Although his effort was most mostly discarded in the end, all his suggested changes were reviewed and some of them incorporated in some other form. Just two commits of his remaining in the tree hugely underestimate an effort he made to keep this project alive. Thank you very much for your work. * Plenty of work on keeping this project alive was made by the maintainer of the package inside of RHEL, Martin Trmač. He also helped a lot by advice with this last effort to revive the project, and his pestering me to do proper small commits rather than freaking dumps of my current thoughts helped to make changes to be made a little bit better (and revieweable). * This last hyena-like effort to revive a dead carcas has been started by Matěj Cepl. * I got a lot of help especially with reviewing patches from Hubert Kario. * Craig Rodrigues didn't loose the hope that M2Crypto could be ported to be py3k-compatible, which lead to the renewed effort to do so. He also helped with plenty of patches in this effort. * Casey Deccio helped a lot with fixing EC module. * Remaining contributors could be find in the output of ``git shortlog -s`` command. Thank you to all. .. _`Chandler project`: https://en.wikipedia.org/wiki/Chandler_%28software%29 .. [#] His and everybody else emails can be found in the git log, I won't make spammers even more happy to collect them here. M2Crypto-0.31.0/INSTALL.rst0000644000175000001440000001336113371123417015377 0ustar matejusers00000000000000Installing M2Crypto =================== .. contents:: Pre-requisites -------------- The following is required to *use* M2Crypto (once installed): - ``Python 2.6``, ``2.7``, ``3.4``, or newer - ``OpenSSL 1.0.1e`` or newer To *install* M2Crypto, you must be able to compile and link C sources against Python and OpenSSL headers/libraries. For example on a Debian-based system the following packages are needed: - ``build-essential`` - ``python3-dev`` and/or ``python-dev`` - ``libssl-dev`` - ``swig 2.0.4`` or newer (installation is also possible on some particular old systems with swig v1.*) Installing on Unix-like systems, including Cygwin ------------------------------------------------- (not tested and most likely obsolete, updated information for building with Cygwin are welcome).:: $ tar zxf m2crypto-.tar.gz $ cd m2crypto- $ python setup.py build $ python setup.py install If you have installed setuptools you can also optionally run tests like this::: $ python setup.py test This assumes OpenSSL is installed in ``/usr``. You can provide an alternate OpenSSL prefix location with --openssl option to ``build\_ext`` (or ``build``) command. So, for example, if you build your local version of OpenSSL and install it with ``/usr/local`` prefix (your includes are in ``/usr/local/include/openssl`` and libs in ``/usr/local/lib``), then you would add ``--openssl=/usr/local`` to your ``build`` command. Differences when installing on Windows -------------------------------------- (Python 2.6 is not supported on Windows anymore, please, just update to 2.7 if you want to stay on Python 2) (needs updating) Before building from source, you need to install OpenSSL's include files, import libraries and DLLs. OpenSSL 1.1.0 and on are installed by default in ``%ProgramFiles(86)%\OpenSSL`` (32-bit), or in ``%ProgramW6432%\OpenSSL`` (64-bit), or as a last resort, in ``%ProgramFiles%\OpenSSL``. setup.py will look in those locations. OpenSSL before 1.1.0 doesn't have a default install location, so you have to specify its install location explicitely. As with other platforms, you can specify a OpenSSL location with --openssl option to ``build\_ext`` (or ``build``) command. For example, ``--openssl=c:\pkg\openssl`` would specify that the OpenSSL include files can be found in ``c:\pkg\openssl\include`` and the librariesin ``c:\pkg\openssl\lib``. The '--openssl' option will configure swig and the compiler to look in the default locations for headers and libraries. If your OpenSSL is installed in a or you want to modify the default options run the build_ext step with normal distutils options: `--swig-opts`, `--include-dirs`, `--library-dirs`, and `--libraries`. MSVC++ ~\ :sub:`:sub:`:sub:`~``` setup.py is already configured to work with MSVC++ by default. With MSVC++, the OpenSSL pre 1.1.0 DLLs, as built, are named ``libeay32.dll`` and ``ssleay32.dll``. The OpenSSL 1.1.x DLLs are named ``libcrypto-1_1.dll`` and ``libssl-1_1.dll``. Install these somewhere on your PATH; for example in ``c:\bin``, together with ``openssl.exe``. For MSVC++, the import libraries, as built by OpenSSL pre 1.1.0, are named ``libeay32.lib`` and ``ssleay32.lib``. The OpenSSL 1.1.x import libraries are named ``libcrypto.lib`` and ``libssl.lib``. MINGW :sub:`:sub:`:sub:`~``` .. NOTE:: The following instructions for building M2Crypto with MINGW are from M2Crypto 0.12. These instructions should continue to work for this release, although I have not tested them. Read Sebastien Sauvage's webpage:: http://sebsauvage.net/python/mingw.html For mingw32, the OpenSSL pre 1.1.0 import libraries are named ``libeay32.dll.a`` and ``libssl32.dll.a``. You may need to edit setup.py file for these. You'll also need to create ``libpython2[123].a``, depending on your version of Python. OpenSSL pre 1.1.0 DLLs for mingw32 are named ``libeay32.dll`` and ``libssl32.dll``. OpenSSL 1.1.x DLLs are named ``libcrypto-1_1.dll`` and ``libssl-1_1.dll``. Install these somewhere on your PATH; for example in ``c:\bin``, together with ``openssl.exe``. Build M2Crypto:: python setup.py build -cmingw32 python setup.py install BC++ :sub:`:sub:`~``\ ~ .. NOTE:: The following instructions for building M2Crypto with MSVC++ 6.0 and BC++ 5.5 free compiler suite are from M2Crypto 0.10. These instructions should continue to work for this release, although I have not tested them. .. NOTE:: OpenSSL 1.1.x doesn't support BC++. For BC++ these files are created from the MSVC++-built ones using the tool ``coff2omf.exe``. I call them ``libeay32_bc.lib`` and ``ssleay32_bc.lib``, respectively. You will need to edit setup.py file for these. You'll also need Python's import library, e.g., ``python22.lib``, to be the BC++-compatible version; i.e., create ``python22_bc.lib`` from ``python22.lib``, save a copy of ``python22.lib`` (as ``python22_vc.lib``, say), then rename ``python22_bc.lib`` to ``python22.lib``. Now you are ready to build M2Crypto. Do one of the following:: python setup.py build python setup.py build -cbcpp Then,:: python setup.py install MacOSX ------ Apple does not provide on more recent versions of Mac OS X (at least certainly `since 10.11`_) any version of OpenSSL, so it is necessary to use ``brew`` or similar packaging systems to install third party packages. A Mac OS X users suggested, that this series of commands gave him a working copy of M2Crypto on his system:: $ brew install openssl && brew install swig $ brew --prefix openssl /usr/local/opt/openssl $ LDFLAGS="-L$(brew --prefix openssl)/lib" \ CFLAGS="-I$(brew --prefix openssl)/include" \ SWIG_FEATURES="-I$(brew --prefix openssl)/include" \ pip install m2crypto .. _`since 10.11`: https://gitlab.com/m2crypto/m2crypto/merge_requests/7#note_2581821 M2Crypto-0.31.0/LICENCE0000664000175000001440000000243613032674550014532 0ustar matejusers00000000000000Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions copyright (c) 2004-2006 Open Source Applications Foundation. All rights reserved. Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam. All rights reserved. Copyright (c) 2008-2010 Heikki Toivonen. All rights reserved. Permission to use, copy, modify, and distribute this software and its documentation for any purpose and without fee is hereby granted, provided that the above copyright notice appear in all copies and that both that copyright notice and this permission notice appear in supporting documentation. THE AUTHOR PROVIDES THIS SOFTWARE ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. M2Crypto-0.31.0/M2Crypto/0000755000175000001440000000000013371124434015212 5ustar matejusers00000000000000M2Crypto-0.31.0/M2Crypto/ASN1.py0000644000175000001440000001662313355123234016275 0ustar matejusers00000000000000from __future__ import absolute_import """ M2Crypto wrapper for OpenSSL ASN1 API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2005 OSAF. All Rights Reserved. """ import datetime import time from M2Crypto import BIO, m2, py27plus, six if py27plus: from typing import Any, Callable, Optional, Tuple # noqa MBSTRING_FLAG = 0x1000 MBSTRING_ASC = MBSTRING_FLAG | 1 MBSTRING_BMP = MBSTRING_FLAG | 2 class ASN1_Integer(object): m2_asn1_integer_free = m2.asn1_integer_free def __init__(self, asn1int, _pyfree=0): # type: (ASN1_Integer, int) -> None self.asn1int = asn1int self._pyfree = _pyfree def __cmp__(self, other): # type: (ASN1_Integer) -> int if not isinstance(other, ASN1_Integer): raise TypeError( "Comparisons supported only between ANS1_Integer objects") return m2.asn1_integer_cmp(self.asn1int, other.asn1int) def __del__(self): # type: () -> None if self._pyfree: self.m2_asn1_integer_free(self.asn1int) def __int__(self): # type: () -> int return m2.asn1_integer_get(self.asn1int) class ASN1_String(object): m2_asn1_string_free = m2.asn1_string_free def __init__(self, asn1str, _pyfree=0): # type: (ASN1_String, int) -> None self.asn1str = asn1str self._pyfree = _pyfree def __bytes__(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.asn1_string_print(buf.bio_ptr(), self.asn1str) return buf.read_all() def __str__(self): # type: () -> str return six.ensure_text(self.__bytes__()) def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_asn1_string_free(self.asn1str) def _ptr(self): return self.asn1str def as_text(self, flags=0): # type: (int) -> str """Output an ASN1_STRING structure according to the set flags. :param flags: determine the format of the output by using predetermined constants, see ASN1_STRING_print_ex(3) manpage for their meaning. :return: output an ASN1_STRING structure. """ buf = BIO.MemoryBuffer() m2.asn1_string_print_ex(buf.bio_ptr(), self.asn1str, flags) return six.ensure_text(buf.read_all()) class ASN1_Object(object): m2_asn1_object_free = m2.asn1_object_free def __init__(self, asn1obj, _pyfree=0): # type: (ASN1_Object, int) -> None self.asn1obj = asn1obj self._pyfree = _pyfree def __del__(self): # type: () -> None if self._pyfree: self.m2_asn1_object_free(self.asn1obj) def _ptr(self): return self.asn1obj class _UTC(datetime.tzinfo): def tzname(self, dt): # type: (Optional[datetime.datetime]) -> str return "UTC" def dst(self, dt): # type: (Optional[datetime.datetime]) -> datetime.timedelta return datetime.timedelta(0) def utcoffset(self, dt): # type: (Optional[datetime.datetime]) -> datetime.timedelta return datetime.timedelta(0) def __repr__(self): return "" % self.tzname(None) UTC = _UTC() # type: _UTC class LocalTimezone(datetime.tzinfo): """Localtimezone from datetime manual.""" def __init__(self): # type: () -> None self._stdoffset = datetime.timedelta(seconds=-time.timezone) if time.daylight: self._dstoffset = datetime.timedelta(seconds=-time.altzone) else: self._dstoffset = self._stdoffset self._dstdiff = self._dstoffset - self._stdoffset def utcoffset(self, dt): # type: (datetime.datetime) -> datetime.timedelta if self._isdst(dt): return self._dstoffset else: return self._stdoffset def dst(self, dt): # type: (datetime.datetime) -> datetime.timedelta if self._isdst(dt): return self._dstdiff else: return datetime.timedelta(0) def tzname(self, dt): # type: (datetime.datetime) -> str return time.tzname[self._isdst(dt).real] def _isdst(self, dt): # type: (datetime.datetime) -> bool tt = (dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.weekday(), 0, -1) stamp = time.mktime(tt) tt = time.localtime(stamp) return tt.tm_isdst > 0 class ASN1_TIME(object): _ssl_months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] m2_asn1_time_free = m2.asn1_time_free def __init__(self, asn1_time=None, _pyfree=0, asn1_utctime=None): # type: (Optional[ASN1_TIME], Optional[int], Optional[ASN1_TIME]) -> None # handle old keyword parameter if asn1_time is None: asn1_time = asn1_utctime if asn1_time is not None: assert m2.asn1_time_type_check(asn1_time), \ "'asn1_time' type error'" self.asn1_time = asn1_time self._pyfree = _pyfree else: self.asn1_time = m2.asn1_time_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_asn1_time_free(self.asn1_time) def __str__(self): # type: () -> str assert m2.asn1_time_type_check(self.asn1_time), \ "'asn1_time' type error'" buf = BIO.MemoryBuffer() m2.asn1_time_print(buf.bio_ptr(), self.asn1_time) return six.ensure_text(buf.read_all()) def _ptr(self): assert m2.asn1_time_type_check(self.asn1_time), \ "'asn1_time' type error'" return self.asn1_time def set_string(self, string): # type: (bytes) -> int """Set time from UTC string.""" assert m2.asn1_time_type_check(self.asn1_time), \ "'asn1_time' type error'" return m2.asn1_time_set_string(self.asn1_time, string) def set_time(self, time): # type: (int) -> ASN1_TIME """Set time from seconds since epoch (int).""" assert m2.asn1_time_type_check(self.asn1_time), \ "'asn1_time' type error'" return m2.asn1_time_set(self.asn1_time, time) def get_datetime(self): # type: () -> ASN1_TIME date = str(self) timezone = None if ' ' not in date: raise ValueError("Invalid date: %s" % date) month, rest = date.split(' ', 1) if month not in self._ssl_months: raise ValueError("Invalid date %s: Invalid month: %s" % (date, month)) if rest.endswith(' GMT'): timezone = UTC rest = rest[:-4] if '.' in rest: dt = datetime.datetime.strptime(rest, "%d %H:%M:%S.%f %Y") else: dt = datetime.datetime.strptime(rest, "%d %H:%M:%S %Y") dt = dt.replace(month=self._ssl_months.index(month) + 1) if timezone: dt = dt.replace(tzinfo=UTC) return dt def set_datetime(self, date): # type: (datetime.datetime) -> ASN1_TIME local = LocalTimezone() if date.tzinfo is None: date = date.replace(tzinfo=local) date = date.astimezone(local) return self.set_time(int(time.mktime(date.timetuple()))) ASN1_UTCTIME = ASN1_TIME M2Crypto-0.31.0/M2Crypto/AuthCookie.py0000644000175000001440000001211613355123234017617 0ustar matejusers00000000000000from __future__ import absolute_import """Secure Authenticator Cookies Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" import logging import re import time from M2Crypto import Rand, m2, py27plus, six, util from M2Crypto.six.moves.http_cookies import SimpleCookie # pylint: disable=no-name-in-module,import-error if py27plus: from typing import re as type_re, AnyStr, Dict, Optional, Union # noqa _MIX_FORMAT = 'exp=%f&data=%s&digest=' _MIX_RE = re.compile(r'exp=(\d+\.\d+)&data=(.+)&digest=(\S*)') log = logging.getLogger(__name__) def mix(expiry, data, format=_MIX_FORMAT): # type: (float, AnyStr, str) -> AnyStr return format % (expiry, data) def unmix(dough, regex=_MIX_RE): # type: (AnyStr, type_re) -> object mo = regex.match(dough) if mo: return float(mo.group(1)), mo.group(2) else: return None def unmix3(dough, regex=_MIX_RE): # type: (AnyStr, type_re) -> Optional[tuple[float, AnyStr, AnyStr]] mo = regex.match(dough) if mo: return float(mo.group(1)), mo.group(2), mo.group(3) else: return None _TOKEN = '_M2AUTH_' # type: str class AuthCookieJar(object): _keylen = 20 # type: int def __init__(self): # type: () -> None self._key = Rand.rand_bytes(self._keylen) def _hmac(self, key, data): # type: (bytes, str) -> str return util.bin_to_hex(m2.hmac(key, six.ensure_binary(data), m2.sha1())) def makeCookie(self, expiry, data): # type: (float, str) -> AuthCookie """ Make a cookie :param expiry: expiration time (float in seconds) :param data: cookie content :return: AuthCookie object """ if not isinstance(expiry, (six.integer_types, float)): raise ValueError('Expiration time must be number, not "%s' % expiry) dough = mix(expiry, data) return AuthCookie(expiry, data, dough, self._hmac(self._key, dough)) def isGoodCookie(self, cookie): # type: (AuthCookie) -> Union[bool, int] assert isinstance(cookie, AuthCookie) if cookie.isExpired(): return 0 c = self.makeCookie(cookie._expiry, cookie._data) return (c._expiry == cookie._expiry) \ and (c._data == cookie._data) \ and (c._mac == cookie._mac) \ and (c.output() == cookie.output()) def isGoodCookieString(self, cookie_str, _debug=False): # type: (Union[dict, bytes], bool) -> Union[bool, int] c = SimpleCookie() c.load(cookie_str) if _TOKEN not in c: log.debug('_TOKEN not in c (keys = %s)', dir(c)) return 0 undough = unmix3(c[_TOKEN].value) if undough is None: log.debug('undough is None') return 0 exp, data, mac = undough c2 = self.makeCookie(exp, data) if _debug and (c2._mac == mac): log.error('cookie_str = %s', cookie_str) log.error('c2.isExpired = %s', c2.isExpired()) log.error('mac = %s', mac) log.error('c2._mac = %s', c2._mac) log.error('c2._mac == mac: %s', str(c2._mac == mac)) return (not c2.isExpired()) and (c2._mac == mac) class AuthCookie(object): def __init__(self, expiry, data, dough, mac): # type: (float, str, str, str) -> None """ Create new authentication cookie :param expiry: expiration time (in seconds) :param data: cookie payload (as a string) :param dough: expiry & data concatenated to URL compliant string :param mac: SHA1-based HMAC of dough and random key """ self._expiry = expiry self._data = data self._mac = mac self._cookie = SimpleCookie() self._cookie[_TOKEN] = '%s%s' % (dough, mac) self._name = '%s%s' % (dough, mac) # WebKit only. def expiry(self): # type: () -> float """Return the cookie's expiry time.""" return self._expiry def data(self): # type: () -> str """Return the data portion of the cookie.""" return self._data def mac(self): # type: () -> str """Return the cookie's MAC.""" return self._mac def output(self, header="Set-Cookie:"): # type: (Optional[str]) -> str """Return the cookie's output in "Set-Cookie" format.""" return self._cookie.output(header=header) def value(self): # type: () -> str """Return the cookie's output minus the "Set-Cookie: " portion. """ return self._cookie[_TOKEN].value def isExpired(self): # type: () -> bool """Return 1 if the cookie has expired, 0 otherwise.""" return isinstance(self._expiry, (float, six.integer_types)) and \ (time.time() > self._expiry) # Following two methods are for WebKit only. # I may wish to push them to WKAuthCookie, but they are part # of the API now. Oh well. def name(self): # type: () -> str return self._name def headerValue(self): # type: () -> str return self.value() M2Crypto-0.31.0/M2Crypto/BIO.py0000644000175000001440000002525213355123234016202 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto wrapper for OpenSSL BIO API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" import logging from M2Crypto import m2, py27plus, six if py27plus: from typing import AnyStr, Callable, Iterable, Optional, Union # noqa log = logging.getLogger('BIO') class BIOError(ValueError): pass m2.bio_init(BIOError) class BIO(object): """Abstract object interface to the BIO API.""" m2_bio_free = m2.bio_free def __init__(self, bio=None, _pyfree=0, _close_cb=None): # type: (Optional[BIO], int, Optional[Callable]) -> None self.bio = bio self._pyfree = _pyfree self._close_cb = _close_cb self.closed = 0 self.write_closed = 0 def __del__(self): if self._pyfree: self.m2_bio_free(self.bio) def _ptr(self): return self.bio # Deprecated. bio_ptr = _ptr def fileno(self): # type: () -> int return m2.bio_get_fd(self.bio) def readable(self): # type: () -> bool return not self.closed def read(self, size=None): # type: (int) -> Union[bytes, bytearray] if not self.readable(): raise IOError('cannot read') if size is None: buf = bytearray() while 1: data = m2.bio_read(self.bio, 4096) if not data: break buf += data return buf elif size == 0: return b'' elif size < 0: raise ValueError('read count is negative') else: return bytes(m2.bio_read(self.bio, size)) def readline(self, size=4096): # type: (int) -> bytes if not self.readable(): raise IOError('cannot read') buf = m2.bio_gets(self.bio, size) buf = '' if buf is None else buf return six.ensure_binary(buf) def readlines(self, sizehint='ignored'): # type: (Union[AnyStr, int]) -> Iterable[bytes] if not self.readable(): raise IOError('cannot read') lines = [] while 1: buf = m2.bio_gets(self.bio, 4096) if buf is None: break lines.append(six.ensure_binary(buf)) return lines def writeable(self): # type: () -> bool return (not self.closed) and (not self.write_closed) def write(self, data): # type: (AnyStr) -> int """Write data to BIO. :return: either data written, or [0, -1] for nothing written, -2 not implemented """ if not self.writeable(): raise IOError('cannot write') if isinstance(data, six.text_type): data = data.encode('utf8') return m2.bio_write(self.bio, data) def write_close(self): # type: () -> None self.write_closed = 1 def flush(self): # type: () -> None """Flush the buffers. :return: 1 for success, and 0 or -1 for failure """ m2.bio_flush(self.bio) def reset(self): # type: () -> int """Set the bio to its initial state. :return: 1 for success, and 0 or -1 for failure """ return m2.bio_reset(self.bio) def close(self): # type: () -> None self.closed = 1 if self._close_cb: self._close_cb() def should_retry(self): # type: () -> int """ Can the call be attempted again, or was there an error ie do_handshake """ return m2.bio_should_retry(self.bio) def should_read(self): # type: () -> int """Should we read more data?""" return m2.bio_should_read(self.bio) def should_write(self): # type: () -> int """Should we write more data?""" return m2.bio_should_write(self.bio) def tell(self): """Return the current offset.""" return m2.bio_tell(self.bio) def seek(self, off): """Seek to the specified absolute offset.""" return m2.bio_seek(self.bio, off) def __enter__(self): return self def __exit__(self, *args): # type: (*Any) -> int self.close() class MemoryBuffer(BIO): """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. """ def __init__(self, data=None): # type: (Optional[bytes]) -> None super(MemoryBuffer, self).__init__(self) if data is not None and not isinstance(data, bytes): raise TypeError( "data must be bytes or None, not %s" % (type(data).__name__, )) self.bio = m2.bio_new(m2.bio_s_mem()) self._pyfree = 1 if data is not None: m2.bio_write(self.bio, data) def __len__(self): # type: () -> int return m2.bio_ctrl_pending(self.bio) def read(self, size=0): # type: (int) -> bytes if not self.readable(): raise IOError('cannot read') if size: return m2.bio_read(self.bio, size) else: return m2.bio_read(self.bio, m2.bio_ctrl_pending(self.bio)) # Backwards-compatibility. getvalue = read_all = read def write_close(self): # type: () -> None super(MemoryBuffer, self).write_close() m2.bio_set_mem_eof_return(self.bio, 0) close = write_close class File(BIO): """Object interface to BIO_s_pyfd. This class interfaces Python to OpenSSL functions that expect BIO. For general file manipulation in Python, use Python's builtin file object. """ def __init__(self, pyfile, close_pyfile=1, mode='rb'): # type: (Union[io.BytesIO, AnyStr], int, AnyStr) -> None super(File, self).__init__(self, _pyfree=1) if isinstance(pyfile, six.string_types): pyfile = open(pyfile, mode) # This is for downward compatibility, but I don't think, that it is # good practice to have two handles for the same file. Whats about # concurrent write access? Last write, last wins? Especially since Py3 # has its own buffer management. See: # # https://docs.python.org/3.3/c-api/file.html # pyfile.flush() self.fname = pyfile.name self.pyfile = pyfile # Be wary of https://github.com/openssl/openssl/pull/1925 # BIO_new_fd is NEVER to be used before OpenSSL 1.1.1 if hasattr(m2, "bio_new_pyfd"): self.bio = m2.bio_new_pyfd(pyfile.fileno(), m2.bio_noclose) else: self.bio = m2.bio_new_pyfile(pyfile, m2.bio_noclose) self.close_pyfile = close_pyfile self.closed = False def flush(self): # type: () -> None super(File, self).flush() self.pyfile.flush() def close(self): # type: () -> None self.flush() super(File, self).close() if self.close_pyfile: self.pyfile.close() def reset(self): # type: () -> int """Set the bio to its initial state. :return: 0 for success, and -1 for failure """ return super(File, self).reset() def __del__(self): if not self.closed: m2.bio_free(self.bio) def openfile(filename, mode='rb'): # type: (AnyStr, AnyStr) -> File try: f = open(filename, mode) except IOError as ex: raise BIOError(ex.args) return File(f) class IOBuffer(BIO): """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. """ m2_bio_pop = m2.bio_pop m2_bio_free = m2.bio_free def __init__(self, under_bio, mode='rwb', _pyfree=1): # type: (BIO, str, int) -> None super(IOBuffer, self).__init__(self, _pyfree=_pyfree) self.io = m2.bio_new(m2.bio_f_buffer()) self.bio = m2.bio_push(self.io, under_bio._ptr()) # This reference keeps the underlying BIO alive while we're not closed. self._under_bio = under_bio if 'w' in mode: self.write_closed = 0 else: self.write_closed = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_bio_pop(self.bio) self.m2_bio_free(self.io) def close(self): # type: () -> None BIO.close(self) class CipherStream(BIO): """Object interface to BIO_f_cipher.""" SALT_LEN = m2.PKCS5_SALT_LEN m2_bio_pop = m2.bio_pop m2_bio_free = m2.bio_free def __init__(self, obio): # type: (BIO) -> None super(CipherStream, self).__init__(self, _pyfree=1) self.obio = obio self.bio = m2.bio_new(m2.bio_f_cipher()) self.closed = 0 def __del__(self): # type: () -> None if not getattr(self, 'closed', 1): self.close() def close(self): # type: () -> None self.m2_bio_pop(self.bio) self.m2_bio_free(self.bio) self.closed = 1 def write_close(self): # type: () -> None self.obio.write_close() def set_cipher(self, algo, key, iv, op): # type: (str, AnyStr, AnyStr, int) -> None cipher = getattr(m2, algo, None) if cipher is None: raise ValueError('unknown cipher', algo) else: if not isinstance(key, bytes): key = key.encode('utf8') if not isinstance(iv, bytes): iv = iv.encode('utf8') m2.bio_set_cipher(self.bio, cipher(), key, iv, int(op)) m2.bio_push(self.bio, self.obio._ptr()) class SSLBio(BIO): """Object interface to BIO_f_ssl.""" def __init__(self, _pyfree=1): # type: (int) -> None super(SSLBio, self).__init__(self, _pyfree=_pyfree) self.bio = m2.bio_new(m2.bio_f_ssl()) self.closed = 0 def set_ssl(self, conn, close_flag=m2.bio_noclose): # type: (Connection, int) -> None """ Sets the bio to the SSL pointer which is contained in the connection object. """ self._pyfree = 0 m2.bio_set_ssl(self.bio, conn.ssl, close_flag) if close_flag == m2.bio_noclose: conn.set_ssl_close_flag(m2.bio_close) def do_handshake(self): # type: () -> int """Do the handshake. Return 1 if the handshake completes Return 0 or a negative number if there is a problem """ return m2.bio_do_handshake(self.bio) M2Crypto-0.31.0/M2Crypto/BN.py0000664000175000001440000000320313165756570016100 0ustar matejusers00000000000000from __future__ import absolute_import """ M2Crypto wrapper for OpenSSL BN (BIGNUM) API. Copyright (c) 2005 Open Source Applications Foundation. All rights reserved. """ from M2Crypto import m2, util if util.py27plus: from typing import Optional # noqa def rand(bits, top=-1, bottom=0): # type: (int, int, int) -> Optional[int] """ Generate cryptographically strong random number. :param bits: Length of random number in bits. :param top: If -1, the most significant bit can be 0. If 0, the most significant bit is 1, and if 1, the two most significant bits will be 1. :param bottom: If bottom is true, the number will be odd. """ return m2.bn_rand(bits, top, bottom) def rand_range(range): # type: (int) -> int """ Generate a random number in a range. :param range: Upper limit for range. :return: A random number in the range [0, range) """ return m2.bn_rand_range(range) def randfname(length): # type: (int) -> str """ Return a random filename, which is simply a string where all the characters are from the set [a-zA-Z0-9]. :param length: Length of filename to return. :return: random filename string """ import warnings warnings.warn( "Don't use BN.randfname(), use tempfile methods instead.", DeprecationWarning, stacklevel=2) letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890' lettersLen = len(letters) fname = [] # type: list for x in range(length): fname += [letters[m2.bn_rand_range(lettersLen)]] return ''.join(fname) M2Crypto-0.31.0/M2Crypto/DH.py0000644000175000001440000000560213355123234016061 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto wrapper for OpenSSL DH API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" from M2Crypto import BIO, m2, util from M2Crypto.util import genparam_callback if util.py27plus: from typing import AnyStr, Callable # noqa class DHError(Exception): pass m2.dh_init(DHError) class DH(object): """Object interface to the Diffie-Hellman key exchange protocol. """ m2_dh_free = m2.dh_free def __init__(self, dh, _pyfree=0): # type: (bytes, int) -> None assert m2.dh_type_check(dh) self.dh = dh self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_dh_free(self.dh) def __len__(self): # type: () -> int assert m2.dh_type_check(self.dh), "'dh' type error" return int(m2.dh_size(self.dh)) def __getattr__(self, name): # type: (str) -> bytes if name in ('p', 'g', 'pub', 'priv'): method = getattr(m2, 'dh_get_%s' % (name,)) assert m2.dh_type_check(self.dh), "'dh' type error" return method(self.dh) else: raise AttributeError def __setattr__(self, name, value): # type: (str, bytes) -> bytes if name in ('p', 'g'): raise DHError('set (p, g) via set_params()') elif name in ('pub', 'priv'): raise DHError('generate (pub, priv) via gen_key()') else: self.__dict__[name] = value def _ptr(self): return self.dh def check_params(self): # type: () -> int assert m2.dh_type_check(self.dh), "'dh' type error" return m2.dh_check(self.dh) def gen_key(self): # type: () -> None assert m2.dh_type_check(self.dh), "'dh' type error" m2.dh_generate_key(self.dh) def compute_key(self, pubkey): # type: (bytes) -> bytes assert m2.dh_type_check(self.dh), "'dh' type error" return m2.dh_compute_key(self.dh, pubkey) def print_params(self, bio): # type: (BIO.BIO) -> int assert m2.dh_type_check(self.dh), "'dh' type error" return m2.dhparams_print(bio._ptr(), self.dh) def gen_params(plen, g, callback=genparam_callback): # type: (int, int, Optional[Callable]) -> DH dh_parms = m2.dh_generate_parameters(plen, g, callback) dh_obj = DH(dh_parms, 1) return dh_obj def load_params(file): # type: (AnyStr) -> DH with BIO.openfile(file) as bio: return load_params_bio(bio) def load_params_bio(bio): # type: (BIO.BIO) -> DH return DH(m2.dh_read_parameters(bio._ptr()), 1) def set_params(p, g): # type: (bytes, bytes) -> DH dh = m2.dh_new() m2.dh_set_pg(dh, p, g) return DH(dh, 1) # def free_params(cptr): # m2.dh_free(cptr) DH_GENERATOR_2 = m2.DH_GENERATOR_2 DH_GENERATOR_5 = m2.DH_GENERATOR_5 M2Crypto-0.31.0/M2Crypto/DSA.py0000644000175000001440000003374313355123234016204 0ustar matejusers00000000000000from __future__ import absolute_import, print_function """ M2Crypto wrapper for OpenSSL DSA API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004 OSAF. All Rights Reserved. """ from M2Crypto import BIO, m2, util if util.py27plus: from typing import AnyStr, Callable, Tuple # noqa class DSAError(Exception): pass m2.dsa_init(DSAError) class DSA(object): """ This class is a context supporting DSA key and parameter values, signing and verifying. Simple example:: from M2Crypto import EVP, DSA, util message = 'Kilroy was here!' md = EVP.MessageDigest('sha1') md.update(message) digest = md.final() dsa = DSA.gen_params(1024) dsa.gen_key() r, s = dsa.sign(digest) good = dsa.verify(digest, r, s) if good: print(' ** success **') else: print(' ** verification failed **') """ m2_dsa_free = m2.dsa_free def __init__(self, dsa, _pyfree=0): # type: (bytes, int) -> None """ Use one of the factory functions to create an instance. :param dsa: binary representation of OpenSSL DSA type """ assert m2.dsa_type_check(dsa), "'dsa' type error" self.dsa = dsa self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_dsa_free(self.dsa) def __len__(self): # type: () -> int """ Return the key length. :return: the DSA key length in bits """ assert m2.dsa_type_check(self.dsa), "'dsa' type error" return m2.dsa_keylen(self.dsa) def __getattr__(self, name): # type: (str) -> bytes """ Return specified DSA parameters and key values. :param name: name of variable to be returned. Must be one of 'p', 'q', 'g', 'pub', 'priv'. :return: value of specified variable (a "byte string") """ if name in ['p', 'q', 'g', 'pub', 'priv']: method = getattr(m2, 'dsa_get_%s' % (name,)) assert m2.dsa_type_check(self.dsa), "'dsa' type error" return method(self.dsa) else: raise AttributeError def __setattr__(self, name, value): # type: (str, bytes) -> None if name in ['p', 'q', 'g']: raise DSAError('set (p, q, g) via set_params()') elif name in ['pub', 'priv']: raise DSAError('generate (pub, priv) via gen_key()') else: self.__dict__[name] = value def set_params(self, p, q, g): # type: (bytes, bytes, bytes) -> None """ Set new parameters. :param p: MPI binary representation ... format that consists of the number's length in bytes represented as a 4-byte big-endian number, and the number itself in big-endian format, where the most significant bit signals a negative number (the representation of numbers with the MSB set is prefixed with null byte). :param q: ditto :param g: ditto @warning: This does not change the private key, so it may be unsafe to use this method. It is better to use gen_params function to create a new DSA object. """ m2.dsa_set_pqg(self.dsa, p, q, g) def gen_key(self): # type: () -> None """ Generate a key pair. """ assert m2.dsa_type_check(self.dsa), "'dsa' type error" m2.dsa_gen_key(self.dsa) def save_params(self, filename): # type: (AnyStr) -> int """ Save the DSA parameters to a file. :param filename: Save the DSA parameters to this file. :return: 1 (true) if successful """ with BIO.openfile(filename, 'wb') as bio: ret = m2.dsa_write_params_bio(self.dsa, bio._ptr()) return ret def save_params_bio(self, bio): # type: (BIO.BIO) -> int """ Save DSA parameters to a BIO object. :param bio: Save DSA parameters to this object. :return: 1 (true) if successful """ return m2.dsa_write_params_bio(self.dsa, bio._ptr()) def save_key(self, filename, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (AnyStr, str, Callable) -> int """ Save the DSA key pair to a file. :param filename: Save the DSA key pair to this file. :param cipher: name of symmetric key algorithm and mode to encrypt the private key. :return: 1 (true) if successful """ with BIO.openfile(filename, 'wb') as bio: ret = self.save_key_bio(bio, cipher, callback) return ret def save_key_bio(self, bio, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (BIO.BIO, str, Callable) -> int """ Save DSA key pair to a BIO object. :param bio: Save DSA parameters to this object. :param cipher: name of symmetric key algorithm and mode to encrypt the private key. :return: 1 (true) if successful """ if cipher is None: return m2.dsa_write_key_bio_no_cipher(self.dsa, bio._ptr(), callback) else: ciph = getattr(m2, cipher, None) if ciph is None: raise DSAError('no such cipher: %s' % cipher) else: ciph = ciph() return m2.dsa_write_key_bio(self.dsa, bio._ptr(), ciph, callback) def save_pub_key(self, filename): # type: (AnyStr) -> int """ Save the DSA public key (with parameters) to a file. :param filename: Save DSA public key (with parameters) to this file. :return: 1 (true) if successful """ with BIO.openfile(filename, 'wb') as bio: ret = self.save_pub_key_bio(bio) return ret def save_pub_key_bio(self, bio): # type: (BIO.BIO) -> int """ Save DSA public key (with parameters) to a BIO object. :param bio: Save DSA public key (with parameters) to this object. :return: 1 (true) if successful """ return m2.dsa_write_pub_key_bio(self.dsa, bio._ptr()) def sign(self, digest): # type: (bytes) -> Tuple[bytes, bytes] """ Sign the digest. :param digest: SHA-1 hash of message (same as output from MessageDigest, a "byte string") :return: DSA signature, a tuple of two values, r and s, both "byte strings". """ assert self.check_key(), 'key is not initialised' return m2.dsa_sign(self.dsa, digest) def verify(self, digest, r, s): # type: (bytes, bytes, bytes) -> int """ Verify a newly calculated digest against the signature values r and s. :param digest: SHA-1 hash of message (same as output from MessageDigest, a "byte string") :param r: r value of the signature, a "byte string" :param s: s value of the signature, a "byte string" :return: 1 (true) if verify succeeded, 0 if failed """ assert self.check_key(), 'key is not initialised' return m2.dsa_verify(self.dsa, digest, r, s) def sign_asn1(self, digest): assert self.check_key(), 'key is not initialised' return m2.dsa_sign_asn1(self.dsa, digest) def verify_asn1(self, digest, blob): assert self.check_key(), 'key is not initialised' return m2.dsa_verify_asn1(self.dsa, digest, blob) def check_key(self): """ Check to be sure the DSA object has a valid private key. :return: 1 (true) if a valid private key """ assert m2.dsa_type_check(self.dsa), "'dsa' type error" return m2.dsa_check_key(self.dsa) class DSA_pub(DSA): """ This class is a DSA context that only supports a public key and verification. It does NOT support a private key or signing. """ def sign(self, *argv): # type: (*Any) -> None raise DSAError('DSA_pub object has no private key') sign_asn1 = sign def check_key(self): # type: () -> int """ :return: does DSA_pub contain a pub key? """ return m2.dsa_check_pub_key(self.dsa) save_key = DSA.save_pub_key save_key_bio = DSA.save_pub_key_bio # -------------------------------------------------------------- # factories and other functions def gen_params(bits, callback=util.genparam_callback): # type: (int, Callable) -> DSA """ Factory function that generates DSA parameters and instantiates a DSA object from the output. :param bits: The length of the prime to be generated. If 'bits' < 512, it is set to 512. :param callback: A Python callback object that will be invoked during parameter generation; it usual purpose is to provide visual feedback. :return: instance of DSA. """ dsa = m2.dsa_generate_parameters(bits, callback) return DSA(dsa, 1) def set_params(p, q, g): # type: (bytes, bytes, bytes) -> DSA """ Factory function that instantiates a DSA object with DSA parameters. :param p: value of p, a "byte string" :param q: value of q, a "byte string" :param g: value of g, a "byte string" :return: instance of DSA. """ dsa = m2.dsa_new() m2.dsa_set_pqg(dsa, p, q, g) return DSA(dsa, 1) def load_params(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> DSA """ Factory function that instantiates a DSA object with DSA parameters from a file. :param file: Names the file (a path) that contains the PEM representation of the DSA parameters. :param callback: A Python callback object that will be invoked if the DSA parameters file is passphrase-protected. :return: instance of DSA. """ with BIO.openfile(file) as bio: ret = load_params_bio(bio, callback) return ret def load_params_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> DSA """ Factory function that instantiates a DSA object with DSA parameters from a M2Crypto.BIO object. :param bio: Contains the PEM representation of the DSA parameters. :param callback: A Python callback object that will be invoked if the DSA parameters file is passphrase-protected. :return: instance of DSA. """ dsa = m2.dsa_read_params(bio._ptr(), callback) return DSA(dsa, 1) def load_key(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> DSA """ Factory function that instantiates a DSA object from a PEM encoded DSA key pair. :param file: Names the file (a path) that contains the PEM representation of the DSA key pair. :param callback: A Python callback object that will be invoked if the DSA key pair is passphrase-protected. :return: instance of DSA. """ with BIO.openfile(file) as bio: ret = load_key_bio(bio, callback) return ret def load_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> DSA """ Factory function that instantiates a DSA object from a PEM encoded DSA key pair. :param bio: Contains the PEM representation of the DSA key pair. :param callback: A Python callback object that will be invoked if the DSA key pair is passphrase-protected. :return: instance of DSA. """ dsa = m2.dsa_read_key(bio._ptr(), callback) return DSA(dsa, 1) def pub_key_from_params(p, q, g, pub): # type: (bytes, bytes, bytes, bytes) -> DSA_pub """ Factory function that instantiates a DSA_pub object using the parameters and public key specified. :param p: value of p :param q: value of q :param g: value of g :param pub: value of the public key :return: instance of DSA_pub. """ dsa = m2.dsa_new() m2.dsa_set_pqg(dsa, p, q, g) m2.dsa_set_pub(dsa, pub) return DSA_pub(dsa, 1) def load_pub_key(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> DSA_pub """ Factory function that instantiates a DSA_pub object using a DSA public key contained in PEM file. The PEM file must contain the parameters in addition to the public key. :param file: Names the file (a path) that contains the PEM representation of the DSA public key. :param callback: A Python callback object that will be invoked should the DSA public key be passphrase-protected. :return: instance of DSA_pub. """ with BIO.openfile(file) as bio: ret = load_pub_key_bio(bio, callback) return ret def load_pub_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> DSA_pub """ Factory function that instantiates a DSA_pub object using a DSA public key contained in PEM format. The PEM must contain the parameters in addition to the public key. :param bio: Contains the PEM representation of the DSA public key (with params). :param callback: A Python callback object that will be invoked should the DSA public key be passphrase-protected. :return: instance of DSA_pub. """ dsapub = m2.dsa_read_pub_key(bio._ptr(), callback) return DSA_pub(dsapub, 1) M2Crypto-0.31.0/M2Crypto/EC.py0000644000175000001440000003714413355123234016063 0ustar matejusers00000000000000from __future__ import absolute_import """ M2Crypto wrapper for OpenSSL ECDH/ECDSA API. @requires: OpenSSL 0.9.8 or newer Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam. All rights reserved.""" from M2Crypto import BIO, Err, EVP, m2, util if util.py27plus: from typing import AnyStr, Callable, Dict, Optional, Tuple, Union # noqa EC_Key = bytes class ECError(Exception): pass m2.ec_init(ECError) # Curve identifier constants NID_secp112r1 = m2.NID_secp112r1 # type: int NID_secp112r2 = m2.NID_secp112r2 # type: int NID_secp128r1 = m2.NID_secp128r1 # type: int NID_secp128r2 = m2.NID_secp128r2 # type: int NID_secp160k1 = m2.NID_secp160k1 # type: int NID_secp160r1 = m2.NID_secp160r1 # type: int NID_secp160r2 = m2.NID_secp160r2 # type: int NID_secp192k1 = m2.NID_secp192k1 # type: int NID_secp224k1 = m2.NID_secp224k1 # type: int NID_secp224r1 = m2.NID_secp224r1 # type: int NID_secp256k1 = m2.NID_secp256k1 # type: int NID_secp384r1 = m2.NID_secp384r1 # type: int NID_secp521r1 = m2.NID_secp521r1 # type: int NID_sect113r1 = m2.NID_sect113r1 # type: int NID_sect113r2 = m2.NID_sect113r2 # type: int NID_sect131r1 = m2.NID_sect131r1 # type: int NID_sect131r2 = m2.NID_sect131r2 # type: int NID_sect163k1 = m2.NID_sect163k1 # type: int NID_sect163r1 = m2.NID_sect163r1 # type: int NID_sect163r2 = m2.NID_sect163r2 # type: int NID_sect193r1 = m2.NID_sect193r1 # type: int NID_sect193r2 = m2.NID_sect193r2 # type: int # default for secg.org TLS test server NID_sect233k1 = m2.NID_sect233k1 # type: int NID_sect233r1 = m2.NID_sect233r1 # type: int NID_sect239k1 = m2.NID_sect239k1 # type: int NID_sect283k1 = m2.NID_sect283k1 # type: int NID_sect283r1 = m2.NID_sect283r1 # type: int NID_sect409k1 = m2.NID_sect409k1 # type: int NID_sect409r1 = m2.NID_sect409r1 # type: int NID_sect571k1 = m2.NID_sect571k1 # type: int NID_sect571r1 = m2.NID_sect571r1 # type: int NID_prime192v1 = m2.NID_X9_62_prime192v1 # type: int NID_prime192v2 = m2.NID_X9_62_prime192v2 # type: int NID_prime192v3 = m2.NID_X9_62_prime192v3 # type: int NID_prime239v1 = m2.NID_X9_62_prime239v1 # type: int NID_prime239v2 = m2.NID_X9_62_prime239v2 # type: int NID_prime239v3 = m2.NID_X9_62_prime239v3 # type: int NID_prime256v1 = m2.NID_X9_62_prime256v1 # type: int NID_c2pnb163v1 = m2.NID_X9_62_c2pnb163v1 # type: int NID_c2pnb163v2 = m2.NID_X9_62_c2pnb163v2 # type: int NID_c2pnb163v3 = m2.NID_X9_62_c2pnb163v3 # type: int NID_c2pnb176v1 = m2.NID_X9_62_c2pnb176v1 # type: int NID_c2tnb191v1 = m2.NID_X9_62_c2tnb191v1 # type: int NID_c2tnb191v2 = m2.NID_X9_62_c2tnb191v2 # type: int NID_c2tnb191v3 = m2.NID_X9_62_c2tnb191v3 # type: int NID_c2pnb208w1 = m2.NID_X9_62_c2pnb208w1 # type: int NID_c2tnb239v1 = m2.NID_X9_62_c2tnb239v1 # type: int NID_c2tnb239v2 = m2.NID_X9_62_c2tnb239v2 # type: int NID_c2tnb239v3 = m2.NID_X9_62_c2tnb239v3 # type: int NID_c2pnb272w1 = m2.NID_X9_62_c2pnb272w1 # type: int NID_c2pnb304w1 = m2.NID_X9_62_c2pnb304w1 # type: int NID_c2tnb359v1 = m2.NID_X9_62_c2tnb359v1 # type: int NID_c2pnb368w1 = m2.NID_X9_62_c2pnb368w1 # type: int NID_c2tnb431r1 = m2.NID_X9_62_c2tnb431r1 # type: int # To preserve compatibility with older names NID_X9_62_prime192v1 = NID_prime192v1 # type: int NID_X9_62_prime192v2 = NID_prime192v2 # type: int NID_X9_62_prime192v3 = NID_prime192v3 # type: int NID_X9_62_prime239v1 = NID_prime239v1 # type: int NID_X9_62_prime239v2 = NID_prime239v2 # type: int NID_X9_62_prime239v3 = NID_prime239v3 # type: int NID_X9_62_prime256v1 = NID_prime256v1 # type: int NID_X9_62_c2pnb163v1 = NID_c2pnb163v1 # type: int NID_X9_62_c2pnb163v2 = NID_c2pnb163v2 # type: int NID_X9_62_c2pnb163v3 = NID_c2pnb163v3 # type: int NID_X9_62_c2pnb176v1 = NID_c2pnb176v1 # type: int NID_X9_62_c2tnb191v1 = NID_c2tnb191v1 # type: int NID_X9_62_c2tnb191v2 = NID_c2tnb191v2 # type: int NID_X9_62_c2tnb191v3 = NID_c2tnb191v3 # type: int NID_X9_62_c2pnb208w1 = NID_c2pnb208w1 # type: int NID_X9_62_c2tnb239v1 = NID_c2tnb239v1 # type: int NID_X9_62_c2tnb239v2 = NID_c2tnb239v2 # type: int NID_X9_62_c2tnb239v3 = NID_c2tnb239v3 # type: int NID_X9_62_c2pnb272w1 = NID_c2pnb272w1 # type: int NID_X9_62_c2pnb304w1 = NID_c2pnb304w1 # type: int NID_X9_62_c2tnb359v1 = NID_c2tnb359v1 # type: int NID_X9_62_c2pnb368w1 = NID_c2pnb368w1 # type: int NID_X9_62_c2tnb431r1 = NID_c2tnb431r1 # type: int NID_wap_wsg_idm_ecid_wtls1 = m2.NID_wap_wsg_idm_ecid_wtls1 # type: int NID_wap_wsg_idm_ecid_wtls3 = m2.NID_wap_wsg_idm_ecid_wtls3 # type: int NID_wap_wsg_idm_ecid_wtls4 = m2.NID_wap_wsg_idm_ecid_wtls4 # type: int NID_wap_wsg_idm_ecid_wtls5 = m2.NID_wap_wsg_idm_ecid_wtls5 # type: int NID_wap_wsg_idm_ecid_wtls6 = m2.NID_wap_wsg_idm_ecid_wtls6 # type: int NID_wap_wsg_idm_ecid_wtls7 = m2.NID_wap_wsg_idm_ecid_wtls7 # type: int NID_wap_wsg_idm_ecid_wtls8 = m2.NID_wap_wsg_idm_ecid_wtls8 # type: int NID_wap_wsg_idm_ecid_wtls9 = m2.NID_wap_wsg_idm_ecid_wtls9 # type: int NID_wap_wsg_idm_ecid_wtls10 = m2.NID_wap_wsg_idm_ecid_wtls10 # type: int NID_wap_wsg_idm_ecid_wtls11 = m2.NID_wap_wsg_idm_ecid_wtls11 # type: int NID_wap_wsg_idm_ecid_wtls12 = m2.NID_wap_wsg_idm_ecid_wtls12 # type: int # The following two curves, according to OpenSSL, have a # "Questionable extension field!" and are not supported by # the OpenSSL inverse function. ECError: no inverse. # As such they cannot be used for signing. They might, # however, be usable for encryption but that has not # been tested. Until thir usefulness can be established, # they are not supported at this time. # NID_ipsec3 = m2.NID_ipsec3 # NID_ipsec4 = m2.NID_ipsec4 class EC(object): """ Object interface to a EC key pair. """ m2_ec_key_free = m2.ec_key_free def __init__(self, ec, _pyfree=0): # type: (EC, int) -> None assert m2.ec_key_type_check(ec), "'ec' type error" self.ec = ec self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_ec_key_free(self.ec) def __len__(self): # type: () -> int assert m2.ec_key_type_check(self.ec), "'ec' type error" return m2.ec_key_keylen(self.ec) def gen_key(self): # type: () -> int """ Generates the key pair from its parameters. Use:: keypair = EC.gen_params(curve) keypair.gen_key() to create an EC key pair. """ assert m2.ec_key_type_check(self.ec), "'ec' type error" m2.ec_key_gen_key(self.ec) def pub(self): # type: () -> EC_pub # Don't let python free return EC_pub(self.ec, 0) def sign_dsa(self, digest): # type: (bytes) -> Tuple[bytes, bytes] """ Sign the given digest using ECDSA. Returns a tuple (r,s), the two ECDSA signature parameters. """ assert self._check_key_type(), "'ec' type error" return m2.ecdsa_sign(self.ec, digest) def verify_dsa(self, digest, r, s): # type: (bytes, bytes, bytes) -> int """ Verify the given digest using ECDSA. r and s are the ECDSA signature parameters. """ assert self._check_key_type(), "'ec' type error" return m2.ecdsa_verify(self.ec, digest, r, s) def sign_dsa_asn1(self, digest): # type: (bytes) -> bytes assert self._check_key_type(), "'ec' type error" return m2.ecdsa_sign_asn1(self.ec, digest) def verify_dsa_asn1(self, digest, blob): assert self._check_key_type(), "'ec' type error" return m2.ecdsa_verify_asn1(self.ec, digest, blob) def compute_dh_key(self, pub_key): # type: (EC) -> Optional[bytes] """ Compute the ECDH shared key of this key pair and the given public key object. They must both use the same curve. Returns the shared key in binary as a buffer object. No Key Derivation Function is applied. """ assert self.check_key(), 'key is not initialised' return m2.ecdh_compute_key(self.ec, pub_key.ec) def save_key_bio(self, bio, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (BIO.BIO, Optional[str], Callable) -> int """ Save the key pair to an M2Crypto.BIO.BIO object in PEM format. :param bio: M2Crypto.BIO.BIO object to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ if cipher is None: return m2.ec_key_write_bio_no_cipher(self.ec, bio._ptr(), callback) else: ciph = getattr(m2, cipher, None) if ciph is None: raise ValueError('not such cipher %s' % cipher) return m2.ec_key_write_bio(self.ec, bio._ptr(), ciph(), callback) def save_key(self, file, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (AnyStr, Optional[str], Callable) -> int """ Save the key pair to a file in PEM format. :param file: Name of filename to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ with BIO.openfile(file, 'wb') as bio: return self.save_key_bio(bio, cipher, callback) def save_pub_key_bio(self, bio): # type: (BIO.BIO) -> int """ Save the public key to an M2Crypto.BIO.BIO object in PEM format. :param bio: M2Crypto.BIO.BIO object to save key to. """ return m2.ec_key_write_pubkey(self.ec, bio._ptr()) def save_pub_key(self, file): # type: (AnyStr) -> int """ Save the public key to a filename in PEM format. :param file: Name of filename to save key to. """ with BIO.openfile(file, 'wb') as bio: return m2.ec_key_write_pubkey(self.ec, bio._ptr()) def as_pem(self, cipher='aes_128_cbc', callback=util.passphrase_callback): """ Returns the key(pair) as a string in PEM format. If no password is passed and the cipher is set it exits with error """ with BIO.MemoryBuffer() as bio: self.save_key_bio(bio, cipher, callback) return bio.read() def _check_key_type(self): # type: () -> int return m2.ec_key_type_check(self.ec) def check_key(self): # type: () -> int assert m2.ec_key_type_check(self.ec), "'ec' type error" return m2.ec_key_check_key(self.ec) class EC_pub(EC): """ Object interface to an EC public key. ((don't like this implementation inheritance)) """ def __init__(self, ec, _pyfree=0): # type: (EC, int) -> None EC.__init__(self, ec, _pyfree) self.der = None # type: Optional[bytes] def get_der(self): # type: () -> bytes """ Returns the public key in DER format as a buffer object. """ assert self.check_key(), 'key is not initialised' if self.der is None: self.der = m2.ec_key_get_public_der(self.ec) return self.der def get_key(self): # type: () -> bytes """ Returns the public key as a byte string. """ assert self.check_key(), 'key is not initialised' return m2.ec_key_get_public_key(self.ec) save_key = EC.save_pub_key save_key_bio = EC.save_pub_key_bio def gen_params(curve): # type: (int) -> EC """ Factory function that generates EC parameters and instantiates a EC object from the output. :param curve: This is the OpenSSL nid of the curve to use. """ assert curve in [x['NID'] for x in m2.ec_get_builtin_curves()], \ 'Elliptic curve %s is not available on this system.' % \ m2.obj_nid2sn(curve) return EC(m2.ec_key_new_by_curve_name(curve), 1) def load_key(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> EC """ Factory function that instantiates a EC object. :param file: Names the filename that contains the PEM representation of the EC key pair. :param callback: Python callback object that will be invoked if the EC key pair is passphrase-protected. """ with BIO.openfile(file) as bio: return load_key_bio(bio, callback) def load_key_string(string, callback=util.passphrase_callback): # type: (str, Callable) -> EC """ Load an EC key pair from a string. :param string: String containing EC key pair in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback. :return: M2Crypto.EC.EC object. """ with BIO.MemoryBuffer(string) as bio: return load_key_bio(bio, callback) def load_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> EC """ Factory function that instantiates a EC object. :param bio: M2Crypto.BIO object that contains the PEM representation of the EC key pair. :param callback: Python callback object that will be invoked if the EC key pair is passphrase-protected. """ return EC(m2.ec_key_read_bio(bio._ptr(), callback), 1) def load_pub_key(file): # type: (AnyStr) -> EC_pub """ Load an EC public key from filename. :param file: Name of filename containing EC public key in PEM format. :return: M2Crypto.EC.EC_pub object. """ with BIO.openfile(file) as bio: return load_pub_key_bio(bio) def load_key_string_pubkey(string, callback=util.passphrase_callback): # type: (str, Callable) -> PKey """ Load an M2Crypto.EC.PKey from a public key as a string. :param string: String containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EC.PKey object. """ with BIO.MemoryBuffer(string) as bio: return EVP.load_key_bio_pubkey(bio, callback) def load_pub_key_bio(bio): # type: (BIO.BIO) -> EC_pub """ Load an EC public key from an M2Crypto.BIO.BIO object. :param bio: M2Crypto.BIO.BIO object containing EC public key in PEM format. :return: M2Crypto.EC.EC_pub object. """ ec = m2.ec_key_read_pubkey(bio._ptr()) if ec is None: ec_error() return EC_pub(ec, 1) def ec_error(): # type: () -> ECError raise ECError(Err.get_error_message()) def pub_key_from_der(der): # type: (bytes) -> EC_pub """ Create EC_pub from DER. """ return EC_pub(m2.ec_key_from_pubkey_der(der), 1) def pub_key_from_params(curve, bytes): # type: (bytes, bytes) -> EC_pub """ Create EC_pub from curve name and octet string. """ return EC_pub(m2.ec_key_from_pubkey_params(curve, bytes), 1) def get_builtin_curves(): # type: () -> Tuple[Dict[str, Union[int, str]]] return m2.ec_get_builtin_curves() M2Crypto-0.31.0/M2Crypto/EVP.py0000644000175000001440000003315013355123234016217 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto wrapper for OpenSSL EVP API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions Copyright (c) 2004-2007 Open Source Applications Foundation. Author: Heikki Toivonen """ import logging from M2Crypto import BIO, Err, RSA, m2, util if util.py27plus: from typing import AnyStr, Optional, Callable # noqa log = logging.getLogger('EVP') class EVPError(ValueError): pass m2.evp_init(EVPError) def pbkdf2(password, salt, iter, keylen): # type: (bytes, bytes, int, int) -> bytes """ Derive a key from password using PBKDF2 algorithm specified in RFC 2898. :param password: Derive the key from this password. :param salt: Salt. :param iter: Number of iterations to perform. :param keylen: Length of key to produce. :return: Key. """ return m2.pkcs5_pbkdf2_hmac_sha1(password, salt, iter, keylen) class MessageDigest(object): """ Message Digest """ m2_md_ctx_free = m2.md_ctx_free def __init__(self, algo): # type: (str) -> None md = getattr(m2, algo, None) # type: Optional[Callable] if md is None: # if the digest algorithm isn't found as an attribute of the m2 # module, try to look up the digest using get_digestbyname() self.md = m2.get_digestbyname(algo) else: self.md = md() self.ctx = m2.md_ctx_new() m2.digest_init(self.ctx, self.md) def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_md_ctx_free(self.ctx) def update(self, data): # type: (bytes) -> int """ Add data to be digested. :return: -1 for Python error, 1 for success, 0 for OpenSSL failure. """ return m2.digest_update(self.ctx, data) def final(self): return m2.digest_final(self.ctx) # Deprecated. digest = final class HMAC(object): m2_hmac_ctx_free = m2.hmac_ctx_free def __init__(self, key, algo='sha1'): # type: (bytes, str) -> None md = getattr(m2, algo, None) if md is None: raise ValueError('unknown algorithm', algo) self.md = md() self.ctx = m2.hmac_ctx_new() m2.hmac_init(self.ctx, key, self.md) def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_hmac_ctx_free(self.ctx) def reset(self, key): # type: (bytes) -> None m2.hmac_init(self.ctx, key, self.md) def update(self, data): # type: (bytes) -> None m2.hmac_update(self.ctx, data) def final(self): # type: () -> bytes return m2.hmac_final(self.ctx) digest = final def hmac(key, data, algo='sha1'): # type: (bytes, bytes, str) -> bytes md = getattr(m2, algo, None) if md is None: raise ValueError('unknown algorithm', algo) return m2.hmac(key, data, md()) class Cipher(object): m2_cipher_ctx_free = m2.cipher_ctx_free def __init__(self, alg, key, iv, op, key_as_bytes=0, d='md5', salt=b'12345678', i=1, padding=1): # type: (str, bytes, bytes, object, int, str, bytes, int, int) -> None cipher = getattr(m2, alg, None) if cipher is None: raise ValueError('unknown cipher', alg) self.cipher = cipher() if key_as_bytes: kmd = getattr(m2, d, None) if kmd is None: raise ValueError('unknown message digest', d) key = m2.bytes_to_key(self.cipher, kmd(), key, salt, iv, i) self.ctx = m2.cipher_ctx_new() m2.cipher_init(self.ctx, self.cipher, key, iv, op) self.set_padding(padding) del key def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_cipher_ctx_free(self.ctx) def update(self, data): # type: (bytes) -> bytes return m2.cipher_update(self.ctx, data) def final(self): # type: () -> bytes return m2.cipher_final(self.ctx) def set_padding(self, padding=1): # type: (int) -> int """ Actually always return 1 """ return m2.cipher_set_padding(self.ctx, padding) class PKey(object): """ Public Key """ m2_pkey_free = m2.pkey_free m2_md_ctx_free = m2.md_ctx_free def __init__(self, pkey=None, _pyfree=0, md='sha1'): # type: (Optional[bytes], int, str) -> None if pkey is not None: self.pkey = pkey # type: bytes self._pyfree = _pyfree else: self.pkey = m2.pkey_new() self._pyfree = 1 self._set_context(md) def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_pkey_free(self.pkey) if getattr(self, 'ctx', None): self.m2_md_ctx_free(self.ctx) def _ptr(self): return self.pkey def _set_context(self, md): # type: (str) -> None mda = getattr(m2, md, None) # type: Optional[Callable] if mda is None: raise ValueError('unknown message digest', md) self.md = mda() self.ctx = m2.md_ctx_new() # type: Context def reset_context(self, md='sha1'): # type: (str) -> None """ Reset internal message digest context. :param md: The message digest algorithm. """ self._set_context(md) def sign_init(self): # type: () -> None """ Initialise signing operation with self. """ m2.sign_init(self.ctx, self.md) def sign_update(self, data): # type: (bytes) -> None """ Feed data to signing operation. :param data: Data to be signed. """ m2.sign_update(self.ctx, data) def sign_final(self): # type: () -> bytes """ Return signature. :return: The signature. """ return m2.sign_final(self.ctx, self.pkey) # Deprecated update = sign_update final = sign_final def verify_init(self): # type: () -> None """ Initialise signature verification operation with self. """ m2.verify_init(self.ctx, self.md) def verify_update(self, data): # type: (bytes) -> int """ Feed data to verification operation. :param data: Data to be verified. :return: -1 on Python error, 1 for success, 0 for OpenSSL error """ return m2.verify_update(self.ctx, data) def verify_final(self, sign): # type: (bytes) -> int """ Return result of verification. :param sign: Signature to use for verification :return: Result of verification: 1 for success, 0 for failure, -1 on other error. """ return m2.verify_final(self.ctx, sign, self.pkey) def assign_rsa(self, rsa, capture=1): # type: (RSA.RSA, int) -> int """ Assign the RSA key pair to self. :param rsa: M2Crypto.RSA.RSA object to be assigned to self. :param capture: If true (default), this PKey object will own the RSA object, meaning that once the PKey object gets deleted it is no longer safe to use the RSA object. :return: Return 1 for success and 0 for failure. """ if capture: ret = m2.pkey_assign_rsa(self.pkey, rsa.rsa) if ret: rsa._pyfree = 0 else: ret = m2.pkey_set1_rsa(self.pkey, rsa.rsa) return ret def get_rsa(self): # type: () -> RSA.RSA_pub """ Return the underlying RSA key if that is what the EVP instance is holding. """ rsa_ptr = m2.pkey_get1_rsa(self.pkey) rsa = RSA.RSA_pub(rsa_ptr, 1) return rsa def save_key(self, file, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (AnyStr, Optional[str], Callable) -> int """ Save the key pair to a file in PEM format. :param file: Name of file to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ with BIO.openfile(file, 'wb') as bio: return self.save_key_bio(bio, cipher, callback) def save_key_bio(self, bio, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (BIO.BIO, Optional[str], Callable) -> int """ Save the key pair to the M2Crypto.BIO object 'bio' in PEM format. :param bio: M2Crypto.BIO object to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ if cipher is None: return m2.pkey_write_pem_no_cipher(self.pkey, bio._ptr(), callback) else: proto = getattr(m2, cipher, None) if proto is None: raise ValueError('no such cipher %s' % cipher) return m2.pkey_write_pem(self.pkey, bio._ptr(), proto(), callback) def as_pem(self, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (Optional[str], Callable) -> bytes """ Return key in PEM format in a string. :param cipher: Symmetric cipher to protect the key. The default cipher is ``'aes_128_cbc'``. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ bio = BIO.MemoryBuffer() self.save_key_bio(bio, cipher, callback) return bio.read_all() def as_der(self): # type: () -> bytes """ Return key in DER format in a string """ buf = m2.pkey_as_der(self.pkey) bio = BIO.MemoryBuffer(buf) return bio.read_all() def size(self): # type: () -> int """ Return the size of the key in bytes. """ return m2.pkey_size(self.pkey) def get_modulus(self): # type: () -> Optional[bytes] """ Return the modulus in hex format. """ return m2.pkey_get_modulus(self.pkey) def load_key(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> PKey """ Load an M2Crypto.EVP.PKey from file. :param file: Name of file containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EVP.PKey object. """ with BIO.openfile(file, 'r') as bio: cptr = m2.pkey_read_pem(bio.bio, callback) return PKey(cptr, 1) def load_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> PKey """ Load an M2Crypto.EVP.PKey from an M2Crypto.BIO object. :param bio: M2Crypto.BIO object containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EVP.PKey object. """ cptr = m2.pkey_read_pem(bio._ptr(), callback) return PKey(cptr, 1) def load_key_bio_pubkey(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> PKey """ Load an M2Crypto.EVP.PKey from a public key as a M2Crypto.BIO object. :param bio: M2Crypto.BIO object containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EVP.PKey object. """ cptr = m2.pkey_read_pem_pubkey(bio._ptr(), callback) if cptr is None: raise EVPError(Err.get_error()) return PKey(cptr, 1) def load_key_string(string, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> PKey """ Load an M2Crypto.EVP.PKey from a string. :param string: String containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EVP.PKey object. """ bio = BIO.MemoryBuffer(string) return load_key_bio(bio, callback) def load_key_string_pubkey(string, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> PKey """ Load an M2Crypto.EVP.PKey from a public key as a string. :param string: String containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EVP.PKey object. """ bio = BIO.MemoryBuffer(string) return load_key_bio_pubkey(bio, callback) M2Crypto-0.31.0/M2Crypto/Engine.py0000644000175000001440000001104713355123234016773 0ustar matejusers00000000000000# vim: sts=4 sw=4 et from __future__ import absolute_import """ M2Crypto wrapper for OpenSSL ENGINE API. Pavel Shramov IMEC MSU """ from M2Crypto import EVP, Err, X509, m2, six, util if util.py27plus: from typing import AnyStr, Callable, Optional # noqa class EngineError(Exception): pass m2.engine_init_error(EngineError) class Engine(object): """Wrapper for ENGINE object.""" m2_engine_free = m2.engine_free def __init__(self, id=None, _ptr=None, _pyfree=1): # type: (Optional[bytes], Optional[bytes], int) -> None """Create new Engine from ENGINE pointer or obtain by id""" if not _ptr and not id: raise ValueError("No engine id specified") self._ptr = _ptr if not self._ptr: self._ptr = m2.engine_by_id(id) if not self._ptr: raise ValueError("Unknown engine: %s" % id) self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_engine_free(self._ptr) def init(self): # type: () -> int """Obtain a functional reference to the engine. :return: 0 on error, non-zero on success.""" return m2.engine_init(self._ptr) def finish(self): # type: () -> int """Release a functional and structural reference to the engine.""" return m2.engine_finish(self._ptr) def ctrl_cmd_string(self, cmd, arg, optional=0): # type: (AnyStr, Optional[AnyStr], int) -> None """Call ENGINE_ctrl_cmd_string""" cmd = six.ensure_str(cmd) if arg is not None: arg = six.ensure_str(arg) if not m2.engine_ctrl_cmd_string(self._ptr, cmd, arg, optional): raise EngineError(Err.get_error()) def get_name(self): # type: () -> bytes """Return engine name""" return m2.engine_get_name(self._ptr) def get_id(self): # type: () -> bytes """Return engine id""" return m2.engine_get_id(self._ptr) def set_default(self, methods=m2.ENGINE_METHOD_ALL): # type: (int) -> int """ Use this engine as default for methods specified in argument :param methods: Possible values are bitwise OR of m2.ENGINE_METHOD_* """ return m2.engine_set_default(self._ptr, methods) def _engine_load_key(self, func, name, pin=None): # type: (Callable, bytes, Optional[bytes]) -> EVP.PKey """Helper function for loading keys""" ui = m2.ui_openssl() cbd = m2.engine_pkcs11_data_new(pin) try: kptr = func(self._ptr, name, ui, cbd) if not kptr: raise EngineError(Err.get_error()) key = EVP.PKey(kptr, _pyfree=1) finally: m2.engine_pkcs11_data_free(cbd) return key def load_private_key(self, name, pin=None): # type: (bytes, Optional[bytes]) -> X509.X509 """Load private key with engine methods (e.g from smartcard). If pin is not set it will be asked """ return self._engine_load_key(m2.engine_load_private_key, name, pin) def load_public_key(self, name, pin=None): # type: (bytes, Optional[bytes]) -> EVP.PKey """Load public key with engine methods (e.g from smartcard).""" return self._engine_load_key(m2.engine_load_public_key, name, pin) def load_certificate(self, name): # type: (bytes) -> X509.X509 """Load certificate from engine (e.g from smartcard). NOTE: This function may be not implemented by engine!""" cptr = m2.engine_load_certificate(self._ptr, name) if not cptr: raise EngineError("Certificate or card not found") return X509.X509(cptr, _pyfree=1) def load_dynamic_engine(id, sopath): # type: (bytes, AnyStr) -> Engine """Load and return dymanic engine from sopath and assign id to it""" if isinstance(sopath, six.text_type): sopath = sopath.encode('utf8') m2.engine_load_dynamic() e = Engine('dynamic') e.ctrl_cmd_string('SO_PATH', sopath) e.ctrl_cmd_string('ID', id) e.ctrl_cmd_string('LIST_ADD', '1') e.ctrl_cmd_string('LOAD', None) return e def load_dynamic(): # type: () -> None """Load dynamic engine""" m2.engine_load_dynamic() def load_openssl(): # type: () -> None """Load openssl engine""" m2.engine_load_openssl() def cleanup(): # type: () -> None """If you load any engines, you need to clean up after your application is finished with the engines.""" m2.engine_cleanup() M2Crypto-0.31.0/M2Crypto/Err.py0000644000175000001440000000327013355123234016315 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto wrapper for OpenSSL Error API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" from M2Crypto import BIO, m2, py27plus, util, six # noqa if py27plus: from typing import Optional # noqa def get_error(): # type: () -> Optional[str] err = BIO.MemoryBuffer() m2.err_print_errors(err.bio_ptr()) err_msg = err.read() if err_msg: return six.ensure_text(err_msg) def get_error_code(): # type: () -> int return m2.err_get_error() def peek_error_code(): # type: () -> int return m2.err_peek_error() def get_error_lib(err): # type: (int) -> str return six.ensure_text(m2.err_lib_error_string(err)) def get_error_func(err): # type: (int) -> str return six.ensure_text(m2.err_func_error_string(err)) def get_error_reason(err): # type: (int) -> str return six.ensure_text(m2.err_reason_error_string(err)) def get_error_message(): # type: () -> str return six.ensure_text(get_error_reason(get_error_code())) def get_x509_verify_error(err): # type: (int) -> str return six.ensure_text(m2.x509_get_verify_error(err)) class SSLError(Exception): def __init__(self, err, client_addr): # type: (int, util.AddrType) -> None self.err = err self.client_addr = client_addr def __str__(self): # type: () -> str if not isinstance(self.client_addr, six.text_type): s = self.client_addr.decode('utf8') else: s = self.client_addr return "%s: %s: %s" % (get_error_func(self.err), s, get_error_reason(self.err)) class M2CryptoError(Exception): pass M2Crypto-0.31.0/M2Crypto/RC4.py0000644000175000001440000000155213355123234016156 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto wrapper for OpenSSL RC4 API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" from M2Crypto.m2 import rc4_free, rc4_new, rc4_set_key, rc4_update class RC4(object): """Object interface to the stream cipher RC4.""" rc4_free = rc4_free def __init__(self, key=None): # type: (bytes) -> None self.cipher = rc4_new() if key: rc4_set_key(self.cipher, key) def __del__(self): # type: () -> None if getattr(self, 'cipher', None): self.rc4_free(self.cipher) def set_key(self, key): # type: (bytes) -> None rc4_set_key(self.cipher, key) def update(self, data): # type: (bytes) -> bytes return rc4_update(self.cipher, data) def final(self): # type: () -> str return '' M2Crypto-0.31.0/M2Crypto/RSA.py0000644000175000001440000003405513355123234016217 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto wrapper for OpenSSL RSA API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" import sys from M2Crypto import BIO, Err, m2, util if util.py27plus: from typing import Any, AnyStr, Callable, Dict, List, IO, Optional, Tuple # noqa class RSAError(Exception): pass m2.rsa_init(RSAError) no_padding = m2.no_padding pkcs1_padding = m2.pkcs1_padding sslv23_padding = m2.sslv23_padding pkcs1_oaep_padding = m2.pkcs1_oaep_padding class RSA(object): """ RSA Key Pair. """ m2_rsa_free = m2.rsa_free def __init__(self, rsa, _pyfree=0): # type: (bytes, int) -> None """ :param rsa: binary representation of OpenSSL RSA type """ assert m2.rsa_type_check(rsa), "'rsa' type error" self.rsa = rsa self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_rsa_free(self.rsa) def __len__(self): # type: () -> int return int(m2.rsa_size(self.rsa) << 3) def __getattr__(self, name): # type: (str) -> bytes if name == 'e': return m2.rsa_get_e(self.rsa) elif name == 'n': return m2.rsa_get_n(self.rsa) else: raise AttributeError def pub(self): # type: () -> Tuple[bytes, bytes] assert self.check_key(), 'key is not initialised' return m2.rsa_get_e(self.rsa), m2.rsa_get_n(self.rsa) def public_encrypt(self, data, padding): # type: (bytes, int) -> bytes assert self.check_key(), 'key is not initialised' return m2.rsa_public_encrypt(self.rsa, data, padding) def public_decrypt(self, data, padding): # type: (bytes, int) -> bytes assert self.check_key(), 'key is not initialised' return m2.rsa_public_decrypt(self.rsa, data, padding) def private_encrypt(self, data, padding): # type: (bytes, int) -> bytes assert self.check_key(), 'key is not initialised' return m2.rsa_private_encrypt(self.rsa, data, padding) def private_decrypt(self, data, padding): # type: (bytes, int) -> bytes assert self.check_key(), 'key is not initialised' return m2.rsa_private_decrypt(self.rsa, data, padding) def save_key_bio(self, bio, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (BIO.BIO, Optional[str], Callable) -> int """ Save the key pair to an M2Crypto.BIO.BIO object in PEM format. :param bio: M2Crypto.BIO.BIO object to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ if cipher is None: return m2.rsa_write_key_no_cipher(self.rsa, bio._ptr(), callback) else: ciph = getattr(m2, cipher, None) if ciph is None: raise RSAError('not such cipher %s' % cipher) else: ciph = ciph() return m2.rsa_write_key(self.rsa, bio._ptr(), ciph, callback) def save_key(self, file, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (AnyStr, Optional[str], Callable) -> int """ Save the key pair to a file in PEM format. :param file: Name of file to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ with BIO.openfile(file, 'wb') as bio: return self.save_key_bio(bio, cipher, callback) save_pem = save_key def as_pem(self, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (Optional[str], Callable) -> bytes """ Returns the key(pair) as a string in PEM format. """ bio = BIO.MemoryBuffer() self.save_key_bio(bio, cipher, callback) return bio.read() def save_key_der_bio(self, bio): # type: (BIO.BIO) -> int """ Save the key pair to an M2Crypto.BIO.BIO object in DER format. :param bio: M2Crypto.BIO.BIO object to save key to. """ return m2.rsa_write_key_der(self.rsa, bio._ptr()) def save_key_der(self, file): # type: (AnyStr) -> int """ Save the key pair to a file in DER format. :param file: Filename to save key to """ with BIO.openfile(file, 'wb') as bio: return self.save_key_der_bio(bio) def save_pub_key_bio(self, bio): # type: (BIO.BIO) -> int """ Save the public key to an M2Crypto.BIO.BIO object in PEM format. :param bio: M2Crypto.BIO.BIO object to save key to. """ return m2.rsa_write_pub_key(self.rsa, bio._ptr()) def save_pub_key(self, file): # type: (AnyStr) -> int """ Save the public key to a file in PEM format. :param file: Name of file to save key to. """ with BIO.openfile(file, 'wb') as bio: return m2.rsa_write_pub_key(self.rsa, bio._ptr()) def check_key(self): # type: () -> int """ :return: returns 1 if rsa is a valid RSA key, and 0 otherwise. -1 is returned if an error occurs while checking the key. If the key is invalid or an error occurred, the reason code can be obtained using ERR_get_error(3). """ return m2.rsa_check_key(self.rsa) def sign_rsassa_pss(self, digest, algo='sha1', salt_length=20): # type: (bytes, str, int) -> bytes """ Signs a digest with the private key using RSASSA-PSS :param digest: A digest created by using the digest method :param salt_length: The length of the salt to use :param algo: The hash algorithm to use Legal values like 'sha1','sha224', 'sha256', 'ripemd160', and 'md5'. :return: a string which is the signature """ hash = getattr(m2, algo, None) if hash is None: raise RSAError('not such hash algorithm %s' % algo) signature = m2.rsa_padding_add_pkcs1_pss(self.rsa, digest, hash(), salt_length) return self.private_encrypt(signature, m2.no_padding) def verify_rsassa_pss(self, data, signature, algo='sha1', salt_length=20): # type: (bytes, bytes, str, int) -> int """ Verifies the signature RSASSA-PSS :param data: Data that has been signed :param signature: The signature signed with RSASSA-PSS :param salt_length: The length of the salt that was used :param algo: The hash algorithm to use Legal values are for example 'sha1','sha224', 'sha256', 'ripemd160', and 'md5'. :return: 1 or 0, depending on whether the signature was verified or not. """ hash = getattr(m2, algo, None) if hash is None: raise RSAError('not such hash algorithm %s' % algo) plain_signature = self.public_decrypt(signature, m2.no_padding) return m2.rsa_verify_pkcs1_pss(self.rsa, data, plain_signature, hash(), salt_length) def sign(self, digest, algo='sha1'): # type: (bytes, str) -> bytes """ Signs a digest with the private key :param digest: A digest created by using the digest method :param algo: The method that created the digest. Legal values like 'sha1','sha224', 'sha256', 'ripemd160', and 'md5'. :return: a string which is the signature """ digest_type = getattr(m2, 'NID_' + algo, None) if digest_type is None: raise ValueError('unknown algorithm', algo) return m2.rsa_sign(self.rsa, digest, digest_type) def verify(self, data, signature, algo='sha1'): # type: (bytes, bytes, str) -> int """ Verifies the signature with the public key :param data: Data that has been signed :param signature: The signature signed with the private key :param algo: The method use to create digest from the data before it was signed. Legal values like 'sha1','sha224', 'sha256', 'ripemd160', and 'md5'. :return: 1 or 0, depending on whether the signature was verified or not. """ digest_type = getattr(m2, 'NID_' + algo, None) if digest_type is None: raise ValueError('unknown algorithm', algo) return m2.rsa_verify(self.rsa, data, signature, digest_type) class RSA_pub(RSA): """ Object interface to an RSA public key. """ def __setattr__(self, name, value): # type: (str, bytes) -> None if name in ['e', 'n']: raise RSAError('use factory function new_pub_key() to set (e, n)') else: self.__dict__[name] = value def private_encrypt(self, *argv): # type: (*Any) -> None raise RSAError('RSA_pub object has no private key') def private_decrypt(self, *argv): # type: (*Any) -> None raise RSAError('RSA_pub object has no private key') def save_key(self, file, *args, **kw): # type: (AnyStr, *Any, **Any) -> int """ Save public key to file. """ return self.save_pub_key(file) def save_key_bio(self, bio, *args, **kw): # type: (BIO.BIO, *Any, **Any) -> int """ Save public key to BIO. """ return self.save_pub_key_bio(bio) # save_key_der # save_key_der_bio def check_key(self): # type: () -> int return m2.rsa_check_pub_key(self.rsa) def rsa_error(): # type: () -> None raise RSAError(Err.get_error_message()) def keygen_callback(p, n, out=sys.stdout): # type: (int, Any, IO[str]) -> None """ Default callback for gen_key(). """ ch = ['.', '+', '*', '\n'] out.write(ch[p]) out.flush() def gen_key(bits, e, callback=keygen_callback): # type: (int, int, Callable) -> RSA """ Generate an RSA key pair. :param bits: Key length, in bits. :param e: The RSA public exponent. :param callback: A Python callable object that is invoked during key generation; its usual purpose is to provide visual feedback. The default callback is keygen_callback. :return: M2Crypto.RSA.RSA object. """ return RSA(m2.rsa_generate_key(bits, e, callback), 1) def load_key(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> RSA """ Load an RSA key pair from file. :param file: Name of file containing RSA public key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback. :return: M2Crypto.RSA.RSA object. """ with BIO.openfile(file) as bio: return load_key_bio(bio, callback) def load_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> RSA """ Load an RSA key pair from an M2Crypto.BIO.BIO object. :param bio: M2Crypto.BIO.BIO object containing RSA key pair in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback. :return: M2Crypto.RSA.RSA object. """ rsa = m2.rsa_read_key(bio._ptr(), callback) if rsa is None: rsa_error() return RSA(rsa, 1) def load_key_string(string, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> RSA """ Load an RSA key pair from a string. :param string: String containing RSA key pair in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback. :return: M2Crypto.RSA.RSA object. """ bio = BIO.MemoryBuffer(string) return load_key_bio(bio, callback) def load_pub_key(file): # type: (AnyStr) -> RSA_pub """ Load an RSA public key from file. :param file: Name of file containing RSA public key in PEM format. :return: M2Crypto.RSA.RSA_pub object. """ with BIO.openfile(file) as bio: return load_pub_key_bio(bio) def load_pub_key_bio(bio): # type: (BIO.BIO) -> RSA_pub """ Load an RSA public key from an M2Crypto.BIO.BIO object. :param bio: M2Crypto.BIO.BIO object containing RSA public key in PEM format. :return: M2Crypto.RSA.RSA_pub object. """ rsa = m2.rsa_read_pub_key(bio._ptr()) if rsa is None: rsa_error() return RSA_pub(rsa, 1) def new_pub_key(e_n): # type: (Tuple[bytes, bytes]) -> RSA_pub """ Instantiate an RSA_pub object from an (e, n) tuple. :param e: The RSA public exponent; it is a string in OpenSSL's MPINT format - 4-byte big-endian bit-count followed by the appropriate number of bits. :param n: The RSA composite of primes; it is a string in OpenSSL's MPINT format - 4-byte big-endian bit-count followed by the appropriate number of bits. :return: M2Crypto.RSA.RSA_pub object. """ (e, n) = e_n rsa = m2.rsa_new() m2.rsa_set_en(rsa, e, n) return RSA_pub(rsa, 1) M2Crypto-0.31.0/M2Crypto/Rand.py0000644000175000001440000001057013355123234016452 0ustar matejusers00000000000000"""M2Crypto wrapper for OpenSSL PRNG. Requires OpenSSL 0.9.5 and above. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Copyright (c) 2014-2017 Matej Cepl. All rights reserved. See LICENCE for the license information. """ from __future__ import absolute_import from M2Crypto import m2, py27plus, six if py27plus: from typing import AnyStr, Tuple # noqa __all__ = ['rand_seed', 'rand_add', 'load_file', 'save_file', 'rand_bytes', 'rand_pseudo_bytes', 'rand_file_name', 'rand_status'] class RandError(ValueError): pass m2.rand_init(RandError) def rand_add(blob, entropy): # type: (bytes, float) -> None """ Mixes blob into the PRNG state. :param blob: added data :param entropy: (the lower bound of) an estimate of how much randomness is contained in blob, measured in bytes. Thus, if the data at buf are unpredictable to an adversary, this increases the uncertainty about the state and makes the PRNG output less predictable. Suitable input comes from user interaction (random key presses, mouse movements) and certain hardware events. Details about sources of randomness and how to estimate their entropy can be found in the literature, e.g. RFC 1750. """ m2.rand_add(blob, entropy) # pylint: disable=no-member def rand_seed(seed): # type: (bytes) -> None """ Equivalent to rand_add() when len(seed) == entropy. :param seed: added data (see description at rand_add) """ m2.rand_seed(seed) # pylint: disable=no-member def rand_status(): # type: () -> int """ Check whether there is enough entropy in PRNG. :return: 1 if the PRNG has been seeded with enough data, 0 otherwise. """ return m2.rand_status() # pylint: disable=no-member def rand_file_name(): # type: () -> str """ Generate a default path for the random seed file. :return: string with the filename. The seed file is $RANDFILE if that environment variable is set, $HOME/.rnd otherwise. If $HOME is not set either, an error occurs. """ return six.ensure_text(m2.rand_file_name()) # pylint: disable=no-member def load_file(filename, max_bytes): # type: (AnyStr, int) -> int """ Read a number of bytes from file filename and adds them to the PRNG. If max_bytes is non-negative, up to to max_bytes are read; starting with OpenSSL 0.9.5, if max_bytes is -1, the complete file is read. :param filename: :param max_bytes: :return: the number of bytes read. """ return m2.rand_load_file(six.ensure_str(filename), max_bytes) # pylint: disable=no-member def save_file(filename): # type: (AnyStr) -> int """ Write a number of random bytes (currently 1024) to file. The file then can be used to initialize the PRNG by calling load_file() in a later session. :param filename: :return: returns the number of bytes written, and -1 if the bytes written were generated without appropriate seed. """ return m2.rand_save_file(filename) # pylint: disable=no-member def rand_bytes(num): # type: (int) -> bytes """ Return n cryptographically strong pseudo-random bytes. An error occurs if the PRNG has not been seeded with enough randomness to ensure an unpredictable byte sequence. :param num: number of bytes to be returned :return: random bytes """ return m2.rand_bytes(num) # pylint: disable=no-member def rand_pseudo_bytes(num): # type: (int) -> Tuple[bytes, int] """ Return num pseudo-random bytes into buf. Pseudo-random byte sequences generated by this method will be unique if they are of sufficient length, but are not necessarily unpredictable. They can be used for non-cryptographic purposes and for certain purposes in cryptographic protocols, but usually not for key generation etc. Output of the function is mixed into the entropy pool before retrieving the new pseudo-random bytes unless disabled at compile time (see FAQ). :param num: number of bytes to be returned :return: random bytes """ import warnings if m2.OPENSSL_VERSION_NUMBER >= 0x10100000: warnings.warn('The underlying OpenSSL method has been ' + 'deprecated. Use Rand.rand_bytes instead.', DeprecationWarning) return m2.rand_pseudo_bytes(num) # pylint: disable=no-member M2Crypto-0.31.0/M2Crypto/SMIME.py0000644000175000001440000002143213355123234016437 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto wrapper for OpenSSL S/MIME API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" from M2Crypto import BIO, EVP, Err, X509, m2, util if util.py27plus: from typing import AnyStr, Callable, Optional # noqa PKCS7_TEXT = m2.PKCS7_TEXT # type: int PKCS7_NOCERTS = m2.PKCS7_NOCERTS # type: int PKCS7_NOSIGS = m2.PKCS7_NOSIGS # type: int PKCS7_NOCHAIN = m2.PKCS7_NOCHAIN # type: int PKCS7_NOINTERN = m2.PKCS7_NOINTERN # type: int PKCS7_NOVERIFY = m2.PKCS7_NOVERIFY # type: int PKCS7_DETACHED = m2.PKCS7_DETACHED # type: int PKCS7_BINARY = m2.PKCS7_BINARY # type: int PKCS7_NOATTR = m2.PKCS7_NOATTR # type: int PKCS7_SIGNED = m2.PKCS7_SIGNED # type: int PKCS7_ENVELOPED = m2.PKCS7_ENVELOPED # type: int PKCS7_SIGNED_ENVELOPED = m2.PKCS7_SIGNED_ENVELOPED # Deprecated PKCS7_DATA = m2.PKCS7_DATA # type: int class PKCS7_Error(Exception): pass m2.pkcs7_init(PKCS7_Error) class PKCS7(object): m2_pkcs7_free = m2.pkcs7_free def __init__(self, pkcs7=None, _pyfree=0): # type: (Optional[bytes], int) -> None """PKCS7 object. :param pkcs7: binary representation of the OpenSSL type PKCS7 """ if pkcs7 is not None: self.pkcs7 = pkcs7 self._pyfree = _pyfree else: self.pkcs7 = m2.pkcs7_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_pkcs7_free(self.pkcs7) def _ptr(self): return self.pkcs7 def type(self, text_name=0): # type: (int) -> int if text_name: return m2.pkcs7_type_sn(self.pkcs7) else: return m2.pkcs7_type_nid(self.pkcs7) def write(self, bio): # type: (BIO.BIO) -> int return m2.pkcs7_write_bio(self.pkcs7, bio._ptr()) def write_der(self, bio): # type: (BIO.BIO) -> int return m2.pkcs7_write_bio_der(self.pkcs7, bio._ptr()) def get0_signers(self, certs, flags=0): # type: (X509.X509_Stack, int) -> X509.X509_Stack return X509.X509_Stack(m2.pkcs7_get0_signers(self.pkcs7, certs.stack, flags), 1) def load_pkcs7(p7file): # type: (AnyStr) -> PKCS7 with BIO.openfile(p7file, 'r') as bio: p7_ptr = m2.pkcs7_read_bio(bio.bio) return PKCS7(p7_ptr, 1) def load_pkcs7_der(p7file): # type: (AnyStr) -> PKCS7 with BIO.openfile(p7file, 'rb') as bio: p7_ptr = m2.pkcs7_read_bio_der(bio.bio) return PKCS7(p7_ptr, 1) def load_pkcs7_bio(p7_bio): # type: (BIO.BIO) -> PKCS7 p7_ptr = m2.pkcs7_read_bio(p7_bio._ptr()) return PKCS7(p7_ptr, 1) def load_pkcs7_bio_der(p7_bio): # type: (BIO.BIO) -> PKCS7 p7_ptr = m2.pkcs7_read_bio_der(p7_bio._ptr()) return PKCS7(p7_ptr, 1) def smime_load_pkcs7(p7file): # type: (AnyStr) -> PKCS7 bio = m2.bio_new_file(p7file, 'r') try: p7_ptr, bio_ptr = m2.smime_read_pkcs7(bio) finally: m2.bio_free(bio) if bio_ptr is None: return PKCS7(p7_ptr, 1), None else: return PKCS7(p7_ptr, 1), BIO.BIO(bio_ptr, 1) def smime_load_pkcs7_bio(p7_bio): # type: (BIO.BIO) -> PKCS7 p7_ptr, bio_ptr = m2.smime_read_pkcs7(p7_bio._ptr()) if p7_ptr is None: raise SMIME_Error(Err.get_error()) if bio_ptr is None: return PKCS7(p7_ptr, 1), None else: return PKCS7(p7_ptr, 1), BIO.BIO(bio_ptr, 1) class Cipher(object): """Object interface to EVP_CIPHER without all the frills of M2Crypto.EVP.Cipher. """ def __init__(self, algo): # type: (str) -> None cipher = getattr(m2, algo, None) if cipher is None: raise ValueError('unknown cipher', algo) self.cipher = cipher() def _ptr(self): return self.cipher class SMIME_Error(Exception): pass m2.smime_init(SMIME_Error) # FIXME class has no __init__ method class SMIME(object): def load_key(self, keyfile, certfile=None, callback=util.passphrase_callback): # type: (AnyStr, Optional[AnyStr], Callable) -> None if certfile is None: certfile = keyfile self.pkey = EVP.load_key(keyfile, callback) self.x509 = X509.load_cert(certfile) def load_key_bio(self, keybio, certbio=None, callback=util.passphrase_callback): # type: (BIO.BIO, Optional[BIO.BIO], Callable) -> None if certbio is None: certbio = keybio self.pkey = EVP.load_key_bio(keybio, callback) self.x509 = X509.load_cert_bio(certbio) def set_x509_stack(self, stack): # type: (X509.X509_Stack) -> None assert isinstance(stack, X509.X509_Stack) self.x509_stack = stack def set_x509_store(self, store): # type: (X509.X509_Store) -> None assert isinstance(store, X509.X509_Store) self.x509_store = store def set_cipher(self, cipher): # type: (Cipher) -> None assert isinstance(cipher, Cipher) self.cipher = cipher def unset_key(self): # type: () -> None del self.pkey del self.x509 def unset_x509_stack(self): # type: () -> None del self.x509_stack def unset_x509_store(self): # type: () -> None del self.x509_store def unset_cipher(self): # type: () -> None del self.cipher def encrypt(self, data_bio, flags=0): # type: (BIO.BIO, int) -> PKCS7 if not hasattr(self, 'cipher'): raise SMIME_Error('no cipher: use set_cipher()') if not hasattr(self, 'x509_stack'): raise SMIME_Error('no recipient certs: use set_x509_stack()') pkcs7 = m2.pkcs7_encrypt(self.x509_stack._ptr(), data_bio._ptr(), self.cipher._ptr(), flags) return PKCS7(pkcs7, 1) def decrypt(self, pkcs7, flags=0): # type: (PKCS7, int) -> Optional[bytes] if not hasattr(self, 'pkey'): raise SMIME_Error('no private key: use load_key()') if not hasattr(self, 'x509'): raise SMIME_Error('no certificate: load_key() used incorrectly?') blob = m2.pkcs7_decrypt(pkcs7._ptr(), self.pkey._ptr(), self.x509._ptr(), flags) return blob def sign(self, data_bio, flags=0, algo='sha1'): # type: (BIO.BIO, int, Optional[str]) -> PKCS7 if not hasattr(self, 'pkey'): raise SMIME_Error('no private key: use load_key()') hash = getattr(m2, algo, None) if hash is None: raise SMIME_Error('no such hash algorithm %s' % algo) if hasattr(self, 'x509_stack'): pkcs7 = m2.pkcs7_sign1(self.x509._ptr(), self.pkey._ptr(), self.x509_stack._ptr(), data_bio._ptr(), hash(), flags) return PKCS7(pkcs7, 1) else: pkcs7 = m2.pkcs7_sign0(self.x509._ptr(), self.pkey._ptr(), data_bio._ptr(), hash(), flags) return PKCS7(pkcs7, 1) def verify(self, pkcs7, data_bio=None, flags=0): # type: (PKCS7, BIO.BIO, int) -> Optional[bytes] if not hasattr(self, 'x509_stack'): raise SMIME_Error('no signer certs: use set_x509_stack()') if not hasattr(self, 'x509_store'): raise SMIME_Error('no x509 cert store: use set_x509_store()') assert isinstance(pkcs7, PKCS7), 'pkcs7 not an instance of PKCS7' p7 = pkcs7._ptr() if data_bio is None: blob = m2.pkcs7_verify0(p7, self.x509_stack._ptr(), self.x509_store._ptr(), flags) else: blob = m2.pkcs7_verify1(p7, self.x509_stack._ptr(), self.x509_store._ptr(), data_bio._ptr(), flags) return blob def write(self, out_bio, pkcs7, data_bio=None, flags=0): # type: (BIO.BIO, PKCS7, Optional[BIO.BIO], int) -> int assert isinstance(pkcs7, PKCS7) if data_bio is None: return m2.smime_write_pkcs7(out_bio._ptr(), pkcs7._ptr(), flags) else: return m2.smime_write_pkcs7_multi(out_bio._ptr(), pkcs7._ptr(), data_bio._ptr(), flags) def text_crlf(text): # type: (bytes) -> bytes bio_in = BIO.MemoryBuffer(text) bio_out = BIO.MemoryBuffer() if m2.smime_crlf_copy(bio_in._ptr(), bio_out._ptr()): return bio_out.read() else: raise SMIME_Error(Err.get_error()) def text_crlf_bio(bio_in): # type: (BIO.BIO) -> BIO.BIO bio_out = BIO.MemoryBuffer() if m2.smime_crlf_copy(bio_in._ptr(), bio_out._ptr()): return bio_out else: raise SMIME_Error(Err.get_error()) M2Crypto-0.31.0/M2Crypto/SSL/0000755000175000001440000000000013371124434015653 5ustar matejusers00000000000000M2Crypto-0.31.0/M2Crypto/SSL/Checker.py0000644000175000001440000002547313355123234017603 0ustar matejusers00000000000000""" SSL peer certificate checking routines Copyright (c) 2004-2007 Open Source Applications Foundation. All rights reserved. Copyright 2008 Heikki Toivonen. All rights reserved. """ __all__ = ['SSLVerificationError', 'NoCertificate', 'WrongCertificate', 'WrongHost', 'Checker'] import re import socket from M2Crypto import X509, m2, six, util # noqa if util.py27plus: from typing import AnyStr, Optional # noqa class SSLVerificationError(Exception): pass class NoCertificate(SSLVerificationError): pass class WrongCertificate(SSLVerificationError): pass class WrongHost(SSLVerificationError): def __init__(self, expectedHost, actualHost, fieldName='commonName'): # type: (str, AnyStr, str) -> None """ This exception will be raised if the certificate returned by the peer was issued for a different host than we tried to connect to. This could be due to a server misconfiguration or an active attack. :param expectedHost: The name of the host we expected to find in the certificate. :param actualHost: The name of the host we actually found in the certificate. :param fieldName: The field name where we noticed the error. This should be either 'commonName' or 'subjectAltName'. """ if fieldName not in ('commonName', 'subjectAltName'): raise ValueError( 'Unknown fieldName, should be either commonName ' + 'or subjectAltName') SSLVerificationError.__init__(self) self.expectedHost = expectedHost self.actualHost = actualHost self.fieldName = fieldName def __str__(self): # type: () -> str s = 'Peer certificate %s does not match host, expected %s, got %s' \ % (self.fieldName, self.expectedHost, self.actualHost) return six.ensure_text(s) class Checker(object): numericIpMatch = re.compile('^[0-9]+(\.[0-9]+)*$') def __init__(self, host=None, peerCertHash=None, peerCertDigest='sha1'): # type: (Optional[str], Optional[bytes], str) -> None self.host = host if peerCertHash is not None: peerCertHash = six.ensure_binary(peerCertHash) self.fingerprint = peerCertHash self.digest = peerCertDigest # type: str def __call__(self, peerCert, host=None): # type: (X509.X509, Optional[str]) -> bool if peerCert is None: raise NoCertificate('peer did not return certificate') if host is not None: self.host = host # type: str if self.fingerprint: if self.digest not in ('sha1', 'md5'): raise ValueError('unsupported digest "%s"' % self.digest) if self.digest == 'sha1': expected_len = 40 elif self.digest == 'md5': expected_len = 32 else: raise ValueError('Unexpected digest {0}'.format(self.digest)) if len(self.fingerprint) != expected_len: raise WrongCertificate( ('peer certificate fingerprint length does not match\n' + 'fingerprint: {0}\nexpected = {1}\n' + 'observed = {2}').format(self.fingerprint, expected_len, len(self.fingerprint))) expected_fingerprint = six.ensure_text(self.fingerprint) observed_fingerprint = peerCert.get_fingerprint(md=self.digest) if observed_fingerprint != expected_fingerprint: raise WrongCertificate( ('peer certificate fingerprint does not match\n' + 'expected = {0},\n' + 'observed = {1}').format(expected_fingerprint, observed_fingerprint)) if self.host: hostValidationPassed = False self.useSubjectAltNameOnly = False # subjectAltName=DNS:somehost[, ...]* try: subjectAltName = peerCert.get_ext('subjectAltName').get_value() if self._splitSubjectAltName(self.host, subjectAltName): hostValidationPassed = True elif self.useSubjectAltNameOnly: raise WrongHost(expectedHost=self.host, actualHost=subjectAltName, fieldName='subjectAltName') except LookupError: pass # commonName=somehost[, ...]* if not hostValidationPassed: hasCommonName = False commonNames = '' for entry in peerCert.get_subject().get_entries_by_nid( m2.NID_commonName): hasCommonName = True commonName = entry.get_data().as_text() if not commonNames: commonNames = commonName else: commonNames += ',' + commonName if self._match(self.host, commonName): hostValidationPassed = True break if not hasCommonName: raise WrongCertificate('no commonName in peer certificate') if not hostValidationPassed: raise WrongHost(expectedHost=self.host, actualHost=commonNames, fieldName='commonName') return True def _splitSubjectAltName(self, host, subjectAltName): # type: (AnyStr, AnyStr) -> bool """ >>> check = Checker() >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:my.example.com') True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:*.example.com') True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:m*.example.com') True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:m*ample.com') False >>> check.useSubjectAltNameOnly True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:m*ample.com, othername:') False >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:m*ample.com, DNS:my.example.org') False >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:m*ample.com, DNS:my.example.com') True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:my.example.com, DNS:my.example.org') True >>> check.useSubjectAltNameOnly True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='') False >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='othername:') False >>> check.useSubjectAltNameOnly False """ self.useSubjectAltNameOnly = False for certHost in subjectAltName.split(','): certHost = certHost.lower().strip() if certHost[:4] == 'dns:': self.useSubjectAltNameOnly = True if self._match(host, certHost[4:]): return True elif certHost[:11] == 'ip address:': self.useSubjectAltNameOnly = True if self._matchIPAddress(host, certHost[11:]): return True return False def _match(self, host, certHost): # type: (str, str) -> bool """ >>> check = Checker() >>> check._match(host='my.example.com', certHost='my.example.com') True >>> check._match(host='my.example.com', certHost='*.example.com') True >>> check._match(host='my.example.com', certHost='m*.example.com') True >>> check._match(host='my.example.com', certHost='m*.EXAMPLE.com') True >>> check._match(host='my.example.com', certHost='m*ample.com') False >>> check._match(host='my.example.com', certHost='*.*.com') False >>> check._match(host='1.2.3.4', certHost='1.2.3.4') True >>> check._match(host='1.2.3.4', certHost='*.2.3.4') False >>> check._match(host='1234', certHost='1234') True """ # XXX See RFC 2818 and 3280 for matching rules, this is may not # XXX yet be complete. host = host.lower() certHost = certHost.lower() if host == certHost: return True if certHost.count('*') > 1: # Not sure about this, but being conservative return False if self.numericIpMatch.match(host) or \ self.numericIpMatch.match(certHost.replace('*', '')): # Not sure if * allowed in numeric IP, but think not. return False if certHost.find('\\') > -1: # Not sure about this, maybe some encoding might have these. # But being conservative for now, because regex below relies # on this. return False # Massage certHost so that it can be used in regex certHost = certHost.replace('.', '\.') certHost = certHost.replace('*', '[^\.]*') if re.compile('^%s$' % certHost).match(host): return True return False def _matchIPAddress(self, host, certHost): # type: (AnyStr, AnyStr) -> bool """ >>> check = Checker() >>> check._matchIPAddress(host='my.example.com', ... certHost='my.example.com') False >>> check._matchIPAddress(host='1.2.3.4', certHost='1.2.3.4') True >>> check._matchIPAddress(host='1.2.3.4', certHost='*.2.3.4') False >>> check._matchIPAddress(host='1.2.3.4', certHost='1.2.3.40') False >>> check._matchIPAddress(host='::1', certHost='::1') True >>> check._matchIPAddress(host='::1', certHost='0:0:0:0:0:0:0:1') True >>> check._matchIPAddress(host='::1', certHost='::2') False """ try: canonical = socket.getaddrinfo(host, 0, 0, socket.SOCK_STREAM, 0, socket.AI_NUMERICHOST) certCanonical = socket.getaddrinfo(certHost, 0, 0, socket.SOCK_STREAM, 0, socket.AI_NUMERICHOST) except: return False return canonical == certCanonical if __name__ == '__main__': import doctest doctest.testmod() M2Crypto-0.31.0/M2Crypto/SSL/Cipher.py0000644000175000001440000000302413355123234017435 0ustar matejusers00000000000000"""SSL Ciphers Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" __all__ = ['Cipher', 'Cipher_Stack'] from M2Crypto import m2, py27plus, six if py27plus: from typing import Iterable # noqa class Cipher(object): def __init__(self, cipher): # type: (str) -> None self.cipher = cipher def __len__(self): # type: () -> int return m2.ssl_cipher_get_bits(self.cipher) def __repr__(self): # type: () -> str return "%s-%s" % (self.name(), len(self)) def __str__(self): # type: () -> str return "%s-%s" % (self.name(), len(self)) def version(self): # type: () -> int return m2.ssl_cipher_get_version(self.cipher) def name(self): # type: () -> str return six.ensure_text(m2.ssl_cipher_get_name(self.cipher)) class Cipher_Stack(object): def __init__(self, stack): # type: (bytes) -> None """ :param stack: binary of the C-type STACK_OF(SSL_CIPHER) """ self.stack = stack def __len__(self): # type: () -> int return m2.sk_ssl_cipher_num(self.stack) def __getitem__(self, idx): # type: (int) -> Cipher if not 0 <= idx < m2.sk_ssl_cipher_num(self.stack): raise IndexError('index out of range') v = m2.sk_ssl_cipher_value(self.stack, idx) return Cipher(v) def __iter__(self): # type: () -> Iterable for i in six.moves.range(m2.sk_ssl_cipher_num(self.stack)): yield self[i] M2Crypto-0.31.0/M2Crypto/SSL/Connection.py0000644000175000001440000006006013355123234020325 0ustar matejusers00000000000000from __future__ import absolute_import """SSL Connection aka socket Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004-2007 OSAF. All Rights Reserved. Copyright 2008 Heikki Toivonen. All rights reserved. """ import logging import socket from M2Crypto import BIO, Err, X509, m2, py27plus, six, util # noqa from M2Crypto.SSL import Checker, Context, timeout # noqa from M2Crypto.SSL import SSLError from M2Crypto.SSL.Cipher import Cipher, Cipher_Stack from M2Crypto.SSL.Session import Session if py27plus: from typing import Any, AnyStr, Callable, Dict, List, Optional, Tuple, Union # noqa __all__ = ['Connection', 'timeout', # XXX Not really, but for documentation purposes ] log = logging.getLogger(__name__) def _serverPostConnectionCheck(*args, **kw): # type: (*Any, **Any) -> int return 1 class Connection(object): """An SSL connection.""" clientPostConnectionCheck = Checker.Checker() serverPostConnectionCheck = _serverPostConnectionCheck m2_bio_free = m2.bio_free m2_ssl_free = m2.ssl_free m2_bio_noclose = m2.bio_noclose def __init__(self, ctx, sock=None, family=socket.AF_INET): # type: (Context, socket.socket, int) -> None """ :param ctx: SSL.Context :param sock: socket to be used :param family: socket family """ self.ctx = ctx self.ssl = m2.ssl_new(self.ctx.ctx) # type: bytes if sock is not None: self.socket = sock else: self.socket = socket.socket(family, socket.SOCK_STREAM) self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self._fileno = self.socket.fileno() self._timeout = self.socket.gettimeout() if self._timeout is None: self._timeout = -1.0 self.ssl_close_flag = m2.bio_noclose if self.ctx.post_connection_check is not None: self.set_post_connection_check_callback( self.ctx.post_connection_check) self.host = None def __del__(self): # type: () -> None # Notice that M2Crypto doesn't automatically shuts down the # connection here. You have to call self.close() in your # program, M2Crypto won't do it automatically for you. if getattr(self, 'sslbio', None): self.m2_bio_free(self.sslbio) if getattr(self, 'sockbio', None): self.m2_bio_free(self.sockbio) if self.ssl_close_flag == self.m2_bio_noclose and \ getattr(self, 'ssl', None): self.m2_ssl_free(self.ssl) self.socket.close() def close(self): # type: () -> None m2.ssl_shutdown(self.ssl) def clear(self): # type: () -> int """ If there were errors in this connection, call clear() rather than close() to end it, so that bad sessions will be cleared from cache. """ return m2.ssl_clear(self.ssl) def set_shutdown(self, mode): # type: (int) -> None """Sets the shutdown state of the Connection to mode. The shutdown state of an ssl connection is a bitmask of (use m2.SSL_* constants): 0 No shutdown setting, yet. SSL_SENT_SHUTDOWN A "close notify" shutdown alert was sent to the peer, the connection is being considered closed and the session is closed and correct. SSL_RECEIVED_SHUTDOWN A shutdown alert was received form the peer, either a normal "close notify" or a fatal error. SSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same time. :param mode: set the mode bitmask. """ m2.ssl_set_shutdown1(self.ssl, mode) def get_shutdown(self): # type: () -> None """Get the current shutdown mode of the Connection.""" return m2.ssl_get_shutdown(self.ssl) def bind(self, addr): # type: (util.AddrType) -> None self.socket.bind(addr) def listen(self, qlen=5): # type: (int) -> None self.socket.listen(qlen) def ssl_get_error(self, ret): # type: (int) -> int return m2.ssl_get_error(self.ssl, ret) def set_bio(self, readbio, writebio): # type: (BIO.BIO, BIO.BIO) -> None """Explicitly set read and write bios Connects the BIOs for the read and write operations of the TLS/SSL (encrypted) side of ssl. The SSL engine inherits the behaviour of both BIO objects, respectively. If a BIO is non-blocking, the Connection will also have non-blocking behaviour. If there was already a BIO connected to Connection, BIO_free() will be called (for both the reading and writing side, if different). :param readbio: BIO for reading :param writebio: BIO for writing. """ m2.ssl_set_bio(self.ssl, readbio._ptr(), writebio._ptr()) def set_client_CA_list_from_file(self, cafile): # type: (AnyStr) -> None """Set the acceptable client CA list. If the client returns a certificate, it must have been issued by one of the CAs listed in cafile. Makes sense only for servers. :param cafile: Filename from which to load the CA list. :return: 0 A failure while manipulating the STACK_OF(X509_NAME) object occurred or the X509_NAME could not be extracted from cacert. Check the error stack to find out the reason. 1 The operation succeeded. """ m2.ssl_set_client_CA_list_from_file(self.ssl, cafile) def set_client_CA_list_from_context(self): # type: () -> None """ Set the acceptable client CA list. If the client returns a certificate, it must have been issued by one of the CAs listed in context. Makes sense only for servers. """ m2.ssl_set_client_CA_list_from_context(self.ssl, self.ctx.ctx) def setup_addr(self, addr): # type: (util.AddrType) -> None self.addr = addr def set_ssl_close_flag(self, flag): # type: (int) -> None """ By default, SSL struct will be freed in __del__. Call with m2.bio_close to override this default. :param flag: either m2.bio_close or m2.bio_noclose """ if flag not in (m2.bio_close, m2.bio_noclose): raise ValueError("flag must be m2.bio_close or m2.bio_noclose") self.ssl_close_flag = flag def setup_ssl(self): # type: () -> None # Make a BIO_s_socket. self.sockbio = m2.bio_new_socket(self.socket.fileno(), 0) # Link SSL struct with the BIO_socket. m2.ssl_set_bio(self.ssl, self.sockbio, self.sockbio) # Make a BIO_f_ssl. self.sslbio = m2.bio_new(m2.bio_f_ssl()) # Link BIO_f_ssl with the SSL struct. m2.bio_set_ssl(self.sslbio, self.ssl, m2.bio_noclose) def _setup_ssl(self, addr): # type: (util.AddrType) -> None """Deprecated""" self.setup_addr(addr) self.setup_ssl() def set_accept_state(self): # type: () -> None """Sets Connection to work in the server mode.""" m2.ssl_set_accept_state(self.ssl) def accept_ssl(self): # type: () -> Optional[int] """Waits for a TLS/SSL client to initiate the TLS/SSL handshake. The communication channel must already have been set and assigned to the ssl by setting an underlying BIO. :return: 0 The TLS/SSL handshake was not successful but was shut down controlled and by the specifications of the TLS/SSL protocol. Call get_error() with the return value ret to find out the reason. 1 The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been established. <0 The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur of action is need to continue the operation for non-blocking BIOs. Call get_error() with the return value ret to find out the reason. """ return m2.ssl_accept(self.ssl, self._timeout) def accept(self): # type: () -> Tuple[Connection, util.AddrType] """Accept an SSL connection. The return value is a pair (ssl, addr) where ssl is a new SSL connection object and addr is the address bound to the other end of the SSL connection. :return: tuple of Connection and addr. Address can take very various forms (see socket documentation), for IPv4 it is tuple(str, int), for IPv6 a tuple of four (host, port, flowinfo, scopeid), where the last two are optional ints. """ sock, addr = self.socket.accept() ssl = Connection(self.ctx, sock) ssl.addr = addr ssl.setup_ssl() ssl.set_accept_state() ssl.accept_ssl() check = getattr(self, 'postConnectionCheck', self.serverPostConnectionCheck) if check is not None: if not check(ssl.get_peer_cert(), ssl.addr[0]): raise Checker.SSLVerificationError( 'post connection check failed') return ssl, addr def set_connect_state(self): # type: () -> None """Sets Connection to work in the client mode.""" m2.ssl_set_connect_state(self.ssl) def connect_ssl(self): # type: () -> Optional[int] return m2.ssl_connect(self.ssl, self._timeout) def connect(self, addr): # type: (util.AddrType) -> int """Overloading socket.connect() :param addr: addresses have various depending on their type :return:status of ssl_connect() """ self.socket.connect(addr) self.addr = addr self.setup_ssl() self.set_connect_state() ret = self.connect_ssl() check = getattr(self, 'postConnectionCheck', self.clientPostConnectionCheck) if check is not None: if not check(self.get_peer_cert(), self.host if self.host else self.addr[0]): raise Checker.SSLVerificationError( 'post connection check failed') return ret def shutdown(self, how): # type: (int) -> None m2.ssl_set_shutdown(self.ssl, how) def renegotiate(self): # type: () -> int """Renegotiate this connection's SSL parameters.""" return m2.ssl_renegotiate(self.ssl) def pending(self): # type: () -> int """Return the numbers of octets that can be read from the connection.""" return m2.ssl_pending(self.ssl) def _write_bio(self, data): # type: (bytes) -> int return m2.ssl_write(self.ssl, data, self._timeout) def _write_nbio(self, data): # type: (bytes) -> int return m2.ssl_write_nbio(self.ssl, data) def _read_bio(self, size=1024): # type: (int) -> bytes if size <= 0: raise ValueError('size <= 0') return m2.ssl_read(self.ssl, size, self._timeout) def _read_nbio(self, size=1024): # type: (int) -> bytes if size <= 0: raise ValueError('size <= 0') return m2.ssl_read_nbio(self.ssl, size) def write(self, data): # type: (bytes) -> int if self._timeout != 0.0: return self._write_bio(data) return self._write_nbio(data) sendall = send = write def _decref_socketios(self): pass def recv_into(self, buff, nbytes=0): # type: (Union[bytearray, memoryview], int) -> int """ A version of recv() that stores its data into a buffer rather than creating a new string. Receive up to buffersize bytes from the socket. If buffersize is not specified (or 0), receive up to the size available in the given buffer. If buff is bytearray, it will have after return length of the actually returned number of bytes. If buff is memoryview, then the size of buff won't change (it cannot), but all bytes after the number of returned bytes will be NULL. :param buffer: a buffer for the received bytes :param nbytes: maximum number of bytes to read :return: number of bytes read See recv() for documentation about the flags. """ n = len(buff) if nbytes == 0 else nbytes if n <= 0: raise ValueError('size <= 0') # buff_bytes are actual bytes returned buff_bytes = m2.ssl_read(self.ssl, n, self._timeout) buflen = len(buff_bytes) # memoryview type has been added in 2.7 if py27plus and isinstance(buff, memoryview): buff[:buflen] = buff_bytes buff[buflen:] = b'\x00' * (len(buff) - buflen) else: buff[:] = buff_bytes return buflen def read(self, size=1024): # type: (int) -> bytes if self._timeout != 0.0: return self._read_bio(size) return self._read_nbio(size) recv = read def setblocking(self, mode): # type: (int) -> None """Set this connection's underlying socket to _mode_. Set blocking or non-blocking mode of the socket: if flag is 0, the socket is set to non-blocking, else to blocking mode. Initially all sockets are in blocking mode. In non-blocking mode, if a recv() call doesn't find any data, or if a send() call can't immediately dispose of the data, a error exception is raised; in blocking mode, the calls block until they can proceed. s.setblocking(0) is equivalent to s.settimeout(0.0); s.setblocking(1) is equivalent to s.settimeout(None). :param mode: new mode to be set """ self.socket.setblocking(mode) if mode: self._timeout = -1.0 else: self._timeout = 0.0 def settimeout(self, timeout): # type: (float) -> None """Set this connection's underlying socket's timeout to _timeout_.""" self.socket.settimeout(timeout) self._timeout = timeout if self._timeout is None: self._timeout = -1.0 def fileno(self): # type: () -> int return self.socket.fileno() def getsockopt(self, level, optname, buflen=None): # type: (int, int, Optional[int]) -> Union[int, bytes] """Get the value of the given socket option. :param level: level at which the option resides. To manipulate options at the sockets API level, level is specified as socket.SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate protocol controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of socket.SOL_TCP; see getprotoent(3). :param optname: The value of the given socket option is described in the Unix man page getsockopt(2)). The needed symbolic constants (SO_* etc.) are defined in the socket module. :param buflen: If it is absent, an integer option is assumed and its integer value is returned by the function. If buflen is present, it specifies the maximum length of the buffer used to receive the option in, and this buffer is returned as a bytes object. :return: Either integer or bytes value of the option. It is up to the caller to decode the contents of the buffer (see the optional built-in module struct for a way to decode C structures encoded as byte strings). """ return self.socket.getsockopt(level, optname, buflen) def setsockopt(self, level, optname, value=None): # type: (int, int, Union[int, bytes, None]) -> Optional[bytes] """Set the value of the given socket option. :param level: same as with getsockopt() above :param optname: same as with getsockopt() above :param value: an integer or a string representing a buffer. In the latter case it is up to the caller to ensure that the string contains the proper bits (see the optional built-in module struct for a way to encode C structures as strings). :return: None for success or the error handler for failure. """ return self.socket.setsockopt(level, optname, value) def get_context(self): # type: () -> Context """Return the Context object associated with this connection.""" return m2.ssl_get_ssl_ctx(self.ssl) def get_state(self): # type: () -> bytes """Return the SSL state of this connection. During its use, an SSL objects passes several states. The state is internally maintained. Querying the state information is not very informative before or when a connection has been established. It however can be of significant interest during the handshake. :return: 6 letter string indicating the current state of the SSL object ssl. """ return m2.ssl_get_state(self.ssl) def verify_ok(self): # type: () -> bool return (m2.ssl_get_verify_result(self.ssl) == m2.X509_V_OK) def get_verify_mode(self): # type: () -> int """Return the peer certificate verification mode.""" return m2.ssl_get_verify_mode(self.ssl) def get_verify_depth(self): # type: () -> int """Return the peer certificate verification depth.""" return m2.ssl_get_verify_depth(self.ssl) def get_verify_result(self): # type: () -> int """Return the peer certificate verification result.""" return m2.ssl_get_verify_result(self.ssl) def get_peer_cert(self): # type: () -> X509.X509 """Return the peer certificate. If the peer did not provide a certificate, return None. """ c = m2.ssl_get_peer_cert(self.ssl) if c is None: return None # Need to free the pointer coz OpenSSL doesn't. return X509.X509(c, 1) def get_peer_cert_chain(self): # type: () -> Optional[X509.X509_Stack] """Return the peer certificate chain; if the peer did not provide a certificate chain, return None. :warning: The returned chain will be valid only for as long as the connection object is alive. Once the connection object gets freed, the chain will be freed as well. """ c = m2.ssl_get_peer_cert_chain(self.ssl) if c is None: return None # No need to free the pointer coz OpenSSL does. return X509.X509_Stack(c) def get_cipher(self): # type: () -> Optional[Cipher] """Return an M2Crypto.SSL.Cipher object for this connection; if the connection has not been initialised with a cipher suite, return None. """ c = m2.ssl_get_current_cipher(self.ssl) if c is None: return None return Cipher(c) def get_ciphers(self): # type: () -> Optional[Cipher_Stack] """Return an M2Crypto.SSL.Cipher_Stack object for this connection; if the connection has not been initialised with cipher suites, return None. """ c = m2.ssl_get_ciphers(self.ssl) if c is None: return None return Cipher_Stack(c) def get_cipher_list(self, idx=0): # type: (int) -> str """Return the cipher suites for this connection as a string object.""" return six.ensure_text(m2.ssl_get_cipher_list(self.ssl, idx)) def set_cipher_list(self, cipher_list): # type: (str) -> int """Set the cipher suites for this connection.""" return m2.ssl_set_cipher_list(self.ssl, cipher_list) def makefile(self, mode='rb', bufsize=-1): # type: (AnyStr, int) -> socket._fileobject if six.PY3: return socket.SocketIO(self, mode) else: return socket._fileobject(self, mode, bufsize) def getsockname(self): # type: () -> util.AddrType """Return the socket's own address. This is useful to find out the port number of an IPv4/v6 socket, for instance. (The format of the address returned depends on the address family -- see above.) :return:socket's address as addr type """ return self.socket.getsockname() def getpeername(self): # type: () -> util.AddrType """Return the remote address to which the socket is connected. This is useful to find out the port number of a remote IPv4/v6 socket, for instance. On some systems this function is not supported. :return: """ return self.socket.getpeername() def set_session_id_ctx(self, id): # type: (bytes) -> int ret = m2.ssl_set_session_id_context(self.ssl, id) if not ret: raise SSLError(Err.get_error_message()) def get_session(self): # type: () -> Session sess = m2.ssl_get_session(self.ssl) return Session(sess) def set_session(self, session): # type: (Session) -> None m2.ssl_set_session(self.ssl, session._ptr()) def get_default_session_timeout(self): # type: () -> int return m2.ssl_get_default_session_timeout(self.ssl) def get_socket_read_timeout(self): # type: () -> timeout return timeout.struct_to_timeout( self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO, timeout.struct_size())) @staticmethod def _hexdump(s): assert isinstance(s, six.binary_type) return ":".join("{0:02x}".format(ord(c) if six.PY2 else c) for c in s) def get_socket_write_timeout(self): # type: () -> timeout binstr = self.socket.getsockopt( socket.SOL_SOCKET, socket.SO_SNDTIMEO, timeout.struct_size()) timeo = timeout.struct_to_timeout(binstr) #print("Debug: get_socket_write_timeout: " # "get sockopt value: %s -> returned timeout(sec=%r, microsec=%r)" % # (self._hexdump(binstr), timeo.sec, timeo.microsec)) return timeo def set_socket_read_timeout(self, timeo): # type: (timeout) -> None assert isinstance(timeo, timeout.timeout) self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_RCVTIMEO, timeo.pack()) def set_socket_write_timeout(self, timeo): # type: (timeout) -> None assert isinstance(timeo, timeout.timeout) binstr = timeo.pack() #print("Debug: set_socket_write_timeout: " # "input timeout(sec=%r, microsec=%r) -> set sockopt value: %s" % # (timeo.sec, timeo.microsec, self._hexdump(binstr))) self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_SNDTIMEO, binstr) def get_version(self): # type: () -> str """Return the TLS/SSL protocol version for this connection.""" return six.ensure_text(m2.ssl_get_version(self.ssl)) def set_post_connection_check_callback(self, postConnectionCheck): # noqa # type: (Callable) -> None self.postConnectionCheck = postConnectionCheck def set_tlsext_host_name(self, name): # type: (bytes) -> None """Set the requested hostname for the SNI (Server Name Indication) extension. """ m2.ssl_set_tlsext_host_name(self.ssl, name) def set1_host(self, name): # type: (bytes) -> None """Set the requested hostname to check in the server certificate.""" self.host = name M2Crypto-0.31.0/M2Crypto/SSL/Context.py0000644000175000001440000004125013355123234017652 0ustar matejusers00000000000000from __future__ import absolute_import """SSL Context Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" from M2Crypto import BIO, Err, RSA, X509, m2, util # noqa from M2Crypto.SSL import cb # noqa from M2Crypto.SSL.Session import Session # noqa from weakref import WeakValueDictionary if util.py27plus: from typing import Any, AnyStr, Callable, Optional, Union # noqa __all__ = ['ctxmap', 'Context', 'map'] class _ctxmap(object): singleton = None # type: Optional[_ctxmap] def __init__(self): # type: () -> None """Simple WeakReffed list. """ self._ctxmap = WeakValueDictionary() def __getitem__(self, key): # type: (int) -> Any return self._ctxmap[key] def __setitem__(self, key, value): # type: (int, Any) -> None self._ctxmap[key] = value def __delitem__(self, key): # type: (int) -> None del self._ctxmap[key] def ctxmap(): # type: () -> _ctxmap if _ctxmap.singleton is None: _ctxmap.singleton = _ctxmap() return _ctxmap.singleton # deprecated!!! map = ctxmap class Context(object): """'Context' for SSL connections.""" m2_ssl_ctx_free = m2.ssl_ctx_free def __init__(self, protocol='tls', weak_crypto=None, post_connection_check=None): # type: (str, Optional[int], Optional[Callable]) -> None proto = getattr(m2, protocol + '_method', None) if proto is None: # default is 'sslv23' for older versions of OpenSSL if protocol == 'tls': proto = getattr(m2, 'sslv23_method') else: raise ValueError("no such protocol '%s'" % protocol) self.ctx = m2.ssl_ctx_new(proto()) self.allow_unknown_ca = 0 # type: Union[int, bool] self.post_connection_check = post_connection_check ctxmap()[int(self.ctx)] = self m2.ssl_ctx_set_cache_size(self.ctx, 128) if weak_crypto is None and protocol in ('sslv23', 'tls'): self.set_options(m2.SSL_OP_ALL | m2.SSL_OP_NO_SSLv2 | m2.SSL_OP_NO_SSLv3) def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_ssl_ctx_free(self.ctx) def close(self): # type: () -> None del ctxmap()[int(self.ctx)] def load_cert(self, certfile, keyfile=None, callback=util.passphrase_callback): # type: (AnyStr, Optional[AnyStr], Callable) -> None """Load certificate and private key into the context. :param certfile: File that contains the PEM-encoded certificate. :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'. :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. """ m2.ssl_ctx_passphrase_callback(self.ctx, callback) m2.ssl_ctx_use_cert(self.ctx, certfile) if not keyfile: keyfile = certfile m2.ssl_ctx_use_privkey(self.ctx, keyfile) if not m2.ssl_ctx_check_privkey(self.ctx): raise ValueError('public/private key mismatch') def load_cert_chain(self, certchainfile, keyfile=None, callback=util.passphrase_callback): # type: (AnyStr, Optional[AnyStr], Callable) -> None """Load certificate chain and private key into the context. :param certchainfile: File object containing the PEM-encoded certificate chain. :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'. :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. """ m2.ssl_ctx_passphrase_callback(self.ctx, callback) m2.ssl_ctx_use_cert_chain(self.ctx, certchainfile) if not keyfile: keyfile = certchainfile m2.ssl_ctx_use_privkey(self.ctx, keyfile) if not m2.ssl_ctx_check_privkey(self.ctx): raise ValueError('public/private key mismatch') def set_client_CA_list_from_file(self, cafile): # type: (AnyStr) -> None """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. """ m2.ssl_ctx_set_client_CA_list_from_file(self.ctx, cafile) # Deprecated. load_client_CA = load_client_ca = set_client_CA_list_from_file def load_verify_locations(self, cafile=None, capath=None): # type: (Optional[AnyStr], Optional[AnyStr]) -> int """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. :param capath: Directory containing PEM-encoded CA certificates (one certificate per file). :return: 0 if the operation failed because CAfile and CApath are NULL or the processing at one of the locations specified failed. Check the error stack to find out the reason. 1 The operation succeeded. """ if cafile is None and capath is None: raise ValueError("cafile and capath can not both be None.") return m2.ssl_ctx_load_verify_locations(self.ctx, cafile, capath) # Deprecated. load_verify_info = load_verify_locations def set_session_id_ctx(self, id): # type: (bytes) -> None """Sets the session id for the SSL.Context w/in a session can be reused. :param id: Sessions are generated within a certain context. When exporting/importing sessions with i2d_SSL_SESSION/d2i_SSL_SESSION it would be possible, to re-import a session generated from another context (e.g. another application), which might lead to malfunctions. Therefore each application must set its own session id context sid_ctx which is used to distinguish the contexts and is stored in exported sessions. The sid_ctx can be any kind of binary data with a given length, it is therefore possible to use e.g. the name of the application and/or the hostname and/or service name. """ ret = m2.ssl_ctx_set_session_id_context(self.ctx, id) if not ret: raise Err.SSLError(Err.get_error_code(), '') def set_default_verify_paths(self): # type: () -> int """ Specifies that the default locations from which CA certs are loaded should be used. There is one default directory and one default file. The default CA certificates directory is called "certs" in the default OpenSSL directory. Alternatively the SSL_CERT_DIR environment variable can be defined to override this location. The default CA certificates file is called "cert.pem" in the default OpenSSL directory. Alternatively the SSL_CERT_FILE environment variable can be defined to override this location. @return 0 if the operation failed. A missing default location is still treated as a success. No error code is set. 1 The operation succeeded. """ ret = m2.ssl_ctx_set_default_verify_paths(self.ctx) if not ret: raise ValueError('Cannot use default SSL certificate store!') def set_allow_unknown_ca(self, ok): # type: (Union[int, bool]) -> None """Set the context to accept/reject a peer certificate if the certificate's CA is unknown. :param ok: True to accept, False to reject. """ self.allow_unknown_ca = ok def get_allow_unknown_ca(self): # type: () -> Union[int, bool] """Get the context's setting that accepts/rejects a peer certificate if the certificate's CA is unknown. FIXME 2Bconverted to bool """ return self.allow_unknown_ca def set_verify(self, mode, depth, callback=None): # type: (int, int, Optional[Callable]) -> None """ 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 depth: The maximum allowed depth of the certificate chain returned by the peer. :param callback: Callable that can be used to specify custom verification checks. """ if callback is None: m2.ssl_ctx_set_verify_default(self.ctx, mode) else: m2.ssl_ctx_set_verify(self.ctx, mode, callback) m2.ssl_ctx_set_verify_depth(self.ctx, depth) def get_verify_mode(self): # type: () -> int return m2.ssl_ctx_get_verify_mode(self.ctx) def get_verify_depth(self): # type: () -> int """Returns the verification mode currently set in the SSL Context.""" return m2.ssl_ctx_get_verify_depth(self.ctx) def set_tmp_dh(self, dhpfile): # type: (AnyStr) -> int """Load ephemeral DH parameters into the context. :param dhpfile: Filename of the file containing the PEM-encoded DH parameters. """ f = BIO.openfile(dhpfile) dhp = m2.dh_read_parameters(f.bio_ptr()) return m2.ssl_ctx_set_tmp_dh(self.ctx, dhp) def set_tmp_dh_callback(self, callback=None): # type: (Optional[Callable]) -> None """Sets the callback function for SSL.Context. :param callback: Callable to be used when a DH parameters are required. """ if callback is not None: m2.ssl_ctx_set_tmp_dh_callback(self.ctx, callback) def set_tmp_rsa(self, rsa): # type: (RSA.RSA) -> int """Load ephemeral RSA key into the context. :param rsa: RSA.RSA instance. """ if isinstance(rsa, RSA.RSA): return m2.ssl_ctx_set_tmp_rsa(self.ctx, rsa.rsa) else: raise TypeError("Expected an instance of RSA.RSA, got %s." % rsa) def set_tmp_rsa_callback(self, callback=None): # type: (Optional[Callable]) -> None """Sets the callback function to be used when a temporary/ephemeral RSA key is required. """ if callback is not None: m2.ssl_ctx_set_tmp_rsa_callback(self.ctx, callback) def set_info_callback(self, callback=cb.ssl_info_callback): # type: (Callable) -> None """Set a callback function to get state information. It 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. """ m2.ssl_ctx_set_info_callback(self.ctx, callback) def set_cipher_list(self, cipher_list): # type: (str) -> int """Sets the list of available ciphers. :param cipher_list: The format of the string is described in ciphers(1). :return: 1 if any cipher could be selected and 0 on complete failure. """ return m2.ssl_ctx_set_cipher_list(self.ctx, cipher_list) def add_session(self, session): # type: (Session) -> int """Add the session to the context. :param session: the session to be added. :return: 0 The operation failed. It was tried to add the same (identical) session twice. 1 The operation succeeded. """ return m2.ssl_ctx_add_session(self.ctx, session._ptr()) def remove_session(self, session): # type: (Session) -> int """Remove the session from the context. :param session: the session to be removed. :return: 0 The operation failed. The session was not found in the cache. 1 The operation succeeded. """ return m2.ssl_ctx_remove_session(self.ctx, session._ptr()) def get_session_timeout(self): # type: () -> int """Get current session timeout. Whenever a new session is created, it is assigned a maximum lifetime. This lifetime is specified by storing the creation time of the session and the timeout value valid at this time. If the actual time is later than creation time plus timeout, the session is not reused. Due to this realization, all sessions behave according to the timeout value valid at the time of the session negotiation. Changes of the timeout value do not affect already established sessions. Expired sessions are removed from the internal session cache, whenever SSL_CTX_flush_sessions(3) is called, either directly by the application or automatically (see SSL_CTX_set_session_cache_mode(3)) The default value for session timeout is decided on a per protocol basis, see SSL_get_default_timeout(3). All currently supported protocols have the same default timeout value of 300 seconds. SSL_CTX_set_timeout() returns the previously set timeout value. :return: the currently set timeout value. """ return m2.ssl_ctx_get_session_timeout(self.ctx) def set_session_timeout(self, timeout): # type: (int) -> int """Set new session timeout. See self.get_session_timeout() for explanation of the session timeouts. :param timeout: new timeout value. :return: the previously set timeout value. """ return m2.ssl_ctx_set_session_timeout(self.ctx, timeout) def set_session_cache_mode(self, mode): # type: (int) -> int """Enables/disables session caching. The mode is set by using m2.SSL_SESS_CACHE_* constants. :param mode: new mode value. :return: the previously set cache mode value. """ return m2.ssl_ctx_set_session_cache_mode(self.ctx, mode) def get_session_cache_mode(self): # type: () -> int """Gets the current session caching. The mode is set to m2.SSL_SESS_CACHE_* constants. :return: the previously set cache mode value. """ return m2.ssl_ctx_get_session_cache_mode(self.ctx) def set_options(self, op): # type: (int) -> int """Adds the options set via bitmask in options to the Context. !!! Options already set before are not cleared! The behaviour of the SSL library can be changed by setting several options. The options are coded as bitmasks and can be combined by a logical or operation (|). SSL.Context.set_options() and SSL.set_options() affect the (external) protocol behaviour of the SSL library. The (internal) behaviour of the API can be changed by using the similar SSL.Context.set_mode() and SSL.set_mode() functions. During a handshake, the option settings of the SSL object are used. When a new SSL object is created from a context using SSL(), the current option setting is copied. Changes to ctx do not affect already created SSL objects. SSL.clear() does not affect the settings. :param op: bitmask of additional options specified in SSL_CTX_set_options(3) manpage. :return: the new options bitmask after adding options. """ return m2.ssl_ctx_set_options(self.ctx, op) def get_cert_store(self): # type: () -> X509.X509 """ 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. """ return X509.X509_Store(m2.ssl_ctx_get_cert_store(self.ctx)) M2Crypto-0.31.0/M2Crypto/SSL/SSLServer.py0000664000175000001440000000406213247615013020061 0ustar matejusers00000000000000from __future__ import absolute_import, print_function """SSLServer Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" # M2Crypto from M2Crypto.SSL import SSLError from M2Crypto.SSL.Connection import Connection from M2Crypto.SSL.Context import Context # noqa from M2Crypto import six # noqa from M2Crypto import util # noqa from M2Crypto.six.moves.socketserver import (BaseServer, TCPServer, ThreadingMixIn) import os if os.name != 'nt': from M2Crypto.six.moves.socketserver import ForkingMixIn from socket import socket # noqa if util.py27plus: from typing import Union # noqa __all__ = ['SSLServer', 'ForkingSSLServer', 'ThreadingSSLServer'] class SSLServer(TCPServer): def __init__(self, server_address, RequestHandlerClass, ssl_context, # noqa bind_and_activate=True): # type: (util.AddrType, socketserver.BaseRequestHandler, Context, bool) -> None """ Superclass says: Constructor. May be extended, do not override. This class says: Ho-hum. """ BaseServer.__init__(self, server_address, RequestHandlerClass) self.ssl_ctx = ssl_context self.socket = Connection(self.ssl_ctx) if bind_and_activate: self.server_bind() self.server_activate() def handle_request(self): # type: () -> None request = None client_address = None try: request, client_address = self.get_request() if self.verify_request(request, client_address): self.process_request(request, client_address) except SSLError: self.handle_error(request, client_address) def handle_error(self, request, client_address): # type: (Union[socket, Connection], util.AddrType) -> None print('-' * 40) import traceback traceback.print_exc() print('-' * 40) class ThreadingSSLServer(ThreadingMixIn, SSLServer): pass if os.name != 'nt': class ForkingSSLServer(ForkingMixIn, SSLServer): pass M2Crypto-0.31.0/M2Crypto/SSL/Session.py0000644000175000001440000000343513355123234017654 0ustar matejusers00000000000000"""SSL Session Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" __all__ = ['Session', 'load_session'] from M2Crypto import BIO, Err, m2, util from M2Crypto.SSL import SSLError if util.py27plus: from typing import AnyStr # noqa class Session(object): m2_ssl_session_free = m2.ssl_session_free def __init__(self, session, _pyfree=0): # type: (bytes, int) -> None assert session is not None self.session = session self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_ssl_session_free(self.session) def _ptr(self): # type: () -> bytes return self.session def as_text(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.ssl_session_print(buf.bio_ptr(), self.session) return buf.read_all() def as_der(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.i2d_ssl_session(buf.bio_ptr(), self.session) return buf.read_all() def write_bio(self, bio): # type: (BIO.BIO) -> int return m2.ssl_session_write_bio(bio.bio_ptr(), self.session) def get_time(self): # type: () -> int return m2.ssl_session_get_time(self.session) def set_time(self, t): # type: (int) -> int return m2.ssl_session_set_time(self.session, t) def get_timeout(self): # type: () -> int return m2.ssl_session_get_timeout(self.session) def set_timeout(self, t): # type: (int) -> int return m2.ssl_session_set_timeout(self.session, t) def load_session(pemfile): # type: (AnyStr) -> Session with BIO.openfile(pemfile) as f: cptr = m2.ssl_session_read_pem(f.bio_ptr()) return Session(cptr, 1) M2Crypto-0.31.0/M2Crypto/SSL/TwistedProtocolWrapper.py0000644000175000001440000004312213355123234022734 0ustar matejusers00000000000000""" Make Twisted use M2Crypto for SSL Copyright (c) 2004-2007 Open Source Applications Foundation. All rights reserved. FIXME THIS HAS NOT BEEN FINISHED. NEITHER PEP484 NOR PORT PYTHON3 HAS BEEN FINISHED. THE FURTHER WORK WILL BE DONE WHEN THE STATUS OF TWISTED IN THE PYTHON 3 (AND ASYNCIO) WORLD WILL BE CLEAR. """ __all__ = ['connectSSL', 'connectTCP', 'listenSSL', 'listenTCP', 'TLSProtocolWrapper'] import logging from functools import partial import twisted.internet.reactor import twisted.protocols.policies as policies from M2Crypto import BIO, X509, m2, util from M2Crypto.SSL.Checker import Checker, SSLVerificationError from twisted.internet.interfaces import ITLSTransport from twisted.protocols.policies import ProtocolWrapper if util.py27plus: from typing import AnyStr, Callable, Iterable, Optional # noqa from zope.interface import implementer log = logging.getLogger(__name__) def _alwaysSucceedsPostConnectionCheck(peerX509, expectedHost): return 1 def connectSSL(host, port, factory, contextFactory, timeout=30, bindAddress=None, reactor=twisted.internet.reactor, postConnectionCheck=Checker()): # type: (str, int, object, object, int, Optional[str], twisted.internet.reactor, Checker) -> reactor.connectTCP """ A convenience function to start an SSL/TLS connection using Twisted. See IReactorSSL interface in Twisted. """ wrappingFactory = policies.WrappingFactory(factory) wrappingFactory.protocol = lambda factory, wrappedProtocol: \ TLSProtocolWrapper(factory, wrappedProtocol, startPassThrough=0, client=1, contextFactory=contextFactory, postConnectionCheck=postConnectionCheck) return reactor.connectTCP(host, port, wrappingFactory, timeout, bindAddress) def connectTCP(host, port, factory, timeout=30, bindAddress=None, reactor=twisted.internet.reactor, postConnectionCheck=Checker()): # type: (str, int, object, int, Optional[util.AddrType], object, Callable) -> object """ 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. """ wrappingFactory = policies.WrappingFactory(factory) wrappingFactory.protocol = lambda factory, wrappedProtocol: \ TLSProtocolWrapper(factory, wrappedProtocol, startPassThrough=1, client=1, contextFactory=None, postConnectionCheck=postConnectionCheck) return reactor.connectTCP(host, port, wrappingFactory, timeout, bindAddress) def listenSSL(port, factory, contextFactory, backlog=5, interface='', reactor=twisted.internet.reactor, postConnectionCheck=_alwaysSucceedsPostConnectionCheck): """ A convenience function to listen for SSL/TLS connections using Twisted. See IReactorSSL interface in Twisted. """ wrappingFactory = policies.WrappingFactory(factory) wrappingFactory.protocol = lambda factory, wrappedProtocol: \ TLSProtocolWrapper(factory, wrappedProtocol, startPassThrough=0, client=0, contextFactory=contextFactory, postConnectionCheck=postConnectionCheck) return reactor.listenTCP(port, wrappingFactory, backlog, interface) def listenTCP(port, factory, backlog=5, interface='', reactor=twisted.internet.reactor, postConnectionCheck=None): """ 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. """ wrappingFactory = policies.WrappingFactory(factory) wrappingFactory.protocol = lambda factory, wrappedProtocol: \ TLSProtocolWrapper(factory, wrappedProtocol, startPassThrough=1, client=0, contextFactory=None, postConnectionCheck=postConnectionCheck) return reactor.listenTCP(port, wrappingFactory, backlog, interface) class _BioProxy(object): """ The purpose of this class is to eliminate the __del__ method from TLSProtocolWrapper, and thus letting it be garbage collected. """ m2_bio_free_all = m2.bio_free_all def __init__(self, bio): self.bio = bio def _ptr(self): return self.bio def __del__(self): if self.bio is not None: self.m2_bio_free_all(self.bio) class _SSLProxy(object): """ The purpose of this class is to eliminate the __del__ method from TLSProtocolWrapper, and thus letting it be garbage collected. """ m2_ssl_free = m2.ssl_free def __init__(self, ssl): self.ssl = ssl def _ptr(self): return self.ssl def __del__(self): if self.ssl is not None: self.m2_ssl_free(self.ssl) @implementer(ITLSTransport) class TLSProtocolWrapper(ProtocolWrapper): """ 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. """ def __init__(self, factory, wrappedProtocol, startPassThrough, client, contextFactory, postConnectionCheck): # type: (policies.WrappingFactory, object, int, int, object, Checker) -> None """ :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. """ # ProtocolWrapper.__init__(self, factory, wrappedProtocol) # XXX: Twisted 2.0 has a new addition where the wrappingFactory is # set as the factory of the wrappedProtocol. This is an issue # as the wrap should be transparent. What we want is # the factory of the wrappedProtocol to be the wrappedFactory and # not the outer wrappingFactory. This is how it was implemented in # Twisted 1.3 self.factory = factory self.wrappedProtocol = wrappedProtocol # wrappedProtocol == client/server instance # factory.wrappedFactory == client/server factory self.data = b'' # Clear text to encrypt and send self.encrypted = b'' # Encrypted data we need to decrypt and pass on self.tlsStarted = 0 # SSL/TLS mode or pass through self.checked = 0 # Post connection check done or not self.isClient = client self.helloDone = 0 # True when hello has been sent if postConnectionCheck is None: self.postConnectionCheck = _alwaysSucceedsPostConnectionCheck else: self.postConnectionCheck = postConnectionCheck if not startPassThrough: self.startTLS(contextFactory.getContext()) def clear(self): """ Clear this instance, after which it is ready for reuse. """ if getattr(self, 'tlsStarted', 0): self.sslBio = None self.ssl = None self.internalBio = None self.networkBio = None self.data = b'' self.encrypted = b'' self.tlsStarted = 0 self.checked = 0 self.isClient = 1 self.helloDone = 0 # We can reuse self.ctx and it will be deleted automatically # when this instance dies def startTLS(self, ctx): """ Start SSL/TLS. If this is not called, this instance just passes data through untouched. """ # NOTE: This method signature must match the startTLS() method Twisted # expects transports to have. This will be called automatically # by Twisted in STARTTLS situations, for example with SMTP. if self.tlsStarted: raise Exception('TLS already started') self.ctx = ctx self.internalBio = m2.bio_new(m2.bio_s_bio()) m2.bio_set_write_buf_size(self.internalBio, 0) self.networkBio = _BioProxy(m2.bio_new(m2.bio_s_bio())) m2.bio_set_write_buf_size(self.networkBio._ptr(), 0) m2.bio_make_bio_pair(self.internalBio, self.networkBio._ptr()) self.sslBio = _BioProxy(m2.bio_new(m2.bio_f_ssl())) self.ssl = _SSLProxy(m2.ssl_new(self.ctx.ctx)) if self.isClient: m2.ssl_set_connect_state(self.ssl._ptr()) else: m2.ssl_set_accept_state(self.ssl._ptr()) m2.ssl_set_bio(self.ssl._ptr(), self.internalBio, self.internalBio) m2.bio_set_ssl(self.sslBio._ptr(), self.ssl._ptr(), m2.bio_noclose) # Need this for writes that are larger than BIO pair buffers mode = m2.ssl_get_mode(self.ssl._ptr()) m2.ssl_set_mode(self.ssl._ptr(), mode | m2.SSL_MODE_ENABLE_PARTIAL_WRITE | m2.SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER) self.tlsStarted = 1 def write(self, data): # type: (bytes) -> None if not self.tlsStarted: ProtocolWrapper.write(self, data) return try: encryptedData = self._encrypt(data) ProtocolWrapper.write(self, encryptedData) self.helloDone = 1 except BIO.BIOError as e: # See http://www.openssl.org/docs/apps/verify.html#DIAGNOSTICS # for the error codes returned by SSL_get_verify_result. e.args = (m2.ssl_get_verify_result(self.ssl._ptr()), e.args[0]) raise e def writeSequence(self, data): # type: (Iterable[bytes]) -> None if not self.tlsStarted: ProtocolWrapper.writeSequence(self, b''.join(data)) return self.write(b''.join(data)) def loseConnection(self): # XXX Do we need to do m2.ssl_shutdown(self.ssl._ptr())? ProtocolWrapper.loseConnection(self) def connectionMade(self): ProtocolWrapper.connectionMade(self) if self.tlsStarted and self.isClient and not self.helloDone: self._clientHello() def dataReceived(self, data): # type: (bytes) -> None if not self.tlsStarted: ProtocolWrapper.dataReceived(self, data) return self.encrypted += data try: while 1: decryptedData = self._decrypt() self._check() encryptedData = self._encrypt() ProtocolWrapper.write(self, encryptedData) ProtocolWrapper.dataReceived(self, decryptedData) if decryptedData == b'' and encryptedData == b'': break except BIO.BIOError as e: # See http://www.openssl.org/docs/apps/verify.html#DIAGNOSTICS # for the error codes returned by SSL_get_verify_result. e.args = (m2.ssl_get_verify_result(self.ssl._ptr()), e.args[0]) raise e def connectionLost(self, reason): # type: (AnyStr) -> None self.clear() ProtocolWrapper.connectionLost(self, reason) def _check(self): if not self.checked and m2.ssl_is_init_finished(self.ssl._ptr()): x509 = m2.ssl_get_peer_cert(self.ssl._ptr()) if x509 is not None: x509 = X509.X509(x509, 1) if self.isClient: host = self.transport.addr[0] else: host = self.transport.getPeer().host if not self.postConnectionCheck(x509, host): raise SSLVerificationError('post connection check') self.checked = 1 def _clientHello(self): try: # We rely on OpenSSL implicitly starting with client hello # when we haven't yet established an SSL connection encryptedData = self._encrypt(clientHello=1) ProtocolWrapper.write(self, encryptedData) self.helloDone = 1 except BIO.BIOError as e: # See http://www.openssl.org/docs/apps/verify.html#DIAGNOSTICS # for the error codes returned by SSL_get_verify_result. e.args = (m2.ssl_get_verify_result(self.ssl._ptr()), e.args[0]) raise e # Optimizations to reduce attribute accesses @property def _get_wr_guar_ssl(self): # type: () -> Callable[[], int] """Return max. length of data can be written to the BIO. Writes larger than this value will return a value from BIO_write() less than the amount requested or if the buffer is full request a retry. """ return partial(m2.bio_ctrl_get_write_guarantee, self.sslBio._ptr()) @property def _get_wr_guar_net(self): # type: () -> Callable[[], int] return partial(m2.bio_ctrl_get_write_guarantee, self.networkBio._ptr()) @property def _shoud_retry_ssl(self): # type: () -> Callable[[], int] # BIO_should_retry() is true if the call that produced this # condition should then be retried at a later time. return partial(m2.bio_should_retry, self.sslBio._ptr()) @property def _shoud_retry_net(self): # type: () -> Callable[[], int] return partial(m2.bio_should_retry, self.networkBio._ptr()) @property def _ctrl_pend_ssl(self): # type: () -> Callable[[], int] # size_t BIO_ctrl_pending(BIO *b); # BIO_ctrl_pending() return the number of pending characters in # the BIOs read and write buffers. return partial(m2.bio_ctrl_pending, self.sslBio._ptr()) @property def _ctrl_pend_net(self): # type: () -> Callable[[], int] return partial(m2.bio_ctrl_pending, self.networkBio._ptr()) @property def _write_ssl(self): # type: () -> Callable[[bytes], int] # All these functions return either the amount of data # successfully read or written (if the return value is # positive) or that no data was successfully read or written # if the result is 0 or -1. If the return value is -2 then # the operation is not implemented in the specific BIO type. return partial(m2.bio_write, self.sslBio._ptr()) @property def _write_net(self): # type: () -> Callable[[bytes], int] return partial(m2.bio_write, self.networkBio._ptr()) @property def _read_ssl(self): # type: () -> Callable[[int], Optional[bytes]] return partial(m2.bio_read, self.sslBio._ptr()) @property def _read_net(self): # type: () -> Callable[[int], Optional[bytes]] return partial(m2.bio_read, self.networkBio._ptr()) def _encrypt(self, data=b'', clientHello=0): # type: (bytes, int) -> bytes """ :param data: :param clientHello: :return: """ encryptedData = b'' self.data += data while 1: if (self._get_wr_guar_ssl() > 0 and self.data != b'') or clientHello: r = self._write_ssl(self.data) if r <= 0: if not self._shoud_retry_ssl(): raise IOError( ('Data left to be written to {}, ' + 'but cannot retry SSL connection!').format(self.sslBio)) else: assert self.checked self.data = self.data[r:] pending = self._ctrl_pend_net() if pending: d = self._read_net(pending) if d is not None: # This is strange, but d can be None encryptedData += d else: assert(self._shoud_retry_net()) else: break return encryptedData def _decrypt(self, data=b''): # type: (bytes) -> bytes self.encrypted += data decryptedData = b'' while 1: if self._get_wr_guar_ssl() > 0 and self.encrypted != b'': r = self._write_net(self.encrypted) if r <= 0: if not self._shoud_retry_net(): raise IOError( ('Data left to be written to {}, ' + 'but cannot retry SSL connection!').format(self.networkBio)) else: self.encrypted = self.encrypted[r:] pending = self._ctrl_pend_ssl() if pending: d = self._read_ssl(pending) if d is not None: # This is strange, but d can be None decryptedData += d else: assert(self._shoud_retry_ssl()) else: break return decryptedData M2Crypto-0.31.0/M2Crypto/SSL/__init__.py0000644000175000001440000000225213355123234017764 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto SSL services. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" import socket, os # M2Crypto from M2Crypto import _m2crypto as m2 class SSLError(Exception): pass class SSLTimeoutError(SSLError, socket.timeout): pass m2.ssl_init(SSLError, SSLTimeoutError) # M2Crypto.SSL from M2Crypto.SSL.Cipher import Cipher, Cipher_Stack from M2Crypto.SSL.Connection import Connection from M2Crypto.SSL.Context import Context from M2Crypto.SSL.SSLServer import SSLServer, ThreadingSSLServer if os.name != 'nt': from M2Crypto.SSL.SSLServer import ForkingSSLServer from M2Crypto.SSL.ssl_dispatcher import ssl_dispatcher from M2Crypto.SSL.timeout import timeout, struct_to_timeout, struct_size verify_none = m2.SSL_VERIFY_NONE # type: int verify_peer = m2.SSL_VERIFY_PEER # type: int verify_fail_if_no_peer_cert = m2.SSL_VERIFY_FAIL_IF_NO_PEER_CERT # type: int verify_client_once = m2.SSL_VERIFY_CLIENT_ONCE # type: int SSL_SENT_SHUTDOWN = m2.SSL_SENT_SHUTDOWN # type: int SSL_RECEIVED_SHUTDOWN = m2.SSL_RECEIVED_SHUTDOWN # type: int op_all = m2.SSL_OP_ALL # type: int op_no_sslv2 = m2.SSL_OP_NO_SSLv2 # type: int M2Crypto-0.31.0/M2Crypto/SSL/cb.py0000664000175000001440000000524713174411415016622 0ustar matejusers00000000000000from __future__ import absolute_import """SSL callbacks Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" import sys from M2Crypto import m2, util if util.py27plus: from typing import Any, List # noqa __all__ = ['unknown_issuer', 'ssl_verify_callback_stub', 'ssl_verify_callback', 'ssl_verify_callback_allow_unknown_ca', 'ssl_info_callback'] def ssl_verify_callback_stub(ssl_ctx_ptr, x509_ptr, errnum, errdepth, ok): # Deprecated return ok unknown_issuer = [ m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, m2.X509_V_ERR_CERT_UNTRUSTED, ] def ssl_verify_callback(ssl_ctx_ptr, x509_ptr, errnum, errdepth, ok): # type: (bytes, bytes, int, int, int) -> int # Deprecated from M2Crypto.SSL.Context import Context ssl_ctx = Context.ctxmap()[int(ssl_ctx_ptr)] if errnum in unknown_issuer: if ssl_ctx.get_allow_unknown_ca(): sys.stderr.write("policy: %s: permitted...\n" % (m2.x509_get_verify_error(errnum))) sys.stderr.flush() ok = 1 # CRL checking goes here... if ok: if ssl_ctx.get_verify_depth() >= errdepth: ok = 1 else: ok = 0 return ok def ssl_verify_callback_allow_unknown_ca(ok, store): # type: (int, Any) -> int errnum = store.get_error() if errnum in unknown_issuer: ok = 1 return ok # Cribbed from OpenSSL's apps/s_cb.c. def ssl_info_callback(where, ret, ssl_ptr): # type: (int, int, bytes) -> None w = where & ~m2.SSL_ST_MASK if w & m2.SSL_ST_CONNECT: state = "SSL connect" elif w & m2.SSL_ST_ACCEPT: state = "SSL accept" else: state = "SSL state unknown" if where & m2.SSL_CB_LOOP: sys.stderr.write("LOOP: %s: %s\n" % (state, m2.ssl_get_state_v(ssl_ptr))) sys.stderr.flush() return if where & m2.SSL_CB_EXIT: if not ret: sys.stderr.write("FAILED: %s: %s\n" % (state, m2.ssl_get_state_v(ssl_ptr))) sys.stderr.flush() else: sys.stderr.write("INFO: %s: %s\n" % (state, m2.ssl_get_state_v(ssl_ptr))) sys.stderr.flush() return if where & m2.SSL_CB_ALERT: if where & m2.SSL_CB_READ: w = 'read' else: w = 'write' sys.stderr.write("ALERT: %s: %s: %s\n" % (w, m2.ssl_get_alert_type_v(ret), m2.ssl_get_alert_desc_v(ret))) sys.stderr.flush() return M2Crypto-0.31.0/M2Crypto/SSL/ssl_dispatcher.py0000644000175000001440000000215113355123234021232 0ustar matejusers00000000000000from __future__ import absolute_import """SSL dispatcher Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" # Python import asyncore import socket # M2Crypto from M2Crypto import util # noqa from M2Crypto.SSL.Connection import Connection from M2Crypto.SSL.Context import Context # noqa __all__ = ['ssl_dispatcher'] class ssl_dispatcher(asyncore.dispatcher): def create_socket(self, ssl_context): # type: (Context) -> None self.family_and_type = socket.AF_INET, socket.SOCK_STREAM self.ssl_ctx = ssl_context self.socket = Connection(self.ssl_ctx) # self.socket.setblocking(0) self.add_channel() def connect(self, addr): # type: (util.AddrType) -> None self.socket.setblocking(1) self.socket.connect(addr) self.socket.setblocking(0) def recv(self, buffer_size=4096): # type: (int) -> bytes """Receive data over SSL.""" return self.socket.recv(buffer_size) def send(self, buffer): # type: (bytes) -> int """Send data over SSL.""" return self.socket.send(buffer) M2Crypto-0.31.0/M2Crypto/SSL/timeout.py0000644000175000001440000000254213355123234017715 0ustar matejusers00000000000000"""Support for SSL socket timeouts. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Copyright 2008 Heikki Toivonen. All rights reserved. """ __all__ = ['DEFAULT_TIMEOUT', 'timeout', 'struct_to_timeout', 'struct_size'] import sys import struct DEFAULT_TIMEOUT = 600 # type: int class timeout(object): def __init__(self, sec=DEFAULT_TIMEOUT, microsec=0): # type: (int, int) -> None self.sec = sec self.microsec = microsec def pack(self): if sys.platform == 'win32': millisec = int(self.sec * 1000 + round(float(self.microsec) / 1000)) binstr = struct.pack('l', millisec) else: binstr = struct.pack('ll', self.sec, self.microsec) return binstr def struct_to_timeout(binstr): # type: (bytes) -> timeout if sys.platform == 'win32': millisec = struct.unpack('l', binstr)[0] # On py3, int/int performs exact division and returns float. We want # the whole number portion of the exact division result: sec = int(millisec / 1000) microsec = (millisec % 1000) * 1000 else: (sec, microsec) = struct.unpack('ll', binstr) return timeout(sec, microsec) def struct_size(): # type: () -> int if sys.platform == 'win32': return struct.calcsize('l') else: return struct.calcsize('ll') M2Crypto-0.31.0/M2Crypto/X509.py0000644000175000001440000012367513355123234016246 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto wrapper for OpenSSL X509 API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004-2007 OSAF. All Rights Reserved. Author: Heikki Toivonen """ import binascii import logging from M2Crypto import ASN1, BIO, EVP, m2, py27plus, six # noqa if py27plus: from typing import AnyStr, Optional # noqa FORMAT_DER = 0 FORMAT_PEM = 1 log = logging.getLogger(__name__) class X509Error(ValueError): pass m2.x509_init(X509Error) V_OK = m2.X509_V_OK # type: int def x509_store_default_cb(ok, ctx): # type: (int, X509_Store_Context) -> int return ok def new_extension(name, value, critical=0, _pyfree=1): # type: (str, bytes, int, int) -> X509_Extension """ Create new X509_Extension instance. """ if name == 'subjectKeyIdentifier' and \ value.strip('0123456789abcdefABCDEF:') is not '': raise ValueError('value must be precomputed hash') ctx = m2.x509v3_set_nconf() x509_ext_ptr = m2.x509v3_ext_conf(None, ctx, name, value) if x509_ext_ptr is None: raise X509Error( "Cannot create X509_Extension with name '%s' and value '%s'" % (name, value)) x509_ext = X509_Extension(x509_ext_ptr, _pyfree) x509_ext.set_critical(critical) return x509_ext class X509_Extension(object): """ X509 Extension """ m2_x509_extension_free = m2.x509_extension_free def __init__(self, x509_ext_ptr=None, _pyfree=1): # type: (Optional[bytes], int) -> None self.x509_ext = x509_ext_ptr self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0) and self.x509_ext: self.m2_x509_extension_free(self.x509_ext) def _ptr(self): # type: () -> bytes return self.x509_ext def set_critical(self, critical=1): # type: (int) -> int """ Mark this extension critical or noncritical. By default an extension is not critical. :param critical: Nonzero sets this extension as critical. Calling this method without arguments will set this extension to critical. :return: 1 for success, 0 for failure """ return m2.x509_extension_set_critical(self.x509_ext, critical) def get_critical(self): # type: () -> int """ Return whether or not this is a critical extension. :return: Nonzero if this is a critical extension. """ return m2.x509_extension_get_critical(self.x509_ext) def get_name(self): # type: () -> str """ Get the extension name, for example 'subjectAltName'. """ return six.ensure_text(m2.x509_extension_get_name(self.x509_ext)) def get_value(self, flag=0, indent=0): # type: (int, int) -> str """ Get the extension value, for example 'DNS:www.example.com'. :param flag: Flag to control what and how to print. :param indent: How many spaces to print before actual value. """ buf = BIO.MemoryBuffer() m2.x509_ext_print(buf.bio_ptr(), self.x509_ext, flag, indent) return six.ensure_text(buf.read_all()) class X509_Extension_Stack(object): """ X509 Extension Stack :warning: Do not modify the underlying OpenSSL stack except through this interface, or use any OpenSSL functions that do so indirectly. Doing so will get the OpenSSL stack and the internal pystack of this class out of sync, leading to python memory leaks, exceptions or even python crashes! """ m2_sk_x509_extension_free = m2.sk_x509_extension_free def __init__(self, stack=None, _pyfree=0): # type: (Optional[bytes], int) -> None if stack is not None: self.stack = stack self._pyfree = _pyfree num = m2.sk_x509_extension_num(self.stack) for i in range(num): self.pystack.append(X509_Extension( m2.sk_x509_extension_value(self.stack, i), _pyfree=_pyfree)) else: self.stack = m2.sk_x509_extension_new_null() self._pyfree = 1 self.pystack = [] # This must be kept in sync with self.stack def __del__(self): # type: () -> None # see BIO.py - unbalanced __init__ / __del__ if getattr(self, '_pyfree', 0): self.m2_sk_x509_extension_free(self.stack) def __len__(self): # type: () -> int assert m2.sk_x509_extension_num(self.stack) == len(self.pystack) return len(self.pystack) def __getitem__(self, idx): # type: (int) -> X509_Extension return self.pystack[idx] def __iter__(self): return iter(self.pystack) def _ptr(self): # type: () -> bytes return self.stack def push(self, x509_ext): # type: (X509_Extension) -> int """ Push X509_Extension object onto the stack. :param x509_ext: X509_Extension object to be pushed onto the stack. :return: The number of extensions on the stack. """ self.pystack.append(x509_ext) ret = m2.sk_x509_extension_push(self.stack, x509_ext._ptr()) assert ret == len(self.pystack) return ret def pop(self): # type: () -> X509_Extension """ Pop X509_Extension object from the stack. :return: X509_Extension popped """ x509_ext_ptr = m2.sk_x509_extension_pop(self.stack) if x509_ext_ptr is None: assert len(self.pystack) == 0 return None return self.pystack.pop() class X509_Name_Entry(object): """ X509 Name Entry """ m2_x509_name_entry_free = m2.x509_name_entry_free def __init__(self, x509_name_entry, _pyfree=0): # type: (bytes, int) -> None """ :param x509_name_entry: this should be OpenSSL X509_NAME_ENTRY binary :param _pyfree: """ self.x509_name_entry = x509_name_entry self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_name_entry_free(self.x509_name_entry) def _ptr(self): # type: () -> bytes return self.x509_name_entry def set_object(self, asn1obj): # type: (ASN1.ASN1_Object) -> int """ Sets the field name to asn1obj :param asn1obj: :return: 0 on failure, 1 on success """ return m2.x509_name_entry_set_object(self.x509_name_entry, asn1obj._ptr()) def set_data(self, data, type=ASN1.MBSTRING_ASC): # type: (bytes, int) -> int """ Sets the field name to asn1obj :param data: data in a binary form to be set :return: 0 on failure, 1 on success """ return m2.x509_name_entry_set_data(self.x509_name_entry, type, data) def get_object(self): # type: () -> ASN1.ASN1_Object return ASN1.ASN1_Object( m2.x509_name_entry_get_object(self.x509_name_entry)) def get_data(self): # type: () -> ASN1.ASN1_String return ASN1.ASN1_String( m2.x509_name_entry_get_data(self.x509_name_entry)) def create_by_txt(self, field, type, entry, len): return m2.x509_name_entry_create_by_txt(self.x509_name_entry._ptr(), field, type, entry, len) class X509_Name(object): """ X509 Name """ nid = {'C': m2.NID_countryName, 'SP': m2.NID_stateOrProvinceName, 'ST': m2.NID_stateOrProvinceName, 'stateOrProvinceName': m2.NID_stateOrProvinceName, 'L': m2.NID_localityName, 'localityName': m2.NID_localityName, 'O': m2.NID_organizationName, 'organizationName': m2.NID_organizationName, 'OU': m2.NID_organizationalUnitName, 'organizationUnitName': m2.NID_organizationalUnitName, 'CN': m2.NID_commonName, 'commonName': m2.NID_commonName, 'Email': m2.NID_pkcs9_emailAddress, 'emailAddress': m2.NID_pkcs9_emailAddress, 'serialNumber': m2.NID_serialNumber, 'SN': m2.NID_surname, 'surname': m2.NID_surname, 'GN': m2.NID_givenName, 'givenName': m2.NID_givenName } m2_x509_name_free = m2.x509_name_free def __init__(self, x509_name=None, _pyfree=0): # type: (bytes, int) -> None """ :param x509_name: this should be OpenSSL X509_NAME binary :param _pyfree: """ if x509_name is not None: assert m2.x509_name_type_check(x509_name), "'x509_name' type error" self.x509_name = x509_name self._pyfree = _pyfree else: self.x509_name = m2.x509_name_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_name_free(self.x509_name) def __str__(self): # type: () -> bytes assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return m2.x509_name_oneline(self.x509_name) def __getattr__(self, attr): # type: (str) -> str if attr in self.nid: assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return six.ensure_text(m2.x509_name_by_nid(self.x509_name, self.nid[attr])) if attr in self.__dict__: return self.__dict__[attr] raise AttributeError(self, attr) def __setattr__(self, attr, value): # type: (str, AnyStr) -> int """ :return: 1 for success of 0 if an error occurred. """ if attr in self.nid: assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return m2.x509_name_set_by_nid(self.x509_name, self.nid[attr], six.ensure_binary(value)) self.__dict__[attr] = value def __len__(self): # type: () -> int return m2.x509_name_entry_count(self.x509_name) def __getitem__(self, idx): # type: (int) -> X509_Name_Entry if not 0 <= idx < self.entry_count(): raise IndexError("index out of range") return X509_Name_Entry(m2.x509_name_get_entry(self.x509_name, idx)) def __iter__(self): for i in range(self.entry_count()): yield self[i] def _ptr(self): assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return self.x509_name def add_entry_by_txt(self, field, type, entry, len, loc, set): # entry_type: (str, int, bytes, int, int, int) -> int """ Add X509_Name field whose name is identified by its name. :param field: name of the entry :param type: use MBSTRING_ASC or MBSTRING_UTF8 (or standard ASN1 type like V_ASN1_IA5STRING) :param entry: value :param len: buf_len of the entry (-1 and the length is computed automagically) The ``loc`` and ``set`` parameters determine where a new entry should be added. For almost all applications loc can be set to -1 and set to 0. This adds a new entry to the end of name as a single valued RelativeDistinguishedName (RDN). :param loc: determines the index where the new entry is inserted: if it is -1 it is appended. :param set: determines how the new type is added. If it is zero a new RDN is created. If set is -1 or 1 it is added to the previous or next RDN structure respectively. This will then be a multivalued RDN: since multivalues RDNs are very seldom used set is almost always set to zero. :return: 1 for success of 0 if an error occurred. """ return m2.x509_name_add_entry_by_txt(self.x509_name, six.ensure_str(field), type, six.ensure_str(entry), len, loc, set) def entry_count(self): # type: () -> int return m2.x509_name_entry_count(self.x509_name) def get_entries_by_nid(self, nid): # type: (int) -> List[X509_Name_Entry] """ Retrieve the next index matching nid. :param nid: name of the entry (as m2.NID* constants) :return: list of X509_Name_Entry items """ ret = [] lastpos = -1 while True: lastpos = m2.x509_name_get_index_by_nid(self.x509_name, nid, lastpos) if lastpos == -1: break ret.append(self[lastpos]) return ret def as_text(self, indent=0, flags=m2.XN_FLAG_COMPAT): # type: (int, int) -> str """ as_text returns the name as a string. :param indent: Each line in multiline format is indented by this many spaces. :param flags: Flags that control how the output should be formatted. """ assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" buf = BIO.MemoryBuffer() m2.x509_name_print_ex(buf.bio_ptr(), self.x509_name, indent, flags) return six.ensure_text(buf.read_all()) def as_der(self): # type: () -> bytes assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return m2.x509_name_get_der(self.x509_name) def as_hash(self): # type: () -> int assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return m2.x509_name_hash(self.x509_name) class X509(object): """ X.509 Certificate """ m2_x509_free = m2.x509_free def __init__(self, x509=None, _pyfree=0): # type: (Optional[bytes], int) -> None """ :param x509: binary representation of the underlying OpenSSL X509 object. :param _pyfree: """ if x509 is not None: assert m2.x509_type_check(x509), "'x509' type error" self.x509 = x509 self._pyfree = _pyfree else: self.x509 = m2.x509_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_free(self.x509) def _ptr(self): # type: () -> bytes assert m2.x509_type_check(self.x509), "'x509' type error" return self.x509 def as_text(self): # type: () -> str assert m2.x509_type_check(self.x509), "'x509' type error" buf = BIO.MemoryBuffer() m2.x509_print(buf.bio_ptr(), self.x509) return six.ensure_text(buf.read_all()) def as_der(self): # type: () -> bytes assert m2.x509_type_check(self.x509), "'x509' type error" return m2.i2d_x509(self.x509) def as_pem(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.x509_write_pem(buf.bio_ptr(), self.x509) return buf.read_all() def save_pem(self, filename): # type: (AnyStr) -> int """ :param filename: name of the file to be loaded :return: 1 for success or 0 for failure """ with BIO.openfile(filename, 'wb') as bio: return m2.x509_write_pem(bio.bio_ptr(), self.x509) def save(self, filename, format=FORMAT_PEM): # type: (AnyStr, int) -> int """ Saves X.509 certificate to a file. Default output format is PEM. :param filename: Name of the file the cert will be saved to. :param format: Controls what output format is used to save the cert. Either FORMAT_PEM or FORMAT_DER to save in PEM or DER format. Raises a ValueError if an unknow format is used. :return: 1 for success or 0 for failure """ with BIO.openfile(filename, 'wb') as bio: if format == FORMAT_PEM: return m2.x509_write_pem(bio.bio_ptr(), self.x509) elif format == FORMAT_DER: return m2.i2d_x509_bio(bio.bio_ptr(), self.x509) else: raise ValueError( "Unknown filetype. Must be either FORMAT_PEM or FORMAT_DER") def set_version(self, version): # type: (int) -> int """ Set version of the certificate. :param version: Version number. :return: Returns 0 on failure. """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_version(self.x509, version) def set_not_before(self, asn1_time): # type: (ASN1.ASN1_TIME) -> int """ :return: 1 on success, 0 on failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_not_before(self.x509, asn1_time._ptr()) def set_not_after(self, asn1_time): # type: (ASN1.ASN1_TIME) -> int """ :return: 1 on success, 0 on failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_not_after(self.x509, asn1_time._ptr()) def set_subject_name(self, name): # type: (X509_Name) -> int """ :return: 1 on success, 0 on failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_subject_name(self.x509, name.x509_name) def set_issuer_name(self, name): # type: (X509_Name) -> int """ :return: 1 on success, 0 on failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_issuer_name(self.x509, name.x509_name) def get_version(self): # type: () -> int assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_get_version(self.x509) def get_serial_number(self): # type: () -> ASN1.ASN1_Integer assert m2.x509_type_check(self.x509), "'x509' type error" asn1_integer = m2.x509_get_serial_number(self.x509) return m2.asn1_integer_get(asn1_integer) def set_serial_number(self, serial): # type: (ASN1.ASN1_Integer) -> int """ Set serial number. :param serial: Serial number. :return 1 for success and 0 for failure. """ assert m2.x509_type_check(self.x509), "'x509' type error" # This "magically" changes serial since asn1_integer # is C pointer to x509's internal serial number. asn1_integer = m2.x509_get_serial_number(self.x509) return m2.asn1_integer_set(asn1_integer, serial) # XXX Or should I do this? # asn1_integer = m2.asn1_integer_new() # m2.asn1_integer_set(asn1_integer, serial) # return m2.x509_set_serial_number(self.x509, asn1_integer) def get_not_before(self): # type: () -> ASN1.ASN1_TIME assert m2.x509_type_check(self.x509), "'x509' type error" return ASN1.ASN1_TIME(m2.x509_get_not_before(self.x509)) def get_not_after(self): # type: () -> ASN1.ASN1_TIME assert m2.x509_type_check(self.x509), "'x509' type error" out = ASN1.ASN1_TIME(m2.x509_get_not_after(self.x509)) if 'Bad time value' in str(out): raise X509Error( '''M2Crypto cannot handle dates after year 2050. See RFC 5280 4.1.2.5 for more information. ''') return out def get_pubkey(self): # type: () -> EVP.PKey assert m2.x509_type_check(self.x509), "'x509' type error" return EVP.PKey(m2.x509_get_pubkey(self.x509), _pyfree=1) def set_pubkey(self, pkey): # type: (EVP.PKey) -> int """ Set the public key for the certificate :param pkey: Public key :return 1 for success and 0 for failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_pubkey(self.x509, pkey.pkey) def get_issuer(self): # type: () -> X509_Name assert m2.x509_type_check(self.x509), "'x509' type error" return X509_Name(m2.x509_get_issuer_name(self.x509)) def set_issuer(self, name): # type: (X509_Name) -> int """ Set issuer name. :param name: subjectName field. :return 1 for success and 0 for failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_issuer_name(self.x509, name.x509_name) def get_subject(self): # type: () -> X509_Name assert m2.x509_type_check(self.x509), "'x509' type error" return X509_Name(m2.x509_get_subject_name(self.x509)) def set_subject(self, name): # type: (X509_Name) -> int """ Set subject name. :param name: subjectName field. :return 1 for success and 0 for failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_subject_name(self.x509, name.x509_name) def add_ext(self, ext): # type: (X509_Extension) -> int """ Add X509 extension to this certificate. :param ext: Extension :return 1 for success and 0 for failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_add_ext(self.x509, ext.x509_ext, -1) def get_ext(self, name): # type: (str) -> X509_Extension """ Get X509 extension by name. :param name: Name of the extension :return: X509_Extension """ # Optimizations to reduce attribute accesses m2x509_get_ext = m2.x509_get_ext m2x509_extension_get_name = m2.x509_extension_get_name x509 = self.x509 name = six.ensure_binary(name) for i in range(m2.x509_get_ext_count(x509)): ext_ptr = m2x509_get_ext(x509, i) if m2x509_extension_get_name(ext_ptr) == name: return X509_Extension(ext_ptr, _pyfree=0) raise LookupError def get_ext_at(self, index): # type: (int) -> X509_Extension """ Get X509 extension by index. :param index: Name of the extension :return: X509_Extension """ if index < 0 or index >= self.get_ext_count(): raise IndexError return X509_Extension(m2.x509_get_ext(self.x509, index), _pyfree=0) def get_ext_count(self): # type: () -> int """ Get X509 extension count. """ return m2.x509_get_ext_count(self.x509) def sign(self, pkey, md): # type: (EVP.PKey, str) -> int """ Sign the certificate. :param pkey: Public key :param md: Message digest algorithm to use for signing, for example 'sha1'. :return int """ assert m2.x509_type_check(self.x509), "'x509' type error" mda = getattr(m2, md, None) if mda is None: raise ValueError('unknown message digest', md) return m2.x509_sign(self.x509, pkey.pkey, mda()) def verify(self, pkey=None): # type: (Optional[EVP.PKey]) -> int assert m2.x509_type_check(self.x509), "'x509' type error" if pkey: return m2.x509_verify(self.x509, pkey.pkey) else: return m2.x509_verify(self.x509, self.get_pubkey().pkey) def check_ca(self): # type: () -> int """ Check if the certificate is a Certificate Authority (CA) certificate. :return: 0 if the certificate is not CA, nonzero otherwise. :requires: OpenSSL 0.9.8 or newer """ return m2.x509_check_ca(self.x509) def check_purpose(self, id, ca): # type: (int, int) -> int """ Check if the certificate's purpose matches the asked purpose. :param id: Purpose id. See X509_PURPOSE_* constants. :param ca: 1 if the certificate should be CA, 0 otherwise. :return: 0 if the certificate purpose does not match, nonzero otherwise. """ return m2.x509_check_purpose(self.x509, id, ca) def get_fingerprint(self, md='md5'): # type: (str) -> str """ Get the fingerprint of the certificate. :param md: Message digest algorithm to use. :return: String containing the fingerprint in hex format. """ der = self.as_der() md = EVP.MessageDigest(md) md.update(der) digest = md.final() return six.ensure_text(binascii.hexlify(digest).upper()) def load_cert(file, format=FORMAT_PEM): # type: (AnyStr, int) -> X509 """ Load certificate from file. :param file: Name of file containing certificate in either DER or PEM format. :param format: Describes the format of the file to be loaded, either PEM or DER. :return: M2Crypto.X509.X509 object. """ with BIO.openfile(file) as bio: if format == FORMAT_PEM: return load_cert_bio(bio) elif format == FORMAT_DER: cptr = m2.d2i_x509(bio._ptr()) return X509(cptr, _pyfree=1) else: raise ValueError( "Unknown format. Must be either FORMAT_DER or FORMAT_PEM") def load_cert_bio(bio, format=FORMAT_PEM): # type: (BIO.BIO, int) -> X509 """ Load certificate from a bio. :param bio: BIO pointing at a certificate in either DER or PEM format. :param format: Describes the format of the cert to be loaded, either PEM or DER (via constants FORMAT_PEM and FORMAT_FORMAT_DER) :return: M2Crypto.X509.X509 object. """ if format == FORMAT_PEM: cptr = m2.x509_read_pem(bio._ptr()) elif format == FORMAT_DER: cptr = m2.d2i_x509(bio._ptr()) else: raise ValueError( "Unknown format. Must be either FORMAT_DER or FORMAT_PEM") return X509(cptr, _pyfree=1) def load_cert_string(string, format=FORMAT_PEM): # type: (AnyStr, int) -> X509 """ Load certificate from a string. :param string: String containing a certificate in either DER or PEM format. :param format: Describes the format of the cert to be loaded, either PEM or DER (via constants FORMAT_PEM and FORMAT_FORMAT_DER) :return: M2Crypto.X509.X509 object. """ string = six.ensure_binary(string) bio = BIO.MemoryBuffer(string) return load_cert_bio(bio, format) def load_cert_der_string(string): # type: (AnyStr) -> X509 """ Load certificate from a string. :param string: String containing a certificate in DER format. :return: M2Crypto.X509.X509 object. """ string = six.ensure_binary(string) bio = BIO.MemoryBuffer(string) cptr = m2.d2i_x509(bio._ptr()) return X509(cptr, _pyfree=1) class X509_Store_Context(object): """ X509 Store Context """ m2_x509_store_ctx_free = m2.x509_store_ctx_free def __init__(self, x509_store_ctx, _pyfree=0): # type: (bytes, int) -> None """ :param x509_store_ctx: binary data for OpenSSL X509_STORE_CTX type """ self.ctx = x509_store_ctx self._pyfree = _pyfree def __del__(self): # type: () -> None # see BIO.py - unbalanced __init__ / __del__ if not hasattr(self, '_pyfree'): pass # print("OOPS") elif self._pyfree: self.m2_x509_store_ctx_free(self.ctx) def _ptr(self): return self.ctx def get_current_cert(self): # type: () -> X509 """ Get current X.509 certificate. :warning: The returned certificate is NOT refcounted, so you can not rely on it being valid once the store context goes away or is modified. """ return X509(m2.x509_store_ctx_get_current_cert(self.ctx), _pyfree=0) def get_error(self): # type: () -> int """ Get error code. """ return m2.x509_store_ctx_get_error(self.ctx) def get_error_depth(self): # type: () -> int """ Get error depth. """ return m2.x509_store_ctx_get_error_depth(self.ctx) def get1_chain(self): # type: () -> X509_Stack """ Get certificate chain. :return: Reference counted (i.e. safe to use even after the store context goes away) stack of certificates in the chain. """ return X509_Stack(m2.x509_store_ctx_get1_chain(self.ctx), 1, 1) class X509_Store(object): """ X509 Store """ m2_x509_store_free = m2.x509_store_free def __init__(self, store=None, _pyfree=0): # type: (Optional[bytes], int) -> None """ :param store: binary data for OpenSSL X509_STORE_CTX type. """ if store is not None: self.store = store self._pyfree = _pyfree else: self.store = m2.x509_store_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_store_free(self.store) def _ptr(self): return self.store def load_info(self, file): # type: (AnyStr) -> int """ :param file: filename :return: 1 on success, 0 on failure """ ret = m2.x509_store_load_locations(self.store, file) return ret load_locations = load_info def add_x509(self, x509): # type: (X509) -> int assert isinstance(x509, X509) return m2.x509_store_add_cert(self.store, x509._ptr()) def set_verify_cb(self, callback=None): # type: (Optional[callable]) -> None """ Set callback which will be called when the store is verified. Wrapper over OpenSSL X509_STORE_set_verify_cb(). :param callback: Callable to specify verification options. Type of the callable must be: (int, X509_Store_Context) -> int. If None: set the standard options. :note: compile-time or run-time errors in the callback would result in mysterious errors during verification, which could be hard to trace. :note: Python exceptions raised in callbacks do not propagate to verify() call. :return: None """ if callback is None: return self.set_verify_cb(x509_store_default_cb) if not callable(callback): raise X509Error("set_verify(): callback is not callable") return m2.x509_store_set_verify_cb(self.store, callback) add_cert = add_x509 class X509_Stack(object): """ X509 Stack :warning: Do not modify the underlying OpenSSL stack except through this interface, or use any OpenSSL functions that do so indirectly. Doing so will get the OpenSSL stack and the internal pystack of this class out of sync, leading to python memory leaks, exceptions or even python crashes! """ m2_sk_x509_free = m2.sk_x509_free def __init__(self, stack=None, _pyfree=0, _pyfree_x509=0): # type: (bytes, int, int) -> None if stack is not None: self.stack = stack self._pyfree = _pyfree self.pystack = [] # This must be kept in sync with self.stack num = m2.sk_x509_num(self.stack) for i in range(num): self.pystack.append(X509(m2.sk_x509_value(self.stack, i), _pyfree=_pyfree_x509)) else: self.stack = m2.sk_x509_new_null() self._pyfree = 1 self.pystack = [] # This must be kept in sync with self.stack def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_sk_x509_free(self.stack) def __len__(self): # type: () -> int assert m2.sk_x509_num(self.stack) == len(self.pystack) return len(self.pystack) def __getitem__(self, idx): # type: (int) -> X509 return self.pystack[idx] def __iter__(self): return iter(self.pystack) def _ptr(self): return self.stack def push(self, x509): # type: (X509) -> int """ push an X509 certificate onto the stack. :param x509: X509 object. :return: The number of X509 objects currently on the stack. """ assert isinstance(x509, X509) self.pystack.append(x509) ret = m2.sk_x509_push(self.stack, x509._ptr()) assert ret == len(self.pystack) return ret def pop(self): # type: () -> X509 """ pop a certificate from the stack. :return: X509 object that was popped, or None if there is nothing to pop. """ x509_ptr = m2.sk_x509_pop(self.stack) if x509_ptr is None: assert len(self.pystack) == 0 return None return self.pystack.pop() def as_der(self): # type: () -> bytes """ Return the stack as a DER encoded string """ return m2.get_der_encoding_stack(self.stack) def new_stack_from_der(der_string): # type: (bytes) -> X509_Stack """ Create a new X509_Stack from DER string. :return: X509_Stack """ der_string = six.ensure_binary(der_string) stack_ptr = m2.make_stack_from_der_sequence(der_string) return X509_Stack(stack_ptr, 1, 1) class Request(object): """ X509 Certificate Request. """ m2_x509_req_free = m2.x509_req_free def __init__(self, req=None, _pyfree=0): # type: (Optional[int], int) -> None if req is not None: self.req = req self._pyfree = _pyfree else: self.req = m2.x509_req_new() m2.x509_req_set_version(self.req, 0) self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_req_free(self.req) def as_text(self): # type: () -> str buf = BIO.MemoryBuffer() m2.x509_req_print(buf.bio_ptr(), self.req) return six.ensure_text(buf.read_all()) def as_pem(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.x509_req_write_pem(buf.bio_ptr(), self.req) return buf.read_all() def as_der(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.i2d_x509_req_bio(buf.bio_ptr(), self.req) return buf.read_all() def save_pem(self, filename): # type: (AnyStr) -> int with BIO.openfile(filename, 'wb') as bio: return m2.x509_req_write_pem(bio.bio_ptr(), self.req) def save(self, filename, format=FORMAT_PEM): # type: (AnyStr, int) -> int """ Saves X.509 certificate request to a file. Default output format is PEM. :param filename: Name of the file the request will be saved to. :param format: Controls what output format is used to save the request. Either FORMAT_PEM or FORMAT_DER to save in PEM or DER format. Raises ValueError if an unknown format is used. :return: 1 for success, 0 for failure. The error code can be obtained by ERR_get_error. """ with BIO.openfile(filename, 'wb') as bio: if format == FORMAT_PEM: return m2.x509_req_write_pem(bio.bio_ptr(), self.req) elif format == FORMAT_DER: return m2.i2d_x509_req_bio(bio.bio_ptr(), self.req) else: raise ValueError( "Unknown filetype. Must be either FORMAT_DER or FORMAT_PEM") def get_pubkey(self): # type: () -> EVP.PKey """ Get the public key for the request. :return: Public key from the request. """ return EVP.PKey(m2.x509_req_get_pubkey(self.req), _pyfree=1) def set_pubkey(self, pkey): # type: (EVP.PKey) -> int """ Set the public key for the request. :param pkey: Public key :return: Return 1 for success and 0 for failure. """ return m2.x509_req_set_pubkey(self.req, pkey.pkey) def get_version(self): # type: () -> int """ Get version. :return: Returns version. """ return m2.x509_req_get_version(self.req) def set_version(self, version): # type: (int) -> int """ Set version. :param version: Version number. :return: Returns 0 on failure. """ return m2.x509_req_set_version(self.req, version) def get_subject(self): # type: () -> X509_Name return X509_Name(m2.x509_req_get_subject_name(self.req)) def set_subject_name(self, name): # type: (X509_Name) -> int """ Set subject name. :param name: subjectName field. :return: 1 for success and 0 for failure """ return m2.x509_req_set_subject_name(self.req, name.x509_name) set_subject = set_subject_name def add_extensions(self, ext_stack): # type: (X509_Extension_Stack) -> int """ Add X509 extensions to this request. :param ext_stack: Stack of extensions to add. :return: 1 for success and 0 for failure """ return m2.x509_req_add_extensions(self.req, ext_stack._ptr()) def verify(self, pkey): # type: (EVP.PKey) -> int """ :param pkey: PKey to be verified :return: 1 for success and 0 for failure """ return m2.x509_req_verify(self.req, pkey.pkey) def sign(self, pkey, md): # type: (EVP.PKey, str) -> int """ :param pkey: PKey to be signed :param md: used algorigthm :return: 1 for success and 0 for failure """ mda = getattr(m2, md, None) if mda is None: raise ValueError('unknown message digest', md) return m2.x509_req_sign(self.req, pkey.pkey, mda()) def load_request(file, format=FORMAT_PEM): # type: (AnyStr, int) -> Request """ Load certificate request from file. :param file: Name of file containing certificate request in either PEM or DER format. :param format: Describes the format of the file to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER) :return: Request object. """ with BIO.openfile(file) as f: if format == FORMAT_PEM: cptr = m2.x509_req_read_pem(f.bio_ptr()) elif format == FORMAT_DER: cptr = m2.d2i_x509_req(f.bio_ptr()) else: raise ValueError( "Unknown filetype. Must be either FORMAT_PEM or FORMAT_DER") return Request(cptr, 1) def load_request_bio(bio, format=FORMAT_PEM): # type: (BIO.BIO, int) -> Request """ Load certificate request from a bio. :param bio: BIO pointing at a certificate request in either DER or PEM format. :param format: Describes the format of the request to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER) :return: M2Crypto.X509.Request object. """ if format == FORMAT_PEM: cptr = m2.x509_req_read_pem(bio._ptr()) elif format == FORMAT_DER: cptr = m2.d2i_x509_req(bio._ptr()) else: raise ValueError( "Unknown format. Must be either FORMAT_DER or FORMAT_PEM") return Request(cptr, _pyfree=1) def load_request_string(string, format=FORMAT_PEM): # type: (AnyStr, int) -> Request """ Load certificate request from a string. :param string: String containing a certificate request in either DER or PEM format. :param format: Describes the format of the request to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER) :return: M2Crypto.X509.Request object. """ string = six.ensure_binary(string) bio = BIO.MemoryBuffer(string) return load_request_bio(bio, format) def load_request_der_string(string): # type: (AnyStr) -> Request """ Load certificate request from a string. :param string: String containing a certificate request in DER format. :return: M2Crypto.X509.Request object. """ string = six.ensure_binary(string) bio = BIO.MemoryBuffer(string) return load_request_bio(bio, FORMAT_DER) class CRL(object): """ X509 Certificate Revocation List """ m2_x509_crl_free = m2.x509_crl_free def __init__(self, crl=None, _pyfree=0): # type: (Optional[bytes], int) -> None """ :param crl: binary representation of the underlying OpenSSL X509_CRL object. """ if crl is not None: self.crl = crl self._pyfree = _pyfree else: self.crl = m2.x509_crl_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_crl_free(self.crl) def as_text(self): # type: () -> str """ Return CRL in PEM format in a string. :return: String containing the CRL in PEM format. """ buf = BIO.MemoryBuffer() m2.x509_crl_print(buf.bio_ptr(), self.crl) return six.ensure_text(buf.read_all()) def load_crl(file): # type: (AnyStr) -> CRL """ Load CRL from file. :param file: Name of file containing CRL in PEM format. :return: M2Crypto.X509.CRL object. """ with BIO.openfile(file) as f: cptr = m2.x509_crl_read_pem(f.bio_ptr()) return CRL(cptr, 1) M2Crypto-0.31.0/M2Crypto/__init__.py0000644000175000001440000000310713371124277017331 0ustar matejusers00000000000000from __future__ import absolute_import """ M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, EC, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing AuthCookies for web session management; FTP/TLS client and server; S/MIME; ZServerSSL: A HTTPS server for Zope and ZSmime: An S/MIME messenger for Zope. M2Crypto can also be used to provide SSL for Twisted. Smartcards supported through the Engine interface. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004-2007 OSAF. All Rights Reserved. Copyright 2008-2011 Heikki Toivonen. All rights reserved. """ # noqa import sys from distutils.version import StrictVersion __version__ = '0.31.0' version = __version__ # type: str version_info = StrictVersion(__version__).version # This means "Python 2.7 or higher" so it is True for py3k as well py27plus = sys.version_info[:2] > (2, 6) # type: bool from M2Crypto import (ASN1, AuthCookie, BIO, BN, DH, DSA, EVP, Engine, Err, RSA, Rand, SMIME, SSL, X509, m2crypto, ftpslib, httpslib, m2, m2urllib, m2xmlrpclib, threading, util) if m2.OPENSSL_VERSION_NUMBER >= 0x90800F and m2.OPENSSL_NO_EC == 0: from M2Crypto import EC if m2.OPENSSL_NO_RC4 == 0: from M2Crypto import RC4 # Backwards compatibility. urllib2 = m2urllib encrypt = 1 decrypt = 0 m2crypto.lib_init() M2Crypto-0.31.0/M2Crypto/callback.py0000664000175000001440000000045213165756570017340 0ustar matejusers00000000000000from __future__ import absolute_import """Deprecated, use the util module instead. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" import warnings warnings.warn('Use the util module instead', DeprecationWarning) from M2Crypto.util import genparam_callback, passphrase_callback M2Crypto-0.31.0/M2Crypto/ftpslib.py0000644000175000001440000000541213355123234017230 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto client-side FTP/TLS. This implementation complies with draft-murray-auth-ftp-ssl-07.txt. Example: >>> from M2Crypto import ftpslib >>> f = ftpslib.FTP_TLS() >>> f.connect('', 9021) '220 spinnaker.dyndns.org M2Crypto (Medusa) FTP/TLS server v0.07 ready.' >>> f.auth_tls() >>> f.set_pasv(0) >>> f.login('ftp', 'ngps@') '230 Ok.' >>> f.retrlines('LIST') -rw-rw-r-- 1 0 198 2326 Jul 3 1996 apache_pb.gif drwxrwxr-x 7 0 198 1536 Oct 10 2000 manual drwxrwxr-x 2 0 198 512 Oct 31 2000 modpy drwxrwxr-x 2 0 198 512 Oct 31 2000 bobo drwxr-xr-x 2 0 198 14336 May 28 15:54 postgresql drwxr-xr-x 4 100 198 512 May 16 17:19 home drwxr-xr-x 7 100 100 3584 Sep 23 2000 openacs drwxr-xr-x 10 0 0 512 Aug 5 2000 python1.5 -rw-r--r-- 1 100 198 326 Jul 29 03:29 index.html drwxr-xr-x 12 0 0 512 May 31 17:08 python2.1 '226 Transfer complete' >>> f.quit() '221 Goodbye.' >>> Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" # We want to import whole stdlib ftplib objects, because our users want # to use them. from ftplib import * # noqa # M2Crypto from M2Crypto import SSL class FTP_TLS(FTP): """Python OO interface to client-side FTP/TLS.""" def __init__(self, host=None, ssl_ctx=None): """Initialise the client. If 'host' is supplied, connect to it.""" if ssl_ctx is not None: self.ssl_ctx = ssl_ctx else: self.ssl_ctx = SSL.Context() FTP.__init__(self, host) self.prot = 0 def auth_tls(self): """Secure the control connection per AUTH TLS, aka AUTH TLS-C.""" self.voidcmd('AUTH TLS') s = SSL.Connection(self.ssl_ctx, self.sock) s.setup_ssl() s.set_connect_state() s.connect_ssl() self.sock = s self.file = self.sock.makefile() def auth_ssl(self): """Secure the control connection per AUTH SSL, aka AUTH TLS-P.""" raise NotImplementedError def prot_p(self): """Set up secure data connection.""" self.voidcmd('PBSZ 0') self.voidcmd('PROT P') self.prot = 1 def prot_c(self): """Set up data connection in the clear.""" self.voidcmd('PROT C') self.prot = 0 def ntransfercmd(self, cmd, rest=None): """Initiate a data transfer.""" conn, size = FTP.ntransfercmd(self, cmd, rest) if self.prot: conn = SSL.Connection(self.ssl_ctx, conn) conn.setup_ssl() conn.set_connect_state() conn.set_session(self.sock.get_session()) conn.connect_ssl() return conn, size M2Crypto-0.31.0/M2Crypto/httpslib.py0000644000175000001440000002406613370532451017426 0ustar matejusers00000000000000from __future__ import absolute_import import warnings """M2Crypto support for Python's httplib. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" import base64 import socket from M2Crypto import SSL, py27plus, six from M2Crypto.six.moves.urllib_parse import urlsplit, urlunsplit from M2Crypto.six.moves.http_client import * # noqa # This is not imported with just '*' from M2Crypto.six.moves.http_client import HTTPS_PORT if py27plus: from typing import Any, AnyStr, Callable, Dict, List, Optional # noqa class HTTPSConnection(HTTPConnection): """ This class allows communication via SSL using M2Crypto. """ default_port = HTTPS_PORT def __init__(self, host, port=None, strict=None, **ssl): # type: (str, Optional[int], Optional[bool], **Any) -> None """ Represents one transaction with an HTTP server over the SSL connection. :param host: host name :param port: port number :param strict: if switched on, it raises BadStatusLine to be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1 status line. :param ssl: dict with all remaining named real parameters of the function. Specifically, ``ssl_context`` is expected to be included with SSL.Context; if it is not default ``'sslv23'`` is substituted). """ self.session = None # type: bytes self.host = host self.port = port keys = set(ssl.keys()) - set(('key_file', 'cert_file', 'ssl_context')) if keys: raise ValueError('unknown keyword argument: %s', keys) try: self.ssl_ctx = ssl['ssl_context'] assert isinstance(self.ssl_ctx, SSL.Context), self.ssl_ctx except KeyError: self.ssl_ctx = SSL.Context() HTTPConnection.__init__(self, host, port, strict) def connect(self): # type: () -> None error = None # We ignore the returned sockaddr because SSL.Connection.connect needs # a host name. for (family, _, _, _, _) in \ socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): sock = None try: sock = SSL.Connection(self.ssl_ctx, family=family) # set SNI server name since we know it at this point sock.set_tlsext_host_name(self.host) if self.session is not None: sock.set_session(self.session) sock.connect((self.host, self.port)) self.sock = sock sock = None return except socket.error as e: # Other exception are probably SSL-related, in that case we # abort and the exception is forwarded to the caller. error = e finally: if sock is not None: sock.close() if error is None: raise AssertionError("Empty list returned by getaddrinfo") raise error def close(self): # type: () -> None # This kludges around line 545 of httplib.py, # which closes the connection in this object; # the connection remains open in the response # object. # # M2Crypto doesn't close-here-keep-open-there, # so, in effect, we don't close until the whole # business is over and gc kicks in. # # XXX Long-running callers beware leakage. # # XXX 05-Jan-2002: This module works with Python 2.2, # XXX but I've not investigated if the above conditions # XXX remain. pass def get_session(self): # type: () -> SSL.Session.Session return self.sock.get_session() def set_session(self, session): # type: (SSL.Session.Session) -> None self.session = session class ProxyHTTPSConnection(HTTPSConnection): """ An HTTPS Connection that uses a proxy and the CONNECT request. When the connection is initiated, CONNECT is first sent to the proxy (along with authorization headers, if supplied). If successful, an SSL connection will be established over the socket through the proxy and to the target host. Finally, the actual request is sent over the SSL connection tunneling through the proxy. """ _ports = {'http': 80, 'https': 443} _AUTH_HEADER = "Proxy-Authorization" _UA_HEADER = "User-Agent" def __init__(self, host, port=None, strict=None, username=None, password=None, **ssl): # type: (str, Optional[int], Optional[bool], Optional[AnyStr], Optional[AnyStr], **Any) -> None """ Create the ProxyHTTPSConnection object. :param host: host name of the proxy server :param port: port number of the proxy server :param strict: if switched on, it raises BadStatusLine to be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1 status line. :param username: username on the proxy server, when required Username can be ``str``, but preferred type is ``bytes``. M2Crypto does some conversion to ``bytes`` when necessary, but it's better when the user of the library does it on its own. :param password: password on the proxy server, when required The same as with ``username``, ``str`` is accepted, but ``bytes`` are preferred. :param ssl: dict with all remaining named real parameters of the function. Specifically, ``ssl_context`` is expected to be included with SSL.Context; if it is not default ``'sslv23'`` is substituted). """ HTTPSConnection.__init__(self, host, port, strict, **ssl) self._username = username.encode('utf8') \ if isinstance(username, six.string_types) else username self._password = password.encode('utf8') \ if isinstance(password, six.string_types) else password self._proxy_auth = None # type: str self._proxy_UA = None # type: str def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): # type: (AnyStr, AnyStr, int, int) -> None """ putrequest is called before connect, so can interpret url and get real host/port to be used to make CONNECT request to proxy """ proto, netloc, path, query, fragment = urlsplit(url) if not proto: raise ValueError("unknown URL type: %s" % url) # get host & port try: username_password, host_port = netloc.split('@') except ValueError: host_port = netloc try: host, port_s = host_port.split(':') port = int(port_s) except ValueError: host = host_port # try to get port from proto try: port = self._ports[proto] except KeyError: raise ValueError("unknown protocol for: %s" % url) self._real_host = host # type: str self._real_port = port # type: int rest = urlunsplit((None, None, path, query, fragment)) HTTPSConnection.putrequest(self, method, rest, skip_host, skip_accept_encoding) def putheader(self, header, value): # type: (AnyStr, AnyStr) -> None # Store the auth header if passed in. if header.lower() == self._UA_HEADER.lower(): self._proxy_UA = value if header.lower() == self._AUTH_HEADER.lower(): self._proxy_auth = value else: HTTPSConnection.putheader(self, header, value) def endheaders(self, *args, **kwargs): # type: (*Any, **Any) -> None # We've recieved all of hte headers. Use the supplied username # and password for authorization, possibly overriding the authstring # supplied in the headers. if not self._proxy_auth: self._proxy_auth = self._encode_auth() HTTPSConnection.endheaders(self, *args, **kwargs) def connect(self): # type: () -> None HTTPConnection.connect(self) # send proxy CONNECT request self.sock.sendall(self._get_connect_msg()) response = HTTPResponse(self.sock) response.begin() code = response.status if code != 200: # proxy returned and error, abort connection, and raise exception self.close() raise socket.error("Proxy connection failed: %d" % code) self._start_ssl() def _get_connect_msg(self): # type: () -> bytes """ Return an HTTP CONNECT request to send to the proxy. """ msg = "CONNECT %s:%d HTTP/1.1\r\n" % (self._real_host, self._real_port) msg = msg + "Host: %s:%d\r\n" % (self._real_host, self._real_port) if self._proxy_UA: msg = msg + "%s: %s\r\n" % (self._UA_HEADER, self._proxy_UA) if self._proxy_auth: msg = msg + "%s: %s\r\n" % (self._AUTH_HEADER, self._proxy_auth) msg = msg + "\r\n" return six.ensure_binary(msg) def _start_ssl(self): # type: () -> None """ Make this connection's socket SSL-aware. """ self.sock = SSL.Connection(self.ssl_ctx, self.sock) self.sock.setup_ssl() self.sock.set_connect_state() self.sock.connect_ssl() def _encode_auth(self): # type: () -> Optional[bytes] """ Encode the username and password for use in the auth header. """ if not (self._username and self._password): return None # Authenticated proxy userpass = "%s:%s" % (self._username, self._password) with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) enc_userpass = base64.encodestring(userpass).replace("\n", "") return six.ensure_binary("Basic %s" % enc_userpass) M2Crypto-0.31.0/M2Crypto/m2.py0000664000175000001440000000147613165756570016131 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto low level OpenSSL wrapper functions. m2 is the low level wrapper for OpenSSL functions. Typically you would not need to use these directly, since these will be called by the higher level objects you should try to use instead. Naming conventions: All functions wrapped by m2 are all lower case, words separated by underscores. Examples: OpenSSL M2Crypto X509_get_version m2.x509_get_version X509_get_notBefore m2.x509_get_not_before X509_REQ_verify m2.x509_req_verify Exceptions to naming rules: XXX TDB Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004 OSAF. All Rights Reserved. """ from M2Crypto.m2crypto import * lib_init() M2Crypto-0.31.0/M2Crypto/m2crypto.py0000644000175000001440000000463113345572040017350 0ustar matejusers00000000000000# This file was automatically generated by SWIG (http://www.swig.org). # Version 2.0.10 # # Do not make changes to this file unless you know what you are doing--modify # the SWIG interface file instead. from sys import version_info if version_info >= (2,6,0): def swig_import_helper(): from os.path import dirname import imp fp = None try: fp, pathname, description = imp.find_module('_m2crypto', [dirname(__file__)]) except ImportError: import _m2crypto return _m2crypto if fp is not None: try: _mod = imp.load_module('_m2crypto', fp, pathname, description) finally: fp.close() return _mod _m2crypto = swig_import_helper() del swig_import_helper else: import _m2crypto del version_info from _m2crypto import * try: _swig_property = property except NameError: pass # Python < 2.2 doesn't have 'property'. def _swig_setattr_nondynamic(self,class_type,name,value,static=1): if (name == "thisown"): return self.this.own(value) if (name == "this"): if type(value).__name__ == 'SwigPyObject': self.__dict__[name] = value return method = class_type.__swig_setmethods__.get(name,None) if method: return method(self,value) if (not static): self.__dict__[name] = value else: raise AttributeError("You cannot add attributes to %s" % self) def _swig_setattr(self,class_type,name,value): return _swig_setattr_nondynamic(self,class_type,name,value,0) def _swig_getattr(self,class_type,name): if (name == "thisown"): return self.this.own() method = class_type.__swig_getmethods__.get(name,None) if method: return method(self) raise AttributeError(name) def _swig_repr(self): try: strthis = "proxy of " + self.this.__repr__() except: strthis = "" return "<%s.%s; %s >" % (self.__class__.__module__, self.__class__.__name__, strthis,) try: _object = object _newclass = 1 except AttributeError: class _object : pass _newclass = 0 def _swig_setattr_nondynamic_method(set): def set_attr(self,name,value): if (name == "thisown"): return self.this.own(value) if hasattr(self,name) or (name == "this"): set(self,name,value) else: raise AttributeError("You cannot add attributes to %s" % self) return set_attr M2Crypto-0.31.0/M2Crypto/m2urllib.py0000644000175000001440000001013113355123234017307 0ustar matejusers00000000000000from __future__ import absolute_import, print_function """M2Crypto enhancement to Python's urllib for handling 'https' url's. FIXME: it is questionable whether we need this old-style module at all. urllib (not urllib2) is in Python 3 support just as a legacy API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" import base64 import warnings from M2Crypto import SSL, httpslib, six, util from M2Crypto.six.moves.urllib_response import addinfourl if util.py27plus: from typing import AnyStr, Optional # noqa # six.moves doesn't support star imports if six.PY3: from urllib.request import * # noqa for other modules to import from urllib.parse import * # noqa for other modules to import from urllib.error import * # noqa for other modules to import else: from urllib import * # noqa def open_https(self, url, data=None, ssl_context=None): # type: (URLOpener, AnyStr, Optional[bytes], Optional[SSL.Context]) -> addinfourl """ Open URL over the SSL connection. :param url: URL to be opened :param data: data for the POST request :param ssl_context: SSL.Context to be used :return: """ if six.PY3: warnings.warn('URLOpener has been deprecated in Py3k', DeprecationWarning) if ssl_context is not None and isinstance(ssl_context, SSL.Context): self.ctx = ssl_context else: self.ctx = SSL.Context() user_passwd = None if isinstance(url, six.string_types): try: # python 2 # http://pydoc.org/2.5.1/urllib.html host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host except NameError: # python 3 has no splithost # https://docs.python.org/3/library/urllib.parse.html parsed = urlparse(url) host = parsed.hostname if parsed.port: host += ":{0}".format(parsed.port) user_passwd = parsed.password if parsed.password: user_passwd += ":{0}".format(parsed.password) selector = parsed.path else: host, selector = url urltype, rest = splittype(selector) url = rest user_passwd = None if urltype.lower() != 'http': realhost = None else: try: # python 2 realhost, rest = splithost(rest) if realhost: user_passwd, realhost = splituser(realhost) if user_passwd: selector = "%s://%s%s" % (urltype, realhost, rest) except NameError: # python 3 has no splithost parsed = urlparse(rest) host = parsed.hostname if parsed.port: host += ":{0}".format(parsed.port) user_passwd = parsed.username if parsed.password: user_passwd += ":{0}".format(parsed.password) # print("proxy via http:", host, selector) if not host: raise IOError('http error', 'no host given') if user_passwd: if six.PY3: auth = base64.encodebytes(user_passwd).strip() else: auth = base64.encodestring(user_passwd).strip() else: auth = None # Start here! h = httpslib.HTTPSConnection(host=host, ssl_context=self.ctx) # h.set_debuglevel(1) # Stop here! if data is not None: h.putrequest('POST', selector) h.putheader('Content-type', 'application/x-www-form-urlencoded') h.putheader('Content-length', '%d' % len(data)) else: h.putrequest('GET', selector) if auth: h.putheader('Authorization', 'Basic %s' % auth) for args in self.addheaders: h.putheader(*args) # for python3 - used to use apply h.endheaders() if data is not None: h.send(data + '\r\n') # Here again! resp = h.getresponse() fp = resp.fp return addinfourl(fp, resp.msg, "https:" + url) # Stop again. # Minor brain surgery. URLopener.open_https = open_https M2Crypto-0.31.0/M2Crypto/m2urllib2.py0000644000175000001440000001436613355123234017407 0ustar matejusers00000000000000from __future__ import absolute_import """ M2Crypto enhancement to Python's urllib2 for handling 'https' url's. Code from urllib2 is Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007 Python Software Foundation; All Rights Reserved Summary of changes: - Use an HTTPSProxyConnection if the request is going through a proxy. - Add the SSL context to the https connection when performing https_open. - Add the M2Crypto HTTPSHandler when building a default opener. """ import socket from M2Crypto import SSL, httpslib, six, util from M2Crypto.six.moves.urllib_parse import urldefrag, urlparse as url_parse from M2Crypto.six.moves.urllib_response import addinfourl if util.py27plus: from typing import List, Optional # noqa # six.moves doesn't support star imports if six.PY3: from urllib.request import * # noqa other modules want to import from urllib.error import * # noqa other modules want to import else: from urllib2 import * # noqa try: mother_class = socket._fileobject except AttributeError: mother_class = socket.SocketIO class _closing_fileobject(mother_class): # noqa """socket._fileobject that propagates self.close() to the socket. Python 2.5 provides this as socket._fileobject(sock, close=True). """ # for python 3 try: AbstractHTTPHandler except NameError: # somehow this won't get imported by the import * above import urllib.request AbstractHTTPHandler = urllib.request.AbstractHTTPHandler class HTTPSHandler(AbstractHTTPHandler): def __init__(self, ssl_context=None): # type: (SSL.Context) -> None AbstractHTTPHandler.__init__(self) if ssl_context is not None: assert isinstance(ssl_context, SSL.Context), ssl_context self.ctx = ssl_context else: self.ctx = SSL.Context() # Copied from urllib2, so we can set the ssl context. def https_open(self, req): # type: (Request) -> addinfourl """Return an addinfourl object for the request, using http_class. http_class must implement the HTTPConnection API from httplib. The addinfourl return value is a file-like object. It also has methods and attributes including: - info(): return a mimetools.Message object for the headers - geturl(): return the original request URL - code: HTTP status code """ # https://docs.python.org/3.3/library/urllib.request.html#urllib.request.Request.get_host try: # up to python-3.2 host = req.get_host() except AttributeError: # from python-3.3 host = req.host if not host: raise URLError('no host given') # Our change: Check to see if we're using a proxy. # Then create an appropriate ssl-aware connection. full_url = req.get_full_url() target_host = url_parse(full_url)[1] if target_host != host: request_uri = urldefrag(full_url)[0] h = httpslib.ProxyHTTPSConnection(host=host, ssl_context=self.ctx) else: try: # up to python-3.2 request_uri = req.get_selector() except AttributeError: # from python-3.3 request_uri = req.selector h = httpslib.HTTPSConnection(host=host, ssl_context=self.ctx) # End our change h.set_debuglevel(self._debuglevel) headers = dict(req.headers) headers.update(req.unredirected_hdrs) # We want to make an HTTP/1.1 request, but the addinfourl # class isn't prepared to deal with a persistent connection. # It will try to read all remaining data from the socket, # which will block while the server waits for the next request. # So make sure the connection gets closed after the (only) # request. headers["Connection"] = "close" try: h.request(req.get_method(), request_uri, req.data, headers) r = h.getresponse() except socket.error as err: # XXX what error? raise URLError(err) # Pick apart the HTTPResponse object to get the addinfourl # object initialized properly. # Wrap the HTTPResponse object in socket's file object adapter # for Windows. That adapter calls recv(), so delegate recv() # to read(). This weird wrapping allows the returned object to # have readline() and readlines() methods. r.recv = r.read if six.PY2: fp = socket._fileobject(r, close=True) else: r._decref_socketios = lambda: None r.ssl = h.sock.ssl r._timeout = -1.0 r.recv_into = r.readinto fp = socket.SocketIO(r, 'rb') resp = addinfourl(fp, r.msg, req.get_full_url()) resp.code = r.status resp.msg = r.reason return resp https_request = AbstractHTTPHandler.do_request_ # Copied from urllib2 with modifications for ssl def build_opener(ssl_context=None, *handlers): # type: (Optional[SSL.Context], *object) -> OpenerDirector """Create an opener object from a list of handlers. The opener will use several default handlers, including support for HTTP and FTP. If any of the handlers passed as arguments are subclasses of the default handlers, the default handlers will not be used. """ def isclass(obj): return isinstance(obj, type) or hasattr(obj, "__bases__") opener = OpenerDirector() default_classes = [ProxyHandler, UnknownHandler, HTTPHandler, HTTPDefaultErrorHandler, HTTPRedirectHandler, FTPHandler, FileHandler, HTTPErrorProcessor] skip = [] for klass in default_classes: for check in handlers: if isclass(check): if issubclass(check, klass): skip.append(klass) elif isinstance(check, klass): skip.append(klass) for klass in skip: default_classes.remove(klass) for klass in default_classes: opener.add_handler(klass()) # Add the HTTPS handler with ssl_context if HTTPSHandler not in skip: opener.add_handler(HTTPSHandler(ssl_context)) for h in handlers: if isclass(h): h = h() opener.add_handler(h) return opener M2Crypto-0.31.0/M2Crypto/m2xmlrpclib.py0000644000175000001440000000451613355123234020024 0ustar matejusers00000000000000from __future__ import absolute_import """M2Crypto enhancement to xmlrpclib. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" import base64 import M2Crypto from M2Crypto import SSL, httpslib, m2urllib, six, util if util.py27plus: from typing import Any, AnyStr, Callable, Optional # noqa from M2Crypto.six.moves.xmlrpc_client import ProtocolError, Transport # six.moves doesn't support star imports if six.PY3: from xmlrpc.client import * # noqa else: from xmlrpclib import * # noqa __version__ = M2Crypto.__version__ class SSL_Transport(Transport): user_agent = "M2Crypto_XMLRPC/%s - %s" % (__version__, Transport.user_agent) def __init__(self, ssl_context=None, *args, **kw): # type: (Optional[SSL.Context], *Any, **Any) -> None Transport.__init__(self, *args, **kw) if ssl_context is None: self.ssl_ctx = SSL.Context() else: self.ssl_ctx = ssl_context def request(self, host, handler, request_body, verbose=0): # type: (AnyStr, Callable, bytes, int) -> object # Handle username and password. user_passwd, host_port = m2urllib.splituser(host) _host, _port = m2urllib.splitport(host_port) h = httpslib.HTTPSConnection(_host, int(_port), ssl_context=self.ssl_ctx) if verbose: h.set_debuglevel(1) # What follows is as in xmlrpclib.Transport. (Except the authz bit.) h.putrequest("POST", handler) # required by HTTP/1.1 h.putheader("Host", _host) # required by XML-RPC h.putheader("User-Agent", self.user_agent) h.putheader("Content-Type", "text/xml") h.putheader("Content-Length", str(len(request_body))) # Authorisation. if user_passwd is not None: auth = base64.encodestring(user_passwd).strip() h.putheader('Authorization', 'Basic %s' % auth) h.endheaders() if request_body: h.send(request_body) errcode, errmsg, headers = h.getreply() if errcode != 200: raise ProtocolError( host + handler, errcode, errmsg, headers ) self.verbose = verbose return self.parse_response(h.getfile()) M2Crypto-0.31.0/M2Crypto/six.py0000644000175000001440000007714213355123234016401 0ustar matejusers00000000000000# Copyright (c) 2010-2018 Benjamin Peterson # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including without limitation the rights # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell # copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in all # copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE # SOFTWARE. """Utilities for writing code that runs on Python 2 and 3""" from __future__ import absolute_import import functools import itertools import operator import sys import types __author__ = "Benjamin Peterson " __version__ = "1.11.0" # Useful for very coarse version differentiation. PY2 = sys.version_info[0] == 2 PY3 = sys.version_info[0] == 3 PY34 = sys.version_info[0:2] >= (3, 4) if PY3: string_types = str, integer_types = int, class_types = type, text_type = str binary_type = bytes MAXSIZE = sys.maxsize else: string_types = basestring, integer_types = (int, long) class_types = (type, types.ClassType) text_type = unicode binary_type = str if sys.platform.startswith("java"): # Jython always uses 32 bits. MAXSIZE = int((1 << 31) - 1) else: # It's possible to have sizeof(long) != sizeof(Py_ssize_t). class X(object): def __len__(self): return 1 << 31 try: len(X()) except OverflowError: # 32-bit MAXSIZE = int((1 << 31) - 1) else: # 64-bit MAXSIZE = int((1 << 63) - 1) del X def _add_doc(func, doc): """Add documentation to a function.""" func.__doc__ = doc def _import_module(name): """Import module, returning the module after the last dot.""" __import__(name) return sys.modules[name] class _LazyDescr(object): def __init__(self, name): self.name = name def __get__(self, obj, tp): result = self._resolve() setattr(obj, self.name, result) # Invokes __set__. try: # This is a bit ugly, but it avoids running this again by # removing this descriptor. delattr(obj.__class__, self.name) except AttributeError: pass return result class MovedModule(_LazyDescr): def __init__(self, name, old, new=None): super(MovedModule, self).__init__(name) if PY3: if new is None: new = name self.mod = new else: self.mod = old def _resolve(self): return _import_module(self.mod) def __getattr__(self, attr): _module = self._resolve() value = getattr(_module, attr) setattr(self, attr, value) return value class _LazyModule(types.ModuleType): def __init__(self, name): super(_LazyModule, self).__init__(name) self.__doc__ = self.__class__.__doc__ def __dir__(self): attrs = ["__doc__", "__name__"] attrs += [attr.name for attr in self._moved_attributes] return attrs # Subclasses should override this _moved_attributes = [] class MovedAttribute(_LazyDescr): def __init__(self, name, old_mod, new_mod, old_attr=None, new_attr=None): super(MovedAttribute, self).__init__(name) if PY3: if new_mod is None: new_mod = name self.mod = new_mod if new_attr is None: if old_attr is None: new_attr = name else: new_attr = old_attr self.attr = new_attr else: self.mod = old_mod if old_attr is None: old_attr = name self.attr = old_attr def _resolve(self): module = _import_module(self.mod) return getattr(module, self.attr) class _SixMetaPathImporter(object): """ A meta path importer to import six.moves and its submodules. This class implements a PEP302 finder and loader. It should be compatible with Python 2.5 and all existing versions of Python3 """ def __init__(self, six_module_name): self.name = six_module_name self.known_modules = {} def _add_module(self, mod, *fullnames): for fullname in fullnames: self.known_modules[self.name + "." + fullname] = mod def _get_module(self, fullname): return self.known_modules[self.name + "." + fullname] def find_module(self, fullname, path=None): if fullname in self.known_modules: return self return None def __get_module(self, fullname): try: return self.known_modules[fullname] except KeyError: raise ImportError("This loader does not know module " + fullname) def load_module(self, fullname): try: # in case of a reload return sys.modules[fullname] except KeyError: pass mod = self.__get_module(fullname) if isinstance(mod, MovedModule): mod = mod._resolve() else: mod.__loader__ = self sys.modules[fullname] = mod return mod def is_package(self, fullname): """ Return true, if the named module is a package. We need this method to get correct spec objects with Python 3.4 (see PEP451) """ return hasattr(self.__get_module(fullname), "__path__") def get_code(self, fullname): """Return None Required, if is_package is implemented""" self.__get_module(fullname) # eventually raises ImportError return None get_source = get_code # same as get_code _importer = _SixMetaPathImporter(__name__) class _MovedItems(_LazyModule): """Lazy loading of moved objects""" __path__ = [] # mark as package _moved_attributes = [ MovedAttribute("cStringIO", "cStringIO", "io", "StringIO"), MovedAttribute("filter", "itertools", "builtins", "ifilter", "filter"), MovedAttribute("filterfalse", "itertools", "itertools", "ifilterfalse", "filterfalse"), MovedAttribute("input", "__builtin__", "builtins", "raw_input", "input"), MovedAttribute("intern", "__builtin__", "sys"), MovedAttribute("map", "itertools", "builtins", "imap", "map"), MovedAttribute("getcwd", "os", "os", "getcwdu", "getcwd"), MovedAttribute("getcwdb", "os", "os", "getcwd", "getcwdb"), MovedAttribute("getoutput", "commands", "subprocess"), MovedAttribute("range", "__builtin__", "builtins", "xrange", "range"), MovedAttribute("reload_module", "__builtin__", "importlib" if PY34 else "imp", "reload"), MovedAttribute("reduce", "__builtin__", "functools"), MovedAttribute("shlex_quote", "pipes", "shlex", "quote"), MovedAttribute("StringIO", "StringIO", "io"), MovedAttribute("UserDict", "UserDict", "collections"), MovedAttribute("UserList", "UserList", "collections"), MovedAttribute("UserString", "UserString", "collections"), MovedAttribute("xrange", "__builtin__", "builtins", "xrange", "range"), MovedAttribute("zip", "itertools", "builtins", "izip", "zip"), MovedAttribute("zip_longest", "itertools", "itertools", "izip_longest", "zip_longest"), MovedModule("builtins", "__builtin__"), MovedModule("configparser", "ConfigParser"), MovedModule("copyreg", "copy_reg"), MovedModule("dbm_gnu", "gdbm", "dbm.gnu"), MovedModule("_dummy_thread", "dummy_thread", "_dummy_thread"), MovedModule("http_cookiejar", "cookielib", "http.cookiejar"), MovedModule("http_cookies", "Cookie", "http.cookies"), MovedModule("html_entities", "htmlentitydefs", "html.entities"), MovedModule("html_parser", "HTMLParser", "html.parser"), MovedModule("http_client", "httplib", "http.client"), MovedModule("email_mime_base", "email.MIMEBase", "email.mime.base"), MovedModule("email_mime_image", "email.MIMEImage", "email.mime.image"), MovedModule("email_mime_multipart", "email.MIMEMultipart", "email.mime.multipart"), MovedModule("email_mime_nonmultipart", "email.MIMENonMultipart", "email.mime.nonmultipart"), MovedModule("email_mime_text", "email.MIMEText", "email.mime.text"), MovedModule("BaseHTTPServer", "BaseHTTPServer", "http.server"), MovedModule("CGIHTTPServer", "CGIHTTPServer", "http.server"), MovedModule("SimpleHTTPServer", "SimpleHTTPServer", "http.server"), MovedModule("cPickle", "cPickle", "pickle"), MovedModule("queue", "Queue"), MovedModule("reprlib", "repr"), MovedModule("socketserver", "SocketServer"), MovedModule("_thread", "thread", "_thread"), MovedModule("tkinter", "Tkinter"), MovedModule("tkinter_dialog", "Dialog", "tkinter.dialog"), MovedModule("tkinter_filedialog", "FileDialog", "tkinter.filedialog"), MovedModule("tkinter_scrolledtext", "ScrolledText", "tkinter.scrolledtext"), MovedModule("tkinter_simpledialog", "SimpleDialog", "tkinter.simpledialog"), MovedModule("tkinter_tix", "Tix", "tkinter.tix"), MovedModule("tkinter_ttk", "ttk", "tkinter.ttk"), MovedModule("tkinter_constants", "Tkconstants", "tkinter.constants"), MovedModule("tkinter_dnd", "Tkdnd", "tkinter.dnd"), MovedModule("tkinter_colorchooser", "tkColorChooser", "tkinter.colorchooser"), MovedModule("tkinter_commondialog", "tkCommonDialog", "tkinter.commondialog"), MovedModule("tkinter_tkfiledialog", "tkFileDialog", "tkinter.filedialog"), MovedModule("tkinter_font", "tkFont", "tkinter.font"), MovedModule("tkinter_messagebox", "tkMessageBox", "tkinter.messagebox"), MovedModule("tkinter_tksimpledialog", "tkSimpleDialog", "tkinter.simpledialog"), MovedModule("urllib_parse", __name__ + ".moves.urllib_parse", "urllib.parse"), MovedModule("urllib_error", __name__ + ".moves.urllib_error", "urllib.error"), MovedModule("urllib", __name__ + ".moves.urllib", __name__ + ".moves.urllib"), MovedModule("urllib_robotparser", "robotparser", "urllib.robotparser"), MovedModule("xmlrpc_client", "xmlrpclib", "xmlrpc.client"), MovedModule("xmlrpc_server", "SimpleXMLRPCServer", "xmlrpc.server"), ] # Add windows specific modules. if sys.platform == "win32": _moved_attributes += [ MovedModule("winreg", "_winreg"), ] for attr in _moved_attributes: setattr(_MovedItems, attr.name, attr) if isinstance(attr, MovedModule): _importer._add_module(attr, "moves." + attr.name) del attr _MovedItems._moved_attributes = _moved_attributes moves = _MovedItems(__name__ + ".moves") _importer._add_module(moves, "moves") class Module_six_moves_urllib_parse(_LazyModule): """Lazy loading of moved objects in six.moves.urllib_parse""" _urllib_parse_moved_attributes = [ MovedAttribute("ParseResult", "urlparse", "urllib.parse"), MovedAttribute("SplitResult", "urlparse", "urllib.parse"), MovedAttribute("parse_qs", "urlparse", "urllib.parse"), MovedAttribute("parse_qsl", "urlparse", "urllib.parse"), MovedAttribute("urldefrag", "urlparse", "urllib.parse"), MovedAttribute("urljoin", "urlparse", "urllib.parse"), MovedAttribute("urlparse", "urlparse", "urllib.parse"), MovedAttribute("urlsplit", "urlparse", "urllib.parse"), MovedAttribute("urlunparse", "urlparse", "urllib.parse"), MovedAttribute("urlunsplit", "urlparse", "urllib.parse"), MovedAttribute("quote", "urllib", "urllib.parse"), MovedAttribute("quote_plus", "urllib", "urllib.parse"), MovedAttribute("unquote", "urllib", "urllib.parse"), MovedAttribute("unquote_plus", "urllib", "urllib.parse"), MovedAttribute("unquote_to_bytes", "urllib", "urllib.parse", "unquote", "unquote_to_bytes"), MovedAttribute("urlencode", "urllib", "urllib.parse"), MovedAttribute("splitquery", "urllib", "urllib.parse"), MovedAttribute("splittag", "urllib", "urllib.parse"), MovedAttribute("splituser", "urllib", "urllib.parse"), MovedAttribute("splitvalue", "urllib", "urllib.parse"), MovedAttribute("uses_fragment", "urlparse", "urllib.parse"), MovedAttribute("uses_netloc", "urlparse", "urllib.parse"), MovedAttribute("uses_params", "urlparse", "urllib.parse"), MovedAttribute("uses_query", "urlparse", "urllib.parse"), MovedAttribute("uses_relative", "urlparse", "urllib.parse"), ] for attr in _urllib_parse_moved_attributes: setattr(Module_six_moves_urllib_parse, attr.name, attr) del attr Module_six_moves_urllib_parse._moved_attributes = _urllib_parse_moved_attributes _importer._add_module(Module_six_moves_urllib_parse(__name__ + ".moves.urllib_parse"), "moves.urllib_parse", "moves.urllib.parse") class Module_six_moves_urllib_error(_LazyModule): """Lazy loading of moved objects in six.moves.urllib_error""" _urllib_error_moved_attributes = [ MovedAttribute("URLError", "urllib2", "urllib.error"), MovedAttribute("HTTPError", "urllib2", "urllib.error"), MovedAttribute("ContentTooShortError", "urllib", "urllib.error"), ] for attr in _urllib_error_moved_attributes: setattr(Module_six_moves_urllib_error, attr.name, attr) del attr Module_six_moves_urllib_error._moved_attributes = _urllib_error_moved_attributes _importer._add_module(Module_six_moves_urllib_error(__name__ + ".moves.urllib.error"), "moves.urllib_error", "moves.urllib.error") class Module_six_moves_urllib_request(_LazyModule): """Lazy loading of moved objects in six.moves.urllib_request""" _urllib_request_moved_attributes = [ MovedAttribute("urlopen", "urllib2", "urllib.request"), MovedAttribute("install_opener", "urllib2", "urllib.request"), MovedAttribute("build_opener", "urllib2", "urllib.request"), MovedAttribute("pathname2url", "urllib", "urllib.request"), MovedAttribute("url2pathname", "urllib", "urllib.request"), MovedAttribute("getproxies", "urllib", "urllib.request"), MovedAttribute("Request", "urllib2", "urllib.request"), MovedAttribute("OpenerDirector", "urllib2", "urllib.request"), MovedAttribute("HTTPDefaultErrorHandler", "urllib2", "urllib.request"), MovedAttribute("HTTPRedirectHandler", "urllib2", "urllib.request"), MovedAttribute("HTTPCookieProcessor", "urllib2", "urllib.request"), MovedAttribute("ProxyHandler", "urllib2", "urllib.request"), MovedAttribute("BaseHandler", "urllib2", "urllib.request"), MovedAttribute("HTTPPasswordMgr", "urllib2", "urllib.request"), MovedAttribute("HTTPPasswordMgrWithDefaultRealm", "urllib2", "urllib.request"), MovedAttribute("AbstractBasicAuthHandler", "urllib2", "urllib.request"), MovedAttribute("HTTPBasicAuthHandler", "urllib2", "urllib.request"), MovedAttribute("ProxyBasicAuthHandler", "urllib2", "urllib.request"), MovedAttribute("AbstractDigestAuthHandler", "urllib2", "urllib.request"), MovedAttribute("HTTPDigestAuthHandler", "urllib2", "urllib.request"), MovedAttribute("ProxyDigestAuthHandler", "urllib2", "urllib.request"), MovedAttribute("HTTPHandler", "urllib2", "urllib.request"), MovedAttribute("HTTPSHandler", "urllib2", "urllib.request"), MovedAttribute("FileHandler", "urllib2", "urllib.request"), MovedAttribute("FTPHandler", "urllib2", "urllib.request"), MovedAttribute("CacheFTPHandler", "urllib2", "urllib.request"), MovedAttribute("UnknownHandler", "urllib2", "urllib.request"), MovedAttribute("HTTPErrorProcessor", "urllib2", "urllib.request"), MovedAttribute("urlretrieve", "urllib", "urllib.request"), MovedAttribute("urlcleanup", "urllib", "urllib.request"), MovedAttribute("URLopener", "urllib", "urllib.request"), MovedAttribute("FancyURLopener", "urllib", "urllib.request"), MovedAttribute("proxy_bypass", "urllib", "urllib.request"), MovedAttribute("parse_http_list", "urllib2", "urllib.request"), MovedAttribute("parse_keqv_list", "urllib2", "urllib.request"), ] for attr in _urllib_request_moved_attributes: setattr(Module_six_moves_urllib_request, attr.name, attr) del attr Module_six_moves_urllib_request._moved_attributes = _urllib_request_moved_attributes _importer._add_module(Module_six_moves_urllib_request(__name__ + ".moves.urllib.request"), "moves.urllib_request", "moves.urllib.request") class Module_six_moves_urllib_response(_LazyModule): """Lazy loading of moved objects in six.moves.urllib_response""" _urllib_response_moved_attributes = [ MovedAttribute("addbase", "urllib", "urllib.response"), MovedAttribute("addclosehook", "urllib", "urllib.response"), MovedAttribute("addinfo", "urllib", "urllib.response"), MovedAttribute("addinfourl", "urllib", "urllib.response"), ] for attr in _urllib_response_moved_attributes: setattr(Module_six_moves_urllib_response, attr.name, attr) del attr Module_six_moves_urllib_response._moved_attributes = _urllib_response_moved_attributes _importer._add_module(Module_six_moves_urllib_response(__name__ + ".moves.urllib.response"), "moves.urllib_response", "moves.urllib.response") class Module_six_moves_urllib_robotparser(_LazyModule): """Lazy loading of moved objects in six.moves.urllib_robotparser""" _urllib_robotparser_moved_attributes = [ MovedAttribute("RobotFileParser", "robotparser", "urllib.robotparser"), ] for attr in _urllib_robotparser_moved_attributes: setattr(Module_six_moves_urllib_robotparser, attr.name, attr) del attr Module_six_moves_urllib_robotparser._moved_attributes = _urllib_robotparser_moved_attributes _importer._add_module(Module_six_moves_urllib_robotparser(__name__ + ".moves.urllib.robotparser"), "moves.urllib_robotparser", "moves.urllib.robotparser") class Module_six_moves_urllib(types.ModuleType): """Create a six.moves.urllib namespace that resembles the Python 3 namespace""" __path__ = [] # mark as package parse = _importer._get_module("moves.urllib_parse") error = _importer._get_module("moves.urllib_error") request = _importer._get_module("moves.urllib_request") response = _importer._get_module("moves.urllib_response") robotparser = _importer._get_module("moves.urllib_robotparser") def __dir__(self): return ['parse', 'error', 'request', 'response', 'robotparser'] _importer._add_module(Module_six_moves_urllib(__name__ + ".moves.urllib"), "moves.urllib") def add_move(move): """Add an item to six.moves.""" setattr(_MovedItems, move.name, move) def remove_move(name): """Remove item from six.moves.""" try: delattr(_MovedItems, name) except AttributeError: try: del moves.__dict__[name] except KeyError: raise AttributeError("no such move, %r" % (name,)) if PY3: _meth_func = "__func__" _meth_self = "__self__" _func_closure = "__closure__" _func_code = "__code__" _func_defaults = "__defaults__" _func_globals = "__globals__" else: _meth_func = "im_func" _meth_self = "im_self" _func_closure = "func_closure" _func_code = "func_code" _func_defaults = "func_defaults" _func_globals = "func_globals" try: advance_iterator = next except NameError: def advance_iterator(it): return it.next() next = advance_iterator try: callable = callable except NameError: def callable(obj): return any("__call__" in klass.__dict__ for klass in type(obj).__mro__) if PY3: def get_unbound_function(unbound): return unbound create_bound_method = types.MethodType def create_unbound_method(func, cls): return func Iterator = object else: def get_unbound_function(unbound): return unbound.im_func def create_bound_method(func, obj): return types.MethodType(func, obj, obj.__class__) def create_unbound_method(func, cls): return types.MethodType(func, None, cls) class Iterator(object): def next(self): return type(self).__next__(self) callable = callable _add_doc(get_unbound_function, """Get the function out of a possibly unbound function""") get_method_function = operator.attrgetter(_meth_func) get_method_self = operator.attrgetter(_meth_self) get_function_closure = operator.attrgetter(_func_closure) get_function_code = operator.attrgetter(_func_code) get_function_defaults = operator.attrgetter(_func_defaults) get_function_globals = operator.attrgetter(_func_globals) if PY3: def iterkeys(d, **kw): return iter(d.keys(**kw)) def itervalues(d, **kw): return iter(d.values(**kw)) def iteritems(d, **kw): return iter(d.items(**kw)) def iterlists(d, **kw): return iter(d.lists(**kw)) viewkeys = operator.methodcaller("keys") viewvalues = operator.methodcaller("values") viewitems = operator.methodcaller("items") else: def iterkeys(d, **kw): return d.iterkeys(**kw) def itervalues(d, **kw): return d.itervalues(**kw) def iteritems(d, **kw): return d.iteritems(**kw) def iterlists(d, **kw): return d.iterlists(**kw) viewkeys = operator.methodcaller("viewkeys") viewvalues = operator.methodcaller("viewvalues") viewitems = operator.methodcaller("viewitems") _add_doc(iterkeys, "Return an iterator over the keys of a dictionary.") _add_doc(itervalues, "Return an iterator over the values of a dictionary.") _add_doc(iteritems, "Return an iterator over the (key, value) pairs of a dictionary.") _add_doc(iterlists, "Return an iterator over the (key, [values]) pairs of a dictionary.") if PY3: def b(s): return s.encode("latin-1") def u(s): return s unichr = chr import struct int2byte = struct.Struct(">B").pack del struct byte2int = operator.itemgetter(0) indexbytes = operator.getitem iterbytes = iter import io StringIO = io.StringIO BytesIO = io.BytesIO _assertCountEqual = "assertCountEqual" if sys.version_info[1] <= 1: _assertRaisesRegex = "assertRaisesRegexp" _assertRegex = "assertRegexpMatches" else: _assertRaisesRegex = "assertRaisesRegex" _assertRegex = "assertRegex" else: def b(s): return s # Workaround for standalone backslash def u(s): return unicode(s.replace(r'\\', r'\\\\'), "unicode_escape") unichr = unichr int2byte = chr def byte2int(bs): return ord(bs[0]) def indexbytes(buf, i): return ord(buf[i]) iterbytes = functools.partial(itertools.imap, ord) import StringIO StringIO = BytesIO = StringIO.StringIO _assertCountEqual = "assertItemsEqual" _assertRaisesRegex = "assertRaisesRegexp" _assertRegex = "assertRegexpMatches" _add_doc(b, """Byte literal""") _add_doc(u, """Text literal""") def assertCountEqual(self, *args, **kwargs): return getattr(self, _assertCountEqual)(*args, **kwargs) def assertRaisesRegex(self, *args, **kwargs): return getattr(self, _assertRaisesRegex)(*args, **kwargs) def assertRegex(self, *args, **kwargs): return getattr(self, _assertRegex)(*args, **kwargs) if PY3: exec_ = getattr(moves.builtins, "exec") def reraise(tp, value, tb=None): try: if value is None: value = tp() if value.__traceback__ is not tb: raise value.with_traceback(tb) raise value finally: value = None tb = None else: def exec_(_code_, _globs_=None, _locs_=None): """Execute code in a namespace.""" if _globs_ is None: frame = sys._getframe(1) _globs_ = frame.f_globals if _locs_ is None: _locs_ = frame.f_locals del frame elif _locs_ is None: _locs_ = _globs_ exec("""exec _code_ in _globs_, _locs_""") exec_("""def reraise(tp, value, tb=None): try: raise tp, value, tb finally: tb = None """) if sys.version_info[:2] == (3, 2): exec_("""def raise_from(value, from_value): try: if from_value is None: raise value raise value from from_value finally: value = None """) elif sys.version_info[:2] > (3, 2): exec_("""def raise_from(value, from_value): try: raise value from from_value finally: value = None """) else: def raise_from(value, from_value): raise value print_ = getattr(moves.builtins, "print", None) if print_ is None: def print_(*args, **kwargs): """The new-style print function for Python 2.4 and 2.5.""" fp = kwargs.pop("file", sys.stdout) if fp is None: return def write(data): if not isinstance(data, basestring): data = str(data) # If the file has an encoding, encode unicode with it. if (isinstance(fp, file) and isinstance(data, unicode) and fp.encoding is not None): errors = getattr(fp, "errors", None) if errors is None: errors = "strict" data = data.encode(fp.encoding, errors) fp.write(data) want_unicode = False sep = kwargs.pop("sep", None) if sep is not None: if isinstance(sep, unicode): want_unicode = True elif not isinstance(sep, str): raise TypeError("sep must be None or a string") end = kwargs.pop("end", None) if end is not None: if isinstance(end, unicode): want_unicode = True elif not isinstance(end, str): raise TypeError("end must be None or a string") if kwargs: raise TypeError("invalid keyword arguments to print()") if not want_unicode: for arg in args: if isinstance(arg, unicode): want_unicode = True break if want_unicode: newline = unicode("\n") space = unicode(" ") else: newline = "\n" space = " " if sep is None: sep = space if end is None: end = newline for i, arg in enumerate(args): if i: write(sep) write(arg) write(end) if sys.version_info[:2] < (3, 3): _print = print_ def print_(*args, **kwargs): fp = kwargs.get("file", sys.stdout) flush = kwargs.pop("flush", False) _print(*args, **kwargs) if flush and fp is not None: fp.flush() _add_doc(reraise, """Reraise an exception.""") if sys.version_info[0:2] < (3, 4): def wraps(wrapped, assigned=functools.WRAPPER_ASSIGNMENTS, updated=functools.WRAPPER_UPDATES): def wrapper(f): f = functools.wraps(wrapped, assigned, updated)(f) f.__wrapped__ = wrapped return f return wrapper else: wraps = functools.wraps def with_metaclass(meta, *bases): """Create a base class with a metaclass.""" # This requires a bit of explanation: the basic idea is to make a dummy # metaclass for one level of class instantiation that replaces itself with # the actual metaclass. class metaclass(type): def __new__(cls, name, this_bases, d): return meta(name, bases, d) @classmethod def __prepare__(cls, name, this_bases): return meta.__prepare__(name, bases) return type.__new__(metaclass, 'temporary_class', (), {}) def add_metaclass(metaclass): """Class decorator for creating a class with a metaclass.""" def wrapper(cls): orig_vars = cls.__dict__.copy() slots = orig_vars.get('__slots__') if slots is not None: if isinstance(slots, str): slots = [slots] for slots_var in slots: orig_vars.pop(slots_var) orig_vars.pop('__dict__', None) orig_vars.pop('__weakref__', None) return metaclass(cls.__name__, cls.__bases__, orig_vars) return wrapper def ensure_binary(s, encoding='utf-8', errors='strict'): """Coerce **s** to six.binary_type. For Python 2: - `unicode` -> encoded to `str` - `str` -> `str` For Python 3: - `str` -> encoded to `bytes` - `bytes` -> `bytes` """ if isinstance(s, text_type): return s.encode(encoding, errors) elif isinstance(s, binary_type): return s else: raise TypeError("not expecting type '%s'" % type(s)) def ensure_str(s, encoding='utf-8', errors='strict'): """Coerce *s* to `str`. For Python 2: - `unicode` -> encoded to `str` - `str` -> `str` For Python 3: - `str` -> `str` - `bytes` -> decoded to `str` """ if not isinstance(s, (text_type, binary_type)): raise TypeError("not expecting type '%s'" % type(s)) if PY2 and isinstance(s, text_type): s = s.encode(encoding, errors) elif PY3 and isinstance(s, binary_type): s = s.decode(encoding, errors) return s def ensure_text(s, encoding='utf-8', errors='strict'): """Coerce *s* to six.text_type. For Python 2: - `unicode` -> `unicode` - `str` -> `unicode` For Python 3: - `str` -> `str` - `bytes` -> decoded to `str` """ if isinstance(s, binary_type): return s.decode(encoding, errors) elif isinstance(s, text_type): return s else: raise TypeError("not expecting type '%s'" % type(s)) def python_2_unicode_compatible(klass): """ A decorator that defines __unicode__ and __str__ methods under Python 2. Under Python 3 it does nothing. To support Python 2 and 3 with a single code base, define a __str__ method returning text and apply this decorator to the class. """ if PY2: if '__str__' not in klass.__dict__: raise ValueError("@python_2_unicode_compatible cannot be applied " "to %s because it doesn't define __str__()." % klass.__name__) klass.__unicode__ = klass.__str__ klass.__str__ = lambda self: self.__unicode__().encode('utf-8') return klass # Complete the moves implementation. # This code is at the end of this module to speed up module loading. # Turn this module into a package. __path__ = [] # required for PEP 302 and PEP 451 __package__ = __name__ # see PEP 366 @ReservedAssignment if globals().get("__spec__") is not None: __spec__.submodule_search_locations = [] # PEP 451 @UndefinedVariable # Remove other six meta path importers, since they cause problems. This can # happen if six is removed from sys.modules and then reloaded. (Setuptools does # this for some reason.) if sys.meta_path: for i, importer in enumerate(sys.meta_path): # Here's some real nastiness: Another "instance" of the six module might # be floating around. Therefore, we can't use isinstance() to check for # the six meta path importer, since the other six instance will have # inserted an importer with different class. if (type(importer).__name__ == "_SixMetaPathImporter" and importer.name == __name__): del sys.meta_path[i] break del i, importer # Finally, add the importer to the meta path import hook. sys.meta_path.append(_importer) M2Crypto-0.31.0/M2Crypto/threading.py0000664000175000001440000000067713165756570017562 0ustar matejusers00000000000000from __future__ import absolute_import """ M2Crypto threading support, required for multithreaded applications. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" # M2Crypto from M2Crypto import m2 def init(): # type: () -> None """ Initialize threading support. """ m2.threading_init() def cleanup(): # type: () -> None """ End and cleanup threading support. """ m2.threading_cleanup() M2Crypto-0.31.0/M2Crypto/util.py0000644000175000001440000000377513355123234016554 0ustar matejusers00000000000000from __future__ import absolute_import """ M2Crypto utility routines. NOTHING IN THIS MODULE IS GUARANTEED TO BE STABLE, USED ONLY FOR INTERNAL PURPOSES OF M2CRYPTO. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004 OSAF. All Rights Reserved. """ import binascii import logging import sys from M2Crypto import m2, py27plus, six if py27plus: from typing import Any, AnyStr, Optional, Tuple, Union # noqa # see https://github.com/python/typeshed/issues/222 AddrType = Union[Tuple[str, int], str] log = logging.getLogger('util') class UtilError(Exception): pass m2.util_init(UtilError) def pkcs5_pad(data, blklen=8): # type: (str, int) -> str pad = (8 - (len(data) % 8)) return data + chr(pad) * pad def pkcs7_pad(data, blklen): # type: (str, int) -> str if blklen > 255: raise ValueError('illegal block size') pad = (blklen - (len(data) % blklen)) return data + chr(pad) * pad def bin_to_hex(b): # type: (bytes) -> str return six.ensure_text(binascii.b2a_base64(b)[:-1]) def octx_to_num(x): # type: (bytes) -> int return int(binascii.hexlify(x), 16) def genparam_callback(p, n, out=sys.stdout): # type: (int, Any, file) -> None ch = ['.', '+', '*', '\n'] out.write(ch[p]) out.flush() def quiet_genparam_callback(p, n, out): # type: (Any, Any, Any) -> None pass def passphrase_callback(v, prompt1='Enter passphrase:', prompt2='Verify passphrase:'): # type: (bool, str, str) -> Optional[str] from getpass import getpass while 1: try: p1 = getpass(prompt1) if v: p2 = getpass(prompt2) if p1 == p2: break else: break except KeyboardInterrupt: return None return p1 def no_passphrase_callback(*args): # type: (*Any) -> str return '' M2Crypto-0.31.0/MANIFEST.in0000644000175000001440000000052313355123234015270 0ustar matejusers00000000000000include SWIG/*.i include SWIG/*.h include SWIG/*.def recursive-include tests *.py *.pem *.der *.b64 README *.pgp *.dat *.p7* *.crt *.txt recursive-include doc * recursive-include contrib * include INSTALL.rst include README.rst include CHANGES include epydoc.conf include LICENCE include SWIG/_m2crypto_wrap.c include M2Crypto/m2crypto.py M2Crypto-0.31.0/PKG-INFO0000644000175000001440000000315213371124434014631 0ustar matejusers00000000000000Metadata-Version: 1.2 Name: M2Crypto Version: 0.31.0 Summary: M2Crypto: A Python crypto and SSL toolkit Home-page: https://gitlab.com/m2crypto/m2crypto Author: Ng Pheng Siong Author-email: ngps@sandbox.rulemaker.net Maintainer: Matej Cepl Maintainer-email: mcepl@cepl.eu License: MIT Description: M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, EC, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing AuthCookies for web session management; FTP/TLS client and server; S/MIME; M2Crypto can also be used to provide SSL for Twisted. Smartcards supported through the Engine interface. Keywords: cryptography openssl Platform: any Classifier: Development Status :: 5 - Production/Stable Classifier: Intended Audience :: Developers Classifier: License :: OSI Approved :: MIT License Classifier: Operating System :: OS Independent Classifier: Programming Language :: C Classifier: Programming Language :: Python Classifier: Topic :: Security :: Cryptography Classifier: Topic :: Software Development :: Libraries :: Python Modules Classifier: Programming Language :: Python :: 2 Classifier: Programming Language :: Python :: 2.6 Classifier: Programming Language :: Python :: 2.7 Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.4 Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 M2Crypto-0.31.0/README.rst0000664000175000001440000000427613243106353015233 0ustar matejusers00000000000000======== M2Crypto ======== :Maintainer: Matěj Cepl :Web-Site: https://gitlab.com/m2crypto/m2crypto :Documentation: https://m2crypto.readthedocs.io/ :Email list: m2crypto@lists.redcrew.org or http://redcrew.org/mailman/listinfo/m2crypto :IRC channel: `#m2crypto`_ on Freenode M2Crypto = Python + OpenSSL + SWIG ---------------------------------- M2Crypto is a crypto and SSL toolkit for Python. M2 stands for "me, too!" M2Crypto comes with the following: - **RSA**, **DSA**, **DH**, **HMACs**, **message digests**, **symmetric ciphers** including **AES**, - **TLS** functionality to implement **clients and servers**. - **Example SSL client and server programs**, which are variously **threading**, **forking** or based on **non-blocking socket IO**. - **HTTPS** extensions to Python's **httplib, urllib and xmlrpclib**. - Unforgeable HMAC'ing **AuthCookies** for **web session management**. - **FTP/TLS** client and server. - **S/MIME v2**. - **ZServerSSL**: A **HTTPS server for Zope**. - **ZSmime**: An S/MIME messenger for **Zope**. We care a lot about stable API and all Python methods should be preserved, note however that ``m2.`` namespace is considered internal to the library and it doesn't have to be preserved. If however some change to it breaks your app, let us know and we will try to make things working for you. - And much more. M2Crypto is released under a very liberal MIT licence. See LICENCE for details. To install, see the file INSTALL. Look at the tests and demos for example use. Recommended reading before deploying in production is "Network Security with OpenSSL" by John Viega, Matt Messier and Pravir Chandra, ISBN 059600270X. Note these caveats: - Possible memory leaks, because some objects need to be freed on the Python side and other objects on the C side, and these may change between OpenSSL versions. (Multiple free's lead to crashes very quickly, so these should be relatively rare.) - No memory locking/clearing for keys, passphrases, etc. because AFAIK Python does not provide the features needed. On the C (OpenSSL) side things are cleared when the Python objects are deleted. Have fun! Your feedback is welcome. .. _`#m2crypto`: irc://Freenode/#m2crypto M2Crypto-0.31.0/SWIG/0000755000175000001440000000000013371124434014304 5ustar matejusers00000000000000M2Crypto-0.31.0/SWIG/Makefile0000664000175000001440000000116313165756570015764 0ustar matejusers00000000000000# $Id$ CFLAGS = -DTHREADING -g INCLUDE = -I/usr/local/include -I. LIBS = -L/usr/local/lib -lssl -lcrypto #if PYTHON_VERSION PYVER = $(PYTHON_VERSION) #else PYVER = 2.3 #endif PYINCLUDE = -DHAVE_CONFIG_H -I/usr/local/include/python$(PYVER) \ -I/usr/local/lib/python$(PYVER)/config PYLIB = /usr/local/lib/python$(PYVER)/config all: _m2crypto _m2crypto: _m2crypto.i swig -python -shadow _m2crypto.i cc -c -fpic $(CFLAGS) $(INCLUDE) $(PYINCLUDE) _m2crypto_wrap.c ld -Bshareable -o _m2crypto.so _m2crypto_wrap.o $(LIBS) cp m2crypto.py _m2crypto.so ../M2Crypto clean: rm -f *_wrap* *.o *.so _*.py *.pyc M2Crypto-0.31.0/SWIG/_aes.i0000664000175000001440000000416013237312743015373 0ustar matejusers00000000000000/* Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. */ /* $Id$ */ %{ #include #if OPENSSL_VERSION_NUMBER >= 0x0090800fL #include #endif /* // 2004-10-10, ngps: // CTR mode is not included in the default OpenSSL build. // To use the AES CTR ciphers, link with your own copy of OpenSSL. */ #ifdef HAVE_AES_CTR extern EVP_CIPHER const *EVP_aes_128_ctr(void); extern EVP_CIPHER const *EVP_aes_192_ctr(void); extern EVP_CIPHER const *EVP_aes_256_ctr(void); #endif %} %apply Pointer NONNULL { AES_KEY * }; %constant int AES_BLOCK_SIZE = AES_BLOCK_SIZE; %inline %{ AES_KEY *aes_new(void) { AES_KEY *key; if (!(key = (AES_KEY *)PyMem_Malloc(sizeof(AES_KEY)))) { PyErr_SetString(PyExc_MemoryError, "Insufficient memory for AES key."); return NULL; } return key; } void AES_free(AES_KEY *key) { PyMem_Free((void *)key); } /* // op == 0: encrypt // otherwise: decrypt (Python code will supply the value 1.) */ PyObject *AES_set_key(AES_KEY *key, PyObject *value, int bits, int op) { char *vbuf; Py_ssize_t vlen; if (PyBytes_AsStringAndSize(value, &vbuf, &vlen) == -1) return NULL; if (op == 0) AES_set_encrypt_key((const unsigned char *)vbuf, bits, key); else AES_set_decrypt_key((const unsigned char *)vbuf, bits, key); Py_RETURN_NONE; } /* // op == 0: encrypt // otherwise: decrypt (Python code will supply the value 1.) */ PyObject *AES_crypt(const AES_KEY *key, PyObject *in, int outlen, int op) { char *buf; Py_ssize_t len; unsigned char *out; PyObject *res; if (PyBytes_AsStringAndSize(in, &buf, &len) == -1) return NULL; if (!(out=(unsigned char *)PyMem_Malloc(outlen))) { PyErr_SetString(PyExc_MemoryError, "AES_crypt"); return NULL; } if (op == 0) AES_encrypt((const unsigned char *)buf, out, key); else AES_decrypt((const unsigned char *)buf, out, key); res = PyBytes_FromStringAndSize((char*)out, outlen); PyMem_Free(out); return res; } int AES_type_check(AES_KEY *key) { return 1; } %} M2Crypto-0.31.0/SWIG/_asn1.i0000644000175000001440000001321013355123234015453 0ustar matejusers00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. */ /* ** Portions created by Open Source Applications Foundation (OSAF) are ** Copyright (C) 2004 OSAF. All Rights Reserved. */ /* $Id$ */ %{ #include %} %apply Pointer NONNULL { BIO * }; %apply Pointer NONNULL { ASN1_OBJECT * }; %apply Pointer NONNULL { ASN1_STRING * }; %apply Pointer NONNULL { ASN1_INTEGER * }; %apply Pointer NONNULL { ASN1_TIME * }; %rename(asn1_object_new) ASN1_OBJECT_new; extern ASN1_OBJECT *ASN1_OBJECT_new( void ); %rename(asn1_object_create) ASN1_OBJECT_create; extern ASN1_OBJECT *ASN1_OBJECT_create( int, unsigned char *, int, const char *, const char *); %rename(asn1_object_free) ASN1_OBJECT_free; extern void ASN1_OBJECT_free( ASN1_OBJECT *); %rename(i2d_asn1_object) i2d_ASN1_OBJECT; extern int i2d_ASN1_OBJECT( ASN1_OBJECT *, unsigned char **); %rename(d2i_asn1_object) d2i_ASN1_OBJECT; extern ASN1_OBJECT *d2i_ASN1_OBJECT( ASN1_OBJECT **, const unsigned char **, long); %rename(asn1_bit_string_new) ASN1_BIT_STRING_new; extern ASN1_BIT_STRING *ASN1_BIT_STRING_new( void ); %rename(asn1_string_new) ASN1_STRING_new; extern ASN1_STRING *ASN1_STRING_new( void ); %rename(asn1_string_free) ASN1_STRING_free; extern void ASN1_STRING_free( ASN1_STRING *); %typemap(in) (const void *, int) { if (PyBytes_Check($input)) { Py_ssize_t len; $1 = PyBytes_AsString($input); len = PyBytes_Size($input); if (len > INT_MAX) { PyErr_SetString(PyExc_ValueError, "object too large"); return NULL; } $2 = len; } else { PyErr_SetString(PyExc_TypeError, "expected string"); return NULL; } } %rename(asn1_string_set) ASN1_STRING_set; extern int ASN1_STRING_set( ASN1_STRING *, const void *, int); %typemap(in) (const void *, int); %rename(asn1_string_print) ASN1_STRING_print; %threadallow ASN1_STRING_print; extern int ASN1_STRING_print(BIO *, ASN1_STRING *); %threadallow ASN1_STRING_print_ex; %rename(asn1_string_print_ex) ASN1_STRING_print_ex; extern int ASN1_STRING_print_ex(BIO *, ASN1_STRING *, unsigned long); %rename(asn1_time_new) ASN1_TIME_new; extern ASN1_TIME *ASN1_TIME_new( void ); %rename(asn1_time_free) ASN1_TIME_free; extern void ASN1_TIME_free(ASN1_TIME *); %rename(asn1_time_check) ASN1_TIME_check; extern int ASN1_TIME_check(ASN1_TIME *); %rename(asn1_time_set) ASN1_TIME_set; extern ASN1_TIME *ASN1_TIME_set(ASN1_TIME *, long); %rename(asn1_time_set_string) ASN1_TIME_set_string; extern int ASN1_TIME_set_string(ASN1_TIME *, const char *); %rename(asn1_time_print) ASN1_TIME_print; %threadallow ASN1_TIME_print; extern int ASN1_TIME_print(BIO *, ASN1_TIME *); %rename(asn1_integer_new) ASN1_INTEGER_new; extern ASN1_INTEGER *ASN1_INTEGER_new( void ); %rename(asn1_integer_free) ASN1_INTEGER_free; extern void ASN1_INTEGER_free( ASN1_INTEGER *); %rename(asn1_integer_cmp) ASN1_INTEGER_cmp; extern int ASN1_INTEGER_cmp(ASN1_INTEGER *, ASN1_INTEGER *); %constant int ASN1_STRFLGS_ESC_2253 = 1; %constant int ASN1_STRFLGS_ESC_CTRL = 2; %constant int ASN1_STRFLGS_ESC_MSB = 4; %constant int ASN1_STRFLGS_ESC_QUOTE = 8; %constant int ASN1_STRFLGS_UTF8_CONVERT = 0x10; %constant int ASN1_STRFLGS_IGNORE_TYPE = 0x20; %constant int ASN1_STRFLGS_SHOW_TYPE = 0x40; %constant int ASN1_STRFLGS_DUMP_ALL = 0x80; %constant int ASN1_STRFLGS_DUMP_UNKNOWN = 0x100; %constant int ASN1_STRFLGS_DUMP_DER = 0x200; %constant int ASN1_STRFLGS_RFC2253 = (ASN1_STRFLGS_ESC_2253 | \ ASN1_STRFLGS_ESC_CTRL | \ ASN1_STRFLGS_ESC_MSB | \ ASN1_STRFLGS_UTF8_CONVERT | \ ASN1_STRFLGS_DUMP_UNKNOWN | \ ASN1_STRFLGS_DUMP_DER); %inline %{ /* ASN1_TIME_set_string () is a macro */ int asn1_time_type_check(ASN1_TIME *ASN1_TIME) { return 1; } PyObject *asn1_integer_get(ASN1_INTEGER *asn1) { BIGNUM *bn; PyObject *ret; char *hex; bn = ASN1_INTEGER_to_BN(asn1, NULL); if (!bn){ m2_PyErr_Msg(PyExc_RuntimeError); return NULL; } hex = BN_bn2hex(bn); if (!hex){ m2_PyErr_Msg(PyExc_RuntimeError); BN_free(bn); return NULL; } BN_free(bn); ret = PyLong_FromString(hex, NULL, 16); OPENSSL_free(hex); return ret; } int asn1_integer_set(ASN1_INTEGER *asn1, PyObject *value) { BIGNUM *bn = NULL; PyObject *fmt, *args, *hex; /* Despite all hopes to the contrary, we cannot survive here with * PyLong_AsLong shims as provided in * /usr/include/python2.7/longobject.h. */ long val = PyLong_AsLong(value); if (val >= 0) { return ASN1_INTEGER_set(asn1, val); } else { PyErr_Clear(); } if (!PyLong_Check(value)){ PyErr_SetString(PyExc_TypeError, "expected int or long"); return 0; } fmt = PyUnicode_FromString("%x"); if (!fmt) return 0; args = PyTuple_New(1); if (!args){ Py_DECREF(fmt); PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() failed"); return 0; } Py_INCREF(value); PyTuple_SET_ITEM(args, 0, value); hex = PyUnicode_Format(fmt, args); if (!hex){ PyErr_SetString(PyExc_RuntimeError, "PyString_Format() failed"); Py_DECREF(fmt); Py_DECREF(args); return 0; } Py_DECREF(fmt); Py_DECREF(args); if (BN_hex2bn(&bn, PyUnicode_AsUTF8(hex)) <= 0){ m2_PyErr_Msg(PyExc_RuntimeError); Py_DECREF(hex); return 0; } Py_DECREF(hex); if (!BN_to_ASN1_INTEGER(bn, asn1)){ m2_PyErr_Msg(PyExc_RuntimeError); BN_free(bn); return 0; } BN_free(bn); return 1; } %} M2Crypto-0.31.0/SWIG/_bio.i0000664000175000001440000003045213247615013015374 0ustar matejusers00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (c) 1999 Ng Pheng Siong. All rights reserved. * * Portions created by Open Source Applications Foundation (OSAF) are * Copyright (C) 2004-2005 OSAF. All Rights Reserved. * Author: Heikki Toivonen * * Copyright 2018 Daniel Wozniak. All Rights Reserved.*/ /* $Id$ */ %{ #include %} %apply Pointer NONNULL { BIO * }; %apply Pointer NONNULL { BIO_METHOD * }; %rename(bio_s_bio) BIO_s_bio; extern BIO_METHOD *BIO_s_bio(void); %rename(bio_s_mem) BIO_s_mem; extern BIO_METHOD *BIO_s_mem(void); %rename(bio_s_socket) BIO_s_socket; extern BIO_METHOD *BIO_s_socket(void); %rename(bio_f_ssl) BIO_f_ssl; extern BIO_METHOD *BIO_f_ssl(void); %rename(bio_f_buffer) BIO_f_buffer; extern BIO_METHOD *BIO_f_buffer(void); %rename(bio_f_cipher) BIO_f_cipher; extern BIO_METHOD *BIO_f_cipher(void); %rename(bio_new) BIO_new; extern BIO *BIO_new(BIO_METHOD *); %rename(bio_new_socket) BIO_new_socket; extern BIO *BIO_new_socket(int, int); %rename(bio_new_fd) BIO_new_pyfd; %rename(bio_new_pyfd) BIO_new_pyfd; %rename(bio_free_all) BIO_free_all; %threadallow BIO_free_all; extern void BIO_free_all(BIO *); %rename(bio_dup_chain) BIO_dup_chain; extern BIO *BIO_dup_chain(BIO *); %rename(bio_push) BIO_push; extern BIO *BIO_push(BIO *, BIO *); %rename(bio_pop) BIO_pop; extern BIO *BIO_pop(BIO *); %rename(bio_eof) BIO_eof; extern int BIO_eof(BIO *); %constant int bio_noclose = BIO_NOCLOSE; %constant int bio_close = BIO_CLOSE; %constant int BIO_FLAGS_READ = 0x01; %constant int BIO_FLAGS_WRITE = 0x02; %constant int BIO_FLAGS_IO_SPECIAL = 0x04; %constant int BIO_FLAGS_RWS = (BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL); %constant int BIO_FLAGS_SHOULD_RETRY = 0x08; %constant int BIO_FLAGS_MEM_RDONLY = 0x200; %warnfilter(454) _bio_err; %inline %{ static PyObject *_bio_err; void pyfd_init(void); void bio_init(PyObject *bio_err) { Py_INCREF(bio_err); _bio_err = bio_err; pyfd_init(); } int bio_free(BIO *bio) { int ret; Py_BEGIN_ALLOW_THREADS ret = BIO_free(bio); Py_END_ALLOW_THREADS if (ret == 0) { m2_PyErr_Msg(_bio_err); } return ret; } BIO * bio_new_file(const char *filename, const char *mode) { BIO *ret; Py_BEGIN_ALLOW_THREADS ret = BIO_new_file(filename, mode); Py_END_ALLOW_THREADS if (ret == NULL) { m2_PyErr_Msg(_bio_err); } return ret; } BIO *bio_new_pyfile(PyObject *pyfile, int bio_close) { FILE *fp = NULL; BIO *bio = NULL; fp = PyFile_AsFile(pyfile); bio = BIO_new_fp(fp, bio_close); /* returns NULL if error occurred */ if (bio == NULL) { /* Find out the name of the file so we can have good error * message. */ PyObject *pyname = m2_PyFile_Name(pyfile); char *name = PyBytes_AsString(pyname); if (name == NULL) { PyErr_Format(_bio_err, "Opening of the new BIO on file failed!"); } else { PyErr_Format(_bio_err, "Opening of the new BIO on file %s failed!", name); } Py_DECREF(pyname); } return bio; } PyObject *bio_read(BIO *bio, int num) { PyObject *blob; void *buf; int r; if (!(buf = PyMem_Malloc(num))) { PyErr_SetString(PyExc_MemoryError, "bio_read"); return NULL; } Py_BEGIN_ALLOW_THREADS r = BIO_read(bio, buf, num); Py_END_ALLOW_THREADS if (r < 0) { PyMem_Free(buf); if (ERR_peek_error()) { m2_PyErr_Msg(_bio_err); return NULL; } Py_RETURN_NONE; } blob = PyBytes_FromStringAndSize(buf, r); PyMem_Free(buf); return blob; } PyObject *bio_gets(BIO *bio, int num) { PyObject *blob; void *buf; int r; if (!(buf = PyMem_Malloc(num))) { PyErr_SetString(PyExc_MemoryError, "bio_gets"); return NULL; } Py_BEGIN_ALLOW_THREADS r = BIO_gets(bio, buf, num); Py_END_ALLOW_THREADS if (r < 1) { PyMem_Free(buf); if (ERR_peek_error()) { m2_PyErr_Msg(_bio_err); return NULL; } Py_RETURN_NONE; } blob = PyBytes_FromStringAndSize(buf, r); PyMem_Free(buf); return blob; } int bio_write(BIO *bio, PyObject *from) { const void *fbuf; int flen = 0, ret; if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1) return -1; Py_BEGIN_ALLOW_THREADS ret = BIO_write(bio, fbuf, flen); Py_END_ALLOW_THREADS if (ret < 0) { if (ERR_peek_error()) { m2_PyErr_Msg(_bio_err); return -1; } } return ret; } /* XXX Casting size_t to int. */ int bio_ctrl_pending(BIO *bio) { return (int)BIO_ctrl_pending(bio); } int bio_ctrl_wpending(BIO *bio) { return (int)BIO_ctrl_wpending(bio); } int bio_ctrl_get_write_guarantee(BIO *a) { return BIO_ctrl_get_write_guarantee(a); } int bio_reset(BIO *bio) { return (int)BIO_reset(bio); } %} %threadallow bio_flush; %inline %{ int bio_flush(BIO *bio) { return (int)BIO_flush(bio); } int bio_seek(BIO *bio, int offset) { return (int)BIO_seek(bio, offset); } int bio_tell(BIO* bio) { return BIO_tell(bio); } void bio_set_flags(BIO *bio, int flags) { BIO_set_flags(bio, flags); } int bio_get_flags(BIO *bio) { return BIO_get_flags(bio); } /* * sets the cipher of BIO @param b to c using key @param key and IV @iv. * @param enc should be set to 1 for encryption and zero to decryption. * */ PyObject *bio_set_cipher(BIO *b, EVP_CIPHER *c, PyObject *key, PyObject *iv, int op) { const void *kbuf, *ibuf; Py_ssize_t klen, ilen; if ((PyObject_AsReadBuffer(key, &kbuf, &klen) == -1) || (PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1)) return NULL; BIO_set_cipher(b, (const EVP_CIPHER *)c, (unsigned char *)kbuf, (unsigned char *)ibuf, op); Py_RETURN_NONE; } int bio_set_mem_eof_return(BIO *b, int v) { return (int)BIO_set_mem_eof_return(b, v); } int bio_get_fd(BIO *bio) { return BIO_get_fd(bio, NULL); } %} %warnfilter(454) methods_fdp; %threadallow bio_do_handshake; %inline %{ int bio_do_handshake(BIO *bio) { return BIO_do_handshake(bio); } /* macro */ int bio_make_bio_pair(BIO* b1, BIO* b2) { return BIO_make_bio_pair(b1, b2); } int bio_set_write_buf_size(BIO* b, size_t size) { return BIO_set_write_buf_size(b, size); } int bio_should_retry(BIO* a) { return BIO_should_retry(a); } int bio_should_read(BIO* a) { return BIO_should_read(a); } int bio_should_write(BIO* a) { return BIO_should_write(a); } /* Macros for things not defined before 1.1.0 */ #if OPENSSL_VERSION_NUMBER < 0x10100000L static BIO_METHOD * BIO_meth_new( int type, const char *name ) { BIO_METHOD *method = malloc( sizeof(BIO_METHOD) ); memset( method, 0, sizeof(BIO_METHOD) ); method->type = type; method->name = name; return method; } static void BIO_meth_free( BIO_METHOD *meth ) { if ( meth == NULL ) { return; } free(meth); } #define BIO_meth_set_write(m, f) (m)->bwrite = (f) #define BIO_meth_set_read(m, f) (m)->bread = (f) #define BIO_meth_set_puts(m, f) (m)->bputs = (f) #define BIO_meth_set_gets(m, f) (m)->bgets = (f) #define BIO_meth_set_ctrl(m, f) (m)->ctrl = (f) #define BIO_meth_set_create(m, f) (m)->create = (f) #define BIO_meth_set_destroy(m, f) (m)->destroy = (f) #define BIO_set_shutdown(b, x) (b)->shutdown = x #define BIO_get_shutdown(b) (b)->shutdown #define BIO_set_init(b, x) b->init = x #define BIO_get_init(b) (b)->init #define BIO_set_data(b, x) b->ptr = x #define BIO_clear_flags(b, x) b->flags &= ~(x) #define BIO_get_data(b) b->ptr #endif /* implment custom BIO_s_pyfd */ #ifdef _WIN32 # define clear_sys_error() SetLastError(0) /* Linux doesn't use underscored calls yet */ # define open(p, f, m) _open(p, f, m) # define read(f, b, n) _read(f, b, n) # define write(f, b, n) _write(f, b, n) # define close(f) _close(f) # define lseek(fd, o, w) _lseek(fd, o, w) #else # define clear_sys_error() errno=0 #endif typedef struct pyfd_struct { int fd; } BIO_PYFD_CTX; /* Setting up methods_fdp */ static BIO_METHOD *methods_fdp; static int pyfd_write(BIO *b, const char *in, int inl) { int ret, fd; if (BIO_get_fd(b, &fd) == -1) { PyErr_SetString(_bio_err, "BIO has not been initialized."); return -1; } clear_sys_error(); ret = write(fd, in, inl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_fd_should_retry(ret)) BIO_set_retry_write(b); } return ret; } static int pyfd_read(BIO *b, char *out, int outl) { int ret = 0, fd; if (BIO_get_fd(b, &fd) == -1) { PyErr_SetString(_bio_err, "BIO has not been initialized."); return -1; } if (out != NULL) { clear_sys_error(); ret = read(fd, out, outl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_fd_should_retry(ret)) BIO_set_retry_read(b); } } return ret; } static int pyfd_puts(BIO *bp, const char *str) { int n, ret; n = strlen(str); ret = pyfd_write(bp, str, n); return ret; } static int pyfd_gets(BIO *bp, char *buf, int size) { int ret = 0; char *ptr = buf; char *end = buf + size - 1; /* See https://github.com/openssl/openssl/pull/3442 We were here just repeating a bug from OpenSSL */ while (ptr < end && pyfd_read(bp, ptr, 1) > 0) { if (*ptr++ == '\n') break; } ptr[0] = '\0'; if (buf[0] != '\0') ret = strlen(buf); return ret; } static int pyfd_new(BIO* b) { BIO_PYFD_CTX* ctx; ctx = OPENSSL_zalloc(sizeof(*ctx)); if (ctx == NULL) return 0; ctx->fd = -1; BIO_set_data(b, ctx); BIO_set_shutdown(b, 0); BIO_set_init(b, 1); return 1; } static int pyfd_free(BIO* b) { BIO_PYFD_CTX* ctx; if (b == 0) return 0; ctx = BIO_get_data(b); if (ctx == NULL) return 0; if (BIO_get_shutdown(b) && BIO_get_init(b)) close(ctx->fd); BIO_set_data(b, NULL); BIO_set_shutdown(b, 0); BIO_set_init(b, 0); OPENSSL_free(ctx); return 1; } static long pyfd_ctrl(BIO *b, int cmd, long num, void *ptr) { BIO_PYFD_CTX* ctx; int *ip; long ret = 1; ctx = BIO_get_data(b); if (ctx == NULL) return 0; switch (cmd) { case BIO_CTRL_RESET: num = 0; case BIO_C_FILE_SEEK: ret = (long)lseek(ctx->fd, num, 0); break; case BIO_C_FILE_TELL: case BIO_CTRL_INFO: ret = (long)lseek(ctx->fd, 0, 1); break; case BIO_C_SET_FD: pyfd_free(b); if (*((int *)ptr) > -1) { if (!pyfd_new(b) || !(ctx = BIO_get_data(b))) return 0; ctx->fd = *((int *)ptr); BIO_set_shutdown(b, (int)num); BIO_set_init(b, 1); } break; case BIO_C_GET_FD: if (BIO_get_init(b)) { ip = (int *)ptr; if (ip != NULL) *ip = ctx->fd; ret = ctx->fd; } else ret = -1; break; case BIO_CTRL_GET_CLOSE: ret = BIO_get_shutdown(b); break; case BIO_CTRL_SET_CLOSE: BIO_set_shutdown(b, (int)num); break; case BIO_CTRL_PENDING: case BIO_CTRL_WPENDING: ret = 0; break; case BIO_CTRL_DUP: case BIO_CTRL_FLUSH: ret = 1; break; default: ret = 0; break; } return ret; } void pyfd_init(void) { #if OPENSSL_VERSION_NUMBER >= 0x10100000L methods_fdp = BIO_meth_new( BIO_get_new_index()|BIO_TYPE_DESCRIPTOR|BIO_TYPE_SOURCE_SINK, "python file descriptor"); #else methods_fdp = BIO_meth_new( 100 |BIO_TYPE_DESCRIPTOR|BIO_TYPE_SOURCE_SINK, "python file descriptor"); #endif BIO_meth_set_write(methods_fdp, pyfd_write); BIO_meth_set_read(methods_fdp, pyfd_read); BIO_meth_set_puts(methods_fdp, pyfd_puts); BIO_meth_set_gets(methods_fdp, pyfd_gets); BIO_meth_set_ctrl(methods_fdp, pyfd_ctrl); BIO_meth_set_create(methods_fdp, pyfd_new); BIO_meth_set_destroy(methods_fdp, pyfd_free); } BIO* BIO_new_pyfd(int fd, int close_flag) { BIO *ret; ret = BIO_new(methods_fdp); BIO_set_fd(ret, fd, close_flag); return ret; } %} M2Crypto-0.31.0/SWIG/_bn.i0000664000175000001440000000572013236336220015220 0ustar matejusers00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (c) 2005-2006 Open Source Applications Foundation. All rights reserved. */ /* We are converting between the Python arbitrarily long integer and * the BIGNUM arbitrarily long integer by converting to and from * a string representation of the number (in hexadecimal). * Direct manipulation would be a possibility, but would require * tighter integration with the Python and OpenSSL internals. */ %{ #include %} %inline %{ PyObject *bn_rand(int bits, int top, int bottom) { BIGNUM* rnd; PyObject *ret; char *randhex; rnd = BN_new(); if (rnd == NULL) { m2_PyErr_Msg(PyExc_Exception); return NULL; } if (!BN_rand(rnd, bits, top, bottom)) { /*Custom errors?*/ m2_PyErr_Msg(PyExc_Exception); BN_free(rnd); return NULL; } randhex = BN_bn2hex(rnd); if (!randhex) { /*Custom errors?*/ m2_PyErr_Msg(PyExc_Exception); BN_free(rnd); return NULL; } BN_free(rnd); ret = PyLong_FromString(randhex, NULL, 16); OPENSSL_free(randhex); return ret; } PyObject *bn_rand_range(PyObject *range) { BIGNUM* rnd; BIGNUM *rng = NULL; PyObject *ret, *tuple; PyObject *format, *rangePyString; char *randhex; /* PyLong_FromString is unhappy with const */ const char *rangehex; /* Wow, it's a lot of work to convert into a hex string in C! */ format = PyUnicode_FromString("%x"); if (!format) { PyErr_SetString(PyExc_RuntimeError, "Cannot create Python string '%x'"); return NULL; } tuple = PyTuple_New(1); if (!tuple) { Py_DECREF(format); PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails"); return NULL; } Py_INCREF(range); PyTuple_SET_ITEM(tuple, 0, range); rangePyString = PyUnicode_Format(format, tuple); if (!rangePyString) { PyErr_SetString(PyExc_Exception, "String Format failed"); Py_DECREF(format); Py_DECREF(tuple); return NULL; } Py_DECREF(format); Py_DECREF(tuple); rangehex = (const char*)PyUnicode_AsUTF8(rangePyString); if (!BN_hex2bn(&rng, rangehex)) { /*Custom errors?*/ m2_PyErr_Msg(PyExc_Exception); Py_DECREF(rangePyString); return NULL; } Py_DECREF(rangePyString); if (!(rnd = BN_new())) { PyErr_SetString(PyExc_MemoryError, "bn_rand_range"); return NULL; } if (!BN_rand_range(rnd, rng)) { /*Custom errors?*/ m2_PyErr_Msg(PyExc_Exception); BN_free(rnd); BN_free(rng); return NULL; } BN_free(rng); randhex = BN_bn2hex(rnd); if (!randhex) { /*Custom errors?*/ m2_PyErr_Msg(PyExc_Exception); BN_free(rnd); return NULL; } BN_free(rnd); ret = PyLong_FromString(randhex, NULL, 16); OPENSSL_free(randhex); return ret; } %} M2Crypto-0.31.0/SWIG/_dh.i0000664000175000001440000001036313236336220015213 0ustar matejusers00000000000000/* Copyright (c) 1999 Ng Pheng Siong. All rights reserved. */ /* $Id$ */ %{ #include #include #include #include #include %} %apply Pointer NONNULL { DH * }; %rename(dh_new) DH_new; extern DH *DH_new(void); %rename(dh_free) DH_free; extern void DH_free(DH *); %rename(dh_size) DH_size; extern int DH_size(const DH *); %rename(dh_generate_key) DH_generate_key; extern int DH_generate_key(DH *); %rename(dhparams_print) DHparams_print; %threadallow DHparams_print; extern int DHparams_print(BIO *, const DH *); %constant int dh_check_ok = 0; %constant int dh_check_p_not_prime = DH_CHECK_P_NOT_PRIME; %constant int dh_check_p_not_strong = DH_CHECK_P_NOT_STRONG_PRIME; %constant int dh_check_g_failed = DH_UNABLE_TO_CHECK_GENERATOR; %constant int dh_check_bad_g = DH_NOT_SUITABLE_GENERATOR; %constant DH_GENERATOR_2 = 2; %constant DH_GENERATOR_5 = 5; %warnfilter(454) _dh_err; %inline %{ static PyObject *_dh_err; void dh_init(PyObject *dh_err) { Py_INCREF(dh_err); _dh_err = dh_err; } int dh_type_check(DH *dh) { /* Our getting here means we passed Swig's type checking, XXX Still need to check the pointer for sanity? */ return 1; } %} %threadallow dh_read_parameters; %inline %{ DH *dh_read_parameters(BIO *bio) { return PEM_read_bio_DHparams(bio, NULL, NULL, NULL); } DH *dh_generate_parameters(int plen, int g, PyObject *pyfunc) { DH *dh; BN_GENCB *gencb; int ret; if ((gencb=BN_GENCB_new()) == NULL) { m2_PyErr_Msg(_dh_err); return NULL; } if ((dh=DH_new()) == NULL) { m2_PyErr_Msg(_dh_err); BN_GENCB_free(gencb); return NULL; } BN_GENCB_set(gencb, bn_gencb_callback, (void *)pyfunc); Py_INCREF(pyfunc); ret = DH_generate_parameters_ex(dh, plen, g, gencb); Py_DECREF(pyfunc); BN_GENCB_free(gencb); if (ret) return dh; m2_PyErr_Msg(_dh_err); DH_free(dh); return NULL; } /* Note return value shenanigan. */ int dh_check(DH *dh) { int err; return (DH_check(dh, &err)) ? 0 : err; } PyObject *dh_compute_key(DH *dh, PyObject *pubkey) { const void *pkbuf; int pklen = 0, klen; void *key; BIGNUM *pk; PyObject *ret; if (m2_PyObject_AsReadBufferInt(pubkey, &pkbuf, &pklen) == -1) return NULL; if (!(pk = BN_mpi2bn((unsigned char *)pkbuf, pklen, NULL))) { m2_PyErr_Msg(_dh_err); return NULL; } if (!(key = PyMem_Malloc(DH_size(dh)))) { BN_free(pk); PyErr_SetString(PyExc_MemoryError, "dh_compute_key"); return NULL; } if ((klen = DH_compute_key((unsigned char *)key, pk, dh)) == -1) { BN_free(pk); PyMem_Free(key); m2_PyErr_Msg(_dh_err); return NULL; } ret = PyBytes_FromStringAndSize((const char *)key, klen); BN_free(pk); PyMem_Free(key); return ret; } PyObject *dh_get_p(DH *dh) { const BIGNUM* p = NULL; DH_get0_pqg(dh, &p, NULL, NULL); if (!p) { PyErr_SetString(_dh_err, "'p' is unset"); return NULL; } return bn_to_mpi(p); } PyObject *dh_get_g(DH *dh) { const BIGNUM* g = NULL; DH_get0_pqg(dh, NULL, NULL, &g); if (!g) { PyErr_SetString(_dh_err, "'g' is unset"); return NULL; } return bn_to_mpi(g); } PyObject *dh_get_pub(DH *dh) { const BIGNUM* pub_key = NULL; DH_get0_key(dh, &pub_key, NULL); if (!pub_key) { PyErr_SetString(_dh_err, "'pub' is unset"); return NULL; } return bn_to_mpi(pub_key); } PyObject *dh_get_priv(DH *dh) { const BIGNUM* priv_key = NULL; DH_get0_key(dh, NULL, &priv_key); if (!priv_key) { PyErr_SetString(_dh_err, "'priv' is unset"); return NULL; } return bn_to_mpi(priv_key); } PyObject *dh_set_pg(DH *dh, PyObject *pval, PyObject* gval) { BIGNUM* p, *g; if (!(p = m2_PyObject_AsBIGNUM(pval, _dh_err)) || !(g = m2_PyObject_AsBIGNUM(gval, _dh_err))) return NULL; if (!DH_set0_pqg(dh, p, NULL, g)) { PyErr_SetString(_dh_err, "Cannot set prime number or generator of Z_p for DH."); BN_free(p); BN_free(g); return NULL; } Py_RETURN_NONE; } %} M2Crypto-0.31.0/SWIG/_dsa.i0000664000175000001440000002221513236336220015366 0ustar matejusers00000000000000/* Copyright (c) 1999-2000 Ng Pheng Siong. All rights reserved. */ /* $Id$ */ %{ #include #include #include #include PyObject *dsa_sig_get_r(DSA_SIG *dsa_sig) { const BIGNUM* pr; DSA_SIG_get0(dsa_sig, &pr, NULL); return bn_to_mpi(pr); } PyObject *dsa_sig_get_s(DSA_SIG *dsa_sig) { const BIGNUM* qs; DSA_SIG_get0(dsa_sig, NULL, &qs); return bn_to_mpi(qs); } %} %apply Pointer NONNULL { DSA * }; %rename(dsa_new) DSA_new; extern DSA *DSA_new(void); %rename(dsa_free) DSA_free; extern void DSA_free(DSA *); %rename(dsa_size) DSA_size; extern int DSA_size(const DSA *); /* assert(dsa->q); */ %rename(dsa_gen_key) DSA_generate_key; extern int DSA_generate_key(DSA *); %warnfilter(454) _dsa_err; %inline %{ static PyObject *_dsa_err; void dsa_init(PyObject *dsa_err) { Py_INCREF(dsa_err); _dsa_err = dsa_err; } %} %typemap(out) DSA * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { $result = NULL; } } %inline %{ DSA *dsa_generate_parameters(int bits, PyObject *pyfunc) { DSA *dsa; BN_GENCB *gencb; int ret; if ((gencb=BN_GENCB_new()) == NULL) { m2_PyErr_Msg(_dh_err); return NULL; } if ((dsa = DSA_new()) == NULL) { m2_PyErr_Msg(_dsa_err); BN_GENCB_free(gencb); return NULL; } BN_GENCB_set(gencb, bn_gencb_callback, (void *) pyfunc); Py_INCREF(pyfunc); ret = DSA_generate_parameters_ex(dsa, bits, NULL, 0, NULL, NULL, gencb); Py_DECREF(pyfunc); BN_GENCB_free(gencb); if (ret) return dsa; m2_PyErr_Msg(_dsa_err); DSA_free(dsa); return NULL; } DSA *dsa_read_params(BIO *f, PyObject *pyfunc) { DSA *ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_read_bio_DSAparams(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); if (ret == NULL) { m2_PyErr_Msg(_dsa_err); } return ret; } DSA *dsa_read_key(BIO *f, PyObject *pyfunc) { DSA *ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_read_bio_DSAPrivateKey(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); if (ret == NULL) { m2_PyErr_Msg(_dsa_err); } return ret; } DSA *dsa_read_pub_key(BIO *f, PyObject *pyfunc) { DSA *ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_read_bio_DSA_PUBKEY(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); if (ret == NULL) { m2_PyErr_Msg(_dsa_err); } return ret; } %} %typemap(out) DSA * ; %inline %{ PyObject *dsa_get_p(DSA *dsa) { const BIGNUM* p = NULL; DSA_get0_pqg(dsa, &p, NULL, NULL); if (!p) { PyErr_SetString(_dsa_err, "'p' is unset"); return NULL; } return bn_to_mpi(p); } PyObject *dsa_get_q(DSA *dsa) { const BIGNUM* q = NULL; DSA_get0_pqg(dsa, NULL, &q, NULL); if (!q) { PyErr_SetString(_dsa_err, "'q' is unset"); return NULL; } return bn_to_mpi(q); } PyObject *dsa_get_g(DSA *dsa) { const BIGNUM* g = NULL; DSA_get0_pqg(dsa, NULL, NULL, &g); if (!g) { PyErr_SetString(_dsa_err, "'g' is unset"); return NULL; } return bn_to_mpi(g); } PyObject *dsa_get_pub(DSA *dsa) { const BIGNUM* pub_key = NULL; DSA_get0_key(dsa, &pub_key, NULL); if (!pub_key) { PyErr_SetString(_dsa_err, "'pub' is unset"); return NULL; } return bn_to_mpi(pub_key); } PyObject *dsa_get_priv(DSA *dsa) { const BIGNUM* priv_key = NULL; DSA_get0_key(dsa, NULL, &priv_key); if (!priv_key) { PyErr_SetString(_dsa_err, "'priv' is unset"); return NULL; } return bn_to_mpi(priv_key); } PyObject *dsa_set_pqg(DSA *dsa, PyObject *pval, PyObject* qval, PyObject* gval) { BIGNUM* p, *q, *g; if (!(p = m2_PyObject_AsBIGNUM(pval, _dsa_err)) || !(q = m2_PyObject_AsBIGNUM(qval, _dsa_err)) || !(g = m2_PyObject_AsBIGNUM(gval, _dsa_err))) return NULL; if (!DSA_set0_pqg(dsa, p, q, g)) { PyErr_SetString( _dsa_err, "Cannot set prime number, subprime, or generator of subgroup for DSA."); BN_free(p); BN_free(q); BN_free(g); return NULL; } Py_RETURN_NONE; } PyObject *dsa_set_pub(DSA *dsa, PyObject *value) { BIGNUM *bn; const void *vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(bn = BN_mpi2bn((unsigned char *)vbuf, vlen, NULL))) { m2_PyErr_Msg(_dsa_err); return NULL; } if (!DSA_set0_key(dsa, bn, NULL)) { BN_free(bn); PyErr_SetString(_dsa_err, "Cannot set private and public key for DSA."); } Py_RETURN_NONE; } %} %threadallow dsa_write_params_bio; %inline %{ int dsa_write_params_bio(DSA* dsa, BIO* f) { return PEM_write_bio_DSAparams(f, dsa); } %} %inline %{ int dsa_write_key_bio(DSA* dsa, BIO* f, EVP_CIPHER *cipher, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_DSAPrivateKey(f, dsa, cipher, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } %} %inline %{ int dsa_write_key_bio_no_cipher(DSA* dsa, BIO* f, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_DSAPrivateKey(f, dsa, NULL, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } %} %threadallow dsa_write_pub_key_bio; %inline %{ int dsa_write_pub_key_bio(DSA* dsa, BIO* f) { return PEM_write_bio_DSA_PUBKEY(f, dsa); } %} %inline %{ PyObject *dsa_sign(DSA *dsa, PyObject *value) { const void *vbuf; int vlen = 0; PyObject *tuple; DSA_SIG *sig; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(sig = DSA_do_sign(vbuf, vlen, dsa))) { m2_PyErr_Msg(_dsa_err); return NULL; } if (!(tuple = PyTuple_New(2))) { DSA_SIG_free(sig); PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails"); return NULL; } PyTuple_SET_ITEM(tuple, 0, dsa_sig_get_r(sig)); PyTuple_SET_ITEM(tuple, 1, dsa_sig_get_s(sig)); DSA_SIG_free(sig); return tuple; } int dsa_verify(DSA *dsa, PyObject *value, PyObject *r, PyObject *s) { const void *vbuf, *rbuf, *sbuf; int vlen = 0, rlen = 0, slen = 0; DSA_SIG *sig; BIGNUM* pr, *ps; int ret; if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) || (m2_PyObject_AsReadBufferInt(r, &rbuf, &rlen) == -1) || (m2_PyObject_AsReadBufferInt(s, &sbuf, &slen) == -1)) return -1; if (!(sig = DSA_SIG_new())) { m2_PyErr_Msg(_dsa_err); return -1; } if (!(pr = BN_mpi2bn((unsigned char *)rbuf, rlen, NULL))) { m2_PyErr_Msg(_dsa_err); DSA_SIG_free(sig); return -1; } if (!(ps = BN_mpi2bn((unsigned char *)sbuf, slen, NULL))) { m2_PyErr_Msg(_dsa_err); DSA_SIG_free(sig); BN_free(pr); return -1; } if (!DSA_SIG_set0(sig, pr, ps)) { m2_PyErr_Msg(_dsa_err); DSA_SIG_free(sig); BN_free(pr); BN_free(ps); return -1; } ret = DSA_do_verify(vbuf, vlen, sig, dsa); DSA_SIG_free(sig); if (ret == -1) m2_PyErr_Msg(_dsa_err); return ret; } PyObject *dsa_sign_asn1(DSA *dsa, PyObject *value) { const void *vbuf; int vlen = 0; void *sigbuf; unsigned int siglen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(sigbuf = PyMem_Malloc(DSA_size(dsa)))) { PyErr_SetString(PyExc_MemoryError, "dsa_sign_asn1"); return NULL; } if (!DSA_sign(0, vbuf, vlen, (unsigned char *)sigbuf, &siglen, dsa)) { m2_PyErr_Msg(_dsa_err); PyMem_Free(sigbuf); return NULL; } ret = PyBytes_FromStringAndSize(sigbuf, siglen); PyMem_Free(sigbuf); return ret; } int dsa_verify_asn1(DSA *dsa, PyObject *value, PyObject *sig) { const void *vbuf; void *sbuf; int vlen = 0, slen = 0, ret = 0; if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) || (m2_PyObject_AsReadBufferInt(sig, (const void **)&sbuf, &slen) == -1)) return -1; if ((ret = DSA_verify(0, vbuf, vlen, sbuf, slen, dsa)) == -1) m2_PyErr_Msg(_dsa_err); return ret; } int dsa_check_key(DSA *dsa) { const BIGNUM* pub_key, *priv_key; DSA_get0_key(dsa, &pub_key, &priv_key); return pub_key != NULL && priv_key != NULL; } int dsa_check_pub_key(DSA *dsa) { const BIGNUM* pub_key; DSA_get0_key(dsa, &pub_key, NULL); return pub_key ? 1 : 0; } int dsa_keylen(DSA *dsa) { const BIGNUM* p; DSA_get0_pqg(dsa, &p, NULL, NULL); return BN_num_bits(p); } int dsa_type_check(DSA *dsa) { return 1; } %} M2Crypto-0.31.0/SWIG/_ec.i0000664000175000001440000003537713236336220015223 0ustar matejusers00000000000000/* Copyright (c) 1999-2000 Ng Pheng Siong. All rights reserved. Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam. All rights reserved. Most code originally from _dsa.i, _rsa.i and _dh.i and adjusted for EC use. */ %include #if OPENSSL_VERSION_NUMBER < 0x0090800fL || defined(OPENSSL_NO_EC) #undef OPENSSL_NO_EC %constant OPENSSL_NO_EC = 1; #else %constant OPENSSL_NO_EC = 0; %{ #include #include #include #include #include #include %} %apply Pointer NONNULL { EC_KEY * }; %rename(ec_key_new) EC_KEY_new; extern EC_KEY *EC_KEY_new(void); %rename(ec_key_free) EC_KEY_free; extern void EC_KEY_free(EC_KEY *); %rename(ec_key_size) ECDSA_size; extern int ECDSA_size(const EC_KEY *); %rename(ec_key_gen_key) EC_KEY_generate_key; extern int EC_KEY_generate_key(EC_KEY *); %rename(ec_key_check_key) EC_KEY_check_key; extern int EC_KEY_check_key(const EC_KEY *); /* Curve identifier constants from OpenSSL */ %constant int NID_secp112r1 = NID_secp112r1; %constant int NID_secp112r2 = NID_secp112r2; %constant int NID_secp128r1 = NID_secp128r1; %constant int NID_secp128r2 = NID_secp128r2; %constant int NID_secp160k1 = NID_secp160k1; %constant int NID_secp160r1 = NID_secp160r1; %constant int NID_secp160r2 = NID_secp160r2; %constant int NID_secp192k1 = NID_secp192k1; %constant int NID_secp224k1 = NID_secp224k1; %constant int NID_secp224r1 = NID_secp224r1; %constant int NID_secp256k1 = NID_secp256k1; %constant int NID_secp384r1 = NID_secp384r1; %constant int NID_secp521r1 = NID_secp521r1; %constant int NID_sect113r1 = NID_sect113r1; %constant int NID_sect113r2 = NID_sect113r2; %constant int NID_sect131r1 = NID_sect131r1; %constant int NID_sect131r2 = NID_sect131r2; %constant int NID_sect163k1 = NID_sect163k1; %constant int NID_sect163r1 = NID_sect163r1; %constant int NID_sect163r2 = NID_sect163r2; %constant int NID_sect193r1 = NID_sect193r1; %constant int NID_sect193r2 = NID_sect193r2; %constant int NID_sect233k1 = NID_sect233k1; %constant int NID_sect233r1 = NID_sect233r1; %constant int NID_sect239k1 = NID_sect239k1; %constant int NID_sect283k1 = NID_sect283k1; %constant int NID_sect283r1 = NID_sect283r1; %constant int NID_sect409k1 = NID_sect409k1; %constant int NID_sect409r1 = NID_sect409r1; %constant int NID_sect571k1 = NID_sect571k1; %constant int NID_sect571r1 = NID_sect571r1; %constant int NID_X9_62_prime192v1 = NID_X9_62_prime192v1; %constant int NID_X9_62_prime192v2 = NID_X9_62_prime192v2; %constant int NID_X9_62_prime192v3 = NID_X9_62_prime192v3; %constant int NID_X9_62_prime239v1 = NID_X9_62_prime239v1; %constant int NID_X9_62_prime239v2 = NID_X9_62_prime239v2; %constant int NID_X9_62_prime239v3 = NID_X9_62_prime239v3; %constant int NID_X9_62_prime256v1 = NID_X9_62_prime256v1; %constant int NID_X9_62_c2pnb163v1 = NID_X9_62_c2pnb163v1; %constant int NID_X9_62_c2pnb163v2 = NID_X9_62_c2pnb163v2; %constant int NID_X9_62_c2pnb163v3 = NID_X9_62_c2pnb163v3; %constant int NID_X9_62_c2pnb176v1 = NID_X9_62_c2pnb176v1; %constant int NID_X9_62_c2tnb191v1 = NID_X9_62_c2tnb191v1; %constant int NID_X9_62_c2tnb191v2 = NID_X9_62_c2tnb191v2; %constant int NID_X9_62_c2tnb191v3 = NID_X9_62_c2tnb191v3; %constant int NID_X9_62_c2pnb208w1 = NID_X9_62_c2pnb208w1; %constant int NID_X9_62_c2tnb239v1 = NID_X9_62_c2tnb239v1; %constant int NID_X9_62_c2tnb239v2 = NID_X9_62_c2tnb239v2; %constant int NID_X9_62_c2tnb239v3 = NID_X9_62_c2tnb239v3; %constant int NID_X9_62_c2pnb272w1 = NID_X9_62_c2pnb272w1; %constant int NID_X9_62_c2pnb304w1 = NID_X9_62_c2pnb304w1; %constant int NID_X9_62_c2tnb359v1 = NID_X9_62_c2tnb359v1; %constant int NID_X9_62_c2pnb368w1 = NID_X9_62_c2pnb368w1; %constant int NID_X9_62_c2tnb431r1 = NID_X9_62_c2tnb431r1; %constant int NID_wap_wsg_idm_ecid_wtls1 = NID_wap_wsg_idm_ecid_wtls1; %constant int NID_wap_wsg_idm_ecid_wtls3 = NID_wap_wsg_idm_ecid_wtls3; %constant int NID_wap_wsg_idm_ecid_wtls4 = NID_wap_wsg_idm_ecid_wtls4; %constant int NID_wap_wsg_idm_ecid_wtls5 = NID_wap_wsg_idm_ecid_wtls5; %constant int NID_wap_wsg_idm_ecid_wtls6 = NID_wap_wsg_idm_ecid_wtls6; %constant int NID_wap_wsg_idm_ecid_wtls7 = NID_wap_wsg_idm_ecid_wtls7; %constant int NID_wap_wsg_idm_ecid_wtls8 = NID_wap_wsg_idm_ecid_wtls8; %constant int NID_wap_wsg_idm_ecid_wtls9 = NID_wap_wsg_idm_ecid_wtls9; %constant int NID_wap_wsg_idm_ecid_wtls10 = NID_wap_wsg_idm_ecid_wtls10; %constant int NID_wap_wsg_idm_ecid_wtls11 = NID_wap_wsg_idm_ecid_wtls11; %constant int NID_wap_wsg_idm_ecid_wtls12 = NID_wap_wsg_idm_ecid_wtls12; %constant int NID_ipsec3 = NID_ipsec3; %constant int NID_ipsec4 = NID_ipsec4; %warnfilter(454) _ec_err; %inline %{ static PyObject *_ec_err; void ec_init(PyObject *ec_err) { Py_INCREF(ec_err); _ec_err = ec_err; } PyObject *ec_get_builtin_curves(void) { /* size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t * nitems); */ EC_builtin_curve *curves; Py_ssize_t ret_curves = 0; size_t num_curves = EC_get_builtin_curves(NULL, 0); PyObject *ret_tuple = NULL; PyObject *ret_dict = NULL; Py_ssize_t i; const char *comment; const char *sname; if (!(curves = PyMem_Malloc(num_curves * sizeof(EC_builtin_curve)))) { PyErr_SetString(PyExc_MemoryError, "ec_get_builtin_curves"); return NULL; } ret_curves = (Py_ssize_t)EC_get_builtin_curves(curves, num_curves); if (!(ret_tuple = PyTuple_New(ret_curves))) { PyErr_SetString(PyExc_MemoryError, "ec_get_builtin_curves"); return NULL; } for (i = 0; i < ret_curves; i++) { if (!(ret_dict = PyDict_New())) { PyErr_SetString(PyExc_MemoryError, "ec_get_builtin_curves"); return NULL; } comment = curves[i].comment; sname = OBJ_nid2sn(curves[i].nid); if (sname == NULL) sname = ""; PyDict_SetItemString(ret_dict, "NID", PyLong_FromLong((long)curves[i].nid)); PyDict_SetItemString(ret_dict, "sname", PyString_FromString(sname)); PyDict_SetItemString(ret_dict, "comment", PyString_FromString(comment)); PyTuple_SET_ITEM(ret_tuple, i, ret_dict); } PyMem_Free(curves); return ret_tuple; } EC_KEY* ec_key_new_by_curve_name(int nid) { EC_KEY *key; EC_GROUP *group; int ret =0; point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED; int asn1_flag = OPENSSL_EC_NAMED_CURVE; /* If I simply do "return EC_KEY_new_by_curve_name(nid);" * I get large public keys (222 vs 84 bytes for sect233k1 curve). * I don't know why that is, but 'openssl ecparam -genkey ...' sets * the ASN.1 flag and the point conversion form, and gets the * small pub keys. So let's do that too. */ key = EC_KEY_new(); if (!key) { PyErr_SetString(PyExc_MemoryError, "ec_key_new_by_curve_name"); return NULL; } group = EC_GROUP_new_by_curve_name(nid); if (!group) { m2_PyErr_Msg(_ec_err); EC_KEY_free(key); return NULL; } EC_GROUP_set_asn1_flag(group, asn1_flag); EC_GROUP_set_point_conversion_form(group, form); ret = EC_KEY_set_group(key, group); EC_GROUP_free(group); if (ret == 0) { /* EC_KEY_set_group only returns 0 or 1, and does not set error. */ PyErr_SetString(_ec_err, "cannot set key's group"); EC_KEY_free(key); return NULL; } return key; } PyObject *ec_key_get_public_der(EC_KEY *key) { char *src=NULL; int src_len=0; PyObject *pyo=NULL; /* Convert to binary */ src_len = i2d_EC_PUBKEY( key, (unsigned char**)&src ); if (src_len < 0) { m2_PyErr_Msg(_ec_err); return NULL; } /* Create a PyBuffer containing a copy of the binary, * to simplify memory deallocation */ pyo = PyBytes_FromStringAndSize( src, src_len ); OPENSSL_free(src); return pyo; } PyObject *ec_key_get_public_key(EC_KEY *key) { char *src=NULL; int src_len=0; PyObject *pyo=NULL; /* Convert to binary */ src_len = i2o_ECPublicKey(key, (unsigned char**)&src); if (src_len < 0) { m2_PyErr_Msg(_ec_err); return NULL; } pyo = PyBytes_FromStringAndSize( src, src_len ); OPENSSL_free(src); return pyo; } %} %threadallow ec_key_read_pubkey; %inline %{ EC_KEY *ec_key_read_pubkey(BIO *f) { return PEM_read_bio_EC_PUBKEY(f, NULL, NULL, NULL); } %} %threadallow ec_key_write_pubkey; %inline %{ int ec_key_write_pubkey(EC_KEY *key, BIO *f) { return PEM_write_bio_EC_PUBKEY(f, key ); } %} %inline %{ EC_KEY *ec_key_read_bio(BIO *f, PyObject *pyfunc) { EC_KEY *ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_read_bio_ECPrivateKey(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } %} %inline %{ int ec_key_write_bio(EC_KEY *key, BIO *f, EVP_CIPHER *cipher, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_ECPrivateKey(f, key, cipher, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } %} %inline %{ int ec_key_write_bio_no_cipher(EC_KEY *key, BIO *f, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_ECPrivateKey(f, key, NULL, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } PyObject *ecdsa_sig_get_r(ECDSA_SIG *ecdsa_sig) { const BIGNUM* pr; ECDSA_SIG_get0(ecdsa_sig, &pr, NULL); return bn_to_mpi(pr); } PyObject *ecdsa_sig_get_s(ECDSA_SIG *ecdsa_sig) { const BIGNUM* ps; ECDSA_SIG_get0(ecdsa_sig, NULL, &ps); return bn_to_mpi(ps); } PyObject *ecdsa_sign(EC_KEY *key, PyObject *value) { const void *vbuf; int vlen = 0; PyObject *tuple; ECDSA_SIG *sig; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(sig = ECDSA_do_sign(vbuf, vlen, key))) { m2_PyErr_Msg(_ec_err); return NULL; } if (!(tuple = PyTuple_New(2))) { ECDSA_SIG_free(sig); PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails"); return NULL; } PyTuple_SET_ITEM(tuple, 0, ecdsa_sig_get_r(sig)); PyTuple_SET_ITEM(tuple, 1, ecdsa_sig_get_s(sig)); ECDSA_SIG_free(sig); return tuple; } int ecdsa_verify(EC_KEY *key, PyObject *value, PyObject *r, PyObject *s) { const void *vbuf, *rbuf, *sbuf; int vlen = 0, rlen = 0, slen = 0; ECDSA_SIG *sig; int ret; BIGNUM* pr, *ps; if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) || (m2_PyObject_AsReadBufferInt(r, &rbuf, &rlen) == -1) || (m2_PyObject_AsReadBufferInt(s, &sbuf, &slen) == -1)) return -1; if (!(pr = BN_mpi2bn((unsigned char *)rbuf, rlen, NULL))) { m2_PyErr_Msg(_ec_err); return -1; } if (!(ps = BN_mpi2bn((unsigned char *)sbuf, slen, NULL))) { m2_PyErr_Msg(_ec_err); BN_free(pr); return -1; } if (!(sig = ECDSA_SIG_new())) { m2_PyErr_Msg(_ec_err); BN_free(pr); BN_free(ps); return -1; } if (!ECDSA_SIG_set0(sig, pr, ps)) { PyErr_SetString(_ec_err, "Cannot set r and s fields of ECDSA_SIG."); ECDSA_SIG_free(sig); BN_free(pr); BN_free(ps); return -1; } ret = ECDSA_do_verify(vbuf, vlen, sig, key); ECDSA_SIG_free(sig); if (ret == -1) m2_PyErr_Msg(_ec_err); return ret; } PyObject *ecdsa_sign_asn1(EC_KEY *key, PyObject *value) { const void *vbuf; int vlen = 0; void *sigbuf; unsigned int siglen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(sigbuf = PyMem_Malloc(ECDSA_size(key)))) { PyErr_SetString(PyExc_MemoryError, "ecdsa_sign_asn1"); return NULL; } if (!ECDSA_sign(0, vbuf, vlen, (unsigned char *)sigbuf, &siglen, key)) { m2_PyErr_Msg(_ec_err); PyMem_Free(sigbuf); return NULL; } ret = PyBytes_FromStringAndSize(sigbuf, siglen); PyMem_Free(sigbuf); return ret; } int ecdsa_verify_asn1(EC_KEY *key, PyObject *value, PyObject *sig) { const void *vbuf; void *sbuf; int vlen = 0, slen = 0, ret; if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) || (m2_PyObject_AsReadBufferInt(sig, (const void **)&sbuf, &slen) == -1)) return -1; if ((ret = ECDSA_verify(0, vbuf, vlen, sbuf, slen, key)) == -1) m2_PyErr_Msg(_ec_err); return ret; } PyObject *ecdh_compute_key(EC_KEY *keypairA, EC_KEY *pubkeyB) { int sharedkeylen; void *sharedkey; const EC_POINT *pkpointB; PyObject *ret; const EC_GROUP* groupA; if ((pkpointB = EC_KEY_get0_public_key(pubkeyB)) == NULL) { PyErr_SetString(_ec_err, "Cannot get the public key of EC_KEY object."); return NULL; } groupA = EC_KEY_get0_group(keypairA); sharedkeylen = (EC_GROUP_get_degree(groupA) + 7)/8; if (!(sharedkey = PyMem_Malloc(sharedkeylen))) { PyErr_SetString(PyExc_MemoryError, "ecdh_compute_key"); return NULL; } if ((sharedkeylen = ECDH_compute_key((unsigned char *)sharedkey, sharedkeylen, pkpointB, keypairA, NULL)) == -1) { m2_PyErr_Msg(_ec_err); PyMem_Free(sharedkey); return NULL; } ret = PyBytes_FromStringAndSize((const char *)sharedkey, sharedkeylen); PyMem_Free(sharedkey); return ret; } EC_KEY* ec_key_from_pubkey_der(PyObject *pubkey) { const void *keypairbuf; Py_ssize_t keypairbuflen; const unsigned char *tempBuf; EC_KEY *keypair; if (PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1) { return NULL; } tempBuf = (const unsigned char *)keypairbuf; if ((keypair = d2i_EC_PUBKEY( NULL, &tempBuf, keypairbuflen)) == 0) { m2_PyErr_Msg(_ec_err); return NULL; } return keypair; } EC_KEY* ec_key_from_pubkey_params(int nid, PyObject *pubkey) { const void *keypairbuf; Py_ssize_t keypairbuflen; const unsigned char *tempBuf; EC_KEY *keypair; if (PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1) { return NULL; } keypair = ec_key_new_by_curve_name(nid); if (!keypair) { m2_PyErr_Msg(_ec_err); return NULL; } tempBuf = (const unsigned char *)keypairbuf; if ((o2i_ECPublicKey( &keypair, &tempBuf, keypairbuflen)) == 0) { m2_PyErr_Msg(_ec_err); return NULL; } return keypair; } // According to [SEC2] the degree of the group is defined as EC key length int ec_key_keylen(EC_KEY *key) { const EC_GROUP *group = EC_KEY_get0_group(key); return EC_GROUP_get_degree(group); } int ec_key_type_check(EC_KEY *key) { return 1; } %} #endif // if OpenSSL version with EC support M2Crypto-0.31.0/SWIG/_engine.i0000664000175000001440000001255113165756570016105 0ustar matejusers00000000000000/* * -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: syntax=c sts=4 sw=4 * * ENGINE functions from engine(3SSL). * * Pavel Shramov * IMEC MSU */ %{ #include #include #include %} %apply Pointer NONNULL { ENGINE * }; %apply Pointer NONNULL { const ENGINE * }; %apply Pointer NONNULL { const char * }; /* * Functions to load different engines */ %rename(engine_load_builtin_engines) ENGINE_load_builtin_engines; extern void ENGINE_load_builtin_engines(void); %rename(engine_load_dynamic) ENGINE_load_dynamic; extern void ENGINE_load_dynamic(void); %rename(engine_load_openssl) ENGINE_load_openssl; extern void ENGINE_load_openssl(void); %rename(engine_cleanup) ENGINE_cleanup; extern void ENGINE_cleanup(void); /* * Engine allocation functions */ %rename(engine_new) ENGINE_new; extern ENGINE * ENGINE_new(); %rename(engine_by_id) ENGINE_by_id; extern ENGINE * ENGINE_by_id(const char *); %rename(engine_free) ENGINE_free; extern int ENGINE_free(ENGINE *); %rename(engine_init) ENGINE_init; extern int ENGINE_init(ENGINE *); %rename(engine_finish) ENGINE_finish; extern int ENGINE_finish(ENGINE *); /* * Engine id/name functions */ %rename(engine_get_id) ENGINE_get_id; extern const char * ENGINE_get_id(const ENGINE *); %rename(engine_get_name) ENGINE_get_name; extern const char * ENGINE_get_name(const ENGINE *); /* * Engine control functions * Control argument may be NULL (e.g for LOAD command) */ %clear const char *; %rename(engine_ctrl_cmd_string) ENGINE_ctrl_cmd_string; extern int ENGINE_ctrl_cmd_string(ENGINE *e, const char *NONNULL, const char *arg, int cmd_optional); %apply Pointer NONNULL { const char * }; /* * UI methods. * XXX: UI_OpenSSL method is static and UI_destroy_method is not needed. */ %rename(ui_openssl) UI_OpenSSL; extern UI_METHOD * UI_OpenSSL(); /* %rename(ui_destroy_method) UI_destroy_method; extern void UI_destroy_method(UI_METHOD *ui_method); */ %clear const char *; %inline %{ /* * Code from engine-pkcs11 1.4.0 in engine-pkcs11.c * 99 static char *get_pin(UI_METHOD * ui_method, void *callback_data, char *sc_pin, 100 int maxlen) 101 { 102 UI *ui; 103 struct { 104 const void *password; 105 const char *prompt_info; 106 } *mycb = callback_data; 107 108 if (mycb->password) { 109 sc_pin = set_pin(mycb->password); 110 return sc_pin; 111 } * * So callback_data need to be always provided and have fixed type. * UI method still may be NULL. * * Following functions allocate and free callback data structure with * optional password set. */ typedef struct { char * password; char * prompt; } _cbd_t; void * engine_pkcs11_data_new(const char *pin) { _cbd_t * cb = (_cbd_t *) PyMem_Malloc(sizeof(_cbd_t)); if (!cb) { PyErr_SetString(PyExc_MemoryError, "engine_pkcs11_data_new"); return NULL; } cb->password = NULL; if (pin) { size_t size = strlen(pin); cb->password = (char *) PyMem_Malloc(size + 1); if (!cb->password) { PyErr_SetString(PyExc_MemoryError, "engine_pkcs11_data_new"); PyMem_Free(cb); return NULL; } memcpy(cb->password, pin, size + 1); } cb->prompt = NULL; return cb; } void engine_pkcs11_data_free(void * vcb) { _cbd_t * cb = (_cbd_t *) vcb; if (!cb) return; if (cb->password) PyMem_Free(cb->password); PyMem_Free(cb); } %} %apply Pointer NONNULL { const char * }; /* * Engine key/cert load functions. * See above notice about callback_data. */ %rename(engine_load_private_key) ENGINE_load_private_key; extern EVP_PKEY *ENGINE_load_private_key(ENGINE *e, const char *key_id, UI_METHOD *ui_method, void *callback_data); %rename(engine_load_public_key) ENGINE_load_public_key; extern EVP_PKEY *ENGINE_load_public_key(ENGINE *e, const char *key_id, UI_METHOD *ui_method, void *callback_data); /* * This function may be not implemented in engine. * pkcs11 engine has this control. */ %warnfilter(454) _engine_err; %inline %{ static PyObject *_engine_err; void engine_init_error(PyObject *engine_err) { Py_INCREF(engine_err); _engine_err = engine_err; } X509 * engine_load_certificate(ENGINE *e, const char * slot) { struct { const char * slot; X509 * cert; } cbd; cbd.slot = slot; cbd.cert = NULL; if (!ENGINE_ctrl_cmd(e, "LOAD_CERT_CTRL", 0, &cbd, NULL, 0)) { PyErr_SetString(_engine_err, "cannot load certificate"); return NULL; } return cbd.cert; } %} /* These flags are used to control combinations of algorithm (methods) * by bitwise "OR"ing. */ %constant int ENGINE_METHOD_RSA = 0x0001; %constant int ENGINE_METHOD_DSA = 0x0002; %constant int ENGINE_METHOD_DH = 0x0004; %constant int ENGINE_METHOD_RAND = 0x0008; %constant int ENGINE_METHOD_ECDH = 0x0010; %constant int ENGINE_METHOD_ECDSA = 0x0020; %constant int ENGINE_METHOD_CIPHERS = 0x0040; %constant int ENGINE_METHOD_DIGESTS = 0x0080; %constant int ENGINE_METHOD_STORE = 0x0100; /* Obvious all-or-nothing cases. */ %constant int ENGINE_METHOD_ALL = 0xFFFF; %constant int ENGINE_METHOD_NONE = 0x0000; %rename(engine_set_default) ENGINE_set_default; extern int ENGINE_set_default(ENGINE *e, unsigned int flags); M2Crypto-0.31.0/SWIG/_evp.i0000664000175000001440000004737513247615013015431 0ustar matejusers00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (c) 1999 Ng Pheng Siong. All rights reserved. Portions Copyright (c) 2004-2007 Open Source Applications Foundation. Author: Heikki Toivonen Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved. */ %include %{ #include #include #include #include #include #include #if OPENSSL_VERSION_NUMBER < 0x10100000L HMAC_CTX *HMAC_CTX_new(void) { HMAC_CTX *ret = PyMem_Malloc(sizeof(HMAC_CTX)); HMAC_CTX_init(ret); return ret; } #define HMAC_CTX_reset(ctx) HMAC_CTX_init(ctx) #define HMAC_CTX_free(ctx) \ do { \ HMAC_CTX_cleanup(ctx); \ PyMem_Free((void *)ctx); \ } while(0) #define EVP_CIPHER_CTX_reset(ctx) EVP_CIPHER_CTX_init(ctx) #endif %} /* from openssl/crypto/include/internal/evp_int.h struct evp_md_st typedef struct evp_md_st EVP_MD; from openssl/crypto/evp/evp_locl.h evp_md_ctx_st typedef struct evp_md_ctx_st EVP_MD_CTX; */ %apply Pointer NONNULL { EVP_MD_CTX * }; %apply Pointer NONNULL { EVP_MD * }; %apply Pointer NONNULL { EVP_PKEY * }; %apply Pointer NONNULL { HMAC_CTX * }; %apply Pointer NONNULL { EVP_CIPHER_CTX * }; %apply Pointer NONNULL { EVP_CIPHER * }; %apply Pointer NONNULL { RSA * }; %rename(md5) EVP_md5; extern const EVP_MD *EVP_md5(void); %rename(sha1) EVP_sha1; extern const EVP_MD *EVP_sha1(void); %rename(ripemd160) EVP_ripemd160; extern const EVP_MD *EVP_ripemd160(void); #if OPENSSL_VERSION_NUMBER >= 0x0090800fL %rename(sha224) EVP_sha224; extern const EVP_MD *EVP_sha224(void); %rename(sha256) EVP_sha256; extern const EVP_MD *EVP_sha256(void); %rename(sha384) EVP_sha384; extern const EVP_MD *EVP_sha384(void); %rename(sha512) EVP_sha512; extern const EVP_MD *EVP_sha512(void); #endif %rename(digest_init) EVP_DigestInit; extern int EVP_DigestInit(EVP_MD_CTX *, const EVP_MD *); %rename(des_ecb) EVP_des_ecb; extern const EVP_CIPHER *EVP_des_ecb(void); %rename(des_ede_ecb) EVP_des_ede; extern const EVP_CIPHER *EVP_des_ede(void); %rename(des_ede3_ecb) EVP_des_ede3; extern const EVP_CIPHER *EVP_des_ede3(void); %rename(des_cbc) EVP_des_cbc; extern const EVP_CIPHER *EVP_des_cbc(void); %rename(des_ede_cbc) EVP_des_ede_cbc; extern const EVP_CIPHER *EVP_des_ede_cbc(void); %rename(des_ede3_cbc) EVP_des_ede3_cbc; extern const EVP_CIPHER *EVP_des_ede3_cbc(void); %rename(des_cfb) EVP_des_cfb; extern const EVP_CIPHER *EVP_des_cfb(void); %rename(des_ede_cfb) EVP_des_ede_cfb; extern const EVP_CIPHER *EVP_des_ede_cfb(void); %rename(des_ede3_cfb) EVP_des_ede3_cfb; extern const EVP_CIPHER *EVP_des_ede3_cfb(void); %rename(des_ofb) EVP_des_ofb; extern const EVP_CIPHER *EVP_des_ofb(void); %rename(des_ede_ofb) EVP_des_ede_ofb; extern const EVP_CIPHER *EVP_des_ede_ofb(void); %rename(des_ede3_ofb) EVP_des_ede3_ofb; extern const EVP_CIPHER *EVP_des_ede3_ofb(void); %rename(bf_ecb) EVP_bf_ecb; extern const EVP_CIPHER *EVP_bf_ecb(void); %rename(bf_cbc) EVP_bf_cbc; extern const EVP_CIPHER *EVP_bf_cbc(void); %rename(bf_cfb) EVP_bf_cfb; extern const EVP_CIPHER *EVP_bf_cfb(void); %rename(bf_ofb) EVP_bf_ofb; extern const EVP_CIPHER *EVP_bf_ofb(void); /* %rename(idea_ecb) extern const EVP_CIPHER *EVP_idea_ecb(void); %rename(idea_cbc) extern const EVP_CIPHER *EVP_idea_cbc(void); %rename(idea_cfb) extern const EVP_CIPHER *EVP_idea_cfb(void); %rename(idea_ofb) extern const EVP_CIPHER *EVP_idea_ofb(void); */ %rename(cast5_ecb) EVP_cast5_ecb; extern const EVP_CIPHER *EVP_cast5_ecb(void); %rename(cast5_cbc) EVP_cast5_cbc; extern const EVP_CIPHER *EVP_cast5_cbc(void); %rename(cast5_cfb) EVP_cast5_cfb; extern const EVP_CIPHER *EVP_cast5_cfb(void); %rename(cast5_ofb) EVP_cast5_ofb; extern const EVP_CIPHER *EVP_cast5_ofb(void); /* %rename(rc5_ecb) extern const EVP_CIPHER *EVP_rc5_32_12_16_ecb(void); %rename(rc5_cbc) extern const EVP_CIPHER *EVP_rc5_32_12_16_cbc(void); %rename(rc5_cfb) extern const EVP_CIPHER *EVP_rc5_32_12_16_cfb(void); %rename(rc5_ofb) extern const EVP_CIPHER *EVP_rc5_32_12_16_ofb(void); */ #if !defined(OPENSSL_NO_RC4) %rename(rc4) EVP_rc4; extern const EVP_CIPHER *EVP_rc4(void); #endif #if !defined(OPENSSL_NO_RC2) %rename(rc2_40_cbc) EVP_rc2_40_cbc; extern const EVP_CIPHER *EVP_rc2_40_cbc(void); #endif %rename(aes_128_ecb) EVP_aes_128_ecb; extern const EVP_CIPHER *EVP_aes_128_ecb(void); %rename(aes_128_cbc) EVP_aes_128_cbc; extern const EVP_CIPHER *EVP_aes_128_cbc(void); %rename(aes_128_cfb) EVP_aes_128_cfb; extern const EVP_CIPHER *EVP_aes_128_cfb(void); %rename(aes_128_ofb) EVP_aes_128_ofb; extern const EVP_CIPHER *EVP_aes_128_ofb(void); %rename(aes_128_ctr) EVP_aes_128_ctr; extern const EVP_CIPHER *EVP_aes_128_ctr(void); %rename(aes_192_ecb) EVP_aes_192_ecb; extern const EVP_CIPHER *EVP_aes_192_ecb(void); %rename(aes_192_cbc) EVP_aes_192_cbc; extern const EVP_CIPHER *EVP_aes_192_cbc(void); %rename(aes_192_cfb) EVP_aes_192_cfb; extern const EVP_CIPHER *EVP_aes_192_cfb(void); %rename(aes_192_ofb) EVP_aes_192_ofb; extern const EVP_CIPHER *EVP_aes_192_ofb(void); %rename(aes_192_ctr) EVP_aes_192_ctr; extern const EVP_CIPHER *EVP_aes_192_ctr(void); %rename(aes_256_ecb) EVP_aes_256_ecb; extern const EVP_CIPHER *EVP_aes_256_ecb(void); %rename(aes_256_cbc) EVP_aes_256_cbc; extern const EVP_CIPHER *EVP_aes_256_cbc(void); %rename(aes_256_cfb) EVP_aes_256_cfb; extern const EVP_CIPHER *EVP_aes_256_cfb(void); %rename(aes_256_ofb) EVP_aes_256_ofb; extern const EVP_CIPHER *EVP_aes_256_ofb(void); %rename(aes_256_ctr) EVP_aes_256_ctr; extern EVP_CIPHER const *EVP_aes_256_ctr(void); %rename(cipher_set_padding) EVP_CIPHER_CTX_set_padding; extern int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *, int); %rename(cipher_set_padding) EVP_CIPHER_CTX_set_padding; extern int EVP_CIPHER_CTX_set_padding(EVP_CIPHER_CTX *x, int padding); %rename(pkey_free) EVP_PKEY_free; extern void EVP_PKEY_free(EVP_PKEY *); %rename(pkey_assign) EVP_PKEY_assign; extern int EVP_PKEY_assign(EVP_PKEY *, int, char *); #if OPENSSL_VERSION_NUMBER >= 0x0090800fL && !defined(OPENSSL_NO_EC) %rename(pkey_assign_ec) EVP_PKEY_assign_EC_KEY; extern int EVP_PKEY_assign_EC_KEY(EVP_PKEY *, EC_KEY *); #endif %rename(pkey_set1_rsa) EVP_PKEY_set1_RSA; extern int EVP_PKEY_set1_RSA(EVP_PKEY *, RSA *); %rename(sign_init) EVP_SignInit; extern int EVP_SignInit(EVP_MD_CTX *, const EVP_MD *); %rename(verify_init) EVP_VerifyInit; extern int EVP_VerifyInit(EVP_MD_CTX *, const EVP_MD *); %rename(pkey_size) EVP_PKEY_size; extern int EVP_PKEY_size(EVP_PKEY *); %warnfilter(454) _evp_err; %inline %{ #define PKCS5_SALT_LEN 8 static PyObject *_evp_err; void evp_init(PyObject *evp_err) { Py_INCREF(evp_err); _evp_err = evp_err; } %} %typemap(out) RSA * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { $result = NULL; } } %inline %{ RSA *pkey_get1_rsa(EVP_PKEY *pkey) { RSA *ret = NULL; if ((ret = EVP_PKEY_get1_RSA(pkey)) == NULL) { /* _evp_err now inherits from PyExc_ValueError, so we should * keep API intact. */ PyErr_Format(_evp_err, "Invalid key in function %s.", __FUNCTION__); } return ret; } %} %typemap(out) RSA * ; %inline %{ PyObject *pkcs5_pbkdf2_hmac_sha1(PyObject *pass, PyObject *salt, int iter, int keylen) { unsigned char *key; unsigned char *saltbuf; char *passbuf; PyObject *ret; int passlen = 0, saltlen = 0; if (m2_PyObject_AsReadBufferInt(pass, (const void **)&passbuf, &passlen) == -1) return NULL; if (m2_PyObject_AsReadBufferInt(salt, (const void **)&saltbuf, &saltlen) == -1) return NULL; key = PyMem_Malloc(keylen); if (key == NULL) return PyErr_NoMemory(); PKCS5_PBKDF2_HMAC_SHA1(passbuf, passlen, saltbuf, saltlen, iter, keylen, key); ret = PyBytes_FromStringAndSize((char*)key, keylen); OPENSSL_cleanse(key, keylen); PyMem_Free(key); return ret; } EVP_MD_CTX *md_ctx_new(void) { EVP_MD_CTX *ctx; if (!(ctx = EVP_MD_CTX_create())) { PyErr_SetString(PyExc_MemoryError, "md_ctx_new"); return NULL; } return ctx; } void md_ctx_free(EVP_MD_CTX *ctx) { EVP_MD_CTX_destroy(ctx); } int digest_update(EVP_MD_CTX *ctx, PyObject *blob) { const void *buf; Py_ssize_t len; if (PyObject_AsReadBuffer(blob, &buf, &len) == -1) return -1; return EVP_DigestUpdate(ctx, buf, len); } PyObject *digest_final(EVP_MD_CTX *ctx) { void *blob; int blen; PyObject *ret; if (!(blob = PyMem_Malloc(EVP_MD_CTX_size(ctx)))) { PyErr_SetString(PyExc_MemoryError, "digest_final"); return NULL; } if (!EVP_DigestFinal(ctx, blob, (unsigned int *)&blen)) { PyMem_Free(blob); m2_PyErr_Msg(_evp_err); return NULL; } ret = PyBytes_FromStringAndSize(blob, blen); PyMem_Free(blob); return ret; } HMAC_CTX *hmac_ctx_new(void) { HMAC_CTX *ctx; if (!(ctx = HMAC_CTX_new())) { PyErr_SetString(PyExc_MemoryError, "hmac_ctx_new"); return NULL; } return ctx; } void hmac_ctx_free(HMAC_CTX *ctx) { HMAC_CTX_free(ctx); } PyObject *hmac_init(HMAC_CTX *ctx, PyObject *key, const EVP_MD *md) { const void *kbuf; int klen = 0; if (m2_PyObject_AsReadBufferInt(key, &kbuf, &klen) == -1) return NULL; if (!HMAC_Init_ex(ctx, kbuf, klen, md, NULL)) { PyErr_SetString(_evp_err, "HMAC_Init failed"); return NULL; } Py_RETURN_NONE; } PyObject *hmac_update(HMAC_CTX *ctx, PyObject *blob) { const void *buf; Py_ssize_t len; if (PyObject_AsReadBuffer(blob, &buf, &len) == -1) return NULL; if (!HMAC_Update(ctx, buf, len)) { PyErr_SetString(_evp_err, "HMAC_Update failed"); return NULL; } Py_RETURN_NONE; } PyObject *hmac_final(HMAC_CTX *ctx) { void *blob; int blen; PyObject *ret; if (!(blob = PyMem_Malloc(HMAC_size(ctx)))) { PyErr_SetString(PyExc_MemoryError, "hmac_final"); return NULL; } if (!HMAC_Final(ctx, blob, (unsigned int *)&blen)) { PyErr_SetString(_evp_err, "HMAC_Final failed"); return NULL; } ret = PyBytes_FromStringAndSize(blob, blen); PyMem_Free(blob); return ret; } PyObject *hmac(PyObject *key, PyObject *data, const EVP_MD *md) { const void *kbuf, *dbuf; void *blob; int klen = 0; unsigned int blen; Py_ssize_t dlen; PyObject *ret; if ((m2_PyObject_AsReadBufferInt(key, &kbuf, &klen) == -1) || (PyObject_AsReadBuffer(data, &dbuf, &dlen) == -1)) return NULL; if (!(blob = PyMem_Malloc(EVP_MAX_MD_SIZE))) { PyErr_SetString(PyExc_MemoryError, "hmac"); return NULL; } HMAC(md, kbuf, klen, dbuf, dlen, blob, &blen); blob = PyMem_Realloc(blob, blen); ret = PyBytes_FromStringAndSize(blob, blen); PyMem_Free(blob); return ret; } EVP_CIPHER_CTX *cipher_ctx_new(void) { EVP_CIPHER_CTX *ctx; if (!(ctx = EVP_CIPHER_CTX_new())) { PyErr_SetString(PyExc_MemoryError, "cipher_ctx_new"); return NULL; } EVP_CIPHER_CTX_reset(ctx); return ctx; } void cipher_ctx_free(EVP_CIPHER_CTX *ctx) { EVP_CIPHER_CTX_free(ctx); } PyObject *bytes_to_key(const EVP_CIPHER *cipher, EVP_MD *md, PyObject *data, PyObject *salt, PyObject *iv, /* Not used */ int iter) { unsigned char key[EVP_MAX_KEY_LENGTH]; const void *dbuf, *sbuf; int dlen = 0, klen; Py_ssize_t slen; PyObject *ret; if ((m2_PyObject_AsReadBufferInt(data, &dbuf, &dlen) == -1) || (PyObject_AsReadBuffer(salt, &sbuf, &slen) == -1)) return NULL; assert((slen == 8) || (slen == 0)); klen = EVP_BytesToKey(cipher, md, (unsigned char *)sbuf, (unsigned char *)dbuf, dlen, iter, key, NULL); /* Since we are not returning IV no need to derive it */ ret = PyBytes_FromStringAndSize((char*)key, klen); return ret; } PyObject *cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, PyObject *key, PyObject *iv, int mode) { const void *kbuf, *ibuf; Py_ssize_t klen, ilen; if ((PyObject_AsReadBuffer(key, &kbuf, &klen) == -1) || (PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1)) return NULL; if (!EVP_CipherInit(ctx, cipher, (unsigned char *)kbuf, (unsigned char *)ibuf, mode)) { m2_PyErr_Msg(_evp_err); return NULL; } Py_RETURN_NONE; } PyObject *cipher_update(EVP_CIPHER_CTX *ctx, PyObject *blob) { const void *buf; int len = 0, olen; void *obuf; PyObject *ret; if (m2_PyObject_AsReadBufferInt(blob, &buf, &len) == -1) return NULL; if (!(obuf = PyMem_Malloc(len + EVP_CIPHER_CTX_block_size(ctx) - 1))) { PyErr_SetString(PyExc_MemoryError, "cipher_update"); return NULL; } if (!EVP_CipherUpdate(ctx, obuf, &olen, (unsigned char *)buf, len)) { PyMem_Free(obuf); m2_PyErr_Msg(_evp_err); return NULL; } ret = PyBytes_FromStringAndSize(obuf, olen); PyMem_Free(obuf); return ret; } PyObject *cipher_final(EVP_CIPHER_CTX *ctx) { void *obuf; int olen; PyObject *ret; if (!(obuf = PyMem_Malloc(EVP_CIPHER_CTX_block_size(ctx)))) { PyErr_SetString(PyExc_MemoryError, "cipher_final"); return NULL; } if (!EVP_CipherFinal(ctx, (unsigned char *)obuf, &olen)) { PyMem_Free(obuf); m2_PyErr_Msg(_evp_err); return NULL; } ret = PyBytes_FromStringAndSize(obuf, olen); PyMem_Free(obuf); return ret; } PyObject *sign_update(EVP_MD_CTX *ctx, PyObject *blob) { const void *buf; Py_ssize_t len; if (PyObject_AsReadBuffer(blob, &buf, &len) == -1) return NULL; if (!EVP_SignUpdate(ctx, buf, len)) { m2_PyErr_Msg(_evp_err); return NULL; } Py_RETURN_NONE; } PyObject *sign_final(EVP_MD_CTX *ctx, EVP_PKEY *pkey) { PyObject *ret; unsigned char *sigbuf; unsigned int siglen = EVP_PKEY_size(pkey); sigbuf = (unsigned char*)OPENSSL_malloc(siglen); if (!sigbuf) { PyErr_SetString(PyExc_MemoryError, "sign_final"); return NULL; } if (!EVP_SignFinal(ctx, sigbuf, &siglen, pkey)) { m2_PyErr_Msg(_evp_err); OPENSSL_cleanse(sigbuf, siglen); OPENSSL_free(sigbuf); return NULL; } ret = PyBytes_FromStringAndSize((char*)sigbuf, siglen); OPENSSL_cleanse(sigbuf, siglen); OPENSSL_free(sigbuf); return ret; } int verify_update(EVP_MD_CTX *ctx, PyObject *blob) { const void *buf; Py_ssize_t len; if (PyObject_AsReadBuffer(blob, &buf, &len) == -1) return -1; return EVP_VerifyUpdate(ctx, buf, len); } int verify_final(EVP_MD_CTX *ctx, PyObject *blob, EVP_PKEY *pkey) { unsigned char *kbuf; int len = 0; if (m2_PyObject_AsReadBufferInt(blob, (const void **)&kbuf, &len) == -1) return -1; return EVP_VerifyFinal(ctx, kbuf, len, pkey); } %} %typemap(out) EVP_MD * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { $result = NULL; } } %inline %{ const EVP_MD *get_digestbyname(const char* name) { const EVP_MD *ret = NULL; if ((ret = EVP_get_digestbyname(name)) == NULL) { m2_PyErr_Msg(_evp_err); } return ret; } %} %typemap(out) EVP_MD *; %inline %{ int pkey_write_pem_no_cipher(EVP_PKEY *pkey, BIO *f, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_PKCS8PrivateKey(f, pkey, NULL, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } %} %inline %{ int pkey_write_pem(EVP_PKEY *pkey, BIO *f, EVP_CIPHER *cipher, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_PKCS8PrivateKey(f, pkey, cipher, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } %} %typemap(out) EVP_PKEY * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { $result = NULL; } } %inline %{ EVP_PKEY *pkey_new(void) { EVP_PKEY *ret; if ((ret = EVP_PKEY_new()) == NULL) { PyErr_Format(PyExc_MemoryError, "Insufficient memory for new key in function %s.", __FUNCTION__); } return ret; } EVP_PKEY *pkey_read_pem(BIO *f, PyObject *pyfunc) { EVP_PKEY *pk; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS pk = PEM_read_bio_PrivateKey(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); if (pk == NULL) { PyErr_Format(_evp_err, "Unable to read private key in function %s.", __FUNCTION__); } return pk; } EVP_PKEY *pkey_read_pem_pubkey(BIO *f, PyObject *pyfunc) { EVP_PKEY *pk; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS pk = PEM_read_bio_PUBKEY(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); if (pk == NULL) { PyErr_Format(_evp_err, "Unable to read public key in function %s.", __FUNCTION__); } return pk; } %} %typemap(out) EVP_PKEY * ; %inline %{ int pkey_assign_rsa(EVP_PKEY *pkey, RSA *rsa) { return EVP_PKEY_assign_RSA(pkey, rsa); } PyObject *pkey_as_der(EVP_PKEY *pkey) { unsigned char * pp = NULL; int len; PyObject * der; len = i2d_PUBKEY(pkey, &pp); if (len < 0){ PyErr_SetString(_evp_err, "EVP_PKEY as DER failed"); return NULL; } der = PyBytes_FromStringAndSize((char*)pp, len); OPENSSL_free(pp); return der; } PyObject *pkey_get_modulus(EVP_PKEY *pkey) { RSA *rsa; DSA *dsa; BIO *bio; BUF_MEM *bptr; PyObject *ret; const BIGNUM* bn; switch (EVP_PKEY_base_id(pkey)) { case EVP_PKEY_RSA: rsa = EVP_PKEY_get1_RSA(pkey); bio = BIO_new(BIO_s_mem()); if (!bio) { RSA_free(rsa); PyErr_SetString(PyExc_MemoryError, "pkey_get_modulus"); return NULL; } RSA_get0_key(rsa, &bn, NULL, NULL); if (!BN_print(bio, bn)) { m2_PyErr_Msg(PyExc_RuntimeError); BIO_free(bio); RSA_free(rsa); return NULL; } BIO_get_mem_ptr(bio, &bptr); ret = PyBytes_FromStringAndSize(bptr->data, bptr->length); (void)BIO_set_close(bio, BIO_CLOSE); BIO_free(bio); RSA_free(rsa); return ret; break; case EVP_PKEY_DSA: dsa = EVP_PKEY_get1_DSA(pkey); bio = BIO_new(BIO_s_mem()); if (!bio) { DSA_free(dsa); PyErr_SetString(PyExc_MemoryError, "pkey_get_modulus"); return NULL; } DSA_get0_key(dsa, &bn, NULL); if (!BN_print(bio, bn)) { m2_PyErr_Msg(PyExc_RuntimeError); BIO_free(bio); DSA_free(dsa); return NULL; } BIO_get_mem_ptr(bio, &bptr); ret = PyBytes_FromStringAndSize(bptr->data, bptr->length); (void)BIO_set_close(bio, BIO_CLOSE); BIO_free(bio); DSA_free(dsa); return ret; break; default: PyErr_SetString(_evp_err, "unsupported key type"); return NULL; } } %} M2Crypto-0.31.0/SWIG/_lib.h0000664000175000001440000000166013165756570015404 0ustar matejusers00000000000000/* Copyright (c) 1999 Ng Pheng Siong. All rights reserved. */ /* $Id$ */ #include typedef struct _blob { unsigned char *data; int len; } Blob; Blob *blob_new(int len, const char *errmsg); Blob *blob_copy(Blob *from, const char *errmsg); void blob_free(Blob *blob); static int m2_PyObject_AsReadBufferInt(PyObject *obj, const void **buffer, int *buffer_len); static int m2_PyString_AsStringAndSizeInt(PyObject *obj, char **s, int *len); static BIGNUM* m2_PyObject_AsBIGNUM(PyObject* value, PyObject* _py_exc) ; /* Always use these two together, to correctly handle non-memoryview objects. */ static int m2_PyObject_GetBufferInt(PyObject *obj, Py_buffer *view, int flags); static void m2_PyBuffer_Release(PyObject *obj, Py_buffer *view); int bn_gencb_callback(int p, int n, BN_GENCB *gencb); int passphrase_callback(char *buf, int num, int v, void *userdata); void lib_init(void); M2Crypto-0.31.0/SWIG/_lib.i0000644000175000001440000004511313355123234015366 0ustar matejusers00000000000000/* Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. */ /* $Id$ */ %{ #include #include #include #include #include #include #include #include #include %} /* OpenSSL 1.1 compatibility shim */ %include _lib11_compat.i /* Python 3 compatibility shim */ %include _py3k_compat.i %{ /* OpenSSL 1.0.2 copmatbility shim */ #if OPENSSL_VERSION_NUMBER < 0x10002000L typedef void (*OPENSSL_sk_freefunc)(void *); typedef void *(*OPENSSL_sk_copyfunc)(const void *); typedef struct stack_st OPENSSL_STACK; # define MIN_NODES 4 # define sk_deep_copy OPENSSL_sk_deep_copy void OPENSSL_sk_free(OPENSSL_STACK *st) { if (st == NULL) return; OPENSSL_free(st->data); OPENSSL_free(st); } OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *sk, OPENSSL_sk_copyfunc copy_func, OPENSSL_sk_freefunc free_func) { OPENSSL_STACK *ret; int i; if (sk->num < 0) return NULL; if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) return NULL; /* direct structure assignment */ *ret = *sk; ret->num_alloc = sk->num > MIN_NODES ? (size_t)sk->num : MIN_NODES; ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc); if (ret->data == NULL) { OPENSSL_free(ret); return NULL; } for (i = 0; i < ret->num; ++i) { if (sk->data[i] == NULL) continue; if ((ret->data[i] = copy_func(sk->data[i])) == NULL) { while (--i >= 0) if (ret->data[i] != NULL) free_func((void *)ret->data[i]); OPENSSL_sk_free(ret); return NULL; } } return ret; } #endif /* OpenSSL 1.0.2 copmatbility shim */ /* Blob interface. Deprecated. */ Blob *blob_new(int len, const char *errmsg) { Blob *blob; if (!(blob=(Blob *)PyMem_Malloc(sizeof(Blob)))){ PyErr_SetString(PyExc_MemoryError, errmsg); return NULL; } if (!(blob->data=(unsigned char *)PyMem_Malloc(len))) { PyMem_Free(blob); PyErr_SetString(PyExc_MemoryError, errmsg); return NULL; } blob->len=len; return blob; } Blob *blob_copy(Blob *from, const char *errmsg) { Blob *blob=blob_new(from->len, errmsg); if (!blob) { PyErr_SetString(PyExc_MemoryError, errmsg); return NULL; } memcpy(blob->data, from->data, from->len); return blob; } void blob_free(Blob *blob) { PyMem_Free(blob->data); PyMem_Free(blob); } /* Python helpers. */ %} %ignore PyObject_CheckBuffer; %ignore PyObject_GetBuffer; %ignore PyBuffer_Release; %ignore m2_PyObject_AsReadBufferInt; %ignore m2_PyObject_GetBufferInt; %ignore m2_PyBuffer_Release; %ignore m2_PyString_AsStringAndSizeInt; %{ static int m2_PyObject_AsReadBufferInt(PyObject *obj, const void **buffer, int *buffer_len) { int ret; Py_ssize_t len; ret = PyObject_AsReadBuffer(obj, buffer, &len); if (ret) return ret; if (len > INT_MAX) { PyErr_SetString(PyExc_ValueError, "object too large"); return -1; } *buffer_len = len; return 0; } static int m2_PyObject_GetBufferInt(PyObject *obj, Py_buffer *view, int flags) { int ret; if (PyObject_CheckBuffer(obj)) ret = PyObject_GetBuffer(obj, view, flags); else { const void *buf; ret = PyObject_AsReadBuffer(obj, &buf, &view->len); if (ret == 0) view->buf = (void *)buf; } if (ret) return ret; if (view->len > INT_MAX) { PyErr_SetString(PyExc_ValueError, "object too large"); m2_PyBuffer_Release(obj, view); return -1; } return 0; } static BIGNUM* m2_PyObject_AsBIGNUM(PyObject* value, PyObject* _py_exc) { BIGNUM* bn; const void* vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(bn = BN_mpi2bn((unsigned char *)vbuf, vlen, NULL))) { PyErr_SetString(_py_exc, ERR_reason_error_string(ERR_get_error())); return NULL; } return bn; } static void m2_PyBuffer_Release(PyObject *obj, Py_buffer *view) { if (PyObject_CheckBuffer(obj)) PyBuffer_Release(view); /* else do nothing, view->buf comes from PyObject_AsReadBuffer */ } static int m2_PyString_AsStringAndSizeInt(PyObject *obj, char **s, int *len) { int ret; Py_ssize_t len2; ret = PyBytes_AsStringAndSize(obj, s, &len2); if (ret) return ret; if (len2 > INT_MAX) { PyErr_SetString(PyExc_ValueError, "string too large"); return -1; } *len = len2; return 0; } /* Works as PyFile_Name, but always returns a new object. */ PyObject *m2_PyFile_Name(PyObject *pyfile) { PyObject *out = NULL; #if PY_MAJOR_VERSION >= 3 out = PyObject_GetAttrString(pyfile, "name"); #else out = PyFile_Name(pyfile); Py_XINCREF(out); #endif return out; } /* Yes, __FUNCTION__ is a non-standard symbol, but it is supported by * both gcc and MSVC. */ #define m2_PyErr_Msg(type) m2_PyErr_Msg_Caller(type, (const char*) __FUNCTION__) static void m2_PyErr_Msg_Caller(PyObject *err_type, const char* caller) { const char *err_reason; const char *data; int flags; /* This max size of a (longer than ours) OpenSSL error string is hardcoded * in OpenSSL's crypto/err/err_prn.c:ERR_print_errors_cb() */ char err_msg[4096]; unsigned long err_code = ERR_get_error_line_data(NULL, NULL, &data, &flags); if (err_code != 0) { err_reason = ERR_reason_error_string(err_code); if (data && (flags & ERR_TXT_STRING)) snprintf(err_msg, sizeof(err_msg), "%s (%s)", err_reason, data); else snprintf(err_msg, sizeof(err_msg), "%s", err_reason); PyErr_SetString(err_type, err_msg); } else { PyErr_Format(err_type, "Unknown error in function %s.", caller); } } /* C callbacks invoked by OpenSSL; these in turn call back into Python. */ int ssl_verify_callback(int ok, X509_STORE_CTX *ctx) { PyObject *argv, *ret; PyObject *_x509_store_ctx_swigptr=0, *_x509_store_ctx_obj=0, *_x509_store_ctx_inst=0, *_klass=0; PyObject *_x509=0, *_ssl_ctx=0; SSL *ssl; SSL_CTX *ssl_ctx; X509 *x509; int errnum, errdepth; int cret; int new_style_callback = 0, warning_raised_exception=0; PyGILState_STATE gilstate; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ ssl = (SSL *)X509_STORE_CTX_get_app_data(ctx); gilstate = PyGILState_Ensure(); if (PyMethod_Check(ssl_verify_cb_func)) { PyObject *func; PyCodeObject *code; func = PyMethod_Function(ssl_verify_cb_func); code = (PyCodeObject *) PyFunction_GetCode(func); if (code && code->co_argcount == 3) { /* XXX Python internals */ new_style_callback = 1; } } else if (PyFunction_Check(ssl_verify_cb_func)) { PyCodeObject *code = (PyCodeObject *) PyFunction_GetCode(ssl_verify_cb_func); if (code && code->co_argcount == 2) { /* XXX Python internals */ new_style_callback = 1; } } else { /* XXX There are lots of other callable types, but we will assume * XXX that any other type of callable uses the new style callback, * XXX although this is not entirely safe assumption. */ new_style_callback = 1; } if (new_style_callback) { PyObject *x509mod; x509mod = PyDict_GetItemString(PyImport_GetModuleDict(), "M2Crypto.X509"); _klass = PyObject_GetAttrString(x509mod, "X509_Store_Context"); _x509_store_ctx_swigptr = SWIG_NewPointerObj((void *)ctx, SWIGTYPE_p_X509_STORE_CTX, 0); _x509_store_ctx_obj = Py_BuildValue("(Oi)", _x509_store_ctx_swigptr, 0); _x509_store_ctx_inst = PyObject_CallObject(_klass, _x509_store_ctx_obj); argv = Py_BuildValue("(iO)", ok, _x509_store_ctx_inst); } else { if (PyErr_Warn(PyExc_DeprecationWarning, "Old style callback, use cb_func(ok, store) instead")) { warning_raised_exception = 1; } x509 = X509_STORE_CTX_get_current_cert(ctx); errnum = X509_STORE_CTX_get_error(ctx); errdepth = X509_STORE_CTX_get_error_depth(ctx); ssl = (SSL *)X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); ssl_ctx = SSL_get_SSL_CTX(ssl); _x509 = SWIG_NewPointerObj((void *)x509, SWIGTYPE_p_X509, 0); _ssl_ctx = SWIG_NewPointerObj((void *)ssl_ctx, SWIGTYPE_p_SSL_CTX, 0); argv = Py_BuildValue("(OOiii)", _ssl_ctx, _x509, errnum, errdepth, ok); } if (!warning_raised_exception) { ret = PyEval_CallObject(ssl_verify_cb_func, argv); } else { ret = 0; } if (!ret) { /* Got an exception in PyEval_CallObject(), let's fail verification * to be safe. */ cret = 0; } else { /* FIXME This is possibly problematic if ret > MAXINT */ cret = (int)PyLong_AsLong(ret); } Py_XDECREF(ret); Py_XDECREF(argv); if (new_style_callback) { Py_XDECREF(_x509_store_ctx_inst); Py_XDECREF(_x509_store_ctx_obj); Py_XDECREF(_x509_store_ctx_swigptr); Py_XDECREF(_klass); } else { Py_XDECREF(_x509); Py_XDECREF(_ssl_ctx); } PyGILState_Release(gilstate); return cret; } int x509_store_verify_callback(int ok, X509_STORE_CTX *ctx) { PyGILState_STATE gilstate; PyObject *argv, *ret; PyObject *_x509_store_ctx_swigptr=0, *_x509_store_ctx_obj=0, *_x509_store_ctx_inst=0, *_klass=0; int cret; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ PyObject *x509mod; gilstate = PyGILState_Ensure(); /* Below, handle only what is called 'new style callback' in ssl_verify_callback(). TODO: does 'old style callback' exist any more? */ x509mod = PyDict_GetItemString(PyImport_GetModuleDict(), "M2Crypto.X509"); _klass = PyObject_GetAttrString(x509mod, "X509_Store_Context"); _x509_store_ctx_swigptr = SWIG_NewPointerObj((void *)ctx, SWIGTYPE_p_X509_STORE_CTX, 0); _x509_store_ctx_obj = Py_BuildValue("(Oi)", _x509_store_ctx_swigptr, 0); _x509_store_ctx_inst = PyObject_CallObject(_klass, _x509_store_ctx_obj); argv = Py_BuildValue("(iO)", ok, _x509_store_ctx_inst); ret = PyEval_CallObject(x509_store_verify_cb_func, argv); if (!ret) { /* Got an exception in PyEval_CallObject(), let's fail verification * to be safe. */ cret = 0; } else { cret = (int)PyInt_AsLong(ret); } Py_XDECREF(ret); Py_XDECREF(argv); Py_XDECREF(_x509_store_ctx_inst); Py_XDECREF(_x509_store_ctx_obj); Py_XDECREF(_x509_store_ctx_swigptr); Py_XDECREF(_klass); PyGILState_Release(gilstate); return cret; } void ssl_info_callback(const SSL *s, int where, int ret) { PyObject *argv, *retval, *_SSL; PyGILState_STATE gilstate; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ gilstate = PyGILState_Ensure(); _SSL = SWIG_NewPointerObj((void *)s, SWIGTYPE_p_SSL, 0); argv = Py_BuildValue("(iiO)", where, ret, _SSL); retval = PyEval_CallObject(ssl_info_cb_func, argv); Py_XDECREF(retval); Py_XDECREF(argv); Py_XDECREF(_SSL); PyGILState_Release(gilstate); } DH *ssl_set_tmp_dh_callback(SSL *ssl, int is_export, int keylength) { PyObject *argv, *ret, *_ssl; DH *dh; PyGILState_STATE gilstate; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ gilstate = PyGILState_Ensure(); _ssl = SWIG_NewPointerObj((void *)ssl, SWIGTYPE_p_SSL, 0); argv = Py_BuildValue("(Oii)", _ssl, is_export, keylength); ret = PyEval_CallObject(ssl_set_tmp_dh_cb_func, argv); if ((SWIG_ConvertPtr(ret, (void **)&dh, SWIGTYPE_p_DH, SWIG_POINTER_EXCEPTION | 0)) == -1) dh = NULL; Py_XDECREF(ret); Py_XDECREF(argv); Py_XDECREF(_ssl); PyGILState_Release(gilstate); return dh; } RSA *ssl_set_tmp_rsa_callback(SSL *ssl, int is_export, int keylength) { PyObject *argv, *ret, *_ssl; RSA *rsa; PyGILState_STATE gilstate; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ gilstate = PyGILState_Ensure(); _ssl = SWIG_NewPointerObj((void *)ssl, SWIGTYPE_p_SSL, 0); argv = Py_BuildValue("(Oii)", _ssl, is_export, keylength); ret = PyEval_CallObject(ssl_set_tmp_rsa_cb_func, argv); if ((SWIG_ConvertPtr(ret, (void **)&rsa, SWIGTYPE_p_RSA, SWIG_POINTER_EXCEPTION | 0)) == -1) rsa = NULL; Py_XDECREF(ret); Py_XDECREF(argv); Py_XDECREF(_ssl); PyGILState_Release(gilstate); return rsa; } /* Universal callback for dh_generate_parameters, * dsa_generate_parametersm, and rsa_generate_key */ int bn_gencb_callback(int p, int n, BN_GENCB *gencb) { PyObject *argv, *ret, *cbfunc; cbfunc = (PyObject *)BN_GENCB_get_arg(gencb); argv = Py_BuildValue("(ii)", p, n); ret = PyEval_CallObject(cbfunc, argv); PyErr_Clear(); Py_DECREF(argv); Py_XDECREF(ret); return 1; } int passphrase_callback(char *buf, int num, int v, void *arg) { int i; Py_ssize_t len; char *str; PyObject *argv, *ret, *cbfunc; PyGILState_STATE gilstate; gilstate = PyGILState_Ensure(); cbfunc = (PyObject *)arg; argv = Py_BuildValue("(i)", v); /* PyEval_CallObject sets exception, if needed. */ ret = PyEval_CallObject(cbfunc, argv); Py_DECREF(argv); if (ret == NULL) { PyGILState_Release(gilstate); return -1; } if (!PyBytes_Check(ret)) { PyErr_SetString(PyExc_RuntimeError, "Result of callback is not bytes()."); Py_DECREF(ret); PyGILState_Release(gilstate); return -1; } if ((len = PyBytes_Size(ret)) > num) len = num; str = PyBytes_AsString(ret); for (i = 0; i < len; i++) buf[i] = str[i]; Py_DECREF(ret); PyGILState_Release(gilstate); return len; } %} %inline %{ void lib_init() { #if OPENSSL_VERSION_NUMBER < 0x10100000L SSLeay_add_all_algorithms(); ERR_load_ERR_strings(); #endif } /* Bignum routines that aren't not numerous enough to warrant a separate file. */ PyObject *bn_to_mpi(const BIGNUM *bn) { int len = 0; unsigned char *mpi; PyObject *pyo; len = BN_bn2mpi(bn, NULL); if (!(mpi=(unsigned char *)PyMem_Malloc(len))) { m2_PyErr_Msg(PyExc_MemoryError); return NULL; } len=BN_bn2mpi(bn, mpi); pyo=PyBytes_FromStringAndSize((const char *)mpi, len); PyMem_Free(mpi); return pyo; } const BIGNUM *mpi_to_bn(PyObject *value) { const void *vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; return BN_mpi2bn(vbuf, vlen, NULL); } PyObject *bn_to_bin(BIGNUM *bn) { int len = 0; unsigned char *bin; PyObject *pyo; len = BN_num_bytes(bn); if (!(bin=(unsigned char *)PyMem_Malloc(len))) { PyErr_SetString(PyExc_MemoryError, "bn_to_bin"); return NULL; } BN_bn2bin(bn, bin); pyo=PyBytes_FromStringAndSize((const char *)bin, len); PyMem_Free(bin); return pyo; } const BIGNUM *bin_to_bn(PyObject *value) { const void *vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; return BN_bin2bn(vbuf, vlen, NULL); } PyObject *bn_to_hex(BIGNUM *bn) { char *hex; PyObject *pyo; Py_ssize_t len = 0; hex = BN_bn2hex(bn); if (!hex) { m2_PyErr_Msg(PyExc_RuntimeError); OPENSSL_free(hex); return NULL; } len = strlen(hex); pyo=PyBytes_FromStringAndSize(hex, len); OPENSSL_free(hex); return pyo; } BIGNUM *hex_to_bn(PyObject *value) { const void *vbuf; Py_ssize_t vlen = 0; BIGNUM *bn; if (PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1) return NULL; if ((bn=BN_new())==NULL) { PyErr_SetString(PyExc_MemoryError, "hex_to_bn"); return NULL; } if (BN_hex2bn(&bn, (const char *)vbuf) <= 0) { m2_PyErr_Msg(PyExc_RuntimeError); BN_free(bn); return NULL; } return bn; } BIGNUM *dec_to_bn(PyObject *value) { const void *vbuf; Py_ssize_t vlen = 0; BIGNUM *bn; if (PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1) return NULL; if ((bn=BN_new())==NULL) { PyErr_SetString(PyExc_MemoryError, "dec_to_bn"); return NULL; } if ((BN_dec2bn(&bn, (const char *)vbuf) <= 0)) { m2_PyErr_Msg(PyExc_RuntimeError); BN_free(bn); return NULL; } return bn; } %} /* Various useful typemaps. */ %typemap(in) Blob * { Py_ssize_t len = 0; if (!PyBytes_Check($input)) { PyErr_SetString(PyExc_TypeError, "expected PyString"); return NULL; } len=PyBytes_Size($input); if (len > INT_MAX) { PyErr_SetString(PyExc_ValueError, "object too large"); return NULL; } $1=(Blob *)PyMem_Malloc(sizeof(Blob)); if (!$1) { PyErr_SetString(PyExc_MemoryError, "malloc Blob"); return NULL; } $1->data=(unsigned char *)PyBytes_AsString($input); $1->len=len; } %typemap(out) Blob * { if ($1==NULL) { Py_INCREF(Py_None); $result=Py_None; } else { $result=PyBytes_FromStringAndSize((const char *)$1->data, $1->len); PyMem_Free($1->data); PyMem_Free($1); } } %typemap(in) PyObject *pyfunc { if (!PyCallable_Check($input)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } $1=$input; } %typemap(in) PyObject *pyblob { if (!PyBytes_Check($input)) { PyErr_SetString(PyExc_TypeError, "expected PyString"); return NULL; } $1=$input; } %typemap(in) PyObject * { $1=$input; } %typemap(out) PyObject * { $result=$1; } %typemap(out) int { $result=PyLong_FromLong($1); if (PyErr_Occurred()) SWIG_fail; } /* Pointer checks. */ %apply Pointer NONNULL { Blob * }; /* A bunch of "straight-thru" functions. */ %rename(err_print_errors) ERR_print_errors; %threadallow ERR_print_errors; extern void ERR_print_errors(BIO *); %rename(err_get_error) ERR_get_error; extern unsigned long ERR_get_error(void); %rename(err_peek_error) ERR_peek_error; extern unsigned long ERR_peek_error(void); %rename(err_lib_error_string) ERR_lib_error_string; extern const char *ERR_lib_error_string(unsigned long); %rename(err_func_error_string) ERR_func_error_string; extern const char *ERR_func_error_string(unsigned long); %rename(err_reason_error_string) ERR_reason_error_string; extern const char *ERR_reason_error_string(unsigned long); M2Crypto-0.31.0/SWIG/_lib11_compat.i0000664000175000001440000002306613165756570017116 0ustar matejusers00000000000000/* * Copyright 2016 The OpenSSL Project Authors. All Rights Reserved. * * Licensed under the OpenSSL license (the "License"). You may not use * this file except in compliance with the License. You can obtain a copy * in the file LICENSE in the source distribution or at * https://www.openssl.org/source/license.html */ %{ #if OPENSSL_VERSION_NUMBER < 0x10100000L #include #include # define OPENSSL_zalloc(num) \ CRYPTO_zalloc(num, __FILE__, __LINE__) static void *CRYPTO_zalloc(size_t num, const char *file, int line) { void *ret = CRYPTO_malloc(num, file, line); if (ret != NULL) memset(ret, 0, num); return ret; } #include #ifndef BN_F_BN_GENCB_NEW # define BN_F_BN_GENCB_NEW 143 #endif # define BN_GENCB_get_arg(gencb) ((gencb)->arg) BN_GENCB *BN_GENCB_new(void) { BN_GENCB *ret; if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) { BNerr(BN_F_BN_GENCB_NEW, ERR_R_MALLOC_FAILURE); return (NULL); } return ret; } void BN_GENCB_free(BN_GENCB *cb) { if (cb == NULL) return; OPENSSL_free(cb); } int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) { /* If the fields n and e in r are NULL, the corresponding input * parameters MUST be non-NULL for n and e. d may be * left NULL (in case only the public key is used). */ if ((r->n == NULL && n == NULL) || (r->e == NULL && e == NULL)) return 0; if (n != NULL) { BN_free(r->n); r->n = n; } if (e != NULL) { BN_free(r->e); r->e = e; } if (d != NULL) { BN_free(r->d); r->d = d; } return 1; } int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) { /* If the fields p and q in r are NULL, the corresponding input * parameters MUST be non-NULL. */ if ((r->p == NULL && p == NULL) || (r->q == NULL && q == NULL)) return 0; if (p != NULL) { BN_free(r->p); r->p = p; } if (q != NULL) { BN_free(r->q); r->q = q; } return 1; } int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) { /* If the fields dmp1, dmq1 and iqmp in r are NULL, the corresponding input * parameters MUST be non-NULL. */ if ((r->dmp1 == NULL && dmp1 == NULL) || (r->dmq1 == NULL && dmq1 == NULL) || (r->iqmp == NULL && iqmp == NULL)) return 0; if (dmp1 != NULL) { BN_free(r->dmp1); r->dmp1 = dmp1; } if (dmq1 != NULL) { BN_free(r->dmq1); r->dmq1 = dmq1; } if (iqmp != NULL) { BN_free(r->iqmp); r->iqmp = iqmp; } return 1; } void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) { if (n != NULL) *n = r->n; if (e != NULL) *e = r->e; if (d != NULL) *d = r->d; } void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) { if (p != NULL) *p = r->p; if (q != NULL) *q = r->q; } void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp) { if (dmp1 != NULL) *dmp1 = r->dmp1; if (dmq1 != NULL) *dmq1 = r->dmq1; if (iqmp != NULL) *iqmp = r->iqmp; } void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) { if (p != NULL) *p = d->p; if (q != NULL) *q = d->q; if (g != NULL) *g = d->g; } int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) { /* If the fields p, q and g in d are NULL, the corresponding input * parameters MUST be non-NULL. */ if ((d->p == NULL && p == NULL) || (d->q == NULL && q == NULL) || (d->g == NULL && g == NULL)) return 0; if (p != NULL) { BN_free(d->p); d->p = p; } if (q != NULL) { BN_free(d->q); d->q = q; } if (g != NULL) { BN_free(d->g); d->g = g; } return 1; } void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) { if (pub_key != NULL) *pub_key = d->pub_key; if (priv_key != NULL) *priv_key = d->priv_key; } int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) { /* If the field pub_key in d is NULL, the corresponding input * parameters MUST be non-NULL. The priv_key field may * be left NULL. */ if (d->pub_key == NULL && pub_key == NULL) return 0; if (pub_key != NULL) { BN_free(d->pub_key); d->pub_key = pub_key; } if (priv_key != NULL) { BN_free(d->priv_key); d->priv_key = priv_key; } return 1; } void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) { if (pr != NULL) *pr = sig->r; if (ps != NULL) *ps = sig->s; } int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s) { if (r == NULL || s == NULL) return 0; BN_clear_free(sig->r); BN_clear_free(sig->s); sig->r = r; sig->s = s; return 1; } void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) { if (pr != NULL) *pr = sig->r; if (ps != NULL) *ps = sig->s; } int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) { if (r == NULL || s == NULL) return 0; BN_clear_free(sig->r); BN_clear_free(sig->s); sig->r = r; sig->s = s; return 1; } void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) { if (p != NULL) *p = dh->p; if (q != NULL) *q = dh->q; if (g != NULL) *g = dh->g; } int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) { /* If the fields p and g in d are NULL, the corresponding input * parameters MUST be non-NULL. q may remain NULL. */ if ((dh->p == NULL && p == NULL) || (dh->g == NULL && g == NULL)) return 0; if (p != NULL) { BN_free(dh->p); dh->p = p; } if (q != NULL) { BN_free(dh->q); dh->q = q; } if (g != NULL) { BN_free(dh->g); dh->g = g; } if (q != NULL) { dh->length = BN_num_bits(q); } return 1; } void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) { if (pub_key != NULL) *pub_key = dh->pub_key; if (priv_key != NULL) *priv_key = dh->priv_key; } int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) { /* If the field pub_key in dh is NULL, the corresponding input * parameters MUST be non-NULL. The priv_key field may * be left NULL. */ if (dh->pub_key == NULL && pub_key == NULL) return 0; if (pub_key != NULL) { BN_free(dh->pub_key); dh->pub_key = pub_key; } if (priv_key != NULL) { BN_free(dh->priv_key); dh->priv_key = priv_key; } return 1; } int DH_set_length(DH *dh, long length) { dh->length = length; return 1; } const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx) { return ctx->iv; } unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx) { return ctx->iv; } EVP_MD_CTX *EVP_MD_CTX_new(void) { return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); } void EVP_MD_CTX_free(EVP_MD_CTX *ctx) { EVP_MD_CTX_cleanup(ctx); OPENSSL_free(ctx); } int RSA_size(const RSA* rsa) { /* BIGNUM* n = NULL; RSA_get0_key(rsa, n, NULL, NULL); */ return BN_num_bytes(rsa->n); } RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth) { RSA_METHOD *ret; ret = OPENSSL_malloc(sizeof(RSA_METHOD)); if (ret != NULL) { memcpy(ret, meth, sizeof(*meth)); ret->name = OPENSSL_strdup(meth->name); if (ret->name == NULL) { OPENSSL_free(ret); return NULL; } } return ret; } int RSA_meth_set1_name(RSA_METHOD *meth, const char *name) { char *tmpname; tmpname = OPENSSL_strdup(name); if (tmpname == NULL) { return 0; } OPENSSL_free((char *)meth->name); meth->name = tmpname; return 1; } int RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)) { meth->rsa_priv_enc = priv_enc; return 1; } int RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)) { meth->rsa_priv_dec = priv_dec; return 1; } int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish) (RSA *rsa)) { meth->finish = finish; return 1; } void RSA_meth_free(RSA_METHOD *meth) { if (meth != NULL) { OPENSSL_free((char *)meth->name); OPENSSL_free(meth); } } int RSA_bits(const RSA *r) { return (BN_num_bits(r->n)); } RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) { if (pkey->type != EVP_PKEY_RSA) { return NULL; } return pkey->pkey.rsa; } int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen) { /* Make sure encoding is valid */ if (i2d_X509_NAME(nm, NULL) <= 0) return 0; if (pder != NULL) *pder = (unsigned char *)nm->bytes->data; if (pderlen != NULL) *pderlen = nm->bytes->length; return 1; } #endif /* OPENSSL_VERSION_NUMBER */ %} M2Crypto-0.31.0/SWIG/_m2crypto.def0000664000175000001440000000002713165756570016720 0ustar matejusers00000000000000EXPORTS init_m2crypto M2Crypto-0.31.0/SWIG/_m2crypto.i0000664000175000001440000000430313247615013016376 0ustar matejusers00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved. * * Portions created by Open Source Applications Foundation (OSAF) are * Copyright (C) 2004-2006 OSAF. All Rights Reserved. * * Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved. * */ %module(threads=1) m2crypto /* We really don't need threadblock (PyGILState_Ensure() etc.) anywhere. Disable threadallow as well, only enable it for operations likely to block. */ %nothreadblock; %nothreadallow; #if SWIG_VERSION >= 0x030000 #define __WCHAR_MAX__ __WCHAR_MAX #define __WCHAR_MIN__ __WCHAR_MIN #endif %{ #ifdef _WIN32 #define _WINSOCKAPI_ #include #include #pragma comment(lib, "Ws2_32") typedef unsigned __int64 uint64_t; #endif %} %{ #if defined __GNUC__ && __GNUC__ < 5 #pragma GCC diagnostic ignored "-Wunused-label" #pragma GCC diagnostic warning "-Wstrict-prototypes" #endif #include #include #include <_lib.h> #include #include #include "compile.h" static PyObject *ssl_verify_cb_func; static PyObject *ssl_info_cb_func; static PyObject *ssl_set_tmp_dh_cb_func; static PyObject *ssl_set_tmp_rsa_cb_func; static PyObject *x509_store_verify_cb_func; %} %include /* Bring in STACK_OF macro definition */ #ifdef _WIN32 %include #endif %include /* Bring in LHASH_OF macro definition */ /* XXX Can't include lhash.h where LHASH_OF is defined, because it includes XXX stdio.h etc. which we fail to include. So we have to (re)define XXX LHASH_OF here instead. %include */ #if OPENSSL_VERSION_NUMBER >= 0x10000000L #define LHASH_OF(type) struct lhash_st_##type #endif %include constraints.i %include _threads.i %include _lib.i %include _bio.i %include _bn.i %include _rand.i %include _evp.i %include _aes.i %include _rc4.i %include _dh.i %include _rsa.i %include _dsa.i %include _ssl.i %include _x509.i %include _asn1.i %include _pkcs7.i %include _util.i %include _ec.i %include _engine.i %include _objects.i #ifdef SWIG_VERSION %constant int encrypt = 1; %constant int decrypt = 0; #endif M2Crypto-0.31.0/SWIG/_m2crypto_wrap.c0000644000175000001440000361677713355123234017451 0ustar matejusers00000000000000/* ---------------------------------------------------------------------------- * This file was automatically generated by SWIG (http://www.swig.org). * Version 2.0.10 * * This file is not intended to be easily readable and contains a number of * coding conventions designed to improve portability and efficiency. Do not make * changes to this file unless you know what you are doing--modify the SWIG * interface file instead. * ----------------------------------------------------------------------------- */ #define SWIGPYTHON #define SWIG_PYTHON_THREADS #define SWIG_PYTHON_DIRECTOR_NO_VTABLE #define SWIGPYTHON_BUILTIN /* ----------------------------------------------------------------------------- * This section contains generic SWIG labels for method/variable * declarations/attributes, and other compiler dependent labels. * ----------------------------------------------------------------------------- */ /* template workaround for compilers that cannot correctly implement the C++ standard */ #ifndef SWIGTEMPLATEDISAMBIGUATOR # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560) # define SWIGTEMPLATEDISAMBIGUATOR template # elif defined(__HP_aCC) /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */ /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */ # define SWIGTEMPLATEDISAMBIGUATOR template # else # define SWIGTEMPLATEDISAMBIGUATOR # endif #endif /* inline attribute */ #ifndef SWIGINLINE # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__)) # define SWIGINLINE inline # else # define SWIGINLINE # endif #endif /* attribute recognised by some compilers to avoid 'unused' warnings */ #ifndef SWIGUNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) # define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif # elif defined(__ICC) # define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif #endif #ifndef SWIG_MSC_UNSUPPRESS_4505 # if defined(_MSC_VER) # pragma warning(disable : 4505) /* unreferenced local function has been removed */ # endif #endif #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) # else # define SWIGUNUSEDPARM(p) p SWIGUNUSED # endif #endif /* internal SWIG method */ #ifndef SWIGINTERN # define SWIGINTERN static SWIGUNUSED #endif /* internal inline SWIG method */ #ifndef SWIGINTERNINLINE # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE #endif /* exporting methods */ #if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) # ifndef GCC_HASCLASSVISIBILITY # define GCC_HASCLASSVISIBILITY # endif #endif #ifndef SWIGEXPORT # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # if defined(STATIC_LINKED) # define SWIGEXPORT # else # define SWIGEXPORT __declspec(dllexport) # endif # else # if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY) # define SWIGEXPORT __attribute__ ((visibility("default"))) # else # define SWIGEXPORT # endif # endif #endif /* calling conventions for Windows */ #ifndef SWIGSTDCALL # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL # endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) # define _CRT_SECURE_NO_DEPRECATE #endif /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */ #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE) # define _SCL_SECURE_NO_DEPRECATE #endif /* Python.h has to appear first */ #include /* ----------------------------------------------------------------------------- * swigrun.swg * * This file contains generic C API SWIG runtime support for pointer * type checking. * ----------------------------------------------------------------------------- */ /* This should only be incremented when either the layout of swig_type_info changes, or for whatever reason, the runtime changes incompatibly */ #define SWIG_RUNTIME_VERSION "4" /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */ #ifdef SWIG_TYPE_TABLE # define SWIG_QUOTE_STRING(x) #x # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x) # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE) #else # define SWIG_TYPE_TABLE_NAME #endif /* You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for creating a static or dynamic library from the SWIG runtime code. In 99.9% of the cases, SWIG just needs to declare them as 'static'. But only do this if strictly necessary, ie, if you have problems with your compiler or suchlike. */ #ifndef SWIGRUNTIME # define SWIGRUNTIME SWIGINTERN #endif #ifndef SWIGRUNTIMEINLINE # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE #endif /* Generic buffer size */ #ifndef SWIG_BUFFER_SIZE # define SWIG_BUFFER_SIZE 1024 #endif /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 /* Flags/methods for returning states. The SWIG conversion methods, as ConvertPtr, return an integer that tells if the conversion was successful or not. And if not, an error code can be returned (see swigerrors.swg for the codes). Use the following macros/flags to set or process the returning states. In old versions of SWIG, code such as the following was usually written: if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) { // success code } else { //fail code } Now you can be more explicit: int res = SWIG_ConvertPtr(obj,vptr,ty.flags); if (SWIG_IsOK(res)) { // success code } else { // fail code } which is the same really, but now you can also do Type *ptr; int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags); if (SWIG_IsOK(res)) { // success code if (SWIG_IsNewObj(res) { ... delete *ptr; } else { ... } } else { // fail code } I.e., now SWIG_ConvertPtr can return new objects and you can identify the case and take care of the deallocation. Of course that also requires SWIG_ConvertPtr to return new result values, such as int SWIG_ConvertPtr(obj, ptr,...) { if () { if () { *ptr = ; return SWIG_NEWOBJ; } else { *ptr = ; return SWIG_OLDOBJ; } } else { return SWIG_BADOBJ; } } Of course, returning the plain '0(success)/-1(fail)' still works, but you can be more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the SWIG errors code. Finally, if the SWIG_CASTRANK_MODE is enabled, the result code allows to return the 'cast rank', for example, if you have this int food(double) int fooi(int); and you call food(1) // cast rank '1' (1 -> 1.0) fooi(1) // cast rank '0' just use the SWIG_AddCast()/SWIG_CheckState() */ #define SWIG_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) #define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) /* The CastRankLimit says how many bits are used for the cast rank */ #define SWIG_CASTRANKLIMIT (1 << 8) /* The NewMask denotes the object was created (using new/malloc) */ #define SWIG_NEWOBJMASK (SWIG_CASTRANKLIMIT << 1) /* The TmpMask is for in/out typemaps that use temporal objects */ #define SWIG_TMPOBJMASK (SWIG_NEWOBJMASK << 1) /* Simple returning values */ #define SWIG_BADOBJ (SWIG_ERROR) #define SWIG_OLDOBJ (SWIG_OK) #define SWIG_NEWOBJ (SWIG_OK | SWIG_NEWOBJMASK) #define SWIG_TMPOBJ (SWIG_OK | SWIG_TMPOBJMASK) /* Check, add and del mask methods */ #define SWIG_AddNewMask(r) (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r) #define SWIG_DelNewMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r) #define SWIG_IsNewObj(r) (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK)) #define SWIG_AddTmpMask(r) (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r) #define SWIG_DelTmpMask(r) (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r) #define SWIG_IsTmpObj(r) (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK)) /* Cast-Rank Mode */ #if defined(SWIG_CASTRANK_MODE) # ifndef SWIG_TypeRank # define SWIG_TypeRank unsigned long # endif # ifndef SWIG_MAXCASTRANK /* Default cast allowed */ # define SWIG_MAXCASTRANK (2) # endif # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) SWIGINTERNINLINE int SWIG_AddCast(int r) { return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r; } SWIGINTERNINLINE int SWIG_CheckState(int r) { return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0; } #else /* no cast-rank mode */ # define SWIG_AddCast(r) (r) # define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0) #endif #include #ifdef __cplusplus extern "C" { #endif typedef void *(*swig_converter_func)(void *, int *); typedef struct swig_type_info *(*swig_dycast_func)(void **); /* Structure to store information on one type */ typedef struct swig_type_info { const char *name; /* mangled name of this type */ const char *str; /* human readable name of this type */ swig_dycast_func dcast; /* dynamic cast function down a hierarchy */ struct swig_cast_info *cast; /* linked list of types that can cast into this type */ void *clientdata; /* language specific type data */ int owndata; /* flag if the structure owns the clientdata */ } swig_type_info; /* Structure to store a type and conversion function used for casting */ typedef struct swig_cast_info { swig_type_info *type; /* pointer to type that is equivalent to this type */ swig_converter_func converter; /* function to cast the void pointers */ struct swig_cast_info *next; /* pointer to next cast in linked list */ struct swig_cast_info *prev; /* pointer to the previous cast */ } swig_cast_info; /* Structure used to store module information * Each module generates one structure like this, and the runtime collects * all of these structures and stores them in a circularly linked list.*/ typedef struct swig_module_info { swig_type_info **types; /* Array of pointers to swig_type_info structures that are in this module */ size_t size; /* Number of types in this module */ struct swig_module_info *next; /* Pointer to next element in circularly linked list */ swig_type_info **type_initial; /* Array of initially generated type structures */ swig_cast_info **cast_initial; /* Array of initially generated casting structures */ void *clientdata; /* Language specific module data */ } swig_module_info; /* Compare two type names skipping the space characters, therefore "char*" == "char *" and "Class" == "Class", etc. Return 0 when the two name types are equivalent, as in strncmp, but skipping ' '. */ SWIGRUNTIME int SWIG_TypeNameComp(const char *f1, const char *l1, const char *f2, const char *l2) { for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) { while ((*f1 == ' ') && (f1 != l1)) ++f1; while ((*f2 == ' ') && (f2 != l2)) ++f2; if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1; } return (int)((l1 - f1) - (l2 - f2)); } /* Check type equivalence in a name list like ||... Return 0 if equal, -1 if nb < tb, 1 if nb > tb */ SWIGRUNTIME int SWIG_TypeCmp(const char *nb, const char *tb) { int equiv = 1; const char* te = tb + strlen(tb); const char* ne = nb; while (equiv != 0 && *ne) { for (nb = ne; *ne; ++ne) { if (*ne == '|') break; } equiv = SWIG_TypeNameComp(nb, ne, tb, te); if (*ne) ++ne; } return equiv; } /* Check type equivalence in a name list like ||... Return 0 if not equal, 1 if equal */ SWIGRUNTIME int SWIG_TypeEquiv(const char *nb, const char *tb) { return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0; } /* Check the typename */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheck(const char *c, swig_type_info *ty) { if (ty) { swig_cast_info *iter = ty->cast; while (iter) { if (strcmp(iter->type->name, c) == 0) { if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ iter->prev->next = iter->next; if (iter->next) iter->next->prev = iter->prev; iter->next = ty->cast; iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; return iter; } iter = iter->next; } } return 0; } /* Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison */ SWIGRUNTIME swig_cast_info * SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) { if (ty) { swig_cast_info *iter = ty->cast; while (iter) { if (iter->type == from) { if (iter == ty->cast) return iter; /* Move iter to the top of the linked list */ iter->prev->next = iter->next; if (iter->next) iter->next->prev = iter->prev; iter->next = ty->cast; iter->prev = 0; if (ty->cast) ty->cast->prev = iter; ty->cast = iter; return iter; } iter = iter->next; } } return 0; } /* Cast a pointer up an inheritance hierarchy */ SWIGRUNTIMEINLINE void * SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) { return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory); } /* Dynamic pointer casting. Down an inheritance hierarchy */ SWIGRUNTIME swig_type_info * SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) { swig_type_info *lastty = ty; if (!ty || !ty->dcast) return ty; while (ty && (ty->dcast)) { ty = (*ty->dcast)(ptr); if (ty) lastty = ty; } return lastty; } /* Return the name associated with this type */ SWIGRUNTIMEINLINE const char * SWIG_TypeName(const swig_type_info *ty) { return ty->name; } /* Return the pretty name associated with this type, that is an unmangled type name in a form presentable to the user. */ SWIGRUNTIME const char * SWIG_TypePrettyName(const swig_type_info *type) { /* The "str" field contains the equivalent pretty names of the type, separated by vertical-bar characters. We choose to print the last name, as it is often (?) the most specific. */ if (!type) return NULL; if (type->str != NULL) { const char *last_name = type->str; const char *s; for (s = type->str; *s; s++) if (*s == '|') last_name = s+1; return last_name; } else return type->name; } /* Set the clientdata field for a type */ SWIGRUNTIME void SWIG_TypeClientData(swig_type_info *ti, void *clientdata) { swig_cast_info *cast = ti->cast; /* if (ti->clientdata == clientdata) return; */ ti->clientdata = clientdata; while (cast) { if (!cast->converter) { swig_type_info *tc = cast->type; if (!tc->clientdata) { SWIG_TypeClientData(tc, clientdata); } } cast = cast->next; } } SWIGRUNTIME void SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) { SWIG_TypeClientData(ti, clientdata); ti->owndata = 1; } /* Search for a swig_type_info structure only by mangled name Search is a O(log #types) We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * SWIG_MangledTypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name) { swig_module_info *iter = start; do { if (iter->size) { register size_t l = 0; register size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ register size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { register int compare = strcmp(name, iname); if (compare == 0) { return iter->types[i]; } else if (compare < 0) { if (i) { r = i - 1; } else { break; } } else if (compare > 0) { l = i + 1; } } else { break; /* should never happen */ } } while (l <= r); } iter = iter->next; } while (iter != end); return 0; } /* Search for a swig_type_info structure for either a mangled name or a human readable name. It first searches the mangled names of the types, which is a O(log #types) If a type is not found it then searches the human readable names, which is O(#types). We start searching at module start, and finish searching when start == end. Note: if start == end at the beginning of the function, we go all the way around the circular list. */ SWIGRUNTIME swig_type_info * SWIG_TypeQueryModule(swig_module_info *start, swig_module_info *end, const char *name) { /* STEP 1: Search the name field using binary search */ swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name); if (ret) { return ret; } else { /* STEP 2: If the type hasn't been found, do a complete search of the str field (the human readable name) */ swig_module_info *iter = start; do { register size_t i = 0; for (; i < iter->size; ++i) { if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name))) return iter->types[i]; } iter = iter->next; } while (iter != end); } /* neither found a match */ return 0; } /* Pack binary data into a string */ SWIGRUNTIME char * SWIG_PackData(char *c, void *ptr, size_t sz) { static const char hex[17] = "0123456789abcdef"; register const unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register unsigned char uu = *u; *(c++) = hex[(uu & 0xf0) >> 4]; *(c++) = hex[uu & 0xf]; } return c; } /* Unpack binary data from a string */ SWIGRUNTIME const char * SWIG_UnpackData(const char *c, void *ptr, size_t sz) { register unsigned char *u = (unsigned char *) ptr; register const unsigned char *eu = u + sz; for (; u != eu; ++u) { register char d = *(c++); register unsigned char uu; if ((d >= '0') && (d <= '9')) uu = ((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) uu = ((d - ('a'-10)) << 4); else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) uu |= (d - '0'); else if ((d >= 'a') && (d <= 'f')) uu |= (d - ('a'-10)); else return (char *) 0; *u = uu; } return c; } /* Pack 'void *' into a string buffer. */ SWIGRUNTIME char * SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) { char *r = buff; if ((2*sizeof(void *) + 2) > bsz) return 0; *(r++) = '_'; r = SWIG_PackData(r,&ptr,sizeof(void *)); if (strlen(name) + 1 > (bsz - (r - buff))) return 0; strcpy(r,name); return buff; } SWIGRUNTIME const char * SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) { if (*c != '_') { if (strcmp(c,"NULL") == 0) { *ptr = (void *) 0; return name; } else { return 0; } } return SWIG_UnpackData(++c,ptr,sizeof(void *)); } SWIGRUNTIME char * SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) { char *r = buff; size_t lname = (name ? strlen(name) : 0); if ((2*sz + 2 + lname) > bsz) return 0; *(r++) = '_'; r = SWIG_PackData(r,ptr,sz); if (lname) { strncpy(r,name,lname+1); } else { *r = 0; } return buff; } SWIGRUNTIME const char * SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { if (*c != '_') { if (strcmp(c,"NULL") == 0) { memset(ptr,0,sz); return name; } else { return 0; } } return SWIG_UnpackData(++c,ptr,sz); } #ifdef __cplusplus } #endif /* Errors in SWIG */ #define SWIG_UnknownError -1 #define SWIG_IOError -2 #define SWIG_RuntimeError -3 #define SWIG_IndexError -4 #define SWIG_TypeError -5 #define SWIG_DivisionByZero -6 #define SWIG_OverflowError -7 #define SWIG_SyntaxError -8 #define SWIG_ValueError -9 #define SWIG_SystemError -10 #define SWIG_AttributeError -11 #define SWIG_MemoryError -12 #define SWIG_NullReferenceError -13 /* Compatibility macros for Python 3 */ #if PY_VERSION_HEX >= 0x03000000 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type) #define PyInt_Check(x) PyLong_Check(x) #define PyInt_AsLong(x) PyLong_AsLong(x) #define PyInt_FromLong(x) PyLong_FromLong(x) #define PyInt_FromSize_t(x) PyLong_FromSize_t(x) #define PyString_Check(name) PyBytes_Check(name) #define PyString_FromString(x) PyUnicode_FromString(x) #define PyString_Format(fmt, args) PyUnicode_Format(fmt, args) #define PyString_AsString(str) PyBytes_AsString(str) #define PyString_Size(str) PyBytes_Size(str) #define PyString_InternFromString(key) PyUnicode_InternFromString(key) #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x) #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x) #endif #ifndef Py_TYPE # define Py_TYPE(op) ((op)->ob_type) #endif /* SWIG APIs for compatibility of both Python 2 & 3 */ #if PY_VERSION_HEX >= 0x03000000 # define SWIG_Python_str_FromFormat PyUnicode_FromFormat #else # define SWIG_Python_str_FromFormat PyString_FromFormat #endif /* Warning: This function will allocate a new string in Python 3, * so please call SWIG_Python_str_DelForPy3(x) to free the space. */ SWIGINTERN char* SWIG_Python_str_AsChar(PyObject *str) { #if PY_VERSION_HEX >= 0x03000000 char *cstr; char *newstr; Py_ssize_t len; str = PyUnicode_AsUTF8String(str); PyBytes_AsStringAndSize(str, &cstr, &len); newstr = (char *) malloc(len+1); memcpy(newstr, cstr, len+1); Py_XDECREF(str); return newstr; #else return PyString_AsString(str); #endif } #if PY_VERSION_HEX >= 0x03000000 # define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) #else # define SWIG_Python_str_DelForPy3(x) #endif SWIGINTERN PyObject* SWIG_Python_str_FromChar(const char *c) { #if PY_VERSION_HEX >= 0x03000000 return PyUnicode_FromString(c); #else return PyString_FromString(c); #endif } /* Add PyOS_snprintf for old Pythons */ #if PY_VERSION_HEX < 0x02020000 # if defined(_MSC_VER) || defined(__BORLANDC__) || defined(_WATCOM) # define PyOS_snprintf _snprintf # else # define PyOS_snprintf snprintf # endif #endif /* A crude PyString_FromFormat implementation for old Pythons */ #if PY_VERSION_HEX < 0x02020000 #ifndef SWIG_PYBUFFER_SIZE # define SWIG_PYBUFFER_SIZE 1024 #endif static PyObject * PyString_FromFormat(const char *fmt, ...) { va_list ap; char buf[SWIG_PYBUFFER_SIZE * 2]; int res; va_start(ap, fmt); res = vsnprintf(buf, sizeof(buf), fmt, ap); va_end(ap); return (res < 0 || res >= (int)sizeof(buf)) ? 0 : PyString_FromString(buf); } #endif /* Add PyObject_Del for old Pythons */ #if PY_VERSION_HEX < 0x01060000 # define PyObject_Del(op) PyMem_DEL((op)) #endif #ifndef PyObject_DEL # define PyObject_DEL PyObject_Del #endif /* A crude PyExc_StopIteration exception for old Pythons */ #if PY_VERSION_HEX < 0x02020000 # ifndef PyExc_StopIteration # define PyExc_StopIteration PyExc_RuntimeError # endif # ifndef PyObject_GenericGetAttr # define PyObject_GenericGetAttr 0 # endif #endif /* Py_NotImplemented is defined in 2.1 and up. */ #if PY_VERSION_HEX < 0x02010000 # ifndef Py_NotImplemented # define Py_NotImplemented PyExc_RuntimeError # endif #endif /* A crude PyString_AsStringAndSize implementation for old Pythons */ #if PY_VERSION_HEX < 0x02010000 # ifndef PyString_AsStringAndSize # define PyString_AsStringAndSize(obj, s, len) {*s = PyString_AsString(obj); *len = *s ? strlen(*s) : 0;} # endif #endif /* PySequence_Size for old Pythons */ #if PY_VERSION_HEX < 0x02000000 # ifndef PySequence_Size # define PySequence_Size PySequence_Length # endif #endif /* PyBool_FromLong for old Pythons */ #if PY_VERSION_HEX < 0x02030000 static PyObject *PyBool_FromLong(long ok) { PyObject *result = ok ? Py_True : Py_False; Py_INCREF(result); return result; } #endif /* Py_ssize_t for old Pythons */ /* This code is as recommended by: */ /* http://www.python.org/dev/peps/pep-0353/#conversion-guidelines */ #if PY_VERSION_HEX < 0x02050000 && !defined(PY_SSIZE_T_MIN) typedef int Py_ssize_t; # define PY_SSIZE_T_MAX INT_MAX # define PY_SSIZE_T_MIN INT_MIN typedef inquiry lenfunc; typedef intargfunc ssizeargfunc; typedef intintargfunc ssizessizeargfunc; typedef intobjargproc ssizeobjargproc; typedef intintobjargproc ssizessizeobjargproc; typedef getreadbufferproc readbufferproc; typedef getwritebufferproc writebufferproc; typedef getsegcountproc segcountproc; typedef getcharbufferproc charbufferproc; static long PyNumber_AsSsize_t (PyObject *x, void *SWIGUNUSEDPARM(exc)) { long result = 0; PyObject *i = PyNumber_Int(x); if (i) { result = PyInt_AsLong(i); Py_DECREF(i); } return result; } #endif #if PY_VERSION_HEX < 0x02050000 #define PyInt_FromSize_t(x) PyInt_FromLong((long)x) #endif #if PY_VERSION_HEX < 0x02040000 #define Py_VISIT(op) \ do { \ if (op) { \ int vret = visit((op), arg); \ if (vret) \ return vret; \ } \ } while (0) #endif #if PY_VERSION_HEX < 0x02030000 typedef struct { PyTypeObject type; PyNumberMethods as_number; PyMappingMethods as_mapping; PySequenceMethods as_sequence; PyBufferProcs as_buffer; PyObject *name, *slots; } PyHeapTypeObject; #endif #if PY_VERSION_HEX < 0x02030000 typedef destructor freefunc; #endif #if ((PY_MAJOR_VERSION == 2 && PY_MINOR_VERSION > 6) || \ (PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 0) || \ (PY_MAJOR_VERSION > 3)) # define SWIGPY_USE_CAPSULE # define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) #endif #if PY_VERSION_HEX < 0x03020000 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) #endif /* ----------------------------------------------------------------------------- * error manipulation * ----------------------------------------------------------------------------- */ SWIGRUNTIME PyObject* SWIG_Python_ErrorType(int code) { PyObject* type = 0; switch(code) { case SWIG_MemoryError: type = PyExc_MemoryError; break; case SWIG_IOError: type = PyExc_IOError; break; case SWIG_RuntimeError: type = PyExc_RuntimeError; break; case SWIG_IndexError: type = PyExc_IndexError; break; case SWIG_TypeError: type = PyExc_TypeError; break; case SWIG_DivisionByZero: type = PyExc_ZeroDivisionError; break; case SWIG_OverflowError: type = PyExc_OverflowError; break; case SWIG_SyntaxError: type = PyExc_SyntaxError; break; case SWIG_ValueError: type = PyExc_ValueError; break; case SWIG_SystemError: type = PyExc_SystemError; break; case SWIG_AttributeError: type = PyExc_AttributeError; break; default: type = PyExc_RuntimeError; } return type; } SWIGRUNTIME void SWIG_Python_AddErrorMsg(const char* mesg) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); if (value) { char *tmp; PyObject *old_str = PyObject_Str(value); PyErr_Clear(); Py_XINCREF(type); PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); } else { PyErr_SetString(PyExc_RuntimeError, mesg); } } #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS # endif #endif #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */ # if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL) # if (PY_VERSION_HEX >= 0x02030000) /* For 2.3 or later, use the PyGILState calls */ # define SWIG_PYTHON_USE_GIL # endif # endif # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ # ifndef SWIG_PYTHON_INITIALIZE_THREADS # define SWIG_PYTHON_INITIALIZE_THREADS PyEval_InitThreads() # endif # ifdef __cplusplus /* C++ code */ class SWIG_Python_Thread_Block { bool status; PyGILState_STATE state; public: void end() { if (status) { PyGILState_Release(state); status = false;} } SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {} ~SWIG_Python_Thread_Block() { end(); } }; class SWIG_Python_Thread_Allow { bool status; PyThreadState *save; public: void end() { if (status) { PyEval_RestoreThread(save); status = false; }} SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {} ~SWIG_Python_Thread_Allow() { end(); } }; # define SWIG_PYTHON_THREAD_BEGIN_BLOCK SWIG_Python_Thread_Block _swig_thread_block # define SWIG_PYTHON_THREAD_END_BLOCK _swig_thread_block.end() # define SWIG_PYTHON_THREAD_BEGIN_ALLOW SWIG_Python_Thread_Allow _swig_thread_allow # define SWIG_PYTHON_THREAD_END_ALLOW _swig_thread_allow.end() # else /* C code */ # define SWIG_PYTHON_THREAD_BEGIN_BLOCK PyGILState_STATE _swig_thread_block = PyGILState_Ensure() # define SWIG_PYTHON_THREAD_END_BLOCK PyGILState_Release(_swig_thread_block) # define SWIG_PYTHON_THREAD_BEGIN_ALLOW PyThreadState *_swig_thread_allow = PyEval_SaveThread() # define SWIG_PYTHON_THREAD_END_ALLOW PyEval_RestoreThread(_swig_thread_allow) # endif # else /* Old thread way, not implemented, user must provide it */ # if !defined(SWIG_PYTHON_INITIALIZE_THREADS) # define SWIG_PYTHON_INITIALIZE_THREADS # endif # if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK) # define SWIG_PYTHON_THREAD_BEGIN_BLOCK # endif # if !defined(SWIG_PYTHON_THREAD_END_BLOCK) # define SWIG_PYTHON_THREAD_END_BLOCK # endif # if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW) # define SWIG_PYTHON_THREAD_BEGIN_ALLOW # endif # if !defined(SWIG_PYTHON_THREAD_END_ALLOW) # define SWIG_PYTHON_THREAD_END_ALLOW # endif # endif #else /* No thread support */ # define SWIG_PYTHON_INITIALIZE_THREADS # define SWIG_PYTHON_THREAD_BEGIN_BLOCK # define SWIG_PYTHON_THREAD_END_BLOCK # define SWIG_PYTHON_THREAD_BEGIN_ALLOW # define SWIG_PYTHON_THREAD_END_ALLOW #endif /* ----------------------------------------------------------------------------- * Python API portion that goes into the runtime * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #endif /* ----------------------------------------------------------------------------- * Constant declarations * ----------------------------------------------------------------------------- */ /* Constant Types */ #define SWIG_PY_POINTER 4 #define SWIG_PY_BINARY 5 /* Constant information structure */ typedef struct swig_const_info { int type; char *name; long lvalue; double dvalue; void *pvalue; swig_type_info **ptype; } swig_const_info; /* ----------------------------------------------------------------------------- * Wrapper of PyInstanceMethod_New() used in Python 3 * It is exported to the generated module, used for -fastproxy * ----------------------------------------------------------------------------- */ #if PY_VERSION_HEX >= 0x03000000 SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { return PyInstanceMethod_New(func); } #else SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *SWIGUNUSEDPARM(func)) { return NULL; } #endif #ifdef __cplusplus } #endif /* ----------------------------------------------------------------------------- * pyrun.swg * * This file contains the runtime support for Python modules * and includes code for managing global variables and pointer * type checking. * * ----------------------------------------------------------------------------- */ /* Common SWIG API */ /* for raw pointers */ #define SWIG_Python_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0) #define SWIG_ConvertPtr(obj, pptr, type, flags) SWIG_Python_ConvertPtr(obj, pptr, type, flags) #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own) SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own) #ifdef SWIGPYTHON_BUILTIN #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(self, ptr, type, flags) #else #define SWIG_NewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) #endif #define SWIG_InternalNewPointerObj(ptr, type, flags) SWIG_Python_NewPointerObj(NULL, ptr, type, flags) #define SWIG_CheckImplicit(ty) SWIG_Python_CheckImplicit(ty) #define SWIG_AcquirePtr(ptr, src) SWIG_Python_AcquirePtr(ptr, src) #define swig_owntype int /* for raw packed data */ #define SWIG_ConvertPacked(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) #define SWIG_NewPackedObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) /* for class or struct pointers */ #define SWIG_ConvertInstance(obj, pptr, type, flags) SWIG_ConvertPtr(obj, pptr, type, flags) #define SWIG_NewInstanceObj(ptr, type, flags) SWIG_NewPointerObj(ptr, type, flags) /* for C or C++ function pointers */ #define SWIG_ConvertFunctionPtr(obj, pptr, type) SWIG_Python_ConvertFunctionPtr(obj, pptr, type) #define SWIG_NewFunctionPtrObj(ptr, type) SWIG_Python_NewPointerObj(NULL, ptr, type, 0) /* for C++ member pointers, ie, member methods */ #define SWIG_ConvertMember(obj, ptr, sz, ty) SWIG_Python_ConvertPacked(obj, ptr, sz, ty) #define SWIG_NewMemberObj(ptr, sz, type) SWIG_Python_NewPackedObj(ptr, sz, type) /* Runtime API */ #define SWIG_GetModule(clientdata) SWIG_Python_GetModule(clientdata) #define SWIG_SetModule(clientdata, pointer) SWIG_Python_SetModule(pointer) #define SWIG_NewClientData(obj) SwigPyClientData_New(obj) #define SWIG_SetErrorObj SWIG_Python_SetErrorObj #define SWIG_SetErrorMsg SWIG_Python_SetErrorMsg #define SWIG_ErrorType(code) SWIG_Python_ErrorType(code) #define SWIG_Error(code, msg) SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg) #define SWIG_fail goto fail /* Runtime API implementation */ /* Error manipulation */ SWIGINTERN void SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) { SWIG_PYTHON_THREAD_BEGIN_BLOCK; PyErr_SetObject(errtype, obj); Py_DECREF(obj); SWIG_PYTHON_THREAD_END_BLOCK; } SWIGINTERN void SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) { SWIG_PYTHON_THREAD_BEGIN_BLOCK; PyErr_SetString(errtype, msg); SWIG_PYTHON_THREAD_END_BLOCK; } #define SWIG_Python_Raise(obj, type, desc) SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj) /* Set a constant value */ #if defined(SWIGPYTHON_BUILTIN) SWIGINTERN void SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { PyObject *s = PyString_InternFromString(key); PyList_Append(seq, s); Py_DECREF(s); } SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) { #if PY_VERSION_HEX < 0x02030000 PyDict_SetItemString(d, (char *)name, obj); #else PyDict_SetItemString(d, name, obj); #endif Py_DECREF(obj); if (public_interface) SwigPyBuiltin_AddPublicSymbol(public_interface, name); } #else SWIGINTERN void SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) { #if PY_VERSION_HEX < 0x02030000 PyDict_SetItemString(d, (char *)name, obj); #else PyDict_SetItemString(d, name, obj); #endif Py_DECREF(obj); } #endif /* Append a value to the result obj */ SWIGINTERN PyObject* SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) { #if !defined(SWIG_PYTHON_OUTPUT_TUPLE) if (!result) { result = obj; } else if (result == Py_None) { Py_DECREF(result); result = obj; } else { if (!PyList_Check(result)) { PyObject *o2 = result; result = PyList_New(1); PyList_SetItem(result, 0, o2); } PyList_Append(result,obj); Py_DECREF(obj); } return result; #else PyObject* o2; PyObject* o3; if (!result) { result = obj; } else if (result == Py_None) { Py_DECREF(result); result = obj; } else { if (!PyTuple_Check(result)) { o2 = result; result = PyTuple_New(1); PyTuple_SET_ITEM(result, 0, o2); } o3 = PyTuple_New(1); PyTuple_SET_ITEM(o3, 0, obj); o2 = result; result = PySequence_Concat(o2, o3); Py_DECREF(o2); Py_DECREF(o3); } return result; #endif } /* Unpack the argument tuple */ SWIGINTERN int SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) { if (!args) { if (!min && !max) { return 1; } else { PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none", name, (min == max ? "" : "at least "), (int)min); return 0; } } if (!PyTuple_Check(args)) { if (min <= 1 && max >= 1) { register int i; objs[0] = args; for (i = 1; i < max; ++i) { objs[i] = 0; } return 2; } PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); return 0; } else { register Py_ssize_t l = PyTuple_GET_SIZE(args); if (l < min) { PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", name, (min == max ? "" : "at least "), (int)min, (int)l); return 0; } else if (l > max) { PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d", name, (min == max ? "" : "at most "), (int)max, (int)l); return 0; } else { register int i; for (i = 0; i < l; ++i) { objs[i] = PyTuple_GET_ITEM(args, i); } for (; l < max; ++l) { objs[l] = 0; } return i + 1; } } } /* A functor is a function object with one single object argument */ #if PY_VERSION_HEX >= 0x02020000 #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunctionObjArgs(functor, obj, NULL); #else #define SWIG_Python_CallFunctor(functor, obj) PyObject_CallFunction(functor, "O", obj); #endif /* Helper for static pointer initialization for both C and C++ code, for example static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...); */ #ifdef __cplusplus #define SWIG_STATIC_POINTER(var) var #else #define SWIG_STATIC_POINTER(var) var = 0; if (!var) var #endif /* ----------------------------------------------------------------------------- * Pointer declarations * ----------------------------------------------------------------------------- */ /* Flags for new pointer objects */ #define SWIG_POINTER_NOSHADOW (SWIG_POINTER_OWN << 1) #define SWIG_POINTER_NEW (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN) #define SWIG_POINTER_IMPLICIT_CONV (SWIG_POINTER_DISOWN << 1) #define SWIG_BUILTIN_TP_INIT (SWIG_POINTER_OWN << 2) #define SWIG_BUILTIN_INIT (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN) #ifdef __cplusplus extern "C" { #endif /* How to access Py_None */ #if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__) # ifndef SWIG_PYTHON_NO_BUILD_NONE # ifndef SWIG_PYTHON_BUILD_NONE # define SWIG_PYTHON_BUILD_NONE # endif # endif #endif #ifdef SWIG_PYTHON_BUILD_NONE # ifdef Py_None # undef Py_None # define Py_None SWIG_Py_None() # endif SWIGRUNTIMEINLINE PyObject * _SWIG_Py_None(void) { PyObject *none = Py_BuildValue((char*)""); Py_DECREF(none); return none; } SWIGRUNTIME PyObject * SWIG_Py_None(void) { static PyObject *SWIG_STATIC_POINTER(none) = _SWIG_Py_None(); return none; } #endif /* The python void return value */ SWIGRUNTIMEINLINE PyObject * SWIG_Py_Void(void) { PyObject *none = Py_None; Py_INCREF(none); return none; } /* SwigPyClientData */ typedef struct { PyObject *klass; PyObject *newraw; PyObject *newargs; PyObject *destroy; int delargs; int implicitconv; PyTypeObject *pytype; } SwigPyClientData; SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; return data ? data->implicitconv : 0; } SWIGRUNTIMEINLINE PyObject * SWIG_Python_ExceptionType(swig_type_info *desc) { SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0; PyObject *klass = data ? data->klass : 0; return (klass ? klass : PyExc_RuntimeError); } SWIGRUNTIME SwigPyClientData * SwigPyClientData_New(PyObject* obj) { if (!obj) { return 0; } else { SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData)); /* the klass element */ data->klass = obj; Py_INCREF(data->klass); /* the newraw method and newargs arguments used to create a new raw instance */ if (PyClass_Check(obj)) { data->newraw = 0; data->newargs = obj; Py_INCREF(obj); } else { #if (PY_VERSION_HEX < 0x02020000) data->newraw = 0; #else data->newraw = PyObject_GetAttrString(data->klass, (char *)"__new__"); #endif if (data->newraw) { Py_INCREF(data->newraw); data->newargs = PyTuple_New(1); PyTuple_SetItem(data->newargs, 0, obj); } else { data->newargs = obj; } Py_INCREF(data->newargs); } /* the destroy method, aka as the C++ delete method */ data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); if (PyErr_Occurred()) { PyErr_Clear(); data->destroy = 0; } if (data->destroy) { int flags; Py_INCREF(data->destroy); flags = PyCFunction_GET_FLAGS(data->destroy); #ifdef METH_O data->delargs = !(flags & (METH_O)); #else data->delargs = 0; #endif } else { data->delargs = 0; } data->implicitconv = 0; data->pytype = 0; return data; } } SWIGRUNTIME void SwigPyClientData_Del(SwigPyClientData *data) { Py_XDECREF(data->newraw); Py_XDECREF(data->newargs); Py_XDECREF(data->destroy); } /* =============== SwigPyObject =====================*/ typedef struct { PyObject_HEAD void *ptr; swig_type_info *ty; int own; PyObject *next; #ifdef SWIGPYTHON_BUILTIN PyObject *dict; #endif } SwigPyObject; SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v) { return PyLong_FromVoidPtr(v->ptr); } SWIGRUNTIME PyObject * SwigPyObject_format(const char* fmt, SwigPyObject *v) { PyObject *res = NULL; PyObject *args = PyTuple_New(1); if (args) { if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) { PyObject *ofmt = SWIG_Python_str_FromChar(fmt); if (ofmt) { #if PY_VERSION_HEX >= 0x03000000 res = PyUnicode_Format(ofmt,args); #else res = PyString_Format(ofmt,args); #endif Py_DECREF(ofmt); } Py_DECREF(args); } } return res; } SWIGRUNTIME PyObject * SwigPyObject_oct(SwigPyObject *v) { return SwigPyObject_format("%o",v); } SWIGRUNTIME PyObject * SwigPyObject_hex(SwigPyObject *v) { return SwigPyObject_format("%x",v); } SWIGRUNTIME PyObject * #ifdef METH_NOARGS SwigPyObject_repr(SwigPyObject *v) #else SwigPyObject_repr(SwigPyObject *v, PyObject *args) #endif { const char *name = SWIG_TypePrettyName(v->ty); PyObject *repr = SWIG_Python_str_FromFormat("", (name ? name : "unknown"), (void *)v); if (v->next) { # ifdef METH_NOARGS PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next); # else PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next, args); # endif # if PY_VERSION_HEX >= 0x03000000 PyObject *joined = PyUnicode_Concat(repr, nrep); Py_DecRef(repr); Py_DecRef(nrep); repr = joined; # else PyString_ConcatAndDel(&repr,nrep); # endif } return repr; } SWIGRUNTIME int SwigPyObject_print(SwigPyObject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char *str; #ifdef METH_NOARGS PyObject *repr = SwigPyObject_repr(v); #else PyObject *repr = SwigPyObject_repr(v, NULL); #endif if (repr) { str = SWIG_Python_str_AsChar(repr); fputs(str, fp); SWIG_Python_str_DelForPy3(str); Py_DECREF(repr); return 0; } else { return 1; } } SWIGRUNTIME PyObject * SwigPyObject_str(SwigPyObject *v) { char result[SWIG_BUFFER_SIZE]; return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? SWIG_Python_str_FromChar(result) : 0; } SWIGRUNTIME int SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w) { void *i = v->ptr; void *j = w->ptr; return (i < j) ? -1 : ((i > j) ? 1 : 0); } /* Added for Python 3.x, would it also be useful for Python 2.x? */ SWIGRUNTIME PyObject* SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op) { PyObject* res; if( op != Py_EQ && op != Py_NE ) { Py_INCREF(Py_NotImplemented); return Py_NotImplemented; } res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0); return res; } SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void); #ifdef SWIGPYTHON_BUILTIN static swig_type_info *SwigPyObject_stype = 0; SWIGRUNTIME PyTypeObject* SwigPyObject_type(void) { SwigPyClientData *cd; assert(SwigPyObject_stype); cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; assert(cd); assert(cd->pytype); return cd->pytype; } #else SWIGRUNTIME PyTypeObject* SwigPyObject_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce(); return type; } #endif SWIGRUNTIMEINLINE int SwigPyObject_Check(PyObject *op) { #ifdef SWIGPYTHON_BUILTIN PyTypeObject *target_tp = SwigPyObject_type(); if (PyType_IsSubtype(op->ob_type, target_tp)) return 1; return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0); #else return (Py_TYPE(op) == SwigPyObject_type()) || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0); #endif } SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own); SWIGRUNTIME void SwigPyObject_dealloc(PyObject *v) { SwigPyObject *sobj = (SwigPyObject *) v; PyObject *next = sobj->next; if (sobj->own == SWIG_POINTER_OWN) { swig_type_info *ty = sobj->ty; SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; PyObject *destroy = data ? data->destroy : 0; if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; if (data->delargs) { /* we need to create a temporary object to carry the destroy operation */ PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0); res = SWIG_Python_CallFunctor(destroy, tmp); Py_DECREF(tmp); } else { PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); PyObject *mself = PyCFunction_GET_SELF(destroy); res = ((*meth)(mself, v)); } Py_XDECREF(res); } #if !defined(SWIG_PYTHON_SILENT_MEMLEAK) else { const char *name = SWIG_TypePrettyName(ty); printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown")); } #endif } Py_XDECREF(next); PyObject_DEL(v); } SWIGRUNTIME PyObject* SwigPyObject_append(PyObject* v, PyObject* next) { SwigPyObject *sobj = (SwigPyObject *) v; #ifndef METH_O PyObject *tmp = 0; if (!PyArg_ParseTuple(next,(char *)"O:append", &tmp)) return NULL; next = tmp; #endif if (!SwigPyObject_Check(next)) { return NULL; } sobj->next = next; Py_INCREF(next); return SWIG_Py_Void(); } SWIGRUNTIME PyObject* #ifdef METH_NOARGS SwigPyObject_next(PyObject* v) #else SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { SwigPyObject *sobj = (SwigPyObject *) v; if (sobj->next) { Py_INCREF(sobj->next); return sobj->next; } else { return SWIG_Py_Void(); } } SWIGINTERN PyObject* #ifdef METH_NOARGS SwigPyObject_disown(PyObject *v) #else SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = 0; return SWIG_Py_Void(); } SWIGINTERN PyObject* #ifdef METH_NOARGS SwigPyObject_acquire(PyObject *v) #else SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) #endif { SwigPyObject *sobj = (SwigPyObject *)v; sobj->own = SWIG_POINTER_OWN; return SWIG_Py_Void(); } SWIGINTERN PyObject* SwigPyObject_own(PyObject *v, PyObject *args) { PyObject *val = 0; #if (PY_VERSION_HEX < 0x02020000) if (!PyArg_ParseTuple(args,(char *)"|O:own",&val)) #elif (PY_VERSION_HEX < 0x02050000) if (!PyArg_UnpackTuple(args, (char *)"own", 0, 1, &val)) #else if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) #endif { return NULL; } else { SwigPyObject *sobj = (SwigPyObject *)v; PyObject *obj = PyBool_FromLong(sobj->own); if (val) { #ifdef METH_NOARGS if (PyObject_IsTrue(val)) { SwigPyObject_acquire(v); } else { SwigPyObject_disown(v); } #else if (PyObject_IsTrue(val)) { SwigPyObject_acquire(v,args); } else { SwigPyObject_disown(v,args); } #endif } return obj; } } #ifdef METH_O static PyMethodDef swigobject_methods[] = { {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_NOARGS, (char *)"releases ownership of the pointer"}, {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_NOARGS, (char *)"acquires ownership of the pointer"}, {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, {(char *)"append", (PyCFunction)SwigPyObject_append, METH_O, (char *)"appends another 'this' object"}, {(char *)"next", (PyCFunction)SwigPyObject_next, METH_NOARGS, (char *)"returns the next 'this' object"}, {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_NOARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #else static PyMethodDef swigobject_methods[] = { {(char *)"disown", (PyCFunction)SwigPyObject_disown, METH_VARARGS, (char *)"releases ownership of the pointer"}, {(char *)"acquire", (PyCFunction)SwigPyObject_acquire, METH_VARARGS, (char *)"aquires ownership of the pointer"}, {(char *)"own", (PyCFunction)SwigPyObject_own, METH_VARARGS, (char *)"returns/sets ownership of the pointer"}, {(char *)"append", (PyCFunction)SwigPyObject_append, METH_VARARGS, (char *)"appends another 'this' object"}, {(char *)"next", (PyCFunction)SwigPyObject_next, METH_VARARGS, (char *)"returns the next 'this' object"}, {(char *)"__repr__",(PyCFunction)SwigPyObject_repr, METH_VARARGS, (char *)"returns object representation"}, {0, 0, 0, 0} }; #endif #if PY_VERSION_HEX < 0x02020000 SWIGINTERN PyObject * SwigPyObject_getattr(SwigPyObject *sobj,char *name) { return Py_FindMethod(swigobject_methods, (PyObject *)sobj, name); } #endif SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void) { static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer"; static PyNumberMethods SwigPyObject_as_number = { (binaryfunc)0, /*nb_add*/ (binaryfunc)0, /*nb_subtract*/ (binaryfunc)0, /*nb_multiply*/ /* nb_divide removed in Python 3 */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc)0, /*nb_divide*/ #endif (binaryfunc)0, /*nb_remainder*/ (binaryfunc)0, /*nb_divmod*/ (ternaryfunc)0,/*nb_power*/ (unaryfunc)0, /*nb_negative*/ (unaryfunc)0, /*nb_positive*/ (unaryfunc)0, /*nb_absolute*/ (inquiry)0, /*nb_nonzero*/ 0, /*nb_invert*/ 0, /*nb_lshift*/ 0, /*nb_rshift*/ 0, /*nb_and*/ 0, /*nb_xor*/ 0, /*nb_or*/ #if PY_VERSION_HEX < 0x03000000 0, /*nb_coerce*/ #endif (unaryfunc)SwigPyObject_long, /*nb_int*/ #if PY_VERSION_HEX < 0x03000000 (unaryfunc)SwigPyObject_long, /*nb_long*/ #else 0, /*nb_reserved*/ #endif (unaryfunc)0, /*nb_float*/ #if PY_VERSION_HEX < 0x03000000 (unaryfunc)SwigPyObject_oct, /*nb_oct*/ (unaryfunc)SwigPyObject_hex, /*nb_hex*/ #endif #if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */ #elif PY_VERSION_HEX >= 0x02050000 /* 2.5.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */ #elif PY_VERSION_HEX >= 0x02020000 /* 2.2.0 */ 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_true_divide */ #elif PY_VERSION_HEX >= 0x02000000 /* 2.0.0 */ 0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_or */ #endif }; static PyTypeObject swigpyobject_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif (char *)"SwigPyObject", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyObject_dealloc, /* tp_dealloc */ (printfunc)SwigPyObject_print, /* tp_print */ #if PY_VERSION_HEX < 0x02020000 (getattrfunc)SwigPyObject_getattr, /* tp_getattr */ #else (getattrfunc)0, /* tp_getattr */ #endif (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ #else (cmpfunc)SwigPyObject_compare, /* tp_compare */ #endif (reprfunc)SwigPyObject_repr, /* tp_repr */ &SwigPyObject_as_number, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ (reprfunc)SwigPyObject_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ swigobject_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ 0, /* tp_iternext */ swigobject_methods, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #if PY_VERSION_HEX >= 0x02060000 0, /* tp_version */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; swigpyobject_type = tmp; type_init = 1; #if PY_VERSION_HEX < 0x02020000 swigpyobject_type.ob_type = &PyType_Type; #else if (PyType_Ready(&swigpyobject_type) < 0) return NULL; #endif } return &swigpyobject_type; } SWIGRUNTIME PyObject * SwigPyObject_New(void *ptr, swig_type_info *ty, int own) { SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type()); if (sobj) { sobj->ptr = ptr; sobj->ty = ty; sobj->own = own; sobj->next = 0; } return (PyObject *)sobj; } /* ----------------------------------------------------------------------------- * Implements a simple Swig Packed type, and use it instead of string * ----------------------------------------------------------------------------- */ typedef struct { PyObject_HEAD void *pack; swig_type_info *ty; size_t size; } SwigPyPacked; SWIGRUNTIME int SwigPyPacked_print(SwigPyPacked *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char result[SWIG_BUFFER_SIZE]; fputs("pack, v->size, 0, sizeof(result))) { fputs("at ", fp); fputs(result, fp); } fputs(v->ty->name,fp); fputs(">", fp); return 0; } SWIGRUNTIME PyObject * SwigPyPacked_repr(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) { return SWIG_Python_str_FromFormat("", result, v->ty->name); } else { return SWIG_Python_str_FromFormat("", v->ty->name); } } SWIGRUNTIME PyObject * SwigPyPacked_str(SwigPyPacked *v) { char result[SWIG_BUFFER_SIZE]; if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){ return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name); } else { return SWIG_Python_str_FromChar(v->ty->name); } } SWIGRUNTIME int SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w) { size_t i = v->size; size_t j = w->size; int s = (i < j) ? -1 : ((i > j) ? 1 : 0); return s ? s : strncmp((char *)v->pack, (char *)w->pack, 2*v->size); } SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); SWIGRUNTIME PyTypeObject* SwigPyPacked_type(void) { static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce(); return type; } SWIGRUNTIMEINLINE int SwigPyPacked_Check(PyObject *op) { return ((op)->ob_type == SwigPyPacked_TypeOnce()) || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0); } SWIGRUNTIME void SwigPyPacked_dealloc(PyObject *v) { if (SwigPyPacked_Check(v)) { SwigPyPacked *sobj = (SwigPyPacked *) v; free(sobj->pack); } PyObject_DEL(v); } SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void) { static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer"; static PyTypeObject swigpypacked_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX>=0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif (char *)"SwigPyPacked", /* tp_name */ sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ (printfunc)SwigPyPacked_print, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX>=0x03000000 0, /* tp_reserved in 3.0.1 */ #else (cmpfunc)SwigPyPacked_compare, /* tp_compare */ #endif (reprfunc)SwigPyPacked_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ (reprfunc)SwigPyPacked_str, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT, /* tp_flags */ swigpacked_doc, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ 0, /* tp_descr_get */ 0, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #if PY_VERSION_HEX >= 0x02060000 0, /* tp_version */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; swigpypacked_type = tmp; type_init = 1; #if PY_VERSION_HEX < 0x02020000 swigpypacked_type.ob_type = &PyType_Type; #else if (PyType_Ready(&swigpypacked_type) < 0) return NULL; #endif } return &swigpypacked_type; } SWIGRUNTIME PyObject * SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty) { SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type()); if (sobj) { void *pack = malloc(size); if (pack) { memcpy(pack, ptr, size); sobj->pack = pack; sobj->ty = ty; sobj->size = size; } else { PyObject_DEL((PyObject *) sobj); sobj = 0; } } return (PyObject *) sobj; } SWIGRUNTIME swig_type_info * SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) { if (SwigPyPacked_Check(obj)) { SwigPyPacked *sobj = (SwigPyPacked *)obj; if (sobj->size != size) return 0; memcpy(ptr, sobj->pack, size); return sobj->ty; } else { return 0; } } /* ----------------------------------------------------------------------------- * pointers/data manipulation * ----------------------------------------------------------------------------- */ SWIGRUNTIMEINLINE PyObject * _SWIG_This(void) { return SWIG_Python_str_FromChar("this"); } static PyObject *swig_this = NULL; SWIGRUNTIME PyObject * SWIG_This(void) { if (swig_this == NULL) swig_this = _SWIG_This(); return swig_this; } /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ /* TODO: I don't know how to implement the fast getset in Python 3 right now */ #if PY_VERSION_HEX>=0x03000000 #define SWIG_PYTHON_SLOW_GETSET_THIS #endif SWIGRUNTIME SwigPyObject * SWIG_Python_GetSwigThis(PyObject *pyobj) { PyObject *obj; if (SwigPyObject_Check(pyobj)) return (SwigPyObject *) pyobj; #ifdef SWIGPYTHON_BUILTIN (void)obj; # ifdef PyWeakref_CheckProxy if (PyWeakref_CheckProxy(pyobj)) { pyobj = PyWeakref_GET_OBJECT(pyobj); if (pyobj && SwigPyObject_Check(pyobj)) return (SwigPyObject*) pyobj; } # endif return NULL; #else obj = 0; #if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) if (PyInstance_Check(pyobj)) { obj = _PyInstance_Lookup(pyobj, SWIG_This()); } else { PyObject **dictptr = _PyObject_GetDictPtr(pyobj); if (dictptr != NULL) { PyObject *dict = *dictptr; obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0; } else { #ifdef PyWeakref_CheckProxy if (PyWeakref_CheckProxy(pyobj)) { PyObject *wobj = PyWeakref_GET_OBJECT(pyobj); return wobj ? SWIG_Python_GetSwigThis(wobj) : 0; } #endif obj = PyObject_GetAttr(pyobj,SWIG_This()); if (obj) { Py_DECREF(obj); } else { if (PyErr_Occurred()) PyErr_Clear(); return 0; } } } #else obj = PyObject_GetAttr(pyobj,SWIG_This()); if (obj) { Py_DECREF(obj); } else { if (PyErr_Occurred()) PyErr_Clear(); return 0; } #endif if (obj && !SwigPyObject_Check(obj)) { /* a PyObject is called 'this', try to get the 'real this' SwigPyObject from it */ return SWIG_Python_GetSwigThis(obj); } return (SwigPyObject *)obj; #endif } /* Acquire a pointer value */ SWIGRUNTIME int SWIG_Python_AcquirePtr(PyObject *obj, int own) { if (own == SWIG_POINTER_OWN) { SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj); if (sobj) { int oldown = sobj->own; sobj->own = own; return oldown; } } return 0; } /* Convert a pointer value */ SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { int res; SwigPyObject *sobj; if (!obj) return SWIG_ERROR; if (obj == Py_None) { if (ptr) *ptr = 0; return SWIG_OK; } res = SWIG_ERROR; sobj = SWIG_Python_GetSwigThis(obj); if (own) *own = 0; while (sobj) { void *vptr = sobj->ptr; if (ty) { swig_type_info *to = sobj->ty; if (to == ty) { /* no type cast needed */ if (ptr) *ptr = vptr; break; } else { swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) { sobj = (SwigPyObject *)sobj->next; } else { if (ptr) { int newmemory = 0; *ptr = SWIG_TypeCast(tc,vptr,&newmemory); if (newmemory == SWIG_CAST_NEW_MEMORY) { assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */ if (own) *own = *own | SWIG_CAST_NEW_MEMORY; } } break; } } } else { if (ptr) *ptr = vptr; break; } } if (sobj) { if (own) *own = *own | sobj->own; if (flags & SWIG_POINTER_DISOWN) { sobj->own = 0; } res = SWIG_OK; } else { if (flags & SWIG_POINTER_IMPLICIT_CONV) { SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; if (klass) { PyObject *impconv; data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/ impconv = SWIG_Python_CallFunctor(klass, obj); data->implicitconv = 0; if (PyErr_Occurred()) { PyErr_Clear(); impconv = 0; } if (impconv) { SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv); if (iobj) { void *vptr; res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0); if (SWIG_IsOK(res)) { if (ptr) { *ptr = vptr; /* transfer the ownership to 'ptr' */ iobj->own = 0; res = SWIG_AddCast(res); res = SWIG_AddNewMask(res); } else { res = SWIG_AddCast(res); } } } Py_DECREF(impconv); } } } } } return res; } /* Convert a function ptr value */ SWIGRUNTIME int SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { if (!PyCFunction_Check(obj)) { return SWIG_ConvertPtr(obj, ptr, ty, 0); } else { void *vptr = 0; /* here we get the method pointer for callbacks */ const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc); const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0; if (desc) desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0; if (!desc) return SWIG_ERROR; if (ty) { swig_cast_info *tc = SWIG_TypeCheck(desc,ty); if (tc) { int newmemory = 0; *ptr = SWIG_TypeCast(tc,vptr,&newmemory); assert(!newmemory); /* newmemory handling not yet implemented */ } else { return SWIG_ERROR; } } else { *ptr = vptr; } return SWIG_OK; } } /* Convert a packed value value */ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz); if (!to) return SWIG_ERROR; if (ty) { if (to != ty) { /* check type cast? */ swig_cast_info *tc = SWIG_TypeCheck(to->name,ty); if (!tc) return SWIG_ERROR; } } return SWIG_OK; } /* ----------------------------------------------------------------------------- * Create a new pointer object * ----------------------------------------------------------------------------- */ /* Create a new instance object, without calling __init__, and set the 'this' attribute. */ SWIGRUNTIME PyObject* SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { #if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; PyObject *newraw = data->newraw; if (newraw) { inst = PyObject_Call(newraw, data->newargs, NULL); if (inst) { #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) PyObject **dictptr = _PyObject_GetDictPtr(inst); if (dictptr != NULL) { PyObject *dict = *dictptr; if (dict == NULL) { dict = PyDict_New(); *dictptr = dict; PyDict_SetItem(dict, SWIG_This(), swig_this); } } #else PyObject *key = SWIG_This(); PyObject_SetAttr(inst, key, swig_this); #endif } } else { #if PY_VERSION_HEX >= 0x03000000 inst = PyBaseObject_Type.tp_new((PyTypeObject*) data->newargs, Py_None, Py_None); if (inst) { PyObject_SetAttr(inst, SWIG_This(), swig_this); Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; } #else PyObject *dict = PyDict_New(); if (dict) { PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); } #endif } return inst; #else #if (PY_VERSION_HEX >= 0x02010000) PyObject *inst = 0; PyObject *dict = PyDict_New(); if (dict) { PyDict_SetItem(dict, SWIG_This(), swig_this); inst = PyInstance_NewRaw(data->newargs, dict); Py_DECREF(dict); } return (PyObject *) inst; #else PyInstanceObject *inst = PyObject_NEW(PyInstanceObject, &PyInstance_Type); if (inst == NULL) { return NULL; } inst->in_class = (PyClassObject *)data->newargs; Py_INCREF(inst->in_class); inst->in_dict = PyDict_New(); if (inst->in_dict == NULL) { Py_DECREF(inst); return NULL; } #ifdef Py_TPFLAGS_HAVE_WEAKREFS inst->in_weakreflist = NULL; #endif #ifdef Py_TPFLAGS_GC PyObject_GC_Init(inst); #endif PyDict_SetItem(inst->in_dict, SWIG_This(), swig_this); return (PyObject *) inst; #endif #endif } SWIGRUNTIME void SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this) { PyObject *dict; #if (PY_VERSION_HEX >= 0x02020000) && !defined(SWIG_PYTHON_SLOW_GETSET_THIS) PyObject **dictptr = _PyObject_GetDictPtr(inst); if (dictptr != NULL) { dict = *dictptr; if (dict == NULL) { dict = PyDict_New(); *dictptr = dict; } PyDict_SetItem(dict, SWIG_This(), swig_this); return; } #endif dict = PyObject_GetAttrString(inst, (char*)"__dict__"); PyDict_SetItem(dict, SWIG_This(), swig_this); Py_DECREF(dict); } SWIGINTERN PyObject * SWIG_Python_InitShadowInstance(PyObject *args) { PyObject *obj[2]; if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) { return NULL; } else { SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]); if (sthis) { SwigPyObject_append((PyObject*) sthis, obj[1]); } else { SWIG_Python_SetSwigThis(obj[0], obj[1]); } return SWIG_Py_Void(); } } /* Create a new pointer object */ SWIGRUNTIME PyObject * SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) { SwigPyClientData *clientdata; PyObject * robj; int own; if (!ptr) return SWIG_Py_Void(); clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0; own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0; if (clientdata && clientdata->pytype) { SwigPyObject *newobj; if (flags & SWIG_BUILTIN_TP_INIT) { newobj = (SwigPyObject*) self; if (newobj->ptr) { PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0); while (newobj->next) newobj = (SwigPyObject *) newobj->next; newobj->next = next_self; newobj = (SwigPyObject *)next_self; } } else { newobj = PyObject_New(SwigPyObject, clientdata->pytype); } if (newobj) { newobj->ptr = ptr; newobj->ty = type; newobj->own = own; newobj->next = 0; #ifdef SWIGPYTHON_BUILTIN newobj->dict = 0; #endif return (PyObject*) newobj; } return SWIG_Py_Void(); } assert(!(flags & SWIG_BUILTIN_TP_INIT)); robj = SwigPyObject_New(ptr, type, own); if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) { PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj); Py_DECREF(robj); robj = inst; } return robj; } /* Create a new packed object */ SWIGRUNTIMEINLINE PyObject * SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) { return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void(); } /* -----------------------------------------------------------------------------* * Get type list * -----------------------------------------------------------------------------*/ #ifdef SWIG_LINK_RUNTIME void *SWIG_ReturnGlobalTypeList(void *); #endif SWIGRUNTIME swig_module_info * SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { static void *type_pointer = (void *)0; /* first check if module already created */ if (!type_pointer) { #ifdef SWIG_LINK_RUNTIME type_pointer = SWIG_ReturnGlobalTypeList((void *)0); #else # ifdef SWIGPY_USE_CAPSULE type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0); # else type_pointer = PyCObject_Import((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME); # endif if (PyErr_Occurred()) { PyErr_Clear(); type_pointer = (void *)0; } #endif } return (swig_module_info *) type_pointer; } #if PY_MAJOR_VERSION < 2 /* PyModule_AddObject function was introduced in Python 2.0. The following function is copied out of Python/modsupport.c in python version 2.3.4 */ SWIGINTERN int PyModule_AddObject(PyObject *m, char *name, PyObject *o) { PyObject *dict; if (!PyModule_Check(m)) { PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs module as first arg"); return SWIG_ERROR; } if (!o) { PyErr_SetString(PyExc_TypeError, "PyModule_AddObject() needs non-NULL value"); return SWIG_ERROR; } dict = PyModule_GetDict(m); if (dict == NULL) { /* Internal error -- modules must have a dict! */ PyErr_Format(PyExc_SystemError, "module '%s' has no __dict__", PyModule_GetName(m)); return SWIG_ERROR; } if (PyDict_SetItemString(dict, name, o)) return SWIG_ERROR; Py_DECREF(o); return SWIG_OK; } #endif SWIGRUNTIME void #ifdef SWIGPY_USE_CAPSULE SWIG_Python_DestroyModule(PyObject *obj) #else SWIG_Python_DestroyModule(void *vptr) #endif { #ifdef SWIGPY_USE_CAPSULE swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME); #else swig_module_info *swig_module = (swig_module_info *) vptr; #endif swig_type_info **types = swig_module->types; size_t i; for (i =0; i < swig_module->size; ++i) { swig_type_info *ty = types[i]; if (ty->owndata) { SwigPyClientData *data = (SwigPyClientData *) ty->clientdata; if (data) SwigPyClientData_Del(data); } } Py_DECREF(SWIG_This()); swig_this = NULL; } SWIGRUNTIME void SWIG_Python_SetModule(swig_module_info *swig_module) { #if PY_VERSION_HEX >= 0x03000000 /* Add a dummy module object into sys.modules */ PyObject *module = PyImport_AddModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION); #else static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */ PyObject *module = Py_InitModule((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table); #endif #ifdef SWIGPY_USE_CAPSULE PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); } else { Py_XDECREF(pointer); } #else PyObject *pointer = PyCObject_FromVoidPtr((void *) swig_module, SWIG_Python_DestroyModule); if (pointer && module) { PyModule_AddObject(module, (char*)"type_pointer" SWIG_TYPE_TABLE_NAME, pointer); } else { Py_XDECREF(pointer); } #endif } /* The python cached type query */ SWIGRUNTIME PyObject * SWIG_Python_TypeCache(void) { static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New(); return cache; } SWIGRUNTIME swig_type_info * SWIG_Python_TypeQuery(const char *type) { PyObject *cache = SWIG_Python_TypeCache(); PyObject *key = SWIG_Python_str_FromChar(type); PyObject *obj = PyDict_GetItem(cache, key); swig_type_info *descriptor; if (obj) { #ifdef SWIGPY_USE_CAPSULE descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL); #else descriptor = (swig_type_info *) PyCObject_AsVoidPtr(obj); #endif } else { swig_module_info *swig_module = SWIG_GetModule(0); descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type); if (descriptor) { #ifdef SWIGPY_USE_CAPSULE obj = PyCapsule_New((void*) descriptor, NULL, NULL); #else obj = PyCObject_FromVoidPtr(descriptor, NULL); #endif PyDict_SetItem(cache, key, obj); Py_DECREF(obj); } } Py_DECREF(key); return descriptor; } /* For backward compatibility only */ #define SWIG_POINTER_EXCEPTION 0 #define SWIG_arg_fail(arg) SWIG_Python_ArgFail(arg) #define SWIG_MustGetPtr(p, type, argnum, flags) SWIG_Python_MustGetPtr(p, type, argnum, flags) SWIGRUNTIME int SWIG_Python_AddErrMesg(const char* mesg, int infront) { if (PyErr_Occurred()) { PyObject *type = 0; PyObject *value = 0; PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { char *tmp; PyObject *old_str = PyObject_Str(value); Py_XINCREF(type); PyErr_Clear(); if (infront) { PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); } else { PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); } SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); } return 1; } else { return 0; } } SWIGRUNTIME int SWIG_Python_ArgFail(int argnum) { if (PyErr_Occurred()) { /* add information about failing argument */ char mesg[256]; PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum); return SWIG_Python_AddErrMesg(mesg, 1); } else { return 0; } } SWIGRUNTIMEINLINE const char * SwigPyObject_GetDesc(PyObject *self) { SwigPyObject *v = (SwigPyObject *)self; swig_type_info *ty = v ? v->ty : 0; return ty ? ty->str : ""; } SWIGRUNTIME void SWIG_Python_TypeError(const char *type, PyObject *obj) { if (type) { #if defined(SWIG_COBJECT_TYPES) if (obj && SwigPyObject_Check(obj)) { const char *otype = (const char *) SwigPyObject_GetDesc(obj); if (otype) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received", type, otype); return; } } else #endif { const char *otype = (obj ? obj->ob_type->tp_name : 0); if (otype) { PyObject *str = PyObject_Str(obj); const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0; if (cstr) { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received", type, otype, cstr); SWIG_Python_str_DelForPy3(cstr); } else { PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received", type, otype); } Py_XDECREF(str); return; } } PyErr_Format(PyExc_TypeError, "a '%s' is expected", type); } else { PyErr_Format(PyExc_TypeError, "unexpected type is received"); } } /* Convert a pointer value, signal an exception on a type mismatch */ SWIGRUNTIME void * SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) { void *result; if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) { PyErr_Clear(); #if SWIG_POINTER_EXCEPTION if (flags) { SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj); SWIG_Python_ArgFail(argnum); } #endif } return result; } #ifdef SWIGPYTHON_BUILTIN SWIGRUNTIME int SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { PyTypeObject *tp = obj->ob_type; PyObject *descr; PyObject *encoded_name; descrsetfunc f; int res; # ifdef Py_USING_UNICODE if (PyString_Check(name)) { name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL); if (!name) return -1; } else if (!PyUnicode_Check(name)) # else if (!PyString_Check(name)) # endif { PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name); return -1; } else { Py_INCREF(name); } if (!tp->tp_dict) { if (PyType_Ready(tp) < 0) goto done; } res = -1; descr = _PyType_Lookup(tp, name); f = NULL; if (descr != NULL) f = descr->ob_type->tp_descr_set; if (!f) { if (PyString_Check(name)) { encoded_name = name; Py_INCREF(name); } else { encoded_name = PyUnicode_AsUTF8String(name); } PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); Py_DECREF(encoded_name); } else { res = f(descr, obj, value); } done: Py_DECREF(name); return res; } #endif #ifdef __cplusplus } #endif #define SWIGPY_UNARYFUNC_CLOSURE(wrapper) \ SWIGINTERN PyObject * \ wrapper##_closure(PyObject *a) { \ return wrapper(a, NULL); \ } #define SWIGPY_DESTRUCTOR_CLOSURE(wrapper) \ SWIGINTERN void \ wrapper##_closure(PyObject *a) { \ SwigPyObject *sobj; \ sobj = (SwigPyObject *)a; \ if (sobj->own) { \ PyObject *o = wrapper(a, NULL); \ Py_XDECREF(o); \ } \ PyObject_Del(a); \ } #define SWIGPY_INQUIRY_CLOSURE(wrapper) \ SWIGINTERN int \ wrapper##_closure(PyObject *a) { \ PyObject *pyresult; \ int result; \ pyresult = wrapper(a, NULL); \ result = pyresult && PyObject_IsTrue(pyresult) ? 1 : 0; \ Py_XDECREF(pyresult); \ return result; \ } #define SWIGPY_BINARYFUNC_CLOSURE(wrapper) \ SWIGINTERN PyObject * \ wrapper##_closure(PyObject *a, PyObject *b) { \ PyObject *tuple, *result; \ tuple = PyTuple_New(1); \ assert(tuple); \ PyTuple_SET_ITEM(tuple, 0, b); \ Py_XINCREF(b); \ result = wrapper(a, tuple); \ Py_DECREF(tuple); \ return result; \ } typedef ternaryfunc ternarycallfunc; #define SWIGPY_TERNARYFUNC_CLOSURE(wrapper) \ SWIGINTERN PyObject * \ wrapper##_closure(PyObject *a, PyObject *b, PyObject *c) { \ PyObject *tuple, *result; \ tuple = PyTuple_New(2); \ assert(tuple); \ PyTuple_SET_ITEM(tuple, 0, b); \ PyTuple_SET_ITEM(tuple, 1, c); \ Py_XINCREF(b); \ Py_XINCREF(c); \ result = wrapper(a, tuple); \ Py_DECREF(tuple); \ return result; \ } #define SWIGPY_TERNARYCALLFUNC_CLOSURE(wrapper) \ SWIGINTERN PyObject * \ wrapper##_closure(PyObject *callable_object, PyObject *args, PyObject *) { \ return wrapper(callable_object, args); \ } #define SWIGPY_LENFUNC_CLOSURE(wrapper) \ SWIGINTERN Py_ssize_t \ wrapper##_closure(PyObject *a) { \ PyObject *resultobj; \ Py_ssize_t result; \ resultobj = wrapper(a, NULL); \ result = PyNumber_AsSsize_t(resultobj, NULL); \ Py_DECREF(resultobj); \ return result; \ } #define SWIGPY_SSIZESSIZEARGFUNC_CLOSURE(wrapper) \ SWIGINTERN PyObject * \ wrapper##_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c) { \ PyObject *tuple, *result; \ tuple = PyTuple_New(2); \ assert(tuple); \ PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \ PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c)); \ result = wrapper(a, tuple); \ Py_DECREF(tuple); \ return result; \ } #define SWIGPY_SSIZESSIZEOBJARGPROC_CLOSURE(wrapper) \ SWIGINTERN int \ wrapper##_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) { \ PyObject *tuple, *resultobj; \ int result; \ tuple = PyTuple_New(d ? 3 : 2); \ assert(tuple); \ PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \ PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c)); \ if (d) { \ PyTuple_SET_ITEM(tuple, 2, d); \ Py_INCREF(d); \ } \ resultobj = wrapper(a, tuple); \ result = resultobj ? 0 : -1; \ Py_DECREF(tuple); \ Py_XDECREF(resultobj); \ return result; \ } #define SWIGPY_SSIZEARGFUNC_CLOSURE(wrapper) \ SWIGINTERN PyObject * \ wrapper##_closure(PyObject *a, Py_ssize_t b) { \ PyObject *tuple, *result; \ tuple = PyTuple_New(1); \ assert(tuple); \ PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \ result = wrapper(a, tuple); \ Py_DECREF(tuple); \ return result; \ } #define SWIGPY_FUNPACK_SSIZEARGFUNC_CLOSURE(wrapper) \ SWIGINTERN PyObject * \ wrapper##_closure(PyObject *a, Py_ssize_t b) { \ PyObject *arg, *result; \ arg = _PyLong_FromSsize_t(b); \ result = wrapper(a, arg); \ Py_DECREF(arg); \ return result; \ } #define SWIGPY_SSIZEOBJARGPROC_CLOSURE(wrapper) \ SWIGINTERN int \ wrapper##_closure(PyObject *a, Py_ssize_t b, PyObject *c) { \ PyObject *tuple, *resultobj; \ int result; \ tuple = PyTuple_New(2); \ assert(tuple); \ PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b)); \ PyTuple_SET_ITEM(tuple, 1, c); \ Py_XINCREF(c); \ resultobj = wrapper(a, tuple); \ result = resultobj ? 0 : -1; \ Py_XDECREF(resultobj); \ Py_DECREF(tuple); \ return result; \ } #define SWIGPY_OBJOBJARGPROC_CLOSURE(wrapper) \ SWIGINTERN int \ wrapper##_closure(PyObject *a, PyObject *b, PyObject *c) { \ PyObject *tuple, *resultobj; \ int result; \ tuple = PyTuple_New(c ? 2 : 1); \ assert(tuple); \ PyTuple_SET_ITEM(tuple, 0, b); \ Py_XINCREF(b); \ if (c) { \ PyTuple_SET_ITEM(tuple, 1, c); \ Py_XINCREF(c); \ } \ resultobj = wrapper(a, tuple); \ result = resultobj ? 0 : -1; \ Py_XDECREF(resultobj); \ Py_DECREF(tuple); \ return result; \ } #define SWIGPY_REPRFUNC_CLOSURE(wrapper) \ SWIGINTERN PyObject * \ wrapper##_closure(PyObject *a) { \ return wrapper(a, NULL); \ } #define SWIGPY_HASHFUNC_CLOSURE(wrapper) \ SWIGINTERN long \ wrapper##_closure(PyObject *a) { \ PyObject *pyresult; \ long result; \ pyresult = wrapper(a, NULL); \ if (!pyresult || !PyLong_Check(pyresult)) \ return -1; \ result = PyLong_AsLong(pyresult); \ Py_DECREF(pyresult); \ return result; \ } #define SWIGPY_ITERNEXT_CLOSURE(wrapper) \ SWIGINTERN PyObject * \ wrapper##_closure(PyObject *a) { \ PyObject *result; \ result = wrapper(a, NULL); \ if (result && result == Py_None) { \ Py_DECREF(result); \ result = NULL; \ } \ return result; \ } #ifdef __cplusplus extern "C" { #endif SWIGINTERN int SwigPyBuiltin_BadInit(PyObject *self, PyObject *SWIGUNUSEDPARM(args), PyObject *SWIGUNUSEDPARM(kwds)) { PyErr_Format(PyExc_TypeError, "Cannot create new instances of type '%.300s'", self->ob_type->tp_name); return -1; } SWIGINTERN void SwigPyBuiltin_BadDealloc(PyObject *pyobj) { SwigPyObject *sobj; sobj = (SwigPyObject *)pyobj; if (sobj->own) { PyErr_Format(PyExc_TypeError, "Swig detected a memory leak in type '%.300s': no callable destructor found.", pyobj->ob_type->tp_name); } } typedef struct { PyCFunction get; PyCFunction set; } SwigPyGetSet; SWIGINTERN PyObject * SwigPyBuiltin_GetterClosure (PyObject *obj, void *closure) { SwigPyGetSet *getset; PyObject *tuple, *result; if (!closure) return SWIG_Py_Void(); getset = (SwigPyGetSet *)closure; if (!getset->get) return SWIG_Py_Void(); tuple = PyTuple_New(0); assert(tuple); result = (*getset->get)(obj, tuple); Py_DECREF(tuple); return result; } SWIGINTERN PyObject * SwigPyBuiltin_FunpackGetterClosure (PyObject *obj, void *closure) { SwigPyGetSet *getset; PyObject *result; if (!closure) return SWIG_Py_Void(); getset = (SwigPyGetSet *)closure; if (!getset->get) return SWIG_Py_Void(); result = (*getset->get)(obj, NULL); return result; } SWIGINTERN int SwigPyBuiltin_SetterClosure (PyObject *obj, PyObject *val, void *closure) { SwigPyGetSet *getset; PyObject *tuple, *result; if (!closure) { PyErr_Format(PyExc_TypeError, "Missing getset closure"); return -1; } getset = (SwigPyGetSet *)closure; if (!getset->set) { PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name); return -1; } tuple = PyTuple_New(1); assert(tuple); PyTuple_SET_ITEM(tuple, 0, val); Py_XINCREF(val); result = (*getset->set)(obj, tuple); Py_DECREF(tuple); Py_XDECREF(result); return result ? 0 : -1; } SWIGINTERN int SwigPyBuiltin_FunpackSetterClosure (PyObject *obj, PyObject *val, void *closure) { SwigPyGetSet *getset; PyObject *result; if (!closure) { PyErr_Format(PyExc_TypeError, "Missing getset closure"); return -1; } getset = (SwigPyGetSet *)closure; if (!getset->set) { PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name); return -1; } result = (*getset->set)(obj, val); Py_XDECREF(result); return result ? 0 : -1; } SWIGINTERN void SwigPyStaticVar_dealloc(PyDescrObject *descr) { _PyObject_GC_UNTRACK(descr); Py_XDECREF(PyDescr_TYPE(descr)); Py_XDECREF(PyDescr_NAME(descr)); PyObject_GC_Del(descr); } SWIGINTERN PyObject * SwigPyStaticVar_repr(PyGetSetDescrObject *descr) { #if PY_VERSION_HEX >= 0x03000000 return PyUnicode_FromFormat("", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); #else return PyString_FromFormat("", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); #endif } SWIGINTERN int SwigPyStaticVar_traverse(PyObject *self, visitproc visit, void *arg) { PyDescrObject *descr; descr = (PyDescrObject *)self; Py_VISIT((PyObject*) PyDescr_TYPE(descr)); return 0; } SWIGINTERN PyObject * SwigPyStaticVar_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *SWIGUNUSEDPARM(type)) { if (descr->d_getset->get != NULL) return descr->d_getset->get(obj, descr->d_getset->closure); #if PY_VERSION_HEX >= 0x03000000 PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not readable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); #else PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not readable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); #endif return NULL; } SWIGINTERN int SwigPyStaticVar_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value) { if (descr->d_getset->set != NULL) return descr->d_getset->set(obj, value, descr->d_getset->closure); #if PY_VERSION_HEX >= 0x03000000 PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not writable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name); #else PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not writable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name); #endif return -1; } SWIGINTERN int SwigPyObjectType_setattro(PyTypeObject *type, PyObject *name, PyObject *value) { PyObject *attribute; descrsetfunc local_set; attribute = _PyType_Lookup(type, name); if (attribute != NULL) { /* Implement descriptor functionality, if any */ local_set = attribute->ob_type->tp_descr_set; if (local_set != NULL) return local_set(attribute, (PyObject *)type, value); #if PY_VERSION_HEX >= 0x03000000 PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400S'", type->tp_name, name); #else PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400s'", type->tp_name, PyString_AS_STRING(name)); #endif } else { #if PY_VERSION_HEX >= 0x03000000 PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400S'", type->tp_name, name); #else PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400s'", type->tp_name, PyString_AS_STRING(name)); #endif } return -1; } SWIGINTERN PyTypeObject* SwigPyStaticVar_Type(void) { static PyTypeObject staticvar_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(&PyType_Type, 0) #else PyObject_HEAD_INIT(&PyType_Type) 0, #endif "swig_static_var_getset_descriptor", sizeof(PyGetSetDescrObject), 0, (destructor)SwigPyStaticVar_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ 0, /* tp_setattr */ 0, /* tp_compare */ (reprfunc)SwigPyStaticVar_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */ 0, /* tp_doc */ SwigPyStaticVar_traverse, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ 0, /* tp_members */ 0, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc)SwigPyStaticVar_get, /* tp_descr_get */ (descrsetfunc)SwigPyStaticVar_set, /* tp_descr_set */ 0, /* tp_dictoffset */ 0, /* tp_init */ 0, /* tp_alloc */ 0, /* tp_new */ 0, /* tp_free */ 0, /* tp_is_gc */ 0, /* tp_bases */ 0, /* tp_mro */ 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #if PY_VERSION_HEX >= 0x02060000 0, /* tp_version */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; staticvar_type = tmp; type_init = 1; #if PY_VERSION_HEX < 0x02020000 staticvar_type.ob_type = &PyType_Type; #else if (PyType_Ready(&staticvar_type) < 0) return NULL; #endif } return &staticvar_type; } SWIGINTERN PyGetSetDescrObject * SwigPyStaticVar_new_getset(PyTypeObject *type, PyGetSetDef *getset) { PyGetSetDescrObject *descr; descr = (PyGetSetDescrObject *)PyType_GenericAlloc(SwigPyStaticVar_Type(), 0); assert(descr); Py_XINCREF(type); PyDescr_TYPE(descr) = type; PyDescr_NAME(descr) = PyString_InternFromString(getset->name); descr->d_getset = getset; if (PyDescr_NAME(descr) == NULL) { Py_DECREF(descr); descr = NULL; } return descr; } SWIGINTERN void SwigPyBuiltin_InitBases (PyTypeObject *type, PyTypeObject **bases) { int base_count = 0; PyTypeObject **b; PyObject *tuple; int i; if (!bases[0]) { bases[0] = SwigPyObject_type(); bases[1] = NULL; } type->tp_base = bases[0]; Py_INCREF((PyObject *)bases[0]); for (b = bases; *b != NULL; ++b) ++base_count; tuple = PyTuple_New(base_count); for (i = 0; i < base_count; ++i) { PyTuple_SET_ITEM(tuple, i, (PyObject *)bases[i]); Py_INCREF((PyObject *)bases[i]); } type->tp_bases = tuple; } SWIGINTERN PyObject * SwigPyBuiltin_ThisClosure (PyObject *self, void *SWIGUNUSEDPARM(closure)) { PyObject *result; result = (PyObject *)SWIG_Python_GetSwigThis(self); Py_XINCREF(result); return result; } SWIGINTERN void SwigPyBuiltin_SetMetaType (PyTypeObject *type, PyTypeObject *metatype) { #if PY_VERSION_HEX >= 0x03000000 type->ob_base.ob_base.ob_type = metatype; #else type->ob_type = metatype; #endif } #ifdef __cplusplus } #endif #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) /* -------- TYPES TABLE (BEGIN) -------- */ #define SWIGTYPE_p_AES_KEY swig_types[0] #define SWIGTYPE_p_ASN1_BIT_STRING swig_types[1] #define SWIGTYPE_p_ASN1_INTEGER swig_types[2] #define SWIGTYPE_p_ASN1_OBJECT swig_types[3] #define SWIGTYPE_p_ASN1_STRING swig_types[4] #define SWIGTYPE_p_ASN1_TIME swig_types[5] #define SWIGTYPE_p_BIGNUM swig_types[6] #define SWIGTYPE_p_BIO swig_types[7] #define SWIGTYPE_p_BIO_METHOD swig_types[8] #define SWIGTYPE_p_DH swig_types[9] #define SWIGTYPE_p_DSA swig_types[10] #define SWIGTYPE_p_ECDSA_SIG swig_types[11] #define SWIGTYPE_p_EC_KEY swig_types[12] #define SWIGTYPE_p_ENGINE swig_types[13] #define SWIGTYPE_p_EVP_CIPHER swig_types[14] #define SWIGTYPE_p_EVP_CIPHER_CTX swig_types[15] #define SWIGTYPE_p_EVP_MD swig_types[16] #define SWIGTYPE_p_EVP_MD_CTX swig_types[17] #define SWIGTYPE_p_EVP_PKEY swig_types[18] #define SWIGTYPE_p_FILE swig_types[19] #define SWIGTYPE_p_HMAC_CTX swig_types[20] #define SWIGTYPE_p_PKCS7 swig_types[21] #define SWIGTYPE_p_PyObject swig_types[22] #define SWIGTYPE_p_RC4_KEY swig_types[23] #define SWIGTYPE_p_RSA swig_types[24] #define SWIGTYPE_p_SSL swig_types[25] #define SWIGTYPE_p_SSL_CIPHER swig_types[26] #define SWIGTYPE_p_SSL_CTX swig_types[27] #define SWIGTYPE_p_SSL_METHOD swig_types[28] #define SWIGTYPE_p_SSL_SESSION swig_types[29] #define SWIGTYPE_p_SwigPyObject swig_types[30] #define SWIGTYPE_p_UI_METHOD swig_types[31] #define SWIGTYPE_p_X509 swig_types[32] #define SWIGTYPE_p_X509V3_CTX swig_types[33] #define SWIGTYPE_p_X509_CRL swig_types[34] #define SWIGTYPE_p_X509_EXTENSION swig_types[35] #define SWIGTYPE_p_X509_NAME swig_types[36] #define SWIGTYPE_p_X509_NAME_ENTRY swig_types[37] #define SWIGTYPE_p_X509_REQ swig_types[38] #define SWIGTYPE_p_X509_STORE swig_types[39] #define SWIGTYPE_p_X509_STORE_CTX swig_types[40] #define SWIGTYPE_p__cbd_t swig_types[41] #define SWIGTYPE_p_char swig_types[42] #define SWIGTYPE_p_f_int_p_X509_STORE_CTX__int swig_types[43] #define SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int swig_types[44] #define SWIGTYPE_p_f_p_void__p_void swig_types[45] #define SWIGTYPE_p_f_p_void__void swig_types[46] #define SWIGTYPE_p_p_ASN1_OBJECT swig_types[47] #define SWIGTYPE_p_p_X509_NAME_ENTRY swig_types[48] #define SWIGTYPE_p_p_char swig_types[49] #define SWIGTYPE_p_p_unsigned_char swig_types[50] #define SWIGTYPE_p_pyfd_struct swig_types[51] #define SWIGTYPE_p_stack_st swig_types[52] #define SWIGTYPE_p_stack_st_OPENSSL_BLOCK swig_types[53] #define SWIGTYPE_p_stack_st_OPENSSL_STRING swig_types[54] #define SWIGTYPE_p_stack_st_SSL_CIPHER swig_types[55] #define SWIGTYPE_p_stack_st_X509 swig_types[56] #define SWIGTYPE_p_stack_st_X509_EXTENSION swig_types[57] #define SWIGTYPE_p_unsigned_char swig_types[58] #define SWIGTYPE_p_void swig_types[59] static swig_type_info *swig_types[61]; static swig_module_info swig_module = {swig_types, 60, 0, 0, 0, 0}; #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name) #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name) /* -------- TYPES TABLE (END) -------- */ #if (PY_VERSION_HEX <= 0x02000000) # if !defined(SWIG_PYTHON_CLASSIC) # error "This python version requires swig to be run with the '-classic' option" # endif #endif #if (PY_VERSION_HEX <= 0x02020000) # error "This python version requires swig to be run with the '-nomodern' option" #endif #if (PY_VERSION_HEX <= 0x02020000) # error "This python version requires swig to be run with the '-nomodernargs' option" #endif /*----------------------------------------------- @(target):= _m2crypto.so ------------------------------------------------*/ #if PY_VERSION_HEX >= 0x03000000 # define SWIG_init PyInit__m2crypto #else # define SWIG_init init_m2crypto #endif #define SWIG_name "_m2crypto" #define SWIGVERSION 0x020010 #define SWIG_VERSION SWIGVERSION #define SWIG_as_voidptr(a) (void *)((const void *)(a)) #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) #ifdef _WIN32 #define _WINSOCKAPI_ #include #include #pragma comment(lib, "Ws2_32") typedef unsigned __int64 uint64_t; #endif #if defined __GNUC__ && __GNUC__ < 5 #pragma GCC diagnostic ignored "-Wunused-label" #pragma GCC diagnostic warning "-Wstrict-prototypes" #endif #include #include #include <_lib.h> #include #include #include "compile.h" static PyObject *ssl_verify_cb_func; static PyObject *ssl_info_cb_func; static PyObject *ssl_set_tmp_dh_cb_func; static PyObject *ssl_set_tmp_rsa_cb_func; static PyObject *x509_store_verify_cb_func; #define SWIG_From_long PyLong_FromLong SWIGINTERN swig_type_info* SWIG_pchar_descriptor(void) { static int init = 0; static swig_type_info* info = 0; if (!init) { info = SWIG_TypeQuery("_p_char"); init = 1; } return info; } SWIGINTERNINLINE PyObject * SWIG_FromCharPtrAndSize(const char* carray, size_t size) { if (carray) { if (size > INT_MAX) { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); return pchar_descriptor ? SWIG_InternalNewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void(); } else { #if PY_VERSION_HEX >= 0x03000000 return PyUnicode_FromStringAndSize(carray, (int)(size)); #else return PyString_FromStringAndSize(carray, (int)(size)); #endif } } else { return SWIG_Py_Void(); } } SWIGINTERNINLINE PyObject * SWIG_FromCharPtr(const char *cptr) { return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0)); } #include #if !defined(SWIG_NO_LLONG_MAX) # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) # define LLONG_MAX __LONG_LONG_MAX__ # define LLONG_MIN (-LLONG_MAX - 1LL) # define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL) # endif #endif SWIGINTERN int SWIG_AsVal_double (PyObject *obj, double *val) { int res = SWIG_TypeError; if (PyFloat_Check(obj)) { if (val) *val = PyFloat_AsDouble(obj); return SWIG_OK; } else if (PyInt_Check(obj)) { if (val) *val = PyInt_AsLong(obj); return SWIG_OK; } else if (PyLong_Check(obj)) { double v = PyLong_AsDouble(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_OK; } else { PyErr_Clear(); } } #ifdef SWIG_PYTHON_CAST_MODE { int dispatch = 0; double d = PyFloat_AsDouble(obj); if (!PyErr_Occurred()) { if (val) *val = d; return SWIG_AddCast(SWIG_OK); } else { PyErr_Clear(); } if (!dispatch) { long v = PyLong_AsLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_AddCast(SWIG_AddCast(SWIG_OK)); } else { PyErr_Clear(); } } } #endif return res; } #include #include SWIGINTERNINLINE int SWIG_CanCastAsInteger(double *d, double min, double max) { double x = *d; if ((min <= x && x <= max)) { double fx = floor(x); double cx = ceil(x); double rd = ((x - fx) < 0.5) ? fx : cx; /* simple rint */ if ((errno == EDOM) || (errno == ERANGE)) { errno = 0; } else { double summ, reps, diff; if (rd < x) { diff = x - rd; } else if (rd > x) { diff = rd - x; } else { return 1; } summ = rd + x; reps = diff/summ; if (reps < 8*DBL_EPSILON) { *d = rd; return 1; } } } return 0; } SWIGINTERN int SWIG_AsVal_long (PyObject *obj, long* val) { if (PyInt_Check(obj)) { if (val) *val = PyInt_AsLong(obj); return SWIG_OK; } else if (PyLong_Check(obj)) { long v = PyLong_AsLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_OK; } else { PyErr_Clear(); } } #ifdef SWIG_PYTHON_CAST_MODE { int dispatch = 0; long v = PyInt_AsLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_AddCast(SWIG_OK); } else { PyErr_Clear(); } if (!dispatch) { double d; int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) { if (val) *val = (long)(d); return res; } } } #endif return SWIG_TypeError; } SWIGINTERN int SWIG_AsVal_int (PyObject * obj, int *val) { long v; int res = SWIG_AsVal_long (obj, &v); if (SWIG_IsOK(res)) { if ((v < INT_MIN || v > INT_MAX)) { return SWIG_OverflowError; } else { if (val) *val = (int)(v); } } return res; } SWIGINTERNINLINE PyObject* SWIG_From_int (int value) { return PyInt_FromLong((long) value); } #include #include #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L #define CRYPTO_num_locks() (CRYPTO_NUM_LOCKS) static PyThread_type_lock lock_cs[CRYPTO_num_locks()]; static long lock_count[CRYPTO_num_locks()]; static int thread_mode = 0; #endif void threading_locking_callback(int mode, int type, const char *file, int line) { #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L if (mode & CRYPTO_LOCK) { PyThread_acquire_lock(lock_cs[type], WAIT_LOCK); lock_count[type]++; } else { PyThread_release_lock(lock_cs[type]); lock_count[type]--; } #endif } unsigned long threading_id_callback(void) { #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L return (unsigned long)PyThread_get_thread_ident(); #else return (unsigned long)0; #endif } void threading_init(void) { #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L int i; if (!thread_mode) { for (i=0; i #include #include #include #include #include #include #include #include #if OPENSSL_VERSION_NUMBER < 0x10100000L #include #include # define OPENSSL_zalloc(num) \ CRYPTO_zalloc(num, __FILE__, __LINE__) static void *CRYPTO_zalloc(size_t num, const char *file, int line) { void *ret = CRYPTO_malloc(num, file, line); if (ret != NULL) memset(ret, 0, num); return ret; } #include #ifndef BN_F_BN_GENCB_NEW # define BN_F_BN_GENCB_NEW 143 #endif # define BN_GENCB_get_arg(gencb) ((gencb)->arg) BN_GENCB *BN_GENCB_new(void) { BN_GENCB *ret; if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) { BNerr(BN_F_BN_GENCB_NEW, ERR_R_MALLOC_FAILURE); return (NULL); } return ret; } void BN_GENCB_free(BN_GENCB *cb) { if (cb == NULL) return; OPENSSL_free(cb); } int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d) { /* If the fields n and e in r are NULL, the corresponding input * parameters MUST be non-NULL for n and e. d may be * left NULL (in case only the public key is used). */ if ((r->n == NULL && n == NULL) || (r->e == NULL && e == NULL)) return 0; if (n != NULL) { BN_free(r->n); r->n = n; } if (e != NULL) { BN_free(r->e); r->e = e; } if (d != NULL) { BN_free(r->d); r->d = d; } return 1; } int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q) { /* If the fields p and q in r are NULL, the corresponding input * parameters MUST be non-NULL. */ if ((r->p == NULL && p == NULL) || (r->q == NULL && q == NULL)) return 0; if (p != NULL) { BN_free(r->p); r->p = p; } if (q != NULL) { BN_free(r->q); r->q = q; } return 1; } int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp) { /* If the fields dmp1, dmq1 and iqmp in r are NULL, the corresponding input * parameters MUST be non-NULL. */ if ((r->dmp1 == NULL && dmp1 == NULL) || (r->dmq1 == NULL && dmq1 == NULL) || (r->iqmp == NULL && iqmp == NULL)) return 0; if (dmp1 != NULL) { BN_free(r->dmp1); r->dmp1 = dmp1; } if (dmq1 != NULL) { BN_free(r->dmq1); r->dmq1 = dmq1; } if (iqmp != NULL) { BN_free(r->iqmp); r->iqmp = iqmp; } return 1; } void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d) { if (n != NULL) *n = r->n; if (e != NULL) *e = r->e; if (d != NULL) *d = r->d; } void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q) { if (p != NULL) *p = r->p; if (q != NULL) *q = r->q; } void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp) { if (dmp1 != NULL) *dmp1 = r->dmp1; if (dmq1 != NULL) *dmq1 = r->dmq1; if (iqmp != NULL) *iqmp = r->iqmp; } void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) { if (p != NULL) *p = d->p; if (q != NULL) *q = d->q; if (g != NULL) *g = d->g; } int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g) { /* If the fields p, q and g in d are NULL, the corresponding input * parameters MUST be non-NULL. */ if ((d->p == NULL && p == NULL) || (d->q == NULL && q == NULL) || (d->g == NULL && g == NULL)) return 0; if (p != NULL) { BN_free(d->p); d->p = p; } if (q != NULL) { BN_free(d->q); d->q = q; } if (g != NULL) { BN_free(d->g); d->g = g; } return 1; } void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key) { if (pub_key != NULL) *pub_key = d->pub_key; if (priv_key != NULL) *priv_key = d->priv_key; } int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key) { /* If the field pub_key in d is NULL, the corresponding input * parameters MUST be non-NULL. The priv_key field may * be left NULL. */ if (d->pub_key == NULL && pub_key == NULL) return 0; if (pub_key != NULL) { BN_free(d->pub_key); d->pub_key = pub_key; } if (priv_key != NULL) { BN_free(d->priv_key); d->priv_key = priv_key; } return 1; } void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) { if (pr != NULL) *pr = sig->r; if (ps != NULL) *ps = sig->s; } int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s) { if (r == NULL || s == NULL) return 0; BN_clear_free(sig->r); BN_clear_free(sig->s); sig->r = r; sig->s = s; return 1; } void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps) { if (pr != NULL) *pr = sig->r; if (ps != NULL) *ps = sig->s; } int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s) { if (r == NULL || s == NULL) return 0; BN_clear_free(sig->r); BN_clear_free(sig->s); sig->r = r; sig->s = s; return 1; } void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g) { if (p != NULL) *p = dh->p; if (q != NULL) *q = dh->q; if (g != NULL) *g = dh->g; } int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) { /* If the fields p and g in d are NULL, the corresponding input * parameters MUST be non-NULL. q may remain NULL. */ if ((dh->p == NULL && p == NULL) || (dh->g == NULL && g == NULL)) return 0; if (p != NULL) { BN_free(dh->p); dh->p = p; } if (q != NULL) { BN_free(dh->q); dh->q = q; } if (g != NULL) { BN_free(dh->g); dh->g = g; } if (q != NULL) { dh->length = BN_num_bits(q); } return 1; } void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key) { if (pub_key != NULL) *pub_key = dh->pub_key; if (priv_key != NULL) *priv_key = dh->priv_key; } int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key) { /* If the field pub_key in dh is NULL, the corresponding input * parameters MUST be non-NULL. The priv_key field may * be left NULL. */ if (dh->pub_key == NULL && pub_key == NULL) return 0; if (pub_key != NULL) { BN_free(dh->pub_key); dh->pub_key = pub_key; } if (priv_key != NULL) { BN_free(dh->priv_key); dh->priv_key = priv_key; } return 1; } int DH_set_length(DH *dh, long length) { dh->length = length; return 1; } const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx) { return ctx->iv; } unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx) { return ctx->iv; } EVP_MD_CTX *EVP_MD_CTX_new(void) { return OPENSSL_zalloc(sizeof(EVP_MD_CTX)); } void EVP_MD_CTX_free(EVP_MD_CTX *ctx) { EVP_MD_CTX_cleanup(ctx); OPENSSL_free(ctx); } int RSA_size(const RSA* rsa) { /* BIGNUM* n = NULL; RSA_get0_key(rsa, n, NULL, NULL); */ return BN_num_bytes(rsa->n); } RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth) { RSA_METHOD *ret; ret = OPENSSL_malloc(sizeof(RSA_METHOD)); if (ret != NULL) { memcpy(ret, meth, sizeof(*meth)); ret->name = OPENSSL_strdup(meth->name); if (ret->name == NULL) { OPENSSL_free(ret); return NULL; } } return ret; } int RSA_meth_set1_name(RSA_METHOD *meth, const char *name) { char *tmpname; tmpname = OPENSSL_strdup(name); if (tmpname == NULL) { return 0; } OPENSSL_free((char *)meth->name); meth->name = tmpname; return 1; } int RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)) { meth->rsa_priv_enc = priv_enc; return 1; } int RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)) { meth->rsa_priv_dec = priv_dec; return 1; } int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish) (RSA *rsa)) { meth->finish = finish; return 1; } void RSA_meth_free(RSA_METHOD *meth) { if (meth != NULL) { OPENSSL_free((char *)meth->name); OPENSSL_free(meth); } } int RSA_bits(const RSA *r) { return (BN_num_bits(r->n)); } RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey) { if (pkey->type != EVP_PKEY_RSA) { return NULL; } return pkey->pkey.rsa; } int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen) { /* Make sure encoding is valid */ if (i2d_X509_NAME(nm, NULL) <= 0) return 0; if (pder != NULL) *pder = (unsigned char *)nm->bytes->data; if (pderlen != NULL) *pderlen = nm->bytes->length; return 1; } #endif /* OPENSSL_VERSION_NUMBER */ #if PY_MAJOR_VERSION >= 3 FILE* PyFile_AsFile(PyObject *pyfile) { FILE* fp; int fd; const char *mode_str = NULL; PyObject *mode_obj; if ((fd = PyObject_AsFileDescriptor(pyfile)) == -1) { PyErr_SetString(PyExc_BlockingIOError, "Cannot find file handler for the Python file!"); return NULL; } if ((mode_obj = PyObject_GetAttrString(pyfile, "mode")) == NULL) { mode_str = "rb"; PyErr_Clear(); } else { /* convert to plain string * note that error checking is embedded in the function */ mode_str = PyUnicode_AsUTF8AndSize(mode_obj, NULL); } if((fp = fdopen(fd, mode_str)) == NULL) { PyErr_SetFromErrno(PyExc_IOError); } Py_XDECREF(mode_obj); return fp; } #else /* PY2K */ #define PyLong_FromLong(x) PyInt_FromLong(x) #define PyUnicode_AsUTF8(x) PyString_AsString(x) #endif /* PY_MAJOR_VERSION */ /* OpenSSL 1.0.2 copmatbility shim */ #if OPENSSL_VERSION_NUMBER < 0x10002000L typedef void (*OPENSSL_sk_freefunc)(void *); typedef void *(*OPENSSL_sk_copyfunc)(const void *); typedef struct stack_st OPENSSL_STACK; # define MIN_NODES 4 # define sk_deep_copy OPENSSL_sk_deep_copy void OPENSSL_sk_free(OPENSSL_STACK *st) { if (st == NULL) return; OPENSSL_free(st->data); OPENSSL_free(st); } OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *sk, OPENSSL_sk_copyfunc copy_func, OPENSSL_sk_freefunc free_func) { OPENSSL_STACK *ret; int i; if (sk->num < 0) return NULL; if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) return NULL; /* direct structure assignment */ *ret = *sk; ret->num_alloc = sk->num > MIN_NODES ? (size_t)sk->num : MIN_NODES; ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc); if (ret->data == NULL) { OPENSSL_free(ret); return NULL; } for (i = 0; i < ret->num; ++i) { if (sk->data[i] == NULL) continue; if ((ret->data[i] = copy_func(sk->data[i])) == NULL) { while (--i >= 0) if (ret->data[i] != NULL) free_func((void *)ret->data[i]); OPENSSL_sk_free(ret); return NULL; } } return ret; } #endif /* OpenSSL 1.0.2 copmatbility shim */ /* Blob interface. Deprecated. */ Blob *blob_new(int len, const char *errmsg) { Blob *blob; if (!(blob=(Blob *)PyMem_Malloc(sizeof(Blob)))){ PyErr_SetString(PyExc_MemoryError, errmsg); return NULL; } if (!(blob->data=(unsigned char *)PyMem_Malloc(len))) { PyMem_Free(blob); PyErr_SetString(PyExc_MemoryError, errmsg); return NULL; } blob->len=len; return blob; } Blob *blob_copy(Blob *from, const char *errmsg) { Blob *blob=blob_new(from->len, errmsg); if (!blob) { PyErr_SetString(PyExc_MemoryError, errmsg); return NULL; } memcpy(blob->data, from->data, from->len); return blob; } void blob_free(Blob *blob) { PyMem_Free(blob->data); PyMem_Free(blob); } /* Python helpers. */ static int m2_PyObject_AsReadBufferInt(PyObject *obj, const void **buffer, int *buffer_len) { int ret; Py_ssize_t len; ret = PyObject_AsReadBuffer(obj, buffer, &len); if (ret) return ret; if (len > INT_MAX) { PyErr_SetString(PyExc_ValueError, "object too large"); return -1; } *buffer_len = len; return 0; } static int m2_PyObject_GetBufferInt(PyObject *obj, Py_buffer *view, int flags) { int ret; if (PyObject_CheckBuffer(obj)) ret = PyObject_GetBuffer(obj, view, flags); else { const void *buf; ret = PyObject_AsReadBuffer(obj, &buf, &view->len); if (ret == 0) view->buf = (void *)buf; } if (ret) return ret; if (view->len > INT_MAX) { PyErr_SetString(PyExc_ValueError, "object too large"); m2_PyBuffer_Release(obj, view); return -1; } return 0; } static BIGNUM* m2_PyObject_AsBIGNUM(PyObject* value, PyObject* _py_exc) { BIGNUM* bn; const void* vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(bn = BN_mpi2bn((unsigned char *)vbuf, vlen, NULL))) { PyErr_SetString(_py_exc, ERR_reason_error_string(ERR_get_error())); return NULL; } return bn; } static void m2_PyBuffer_Release(PyObject *obj, Py_buffer *view) { if (PyObject_CheckBuffer(obj)) PyBuffer_Release(view); /* else do nothing, view->buf comes from PyObject_AsReadBuffer */ } static int m2_PyString_AsStringAndSizeInt(PyObject *obj, char **s, int *len) { int ret; Py_ssize_t len2; ret = PyBytes_AsStringAndSize(obj, s, &len2); if (ret) return ret; if (len2 > INT_MAX) { PyErr_SetString(PyExc_ValueError, "string too large"); return -1; } *len = len2; return 0; } /* Works as PyFile_Name, but always returns a new object. */ PyObject *m2_PyFile_Name(PyObject *pyfile) { PyObject *out = NULL; #if PY_MAJOR_VERSION >= 3 out = PyObject_GetAttrString(pyfile, "name"); #else out = PyFile_Name(pyfile); Py_XINCREF(out); #endif return out; } /* Yes, __FUNCTION__ is a non-standard symbol, but it is supported by * both gcc and MSVC. */ #define m2_PyErr_Msg(type) m2_PyErr_Msg_Caller(type, (const char*) __FUNCTION__) static void m2_PyErr_Msg_Caller(PyObject *err_type, const char* caller) { const char *err_reason; const char *data; int flags; /* This max size of a (longer than ours) OpenSSL error string is hardcoded * in OpenSSL's crypto/err/err_prn.c:ERR_print_errors_cb() */ char err_msg[4096]; unsigned long err_code = ERR_get_error_line_data(NULL, NULL, &data, &flags); if (err_code != 0) { err_reason = ERR_reason_error_string(err_code); if (data && (flags & ERR_TXT_STRING)) snprintf(err_msg, sizeof(err_msg), "%s (%s)", err_reason, data); else snprintf(err_msg, sizeof(err_msg), "%s", err_reason); PyErr_SetString(err_type, err_msg); } else { PyErr_Format(err_type, "Unknown error in function %s.", caller); } } /* C callbacks invoked by OpenSSL; these in turn call back into Python. */ int ssl_verify_callback(int ok, X509_STORE_CTX *ctx) { PyObject *argv, *ret; PyObject *_x509_store_ctx_swigptr=0, *_x509_store_ctx_obj=0, *_x509_store_ctx_inst=0, *_klass=0; PyObject *_x509=0, *_ssl_ctx=0; SSL *ssl; SSL_CTX *ssl_ctx; X509 *x509; int errnum, errdepth; int cret; int new_style_callback = 0, warning_raised_exception=0; PyGILState_STATE gilstate; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ ssl = (SSL *)X509_STORE_CTX_get_app_data(ctx); gilstate = PyGILState_Ensure(); if (PyMethod_Check(ssl_verify_cb_func)) { PyObject *func; PyCodeObject *code; func = PyMethod_Function(ssl_verify_cb_func); code = (PyCodeObject *) PyFunction_GetCode(func); if (code && code->co_argcount == 3) { /* XXX Python internals */ new_style_callback = 1; } } else if (PyFunction_Check(ssl_verify_cb_func)) { PyCodeObject *code = (PyCodeObject *) PyFunction_GetCode(ssl_verify_cb_func); if (code && code->co_argcount == 2) { /* XXX Python internals */ new_style_callback = 1; } } else { /* XXX There are lots of other callable types, but we will assume * XXX that any other type of callable uses the new style callback, * XXX although this is not entirely safe assumption. */ new_style_callback = 1; } if (new_style_callback) { PyObject *x509mod; x509mod = PyDict_GetItemString(PyImport_GetModuleDict(), "M2Crypto.X509"); _klass = PyObject_GetAttrString(x509mod, "X509_Store_Context"); _x509_store_ctx_swigptr = SWIG_NewPointerObj((void *)ctx, SWIGTYPE_p_X509_STORE_CTX, 0); _x509_store_ctx_obj = Py_BuildValue("(Oi)", _x509_store_ctx_swigptr, 0); _x509_store_ctx_inst = PyObject_CallObject(_klass, _x509_store_ctx_obj); argv = Py_BuildValue("(iO)", ok, _x509_store_ctx_inst); } else { if (PyErr_Warn(PyExc_DeprecationWarning, "Old style callback, use cb_func(ok, store) instead")) { warning_raised_exception = 1; } x509 = X509_STORE_CTX_get_current_cert(ctx); errnum = X509_STORE_CTX_get_error(ctx); errdepth = X509_STORE_CTX_get_error_depth(ctx); ssl = (SSL *)X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx()); ssl_ctx = SSL_get_SSL_CTX(ssl); _x509 = SWIG_NewPointerObj((void *)x509, SWIGTYPE_p_X509, 0); _ssl_ctx = SWIG_NewPointerObj((void *)ssl_ctx, SWIGTYPE_p_SSL_CTX, 0); argv = Py_BuildValue("(OOiii)", _ssl_ctx, _x509, errnum, errdepth, ok); } if (!warning_raised_exception) { ret = PyEval_CallObject(ssl_verify_cb_func, argv); } else { ret = 0; } if (!ret) { /* Got an exception in PyEval_CallObject(), let's fail verification * to be safe. */ cret = 0; } else { /* FIXME This is possibly problematic if ret > MAXINT */ cret = (int)PyLong_AsLong(ret); } Py_XDECREF(ret); Py_XDECREF(argv); if (new_style_callback) { Py_XDECREF(_x509_store_ctx_inst); Py_XDECREF(_x509_store_ctx_obj); Py_XDECREF(_x509_store_ctx_swigptr); Py_XDECREF(_klass); } else { Py_XDECREF(_x509); Py_XDECREF(_ssl_ctx); } PyGILState_Release(gilstate); return cret; } int x509_store_verify_callback(int ok, X509_STORE_CTX *ctx) { PyGILState_STATE gilstate; PyObject *argv, *ret; PyObject *_x509_store_ctx_swigptr=0, *_x509_store_ctx_obj=0, *_x509_store_ctx_inst=0, *_klass=0; int cret; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ PyObject *x509mod; gilstate = PyGILState_Ensure(); /* Below, handle only what is called 'new style callback' in ssl_verify_callback(). TODO: does 'old style callback' exist any more? */ x509mod = PyDict_GetItemString(PyImport_GetModuleDict(), "M2Crypto.X509"); _klass = PyObject_GetAttrString(x509mod, "X509_Store_Context"); _x509_store_ctx_swigptr = SWIG_NewPointerObj((void *)ctx, SWIGTYPE_p_X509_STORE_CTX, 0); _x509_store_ctx_obj = Py_BuildValue("(Oi)", _x509_store_ctx_swigptr, 0); _x509_store_ctx_inst = PyObject_CallObject(_klass, _x509_store_ctx_obj); argv = Py_BuildValue("(iO)", ok, _x509_store_ctx_inst); ret = PyEval_CallObject(x509_store_verify_cb_func, argv); if (!ret) { /* Got an exception in PyEval_CallObject(), let's fail verification * to be safe. */ cret = 0; } else { cret = (int)PyInt_AsLong(ret); } Py_XDECREF(ret); Py_XDECREF(argv); Py_XDECREF(_x509_store_ctx_inst); Py_XDECREF(_x509_store_ctx_obj); Py_XDECREF(_x509_store_ctx_swigptr); Py_XDECREF(_klass); PyGILState_Release(gilstate); return cret; } void ssl_info_callback(const SSL *s, int where, int ret) { PyObject *argv, *retval, *_SSL; PyGILState_STATE gilstate; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ gilstate = PyGILState_Ensure(); _SSL = SWIG_NewPointerObj((void *)s, SWIGTYPE_p_SSL, 0); argv = Py_BuildValue("(iiO)", where, ret, _SSL); retval = PyEval_CallObject(ssl_info_cb_func, argv); Py_XDECREF(retval); Py_XDECREF(argv); Py_XDECREF(_SSL); PyGILState_Release(gilstate); } DH *ssl_set_tmp_dh_callback(SSL *ssl, int is_export, int keylength) { PyObject *argv, *ret, *_ssl; DH *dh; PyGILState_STATE gilstate; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ gilstate = PyGILState_Ensure(); _ssl = SWIG_NewPointerObj((void *)ssl, SWIGTYPE_p_SSL, 0); argv = Py_BuildValue("(Oii)", _ssl, is_export, keylength); ret = PyEval_CallObject(ssl_set_tmp_dh_cb_func, argv); if ((SWIG_ConvertPtr(ret, (void **)&dh, SWIGTYPE_p_DH, SWIG_POINTER_EXCEPTION | 0)) == -1) dh = NULL; Py_XDECREF(ret); Py_XDECREF(argv); Py_XDECREF(_ssl); PyGILState_Release(gilstate); return dh; } RSA *ssl_set_tmp_rsa_callback(SSL *ssl, int is_export, int keylength) { PyObject *argv, *ret, *_ssl; RSA *rsa; PyGILState_STATE gilstate; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ gilstate = PyGILState_Ensure(); _ssl = SWIG_NewPointerObj((void *)ssl, SWIGTYPE_p_SSL, 0); argv = Py_BuildValue("(Oii)", _ssl, is_export, keylength); ret = PyEval_CallObject(ssl_set_tmp_rsa_cb_func, argv); if ((SWIG_ConvertPtr(ret, (void **)&rsa, SWIGTYPE_p_RSA, SWIG_POINTER_EXCEPTION | 0)) == -1) rsa = NULL; Py_XDECREF(ret); Py_XDECREF(argv); Py_XDECREF(_ssl); PyGILState_Release(gilstate); return rsa; } /* Universal callback for dh_generate_parameters, * dsa_generate_parametersm, and rsa_generate_key */ int bn_gencb_callback(int p, int n, BN_GENCB *gencb) { PyObject *argv, *ret, *cbfunc; cbfunc = (PyObject *)BN_GENCB_get_arg(gencb); argv = Py_BuildValue("(ii)", p, n); ret = PyEval_CallObject(cbfunc, argv); PyErr_Clear(); Py_DECREF(argv); Py_XDECREF(ret); return 1; } int passphrase_callback(char *buf, int num, int v, void *arg) { int i; Py_ssize_t len; char *str; PyObject *argv, *ret, *cbfunc; PyGILState_STATE gilstate; gilstate = PyGILState_Ensure(); cbfunc = (PyObject *)arg; argv = Py_BuildValue("(i)", v); /* PyEval_CallObject sets exception, if needed. */ ret = PyEval_CallObject(cbfunc, argv); Py_DECREF(argv); if (ret == NULL) { PyGILState_Release(gilstate); return -1; } if (!PyBytes_Check(ret)) { PyErr_SetString(PyExc_RuntimeError, "Result of callback is not bytes()."); Py_DECREF(ret); PyGILState_Release(gilstate); return -1; } if ((len = PyBytes_Size(ret)) > num) len = num; str = PyBytes_AsString(ret); for (i = 0; i < len; i++) buf[i] = str[i]; Py_DECREF(ret); PyGILState_Release(gilstate); return len; } void lib_init() { #if OPENSSL_VERSION_NUMBER < 0x10100000L SSLeay_add_all_algorithms(); ERR_load_ERR_strings(); #endif } /* Bignum routines that aren't not numerous enough to warrant a separate file. */ PyObject *bn_to_mpi(const BIGNUM *bn) { int len = 0; unsigned char *mpi; PyObject *pyo; len = BN_bn2mpi(bn, NULL); if (!(mpi=(unsigned char *)PyMem_Malloc(len))) { m2_PyErr_Msg(PyExc_MemoryError); return NULL; } len=BN_bn2mpi(bn, mpi); pyo=PyBytes_FromStringAndSize((const char *)mpi, len); PyMem_Free(mpi); return pyo; } const BIGNUM *mpi_to_bn(PyObject *value) { const void *vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; return BN_mpi2bn(vbuf, vlen, NULL); } PyObject *bn_to_bin(BIGNUM *bn) { int len = 0; unsigned char *bin; PyObject *pyo; len = BN_num_bytes(bn); if (!(bin=(unsigned char *)PyMem_Malloc(len))) { PyErr_SetString(PyExc_MemoryError, "bn_to_bin"); return NULL; } BN_bn2bin(bn, bin); pyo=PyBytes_FromStringAndSize((const char *)bin, len); PyMem_Free(bin); return pyo; } const BIGNUM *bin_to_bn(PyObject *value) { const void *vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; return BN_bin2bn(vbuf, vlen, NULL); } PyObject *bn_to_hex(BIGNUM *bn) { char *hex; PyObject *pyo; Py_ssize_t len = 0; hex = BN_bn2hex(bn); if (!hex) { m2_PyErr_Msg(PyExc_RuntimeError); OPENSSL_free(hex); return NULL; } len = strlen(hex); pyo=PyBytes_FromStringAndSize(hex, len); OPENSSL_free(hex); return pyo; } BIGNUM *hex_to_bn(PyObject *value) { const void *vbuf; Py_ssize_t vlen = 0; BIGNUM *bn; if (PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1) return NULL; if ((bn=BN_new())==NULL) { PyErr_SetString(PyExc_MemoryError, "hex_to_bn"); return NULL; } if (BN_hex2bn(&bn, (const char *)vbuf) <= 0) { m2_PyErr_Msg(PyExc_RuntimeError); BN_free(bn); return NULL; } return bn; } BIGNUM *dec_to_bn(PyObject *value) { const void *vbuf; Py_ssize_t vlen = 0; BIGNUM *bn; if (PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1) return NULL; if ((bn=BN_new())==NULL) { PyErr_SetString(PyExc_MemoryError, "dec_to_bn"); return NULL; } if ((BN_dec2bn(&bn, (const char *)vbuf) <= 0)) { m2_PyErr_Msg(PyExc_RuntimeError); BN_free(bn); return NULL; } return bn; } SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_long (unsigned long value) { return (value > LONG_MAX) ? PyLong_FromUnsignedLong(value) : PyLong_FromLong((long)(value)); } SWIGINTERN int SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) { #if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(obj)) { long v = PyInt_AsLong(obj); if (v >= 0) { if (val) *val = v; return SWIG_OK; } else { return SWIG_OverflowError; } } else #endif if (PyLong_Check(obj)) { unsigned long v = PyLong_AsUnsignedLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_OK; } else { PyErr_Clear(); #if PY_VERSION_HEX >= 0x03000000 { long v = PyLong_AsLong(obj); if (!PyErr_Occurred()) { if (v < 0) { return SWIG_OverflowError; } } else { PyErr_Clear(); } } #endif } } #ifdef SWIG_PYTHON_CAST_MODE { int dispatch = 0; unsigned long v = PyLong_AsUnsignedLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_AddCast(SWIG_OK); } else { PyErr_Clear(); } if (!dispatch) { double d; int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d)); if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) { if (val) *val = (unsigned long)(d); return res; } } } #endif return SWIG_TypeError; } #include static PyObject *_bio_err; void pyfd_init(void); void bio_init(PyObject *bio_err) { Py_INCREF(bio_err); _bio_err = bio_err; pyfd_init(); } int bio_free(BIO *bio) { int ret; Py_BEGIN_ALLOW_THREADS ret = BIO_free(bio); Py_END_ALLOW_THREADS if (ret == 0) { m2_PyErr_Msg(_bio_err); } return ret; } BIO * bio_new_file(const char *filename, const char *mode) { BIO *ret; Py_BEGIN_ALLOW_THREADS ret = BIO_new_file(filename, mode); Py_END_ALLOW_THREADS if (ret == NULL) { m2_PyErr_Msg(_bio_err); } return ret; } BIO *bio_new_pyfile(PyObject *pyfile, int bio_close) { FILE *fp = NULL; BIO *bio = NULL; fp = PyFile_AsFile(pyfile); bio = BIO_new_fp(fp, bio_close); /* returns NULL if error occurred */ if (bio == NULL) { /* Find out the name of the file so we can have good error * message. */ PyObject *pyname = m2_PyFile_Name(pyfile); char *name = PyBytes_AsString(pyname); if (name == NULL) { PyErr_Format(_bio_err, "Opening of the new BIO on file failed!"); } else { PyErr_Format(_bio_err, "Opening of the new BIO on file %s failed!", name); } Py_DECREF(pyname); } return bio; } PyObject *bio_read(BIO *bio, int num) { PyObject *blob; void *buf; int r; if (!(buf = PyMem_Malloc(num))) { PyErr_SetString(PyExc_MemoryError, "bio_read"); return NULL; } Py_BEGIN_ALLOW_THREADS r = BIO_read(bio, buf, num); Py_END_ALLOW_THREADS if (r < 0) { PyMem_Free(buf); if (ERR_peek_error()) { m2_PyErr_Msg(_bio_err); return NULL; } Py_RETURN_NONE; } blob = PyBytes_FromStringAndSize(buf, r); PyMem_Free(buf); return blob; } PyObject *bio_gets(BIO *bio, int num) { PyObject *blob; void *buf; int r; if (!(buf = PyMem_Malloc(num))) { PyErr_SetString(PyExc_MemoryError, "bio_gets"); return NULL; } Py_BEGIN_ALLOW_THREADS r = BIO_gets(bio, buf, num); Py_END_ALLOW_THREADS if (r < 1) { PyMem_Free(buf); if (ERR_peek_error()) { m2_PyErr_Msg(_bio_err); return NULL; } Py_RETURN_NONE; } blob = PyBytes_FromStringAndSize(buf, r); PyMem_Free(buf); return blob; } int bio_write(BIO *bio, PyObject *from) { const void *fbuf; int flen = 0, ret; if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1) return -1; Py_BEGIN_ALLOW_THREADS ret = BIO_write(bio, fbuf, flen); Py_END_ALLOW_THREADS if (ret < 0) { if (ERR_peek_error()) { m2_PyErr_Msg(_bio_err); return -1; } } return ret; } /* XXX Casting size_t to int. */ int bio_ctrl_pending(BIO *bio) { return (int)BIO_ctrl_pending(bio); } int bio_ctrl_wpending(BIO *bio) { return (int)BIO_ctrl_wpending(bio); } int bio_ctrl_get_write_guarantee(BIO *a) { return BIO_ctrl_get_write_guarantee(a); } int bio_reset(BIO *bio) { return (int)BIO_reset(bio); } SWIGINTERN int SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { #if PY_VERSION_HEX>=0x03000000 if (PyUnicode_Check(obj)) #else if (PyString_Check(obj)) #endif { char *cstr; Py_ssize_t len; #if PY_VERSION_HEX>=0x03000000 if (!alloc && cptr) { /* We can't allow converting without allocation, since the internal representation of string in Python 3 is UCS-2/UCS-4 but we require a UTF-8 representation. TODO(bhy) More detailed explanation */ return SWIG_RuntimeError; } obj = PyUnicode_AsUTF8String(obj); PyBytes_AsStringAndSize(obj, &cstr, &len); if(alloc) *alloc = SWIG_NEWOBJ; #else PyString_AsStringAndSize(obj, &cstr, &len); #endif if (cptr) { if (alloc) { /* In python the user should not be able to modify the inner string representation. To warranty that, if you define SWIG_PYTHON_SAFE_CSTRINGS, a new/copy of the python string buffer is always returned. The default behavior is just to return the pointer value, so, be careful. */ #if defined(SWIG_PYTHON_SAFE_CSTRINGS) if (*alloc != SWIG_OLDOBJ) #else if (*alloc == SWIG_NEWOBJ) #endif { *cptr = (char *)memcpy((char *)malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); *alloc = SWIG_NEWOBJ; } else { *cptr = cstr; *alloc = SWIG_OLDOBJ; } } else { #if PY_VERSION_HEX>=0x03000000 assert(0); /* Should never reach here in Python 3 */ #endif *cptr = SWIG_Python_str_AsChar(obj); } } if (psize) *psize = len + 1; #if PY_VERSION_HEX>=0x03000000 Py_XDECREF(obj); #endif return SWIG_OK; } else { swig_type_info* pchar_descriptor = SWIG_pchar_descriptor(); if (pchar_descriptor) { void* vptr = 0; if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) { if (cptr) *cptr = (char *) vptr; if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0; if (alloc) *alloc = SWIG_OLDOBJ; return SWIG_OK; } } } return SWIG_TypeError; } int bio_flush(BIO *bio) { return (int)BIO_flush(bio); } int bio_seek(BIO *bio, int offset) { return (int)BIO_seek(bio, offset); } int bio_tell(BIO* bio) { return BIO_tell(bio); } void bio_set_flags(BIO *bio, int flags) { BIO_set_flags(bio, flags); } int bio_get_flags(BIO *bio) { return BIO_get_flags(bio); } /* * sets the cipher of BIO @param b to c using key @param key and IV @iv. * @param enc should be set to 1 for encryption and zero to decryption. * */ PyObject *bio_set_cipher(BIO *b, EVP_CIPHER *c, PyObject *key, PyObject *iv, int op) { const void *kbuf, *ibuf; Py_ssize_t klen, ilen; if ((PyObject_AsReadBuffer(key, &kbuf, &klen) == -1) || (PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1)) return NULL; BIO_set_cipher(b, (const EVP_CIPHER *)c, (unsigned char *)kbuf, (unsigned char *)ibuf, op); Py_RETURN_NONE; } int bio_set_mem_eof_return(BIO *b, int v) { return (int)BIO_set_mem_eof_return(b, v); } int bio_get_fd(BIO *bio) { return BIO_get_fd(bio, NULL); } int bio_do_handshake(BIO *bio) { return BIO_do_handshake(bio); } /* macro */ int bio_make_bio_pair(BIO* b1, BIO* b2) { return BIO_make_bio_pair(b1, b2); } int bio_set_write_buf_size(BIO* b, size_t size) { return BIO_set_write_buf_size(b, size); } int bio_should_retry(BIO* a) { return BIO_should_retry(a); } int bio_should_read(BIO* a) { return BIO_should_read(a); } int bio_should_write(BIO* a) { return BIO_should_write(a); } /* Macros for things not defined before 1.1.0 */ #if OPENSSL_VERSION_NUMBER < 0x10100000L static BIO_METHOD * BIO_meth_new( int type, const char *name ) { BIO_METHOD *method = malloc( sizeof(BIO_METHOD) ); memset( method, 0, sizeof(BIO_METHOD) ); method->type = type; method->name = name; return method; } static void BIO_meth_free( BIO_METHOD *meth ) { if ( meth == NULL ) { return; } free(meth); } #define BIO_meth_set_write(m, f) (m)->bwrite = (f) #define BIO_meth_set_read(m, f) (m)->bread = (f) #define BIO_meth_set_puts(m, f) (m)->bputs = (f) #define BIO_meth_set_gets(m, f) (m)->bgets = (f) #define BIO_meth_set_ctrl(m, f) (m)->ctrl = (f) #define BIO_meth_set_create(m, f) (m)->create = (f) #define BIO_meth_set_destroy(m, f) (m)->destroy = (f) #define BIO_set_shutdown(b, x) (b)->shutdown = x #define BIO_get_shutdown(b) (b)->shutdown #define BIO_set_init(b, x) b->init = x #define BIO_get_init(b) (b)->init #define BIO_set_data(b, x) b->ptr = x #define BIO_clear_flags(b, x) b->flags &= ~(x) #define BIO_get_data(b) b->ptr #endif /* implment custom BIO_s_pyfd */ #ifdef _WIN32 # define clear_sys_error() SetLastError(0) /* Linux doesn't use underscored calls yet */ # define open(p, f, m) _open(p, f, m) # define read(f, b, n) _read(f, b, n) # define write(f, b, n) _write(f, b, n) # define close(f) _close(f) # define lseek(fd, o, w) _lseek(fd, o, w) #else # define clear_sys_error() errno=0 #endif typedef struct pyfd_struct { int fd; } BIO_PYFD_CTX; /* Setting up methods_fdp */ static BIO_METHOD *methods_fdp; static int pyfd_write(BIO *b, const char *in, int inl) { int ret, fd; if (BIO_get_fd(b, &fd) == -1) { PyErr_SetString(_bio_err, "BIO has not been initialized."); return -1; } clear_sys_error(); ret = write(fd, in, inl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_fd_should_retry(ret)) BIO_set_retry_write(b); } return ret; } static int pyfd_read(BIO *b, char *out, int outl) { int ret = 0, fd; if (BIO_get_fd(b, &fd) == -1) { PyErr_SetString(_bio_err, "BIO has not been initialized."); return -1; } if (out != NULL) { clear_sys_error(); ret = read(fd, out, outl); BIO_clear_retry_flags(b); if (ret <= 0) { if (BIO_fd_should_retry(ret)) BIO_set_retry_read(b); } } return ret; } static int pyfd_puts(BIO *bp, const char *str) { int n, ret; n = strlen(str); ret = pyfd_write(bp, str, n); return ret; } static int pyfd_gets(BIO *bp, char *buf, int size) { int ret = 0; char *ptr = buf; char *end = buf + size - 1; /* See https://github.com/openssl/openssl/pull/3442 We were here just repeating a bug from OpenSSL */ while (ptr < end && pyfd_read(bp, ptr, 1) > 0) { if (*ptr++ == '\n') break; } ptr[0] = '\0'; if (buf[0] != '\0') ret = strlen(buf); return ret; } static int pyfd_new(BIO* b) { BIO_PYFD_CTX* ctx; ctx = OPENSSL_zalloc(sizeof(*ctx)); if (ctx == NULL) return 0; ctx->fd = -1; BIO_set_data(b, ctx); BIO_set_shutdown(b, 0); BIO_set_init(b, 1); return 1; } static int pyfd_free(BIO* b) { BIO_PYFD_CTX* ctx; if (b == 0) return 0; ctx = BIO_get_data(b); if (ctx == NULL) return 0; if (BIO_get_shutdown(b) && BIO_get_init(b)) close(ctx->fd); BIO_set_data(b, NULL); BIO_set_shutdown(b, 0); BIO_set_init(b, 0); OPENSSL_free(ctx); return 1; } static long pyfd_ctrl(BIO *b, int cmd, long num, void *ptr) { BIO_PYFD_CTX* ctx; int *ip; long ret = 1; ctx = BIO_get_data(b); if (ctx == NULL) return 0; switch (cmd) { case BIO_CTRL_RESET: num = 0; case BIO_C_FILE_SEEK: ret = (long)lseek(ctx->fd, num, 0); break; case BIO_C_FILE_TELL: case BIO_CTRL_INFO: ret = (long)lseek(ctx->fd, 0, 1); break; case BIO_C_SET_FD: pyfd_free(b); if (*((int *)ptr) > -1) { if (!pyfd_new(b) || !(ctx = BIO_get_data(b))) return 0; ctx->fd = *((int *)ptr); BIO_set_shutdown(b, (int)num); BIO_set_init(b, 1); } break; case BIO_C_GET_FD: if (BIO_get_init(b)) { ip = (int *)ptr; if (ip != NULL) *ip = ctx->fd; ret = ctx->fd; } else ret = -1; break; case BIO_CTRL_GET_CLOSE: ret = BIO_get_shutdown(b); break; case BIO_CTRL_SET_CLOSE: BIO_set_shutdown(b, (int)num); break; case BIO_CTRL_PENDING: case BIO_CTRL_WPENDING: ret = 0; break; case BIO_CTRL_DUP: case BIO_CTRL_FLUSH: ret = 1; break; default: ret = 0; break; } return ret; } void pyfd_init(void) { #if OPENSSL_VERSION_NUMBER >= 0x10100000L methods_fdp = BIO_meth_new( BIO_get_new_index()|BIO_TYPE_DESCRIPTOR|BIO_TYPE_SOURCE_SINK, "python file descriptor"); #else methods_fdp = BIO_meth_new( 100 |BIO_TYPE_DESCRIPTOR|BIO_TYPE_SOURCE_SINK, "python file descriptor"); #endif BIO_meth_set_write(methods_fdp, pyfd_write); BIO_meth_set_read(methods_fdp, pyfd_read); BIO_meth_set_puts(methods_fdp, pyfd_puts); BIO_meth_set_gets(methods_fdp, pyfd_gets); BIO_meth_set_ctrl(methods_fdp, pyfd_ctrl); BIO_meth_set_create(methods_fdp, pyfd_new); BIO_meth_set_destroy(methods_fdp, pyfd_free); } BIO* BIO_new_pyfd(int fd, int close_flag) { BIO *ret; ret = BIO_new(methods_fdp); BIO_set_fd(ret, fd, close_flag); return ret; } SWIGINTERNINLINE int SWIG_AsVal_size_t (PyObject * obj, size_t *val) { unsigned long v; int res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); if (SWIG_IsOK(res) && val) *val = (size_t)(v); return res; } #include PyObject *bn_rand(int bits, int top, int bottom) { BIGNUM* rnd; PyObject *ret; char *randhex; rnd = BN_new(); if (rnd == NULL) { m2_PyErr_Msg(PyExc_Exception); return NULL; } if (!BN_rand(rnd, bits, top, bottom)) { /*Custom errors?*/ m2_PyErr_Msg(PyExc_Exception); BN_free(rnd); return NULL; } randhex = BN_bn2hex(rnd); if (!randhex) { /*Custom errors?*/ m2_PyErr_Msg(PyExc_Exception); BN_free(rnd); return NULL; } BN_free(rnd); ret = PyLong_FromString(randhex, NULL, 16); OPENSSL_free(randhex); return ret; } PyObject *bn_rand_range(PyObject *range) { BIGNUM* rnd; BIGNUM *rng = NULL; PyObject *ret, *tuple; PyObject *format, *rangePyString; char *randhex; /* PyLong_FromString is unhappy with const */ const char *rangehex; /* Wow, it's a lot of work to convert into a hex string in C! */ format = PyUnicode_FromString("%x"); if (!format) { PyErr_SetString(PyExc_RuntimeError, "Cannot create Python string '%x'"); return NULL; } tuple = PyTuple_New(1); if (!tuple) { Py_DECREF(format); PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails"); return NULL; } Py_INCREF(range); PyTuple_SET_ITEM(tuple, 0, range); rangePyString = PyUnicode_Format(format, tuple); if (!rangePyString) { PyErr_SetString(PyExc_Exception, "String Format failed"); Py_DECREF(format); Py_DECREF(tuple); return NULL; } Py_DECREF(format); Py_DECREF(tuple); rangehex = (const char*)PyUnicode_AsUTF8(rangePyString); if (!BN_hex2bn(&rng, rangehex)) { /*Custom errors?*/ m2_PyErr_Msg(PyExc_Exception); Py_DECREF(rangePyString); return NULL; } Py_DECREF(rangePyString); if (!(rnd = BN_new())) { PyErr_SetString(PyExc_MemoryError, "bn_rand_range"); return NULL; } if (!BN_rand_range(rnd, rng)) { /*Custom errors?*/ m2_PyErr_Msg(PyExc_Exception); BN_free(rnd); BN_free(rng); return NULL; } BN_free(rng); randhex = BN_bn2hex(rnd); if (!randhex) { /*Custom errors?*/ m2_PyErr_Msg(PyExc_Exception); BN_free(rnd); return NULL; } BN_free(rnd); ret = PyLong_FromString(randhex, NULL, 16); OPENSSL_free(randhex); return ret; } static PyObject *_rand_err; void rand_init(PyObject *rand_err) { Py_INCREF(rand_err); _rand_err = rand_err; } PyObject *rand_seed(PyObject *seed) { const void *buf; int len = 0; m2_PyObject_AsReadBufferInt(seed, &buf, &len); RAND_seed(buf, len); Py_RETURN_NONE; } PyObject *rand_add(PyObject *blob, double entropy) { const void *buf; int len = 0; m2_PyObject_AsReadBufferInt(blob, &buf, &len); RAND_add(buf, len, entropy); Py_RETURN_NONE; } PyObject *rand_bytes(int n) { void *blob; int ret; PyObject *obj; if (!(blob = PyMem_Malloc(n))) { PyErr_SetString(PyExc_MemoryError, "Insufficient memory for rand_bytes."); return NULL; } if ((ret = RAND_bytes(blob, n)) == 1) { obj = PyBytes_FromStringAndSize(blob, n); PyMem_Free(blob); return obj; } else if (ret == 0) { PyErr_SetString(_rand_err, "Not enough randomness."); PyMem_Free(blob); return NULL; } else if (ret == -1) { PyErr_SetString(_rand_err, "Not supported by the current RAND method."); PyMem_Free(blob); return NULL; } else { PyMem_Free(blob); m2_PyErr_Msg(_rand_err); return NULL; } } PyObject *rand_pseudo_bytes(int n) { int ret; unsigned char *blob; PyObject *tuple; if (!(blob=(unsigned char *)PyMem_Malloc(n))) { PyErr_SetString(PyExc_MemoryError, "Insufficient memory for rand_pseudo_bytes."); return NULL; } if (!(tuple=PyTuple_New(2))) { PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails"); PyMem_Free(blob); return NULL; } ret = RAND_pseudo_bytes(blob, n); if (ret == -1) { PyMem_Free(blob); Py_DECREF(tuple); PyErr_SetString(_rand_err, "Function RAND_pseudo_bytes not supported by the current RAND method."); return NULL; } else { PyTuple_SET_ITEM(tuple, 0, PyBytes_FromStringAndSize((char*)blob, n)); PyMem_Free(blob); PyTuple_SET_ITEM(tuple, 1, PyLong_FromLong((long)ret)); return tuple; } } PyObject *rand_file_name(void) { PyObject *obj; char *str; if ((obj = PyBytes_FromStringAndSize(NULL, BUFSIZ))==NULL) { PyErr_SetString(PyExc_MemoryError, "rand_file_name"); return NULL; } str=PyBytes_AS_STRING(obj); if (RAND_file_name(str, BUFSIZ)==NULL) { PyErr_SetString(PyExc_RuntimeError, "rand_file_name"); return NULL; } if (_PyBytes_Resize(&obj, (Py_ssize_t)strlen(str))!=0) return NULL; /* mem exception set by _PyBytes_Resize */ return obj; } void rand_screen(void) { #ifdef _WIN32 RAND_screen(); #endif } int rand_win32_event(unsigned int imsg, int wparam, long lparam) { #ifdef _WIN32 return RAND_event(imsg, wparam, lparam); #else return 0; #endif } SWIGINTERN int SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val) { unsigned long v; int res = SWIG_AsVal_unsigned_SS_long (obj, &v); if (SWIG_IsOK(res)) { if ((v > UINT_MAX)) { return SWIG_OverflowError; } else { if (val) *val = (unsigned int)(v); } } return res; } #include #include #include #include #include #include #if OPENSSL_VERSION_NUMBER < 0x10100000L HMAC_CTX *HMAC_CTX_new(void) { HMAC_CTX *ret = PyMem_Malloc(sizeof(HMAC_CTX)); HMAC_CTX_init(ret); return ret; } #define HMAC_CTX_reset(ctx) HMAC_CTX_init(ctx) #define HMAC_CTX_free(ctx) \ do { \ HMAC_CTX_cleanup(ctx); \ PyMem_Free((void *)ctx); \ } while(0) #define EVP_CIPHER_CTX_reset(ctx) EVP_CIPHER_CTX_init(ctx) #endif #define PKCS5_SALT_LEN 8 static PyObject *_evp_err; void evp_init(PyObject *evp_err) { Py_INCREF(evp_err); _evp_err = evp_err; } RSA *pkey_get1_rsa(EVP_PKEY *pkey) { RSA *ret = NULL; if ((ret = EVP_PKEY_get1_RSA(pkey)) == NULL) { /* _evp_err now inherits from PyExc_ValueError, so we should * keep API intact. */ PyErr_Format(_evp_err, "Invalid key in function %s.", __FUNCTION__); } return ret; } PyObject *pkcs5_pbkdf2_hmac_sha1(PyObject *pass, PyObject *salt, int iter, int keylen) { unsigned char *key; unsigned char *saltbuf; char *passbuf; PyObject *ret; int passlen = 0, saltlen = 0; if (m2_PyObject_AsReadBufferInt(pass, (const void **)&passbuf, &passlen) == -1) return NULL; if (m2_PyObject_AsReadBufferInt(salt, (const void **)&saltbuf, &saltlen) == -1) return NULL; key = PyMem_Malloc(keylen); if (key == NULL) return PyErr_NoMemory(); PKCS5_PBKDF2_HMAC_SHA1(passbuf, passlen, saltbuf, saltlen, iter, keylen, key); ret = PyBytes_FromStringAndSize((char*)key, keylen); OPENSSL_cleanse(key, keylen); PyMem_Free(key); return ret; } EVP_MD_CTX *md_ctx_new(void) { EVP_MD_CTX *ctx; if (!(ctx = EVP_MD_CTX_create())) { PyErr_SetString(PyExc_MemoryError, "md_ctx_new"); return NULL; } return ctx; } void md_ctx_free(EVP_MD_CTX *ctx) { EVP_MD_CTX_destroy(ctx); } int digest_update(EVP_MD_CTX *ctx, PyObject *blob) { const void *buf; Py_ssize_t len; if (PyObject_AsReadBuffer(blob, &buf, &len) == -1) return -1; return EVP_DigestUpdate(ctx, buf, len); } PyObject *digest_final(EVP_MD_CTX *ctx) { void *blob; int blen; PyObject *ret; if (!(blob = PyMem_Malloc(EVP_MD_CTX_size(ctx)))) { PyErr_SetString(PyExc_MemoryError, "digest_final"); return NULL; } if (!EVP_DigestFinal(ctx, blob, (unsigned int *)&blen)) { PyMem_Free(blob); m2_PyErr_Msg(_evp_err); return NULL; } ret = PyBytes_FromStringAndSize(blob, blen); PyMem_Free(blob); return ret; } HMAC_CTX *hmac_ctx_new(void) { HMAC_CTX *ctx; if (!(ctx = HMAC_CTX_new())) { PyErr_SetString(PyExc_MemoryError, "hmac_ctx_new"); return NULL; } return ctx; } void hmac_ctx_free(HMAC_CTX *ctx) { HMAC_CTX_free(ctx); } PyObject *hmac_init(HMAC_CTX *ctx, PyObject *key, const EVP_MD *md) { const void *kbuf; int klen = 0; if (m2_PyObject_AsReadBufferInt(key, &kbuf, &klen) == -1) return NULL; if (!HMAC_Init_ex(ctx, kbuf, klen, md, NULL)) { PyErr_SetString(_evp_err, "HMAC_Init failed"); return NULL; } Py_RETURN_NONE; } PyObject *hmac_update(HMAC_CTX *ctx, PyObject *blob) { const void *buf; Py_ssize_t len; if (PyObject_AsReadBuffer(blob, &buf, &len) == -1) return NULL; if (!HMAC_Update(ctx, buf, len)) { PyErr_SetString(_evp_err, "HMAC_Update failed"); return NULL; } Py_RETURN_NONE; } PyObject *hmac_final(HMAC_CTX *ctx) { void *blob; int blen; PyObject *ret; if (!(blob = PyMem_Malloc(HMAC_size(ctx)))) { PyErr_SetString(PyExc_MemoryError, "hmac_final"); return NULL; } if (!HMAC_Final(ctx, blob, (unsigned int *)&blen)) { PyErr_SetString(_evp_err, "HMAC_Final failed"); return NULL; } ret = PyBytes_FromStringAndSize(blob, blen); PyMem_Free(blob); return ret; } PyObject *hmac(PyObject *key, PyObject *data, const EVP_MD *md) { const void *kbuf, *dbuf; void *blob; int klen = 0; unsigned int blen; Py_ssize_t dlen; PyObject *ret; if ((m2_PyObject_AsReadBufferInt(key, &kbuf, &klen) == -1) || (PyObject_AsReadBuffer(data, &dbuf, &dlen) == -1)) return NULL; if (!(blob = PyMem_Malloc(EVP_MAX_MD_SIZE))) { PyErr_SetString(PyExc_MemoryError, "hmac"); return NULL; } HMAC(md, kbuf, klen, dbuf, dlen, blob, &blen); blob = PyMem_Realloc(blob, blen); ret = PyBytes_FromStringAndSize(blob, blen); PyMem_Free(blob); return ret; } EVP_CIPHER_CTX *cipher_ctx_new(void) { EVP_CIPHER_CTX *ctx; if (!(ctx = EVP_CIPHER_CTX_new())) { PyErr_SetString(PyExc_MemoryError, "cipher_ctx_new"); return NULL; } EVP_CIPHER_CTX_reset(ctx); return ctx; } void cipher_ctx_free(EVP_CIPHER_CTX *ctx) { EVP_CIPHER_CTX_free(ctx); } PyObject *bytes_to_key(const EVP_CIPHER *cipher, EVP_MD *md, PyObject *data, PyObject *salt, PyObject *iv, /* Not used */ int iter) { unsigned char key[EVP_MAX_KEY_LENGTH]; const void *dbuf, *sbuf; int dlen = 0, klen; Py_ssize_t slen; PyObject *ret; if ((m2_PyObject_AsReadBufferInt(data, &dbuf, &dlen) == -1) || (PyObject_AsReadBuffer(salt, &sbuf, &slen) == -1)) return NULL; assert((slen == 8) || (slen == 0)); klen = EVP_BytesToKey(cipher, md, (unsigned char *)sbuf, (unsigned char *)dbuf, dlen, iter, key, NULL); /* Since we are not returning IV no need to derive it */ ret = PyBytes_FromStringAndSize((char*)key, klen); return ret; } PyObject *cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher, PyObject *key, PyObject *iv, int mode) { const void *kbuf, *ibuf; Py_ssize_t klen, ilen; if ((PyObject_AsReadBuffer(key, &kbuf, &klen) == -1) || (PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1)) return NULL; if (!EVP_CipherInit(ctx, cipher, (unsigned char *)kbuf, (unsigned char *)ibuf, mode)) { m2_PyErr_Msg(_evp_err); return NULL; } Py_RETURN_NONE; } PyObject *cipher_update(EVP_CIPHER_CTX *ctx, PyObject *blob) { const void *buf; int len = 0, olen; void *obuf; PyObject *ret; if (m2_PyObject_AsReadBufferInt(blob, &buf, &len) == -1) return NULL; if (!(obuf = PyMem_Malloc(len + EVP_CIPHER_CTX_block_size(ctx) - 1))) { PyErr_SetString(PyExc_MemoryError, "cipher_update"); return NULL; } if (!EVP_CipherUpdate(ctx, obuf, &olen, (unsigned char *)buf, len)) { PyMem_Free(obuf); m2_PyErr_Msg(_evp_err); return NULL; } ret = PyBytes_FromStringAndSize(obuf, olen); PyMem_Free(obuf); return ret; } PyObject *cipher_final(EVP_CIPHER_CTX *ctx) { void *obuf; int olen; PyObject *ret; if (!(obuf = PyMem_Malloc(EVP_CIPHER_CTX_block_size(ctx)))) { PyErr_SetString(PyExc_MemoryError, "cipher_final"); return NULL; } if (!EVP_CipherFinal(ctx, (unsigned char *)obuf, &olen)) { PyMem_Free(obuf); m2_PyErr_Msg(_evp_err); return NULL; } ret = PyBytes_FromStringAndSize(obuf, olen); PyMem_Free(obuf); return ret; } PyObject *sign_update(EVP_MD_CTX *ctx, PyObject *blob) { const void *buf; Py_ssize_t len; if (PyObject_AsReadBuffer(blob, &buf, &len) == -1) return NULL; if (!EVP_SignUpdate(ctx, buf, len)) { m2_PyErr_Msg(_evp_err); return NULL; } Py_RETURN_NONE; } PyObject *sign_final(EVP_MD_CTX *ctx, EVP_PKEY *pkey) { PyObject *ret; unsigned char *sigbuf; unsigned int siglen = EVP_PKEY_size(pkey); sigbuf = (unsigned char*)OPENSSL_malloc(siglen); if (!sigbuf) { PyErr_SetString(PyExc_MemoryError, "sign_final"); return NULL; } if (!EVP_SignFinal(ctx, sigbuf, &siglen, pkey)) { m2_PyErr_Msg(_evp_err); OPENSSL_cleanse(sigbuf, siglen); OPENSSL_free(sigbuf); return NULL; } ret = PyBytes_FromStringAndSize((char*)sigbuf, siglen); OPENSSL_cleanse(sigbuf, siglen); OPENSSL_free(sigbuf); return ret; } int verify_update(EVP_MD_CTX *ctx, PyObject *blob) { const void *buf; Py_ssize_t len; if (PyObject_AsReadBuffer(blob, &buf, &len) == -1) return -1; return EVP_VerifyUpdate(ctx, buf, len); } int verify_final(EVP_MD_CTX *ctx, PyObject *blob, EVP_PKEY *pkey) { unsigned char *kbuf; int len = 0; if (m2_PyObject_AsReadBufferInt(blob, (const void **)&kbuf, &len) == -1) return -1; return EVP_VerifyFinal(ctx, kbuf, len, pkey); } const EVP_MD *get_digestbyname(const char* name) { const EVP_MD *ret = NULL; if ((ret = EVP_get_digestbyname(name)) == NULL) { m2_PyErr_Msg(_evp_err); } return ret; } int pkey_write_pem_no_cipher(EVP_PKEY *pkey, BIO *f, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_PKCS8PrivateKey(f, pkey, NULL, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } int pkey_write_pem(EVP_PKEY *pkey, BIO *f, EVP_CIPHER *cipher, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_PKCS8PrivateKey(f, pkey, cipher, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } EVP_PKEY *pkey_new(void) { EVP_PKEY *ret; if ((ret = EVP_PKEY_new()) == NULL) { PyErr_Format(PyExc_MemoryError, "Insufficient memory for new key in function %s.", __FUNCTION__); } return ret; } EVP_PKEY *pkey_read_pem(BIO *f, PyObject *pyfunc) { EVP_PKEY *pk; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS pk = PEM_read_bio_PrivateKey(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); if (pk == NULL) { PyErr_Format(_evp_err, "Unable to read private key in function %s.", __FUNCTION__); } return pk; } EVP_PKEY *pkey_read_pem_pubkey(BIO *f, PyObject *pyfunc) { EVP_PKEY *pk; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS pk = PEM_read_bio_PUBKEY(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); if (pk == NULL) { PyErr_Format(_evp_err, "Unable to read public key in function %s.", __FUNCTION__); } return pk; } int pkey_assign_rsa(EVP_PKEY *pkey, RSA *rsa) { return EVP_PKEY_assign_RSA(pkey, rsa); } PyObject *pkey_as_der(EVP_PKEY *pkey) { unsigned char * pp = NULL; int len; PyObject * der; len = i2d_PUBKEY(pkey, &pp); if (len < 0){ PyErr_SetString(_evp_err, "EVP_PKEY as DER failed"); return NULL; } der = PyBytes_FromStringAndSize((char*)pp, len); OPENSSL_free(pp); return der; } PyObject *pkey_get_modulus(EVP_PKEY *pkey) { RSA *rsa; DSA *dsa; BIO *bio; BUF_MEM *bptr; PyObject *ret; const BIGNUM* bn; switch (EVP_PKEY_base_id(pkey)) { case EVP_PKEY_RSA: rsa = EVP_PKEY_get1_RSA(pkey); bio = BIO_new(BIO_s_mem()); if (!bio) { RSA_free(rsa); PyErr_SetString(PyExc_MemoryError, "pkey_get_modulus"); return NULL; } RSA_get0_key(rsa, &bn, NULL, NULL); if (!BN_print(bio, bn)) { m2_PyErr_Msg(PyExc_RuntimeError); BIO_free(bio); RSA_free(rsa); return NULL; } BIO_get_mem_ptr(bio, &bptr); ret = PyBytes_FromStringAndSize(bptr->data, bptr->length); (void)BIO_set_close(bio, BIO_CLOSE); BIO_free(bio); RSA_free(rsa); return ret; break; case EVP_PKEY_DSA: dsa = EVP_PKEY_get1_DSA(pkey); bio = BIO_new(BIO_s_mem()); if (!bio) { DSA_free(dsa); PyErr_SetString(PyExc_MemoryError, "pkey_get_modulus"); return NULL; } DSA_get0_key(dsa, &bn, NULL); if (!BN_print(bio, bn)) { m2_PyErr_Msg(PyExc_RuntimeError); BIO_free(bio); DSA_free(dsa); return NULL; } BIO_get_mem_ptr(bio, &bptr); ret = PyBytes_FromStringAndSize(bptr->data, bptr->length); (void)BIO_set_close(bio, BIO_CLOSE); BIO_free(bio); DSA_free(dsa); return ret; break; default: PyErr_SetString(_evp_err, "unsupported key type"); return NULL; } } #include #if OPENSSL_VERSION_NUMBER >= 0x0090800fL #include #endif /* // 2004-10-10, ngps: // CTR mode is not included in the default OpenSSL build. // To use the AES CTR ciphers, link with your own copy of OpenSSL. */ #ifdef HAVE_AES_CTR extern EVP_CIPHER const *EVP_aes_128_ctr(void); extern EVP_CIPHER const *EVP_aes_192_ctr(void); extern EVP_CIPHER const *EVP_aes_256_ctr(void); #endif AES_KEY *aes_new(void) { AES_KEY *key; if (!(key = (AES_KEY *)PyMem_Malloc(sizeof(AES_KEY)))) { PyErr_SetString(PyExc_MemoryError, "Insufficient memory for AES key."); return NULL; } return key; } void AES_free(AES_KEY *key) { PyMem_Free((void *)key); } /* // op == 0: encrypt // otherwise: decrypt (Python code will supply the value 1.) */ PyObject *AES_set_key(AES_KEY *key, PyObject *value, int bits, int op) { char *vbuf; Py_ssize_t vlen; if (PyBytes_AsStringAndSize(value, &vbuf, &vlen) == -1) return NULL; if (op == 0) AES_set_encrypt_key((const unsigned char *)vbuf, bits, key); else AES_set_decrypt_key((const unsigned char *)vbuf, bits, key); Py_RETURN_NONE; } /* // op == 0: encrypt // otherwise: decrypt (Python code will supply the value 1.) */ PyObject *AES_crypt(const AES_KEY *key, PyObject *in, int outlen, int op) { char *buf; Py_ssize_t len; unsigned char *out; PyObject *res; if (PyBytes_AsStringAndSize(in, &buf, &len) == -1) return NULL; if (!(out=(unsigned char *)PyMem_Malloc(outlen))) { PyErr_SetString(PyExc_MemoryError, "AES_crypt"); return NULL; } if (op == 0) AES_encrypt((const unsigned char *)buf, out, key); else AES_decrypt((const unsigned char *)buf, out, key); res = PyBytes_FromStringAndSize((char*)out, outlen); PyMem_Free(out); return res; } int AES_type_check(AES_KEY *key) { return 1; } #include RC4_KEY *rc4_new(void) { RC4_KEY *key; if (!(key = (RC4_KEY *)PyMem_Malloc(sizeof(RC4_KEY)))) PyErr_SetString(PyExc_MemoryError, "rc4_new"); return key; } void rc4_free(RC4_KEY *key) { PyMem_Free((void *)key); } PyObject *rc4_set_key(RC4_KEY *key, PyObject *value) { const void *vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; RC4_set_key(key, vlen, vbuf); Py_RETURN_NONE; } PyObject *rc4_update(RC4_KEY *key, PyObject *in) { PyObject *ret; const void *buf; Py_ssize_t len; void *out; if (PyObject_AsReadBuffer(in, &buf, &len) == -1) return NULL; if (!(out = PyMem_Malloc(len))) { PyErr_SetString(PyExc_MemoryError, "expected a string object"); return NULL; } RC4(key, len, buf, out); ret = PyBytes_FromStringAndSize(out, len); PyMem_Free(out); return ret; } int rc4_type_check(RC4_KEY *key) { return 1; } #include #include #include #include #include static PyObject *_dh_err; void dh_init(PyObject *dh_err) { Py_INCREF(dh_err); _dh_err = dh_err; } int dh_type_check(DH *dh) { /* Our getting here means we passed Swig's type checking, XXX Still need to check the pointer for sanity? */ return 1; } DH *dh_read_parameters(BIO *bio) { return PEM_read_bio_DHparams(bio, NULL, NULL, NULL); } DH *dh_generate_parameters(int plen, int g, PyObject *pyfunc) { DH *dh; BN_GENCB *gencb; int ret; if ((gencb=BN_GENCB_new()) == NULL) { m2_PyErr_Msg(_dh_err); return NULL; } if ((dh=DH_new()) == NULL) { m2_PyErr_Msg(_dh_err); BN_GENCB_free(gencb); return NULL; } BN_GENCB_set(gencb, bn_gencb_callback, (void *)pyfunc); Py_INCREF(pyfunc); ret = DH_generate_parameters_ex(dh, plen, g, gencb); Py_DECREF(pyfunc); BN_GENCB_free(gencb); if (ret) return dh; m2_PyErr_Msg(_dh_err); DH_free(dh); return NULL; } /* Note return value shenanigan. */ int dh_check(DH *dh) { int err; return (DH_check(dh, &err)) ? 0 : err; } PyObject *dh_compute_key(DH *dh, PyObject *pubkey) { const void *pkbuf; int pklen = 0, klen; void *key; BIGNUM *pk; PyObject *ret; if (m2_PyObject_AsReadBufferInt(pubkey, &pkbuf, &pklen) == -1) return NULL; if (!(pk = BN_mpi2bn((unsigned char *)pkbuf, pklen, NULL))) { m2_PyErr_Msg(_dh_err); return NULL; } if (!(key = PyMem_Malloc(DH_size(dh)))) { BN_free(pk); PyErr_SetString(PyExc_MemoryError, "dh_compute_key"); return NULL; } if ((klen = DH_compute_key((unsigned char *)key, pk, dh)) == -1) { BN_free(pk); PyMem_Free(key); m2_PyErr_Msg(_dh_err); return NULL; } ret = PyBytes_FromStringAndSize((const char *)key, klen); BN_free(pk); PyMem_Free(key); return ret; } PyObject *dh_get_p(DH *dh) { const BIGNUM* p = NULL; DH_get0_pqg(dh, &p, NULL, NULL); if (!p) { PyErr_SetString(_dh_err, "'p' is unset"); return NULL; } return bn_to_mpi(p); } PyObject *dh_get_g(DH *dh) { const BIGNUM* g = NULL; DH_get0_pqg(dh, NULL, NULL, &g); if (!g) { PyErr_SetString(_dh_err, "'g' is unset"); return NULL; } return bn_to_mpi(g); } PyObject *dh_get_pub(DH *dh) { const BIGNUM* pub_key = NULL; DH_get0_key(dh, &pub_key, NULL); if (!pub_key) { PyErr_SetString(_dh_err, "'pub' is unset"); return NULL; } return bn_to_mpi(pub_key); } PyObject *dh_get_priv(DH *dh) { const BIGNUM* priv_key = NULL; DH_get0_key(dh, NULL, &priv_key); if (!priv_key) { PyErr_SetString(_dh_err, "'priv' is unset"); return NULL; } return bn_to_mpi(priv_key); } PyObject *dh_set_pg(DH *dh, PyObject *pval, PyObject* gval) { BIGNUM* p, *g; if (!(p = m2_PyObject_AsBIGNUM(pval, _dh_err)) || !(g = m2_PyObject_AsBIGNUM(gval, _dh_err))) return NULL; if (!DH_set0_pqg(dh, p, NULL, g)) { PyErr_SetString(_dh_err, "Cannot set prime number or generator of Z_p for DH."); BN_free(p); BN_free(g); return NULL; } Py_RETURN_NONE; } #include #include #include #include #include static PyObject *_rsa_err; void rsa_init(PyObject *rsa_err) { Py_INCREF(rsa_err); _rsa_err = rsa_err; } RSA *rsa_read_key(BIO *f, PyObject *pyfunc) { RSA *rsa; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS rsa = PEM_read_bio_RSAPrivateKey(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return rsa; } int rsa_write_key(RSA *rsa, BIO *f, EVP_CIPHER *cipher, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_RSAPrivateKey(f, rsa, cipher, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } int rsa_write_key_no_cipher(RSA *rsa, BIO *f, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_RSAPrivateKey(f, rsa, NULL, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } RSA *rsa_read_pub_key(BIO *f) { return PEM_read_bio_RSA_PUBKEY(f, NULL, NULL, NULL); } int rsa_write_pub_key(RSA *rsa, BIO *f) { return PEM_write_bio_RSA_PUBKEY(f, rsa); } PyObject *rsa_get_e(RSA *rsa) { const BIGNUM* e = NULL; RSA_get0_key(rsa, NULL, &e, NULL); if (!e) { PyErr_SetString(_rsa_err, "'e' is unset"); return NULL; } return bn_to_mpi(e); } PyObject *rsa_get_n(RSA *rsa) { const BIGNUM* n = NULL; RSA_get0_key(rsa, &n, NULL, NULL); if (!n) { PyErr_SetString(_rsa_err, "'n' is unset"); return NULL; } return bn_to_mpi(n); } PyObject *rsa_set_e(RSA *rsa, PyObject *eval) { const BIGNUM* n_read = NULL; BIGNUM* n = NULL; BIGNUM* e; if (!(e = m2_PyObject_AsBIGNUM(eval, _rsa_err))) { return NULL; } /* n and e must be set at the same time so if e is unset, set it to zero */ RSA_get0_key(rsa, &n_read, NULL, NULL); if (!n_read) { n = BN_new(); } if (RSA_set0_key(rsa, n, e, NULL) != 1) { PyErr_SetString(_rsa_err, "Cannot set fields of RSA object."); BN_free(e); BN_free(n); return NULL; } Py_RETURN_NONE; } PyObject *rsa_set_n(RSA *rsa, PyObject *nval) { BIGNUM* n; const BIGNUM* e_read = NULL; BIGNUM* e = NULL; if (!(n = m2_PyObject_AsBIGNUM(nval, _rsa_err))) { return NULL; } /* n and e must be set at the same time so if e is unset, set it to zero */ RSA_get0_key(rsa, NULL, &e_read, NULL); if (!e_read) { e = BN_new(); } if (RSA_set0_key(rsa, n, e, NULL) != 1) { PyErr_SetString(_rsa_err, "Cannot set fields of RSA object."); BN_free(n); BN_free(e); return NULL; } Py_RETURN_NONE; } PyObject *rsa_set_en(RSA *rsa, PyObject *eval, PyObject* nval) { BIGNUM* e, *n; if (!(e = m2_PyObject_AsBIGNUM(eval, _rsa_err)) || !(n = m2_PyObject_AsBIGNUM(nval, _rsa_err))) { return NULL; } if (!RSA_set0_key(rsa, n, e, NULL)) { PyErr_SetString(_rsa_err, "Cannot set fields of RSA object."); BN_free(e); BN_free(n); return NULL; } Py_RETURN_NONE; } static BIGNUM* PyObject_Bin_AsBIGNUM(PyObject* value) { BIGNUM* bn; const void* vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(bn = BN_bin2bn((unsigned char *)vbuf, vlen, NULL))) { m2_PyErr_Msg(_rsa_err); return NULL; } return bn; } PyObject *rsa_set_en_bin(RSA *rsa, PyObject *eval, PyObject* nval) { BIGNUM* e, *n; if (!(e = PyObject_Bin_AsBIGNUM(eval)) || !(n = PyObject_Bin_AsBIGNUM(nval))) { return NULL; } if (!RSA_set0_key(rsa, e, n, NULL)) { PyErr_SetString(_rsa_err, "Cannot set fields of RSA object."); BN_free(e); BN_free(n); return NULL; } Py_RETURN_NONE; } PyObject *rsa_private_encrypt(RSA *rsa, PyObject *from, int padding) { const void *fbuf; void *tbuf; int flen = 0, tlen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1) return NULL; if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) { PyErr_SetString(PyExc_MemoryError, "rsa_private_encrypt"); return NULL; } tlen = RSA_private_encrypt(flen, (unsigned char *)fbuf, (unsigned char *)tbuf, rsa, padding); if (tlen == -1) { m2_PyErr_Msg(_rsa_err); PyMem_Free(tbuf); return NULL; } ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen); PyMem_Free(tbuf); return ret; } PyObject *rsa_public_decrypt(RSA *rsa, PyObject *from, int padding) { const void *fbuf; void *tbuf; int flen = 0, tlen = 0; PyObject *ret; if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1) return NULL; /* OpenSSL docs are confused here: it says we only need buffer * 'RSA_size()-11', but it is true only for RSA PKCS#1 type 1 * padding. For other uses we need to use different sizes. */ if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) { PyErr_SetString(PyExc_MemoryError, "rsa_public_decrypt"); return NULL; } tlen = RSA_public_decrypt(flen, (unsigned char *)fbuf, (unsigned char *)tbuf, rsa, padding); if (tlen == -1) { m2_PyErr_Msg(_rsa_err); PyMem_Free(tbuf); return NULL; } ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen); PyMem_Free(tbuf); return ret; } PyObject *rsa_public_encrypt(RSA *rsa, PyObject *from, int padding) { const void *fbuf; void *tbuf; int flen = 0, tlen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1) return NULL; if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) { PyErr_SetString(PyExc_MemoryError, "rsa_public_encrypt"); return NULL; } tlen = RSA_public_encrypt(flen, (unsigned char *)fbuf, (unsigned char *)tbuf, rsa, padding); if (tlen == -1) { m2_PyErr_Msg(_rsa_err); PyMem_Free(tbuf); return NULL; } ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen); PyMem_Free(tbuf); return ret; } PyObject *rsa_private_decrypt(RSA *rsa, PyObject *from, int padding) { const void *fbuf; void *tbuf; int flen = 0, tlen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1) return NULL; if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) { PyErr_SetString(PyExc_MemoryError, "rsa_private_decrypt"); return NULL; } tlen = RSA_private_decrypt(flen, (unsigned char *)fbuf, (unsigned char *)tbuf, rsa, padding); if (tlen == -1) { m2_PyErr_Msg(_rsa_err); PyMem_Free(tbuf); return NULL; } ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen); PyMem_Free(tbuf); return ret; } #if OPENSSL_VERSION_NUMBER >= 0x0090708fL PyObject *rsa_padding_add_pkcs1_pss(RSA *rsa, PyObject *digest, EVP_MD *hash, int salt_length) { const void *dbuf; unsigned char *tbuf; int dlen, result, tlen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(digest, &dbuf, &dlen) == -1) return NULL; tlen = RSA_size(rsa); if (!(tbuf = OPENSSL_malloc(tlen))) { PyErr_SetString(PyExc_MemoryError, "rsa_padding_add_pkcs1_pss"); return NULL; } result = RSA_padding_add_PKCS1_PSS( rsa, tbuf, (unsigned char *)dbuf, hash, salt_length); if (result == -1) { m2_PyErr_Msg(_rsa_err); OPENSSL_cleanse(tbuf, tlen); OPENSSL_free(tbuf); return NULL; } ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen); OPENSSL_cleanse(tbuf, tlen); OPENSSL_free(tbuf); return ret; } int rsa_verify_pkcs1_pss(RSA *rsa, PyObject *digest, PyObject *signature, EVP_MD *hash, int salt_length) { const void *dbuf; const void *sbuf; int dlen, slen, ret; if (m2_PyObject_AsReadBufferInt(digest, &dbuf, &dlen) == -1) { return 0; } if (m2_PyObject_AsReadBufferInt(signature, &sbuf, &slen) == -1) { return 0; } ret = RSA_verify_PKCS1_PSS( rsa, (unsigned char *)dbuf, hash, (unsigned char *)sbuf, salt_length); return ret; } #endif PyObject *rsa_sign(RSA *rsa, PyObject *py_digest_string, int method_type) { int digest_len = 0; int buf_len = 0; int ret = 0; unsigned int real_buf_len = 0; char *digest_string = NULL; unsigned char * sign_buf = NULL; PyObject *signature; ret = m2_PyString_AsStringAndSizeInt(py_digest_string, &digest_string, &digest_len); if (ret == -1) { /* PyString_AsStringAndSize raises the correct exceptions. */ return NULL; } buf_len = RSA_size(rsa); sign_buf = (unsigned char *)PyMem_Malloc(buf_len); ret = RSA_sign(method_type, (const unsigned char *)digest_string, digest_len, sign_buf, &real_buf_len, rsa); if (!ret) { m2_PyErr_Msg(_rsa_err); PyMem_Free(sign_buf); return NULL; } signature = PyBytes_FromStringAndSize((const char*) sign_buf, buf_len); PyMem_Free(sign_buf); return signature; } int rsa_verify(RSA *rsa, PyObject *py_verify_string, PyObject* py_sign_string, int method_type){ int ret = 0; char * sign_string = NULL; char * verify_string = NULL; int verify_len = 0; int sign_len = 0; ret = m2_PyString_AsStringAndSizeInt(py_verify_string, &verify_string, &verify_len); if (ret == -1) { /* PyString_AsStringAndSize raises the correct exceptions. */ return 0; } ret = m2_PyString_AsStringAndSizeInt(py_sign_string, &sign_string, &sign_len); if (ret == -1) { return 0; } ret = RSA_verify(method_type, (unsigned char *) verify_string, verify_len, (unsigned char *) sign_string, sign_len, rsa); if (!ret) { m2_PyErr_Msg(_rsa_err); return 0; } return ret; } PyObject *rsa_generate_key(int bits, unsigned long e, PyObject *pyfunc) { RSA *rsa; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ BN_GENCB *gencb; BIGNUM *e_big; int ret; if ((e_big=BN_new()) == NULL) { m2_PyErr_Msg(_rsa_err); return NULL; } if (BN_set_word(e_big, e) == 0) { m2_PyErr_Msg(_rsa_err); BN_free(e_big); return NULL; } if ((gencb=BN_GENCB_new()) == NULL) { m2_PyErr_Msg(_rsa_err); BN_free(e_big); return NULL; } if ((rsa = RSA_new()) == NULL) { m2_PyErr_Msg(_rsa_err); BN_free(e_big); BN_GENCB_free(gencb); return NULL; } BN_GENCB_set(gencb, bn_gencb_callback, (void *) pyfunc); Py_INCREF(pyfunc); ret = RSA_generate_key_ex(rsa, bits, e_big, gencb); BN_free(e_big); BN_GENCB_free(gencb); Py_DECREF(pyfunc); if (ret) return SWIG_NewPointerObj((void *)rsa, SWIGTYPE_p_RSA, 0); m2_PyErr_Msg(_rsa_err); RSA_free(rsa); return NULL; } int rsa_type_check(RSA *rsa) { return 1; } int rsa_check_pub_key(RSA *rsa) { const BIGNUM* n, *e; RSA_get0_key(rsa, &n, &e, NULL); return n && e; } int rsa_write_key_der(RSA *rsa, BIO *bio) { return i2d_RSAPrivateKey_bio(bio, rsa); } #include #include #include #include PyObject *dsa_sig_get_r(DSA_SIG *dsa_sig) { const BIGNUM* pr; DSA_SIG_get0(dsa_sig, &pr, NULL); return bn_to_mpi(pr); } PyObject *dsa_sig_get_s(DSA_SIG *dsa_sig) { const BIGNUM* qs; DSA_SIG_get0(dsa_sig, NULL, &qs); return bn_to_mpi(qs); } static PyObject *_dsa_err; void dsa_init(PyObject *dsa_err) { Py_INCREF(dsa_err); _dsa_err = dsa_err; } DSA *dsa_generate_parameters(int bits, PyObject *pyfunc) { DSA *dsa; BN_GENCB *gencb; int ret; if ((gencb=BN_GENCB_new()) == NULL) { m2_PyErr_Msg(_dh_err); return NULL; } if ((dsa = DSA_new()) == NULL) { m2_PyErr_Msg(_dsa_err); BN_GENCB_free(gencb); return NULL; } BN_GENCB_set(gencb, bn_gencb_callback, (void *) pyfunc); Py_INCREF(pyfunc); ret = DSA_generate_parameters_ex(dsa, bits, NULL, 0, NULL, NULL, gencb); Py_DECREF(pyfunc); BN_GENCB_free(gencb); if (ret) return dsa; m2_PyErr_Msg(_dsa_err); DSA_free(dsa); return NULL; } DSA *dsa_read_params(BIO *f, PyObject *pyfunc) { DSA *ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_read_bio_DSAparams(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); if (ret == NULL) { m2_PyErr_Msg(_dsa_err); } return ret; } DSA *dsa_read_key(BIO *f, PyObject *pyfunc) { DSA *ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_read_bio_DSAPrivateKey(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); if (ret == NULL) { m2_PyErr_Msg(_dsa_err); } return ret; } DSA *dsa_read_pub_key(BIO *f, PyObject *pyfunc) { DSA *ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_read_bio_DSA_PUBKEY(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); if (ret == NULL) { m2_PyErr_Msg(_dsa_err); } return ret; } PyObject *dsa_get_p(DSA *dsa) { const BIGNUM* p = NULL; DSA_get0_pqg(dsa, &p, NULL, NULL); if (!p) { PyErr_SetString(_dsa_err, "'p' is unset"); return NULL; } return bn_to_mpi(p); } PyObject *dsa_get_q(DSA *dsa) { const BIGNUM* q = NULL; DSA_get0_pqg(dsa, NULL, &q, NULL); if (!q) { PyErr_SetString(_dsa_err, "'q' is unset"); return NULL; } return bn_to_mpi(q); } PyObject *dsa_get_g(DSA *dsa) { const BIGNUM* g = NULL; DSA_get0_pqg(dsa, NULL, NULL, &g); if (!g) { PyErr_SetString(_dsa_err, "'g' is unset"); return NULL; } return bn_to_mpi(g); } PyObject *dsa_get_pub(DSA *dsa) { const BIGNUM* pub_key = NULL; DSA_get0_key(dsa, &pub_key, NULL); if (!pub_key) { PyErr_SetString(_dsa_err, "'pub' is unset"); return NULL; } return bn_to_mpi(pub_key); } PyObject *dsa_get_priv(DSA *dsa) { const BIGNUM* priv_key = NULL; DSA_get0_key(dsa, NULL, &priv_key); if (!priv_key) { PyErr_SetString(_dsa_err, "'priv' is unset"); return NULL; } return bn_to_mpi(priv_key); } PyObject *dsa_set_pqg(DSA *dsa, PyObject *pval, PyObject* qval, PyObject* gval) { BIGNUM* p, *q, *g; if (!(p = m2_PyObject_AsBIGNUM(pval, _dsa_err)) || !(q = m2_PyObject_AsBIGNUM(qval, _dsa_err)) || !(g = m2_PyObject_AsBIGNUM(gval, _dsa_err))) return NULL; if (!DSA_set0_pqg(dsa, p, q, g)) { PyErr_SetString( _dsa_err, "Cannot set prime number, subprime, or generator of subgroup for DSA."); BN_free(p); BN_free(q); BN_free(g); return NULL; } Py_RETURN_NONE; } PyObject *dsa_set_pub(DSA *dsa, PyObject *value) { BIGNUM *bn; const void *vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(bn = BN_mpi2bn((unsigned char *)vbuf, vlen, NULL))) { m2_PyErr_Msg(_dsa_err); return NULL; } if (!DSA_set0_key(dsa, bn, NULL)) { BN_free(bn); PyErr_SetString(_dsa_err, "Cannot set private and public key for DSA."); } Py_RETURN_NONE; } int dsa_write_params_bio(DSA* dsa, BIO* f) { return PEM_write_bio_DSAparams(f, dsa); } int dsa_write_key_bio(DSA* dsa, BIO* f, EVP_CIPHER *cipher, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_DSAPrivateKey(f, dsa, cipher, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } int dsa_write_key_bio_no_cipher(DSA* dsa, BIO* f, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_DSAPrivateKey(f, dsa, NULL, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } int dsa_write_pub_key_bio(DSA* dsa, BIO* f) { return PEM_write_bio_DSA_PUBKEY(f, dsa); } PyObject *dsa_sign(DSA *dsa, PyObject *value) { const void *vbuf; int vlen = 0; PyObject *tuple; DSA_SIG *sig; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(sig = DSA_do_sign(vbuf, vlen, dsa))) { m2_PyErr_Msg(_dsa_err); return NULL; } if (!(tuple = PyTuple_New(2))) { DSA_SIG_free(sig); PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails"); return NULL; } PyTuple_SET_ITEM(tuple, 0, dsa_sig_get_r(sig)); PyTuple_SET_ITEM(tuple, 1, dsa_sig_get_s(sig)); DSA_SIG_free(sig); return tuple; } int dsa_verify(DSA *dsa, PyObject *value, PyObject *r, PyObject *s) { const void *vbuf, *rbuf, *sbuf; int vlen = 0, rlen = 0, slen = 0; DSA_SIG *sig; BIGNUM* pr, *ps; int ret; if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) || (m2_PyObject_AsReadBufferInt(r, &rbuf, &rlen) == -1) || (m2_PyObject_AsReadBufferInt(s, &sbuf, &slen) == -1)) return -1; if (!(sig = DSA_SIG_new())) { m2_PyErr_Msg(_dsa_err); return -1; } if (!(pr = BN_mpi2bn((unsigned char *)rbuf, rlen, NULL))) { m2_PyErr_Msg(_dsa_err); DSA_SIG_free(sig); return -1; } if (!(ps = BN_mpi2bn((unsigned char *)sbuf, slen, NULL))) { m2_PyErr_Msg(_dsa_err); DSA_SIG_free(sig); BN_free(pr); return -1; } if (!DSA_SIG_set0(sig, pr, ps)) { m2_PyErr_Msg(_dsa_err); DSA_SIG_free(sig); BN_free(pr); BN_free(ps); return -1; } ret = DSA_do_verify(vbuf, vlen, sig, dsa); DSA_SIG_free(sig); if (ret == -1) m2_PyErr_Msg(_dsa_err); return ret; } PyObject *dsa_sign_asn1(DSA *dsa, PyObject *value) { const void *vbuf; int vlen = 0; void *sigbuf; unsigned int siglen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(sigbuf = PyMem_Malloc(DSA_size(dsa)))) { PyErr_SetString(PyExc_MemoryError, "dsa_sign_asn1"); return NULL; } if (!DSA_sign(0, vbuf, vlen, (unsigned char *)sigbuf, &siglen, dsa)) { m2_PyErr_Msg(_dsa_err); PyMem_Free(sigbuf); return NULL; } ret = PyBytes_FromStringAndSize(sigbuf, siglen); PyMem_Free(sigbuf); return ret; } int dsa_verify_asn1(DSA *dsa, PyObject *value, PyObject *sig) { const void *vbuf; void *sbuf; int vlen = 0, slen = 0, ret = 0; if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) || (m2_PyObject_AsReadBufferInt(sig, (const void **)&sbuf, &slen) == -1)) return -1; if ((ret = DSA_verify(0, vbuf, vlen, sbuf, slen, dsa)) == -1) m2_PyErr_Msg(_dsa_err); return ret; } int dsa_check_key(DSA *dsa) { const BIGNUM* pub_key, *priv_key; DSA_get0_key(dsa, &pub_key, &priv_key); return pub_key != NULL && priv_key != NULL; } int dsa_check_pub_key(DSA *dsa) { const BIGNUM* pub_key; DSA_get0_key(dsa, &pub_key, NULL); return pub_key ? 1 : 0; } int dsa_keylen(DSA *dsa) { const BIGNUM* p; DSA_get0_pqg(dsa, &p, NULL, NULL); return BN_num_bits(p); } int dsa_type_check(DSA *dsa) { return 1; } #include #include #include #include #include #include #include #ifdef _WIN32 #include #include #pragma comment(lib, "Ws2_32") typedef unsigned __int64 uint64_t; #else #include #include #endif static PyObject *_ssl_err; static PyObject *_ssl_timeout_err; void ssl_init(PyObject *ssl_err, PyObject *ssl_timeout_err) { SSL_library_init(); SSL_load_error_strings(); Py_INCREF(ssl_err); Py_INCREF(ssl_timeout_err); _ssl_err = ssl_err; _ssl_timeout_err = ssl_timeout_err; } const SSL_METHOD *tlsv1_method(void) { #if OPENSSL_VERSION_NUMBER >= 0x10100000L PyErr_WarnEx(PyExc_DeprecationWarning, "Function TLSv1_method has been deprecated.", 1); #endif return TLSv1_method(); } void ssl_ctx_passphrase_callback(SSL_CTX *ctx, PyObject *pyfunc) { SSL_CTX_set_default_passwd_cb(ctx, passphrase_callback); SSL_CTX_set_default_passwd_cb_userdata(ctx, (void *)pyfunc); Py_INCREF(pyfunc); } int ssl_ctx_use_x509(SSL_CTX *ctx, X509 *x) { int i; if (!(i = SSL_CTX_use_certificate(ctx, x))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_use_cert(SSL_CTX *ctx, char *file) { int i; if (!(i = SSL_CTX_use_certificate_file(ctx, file, SSL_FILETYPE_PEM))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_use_cert_chain(SSL_CTX *ctx, char *file) { int i; if (!(i = SSL_CTX_use_certificate_chain_file(ctx, file))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_use_privkey(SSL_CTX *ctx, char *file) { int i; if (!(i = SSL_CTX_use_PrivateKey_file(ctx, file, SSL_FILETYPE_PEM))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_use_rsa_privkey(SSL_CTX *ctx, RSA *rsakey) { int i; if (!(i = SSL_CTX_use_RSAPrivateKey(ctx, rsakey))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_use_pkey_privkey(SSL_CTX *ctx, EVP_PKEY *pkey) { int i; if (!(i = SSL_CTX_use_PrivateKey(ctx, pkey))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_check_privkey(SSL_CTX *ctx) { int ret; if (!(ret = SSL_CTX_check_private_key(ctx))) { m2_PyErr_Msg(_ssl_err); return -1; } return ret; } void ssl_ctx_set_client_CA_list_from_file(SSL_CTX *ctx, const char *ca_file) { SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(ca_file)); } void ssl_ctx_set_verify_default(SSL_CTX *ctx, int mode) { SSL_CTX_set_verify(ctx, mode, NULL); } void ssl_ctx_set_verify(SSL_CTX *ctx, int mode, PyObject *pyfunc) { Py_XDECREF(ssl_verify_cb_func); Py_INCREF(pyfunc); ssl_verify_cb_func = pyfunc; SSL_CTX_set_verify(ctx, mode, ssl_verify_callback); } int ssl_ctx_set_session_id_context(SSL_CTX *ctx, PyObject *sid_ctx) { const void *buf; int len = 0; if (m2_PyObject_AsReadBufferInt(sid_ctx, &buf, &len) == -1) return -1; return SSL_CTX_set_session_id_context(ctx, buf, len); } void ssl_ctx_set_info_callback(SSL_CTX *ctx, PyObject *pyfunc) { Py_XDECREF(ssl_info_cb_func); Py_INCREF(pyfunc); ssl_info_cb_func = pyfunc; SSL_CTX_set_info_callback(ctx, ssl_info_callback); } long ssl_ctx_set_tmp_dh(SSL_CTX *ctx, DH* dh) { return SSL_CTX_set_tmp_dh(ctx, dh); } void ssl_ctx_set_tmp_dh_callback(SSL_CTX *ctx, PyObject *pyfunc) { Py_XDECREF(ssl_set_tmp_dh_cb_func); Py_INCREF(pyfunc); ssl_set_tmp_dh_cb_func = pyfunc; SSL_CTX_set_tmp_dh_callback(ctx, ssl_set_tmp_dh_callback); } long ssl_ctx_set_tmp_rsa(SSL_CTX *ctx, RSA* rsa) { return SSL_CTX_set_tmp_rsa(ctx, rsa); } void ssl_ctx_set_tmp_rsa_callback(SSL_CTX *ctx, PyObject *pyfunc) { Py_XDECREF(ssl_set_tmp_rsa_cb_func); Py_INCREF(pyfunc); ssl_set_tmp_rsa_cb_func = pyfunc; SSL_CTX_set_tmp_rsa_callback(ctx, ssl_set_tmp_rsa_callback); } int ssl_ctx_load_verify_locations(SSL_CTX *ctx, const char *cafile, const char *capath) { return SSL_CTX_load_verify_locations(ctx, cafile, capath); } /* SSL_CTX_set_options is a macro. */ long ssl_ctx_set_options(SSL_CTX *ctx, long op) { return SSL_CTX_set_options(ctx, op); } int bio_set_ssl(BIO *bio, SSL *ssl, int flag) { SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); return BIO_ctrl(bio, BIO_C_SET_SSL, flag, (char *)ssl); } long ssl_set_mode(SSL *ssl, long mode) { return SSL_set_mode(ssl, mode); } long ssl_get_mode(SSL *ssl) { return SSL_get_mode(ssl); } int ssl_set_tlsext_host_name(SSL *ssl, const char *name) { long l; if (!(l = SSL_set_tlsext_host_name(ssl, name))) { m2_PyErr_Msg(_ssl_err); return -1; } /* Return an "int" to match the 'typemap(out) int' in _lib.i */ return 1; } void ssl_set_client_CA_list_from_file(SSL *ssl, const char *ca_file) { SSL_set_client_CA_list(ssl, SSL_load_client_CA_file(ca_file)); } void ssl_set_client_CA_list_from_context(SSL *ssl, SSL_CTX *ctx) { SSL_set_client_CA_list(ssl, SSL_CTX_get_client_CA_list(ctx)); } int ssl_set_session_id_context(SSL *ssl, PyObject *sid_ctx) { const void *buf; int len = 0; if (m2_PyObject_AsReadBufferInt(sid_ctx, &buf, &len) == -1) return -1; return SSL_set_session_id_context(ssl, buf, len); } int ssl_set_fd(SSL *ssl, int fd) { int ret; if (!(ret = SSL_set_fd(ssl, fd))) { m2_PyErr_Msg(_ssl_err); return -1; } return ret; } static void ssl_handle_error(int ssl_err, int ret) { int err; switch (ssl_err) { case SSL_ERROR_SSL: PyErr_SetString(_ssl_err, ERR_reason_error_string(ERR_get_error())); break; case SSL_ERROR_SYSCALL: err = ERR_get_error(); if (err) PyErr_SetString(_ssl_err, ERR_reason_error_string(err)); else if (ret == 0) PyErr_SetString(_ssl_err, "unexpected eof"); else if (ret == -1) PyErr_SetFromErrno(_ssl_err); else assert(0); break; default: PyErr_SetString(_ssl_err, "unexpected SSL error"); } } #ifdef _WIN32 /* http://stackoverflow.com/questions/10905892/equivalent-of-gettimeday-for-windows */ int gettimeofday(struct timeval *tp, void *tzp) { // Note: some broken versions only have 8 trailing zero's, the correct epoch has 9 trailing zero's static const uint64_t EPOCH = ((uint64_t) 116444736000000000ULL); SYSTEMTIME system_time; FILETIME file_time; uint64_t time; GetSystemTime( &system_time ); SystemTimeToFileTime( &system_time, &file_time ); time = ((uint64_t)file_time.dwLowDateTime ) ; time += ((uint64_t)file_time.dwHighDateTime) << 32; tp->tv_sec = (long) ((time - EPOCH) / 10000000L); tp->tv_usec = (long) (system_time.wMilliseconds * 1000); return 0; } #endif static int ssl_sleep_with_timeout(SSL *ssl, const struct timeval *start, double timeout, int ssl_err) { #ifdef _WIN32 WSAPOLLFD fd; #else struct pollfd fd; #endif struct timeval tv; int ms, tmp; assert(timeout > 0); again: gettimeofday(&tv, NULL); /* tv >= start */ if ((timeout + start->tv_sec - tv.tv_sec) > INT_MAX / 1000) ms = -1; else { int fract; ms = ((start->tv_sec + (int)timeout) - tv.tv_sec) * 1000; fract = (int)((start->tv_usec + (timeout - (int)timeout) * 1000000 - tv.tv_usec + 999) / 1000); if (ms > 0 && fract > INT_MAX - ms) ms = -1; else { ms += fract; if (ms <= 0) goto timeout; } } switch (ssl_err) { case SSL_ERROR_WANT_READ: fd.fd = SSL_get_rfd(ssl); fd.events = POLLIN; break; case SSL_ERROR_WANT_WRITE: fd.fd = SSL_get_wfd(ssl); fd.events = POLLOUT; break; case SSL_ERROR_WANT_X509_LOOKUP: return 0; /* FIXME: is this correct? */ default: assert(0); } if (fd.fd == -1) { PyErr_SetString(_ssl_err, "timeout on a non-FD SSL"); return -1; } Py_BEGIN_ALLOW_THREADS #ifdef _WIN32 tmp = WSAPoll(&fd, 1, ms); #else tmp = poll(&fd, 1, ms); #endif Py_END_ALLOW_THREADS switch (tmp) { case 1: return 0; case 0: goto timeout; case -1: #ifdef _WIN32 if (WSAGetLastError() == EINTR) #else if (errno == EINTR) #endif goto again; PyErr_SetFromErrno(_ssl_err); return -1; } return 0; timeout: PyErr_SetString(_ssl_timeout_err, "timed out"); return -1; } PyObject *ssl_accept(SSL *ssl, double timeout) { PyObject *obj = NULL; int r, ssl_err; struct timeval tv; if (timeout > 0) gettimeofday(&tv, NULL); again: Py_BEGIN_ALLOW_THREADS r = SSL_accept(ssl); ssl_err = SSL_get_error(ssl, r); Py_END_ALLOW_THREADS switch (ssl_err) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: obj = PyLong_FromLong((long)1); break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: if (timeout <= 0) { obj = PyLong_FromLong((long)0); break; } if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0) goto again; obj = NULL; break; case SSL_ERROR_SSL: case SSL_ERROR_SYSCALL: ssl_handle_error(ssl_err, r); obj = NULL; break; } return obj; } PyObject *ssl_connect(SSL *ssl, double timeout) { PyObject *obj = NULL; int r, ssl_err; struct timeval tv; if (timeout > 0) gettimeofday(&tv, NULL); again: Py_BEGIN_ALLOW_THREADS r = SSL_connect(ssl); ssl_err = SSL_get_error(ssl, r); Py_END_ALLOW_THREADS switch (ssl_err) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: obj = PyLong_FromLong((long)1); break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: if (timeout <= 0) { obj = PyLong_FromLong((long)0); break; } if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0) goto again; obj = NULL; break; case SSL_ERROR_SSL: case SSL_ERROR_SYSCALL: ssl_handle_error(ssl_err, r); obj = NULL; break; } return obj; } void ssl_set_shutdown1(SSL *ssl, int mode) { SSL_set_shutdown(ssl, mode); } PyObject *ssl_read(SSL *ssl, int num, double timeout) { PyObject *obj = NULL; void *buf; int r; struct timeval tv; if (!(buf = PyMem_Malloc(num))) { PyErr_SetString(PyExc_MemoryError, "ssl_read"); return NULL; } if (timeout > 0) gettimeofday(&tv, NULL); again: Py_BEGIN_ALLOW_THREADS r = SSL_read(ssl, buf, num); Py_END_ALLOW_THREADS if (r >= 0) { buf = PyMem_Realloc(buf, r); obj = PyBytes_FromStringAndSize(buf, r); } else { int ssl_err; ssl_err = SSL_get_error(ssl, r); switch (ssl_err) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: assert(0); case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_X509_LOOKUP: if (timeout <= 0) { Py_INCREF(Py_None); obj = Py_None; break; } if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0) goto again; obj = NULL; break; case SSL_ERROR_SSL: case SSL_ERROR_SYSCALL: ssl_handle_error(ssl_err, r); obj = NULL; break; } } PyMem_Free(buf); return obj; } PyObject *ssl_read_nbio(SSL *ssl, int num) { PyObject *obj = NULL; void *buf; int r, err; if (!(buf = PyMem_Malloc(num))) { PyErr_SetString(PyExc_MemoryError, "ssl_read"); return NULL; } Py_BEGIN_ALLOW_THREADS r = SSL_read(ssl, buf, num); Py_END_ALLOW_THREADS switch (SSL_get_error(ssl, r)) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: buf = PyMem_Realloc(buf, r); obj = PyBytes_FromStringAndSize(buf, r); break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_X509_LOOKUP: Py_INCREF(Py_None); obj = Py_None; break; case SSL_ERROR_SSL: m2_PyErr_Msg(_ssl_err); obj = NULL; break; case SSL_ERROR_SYSCALL: err = ERR_get_error(); if (err) PyErr_SetString(_ssl_err, ERR_reason_error_string(err)); else if (r == 0) PyErr_SetString(_ssl_err, "unexpected eof"); else if (r == -1) PyErr_SetFromErrno(_ssl_err); obj = NULL; break; } PyMem_Free(buf); return obj; } int ssl_write(SSL *ssl, PyObject *blob, double timeout) { Py_buffer buf; int r, ssl_err, ret; struct timeval tv; if (m2_PyObject_GetBufferInt(blob, &buf, PyBUF_CONTIG_RO) == -1) { return -1; } if (timeout > 0) gettimeofday(&tv, NULL); again: Py_BEGIN_ALLOW_THREADS r = SSL_write(ssl, buf.buf, buf.len); ssl_err = SSL_get_error(ssl, r); Py_END_ALLOW_THREADS switch (ssl_err) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: ret = r; break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_X509_LOOKUP: if (timeout <= 0) { ret = -1; break; } if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0) goto again; ret = -1; break; case SSL_ERROR_SSL: case SSL_ERROR_SYSCALL: ssl_handle_error(ssl_err, r); default: ret = -1; } m2_PyBuffer_Release(blob, &buf); return ret; } int ssl_write_nbio(SSL *ssl, PyObject *blob) { Py_buffer buf; int r, err, ret; if (m2_PyObject_GetBufferInt(blob, &buf, PyBUF_CONTIG_RO) == -1) { return -1; } Py_BEGIN_ALLOW_THREADS r = SSL_write(ssl, buf.buf, buf.len); Py_END_ALLOW_THREADS switch (SSL_get_error(ssl, r)) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: ret = r; break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_X509_LOOKUP: ret = -1; break; case SSL_ERROR_SSL: ret = -1; break; case SSL_ERROR_SYSCALL: err = ERR_get_error(); if (err) PyErr_SetString(_ssl_err, ERR_reason_error_string(err)); else if (r == 0) PyErr_SetString(_ssl_err, "unexpected eof"); else if (r == -1) PyErr_SetFromErrno(_ssl_err); default: ret = -1; } m2_PyBuffer_Release(blob, &buf); return ret; } int ssl_cipher_get_bits(SSL_CIPHER *c) { return SSL_CIPHER_get_bits(c, NULL); } int sk_ssl_cipher_num(STACK_OF(SSL_CIPHER) *stack) { return sk_SSL_CIPHER_num(stack); } const SSL_CIPHER *sk_ssl_cipher_value(STACK_OF(SSL_CIPHER) *stack, int idx) { return sk_SSL_CIPHER_value(stack, idx); } STACK_OF(X509) *ssl_get_peer_cert_chain(SSL *ssl) { return SSL_get_peer_cert_chain(ssl); } int sk_x509_num(STACK_OF(X509) *stack) { return sk_X509_num(stack); } X509 *sk_x509_value(STACK_OF(X509) *stack, int idx) { return sk_X509_value(stack, idx); } void i2d_ssl_session(BIO *bio, SSL_SESSION *sess) { i2d_SSL_SESSION_bio(bio, sess); } SSL_SESSION *ssl_session_read_pem(BIO *bio) { return PEM_read_bio_SSL_SESSION(bio, NULL, NULL, NULL); } int ssl_session_write_pem(SSL_SESSION *sess, BIO *bio) { return PEM_write_bio_SSL_SESSION(bio, sess); } int ssl_ctx_set_session_cache_mode(SSL_CTX *ctx, int mode) { return SSL_CTX_set_session_cache_mode(ctx, mode); } int ssl_ctx_get_session_cache_mode(SSL_CTX *ctx) { return SSL_CTX_get_session_cache_mode(ctx); } static long ssl_ctx_set_cache_size(SSL_CTX *ctx, long arg) { return SSL_CTX_sess_set_cache_size(ctx, arg); } int ssl_is_init_finished(SSL *ssl) { return SSL_is_init_finished(ssl); } #include #include #include #include typedef STACK_OF(X509) SEQ_CERT; ASN1_ITEM_TEMPLATE(SEQ_CERT) = ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, SeqCert, X509) ASN1_ITEM_TEMPLATE_END(SEQ_CERT) IMPLEMENT_ASN1_FUNCTIONS(SEQ_CERT) X509 *x509_read_pem(BIO *bio) { return PEM_read_bio_X509(bio, NULL, NULL, NULL); } X509 *d2i_x509(BIO *bio) { return d2i_X509_bio(bio, NULL); } static PyObject *_x509_err; void x509_init(PyObject *x509_err) { Py_INCREF(x509_err); _x509_err = x509_err; } X509_REQ *d2i_x509_req(BIO *bio) { return d2i_X509_REQ_bio(bio, NULL); } X509_REQ *x509_req_read_pem(BIO *bio) { return PEM_read_bio_X509_REQ(bio, NULL, NULL, NULL); } PyObject *i2d_x509(X509 *x) { int len; PyObject *ret = NULL; unsigned char *buf = NULL; len = i2d_X509(x, &buf); if (len < 0) { m2_PyErr_Msg(_x509_err); } else { ret = PyBytes_FromStringAndSize((char*)buf, len); OPENSSL_free(buf); } return ret; } int x509_req_write_pem(BIO *bio, X509_REQ *x) { return PEM_write_bio_X509_REQ(bio, x); } X509_CRL *x509_crl_read_pem(BIO *bio) { return PEM_read_bio_X509_CRL(bio, NULL, NULL, NULL); } /* X509_set_version() is a macro. */ int x509_set_version(X509 *x, long version) { return X509_set_version(x, version); } /* X509_get_version() is a macro. */ long x509_get_version(X509 *x) { return X509_get_version(x); } /* X509_set_notBefore() is a macro. */ int x509_set_not_before(X509 *x, ASN1_TIME *tm) { return X509_set_notBefore(x, tm); } /* X509_get_notBefore() is a macro. */ ASN1_TIME *x509_get_not_before(X509 *x) { return X509_get_notBefore(x); } /* X509_set_notAfter() is a macro. */ int x509_set_not_after(X509 *x, ASN1_TIME *tm) { return X509_set_notAfter(x, tm); } /* X509_get_notAfter() is a macro. */ ASN1_TIME *x509_get_not_after(X509 *x) { return X509_get_notAfter(x); } int x509_sign(X509 *x, EVP_PKEY *pkey, EVP_MD *md) { return X509_sign(x, pkey, md); } /* x509_gmtime_adj() is a macro. */ ASN1_TIME *x509_gmtime_adj(ASN1_TIME *s, long adj) { return X509_gmtime_adj(s, adj); } PyObject *x509_name_by_nid(X509_NAME *name, int nid) { void *buf; int len, xlen; PyObject *ret; if ((len = X509_NAME_get_text_by_NID(name, nid, NULL, 0)) == -1) { Py_RETURN_NONE; } len++; if (!(buf = PyMem_Malloc(len))) { PyErr_SetString(PyExc_MemoryError, "x509_name_by_nid"); return NULL; } xlen = X509_NAME_get_text_by_NID(name, nid, buf, len); ret = PyBytes_FromStringAndSize(buf, xlen); PyMem_Free(buf); return ret; } int x509_name_set_by_nid(X509_NAME *name, int nid, PyObject *obj) { return X509_NAME_add_entry_by_NID(name, nid, MBSTRING_ASC, (unsigned char *)PyBytes_AsString(obj), -1, -1, 0); } /* x509_name_add_entry_by_txt */ int x509_name_add_entry_by_txt(X509_NAME *name, char *field, int type, char *bytes, int len, int loc, int set) { return X509_NAME_add_entry_by_txt(name, field, type, (unsigned char *)bytes, len, loc, set); } PyObject *x509_name_get_der(X509_NAME *name) { const char* pder=""; size_t pderlen; i2d_X509_NAME(name, 0); if (!X509_NAME_get0_der(name, (const unsigned char **)pder, &pderlen)) { m2_PyErr_Msg(_x509_err); return NULL; } return PyBytes_FromStringAndSize(pder, pderlen); } /* sk_X509_free() is a macro. */ void sk_x509_free(STACK_OF(X509) *stack) { sk_X509_free(stack); } /* sk_X509_push() is a macro. */ int sk_x509_push(STACK_OF(X509) *stack, X509 *x509) { return sk_X509_push(stack, x509); } /* sk_X509_pop() is a macro. */ X509 *sk_x509_pop(STACK_OF(X509) *stack) { return sk_X509_pop(stack); } int x509_store_load_locations(X509_STORE *store, const char *file) { int locations = 0; if ((locations = X509_STORE_load_locations(store, file, NULL)) < 1) { m2_PyErr_Msg(_x509_err); } return locations; } int x509_type_check(X509 *x509) { return 1; } int x509_name_type_check(X509_NAME *name) { return 1; } X509_NAME *x509_req_get_subject_name(X509_REQ *x) { return X509_REQ_get_subject_name(x); } long x509_req_get_version(X509_REQ *x) { return X509_REQ_get_version(x); } int x509_req_set_version(X509_REQ *x, long version) { return X509_REQ_set_version(x, version); } int x509_req_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts) { return X509_REQ_add_extensions(req, exts); } X509_NAME_ENTRY *x509_name_entry_create_by_txt(X509_NAME_ENTRY **ne, char *field, int type, char *bytes, int len) { return X509_NAME_ENTRY_create_by_txt( ne, field, type, (unsigned char *)bytes, len); } X509V3_CTX * x509v3_set_nconf(void) { X509V3_CTX * ctx; CONF *conf = NCONF_new(NULL); if (!(ctx=(X509V3_CTX *)PyMem_Malloc(sizeof(X509V3_CTX)))) { PyErr_SetString(PyExc_MemoryError, "x509v3_set_nconf"); return NULL; } /* X509V3_set_nconf does not generate any error signs at all. */ X509V3_set_nconf(ctx, conf); return ctx; } X509_EXTENSION * x509v3_ext_conf(void *conf, X509V3_CTX *ctx, char *name, char *value) { X509_EXTENSION * ext = NULL; ext = X509V3_EXT_conf(conf, ctx, name, value); PyMem_Free(ctx); return ext; } /* X509_EXTENSION_free() might be a macro, didn't find definition. */ void x509_extension_free(X509_EXTENSION *ext) { X509_EXTENSION_free(ext); } PyObject *x509_extension_get_name(X509_EXTENSION *ext) { PyObject * ext_name; const char * ext_name_str; ext_name_str = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext))); if (!ext_name_str) { m2_PyErr_Msg(_x509_err); return NULL; } ext_name = PyBytes_FromStringAndSize(ext_name_str, strlen(ext_name_str)); return ext_name; } /* sk_X509_EXTENSION_new_null is a macro. */ STACK_OF(X509_EXTENSION) *sk_x509_extension_new_null(void) { return sk_X509_EXTENSION_new_null(); } /* sk_X509_EXTENSION_free() is a macro. */ void sk_x509_extension_free(STACK_OF(X509_EXTENSION) *stack) { sk_X509_EXTENSION_free(stack); } /* sk_X509_EXTENSION_push() is a macro. */ int sk_x509_extension_push(STACK_OF(X509_EXTENSION) *stack, X509_EXTENSION *x509_ext) { return sk_X509_EXTENSION_push(stack, x509_ext); } /* sk_X509_EXTENSION_pop() is a macro. */ X509_EXTENSION *sk_x509_extension_pop(STACK_OF(X509_EXTENSION) *stack) { return sk_X509_EXTENSION_pop(stack); } /* sk_X509_EXTENSION_num() is a macro. */ int sk_x509_extension_num(STACK_OF(X509_EXTENSION) *stack) { return sk_X509_EXTENSION_num(stack); } /* sk_X509_EXTENSION_value() is a macro. */ X509_EXTENSION *sk_x509_extension_value(STACK_OF(X509_EXTENSION) *stack, int i) { return sk_X509_EXTENSION_value(stack, i); } /* X509_STORE_CTX_get_app_data is a macro. */ void *x509_store_ctx_get_app_data(X509_STORE_CTX *ctx) { return X509_STORE_CTX_get_app_data(ctx); } /* X509_STORE_CTX_get_app_data is a macro. */ void *x509_store_ctx_get_ex_data(X509_STORE_CTX *ctx, int idx) { return X509_STORE_CTX_get_ex_data(ctx, idx); } void x509_store_set_verify_cb(X509_STORE *store, PyObject *pyfunc) { Py_XDECREF(x509_store_verify_cb_func); Py_INCREF(pyfunc); x509_store_verify_cb_func = pyfunc; X509_STORE_set_verify_cb(store, x509_store_verify_callback); } STACK_OF(X509) * make_stack_from_der_sequence(PyObject * pyEncodedString){ STACK_OF(X509) *certs; Py_ssize_t encoded_string_len; char *encoded_string; const unsigned char *tmp_str; encoded_string_len = PyBytes_Size(pyEncodedString); if (encoded_string_len > INT_MAX) { PyErr_Format(_x509_err, "object too large"); return NULL; } encoded_string = PyBytes_AsString(pyEncodedString); if (!encoded_string) { PyErr_SetString(_x509_err, "Cannot convert Python Bytes to (char *)."); return NULL; } tmp_str = (unsigned char *)encoded_string; certs = d2i_SEQ_CERT(NULL, &tmp_str, encoded_string_len); if (certs == NULL) { PyErr_SetString(_x509_err, "Generating STACK_OF(X509) failed."); return NULL; } return certs; } /* sk_X509_new_null() is a macro returning "STACK_OF(X509) *". */ STACK_OF(X509) *sk_x509_new_null(void) { return sk_X509_new_null(); } PyObject * get_der_encoding_stack(STACK_OF(X509) *stack){ PyObject * encodedString; unsigned char * encoding = NULL; int len; len = i2d_SEQ_CERT(stack, &encoding); if (!encoding) { m2_PyErr_Msg(_x509_err); return NULL; } encodedString = PyBytes_FromStringAndSize((const char *)encoding, len); if (encoding) OPENSSL_free(encoding); return encodedString; } char *x509_name_oneline(X509_NAME *x) { return X509_NAME_oneline(x, NULL, 0); } #include /* ASN1_TIME_set_string () is a macro */ int asn1_time_type_check(ASN1_TIME *ASN1_TIME) { return 1; } PyObject *asn1_integer_get(ASN1_INTEGER *asn1) { BIGNUM *bn; PyObject *ret; char *hex; bn = ASN1_INTEGER_to_BN(asn1, NULL); if (!bn){ m2_PyErr_Msg(PyExc_RuntimeError); return NULL; } hex = BN_bn2hex(bn); if (!hex){ m2_PyErr_Msg(PyExc_RuntimeError); BN_free(bn); return NULL; } BN_free(bn); ret = PyLong_FromString(hex, NULL, 16); OPENSSL_free(hex); return ret; } int asn1_integer_set(ASN1_INTEGER *asn1, PyObject *value) { BIGNUM *bn = NULL; PyObject *fmt, *args, *hex; /* Despite all hopes to the contrary, we cannot survive here with * PyLong_AsLong shims as provided in * /usr/include/python2.7/longobject.h. */ #if PY_MAJOR_VERSION >= 3 if (PyLong_Check(value)) return ASN1_INTEGER_set(asn1, PyLong_AsLong(value)); #else if (PyInt_Check(value)) return ASN1_INTEGER_set(asn1, PyInt_AS_LONG(value)); #endif // PY_MAJOR_VERSION >= 3 if (!PyLong_Check(value)){ PyErr_SetString(PyExc_TypeError, "expected int or long"); return 0; } fmt = PyString_FromString("%x"); if (!fmt) return 0; args = PyTuple_New(1); if (!args){ Py_DECREF(fmt); PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() failed"); return 0; } Py_INCREF(value); PyTuple_SET_ITEM(args, 0, value); hex = PyString_Format(fmt, args); if (!hex){ PyErr_SetString(PyExc_RuntimeError, "PyString_Format() failed"); Py_DECREF(fmt); Py_DECREF(args); return 0; } Py_DECREF(fmt); Py_DECREF(args); if (BN_hex2bn(&bn, PyString_AsString(hex)) <= 0){ m2_PyErr_Msg(PyExc_RuntimeError); Py_DECREF(hex); return 0; } Py_DECREF(hex); if (!BN_to_ASN1_INTEGER(bn, asn1)){ m2_PyErr_Msg(PyExc_RuntimeError); BN_free(bn); return 0; } BN_free(bn); return 1; } #include #include #include #include static PyObject *_pkcs7_err, *_smime_err; void pkcs7_init(PyObject *pkcs7_err) { Py_INCREF(pkcs7_err); _pkcs7_err = pkcs7_err; } void smime_init(PyObject *smime_err) { Py_INCREF(smime_err); _smime_err = smime_err; } PyObject *pkcs7_decrypt(PKCS7 *pkcs7, EVP_PKEY *pkey, X509 *cert, int flags) { int outlen; char *outbuf; BIO *bio; PyObject *ret; if (!(bio=BIO_new(BIO_s_mem()))) { PyErr_SetString(PyExc_MemoryError, "pkcs7_decrypt"); return NULL; } if (!PKCS7_decrypt(pkcs7, pkey, cert, bio, flags)) { m2_PyErr_Msg(_pkcs7_err); BIO_free(bio); return NULL; } outlen = BIO_ctrl_pending(bio); if (!(outbuf=(char *)PyMem_Malloc(outlen))) { PyErr_SetString(PyExc_MemoryError, "pkcs7_decrypt"); BIO_free(bio); return NULL; } BIO_read(bio, outbuf, outlen); ret = PyBytes_FromStringAndSize(outbuf, outlen); BIO_free(bio); PyMem_Free(outbuf); return ret; } PKCS7 *pkcs7_encrypt(STACK_OF(X509) *stack, BIO *bio, EVP_CIPHER *cipher, int flags) { return PKCS7_encrypt(stack, bio, cipher, flags); } PKCS7 *pkcs7_sign1(X509 *x509, EVP_PKEY *pkey, STACK_OF(X509) *stack, BIO *bio, EVP_MD *hash, int flags) { PKCS7 *p7 = PKCS7_sign(NULL, NULL, stack, bio, flags | PKCS7_STREAM); if (p7 == NULL) { return NULL; } if (PKCS7_sign_add_signer(p7, x509, pkey, hash, flags) == NULL) { return NULL; } if (PKCS7_final(p7, bio, flags) != 1) { return NULL; } return p7; } PKCS7 *pkcs7_sign0(X509 *x509, EVP_PKEY *pkey, BIO *bio, EVP_MD *hash, int flags) { return pkcs7_sign1(x509, pkey, NULL, bio, hash, flags); } PKCS7 *pkcs7_read_bio(BIO *bio) { return PEM_read_bio_PKCS7(bio, NULL, NULL, NULL); } PKCS7 *pkcs7_read_bio_der(BIO *bio) { return d2i_PKCS7_bio(bio, NULL); } PyObject *pkcs7_verify1(PKCS7 *pkcs7, STACK_OF(X509) *stack, X509_STORE *store, BIO *data, int flags) { int res, outlen; char *outbuf; BIO *bio; PyObject *ret; if (!(bio=BIO_new(BIO_s_mem()))) { PyErr_SetString(PyExc_MemoryError, "pkcs7_verify1"); return NULL; } Py_BEGIN_ALLOW_THREADS res = PKCS7_verify(pkcs7, stack, store, data, bio, flags); Py_END_ALLOW_THREADS if (!res) { m2_PyErr_Msg(_pkcs7_err); BIO_free(bio); return NULL; } outlen = BIO_ctrl_pending(bio); if (!(outbuf=(char *)PyMem_Malloc(outlen))) { PyErr_SetString(PyExc_MemoryError, "pkcs7_verify1"); BIO_free(bio); return NULL; } BIO_read(bio, outbuf, outlen); ret = PyBytes_FromStringAndSize(outbuf, outlen); BIO_free(bio); PyMem_Free(outbuf); return ret; } PyObject *pkcs7_verify0(PKCS7 *pkcs7, STACK_OF(X509) *stack, X509_STORE *store, int flags) { return pkcs7_verify1(pkcs7, stack, store, NULL, flags); } int smime_write_pkcs7_multi(BIO *bio, PKCS7 *pkcs7, BIO *data, int flags) { return SMIME_write_PKCS7(bio, pkcs7, data, flags | PKCS7_DETACHED); } int smime_write_pkcs7(BIO *bio, PKCS7 *pkcs7, int flags) { return SMIME_write_PKCS7(bio, pkcs7, NULL, flags); } PyObject *smime_read_pkcs7(BIO *bio) { BIO *bcont = NULL; PKCS7 *p7; PyObject *tuple, *_p7, *_BIO; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (BIO_method_type(bio) == BIO_TYPE_MEM) { /* OpenSSL FAQ explains that this is needed for mem BIO to return EOF, * like file BIO does. Might need to do this for more mem BIOs but * not sure if that is safe, so starting with just this single place. */ BIO_set_mem_eof_return(bio, 0); } Py_BEGIN_ALLOW_THREADS p7=SMIME_read_PKCS7(bio, &bcont); Py_END_ALLOW_THREADS if (!p7) { m2_PyErr_Msg(_smime_err); return NULL; } if (!(tuple=PyTuple_New(2))) { PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails"); return NULL; } _p7 = SWIG_NewPointerObj((void *)p7, SWIGTYPE_p_PKCS7, 0); PyTuple_SET_ITEM(tuple, 0, _p7); if (!bcont) { Py_INCREF(Py_None); PyTuple_SET_ITEM(tuple, 1, Py_None); } else { _BIO = SWIG_NewPointerObj((void *)bcont, SWIGTYPE_p_BIO, 0); PyTuple_SET_ITEM(tuple, 1, _BIO); } return tuple; } int pkcs7_write_bio(PKCS7 *pkcs7, BIO* bio) { return PEM_write_bio_PKCS7(bio, pkcs7); } int pkcs7_write_bio_der(PKCS7 *pkcs7, BIO *bio) { return i2d_PKCS7_bio(bio, pkcs7); } int pkcs7_type_nid(PKCS7 *pkcs7) { return OBJ_obj2nid(pkcs7->type); } const char *pkcs7_type_sn(PKCS7 *pkcs7) { return OBJ_nid2sn(OBJ_obj2nid(pkcs7->type)); } int smime_crlf_copy(BIO *in, BIO *out) { return SMIME_crlf_copy(in, out, PKCS7_TEXT); } /* return STACK_OF(X509)* */ STACK_OF(X509) *pkcs7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags) { return PKCS7_get0_signers(p7, certs, flags); } #include static PyObject *_util_err; void util_init(PyObject *util_err) { Py_INCREF(util_err); _util_err = util_err; } PyObject *util_hex_to_string(PyObject *blob) { PyObject *obj; const void *buf; char *ret; Py_ssize_t len; if (PyObject_AsReadBuffer(blob, &buf, &len) == -1) return NULL; ret = hex_to_string((unsigned char *)buf, len); if (!ret) { m2_PyErr_Msg(_util_err); return NULL; } obj = PyBytes_FromString(ret); OPENSSL_free(ret); return obj; } PyObject *util_string_to_hex(PyObject *blob) { PyObject *obj; const void *buf; unsigned char *ret; Py_ssize_t len0; long len; if (PyObject_AsReadBuffer(blob, &buf, &len0) == -1) return NULL; len = len0; ret = string_to_hex((char *)buf, &len); if (ret == NULL) { m2_PyErr_Msg(_util_err); return NULL; } obj = PyBytes_FromStringAndSize((char*)ret, len); OPENSSL_free(ret); return obj; } #include #include #include #include #include #include static PyObject *_ec_err; void ec_init(PyObject *ec_err) { Py_INCREF(ec_err); _ec_err = ec_err; } PyObject *ec_get_builtin_curves(void) { /* size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t * nitems); */ EC_builtin_curve *curves; Py_ssize_t ret_curves = 0; size_t num_curves = EC_get_builtin_curves(NULL, 0); PyObject *ret_tuple = NULL; PyObject *ret_dict = NULL; Py_ssize_t i; const char *comment; const char *sname; if (!(curves = PyMem_Malloc(num_curves * sizeof(EC_builtin_curve)))) { PyErr_SetString(PyExc_MemoryError, "ec_get_builtin_curves"); return NULL; } ret_curves = (Py_ssize_t)EC_get_builtin_curves(curves, num_curves); if (!(ret_tuple = PyTuple_New(ret_curves))) { PyErr_SetString(PyExc_MemoryError, "ec_get_builtin_curves"); return NULL; } for (i = 0; i < ret_curves; i++) { if (!(ret_dict = PyDict_New())) { PyErr_SetString(PyExc_MemoryError, "ec_get_builtin_curves"); return NULL; } comment = curves[i].comment; sname = OBJ_nid2sn(curves[i].nid); if (sname == NULL) sname = ""; PyDict_SetItemString(ret_dict, "NID", PyLong_FromLong((long)curves[i].nid)); PyDict_SetItemString(ret_dict, "sname", PyString_FromString(sname)); PyDict_SetItemString(ret_dict, "comment", PyString_FromString(comment)); PyTuple_SET_ITEM(ret_tuple, i, ret_dict); } PyMem_Free(curves); return ret_tuple; } EC_KEY* ec_key_new_by_curve_name(int nid) { EC_KEY *key; EC_GROUP *group; int ret =0; point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED; int asn1_flag = OPENSSL_EC_NAMED_CURVE; /* If I simply do "return EC_KEY_new_by_curve_name(nid);" * I get large public keys (222 vs 84 bytes for sect233k1 curve). * I don't know why that is, but 'openssl ecparam -genkey ...' sets * the ASN.1 flag and the point conversion form, and gets the * small pub keys. So let's do that too. */ key = EC_KEY_new(); if (!key) { PyErr_SetString(PyExc_MemoryError, "ec_key_new_by_curve_name"); return NULL; } group = EC_GROUP_new_by_curve_name(nid); if (!group) { m2_PyErr_Msg(_ec_err); EC_KEY_free(key); return NULL; } EC_GROUP_set_asn1_flag(group, asn1_flag); EC_GROUP_set_point_conversion_form(group, form); ret = EC_KEY_set_group(key, group); EC_GROUP_free(group); if (ret == 0) { /* EC_KEY_set_group only returns 0 or 1, and does not set error. */ PyErr_SetString(_ec_err, "cannot set key's group"); EC_KEY_free(key); return NULL; } return key; } PyObject *ec_key_get_public_der(EC_KEY *key) { char *src=NULL; int src_len=0; PyObject *pyo=NULL; /* Convert to binary */ src_len = i2d_EC_PUBKEY( key, (unsigned char**)&src ); if (src_len < 0) { m2_PyErr_Msg(_ec_err); return NULL; } /* Create a PyBuffer containing a copy of the binary, * to simplify memory deallocation */ pyo = PyBytes_FromStringAndSize( src, src_len ); OPENSSL_free(src); return pyo; } PyObject *ec_key_get_public_key(EC_KEY *key) { char *src=NULL; int src_len=0; PyObject *pyo=NULL; /* Convert to binary */ src_len = i2o_ECPublicKey(key, (unsigned char**)&src); if (src_len < 0) { m2_PyErr_Msg(_ec_err); return NULL; } pyo = PyBytes_FromStringAndSize( src, src_len ); OPENSSL_free(src); return pyo; } EC_KEY *ec_key_read_pubkey(BIO *f) { return PEM_read_bio_EC_PUBKEY(f, NULL, NULL, NULL); } int ec_key_write_pubkey(EC_KEY *key, BIO *f) { return PEM_write_bio_EC_PUBKEY(f, key ); } EC_KEY *ec_key_read_bio(BIO *f, PyObject *pyfunc) { EC_KEY *ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_read_bio_ECPrivateKey(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } int ec_key_write_bio(EC_KEY *key, BIO *f, EVP_CIPHER *cipher, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_ECPrivateKey(f, key, cipher, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } int ec_key_write_bio_no_cipher(EC_KEY *key, BIO *f, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_ECPrivateKey(f, key, NULL, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } PyObject *ecdsa_sig_get_r(ECDSA_SIG *ecdsa_sig) { const BIGNUM* pr; ECDSA_SIG_get0(ecdsa_sig, &pr, NULL); return bn_to_mpi(pr); } PyObject *ecdsa_sig_get_s(ECDSA_SIG *ecdsa_sig) { const BIGNUM* ps; ECDSA_SIG_get0(ecdsa_sig, NULL, &ps); return bn_to_mpi(ps); } PyObject *ecdsa_sign(EC_KEY *key, PyObject *value) { const void *vbuf; int vlen = 0; PyObject *tuple; ECDSA_SIG *sig; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(sig = ECDSA_do_sign(vbuf, vlen, key))) { m2_PyErr_Msg(_ec_err); return NULL; } if (!(tuple = PyTuple_New(2))) { ECDSA_SIG_free(sig); PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails"); return NULL; } PyTuple_SET_ITEM(tuple, 0, ecdsa_sig_get_r(sig)); PyTuple_SET_ITEM(tuple, 1, ecdsa_sig_get_s(sig)); ECDSA_SIG_free(sig); return tuple; } int ecdsa_verify(EC_KEY *key, PyObject *value, PyObject *r, PyObject *s) { const void *vbuf, *rbuf, *sbuf; int vlen = 0, rlen = 0, slen = 0; ECDSA_SIG *sig; int ret; BIGNUM* pr, *ps; if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) || (m2_PyObject_AsReadBufferInt(r, &rbuf, &rlen) == -1) || (m2_PyObject_AsReadBufferInt(s, &sbuf, &slen) == -1)) return -1; if (!(pr = BN_mpi2bn((unsigned char *)rbuf, rlen, NULL))) { m2_PyErr_Msg(_ec_err); return -1; } if (!(ps = BN_mpi2bn((unsigned char *)sbuf, slen, NULL))) { m2_PyErr_Msg(_ec_err); BN_free(pr); return -1; } if (!(sig = ECDSA_SIG_new())) { m2_PyErr_Msg(_ec_err); BN_free(pr); BN_free(ps); return -1; } if (!ECDSA_SIG_set0(sig, pr, ps)) { PyErr_SetString(_ec_err, "Cannot set r and s fields of ECDSA_SIG."); ECDSA_SIG_free(sig); BN_free(pr); BN_free(ps); return -1; } ret = ECDSA_do_verify(vbuf, vlen, sig, key); ECDSA_SIG_free(sig); if (ret == -1) m2_PyErr_Msg(_ec_err); return ret; } PyObject *ecdsa_sign_asn1(EC_KEY *key, PyObject *value) { const void *vbuf; int vlen = 0; void *sigbuf; unsigned int siglen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(sigbuf = PyMem_Malloc(ECDSA_size(key)))) { PyErr_SetString(PyExc_MemoryError, "ecdsa_sign_asn1"); return NULL; } if (!ECDSA_sign(0, vbuf, vlen, (unsigned char *)sigbuf, &siglen, key)) { m2_PyErr_Msg(_ec_err); PyMem_Free(sigbuf); return NULL; } ret = PyBytes_FromStringAndSize(sigbuf, siglen); PyMem_Free(sigbuf); return ret; } int ecdsa_verify_asn1(EC_KEY *key, PyObject *value, PyObject *sig) { const void *vbuf; void *sbuf; int vlen = 0, slen = 0, ret; if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) || (m2_PyObject_AsReadBufferInt(sig, (const void **)&sbuf, &slen) == -1)) return -1; if ((ret = ECDSA_verify(0, vbuf, vlen, sbuf, slen, key)) == -1) m2_PyErr_Msg(_ec_err); return ret; } PyObject *ecdh_compute_key(EC_KEY *keypairA, EC_KEY *pubkeyB) { int sharedkeylen; void *sharedkey; const EC_POINT *pkpointB; PyObject *ret; const EC_GROUP* groupA; if ((pkpointB = EC_KEY_get0_public_key(pubkeyB)) == NULL) { PyErr_SetString(_ec_err, "Cannot get the public key of EC_KEY object."); return NULL; } groupA = EC_KEY_get0_group(keypairA); sharedkeylen = (EC_GROUP_get_degree(groupA) + 7)/8; if (!(sharedkey = PyMem_Malloc(sharedkeylen))) { PyErr_SetString(PyExc_MemoryError, "ecdh_compute_key"); return NULL; } if ((sharedkeylen = ECDH_compute_key((unsigned char *)sharedkey, sharedkeylen, pkpointB, keypairA, NULL)) == -1) { m2_PyErr_Msg(_ec_err); PyMem_Free(sharedkey); return NULL; } ret = PyBytes_FromStringAndSize((const char *)sharedkey, sharedkeylen); PyMem_Free(sharedkey); return ret; } EC_KEY* ec_key_from_pubkey_der(PyObject *pubkey) { const void *keypairbuf; Py_ssize_t keypairbuflen; const unsigned char *tempBuf; EC_KEY *keypair; if (PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1) { return NULL; } tempBuf = (const unsigned char *)keypairbuf; if ((keypair = d2i_EC_PUBKEY( NULL, &tempBuf, keypairbuflen)) == 0) { m2_PyErr_Msg(_ec_err); return NULL; } return keypair; } EC_KEY* ec_key_from_pubkey_params(int nid, PyObject *pubkey) { const void *keypairbuf; Py_ssize_t keypairbuflen; const unsigned char *tempBuf; EC_KEY *keypair; if (PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1) { return NULL; } keypair = ec_key_new_by_curve_name(nid); if (!keypair) { m2_PyErr_Msg(_ec_err); return NULL; } tempBuf = (const unsigned char *)keypairbuf; if ((o2i_ECPublicKey( &keypair, &tempBuf, keypairbuflen)) == 0) { m2_PyErr_Msg(_ec_err); return NULL; } return keypair; } // According to [SEC2] the degree of the group is defined as EC key length int ec_key_keylen(EC_KEY *key) { const EC_GROUP *group = EC_KEY_get0_group(key); return EC_GROUP_get_degree(group); } int ec_key_type_check(EC_KEY *key) { return 1; } #include #include #include /* * Code from engine-pkcs11 1.4.0 in engine-pkcs11.c * 99 static char *get_pin(UI_METHOD * ui_method, void *callback_data, char *sc_pin, 100 int maxlen) 101 { 102 UI *ui; 103 struct { 104 const void *password; 105 const char *prompt_info; 106 } *mycb = callback_data; 107 108 if (mycb->password) { 109 sc_pin = set_pin(mycb->password); 110 return sc_pin; 111 } * * So callback_data need to be always provided and have fixed type. * UI method still may be NULL. * * Following functions allocate and free callback data structure with * optional password set. */ typedef struct { char * password; char * prompt; } _cbd_t; void * engine_pkcs11_data_new(const char *pin) { _cbd_t * cb = (_cbd_t *) PyMem_Malloc(sizeof(_cbd_t)); if (!cb) { PyErr_SetString(PyExc_MemoryError, "engine_pkcs11_data_new"); return NULL; } cb->password = NULL; if (pin) { size_t size = strlen(pin); cb->password = (char *) PyMem_Malloc(size + 1); if (!cb->password) { PyErr_SetString(PyExc_MemoryError, "engine_pkcs11_data_new"); PyMem_Free(cb); return NULL; } memcpy(cb->password, pin, size + 1); } cb->prompt = NULL; return cb; } void engine_pkcs11_data_free(void * vcb) { _cbd_t * cb = (_cbd_t *) vcb; if (!cb) return; if (cb->password) PyMem_Free(cb->password); PyMem_Free(cb); } static PyObject *_engine_err; void engine_init_error(PyObject *engine_err) { Py_INCREF(engine_err); _engine_err = engine_err; } X509 * engine_load_certificate(ENGINE *e, const char * slot) { struct { const char * slot; X509 * cert; } cbd; cbd.slot = slot; cbd.cert = NULL; if (!ENGINE_ctrl_cmd(e, "LOAD_CERT_CTRL", 0, &cbd, NULL, 0)) { PyErr_SetString(_engine_err, "cannot load certificate"); return NULL; } return cbd.cert; } #include /* From the manpage for OBJ_obt2txt (): BUGS OBJ_obj2txt() is awkward and messy to use: it doesn’t follow the convention of other OpenSSL functions where the buffer can be set to NULL to determine the amount of data that should be written. Instead buf must point to a valid buffer and buf_len should be set to a positive value. A buffer length of 80 should be more than enough to handle any OID encountered in practice. The first call to OBJ_obj2txt () therefore passes a non-NULL dummy buffer. This wart is reportedly removed in OpenSSL 0.9.8b, although the manpage has not been updated. OBJ_obj2txt always prints \0 at the end. But the return value is the number of "good" bytes written. So memory is allocated for len + 1 bytes but only len bytes are marshalled to python. */ PyObject *obj_obj2txt(const ASN1_OBJECT *obj, int no_name) { int len; PyObject *ret; char *buf; char dummy[1]; len = OBJ_obj2txt(dummy, 1, obj, no_name); if (len < 0) { m2_PyErr_Msg(PyExc_RuntimeError); return NULL; } else if (len == 0) { /* XXX: For OpenSSL prior to 0.9.8b. Changes between 0.9.8a and 0.9.8b [04 May 2006] ... *) Several fixes and enhancements to the OID generation code. The old code sometimes allowed invalid OIDs (1.X for X >= 40 for example), couldn't handle numbers larger than ULONG_MAX, truncated printing and had a non standard OBJ_obj2txt() behaviour. [Steve Henson] */ len = 80; } buf = PyMem_Malloc(len + 1); len = OBJ_obj2txt(buf, len + 1, obj, no_name); ret = PyBytes_FromStringAndSize(buf, len); PyMem_Free(buf); return ret; } #ifdef __cplusplus extern "C" { #endif SWIGINTERN PyObject *_wrap__STACK_num_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"_STACK_num_set",1,1,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_STACK_num_set" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_STACK_num_set" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); if (arg1) (arg1)->num = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__STACK_num_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int result; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_STACK_num_get" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); result = (int) ((arg1)->num); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__STACK_data_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; char **arg2 = (char **) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"_STACK_data_set",1,1,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_STACK_data_set" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_char, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_STACK_data_set" "', argument " "2"" of type '" "char **""'"); } arg2 = (char **)(argp2); if (arg1) (arg1)->data = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__STACK_data_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; void *argp1 = 0 ; int res1 = 0 ; char **result = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_STACK_data_get" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); result = (char **) ((arg1)->data); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_p_char, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__STACK_sorted_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"_STACK_sorted_set",1,1,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_STACK_sorted_set" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_STACK_sorted_set" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); if (arg1) (arg1)->sorted = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__STACK_sorted_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int result; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_STACK_sorted_get" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); result = (int) ((arg1)->sorted); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__STACK_num_alloc_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"_STACK_num_alloc_set",1,1,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_STACK_num_alloc_set" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_STACK_num_alloc_set" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); if (arg1) (arg1)->num_alloc = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__STACK_num_alloc_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int result; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_STACK_num_alloc_get" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); result = (int) ((arg1)->num_alloc); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__STACK_comp_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; int (*arg2)(void const *,void const *) = (int (*)(void const *,void const *)) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"_STACK_comp_set",1,1,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_STACK_comp_set" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); { int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in method '" "_STACK_comp_set" "', argument " "2"" of type '" "int (*)(void const *,void const *)""'"); } } if (arg1) (arg1)->comp = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__STACK_comp_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int (*result)(void const *,void const *) = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_STACK_comp_get" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); result = (int (*)(void const *,void const *)) ((arg1)->comp); resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int); return resultobj; fail: return NULL; } SWIGINTERN int _wrap_new__STACK(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *result = 0 ; result = (struct stack_st *)calloc(1, sizeof(struct stack_st)); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: return -1; } SWIGINTERN PyObject *_wrap_delete__STACK(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st *arg1 = (struct stack_st *) 0 ; void *argp1 = 0 ; int res1 = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__STACK" "', argument " "1"" of type '" "struct stack_st *""'"); } arg1 = (struct stack_st *)(argp1); free((char *) arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_num(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_num",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_num" "', argument " "1"" of type '" "_STACK const *""'"); } arg1 = (_STACK *)(argp1); result = (int)sk_num((struct stack_st const *)arg1); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; void *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_value",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_value" "', argument " "1"" of type '" "_STACK const *""'"); } arg1 = (_STACK *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_value" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); result = (void *)sk_value((struct stack_st const *)arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; int arg2 ; void *arg3 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int res3 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; void *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_set",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_set" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_set" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); res3 = SWIG_ConvertPtr(obj2,SWIG_as_voidptrptr(&arg3), 0, 0); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "sk_set" "', argument " "3"" of type '" "void *""'"); } result = (void *)sk_set(arg1,arg2,arg3); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int (*arg1)(void const *,void const *) = (int (*)(void const *,void const *)) 0 ; PyObject * obj0 = 0 ; _STACK *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_new",1,1,&obj0)) SWIG_fail; { int res = SWIG_ConvertFunctionPtr(obj0, (void**)(&arg1), SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_new" "', argument " "1"" of type '" "int (*)(void const *,void const *)""'"); } } result = (_STACK *)sk_new(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_new_null(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *result = 0 ; result = (_STACK *)sk_new_null(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_free" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); sk_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_pop_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void (*arg2)(void *) = (void (*)(void *)) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_pop_free",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_pop_free" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); { int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void__void); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_pop_free" "', argument " "2"" of type '" "void (*)(void *)""'"); } } sk_pop_free(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_deep_copy(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *(*arg2)(void *) = (void *(*)(void *)) 0 ; void (*arg3)(void *) = (void (*)(void *)) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; _STACK *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_deep_copy",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_deep_copy" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); { int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void__p_void); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_deep_copy" "', argument " "2"" of type '" "void *(*)(void *)""'"); } } { int res = SWIG_ConvertFunctionPtr(obj2, (void**)(&arg3), SWIGTYPE_p_f_p_void__void); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_deep_copy" "', argument " "3"" of type '" "void (*)(void *)""'"); } } result = (_STACK *)sk_deep_copy(arg1,arg2,arg3); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_insert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *arg2 = (void *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_insert",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_insert" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_insert" "', argument " "2"" of type '" "void *""'"); } ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "sk_insert" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); result = (int)sk_insert(arg1,arg2,arg3); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_delete(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; void *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_delete",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_delete" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_delete" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); result = (void *)sk_delete(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_delete_ptr(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; void *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_delete_ptr",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_delete_ptr" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_delete_ptr" "', argument " "2"" of type '" "void *""'"); } result = (void *)sk_delete_ptr(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_find(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_find",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_find" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_find" "', argument " "2"" of type '" "void *""'"); } result = (int)sk_find(arg1,arg2); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_find_ex(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_find_ex",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_find_ex" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_find_ex" "', argument " "2"" of type '" "void *""'"); } result = (int)sk_find_ex(arg1,arg2); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_push(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_push",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_push" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_push" "', argument " "2"" of type '" "void *""'"); } result = (int)sk_push(arg1,arg2); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_unshift(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_unshift",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_unshift" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); res2 = SWIG_ConvertPtr(obj1,SWIG_as_voidptrptr(&arg2), 0, 0); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_unshift" "', argument " "2"" of type '" "void *""'"); } result = (int)sk_unshift(arg1,arg2); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_shift(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; void *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_shift",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_shift" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); result = (void *)sk_shift(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; void *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_pop",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_pop" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); result = (void *)sk_pop(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_zero(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_zero",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_zero" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); sk_zero(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_set_cmp_func(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; int (*arg2)(void const *,void const *) = (int (*)(void const *,void const *)) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int (*result)(void const *,void const *) = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_set_cmp_func",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_set_cmp_func" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); { int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_set_cmp_func" "', argument " "2"" of type '" "int (*)(void const *,void const *)""'"); } } result = (int (*)(void const *,void const *))sk_set_cmp_func(arg1,arg2); resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_dup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; _STACK *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_dup",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_dup" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); result = (_STACK *)sk_dup(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_sort(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_sort",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_sort" "', argument " "1"" of type '" "_STACK *""'"); } arg1 = (_STACK *)(argp1); sk_sort(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_is_sorted(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _STACK *arg1 = (_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_is_sorted",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_is_sorted" "', argument " "1"" of type '" "_STACK const *""'"); } arg1 = (_STACK *)(argp1); result = (int)sk_is_sorted((struct stack_st const *)arg1); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_stack_st_OPENSSL_STRING_stack_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; _STACK *arg2 = (_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"stack_st_OPENSSL_STRING_stack_set",1,1,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "stack_st_OPENSSL_STRING_stack_set" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "stack_st_OPENSSL_STRING_stack_set" "', argument " "2"" of type '" "_STACK *""'"); } arg2 = (_STACK *)(argp2); if (arg1) (arg1)->stack = *arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_stack_st_OPENSSL_STRING_stack_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; _STACK *result = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "stack_st_OPENSSL_STRING_stack_get" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); result = (_STACK *)& ((arg1)->stack); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN int _wrap_new_stack_st_OPENSSL_STRING(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_OPENSSL_STRING *result = 0 ; result = (struct stack_st_OPENSSL_STRING *)calloc(1, sizeof(struct stack_st_OPENSSL_STRING)); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: return -1; } SWIGINTERN PyObject *_wrap_delete_stack_st_OPENSSL_STRING(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_stack_st_OPENSSL_STRING" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); free((char *) arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_stack_st_OPENSSL_BLOCK_stack_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; _STACK *arg2 = (_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"stack_st_OPENSSL_BLOCK_stack_set",1,1,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "stack_st_OPENSSL_BLOCK_stack_set" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "stack_st_OPENSSL_BLOCK_stack_set" "', argument " "2"" of type '" "_STACK *""'"); } arg2 = (_STACK *)(argp2); if (arg1) (arg1)->stack = *arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_stack_st_OPENSSL_BLOCK_stack_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; _STACK *result = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "stack_st_OPENSSL_BLOCK_stack_get" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); result = (_STACK *)& ((arg1)->stack); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN int _wrap_new_stack_st_OPENSSL_BLOCK(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_OPENSSL_BLOCK *result = 0 ; result = (struct stack_st_OPENSSL_BLOCK *)calloc(1, sizeof(struct stack_st_OPENSSL_BLOCK)); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: return -1; } SWIGINTERN PyObject *_wrap_delete_stack_st_OPENSSL_BLOCK(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_stack_st_OPENSSL_BLOCK" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); free((char *) arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_threading_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; threading_init(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_threading_cleanup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; threading_cleanup(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_lib_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; lib_init(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bn_to_mpi(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIGNUM *arg1 = (BIGNUM *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bn_to_mpi",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIGNUM, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bn_to_mpi" "', argument " "1"" of type '" "BIGNUM const *""'"); } arg1 = (BIGNUM *)(argp1); result = (PyObject *)bn_to_mpi((BIGNUM const *)arg1); resultobj = result; return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_mpi_to_bn(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; BIGNUM *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"mpi_to_bn",1,1,&obj0)) SWIG_fail; arg1 = obj0; result = (BIGNUM *)mpi_to_bn(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bn_to_bin(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIGNUM *arg1 = (BIGNUM *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bn_to_bin",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIGNUM, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bn_to_bin" "', argument " "1"" of type '" "BIGNUM *""'"); } arg1 = (BIGNUM *)(argp1); result = (PyObject *)bn_to_bin(arg1); resultobj = result; return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bin_to_bn(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; BIGNUM *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bin_to_bn",1,1,&obj0)) SWIG_fail; arg1 = obj0; result = (BIGNUM *)bin_to_bn(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bn_to_hex(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIGNUM *arg1 = (BIGNUM *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bn_to_hex",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIGNUM, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bn_to_hex" "', argument " "1"" of type '" "BIGNUM *""'"); } arg1 = (BIGNUM *)(argp1); result = (PyObject *)bn_to_hex(arg1); resultobj = result; return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_hex_to_bn(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; BIGNUM *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"hex_to_bn",1,1,&obj0)) SWIG_fail; arg1 = obj0; result = (BIGNUM *)hex_to_bn(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dec_to_bn(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; BIGNUM *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dec_to_bn",1,1,&obj0)) SWIG_fail; arg1 = obj0; result = (BIGNUM *)dec_to_bn(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_err_print_errors(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"err_print_errors",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "err_print_errors" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { SWIG_PYTHON_THREAD_BEGIN_ALLOW; ERR_print_errors(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_err_get_error(PyObject *self, PyObject *args) { PyObject *resultobj = 0; unsigned long result; result = (unsigned long)ERR_get_error(); resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_err_peek_error(PyObject *self, PyObject *args) { PyObject *resultobj = 0; unsigned long result; result = (unsigned long)ERR_peek_error(); resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_err_lib_error_string(PyObject *self, PyObject *args) { PyObject *resultobj = 0; unsigned long arg1 ; unsigned long val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"err_lib_error_string",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "err_lib_error_string" "', argument " "1"" of type '" "unsigned long""'"); } arg1 = (unsigned long)(val1); result = (char *)ERR_lib_error_string(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_err_func_error_string(PyObject *self, PyObject *args) { PyObject *resultobj = 0; unsigned long arg1 ; unsigned long val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"err_func_error_string",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "err_func_error_string" "', argument " "1"" of type '" "unsigned long""'"); } arg1 = (unsigned long)(val1); result = (char *)ERR_func_error_string(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_err_reason_error_string(PyObject *self, PyObject *args) { PyObject *resultobj = 0; unsigned long arg1 ; unsigned long val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"err_reason_error_string",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_unsigned_SS_long(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "err_reason_error_string" "', argument " "1"" of type '" "unsigned long""'"); } arg1 = (unsigned long)(val1); result = (char *)ERR_reason_error_string(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_s_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO_METHOD *result = 0 ; result = (BIO_METHOD *)BIO_s_bio(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_s_mem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO_METHOD *result = 0 ; result = (BIO_METHOD *)BIO_s_mem(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_s_socket(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO_METHOD *result = 0 ; result = (BIO_METHOD *)BIO_s_socket(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_f_ssl(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO_METHOD *result = 0 ; result = (BIO_METHOD *)BIO_f_ssl(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_f_buffer(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO_METHOD *result = 0 ; result = (BIO_METHOD *)BIO_f_buffer(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_f_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO_METHOD *result = 0 ; result = (BIO_METHOD *)BIO_f_cipher(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO_METHOD *arg1 = (BIO_METHOD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; BIO *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_new",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO_METHOD, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_new" "', argument " "1"" of type '" "BIO_METHOD *""'"); } arg1 = (BIO_METHOD *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (BIO *)BIO_new(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_new_socket(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int arg2 ; int val1 ; int ecode1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; BIO *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_new_socket",2,2,&obj0,&obj1)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bio_new_socket" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_socket" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); result = (BIO *)BIO_new_socket(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_free_all(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_free_all",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_free_all" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; BIO_free_all(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_dup_chain(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; BIO *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_dup_chain",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_dup_chain" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (BIO *)BIO_dup_chain(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_push(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; BIO *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_push",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_push" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_push" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (BIO *)BIO_push(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; BIO *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_pop",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_pop" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (BIO *)BIO_pop(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_eof(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_eof",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_eof" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)BIO_eof(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__bio_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_bio_err""' of type '""PyObject *""'"); } _bio_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__bio_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_bio_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_pyfd_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; pyfd_init(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } bio_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_free" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_free(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_new_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; char *arg2 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; BIO *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_new_file",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_new_file" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_new_file" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); result = (BIO *)bio_new_file((char const *)arg1,(char const *)arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_bio_new_pyfile(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; int arg2 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; BIO *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_new_pyfile",2,2,&obj0,&obj1)) SWIG_fail; { arg1=obj0; } ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_pyfile" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); result = (BIO *)bio_new_pyfile(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_read(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_read",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_read" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_read" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)bio_read(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_gets(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_gets",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_gets" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_gets" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)bio_gets(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_write(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_write",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_write" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_write(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_ctrl_pending(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_ctrl_pending",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_ctrl_pending" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_ctrl_pending(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_ctrl_wpending(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_ctrl_wpending",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_ctrl_wpending" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_ctrl_wpending(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_ctrl_get_write_guarantee(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_ctrl_get_write_guarantee",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_ctrl_get_write_guarantee" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_ctrl_get_write_guarantee(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_reset(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_reset",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_reset" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_reset(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_flush(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_flush",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_flush" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)bio_flush(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_seek(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_seek",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_seek" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_seek" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_seek(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_tell(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_tell",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_tell" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_tell(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_set_flags(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_set_flags",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_flags" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_set_flags" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } bio_set_flags(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_get_flags(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_get_flags",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_get_flags" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_get_flags(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_set_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; EVP_CIPHER *arg2 = (EVP_CIPHER *) 0 ; PyObject *arg3 = (PyObject *) 0 ; PyObject *arg4 = (PyObject *) 0 ; int arg5 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val5 ; int ecode5 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_set_cipher",5,5,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_cipher" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_set_cipher" "', argument " "2"" of type '" "EVP_CIPHER *""'"); } arg2 = (EVP_CIPHER *)(argp2); { arg3=obj2; } { arg4=obj3; } ecode5 = SWIG_AsVal_int(obj4, &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "bio_set_cipher" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)bio_set_cipher(arg1,arg2,arg3,arg4,arg5); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_set_mem_eof_return(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_set_mem_eof_return",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_mem_eof_return" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_set_mem_eof_return" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_set_mem_eof_return(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_get_fd(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_get_fd",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_get_fd" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_get_fd(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_do_handshake(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_do_handshake",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_do_handshake" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)bio_do_handshake(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_make_bio_pair(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_make_bio_pair",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_make_bio_pair" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_make_bio_pair" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_make_bio_pair(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_set_write_buf_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; size_t arg2 ; void *argp1 = 0 ; int res1 = 0 ; size_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_set_write_buf_size",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_write_buf_size" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); ecode2 = SWIG_AsVal_size_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_set_write_buf_size" "', argument " "2"" of type '" "size_t""'"); } arg2 = (size_t)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_set_write_buf_size(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_should_retry(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_should_retry",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_should_retry" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_should_retry(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_should_read(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_should_read",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_should_read" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_should_read(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_should_write(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_should_write",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_should_write" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_should_write(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_BIO_meth_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; char *arg2 = (char *) 0 ; int val1 ; int ecode1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; BIO_METHOD *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"BIO_meth_new",2,2,&obj0,&obj1)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "BIO_meth_new" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "BIO_meth_new" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); result = (BIO_METHOD *)BIO_meth_new(arg1,(char const *)arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_BIO_meth_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO_METHOD *arg1 = (BIO_METHOD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"BIO_meth_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO_METHOD, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BIO_meth_free" "', argument " "1"" of type '" "BIO_METHOD *""'"); } arg1 = (BIO_METHOD *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } BIO_meth_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_BIO_PYFD_CTX_fd_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"BIO_PYFD_CTX_fd_set",1,1,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pyfd_struct, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BIO_PYFD_CTX_fd_set" "', argument " "1"" of type '" "struct pyfd_struct *""'"); } arg1 = (struct pyfd_struct *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BIO_PYFD_CTX_fd_set" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); if (arg1) (arg1)->fd = arg2; resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_BIO_PYFD_CTX_fd_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int result; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pyfd_struct, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BIO_PYFD_CTX_fd_get" "', argument " "1"" of type '" "struct pyfd_struct *""'"); } arg1 = (struct pyfd_struct *)(argp1); result = (int) ((arg1)->fd); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN int _wrap_new_BIO_PYFD_CTX(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct pyfd_struct *result = 0 ; result = (struct pyfd_struct *)calloc(1, sizeof(struct pyfd_struct)); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_pyfd_struct, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: return -1; } SWIGINTERN PyObject *_wrap_delete_BIO_PYFD_CTX(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ; void *argp1 = 0 ; int res1 = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pyfd_struct, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BIO_PYFD_CTX" "', argument " "1"" of type '" "struct pyfd_struct *""'"); } arg1 = (struct pyfd_struct *)(argp1); free((char *) arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN int Swig_var_methods_fdp_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_BIO_METHOD, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""methods_fdp""' of type '""BIO_METHOD *""'"); } methods_fdp = (BIO_METHOD *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var_methods_fdp_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(methods_fdp), SWIGTYPE_p_BIO_METHOD, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_pyfd_write(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; char *arg2 = (char *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pyfd_write",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_write" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pyfd_write" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pyfd_write" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)pyfd_write(arg1,(char const *)arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_pyfd_read(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; char *arg2 = (char *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pyfd_read",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_read" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pyfd_read" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pyfd_read" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)pyfd_read(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_pyfd_puts(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pyfd_puts",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_puts" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pyfd_puts" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)pyfd_puts(arg1,(char const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_pyfd_gets(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; char *arg2 = (char *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pyfd_gets",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_gets" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pyfd_gets" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pyfd_gets" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)pyfd_gets(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_pyfd_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pyfd_new",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_new" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)pyfd_new(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pyfd_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pyfd_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_free" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)pyfd_free(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pyfd_ctrl(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; int arg2 ; long arg3 ; void *arg4 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; long val3 ; int ecode3 = 0 ; int res4 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"pyfd_ctrl",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_ctrl" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pyfd_ctrl" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); ecode3 = SWIG_AsVal_long(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pyfd_ctrl" "', argument " "3"" of type '" "long""'"); } arg3 = (long)(val3); res4 = SWIG_ConvertPtr(obj3,SWIG_as_voidptrptr(&arg4), 0, 0); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "pyfd_ctrl" "', argument " "4"" of type '" "void *""'"); } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)pyfd_ctrl(arg1,arg2,arg3,arg4); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_new_pyfd(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int arg2 ; int val1 ; int ecode1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; BIO *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_new_pyfd",2,2,&obj0,&obj1)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bio_new_pyfd" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_pyfd" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); result = (BIO *)BIO_new_pyfd(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bn_rand(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int arg2 ; int arg3 ; int val1 ; int ecode1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bn_rand",3,3,&obj0,&obj1,&obj2)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bn_rand" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bn_rand" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bn_rand" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); result = (PyObject *)bn_rand(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bn_rand_range(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bn_rand_range",1,1,&obj0)) SWIG_fail; { arg1=obj0; } result = (PyObject *)bn_rand_range(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rand_file_name__SWIG_0(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; size_t arg2 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; size_t val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rand_file_name",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_file_name" "', argument " "1"" of type '" "char *""'"); } arg1 = (char *)(buf1); ecode2 = SWIG_AsVal_size_t(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_file_name" "', argument " "2"" of type '" "size_t""'"); } arg2 = (size_t)(val2); result = (char *)RAND_file_name(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap_rand_load_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; long arg2 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rand_load_file",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_load_file" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); ecode2 = SWIG_AsVal_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_load_file" "', argument " "2"" of type '" "long""'"); } arg2 = (long)(val2); result = (int)RAND_load_file((char const *)arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap_rand_save_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rand_save_file",1,1,&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_save_file" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); result = (int)RAND_write_file((char const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap_rand_poll(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int result; result = (int)RAND_poll(); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rand_status(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int result; result = (int)RAND_status(); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rand_cleanup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RAND_cleanup(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__rand_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_rand_err""' of type '""PyObject *""'"); } _rand_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__rand_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_rand_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_rand_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rand_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } rand_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rand_seed(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rand_seed",1,1,&obj0)) SWIG_fail; { arg1=obj0; } result = (PyObject *)rand_seed(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rand_add(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; double arg2 ; double val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rand_add",2,2,&obj0,&obj1)) SWIG_fail; { arg1=obj0; } ecode2 = SWIG_AsVal_double(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_add" "', argument " "2"" of type '" "double""'"); } arg2 = (double)(val2); result = (PyObject *)rand_add(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rand_bytes(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rand_bytes",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rand_bytes" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); result = (PyObject *)rand_bytes(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rand_pseudo_bytes(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rand_pseudo_bytes",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rand_pseudo_bytes" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); result = (PyObject *)rand_pseudo_bytes(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rand_file_name__SWIG_1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *result = 0 ; result = (PyObject *)rand_file_name(); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rand_file_name(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 0) { return _wrap_rand_file_name__SWIG_1(self, args); } if (argc == 2) { int _v; int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0); _v = SWIG_CheckState(res); if (_v) { { int res = SWIG_AsVal_size_t(argv[1], NULL); _v = SWIG_CheckState(res); } if (_v) { return _wrap_rand_file_name__SWIG_0(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'rand_file_name'.\n" " Possible C/C++ prototypes are:\n" " RAND_file_name(char *,size_t)\n" " rand_file_name()\n"); return 0; } SWIGINTERN PyObject *_wrap_rand_screen(PyObject *self, PyObject *args) { PyObject *resultobj = 0; rand_screen(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rand_win32_event(PyObject *self, PyObject *args) { PyObject *resultobj = 0; unsigned int arg1 ; int arg2 ; long arg3 ; unsigned int val1 ; int ecode1 = 0 ; int val2 ; int ecode2 = 0 ; long val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rand_win32_event",3,3,&obj0,&obj1,&obj2)) SWIG_fail; ecode1 = SWIG_AsVal_unsigned_SS_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rand_win32_event" "', argument " "1"" of type '" "unsigned int""'"); } arg1 = (unsigned int)(val1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_win32_event" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); ecode3 = SWIG_AsVal_long(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rand_win32_event" "', argument " "3"" of type '" "long""'"); } arg3 = (long)(val3); result = (int)rand_win32_event(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_md5(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD *result = 0 ; result = (EVP_MD *)EVP_md5(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sha1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD *result = 0 ; result = (EVP_MD *)EVP_sha1(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ripemd160(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD *result = 0 ; result = (EVP_MD *)EVP_ripemd160(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sha224(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD *result = 0 ; result = (EVP_MD *)EVP_sha224(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sha256(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD *result = 0 ; result = (EVP_MD *)EVP_sha256(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sha384(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD *result = 0 ; result = (EVP_MD *)EVP_sha384(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sha512(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD *result = 0 ; result = (EVP_MD *)EVP_sha512(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_digest_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; EVP_MD *arg2 = (EVP_MD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"digest_init",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } arg1 = (EVP_MD_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_init" "', argument " "2"" of type '" "EVP_MD const *""'"); } arg2 = (EVP_MD *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)EVP_DigestInit(arg1,(EVP_MD const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_ecb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_ede_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_ede(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_ede3_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_ede3(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_cbc(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_ede_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_ede_cbc(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_ede3_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_ede3_cbc(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_cfb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_cfb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_ede_cfb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_ede_cfb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_ede3_cfb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_ede3_cfb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_ofb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_ede_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_ede_ofb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_des_ede3_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_des_ede3_ofb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bf_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_bf_ecb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bf_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_bf_cbc(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bf_cfb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_bf_cfb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bf_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_bf_ofb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_cast5_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_cast5_ecb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_cast5_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_cast5_cbc(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_cast5_cfb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_cast5_cfb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_cast5_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_cast5_ofb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rc4(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_rc4(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rc2_40_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_rc2_40_cbc(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_128_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_128_ecb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_128_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_128_cbc(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_128_cfb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_128_cfb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_128_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_128_ofb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_128_ctr(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_128_ctr(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_192_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_192_ecb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_192_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_192_cbc(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_192_cfb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_192_cfb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_192_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_192_ofb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_192_ctr(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_192_ctr(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_256_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_256_ecb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_256_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_256_cbc(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_256_cfb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_256_cfb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_256_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_256_ofb(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_256_ctr(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *result = 0 ; result = (EVP_CIPHER *)EVP_aes_256_ctr(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_cipher_set_padding(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"cipher_set_padding",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_set_padding" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'"); } arg1 = (EVP_CIPHER_CTX *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cipher_set_padding" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)EVP_CIPHER_CTX_set_padding(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkey_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_free" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } EVP_PKEY_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_assign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; int arg2 ; char *arg3 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pkey_assign",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_assign" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pkey_assign" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkey_assign" "', argument " "3"" of type '" "char *""'"); } arg3 = (char *)(buf3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)EVP_PKEY_assign(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } SWIGINTERN PyObject *_wrap_pkey_assign_ec(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; EC_KEY *arg2 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pkey_assign_ec",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_assign_ec" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkey_assign_ec" "', argument " "2"" of type '" "EC_KEY *""'"); } arg2 = (EC_KEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)EVP_PKEY_assign_EC_KEY(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_set1_rsa(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; RSA *arg2 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pkey_set1_rsa",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_set1_rsa" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkey_set1_rsa" "', argument " "2"" of type '" "RSA *""'"); } arg2 = (RSA *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)EVP_PKEY_set1_RSA(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sign_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; EVP_MD *arg2 = (EVP_MD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sign_init",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sign_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } arg1 = (EVP_MD_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sign_init" "', argument " "2"" of type '" "EVP_MD const *""'"); } arg2 = (EVP_MD *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)EVP_SignInit(arg1,(EVP_MD const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_verify_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; EVP_MD *arg2 = (EVP_MD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"verify_init",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "verify_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } arg1 = (EVP_MD_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "verify_init" "', argument " "2"" of type '" "EVP_MD const *""'"); } arg2 = (EVP_MD *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)EVP_VerifyInit(arg1,(EVP_MD const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pkey_size",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_size" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)EVP_PKEY_size(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__evp_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_evp_err""' of type '""PyObject *""'"); } _evp_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__evp_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_evp_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_evp_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"evp_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } evp_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_get1_rsa(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; RSA *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkey_get1_rsa",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_get1_rsa" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (RSA *)pkey_get1_rsa(arg1); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_RSA, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs5_pbkdf2_hmac_sha1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject *arg2 = (PyObject *) 0 ; int arg3 ; int arg4 ; int val3 ; int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs5_pbkdf2_hmac_sha1",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; { arg1=obj0; } { arg2=obj1; } ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pkcs5_pbkdf2_hmac_sha1" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pkcs5_pbkdf2_hmac_sha1" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); result = (PyObject *)pkcs5_pbkdf2_hmac_sha1(arg1,arg2,arg3,arg4); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_md_ctx_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *result = 0 ; result = (EVP_MD_CTX *)md_ctx_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_md_ctx_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"md_ctx_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "md_ctx_free" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } arg1 = (EVP_MD_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } md_ctx_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_digest_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"digest_update",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } arg1 = (EVP_MD_CTX *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)digest_update(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_digest_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"digest_final",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } arg1 = (EVP_MD_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)digest_final(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_hmac_ctx_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; HMAC_CTX *result = 0 ; result = (HMAC_CTX *)hmac_ctx_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HMAC_CTX, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_hmac_ctx_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; HMAC_CTX *arg1 = (HMAC_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"hmac_ctx_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HMAC_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_ctx_free" "', argument " "1"" of type '" "HMAC_CTX *""'"); } arg1 = (HMAC_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } hmac_ctx_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_hmac_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; HMAC_CTX *arg1 = (HMAC_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; EVP_MD *arg3 = (EVP_MD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"hmac_init",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HMAC_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_init" "', argument " "1"" of type '" "HMAC_CTX *""'"); } arg1 = (HMAC_CTX *)(argp1); { arg2=obj1; } res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hmac_init" "', argument " "3"" of type '" "EVP_MD const *""'"); } arg3 = (EVP_MD *)(argp3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)hmac_init(arg1,arg2,(EVP_MD const *)arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_hmac_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; HMAC_CTX *arg1 = (HMAC_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"hmac_update",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HMAC_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_update" "', argument " "1"" of type '" "HMAC_CTX *""'"); } arg1 = (HMAC_CTX *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)hmac_update(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_hmac_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; HMAC_CTX *arg1 = (HMAC_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"hmac_final",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_HMAC_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_final" "', argument " "1"" of type '" "HMAC_CTX *""'"); } arg1 = (HMAC_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)hmac_final(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_hmac(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject *arg2 = (PyObject *) 0 ; EVP_MD *arg3 = (EVP_MD *) 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"hmac",3,3,&obj0,&obj1,&obj2)) SWIG_fail; { arg1=obj0; } { arg2=obj1; } res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hmac" "', argument " "3"" of type '" "EVP_MD const *""'"); } arg3 = (EVP_MD *)(argp3); { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)hmac(arg1,arg2,(EVP_MD const *)arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_cipher_ctx_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER_CTX *result = 0 ; result = (EVP_CIPHER_CTX *)cipher_ctx_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_cipher_ctx_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"cipher_ctx_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_ctx_free" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'"); } arg1 = (EVP_CIPHER_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } cipher_ctx_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bytes_to_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER *arg1 = (EVP_CIPHER *) 0 ; EVP_MD *arg2 = (EVP_MD *) 0 ; PyObject *arg3 = (PyObject *) 0 ; PyObject *arg4 = (PyObject *) 0 ; PyObject *arg5 = (PyObject *) 0 ; int arg6 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val6 ; int ecode6 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bytes_to_key",6,6,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bytes_to_key" "', argument " "1"" of type '" "EVP_CIPHER const *""'"); } arg1 = (EVP_CIPHER *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bytes_to_key" "', argument " "2"" of type '" "EVP_MD *""'"); } arg2 = (EVP_MD *)(argp2); { arg3=obj2; } { arg4=obj3; } { arg5=obj4; } ecode6 = SWIG_AsVal_int(obj5, &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "bytes_to_key" "', argument " "6"" of type '" "int""'"); } arg6 = (int)(val6); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)bytes_to_key((EVP_CIPHER const *)arg1,arg2,arg3,arg4,arg5,arg6); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_cipher_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ; EVP_CIPHER *arg2 = (EVP_CIPHER *) 0 ; PyObject *arg3 = (PyObject *) 0 ; PyObject *arg4 = (PyObject *) 0 ; int arg5 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val5 ; int ecode5 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"cipher_init",5,5,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_init" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'"); } arg1 = (EVP_CIPHER_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cipher_init" "', argument " "2"" of type '" "EVP_CIPHER const *""'"); } arg2 = (EVP_CIPHER *)(argp2); { arg3=obj2; } { arg4=obj3; } ecode5 = SWIG_AsVal_int(obj4, &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "cipher_init" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)cipher_init(arg1,(EVP_CIPHER const *)arg2,arg3,arg4,arg5); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_cipher_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"cipher_update",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_update" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'"); } arg1 = (EVP_CIPHER_CTX *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)cipher_update(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_cipher_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"cipher_final",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_final" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'"); } arg1 = (EVP_CIPHER_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)cipher_final(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sign_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sign_update",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sign_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } arg1 = (EVP_MD_CTX *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)sign_update(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sign_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sign_final",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sign_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } arg1 = (EVP_MD_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sign_final" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)sign_final(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_verify_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"verify_update",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "verify_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } arg1 = (EVP_MD_CTX *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)verify_update(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_verify_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; EVP_PKEY *arg3 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"verify_final",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "verify_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } arg1 = (EVP_MD_CTX *)(argp1); { arg2=obj1; } res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "verify_final" "', argument " "3"" of type '" "EVP_PKEY *""'"); } arg3 = (EVP_PKEY *)(argp3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)verify_final(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_get_digestbyname(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; PyObject * obj0 = 0 ; EVP_MD *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"get_digestbyname",1,1,&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_digestbyname" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); result = (EVP_MD *)get_digestbyname((char const *)arg1); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_EVP_MD, 0); else { resultobj = NULL; } } if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap_pkey_write_pem_no_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; BIO *arg2 = (BIO *) 0 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pkey_write_pem_no_cipher",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_write_pem_no_cipher" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkey_write_pem_no_cipher" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!PyCallable_Check(obj2)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)pkey_write_pem_no_cipher(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_write_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; BIO *arg2 = (BIO *) 0 ; EVP_CIPHER *arg3 = (EVP_CIPHER *) 0 ; PyObject *arg4 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pkey_write_pem",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_write_pem" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkey_write_pem" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkey_write_pem" "', argument " "3"" of type '" "EVP_CIPHER *""'"); } arg3 = (EVP_CIPHER *)(argp3); { if (!PyCallable_Check(obj3)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg4=obj3; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)pkey_write_pem(arg1,arg2,arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *result = 0 ; result = (EVP_PKEY *)pkey_new(); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_EVP_PKEY, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_read_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; EVP_PKEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkey_read_pem",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_read_pem" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (EVP_PKEY *)pkey_read_pem(arg1,arg2); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_EVP_PKEY, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_read_pem_pubkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; EVP_PKEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkey_read_pem_pubkey",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_read_pem_pubkey" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (EVP_PKEY *)pkey_read_pem_pubkey(arg1,arg2); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_EVP_PKEY, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_assign_rsa(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; RSA *arg2 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pkey_assign_rsa",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_assign_rsa" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkey_assign_rsa" "', argument " "2"" of type '" "RSA *""'"); } arg2 = (RSA *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)pkey_assign_rsa(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_as_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkey_as_der",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_as_der" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)pkey_as_der(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkey_get_modulus(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkey_get_modulus",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_get_modulus" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)pkey_get_modulus(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_aes_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; AES_KEY *result = 0 ; result = (AES_KEY *)aes_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_AES_KEY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_AES_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; AES_KEY *arg1 = (AES_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"AES_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AES_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_free" "', argument " "1"" of type '" "AES_KEY *""'"); } arg1 = (AES_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } AES_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_AES_set_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; AES_KEY *arg1 = (AES_KEY *) 0 ; PyObject *arg2 = (PyObject *) 0 ; int arg3 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; int val3 ; int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"AES_set_key",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AES_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_set_key" "', argument " "1"" of type '" "AES_KEY *""'"); } arg1 = (AES_KEY *)(argp1); { arg2=obj1; } ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "AES_set_key" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "AES_set_key" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)AES_set_key(arg1,arg2,arg3,arg4); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_AES_crypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; AES_KEY *arg1 = (AES_KEY *) 0 ; PyObject *arg2 = (PyObject *) 0 ; int arg3 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; int val3 ; int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"AES_crypt",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AES_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_crypt" "', argument " "1"" of type '" "AES_KEY const *""'"); } arg1 = (AES_KEY *)(argp1); { arg2=obj1; } ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "AES_crypt" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "AES_crypt" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)AES_crypt((AES_KEY const *)arg1,arg2,arg3,arg4); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_AES_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; AES_KEY *arg1 = (AES_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"AES_type_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_AES_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_type_check" "', argument " "1"" of type '" "AES_KEY *""'"); } arg1 = (AES_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)AES_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rc4_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RC4_KEY *result = 0 ; result = (RC4_KEY *)rc4_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RC4_KEY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rc4_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RC4_KEY *arg1 = (RC4_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rc4_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RC4_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_free" "', argument " "1"" of type '" "RC4_KEY *""'"); } arg1 = (RC4_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } rc4_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rc4_set_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RC4_KEY *arg1 = (RC4_KEY *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rc4_set_key",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RC4_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_set_key" "', argument " "1"" of type '" "RC4_KEY *""'"); } arg1 = (RC4_KEY *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rc4_set_key(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rc4_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RC4_KEY *arg1 = (RC4_KEY *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rc4_update",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RC4_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_update" "', argument " "1"" of type '" "RC4_KEY *""'"); } arg1 = (RC4_KEY *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rc4_update(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rc4_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RC4_KEY *arg1 = (RC4_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rc4_type_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RC4_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_type_check" "', argument " "1"" of type '" "RC4_KEY *""'"); } arg1 = (RC4_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)rc4_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *result = 0 ; result = (DH *)DH_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DH, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dh_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_free" "', argument " "1"" of type '" "DH *""'"); } arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } DH_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dh_size",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_size" "', argument " "1"" of type '" "DH const *""'"); } arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)DH_size((DH const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_generate_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dh_generate_key",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_generate_key" "', argument " "1"" of type '" "DH *""'"); } arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)DH_generate_key(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dhparams_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; DH *arg2 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dhparams_print",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dhparams_print" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dhparams_print" "', argument " "2"" of type '" "DH const *""'"); } arg2 = (DH *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)DHparams_print(arg1,(DH const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__dh_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_dh_err""' of type '""PyObject *""'"); } _dh_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__dh_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_dh_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_dh_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dh_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } dh_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dh_type_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_type_check" "', argument " "1"" of type '" "DH *""'"); } arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)dh_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_read_parameters(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; DH *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dh_read_parameters",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_read_parameters" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (DH *)dh_read_parameters(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DH, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_generate_parameters(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int arg2 ; PyObject *arg3 = (PyObject *) 0 ; int val1 ; int ecode1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; DH *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dh_generate_parameters",3,3,&obj0,&obj1,&obj2)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dh_generate_parameters" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dh_generate_parameters" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!PyCallable_Check(obj2)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg3=obj2; } result = (DH *)dh_generate_parameters(arg1,arg2,arg3); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DH, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dh_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_check" "', argument " "1"" of type '" "DH *""'"); } arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)dh_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_compute_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dh_compute_key",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_compute_key" "', argument " "1"" of type '" "DH *""'"); } arg1 = (DH *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dh_compute_key(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_get_p(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dh_get_p",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_p" "', argument " "1"" of type '" "DH *""'"); } arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dh_get_p(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_get_g(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dh_get_g",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_g" "', argument " "1"" of type '" "DH *""'"); } arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dh_get_g(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_get_pub(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dh_get_pub",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_pub" "', argument " "1"" of type '" "DH *""'"); } arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dh_get_pub(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_get_priv(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dh_get_priv",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_priv" "', argument " "1"" of type '" "DH *""'"); } arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dh_get_priv(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dh_set_pg(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DH *arg1 = (DH *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dh_set_pg",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_set_pg" "', argument " "1"" of type '" "DH *""'"); } arg1 = (DH *)(argp1); { arg2=obj1; } { arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dh_set_pg(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rsa_size",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_size" "', argument " "1"" of type '" "RSA const *""'"); } arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)RSA_size((RSA const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *result = 0 ; result = (RSA *)RSA_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RSA, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_free" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } RSA_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_check_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rsa_check_key",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_check_key" "', argument " "1"" of type '" "RSA const *""'"); } arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)RSA_check_key((RSA const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__rsa_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_rsa_err""' of type '""PyObject *""'"); } _rsa_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__rsa_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_rsa_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_rsa_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } rsa_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_read_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; RSA *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_read_key",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_read_key" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (RSA *)rsa_read_key(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RSA, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_write_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; BIO *arg2 = (BIO *) 0 ; EVP_CIPHER *arg3 = (EVP_CIPHER *) 0 ; PyObject *arg4 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rsa_write_key",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rsa_write_key" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "rsa_write_key" "', argument " "3"" of type '" "EVP_CIPHER *""'"); } arg3 = (EVP_CIPHER *)(argp3); { if (!PyCallable_Check(obj3)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg4=obj3; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg4) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)rsa_write_key(arg1,arg2,arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_write_key_no_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; BIO *arg2 = (BIO *) 0 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rsa_write_key_no_cipher",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key_no_cipher" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rsa_write_key_no_cipher" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!PyCallable_Check(obj2)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)rsa_write_key_no_cipher(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_read_pub_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; RSA *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_read_pub_key",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_read_pub_key" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (RSA *)rsa_read_pub_key(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RSA, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_write_pub_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rsa_write_pub_key",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_pub_key" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rsa_write_pub_key" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)rsa_write_pub_key(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_get_e(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_get_e",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_get_e" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_get_e(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_get_n(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_get_n",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_get_n" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_get_n(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_set_e(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_set_e",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_e" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_set_e(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_set_n(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_set_n",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_n" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_set_n(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_set_en(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_set_en",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_en" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } { arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_set_en(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_PyObject_Bin_AsBIGNUM(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; BIGNUM *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"PyObject_Bin_AsBIGNUM",1,1,&obj0)) SWIG_fail; { arg1=obj0; } result = (BIGNUM *)PyObject_Bin_AsBIGNUM(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_set_en_bin(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_set_en_bin",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_en_bin" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } { arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_set_en_bin(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_private_encrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_private_encrypt",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_private_encrypt" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_private_encrypt" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_private_encrypt(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_public_decrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_public_decrypt",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_public_decrypt" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_public_decrypt" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_public_decrypt(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_public_encrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_public_encrypt",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_public_encrypt" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_public_encrypt" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_public_encrypt(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_private_decrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_private_decrypt",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_private_decrypt" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_private_decrypt" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_private_decrypt(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_padding_add_pkcs1_pss(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; EVP_MD *arg3 = (EVP_MD *) 0 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; void *argp3 = 0 ; int res3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_padding_add_pkcs1_pss",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_padding_add_pkcs1_pss" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "rsa_padding_add_pkcs1_pss" "', argument " "3"" of type '" "EVP_MD *""'"); } arg3 = (EVP_MD *)(argp3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "rsa_padding_add_pkcs1_pss" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_padding_add_pkcs1_pss(arg1,arg2,arg3,arg4); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_verify_pkcs1_pss(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject *arg3 = (PyObject *) 0 ; EVP_MD *arg4 = (EVP_MD *) 0 ; int arg5 ; void *argp1 = 0 ; int res1 = 0 ; void *argp4 = 0 ; int res4 = 0 ; int val5 ; int ecode5 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rsa_verify_pkcs1_pss",5,5,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_verify_pkcs1_pss" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } { arg3=obj2; } res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "rsa_verify_pkcs1_pss" "', argument " "4"" of type '" "EVP_MD *""'"); } arg4 = (EVP_MD *)(argp4); ecode5 = SWIG_AsVal_int(obj4, &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "rsa_verify_pkcs1_pss" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg4) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)rsa_verify_pkcs1_pss(arg1,arg2,arg3,arg4,arg5); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_sign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_sign",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_sign" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_sign" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_sign(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_verify(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject *arg3 = (PyObject *) 0 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rsa_verify",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_verify" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { arg2=obj1; } { arg3=obj2; } ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "rsa_verify" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)rsa_verify(arg1,arg2,arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_generate_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; unsigned long arg2 ; PyObject *arg3 = (PyObject *) 0 ; int val1 ; int ecode1 = 0 ; unsigned long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"rsa_generate_key",3,3,&obj0,&obj1,&obj2)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rsa_generate_key" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rsa_generate_key" "', argument " "2"" of type '" "unsigned long""'"); } arg2 = (unsigned long)(val2); { if (!PyCallable_Check(obj2)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg3=obj2; } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)rsa_generate_key(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rsa_type_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_type_check" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)rsa_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_check_pub_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rsa_check_pub_key",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_check_pub_key" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)rsa_check_pub_key(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_rsa_write_key_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; RSA *arg1 = (RSA *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"rsa_write_key_der",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key_der" "', argument " "1"" of type '" "RSA *""'"); } arg1 = (RSA *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rsa_write_key_der" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)rsa_write_key_der(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *result = 0 ; result = (DSA *)DSA_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DSA, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_free" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } DSA_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_size",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_size" "', argument " "1"" of type '" "DSA const *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)DSA_size((DSA const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_gen_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_gen_key",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_gen_key" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)DSA_generate_key(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__dsa_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_dsa_err""' of type '""PyObject *""'"); } _dsa_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__dsa_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_dsa_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_dsa_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } dsa_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_generate_parameters(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; PyObject *arg2 = (PyObject *) 0 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; DSA *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_generate_parameters",2,2,&obj0,&obj1)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dsa_generate_parameters" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (DSA *)dsa_generate_parameters(arg1,arg2); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_DSA, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_read_params(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; DSA *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_read_params",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_params" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (DSA *)dsa_read_params(arg1,arg2); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_DSA, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_read_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; DSA *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_read_key",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_key" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (DSA *)dsa_read_key(arg1,arg2); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_DSA, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_read_pub_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; DSA *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_read_pub_key",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_pub_key" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (DSA *)dsa_read_pub_key(arg1,arg2); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_DSA, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_get_p(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_get_p",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_p" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dsa_get_p(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_get_q(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_get_q",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_q" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dsa_get_q(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_get_g(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_get_g",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_g" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dsa_get_g(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_get_pub(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_get_pub",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_pub" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dsa_get_pub(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_get_priv(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_get_priv",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_priv" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dsa_get_priv(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_set_pqg(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject *arg3 = (PyObject *) 0 ; PyObject *arg4 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_set_pqg",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_set_pqg" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { arg2=obj1; } { arg3=obj2; } { arg4=obj3; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dsa_set_pqg(arg1,arg2,arg3,arg4); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_set_pub(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_set_pub",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_set_pub" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dsa_set_pub(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_write_params_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_write_params_bio",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_params_bio" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dsa_write_params_bio" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)dsa_write_params_bio(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_write_key_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; BIO *arg2 = (BIO *) 0 ; EVP_CIPHER *arg3 = (EVP_CIPHER *) 0 ; PyObject *arg4 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_write_key_bio",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_key_bio" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dsa_write_key_bio" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "dsa_write_key_bio" "', argument " "3"" of type '" "EVP_CIPHER *""'"); } arg3 = (EVP_CIPHER *)(argp3); { if (!PyCallable_Check(obj3)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg4=obj3; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg4) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)dsa_write_key_bio(arg1,arg2,arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_write_key_bio_no_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; BIO *arg2 = (BIO *) 0 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_write_key_bio_no_cipher",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_key_bio_no_cipher" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dsa_write_key_bio_no_cipher" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!PyCallable_Check(obj2)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)dsa_write_key_bio_no_cipher(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_write_pub_key_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_write_pub_key_bio",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_pub_key_bio" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dsa_write_pub_key_bio" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)dsa_write_pub_key_bio(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_sign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_sign",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_sign" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dsa_sign(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_verify(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject *arg3 = (PyObject *) 0 ; PyObject *arg4 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_verify",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_verify" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { arg2=obj1; } { arg3=obj2; } { arg4=obj3; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)dsa_verify(arg1,arg2,arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_sign_asn1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"dsa_sign_asn1",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_sign_asn1" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)dsa_sign_asn1(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_verify_asn1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_verify_asn1",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_verify_asn1" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { arg2=obj1; } { arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)dsa_verify_asn1(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_check_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_check_key",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_check_key" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)dsa_check_key(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_check_pub_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_check_pub_key",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_check_pub_key" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)dsa_check_pub_key(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_keylen(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_keylen",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_keylen" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)dsa_keylen(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_dsa_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"dsa_type_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_type_check" "', argument " "1"" of type '" "DSA *""'"); } arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)dsa_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_ciphers(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; struct stack_st_SSL_CIPHER *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_ciphers",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_ciphers" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (struct stack_st_SSL_CIPHER *)SSL_get_ciphers((SSL const *)arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_SSL_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_version",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_version" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (char *)SSL_get_version((SSL const *)arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_error(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_error",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_error" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_get_error" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_get_error((SSL const *)arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_state(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_state",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_state" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (char *)SSL_state_string((SSL const *)arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_state_v(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_state_v",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_state_v" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (char *)SSL_state_string_long((SSL const *)arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_alert_type(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_alert_type",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ssl_get_alert_type" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); result = (char *)SSL_alert_type_string(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_alert_type_v(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_alert_type_v",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ssl_get_alert_type_v" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); result = (char *)SSL_alert_type_string_long(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_alert_desc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_alert_desc",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ssl_get_alert_desc" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); result = (char *)SSL_alert_desc_string(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_alert_desc_v(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_alert_desc_v",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ssl_get_alert_desc_v" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); result = (char *)SSL_alert_desc_string_long(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sslv23_method(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_METHOD *result = 0 ; result = (SSL_METHOD *)SSLv23_method(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_METHOD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_METHOD *arg1 = (SSL_METHOD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; SSL_CTX *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_new",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_METHOD, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_new" "', argument " "1"" of type '" "SSL_METHOD *""'"); } arg1 = (SSL_METHOD *)(argp1); result = (SSL_CTX *)SSL_CTX_new(arg1); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_SSL_CTX, 0); else { m2_PyErr_Msg(_ssl_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_free" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } SSL_CTX_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify_depth(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_verify_depth",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_verify_depth" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_verify_depth" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } SSL_CTX_set_verify_depth(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_get_verify_depth(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_get_verify_depth",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_verify_depth" "', argument " "1"" of type '" "SSL_CTX const *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_CTX_get_verify_depth((SSL_CTX const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_get_verify_mode(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_get_verify_mode",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_verify_mode" "', argument " "1"" of type '" "SSL_CTX const *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_CTX_get_verify_mode((SSL_CTX const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_cipher_list(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_cipher_list",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_cipher_list" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_cipher_list" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_CTX_set_cipher_list(arg1,(char const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_add_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; SSL_SESSION *arg2 = (SSL_SESSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_add_session",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_add_session" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_add_session" "', argument " "2"" of type '" "SSL_SESSION *""'"); } arg2 = (SSL_SESSION *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_CTX_add_session(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_remove_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; SSL_SESSION *arg2 = (SSL_SESSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_remove_session",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_remove_session" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_remove_session" "', argument " "2"" of type '" "SSL_SESSION *""'"); } arg2 = (SSL_SESSION *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_CTX_remove_session(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_session_timeout(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; long arg2 ; void *argp1 = 0 ; int res1 = 0 ; long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_session_timeout",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_session_timeout" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); ecode2 = SWIG_AsVal_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_session_timeout" "', argument " "2"" of type '" "long""'"); } arg2 = (long)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)SSL_CTX_set_timeout(arg1,arg2); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_get_session_timeout(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_get_session_timeout",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_session_timeout" "', argument " "1"" of type '" "SSL_CTX const *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)SSL_CTX_get_timeout((SSL_CTX const *)arg1); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_get_cert_store(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509_STORE *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_get_cert_store",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_cert_store" "', argument " "1"" of type '" "SSL_CTX const *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509_STORE *)SSL_CTX_get_cert_store((SSL_CTX const *)arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_STORE, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_default_verify_paths(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_default_verify_paths",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_default_verify_paths" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_CTX_set_default_verify_paths(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_ex_data_x509_store_ctx_idx(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int result; result = (int)SSL_get_ex_data_X509_STORE_CTX_idx(); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_new_ssl(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; BIO *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"bio_new_ssl",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_new_ssl" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_ssl" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (BIO *)BIO_new_ssl(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; SSL *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_new",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_new" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (SSL *)SSL_new(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_free" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; SSL_free(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_dup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; SSL *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_dup",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_dup" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (SSL *)SSL_dup(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; BIO *arg2 = (BIO *) 0 ; BIO *arg3 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_bio",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_bio" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_bio" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ssl_set_bio" "', argument " "3"" of type '" "BIO *""'"); } arg3 = (BIO *)(argp3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } SSL_set_bio(arg1,arg2,arg3); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_accept_state(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_accept_state",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_accept_state" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } SSL_set_accept_state(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_connect_state(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_connect_state",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_connect_state" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } SSL_set_connect_state(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_shutdown(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_shutdown",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_shutdown" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_get_shutdown((SSL const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_shutdown(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_shutdown",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_shutdown" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_shutdown" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } SSL_set_shutdown(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_shutdown(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_shutdown",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_shutdown" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)SSL_shutdown(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_clear(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_clear",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_clear" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_clear(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_do_handshake(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_do_handshake",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_do_handshake" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)SSL_do_handshake(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_renegotiate(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_renegotiate",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_renegotiate" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)SSL_renegotiate(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_pending(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_pending",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_pending" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_pending((SSL const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_peer_cert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_peer_cert",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_peer_cert" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509 *)SSL_get_peer_certificate((SSL const *)arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_current_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; SSL_CIPHER *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_current_cipher",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_current_cipher" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (SSL_CIPHER *)SSL_get_current_cipher((SSL const *)arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_verify_mode(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_verify_mode",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_mode" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_get_verify_mode((SSL const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_verify_depth(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_verify_depth",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_depth" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_get_verify_depth((SSL const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_verify_result(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_verify_result",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_result" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)SSL_get_verify_result((SSL const *)arg1); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_ssl_ctx(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; SSL_CTX *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_ssl_ctx",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_ssl_ctx" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (SSL_CTX *)SSL_get_SSL_CTX((SSL const *)arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_CTX, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_default_session_timeout(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_default_session_timeout",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_default_session_timeout" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)SSL_get_default_timeout((SSL const *)arg1); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_cipher_list(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_cipher_list",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_cipher_list" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_cipher_list" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_set_cipher_list(arg1,(char const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_cipher_list(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_cipher_list",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_cipher_list" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_get_cipher_list" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (char *)SSL_get_cipher_list((SSL const *)arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_cipher_get_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_cipher_get_name",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_cipher_get_name" "', argument " "1"" of type '" "SSL_CIPHER const *""'"); } arg1 = (SSL_CIPHER *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (char *)SSL_CIPHER_get_name((SSL_CIPHER const *)arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_cipher_get_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_cipher_get_version",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_cipher_get_version" "', argument " "1"" of type '" "SSL_CIPHER const *""'"); } arg1 = (SSL_CIPHER *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (char *)SSL_CIPHER_get_version((SSL_CIPHER const *)arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; SSL_SESSION *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_session",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_session" "', argument " "1"" of type '" "SSL const *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (SSL_SESSION *)SSL_get_session((SSL const *)arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_SESSION, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get1_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; SSL_SESSION *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get1_session",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get1_session" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (SSL_SESSION *)SSL_get1_session(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_SESSION, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; SSL_SESSION *arg2 = (SSL_SESSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_session",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_session" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_session" "', argument " "2"" of type '" "SSL_SESSION *""'"); } arg2 = (SSL_SESSION *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)SSL_set_session(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_session_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_SESSION *arg1 = (SSL_SESSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_session_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_free" "', argument " "1"" of type '" "SSL_SESSION *""'"); } arg1 = (SSL_SESSION *)(argp1); SSL_SESSION_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_session_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; SSL_SESSION *arg2 = (SSL_SESSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_session_print",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_print" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_session_print" "', argument " "2"" of type '" "SSL_SESSION const *""'"); } arg2 = (SSL_SESSION *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)SSL_SESSION_print(arg1,(SSL_SESSION const *)arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_session_set_timeout(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_SESSION *arg1 = (SSL_SESSION *) 0 ; long arg2 ; void *argp1 = 0 ; int res1 = 0 ; long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_session_set_timeout",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_set_timeout" "', argument " "1"" of type '" "SSL_SESSION *""'"); } arg1 = (SSL_SESSION *)(argp1); ecode2 = SWIG_AsVal_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_session_set_timeout" "', argument " "2"" of type '" "long""'"); } arg2 = (long)(val2); result = (long)SSL_SESSION_set_timeout(arg1,arg2); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_session_get_timeout(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_SESSION *arg1 = (SSL_SESSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_session_get_timeout",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_get_timeout" "', argument " "1"" of type '" "SSL_SESSION const *""'"); } arg1 = (SSL_SESSION *)(argp1); result = (long)SSL_SESSION_get_timeout((SSL_SESSION const *)arg1); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_accept(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; double arg2 = (double) -1 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_accept",1,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_accept" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); if (obj1) { ecode2 = SWIG_AsVal_double(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_accept" "', argument " "2"" of type '" "double""'"); } arg2 = (double)(val2); } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)ssl_accept(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_connect(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; double arg2 = (double) -1 ; void *argp1 = 0 ; int res1 = 0 ; double val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_connect",1,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_connect" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); if (obj1) { ecode2 = SWIG_AsVal_double(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_connect" "', argument " "2"" of type '" "double""'"); } arg2 = (double)(val2); } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)ssl_connect(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_read(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; int arg2 ; double arg3 = (double) -1 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; double val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_read",2,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_read" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_read" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); if (obj2) { ecode3 = SWIG_AsVal_double(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ssl_read" "', argument " "3"" of type '" "double""'"); } arg3 = (double)(val3); } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)ssl_read(arg1,arg2,arg3); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_write(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; PyObject *arg2 = (PyObject *) 0 ; double arg3 = (double) -1 ; void *argp1 = 0 ; int res1 = 0 ; double val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_write",2,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_write" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { arg2=obj1; } if (obj2) { ecode3 = SWIG_AsVal_double(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ssl_write" "', argument " "3"" of type '" "double""'"); } arg3 = (double)(val3); } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_write(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__ssl_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_ssl_err""' of type '""PyObject *""'"); } _ssl_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__ssl_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_ssl_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN int Swig_var__ssl_timeout_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_ssl_timeout_err""' of type '""PyObject *""'"); } _ssl_timeout_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__ssl_timeout_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_ssl_timeout_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_ssl_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_init",2,2,&obj0,&obj1)) SWIG_fail; { arg1=obj0; } { arg2=obj1; } ssl_init(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_tlsv1_method(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_METHOD *result = 0 ; result = (SSL_METHOD *)tlsv1_method(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_METHOD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_passphrase_callback(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_passphrase_callback",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_passphrase_callback" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ssl_ctx_passphrase_callback(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_use_x509(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; X509 *arg2 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_use_x509",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_x509" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_x509" "', argument " "2"" of type '" "X509 *""'"); } arg2 = (X509 *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_use_x509(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_use_cert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_use_cert",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_cert" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_cert" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_use_cert(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_use_cert_chain(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_use_cert_chain",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_cert_chain" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_cert_chain" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_use_cert_chain(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_use_privkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_use_privkey",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_privkey" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_privkey" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_use_privkey(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_use_rsa_privkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; RSA *arg2 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_use_rsa_privkey",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_rsa_privkey" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_rsa_privkey" "', argument " "2"" of type '" "RSA *""'"); } arg2 = (RSA *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_use_rsa_privkey(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_use_pkey_privkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_use_pkey_privkey",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_pkey_privkey" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_pkey_privkey" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_use_pkey_privkey(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_check_privkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_check_privkey",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_check_privkey" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_check_privkey(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_client_CA_list_from_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_client_CA_list_from_file",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_client_CA_list_from_file" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_client_CA_list_from_file" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ssl_ctx_set_client_CA_list_from_file(arg1,(char const *)arg2); resultobj = SWIG_Py_Void(); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify_default(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_verify_default",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_verify_default" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_verify_default" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ssl_ctx_set_verify_default(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; int arg2 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_verify",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_verify" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_verify" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!PyCallable_Check(obj2)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ssl_ctx_set_verify(arg1,arg2,arg3); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_session_id_context(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_session_id_context",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_session_id_context" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_set_session_id_context(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_info_callback(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_info_callback",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_info_callback" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ssl_ctx_set_info_callback(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_dh(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; DH *arg2 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_tmp_dh",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_dh" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_tmp_dh" "', argument " "2"" of type '" "DH *""'"); } arg2 = (DH *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)ssl_ctx_set_tmp_dh(arg1,arg2); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_dh_callback(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_tmp_dh_callback",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_dh_callback" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ssl_ctx_set_tmp_dh_callback(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_rsa(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; RSA *arg2 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_tmp_rsa",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_rsa" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_tmp_rsa" "', argument " "2"" of type '" "RSA *""'"); } arg2 = (RSA *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)ssl_ctx_set_tmp_rsa(arg1,arg2); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_rsa_callback(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_tmp_rsa_callback",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_rsa_callback" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ssl_ctx_set_tmp_rsa_callback(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_load_verify_locations(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_load_verify_locations",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_load_verify_locations" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_load_verify_locations" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ssl_ctx_load_verify_locations" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_load_verify_locations(arg1,(char const *)arg2,(char const *)arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_options(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; long arg2 ; void *argp1 = 0 ; int res1 = 0 ; long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_options",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_options" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); ecode2 = SWIG_AsVal_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_options" "', argument " "2"" of type '" "long""'"); } arg2 = (long)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)ssl_ctx_set_options(arg1,arg2); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_bio_set_ssl(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; SSL *arg2 = (SSL *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"bio_set_ssl",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_ssl" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_set_ssl" "', argument " "2"" of type '" "SSL *""'"); } arg2 = (SSL *)(argp2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bio_set_ssl" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)bio_set_ssl(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_mode(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; long arg2 ; void *argp1 = 0 ; int res1 = 0 ; long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_mode",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_mode" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); ecode2 = SWIG_AsVal_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_mode" "', argument " "2"" of type '" "long""'"); } arg2 = (long)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)ssl_set_mode(arg1,arg2); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_mode(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_mode",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_mode" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)ssl_get_mode(arg1); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_tlsext_host_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_tlsext_host_name",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_tlsext_host_name" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_tlsext_host_name" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_set_tlsext_host_name(arg1,(char const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_client_CA_list_from_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_client_CA_list_from_file",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_client_CA_list_from_file" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_client_CA_list_from_file" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ssl_set_client_CA_list_from_file(arg1,(char const *)arg2); resultobj = SWIG_Py_Void(); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_client_CA_list_from_context(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; SSL_CTX *arg2 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_client_CA_list_from_context",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_client_CA_list_from_context" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_client_CA_list_from_context" "', argument " "2"" of type '" "SSL_CTX *""'"); } arg2 = (SSL_CTX *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ssl_set_client_CA_list_from_context(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_session_id_context(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_session_id_context",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_session_id_context" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_set_session_id_context(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_fd(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_fd",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_fd" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_fd" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_set_fd(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_set_shutdown1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_set_shutdown1",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_shutdown1" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_shutdown1" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ssl_set_shutdown1(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_read_nbio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_read_nbio",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_read_nbio" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_read_nbio" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)ssl_read_nbio(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_write_nbio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_write_nbio",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_write_nbio" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_write_nbio(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_cipher_get_bits(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_cipher_get_bits",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_cipher_get_bits" "', argument " "1"" of type '" "SSL_CIPHER *""'"); } arg1 = (SSL_CIPHER *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_cipher_get_bits(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_ssl_cipher_num(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_SSL_CIPHER *arg1 = (struct stack_st_SSL_CIPHER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_ssl_cipher_num",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_SSL_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_ssl_cipher_num" "', argument " "1"" of type '" "struct stack_st_SSL_CIPHER *""'"); } arg1 = (struct stack_st_SSL_CIPHER *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)sk_ssl_cipher_num(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_ssl_cipher_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_SSL_CIPHER *arg1 = (struct stack_st_SSL_CIPHER *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; SSL_CIPHER *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_ssl_cipher_value",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_SSL_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_ssl_cipher_value" "', argument " "1"" of type '" "struct stack_st_SSL_CIPHER *""'"); } arg1 = (struct stack_st_SSL_CIPHER *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_ssl_cipher_value" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (SSL_CIPHER *)sk_ssl_cipher_value(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_CIPHER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_get_peer_cert_chain(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; struct stack_st_X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_get_peer_cert_chain",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_peer_cert_chain" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (struct stack_st_X509 *)ssl_get_peer_cert_chain(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_X509, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_num(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_x509_num",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_num" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } arg1 = (struct stack_st_X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)sk_x509_num(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_x509_value",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_value" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } arg1 = (struct stack_st_X509 *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_x509_value" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509 *)sk_x509_value(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_i2d_ssl_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; SSL_SESSION *arg2 = (SSL_SESSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"i2d_ssl_session",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_ssl_session" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "i2d_ssl_session" "', argument " "2"" of type '" "SSL_SESSION *""'"); } arg2 = (SSL_SESSION *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; i2d_ssl_session(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_session_read_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; SSL_SESSION *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ssl_session_read_pem",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_read_pem" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (SSL_SESSION *)ssl_session_read_pem(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_SSL_SESSION, 0); else { m2_PyErr_Msg(_ssl_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_session_write_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_SESSION *arg1 = (SSL_SESSION *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_session_write_pem",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_write_pem" "', argument " "1"" of type '" "SSL_SESSION *""'"); } arg1 = (SSL_SESSION *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_session_write_pem" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)ssl_session_write_pem(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_session_cache_mode(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_session_cache_mode",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_session_cache_mode" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_session_cache_mode" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_set_session_cache_mode(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_get_session_cache_mode(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_get_session_cache_mode",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_session_cache_mode" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_ctx_get_session_cache_mode(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_ctx_set_cache_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; long arg2 ; void *argp1 = 0 ; int res1 = 0 ; long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"ssl_ctx_set_cache_size",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_cache_size" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); ecode2 = SWIG_AsVal_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_cache_size" "', argument " "2"" of type '" "long""'"); } arg2 = (long)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)ssl_ctx_set_cache_size(arg1,arg2); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ssl_is_init_finished(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ssl_is_init_finished",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_is_init_finished" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ssl_is_init_finished(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_check_ca(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_check_ca",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_ca" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_check_ca(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *result = 0 ; result = (X509 *)X509_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_dup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_dup",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_dup" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509 *)X509_dup(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_free" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } X509_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_crl_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_CRL *arg1 = (X509_CRL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_crl_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_CRL, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_crl_free" "', argument " "1"" of type '" "X509_CRL *""'"); } arg1 = (X509_CRL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } X509_CRL_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_crl_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_CRL *result = 0 ; result = (X509_CRL *)X509_CRL_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_CRL, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; X509 *arg2 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_print",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_print" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_print" "', argument " "2"" of type '" "X509 *""'"); } arg2 = (X509 *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)X509_print(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_crl_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; X509_CRL *arg2 = (X509_CRL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_crl_print",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_crl_print" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_CRL, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_crl_print" "', argument " "2"" of type '" "X509_CRL *""'"); } arg2 = (X509_CRL *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)X509_CRL_print(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_get_serial_number(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; ASN1_INTEGER *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_get_serial_number",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_serial_number" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (ASN1_INTEGER *)X509_get_serialNumber(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_set_serial_number(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; ASN1_INTEGER *arg2 = (ASN1_INTEGER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_set_serial_number",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_serial_number" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_serial_number" "', argument " "2"" of type '" "ASN1_INTEGER *""'"); } arg2 = (ASN1_INTEGER *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_set_serialNumber(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_get_pubkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; EVP_PKEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_get_pubkey",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_pubkey" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (EVP_PKEY *)X509_get_pubkey(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_PKEY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_set_pubkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_set_pubkey",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_pubkey" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_pubkey" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_set_pubkey(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_get_issuer_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509_NAME *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_get_issuer_name",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_issuer_name" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509_NAME *)X509_get_issuer_name(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_set_issuer_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; X509_NAME *arg2 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_set_issuer_name",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_issuer_name" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_issuer_name" "', argument " "2"" of type '" "X509_NAME *""'"); } arg2 = (X509_NAME *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_set_issuer_name(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_get_subject_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509_NAME *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_get_subject_name",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_subject_name" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509_NAME *)X509_get_subject_name(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_set_subject_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; X509_NAME *arg2 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_set_subject_name",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_subject_name" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_subject_name" "', argument " "2"" of type '" "X509_NAME *""'"); } arg2 = (X509_NAME *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_set_subject_name(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_cmp_current_time(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_cmp_current_time",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_cmp_current_time" "', argument " "1"" of type '" "ASN1_TIME *""'"); } arg1 = (ASN1_TIME *)(argp1); result = (int)X509_cmp_current_time(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_check_purpose(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; int arg2 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_check_purpose",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_purpose" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_check_purpose" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_check_purpose" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_check_purpose(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_check_trust(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; int arg2 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_check_trust",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_trust" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_check_trust" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_check_trust" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_check_trust(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_write_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; X509 *arg2 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_write_pem",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_write_pem" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_write_pem" "', argument " "2"" of type '" "X509 *""'"); } arg2 = (X509 *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)PEM_write_bio_X509(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_write_pem_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; FILE *arg1 = (FILE *) 0 ; X509 *arg2 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_write_pem_file",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_FILE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_write_pem_file" "', argument " "1"" of type '" "FILE *""'"); } arg1 = (FILE *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_write_pem_file" "', argument " "2"" of type '" "X509 *""'"); } arg2 = (X509 *)(argp2); { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)PEM_write_X509(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_verify(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_verify",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_verify" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_verify" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_verify(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_get_verify_error(PyObject *self, PyObject *args) { PyObject *resultobj = 0; long arg1 ; long val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_get_verify_error",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_long(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "x509_get_verify_error" "', argument " "1"" of type '" "long""'"); } arg1 = (long)(val1); result = (char *)X509_verify_cert_error_string(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_add_ext(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; X509_EXTENSION *arg2 = (X509_EXTENSION *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_add_ext",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_add_ext" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_add_ext" "', argument " "2"" of type '" "X509_EXTENSION *""'"); } arg2 = (X509_EXTENSION *)(argp2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_add_ext" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_add_ext(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_get_ext_count(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_get_ext_count",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_ext_count" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_get_ext_count(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_get_ext(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; X509_EXTENSION *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_get_ext",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_ext" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_get_ext" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509_EXTENSION *)X509_get_ext(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_ext_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; X509_EXTENSION *arg2 = (X509_EXTENSION *) 0 ; unsigned long arg3 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; unsigned long val3 ; int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_ext_print",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_ext_print" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_ext_print" "', argument " "2"" of type '" "X509_EXTENSION *""'"); } arg2 = (X509_EXTENSION *)(argp2); ecode3 = SWIG_AsVal_unsigned_SS_long(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_ext_print" "', argument " "3"" of type '" "unsigned long""'"); } arg3 = (unsigned long)(val3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "x509_ext_print" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)X509V3_EXT_print(arg1,arg2,arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *result = 0 ; result = (X509_NAME *)X509_NAME_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_free" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } X509_NAME_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; X509_NAME *arg2 = (X509_NAME *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_print",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_print" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_print" "', argument " "2"" of type '" "X509_NAME *""'"); } arg2 = (X509_NAME *)(argp2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_print" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)X509_NAME_print(arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_get_entry(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; X509_NAME_ENTRY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_get_entry",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_entry" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_get_entry" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509_NAME_ENTRY *)X509_NAME_get_entry(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_entry_count(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_entry_count",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_count" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_NAME_entry_count(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_delete_entry(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; X509_NAME_ENTRY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_delete_entry",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_delete_entry" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_delete_entry" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509_NAME_ENTRY *)X509_NAME_delete_entry(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_add_entry(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; X509_NAME_ENTRY *arg2 = (X509_NAME_ENTRY *) 0 ; int arg3 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val3 ; int ecode3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_add_entry",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_add_entry" "', argument " "2"" of type '" "X509_NAME_ENTRY *""'"); } arg2 = (X509_NAME_ENTRY *)(argp2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_add_entry" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "x509_name_add_entry" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_NAME_add_entry(arg1,arg2,arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_obj(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; ASN1_OBJECT *arg2 = (ASN1_OBJECT *) 0 ; int arg3 ; unsigned char *arg4 = (unsigned char *) 0 ; int arg5 ; int arg6 ; int arg7 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val3 ; int ecode3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; int val5 ; int ecode5 = 0 ; int val6 ; int ecode6 = 0 ; int val7 ; int ecode7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_add_entry_by_obj",7,7,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry_by_obj" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_add_entry_by_obj" "', argument " "2"" of type '" "ASN1_OBJECT *""'"); } arg2 = (ASN1_OBJECT *)(argp2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_add_entry_by_obj" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_add_entry_by_obj" "', argument " "4"" of type '" "unsigned char *""'"); } arg4 = (unsigned char *)(argp4); ecode5 = SWIG_AsVal_int(obj4, &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "x509_name_add_entry_by_obj" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); ecode6 = SWIG_AsVal_int(obj5, &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "x509_name_add_entry_by_obj" "', argument " "6"" of type '" "int""'"); } arg6 = (int)(val6); ecode7 = SWIG_AsVal_int(obj6, &val7); if (!SWIG_IsOK(ecode7)) { SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "x509_name_add_entry_by_obj" "', argument " "7"" of type '" "int""'"); } arg7 = (int)(val7); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_NAME_add_entry_by_OBJ(arg1,arg2,arg3,arg4,arg5,arg6,arg7); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; int arg2 ; int arg3 ; unsigned char *arg4 = (unsigned char *) 0 ; int arg5 ; int arg6 ; int arg7 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; int val5 ; int ecode5 = 0 ; int val6 ; int ecode6 = 0 ; int val7 ; int ecode7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_add_entry_by_nid",7,7,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry_by_nid" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_add_entry_by_nid" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_add_entry_by_nid" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_add_entry_by_nid" "', argument " "4"" of type '" "unsigned char *""'"); } arg4 = (unsigned char *)(argp4); ecode5 = SWIG_AsVal_int(obj4, &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "x509_name_add_entry_by_nid" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); ecode6 = SWIG_AsVal_int(obj5, &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "x509_name_add_entry_by_nid" "', argument " "6"" of type '" "int""'"); } arg6 = (int)(val6); ecode7 = SWIG_AsVal_int(obj6, &val7); if (!SWIG_IsOK(ecode7)) { SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "x509_name_add_entry_by_nid" "', argument " "7"" of type '" "int""'"); } arg7 = (int)(val7); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_NAME_add_entry_by_NID(arg1,arg2,arg3,arg4,arg5,arg6,arg7); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_print_ex(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; X509_NAME *arg2 = (X509_NAME *) 0 ; int arg3 ; unsigned long arg4 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val3 ; int ecode3 = 0 ; unsigned long val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_print_ex",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_print_ex" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_print_ex" "', argument " "2"" of type '" "X509_NAME *""'"); } arg2 = (X509_NAME *)(argp2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_print_ex" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); ecode4 = SWIG_AsVal_unsigned_SS_long(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "x509_name_print_ex" "', argument " "4"" of type '" "unsigned long""'"); } arg4 = (unsigned long)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)X509_NAME_print_ex(arg1,arg2,arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_hash(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; unsigned long result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_hash",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_hash" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (unsigned long)X509_NAME_hash_old(arg1); resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_get_index_by_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; int arg2 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_get_index_by_nid",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_index_by_nid" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_get_index_by_nid" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_get_index_by_nid" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_NAME_get_index_by_NID(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_entry_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME_ENTRY *result = 0 ; result = (X509_NAME_ENTRY *)X509_NAME_ENTRY_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_entry_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_entry_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_free" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'"); } arg1 = (X509_NAME_ENTRY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } X509_NAME_ENTRY_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_entry_create_by_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME_ENTRY **arg1 = (X509_NAME_ENTRY **) 0 ; int arg2 ; int arg3 ; unsigned char *arg4 = (unsigned char *) 0 ; int arg5 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; int val3 ; int ecode3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; int val5 ; int ecode5 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; X509_NAME_ENTRY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_entry_create_by_nid",5,5,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_create_by_nid" "', argument " "1"" of type '" "X509_NAME_ENTRY **""'"); } arg1 = (X509_NAME_ENTRY **)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_entry_create_by_nid" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_entry_create_by_nid" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_unsigned_char, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_entry_create_by_nid" "', argument " "4"" of type '" "unsigned char *""'"); } arg4 = (unsigned char *)(argp4); ecode5 = SWIG_AsVal_int(obj4, &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "x509_name_entry_create_by_nid" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); result = (X509_NAME_ENTRY *)X509_NAME_ENTRY_create_by_NID(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_entry_set_object(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; ASN1_OBJECT *arg2 = (ASN1_OBJECT *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_entry_set_object",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_set_object" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'"); } arg1 = (X509_NAME_ENTRY *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_entry_set_object" "', argument " "2"" of type '" "ASN1_OBJECT *""'"); } arg2 = (ASN1_OBJECT *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_NAME_ENTRY_set_object(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_entry_get_object(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; ASN1_OBJECT *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_entry_get_object",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_get_object" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'"); } arg1 = (X509_NAME_ENTRY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (ASN1_OBJECT *)X509_NAME_ENTRY_get_object(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_entry_get_data(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; ASN1_STRING *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_entry_get_data",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_get_data" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'"); } arg1 = (X509_NAME_ENTRY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (ASN1_STRING *)X509_NAME_ENTRY_get_data(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_STRING, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_entry_set_data(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; int arg2 ; unsigned char *arg3 = (unsigned char *) 0 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_entry_set_data",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_set_data" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'"); } arg1 = (X509_NAME_ENTRY *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_entry_set_data" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (PyString_Check(obj2)) { Py_ssize_t len; arg3 = (unsigned char *)PyString_AsString(obj2); len = PyString_Size(obj2); if (len > INT_MAX) { PyErr_SetString(_x509_err, "object too large"); return NULL; } arg4 = len; } else { PyErr_SetString(PyExc_TypeError, "expected string"); return NULL; } } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_NAME_ENTRY_set_data(arg1,arg2,(unsigned char const *)arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *result = 0 ; result = (X509_REQ *)X509_REQ_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_REQ, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_req_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_free" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } X509_REQ_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; X509_REQ *arg2 = (X509_REQ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_req_print",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_print" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_print" "', argument " "2"" of type '" "X509_REQ *""'"); } arg2 = (X509_REQ *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)X509_REQ_print(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_get_pubkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; EVP_PKEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_req_get_pubkey",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_get_pubkey" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (EVP_PKEY *)X509_REQ_get_pubkey(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_PKEY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_set_pubkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_req_set_pubkey",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_set_pubkey" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_set_pubkey" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_REQ_set_pubkey(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_set_subject_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; X509_NAME *arg2 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_req_set_subject_name",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_set_subject_name" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_set_subject_name" "', argument " "2"" of type '" "X509_NAME *""'"); } arg2 = (X509_NAME *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_REQ_set_subject_name(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_verify(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_req_verify",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_verify" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_verify" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_REQ_verify(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_sign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; EVP_MD *arg3 = (EVP_MD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_req_sign",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_sign" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_sign" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "x509_req_sign" "', argument " "3"" of type '" "EVP_MD const *""'"); } arg3 = (EVP_MD *)(argp3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_REQ_sign(arg1,arg2,(EVP_MD const *)arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_i2d_x509_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; X509 *arg2 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"i2d_x509_bio",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_x509_bio" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "i2d_x509_bio" "', argument " "2"" of type '" "X509 *""'"); } arg2 = (X509 *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)i2d_X509_bio(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_i2d_x509_req_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; X509_REQ *arg2 = (X509_REQ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"i2d_x509_req_bio",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_x509_req_bio" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "i2d_x509_req_bio" "', argument " "2"" of type '" "X509_REQ *""'"); } arg2 = (X509_REQ *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)i2d_X509_REQ_bio(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE *result = 0 ; result = (X509_STORE *)X509_STORE_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_STORE, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE *arg1 = (X509_STORE *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_store_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_free" "', argument " "1"" of type '" "X509_STORE *""'"); } arg1 = (X509_STORE *)(argp1); X509_STORE_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_add_cert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE *arg1 = (X509_STORE *) 0 ; X509 *arg2 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_store_add_cert",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_add_cert" "', argument " "1"" of type '" "X509_STORE *""'"); } arg1 = (X509_STORE *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_store_add_cert" "', argument " "2"" of type '" "X509 *""'"); } arg2 = (X509 *)(argp2); { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)X509_STORE_add_cert(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_set_verify_cb__SWIG_0(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE *arg1 = (X509_STORE *) 0 ; int (*arg2)(int,X509_STORE_CTX *) = (int (*)(int,X509_STORE_CTX *)) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_store_set_verify_cb",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_set_verify_cb" "', argument " "1"" of type '" "X509_STORE *""'"); } arg1 = (X509_STORE *)(argp1); { int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_int_p_X509_STORE_CTX__int); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in method '" "x509_store_set_verify_cb" "', argument " "2"" of type '" "int (*)(int,X509_STORE_CTX *)""'"); } } X509_STORE_set_verify_cb(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_ctx_get_current_cert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_store_ctx_get_current_cert",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_current_cert" "', argument " "1"" of type '" "X509_STORE_CTX *""'"); } arg1 = (X509_STORE_CTX *)(argp1); result = (X509 *)X509_STORE_CTX_get_current_cert(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_ctx_get_error(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_store_ctx_get_error",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_error" "', argument " "1"" of type '" "X509_STORE_CTX *""'"); } arg1 = (X509_STORE_CTX *)(argp1); result = (int)X509_STORE_CTX_get_error(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_ctx_get_error_depth(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_store_ctx_get_error_depth",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_error_depth" "', argument " "1"" of type '" "X509_STORE_CTX *""'"); } arg1 = (X509_STORE_CTX *)(argp1); result = (int)X509_STORE_CTX_get_error_depth(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_ctx_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_store_ctx_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_free" "', argument " "1"" of type '" "X509_STORE_CTX *""'"); } arg1 = (X509_STORE_CTX *)(argp1); X509_STORE_CTX_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_ctx_get1_chain(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; struct stack_st_X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_store_ctx_get1_chain",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get1_chain" "', argument " "1"" of type '" "X509_STORE_CTX *""'"); } arg1 = (X509_STORE_CTX *)(argp1); result = (struct stack_st_X509 *)X509_STORE_CTX_get1_chain(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_X509, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_extension_get_critical(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_extension_get_critical",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_get_critical" "', argument " "1"" of type '" "X509_EXTENSION *""'"); } arg1 = (X509_EXTENSION *)(argp1); result = (int)X509_EXTENSION_get_critical(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_extension_set_critical(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_extension_set_critical",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_set_critical" "', argument " "1"" of type '" "X509_EXTENSION *""'"); } arg1 = (X509_EXTENSION *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_extension_set_critical" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); result = (int)X509_EXTENSION_set_critical(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_read_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_read_pem",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_read_pem" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (X509 *)x509_read_pem(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509, 0); else { m2_PyErr_Msg(_x509_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_d2i_x509(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"d2i_x509",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "d2i_x509" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (X509 *)d2i_x509(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509, 0); else { m2_PyErr_Msg(_x509_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__x509_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_x509_err""' of type '""PyObject *""'"); } _x509_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__x509_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_x509_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_x509_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } x509_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_d2i_x509_req(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509_REQ *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"d2i_x509_req",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "d2i_x509_req" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (X509_REQ *)d2i_x509_req(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509_REQ, 0); else { m2_PyErr_Msg(_x509_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_read_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509_REQ *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_req_read_pem",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_read_pem" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (X509_REQ *)x509_req_read_pem(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509_REQ, 0); else { m2_PyErr_Msg(_x509_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_i2d_x509(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"i2d_x509",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_x509" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)i2d_x509(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_write_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; X509_REQ *arg2 = (X509_REQ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_req_write_pem",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_write_pem" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_write_pem" "', argument " "2"" of type '" "X509_REQ *""'"); } arg2 = (X509_REQ *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)x509_req_write_pem(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_crl_read_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509_CRL *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_crl_read_pem",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_crl_read_pem" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (X509_CRL *)x509_crl_read_pem(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509_CRL, 0); else { m2_PyErr_Msg(_x509_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_set_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; long arg2 ; void *argp1 = 0 ; int res1 = 0 ; long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_set_version",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_version" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); ecode2 = SWIG_AsVal_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_set_version" "', argument " "2"" of type '" "long""'"); } arg2 = (long)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)x509_set_version(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_get_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"x509_get_version",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_version" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)x509_get_version(arg1); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_set_not_before(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; ASN1_TIME *arg2 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_set_not_before",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_not_before" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_not_before" "', argument " "2"" of type '" "ASN1_TIME *""'"); } arg2 = (ASN1_TIME *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)x509_set_not_before(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_get_not_before(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; ASN1_TIME *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_get_not_before",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_not_before" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (ASN1_TIME *)x509_get_not_before(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_set_not_after(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; ASN1_TIME *arg2 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_set_not_after",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_not_after" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_not_after" "', argument " "2"" of type '" "ASN1_TIME *""'"); } arg2 = (ASN1_TIME *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)x509_set_not_after(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_get_not_after(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; ASN1_TIME *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_get_not_after",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_not_after" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (ASN1_TIME *)x509_get_not_after(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_sign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; EVP_MD *arg3 = (EVP_MD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_sign",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_sign" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_sign" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "x509_sign" "', argument " "3"" of type '" "EVP_MD *""'"); } arg3 = (EVP_MD *)(argp3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)x509_sign(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_gmtime_adj(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; long arg2 ; void *argp1 = 0 ; int res1 = 0 ; long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; ASN1_TIME *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_gmtime_adj",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_gmtime_adj" "', argument " "1"" of type '" "ASN1_TIME *""'"); } arg1 = (ASN1_TIME *)(argp1); ecode2 = SWIG_AsVal_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_gmtime_adj" "', argument " "2"" of type '" "long""'"); } arg2 = (long)(val2); result = (ASN1_TIME *)x509_gmtime_adj(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_by_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_by_nid",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_by_nid" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_by_nid" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)x509_name_by_nid(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_set_by_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; int arg2 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_set_by_nid",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_set_by_nid" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_set_by_nid" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)x509_name_set_by_nid(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_txt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; char *arg2 = (char *) 0 ; int arg3 ; char *arg4 = (char *) 0 ; int arg5 ; int arg6 ; int arg7 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int val3 ; int ecode3 = 0 ; int res4 ; char *buf4 = 0 ; int alloc4 = 0 ; int val5 ; int ecode5 = 0 ; int val6 ; int ecode6 = 0 ; int val7 ; int ecode7 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PyObject * obj6 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_add_entry_by_txt",7,7,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5,&obj6)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry_by_txt" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_add_entry_by_txt" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_add_entry_by_txt" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_add_entry_by_txt" "', argument " "4"" of type '" "char *""'"); } arg4 = (char *)(buf4); ecode5 = SWIG_AsVal_int(obj4, &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "x509_name_add_entry_by_txt" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); ecode6 = SWIG_AsVal_int(obj5, &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "x509_name_add_entry_by_txt" "', argument " "6"" of type '" "int""'"); } arg6 = (int)(val6); ecode7 = SWIG_AsVal_int(obj6, &val7); if (!SWIG_IsOK(ecode7)) { SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "x509_name_add_entry_by_txt" "', argument " "7"" of type '" "int""'"); } arg7 = (int)(val7); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)x509_name_add_entry_by_txt(arg1,arg2,arg3,arg4,arg5,arg6,arg7); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } SWIGINTERN PyObject *_wrap_x509_name_get_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_get_der",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_der" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)x509_name_get_der(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_x509_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_free" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } arg1 = (struct stack_st_X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } sk_x509_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_push(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; X509 *arg2 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_x509_push",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_push" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } arg1 = (struct stack_st_X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_x509_push" "', argument " "2"" of type '" "X509 *""'"); } arg2 = (X509 *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)sk_x509_push(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_x509_pop",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_pop" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } arg1 = (struct stack_st_X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509 *)sk_x509_pop(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_load_locations(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE *arg1 = (X509_STORE *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_store_load_locations",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_load_locations" "', argument " "1"" of type '" "X509_STORE *""'"); } arg1 = (X509_STORE *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_store_load_locations" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); result = (int)x509_store_load_locations(arg1,(char const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_x509_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_type_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_type_check" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)x509_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_name_type_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_type_check" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)x509_name_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_get_subject_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509_NAME *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_req_get_subject_name",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_get_subject_name" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509_NAME *)x509_req_get_subject_name(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_get_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; long result; if(!PyArg_UnpackTuple(args,(char *)"x509_req_get_version",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_get_version" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (long)x509_req_get_version(arg1); resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_set_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; long arg2 ; void *argp1 = 0 ; int res1 = 0 ; long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_req_set_version",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_set_version" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); ecode2 = SWIG_AsVal_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_req_set_version" "', argument " "2"" of type '" "long""'"); } arg2 = (long)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)x509_req_set_version(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_req_add_extensions(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; struct stack_st_X509_EXTENSION *arg2 = (struct stack_st_X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"x509_req_add_extensions",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_add_extensions" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_add_extensions" "', argument " "2"" of type '" "struct stack_st_X509_EXTENSION *""'"); } arg2 = (struct stack_st_X509_EXTENSION *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)x509_req_add_extensions(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_entry_create_by_txt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME_ENTRY **arg1 = (X509_NAME_ENTRY **) 0 ; char *arg2 = (char *) 0 ; int arg3 ; char *arg4 = (char *) 0 ; int arg5 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int val3 ; int ecode3 = 0 ; int res4 ; char *buf4 = 0 ; int alloc4 = 0 ; int val5 ; int ecode5 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; X509_NAME_ENTRY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_entry_create_by_txt",5,5,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_create_by_txt" "', argument " "1"" of type '" "X509_NAME_ENTRY **""'"); } arg1 = (X509_NAME_ENTRY **)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_entry_create_by_txt" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_entry_create_by_txt" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_entry_create_by_txt" "', argument " "4"" of type '" "char *""'"); } arg4 = (char *)(buf4); ecode5 = SWIG_AsVal_int(obj4, &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "x509_name_entry_create_by_txt" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); result = (X509_NAME_ENTRY *)x509_name_entry_create_by_txt(arg1,arg2,arg3,arg4,arg5); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } SWIGINTERN PyObject *_wrap_x509v3_set_nconf(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509V3_CTX *result = 0 ; result = (X509V3_CTX *)x509v3_set_nconf(); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509V3_CTX, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509v3_ext_conf(PyObject *self, PyObject *args) { PyObject *resultobj = 0; void *arg1 = (void *) 0 ; X509V3_CTX *arg2 = (X509V3_CTX *) 0 ; char *arg3 = (char *) 0 ; char *arg4 = (char *) 0 ; int res1 ; void *argp2 = 0 ; int res2 = 0 ; int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; int res4 ; char *buf4 = 0 ; int alloc4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; X509_EXTENSION *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509v3_ext_conf",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&arg1), 0, 0); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509v3_ext_conf" "', argument " "1"" of type '" "void *""'"); } res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509V3_CTX, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509v3_ext_conf" "', argument " "2"" of type '" "X509V3_CTX *""'"); } arg2 = (X509V3_CTX *)(argp2); res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "x509v3_ext_conf" "', argument " "3"" of type '" "char *""'"); } arg3 = (char *)(buf3); res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509v3_ext_conf" "', argument " "4"" of type '" "char *""'"); } arg4 = (char *)(buf4); result = (X509_EXTENSION *)x509v3_ext_conf(arg1,arg2,arg3,arg4); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509_EXTENSION, 0); else { m2_PyErr_Msg(_x509_err); resultobj = NULL; } } if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return resultobj; fail: if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); return NULL; } SWIGINTERN PyObject *_wrap_x509_extension_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_extension_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_free" "', argument " "1"" of type '" "X509_EXTENSION *""'"); } arg1 = (X509_EXTENSION *)(argp1); x509_extension_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_extension_get_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_extension_get_name",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_get_name" "', argument " "1"" of type '" "X509_EXTENSION *""'"); } arg1 = (X509_EXTENSION *)(argp1); result = (PyObject *)x509_extension_get_name(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_extension_new_null(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509_EXTENSION *result = 0 ; result = (struct stack_st_X509_EXTENSION *)sk_x509_extension_new_null(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_X509_EXTENSION, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_extension_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_x509_extension_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_free" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'"); } arg1 = (struct stack_st_X509_EXTENSION *)(argp1); sk_x509_extension_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_extension_push(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ; X509_EXTENSION *arg2 = (X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_x509_extension_push",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_push" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'"); } arg1 = (struct stack_st_X509_EXTENSION *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_x509_extension_push" "', argument " "2"" of type '" "X509_EXTENSION *""'"); } arg2 = (X509_EXTENSION *)(argp2); result = (int)sk_x509_extension_push(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_extension_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; X509_EXTENSION *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_x509_extension_pop",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_pop" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'"); } arg1 = (struct stack_st_X509_EXTENSION *)(argp1); result = (X509_EXTENSION *)sk_x509_extension_pop(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_extension_num(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"sk_x509_extension_num",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_num" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'"); } arg1 = (struct stack_st_X509_EXTENSION *)(argp1); result = (int)sk_x509_extension_num(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_extension_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; X509_EXTENSION *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"sk_x509_extension_value",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_value" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'"); } arg1 = (struct stack_st_X509_EXTENSION *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_x509_extension_value" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); result = (X509_EXTENSION *)sk_x509_extension_value(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_ctx_get_app_data(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; void *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_store_ctx_get_app_data",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_app_data" "', argument " "1"" of type '" "X509_STORE_CTX *""'"); } arg1 = (X509_STORE_CTX *)(argp1); result = (void *)x509_store_ctx_get_app_data(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_ctx_get_ex_data(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; void *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_store_ctx_get_ex_data",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_ex_data" "', argument " "1"" of type '" "X509_STORE_CTX *""'"); } arg1 = (X509_STORE_CTX *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_store_ctx_get_ex_data" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); result = (void *)x509_store_ctx_get_ex_data(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_set_verify_cb__SWIG_1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_STORE *arg1 = (X509_STORE *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_store_set_verify_cb",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_set_verify_cb" "', argument " "1"" of type '" "X509_STORE *""'"); } arg1 = (X509_STORE *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } x509_store_set_verify_cb(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_store_set_verify_cb(PyObject *self, PyObject *args) { int argc; PyObject *argv[3]; int ii; if (!PyTuple_Check(args)) SWIG_fail; argc = args ? (int)PyObject_Length(args) : 0; for (ii = 0; (ii < 2) && (ii < argc); ii++) { argv[ii] = PyTuple_GET_ITEM(args,ii); } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_X509_STORE, 0); _v = SWIG_CheckState(res); if (_v) { void *ptr = 0; int res = SWIG_ConvertFunctionPtr(argv[1], &ptr, SWIGTYPE_p_f_int_p_X509_STORE_CTX__int); _v = SWIG_CheckState(res); if (_v) { return _wrap_x509_store_set_verify_cb__SWIG_0(self, args); } } } if (argc == 2) { int _v; void *vptr = 0; int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_X509_STORE, 0); _v = SWIG_CheckState(res); if (_v) { _v = (argv[1] != 0); if (_v) { return _wrap_x509_store_set_verify_cb__SWIG_1(self, args); } } } fail: SWIG_SetErrorMsg(PyExc_NotImplementedError,"Wrong number or type of arguments for overloaded function 'x509_store_set_verify_cb'.\n" " Possible C/C++ prototypes are:\n" " X509_STORE_set_verify_cb(X509_STORE *,int (*)(int,X509_STORE_CTX *))\n" " x509_store_set_verify_cb(X509_STORE *,PyObject *)\n"); return 0; } SWIGINTERN PyObject *_wrap_make_stack_from_der_sequence(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; struct stack_st_X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"make_stack_from_der_sequence",1,1,&obj0)) SWIG_fail; { arg1=obj0; } result = (struct stack_st_X509 *)make_stack_from_der_sequence(arg1); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_stack_st_X509, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_sk_x509_new_null(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509 *result = 0 ; result = (struct stack_st_X509 *)sk_x509_new_null(); { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_stack_st_X509, 0); else { resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_get_der_encoding_stack(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"get_der_encoding_stack",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_der_encoding_stack" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } arg1 = (struct stack_st_X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)get_der_encoding_stack(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_x509_name_oneline(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"x509_name_oneline",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_oneline" "', argument " "1"" of type '" "X509_NAME *""'"); } arg1 = (X509_NAME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (char *)x509_name_oneline(arg1); resultobj = SWIG_FromCharPtr((const char *)result); { if (result != NULL) OPENSSL_free(result); } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_object_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_OBJECT *result = 0 ; result = (ASN1_OBJECT *)ASN1_OBJECT_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_object_create(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; unsigned char *arg2 = (unsigned char *) 0 ; int arg3 ; char *arg4 = (char *) 0 ; char *arg5 = (char *) 0 ; int val1 ; int ecode1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val3 ; int ecode3 = 0 ; int res4 ; char *buf4 = 0 ; int alloc4 = 0 ; int res5 ; char *buf5 = 0 ; int alloc5 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; ASN1_OBJECT *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"asn1_object_create",5,5,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "asn1_object_create" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_unsigned_char, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_object_create" "', argument " "2"" of type '" "unsigned char *""'"); } arg2 = (unsigned char *)(argp2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "asn1_object_create" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); res4 = SWIG_AsCharPtrAndSize(obj3, &buf4, NULL, &alloc4); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "asn1_object_create" "', argument " "4"" of type '" "char const *""'"); } arg4 = (char *)(buf4); res5 = SWIG_AsCharPtrAndSize(obj4, &buf5, NULL, &alloc5); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "asn1_object_create" "', argument " "5"" of type '" "char const *""'"); } arg5 = (char *)(buf5); result = (ASN1_OBJECT *)ASN1_OBJECT_create(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); if (alloc5 == SWIG_NEWOBJ) free((char*)buf5); return resultobj; fail: if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); if (alloc5 == SWIG_NEWOBJ) free((char*)buf5); return NULL; } SWIGINTERN PyObject *_wrap_asn1_object_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"asn1_object_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_object_free" "', argument " "1"" of type '" "ASN1_OBJECT *""'"); } arg1 = (ASN1_OBJECT *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ASN1_OBJECT_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_i2d_asn1_object(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ; unsigned char **arg2 = (unsigned char **) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"i2d_asn1_object",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_asn1_object" "', argument " "1"" of type '" "ASN1_OBJECT *""'"); } arg1 = (ASN1_OBJECT *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_unsigned_char, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "i2d_asn1_object" "', argument " "2"" of type '" "unsigned char **""'"); } arg2 = (unsigned char **)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)i2d_ASN1_OBJECT(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_d2i_asn1_object(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_OBJECT **arg1 = (ASN1_OBJECT **) 0 ; unsigned char **arg2 = (unsigned char **) 0 ; long arg3 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; long val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; ASN1_OBJECT *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"d2i_asn1_object",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_p_ASN1_OBJECT, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "d2i_asn1_object" "', argument " "1"" of type '" "ASN1_OBJECT **""'"); } arg1 = (ASN1_OBJECT **)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_p_unsigned_char, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "d2i_asn1_object" "', argument " "2"" of type '" "unsigned char const **""'"); } arg2 = (unsigned char **)(argp2); ecode3 = SWIG_AsVal_long(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "d2i_asn1_object" "', argument " "3"" of type '" "long""'"); } arg3 = (long)(val3); result = (ASN1_OBJECT *)d2i_ASN1_OBJECT(arg1,(unsigned char const **)arg2,arg3); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_bit_string_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_BIT_STRING *result = 0 ; result = (ASN1_BIT_STRING *)ASN1_BIT_STRING_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_BIT_STRING, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_string_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_STRING *result = 0 ; result = (ASN1_STRING *)ASN1_STRING_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_STRING, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_string_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_STRING *arg1 = (ASN1_STRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"asn1_string_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_free" "', argument " "1"" of type '" "ASN1_STRING *""'"); } arg1 = (ASN1_STRING *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ASN1_STRING_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_string_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_STRING *arg1 = (ASN1_STRING *) 0 ; void *arg2 = (void *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"asn1_string_set",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_set" "', argument " "1"" of type '" "ASN1_STRING *""'"); } arg1 = (ASN1_STRING *)(argp1); { if (PyBytes_Check(obj1)) { Py_ssize_t len; arg2 = PyBytes_AsString(obj1); len = PyBytes_Size(obj1); if (len > INT_MAX) { PyErr_SetString(PyExc_ValueError, "object too large"); return NULL; } arg3 = len; } else { PyErr_SetString(PyExc_TypeError, "expected string"); return NULL; } } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ASN1_STRING_set(arg1,(void const *)arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_string_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; ASN1_STRING *arg2 = (ASN1_STRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"asn1_string_print",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_print" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_STRING, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_string_print" "', argument " "2"" of type '" "ASN1_STRING *""'"); } arg2 = (ASN1_STRING *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)ASN1_STRING_print(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_string_print_ex(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; ASN1_STRING *arg2 = (ASN1_STRING *) 0 ; unsigned long arg3 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; unsigned long val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"asn1_string_print_ex",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_print_ex" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_STRING, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_string_print_ex" "', argument " "2"" of type '" "ASN1_STRING *""'"); } arg2 = (ASN1_STRING *)(argp2); ecode3 = SWIG_AsVal_unsigned_SS_long(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "asn1_string_print_ex" "', argument " "3"" of type '" "unsigned long""'"); } arg3 = (unsigned long)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)ASN1_STRING_print_ex(arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_time_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_TIME *result = 0 ; result = (ASN1_TIME *)ASN1_TIME_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_time_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"asn1_time_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_free" "', argument " "1"" of type '" "ASN1_TIME *""'"); } arg1 = (ASN1_TIME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ASN1_TIME_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_time_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"asn1_time_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_check" "', argument " "1"" of type '" "ASN1_TIME *""'"); } arg1 = (ASN1_TIME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ASN1_TIME_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_time_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; long arg2 ; void *argp1 = 0 ; int res1 = 0 ; long val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; ASN1_TIME *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"asn1_time_set",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_set" "', argument " "1"" of type '" "ASN1_TIME *""'"); } arg1 = (ASN1_TIME *)(argp1); ecode2 = SWIG_AsVal_long(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "asn1_time_set" "', argument " "2"" of type '" "long""'"); } arg2 = (long)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (ASN1_TIME *)ASN1_TIME_set(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_time_set_string(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"asn1_time_set_string",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_set_string" "', argument " "1"" of type '" "ASN1_TIME *""'"); } arg1 = (ASN1_TIME *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_time_set_string" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ASN1_TIME_set_string(arg1,(char const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_asn1_time_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; ASN1_TIME *arg2 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"asn1_time_print",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_print" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_time_print" "', argument " "2"" of type '" "ASN1_TIME *""'"); } arg2 = (ASN1_TIME *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)ASN1_TIME_print(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_integer_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_INTEGER *result = 0 ; result = (ASN1_INTEGER *)ASN1_INTEGER_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_integer_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"asn1_integer_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_free" "', argument " "1"" of type '" "ASN1_INTEGER *""'"); } arg1 = (ASN1_INTEGER *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } ASN1_INTEGER_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_integer_cmp(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ; ASN1_INTEGER *arg2 = (ASN1_INTEGER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"asn1_integer_cmp",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_cmp" "', argument " "1"" of type '" "ASN1_INTEGER *""'"); } arg1 = (ASN1_INTEGER *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_integer_cmp" "', argument " "2"" of type '" "ASN1_INTEGER *""'"); } arg2 = (ASN1_INTEGER *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ASN1_INTEGER_cmp(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_time_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"asn1_time_type_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_type_check" "', argument " "1"" of type '" "ASN1_TIME *""'"); } arg1 = (ASN1_TIME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)asn1_time_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_integer_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"asn1_integer_get",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_get" "', argument " "1"" of type '" "ASN1_INTEGER *""'"); } arg1 = (ASN1_INTEGER *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)asn1_integer_get(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_asn1_integer_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"asn1_integer_set",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_set" "', argument " "1"" of type '" "ASN1_INTEGER *""'"); } arg1 = (ASN1_INTEGER *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)asn1_integer_set(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *result = 0 ; result = (PKCS7 *)PKCS7_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PKCS7, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *arg1 = (PKCS7 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_free" "', argument " "1"" of type '" "PKCS7 *""'"); } arg1 = (PKCS7 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } PKCS7_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_add_certificate(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *arg1 = (PKCS7 *) 0 ; X509 *arg2 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_add_certificate",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_add_certificate" "', argument " "1"" of type '" "PKCS7 *""'"); } arg1 = (PKCS7 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_add_certificate" "', argument " "2"" of type '" "X509 *""'"); } arg2 = (X509 *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } PKCS7_add_certificate(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__pkcs7_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_pkcs7_err""' of type '""PyObject *""'"); } _pkcs7_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__pkcs7_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_pkcs7_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN int Swig_var__smime_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_smime_err""' of type '""PyObject *""'"); } _smime_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__smime_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_smime_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_pkcs7_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } pkcs7_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_smime_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"smime_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } smime_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_decrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *arg1 = (PKCS7 *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; X509 *arg3 = (X509 *) 0 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_decrypt",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_decrypt" "', argument " "1"" of type '" "PKCS7 *""'"); } arg1 = (PKCS7 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_decrypt" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_decrypt" "', argument " "3"" of type '" "X509 *""'"); } arg3 = (X509 *)(argp3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pkcs7_decrypt" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)pkcs7_decrypt(arg1,arg2,arg3,arg4); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_encrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; BIO *arg2 = (BIO *) 0 ; EVP_CIPHER *arg3 = (EVP_CIPHER *) 0 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PKCS7 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_encrypt",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_encrypt" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } arg1 = (struct stack_st_X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_encrypt" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_encrypt" "', argument " "3"" of type '" "EVP_CIPHER *""'"); } arg3 = (EVP_CIPHER *)(argp3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pkcs7_encrypt" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (PKCS7 *)pkcs7_encrypt(arg1,arg2,arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_PKCS7, 0); else { m2_PyErr_Msg(_smime_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_sign1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; struct stack_st_X509 *arg3 = (struct stack_st_X509 *) 0 ; BIO *arg4 = (BIO *) 0 ; EVP_MD *arg5 = (EVP_MD *) 0 ; int arg6 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; void *argp5 = 0 ; int res5 = 0 ; int val6 ; int ecode6 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject * obj5 = 0 ; PKCS7 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_sign1",6,6,&obj0,&obj1,&obj2,&obj3,&obj4,&obj5)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_sign1" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_sign1" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_sign1" "', argument " "3"" of type '" "struct stack_st_X509 *""'"); } arg3 = (struct stack_st_X509 *)(argp3); res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "pkcs7_sign1" "', argument " "4"" of type '" "BIO *""'"); } arg4 = (BIO *)(argp4); res5 = SWIG_ConvertPtr(obj4, &argp5,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res5)) { SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pkcs7_sign1" "', argument " "5"" of type '" "EVP_MD *""'"); } arg5 = (EVP_MD *)(argp5); ecode6 = SWIG_AsVal_int(obj5, &val6); if (!SWIG_IsOK(ecode6)) { SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "pkcs7_sign1" "', argument " "6"" of type '" "int""'"); } arg6 = (int)(val6); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg4) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg5) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (PKCS7 *)pkcs7_sign1(arg1,arg2,arg3,arg4,arg5,arg6); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_PKCS7, 0); else { m2_PyErr_Msg(_smime_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_sign0(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509 *arg1 = (X509 *) 0 ; EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; BIO *arg3 = (BIO *) 0 ; EVP_MD *arg4 = (EVP_MD *) 0 ; int arg5 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; int val5 ; int ecode5 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PKCS7 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_sign0",5,5,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_sign0" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_sign0" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_sign0" "', argument " "3"" of type '" "BIO *""'"); } arg3 = (BIO *)(argp3); res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "pkcs7_sign0" "', argument " "4"" of type '" "EVP_MD *""'"); } arg4 = (EVP_MD *)(argp4); ecode5 = SWIG_AsVal_int(obj4, &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "pkcs7_sign0" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg4) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (PKCS7 *)pkcs7_sign0(arg1,arg2,arg3,arg4,arg5); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_PKCS7, 0); else { m2_PyErr_Msg(_smime_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_read_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PKCS7 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_read_bio",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_read_bio" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (PKCS7 *)pkcs7_read_bio(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_PKCS7, 0); else { m2_PyErr_Msg(_pkcs7_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_read_bio_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PKCS7 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_read_bio_der",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_read_bio_der" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (PKCS7 *)pkcs7_read_bio_der(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (result != NULL) resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_PKCS7, 0); else { m2_PyErr_Msg(_pkcs7_err); resultobj = NULL; } } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_verify1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *arg1 = (PKCS7 *) 0 ; struct stack_st_X509 *arg2 = (struct stack_st_X509 *) 0 ; X509_STORE *arg3 = (X509_STORE *) 0 ; BIO *arg4 = (BIO *) 0 ; int arg5 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; void *argp4 = 0 ; int res4 = 0 ; int val5 ; int ecode5 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject * obj4 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_verify1",5,5,&obj0,&obj1,&obj2,&obj3,&obj4)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_verify1" "', argument " "1"" of type '" "PKCS7 *""'"); } arg1 = (PKCS7 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_verify1" "', argument " "2"" of type '" "struct stack_st_X509 *""'"); } arg2 = (struct stack_st_X509 *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_X509_STORE, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_verify1" "', argument " "3"" of type '" "X509_STORE *""'"); } arg3 = (X509_STORE *)(argp3); res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "pkcs7_verify1" "', argument " "4"" of type '" "BIO *""'"); } arg4 = (BIO *)(argp4); ecode5 = SWIG_AsVal_int(obj4, &val5); if (!SWIG_IsOK(ecode5)) { SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "pkcs7_verify1" "', argument " "5"" of type '" "int""'"); } arg5 = (int)(val5); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg4) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)pkcs7_verify1(arg1,arg2,arg3,arg4,arg5); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_verify0(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *arg1 = (PKCS7 *) 0 ; struct stack_st_X509 *arg2 = (struct stack_st_X509 *) 0 ; X509_STORE *arg3 = (X509_STORE *) 0 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_verify0",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_verify0" "', argument " "1"" of type '" "PKCS7 *""'"); } arg1 = (PKCS7 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_verify0" "', argument " "2"" of type '" "struct stack_st_X509 *""'"); } arg2 = (struct stack_st_X509 *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_X509_STORE, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_verify0" "', argument " "3"" of type '" "X509_STORE *""'"); } arg3 = (X509_STORE *)(argp3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pkcs7_verify0" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)pkcs7_verify0(arg1,arg2,arg3,arg4); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_smime_write_pkcs7_multi(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; PKCS7 *arg2 = (PKCS7 *) 0 ; BIO *arg3 = (BIO *) 0 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"smime_write_pkcs7_multi",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smime_write_pkcs7_multi" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "smime_write_pkcs7_multi" "', argument " "2"" of type '" "PKCS7 *""'"); } arg2 = (PKCS7 *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "smime_write_pkcs7_multi" "', argument " "3"" of type '" "BIO *""'"); } arg3 = (BIO *)(argp3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "smime_write_pkcs7_multi" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)smime_write_pkcs7_multi(arg1,arg2,arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_smime_write_pkcs7(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; PKCS7 *arg2 = (PKCS7 *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"smime_write_pkcs7",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smime_write_pkcs7" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "smime_write_pkcs7" "', argument " "2"" of type '" "PKCS7 *""'"); } arg2 = (PKCS7 *)(argp2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "smime_write_pkcs7" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)smime_write_pkcs7(arg1,arg2,arg3); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_smime_read_pkcs7(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"smime_read_pkcs7",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smime_read_pkcs7" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)smime_read_pkcs7(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_write_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *arg1 = (PKCS7 *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_write_bio",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_write_bio" "', argument " "1"" of type '" "PKCS7 *""'"); } arg1 = (PKCS7 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_write_bio" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)pkcs7_write_bio(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_write_bio_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *arg1 = (PKCS7 *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_write_bio_der",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_write_bio_der" "', argument " "1"" of type '" "PKCS7 *""'"); } arg1 = (PKCS7 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_write_bio_der" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)pkcs7_write_bio_der(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_type_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *arg1 = (PKCS7 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_type_nid",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_type_nid" "', argument " "1"" of type '" "PKCS7 *""'"); } arg1 = (PKCS7 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)pkcs7_type_nid(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_type_sn(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *arg1 = (PKCS7 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_type_sn",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_type_sn" "', argument " "1"" of type '" "PKCS7 *""'"); } arg1 = (PKCS7 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (char *)pkcs7_type_sn(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_smime_crlf_copy(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"smime_crlf_copy",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smime_crlf_copy" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "smime_crlf_copy" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)smime_crlf_copy(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_pkcs7_get0_signers(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PKCS7 *arg1 = (PKCS7 *) 0 ; struct stack_st_X509 *arg2 = (struct stack_st_X509 *) 0 ; int arg3 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; int val3 ; int ecode3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; struct stack_st_X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"pkcs7_get0_signers",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_get0_signers" "', argument " "1"" of type '" "PKCS7 *""'"); } arg1 = (PKCS7 *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_get0_signers" "', argument " "2"" of type '" "struct stack_st_X509 *""'"); } arg2 = (struct stack_st_X509 *)(argp2); ecode3 = SWIG_AsVal_int(obj2, &val3); if (!SWIG_IsOK(ecode3)) { SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pkcs7_get0_signers" "', argument " "3"" of type '" "int""'"); } arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (struct stack_st_X509 *)pkcs7_get0_signers(arg1,arg2,arg3); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_X509, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__util_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_util_err""' of type '""PyObject *""'"); } _util_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__util_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_util_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_util_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"util_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } util_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_util_hex_to_string(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"util_hex_to_string",1,1,&obj0)) SWIG_fail; { arg1=obj0; } result = (PyObject *)util_hex_to_string(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_util_string_to_hex(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"util_string_to_hex",1,1,&obj0)) SWIG_fail; { arg1=obj0; } result = (PyObject *)util_string_to_hex(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *result = 0 ; result = (EC_KEY *)EC_KEY_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ec_key_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_free" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } EC_KEY_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ec_key_size",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_size" "', argument " "1"" of type '" "EC_KEY const *""'"); } arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ECDSA_size((EC_KEY const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_gen_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ec_key_gen_key",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_gen_key" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)EC_KEY_generate_key(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_check_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ec_key_check_key",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_check_key" "', argument " "1"" of type '" "EC_KEY const *""'"); } arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)EC_KEY_check_key((EC_KEY const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN int Swig_var__ec_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_ec_err""' of type '""PyObject *""'"); } _ec_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__ec_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_ec_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_ec_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ec_init",1,1,&obj0)) SWIG_fail; { arg1=obj0; } ec_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_get_builtin_curves(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *result = 0 ; result = (PyObject *)ec_get_builtin_curves(); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_new_by_curve_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; EC_KEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ec_key_new_by_curve_name",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ec_key_new_by_curve_name" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); result = (EC_KEY *)ec_key_new_by_curve_name(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_get_public_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ec_key_get_public_der",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_get_public_der" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)ec_key_get_public_der(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_get_public_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ec_key_get_public_key",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_get_public_key" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)ec_key_get_public_key(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_read_pubkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; EC_KEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ec_key_read_pubkey",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_read_pubkey" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (EC_KEY *)ec_key_read_pubkey(arg1); SWIG_PYTHON_THREAD_END_ALLOW; } resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_write_pubkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ec_key_write_pubkey",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_write_pubkey" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ec_key_write_pubkey" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; result = (int)ec_key_write_pubkey(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_read_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; EC_KEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ec_key_read_bio",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_read_bio" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); { if (!PyCallable_Check(obj1)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (EC_KEY *)ec_key_read_bio(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_write_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; BIO *arg2 = (BIO *) 0 ; EVP_CIPHER *arg3 = (EVP_CIPHER *) 0 ; PyObject *arg4 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ec_key_write_bio",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_write_bio" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ec_key_write_bio" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ec_key_write_bio" "', argument " "3"" of type '" "EVP_CIPHER *""'"); } arg3 = (EVP_CIPHER *)(argp3); { if (!PyCallable_Check(obj3)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg4=obj3; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg4) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ec_key_write_bio(arg1,arg2,arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_write_bio_no_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; BIO *arg2 = (BIO *) 0 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ec_key_write_bio_no_cipher",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_write_bio_no_cipher" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ec_key_write_bio_no_cipher" "', argument " "2"" of type '" "BIO *""'"); } arg2 = (BIO *)(argp2); { if (!PyCallable_Check(obj2)) { PyErr_SetString(PyExc_TypeError, "expected PyCallable"); return NULL; } arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ec_key_write_bio_no_cipher(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ecdsa_sig_get_r(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ECDSA_SIG *arg1 = (ECDSA_SIG *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ecdsa_sig_get_r",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ECDSA_SIG, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_sig_get_r" "', argument " "1"" of type '" "ECDSA_SIG *""'"); } arg1 = (ECDSA_SIG *)(argp1); result = (PyObject *)ecdsa_sig_get_r(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ecdsa_sig_get_s(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ECDSA_SIG *arg1 = (ECDSA_SIG *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ecdsa_sig_get_s",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ECDSA_SIG, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_sig_get_s" "', argument " "1"" of type '" "ECDSA_SIG *""'"); } arg1 = (ECDSA_SIG *)(argp1); result = (PyObject *)ecdsa_sig_get_s(arg1); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ecdsa_sign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ecdsa_sign",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_sign" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)ecdsa_sign(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ecdsa_verify(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject *arg3 = (PyObject *) 0 ; PyObject *arg4 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ecdsa_verify",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_verify" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); { arg2=obj1; } { arg3=obj2; } { arg4=obj3; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ecdsa_verify(arg1,arg2,arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ecdsa_sign_asn1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ecdsa_sign_asn1",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_sign_asn1" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); { arg2=obj1; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)ecdsa_sign_asn1(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ecdsa_verify_asn1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; PyObject *arg2 = (PyObject *) 0 ; PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ecdsa_verify_asn1",3,3,&obj0,&obj1,&obj2)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_verify_asn1" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); { arg2=obj1; } { arg3=obj2; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ecdsa_verify_asn1(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ecdh_compute_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; EC_KEY *arg2 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ecdh_compute_key",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdh_compute_key" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ecdh_compute_key" "', argument " "2"" of type '" "EC_KEY *""'"); } arg2 = (EC_KEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)ecdh_compute_key(arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_from_pubkey_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; EC_KEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ec_key_from_pubkey_der",1,1,&obj0)) SWIG_fail; { arg1=obj0; } result = (EC_KEY *)ec_key_from_pubkey_der(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_from_pubkey_params(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; PyObject *arg2 = (PyObject *) 0 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; EC_KEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"ec_key_from_pubkey_params",2,2,&obj0,&obj1)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ec_key_from_pubkey_params" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); { arg2=obj1; } result = (EC_KEY *)ec_key_from_pubkey_params(arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_keylen(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ec_key_keylen",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_keylen" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ec_key_keylen(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_ec_key_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EC_KEY *arg1 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"ec_key_type_check",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_type_check" "', argument " "1"" of type '" "EC_KEY *""'"); } arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ec_key_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_load_builtin_engines(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE_load_builtin_engines(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_load_dynamic(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE_load_dynamic(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_load_openssl(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE_load_openssl(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_cleanup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE_cleanup(); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *result = 0 ; result = (ENGINE *)ENGINE_new(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ENGINE, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_by_id(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; PyObject * obj0 = 0 ; ENGINE *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"engine_by_id",1,1,&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_by_id" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (ENGINE *)ENGINE_by_id((char const *)arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ENGINE, 0 | 0 ); if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap_engine_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *arg1 = (ENGINE *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"engine_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_free" "', argument " "1"" of type '" "ENGINE *""'"); } arg1 = (ENGINE *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ENGINE_free(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *arg1 = (ENGINE *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"engine_init",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_init" "', argument " "1"" of type '" "ENGINE *""'"); } arg1 = (ENGINE *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ENGINE_init(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_finish(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *arg1 = (ENGINE *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"engine_finish",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_finish" "', argument " "1"" of type '" "ENGINE *""'"); } arg1 = (ENGINE *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ENGINE_finish(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_get_id(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *arg1 = (ENGINE *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"engine_get_id",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_get_id" "', argument " "1"" of type '" "ENGINE const *""'"); } arg1 = (ENGINE *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (char *)ENGINE_get_id((ENGINE const *)arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_get_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *arg1 = (ENGINE *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"engine_get_name",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_get_name" "', argument " "1"" of type '" "ENGINE const *""'"); } arg1 = (ENGINE *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (char *)ENGINE_get_name((ENGINE const *)arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_ctrl_cmd_string(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *arg1 = (ENGINE *) 0 ; char *arg2 = (char *) 0 ; char *arg3 = (char *) 0 ; int arg4 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; int res3 ; char *buf3 = 0 ; int alloc3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"engine_ctrl_cmd_string",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_ctrl_cmd_string" "', argument " "1"" of type '" "ENGINE *""'"); } arg1 = (ENGINE *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "engine_ctrl_cmd_string" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "engine_ctrl_cmd_string" "', argument " "3"" of type '" "char const *""'"); } arg3 = (char *)(buf3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "engine_ctrl_cmd_string" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ENGINE_ctrl_cmd_string(arg1,(char const *)arg2,(char const *)arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } SWIGINTERN PyObject *_wrap_ui_openssl(PyObject *self, PyObject *args) { PyObject *resultobj = 0; UI_METHOD *result = 0 ; result = (UI_METHOD *)UI_OpenSSL(); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_UI_METHOD, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__cbd_t_password_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _cbd_t *arg1 = (_cbd_t *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"_cbd_t_password_set",1,1,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_password_set" "', argument " "1"" of type '" "_cbd_t *""'"); } arg1 = (_cbd_t *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_cbd_t_password_set" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); if (arg1->password) free((char*)arg1->password); if (arg2) { size_t size = strlen((const char *)(arg2)) + 1; arg1->password = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size)); } else { arg1->password = 0; } resultobj = SWIG_Py_Void(); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap__cbd_t_password_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _cbd_t *arg1 = (_cbd_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; char *result = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_password_get" "', argument " "1"" of type '" "_cbd_t *""'"); } arg1 = (_cbd_t *)(argp1); result = (char *) ((arg1)->password); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap__cbd_t_prompt_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _cbd_t *arg1 = (_cbd_t *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj1 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"_cbd_t_prompt_set",1,1,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_prompt_set" "', argument " "1"" of type '" "_cbd_t *""'"); } arg1 = (_cbd_t *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_cbd_t_prompt_set" "', argument " "2"" of type '" "char *""'"); } arg2 = (char *)(buf2); if (arg1->prompt) free((char*)arg1->prompt); if (arg2) { size_t size = strlen((const char *)(arg2)) + 1; arg1->prompt = (char *)(char *)memcpy((char *)malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size)); } else { arg1->prompt = 0; } resultobj = SWIG_Py_Void(); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap__cbd_t_prompt_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _cbd_t *arg1 = (_cbd_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; char *result = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_prompt_get" "', argument " "1"" of type '" "_cbd_t *""'"); } arg1 = (_cbd_t *)(argp1); result = (char *) ((arg1)->prompt); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN int _wrap_new__cbd_t(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _cbd_t *result = 0 ; result = (_cbd_t *)calloc(1, sizeof(_cbd_t)); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p__cbd_t, SWIG_BUILTIN_INIT | 0 ); return resultobj == Py_None ? -1 : 0; fail: return -1; } SWIGINTERN PyObject *_wrap_delete__cbd_t(PyObject *self, PyObject *args) { PyObject *resultobj = 0; _cbd_t *arg1 = (_cbd_t *) 0 ; void *argp1 = 0 ; int res1 = 0 ; res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, SWIG_POINTER_DISOWN | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__cbd_t" "', argument " "1"" of type '" "_cbd_t *""'"); } arg1 = (_cbd_t *)(argp1); free((char *) arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_pkcs11_data_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; PyObject * obj0 = 0 ; void *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"engine_pkcs11_data_new",1,1,&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_pkcs11_data_new" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); result = (void *)engine_pkcs11_data_new((char const *)arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap_engine_pkcs11_data_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; void *arg1 = (void *) 0 ; int res1 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"engine_pkcs11_data_free",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0,SWIG_as_voidptrptr(&arg1), 0, 0); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_pkcs11_data_free" "', argument " "1"" of type '" "void *""'"); } engine_pkcs11_data_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_load_private_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *arg1 = (ENGINE *) 0 ; char *arg2 = (char *) 0 ; UI_METHOD *arg3 = (UI_METHOD *) 0 ; void *arg4 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; int res4 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; EVP_PKEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"engine_load_private_key",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_load_private_key" "', argument " "1"" of type '" "ENGINE *""'"); } arg1 = (ENGINE *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "engine_load_private_key" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_UI_METHOD, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "engine_load_private_key" "', argument " "3"" of type '" "UI_METHOD *""'"); } arg3 = (UI_METHOD *)(argp3); res4 = SWIG_ConvertPtr(obj3,SWIG_as_voidptrptr(&arg4), 0, 0); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "engine_load_private_key" "', argument " "4"" of type '" "void *""'"); } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (EVP_PKEY *)ENGINE_load_private_key(arg1,(char const *)arg2,arg3,arg4); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_engine_load_public_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *arg1 = (ENGINE *) 0 ; char *arg2 = (char *) 0 ; UI_METHOD *arg3 = (UI_METHOD *) 0 ; void *arg4 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; int res4 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; EVP_PKEY *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"engine_load_public_key",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_load_public_key" "', argument " "1"" of type '" "ENGINE *""'"); } arg1 = (ENGINE *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "engine_load_public_key" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_UI_METHOD, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "engine_load_public_key" "', argument " "3"" of type '" "UI_METHOD *""'"); } arg3 = (UI_METHOD *)(argp3); res4 = SWIG_ConvertPtr(obj3,SWIG_as_voidptrptr(&arg4), 0, 0); if (!SWIG_IsOK(res4)) { SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "engine_load_public_key" "', argument " "4"" of type '" "void *""'"); } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (EVP_PKEY *)ENGINE_load_public_key(arg1,(char const *)arg2,arg3,arg4); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN int Swig_var__engine_err_set(PyObject *_val) { { void *argp = 0; int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject, 0 ); if (!SWIG_IsOK(res)) { SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_engine_err""' of type '""PyObject *""'"); } _engine_err = (PyObject *)(argp); } return 0; fail: return 1; } SWIGINTERN PyObject *Swig_var__engine_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_engine_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } SWIGINTERN PyObject *_wrap_engine_init_error(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; PyObject * obj0 = 0 ; if(!PyArg_UnpackTuple(args,(char *)"engine_init_error",1,1,&obj0)) SWIG_fail; { arg1=obj0; } engine_init_error(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_engine_load_certificate(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *arg1 = (ENGINE *) 0 ; char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; X509 *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"engine_load_certificate",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_load_certificate" "', argument " "1"" of type '" "ENGINE *""'"); } arg1 = (ENGINE *)(argp1); res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "engine_load_certificate" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (X509 *)engine_load_certificate(arg1,(char const *)arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 | 0 ); if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } SWIGINTERN PyObject *_wrap_engine_set_default(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ENGINE *arg1 = (ENGINE *) 0 ; unsigned int arg2 ; void *argp1 = 0 ; int res1 = 0 ; unsigned int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"engine_set_default",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_set_default" "', argument " "1"" of type '" "ENGINE *""'"); } arg1 = (ENGINE *)(argp1); ecode2 = SWIG_AsVal_unsigned_SS_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "engine_set_default" "', argument " "2"" of type '" "unsigned int""'"); } arg2 = (unsigned int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)ENGINE_set_default(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_obj_nid2obj(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; ASN1_OBJECT *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"obj_nid2obj",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "obj_nid2obj" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); result = (ASN1_OBJECT *)OBJ_nid2obj(arg1); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_obj_nid2ln(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"obj_nid2ln",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "obj_nid2ln" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); result = (char *)OBJ_nid2ln(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_obj_nid2sn(PyObject *self, PyObject *args) { PyObject *resultobj = 0; int arg1 ; int val1 ; int ecode1 = 0 ; PyObject * obj0 = 0 ; char *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"obj_nid2sn",1,1,&obj0)) SWIG_fail; ecode1 = SWIG_AsVal_int(obj0, &val1); if (!SWIG_IsOK(ecode1)) { SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "obj_nid2sn" "', argument " "1"" of type '" "int""'"); } arg1 = (int)(val1); result = (char *)OBJ_nid2sn(arg1); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_obj_obj2nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ; void *argp1 = 0 ; int res1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"obj_obj2nid",1,1,&obj0)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_obj2nid" "', argument " "1"" of type '" "ASN1_OBJECT const *""'"); } arg1 = (ASN1_OBJECT *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)OBJ_obj2nid((ASN1_OBJECT const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: return NULL; } SWIGINTERN PyObject *_wrap_obj_ln2nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"obj_ln2nid",1,1,&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_ln2nid" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)OBJ_ln2nid((char const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap_obj_sn2nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"obj_sn2nid",1,1,&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_sn2nid" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)OBJ_sn2nid((char const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap_obj_txt2nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; PyObject * obj0 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"obj_txt2nid",1,1,&obj0)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_txt2nid" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)OBJ_txt2nid((char const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap_obj_txt2obj(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int arg2 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; ASN1_OBJECT *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"obj_txt2obj",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_txt2obj" "', argument " "1"" of type '" "char const *""'"); } arg1 = (char *)(buf1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "obj_txt2obj" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (ASN1_OBJECT *)OBJ_txt2obj((char const *)arg1,arg2); resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap__obj_obj2txt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; char *arg1 = (char *) 0 ; int arg2 ; ASN1_OBJECT *arg3 = (ASN1_OBJECT *) 0 ; int arg4 ; int res1 ; char *buf1 = 0 ; int alloc1 = 0 ; int val2 ; int ecode2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; int val4 ; int ecode4 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject * obj2 = 0 ; PyObject * obj3 = 0 ; int result; if(!PyArg_UnpackTuple(args,(char *)"_obj_obj2txt",4,4,&obj0,&obj1,&obj2,&obj3)) SWIG_fail; res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_obj_obj2txt" "', argument " "1"" of type '" "char *""'"); } arg1 = (char *)(buf1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_obj_obj2txt" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); if (!SWIG_IsOK(res3)) { SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "_obj_obj2txt" "', argument " "3"" of type '" "ASN1_OBJECT const *""'"); } arg3 = (ASN1_OBJECT *)(argp3); ecode4 = SWIG_AsVal_int(obj3, &val4); if (!SWIG_IsOK(ecode4)) { SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_obj_obj2txt" "', argument " "4"" of type '" "int""'"); } arg4 = (int)(val4); { if (!arg3) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (int)OBJ_obj2txt(arg1,arg2,(ASN1_OBJECT const *)arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; } if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } SWIGINTERN PyObject *_wrap_obj_obj2txt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; PyObject * obj0 = 0 ; PyObject * obj1 = 0 ; PyObject *result = 0 ; if(!PyArg_UnpackTuple(args,(char *)"obj_obj2txt",2,2,&obj0,&obj1)) SWIG_fail; res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); if (!SWIG_IsOK(res1)) { SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_obj2txt" "', argument " "1"" of type '" "ASN1_OBJECT const *""'"); } arg1 = (ASN1_OBJECT *)(argp1); ecode2 = SWIG_AsVal_int(obj1, &val2); if (!SWIG_IsOK(ecode2)) { SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "obj_obj2txt" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } result = (PyObject *)obj_obj2txt((ASN1_OBJECT const *)arg1,arg2); { resultobj=result; } return resultobj; fail: return NULL; } static PyMethodDef SwigMethods[] = { { (char *)"SWIG_PyInstanceMethod_New", (PyCFunction)SWIG_PyInstanceMethod_New, METH_O, NULL}, { (char *)"sk_num", _wrap_sk_num, METH_VARARGS, NULL}, { (char *)"sk_value", _wrap_sk_value, METH_VARARGS, NULL}, { (char *)"sk_set", _wrap_sk_set, METH_VARARGS, NULL}, { (char *)"sk_new", _wrap_sk_new, METH_VARARGS, NULL}, { (char *)"sk_new_null", _wrap_sk_new_null, METH_VARARGS, NULL}, { (char *)"sk_free", _wrap_sk_free, METH_VARARGS, NULL}, { (char *)"sk_pop_free", _wrap_sk_pop_free, METH_VARARGS, NULL}, { (char *)"sk_deep_copy", _wrap_sk_deep_copy, METH_VARARGS, NULL}, { (char *)"sk_insert", _wrap_sk_insert, METH_VARARGS, NULL}, { (char *)"sk_delete", _wrap_sk_delete, METH_VARARGS, NULL}, { (char *)"sk_delete_ptr", _wrap_sk_delete_ptr, METH_VARARGS, NULL}, { (char *)"sk_find", _wrap_sk_find, METH_VARARGS, NULL}, { (char *)"sk_find_ex", _wrap_sk_find_ex, METH_VARARGS, NULL}, { (char *)"sk_push", _wrap_sk_push, METH_VARARGS, NULL}, { (char *)"sk_unshift", _wrap_sk_unshift, METH_VARARGS, NULL}, { (char *)"sk_shift", _wrap_sk_shift, METH_VARARGS, NULL}, { (char *)"sk_pop", _wrap_sk_pop, METH_VARARGS, NULL}, { (char *)"sk_zero", _wrap_sk_zero, METH_VARARGS, NULL}, { (char *)"sk_set_cmp_func", _wrap_sk_set_cmp_func, METH_VARARGS, NULL}, { (char *)"sk_dup", _wrap_sk_dup, METH_VARARGS, NULL}, { (char *)"sk_sort", _wrap_sk_sort, METH_VARARGS, NULL}, { (char *)"sk_is_sorted", _wrap_sk_is_sorted, METH_VARARGS, NULL}, { (char *)"threading_init", _wrap_threading_init, METH_VARARGS, NULL}, { (char *)"threading_cleanup", _wrap_threading_cleanup, METH_VARARGS, NULL}, { (char *)"lib_init", _wrap_lib_init, METH_VARARGS, NULL}, { (char *)"bn_to_mpi", _wrap_bn_to_mpi, METH_VARARGS, NULL}, { (char *)"mpi_to_bn", _wrap_mpi_to_bn, METH_VARARGS, NULL}, { (char *)"bn_to_bin", _wrap_bn_to_bin, METH_VARARGS, NULL}, { (char *)"bin_to_bn", _wrap_bin_to_bn, METH_VARARGS, NULL}, { (char *)"bn_to_hex", _wrap_bn_to_hex, METH_VARARGS, NULL}, { (char *)"hex_to_bn", _wrap_hex_to_bn, METH_VARARGS, NULL}, { (char *)"dec_to_bn", _wrap_dec_to_bn, METH_VARARGS, NULL}, { (char *)"err_print_errors", _wrap_err_print_errors, METH_VARARGS, NULL}, { (char *)"err_get_error", _wrap_err_get_error, METH_VARARGS, NULL}, { (char *)"err_peek_error", _wrap_err_peek_error, METH_VARARGS, NULL}, { (char *)"err_lib_error_string", _wrap_err_lib_error_string, METH_VARARGS, NULL}, { (char *)"err_func_error_string", _wrap_err_func_error_string, METH_VARARGS, NULL}, { (char *)"err_reason_error_string", _wrap_err_reason_error_string, METH_VARARGS, NULL}, { (char *)"bio_s_bio", _wrap_bio_s_bio, METH_VARARGS, NULL}, { (char *)"bio_s_mem", _wrap_bio_s_mem, METH_VARARGS, NULL}, { (char *)"bio_s_socket", _wrap_bio_s_socket, METH_VARARGS, NULL}, { (char *)"bio_f_ssl", _wrap_bio_f_ssl, METH_VARARGS, NULL}, { (char *)"bio_f_buffer", _wrap_bio_f_buffer, METH_VARARGS, NULL}, { (char *)"bio_f_cipher", _wrap_bio_f_cipher, METH_VARARGS, NULL}, { (char *)"bio_new", _wrap_bio_new, METH_VARARGS, NULL}, { (char *)"bio_new_socket", _wrap_bio_new_socket, METH_VARARGS, NULL}, { (char *)"bio_free_all", _wrap_bio_free_all, METH_VARARGS, NULL}, { (char *)"bio_dup_chain", _wrap_bio_dup_chain, METH_VARARGS, NULL}, { (char *)"bio_push", _wrap_bio_push, METH_VARARGS, NULL}, { (char *)"bio_pop", _wrap_bio_pop, METH_VARARGS, NULL}, { (char *)"bio_eof", _wrap_bio_eof, METH_VARARGS, NULL}, { (char *)"pyfd_init", _wrap_pyfd_init, METH_VARARGS, NULL}, { (char *)"bio_init", _wrap_bio_init, METH_VARARGS, NULL}, { (char *)"bio_free", _wrap_bio_free, METH_VARARGS, NULL}, { (char *)"bio_new_file", _wrap_bio_new_file, METH_VARARGS, NULL}, { (char *)"bio_new_pyfile", _wrap_bio_new_pyfile, METH_VARARGS, NULL}, { (char *)"bio_read", _wrap_bio_read, METH_VARARGS, NULL}, { (char *)"bio_gets", _wrap_bio_gets, METH_VARARGS, NULL}, { (char *)"bio_write", _wrap_bio_write, METH_VARARGS, NULL}, { (char *)"bio_ctrl_pending", _wrap_bio_ctrl_pending, METH_VARARGS, NULL}, { (char *)"bio_ctrl_wpending", _wrap_bio_ctrl_wpending, METH_VARARGS, NULL}, { (char *)"bio_ctrl_get_write_guarantee", _wrap_bio_ctrl_get_write_guarantee, METH_VARARGS, NULL}, { (char *)"bio_reset", _wrap_bio_reset, METH_VARARGS, NULL}, { (char *)"bio_flush", _wrap_bio_flush, METH_VARARGS, NULL}, { (char *)"bio_seek", _wrap_bio_seek, METH_VARARGS, NULL}, { (char *)"bio_tell", _wrap_bio_tell, METH_VARARGS, NULL}, { (char *)"bio_set_flags", _wrap_bio_set_flags, METH_VARARGS, NULL}, { (char *)"bio_get_flags", _wrap_bio_get_flags, METH_VARARGS, NULL}, { (char *)"bio_set_cipher", _wrap_bio_set_cipher, METH_VARARGS, NULL}, { (char *)"bio_set_mem_eof_return", _wrap_bio_set_mem_eof_return, METH_VARARGS, NULL}, { (char *)"bio_get_fd", _wrap_bio_get_fd, METH_VARARGS, NULL}, { (char *)"bio_do_handshake", _wrap_bio_do_handshake, METH_VARARGS, NULL}, { (char *)"bio_make_bio_pair", _wrap_bio_make_bio_pair, METH_VARARGS, NULL}, { (char *)"bio_set_write_buf_size", _wrap_bio_set_write_buf_size, METH_VARARGS, NULL}, { (char *)"bio_should_retry", _wrap_bio_should_retry, METH_VARARGS, NULL}, { (char *)"bio_should_read", _wrap_bio_should_read, METH_VARARGS, NULL}, { (char *)"bio_should_write", _wrap_bio_should_write, METH_VARARGS, NULL}, { (char *)"BIO_meth_new", _wrap_BIO_meth_new, METH_VARARGS, NULL}, { (char *)"BIO_meth_free", _wrap_BIO_meth_free, METH_VARARGS, NULL}, { (char *)"pyfd_write", _wrap_pyfd_write, METH_VARARGS, NULL}, { (char *)"pyfd_read", _wrap_pyfd_read, METH_VARARGS, NULL}, { (char *)"pyfd_puts", _wrap_pyfd_puts, METH_VARARGS, NULL}, { (char *)"pyfd_gets", _wrap_pyfd_gets, METH_VARARGS, NULL}, { (char *)"pyfd_new", _wrap_pyfd_new, METH_VARARGS, NULL}, { (char *)"pyfd_free", _wrap_pyfd_free, METH_VARARGS, NULL}, { (char *)"pyfd_ctrl", _wrap_pyfd_ctrl, METH_VARARGS, NULL}, { (char *)"bio_new_pyfd", _wrap_bio_new_pyfd, METH_VARARGS, NULL}, { (char *)"bn_rand", _wrap_bn_rand, METH_VARARGS, NULL}, { (char *)"bn_rand_range", _wrap_bn_rand_range, METH_VARARGS, NULL}, { (char *)"rand_load_file", _wrap_rand_load_file, METH_VARARGS, NULL}, { (char *)"rand_save_file", _wrap_rand_save_file, METH_VARARGS, NULL}, { (char *)"rand_poll", _wrap_rand_poll, METH_VARARGS, NULL}, { (char *)"rand_status", _wrap_rand_status, METH_VARARGS, NULL}, { (char *)"rand_cleanup", _wrap_rand_cleanup, METH_VARARGS, NULL}, { (char *)"rand_init", _wrap_rand_init, METH_VARARGS, NULL}, { (char *)"rand_seed", _wrap_rand_seed, METH_VARARGS, NULL}, { (char *)"rand_add", _wrap_rand_add, METH_VARARGS, NULL}, { (char *)"rand_bytes", _wrap_rand_bytes, METH_VARARGS, NULL}, { (char *)"rand_pseudo_bytes", _wrap_rand_pseudo_bytes, METH_VARARGS, NULL}, { (char *)"rand_file_name", _wrap_rand_file_name, METH_VARARGS, NULL}, { (char *)"rand_screen", _wrap_rand_screen, METH_VARARGS, NULL}, { (char *)"rand_win32_event", _wrap_rand_win32_event, METH_VARARGS, NULL}, { (char *)"md5", _wrap_md5, METH_VARARGS, NULL}, { (char *)"sha1", _wrap_sha1, METH_VARARGS, NULL}, { (char *)"ripemd160", _wrap_ripemd160, METH_VARARGS, NULL}, { (char *)"sha224", _wrap_sha224, METH_VARARGS, NULL}, { (char *)"sha256", _wrap_sha256, METH_VARARGS, NULL}, { (char *)"sha384", _wrap_sha384, METH_VARARGS, NULL}, { (char *)"sha512", _wrap_sha512, METH_VARARGS, NULL}, { (char *)"digest_init", _wrap_digest_init, METH_VARARGS, NULL}, { (char *)"des_ecb", _wrap_des_ecb, METH_VARARGS, NULL}, { (char *)"des_ede_ecb", _wrap_des_ede_ecb, METH_VARARGS, NULL}, { (char *)"des_ede3_ecb", _wrap_des_ede3_ecb, METH_VARARGS, NULL}, { (char *)"des_cbc", _wrap_des_cbc, METH_VARARGS, NULL}, { (char *)"des_ede_cbc", _wrap_des_ede_cbc, METH_VARARGS, NULL}, { (char *)"des_ede3_cbc", _wrap_des_ede3_cbc, METH_VARARGS, NULL}, { (char *)"des_cfb", _wrap_des_cfb, METH_VARARGS, NULL}, { (char *)"des_ede_cfb", _wrap_des_ede_cfb, METH_VARARGS, NULL}, { (char *)"des_ede3_cfb", _wrap_des_ede3_cfb, METH_VARARGS, NULL}, { (char *)"des_ofb", _wrap_des_ofb, METH_VARARGS, NULL}, { (char *)"des_ede_ofb", _wrap_des_ede_ofb, METH_VARARGS, NULL}, { (char *)"des_ede3_ofb", _wrap_des_ede3_ofb, METH_VARARGS, NULL}, { (char *)"bf_ecb", _wrap_bf_ecb, METH_VARARGS, NULL}, { (char *)"bf_cbc", _wrap_bf_cbc, METH_VARARGS, NULL}, { (char *)"bf_cfb", _wrap_bf_cfb, METH_VARARGS, NULL}, { (char *)"bf_ofb", _wrap_bf_ofb, METH_VARARGS, NULL}, { (char *)"cast5_ecb", _wrap_cast5_ecb, METH_VARARGS, NULL}, { (char *)"cast5_cbc", _wrap_cast5_cbc, METH_VARARGS, NULL}, { (char *)"cast5_cfb", _wrap_cast5_cfb, METH_VARARGS, NULL}, { (char *)"cast5_ofb", _wrap_cast5_ofb, METH_VARARGS, NULL}, { (char *)"rc4", _wrap_rc4, METH_VARARGS, NULL}, { (char *)"rc2_40_cbc", _wrap_rc2_40_cbc, METH_VARARGS, NULL}, { (char *)"aes_128_ecb", _wrap_aes_128_ecb, METH_VARARGS, NULL}, { (char *)"aes_128_cbc", _wrap_aes_128_cbc, METH_VARARGS, NULL}, { (char *)"aes_128_cfb", _wrap_aes_128_cfb, METH_VARARGS, NULL}, { (char *)"aes_128_ofb", _wrap_aes_128_ofb, METH_VARARGS, NULL}, { (char *)"aes_128_ctr", _wrap_aes_128_ctr, METH_VARARGS, NULL}, { (char *)"aes_192_ecb", _wrap_aes_192_ecb, METH_VARARGS, NULL}, { (char *)"aes_192_cbc", _wrap_aes_192_cbc, METH_VARARGS, NULL}, { (char *)"aes_192_cfb", _wrap_aes_192_cfb, METH_VARARGS, NULL}, { (char *)"aes_192_ofb", _wrap_aes_192_ofb, METH_VARARGS, NULL}, { (char *)"aes_192_ctr", _wrap_aes_192_ctr, METH_VARARGS, NULL}, { (char *)"aes_256_ecb", _wrap_aes_256_ecb, METH_VARARGS, NULL}, { (char *)"aes_256_cbc", _wrap_aes_256_cbc, METH_VARARGS, NULL}, { (char *)"aes_256_cfb", _wrap_aes_256_cfb, METH_VARARGS, NULL}, { (char *)"aes_256_ofb", _wrap_aes_256_ofb, METH_VARARGS, NULL}, { (char *)"aes_256_ctr", _wrap_aes_256_ctr, METH_VARARGS, NULL}, { (char *)"cipher_set_padding", _wrap_cipher_set_padding, METH_VARARGS, NULL}, { (char *)"pkey_free", _wrap_pkey_free, METH_VARARGS, NULL}, { (char *)"pkey_assign", _wrap_pkey_assign, METH_VARARGS, NULL}, { (char *)"pkey_assign_ec", _wrap_pkey_assign_ec, METH_VARARGS, NULL}, { (char *)"pkey_set1_rsa", _wrap_pkey_set1_rsa, METH_VARARGS, NULL}, { (char *)"sign_init", _wrap_sign_init, METH_VARARGS, NULL}, { (char *)"verify_init", _wrap_verify_init, METH_VARARGS, NULL}, { (char *)"pkey_size", _wrap_pkey_size, METH_VARARGS, NULL}, { (char *)"evp_init", _wrap_evp_init, METH_VARARGS, NULL}, { (char *)"pkey_get1_rsa", _wrap_pkey_get1_rsa, METH_VARARGS, NULL}, { (char *)"pkcs5_pbkdf2_hmac_sha1", _wrap_pkcs5_pbkdf2_hmac_sha1, METH_VARARGS, NULL}, { (char *)"md_ctx_new", _wrap_md_ctx_new, METH_VARARGS, NULL}, { (char *)"md_ctx_free", _wrap_md_ctx_free, METH_VARARGS, NULL}, { (char *)"digest_update", _wrap_digest_update, METH_VARARGS, NULL}, { (char *)"digest_final", _wrap_digest_final, METH_VARARGS, NULL}, { (char *)"hmac_ctx_new", _wrap_hmac_ctx_new, METH_VARARGS, NULL}, { (char *)"hmac_ctx_free", _wrap_hmac_ctx_free, METH_VARARGS, NULL}, { (char *)"hmac_init", _wrap_hmac_init, METH_VARARGS, NULL}, { (char *)"hmac_update", _wrap_hmac_update, METH_VARARGS, NULL}, { (char *)"hmac_final", _wrap_hmac_final, METH_VARARGS, NULL}, { (char *)"hmac", _wrap_hmac, METH_VARARGS, NULL}, { (char *)"cipher_ctx_new", _wrap_cipher_ctx_new, METH_VARARGS, NULL}, { (char *)"cipher_ctx_free", _wrap_cipher_ctx_free, METH_VARARGS, NULL}, { (char *)"bytes_to_key", _wrap_bytes_to_key, METH_VARARGS, NULL}, { (char *)"cipher_init", _wrap_cipher_init, METH_VARARGS, NULL}, { (char *)"cipher_update", _wrap_cipher_update, METH_VARARGS, NULL}, { (char *)"cipher_final", _wrap_cipher_final, METH_VARARGS, NULL}, { (char *)"sign_update", _wrap_sign_update, METH_VARARGS, NULL}, { (char *)"sign_final", _wrap_sign_final, METH_VARARGS, NULL}, { (char *)"verify_update", _wrap_verify_update, METH_VARARGS, NULL}, { (char *)"verify_final", _wrap_verify_final, METH_VARARGS, NULL}, { (char *)"get_digestbyname", _wrap_get_digestbyname, METH_VARARGS, NULL}, { (char *)"pkey_write_pem_no_cipher", _wrap_pkey_write_pem_no_cipher, METH_VARARGS, NULL}, { (char *)"pkey_write_pem", _wrap_pkey_write_pem, METH_VARARGS, NULL}, { (char *)"pkey_new", _wrap_pkey_new, METH_VARARGS, NULL}, { (char *)"pkey_read_pem", _wrap_pkey_read_pem, METH_VARARGS, NULL}, { (char *)"pkey_read_pem_pubkey", _wrap_pkey_read_pem_pubkey, METH_VARARGS, NULL}, { (char *)"pkey_assign_rsa", _wrap_pkey_assign_rsa, METH_VARARGS, NULL}, { (char *)"pkey_as_der", _wrap_pkey_as_der, METH_VARARGS, NULL}, { (char *)"pkey_get_modulus", _wrap_pkey_get_modulus, METH_VARARGS, NULL}, { (char *)"aes_new", _wrap_aes_new, METH_VARARGS, NULL}, { (char *)"AES_free", _wrap_AES_free, METH_VARARGS, NULL}, { (char *)"AES_set_key", _wrap_AES_set_key, METH_VARARGS, NULL}, { (char *)"AES_crypt", _wrap_AES_crypt, METH_VARARGS, NULL}, { (char *)"AES_type_check", _wrap_AES_type_check, METH_VARARGS, NULL}, { (char *)"rc4_new", _wrap_rc4_new, METH_VARARGS, NULL}, { (char *)"rc4_free", _wrap_rc4_free, METH_VARARGS, NULL}, { (char *)"rc4_set_key", _wrap_rc4_set_key, METH_VARARGS, NULL}, { (char *)"rc4_update", _wrap_rc4_update, METH_VARARGS, NULL}, { (char *)"rc4_type_check", _wrap_rc4_type_check, METH_VARARGS, NULL}, { (char *)"dh_new", _wrap_dh_new, METH_VARARGS, NULL}, { (char *)"dh_free", _wrap_dh_free, METH_VARARGS, NULL}, { (char *)"dh_size", _wrap_dh_size, METH_VARARGS, NULL}, { (char *)"dh_generate_key", _wrap_dh_generate_key, METH_VARARGS, NULL}, { (char *)"dhparams_print", _wrap_dhparams_print, METH_VARARGS, NULL}, { (char *)"dh_init", _wrap_dh_init, METH_VARARGS, NULL}, { (char *)"dh_type_check", _wrap_dh_type_check, METH_VARARGS, NULL}, { (char *)"dh_read_parameters", _wrap_dh_read_parameters, METH_VARARGS, NULL}, { (char *)"dh_generate_parameters", _wrap_dh_generate_parameters, METH_VARARGS, NULL}, { (char *)"dh_check", _wrap_dh_check, METH_VARARGS, NULL}, { (char *)"dh_compute_key", _wrap_dh_compute_key, METH_VARARGS, NULL}, { (char *)"dh_get_p", _wrap_dh_get_p, METH_VARARGS, NULL}, { (char *)"dh_get_g", _wrap_dh_get_g, METH_VARARGS, NULL}, { (char *)"dh_get_pub", _wrap_dh_get_pub, METH_VARARGS, NULL}, { (char *)"dh_get_priv", _wrap_dh_get_priv, METH_VARARGS, NULL}, { (char *)"dh_set_pg", _wrap_dh_set_pg, METH_VARARGS, NULL}, { (char *)"rsa_size", _wrap_rsa_size, METH_VARARGS, NULL}, { (char *)"rsa_new", _wrap_rsa_new, METH_VARARGS, NULL}, { (char *)"rsa_free", _wrap_rsa_free, METH_VARARGS, NULL}, { (char *)"rsa_check_key", _wrap_rsa_check_key, METH_VARARGS, NULL}, { (char *)"rsa_init", _wrap_rsa_init, METH_VARARGS, NULL}, { (char *)"rsa_read_key", _wrap_rsa_read_key, METH_VARARGS, NULL}, { (char *)"rsa_write_key", _wrap_rsa_write_key, METH_VARARGS, NULL}, { (char *)"rsa_write_key_no_cipher", _wrap_rsa_write_key_no_cipher, METH_VARARGS, NULL}, { (char *)"rsa_read_pub_key", _wrap_rsa_read_pub_key, METH_VARARGS, NULL}, { (char *)"rsa_write_pub_key", _wrap_rsa_write_pub_key, METH_VARARGS, NULL}, { (char *)"rsa_get_e", _wrap_rsa_get_e, METH_VARARGS, NULL}, { (char *)"rsa_get_n", _wrap_rsa_get_n, METH_VARARGS, NULL}, { (char *)"rsa_set_e", _wrap_rsa_set_e, METH_VARARGS, NULL}, { (char *)"rsa_set_n", _wrap_rsa_set_n, METH_VARARGS, NULL}, { (char *)"rsa_set_en", _wrap_rsa_set_en, METH_VARARGS, NULL}, { (char *)"PyObject_Bin_AsBIGNUM", _wrap_PyObject_Bin_AsBIGNUM, METH_VARARGS, NULL}, { (char *)"rsa_set_en_bin", _wrap_rsa_set_en_bin, METH_VARARGS, NULL}, { (char *)"rsa_private_encrypt", _wrap_rsa_private_encrypt, METH_VARARGS, NULL}, { (char *)"rsa_public_decrypt", _wrap_rsa_public_decrypt, METH_VARARGS, NULL}, { (char *)"rsa_public_encrypt", _wrap_rsa_public_encrypt, METH_VARARGS, NULL}, { (char *)"rsa_private_decrypt", _wrap_rsa_private_decrypt, METH_VARARGS, NULL}, { (char *)"rsa_padding_add_pkcs1_pss", _wrap_rsa_padding_add_pkcs1_pss, METH_VARARGS, NULL}, { (char *)"rsa_verify_pkcs1_pss", _wrap_rsa_verify_pkcs1_pss, METH_VARARGS, NULL}, { (char *)"rsa_sign", _wrap_rsa_sign, METH_VARARGS, NULL}, { (char *)"rsa_verify", _wrap_rsa_verify, METH_VARARGS, NULL}, { (char *)"rsa_generate_key", _wrap_rsa_generate_key, METH_VARARGS, NULL}, { (char *)"rsa_type_check", _wrap_rsa_type_check, METH_VARARGS, NULL}, { (char *)"rsa_check_pub_key", _wrap_rsa_check_pub_key, METH_VARARGS, NULL}, { (char *)"rsa_write_key_der", _wrap_rsa_write_key_der, METH_VARARGS, NULL}, { (char *)"dsa_new", _wrap_dsa_new, METH_VARARGS, NULL}, { (char *)"dsa_free", _wrap_dsa_free, METH_VARARGS, NULL}, { (char *)"dsa_size", _wrap_dsa_size, METH_VARARGS, NULL}, { (char *)"dsa_gen_key", _wrap_dsa_gen_key, METH_VARARGS, NULL}, { (char *)"dsa_init", _wrap_dsa_init, METH_VARARGS, NULL}, { (char *)"dsa_generate_parameters", _wrap_dsa_generate_parameters, METH_VARARGS, NULL}, { (char *)"dsa_read_params", _wrap_dsa_read_params, METH_VARARGS, NULL}, { (char *)"dsa_read_key", _wrap_dsa_read_key, METH_VARARGS, NULL}, { (char *)"dsa_read_pub_key", _wrap_dsa_read_pub_key, METH_VARARGS, NULL}, { (char *)"dsa_get_p", _wrap_dsa_get_p, METH_VARARGS, NULL}, { (char *)"dsa_get_q", _wrap_dsa_get_q, METH_VARARGS, NULL}, { (char *)"dsa_get_g", _wrap_dsa_get_g, METH_VARARGS, NULL}, { (char *)"dsa_get_pub", _wrap_dsa_get_pub, METH_VARARGS, NULL}, { (char *)"dsa_get_priv", _wrap_dsa_get_priv, METH_VARARGS, NULL}, { (char *)"dsa_set_pqg", _wrap_dsa_set_pqg, METH_VARARGS, NULL}, { (char *)"dsa_set_pub", _wrap_dsa_set_pub, METH_VARARGS, NULL}, { (char *)"dsa_write_params_bio", _wrap_dsa_write_params_bio, METH_VARARGS, NULL}, { (char *)"dsa_write_key_bio", _wrap_dsa_write_key_bio, METH_VARARGS, NULL}, { (char *)"dsa_write_key_bio_no_cipher", _wrap_dsa_write_key_bio_no_cipher, METH_VARARGS, NULL}, { (char *)"dsa_write_pub_key_bio", _wrap_dsa_write_pub_key_bio, METH_VARARGS, NULL}, { (char *)"dsa_sign", _wrap_dsa_sign, METH_VARARGS, NULL}, { (char *)"dsa_verify", _wrap_dsa_verify, METH_VARARGS, NULL}, { (char *)"dsa_sign_asn1", _wrap_dsa_sign_asn1, METH_VARARGS, NULL}, { (char *)"dsa_verify_asn1", _wrap_dsa_verify_asn1, METH_VARARGS, NULL}, { (char *)"dsa_check_key", _wrap_dsa_check_key, METH_VARARGS, NULL}, { (char *)"dsa_check_pub_key", _wrap_dsa_check_pub_key, METH_VARARGS, NULL}, { (char *)"dsa_keylen", _wrap_dsa_keylen, METH_VARARGS, NULL}, { (char *)"dsa_type_check", _wrap_dsa_type_check, METH_VARARGS, NULL}, { (char *)"ssl_get_ciphers", _wrap_ssl_get_ciphers, METH_VARARGS, NULL}, { (char *)"ssl_get_version", _wrap_ssl_get_version, METH_VARARGS, NULL}, { (char *)"ssl_get_error", _wrap_ssl_get_error, METH_VARARGS, NULL}, { (char *)"ssl_get_state", _wrap_ssl_get_state, METH_VARARGS, NULL}, { (char *)"ssl_get_state_v", _wrap_ssl_get_state_v, METH_VARARGS, NULL}, { (char *)"ssl_get_alert_type", _wrap_ssl_get_alert_type, METH_VARARGS, NULL}, { (char *)"ssl_get_alert_type_v", _wrap_ssl_get_alert_type_v, METH_VARARGS, NULL}, { (char *)"ssl_get_alert_desc", _wrap_ssl_get_alert_desc, METH_VARARGS, NULL}, { (char *)"ssl_get_alert_desc_v", _wrap_ssl_get_alert_desc_v, METH_VARARGS, NULL}, { (char *)"sslv23_method", _wrap_sslv23_method, METH_VARARGS, NULL}, { (char *)"ssl_ctx_new", _wrap_ssl_ctx_new, METH_VARARGS, NULL}, { (char *)"ssl_ctx_free", _wrap_ssl_ctx_free, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_verify_depth", _wrap_ssl_ctx_set_verify_depth, METH_VARARGS, NULL}, { (char *)"ssl_ctx_get_verify_depth", _wrap_ssl_ctx_get_verify_depth, METH_VARARGS, NULL}, { (char *)"ssl_ctx_get_verify_mode", _wrap_ssl_ctx_get_verify_mode, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_cipher_list", _wrap_ssl_ctx_set_cipher_list, METH_VARARGS, NULL}, { (char *)"ssl_ctx_add_session", _wrap_ssl_ctx_add_session, METH_VARARGS, NULL}, { (char *)"ssl_ctx_remove_session", _wrap_ssl_ctx_remove_session, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_session_timeout", _wrap_ssl_ctx_set_session_timeout, METH_VARARGS, NULL}, { (char *)"ssl_ctx_get_session_timeout", _wrap_ssl_ctx_get_session_timeout, METH_VARARGS, NULL}, { (char *)"ssl_ctx_get_cert_store", _wrap_ssl_ctx_get_cert_store, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_default_verify_paths", _wrap_ssl_ctx_set_default_verify_paths, METH_VARARGS, NULL}, { (char *)"ssl_get_ex_data_x509_store_ctx_idx", _wrap_ssl_get_ex_data_x509_store_ctx_idx, METH_VARARGS, NULL}, { (char *)"bio_new_ssl", _wrap_bio_new_ssl, METH_VARARGS, NULL}, { (char *)"ssl_new", _wrap_ssl_new, METH_VARARGS, NULL}, { (char *)"ssl_free", _wrap_ssl_free, METH_VARARGS, NULL}, { (char *)"ssl_dup", _wrap_ssl_dup, METH_VARARGS, NULL}, { (char *)"ssl_set_bio", _wrap_ssl_set_bio, METH_VARARGS, NULL}, { (char *)"ssl_set_accept_state", _wrap_ssl_set_accept_state, METH_VARARGS, NULL}, { (char *)"ssl_set_connect_state", _wrap_ssl_set_connect_state, METH_VARARGS, NULL}, { (char *)"ssl_get_shutdown", _wrap_ssl_get_shutdown, METH_VARARGS, NULL}, { (char *)"ssl_set_shutdown", _wrap_ssl_set_shutdown, METH_VARARGS, NULL}, { (char *)"ssl_shutdown", _wrap_ssl_shutdown, METH_VARARGS, NULL}, { (char *)"ssl_clear", _wrap_ssl_clear, METH_VARARGS, NULL}, { (char *)"ssl_do_handshake", _wrap_ssl_do_handshake, METH_VARARGS, NULL}, { (char *)"ssl_renegotiate", _wrap_ssl_renegotiate, METH_VARARGS, NULL}, { (char *)"ssl_pending", _wrap_ssl_pending, METH_VARARGS, NULL}, { (char *)"ssl_get_peer_cert", _wrap_ssl_get_peer_cert, METH_VARARGS, NULL}, { (char *)"ssl_get_current_cipher", _wrap_ssl_get_current_cipher, METH_VARARGS, NULL}, { (char *)"ssl_get_verify_mode", _wrap_ssl_get_verify_mode, METH_VARARGS, NULL}, { (char *)"ssl_get_verify_depth", _wrap_ssl_get_verify_depth, METH_VARARGS, NULL}, { (char *)"ssl_get_verify_result", _wrap_ssl_get_verify_result, METH_VARARGS, NULL}, { (char *)"ssl_get_ssl_ctx", _wrap_ssl_get_ssl_ctx, METH_VARARGS, NULL}, { (char *)"ssl_get_default_session_timeout", _wrap_ssl_get_default_session_timeout, METH_VARARGS, NULL}, { (char *)"ssl_set_cipher_list", _wrap_ssl_set_cipher_list, METH_VARARGS, NULL}, { (char *)"ssl_get_cipher_list", _wrap_ssl_get_cipher_list, METH_VARARGS, NULL}, { (char *)"ssl_cipher_get_name", _wrap_ssl_cipher_get_name, METH_VARARGS, NULL}, { (char *)"ssl_cipher_get_version", _wrap_ssl_cipher_get_version, METH_VARARGS, NULL}, { (char *)"ssl_get_session", _wrap_ssl_get_session, METH_VARARGS, NULL}, { (char *)"ssl_get1_session", _wrap_ssl_get1_session, METH_VARARGS, NULL}, { (char *)"ssl_set_session", _wrap_ssl_set_session, METH_VARARGS, NULL}, { (char *)"ssl_session_free", _wrap_ssl_session_free, METH_VARARGS, NULL}, { (char *)"ssl_session_print", _wrap_ssl_session_print, METH_VARARGS, NULL}, { (char *)"ssl_session_set_timeout", _wrap_ssl_session_set_timeout, METH_VARARGS, NULL}, { (char *)"ssl_session_get_timeout", _wrap_ssl_session_get_timeout, METH_VARARGS, NULL}, { (char *)"ssl_accept", _wrap_ssl_accept, METH_VARARGS, NULL}, { (char *)"ssl_connect", _wrap_ssl_connect, METH_VARARGS, NULL}, { (char *)"ssl_read", _wrap_ssl_read, METH_VARARGS, NULL}, { (char *)"ssl_write", _wrap_ssl_write, METH_VARARGS, NULL}, { (char *)"ssl_init", _wrap_ssl_init, METH_VARARGS, NULL}, { (char *)"tlsv1_method", _wrap_tlsv1_method, METH_VARARGS, NULL}, { (char *)"ssl_ctx_passphrase_callback", _wrap_ssl_ctx_passphrase_callback, METH_VARARGS, NULL}, { (char *)"ssl_ctx_use_x509", _wrap_ssl_ctx_use_x509, METH_VARARGS, NULL}, { (char *)"ssl_ctx_use_cert", _wrap_ssl_ctx_use_cert, METH_VARARGS, NULL}, { (char *)"ssl_ctx_use_cert_chain", _wrap_ssl_ctx_use_cert_chain, METH_VARARGS, NULL}, { (char *)"ssl_ctx_use_privkey", _wrap_ssl_ctx_use_privkey, METH_VARARGS, NULL}, { (char *)"ssl_ctx_use_rsa_privkey", _wrap_ssl_ctx_use_rsa_privkey, METH_VARARGS, NULL}, { (char *)"ssl_ctx_use_pkey_privkey", _wrap_ssl_ctx_use_pkey_privkey, METH_VARARGS, NULL}, { (char *)"ssl_ctx_check_privkey", _wrap_ssl_ctx_check_privkey, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_client_CA_list_from_file", _wrap_ssl_ctx_set_client_CA_list_from_file, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_verify_default", _wrap_ssl_ctx_set_verify_default, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_verify", _wrap_ssl_ctx_set_verify, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_session_id_context", _wrap_ssl_ctx_set_session_id_context, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_info_callback", _wrap_ssl_ctx_set_info_callback, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_tmp_dh", _wrap_ssl_ctx_set_tmp_dh, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_tmp_dh_callback", _wrap_ssl_ctx_set_tmp_dh_callback, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_tmp_rsa", _wrap_ssl_ctx_set_tmp_rsa, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_tmp_rsa_callback", _wrap_ssl_ctx_set_tmp_rsa_callback, METH_VARARGS, NULL}, { (char *)"ssl_ctx_load_verify_locations", _wrap_ssl_ctx_load_verify_locations, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_options", _wrap_ssl_ctx_set_options, METH_VARARGS, NULL}, { (char *)"bio_set_ssl", _wrap_bio_set_ssl, METH_VARARGS, NULL}, { (char *)"ssl_set_mode", _wrap_ssl_set_mode, METH_VARARGS, NULL}, { (char *)"ssl_get_mode", _wrap_ssl_get_mode, METH_VARARGS, NULL}, { (char *)"ssl_set_tlsext_host_name", _wrap_ssl_set_tlsext_host_name, METH_VARARGS, NULL}, { (char *)"ssl_set_client_CA_list_from_file", _wrap_ssl_set_client_CA_list_from_file, METH_VARARGS, NULL}, { (char *)"ssl_set_client_CA_list_from_context", _wrap_ssl_set_client_CA_list_from_context, METH_VARARGS, NULL}, { (char *)"ssl_set_session_id_context", _wrap_ssl_set_session_id_context, METH_VARARGS, NULL}, { (char *)"ssl_set_fd", _wrap_ssl_set_fd, METH_VARARGS, NULL}, { (char *)"ssl_set_shutdown1", _wrap_ssl_set_shutdown1, METH_VARARGS, NULL}, { (char *)"ssl_read_nbio", _wrap_ssl_read_nbio, METH_VARARGS, NULL}, { (char *)"ssl_write_nbio", _wrap_ssl_write_nbio, METH_VARARGS, NULL}, { (char *)"ssl_cipher_get_bits", _wrap_ssl_cipher_get_bits, METH_VARARGS, NULL}, { (char *)"sk_ssl_cipher_num", _wrap_sk_ssl_cipher_num, METH_VARARGS, NULL}, { (char *)"sk_ssl_cipher_value", _wrap_sk_ssl_cipher_value, METH_VARARGS, NULL}, { (char *)"ssl_get_peer_cert_chain", _wrap_ssl_get_peer_cert_chain, METH_VARARGS, NULL}, { (char *)"sk_x509_num", _wrap_sk_x509_num, METH_VARARGS, NULL}, { (char *)"sk_x509_value", _wrap_sk_x509_value, METH_VARARGS, NULL}, { (char *)"i2d_ssl_session", _wrap_i2d_ssl_session, METH_VARARGS, NULL}, { (char *)"ssl_session_read_pem", _wrap_ssl_session_read_pem, METH_VARARGS, NULL}, { (char *)"ssl_session_write_pem", _wrap_ssl_session_write_pem, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_session_cache_mode", _wrap_ssl_ctx_set_session_cache_mode, METH_VARARGS, NULL}, { (char *)"ssl_ctx_get_session_cache_mode", _wrap_ssl_ctx_get_session_cache_mode, METH_VARARGS, NULL}, { (char *)"ssl_ctx_set_cache_size", _wrap_ssl_ctx_set_cache_size, METH_VARARGS, NULL}, { (char *)"ssl_is_init_finished", _wrap_ssl_is_init_finished, METH_VARARGS, NULL}, { (char *)"x509_check_ca", _wrap_x509_check_ca, METH_VARARGS, NULL}, { (char *)"x509_new", _wrap_x509_new, METH_VARARGS, NULL}, { (char *)"x509_dup", _wrap_x509_dup, METH_VARARGS, NULL}, { (char *)"x509_free", _wrap_x509_free, METH_VARARGS, NULL}, { (char *)"x509_crl_free", _wrap_x509_crl_free, METH_VARARGS, NULL}, { (char *)"x509_crl_new", _wrap_x509_crl_new, METH_VARARGS, NULL}, { (char *)"x509_print", _wrap_x509_print, METH_VARARGS, NULL}, { (char *)"x509_crl_print", _wrap_x509_crl_print, METH_VARARGS, NULL}, { (char *)"x509_get_serial_number", _wrap_x509_get_serial_number, METH_VARARGS, NULL}, { (char *)"x509_set_serial_number", _wrap_x509_set_serial_number, METH_VARARGS, NULL}, { (char *)"x509_get_pubkey", _wrap_x509_get_pubkey, METH_VARARGS, NULL}, { (char *)"x509_set_pubkey", _wrap_x509_set_pubkey, METH_VARARGS, NULL}, { (char *)"x509_get_issuer_name", _wrap_x509_get_issuer_name, METH_VARARGS, NULL}, { (char *)"x509_set_issuer_name", _wrap_x509_set_issuer_name, METH_VARARGS, NULL}, { (char *)"x509_get_subject_name", _wrap_x509_get_subject_name, METH_VARARGS, NULL}, { (char *)"x509_set_subject_name", _wrap_x509_set_subject_name, METH_VARARGS, NULL}, { (char *)"x509_cmp_current_time", _wrap_x509_cmp_current_time, METH_VARARGS, NULL}, { (char *)"x509_check_purpose", _wrap_x509_check_purpose, METH_VARARGS, NULL}, { (char *)"x509_check_trust", _wrap_x509_check_trust, METH_VARARGS, NULL}, { (char *)"x509_write_pem", _wrap_x509_write_pem, METH_VARARGS, NULL}, { (char *)"x509_write_pem_file", _wrap_x509_write_pem_file, METH_VARARGS, NULL}, { (char *)"x509_verify", _wrap_x509_verify, METH_VARARGS, NULL}, { (char *)"x509_get_verify_error", _wrap_x509_get_verify_error, METH_VARARGS, NULL}, { (char *)"x509_add_ext", _wrap_x509_add_ext, METH_VARARGS, NULL}, { (char *)"x509_get_ext_count", _wrap_x509_get_ext_count, METH_VARARGS, NULL}, { (char *)"x509_get_ext", _wrap_x509_get_ext, METH_VARARGS, NULL}, { (char *)"x509_ext_print", _wrap_x509_ext_print, METH_VARARGS, NULL}, { (char *)"x509_name_new", _wrap_x509_name_new, METH_VARARGS, NULL}, { (char *)"x509_name_free", _wrap_x509_name_free, METH_VARARGS, NULL}, { (char *)"x509_name_print", _wrap_x509_name_print, METH_VARARGS, NULL}, { (char *)"x509_name_get_entry", _wrap_x509_name_get_entry, METH_VARARGS, NULL}, { (char *)"x509_name_entry_count", _wrap_x509_name_entry_count, METH_VARARGS, NULL}, { (char *)"x509_name_delete_entry", _wrap_x509_name_delete_entry, METH_VARARGS, NULL}, { (char *)"x509_name_add_entry", _wrap_x509_name_add_entry, METH_VARARGS, NULL}, { (char *)"x509_name_add_entry_by_obj", _wrap_x509_name_add_entry_by_obj, METH_VARARGS, NULL}, { (char *)"x509_name_add_entry_by_nid", _wrap_x509_name_add_entry_by_nid, METH_VARARGS, NULL}, { (char *)"x509_name_print_ex", _wrap_x509_name_print_ex, METH_VARARGS, NULL}, { (char *)"x509_name_hash", _wrap_x509_name_hash, METH_VARARGS, NULL}, { (char *)"x509_name_get_index_by_nid", _wrap_x509_name_get_index_by_nid, METH_VARARGS, NULL}, { (char *)"x509_name_entry_new", _wrap_x509_name_entry_new, METH_VARARGS, NULL}, { (char *)"x509_name_entry_free", _wrap_x509_name_entry_free, METH_VARARGS, NULL}, { (char *)"x509_name_entry_create_by_nid", _wrap_x509_name_entry_create_by_nid, METH_VARARGS, NULL}, { (char *)"x509_name_entry_set_object", _wrap_x509_name_entry_set_object, METH_VARARGS, NULL}, { (char *)"x509_name_entry_get_object", _wrap_x509_name_entry_get_object, METH_VARARGS, NULL}, { (char *)"x509_name_entry_get_data", _wrap_x509_name_entry_get_data, METH_VARARGS, NULL}, { (char *)"x509_name_entry_set_data", _wrap_x509_name_entry_set_data, METH_VARARGS, NULL}, { (char *)"x509_req_new", _wrap_x509_req_new, METH_VARARGS, NULL}, { (char *)"x509_req_free", _wrap_x509_req_free, METH_VARARGS, NULL}, { (char *)"x509_req_print", _wrap_x509_req_print, METH_VARARGS, NULL}, { (char *)"x509_req_get_pubkey", _wrap_x509_req_get_pubkey, METH_VARARGS, NULL}, { (char *)"x509_req_set_pubkey", _wrap_x509_req_set_pubkey, METH_VARARGS, NULL}, { (char *)"x509_req_set_subject_name", _wrap_x509_req_set_subject_name, METH_VARARGS, NULL}, { (char *)"x509_req_verify", _wrap_x509_req_verify, METH_VARARGS, NULL}, { (char *)"x509_req_sign", _wrap_x509_req_sign, METH_VARARGS, NULL}, { (char *)"i2d_x509_bio", _wrap_i2d_x509_bio, METH_VARARGS, NULL}, { (char *)"i2d_x509_req_bio", _wrap_i2d_x509_req_bio, METH_VARARGS, NULL}, { (char *)"x509_store_new", _wrap_x509_store_new, METH_VARARGS, NULL}, { (char *)"x509_store_free", _wrap_x509_store_free, METH_VARARGS, NULL}, { (char *)"x509_store_add_cert", _wrap_x509_store_add_cert, METH_VARARGS, NULL}, { (char *)"x509_store_ctx_get_current_cert", _wrap_x509_store_ctx_get_current_cert, METH_VARARGS, NULL}, { (char *)"x509_store_ctx_get_error", _wrap_x509_store_ctx_get_error, METH_VARARGS, NULL}, { (char *)"x509_store_ctx_get_error_depth", _wrap_x509_store_ctx_get_error_depth, METH_VARARGS, NULL}, { (char *)"x509_store_ctx_free", _wrap_x509_store_ctx_free, METH_VARARGS, NULL}, { (char *)"x509_store_ctx_get1_chain", _wrap_x509_store_ctx_get1_chain, METH_VARARGS, NULL}, { (char *)"x509_extension_get_critical", _wrap_x509_extension_get_critical, METH_VARARGS, NULL}, { (char *)"x509_extension_set_critical", _wrap_x509_extension_set_critical, METH_VARARGS, NULL}, { (char *)"x509_read_pem", _wrap_x509_read_pem, METH_VARARGS, NULL}, { (char *)"d2i_x509", _wrap_d2i_x509, METH_VARARGS, NULL}, { (char *)"x509_init", _wrap_x509_init, METH_VARARGS, NULL}, { (char *)"d2i_x509_req", _wrap_d2i_x509_req, METH_VARARGS, NULL}, { (char *)"x509_req_read_pem", _wrap_x509_req_read_pem, METH_VARARGS, NULL}, { (char *)"i2d_x509", _wrap_i2d_x509, METH_VARARGS, NULL}, { (char *)"x509_req_write_pem", _wrap_x509_req_write_pem, METH_VARARGS, NULL}, { (char *)"x509_crl_read_pem", _wrap_x509_crl_read_pem, METH_VARARGS, NULL}, { (char *)"x509_set_version", _wrap_x509_set_version, METH_VARARGS, NULL}, { (char *)"x509_get_version", _wrap_x509_get_version, METH_VARARGS, NULL}, { (char *)"x509_set_not_before", _wrap_x509_set_not_before, METH_VARARGS, NULL}, { (char *)"x509_get_not_before", _wrap_x509_get_not_before, METH_VARARGS, NULL}, { (char *)"x509_set_not_after", _wrap_x509_set_not_after, METH_VARARGS, NULL}, { (char *)"x509_get_not_after", _wrap_x509_get_not_after, METH_VARARGS, NULL}, { (char *)"x509_sign", _wrap_x509_sign, METH_VARARGS, NULL}, { (char *)"x509_gmtime_adj", _wrap_x509_gmtime_adj, METH_VARARGS, NULL}, { (char *)"x509_name_by_nid", _wrap_x509_name_by_nid, METH_VARARGS, NULL}, { (char *)"x509_name_set_by_nid", _wrap_x509_name_set_by_nid, METH_VARARGS, NULL}, { (char *)"x509_name_add_entry_by_txt", _wrap_x509_name_add_entry_by_txt, METH_VARARGS, NULL}, { (char *)"x509_name_get_der", _wrap_x509_name_get_der, METH_VARARGS, NULL}, { (char *)"sk_x509_free", _wrap_sk_x509_free, METH_VARARGS, NULL}, { (char *)"sk_x509_push", _wrap_sk_x509_push, METH_VARARGS, NULL}, { (char *)"sk_x509_pop", _wrap_sk_x509_pop, METH_VARARGS, NULL}, { (char *)"x509_store_load_locations", _wrap_x509_store_load_locations, METH_VARARGS, NULL}, { (char *)"x509_type_check", _wrap_x509_type_check, METH_VARARGS, NULL}, { (char *)"x509_name_type_check", _wrap_x509_name_type_check, METH_VARARGS, NULL}, { (char *)"x509_req_get_subject_name", _wrap_x509_req_get_subject_name, METH_VARARGS, NULL}, { (char *)"x509_req_get_version", _wrap_x509_req_get_version, METH_VARARGS, NULL}, { (char *)"x509_req_set_version", _wrap_x509_req_set_version, METH_VARARGS, NULL}, { (char *)"x509_req_add_extensions", _wrap_x509_req_add_extensions, METH_VARARGS, NULL}, { (char *)"x509_name_entry_create_by_txt", _wrap_x509_name_entry_create_by_txt, METH_VARARGS, NULL}, { (char *)"x509v3_set_nconf", _wrap_x509v3_set_nconf, METH_VARARGS, NULL}, { (char *)"x509v3_ext_conf", _wrap_x509v3_ext_conf, METH_VARARGS, NULL}, { (char *)"x509_extension_free", _wrap_x509_extension_free, METH_VARARGS, NULL}, { (char *)"x509_extension_get_name", _wrap_x509_extension_get_name, METH_VARARGS, NULL}, { (char *)"sk_x509_extension_new_null", _wrap_sk_x509_extension_new_null, METH_VARARGS, NULL}, { (char *)"sk_x509_extension_free", _wrap_sk_x509_extension_free, METH_VARARGS, NULL}, { (char *)"sk_x509_extension_push", _wrap_sk_x509_extension_push, METH_VARARGS, NULL}, { (char *)"sk_x509_extension_pop", _wrap_sk_x509_extension_pop, METH_VARARGS, NULL}, { (char *)"sk_x509_extension_num", _wrap_sk_x509_extension_num, METH_VARARGS, NULL}, { (char *)"sk_x509_extension_value", _wrap_sk_x509_extension_value, METH_VARARGS, NULL}, { (char *)"x509_store_ctx_get_app_data", _wrap_x509_store_ctx_get_app_data, METH_VARARGS, NULL}, { (char *)"x509_store_ctx_get_ex_data", _wrap_x509_store_ctx_get_ex_data, METH_VARARGS, NULL}, { (char *)"x509_store_set_verify_cb", _wrap_x509_store_set_verify_cb, METH_VARARGS, NULL}, { (char *)"make_stack_from_der_sequence", _wrap_make_stack_from_der_sequence, METH_VARARGS, NULL}, { (char *)"sk_x509_new_null", _wrap_sk_x509_new_null, METH_VARARGS, NULL}, { (char *)"get_der_encoding_stack", _wrap_get_der_encoding_stack, METH_VARARGS, NULL}, { (char *)"x509_name_oneline", _wrap_x509_name_oneline, METH_VARARGS, NULL}, { (char *)"asn1_object_new", _wrap_asn1_object_new, METH_VARARGS, NULL}, { (char *)"asn1_object_create", _wrap_asn1_object_create, METH_VARARGS, NULL}, { (char *)"asn1_object_free", _wrap_asn1_object_free, METH_VARARGS, NULL}, { (char *)"i2d_asn1_object", _wrap_i2d_asn1_object, METH_VARARGS, NULL}, { (char *)"d2i_asn1_object", _wrap_d2i_asn1_object, METH_VARARGS, NULL}, { (char *)"asn1_bit_string_new", _wrap_asn1_bit_string_new, METH_VARARGS, NULL}, { (char *)"asn1_string_new", _wrap_asn1_string_new, METH_VARARGS, NULL}, { (char *)"asn1_string_free", _wrap_asn1_string_free, METH_VARARGS, NULL}, { (char *)"asn1_string_set", _wrap_asn1_string_set, METH_VARARGS, NULL}, { (char *)"asn1_string_print", _wrap_asn1_string_print, METH_VARARGS, NULL}, { (char *)"asn1_string_print_ex", _wrap_asn1_string_print_ex, METH_VARARGS, NULL}, { (char *)"asn1_time_new", _wrap_asn1_time_new, METH_VARARGS, NULL}, { (char *)"asn1_time_free", _wrap_asn1_time_free, METH_VARARGS, NULL}, { (char *)"asn1_time_check", _wrap_asn1_time_check, METH_VARARGS, NULL}, { (char *)"asn1_time_set", _wrap_asn1_time_set, METH_VARARGS, NULL}, { (char *)"asn1_time_set_string", _wrap_asn1_time_set_string, METH_VARARGS, NULL}, { (char *)"asn1_time_print", _wrap_asn1_time_print, METH_VARARGS, NULL}, { (char *)"asn1_integer_new", _wrap_asn1_integer_new, METH_VARARGS, NULL}, { (char *)"asn1_integer_free", _wrap_asn1_integer_free, METH_VARARGS, NULL}, { (char *)"asn1_integer_cmp", _wrap_asn1_integer_cmp, METH_VARARGS, NULL}, { (char *)"asn1_time_type_check", _wrap_asn1_time_type_check, METH_VARARGS, NULL}, { (char *)"asn1_integer_get", _wrap_asn1_integer_get, METH_VARARGS, NULL}, { (char *)"asn1_integer_set", _wrap_asn1_integer_set, METH_VARARGS, NULL}, { (char *)"pkcs7_new", _wrap_pkcs7_new, METH_VARARGS, NULL}, { (char *)"pkcs7_free", _wrap_pkcs7_free, METH_VARARGS, NULL}, { (char *)"pkcs7_add_certificate", _wrap_pkcs7_add_certificate, METH_VARARGS, NULL}, { (char *)"pkcs7_init", _wrap_pkcs7_init, METH_VARARGS, NULL}, { (char *)"smime_init", _wrap_smime_init, METH_VARARGS, NULL}, { (char *)"pkcs7_decrypt", _wrap_pkcs7_decrypt, METH_VARARGS, NULL}, { (char *)"pkcs7_encrypt", _wrap_pkcs7_encrypt, METH_VARARGS, NULL}, { (char *)"pkcs7_sign1", _wrap_pkcs7_sign1, METH_VARARGS, NULL}, { (char *)"pkcs7_sign0", _wrap_pkcs7_sign0, METH_VARARGS, NULL}, { (char *)"pkcs7_read_bio", _wrap_pkcs7_read_bio, METH_VARARGS, NULL}, { (char *)"pkcs7_read_bio_der", _wrap_pkcs7_read_bio_der, METH_VARARGS, NULL}, { (char *)"pkcs7_verify1", _wrap_pkcs7_verify1, METH_VARARGS, NULL}, { (char *)"pkcs7_verify0", _wrap_pkcs7_verify0, METH_VARARGS, NULL}, { (char *)"smime_write_pkcs7_multi", _wrap_smime_write_pkcs7_multi, METH_VARARGS, NULL}, { (char *)"smime_write_pkcs7", _wrap_smime_write_pkcs7, METH_VARARGS, NULL}, { (char *)"smime_read_pkcs7", _wrap_smime_read_pkcs7, METH_VARARGS, NULL}, { (char *)"pkcs7_write_bio", _wrap_pkcs7_write_bio, METH_VARARGS, NULL}, { (char *)"pkcs7_write_bio_der", _wrap_pkcs7_write_bio_der, METH_VARARGS, NULL}, { (char *)"pkcs7_type_nid", _wrap_pkcs7_type_nid, METH_VARARGS, NULL}, { (char *)"pkcs7_type_sn", _wrap_pkcs7_type_sn, METH_VARARGS, NULL}, { (char *)"smime_crlf_copy", _wrap_smime_crlf_copy, METH_VARARGS, NULL}, { (char *)"pkcs7_get0_signers", _wrap_pkcs7_get0_signers, METH_VARARGS, NULL}, { (char *)"util_init", _wrap_util_init, METH_VARARGS, NULL}, { (char *)"util_hex_to_string", _wrap_util_hex_to_string, METH_VARARGS, NULL}, { (char *)"util_string_to_hex", _wrap_util_string_to_hex, METH_VARARGS, NULL}, { (char *)"ec_key_new", _wrap_ec_key_new, METH_VARARGS, NULL}, { (char *)"ec_key_free", _wrap_ec_key_free, METH_VARARGS, NULL}, { (char *)"ec_key_size", _wrap_ec_key_size, METH_VARARGS, NULL}, { (char *)"ec_key_gen_key", _wrap_ec_key_gen_key, METH_VARARGS, NULL}, { (char *)"ec_key_check_key", _wrap_ec_key_check_key, METH_VARARGS, NULL}, { (char *)"ec_init", _wrap_ec_init, METH_VARARGS, NULL}, { (char *)"ec_get_builtin_curves", _wrap_ec_get_builtin_curves, METH_VARARGS, NULL}, { (char *)"ec_key_new_by_curve_name", _wrap_ec_key_new_by_curve_name, METH_VARARGS, NULL}, { (char *)"ec_key_get_public_der", _wrap_ec_key_get_public_der, METH_VARARGS, NULL}, { (char *)"ec_key_get_public_key", _wrap_ec_key_get_public_key, METH_VARARGS, NULL}, { (char *)"ec_key_read_pubkey", _wrap_ec_key_read_pubkey, METH_VARARGS, NULL}, { (char *)"ec_key_write_pubkey", _wrap_ec_key_write_pubkey, METH_VARARGS, NULL}, { (char *)"ec_key_read_bio", _wrap_ec_key_read_bio, METH_VARARGS, NULL}, { (char *)"ec_key_write_bio", _wrap_ec_key_write_bio, METH_VARARGS, NULL}, { (char *)"ec_key_write_bio_no_cipher", _wrap_ec_key_write_bio_no_cipher, METH_VARARGS, NULL}, { (char *)"ecdsa_sig_get_r", _wrap_ecdsa_sig_get_r, METH_VARARGS, NULL}, { (char *)"ecdsa_sig_get_s", _wrap_ecdsa_sig_get_s, METH_VARARGS, NULL}, { (char *)"ecdsa_sign", _wrap_ecdsa_sign, METH_VARARGS, NULL}, { (char *)"ecdsa_verify", _wrap_ecdsa_verify, METH_VARARGS, NULL}, { (char *)"ecdsa_sign_asn1", _wrap_ecdsa_sign_asn1, METH_VARARGS, NULL}, { (char *)"ecdsa_verify_asn1", _wrap_ecdsa_verify_asn1, METH_VARARGS, NULL}, { (char *)"ecdh_compute_key", _wrap_ecdh_compute_key, METH_VARARGS, NULL}, { (char *)"ec_key_from_pubkey_der", _wrap_ec_key_from_pubkey_der, METH_VARARGS, NULL}, { (char *)"ec_key_from_pubkey_params", _wrap_ec_key_from_pubkey_params, METH_VARARGS, NULL}, { (char *)"ec_key_keylen", _wrap_ec_key_keylen, METH_VARARGS, NULL}, { (char *)"ec_key_type_check", _wrap_ec_key_type_check, METH_VARARGS, NULL}, { (char *)"engine_load_builtin_engines", _wrap_engine_load_builtin_engines, METH_VARARGS, NULL}, { (char *)"engine_load_dynamic", _wrap_engine_load_dynamic, METH_VARARGS, NULL}, { (char *)"engine_load_openssl", _wrap_engine_load_openssl, METH_VARARGS, NULL}, { (char *)"engine_cleanup", _wrap_engine_cleanup, METH_VARARGS, NULL}, { (char *)"engine_new", _wrap_engine_new, METH_VARARGS, NULL}, { (char *)"engine_by_id", _wrap_engine_by_id, METH_VARARGS, NULL}, { (char *)"engine_free", _wrap_engine_free, METH_VARARGS, NULL}, { (char *)"engine_init", _wrap_engine_init, METH_VARARGS, NULL}, { (char *)"engine_finish", _wrap_engine_finish, METH_VARARGS, NULL}, { (char *)"engine_get_id", _wrap_engine_get_id, METH_VARARGS, NULL}, { (char *)"engine_get_name", _wrap_engine_get_name, METH_VARARGS, NULL}, { (char *)"engine_ctrl_cmd_string", _wrap_engine_ctrl_cmd_string, METH_VARARGS, NULL}, { (char *)"ui_openssl", _wrap_ui_openssl, METH_VARARGS, NULL}, { (char *)"engine_pkcs11_data_new", _wrap_engine_pkcs11_data_new, METH_VARARGS, NULL}, { (char *)"engine_pkcs11_data_free", _wrap_engine_pkcs11_data_free, METH_VARARGS, NULL}, { (char *)"engine_load_private_key", _wrap_engine_load_private_key, METH_VARARGS, NULL}, { (char *)"engine_load_public_key", _wrap_engine_load_public_key, METH_VARARGS, NULL}, { (char *)"engine_init_error", _wrap_engine_init_error, METH_VARARGS, NULL}, { (char *)"engine_load_certificate", _wrap_engine_load_certificate, METH_VARARGS, NULL}, { (char *)"engine_set_default", _wrap_engine_set_default, METH_VARARGS, NULL}, { (char *)"obj_nid2obj", _wrap_obj_nid2obj, METH_VARARGS, NULL}, { (char *)"obj_nid2ln", _wrap_obj_nid2ln, METH_VARARGS, NULL}, { (char *)"obj_nid2sn", _wrap_obj_nid2sn, METH_VARARGS, NULL}, { (char *)"obj_obj2nid", _wrap_obj_obj2nid, METH_VARARGS, NULL}, { (char *)"obj_ln2nid", _wrap_obj_ln2nid, METH_VARARGS, NULL}, { (char *)"obj_sn2nid", _wrap_obj_sn2nid, METH_VARARGS, NULL}, { (char *)"obj_txt2nid", _wrap_obj_txt2nid, METH_VARARGS, NULL}, { (char *)"obj_txt2obj", _wrap_obj_txt2obj, METH_VARARGS, NULL}, { (char *)"_obj_obj2txt", _wrap__obj_obj2txt, METH_VARARGS, NULL}, { (char *)"obj_obj2txt", _wrap_obj_obj2txt, METH_VARARGS, NULL}, { NULL, NULL, 0, NULL } }; SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete__STACK) static SwigPyGetSet _STACK_num_alloc_getset = { _wrap__STACK_num_alloc_get, _wrap__STACK_num_alloc_set }; static SwigPyGetSet _STACK_data_getset = { _wrap__STACK_data_get, _wrap__STACK_data_set }; static SwigPyGetSet _STACK_comp_getset = { _wrap__STACK_comp_get, _wrap__STACK_comp_set }; static SwigPyGetSet _STACK_sorted_getset = { _wrap__STACK_sorted_get, _wrap__STACK_sorted_set }; static SwigPyGetSet _STACK_num_getset = { _wrap__STACK_num_get, _wrap__STACK_num_set }; SWIGINTERN PyGetSetDef SwigPyBuiltin__stack_st_getset[] = { { (char*) "num_alloc", (getter) SwigPyBuiltin_GetterClosure, (setter) SwigPyBuiltin_SetterClosure, (char*)"stack_st.num_alloc", (void*) &_STACK_num_alloc_getset } , { (char*) "data", (getter) SwigPyBuiltin_GetterClosure, (setter) SwigPyBuiltin_SetterClosure, (char*)"stack_st.data", (void*) &_STACK_data_getset } , { (char*) "comp", (getter) SwigPyBuiltin_GetterClosure, (setter) SwigPyBuiltin_SetterClosure, (char*)"stack_st.comp", (void*) &_STACK_comp_getset } , { (char*) "sorted", (getter) SwigPyBuiltin_GetterClosure, (setter) SwigPyBuiltin_SetterClosure, (char*)"stack_st.sorted", (void*) &_STACK_sorted_getset } , { (char*) "num", (getter) SwigPyBuiltin_GetterClosure, (setter) SwigPyBuiltin_SetterClosure, (char*)"stack_st.num", (void*) &_STACK_num_getset } , {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; SWIGINTERN PyObject * SwigPyBuiltin__stack_st_richcompare(PyObject *self, PyObject *other, int op) { PyObject *result = NULL; PyObject *tuple = PyTuple_New(1); assert(tuple); PyTuple_SET_ITEM(tuple, 0, other); Py_XINCREF(other); if (!result) { if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) { result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op); } else { result = Py_NotImplemented; Py_INCREF(result); } } Py_DECREF(tuple); return result; } SWIGINTERN PyMethodDef SwigPyBuiltin__stack_st_methods[] = { { NULL, NULL, 0, NULL } /* Sentinel */ }; static PyHeapTypeObject SwigPyBuiltin__stack_st_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif "_STACK", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) _wrap_delete__STACK_closure, /* tp_dealloc */ (printfunc) 0, /* tp_print */ (getattrfunc) 0, /* tp_getattr */ (setattrfunc) 0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 0, /* tp_compare */ #else (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ &SwigPyBuiltin__stack_st_type.as_number, /* tp_as_number */ &SwigPyBuiltin__stack_st_type.as_sequence, /* tp_as_sequence */ &SwigPyBuiltin__stack_st_type.as_mapping, /* tp_as_mapping */ (hashfunc) 0, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ &SwigPyBuiltin__stack_st_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif "::stack_st", /* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ (richcmpfunc) SwigPyBuiltin__stack_st_richcompare, /* feature:python:tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ SwigPyBuiltin__stack_st_methods, /* tp_methods */ 0, /* tp_members */ SwigPyBuiltin__stack_st_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ (size_t)(((char*)&((SwigPyObject *) 64L)->dict) - (char*) 64L), /* tp_dictoffset */ (initproc) _wrap_new__STACK, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ (inquiry) 0, /* tp_is_gc */ (PyObject*) 0, /* tp_bases */ (PyObject*) 0, /* tp_mro */ (PyObject*) 0, /* tp_cache */ (PyObject*) 0, /* tp_subclasses */ (PyObject*) 0, /* tp_weaklist */ (destructor) 0, /* tp_del */ #if PY_VERSION_HEX >= 0x02060000 (int) 0, /* tp_version_tag */ #endif }, { (binaryfunc) 0, /* nb_add */ (binaryfunc) 0, /* nb_subtract */ (binaryfunc) 0, /* nb_multiply */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc) 0, /* nb_divide */ #endif (binaryfunc) 0, /* nb_remainder */ (binaryfunc) 0, /* nb_divmod */ (ternaryfunc) 0, /* nb_power */ (unaryfunc) 0, /* nb_negative */ (unaryfunc) 0, /* nb_positive */ (unaryfunc) 0, /* nb_absolute */ (inquiry) 0, /* nb_nonzero */ (unaryfunc) 0, /* nb_invert */ (binaryfunc) 0, /* nb_lshift */ (binaryfunc) 0, /* nb_rshift */ (binaryfunc) 0, /* nb_and */ (binaryfunc) 0, /* nb_xor */ (binaryfunc) 0, /* nb_or */ #if PY_VERSION_HEX < 0x03000000 (coercion) 0, /* nb_coerce */ #endif (unaryfunc) 0, /* nb_int */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* nb_reserved */ #else (unaryfunc) 0, /* nb_long */ #endif (unaryfunc) 0, /* nb_float */ #if PY_VERSION_HEX < 0x03000000 (unaryfunc) 0, /* nb_oct */ (unaryfunc) 0, /* nb_hex */ #endif (binaryfunc) 0, /* nb_inplace_add */ (binaryfunc) 0, /* nb_inplace_subtract */ (binaryfunc) 0, /* nb_inplace_multiply */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc) 0, /* nb_inplace_divide */ #endif (binaryfunc) 0, /* nb_inplace_remainder */ (ternaryfunc) 0, /* nb_inplace_power */ (binaryfunc) 0, /* nb_inplace_lshift */ (binaryfunc) 0, /* nb_inplace_rshift */ (binaryfunc) 0, /* nb_inplace_and */ (binaryfunc) 0, /* nb_inplace_xor */ (binaryfunc) 0, /* nb_inplace_or */ (binaryfunc) 0, /* nb_floor_divide */ (binaryfunc) 0, /* nb_true_divide */ (binaryfunc) 0, /* nb_inplace_floor_divide */ (binaryfunc) 0, /* nb_inplace_true_divide */ #if PY_VERSION_HEX >= 0x02050000 (unaryfunc) 0, /* nb_index */ #endif }, { (lenfunc) 0, /* mp_length */ (binaryfunc) 0, /* mp_subscript */ (objobjargproc) 0, /* mp_ass_subscript */ }, { (lenfunc) 0, /* sq_length */ (binaryfunc) 0, /* sq_concat */ (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* was_sq_slice */ #else (ssizessizeargfunc) 0, /* sq_slice */ #endif (ssizeobjargproc) 0, /* sq_ass_item */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* was_sq_ass_slice */ #else (ssizessizeobjargproc) 0, /* sq_ass_slice */ #endif (objobjproc) 0, /* sq_contains */ (binaryfunc) 0, /* sq_inplace_concat */ (ssizeargfunc) 0, /* sq_inplace_repeat */ }, { #if PY_VERSION_HEX < 0x03000000 (readbufferproc) 0, /* bf_getreadbuffer */ (writebufferproc) 0, /* bf_getwritebuffer */ (segcountproc) 0, /* bf_getsegcount */ (charbufferproc) 0, /* bf_getcharbuffer */ #endif #if PY_VERSION_HEX >= 0x02060000 (getbufferproc) 0, /* bf_getbuffer */ (releasebufferproc) 0, /* bf_releasebuffer */ #endif }, (PyObject*) 0, /* ht_name */ (PyObject*) 0, /* ht_slots */ }; SWIGINTERN SwigPyClientData SwigPyBuiltin__stack_st_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__stack_st_type}; SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_stack_st_OPENSSL_STRING) static SwigPyGetSet stack_st_OPENSSL_STRING_stack_getset = { _wrap_stack_st_OPENSSL_STRING_stack_get, _wrap_stack_st_OPENSSL_STRING_stack_set }; SWIGINTERN PyGetSetDef SwigPyBuiltin__stack_st_OPENSSL_STRING_getset[] = { { (char*) "stack", (getter) SwigPyBuiltin_GetterClosure, (setter) SwigPyBuiltin_SetterClosure, (char*)"stack_st_OPENSSL_STRING.stack", (void*) &stack_st_OPENSSL_STRING_stack_getset } , {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; SWIGINTERN PyObject * SwigPyBuiltin__stack_st_OPENSSL_STRING_richcompare(PyObject *self, PyObject *other, int op) { PyObject *result = NULL; PyObject *tuple = PyTuple_New(1); assert(tuple); PyTuple_SET_ITEM(tuple, 0, other); Py_XINCREF(other); if (!result) { if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) { result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op); } else { result = Py_NotImplemented; Py_INCREF(result); } } Py_DECREF(tuple); return result; } SWIGINTERN PyMethodDef SwigPyBuiltin__stack_st_OPENSSL_STRING_methods[] = { { NULL, NULL, 0, NULL } /* Sentinel */ }; static PyHeapTypeObject SwigPyBuiltin__stack_st_OPENSSL_STRING_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif "stack_st_OPENSSL_STRING", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) _wrap_delete_stack_st_OPENSSL_STRING_closure, /* tp_dealloc */ (printfunc) 0, /* tp_print */ (getattrfunc) 0, /* tp_getattr */ (setattrfunc) 0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 0, /* tp_compare */ #else (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ &SwigPyBuiltin__stack_st_OPENSSL_STRING_type.as_number, /* tp_as_number */ &SwigPyBuiltin__stack_st_OPENSSL_STRING_type.as_sequence, /* tp_as_sequence */ &SwigPyBuiltin__stack_st_OPENSSL_STRING_type.as_mapping, /* tp_as_mapping */ (hashfunc) 0, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ &SwigPyBuiltin__stack_st_OPENSSL_STRING_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif "::stack_st_OPENSSL_STRING", /* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ (richcmpfunc) SwigPyBuiltin__stack_st_OPENSSL_STRING_richcompare, /* feature:python:tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ SwigPyBuiltin__stack_st_OPENSSL_STRING_methods, /* tp_methods */ 0, /* tp_members */ SwigPyBuiltin__stack_st_OPENSSL_STRING_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ (size_t)(((char*)&((SwigPyObject *) 64L)->dict) - (char*) 64L), /* tp_dictoffset */ (initproc) _wrap_new_stack_st_OPENSSL_STRING, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ (inquiry) 0, /* tp_is_gc */ (PyObject*) 0, /* tp_bases */ (PyObject*) 0, /* tp_mro */ (PyObject*) 0, /* tp_cache */ (PyObject*) 0, /* tp_subclasses */ (PyObject*) 0, /* tp_weaklist */ (destructor) 0, /* tp_del */ #if PY_VERSION_HEX >= 0x02060000 (int) 0, /* tp_version_tag */ #endif }, { (binaryfunc) 0, /* nb_add */ (binaryfunc) 0, /* nb_subtract */ (binaryfunc) 0, /* nb_multiply */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc) 0, /* nb_divide */ #endif (binaryfunc) 0, /* nb_remainder */ (binaryfunc) 0, /* nb_divmod */ (ternaryfunc) 0, /* nb_power */ (unaryfunc) 0, /* nb_negative */ (unaryfunc) 0, /* nb_positive */ (unaryfunc) 0, /* nb_absolute */ (inquiry) 0, /* nb_nonzero */ (unaryfunc) 0, /* nb_invert */ (binaryfunc) 0, /* nb_lshift */ (binaryfunc) 0, /* nb_rshift */ (binaryfunc) 0, /* nb_and */ (binaryfunc) 0, /* nb_xor */ (binaryfunc) 0, /* nb_or */ #if PY_VERSION_HEX < 0x03000000 (coercion) 0, /* nb_coerce */ #endif (unaryfunc) 0, /* nb_int */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* nb_reserved */ #else (unaryfunc) 0, /* nb_long */ #endif (unaryfunc) 0, /* nb_float */ #if PY_VERSION_HEX < 0x03000000 (unaryfunc) 0, /* nb_oct */ (unaryfunc) 0, /* nb_hex */ #endif (binaryfunc) 0, /* nb_inplace_add */ (binaryfunc) 0, /* nb_inplace_subtract */ (binaryfunc) 0, /* nb_inplace_multiply */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc) 0, /* nb_inplace_divide */ #endif (binaryfunc) 0, /* nb_inplace_remainder */ (ternaryfunc) 0, /* nb_inplace_power */ (binaryfunc) 0, /* nb_inplace_lshift */ (binaryfunc) 0, /* nb_inplace_rshift */ (binaryfunc) 0, /* nb_inplace_and */ (binaryfunc) 0, /* nb_inplace_xor */ (binaryfunc) 0, /* nb_inplace_or */ (binaryfunc) 0, /* nb_floor_divide */ (binaryfunc) 0, /* nb_true_divide */ (binaryfunc) 0, /* nb_inplace_floor_divide */ (binaryfunc) 0, /* nb_inplace_true_divide */ #if PY_VERSION_HEX >= 0x02050000 (unaryfunc) 0, /* nb_index */ #endif }, { (lenfunc) 0, /* mp_length */ (binaryfunc) 0, /* mp_subscript */ (objobjargproc) 0, /* mp_ass_subscript */ }, { (lenfunc) 0, /* sq_length */ (binaryfunc) 0, /* sq_concat */ (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* was_sq_slice */ #else (ssizessizeargfunc) 0, /* sq_slice */ #endif (ssizeobjargproc) 0, /* sq_ass_item */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* was_sq_ass_slice */ #else (ssizessizeobjargproc) 0, /* sq_ass_slice */ #endif (objobjproc) 0, /* sq_contains */ (binaryfunc) 0, /* sq_inplace_concat */ (ssizeargfunc) 0, /* sq_inplace_repeat */ }, { #if PY_VERSION_HEX < 0x03000000 (readbufferproc) 0, /* bf_getreadbuffer */ (writebufferproc) 0, /* bf_getwritebuffer */ (segcountproc) 0, /* bf_getsegcount */ (charbufferproc) 0, /* bf_getcharbuffer */ #endif #if PY_VERSION_HEX >= 0x02060000 (getbufferproc) 0, /* bf_getbuffer */ (releasebufferproc) 0, /* bf_releasebuffer */ #endif }, (PyObject*) 0, /* ht_name */ (PyObject*) 0, /* ht_slots */ }; SWIGINTERN SwigPyClientData SwigPyBuiltin__stack_st_OPENSSL_STRING_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__stack_st_OPENSSL_STRING_type}; SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_stack_st_OPENSSL_BLOCK) static SwigPyGetSet stack_st_OPENSSL_BLOCK_stack_getset = { _wrap_stack_st_OPENSSL_BLOCK_stack_get, _wrap_stack_st_OPENSSL_BLOCK_stack_set }; SWIGINTERN PyGetSetDef SwigPyBuiltin__stack_st_OPENSSL_BLOCK_getset[] = { { (char*) "stack", (getter) SwigPyBuiltin_GetterClosure, (setter) SwigPyBuiltin_SetterClosure, (char*)"stack_st_OPENSSL_BLOCK.stack", (void*) &stack_st_OPENSSL_BLOCK_stack_getset } , {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; SWIGINTERN PyObject * SwigPyBuiltin__stack_st_OPENSSL_BLOCK_richcompare(PyObject *self, PyObject *other, int op) { PyObject *result = NULL; PyObject *tuple = PyTuple_New(1); assert(tuple); PyTuple_SET_ITEM(tuple, 0, other); Py_XINCREF(other); if (!result) { if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) { result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op); } else { result = Py_NotImplemented; Py_INCREF(result); } } Py_DECREF(tuple); return result; } SWIGINTERN PyMethodDef SwigPyBuiltin__stack_st_OPENSSL_BLOCK_methods[] = { { NULL, NULL, 0, NULL } /* Sentinel */ }; static PyHeapTypeObject SwigPyBuiltin__stack_st_OPENSSL_BLOCK_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif "stack_st_OPENSSL_BLOCK", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) _wrap_delete_stack_st_OPENSSL_BLOCK_closure, /* tp_dealloc */ (printfunc) 0, /* tp_print */ (getattrfunc) 0, /* tp_getattr */ (setattrfunc) 0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 0, /* tp_compare */ #else (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ &SwigPyBuiltin__stack_st_OPENSSL_BLOCK_type.as_number, /* tp_as_number */ &SwigPyBuiltin__stack_st_OPENSSL_BLOCK_type.as_sequence, /* tp_as_sequence */ &SwigPyBuiltin__stack_st_OPENSSL_BLOCK_type.as_mapping, /* tp_as_mapping */ (hashfunc) 0, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ &SwigPyBuiltin__stack_st_OPENSSL_BLOCK_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif "::stack_st_OPENSSL_BLOCK", /* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ (richcmpfunc) SwigPyBuiltin__stack_st_OPENSSL_BLOCK_richcompare, /* feature:python:tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ SwigPyBuiltin__stack_st_OPENSSL_BLOCK_methods, /* tp_methods */ 0, /* tp_members */ SwigPyBuiltin__stack_st_OPENSSL_BLOCK_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ (size_t)(((char*)&((SwigPyObject *) 64L)->dict) - (char*) 64L), /* tp_dictoffset */ (initproc) _wrap_new_stack_st_OPENSSL_BLOCK, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ (inquiry) 0, /* tp_is_gc */ (PyObject*) 0, /* tp_bases */ (PyObject*) 0, /* tp_mro */ (PyObject*) 0, /* tp_cache */ (PyObject*) 0, /* tp_subclasses */ (PyObject*) 0, /* tp_weaklist */ (destructor) 0, /* tp_del */ #if PY_VERSION_HEX >= 0x02060000 (int) 0, /* tp_version_tag */ #endif }, { (binaryfunc) 0, /* nb_add */ (binaryfunc) 0, /* nb_subtract */ (binaryfunc) 0, /* nb_multiply */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc) 0, /* nb_divide */ #endif (binaryfunc) 0, /* nb_remainder */ (binaryfunc) 0, /* nb_divmod */ (ternaryfunc) 0, /* nb_power */ (unaryfunc) 0, /* nb_negative */ (unaryfunc) 0, /* nb_positive */ (unaryfunc) 0, /* nb_absolute */ (inquiry) 0, /* nb_nonzero */ (unaryfunc) 0, /* nb_invert */ (binaryfunc) 0, /* nb_lshift */ (binaryfunc) 0, /* nb_rshift */ (binaryfunc) 0, /* nb_and */ (binaryfunc) 0, /* nb_xor */ (binaryfunc) 0, /* nb_or */ #if PY_VERSION_HEX < 0x03000000 (coercion) 0, /* nb_coerce */ #endif (unaryfunc) 0, /* nb_int */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* nb_reserved */ #else (unaryfunc) 0, /* nb_long */ #endif (unaryfunc) 0, /* nb_float */ #if PY_VERSION_HEX < 0x03000000 (unaryfunc) 0, /* nb_oct */ (unaryfunc) 0, /* nb_hex */ #endif (binaryfunc) 0, /* nb_inplace_add */ (binaryfunc) 0, /* nb_inplace_subtract */ (binaryfunc) 0, /* nb_inplace_multiply */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc) 0, /* nb_inplace_divide */ #endif (binaryfunc) 0, /* nb_inplace_remainder */ (ternaryfunc) 0, /* nb_inplace_power */ (binaryfunc) 0, /* nb_inplace_lshift */ (binaryfunc) 0, /* nb_inplace_rshift */ (binaryfunc) 0, /* nb_inplace_and */ (binaryfunc) 0, /* nb_inplace_xor */ (binaryfunc) 0, /* nb_inplace_or */ (binaryfunc) 0, /* nb_floor_divide */ (binaryfunc) 0, /* nb_true_divide */ (binaryfunc) 0, /* nb_inplace_floor_divide */ (binaryfunc) 0, /* nb_inplace_true_divide */ #if PY_VERSION_HEX >= 0x02050000 (unaryfunc) 0, /* nb_index */ #endif }, { (lenfunc) 0, /* mp_length */ (binaryfunc) 0, /* mp_subscript */ (objobjargproc) 0, /* mp_ass_subscript */ }, { (lenfunc) 0, /* sq_length */ (binaryfunc) 0, /* sq_concat */ (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* was_sq_slice */ #else (ssizessizeargfunc) 0, /* sq_slice */ #endif (ssizeobjargproc) 0, /* sq_ass_item */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* was_sq_ass_slice */ #else (ssizessizeobjargproc) 0, /* sq_ass_slice */ #endif (objobjproc) 0, /* sq_contains */ (binaryfunc) 0, /* sq_inplace_concat */ (ssizeargfunc) 0, /* sq_inplace_repeat */ }, { #if PY_VERSION_HEX < 0x03000000 (readbufferproc) 0, /* bf_getreadbuffer */ (writebufferproc) 0, /* bf_getwritebuffer */ (segcountproc) 0, /* bf_getsegcount */ (charbufferproc) 0, /* bf_getcharbuffer */ #endif #if PY_VERSION_HEX >= 0x02060000 (getbufferproc) 0, /* bf_getbuffer */ (releasebufferproc) 0, /* bf_releasebuffer */ #endif }, (PyObject*) 0, /* ht_name */ (PyObject*) 0, /* ht_slots */ }; SWIGINTERN SwigPyClientData SwigPyBuiltin__stack_st_OPENSSL_BLOCK_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__stack_st_OPENSSL_BLOCK_type}; SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_BIO_PYFD_CTX) static SwigPyGetSet BIO_PYFD_CTX_fd_getset = { _wrap_BIO_PYFD_CTX_fd_get, _wrap_BIO_PYFD_CTX_fd_set }; SWIGINTERN PyGetSetDef SwigPyBuiltin__pyfd_struct_getset[] = { { (char*) "fd", (getter) SwigPyBuiltin_GetterClosure, (setter) SwigPyBuiltin_SetterClosure, (char*)"pyfd_struct.fd", (void*) &BIO_PYFD_CTX_fd_getset } , {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; SWIGINTERN PyObject * SwigPyBuiltin__pyfd_struct_richcompare(PyObject *self, PyObject *other, int op) { PyObject *result = NULL; PyObject *tuple = PyTuple_New(1); assert(tuple); PyTuple_SET_ITEM(tuple, 0, other); Py_XINCREF(other); if (!result) { if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) { result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op); } else { result = Py_NotImplemented; Py_INCREF(result); } } Py_DECREF(tuple); return result; } SWIGINTERN PyMethodDef SwigPyBuiltin__pyfd_struct_methods[] = { { NULL, NULL, 0, NULL } /* Sentinel */ }; static PyHeapTypeObject SwigPyBuiltin__pyfd_struct_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif "BIO_PYFD_CTX", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) _wrap_delete_BIO_PYFD_CTX_closure, /* tp_dealloc */ (printfunc) 0, /* tp_print */ (getattrfunc) 0, /* tp_getattr */ (setattrfunc) 0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 0, /* tp_compare */ #else (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ &SwigPyBuiltin__pyfd_struct_type.as_number, /* tp_as_number */ &SwigPyBuiltin__pyfd_struct_type.as_sequence, /* tp_as_sequence */ &SwigPyBuiltin__pyfd_struct_type.as_mapping, /* tp_as_mapping */ (hashfunc) 0, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ &SwigPyBuiltin__pyfd_struct_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif "::pyfd_struct", /* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ (richcmpfunc) SwigPyBuiltin__pyfd_struct_richcompare, /* feature:python:tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ SwigPyBuiltin__pyfd_struct_methods, /* tp_methods */ 0, /* tp_members */ SwigPyBuiltin__pyfd_struct_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ (size_t)(((char*)&((SwigPyObject *) 64L)->dict) - (char*) 64L), /* tp_dictoffset */ (initproc) _wrap_new_BIO_PYFD_CTX, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ (inquiry) 0, /* tp_is_gc */ (PyObject*) 0, /* tp_bases */ (PyObject*) 0, /* tp_mro */ (PyObject*) 0, /* tp_cache */ (PyObject*) 0, /* tp_subclasses */ (PyObject*) 0, /* tp_weaklist */ (destructor) 0, /* tp_del */ #if PY_VERSION_HEX >= 0x02060000 (int) 0, /* tp_version_tag */ #endif }, { (binaryfunc) 0, /* nb_add */ (binaryfunc) 0, /* nb_subtract */ (binaryfunc) 0, /* nb_multiply */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc) 0, /* nb_divide */ #endif (binaryfunc) 0, /* nb_remainder */ (binaryfunc) 0, /* nb_divmod */ (ternaryfunc) 0, /* nb_power */ (unaryfunc) 0, /* nb_negative */ (unaryfunc) 0, /* nb_positive */ (unaryfunc) 0, /* nb_absolute */ (inquiry) 0, /* nb_nonzero */ (unaryfunc) 0, /* nb_invert */ (binaryfunc) 0, /* nb_lshift */ (binaryfunc) 0, /* nb_rshift */ (binaryfunc) 0, /* nb_and */ (binaryfunc) 0, /* nb_xor */ (binaryfunc) 0, /* nb_or */ #if PY_VERSION_HEX < 0x03000000 (coercion) 0, /* nb_coerce */ #endif (unaryfunc) 0, /* nb_int */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* nb_reserved */ #else (unaryfunc) 0, /* nb_long */ #endif (unaryfunc) 0, /* nb_float */ #if PY_VERSION_HEX < 0x03000000 (unaryfunc) 0, /* nb_oct */ (unaryfunc) 0, /* nb_hex */ #endif (binaryfunc) 0, /* nb_inplace_add */ (binaryfunc) 0, /* nb_inplace_subtract */ (binaryfunc) 0, /* nb_inplace_multiply */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc) 0, /* nb_inplace_divide */ #endif (binaryfunc) 0, /* nb_inplace_remainder */ (ternaryfunc) 0, /* nb_inplace_power */ (binaryfunc) 0, /* nb_inplace_lshift */ (binaryfunc) 0, /* nb_inplace_rshift */ (binaryfunc) 0, /* nb_inplace_and */ (binaryfunc) 0, /* nb_inplace_xor */ (binaryfunc) 0, /* nb_inplace_or */ (binaryfunc) 0, /* nb_floor_divide */ (binaryfunc) 0, /* nb_true_divide */ (binaryfunc) 0, /* nb_inplace_floor_divide */ (binaryfunc) 0, /* nb_inplace_true_divide */ #if PY_VERSION_HEX >= 0x02050000 (unaryfunc) 0, /* nb_index */ #endif }, { (lenfunc) 0, /* mp_length */ (binaryfunc) 0, /* mp_subscript */ (objobjargproc) 0, /* mp_ass_subscript */ }, { (lenfunc) 0, /* sq_length */ (binaryfunc) 0, /* sq_concat */ (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* was_sq_slice */ #else (ssizessizeargfunc) 0, /* sq_slice */ #endif (ssizeobjargproc) 0, /* sq_ass_item */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* was_sq_ass_slice */ #else (ssizessizeobjargproc) 0, /* sq_ass_slice */ #endif (objobjproc) 0, /* sq_contains */ (binaryfunc) 0, /* sq_inplace_concat */ (ssizeargfunc) 0, /* sq_inplace_repeat */ }, { #if PY_VERSION_HEX < 0x03000000 (readbufferproc) 0, /* bf_getreadbuffer */ (writebufferproc) 0, /* bf_getwritebuffer */ (segcountproc) 0, /* bf_getsegcount */ (charbufferproc) 0, /* bf_getcharbuffer */ #endif #if PY_VERSION_HEX >= 0x02060000 (getbufferproc) 0, /* bf_getbuffer */ (releasebufferproc) 0, /* bf_releasebuffer */ #endif }, (PyObject*) 0, /* ht_name */ (PyObject*) 0, /* ht_slots */ }; SWIGINTERN SwigPyClientData SwigPyBuiltin__pyfd_struct_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__pyfd_struct_type}; SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete__cbd_t) static SwigPyGetSet _cbd_t_password_getset = { _wrap__cbd_t_password_get, _wrap__cbd_t_password_set }; static SwigPyGetSet _cbd_t_prompt_getset = { _wrap__cbd_t_prompt_get, _wrap__cbd_t_prompt_set }; SWIGINTERN PyGetSetDef SwigPyBuiltin___cbd_t_getset[] = { { (char*) "password", (getter) SwigPyBuiltin_GetterClosure, (setter) SwigPyBuiltin_SetterClosure, (char*)"_cbd_t.password", (void*) &_cbd_t_password_getset } , { (char*) "prompt", (getter) SwigPyBuiltin_GetterClosure, (setter) SwigPyBuiltin_SetterClosure, (char*)"_cbd_t.prompt", (void*) &_cbd_t_prompt_getset } , {NULL, NULL, NULL, NULL, NULL} /* Sentinel */ }; SWIGINTERN PyObject * SwigPyBuiltin___cbd_t_richcompare(PyObject *self, PyObject *other, int op) { PyObject *result = NULL; PyObject *tuple = PyTuple_New(1); assert(tuple); PyTuple_SET_ITEM(tuple, 0, other); Py_XINCREF(other); if (!result) { if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) { result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op); } else { result = Py_NotImplemented; Py_INCREF(result); } } Py_DECREF(tuple); return result; } SWIGINTERN PyMethodDef SwigPyBuiltin___cbd_t_methods[] = { { NULL, NULL, 0, NULL } /* Sentinel */ }; static PyHeapTypeObject SwigPyBuiltin___cbd_t_type = { { #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif "_cbd_t", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) _wrap_delete__cbd_t_closure, /* tp_dealloc */ (printfunc) 0, /* tp_print */ (getattrfunc) 0, /* tp_getattr */ (setattrfunc) 0, /* tp_setattr */ #if PY_VERSION_HEX >= 0x03000000 0, /* tp_compare */ #else (cmpfunc) 0, /* tp_compare */ #endif (reprfunc) 0, /* tp_repr */ &SwigPyBuiltin___cbd_t_type.as_number, /* tp_as_number */ &SwigPyBuiltin___cbd_t_type.as_sequence, /* tp_as_sequence */ &SwigPyBuiltin___cbd_t_type.as_mapping, /* tp_as_mapping */ (hashfunc) 0, /* tp_hash */ (ternaryfunc) 0, /* tp_call */ (reprfunc) 0, /* tp_str */ (getattrofunc) 0, /* tp_getattro */ (setattrofunc) 0, /* tp_setattro */ &SwigPyBuiltin___cbd_t_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */ #endif "::_cbd_t", /* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ (richcmpfunc) SwigPyBuiltin___cbd_t_richcompare, /* feature:python:tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ SwigPyBuiltin___cbd_t_methods, /* tp_methods */ 0, /* tp_members */ SwigPyBuiltin___cbd_t_getset, /* tp_getset */ 0, /* tp_base */ 0, /* tp_dict */ (descrgetfunc) 0, /* tp_descr_get */ (descrsetfunc) 0, /* tp_descr_set */ (size_t)(((char*)&((SwigPyObject *) 64L)->dict) - (char*) 64L), /* tp_dictoffset */ (initproc) _wrap_new__cbd_t, /* tp_init */ (allocfunc) 0, /* tp_alloc */ (newfunc) 0, /* tp_new */ (freefunc) 0, /* tp_free */ (inquiry) 0, /* tp_is_gc */ (PyObject*) 0, /* tp_bases */ (PyObject*) 0, /* tp_mro */ (PyObject*) 0, /* tp_cache */ (PyObject*) 0, /* tp_subclasses */ (PyObject*) 0, /* tp_weaklist */ (destructor) 0, /* tp_del */ #if PY_VERSION_HEX >= 0x02060000 (int) 0, /* tp_version_tag */ #endif }, { (binaryfunc) 0, /* nb_add */ (binaryfunc) 0, /* nb_subtract */ (binaryfunc) 0, /* nb_multiply */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc) 0, /* nb_divide */ #endif (binaryfunc) 0, /* nb_remainder */ (binaryfunc) 0, /* nb_divmod */ (ternaryfunc) 0, /* nb_power */ (unaryfunc) 0, /* nb_negative */ (unaryfunc) 0, /* nb_positive */ (unaryfunc) 0, /* nb_absolute */ (inquiry) 0, /* nb_nonzero */ (unaryfunc) 0, /* nb_invert */ (binaryfunc) 0, /* nb_lshift */ (binaryfunc) 0, /* nb_rshift */ (binaryfunc) 0, /* nb_and */ (binaryfunc) 0, /* nb_xor */ (binaryfunc) 0, /* nb_or */ #if PY_VERSION_HEX < 0x03000000 (coercion) 0, /* nb_coerce */ #endif (unaryfunc) 0, /* nb_int */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* nb_reserved */ #else (unaryfunc) 0, /* nb_long */ #endif (unaryfunc) 0, /* nb_float */ #if PY_VERSION_HEX < 0x03000000 (unaryfunc) 0, /* nb_oct */ (unaryfunc) 0, /* nb_hex */ #endif (binaryfunc) 0, /* nb_inplace_add */ (binaryfunc) 0, /* nb_inplace_subtract */ (binaryfunc) 0, /* nb_inplace_multiply */ #if PY_VERSION_HEX < 0x03000000 (binaryfunc) 0, /* nb_inplace_divide */ #endif (binaryfunc) 0, /* nb_inplace_remainder */ (ternaryfunc) 0, /* nb_inplace_power */ (binaryfunc) 0, /* nb_inplace_lshift */ (binaryfunc) 0, /* nb_inplace_rshift */ (binaryfunc) 0, /* nb_inplace_and */ (binaryfunc) 0, /* nb_inplace_xor */ (binaryfunc) 0, /* nb_inplace_or */ (binaryfunc) 0, /* nb_floor_divide */ (binaryfunc) 0, /* nb_true_divide */ (binaryfunc) 0, /* nb_inplace_floor_divide */ (binaryfunc) 0, /* nb_inplace_true_divide */ #if PY_VERSION_HEX >= 0x02050000 (unaryfunc) 0, /* nb_index */ #endif }, { (lenfunc) 0, /* mp_length */ (binaryfunc) 0, /* mp_subscript */ (objobjargproc) 0, /* mp_ass_subscript */ }, { (lenfunc) 0, /* sq_length */ (binaryfunc) 0, /* sq_concat */ (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* was_sq_slice */ #else (ssizessizeargfunc) 0, /* sq_slice */ #endif (ssizeobjargproc) 0, /* sq_ass_item */ #if PY_VERSION_HEX >= 0x03000000 (void*) 0, /* was_sq_ass_slice */ #else (ssizessizeobjargproc) 0, /* sq_ass_slice */ #endif (objobjproc) 0, /* sq_contains */ (binaryfunc) 0, /* sq_inplace_concat */ (ssizeargfunc) 0, /* sq_inplace_repeat */ }, { #if PY_VERSION_HEX < 0x03000000 (readbufferproc) 0, /* bf_getreadbuffer */ (writebufferproc) 0, /* bf_getwritebuffer */ (segcountproc) 0, /* bf_getsegcount */ (charbufferproc) 0, /* bf_getcharbuffer */ #endif #if PY_VERSION_HEX >= 0x02060000 (getbufferproc) 0, /* bf_getbuffer */ (releasebufferproc) 0, /* bf_releasebuffer */ #endif }, (PyObject*) 0, /* ht_name */ (PyObject*) 0, /* ht_slots */ }; SWIGINTERN SwigPyClientData SwigPyBuiltin___cbd_t_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin___cbd_t_type}; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */ static swig_type_info _swigt__p_AES_KEY = {"_p_AES_KEY", "AES_KEY *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ASN1_BIT_STRING = {"_p_ASN1_BIT_STRING", "ASN1_BIT_STRING *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ASN1_INTEGER = {"_p_ASN1_INTEGER", "ASN1_INTEGER *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ASN1_OBJECT = {"_p_ASN1_OBJECT", "ASN1_OBJECT *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ASN1_STRING = {"_p_ASN1_STRING", "ASN1_STRING *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ASN1_TIME = {"_p_ASN1_TIME", "ASN1_TIME *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_BIGNUM = {"_p_BIGNUM", "BIGNUM *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_BIO = {"_p_BIO", "BIO *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_BIO_METHOD = {"_p_BIO_METHOD", "BIO_METHOD *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_DH = {"_p_DH", "DH *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_DSA = {"_p_DSA", "DSA *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ECDSA_SIG = {"_p_ECDSA_SIG", "ECDSA_SIG *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_EC_KEY = {"_p_EC_KEY", "EC_KEY *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_ENGINE = {"_p_ENGINE", "ENGINE *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_EVP_CIPHER = {"_p_EVP_CIPHER", "EVP_CIPHER *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_EVP_CIPHER_CTX = {"_p_EVP_CIPHER_CTX", "EVP_CIPHER_CTX *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_EVP_MD = {"_p_EVP_MD", "EVP_MD *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_EVP_MD_CTX = {"_p_EVP_MD_CTX", "EVP_MD_CTX *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_EVP_PKEY = {"_p_EVP_PKEY", "EVP_PKEY *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_HMAC_CTX = {"_p_HMAC_CTX", "HMAC_CTX *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_PKCS7 = {"_p_PKCS7", "PKCS7 *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_PyObject = {"_p_PyObject", "PyObject *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_RC4_KEY = {"_p_RC4_KEY", "RC4_KEY *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_RSA = {"_p_RSA", "RSA *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_SSL = {"_p_SSL", "SSL *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_SSL_CIPHER = {"_p_SSL_CIPHER", "SSL_CIPHER *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_SSL_CTX = {"_p_SSL_CTX", "SSL_CTX *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_SSL_METHOD = {"_p_SSL_METHOD", "SSL_METHOD *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_SSL_SESSION = {"_p_SSL_SESSION", "SSL_SESSION *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_SwigPyObject = {"_p_SwigPyObject", "SwigPyObject *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_UI_METHOD = {"_p_UI_METHOD", "UI_METHOD *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_X509 = {"_p_X509", "X509 *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_X509V3_CTX = {"_p_X509V3_CTX", "X509V3_CTX *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_X509_CRL = {"_p_X509_CRL", "X509_CRL *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_X509_EXTENSION = {"_p_X509_EXTENSION", "X509_EXTENSION *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_X509_NAME = {"_p_X509_NAME", "X509_NAME *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_X509_NAME_ENTRY = {"_p_X509_NAME_ENTRY", "X509_NAME_ENTRY *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_X509_REQ = {"_p_X509_REQ", "X509_REQ *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_X509_STORE = {"_p_X509_STORE", "X509_STORE *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_X509_STORE_CTX = {"_p_X509_STORE_CTX", "X509_STORE_CTX *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p__cbd_t = {"_p__cbd_t", "_cbd_t *", 0, 0, (void*)&SwigPyBuiltin___cbd_t_clientdata, 0}; static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_f_int_p_X509_STORE_CTX__int = {"_p_f_int_p_X509_STORE_CTX__int", "int (*)(int,X509_STORE_CTX *)", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_f_p_q_const__void_p_q_const__void__int = {"_p_f_p_q_const__void_p_q_const__void__int", "int (*)(void const *,void const *)", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_f_p_void__p_void = {"_p_f_p_void__p_void", "void *(*)(void *)", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_f_p_void__void = {"_p_f_p_void__void", "void (*)(void *)", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_ASN1_OBJECT = {"_p_p_ASN1_OBJECT", "ASN1_OBJECT **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_X509_NAME_ENTRY = {"_p_p_X509_NAME_ENTRY", "X509_NAME_ENTRY **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_char = {"_p_p_char", "char **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_p_unsigned_char = {"_p_p_unsigned_char", "unsigned char **", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_pyfd_struct = {"_p_pyfd_struct", "BIO_PYFD_CTX *|struct pyfd_struct *|pyfd_struct *", 0, 0, (void*)&SwigPyBuiltin__pyfd_struct_clientdata, 0}; static swig_type_info _swigt__p_stack_st = {"_p_stack_st", "struct stack_st *|stack_st *|_STACK *", 0, 0, (void*)&SwigPyBuiltin__stack_st_clientdata, 0}; static swig_type_info _swigt__p_stack_st_OPENSSL_BLOCK = {"_p_stack_st_OPENSSL_BLOCK", "struct stack_st_OPENSSL_BLOCK *|stack_st_OPENSSL_BLOCK *", 0, 0, (void*)&SwigPyBuiltin__stack_st_OPENSSL_BLOCK_clientdata, 0}; static swig_type_info _swigt__p_stack_st_OPENSSL_STRING = {"_p_stack_st_OPENSSL_STRING", "struct stack_st_OPENSSL_STRING *|stack_st_OPENSSL_STRING *", 0, 0, (void*)&SwigPyBuiltin__stack_st_OPENSSL_STRING_clientdata, 0}; static swig_type_info _swigt__p_stack_st_SSL_CIPHER = {"_p_stack_st_SSL_CIPHER", "struct stack_st_SSL_CIPHER *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_stack_st_X509 = {"_p_stack_st_X509", "struct stack_st_X509 *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_stack_st_X509_EXTENSION = {"_p_stack_st_X509_EXTENSION", "struct stack_st_X509_EXTENSION *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0}; static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0}; static swig_type_info *swig_type_initial[] = { &_swigt__p_AES_KEY, &_swigt__p_ASN1_BIT_STRING, &_swigt__p_ASN1_INTEGER, &_swigt__p_ASN1_OBJECT, &_swigt__p_ASN1_STRING, &_swigt__p_ASN1_TIME, &_swigt__p_BIGNUM, &_swigt__p_BIO, &_swigt__p_BIO_METHOD, &_swigt__p_DH, &_swigt__p_DSA, &_swigt__p_ECDSA_SIG, &_swigt__p_EC_KEY, &_swigt__p_ENGINE, &_swigt__p_EVP_CIPHER, &_swigt__p_EVP_CIPHER_CTX, &_swigt__p_EVP_MD, &_swigt__p_EVP_MD_CTX, &_swigt__p_EVP_PKEY, &_swigt__p_FILE, &_swigt__p_HMAC_CTX, &_swigt__p_PKCS7, &_swigt__p_PyObject, &_swigt__p_RC4_KEY, &_swigt__p_RSA, &_swigt__p_SSL, &_swigt__p_SSL_CIPHER, &_swigt__p_SSL_CTX, &_swigt__p_SSL_METHOD, &_swigt__p_SSL_SESSION, &_swigt__p_SwigPyObject, &_swigt__p_UI_METHOD, &_swigt__p_X509, &_swigt__p_X509V3_CTX, &_swigt__p_X509_CRL, &_swigt__p_X509_EXTENSION, &_swigt__p_X509_NAME, &_swigt__p_X509_NAME_ENTRY, &_swigt__p_X509_REQ, &_swigt__p_X509_STORE, &_swigt__p_X509_STORE_CTX, &_swigt__p__cbd_t, &_swigt__p_char, &_swigt__p_f_int_p_X509_STORE_CTX__int, &_swigt__p_f_p_q_const__void_p_q_const__void__int, &_swigt__p_f_p_void__p_void, &_swigt__p_f_p_void__void, &_swigt__p_p_ASN1_OBJECT, &_swigt__p_p_X509_NAME_ENTRY, &_swigt__p_p_char, &_swigt__p_p_unsigned_char, &_swigt__p_pyfd_struct, &_swigt__p_stack_st, &_swigt__p_stack_st_OPENSSL_BLOCK, &_swigt__p_stack_st_OPENSSL_STRING, &_swigt__p_stack_st_SSL_CIPHER, &_swigt__p_stack_st_X509, &_swigt__p_stack_st_X509_EXTENSION, &_swigt__p_unsigned_char, &_swigt__p_void, }; static swig_cast_info _swigc__p_AES_KEY[] = { {&_swigt__p_AES_KEY, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ASN1_BIT_STRING[] = { {&_swigt__p_ASN1_BIT_STRING, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ASN1_INTEGER[] = { {&_swigt__p_ASN1_INTEGER, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ASN1_OBJECT[] = { {&_swigt__p_ASN1_OBJECT, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ASN1_STRING[] = { {&_swigt__p_ASN1_STRING, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ASN1_TIME[] = { {&_swigt__p_ASN1_TIME, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_BIGNUM[] = { {&_swigt__p_BIGNUM, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_BIO[] = { {&_swigt__p_BIO, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_BIO_METHOD[] = { {&_swigt__p_BIO_METHOD, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DH[] = { {&_swigt__p_DH, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_DSA[] = { {&_swigt__p_DSA, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ECDSA_SIG[] = { {&_swigt__p_ECDSA_SIG, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_EC_KEY[] = { {&_swigt__p_EC_KEY, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_ENGINE[] = { {&_swigt__p_ENGINE, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_EVP_CIPHER[] = { {&_swigt__p_EVP_CIPHER, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_EVP_CIPHER_CTX[] = { {&_swigt__p_EVP_CIPHER_CTX, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_EVP_MD[] = { {&_swigt__p_EVP_MD, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_EVP_MD_CTX[] = { {&_swigt__p_EVP_MD_CTX, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_EVP_PKEY[] = { {&_swigt__p_EVP_PKEY, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_FILE[] = { {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_HMAC_CTX[] = { {&_swigt__p_HMAC_CTX, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_PKCS7[] = { {&_swigt__p_PKCS7, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_PyObject[] = { {&_swigt__p_PyObject, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_RC4_KEY[] = { {&_swigt__p_RC4_KEY, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_RSA[] = { {&_swigt__p_RSA, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SSL[] = { {&_swigt__p_SSL, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SSL_CIPHER[] = { {&_swigt__p_SSL_CIPHER, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SSL_CTX[] = { {&_swigt__p_SSL_CTX, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SSL_METHOD[] = { {&_swigt__p_SSL_METHOD, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SSL_SESSION[] = { {&_swigt__p_SSL_SESSION, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_SwigPyObject[] = { {&_swigt__p_SwigPyObject, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_UI_METHOD[] = { {&_swigt__p_UI_METHOD, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_X509[] = { {&_swigt__p_X509, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_X509V3_CTX[] = { {&_swigt__p_X509V3_CTX, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_X509_CRL[] = { {&_swigt__p_X509_CRL, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_X509_EXTENSION[] = { {&_swigt__p_X509_EXTENSION, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_X509_NAME[] = { {&_swigt__p_X509_NAME, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_X509_NAME_ENTRY[] = { {&_swigt__p_X509_NAME_ENTRY, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_X509_REQ[] = { {&_swigt__p_X509_REQ, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_X509_STORE[] = { {&_swigt__p_X509_STORE, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_X509_STORE_CTX[] = { {&_swigt__p_X509_STORE_CTX, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p__cbd_t[] = { {&_swigt__p__cbd_t, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_char[] = { {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_f_int_p_X509_STORE_CTX__int[] = { {&_swigt__p_f_int_p_X509_STORE_CTX__int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_f_p_q_const__void_p_q_const__void__int[] = { {&_swigt__p_f_p_q_const__void_p_q_const__void__int, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_f_p_void__p_void[] = { {&_swigt__p_f_p_void__p_void, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_f_p_void__void[] = { {&_swigt__p_f_p_void__void, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_ASN1_OBJECT[] = { {&_swigt__p_p_ASN1_OBJECT, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_X509_NAME_ENTRY[] = { {&_swigt__p_p_X509_NAME_ENTRY, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_char[] = { {&_swigt__p_p_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_p_unsigned_char[] = { {&_swigt__p_p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_pyfd_struct[] = { {&_swigt__p_pyfd_struct, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_stack_st[] = { {&_swigt__p_stack_st, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_stack_st_OPENSSL_BLOCK[] = { {&_swigt__p_stack_st_OPENSSL_BLOCK, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_stack_st_OPENSSL_STRING[] = { {&_swigt__p_stack_st_OPENSSL_STRING, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_stack_st_SSL_CIPHER[] = { {&_swigt__p_stack_st_SSL_CIPHER, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_stack_st_X509[] = { {&_swigt__p_stack_st_X509, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_stack_st_X509_EXTENSION[] = { {&_swigt__p_stack_st_X509_EXTENSION, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_unsigned_char[] = { {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info _swigc__p_void[] = { {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}}; static swig_cast_info *swig_cast_initial[] = { _swigc__p_AES_KEY, _swigc__p_ASN1_BIT_STRING, _swigc__p_ASN1_INTEGER, _swigc__p_ASN1_OBJECT, _swigc__p_ASN1_STRING, _swigc__p_ASN1_TIME, _swigc__p_BIGNUM, _swigc__p_BIO, _swigc__p_BIO_METHOD, _swigc__p_DH, _swigc__p_DSA, _swigc__p_ECDSA_SIG, _swigc__p_EC_KEY, _swigc__p_ENGINE, _swigc__p_EVP_CIPHER, _swigc__p_EVP_CIPHER_CTX, _swigc__p_EVP_MD, _swigc__p_EVP_MD_CTX, _swigc__p_EVP_PKEY, _swigc__p_FILE, _swigc__p_HMAC_CTX, _swigc__p_PKCS7, _swigc__p_PyObject, _swigc__p_RC4_KEY, _swigc__p_RSA, _swigc__p_SSL, _swigc__p_SSL_CIPHER, _swigc__p_SSL_CTX, _swigc__p_SSL_METHOD, _swigc__p_SSL_SESSION, _swigc__p_SwigPyObject, _swigc__p_UI_METHOD, _swigc__p_X509, _swigc__p_X509V3_CTX, _swigc__p_X509_CRL, _swigc__p_X509_EXTENSION, _swigc__p_X509_NAME, _swigc__p_X509_NAME_ENTRY, _swigc__p_X509_REQ, _swigc__p_X509_STORE, _swigc__p_X509_STORE_CTX, _swigc__p__cbd_t, _swigc__p_char, _swigc__p_f_int_p_X509_STORE_CTX__int, _swigc__p_f_p_q_const__void_p_q_const__void__int, _swigc__p_f_p_void__p_void, _swigc__p_f_p_void__void, _swigc__p_p_ASN1_OBJECT, _swigc__p_p_X509_NAME_ENTRY, _swigc__p_p_char, _swigc__p_p_unsigned_char, _swigc__p_pyfd_struct, _swigc__p_stack_st, _swigc__p_stack_st_OPENSSL_BLOCK, _swigc__p_stack_st_OPENSSL_STRING, _swigc__p_stack_st_SSL_CIPHER, _swigc__p_stack_st_X509, _swigc__p_stack_st_X509_EXTENSION, _swigc__p_unsigned_char, _swigc__p_void, }; /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */ static swig_const_info swig_const_table[] = { {0, 0, 0, 0.0, 0, 0}}; #ifdef __cplusplus } #endif static PyTypeObject *builtin_bases[2]; /* ----------------------------------------------------------------------------- * Type initialization: * This problem is tough by the requirement that no dynamic * memory is used. Also, since swig_type_info structures store pointers to * swig_cast_info structures and swig_cast_info structures store pointers back * to swig_type_info structures, we need some lookup code at initialization. * The idea is that swig generates all the structures that are needed. * The runtime then collects these partially filled structures. * The SWIG_InitializeModule function takes these initial arrays out of * swig_module, and does all the lookup, filling in the swig_module.types * array with the correct data and linking the correct swig_cast_info * structures together. * * The generated swig_type_info structures are assigned staticly to an initial * array. We just loop through that array, and handle each type individually. * First we lookup if this type has been already loaded, and if so, use the * loaded structure instead of the generated one. Then we have to fill in the * cast linked list. The cast data is initially stored in something like a * two-dimensional array. Each row corresponds to a type (there are the same * number of rows as there are in the swig_type_initial array). Each entry in * a column is one of the swig_cast_info structures for that type. * The cast_initial array is actually an array of arrays, because each row has * a variable number of columns. So to actually build the cast linked list, * we find the array of casts associated with the type, and loop through it * adding the casts to the list. The one last trick we need to do is making * sure the type pointer in the swig_cast_info struct is correct. * * First off, we lookup the cast->type name to see if it is already loaded. * There are three cases to handle: * 1) If the cast->type has already been loaded AND the type we are adding * casting info to has not been loaded (it is in this module), THEN we * replace the cast->type pointer with the type pointer that has already * been loaded. * 2) If BOTH types (the one we are adding casting info to, and the * cast->type) are loaded, THEN the cast info has already been loaded by * the previous module so we just ignore it. * 3) Finally, if cast->type has not already been loaded, then we add that * swig_cast_info to the linked list (because the cast->type) pointer will * be correct. * ----------------------------------------------------------------------------- */ #ifdef __cplusplus extern "C" { #if 0 } /* c-mode */ #endif #endif #if 0 #define SWIGRUNTIME_DEBUG #endif SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; int found, init; /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { /* Initialize the swig_module */ swig_module.type_initial = swig_type_initial; swig_module.cast_initial = swig_cast_initial; swig_module.next = &swig_module; init = 1; } else { init = 0; } /* Try and load any already created modules */ module_head = SWIG_GetModule(clientdata); if (!module_head) { /* This is the first module loaded for this interpreter */ /* so set the swig module into the interpreter */ SWIG_SetModule(clientdata, &swig_module); module_head = &swig_module; } else { /* the interpreter has loaded a SWIG module, but has it loaded this one? */ found=0; iter=module_head; do { if (iter==&swig_module) { found=1; break; } iter=iter->next; } while (iter!= module_head); /* if the is found in the list, then all is done and we may leave */ if (found) return; /* otherwise we must add out module into the list */ swig_module.next = module_head->next; module_head->next = &swig_module; } /* When multiple interpeters are used, a module could have already been initialized in a different interpreter, but not yet have a pointer in this interpreter. In this case, we do not want to continue adding types... everything should be set up already */ if (init == 0) return; /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: size %d\n", swig_module.size); #endif for (i = 0; i < swig_module.size; ++i) { swig_type_info *type = 0; swig_type_info *ret; swig_cast_info *cast; #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); #endif /* if there is another module already loaded */ if (swig_module.next != &swig_module) { type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name); } if (type) { /* Overwrite clientdata field */ #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: found type %s\n", type->name); #endif if (swig_module.type_initial[i]->clientdata) { type->clientdata = swig_module.type_initial[i]->clientdata; #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name); #endif } } else { type = swig_module.type_initial[i]; } /* Insert casting types */ cast = swig_module.cast_initial[i]; while (cast->type) { /* Don't need to add information already in the list */ ret = 0; #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: look cast %s\n", cast->type->name); #endif if (swig_module.next != &swig_module) { ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name); #ifdef SWIGRUNTIME_DEBUG if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name); #endif } if (ret) { if (type == swig_module.type_initial[i]) { #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: skip old type %s\n", ret->name); #endif cast->type = ret; ret = 0; } else { /* Check for casting already in the list */ swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type); #ifdef SWIGRUNTIME_DEBUG if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name); #endif if (!ocast) ret = 0; } } if (!ret) { #ifdef SWIGRUNTIME_DEBUG printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name); #endif if (type->cast) { type->cast->prev = cast; cast->next = type->cast; } type->cast = cast; } cast++; } /* Set entry in modules->types array equal to the type */ swig_module.types[i] = type; } swig_module.types[i] = 0; #ifdef SWIGRUNTIME_DEBUG printf("**** SWIG_InitializeModule: Cast List ******\n"); for (i = 0; i < swig_module.size; ++i) { int j = 0; swig_cast_info *cast = swig_module.cast_initial[i]; printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); while (cast->type) { printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); cast++; ++j; } printf("---- Total casts: %d\n",j); } printf("**** SWIG_InitializeModule: Cast List ******\n"); #endif } /* This function will propagate the clientdata field of type to * any new swig_type_info structures that have been added into the list * of equivalent types. It is like calling * SWIG_TypeClientData(type, clientdata) a second time. */ SWIGRUNTIME void SWIG_PropagateClientData(void) { size_t i; swig_cast_info *equiv; static int init_run = 0; if (init_run) return; init_run = 1; for (i = 0; i < swig_module.size; i++) { if (swig_module.types[i]->clientdata) { equiv = swig_module.types[i]->cast; while (equiv) { if (!equiv->converter) { if (equiv->type && !equiv->type->clientdata) SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata); } equiv = equiv->next; } } } } #ifdef __cplusplus #if 0 { /* c-mode */ #endif } #endif #ifdef __cplusplus extern "C" { #endif /* Python-specific SWIG API */ #define SWIG_newvarlink() SWIG_Python_newvarlink() #define SWIG_addvarlink(p, name, get_attr, set_attr) SWIG_Python_addvarlink(p, name, get_attr, set_attr) #define SWIG_InstallConstants(d, constants) SWIG_Python_InstallConstants(d, constants) /* ----------------------------------------------------------------------------- * global variable support code. * ----------------------------------------------------------------------------- */ typedef struct swig_globalvar { char *name; /* Name of global variable */ PyObject *(*get_attr)(void); /* Return the current value */ int (*set_attr)(PyObject *); /* Set the value */ struct swig_globalvar *next; } swig_globalvar; typedef struct swig_varlinkobject { PyObject_HEAD swig_globalvar *vars; } swig_varlinkobject; SWIGINTERN PyObject * swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) { #if PY_VERSION_HEX >= 0x03000000 return PyUnicode_InternFromString(""); #else return PyString_FromString(""); #endif } SWIGINTERN PyObject * swig_varlink_str(swig_varlinkobject *v) { #if PY_VERSION_HEX >= 0x03000000 PyObject *str = PyUnicode_InternFromString("("); PyObject *tail; PyObject *joined; swig_globalvar *var; for (var = v->vars; var; var=var->next) { tail = PyUnicode_FromString(var->name); joined = PyUnicode_Concat(str, tail); Py_DecRef(str); Py_DecRef(tail); str = joined; if (var->next) { tail = PyUnicode_InternFromString(", "); joined = PyUnicode_Concat(str, tail); Py_DecRef(str); Py_DecRef(tail); str = joined; } } tail = PyUnicode_InternFromString(")"); joined = PyUnicode_Concat(str, tail); Py_DecRef(str); Py_DecRef(tail); str = joined; #else PyObject *str = PyString_FromString("("); swig_globalvar *var; for (var = v->vars; var; var=var->next) { PyString_ConcatAndDel(&str,PyString_FromString(var->name)); if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", ")); } PyString_ConcatAndDel(&str,PyString_FromString(")")); #endif return str; } SWIGINTERN int swig_varlink_print(swig_varlinkobject *v, FILE *fp, int SWIGUNUSEDPARM(flags)) { char *tmp; PyObject *str = swig_varlink_str(v); fprintf(fp,"Swig global variables "); fprintf(fp,"%s\n", tmp = SWIG_Python_str_AsChar(str)); SWIG_Python_str_DelForPy3(tmp); Py_DECREF(str); return 0; } SWIGINTERN void swig_varlink_dealloc(swig_varlinkobject *v) { swig_globalvar *var = v->vars; while (var) { swig_globalvar *n = var->next; free(var->name); free(var); var = n; } } SWIGINTERN PyObject * swig_varlink_getattr(swig_varlinkobject *v, char *n) { PyObject *res = NULL; swig_globalvar *var = v->vars; while (var) { if (strcmp(var->name,n) == 0) { res = (*var->get_attr)(); break; } var = var->next; } if (res == NULL && !PyErr_Occurred()) { PyErr_SetString(PyExc_NameError,"Unknown C global variable"); } return res; } SWIGINTERN int swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) { int res = 1; swig_globalvar *var = v->vars; while (var) { if (strcmp(var->name,n) == 0) { res = (*var->set_attr)(p); break; } var = var->next; } if (res == 1 && !PyErr_Occurred()) { PyErr_SetString(PyExc_NameError,"Unknown C global variable"); } return res; } SWIGINTERN PyTypeObject* swig_varlink_type(void) { static char varlink__doc__[] = "Swig var link object"; static PyTypeObject varlink_type; static int type_init = 0; if (!type_init) { const PyTypeObject tmp = { /* PyObject header changed in Python 3 */ #if PY_VERSION_HEX >= 0x03000000 PyVarObject_HEAD_INIT(NULL, 0) #else PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif (char *)"swigvarlink", /* tp_name */ sizeof(swig_varlinkobject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) swig_varlink_dealloc, /* tp_dealloc */ (printfunc) swig_varlink_print, /* tp_print */ (getattrfunc) swig_varlink_getattr, /* tp_getattr */ (setattrfunc) swig_varlink_setattr, /* tp_setattr */ 0, /* tp_compare */ (reprfunc) swig_varlink_repr, /* tp_repr */ 0, /* tp_as_number */ 0, /* tp_as_sequence */ 0, /* tp_as_mapping */ 0, /* tp_hash */ 0, /* tp_call */ (reprfunc) swig_varlink_str, /* tp_str */ 0, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ 0, /* tp_flags */ varlink__doc__, /* tp_doc */ 0, /* tp_traverse */ 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ #if PY_VERSION_HEX >= 0x02020000 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */ #endif #if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ #endif #if PY_VERSION_HEX >= 0x02060000 0, /* tp_version */ #endif #ifdef COUNT_ALLOCS 0,0,0,0 /* tp_alloc -> tp_next */ #endif }; varlink_type = tmp; type_init = 1; #if PY_VERSION_HEX < 0x02020000 varlink_type.ob_type = &PyType_Type; #else if (PyType_Ready(&varlink_type) < 0) return NULL; #endif } return &varlink_type; } /* Create a variable linking object for use later */ SWIGINTERN PyObject * SWIG_Python_newvarlink(void) { swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type()); if (result) { result->vars = 0; } return ((PyObject*) result); } SWIGINTERN void SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { swig_varlinkobject *v = (swig_varlinkobject *) p; swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar)); if (gv) { size_t size = strlen(name)+1; gv->name = (char *)malloc(size); if (gv->name) { strncpy(gv->name,name,size); gv->get_attr = get_attr; gv->set_attr = set_attr; gv->next = v->vars; } } v->vars = gv; } SWIGINTERN PyObject * SWIG_globals(void) { static PyObject *_SWIG_globals = 0; if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); return _SWIG_globals; } /* ----------------------------------------------------------------------------- * constants/methods manipulation * ----------------------------------------------------------------------------- */ /* Install Constants */ SWIGINTERN void SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) { PyObject *obj = 0; size_t i; for (i = 0; constants[i].type; ++i) { switch(constants[i].type) { case SWIG_PY_POINTER: obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0); break; case SWIG_PY_BINARY: obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype)); break; default: obj = 0; break; } if (obj) { PyDict_SetItemString(d, constants[i].name, obj); Py_DECREF(obj); } } } /* -----------------------------------------------------------------------------*/ /* Fix SwigMethods to carry the callback ptrs when needed */ /* -----------------------------------------------------------------------------*/ SWIGINTERN void SWIG_Python_FixMethods(PyMethodDef *methods, swig_const_info *const_table, swig_type_info **types, swig_type_info **types_initial) { size_t i; for (i = 0; methods[i].ml_name; ++i) { const char *c = methods[i].ml_doc; if (c && (c = strstr(c, "swig_ptr: "))) { int j; swig_const_info *ci = 0; const char *name = c + 10; for (j = 0; const_table[j].type; ++j) { if (strncmp(const_table[j].name, name, strlen(const_table[j].name)) == 0) { ci = &(const_table[j]); break; } } if (ci) { void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0; if (ptr) { size_t shift = (ci->ptype) - types; swig_type_info *ty = types_initial[shift]; size_t ldoc = (c - methods[i].ml_doc); size_t lptr = strlen(ty->name)+2*sizeof(void*)+2; char *ndoc = (char*)malloc(ldoc + lptr + 10); if (ndoc) { char *buff = ndoc; strncpy(buff, methods[i].ml_doc, ldoc); buff += ldoc; strncpy(buff, "swig_ptr: ", 10); buff += 10; SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); methods[i].ml_doc = ndoc; } } } } } } #ifdef __cplusplus } #endif /* -----------------------------------------------------------------------------* * Partial Init method * -----------------------------------------------------------------------------*/ #ifdef __cplusplus extern "C" #endif SWIGEXPORT #if PY_VERSION_HEX >= 0x03000000 PyObject* #else void #endif SWIG_init(void) { PyObject *m, *d, *md; #if PY_VERSION_HEX >= 0x03000000 static struct PyModuleDef SWIG_module = { # if PY_VERSION_HEX >= 0x03020000 PyModuleDef_HEAD_INIT, # else { PyObject_HEAD_INIT(NULL) NULL, /* m_init */ 0, /* m_index */ NULL, /* m_copy */ }, # endif (char *) SWIG_name, NULL, -1, SwigMethods, NULL, NULL, NULL, NULL }; #endif #if defined(SWIGPYTHON_BUILTIN) static SwigPyClientData SwigPyObject_clientdata = { 0, 0, 0, 0, 0, 0, 0 }; static PyGetSetDef this_getset_def = { (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL }; static SwigPyGetSet thisown_getset_closure = { (PyCFunction) SwigPyObject_own, (PyCFunction) SwigPyObject_own }; static PyGetSetDef thisown_getset_def = { (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure }; PyObject *metatype_args; PyTypeObject *builtin_pytype; int builtin_base_count; swig_type_info *builtin_basetype; PyObject *tuple; PyGetSetDescrObject *static_getset; PyTypeObject *metatype; SwigPyClientData *cd; PyObject *public_interface, *public_symbol; PyObject *this_descr; PyObject *thisown_descr; int i; (void)builtin_pytype; (void)builtin_base_count; (void)builtin_basetype; (void)tuple; (void)static_getset; /* metatype is used to implement static member variables. */ metatype_args = Py_BuildValue("(s(O){})", "SwigPyObjectType", &PyType_Type); assert(metatype_args); metatype = (PyTypeObject *) PyType_Type.tp_call((PyObject *) &PyType_Type, metatype_args, NULL); assert(metatype); Py_DECREF(metatype_args); metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro; assert(PyType_Ready(metatype) >= 0); #endif /* Fix SwigMethods to carry the callback ptrs when needed */ SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial); #if PY_VERSION_HEX >= 0x03000000 m = PyModule_Create(&SWIG_module); #else m = Py_InitModule((char *) SWIG_name, SwigMethods); #endif md = d = PyModule_GetDict(m); (void)md; SWIG_InitializeModule(0); #ifdef SWIGPYTHON_BUILTIN SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject"); assert(SwigPyObject_stype); cd = (SwigPyClientData*) SwigPyObject_stype->clientdata; if (!cd) { SwigPyObject_stype->clientdata = &SwigPyObject_clientdata; SwigPyObject_clientdata.pytype = SwigPyObject_TypeOnce(); } else if (SwigPyObject_TypeOnce()->tp_basicsize != cd->pytype->tp_basicsize) { PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules."); # if PY_VERSION_HEX >= 0x03000000 return NULL; # else return; # endif } /* All objects have a 'this' attribute */ this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def); (void)this_descr; /* All objects have a 'thisown' attribute */ thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def); (void)thisown_descr; public_interface = PyList_New(0); public_symbol = 0; (void)public_symbol; PyDict_SetItemString(md, "__all__", public_interface); Py_DECREF(public_interface); for (i = 0; SwigMethods[i].ml_name != NULL; ++i) SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name); for (i = 0; swig_const_table[i].name != 0; ++i) SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name); #endif SWIG_InstallConstants(d,swig_const_table); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_VERSION_NUMBER",SWIG_From_long((long)(0x100020bfL))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_VERSION_TEXT",SWIG_FromCharPtr("OpenSSL 1.0.2k 26 Jan 2017")); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_VERSION_PTEXT",SWIG_FromCharPtr(" part of OpenSSL 1.0.2k 26 Jan 2017")); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SHLIB_VERSION_HISTORY",SWIG_FromCharPtr("")); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SHLIB_VERSION_NUMBER",SWIG_FromCharPtr("1.0.2k")); /* type '::stack_st' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__stack_st_type; builtin_pytype->tp_dict = d = PyDict_New(); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; builtin_base_count = 0; builtin_bases[builtin_base_count] = NULL; SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases); PyDict_SetItemString(d, "this", this_descr); PyDict_SetItemString(d, "thisown", thisown_descr); if (PyType_Ready(builtin_pytype) < 0) { PyErr_SetString(PyExc_TypeError, "Could not create type '_STACK'."); #if PY_VERSION_HEX >= 0x03000000 return NULL; #else return; #endif } Py_INCREF(builtin_pytype); PyModule_AddObject(m, "_STACK", (PyObject*) builtin_pytype); SwigPyBuiltin_AddPublicSymbol(public_interface, "_STACK"); d = md; /* type '::stack_st_OPENSSL_STRING' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__stack_st_OPENSSL_STRING_type; builtin_pytype->tp_dict = d = PyDict_New(); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; builtin_base_count = 0; builtin_bases[builtin_base_count] = NULL; SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases); PyDict_SetItemString(d, "this", this_descr); PyDict_SetItemString(d, "thisown", thisown_descr); if (PyType_Ready(builtin_pytype) < 0) { PyErr_SetString(PyExc_TypeError, "Could not create type 'stack_st_OPENSSL_STRING'."); #if PY_VERSION_HEX >= 0x03000000 return NULL; #else return; #endif } Py_INCREF(builtin_pytype); PyModule_AddObject(m, "stack_st_OPENSSL_STRING", (PyObject*) builtin_pytype); SwigPyBuiltin_AddPublicSymbol(public_interface, "stack_st_OPENSSL_STRING"); d = md; /* type '::stack_st_OPENSSL_BLOCK' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__stack_st_OPENSSL_BLOCK_type; builtin_pytype->tp_dict = d = PyDict_New(); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; builtin_base_count = 0; builtin_bases[builtin_base_count] = NULL; SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases); PyDict_SetItemString(d, "this", this_descr); PyDict_SetItemString(d, "thisown", thisown_descr); if (PyType_Ready(builtin_pytype) < 0) { PyErr_SetString(PyExc_TypeError, "Could not create type 'stack_st_OPENSSL_BLOCK'."); #if PY_VERSION_HEX >= 0x03000000 return NULL; #else return; #endif } Py_INCREF(builtin_pytype); PyModule_AddObject(m, "stack_st_OPENSSL_BLOCK", (PyObject*) builtin_pytype); SwigPyBuiltin_AddPublicSymbol(public_interface, "stack_st_OPENSSL_BLOCK"); d = md; SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "bio_noclose",SWIG_From_int((int)(BIO_NOCLOSE))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "bio_close",SWIG_From_int((int)(BIO_CLOSE))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_READ",SWIG_From_int((int)(0x01))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_WRITE",SWIG_From_int((int)(0x02))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_IO_SPECIAL",SWIG_From_int((int)(0x04))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_RWS",SWIG_From_int((int)((BIO_FLAGS_READ|BIO_FLAGS_WRITE|BIO_FLAGS_IO_SPECIAL)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_SHOULD_RETRY",SWIG_From_int((int)(0x08))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_MEM_RDONLY",SWIG_From_int((int)(0x200))); PyDict_SetItemString(md,(char*)"cvar", SWIG_globals()); SwigPyBuiltin_AddPublicSymbol(public_interface, "cvar"); SWIG_addvarlink(SWIG_globals(),(char*)"_bio_err",Swig_var__bio_err_get, Swig_var__bio_err_set); /* type '::pyfd_struct' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__pyfd_struct_type; builtin_pytype->tp_dict = d = PyDict_New(); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; builtin_base_count = 0; builtin_bases[builtin_base_count] = NULL; SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases); PyDict_SetItemString(d, "this", this_descr); PyDict_SetItemString(d, "thisown", thisown_descr); if (PyType_Ready(builtin_pytype) < 0) { PyErr_SetString(PyExc_TypeError, "Could not create type 'BIO_PYFD_CTX'."); #if PY_VERSION_HEX >= 0x03000000 return NULL; #else return; #endif } Py_INCREF(builtin_pytype); PyModule_AddObject(m, "BIO_PYFD_CTX", (PyObject*) builtin_pytype); SwigPyBuiltin_AddPublicSymbol(public_interface, "BIO_PYFD_CTX"); d = md; SWIG_addvarlink(SWIG_globals(),(char*)"methods_fdp",Swig_var_methods_fdp_get, Swig_var_methods_fdp_set); SWIG_addvarlink(SWIG_globals(),(char*)"_rand_err",Swig_var__rand_err_get, Swig_var__rand_err_set); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS5_SALT_LEN",SWIG_From_int((int)(8))); SWIG_addvarlink(SWIG_globals(),(char*)"_evp_err",Swig_var__evp_err_get, Swig_var__evp_err_set); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "AES_BLOCK_SIZE",SWIG_From_int((int)(AES_BLOCK_SIZE))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_NO_RC4",SWIG_From_int((int)(0))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "dh_check_ok",SWIG_From_int((int)(0))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "dh_check_p_not_prime",SWIG_From_int((int)(DH_CHECK_P_NOT_PRIME))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "dh_check_p_not_strong",SWIG_From_int((int)(DH_CHECK_P_NOT_STRONG_PRIME))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "dh_check_g_failed",SWIG_From_int((int)(DH_UNABLE_TO_CHECK_GENERATOR))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "dh_check_bad_g",SWIG_From_int((int)(DH_NOT_SUITABLE_GENERATOR))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "DH_GENERATOR_2",SWIG_From_int((int)(2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "DH_GENERATOR_5",SWIG_From_int((int)(5))); SWIG_addvarlink(SWIG_globals(),(char*)"_dh_err",Swig_var__dh_err_get, Swig_var__dh_err_set); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "no_padding",SWIG_From_int((int)(RSA_NO_PADDING))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "pkcs1_padding",SWIG_From_int((int)(RSA_PKCS1_PADDING))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "sslv23_padding",SWIG_From_int((int)(RSA_SSLV23_PADDING))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "pkcs1_oaep_padding",SWIG_From_int((int)(RSA_PKCS1_OAEP_PADDING))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sha1",SWIG_From_int((int)(NID_sha1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sha224",SWIG_From_int((int)(NID_sha224))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sha256",SWIG_From_int((int)(NID_sha256))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sha384",SWIG_From_int((int)(NID_sha384))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sha512",SWIG_From_int((int)(NID_sha512))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_md5",SWIG_From_int((int)(NID_md5))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_ripemd160",SWIG_From_int((int)(NID_ripemd160))); SWIG_addvarlink(SWIG_globals(),(char*)"_rsa_err",Swig_var__rsa_err_get, Swig_var__rsa_err_set); SWIG_addvarlink(SWIG_globals(),(char*)"_dsa_err",Swig_var__dsa_err_get, Swig_var__dsa_err_set); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_none",SWIG_From_int((int)(SSL_ERROR_NONE))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_ssl",SWIG_From_int((int)(SSL_ERROR_SSL))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_want_read",SWIG_From_int((int)(SSL_ERROR_WANT_READ))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_want_write",SWIG_From_int((int)(SSL_ERROR_WANT_WRITE))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_want_x509_lookup",SWIG_From_int((int)(SSL_ERROR_WANT_X509_LOOKUP))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_syscall",SWIG_From_int((int)(SSL_ERROR_SYSCALL))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_zero_return",SWIG_From_int((int)(SSL_ERROR_ZERO_RETURN))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_want_connect",SWIG_From_int((int)(SSL_ERROR_WANT_CONNECT))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_VERIFY_NONE",SWIG_From_int((int)(0x00))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_VERIFY_PEER",SWIG_From_int((int)(0x01))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_VERIFY_FAIL_IF_NO_PEER_CERT",SWIG_From_int((int)(0x02))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_VERIFY_CLIENT_ONCE",SWIG_From_int((int)(0x04))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_CONNECT",SWIG_From_int((int)(0x1000))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_ACCEPT",SWIG_From_int((int)(0x2000))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_MASK",SWIG_From_int((int)(0x0FFF))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_INIT",SWIG_From_int((int)((SSL_ST_CONNECT|SSL_ST_ACCEPT)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_BEFORE",SWIG_From_int((int)(0x4000))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_OK",SWIG_From_int((int)(0x03))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_RENEGOTIATE",SWIG_From_int((int)((0x04|SSL_ST_CONNECT|SSL_ST_ACCEPT)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_LOOP",SWIG_From_int((int)(0x01))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_EXIT",SWIG_From_int((int)(0x02))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_READ",SWIG_From_int((int)(0x04))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_WRITE",SWIG_From_int((int)(0x08))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_ALERT",SWIG_From_int((int)(0x4000))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_READ_ALERT",SWIG_From_int((int)((SSL_CB_ALERT|SSL_CB_READ)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_WRITE_ALERT",SWIG_From_int((int)((SSL_CB_ALERT|SSL_CB_WRITE)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_ACCEPT_LOOP",SWIG_From_int((int)((SSL_ST_ACCEPT|SSL_CB_LOOP)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_ACCEPT_EXIT",SWIG_From_int((int)((SSL_ST_ACCEPT|SSL_CB_EXIT)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_CONNECT_LOOP",SWIG_From_int((int)((SSL_ST_CONNECT|SSL_CB_LOOP)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_CONNECT_EXIT",SWIG_From_int((int)((SSL_ST_CONNECT|SSL_CB_EXIT)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_HANDSHAKE_START",SWIG_From_int((int)(0x10))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_HANDSHAKE_DONE",SWIG_From_int((int)(0x20))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_SENT_SHUTDOWN",SWIG_From_int((int)(1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_RECEIVED_SHUTDOWN",SWIG_From_int((int)(2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_SESS_CACHE_OFF",SWIG_From_int((int)(0x000))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_SESS_CACHE_CLIENT",SWIG_From_int((int)(0x001))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_SESS_CACHE_SERVER",SWIG_From_int((int)(0x002))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_SESS_CACHE_BOTH",SWIG_From_int((int)((SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_OP_ALL",SWIG_From_int((int)(0x00000FFFL))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_OP_NO_SSLv2",SWIG_From_int((int)(0x01000000L))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_OP_NO_SSLv3",SWIG_From_int((int)(0x02000000L))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_OP_NO_TLSv1",SWIG_From_int((int)(0x04000000L))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS",SWIG_From_int((int)(0x00000800L))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_MODE_ENABLE_PARTIAL_WRITE",SWIG_From_int((int)(SSL_MODE_ENABLE_PARTIAL_WRITE))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER",SWIG_From_int((int)(SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_MODE_AUTO_RETRY",SWIG_From_int((int)(SSL_MODE_AUTO_RETRY))); SWIG_addvarlink(SWIG_globals(),(char*)"_ssl_err",Swig_var__ssl_err_get, Swig_var__ssl_err_set); SWIG_addvarlink(SWIG_globals(),(char*)"_ssl_timeout_err",Swig_var__ssl_timeout_err_get, Swig_var__ssl_timeout_err_set); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_DEFAULT",SWIG_From_int((int)(-1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_COMPAT",SWIG_From_int((int)(1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_SSL_CLIENT",SWIG_From_int((int)(2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_SSL_SERVER",SWIG_From_int((int)(3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_EMAIL",SWIG_From_int((int)(4))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_OBJECT_SIGN",SWIG_From_int((int)(5))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_OCSP_SIGN",SWIG_From_int((int)(6))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_OCSP_REQUEST",SWIG_From_int((int)(7))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_DYNAMIC",SWIG_From_int((int)(1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_DYNAMIC_NAME",SWIG_From_int((int)(2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_TRUSTED",SWIG_From_int((int)(1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_REJECTED",SWIG_From_int((int)(2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_UNTRUSTED",SWIG_From_int((int)(3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_SSL_CLIENT",SWIG_From_int((int)(1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_SSL_SERVER",SWIG_From_int((int)(2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_NS_SSL_SERVER",SWIG_From_int((int)(3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_SMIME_SIGN",SWIG_From_int((int)(4))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_SMIME_ENCRYPT",SWIG_From_int((int)(5))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_CRL_SIGN",SWIG_From_int((int)(6))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_ANY",SWIG_From_int((int)(7))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_OCSP_HELPER",SWIG_From_int((int)(8))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509V3_EXT_UNKNOWN_MASK",SWIG_From_long((long)((0xfL << 16)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509V3_EXT_DEFAULT",SWIG_From_long((long)(0))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509V3_EXT_ERROR_UNKNOWN",SWIG_From_long((long)((1L << 16)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509V3_EXT_PARSE_UNKNOWN",SWIG_From_long((long)((2L << 16)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509V3_EXT_DUMP_UNKNOWN",SWIG_From_long((long)((3L << 16)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_commonName",SWIG_From_int((int)(13))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_countryName",SWIG_From_int((int)(14))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_localityName",SWIG_From_int((int)(15))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_stateOrProvinceName",SWIG_From_int((int)(16))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_organizationName",SWIG_From_int((int)(17))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_organizationalUnitName",SWIG_From_int((int)(18))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_serialNumber",SWIG_From_int((int)(105))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_surname",SWIG_From_int((int)(100))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_givenName",SWIG_From_int((int)(99))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_pkcs9_emailAddress",SWIG_From_int((int)(48))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_OK",SWIG_From_int((int)(0))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT",SWIG_From_int((int)(2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_GET_CRL",SWIG_From_int((int)(3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE",SWIG_From_int((int)(4))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE",SWIG_From_int((int)(5))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY",SWIG_From_int((int)(6))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_SIGNATURE_FAILURE",SWIG_From_int((int)(7))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CRL_SIGNATURE_FAILURE",SWIG_From_int((int)(8))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_NOT_YET_VALID",SWIG_From_int((int)(9))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_HAS_EXPIRED",SWIG_From_int((int)(10))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CRL_NOT_YET_VALID",SWIG_From_int((int)(11))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CRL_HAS_EXPIRED",SWIG_From_int((int)(12))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD",SWIG_From_int((int)(13))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD",SWIG_From_int((int)(14))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD",SWIG_From_int((int)(15))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD",SWIG_From_int((int)(16))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_OUT_OF_MEM",SWIG_From_int((int)(17))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT",SWIG_From_int((int)(18))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN",SWIG_From_int((int)(19))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY",SWIG_From_int((int)(20))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE",SWIG_From_int((int)(21))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_CHAIN_TOO_LONG",SWIG_From_int((int)(22))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_REVOKED",SWIG_From_int((int)(23))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_INVALID_CA",SWIG_From_int((int)(24))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_PATH_LENGTH_EXCEEDED",SWIG_From_int((int)(25))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_INVALID_PURPOSE",SWIG_From_int((int)(26))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_UNTRUSTED",SWIG_From_int((int)(27))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_REJECTED",SWIG_From_int((int)(28))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_APPLICATION_VERIFICATION",SWIG_From_int((int)(50))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_COMPAT",SWIG_From_int((int)(0))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_SEP_COMMA_PLUS",SWIG_From_int((int)((1 << 16)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_SEP_CPLUS_SPC",SWIG_From_int((int)((2 << 16)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_SEP_MULTILINE",SWIG_From_int((int)((4 << 16)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_DN_REV",SWIG_From_int((int)((1 << 20)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_FN_LN",SWIG_From_int((int)((1 << 21)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_SPC_EQ",SWIG_From_int((int)((1 << 23)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_DUMP_UNKNOWN_FIELDS",SWIG_From_int((int)((1 << 24)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_FN_ALIGN",SWIG_From_int((int)((1 << 25)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_ONELINE",SWIG_From_int((int)((ASN1_STRFLGS_RFC2253|ASN1_STRFLGS_ESC_QUOTE|XN_FLAG_SEP_CPLUS_SPC|XN_FLAG_SPC_EQ)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_MULTILINE",SWIG_From_int((int)((ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB|XN_FLAG_SEP_MULTILINE|XN_FLAG_SPC_EQ|XN_FLAG_FN_LN|XN_FLAG_FN_ALIGN)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_RFC2253",SWIG_From_int((int)((ASN1_STRFLGS_RFC2253|XN_FLAG_SEP_COMMA_PLUS|XN_FLAG_DN_REV|XN_FLAG_DUMP_UNKNOWN_FIELDS)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "RSA_3",SWIG_From_int((int)(0x3L))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "RSA_F4",SWIG_From_int((int)(0x10001L))); SWIG_addvarlink(SWIG_globals(),(char*)"_x509_err",Swig_var__x509_err_get, Swig_var__x509_err_set); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_ESC_2253",SWIG_From_int((int)(1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_ESC_CTRL",SWIG_From_int((int)(2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_ESC_MSB",SWIG_From_int((int)(4))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_ESC_QUOTE",SWIG_From_int((int)(8))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_UTF8_CONVERT",SWIG_From_int((int)(0x10))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_IGNORE_TYPE",SWIG_From_int((int)(0x20))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_SHOW_TYPE",SWIG_From_int((int)(0x40))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_DUMP_ALL",SWIG_From_int((int)(0x80))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_DUMP_UNKNOWN",SWIG_From_int((int)(0x100))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_DUMP_DER",SWIG_From_int((int)(0x200))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_RFC2253",SWIG_From_int((int)((ASN1_STRFLGS_ESC_2253|ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB|ASN1_STRFLGS_UTF8_CONVERT|ASN1_STRFLGS_DUMP_UNKNOWN|ASN1_STRFLGS_DUMP_DER)))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_TEXT",SWIG_From_int((int)(0x1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOCERTS",SWIG_From_int((int)(0x2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOSIGS",SWIG_From_int((int)(0x4))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOCHAIN",SWIG_From_int((int)(0x8))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOINTERN",SWIG_From_int((int)(0x10))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOVERIFY",SWIG_From_int((int)(0x20))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_DETACHED",SWIG_From_int((int)(0x40))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_BINARY",SWIG_From_int((int)(0x80))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOATTR",SWIG_From_int((int)(0x100))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_SIGNED",SWIG_From_int((int)(NID_pkcs7_signed))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_ENVELOPED",SWIG_From_int((int)(NID_pkcs7_enveloped))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_SIGNED_ENVELOPED",SWIG_From_int((int)(NID_pkcs7_signedAndEnveloped))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_DATA",SWIG_From_int((int)(NID_pkcs7_data))); SWIG_addvarlink(SWIG_globals(),(char*)"_pkcs7_err",Swig_var__pkcs7_err_get, Swig_var__pkcs7_err_set); SWIG_addvarlink(SWIG_globals(),(char*)"_smime_err",Swig_var__smime_err_get, Swig_var__smime_err_set); SWIG_addvarlink(SWIG_globals(),(char*)"_util_err",Swig_var__util_err_get, Swig_var__util_err_set); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_NO_EC",SWIG_From_int((int)(0))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp112r1",SWIG_From_int((int)(NID_secp112r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp112r2",SWIG_From_int((int)(NID_secp112r2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp128r1",SWIG_From_int((int)(NID_secp128r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp128r2",SWIG_From_int((int)(NID_secp128r2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp160k1",SWIG_From_int((int)(NID_secp160k1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp160r1",SWIG_From_int((int)(NID_secp160r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp160r2",SWIG_From_int((int)(NID_secp160r2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp192k1",SWIG_From_int((int)(NID_secp192k1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp224k1",SWIG_From_int((int)(NID_secp224k1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp224r1",SWIG_From_int((int)(NID_secp224r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp256k1",SWIG_From_int((int)(NID_secp256k1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp384r1",SWIG_From_int((int)(NID_secp384r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp521r1",SWIG_From_int((int)(NID_secp521r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect113r1",SWIG_From_int((int)(NID_sect113r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect113r2",SWIG_From_int((int)(NID_sect113r2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect131r1",SWIG_From_int((int)(NID_sect131r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect131r2",SWIG_From_int((int)(NID_sect131r2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect163k1",SWIG_From_int((int)(NID_sect163k1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect163r1",SWIG_From_int((int)(NID_sect163r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect163r2",SWIG_From_int((int)(NID_sect163r2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect193r1",SWIG_From_int((int)(NID_sect193r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect193r2",SWIG_From_int((int)(NID_sect193r2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect233k1",SWIG_From_int((int)(NID_sect233k1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect233r1",SWIG_From_int((int)(NID_sect233r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect239k1",SWIG_From_int((int)(NID_sect239k1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect283k1",SWIG_From_int((int)(NID_sect283k1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect283r1",SWIG_From_int((int)(NID_sect283r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect409k1",SWIG_From_int((int)(NID_sect409k1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect409r1",SWIG_From_int((int)(NID_sect409r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect571k1",SWIG_From_int((int)(NID_sect571k1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect571r1",SWIG_From_int((int)(NID_sect571r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime192v1",SWIG_From_int((int)(NID_X9_62_prime192v1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime192v2",SWIG_From_int((int)(NID_X9_62_prime192v2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime192v3",SWIG_From_int((int)(NID_X9_62_prime192v3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime239v1",SWIG_From_int((int)(NID_X9_62_prime239v1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime239v2",SWIG_From_int((int)(NID_X9_62_prime239v2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime239v3",SWIG_From_int((int)(NID_X9_62_prime239v3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime256v1",SWIG_From_int((int)(NID_X9_62_prime256v1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb163v1",SWIG_From_int((int)(NID_X9_62_c2pnb163v1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb163v2",SWIG_From_int((int)(NID_X9_62_c2pnb163v2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb163v3",SWIG_From_int((int)(NID_X9_62_c2pnb163v3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb176v1",SWIG_From_int((int)(NID_X9_62_c2pnb176v1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb191v1",SWIG_From_int((int)(NID_X9_62_c2tnb191v1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb191v2",SWIG_From_int((int)(NID_X9_62_c2tnb191v2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb191v3",SWIG_From_int((int)(NID_X9_62_c2tnb191v3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb208w1",SWIG_From_int((int)(NID_X9_62_c2pnb208w1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb239v1",SWIG_From_int((int)(NID_X9_62_c2tnb239v1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb239v2",SWIG_From_int((int)(NID_X9_62_c2tnb239v2))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb239v3",SWIG_From_int((int)(NID_X9_62_c2tnb239v3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb272w1",SWIG_From_int((int)(NID_X9_62_c2pnb272w1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb304w1",SWIG_From_int((int)(NID_X9_62_c2pnb304w1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb359v1",SWIG_From_int((int)(NID_X9_62_c2tnb359v1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb368w1",SWIG_From_int((int)(NID_X9_62_c2pnb368w1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb431r1",SWIG_From_int((int)(NID_X9_62_c2tnb431r1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls1",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls3",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls4",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls4))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls5",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls5))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls6",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls6))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls7",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls7))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls8",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls8))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls9",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls9))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls10",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls10))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls11",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls11))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls12",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls12))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_ipsec3",SWIG_From_int((int)(NID_ipsec3))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_ipsec4",SWIG_From_int((int)(NID_ipsec4))); SWIG_addvarlink(SWIG_globals(),(char*)"_ec_err",Swig_var__ec_err_get, Swig_var__ec_err_set); /* type '::_cbd_t' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin___cbd_t_type; builtin_pytype->tp_dict = d = PyDict_New(); SwigPyBuiltin_SetMetaType(builtin_pytype, metatype); builtin_pytype->tp_new = PyType_GenericNew; builtin_base_count = 0; builtin_bases[builtin_base_count] = NULL; SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases); PyDict_SetItemString(d, "this", this_descr); PyDict_SetItemString(d, "thisown", thisown_descr); if (PyType_Ready(builtin_pytype) < 0) { PyErr_SetString(PyExc_TypeError, "Could not create type '_cbd_t'."); #if PY_VERSION_HEX >= 0x03000000 return NULL; #else return; #endif } Py_INCREF(builtin_pytype); PyModule_AddObject(m, "_cbd_t", (PyObject*) builtin_pytype); SwigPyBuiltin_AddPublicSymbol(public_interface, "_cbd_t"); d = md; SWIG_addvarlink(SWIG_globals(),(char*)"_engine_err",Swig_var__engine_err_get, Swig_var__engine_err_set); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_RSA",SWIG_From_int((int)(0x0001))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_DSA",SWIG_From_int((int)(0x0002))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_DH",SWIG_From_int((int)(0x0004))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_RAND",SWIG_From_int((int)(0x0008))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_ECDH",SWIG_From_int((int)(0x0010))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_ECDSA",SWIG_From_int((int)(0x0020))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_CIPHERS",SWIG_From_int((int)(0x0040))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_DIGESTS",SWIG_From_int((int)(0x0080))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_STORE",SWIG_From_int((int)(0x0100))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_ALL",SWIG_From_int((int)(0xFFFF))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_NONE",SWIG_From_int((int)(0x0000))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "encrypt",SWIG_From_int((int)(1))); SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "decrypt",SWIG_From_int((int)(0))); /* Initialize threading */ SWIG_PYTHON_INITIALIZE_THREADS; #if PY_VERSION_HEX >= 0x03000000 return m; #else return; #endif } M2Crypto-0.31.0/SWIG/_objects.i0000664000175000001440000000543313210303077016247 0ustar matejusers00000000000000/* * -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- * vim: syntax=c sts=4 sw=4 * * ASN1_OBJECT manipulation functions from OBJ_obj2txt(3SSL). * * Pavel Shramov * IMEC MSU */ %{ #include %} %apply Pointer NONNULL { ASN1_OBJECT * }; %apply Pointer NONNULL { const char * }; %rename(obj_nid2obj) OBJ_nid2obj; extern ASN1_OBJECT * OBJ_nid2obj(int n); %rename(obj_nid2ln) OBJ_nid2ln; extern const char * OBJ_nid2ln(int n); %rename(obj_nid2sn) OBJ_nid2sn; extern const char * OBJ_nid2sn(int n); %rename(obj_obj2nid) OBJ_obj2nid; extern int OBJ_obj2nid(const ASN1_OBJECT *o); %rename(obj_ln2nid) OBJ_ln2nid; extern int OBJ_ln2nid(const char *ln); %rename(obj_sn2nid) OBJ_sn2nid; extern int OBJ_sn2nid(const char *sn); %rename(obj_txt2nid) OBJ_txt2nid; extern int OBJ_txt2nid(const char *s); %rename(obj_txt2obj) OBJ_txt2obj; extern ASN1_OBJECT * OBJ_txt2obj(const char *s, int no_name); %rename(_obj_obj2txt) OBJ_obj2txt; extern int OBJ_obj2txt(char *, int, const ASN1_OBJECT *, int); %inline %{ /* From the manpage for OBJ_obt2txt (): BUGS OBJ_obj2txt() is awkward and messy to use: it doesn’t follow the convention of other OpenSSL functions where the buffer can be set to NULL to determine the amount of data that should be written. Instead buf must point to a valid buffer and buf_len should be set to a positive value. A buffer length of 80 should be more than enough to handle any OID encountered in practice. The first call to OBJ_obj2txt () therefore passes a non-NULL dummy buffer. This wart is reportedly removed in OpenSSL 0.9.8b, although the manpage has not been updated. OBJ_obj2txt always prints \0 at the end. But the return value is the number of "good" bytes written. So memory is allocated for len + 1 bytes but only len bytes are marshalled to python. */ PyObject *obj_obj2txt(const ASN1_OBJECT *obj, int no_name) { int len; PyObject *ret; char *buf; char dummy[1]; len = OBJ_obj2txt(dummy, 1, obj, no_name); if (len < 0) { m2_PyErr_Msg(PyExc_RuntimeError); return NULL; } else if (len == 0) { /* XXX: For OpenSSL prior to 0.9.8b. Changes between 0.9.8a and 0.9.8b [04 May 2006] ... *) Several fixes and enhancements to the OID generation code. The old code sometimes allowed invalid OIDs (1.X for X >= 40 for example), couldn't handle numbers larger than ULONG_MAX, truncated printing and had a non standard OBJ_obj2txt() behaviour. [Steve Henson] */ len = 80; } buf = PyMem_Malloc(len + 1); len = OBJ_obj2txt(buf, len + 1, obj, no_name); ret = PyBytes_FromStringAndSize(buf, len); PyMem_Free(buf); return ret; } %} M2Crypto-0.31.0/SWIG/_pkcs7.i0000664000175000001440000001626513210303077015652 0ustar matejusers00000000000000/* Copyright (c) 2000 Ng Pheng Siong. All rights reserved. * Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved. */ /* $Id$ */ %{ #include #include #include #include %} %apply Pointer NONNULL { BIO * }; %apply Pointer NONNULL { EVP_CIPHER * }; %apply Pointer NONNULL { EVP_PKEY * }; %apply Pointer NONNULL { PKCS7 * }; %apply Pointer NONNULL { STACK_OF(X509) * }; %apply Pointer NONNULL { X509 * }; %rename(pkcs7_new) PKCS7_new; extern PKCS7 *PKCS7_new(void); %rename(pkcs7_free) PKCS7_free; extern void PKCS7_free(PKCS7 *); %rename(pkcs7_add_certificate) PKCS7_add_certificate; extern void PKCS7_add_certificate(PKCS7 *, X509 *); /* S/MIME operation */ %constant int PKCS7_TEXT = 0x1; %constant int PKCS7_NOCERTS = 0x2; %constant int PKCS7_NOSIGS = 0x4; %constant int PKCS7_NOCHAIN = 0x8; %constant int PKCS7_NOINTERN = 0x10; %constant int PKCS7_NOVERIFY = 0x20; %constant int PKCS7_DETACHED = 0x40; %constant int PKCS7_BINARY = 0x80; %constant int PKCS7_NOATTR = 0x100; %constant int PKCS7_SIGNED = NID_pkcs7_signed; %constant int PKCS7_ENVELOPED = NID_pkcs7_enveloped; %constant int PKCS7_SIGNED_ENVELOPED = NID_pkcs7_signedAndEnveloped; %constant int PKCS7_DATA = NID_pkcs7_data; %warnfilter(454) _pkcs7_err; %warnfilter(454) _smime_err; %inline %{ static PyObject *_pkcs7_err, *_smime_err; void pkcs7_init(PyObject *pkcs7_err) { Py_INCREF(pkcs7_err); _pkcs7_err = pkcs7_err; } void smime_init(PyObject *smime_err) { Py_INCREF(smime_err); _smime_err = smime_err; } %} %inline %{ PyObject *pkcs7_decrypt(PKCS7 *pkcs7, EVP_PKEY *pkey, X509 *cert, int flags) { int outlen; char *outbuf; BIO *bio; PyObject *ret; if (!(bio=BIO_new(BIO_s_mem()))) { PyErr_SetString(PyExc_MemoryError, "pkcs7_decrypt"); return NULL; } if (!PKCS7_decrypt(pkcs7, pkey, cert, bio, flags)) { m2_PyErr_Msg(_pkcs7_err); BIO_free(bio); return NULL; } outlen = BIO_ctrl_pending(bio); if (!(outbuf=(char *)PyMem_Malloc(outlen))) { PyErr_SetString(PyExc_MemoryError, "pkcs7_decrypt"); BIO_free(bio); return NULL; } BIO_read(bio, outbuf, outlen); ret = PyBytes_FromStringAndSize(outbuf, outlen); BIO_free(bio); PyMem_Free(outbuf); return ret; } %} %typemap(out) PKCS7 * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { m2_PyErr_Msg(_smime_err); $result = NULL; } } %threadallow pkcs7_encrypt; %inline %{ PKCS7 *pkcs7_encrypt(STACK_OF(X509) *stack, BIO *bio, EVP_CIPHER *cipher, int flags) { return PKCS7_encrypt(stack, bio, cipher, flags); } %} %threadallow pkcs7_sign1; %inline %{ PKCS7 *pkcs7_sign1(X509 *x509, EVP_PKEY *pkey, STACK_OF(X509) *stack, BIO *bio, EVP_MD *hash, int flags) { PKCS7 *p7 = PKCS7_sign(NULL, NULL, stack, bio, flags | PKCS7_STREAM); if (p7 == NULL) { return NULL; } if (PKCS7_sign_add_signer(p7, x509, pkey, hash, flags) == NULL) { return NULL; } if (PKCS7_final(p7, bio, flags) != 1) { return NULL; } return p7; } %} %threadallow pkcs7_sign0; %inline %{ PKCS7 *pkcs7_sign0(X509 *x509, EVP_PKEY *pkey, BIO *bio, EVP_MD *hash, int flags) { return pkcs7_sign1(x509, pkey, NULL, bio, hash, flags); } %} %typemap(out) PKCS7 * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { m2_PyErr_Msg(_pkcs7_err); $result = NULL; } } %threadallow pkcs7_read_bio; %inline %{ PKCS7 *pkcs7_read_bio(BIO *bio) { return PEM_read_bio_PKCS7(bio, NULL, NULL, NULL); } %} %threadallow pkcs7_read_bio_der; %inline %{ PKCS7 *pkcs7_read_bio_der(BIO *bio) { return d2i_PKCS7_bio(bio, NULL); } %} %typemap(out) PKCS7 * ; %inline %{ PyObject *pkcs7_verify1(PKCS7 *pkcs7, STACK_OF(X509) *stack, X509_STORE *store, BIO *data, int flags) { int res, outlen; char *outbuf; BIO *bio; PyObject *ret; if (!(bio=BIO_new(BIO_s_mem()))) { PyErr_SetString(PyExc_MemoryError, "pkcs7_verify1"); return NULL; } Py_BEGIN_ALLOW_THREADS res = PKCS7_verify(pkcs7, stack, store, data, bio, flags); Py_END_ALLOW_THREADS if (!res) { m2_PyErr_Msg(_pkcs7_err); BIO_free(bio); return NULL; } outlen = BIO_ctrl_pending(bio); if (!(outbuf=(char *)PyMem_Malloc(outlen))) { PyErr_SetString(PyExc_MemoryError, "pkcs7_verify1"); BIO_free(bio); return NULL; } BIO_read(bio, outbuf, outlen); ret = PyBytes_FromStringAndSize(outbuf, outlen); BIO_free(bio); PyMem_Free(outbuf); return ret; } PyObject *pkcs7_verify0(PKCS7 *pkcs7, STACK_OF(X509) *stack, X509_STORE *store, int flags) { return pkcs7_verify1(pkcs7, stack, store, NULL, flags); } %} %threadallow smime_write_pkcs7_multi; %inline %{ int smime_write_pkcs7_multi(BIO *bio, PKCS7 *pkcs7, BIO *data, int flags) { return SMIME_write_PKCS7(bio, pkcs7, data, flags | PKCS7_DETACHED); } %} %threadallow smime_write_pkcs7; %inline %{ int smime_write_pkcs7(BIO *bio, PKCS7 *pkcs7, int flags) { return SMIME_write_PKCS7(bio, pkcs7, NULL, flags); } PyObject *smime_read_pkcs7(BIO *bio) { BIO *bcont = NULL; PKCS7 *p7; PyObject *tuple, *_p7, *_BIO; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if (BIO_method_type(bio) == BIO_TYPE_MEM) { /* OpenSSL FAQ explains that this is needed for mem BIO to return EOF, * like file BIO does. Might need to do this for more mem BIOs but * not sure if that is safe, so starting with just this single place. */ BIO_set_mem_eof_return(bio, 0); } Py_BEGIN_ALLOW_THREADS p7=SMIME_read_PKCS7(bio, &bcont); Py_END_ALLOW_THREADS if (!p7) { m2_PyErr_Msg(_smime_err); return NULL; } if (!(tuple=PyTuple_New(2))) { PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails"); return NULL; } _p7 = SWIG_NewPointerObj((void *)p7, SWIGTYPE_p_PKCS7, 0); PyTuple_SET_ITEM(tuple, 0, _p7); if (!bcont) { Py_INCREF(Py_None); PyTuple_SET_ITEM(tuple, 1, Py_None); } else { _BIO = SWIG_NewPointerObj((void *)bcont, SWIGTYPE_p_BIO, 0); PyTuple_SET_ITEM(tuple, 1, _BIO); } return tuple; } %} %threadallow pkcs7_write_bio; %inline %{ int pkcs7_write_bio(PKCS7 *pkcs7, BIO* bio) { return PEM_write_bio_PKCS7(bio, pkcs7); } %} %threadallow pkcs7_write_bio_der; %inline %{ int pkcs7_write_bio_der(PKCS7 *pkcs7, BIO *bio) { return i2d_PKCS7_bio(bio, pkcs7); } int pkcs7_type_nid(PKCS7 *pkcs7) { return OBJ_obj2nid(pkcs7->type); } const char *pkcs7_type_sn(PKCS7 *pkcs7) { return OBJ_nid2sn(OBJ_obj2nid(pkcs7->type)); } %} %threadallow smime_crlf_copy; %inline %{ int smime_crlf_copy(BIO *in, BIO *out) { return SMIME_crlf_copy(in, out, PKCS7_TEXT); } /* return STACK_OF(X509)* */ STACK_OF(X509) *pkcs7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags) { return PKCS7_get0_signers(p7, certs, flags); } %} M2Crypto-0.31.0/SWIG/_py3k_compat.i0000644000175000001440000000205613355123234017050 0ustar matejusers00000000000000%{ #if PY_MAJOR_VERSION >= 3 FILE* PyFile_AsFile(PyObject *pyfile) { FILE* fp; int fd; const char *mode_str = NULL; PyObject *mode_obj; if ((fd = PyObject_AsFileDescriptor(pyfile)) == -1) { PyErr_SetString(PyExc_BlockingIOError, "Cannot find file handler for the Python file!"); return NULL; } if ((mode_obj = PyObject_GetAttrString(pyfile, "mode")) == NULL) { mode_str = "rb"; PyErr_Clear(); } else { /* convert to plain string * note that error checking is embedded in the function */ mode_str = PyUnicode_AsUTF8AndSize(mode_obj, NULL); } if((fp = fdopen(fd, mode_str)) == NULL) { PyErr_SetFromErrno(PyExc_IOError); } Py_XDECREF(mode_obj); return fp; } #else /* PY2K */ #define PyLong_FromLong(x) PyInt_FromLong(x) #define PyUnicode_AsUTF8(x) PyString_AsString(x) #define PyUnicode_FromString(x) PyString_FromString(x) #define PyUnicode_Format(x, y) PyString_Format(x, y) #endif /* PY_MAJOR_VERSION */ %} M2Crypto-0.31.0/SWIG/_rand.i0000664000175000001440000000733613247615013015554 0ustar matejusers00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. * Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved. */ /* $Id: _rand.i 721 2010-02-13 06:30:33Z heikki $ */ %module _rand %rename(rand_file_name) RAND_file_name; extern const char *RAND_file_name(char *, size_t ); %rename(rand_load_file) RAND_load_file; extern int RAND_load_file(const char *, long); %rename(rand_save_file) RAND_write_file; extern int RAND_write_file(const char *); %rename(rand_poll) RAND_poll; extern int RAND_poll(void); %rename(rand_status) RAND_status; extern int RAND_status(void); %rename(rand_cleanup) RAND_cleanup; extern void RAND_cleanup(void); %warnfilter(454) _rand_err; %inline %{ static PyObject *_rand_err; void rand_init(PyObject *rand_err) { Py_INCREF(rand_err); _rand_err = rand_err; } PyObject *rand_seed(PyObject *seed) { const void *buf; int len = 0; m2_PyObject_AsReadBufferInt(seed, &buf, &len); RAND_seed(buf, len); Py_RETURN_NONE; } PyObject *rand_add(PyObject *blob, double entropy) { const void *buf; int len = 0; m2_PyObject_AsReadBufferInt(blob, &buf, &len); RAND_add(buf, len, entropy); Py_RETURN_NONE; } PyObject *rand_bytes(int n) { void *blob; int ret; PyObject *obj; if (!(blob = PyMem_Malloc(n))) { PyErr_SetString(PyExc_MemoryError, "Insufficient memory for rand_bytes."); return NULL; } if ((ret = RAND_bytes(blob, n)) == 1) { obj = PyBytes_FromStringAndSize(blob, n); PyMem_Free(blob); return obj; } else if (ret == 0) { PyErr_SetString(_rand_err, "Not enough randomness."); PyMem_Free(blob); return NULL; } else if (ret == -1) { PyErr_SetString(_rand_err, "Not supported by the current RAND method."); PyMem_Free(blob); return NULL; } else { PyMem_Free(blob); m2_PyErr_Msg(_rand_err); return NULL; } } PyObject *rand_pseudo_bytes(int n) { int ret; unsigned char *blob; PyObject *tuple; if (!(blob=(unsigned char *)PyMem_Malloc(n))) { PyErr_SetString(PyExc_MemoryError, "Insufficient memory for rand_pseudo_bytes."); return NULL; } if (!(tuple=PyTuple_New(2))) { PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails"); PyMem_Free(blob); return NULL; } ret = RAND_pseudo_bytes(blob, n); if (ret == -1) { PyMem_Free(blob); Py_DECREF(tuple); PyErr_SetString(_rand_err, "Function RAND_pseudo_bytes not supported by the current RAND method."); return NULL; } else { PyTuple_SET_ITEM(tuple, 0, PyBytes_FromStringAndSize((char*)blob, n)); PyMem_Free(blob); PyTuple_SET_ITEM(tuple, 1, PyLong_FromLong((long)ret)); return tuple; } } PyObject *rand_file_name(void) { PyObject *obj; char *str; if ((obj = PyBytes_FromStringAndSize(NULL, BUFSIZ))==NULL) { PyErr_SetString(PyExc_MemoryError, "rand_file_name"); return NULL; } str=PyBytes_AS_STRING(obj); if (RAND_file_name(str, BUFSIZ)==NULL) { PyErr_SetString(PyExc_RuntimeError, "rand_file_name"); return NULL; } if (_PyBytes_Resize(&obj, (Py_ssize_t)strlen(str))!=0) return NULL; /* mem exception set by _PyBytes_Resize */ return obj; } void rand_screen(void) { #ifdef _WIN32 RAND_screen(); #endif } int rand_win32_event(unsigned int imsg, int wparam, long lparam) { #ifdef _WIN32 return RAND_event(imsg, wparam, lparam); #else return 0; #endif } %} /* 2004-04-05, ngps: Still missing: RAND_egd RAND_egd_bytes RAND_query_egd_bytes */ M2Crypto-0.31.0/SWIG/_rc4.i0000664000175000001440000000254613236336220015314 0ustar matejusers00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (c) 1999 Ng Pheng Siong. All rights reserved. */ /* $Id$ */ %include #if defined(OPENSSL_NO_RC4) #undef OPENSSL_NO_RC4 %constant OPENSSL_NO_RC4 = 1; #else %constant OPENSSL_NO_RC4 = 0; %{ #include %} %apply Pointer NONNULL { RC4_KEY * }; %inline %{ RC4_KEY *rc4_new(void) { RC4_KEY *key; if (!(key = (RC4_KEY *)PyMem_Malloc(sizeof(RC4_KEY)))) PyErr_SetString(PyExc_MemoryError, "rc4_new"); return key; } void rc4_free(RC4_KEY *key) { PyMem_Free((void *)key); } PyObject *rc4_set_key(RC4_KEY *key, PyObject *value) { const void *vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; RC4_set_key(key, vlen, vbuf); Py_RETURN_NONE; } PyObject *rc4_update(RC4_KEY *key, PyObject *in) { PyObject *ret; const void *buf; Py_ssize_t len; void *out; if (PyObject_AsReadBuffer(in, &buf, &len) == -1) return NULL; if (!(out = PyMem_Malloc(len))) { PyErr_SetString(PyExc_MemoryError, "expected a string object"); return NULL; } RC4(key, len, buf, out); ret = PyBytes_FromStringAndSize(out, len); PyMem_Free(out); return ret; } int rc4_type_check(RC4_KEY *key) { return 1; } %} #endif M2Crypto-0.31.0/SWIG/_rsa.i0000664000175000001440000003116113236336220015404 0ustar matejusers00000000000000/* Copyright (c) 1999-2000 Ng Pheng Siong. All rights reserved. */ /* $Id$ */ %{ #include #include #include #include #include %} %apply Pointer NONNULL { RSA * }; %apply Pointer NONNULL { PyObject *pyfunc }; %rename(rsa_size) RSA_size; extern int RSA_size(const RSA*); %rename(rsa_new) RSA_new; extern RSA *RSA_new(void); %rename(rsa_free) RSA_free; extern void RSA_free(RSA *); %rename(rsa_check_key) RSA_check_key; extern int RSA_check_key(const RSA *); %constant int no_padding = RSA_NO_PADDING; %constant int pkcs1_padding = RSA_PKCS1_PADDING; %constant int sslv23_padding = RSA_SSLV23_PADDING; %constant int pkcs1_oaep_padding = RSA_PKCS1_OAEP_PADDING; %constant int NID_sha1 = NID_sha1; #if OPENSSL_VERSION_NUMBER >= 0x0090800fL %constant int NID_sha224 = NID_sha224; %constant int NID_sha256 = NID_sha256; %constant int NID_sha384 = NID_sha384; %constant int NID_sha512 = NID_sha512; #endif %constant int NID_md5 = NID_md5; %constant int NID_ripemd160 = NID_ripemd160; %warnfilter(454) _rsa_err; %inline %{ static PyObject *_rsa_err; void rsa_init(PyObject *rsa_err) { Py_INCREF(rsa_err); _rsa_err = rsa_err; } %} %inline %{ RSA *rsa_read_key(BIO *f, PyObject *pyfunc) { RSA *rsa; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS rsa = PEM_read_bio_RSAPrivateKey(f, NULL, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return rsa; } %} %inline %{ int rsa_write_key(RSA *rsa, BIO *f, EVP_CIPHER *cipher, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_RSAPrivateKey(f, rsa, cipher, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } %} %inline %{ int rsa_write_key_no_cipher(RSA *rsa, BIO *f, PyObject *pyfunc) { int ret; Py_INCREF(pyfunc); Py_BEGIN_ALLOW_THREADS ret = PEM_write_bio_RSAPrivateKey(f, rsa, NULL, NULL, 0, passphrase_callback, (void *)pyfunc); Py_END_ALLOW_THREADS Py_DECREF(pyfunc); return ret; } %} %threadallow rsa_read_pub_key; %inline %{ RSA *rsa_read_pub_key(BIO *f) { return PEM_read_bio_RSA_PUBKEY(f, NULL, NULL, NULL); } %} %threadallow rsa_write_pub_key; %inline %{ int rsa_write_pub_key(RSA *rsa, BIO *f) { return PEM_write_bio_RSA_PUBKEY(f, rsa); } PyObject *rsa_get_e(RSA *rsa) { const BIGNUM* e = NULL; RSA_get0_key(rsa, NULL, &e, NULL); if (!e) { PyErr_SetString(_rsa_err, "'e' is unset"); return NULL; } return bn_to_mpi(e); } PyObject *rsa_get_n(RSA *rsa) { const BIGNUM* n = NULL; RSA_get0_key(rsa, &n, NULL, NULL); if (!n) { PyErr_SetString(_rsa_err, "'n' is unset"); return NULL; } return bn_to_mpi(n); } PyObject *rsa_set_e(RSA *rsa, PyObject *eval) { const BIGNUM* n_read = NULL; BIGNUM* n = NULL; BIGNUM* e; if (!(e = m2_PyObject_AsBIGNUM(eval, _rsa_err))) { return NULL; } /* n and e must be set at the same time so if e is unset, set it to zero */ RSA_get0_key(rsa, &n_read, NULL, NULL); if (!n_read) { n = BN_new(); } if (RSA_set0_key(rsa, n, e, NULL) != 1) { PyErr_SetString(_rsa_err, "Cannot set fields of RSA object."); BN_free(e); BN_free(n); return NULL; } Py_RETURN_NONE; } PyObject *rsa_set_n(RSA *rsa, PyObject *nval) { BIGNUM* n; const BIGNUM* e_read = NULL; BIGNUM* e = NULL; if (!(n = m2_PyObject_AsBIGNUM(nval, _rsa_err))) { return NULL; } /* n and e must be set at the same time so if e is unset, set it to zero */ RSA_get0_key(rsa, NULL, &e_read, NULL); if (!e_read) { e = BN_new(); } if (RSA_set0_key(rsa, n, e, NULL) != 1) { PyErr_SetString(_rsa_err, "Cannot set fields of RSA object."); BN_free(n); BN_free(e); return NULL; } Py_RETURN_NONE; } PyObject *rsa_set_en(RSA *rsa, PyObject *eval, PyObject* nval) { BIGNUM* e, *n; if (!(e = m2_PyObject_AsBIGNUM(eval, _rsa_err)) || !(n = m2_PyObject_AsBIGNUM(nval, _rsa_err))) { return NULL; } if (!RSA_set0_key(rsa, n, e, NULL)) { PyErr_SetString(_rsa_err, "Cannot set fields of RSA object."); BN_free(e); BN_free(n); return NULL; } Py_RETURN_NONE; } static BIGNUM* PyObject_Bin_AsBIGNUM(PyObject* value) { BIGNUM* bn; const void* vbuf; int vlen = 0; if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1) return NULL; if (!(bn = BN_bin2bn((unsigned char *)vbuf, vlen, NULL))) { m2_PyErr_Msg(_rsa_err); return NULL; } return bn; } PyObject *rsa_set_en_bin(RSA *rsa, PyObject *eval, PyObject* nval) { BIGNUM* e, *n; if (!(e = PyObject_Bin_AsBIGNUM(eval)) || !(n = PyObject_Bin_AsBIGNUM(nval))) { return NULL; } if (!RSA_set0_key(rsa, e, n, NULL)) { PyErr_SetString(_rsa_err, "Cannot set fields of RSA object."); BN_free(e); BN_free(n); return NULL; } Py_RETURN_NONE; } PyObject *rsa_private_encrypt(RSA *rsa, PyObject *from, int padding) { const void *fbuf; void *tbuf; int flen = 0, tlen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1) return NULL; if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) { PyErr_SetString(PyExc_MemoryError, "rsa_private_encrypt"); return NULL; } tlen = RSA_private_encrypt(flen, (unsigned char *)fbuf, (unsigned char *)tbuf, rsa, padding); if (tlen == -1) { m2_PyErr_Msg(_rsa_err); PyMem_Free(tbuf); return NULL; } ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen); PyMem_Free(tbuf); return ret; } PyObject *rsa_public_decrypt(RSA *rsa, PyObject *from, int padding) { const void *fbuf; void *tbuf; int flen = 0, tlen = 0; PyObject *ret; if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1) return NULL; /* OpenSSL docs are confused here: it says we only need buffer * 'RSA_size()-11', but it is true only for RSA PKCS#1 type 1 * padding. For other uses we need to use different sizes. */ if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) { PyErr_SetString(PyExc_MemoryError, "rsa_public_decrypt"); return NULL; } tlen = RSA_public_decrypt(flen, (unsigned char *)fbuf, (unsigned char *)tbuf, rsa, padding); if (tlen == -1) { m2_PyErr_Msg(_rsa_err); PyMem_Free(tbuf); return NULL; } ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen); PyMem_Free(tbuf); return ret; } PyObject *rsa_public_encrypt(RSA *rsa, PyObject *from, int padding) { const void *fbuf; void *tbuf; int flen = 0, tlen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1) return NULL; if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) { PyErr_SetString(PyExc_MemoryError, "rsa_public_encrypt"); return NULL; } tlen = RSA_public_encrypt(flen, (unsigned char *)fbuf, (unsigned char *)tbuf, rsa, padding); if (tlen == -1) { m2_PyErr_Msg(_rsa_err); PyMem_Free(tbuf); return NULL; } ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen); PyMem_Free(tbuf); return ret; } PyObject *rsa_private_decrypt(RSA *rsa, PyObject *from, int padding) { const void *fbuf; void *tbuf; int flen = 0, tlen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1) return NULL; if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) { PyErr_SetString(PyExc_MemoryError, "rsa_private_decrypt"); return NULL; } tlen = RSA_private_decrypt(flen, (unsigned char *)fbuf, (unsigned char *)tbuf, rsa, padding); if (tlen == -1) { m2_PyErr_Msg(_rsa_err); PyMem_Free(tbuf); return NULL; } ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen); PyMem_Free(tbuf); return ret; } #if OPENSSL_VERSION_NUMBER >= 0x0090708fL PyObject *rsa_padding_add_pkcs1_pss(RSA *rsa, PyObject *digest, EVP_MD *hash, int salt_length) { const void *dbuf; unsigned char *tbuf; int dlen, result, tlen; PyObject *ret; if (m2_PyObject_AsReadBufferInt(digest, &dbuf, &dlen) == -1) return NULL; tlen = RSA_size(rsa); if (!(tbuf = OPENSSL_malloc(tlen))) { PyErr_SetString(PyExc_MemoryError, "rsa_padding_add_pkcs1_pss"); return NULL; } result = RSA_padding_add_PKCS1_PSS( rsa, tbuf, (unsigned char *)dbuf, hash, salt_length); if (result == -1) { m2_PyErr_Msg(_rsa_err); OPENSSL_cleanse(tbuf, tlen); OPENSSL_free(tbuf); return NULL; } ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen); OPENSSL_cleanse(tbuf, tlen); OPENSSL_free(tbuf); return ret; } int rsa_verify_pkcs1_pss(RSA *rsa, PyObject *digest, PyObject *signature, EVP_MD *hash, int salt_length) { const void *dbuf; const void *sbuf; int dlen, slen, ret; if (m2_PyObject_AsReadBufferInt(digest, &dbuf, &dlen) == -1) { return 0; } if (m2_PyObject_AsReadBufferInt(signature, &sbuf, &slen) == -1) { return 0; } ret = RSA_verify_PKCS1_PSS( rsa, (unsigned char *)dbuf, hash, (unsigned char *)sbuf, salt_length); return ret; } #endif PyObject *rsa_sign(RSA *rsa, PyObject *py_digest_string, int method_type) { int digest_len = 0; int buf_len = 0; int ret = 0; unsigned int real_buf_len = 0; char *digest_string = NULL; unsigned char * sign_buf = NULL; PyObject *signature; ret = m2_PyString_AsStringAndSizeInt(py_digest_string, &digest_string, &digest_len); if (ret == -1) { /* PyString_AsStringAndSize raises the correct exceptions. */ return NULL; } buf_len = RSA_size(rsa); sign_buf = (unsigned char *)PyMem_Malloc(buf_len); ret = RSA_sign(method_type, (const unsigned char *)digest_string, digest_len, sign_buf, &real_buf_len, rsa); if (!ret) { m2_PyErr_Msg(_rsa_err); PyMem_Free(sign_buf); return NULL; } signature = PyBytes_FromStringAndSize((const char*) sign_buf, buf_len); PyMem_Free(sign_buf); return signature; } int rsa_verify(RSA *rsa, PyObject *py_verify_string, PyObject* py_sign_string, int method_type){ int ret = 0; char * sign_string = NULL; char * verify_string = NULL; int verify_len = 0; int sign_len = 0; ret = m2_PyString_AsStringAndSizeInt(py_verify_string, &verify_string, &verify_len); if (ret == -1) { /* PyString_AsStringAndSize raises the correct exceptions. */ return 0; } ret = m2_PyString_AsStringAndSizeInt(py_sign_string, &sign_string, &sign_len); if (ret == -1) { return 0; } ret = RSA_verify(method_type, (unsigned char *) verify_string, verify_len, (unsigned char *) sign_string, sign_len, rsa); if (!ret) { m2_PyErr_Msg(_rsa_err); return 0; } return ret; } PyObject *rsa_generate_key(int bits, unsigned long e, PyObject *pyfunc) { RSA *rsa; PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ BN_GENCB *gencb; BIGNUM *e_big; int ret; if ((e_big=BN_new()) == NULL) { m2_PyErr_Msg(_rsa_err); return NULL; } if (BN_set_word(e_big, e) == 0) { m2_PyErr_Msg(_rsa_err); BN_free(e_big); return NULL; } if ((gencb=BN_GENCB_new()) == NULL) { m2_PyErr_Msg(_rsa_err); BN_free(e_big); return NULL; } if ((rsa = RSA_new()) == NULL) { m2_PyErr_Msg(_rsa_err); BN_free(e_big); BN_GENCB_free(gencb); return NULL; } BN_GENCB_set(gencb, bn_gencb_callback, (void *) pyfunc); Py_INCREF(pyfunc); ret = RSA_generate_key_ex(rsa, bits, e_big, gencb); BN_free(e_big); BN_GENCB_free(gencb); Py_DECREF(pyfunc); if (ret) return SWIG_NewPointerObj((void *)rsa, SWIGTYPE_p_RSA, 0); m2_PyErr_Msg(_rsa_err); RSA_free(rsa); return NULL; } int rsa_type_check(RSA *rsa) { return 1; } int rsa_check_pub_key(RSA *rsa) { const BIGNUM* n, *e; RSA_get0_key(rsa, &n, &e, NULL); return n && e; } %} %threadallow rsa_write_key_der; %inline %{ int rsa_write_key_der(RSA *rsa, BIO *bio) { return i2d_RSAPrivateKey_bio(bio, rsa); } %} M2Crypto-0.31.0/SWIG/_ssl.i0000644000175000001440000006562713355123234015435 0ustar matejusers00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. */ /* ** Portions created by Open Source Applications Foundation (OSAF) are ** Copyright (C) 2004-2005 OSAF. All Rights Reserved. ** ** Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved. ** */ /* $Id$ */ %{ #include #include #include #include #include #include #include #ifdef _WIN32 #include #include #pragma comment(lib, "Ws2_32") typedef unsigned __int64 uint64_t; #else #include #include #endif %} #if OPENSSL_VERSION_NUMBER >= 0x10100005L %include #endif %apply Pointer NONNULL { SSL_CTX * }; %apply Pointer NONNULL { SSL * }; %apply Pointer NONNULL { SSL_CIPHER * }; %apply Pointer NONNULL { STACK_OF(SSL_CIPHER) * }; %apply Pointer NONNULL { STACK_OF(X509) * }; %apply Pointer NONNULL { BIO * }; %apply Pointer NONNULL { DH * }; %apply Pointer NONNULL { RSA * }; %apply Pointer NONNULL { EVP_PKEY *}; %apply Pointer NONNULL { PyObject *pyfunc }; %rename(ssl_get_ciphers) SSL_get_ciphers; extern STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *ssl); %rename(ssl_get_version) SSL_get_version; extern const char *SSL_get_version(const SSL *); %rename(ssl_get_error) SSL_get_error; extern int SSL_get_error(const SSL *, int); %rename(ssl_get_state) SSL_state_string; extern const char *SSL_state_string(const SSL *); %rename(ssl_get_state_v) SSL_state_string_long; extern const char *SSL_state_string_long(const SSL *); %rename(ssl_get_alert_type) SSL_alert_type_string; extern const char *SSL_alert_type_string(int); %rename(ssl_get_alert_type_v) SSL_alert_type_string_long; extern const char *SSL_alert_type_string_long(int); %rename(ssl_get_alert_desc) SSL_alert_desc_string; extern const char *SSL_alert_desc_string(int); %rename(ssl_get_alert_desc_v) SSL_alert_desc_string_long; extern const char *SSL_alert_desc_string_long(int); %rename(sslv23_method) SSLv23_method; extern SSL_METHOD *SSLv23_method(void); %ignore TLSv1_method; extern SSL_METHOD *TLSv1_method(void); %typemap(out) SSL_CTX * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { m2_PyErr_Msg(_ssl_err); $result = NULL; } } %rename(ssl_ctx_new) SSL_CTX_new; extern SSL_CTX *SSL_CTX_new(SSL_METHOD *); %typemap(out) SSL_CTX *; %rename(ssl_ctx_free) SSL_CTX_free; extern void SSL_CTX_free(SSL_CTX *); %rename(ssl_ctx_set_verify_depth) SSL_CTX_set_verify_depth; extern void SSL_CTX_set_verify_depth(SSL_CTX *, int); %rename(ssl_ctx_get_verify_depth) SSL_CTX_get_verify_depth; extern int SSL_CTX_get_verify_depth(const SSL_CTX *); %rename(ssl_ctx_get_verify_mode) SSL_CTX_get_verify_mode; extern int SSL_CTX_get_verify_mode(const SSL_CTX *); %rename(ssl_ctx_set_cipher_list) SSL_CTX_set_cipher_list; extern int SSL_CTX_set_cipher_list(SSL_CTX *, const char *); %rename(ssl_ctx_add_session) SSL_CTX_add_session; extern int SSL_CTX_add_session(SSL_CTX *, SSL_SESSION *); %rename(ssl_ctx_remove_session) SSL_CTX_remove_session; extern int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *); %rename(ssl_ctx_set_session_timeout) SSL_CTX_set_timeout; extern long SSL_CTX_set_timeout(SSL_CTX *, long); %rename(ssl_ctx_get_session_timeout) SSL_CTX_get_timeout; extern long SSL_CTX_get_timeout(const SSL_CTX *); %rename(ssl_ctx_get_cert_store) SSL_CTX_get_cert_store; extern X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *); %rename(ssl_ctx_set_default_verify_paths) SSL_CTX_set_default_verify_paths; extern int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); %rename(ssl_get_ex_data_x509_store_ctx_idx) SSL_get_ex_data_X509_STORE_CTX_idx; extern int SSL_get_ex_data_X509_STORE_CTX_idx(void); %rename(bio_new_ssl) BIO_new_ssl; extern BIO *BIO_new_ssl(SSL_CTX *, int); %rename(ssl_new) SSL_new; extern SSL *SSL_new(SSL_CTX *); %rename(ssl_free) SSL_free; %threadallow SSL_free; extern void SSL_free(SSL *); %rename(ssl_dup) SSL_dup; extern SSL *SSL_dup(SSL *); %rename(ssl_set_bio) SSL_set_bio; extern void SSL_set_bio(SSL *, BIO *, BIO *); %rename(ssl_set_accept_state) SSL_set_accept_state; extern void SSL_set_accept_state(SSL *); %rename(ssl_set_connect_state) SSL_set_connect_state; extern void SSL_set_connect_state(SSL *); %rename(ssl_get_shutdown) SSL_get_shutdown; extern int SSL_get_shutdown(const SSL *); %rename(ssl_set_shutdown) SSL_set_shutdown; extern void SSL_set_shutdown(SSL *, int); %rename(ssl_shutdown) SSL_shutdown; %threadallow SSL_shutdown; extern int SSL_shutdown(SSL *); %rename(ssl_clear) SSL_clear; extern int SSL_clear(SSL *); %rename(ssl_do_handshake) SSL_do_handshake; %threadallow SSL_do_handshake; extern int SSL_do_handshake(SSL *); %rename(ssl_renegotiate) SSL_renegotiate; %threadallow SSL_renegotiate; extern int SSL_renegotiate(SSL *); %rename(ssl_pending) SSL_pending; extern int SSL_pending(const SSL *); %rename(ssl_get_peer_cert) SSL_get_peer_certificate; extern X509 *SSL_get_peer_certificate(const SSL *); %rename(ssl_get_current_cipher) SSL_get_current_cipher; extern SSL_CIPHER *SSL_get_current_cipher(const SSL *); %rename(ssl_get_verify_mode) SSL_get_verify_mode; extern int SSL_get_verify_mode(const SSL *); %rename(ssl_get_verify_depth) SSL_get_verify_depth; extern int SSL_get_verify_depth(const SSL *); %rename(ssl_get_verify_result) SSL_get_verify_result; extern long SSL_get_verify_result(const SSL *); %rename(ssl_get_ssl_ctx) SSL_get_SSL_CTX; extern SSL_CTX *SSL_get_SSL_CTX(const SSL *); %rename(ssl_get_default_session_timeout) SSL_get_default_timeout; extern long SSL_get_default_timeout(const SSL *); %rename(ssl_set_cipher_list) SSL_set_cipher_list; extern int SSL_set_cipher_list(SSL *, const char *); %rename(ssl_get_cipher_list) SSL_get_cipher_list; extern const char *SSL_get_cipher_list(const SSL *, int); %rename(ssl_cipher_get_name) SSL_CIPHER_get_name; extern const char *SSL_CIPHER_get_name(const SSL_CIPHER *); %rename(ssl_cipher_get_version) SSL_CIPHER_get_version; extern char *SSL_CIPHER_get_version(const SSL_CIPHER *); %rename(ssl_get_session) SSL_get_session; extern SSL_SESSION *SSL_get_session(const SSL *); %rename(ssl_get1_session) SSL_get1_session; extern SSL_SESSION *SSL_get1_session(SSL *); %rename(ssl_set_session) SSL_set_session; extern int SSL_set_session(SSL *, SSL_SESSION *); %rename(ssl_session_free) SSL_SESSION_free; extern void SSL_SESSION_free(SSL_SESSION *); %rename(ssl_session_print) SSL_SESSION_print; %threadallow SSL_SESSION_print; extern int SSL_SESSION_print(BIO *, const SSL_SESSION *); %rename(ssl_session_set_timeout) SSL_SESSION_set_timeout; extern long SSL_SESSION_set_timeout(SSL_SESSION *, long); %rename(ssl_session_get_timeout) SSL_SESSION_get_timeout; extern long SSL_SESSION_get_timeout(const SSL_SESSION *); extern PyObject *ssl_accept(SSL *ssl, double timeout = -1); extern PyObject *ssl_connect(SSL *ssl, double timeout = -1); extern PyObject *ssl_read(SSL *ssl, int num, double timeout = -1); extern int ssl_write(SSL *ssl, PyObject *blob, double timeout = -1); %constant int ssl_error_none = SSL_ERROR_NONE; %constant int ssl_error_ssl = SSL_ERROR_SSL; %constant int ssl_error_want_read = SSL_ERROR_WANT_READ; %constant int ssl_error_want_write = SSL_ERROR_WANT_WRITE; %constant int ssl_error_want_x509_lookup = SSL_ERROR_WANT_X509_LOOKUP; %constant int ssl_error_syscall = SSL_ERROR_SYSCALL; %constant int ssl_error_zero_return = SSL_ERROR_ZERO_RETURN; %constant int ssl_error_want_connect = SSL_ERROR_WANT_CONNECT; %constant int SSL_VERIFY_NONE = 0x00; %constant int SSL_VERIFY_PEER = 0x01; %constant int SSL_VERIFY_FAIL_IF_NO_PEER_CERT = 0x02; %constant int SSL_VERIFY_CLIENT_ONCE = 0x04; %constant int SSL_ST_CONNECT = 0x1000; %constant int SSL_ST_ACCEPT = 0x2000; %constant int SSL_ST_MASK = 0x0FFF; %constant int SSL_ST_INIT = (SSL_ST_CONNECT|SSL_ST_ACCEPT); %constant int SSL_ST_BEFORE = 0x4000; %constant int SSL_ST_OK = 0x03; /* SWIG 3.0.1 complains about the next line -- simplified declaration for now */ /*%constant int SSL_ST_RENEGOTIATE = (0x04|SSL_ST_INIT);*/ %constant int SSL_ST_RENEGOTIATE = (0x04|SSL_ST_CONNECT|SSL_ST_ACCEPT); %constant int SSL_CB_LOOP = 0x01; %constant int SSL_CB_EXIT = 0x02; %constant int SSL_CB_READ = 0x04; %constant int SSL_CB_WRITE = 0x08; %constant int SSL_CB_ALERT = 0x4000; /* used in callback */ %constant int SSL_CB_READ_ALERT = (SSL_CB_ALERT|SSL_CB_READ); %constant int SSL_CB_WRITE_ALERT = (SSL_CB_ALERT|SSL_CB_WRITE); %constant int SSL_CB_ACCEPT_LOOP = (SSL_ST_ACCEPT|SSL_CB_LOOP); %constant int SSL_CB_ACCEPT_EXIT = (SSL_ST_ACCEPT|SSL_CB_EXIT); %constant int SSL_CB_CONNECT_LOOP = (SSL_ST_CONNECT|SSL_CB_LOOP); %constant int SSL_CB_CONNECT_EXIT = (SSL_ST_CONNECT|SSL_CB_EXIT); %constant int SSL_CB_HANDSHAKE_START = 0x10; %constant int SSL_CB_HANDSHAKE_DONE = 0x20; %constant int SSL_SENT_SHUTDOWN = 1; %constant int SSL_RECEIVED_SHUTDOWN = 2; %constant int SSL_SESS_CACHE_OFF = 0x000; %constant int SSL_SESS_CACHE_CLIENT = 0x001; %constant int SSL_SESS_CACHE_SERVER = 0x002; %constant int SSL_SESS_CACHE_BOTH = (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER); %constant int SSL_OP_ALL = 0x00000FFFL; %constant int SSL_OP_NO_SSLv2 = 0x01000000L; %constant int SSL_OP_NO_SSLv3 = 0x02000000L; %constant int SSL_OP_NO_TLSv1 = 0x04000000L; %constant int SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 0x00000800L; %constant int SSL_MODE_ENABLE_PARTIAL_WRITE = SSL_MODE_ENABLE_PARTIAL_WRITE; %constant int SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER; %constant int SSL_MODE_AUTO_RETRY = SSL_MODE_AUTO_RETRY; %ignore ssl_handle_error; %ignore ssl_sleep_with_timeout; %warnfilter(454) _ssl_err; %warnfilter(454) _ssl_timeout_err; %inline %{ static PyObject *_ssl_err; static PyObject *_ssl_timeout_err; void ssl_init(PyObject *ssl_err, PyObject *ssl_timeout_err) { SSL_library_init(); SSL_load_error_strings(); Py_INCREF(ssl_err); Py_INCREF(ssl_timeout_err); _ssl_err = ssl_err; _ssl_timeout_err = ssl_timeout_err; } const SSL_METHOD *tlsv1_method(void) { #if OPENSSL_VERSION_NUMBER >= 0x10100000L PyErr_WarnEx(PyExc_DeprecationWarning, "Function TLSv1_method has been deprecated.", 1); #endif return TLSv1_method(); } void ssl_ctx_passphrase_callback(SSL_CTX *ctx, PyObject *pyfunc) { SSL_CTX_set_default_passwd_cb(ctx, passphrase_callback); SSL_CTX_set_default_passwd_cb_userdata(ctx, (void *)pyfunc); Py_INCREF(pyfunc); } int ssl_ctx_use_x509(SSL_CTX *ctx, X509 *x) { int i; if (!(i = SSL_CTX_use_certificate(ctx, x))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_use_cert(SSL_CTX *ctx, char *file) { int i; if (!(i = SSL_CTX_use_certificate_file(ctx, file, SSL_FILETYPE_PEM))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_use_cert_chain(SSL_CTX *ctx, char *file) { int i; if (!(i = SSL_CTX_use_certificate_chain_file(ctx, file))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_use_privkey(SSL_CTX *ctx, char *file) { int i; if (!(i = SSL_CTX_use_PrivateKey_file(ctx, file, SSL_FILETYPE_PEM))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_use_rsa_privkey(SSL_CTX *ctx, RSA *rsakey) { int i; if (!(i = SSL_CTX_use_RSAPrivateKey(ctx, rsakey))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_use_pkey_privkey(SSL_CTX *ctx, EVP_PKEY *pkey) { int i; if (!(i = SSL_CTX_use_PrivateKey(ctx, pkey))) { m2_PyErr_Msg(_ssl_err); return -1; } return i; } int ssl_ctx_check_privkey(SSL_CTX *ctx) { int ret; if (!(ret = SSL_CTX_check_private_key(ctx))) { m2_PyErr_Msg(_ssl_err); return -1; } return ret; } void ssl_ctx_set_client_CA_list_from_file(SSL_CTX *ctx, const char *ca_file) { SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(ca_file)); } void ssl_ctx_set_verify_default(SSL_CTX *ctx, int mode) { SSL_CTX_set_verify(ctx, mode, NULL); } void ssl_ctx_set_verify(SSL_CTX *ctx, int mode, PyObject *pyfunc) { Py_XDECREF(ssl_verify_cb_func); Py_INCREF(pyfunc); ssl_verify_cb_func = pyfunc; SSL_CTX_set_verify(ctx, mode, ssl_verify_callback); } int ssl_ctx_set_session_id_context(SSL_CTX *ctx, PyObject *sid_ctx) { const void *buf; int len = 0; if (m2_PyObject_AsReadBufferInt(sid_ctx, &buf, &len) == -1) return -1; return SSL_CTX_set_session_id_context(ctx, buf, len); } void ssl_ctx_set_info_callback(SSL_CTX *ctx, PyObject *pyfunc) { Py_XDECREF(ssl_info_cb_func); Py_INCREF(pyfunc); ssl_info_cb_func = pyfunc; SSL_CTX_set_info_callback(ctx, ssl_info_callback); } long ssl_ctx_set_tmp_dh(SSL_CTX *ctx, DH* dh) { return SSL_CTX_set_tmp_dh(ctx, dh); } void ssl_ctx_set_tmp_dh_callback(SSL_CTX *ctx, PyObject *pyfunc) { Py_XDECREF(ssl_set_tmp_dh_cb_func); Py_INCREF(pyfunc); ssl_set_tmp_dh_cb_func = pyfunc; SSL_CTX_set_tmp_dh_callback(ctx, ssl_set_tmp_dh_callback); } long ssl_ctx_set_tmp_rsa(SSL_CTX *ctx, RSA* rsa) { return SSL_CTX_set_tmp_rsa(ctx, rsa); } void ssl_ctx_set_tmp_rsa_callback(SSL_CTX *ctx, PyObject *pyfunc) { Py_XDECREF(ssl_set_tmp_rsa_cb_func); Py_INCREF(pyfunc); ssl_set_tmp_rsa_cb_func = pyfunc; SSL_CTX_set_tmp_rsa_callback(ctx, ssl_set_tmp_rsa_callback); } int ssl_ctx_load_verify_locations(SSL_CTX *ctx, const char *cafile, const char *capath) { return SSL_CTX_load_verify_locations(ctx, cafile, capath); } /* SSL_CTX_set_options is a macro. */ long ssl_ctx_set_options(SSL_CTX *ctx, long op) { return SSL_CTX_set_options(ctx, op); } int bio_set_ssl(BIO *bio, SSL *ssl, int flag) { SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY); return BIO_ctrl(bio, BIO_C_SET_SSL, flag, (char *)ssl); } long ssl_set_mode(SSL *ssl, long mode) { return SSL_set_mode(ssl, mode); } long ssl_get_mode(SSL *ssl) { return SSL_get_mode(ssl); } int ssl_set_tlsext_host_name(SSL *ssl, const char *name) { long l; if (!(l = SSL_set_tlsext_host_name(ssl, name))) { m2_PyErr_Msg(_ssl_err); return -1; } /* Return an "int" to match the 'typemap(out) int' in _lib.i */ return 1; } void ssl_set_client_CA_list_from_file(SSL *ssl, const char *ca_file) { SSL_set_client_CA_list(ssl, SSL_load_client_CA_file(ca_file)); } void ssl_set_client_CA_list_from_context(SSL *ssl, SSL_CTX *ctx) { SSL_set_client_CA_list(ssl, SSL_CTX_get_client_CA_list(ctx)); } int ssl_set_session_id_context(SSL *ssl, PyObject *sid_ctx) { const void *buf; int len = 0; if (m2_PyObject_AsReadBufferInt(sid_ctx, &buf, &len) == -1) return -1; return SSL_set_session_id_context(ssl, buf, len); } int ssl_set_fd(SSL *ssl, int fd) { int ret; if (!(ret = SSL_set_fd(ssl, fd))) { m2_PyErr_Msg(_ssl_err); return -1; } return ret; } static void ssl_handle_error(int ssl_err, int ret) { int err; switch (ssl_err) { case SSL_ERROR_SSL: PyErr_SetString(_ssl_err, ERR_reason_error_string(ERR_get_error())); break; case SSL_ERROR_SYSCALL: err = ERR_get_error(); if (err) PyErr_SetString(_ssl_err, ERR_reason_error_string(err)); else if (ret == 0) PyErr_SetString(_ssl_err, "unexpected eof"); else if (ret == -1) PyErr_SetFromErrno(_ssl_err); else assert(0); break; default: PyErr_SetString(_ssl_err, "unexpected SSL error"); } } #ifdef _WIN32 /* http://stackoverflow.com/questions/10905892/equivalent-of-gettimeday-for-windows */ int gettimeofday(struct timeval *tp, void *tzp) { // Note: some broken versions only have 8 trailing zero's, the correct epoch has 9 trailing zero's static const uint64_t EPOCH = ((uint64_t) 116444736000000000ULL); SYSTEMTIME system_time; FILETIME file_time; uint64_t time; GetSystemTime( &system_time ); SystemTimeToFileTime( &system_time, &file_time ); time = ((uint64_t)file_time.dwLowDateTime ) ; time += ((uint64_t)file_time.dwHighDateTime) << 32; tp->tv_sec = (long) ((time - EPOCH) / 10000000L); tp->tv_usec = (long) (system_time.wMilliseconds * 1000); return 0; } #endif static int ssl_sleep_with_timeout(SSL *ssl, const struct timeval *start, double timeout, int ssl_err) { #ifdef _WIN32 WSAPOLLFD fd; #else struct pollfd fd; #endif struct timeval tv; int ms, tmp; assert(timeout > 0); again: gettimeofday(&tv, NULL); /* tv >= start */ if ((timeout + start->tv_sec - tv.tv_sec) > INT_MAX / 1000) ms = -1; else { int fract; ms = ((start->tv_sec + (int)timeout) - tv.tv_sec) * 1000; fract = (int)((start->tv_usec + (timeout - (int)timeout) * 1000000 - tv.tv_usec + 999) / 1000); if (ms > 0 && fract > INT_MAX - ms) ms = -1; else { ms += fract; if (ms <= 0) goto timeout; } } switch (ssl_err) { case SSL_ERROR_WANT_READ: fd.fd = SSL_get_rfd(ssl); fd.events = POLLIN; break; case SSL_ERROR_WANT_WRITE: fd.fd = SSL_get_wfd(ssl); fd.events = POLLOUT; break; case SSL_ERROR_WANT_X509_LOOKUP: return 0; /* FIXME: is this correct? */ default: assert(0); } if (fd.fd == -1) { PyErr_SetString(_ssl_err, "timeout on a non-FD SSL"); return -1; } Py_BEGIN_ALLOW_THREADS #ifdef _WIN32 tmp = WSAPoll(&fd, 1, ms); #else tmp = poll(&fd, 1, ms); #endif Py_END_ALLOW_THREADS switch (tmp) { case 1: return 0; case 0: goto timeout; case -1: #ifdef _WIN32 if (WSAGetLastError() == EINTR) #else if (errno == EINTR) #endif goto again; PyErr_SetFromErrno(_ssl_err); return -1; } return 0; timeout: PyErr_SetString(_ssl_timeout_err, "timed out"); return -1; } PyObject *ssl_accept(SSL *ssl, double timeout) { PyObject *obj = NULL; int r, ssl_err; struct timeval tv; if (timeout > 0) gettimeofday(&tv, NULL); again: Py_BEGIN_ALLOW_THREADS r = SSL_accept(ssl); ssl_err = SSL_get_error(ssl, r); Py_END_ALLOW_THREADS switch (ssl_err) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: obj = PyLong_FromLong((long)1); break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: if (timeout <= 0) { obj = PyLong_FromLong((long)0); break; } if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0) goto again; obj = NULL; break; case SSL_ERROR_SSL: case SSL_ERROR_SYSCALL: ssl_handle_error(ssl_err, r); obj = NULL; break; } return obj; } PyObject *ssl_connect(SSL *ssl, double timeout) { PyObject *obj = NULL; int r, ssl_err; struct timeval tv; if (timeout > 0) gettimeofday(&tv, NULL); again: Py_BEGIN_ALLOW_THREADS r = SSL_connect(ssl); ssl_err = SSL_get_error(ssl, r); Py_END_ALLOW_THREADS switch (ssl_err) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: obj = PyLong_FromLong((long)1); break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: if (timeout <= 0) { obj = PyLong_FromLong((long)0); break; } if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0) goto again; obj = NULL; break; case SSL_ERROR_SSL: case SSL_ERROR_SYSCALL: ssl_handle_error(ssl_err, r); obj = NULL; break; } return obj; } void ssl_set_shutdown1(SSL *ssl, int mode) { SSL_set_shutdown(ssl, mode); } PyObject *ssl_read(SSL *ssl, int num, double timeout) { PyObject *obj = NULL; void *buf; int r; struct timeval tv; if (!(buf = PyMem_Malloc(num))) { PyErr_SetString(PyExc_MemoryError, "ssl_read"); return NULL; } if (timeout > 0) gettimeofday(&tv, NULL); again: Py_BEGIN_ALLOW_THREADS r = SSL_read(ssl, buf, num); Py_END_ALLOW_THREADS if (r >= 0) { buf = PyMem_Realloc(buf, r); obj = PyBytes_FromStringAndSize(buf, r); } else { int ssl_err; ssl_err = SSL_get_error(ssl, r); switch (ssl_err) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: assert(0); case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_X509_LOOKUP: if (timeout <= 0) { Py_INCREF(Py_None); obj = Py_None; break; } if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0) goto again; obj = NULL; break; case SSL_ERROR_SSL: case SSL_ERROR_SYSCALL: ssl_handle_error(ssl_err, r); obj = NULL; break; } } PyMem_Free(buf); return obj; } PyObject *ssl_read_nbio(SSL *ssl, int num) { PyObject *obj = NULL; void *buf; int r, err; if (!(buf = PyMem_Malloc(num))) { PyErr_SetString(PyExc_MemoryError, "ssl_read"); return NULL; } Py_BEGIN_ALLOW_THREADS r = SSL_read(ssl, buf, num); Py_END_ALLOW_THREADS switch (SSL_get_error(ssl, r)) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: buf = PyMem_Realloc(buf, r); obj = PyBytes_FromStringAndSize(buf, r); break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_X509_LOOKUP: Py_INCREF(Py_None); obj = Py_None; break; case SSL_ERROR_SSL: m2_PyErr_Msg(_ssl_err); obj = NULL; break; case SSL_ERROR_SYSCALL: err = ERR_get_error(); if (err) PyErr_SetString(_ssl_err, ERR_reason_error_string(err)); else if (r == 0) PyErr_SetString(_ssl_err, "unexpected eof"); else if (r == -1) PyErr_SetFromErrno(_ssl_err); obj = NULL; break; } PyMem_Free(buf); return obj; } int ssl_write(SSL *ssl, PyObject *blob, double timeout) { Py_buffer buf; int r, ssl_err, ret; struct timeval tv; if (m2_PyObject_GetBufferInt(blob, &buf, PyBUF_CONTIG_RO) == -1) { return -1; } if (timeout > 0) gettimeofday(&tv, NULL); again: Py_BEGIN_ALLOW_THREADS r = SSL_write(ssl, buf.buf, buf.len); ssl_err = SSL_get_error(ssl, r); Py_END_ALLOW_THREADS switch (ssl_err) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: ret = r; break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_X509_LOOKUP: if (timeout <= 0) { ret = -1; break; } if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0) goto again; ret = -1; break; case SSL_ERROR_SSL: case SSL_ERROR_SYSCALL: ssl_handle_error(ssl_err, r); default: ret = -1; } m2_PyBuffer_Release(blob, &buf); return ret; } int ssl_write_nbio(SSL *ssl, PyObject *blob) { Py_buffer buf; int r, err, ret; if (m2_PyObject_GetBufferInt(blob, &buf, PyBUF_CONTIG_RO) == -1) { return -1; } Py_BEGIN_ALLOW_THREADS r = SSL_write(ssl, buf.buf, buf.len); Py_END_ALLOW_THREADS switch (SSL_get_error(ssl, r)) { case SSL_ERROR_NONE: case SSL_ERROR_ZERO_RETURN: ret = r; break; case SSL_ERROR_WANT_WRITE: case SSL_ERROR_WANT_READ: case SSL_ERROR_WANT_X509_LOOKUP: ret = -1; break; case SSL_ERROR_SSL: ret = -1; break; case SSL_ERROR_SYSCALL: err = ERR_get_error(); if (err) PyErr_SetString(_ssl_err, ERR_reason_error_string(err)); else if (r == 0) PyErr_SetString(_ssl_err, "unexpected eof"); else if (r == -1) PyErr_SetFromErrno(_ssl_err); default: ret = -1; } m2_PyBuffer_Release(blob, &buf); return ret; } int ssl_cipher_get_bits(SSL_CIPHER *c) { return SSL_CIPHER_get_bits(c, NULL); } int sk_ssl_cipher_num(STACK_OF(SSL_CIPHER) *stack) { return sk_SSL_CIPHER_num(stack); } const SSL_CIPHER *sk_ssl_cipher_value(STACK_OF(SSL_CIPHER) *stack, int idx) { return sk_SSL_CIPHER_value(stack, idx); } STACK_OF(X509) *ssl_get_peer_cert_chain(SSL *ssl) { return SSL_get_peer_cert_chain(ssl); } int sk_x509_num(STACK_OF(X509) *stack) { return sk_X509_num(stack); } X509 *sk_x509_value(STACK_OF(X509) *stack, int idx) { return sk_X509_value(stack, idx); } %} %threadallow i2d_ssl_session; %inline %{ void i2d_ssl_session(BIO *bio, SSL_SESSION *sess) { i2d_SSL_SESSION_bio(bio, sess); } %} %typemap(out) SSL_SESSION * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { m2_PyErr_Msg(_ssl_err); $result = NULL; } } %threadallow ssl_session_read_pem; %inline %{ SSL_SESSION *ssl_session_read_pem(BIO *bio) { return PEM_read_bio_SSL_SESSION(bio, NULL, NULL, NULL); } %} %typemap(out) SSL_SESSION * ; %threadallow ssl_session_write_pem; %inline %{ int ssl_session_write_pem(SSL_SESSION *sess, BIO *bio) { return PEM_write_bio_SSL_SESSION(bio, sess); } int ssl_ctx_set_session_cache_mode(SSL_CTX *ctx, int mode) { return SSL_CTX_set_session_cache_mode(ctx, mode); } int ssl_ctx_get_session_cache_mode(SSL_CTX *ctx) { return SSL_CTX_get_session_cache_mode(ctx); } static long ssl_ctx_set_cache_size(SSL_CTX *ctx, long arg) { return SSL_CTX_sess_set_cache_size(ctx, arg); } int ssl_is_init_finished(SSL *ssl) { return SSL_is_init_finished(ssl); } %} M2Crypto-0.31.0/SWIG/_threads.i0000664000175000001440000000342313165756570016270 0ustar matejusers00000000000000/* Copyright (c) 1999 Ng Pheng Siong. All rights reserved. */ /* $Id$ */ %{ #include #include #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L #define CRYPTO_num_locks() (CRYPTO_NUM_LOCKS) static PyThread_type_lock lock_cs[CRYPTO_num_locks()]; static long lock_count[CRYPTO_num_locks()]; static int thread_mode = 0; #endif void threading_locking_callback(int mode, int type, const char *file, int line) { #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L if (mode & CRYPTO_LOCK) { PyThread_acquire_lock(lock_cs[type], WAIT_LOCK); lock_count[type]++; } else { PyThread_release_lock(lock_cs[type]); lock_count[type]--; } #endif } unsigned long threading_id_callback(void) { #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L return (unsigned long)PyThread_get_thread_ident(); #else return (unsigned long)0; #endif } %} %inline %{ void threading_init(void) { #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L int i; if (!thread_mode) { for (i=0; i %} %warnfilter(454) _util_err; %inline %{ static PyObject *_util_err; void util_init(PyObject *util_err) { Py_INCREF(util_err); _util_err = util_err; } PyObject *util_hex_to_string(PyObject *blob) { PyObject *obj; const void *buf; char *ret; Py_ssize_t len; if (PyObject_AsReadBuffer(blob, &buf, &len) == -1) return NULL; ret = hex_to_string((unsigned char *)buf, len); if (!ret) { m2_PyErr_Msg(_util_err); return NULL; } obj = PyBytes_FromString(ret); OPENSSL_free(ret); return obj; } PyObject *util_string_to_hex(PyObject *blob) { PyObject *obj; const void *buf; unsigned char *ret; Py_ssize_t len0; long len; if (PyObject_AsReadBuffer(blob, &buf, &len0) == -1) return NULL; len = len0; ret = string_to_hex((char *)buf, &len); if (ret == NULL) { m2_PyErr_Msg(_util_err); return NULL; } obj = PyBytes_FromStringAndSize((char*)ret, len); OPENSSL_free(ret); return obj; } %} M2Crypto-0.31.0/SWIG/_x509.i0000664000175000001440000006141613247615013015334 0ustar matejusers00000000000000/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ /* Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. */ /* ** Portions created by Open Source Applications Foundation (OSAF) are ** Copyright (C) 2004-2005 OSAF. All Rights Reserved. ** ** Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved. ** */ /* $Id$ */ %{ #include #include #include #include typedef STACK_OF(X509) SEQ_CERT; ASN1_ITEM_TEMPLATE(SEQ_CERT) = ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, SeqCert, X509) ASN1_ITEM_TEMPLATE_END(SEQ_CERT) IMPLEMENT_ASN1_FUNCTIONS(SEQ_CERT) %} %apply Pointer NONNULL { BIO * }; %apply Pointer NONNULL { X509 * }; %apply Pointer NONNULL { X509_CRL * }; %apply Pointer NONNULL { X509_REQ * }; %apply Pointer NONNULL { X509_NAME * }; %apply Pointer NONNULL { X509_NAME_ENTRY * }; %apply Pointer NONNULL { EVP_PKEY * }; #if OPENSSL_VERSION_NUMBER >= 0x0090800fL %rename(x509_check_ca) X509_check_ca; extern int X509_check_ca(X509 *); #endif %rename(x509_new) X509_new; extern X509 *X509_new( void ); %rename(x509_dup) X509_dup; extern X509 *X509_dup(X509 *); %rename(x509_free) X509_free; extern void X509_free(X509 *); %rename(x509_crl_free) X509_CRL_free; extern void X509_CRL_free(X509_CRL *); %rename(x509_crl_new) X509_CRL_new; extern X509_CRL * X509_CRL_new(); %rename(x509_print) X509_print; %threadallow X509_print; extern int X509_print(BIO *, X509 *); %rename(x509_crl_print) X509_CRL_print; %threadallow X509_CRL_print; extern int X509_CRL_print(BIO *, X509_CRL *); %rename(x509_get_serial_number) X509_get_serialNumber; extern ASN1_INTEGER *X509_get_serialNumber(X509 *); %rename(x509_set_serial_number) X509_set_serialNumber; extern int X509_set_serialNumber(X509 *, ASN1_INTEGER *); %rename(x509_get_pubkey) X509_get_pubkey; extern EVP_PKEY *X509_get_pubkey(X509 *); %rename(x509_set_pubkey) X509_set_pubkey; extern int X509_set_pubkey(X509 *, EVP_PKEY *); %rename(x509_get_issuer_name) X509_get_issuer_name; extern X509_NAME *X509_get_issuer_name(X509 *); %rename(x509_set_issuer_name) X509_set_issuer_name; extern int X509_set_issuer_name(X509 *, X509_NAME *); %rename(x509_get_subject_name) X509_get_subject_name; extern X509_NAME *X509_get_subject_name(X509 *); %rename(x509_set_subject_name) X509_set_subject_name; extern int X509_set_subject_name(X509 *, X509_NAME *); %rename(x509_cmp_current_time) X509_cmp_current_time; extern int X509_cmp_current_time(ASN1_TIME *); /* From x509.h */ /* standard trust ids */ %constant int X509_TRUST_DEFAULT = -1; %constant int X509_TRUST_COMPAT = 1; %constant int X509_TRUST_SSL_CLIENT = 2; %constant int X509_TRUST_SSL_SERVER = 3; %constant int X509_TRUST_EMAIL = 4; %constant int X509_TRUST_OBJECT_SIGN = 5; %constant int X509_TRUST_OCSP_SIGN = 6; %constant int X509_TRUST_OCSP_REQUEST = 7; /* trust_flags values */ %constant int X509_TRUST_DYNAMIC = 1; %constant int X509_TRUST_DYNAMIC_NAME = 2; /* check_trust return codes */ %constant int X509_TRUST_TRUSTED = 1; %constant int X509_TRUST_REJECTED = 2; %constant int X509_TRUST_UNTRUSTED = 3; /* From x509v3.h */ %constant int X509_PURPOSE_SSL_CLIENT = 1; %constant int X509_PURPOSE_SSL_SERVER = 2; %constant int X509_PURPOSE_NS_SSL_SERVER = 3; %constant int X509_PURPOSE_SMIME_SIGN = 4; %constant int X509_PURPOSE_SMIME_ENCRYPT = 5; %constant int X509_PURPOSE_CRL_SIGN = 6; %constant int X509_PURPOSE_ANY = 7; %constant int X509_PURPOSE_OCSP_HELPER = 8; %rename(x509_check_purpose) X509_check_purpose; extern int X509_check_purpose(X509 *, int, int); %rename(x509_check_trust) X509_check_trust; extern int X509_check_trust(X509 *, int, int); %rename(x509_write_pem) PEM_write_bio_X509; %threadallow PEM_write_bio_X509; extern int PEM_write_bio_X509(BIO *, X509 *); %rename(x509_write_pem_file) PEM_write_X509; extern int PEM_write_X509(FILE *, X509 *); %rename(x509_verify) X509_verify; extern int X509_verify(X509 *a, EVP_PKEY *r); %rename(x509_get_verify_error) X509_verify_cert_error_string; extern const char *X509_verify_cert_error_string(long); %constant long X509V3_EXT_UNKNOWN_MASK = (0xfL << 16); %constant long X509V3_EXT_DEFAULT = 0; %constant long X509V3_EXT_ERROR_UNKNOWN = (1L << 16); %constant long X509V3_EXT_PARSE_UNKNOWN = (2L << 16); %constant long X509V3_EXT_DUMP_UNKNOWN = (3L << 16); %rename(x509_add_ext) X509_add_ext; extern int X509_add_ext(X509 *, X509_EXTENSION *, int); %rename(x509_get_ext_count) X509_get_ext_count; extern int X509_get_ext_count(X509 *); %rename(x509_get_ext) X509_get_ext; extern X509_EXTENSION *X509_get_ext(X509 *, int); %rename(x509_ext_print) X509V3_EXT_print; %threadallow X509V3_EXT_print; extern int X509V3_EXT_print(BIO *, X509_EXTENSION *, unsigned long, int); %rename(x509_name_new) X509_NAME_new; extern X509_NAME *X509_NAME_new( void ); %rename(x509_name_free) X509_NAME_free; extern void X509_NAME_free(X509_NAME *); %rename(x509_name_print) X509_NAME_print; %threadallow X509_NAME_print; extern int X509_NAME_print(BIO *, X509_NAME *, int); %rename(x509_name_get_entry) X509_NAME_get_entry; extern X509_NAME_ENTRY *X509_NAME_get_entry(X509_NAME *, int); %rename(x509_name_entry_count) X509_NAME_entry_count; extern int X509_NAME_entry_count(X509_NAME *); %rename(x509_name_delete_entry) X509_NAME_delete_entry; extern X509_NAME_ENTRY *X509_NAME_delete_entry(X509_NAME *, int); %rename(x509_name_add_entry) X509_NAME_add_entry; extern int X509_NAME_add_entry(X509_NAME *, X509_NAME_ENTRY *, int, int); %rename(x509_name_add_entry_by_obj) X509_NAME_add_entry_by_OBJ; extern int X509_NAME_add_entry_by_OBJ(X509_NAME *, ASN1_OBJECT *, int, unsigned char *, int, int, int ); %rename(x509_name_add_entry_by_nid) X509_NAME_add_entry_by_NID; extern int X509_NAME_add_entry_by_NID(X509_NAME *, int, int, unsigned char *, int, int, int ); %rename(x509_name_print_ex) X509_NAME_print_ex; %threadallow X509_NAME_print_ex; extern int X509_NAME_print_ex(BIO *, X509_NAME *, int, unsigned long); #if OPENSSL_VERSION_NUMBER >= 0x10000000L %rename(x509_name_hash) X509_NAME_hash_old; extern unsigned long X509_NAME_hash_old(X509_NAME *); #else %rename(x509_name_hash) X509_NAME_hash; extern unsigned long X509_NAME_hash(X509_NAME *); #endif %rename(x509_name_get_index_by_nid) X509_NAME_get_index_by_NID; extern int X509_NAME_get_index_by_NID(X509_NAME *, int, int); %rename(x509_name_entry_new) X509_NAME_ENTRY_new; extern X509_NAME_ENTRY *X509_NAME_ENTRY_new( void ); %rename(x509_name_entry_free) X509_NAME_ENTRY_free; extern void X509_NAME_ENTRY_free( X509_NAME_ENTRY *); /*XXX This is probably bogus:*/ %rename(x509_name_entry_create_by_nid) X509_NAME_ENTRY_create_by_NID; extern X509_NAME_ENTRY *X509_NAME_ENTRY_create_by_NID( X509_NAME_ENTRY **, int, int, unsigned char *, int); %rename(x509_name_entry_set_object) X509_NAME_ENTRY_set_object; extern int X509_NAME_ENTRY_set_object( X509_NAME_ENTRY *, ASN1_OBJECT *); %rename(x509_name_entry_get_object) X509_NAME_ENTRY_get_object; extern ASN1_OBJECT *X509_NAME_ENTRY_get_object(X509_NAME_ENTRY *); %rename(x509_name_entry_get_data) X509_NAME_ENTRY_get_data; extern ASN1_STRING *X509_NAME_ENTRY_get_data(X509_NAME_ENTRY *); %typemap(in) (const unsigned char *, int) { #if PY_MAJOR_VERSION >= 3 if (PyBytes_Check($input)) { Py_ssize_t len; $1 = PyBytes_AsString($input); len = PyBytes_Size($input); #else if (PyString_Check($input)) { Py_ssize_t len; $1 = (unsigned char *)PyString_AsString($input); len = PyString_Size($input); #endif // PY_MAJOR_VERSION >= 3 if (len > INT_MAX) { PyErr_SetString(_x509_err, "object too large"); return NULL; } $2 = len; } else { PyErr_SetString(PyExc_TypeError, "expected string"); return NULL; } } %rename(x509_name_entry_set_data) X509_NAME_ENTRY_set_data; extern int X509_NAME_ENTRY_set_data(X509_NAME_ENTRY *, int, const unsigned char *, int); %typemap(in) (const unsigned char *, int); %rename(x509_req_new) X509_REQ_new; extern X509_REQ * X509_REQ_new(); %rename(x509_req_free) X509_REQ_free; extern void X509_REQ_free(X509_REQ *); %rename(x509_req_print) X509_REQ_print; %threadallow X509_REQ_print; extern int X509_REQ_print(BIO *, X509_REQ *); %rename(x509_req_get_pubkey) X509_REQ_get_pubkey; extern EVP_PKEY *X509_REQ_get_pubkey(X509_REQ *); %rename(x509_req_set_pubkey) X509_REQ_set_pubkey; extern int X509_REQ_set_pubkey(X509_REQ *, EVP_PKEY *); %rename(x509_req_set_subject_name) X509_REQ_set_subject_name; extern int X509_REQ_set_subject_name(X509_REQ *, X509_NAME *); %rename(x509_req_verify) X509_REQ_verify; extern int X509_REQ_verify(X509_REQ *, EVP_PKEY *); %rename(x509_req_sign) X509_REQ_sign; extern int X509_REQ_sign(X509_REQ *, EVP_PKEY *, const EVP_MD *); %rename(i2d_x509_bio) i2d_X509_bio; %threadallow i2d_X509_bio; extern int i2d_X509_bio(BIO *, X509 *); %rename(i2d_x509_req_bio) i2d_X509_REQ_bio; %threadallow i2d_X509_REQ_bio; extern int i2d_X509_REQ_bio(BIO *, X509_REQ *); %rename(x509_store_new) X509_STORE_new; extern X509_STORE *X509_STORE_new(void); %rename(x509_store_free) X509_STORE_free; extern void X509_STORE_free(X509_STORE *); %rename(x509_store_add_cert) X509_STORE_add_cert; extern int X509_STORE_add_cert(X509_STORE *, X509 *); %rename(x509_store_set_verify_cb) X509_STORE_set_verify_cb; extern void X509_STORE_set_verify_cb(X509_STORE *st, int (*verify_cb)(int ok, X509_STORE_CTX *ctx)); %rename(x509_store_ctx_get_current_cert) X509_STORE_CTX_get_current_cert; extern X509 *X509_STORE_CTX_get_current_cert(X509_STORE_CTX *); %rename(x509_store_ctx_get_error) X509_STORE_CTX_get_error; extern int X509_STORE_CTX_get_error(X509_STORE_CTX *); %rename(x509_store_ctx_get_error_depth) X509_STORE_CTX_get_error_depth; extern int X509_STORE_CTX_get_error_depth(X509_STORE_CTX *); %rename(x509_store_ctx_free) X509_STORE_CTX_free; extern void X509_STORE_CTX_free(X509_STORE_CTX *); %rename(x509_store_ctx_get1_chain) X509_STORE_CTX_get1_chain; extern STACK_OF(X509) *X509_STORE_CTX_get1_chain(X509_STORE_CTX *); %rename(x509_extension_get_critical) X509_EXTENSION_get_critical; extern int X509_EXTENSION_get_critical(X509_EXTENSION *); %rename(x509_extension_set_critical) X509_EXTENSION_set_critical; extern int X509_EXTENSION_set_critical(X509_EXTENSION *, int); %typemap(out) X509 * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { m2_PyErr_Msg(_x509_err); $result = NULL; } } /* Functions using m2_PyErr_Msg and thus using internal Python C API are * not thread safe, so if we want to have %threadallow here, error * handling must be done outside of these internal functions. */ %threadallow x509_read_pem; %inline %{ X509 *x509_read_pem(BIO *bio) { return PEM_read_bio_X509(bio, NULL, NULL, NULL); } %} %threadallow d2i_x509; %inline %{ X509 *d2i_x509(BIO *bio) { return d2i_X509_bio(bio, NULL); } %} %typemap(out) X509 *; %constant int NID_commonName = 13; %constant int NID_countryName = 14; %constant int NID_localityName = 15; %constant int NID_stateOrProvinceName = 16; %constant int NID_organizationName = 17; %constant int NID_organizationalUnitName = 18; %constant int NID_serialNumber = 105; %constant int NID_surname = 100; %constant int NID_givenName = 99; %constant int NID_pkcs9_emailAddress = 48; /* Cribbed from x509_vfy.h. */ %constant int X509_V_OK = 0; %constant int X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 2; %constant int X509_V_ERR_UNABLE_TO_GET_CRL = 3; %constant int X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE = 4; %constant int X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE = 5; %constant int X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY = 6; %constant int X509_V_ERR_CERT_SIGNATURE_FAILURE = 7; %constant int X509_V_ERR_CRL_SIGNATURE_FAILURE = 8; %constant int X509_V_ERR_CERT_NOT_YET_VALID = 9; %constant int X509_V_ERR_CERT_HAS_EXPIRED = 10; %constant int X509_V_ERR_CRL_NOT_YET_VALID = 11; %constant int X509_V_ERR_CRL_HAS_EXPIRED = 12; %constant int X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 13; %constant int X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 14; %constant int X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD = 15; %constant int X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 16; %constant int X509_V_ERR_OUT_OF_MEM = 17; %constant int X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 18; %constant int X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 19; %constant int X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 20; %constant int X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 21; %constant int X509_V_ERR_CERT_CHAIN_TOO_LONG = 22; %constant int X509_V_ERR_CERT_REVOKED = 23; %constant int X509_V_ERR_INVALID_CA = 24; %constant int X509_V_ERR_PATH_LENGTH_EXCEEDED = 25; %constant int X509_V_ERR_INVALID_PURPOSE = 26; %constant int X509_V_ERR_CERT_UNTRUSTED = 27; %constant int X509_V_ERR_CERT_REJECTED = 28; %constant int X509_V_ERR_APPLICATION_VERIFICATION = 50; /* x509.h */ %constant int XN_FLAG_COMPAT = 0; %constant int XN_FLAG_SEP_COMMA_PLUS = (1 << 16); %constant int XN_FLAG_SEP_CPLUS_SPC = (2 << 16); %constant int XN_FLAG_SEP_MULTILINE = (4 << 16); %constant int XN_FLAG_DN_REV = (1 << 20); %constant int XN_FLAG_FN_LN = (1 << 21); %constant int XN_FLAG_SPC_EQ = (1 << 23); %constant int XN_FLAG_DUMP_UNKNOWN_FIELDS = (1 << 24); %constant int XN_FLAG_FN_ALIGN = (1 << 25); %constant int XN_FLAG_ONELINE =(ASN1_STRFLGS_RFC2253 | \ ASN1_STRFLGS_ESC_QUOTE | \ XN_FLAG_SEP_CPLUS_SPC | \ XN_FLAG_SPC_EQ); %constant int XN_FLAG_MULTILINE = (ASN1_STRFLGS_ESC_CTRL | \ ASN1_STRFLGS_ESC_MSB | \ XN_FLAG_SEP_MULTILINE | \ XN_FLAG_SPC_EQ | \ XN_FLAG_FN_LN | \ XN_FLAG_FN_ALIGN); %constant int XN_FLAG_RFC2253 = (ASN1_STRFLGS_RFC2253 | \ XN_FLAG_SEP_COMMA_PLUS | \ XN_FLAG_DN_REV | \ XN_FLAG_DUMP_UNKNOWN_FIELDS); /* Cribbed from rsa.h. */ %constant int RSA_3 = 0x3L; %constant int RSA_F4 = 0x10001L; %warnfilter(454) _x509_err; %inline %{ static PyObject *_x509_err; void x509_init(PyObject *x509_err) { Py_INCREF(x509_err); _x509_err = x509_err; } %} %typemap(out) X509_REQ * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { m2_PyErr_Msg(_x509_err); $result = NULL; } } %threadallow d2i_x509_req; %inline %{ X509_REQ *d2i_x509_req(BIO *bio) { return d2i_X509_REQ_bio(bio, NULL); } %} %threadallow x509_req_read_pem; %inline %{ X509_REQ *x509_req_read_pem(BIO *bio) { return PEM_read_bio_X509_REQ(bio, NULL, NULL, NULL); } %} %typemap(out) X509_REQ *; %inline %{ PyObject *i2d_x509(X509 *x) { int len; PyObject *ret = NULL; unsigned char *buf = NULL; len = i2d_X509(x, &buf); if (len < 0) { m2_PyErr_Msg(_x509_err); } else { ret = PyBytes_FromStringAndSize((char*)buf, len); OPENSSL_free(buf); } return ret; } %} %threadallow x509_req_write_pem; %inline %{ int x509_req_write_pem(BIO *bio, X509_REQ *x) { return PEM_write_bio_X509_REQ(bio, x); } %} %typemap(out) X509_CRL * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { m2_PyErr_Msg(_x509_err); $result = NULL; } } %threadallow x509_crl_read_pem; %inline %{ X509_CRL *x509_crl_read_pem(BIO *bio) { return PEM_read_bio_X509_CRL(bio, NULL, NULL, NULL); } %} %typemap(out) X509_CRL * ; %inline %{ /* X509_set_version() is a macro. */ int x509_set_version(X509 *x, long version) { return X509_set_version(x, version); } /* X509_get_version() is a macro. */ long x509_get_version(X509 *x) { return X509_get_version(x); } /* X509_set_notBefore() is a macro. */ int x509_set_not_before(X509 *x, ASN1_TIME *tm) { return X509_set_notBefore(x, tm); } /* X509_get_notBefore() is a macro. */ ASN1_TIME *x509_get_not_before(X509 *x) { return X509_get_notBefore(x); } /* X509_set_notAfter() is a macro. */ int x509_set_not_after(X509 *x, ASN1_TIME *tm) { return X509_set_notAfter(x, tm); } /* X509_get_notAfter() is a macro. */ ASN1_TIME *x509_get_not_after(X509 *x) { return X509_get_notAfter(x); } int x509_sign(X509 *x, EVP_PKEY *pkey, EVP_MD *md) { return X509_sign(x, pkey, md); } /* x509_gmtime_adj() is a macro. */ ASN1_TIME *x509_gmtime_adj(ASN1_TIME *s, long adj) { return X509_gmtime_adj(s, adj); } PyObject *x509_name_by_nid(X509_NAME *name, int nid) { void *buf; int len, xlen; PyObject *ret; if ((len = X509_NAME_get_text_by_NID(name, nid, NULL, 0)) == -1) { Py_RETURN_NONE; } len++; if (!(buf = PyMem_Malloc(len))) { PyErr_SetString(PyExc_MemoryError, "x509_name_by_nid"); return NULL; } xlen = X509_NAME_get_text_by_NID(name, nid, buf, len); ret = PyBytes_FromStringAndSize(buf, xlen); PyMem_Free(buf); return ret; } int x509_name_set_by_nid(X509_NAME *name, int nid, PyObject *obj) { return X509_NAME_add_entry_by_NID(name, nid, MBSTRING_ASC, (unsigned char *)PyBytes_AsString(obj), -1, -1, 0); } /* x509_name_add_entry_by_txt */ int x509_name_add_entry_by_txt(X509_NAME *name, char *field, int type, char *bytes, int len, int loc, int set) { return X509_NAME_add_entry_by_txt(name, field, type, (unsigned char *)bytes, len, loc, set); } PyObject *x509_name_get_der(X509_NAME *name) { const char* pder=""; size_t pderlen; i2d_X509_NAME(name, 0); if (!X509_NAME_get0_der(name, (const unsigned char **)pder, &pderlen)) { m2_PyErr_Msg(_x509_err); return NULL; } return PyBytes_FromStringAndSize(pder, pderlen); } /* sk_X509_free() is a macro. */ void sk_x509_free(STACK_OF(X509) *stack) { sk_X509_free(stack); } /* sk_X509_push() is a macro. */ int sk_x509_push(STACK_OF(X509) *stack, X509 *x509) { return sk_X509_push(stack, x509); } /* sk_X509_pop() is a macro. */ X509 *sk_x509_pop(STACK_OF(X509) *stack) { return sk_X509_pop(stack); } %} %inline %{ int x509_store_load_locations(X509_STORE *store, const char *file) { int locations = 0; if ((locations = X509_STORE_load_locations(store, file, NULL)) < 1) { m2_PyErr_Msg(_x509_err); } return locations; } int x509_type_check(X509 *x509) { return 1; } int x509_name_type_check(X509_NAME *name) { return 1; } X509_NAME *x509_req_get_subject_name(X509_REQ *x) { return X509_REQ_get_subject_name(x); } long x509_req_get_version(X509_REQ *x) { return X509_REQ_get_version(x); } int x509_req_set_version(X509_REQ *x, long version) { return X509_REQ_set_version(x, version); } int x509_req_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts) { return X509_REQ_add_extensions(req, exts); } X509_NAME_ENTRY *x509_name_entry_create_by_txt(X509_NAME_ENTRY **ne, char *field, int type, char *bytes, int len) { return X509_NAME_ENTRY_create_by_txt( ne, field, type, (unsigned char *)bytes, len); } %} %typemap(out) X509V3_CTX * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { $result = NULL; } } %inline %{ X509V3_CTX * x509v3_set_nconf(void) { X509V3_CTX * ctx; CONF *conf = NCONF_new(NULL); if (!(ctx=(X509V3_CTX *)PyMem_Malloc(sizeof(X509V3_CTX)))) { PyErr_SetString(PyExc_MemoryError, "x509v3_set_nconf"); return NULL; } /* X509V3_set_nconf does not generate any error signs at all. */ X509V3_set_nconf(ctx, conf); return ctx; } %} %typemap(out) X509V3_CTX * ; %typemap(out) X509_EXTENSION * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { m2_PyErr_Msg(_x509_err); $result = NULL; } } %inline %{ X509_EXTENSION * x509v3_ext_conf(void *conf, X509V3_CTX *ctx, char *name, char *value) { X509_EXTENSION * ext = NULL; ext = X509V3_EXT_conf(conf, ctx, name, value); PyMem_Free(ctx); return ext; } %} %typemap(out) X509_EXTENSION * ; %inline %{ /* X509_EXTENSION_free() might be a macro, didn't find definition. */ void x509_extension_free(X509_EXTENSION *ext) { X509_EXTENSION_free(ext); } PyObject *x509_extension_get_name(X509_EXTENSION *ext) { PyObject * ext_name; const char * ext_name_str; ext_name_str = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext))); if (!ext_name_str) { m2_PyErr_Msg(_x509_err); return NULL; } ext_name = PyBytes_FromStringAndSize(ext_name_str, strlen(ext_name_str)); return ext_name; } /* sk_X509_EXTENSION_new_null is a macro. */ STACK_OF(X509_EXTENSION) *sk_x509_extension_new_null(void) { return sk_X509_EXTENSION_new_null(); } /* sk_X509_EXTENSION_free() is a macro. */ void sk_x509_extension_free(STACK_OF(X509_EXTENSION) *stack) { sk_X509_EXTENSION_free(stack); } /* sk_X509_EXTENSION_push() is a macro. */ int sk_x509_extension_push(STACK_OF(X509_EXTENSION) *stack, X509_EXTENSION *x509_ext) { return sk_X509_EXTENSION_push(stack, x509_ext); } /* sk_X509_EXTENSION_pop() is a macro. */ X509_EXTENSION *sk_x509_extension_pop(STACK_OF(X509_EXTENSION) *stack) { return sk_X509_EXTENSION_pop(stack); } /* sk_X509_EXTENSION_num() is a macro. */ int sk_x509_extension_num(STACK_OF(X509_EXTENSION) *stack) { return sk_X509_EXTENSION_num(stack); } /* sk_X509_EXTENSION_value() is a macro. */ X509_EXTENSION *sk_x509_extension_value(STACK_OF(X509_EXTENSION) *stack, int i) { return sk_X509_EXTENSION_value(stack, i); } /* X509_STORE_CTX_get_app_data is a macro. */ void *x509_store_ctx_get_app_data(X509_STORE_CTX *ctx) { return X509_STORE_CTX_get_app_data(ctx); } /* X509_STORE_CTX_get_app_data is a macro. */ void *x509_store_ctx_get_ex_data(X509_STORE_CTX *ctx, int idx) { return X509_STORE_CTX_get_ex_data(ctx, idx); } void x509_store_set_verify_cb(X509_STORE *store, PyObject *pyfunc) { Py_XDECREF(x509_store_verify_cb_func); Py_INCREF(pyfunc); x509_store_verify_cb_func = pyfunc; X509_STORE_set_verify_cb(store, x509_store_verify_callback); } %} %typemap(out) STACK_OF(X509) * { PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */ if ($1 != NULL) $result = SWIG_NewPointerObj($1, $1_descriptor, 0); else { $result = NULL; } } %inline %{ STACK_OF(X509) * make_stack_from_der_sequence(PyObject * pyEncodedString){ STACK_OF(X509) *certs; Py_ssize_t encoded_string_len; char *encoded_string; const unsigned char *tmp_str; encoded_string_len = PyBytes_Size(pyEncodedString); if (encoded_string_len > INT_MAX) { PyErr_Format(_x509_err, "object too large"); return NULL; } encoded_string = PyBytes_AsString(pyEncodedString); if (!encoded_string) { PyErr_SetString(_x509_err, "Cannot convert Python Bytes to (char *)."); return NULL; } tmp_str = (unsigned char *)encoded_string; certs = d2i_SEQ_CERT(NULL, &tmp_str, encoded_string_len); if (certs == NULL) { PyErr_SetString(_x509_err, "Generating STACK_OF(X509) failed."); return NULL; } return certs; } /* sk_X509_new_null() is a macro returning "STACK_OF(X509) *". */ STACK_OF(X509) *sk_x509_new_null(void) { return sk_X509_new_null(); } %} %typemap(out) STACK_OF(X509) *; %inline %{ PyObject * get_der_encoding_stack(STACK_OF(X509) *stack){ PyObject * encodedString; unsigned char * encoding = NULL; int len; len = i2d_SEQ_CERT(stack, &encoding); if (!encoding) { m2_PyErr_Msg(_x509_err); return NULL; } encodedString = PyBytes_FromStringAndSize((const char *)encoding, len); if (encoding) OPENSSL_free(encoding); return encodedString; } %} /* Free malloc'ed return value for x509_name_oneline */ %typemap(ret) char * { if ($1 != NULL) OPENSSL_free($1); } %inline %{ char *x509_name_oneline(X509_NAME *x) { return X509_NAME_oneline(x, NULL, 0); } %} %typemap(ret) char *; M2Crypto-0.31.0/SWIG/libcrypto-compat.h0000664000175000001440000000524713247615013017757 0ustar matejusers00000000000000#ifndef LIBCRYPTO_COMPAT_H #define LIBCRYPTO_COMPAT_H #if OPENSSL_VERSION_NUMBER < 0x10100000L #include #include #include #include #include #include int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d); int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q); int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp); void RSA_get0_key(const RSA *r, const BIGNUM **n, const BIGNUM **e, const BIGNUM **d); void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q); void RSA_get0_crt_params(const RSA *r, const BIGNUM **dmp1, const BIGNUM **dmq1, const BIGNUM **iqmp); void DSA_get0_pqg(const DSA *d, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g); int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g); void DSA_get0_key(const DSA *d, const BIGNUM **pub_key, const BIGNUM **priv_key); int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key); void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s); void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps); int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s); void DH_get0_pqg(const DH *dh, const BIGNUM **p, const BIGNUM **q, const BIGNUM **g); int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g); void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key); int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key); int DH_set_length(DH *dh, long length); const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx); unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx); EVP_MD_CTX *EVP_MD_CTX_new(void); void EVP_MD_CTX_free(EVP_MD_CTX *ctx); #define EVP_CIPHER_impl_ctx_size(e) e->ctx_size #define EVP_CIPHER_CTX_get_cipher_data(ctx) ctx->cipher_data int RSA_size(const RSA* rsa); RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth); int RSA_meth_set1_name(RSA_METHOD *meth, const char *name); #define RSA_meth_get_finish(meth) meth->finish int RSA_meth_set_priv_enc(RSA_METHOD *meth, int (*priv_enc) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); int RSA_meth_set_priv_dec(RSA_METHOD *meth, int (*priv_dec) (int flen, const unsigned char *from, unsigned char *to, RSA *rsa, int padding)); int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish) (RSA *rsa)); void RSA_meth_free(RSA_METHOD *meth); int RSA_bits(const RSA *r); RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey); int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder, size_t *pderlen); #endif /* OPENSSL_VERSION_NUMBER */ #endif /* LIBCRYPTO_COMPAT_H */ M2Crypto-0.31.0/SWIG/py3k_compat.h0000664000175000001440000000207213236336220016707 0ustar matejusers00000000000000#ifndef PY3K_COMPAT_H #define PY3K_COMPAT_H #if PY_MAJOR_VERSION >= 3 FILE* PyFile_AsFile(PyObject *p); PyObject* PyFile_Name(PyObject *p); #else /* PY2K */ /* Concerning PyBytes* functions: * * Python 3’s str() type is equivalent to Python 2’s unicode(); the * C functions are called PyUnicode_* for both. The old 8-bit string * type has become bytes(), with C functions called PyBytes_*. Python * 2.6 and later provide a compatibility header, bytesobject.h, mapping * PyBytes names to PyString ones. For best compatibility with Python 3, * PyUnicode should be used for textual data and PyBytes for binary * data. It’s also important to remember that PyBytes and PyUnicode in * Python 3 are not interchangeable like PyString and PyUnicode are in * Python 2. The following example shows best practices with regards to * PyUnicode, PyString, and PyBytes. * * From https://docs.python.org/2.7/howto/cporting.html */ PyObject* PyLong_FromLong(long x); const char* PyUnicode_AsUTF8(PyObject *unicode); #endif /* PY_MAJOR_VERSION */ #endif /* PY3K_COMPAT_H */ M2Crypto-0.31.0/appveyor.yml0000644000175000001440000001224213356647701016136 0ustar matejusers00000000000000environment: global: # PyPI login environment: USER: secure: oqWqarxnd4H23FMywnlQeg== PASS: secure: j/VSxdYJ7mdR44u8OdywLg== X86_OPENSSL_INSTALLER: Win32OpenSSL-1_1_0i.exe X64_OPENSSL_INSTALLER: Win64OpenSSL-1_1_0i.exe matrix: # Pre-installed Python versions, which Appveyor may upgrade to # a later point release. - PYTHON: "C:\\Python36" PYTHON_VERSION: "3.6.x" # currently 3.6.4 PYTHON_ARCH: "32" OPENSSL_PATH: "C:\\OpenSSL-1-1-Win32" PYWIN32: "pywin32-222.win32-py3.6.exe" PYWIN32_RELEASE: b222 - PYTHON: "C:\\Python36-x64" PYTHON_VERSION: "3.6.x" # currently 3.6.4 PYTHON_ARCH: "64" OPENSSL_PATH: "C:\\OpenSSL-1-1-Win64" PYWIN32: "pywin32-222.win-amd64-py3.6.exe" PYWIN32_RELEASE: b222 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - PYTHON: "C:\\Python35" PYTHON_VERSION: "3.5.x" # currently 3.6.4 PYTHON_ARCH: "32" OPENSSL_PATH: "C:\\OpenSSL-1-1-Win32" PYWIN32: "pywin32-222.win32-py3.5.exe" PYWIN32_RELEASE: b222 - PYTHON: "C:\\Python35-x64" PYTHON_VERSION: "3.5.x" # currently 3.6.4 PYTHON_ARCH: "64" OPENSSL_PATH: "C:\\OpenSSL-1-1-Win64" PYWIN32: "pywin32-222.win-amd64-py3.5.exe" PYWIN32_RELEASE: b222 APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017 - PYTHON: "C:\\Python27" PYTHON_VERSION: "2.7.x" # currently 2.7.9 PYTHON_ARCH: "32" OPENSSL_PATH: "C:\\OpenSSL-Win32" PYWIN32: "pywin32-222.win32-py2.7.exe" PYWIN32_RELEASE: b222 - PYTHON: "C:\\Python27" PYTHON_VERSION: "2.7.x" # currently 2.7.9 PYTHON_ARCH: "32" OPENSSL_PATH: "C:\\OpenSSL-1-1-Win32" PYWIN32: "pywin32-222.win32-py2.7.exe" PYWIN32_RELEASE: b222 - PYTHON: "C:\\Python27-x64" PYTHON_VERSION: "2.7.x" # currently 2.7.9 PYTHON_ARCH: "64" OPENSSL_PATH: "C:\\OpenSSL-1-1-Win64" PYWIN32: "pywin32-222.win-amd64-py2.7.exe" PYWIN32_RELEASE: b222 - PYTHON: "C:\\Python27-x64" PYTHON_VERSION: "2.7.x" # currently 2.7.9 PYTHON_ARCH: "64" OPENSSL_PATH: "C:\\OpenSSL-1-1-Win64" PYWIN32: "pywin32-222.win-amd64-py2.7.exe" PYWIN32_RELEASE: b222 nuget: account_feed: true install: # Install non-python dependencies using chocolatey package manager - choco install -r -y swig # Install Python (from the official .msi of http://python.org) and pip when # not already installed. - ps: if (-not(Test-Path($env:PYTHON))) { & appveyor\install.ps1 } # Prepend newly installed Python to the PATH of this build (this cannot be # done from inside the powershell script as it would require to restart # the parent CMD process). - "SET PATH=%PYTHON%;%PYTHON%\\Scripts;%PATH%;%OPENSSL_PATH%\\bin" # Check that we have the expected version and architecture for Python - "python --version" - "python -c \"import struct; print(struct.calcsize('P') * 8)\"" # Install the build dependencies of the project. If some dependencies contain # compiled extensions and are not provided as pre-built wheel packages, # pip will build them from source using the MSVC compiler matching the # target Python version and architecture - "%PYTHON%\\Scripts\\pip.exe install -r dev-requirements.txt" - ECHO "Install OpenSSL 1.1.0 32bit" - curl -o "c:\\%X86_OPENSSL_INSTALLER%" -fsSL "https://slproweb.com/download/%X86_OPENSSL_INSTALLER%" - "c:\\%X86_OPENSSL_INSTALLER% /silent /verysilent /DIR=C:\\OpenSSL-1-1-Win32" - ECHO "Install OpenSSL 1.1.0 64bit" - curl -o "c:\\%X64_OPENSSL_INSTALLER%" -fsSL "https://slproweb.com/download/%X64_OPENSSL_INSTALLER%" - "c:\\%X64_OPENSSL_INSTALLER% /silent /verysilent /DIR=C:\\OpenSSL-1-1-Win64" - ECHO "Install pywin32" - curl -o "%PYWIN32%" -fsSL "https://github.com/mhammond/pywin32/releases/download/%PYWIN32_RELEASE%/%PYWIN32%" - "%PYTHON%\\Scripts\\easy_install.exe %PYWIN32%" #- mkdir pywin32 #- 7z x "%PYWIN32%" -opywin32 #- xcopy /e "pywin32\\PLATLIB" "%PYTHON%\\Lib\\site-packages" - ECHO "Filesystem root:" - ps: "ls \"C:/\"" - ps: "ls \"C:/OpenSSL-Win32\"" - ECHO "Installed SDKs:" - ps: if (Test-Path "C:/Program Files/Microsoft SDKs/Windows") { ls "C:/Program Files/Microsoft SDKs/Windows" } - ECHO "Appveyor OpenSSL Version (%OPENSSL_VERSION%)" - "%OPENSSL_PATH%/bin/openssl.exe version" - ECHO "Python OpenSSL Version (%PYTHON%)" - "%PYTHON%\\python.exe -c \"import ssl; print(getattr(ssl, 'OPENSSL_VERSION', None))\"" build_script: - "%PYTHON%\\python.exe setup.py build --openssl=\"%OPENSSL_PATH%\" --bundledlls" test_script: - "%PYTHON%\\python.exe setup.py test" after_test: # If tests are successful, create a whl package for the project. - "%PYTHON%\\python.exe setup.py bdist_wheel bdist_wininst bdist_msi" - ps: "ls dist" artifacts: # Archive the generated wheel package in the ci.appveyor.com build report. - path: dist\* - path: SWIG/_m2crypto_wrap.c name: _m2crypto_wrap.zip type: zip after_build: - ps: Get-ChildItem SWIG\_m2crypto_wrap.c | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } on_failure: - ps: Get-ChildItem SWIG\_m2crypto_wrap.c | % { Push-AppveyorArtifact $_.FullName -FileName $_.Name } M2Crypto-0.31.0/contrib/0000755000175000001440000000000013371124434015173 5ustar matejusers00000000000000M2Crypto-0.31.0/contrib/README0000664000175000001440000000021513032674550016056 0ustar matejusers00000000000000This directory contains contributions by users of M2Crypto. Some of these may get folded into the main distribution in time. Thanks guys! M2Crypto-0.31.0/contrib/SimpleX509create.README0000664000175000001440000000017113032674550021061 0ustar matejusers00000000000000Contributed by Peter Teniz as a demonstration of PKI functionality, also contributed by him. M2Crypto-0.31.0/contrib/SimpleX509create.py0000644000175000001440000001262313355123234020553 0ustar matejusers00000000000000#!/usr/bin/env python # #vim: ts=4 sw=4 nowrap # from __future__ import print_function """PKI demo by Peter Teniz """ import M2Crypto MBSTRING_FLAG = 0x1000 MBSTRING_ASC = MBSTRING_FLAG | 1 MBSTRING_BMP = MBSTRING_FLAG | 2 class Cert(object): def __init__ ( self ): self.RsaKey = { 'KeyLength' : 1024, 'PubExponent' : 0x10001, # -> 65537 'keygen_callback' : self.callback } self.KeyPair = None self.PKey = None self.X509Request = None self.X509Certificate = None def callback ( self, *args ): return 'p' def CreatePKey ( self ): self.KeyPair = M2Crypto.RSA.gen_key( self.RsaKey['KeyLength'], self.RsaKey['PubExponent'], self.RsaKey['keygen_callback'] ) #PubKey = M2Crypto.RSA.new_pub_key( self.KeyPair.pub () ) self.KeyPair.save_key( 'KeyPair.pem', cipher='des_ede3_cbc', callback=self.callback ) self.PKey = M2Crypto.EVP.PKey ( md='sha1') self.PKey.assign_rsa ( self.KeyPair ) def CreateX509Request ( self ): # # X509 REQUEST # self.X509Request = M2Crypto.X509.Request () # # subject # X509Name = M2Crypto.X509.X509_Name () X509Name.add_entry_by_txt ( field='C', type=MBSTRING_ASC, entry='austria', len=-1, loc=-1, set=0 ) # country name X509Name.add_entry_by_txt ( field='SP', type=MBSTRING_ASC, entry='kernten', len=-1, loc=-1, set=0 ) # state of province name X509Name.add_entry_by_txt ( field='L', type=MBSTRING_ASC, entry='stgallen', len=-1, loc=-1, set=0 ) # locality name X509Name.add_entry_by_txt ( field='O', type=MBSTRING_ASC, entry='labor', len=-1, loc=-1, set=0 ) # organization name X509Name.add_entry_by_txt ( field='OU', type=MBSTRING_ASC, entry='it-department', len=-1, loc=-1, set=0 ) # organizational unit name X509Name.add_entry_by_txt ( field='CN', type=MBSTRING_ASC, entry='Certificate client', len=-1, loc=-1, set=0 ) # common name X509Name.add_entry_by_txt ( field='Email', type=MBSTRING_ASC, entry='user@localhost', len=-1, loc=-1, set=0 ) # pkcs9 email address X509Name.add_entry_by_txt ( field='emailAddress', type=MBSTRING_ASC, entry='user@localhost', len=-1, loc=-1, set=0 ) # pkcs9 email address self.X509Request.set_subject_name( X509Name ) # # publickey # self.X509Request.set_pubkey ( pkey=self.PKey ) self.X509Request.sign ( pkey=self.PKey, md='sha1' ) #print(X509Request.as_text ()) def CreateX509Certificate ( self ): # # X509 CERTIFICATE # self.X509Certificate = M2Crypto.X509.X509 () # # version # self.X509Certificate.set_version ( 0 ) # # time notBefore # ASN1 = M2Crypto.ASN1.ASN1_TIME () ASN1.set_time ( 500 ) self.X509Certificate.set_not_before( ASN1 ) # # time notAfter # ASN1 = M2Crypto.ASN1.ASN1_TIME () ASN1.set_time ( 500 ) self.X509Certificate.set_not_after( ASN1 ) # # public key # self.X509Certificate.set_pubkey ( pkey=self.PKey ) # # subject # X509Name = self.X509Request.get_subject () #print(X509Name.entry_count ()) #print(X509Name.as_text ()) self.X509Certificate.set_subject_name( X509Name ) # # issuer # X509Name = M2Crypto.X509.X509_Name ( M2Crypto.m2.x509_name_new () ) X509Name.add_entry_by_txt ( field='C', type=MBSTRING_ASC, entry='germany', len=-1, loc=-1, set=0 ) # country name X509Name.add_entry_by_txt ( field='SP', type=MBSTRING_ASC, entry='bavaria', len=-1, loc=-1, set=0 ) # state of province name X509Name.add_entry_by_txt ( field='L', type=MBSTRING_ASC, entry='munich', len=-1, loc=-1, set=0 ) # locality name X509Name.add_entry_by_txt ( field='O', type=MBSTRING_ASC, entry='sbs', len=-1, loc=-1, set=0 ) # organization name X509Name.add_entry_by_txt ( field='OU', type=MBSTRING_ASC, entry='it-department', len=-1, loc=-1, set=0 ) # organizational unit name X509Name.add_entry_by_txt ( field='CN', type=MBSTRING_ASC, entry='Certificate Authority', len=-1, loc=-1, set=0 ) # common name X509Name.add_entry_by_txt ( field='Email', type=MBSTRING_ASC, entry='admin@localhost', len=-1, loc=-1, set=0 ) # pkcs9 email address X509Name.add_entry_by_txt ( field='emailAddress', type=MBSTRING_ASC, entry='admin@localhost', len=-1, loc=-1, set=0 ) # pkcs9 email address #print(X509Name.entry_count ()) #print(X509Name.as_text ()) self.X509Certificate.set_issuer_name( X509Name ) # # signing # self.X509Certificate.sign( pkey=self.PKey, md='sha1' ) print(self.X509Certificate.as_text ()) if __name__ == '__main__': run = Cert () run.CreatePKey () run.CreateX509Request () run.CreateX509Certificate () M2Crypto-0.31.0/contrib/dave.README0000664000175000001440000000530513032674550017001 0ustar matejusers00000000000000From dave@pythonapocrypha.com Wed Dec 11 07:57:55 2002 Date: Tue, 10 Dec 2002 15:05:26 -0800 (PST) From: Dave Brueck To: ngps@netmemetic.com Subject: M2Crypto problem with asynch sockets Hi and thanks for M2Crypto - great stuff! I wrote an asynchronous socket layer and decided to use M2Crypto to add SSL support to it. Unfortunately, I've found a small problem in _m2crypto_wrap.c - hopefully I'm just not understanding something. The ssl_connect, ssl_read_nbio, etc. calls don't differentiate between SSL_ERROR_WANT_WRITE and SSL_ERROR_WANT_READ when a non-blocking call couldn't finish. But without this information, I don't know whether the socket needs to do more reading or more writing before a subsequent attempt will work without blocking. The demo applications (e.g. echod-async.py) don't seem to care about this but they get around it by simply trying the operation over and over again, which I can't do for performance reasons. Am I missing something? I thought about just calling SSL_get_error when the above calls return None (indicating WANT_READ or WANT_WRITE), but by then the error has already been removed from the SSL error queue. Any help or suggestions would be appreciated. I'd be happy to submit a patch fixing those calls, but by not returning None they would break existing code. Thanks again for M2Crypto though! -Dave From dave@pythonapocrypha.com Fri Dec 13 00:46:39 2002 Date: Thu, 12 Dec 2002 09:52:08 -0800 (PST) From: Dave Brueck To: ngps@netmemetic.com Subject: Re: M2Crypto problem with asynch sockets Hello again, Here is a patch to M2Crypto's _ssl.i that illustrates the fix I had in mind in my previous message. You might not want to use it as is since it changes the error semantics of the affected functions (they now raise an exception that contains the SSL_WANT_READ or SSL_WANT_WRITE flag instead of returning None or whatever), but if you tell me how you'd like it instead then I'd be happy to fix the patch and send it back to you. Just to refresh your memory, this patch fixes the problem where a non-blocking call to accept/connect/etc results in an SSL_NEED_READ/WRITE; currently there's no way for the caller to know _which_ of the two occurred and so it must try again once the socket has become readable OR writeable, instead of waiting specifically for one or the other. For many people this won't matter because their performance requirements are low enough that trying the ssl_accept/etc call again prematurely won't hurt too much, but for servers with lots of connections or high throughput it's much more critical to wait until you know the SSL call has a better chance of success. Thanks! -Dave Brueck M2Crypto-0.31.0/contrib/dispatcher.README0000664000175000001440000000157613032674550020216 0ustar matejusers00000000000000Date: Thu, 31 May 2001 17:11:45 +0400 (MSD) From: Ilya Etingof To: ngps@post1.com Cc: Ilya Etingof Subject: Another kind of non-blocking SSL dispatcher --1922505501-409592217-991314705=:1995 Content-Type: TEXT/PLAIN; charset=US-ASCII Hi, Thanks for writing M2Crypto! I've been trying to use the ssl_dispatcher.py though I felt like the bundled version is not absolutely non-blocking. Precisely, it looks like the Connection.connect() method does not handle the case when socket.connect() returns the WOULDBLOCK error. Another suspicious thing is that there seems to be no SSL "want read" and "want write" error return codes of SSL read and write functions. The attached [quick and dirty] code hopefully fixes these two problems. Please, let me know if I'm missing some important clue about all this. Thanks, ilya --1922505501-409592217-991314705=:1995 M2Crypto-0.31.0/contrib/dispatcher.py0000664000175000001440000001134313165756570017714 0ustar matejusers00000000000000#!/usr/local/bin/python -O from __future__ import print_function """Implements a [hopefully] non-blocking SSL Dispatcher on top of M2Crypto. Written by Ilya Etingof , 05/2001 """ import asyncore # type: ignore # https://github.com/python/typeshed/issues/356 import socket # M2Crypto from M2Crypto import SSL # type: ignore # we are not in proper directory class NBConnection(SSL.Connection): """Functional equivalent of SSL.Connection class. Facilitates possibly delayed socket.connect() and socket.accept() termination. """ def __init__(self, ctx, sock): SSL.Connection.__init__(self, ctx, sock) def connect(self, addr): self._setup_ssl(addr) # FIXME SSL.Connection doesn't have _check_ssl_return method return self._check_ssl_return(SSL.m2.ssl_connect(self.ssl)) def accept(self, addr): self._setup_ssl(addr) self.accept_ssl() class Dispatcher(asyncore.dispatcher_with_send): """A non-blocking SSL Dispatcher that mimics the asyncode.dispatcher API""" def __init__(self, cert, key, sock=None, serving=None): asyncore.dispatcher_with_send.__init__(self) self.__serving = serving # XXX if sock: if self.__serving: self.set_socket(sock) else: self.create_socket(socket.AF_INET, socket.SOCK_STREAM) self.ctx = SSL.Context() self.ctx.set_verify(SSL.verify_none, 10) self.ctx.load_cert(cert, key) self.ctx.set_info_callback() self.ssl = NBConnection(self.ctx, self.socket) self.peer = None self.__output = '' self.__want_write = 1 # # The following are asyncore overloaded methods # def handle_connect(self): """Initiate SSL connection negotiation""" if self.__serving: self.ssl.accept(self.addr) self.peer = self.ssl.get_peer_cert() self.handle_ssl_accept() else: self.ssl.connect(self.addr) self.handle_ssl_connect() def handle_read(self): """Read user and/or SSL protocol data from SSL connection""" ret = self.ssl._read_nbio() if ret: self.handle_ssl_read(ret) else: # Assume write is wanted self.__want_write = 1 def handle_write(self): """Write pending user or SSL protocol data down to SSL connection""" self.__want_write = 0 ret = self.ssl._write_nbio(self.__output) if ret < 0: try: err = SSL.m2.ssl_get_error(self.ssl.ssl, ret) except SSL.SSLError: return if err == SSL.m2.ssl_error_want_write: self.__want_write = 1 else: self.__output = self.__output[ret:] def writable(self): """Indicate that write is desired. Happens if there's some user and/or SSL protocol data. """ if self.__output or self.__want_write: return 1 return self.ssl_writable() def handle_close(self): """Shutdown SSL connection.""" self.ssl = None self.ctx = None self.close() self.handle_ssl_close() def handle_error(self, *info): """A trap for asyncore errors""" self.handle_ssl_error(info) # # The following are ssl.dispatcher API # def ssl_connect(self, server): """Initiate SSL connection""" self.connect(server) def ssl_write(self, data): """Write data to SSL connection""" self.__output = self.__output + data def ssl_close(self): """Close SSL connection""" self.handle_close() def handle_ssl_connect(self): """Invoked on SSL connection establishment (whilst in Client mode)""" print('Unhandled handle_ssl_connect()') def handle_ssl_accept(self): """Invoked on SSL connection establishment (whilst in server mode)""" print('Unhandled handle_ssl_accept()') def handle_ssl_read(self, data): """Invoked on new data arrival to SSL connection""" print('Unhandled handle_ssl_read event') def handle_ssl_close(self): """Invoked on SSL connection termination""" pass def ssl_writable(self): """Invoked prior to every select() call""" return 0 if __name__ == '__main__': """Give it a test run""" class Client(Dispatcher): """SSL Client class""" def __init__(self, cert, key): Dispatcher.__init__(self, cert, key) def handle_ssl_read(self, data): print(data) self.ssl_write('test write') ssl = Client('test.cert', 'test.key') ssl.ssl_connect(('localhost', 7777)) asyncore.loop() M2Crypto-0.31.0/contrib/isaac.README0000664000175000001440000000122713032674550017141 0ustar matejusers00000000000000This is Isaac Salzberg's application of Mihai Ibanescu's patch (available on SF) that allows HTTPS tunneling through an authenticating proxy. This one's a double whammy: it works with IIS through the authenticating proxy, whereas the one on SF, which uses Python's built-in SSL, doesn't. This code is not folded into the main distribution because: 1. Apparently Mihai is still working on it. 2. Mihai uses Python's built-in SSL. Isaac patched it to use M2Crypto.SSL. The stuff is essentially #ifdef'ed code. 3. I don't have an authenticating proxy nor an IIS server to test against, so I can't clean up the code. Volunteers welcome. ;-) Thanks Isaac. M2Crypto-0.31.0/contrib/isaac.httpslib.py0000664000175000001440000002070613165756570020501 0ustar matejusers00000000000000from __future__ import print_function """M2Crypto support for Python 2.x's httplib. Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" import string from M2Crypto import SSL from httplib import FakeSocket, HTTP, HTTPConnection, HTTPResponse, HTTPS_PORT class HTTPSConnection(HTTPConnection): """ This class allows communication via SSL using M2Crypto. """ default_port = HTTPS_PORT def __init__(self, host, port=None, **ssl): keys = ssl.keys() try: keys.remove('key_file') except ValueError: pass try: keys.remove('cert_file') except ValueError: pass try: keys.remove('ssl_context') except ValueError: pass if keys: raise ValueError() try: self.ssl_ctx = ssl['ssl_context'] assert isinstance(self.ssl_ctx, SSL.Context) except KeyError: self.ssl_ctx = SSL.Context('sslv23') HTTPConnection.__init__(self, host, port) def connect(self): self.sock = SSL.Connection(self.ssl_ctx) self.sock.connect((self.host, self.port)) def close(self): # This kludges around line 545 of httplib.py, # which closes the connection in this object; # the connection remains open in the response # object. # # M2Crypto doesn't close-here-keep-open-there, # so, in effect, we don't close until the whole # business is over and gc kicks in. # # Long-running callers beware leakage. # # 05-Jan-2002: This module works with Python 2.2, # but I've not investigated if the above conditions # remain. pass class HTTPS(HTTP): _connection_class = HTTPSConnection def __init__(self, host='', port=None, **ssl): HTTP.__init__(self, host, port) try: self.ssl_ctx = ssl['ssl_context'] except KeyError: self.ssl_ctx = SSL.Context('sslv23') # ISS Added. # From here, starts the proxy patch class HTTPProxyConnection(HTTPConnection): """ This class provides HTTP access through (authenticated) proxies. Example: If the HTTP proxy address is proxy.your.org:8080, an authenticated proxy (one which requires a username/password combination in order to serve requests), one can fetch HTTP documents from 'www.webserver.net', port 81: conn = HTTPProxyConnection('proxy.your.org:8080', 'www.webserver.net', port=81, username='username', password='password') conn.connect() conn.request("HEAD", "/index.html", headers={'X-Custom-Header-1' : 'Value-1'}) resp = conn.getresponse() ... """ def __init__(self, proxy, host, port=None, username=None, password=None): # The connection goes through the proxy HTTPConnection.__init__(self, proxy) # save the proxy connection settings self.__proxy, self.__proxy_port = self.host, self.port # self.host and self.port will point to the real host self._set_hostport(host, port) # save the host and port self._host, self._port = self.host, self.port # Authenticated proxies support self.__username = username self.__password = password def connect(self): """Connect to the host and port specified in __init__ (through a proxy).""" # We are connecting to the proxy, so use the proxy settings self._set_hostport(self.__proxy, self.__proxy_port) HTTPConnection.connect(self) # Restore the real host and port self._set_hostport(self._host, self._port) def putrequest(self, method, url): """Send a request to the server. `method' specifies an HTTP request method, e.g. 'GET'. `url' specifies the object being requested, e.g. '/index.html'. """ # The URL has to include the real host hostname = self._host if self._port != self.default_port: hostname = hostname + ':' + str(self._port) newurl = "http://%s%s" % (hostname, url) # Piggyback on the parent class HTTPConnection.putrequest(self, method, newurl) # Add proxy-specific headers self._add_auth_proxy_header() def _add_auth_proxy_header(self): """Adds an HTTP header for authenticated proxies """ if not self.__username: # No username, so assume not an authenticated proxy return # Authenticated proxy import base64 userpass = "%s:%s" % (self.__username, self.__password) enc_userpass = string.strip(base64.encodestring(userpass)) self.putheader("Proxy-Authorization", "Basic %s" % enc_userpass) class HTTPSProxyResponse(HTTPResponse): """ Replacement class for HTTPResponse Proxy responses (made through SSL) have to keep the connection open after the initial request, since the connection is tunneled to the SSL host with the CONNECT method. """ def begin(self): HTTPResponse.begin(self) self.will_close = 0 class HTTPSProxyConnection(HTTPProxyConnection): """This class provides HTTP access through (authenticated) proxies. Example: If the HTTP proxy address is proxy.your.org:8080, an authenticated proxy (one which requires a username/password combination in order to serve requests), one can fetch HTTP documents from 'www.webserver.net', port 81: conn = HTTPProxyConnection('proxy.your.org:8080', 'www.webserver.net', port=81, username='username', password='password') conn.connect() conn.request("HEAD", "/index.html", headers={'X-Custom-Header-1' : 'Value-1'}) resp = conn.getresponse() ... To avoid dealing with multiple inheritance, this class only inherits from HTTPProxyConnection. """ default_port = HTTPSConnection.default_port def __init__(self, proxy, host, port=None, username=None, password=None, **x509): for key in x509.keys(): if key not in ['cert_file', 'key_file', 'ssl_context']: raise ValueError() self.key_file = x509.get('key_file') self.cert_file = x509.get('cert_file') #ISS Added self.ssl_ctx = x509.get('ssl_context') # Piggybacking on HTTPProxyConnection HTTPProxyConnection.__init__(self, proxy, host, port, username, password) def connect(self): """Connect (using SSL) to the host and port specified in __init__ (through a proxy).""" import socket # Set the connection with the proxy HTTPProxyConnection.connect(self) # Use the stock HTTPConnection putrequest host = "%s:%s" % (self._host, self._port) HTTPConnection.putrequest(self, "CONNECT", host) # Add proxy-specific stuff self._add_auth_proxy_header() # And send the request HTTPConnection.endheaders(self) # Save the response class response_class = self.response_class # And replace the response class with our own one, which does not # close the connection self.response_class = HTTPSProxyResponse response = HTTPConnection.getresponse(self) # Restore the response class self.response_class = response_class # Close the response object manually response.close() if response.status != 200: # Close the connection manually self.close() # XXX Find the appropriate error code raise socket.error(1001, response.status, response.value) # NgPS: I haven't read the code recently, but I think it is # reasonable to assume that self.sock is a connected TCP socket at # this point. # Use the real stuff. ;-) if self.ssl_ctx and isinstance(self.ssl_ctx, SSL.Context): self.sock = SSL.Connection(self.ssl_ctx) self.sock.connect((self.host, self.port)) else: # Fake the socket ssl = socket.ssl(self.sock, self.key_file, self.cert_file) self.sock = FakeSocket(self.sock, ssl) if self.debuglevel > 0: print('socket type:', self.sock) def putrequest(self, method, url): """Send a request to the server. `method' specifies an HTTP request method, e.g. 'GET'. `url' specifies the object being requested, e.g. '/index.html'. """ # bypass the parent class's putrequest: use the grandparent's one :-) return HTTPConnection.putrequest(self, method, url) M2Crypto-0.31.0/contrib/smimeplus.README0000664000175000001440000000024513032674550020076 0ustar matejusers00000000000000Contributed by Bernard Yue: A high level smime interface. "It works for Python 2.2 and above, and requires the email module from Python 2.2.3 to work on Python 2.1. M2Crypto-0.31.0/contrib/smimeplus.py0000664000175000001440000001300013165756570017574 0ustar matejusers00000000000000import UserDict import os import tempfile import M2Crypto from email import Message class smimeplus(object): def __init__(self, cert, privkey, passphrase, cacert, randfile=None): self.cipher = 'des_ede3_cbc' # XXX make it configable?? self.setsender(cert, privkey, passphrase) self.setcacert(cacert) self.randfile = randfile self.__loadrand() def __passcallback(self, v): """private key passphrase callback function""" return self.passphrase def __loadrand(self): """Load random number file""" if self.randfile: M2Crypto.Rand.load_file(self.randfile, -1) def __saverand(self): """Save random number file""" if self.randfile: M2Crypto.Rand.save_file(self.randfile) def __gettext(self, msg): """Return a string representation of 'msg'""" _data = '' if isinstance(msg, Message.Message): for _p in msg.walk(): _data = _data + _p.as_string() else: _data = str(msg) return _data def __pack(self, msg): """Convert 'msg' to string and put it into an memory buffer for openssl operation""" return M2Crypto.BIO.MemoryBuffer(self.__gettext(msg)) def setsender(self, cert=None, privkey=None, passphrase=None): if cert: self.cert = cert if privkey: self.key = privkey if passphrase: self.passphrase = passphrase def setcacert(self, cacert): self.cacert = cacert def sign(self, msg): """Sign a message""" _sender = M2Crypto.SMIME.SMIME() _sender.load_key_bio(self.__pack(self.key), self.__pack(self.cert), callback=self.__passcallback) _signed = _sender.sign(self.__pack(msg), M2Crypto.SMIME.PKCS7_DETACHED) _out = self.__pack(None) _sender.write(_out, _signed, self.__pack(msg)) return _out.read() def verify(self, smsg, scert): """Verify to see if 'smsg' was signed by 'scert', and scert was issued by cacert of this object. Return message signed if success, None otherwise""" # Load signer's cert. _x509 = M2Crypto.X509.load_cert_bio(self.__pack(scert)) _stack = M2Crypto.X509.X509_Stack() _stack.push(_x509) # Load CA cert. _tmpfile = persistdata(self.cacert) _store = M2Crypto.X509.X509_Store() _store.load_info(_tmpfile) os.remove(_tmpfile) # prepare SMIME object _sender = M2Crypto.SMIME.SMIME() _sender.set_x509_stack(_stack) _sender.set_x509_store(_store) # Load signed message, verify it, and return result _p7, _data = M2Crypto.SMIME.smime_load_pkcs7_bio(self.__pack(smsg)) try: return _sender.verify(_p7, _data, flags=M2Crypto.SMIME.PKCS7_SIGNED) except M2Crypto.SMIME.SMIME_Error: return None def encrypt(self, rcert, msg): # Instantiate an SMIME object. _sender = M2Crypto.SMIME.SMIME() # Load target cert to encrypt to. _x509 = M2Crypto.X509.load_cert_bio(self.__pack(rcert)) _stack = M2Crypto.X509.X509_Stack() _stack.push(_x509) _sender.set_x509_stack(_stack) _sender.set_cipher(M2Crypto.SMIME.Cipher(self.cipher)) # Encrypt the buffer. _buf = self.__pack(self.__gettext(msg)) _p7 = _sender.encrypt(_buf) # Output p7 in mail-friendly format. _out = self.__pack('') _sender.write(_out, _p7) # Save the PRNG's state. self.__saverand() return _out.read() def decrypt(self, emsg): """decrypt 'msg'. Return decrypt message if success, None otherwise""" # Load private key and cert. _sender = M2Crypto.SMIME.SMIME() _sender.load_key_bio(self.__pack(self.key), self.__pack(self.cert), callback=self.__passcallback) # Load the encrypted data. _p7, _data = M2Crypto.SMIME.smime_load_pkcs7_bio(self.__pack(emsg)) # Decrypt p7. try: return _sender.decrypt(_p7) except M2Crypto.SMIME.SMIME_Error: return None def addHeader(self, rcert, content, subject=''): """Add To, From, Subject Header to 'content'""" _scert = M2Crypto.X509.load_cert_bio(self.__pack(self.cert)) _scertsubj = X509_Subject(str(_scert.get_subject())) _rcert = M2Crypto.X509.load_cert_bio(self.__pack(rcert)) _rcertsubj = X509_Subject(str(_rcert.get_subject())) _out = 'From: "%(CN)s" <%(emailAddress)s>\n' % _scertsubj _out = _out + 'To: "%(CN)s" <%(emailAddress)s>\n' % _rcertsubj _out = _out + 'Subject: %s\n' % subject _out = _out + content return _out class X509_Subject(UserDict.UserDict): # This class needed to be rewritten or merge with X509_Name def __init__(self, substr): UserDict.UserDict.__init__(self) try: _data = substr.strip().split('/') except AttributeError: pass else: for _i in _data: try: _k, _v = _i.split('=') self[_k] = _v except ValueError: pass def persistdata(data, file=None, isbinary=False): if not file: file = tempfile.mktemp() if isbinary: _flag = 'wb' else: _flag = 'w' _fh = open(file, _flag) _fh.write(data) _fh.close() return file M2Crypto-0.31.0/dev-requirements.txt0000664000175000001440000000001413247615013017570 0ustar matejusers00000000000000wheel twine M2Crypto-0.31.0/doc/0000755000175000001440000000000013371124434014300 5ustar matejusers00000000000000M2Crypto-0.31.0/doc/M2Crypto.SSL.rst0000664000175000001440000000311613165756570017171 0ustar matejusers00000000000000SSL Package =========== :mod:`SSL` Package ------------------ .. automodule:: M2Crypto.SSL :members: :undoc-members: :show-inheritance: :mod:`Checker` Module --------------------- .. automodule:: M2Crypto.SSL.Checker :members: :undoc-members: :show-inheritance: :mod:`Cipher` Module -------------------- .. automodule:: M2Crypto.SSL.Cipher :members: :undoc-members: :show-inheritance: :mod:`Connection` Module ------------------------ .. automodule:: M2Crypto.SSL.Connection :members: :undoc-members: :show-inheritance: :mod:`Context` Module --------------------- .. automodule:: M2Crypto.SSL.Context :members: :undoc-members: :show-inheritance: :mod:`SSLServer` Module ----------------------- .. automodule:: M2Crypto.SSL.SSLServer :members: :undoc-members: :show-inheritance: :mod:`Session` Module --------------------- .. automodule:: M2Crypto.SSL.Session :members: :undoc-members: :show-inheritance: :mod:`TwistedProtocolWrapper` Module ------------------------------------ .. automodule:: M2Crypto.SSL.TwistedProtocolWrapper :members: :undoc-members: :show-inheritance: :mod:`cb` Module ---------------- .. automodule:: M2Crypto.SSL.cb :members: :undoc-members: :show-inheritance: :mod:`ssl_dispatcher` Module ---------------------------- .. automodule:: M2Crypto.SSL.ssl_dispatcher :members: :undoc-members: :show-inheritance: :mod:`timeout` Module --------------------- .. automodule:: M2Crypto.SSL.timeout :members: :undoc-members: :show-inheritance: M2Crypto-0.31.0/doc/M2Crypto.rst0000664000175000001440000000665513174411415016526 0ustar matejusers00000000000000M2Crypto Package ================ :mod:`M2Crypto` Package ----------------------- .. automodule:: M2Crypto.__init__ :members: :undoc-members: :show-inheritance: :mod:`ASN1` Module ------------------ .. automodule:: M2Crypto.ASN1 :members: :undoc-members: :show-inheritance: :mod:`AuthCookie` Module ------------------------ .. automodule:: M2Crypto.AuthCookie :members: :undoc-members: :show-inheritance: :mod:`BIO` Module ----------------- .. automodule:: M2Crypto.BIO :members: :undoc-members: :show-inheritance: :mod:`BN` Module ---------------- .. automodule:: M2Crypto.BN :members: :undoc-members: :show-inheritance: :mod:`DH` Module ---------------- .. automodule:: M2Crypto.DH :members: :undoc-members: :show-inheritance: :mod:`DSA` Module ----------------- .. automodule:: M2Crypto.DSA :members: :undoc-members: :show-inheritance: :mod:`EC` Module ---------------- .. automodule:: M2Crypto.EC :members: :undoc-members: :show-inheritance: :mod:`EVP` Module ----------------- .. automodule:: M2Crypto.EVP :members: :undoc-members: :show-inheritance: :mod:`Engine` Module -------------------- .. automodule:: M2Crypto.Engine :members: :undoc-members: :show-inheritance: :mod:`Err` Module ----------------- .. automodule:: M2Crypto.Err :members: :undoc-members: :show-inheritance: :mod:`RC4` Module ----------------- .. automodule:: M2Crypto.RC4 :members: :undoc-members: :show-inheritance: :mod:`RSA` Module ----------------- .. automodule:: M2Crypto.RSA :members: :undoc-members: :show-inheritance: :mod:`Rand` Module ------------------ .. automodule:: M2Crypto.Rand :members: :undoc-members: :show-inheritance: :mod:`SMIME` Module ------------------- .. automodule:: M2Crypto.SMIME :members: :undoc-members: :show-inheritance: :mod:`X509` Module ------------------ .. automodule:: M2Crypto.X509 :members: :undoc-members: :show-inheritance: :mod:`callback` Module ---------------------- .. automodule:: M2Crypto.callback :members: :undoc-members: :show-inheritance: :mod:`ftpslib` Module --------------------- .. automodule:: M2Crypto.ftpslib :members: :undoc-members: :show-inheritance: :mod:`httpslib` Module ---------------------- .. automodule:: M2Crypto.httpslib :members: :undoc-members: :show-inheritance: :mod:`m2` Module ---------------- .. automodule:: M2Crypto.m2 :members: :undoc-members: :show-inheritance: :mod:`m2crypto` Module ---------------------- .. automodule:: M2Crypto.m2crypto :members: :undoc-members: :show-inheritance: :mod:`m2urllib` Module ---------------------- .. automodule:: M2Crypto.m2urllib :members: :undoc-members: :show-inheritance: :mod:`m2urllib2` Module ----------------------- .. automodule:: M2Crypto.m2urllib2 :members: :undoc-members: :show-inheritance: :mod:`m2xmlrpclib` Module ------------------------- .. automodule:: M2Crypto.m2xmlrpclib :members: :undoc-members: :show-inheritance: :mod:`threading` Module ----------------------- .. automodule:: M2Crypto.threading :members: :undoc-members: :show-inheritance: :mod:`util` Module ------------------ .. automodule:: M2Crypto.util :members: :undoc-members: :show-inheritance: Subpackages ----------- .. toctree:: M2Crypto.SSL M2Crypto-0.31.0/doc/Makefile0000664000175000001440000001267713165756570015774 0ustar matejusers00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = . # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: -rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/M2Crypto.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/M2Crypto.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/M2Crypto" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/M2Crypto" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." M2Crypto-0.31.0/doc/ZServerSSL-HOWTO.rst0000664000175000001440000001670613165756570017743 0ustar matejusers00000000000000:orphan: .. _zserverssl-howto: ZServerSSL-HOWTO ################ :author: Pheng Siong Ng :copyright: © 2000, 2001 by Ng Pheng Siong. :date: 2003-06-22 .. contents:: :backlinks: entry .. sectnum:: :suffix: . Introduction ============ ZServerSSL adds to Zope's ZServer the following: - HTTPS server - WebDAV-source-over-HTTPS server With the HTTPS server, ZServerSSL also provides WebDAV-over-HTTPS and XMLRPC-over-HTTPS access to Zope. These instructions apply to both Un\*x and Windows installations of Zope 2.6.1. To avoid cluttering the presentation, Windows pathnames are shown in Un\*x fashion. Preparation =========== #. Download M2Crypto 0.11, contained in the file ``m2crypto-0.11.zip``. #. Unpack ``m2crypto-0.11.zip``. This will create a directory ``m2crypto-0.11``. Henceforth, we refer to this directory as ``$M2``. #. Install M2Crypto per the instructions in ``$M2/INSTALL``. The ZServerSSL distribution is in ``$M2/demo/Zope``. We shall refer to this directory as ``$ZSSL``. Installation ============ Below, we refer to your Zope top-level directory as ``$ZOPE``. #. Copy ``$ZSSL/z2s.py`` into ``$ZOPE``. #. Depending on your operating system, modify ``$ZOPE/start`` or ``$ZOPE/start.bat`` to invoke ``$ZOPE/z2s.py``, instead of ``$ZOPE/z2.py``. The files ``$ZSSL/starts`` and ``$ZSSL/starts.bat`` serve as examples. #. Copy ``$ZSSL/dh1024.pem`` into ``$ZOPE``. This file contains Diffie-Hellman parameters for use by the SSL protocol. #. Copy ``$ZSSL/randpool.dat`` into ``$ZOPE``. This file contains seed material for the OpenSSL PRNG. Alternatively, create ``$ZOPE/randpool.dat`` thusly:: $ dd if=/dev/urandom of=randpool.dat bs=1024 count=1 #. Copy ``$ZSSL/ca.pem`` to ``$ZOPE``. This file contains an example Certification Authority (CA) certificate. For information on operating your own CA, see :ref:`howto-ca` or one of numerous similar documents available on the web. #. Copy ``$ZSSL/server.pem`` to ``$ZOPE``. This file contains an RSA key pair and its X.509v3 certificate issued by the above CA. You may also create your own key/certificate bundle. #. Copy ``$ZSSL/ZServer/HTTPS_Server.py`` to ``$ZOPE/ZServer``. #. Copy ``$ZSSL/ZServer/__init__.py`` to ``$ZOPE/ZServer``. This overwrites the existing ``$ZOPE/ZServer/__init__.py``. Alternatively, apply the following patch to ``$ZOPE/ZServer/__init__.py``:: --- __init__.py.org Sat Jun 21 23:20:41 2003 +++ __init__.py Tue Jan 7 23:30:53 2003 @@ -84,6 +84,7 @@ import asyncore from medusa import resolver, logger from HTTPServer import zhttp_server, zhttp_handler +from HTTPS_Server import zhttps_server, zhttps_handler from PCGIServer import PCGIServer from FCGIServer import FCGIServer from FTPServer import FTPServer #. Copy ``$ZSSL/ZServer/medusa/https_server.py`` to ``$ZOPE/ZServer/medusa``. #. Stop Zope, if it is running. #. Start Zope with ZServerSSL thusly:: ./starts -X -f 9021 -w 9080 -W 9081 -y 9443 -Y 9444 This starts the following: - an FTP server on port 9021 - a HTTP server on port 9080 - a WebDAV-source server on port 9081 - a HTTPS server on port 9443 - a WebDAV-source-over-HTTPS server on port 9444 Testing ======= Below, we assume your Zope server is running on ``localhost``. HTTPS ===== This testing is done with Mozilla 1.1 on FreeBSD. #. With a browser, connect to https://localhost:9443/. Browse around. Check out your browser's HTTPS informational screens. #. Connect to https://localhost:9443/manage. Verify that you can access Zope's management functionality. WebDAV-over-HTTPS ================= This testing is done with Cadaver 0.21.0 on FreeBSD.:: $ cadaver https://localhost:9443/ WARNING: Untrusted server certificate presented: Issued to: M2Crypto, SG Issued by: M2Crypto, SG Do you wish to accept the certificate? (y/n) y dav:/> ls Listing collection `/': succeeded. Coll: Channels 0 Jun 19 00:04 Coll: Control_Panel 0 Jun 6 00:13 Coll: Examples 0 Jun 6 00:12 Coll: catalog 0 Jun 12 11:53 Coll: ngps 0 Jun 16 15:34 Coll: portal 0 Jun 21 15:21 Coll: skunk 0 Jun 18 21:18 Coll: temp_folder 0 Jun 22 17:57 Coll: zope 0 Jun 20 15:27 acl_users 0 Dec 30 1998 browser_id_manager 0 Jun 6 00:12 default.css 3037 Jun 21 16:38 error_log 0 Jun 6 00:12 index_html 313 Jun 12 13:36 portal0 0 Jun 21 15:21 session_data_manager 0 Jun 6 00:12 standard_error_message 1365 Jan 21 2001 standard_html_footer 50 Jun 12 12:30 standard_html_header 80 Jan 21 2001 standard_template.pt 282 Jun 6 00:12 zsyncer 0 Jun 17 15:28 dav:/> quit Connection to `localhost' closed. $ WebDAV-Source-over-HTTPS ======================== This testing is done with Mozilla 1.1 on FreeBSD. #. Open the Mozilla Composer window. #. Click "File", "Open Web Location". A dialog box appears. #. Enter ``https://localhost:9444/index_html`` for the URL. #. Select "Open in new Composer window." #. Click "Open". A new Composer window will open with ``index_html`` loaded. Python with M2Crypto ==================== This testing is done with M2Crypto 0.11 and Python 2.2.2 on FreeBSD. HTTPS ===== :: >>> from M2Crypto import Rand, SSL, m2urllib >>> url = m2urllib.FancyURLopener() >>> url.addheader('Connection', 'close') >>> u = url.open('https://127.0.0.1:9443/') send: 'GET / HTTP/1.1\r\nHost: 127.0.0.1:9443\r\nAccept-Encoding: identity\r\nUser-agent: Python-urllib/1.15\r\nConnection: close\r\n\r\n' reply: 'HTTP/1.1 200 OK\r\n' header: Server: ZServerSSL/0.11 header: Date: Sun, 22 Jun 2003 13:42:34 GMT header: Connection: close header: Content-Type: text/html header: Etag: header: Content-Length: 535 >>> while 1: ... data = u.read() ... if not data: break ... print(data) ... :: Zope

NgPS Desktop Portal

  So many hacks.
  So little time.

Link Farm


Powered by Zope :: >>> u.close() >>> XMLRPC-over-HTTPS ================= :: >>> from M2Crypto.m2xmlrpclib import Server, SSL_Transport >>> zs = Server('https://127.0.0.1:9443/', SSL_Transport()) >>> print(zs.propertyMap()) [{'type': 'string', 'id': 'title', 'mode': 'w'}] >>> Conclusion ========== Well, it works! ;-) M2Crypto-0.31.0/doc/conf.py0000664000175000001440000002167613236336220015613 0ustar matejusers00000000000000# -*- coding: utf-8 -*- # # M2Crypto documentation build configuration file, created by # sphinx-quickstart on Thu Apr 20 11:15:12 2017. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys, os # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath(os.path.join('..'))) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'M2Crypto' copyright = u'2017, Matej Cepl ' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '' # The full version, including alpha/beta/rc tags. release = '' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # html_theme = 'default' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'M2Cryptodoc' # -- Options for LaTeX output -------------------------------------------------- latex_elements = { # The paper size ('letterpaper' or 'a4paper'). #'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). #'pointsize': '10pt', # Additional stuff for the LaTeX preamble. #'preamble': '', } # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'M2Crypto.tex', u'M2Crypto Documentation', u'Matej Cepl \\textless{}mcepl@cepl.eu\\textgreater{}', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'm2crypto', u'M2Crypto Documentation', [u'Matej Cepl '], 1) ] # If true, show URL addresses after external links. #man_show_urls = False # -- Options for Texinfo output ------------------------------------------------ # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ('index', 'M2Crypto', u'M2Crypto Documentation', u'Matej Cepl ', 'M2Crypto', 'One line description of project.', 'Miscellaneous'), ] # Documents to append as an appendix to all manuals. #texinfo_appendices = [] # If false, no module index is generated. #texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. #texinfo_show_urls = 'footnote' # -- Options for Epub output --------------------------------------------------- # Bibliographic Dublin Core info. epub_title = u'M2Crypto' epub_author = u'Matej Cepl ' epub_publisher = u'Matej Cepl ' epub_copyright = u'2017, Matej Cepl ' # The language of the text. It defaults to the language option # or en if the language is not set. #epub_language = '' # The scheme of the identifier. Typical schemes are ISBN or URL. #epub_scheme = '' # The unique identifier of the text. This can be a ISBN number # or the project homepage. #epub_identifier = '' # A unique identification for the text. #epub_uid = '' # A tuple containing the cover image and cover page html template filenames. #epub_cover = () # HTML files that should be inserted before the pages created by sphinx. # The format is a list of tuples containing the path and title. #epub_pre_files = [] # HTML files shat should be inserted after the pages created by sphinx. # The format is a list of tuples containing the path and title. #epub_post_files = [] # A list of files that should not be packed into the epub file. #epub_exclude_files = [] # The depth of the table of contents in toc.ncx. #epub_tocdepth = 3 # Allow duplicate toc entries. #epub_tocdup = True M2Crypto-0.31.0/doc/doctrees/0000755000175000001440000000000013371124434016110 5ustar matejusers00000000000000M2Crypto-0.31.0/doc/doctrees/M2Crypto.SSL.doctree0000664000175000001440000135470413236336220021614 0ustar matejusers00000000000000cdocutils.nodes document q)q}q(U nametypesq}q(X4M2Crypto.SSL.Connection.Connection.set_connect_stateqX;M2Crypto.SSL.Connection.Connection.set_socket_write_timeoutqX.M2Crypto.SSL.Connection.Connection.m2_bio_freeqX.M2Crypto.SSL.Connection.Connection.get_sessionq X1M2Crypto.SSL.Context.Context.set_allow_unknown_caq XDM2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.writeSequenceq XEM2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.connectionMadeq X.M2Crypto.SSL.Connection.Connection.getsocknameq X(M2Crypto.SSL.Connection.Connection.closeqX+M2Crypto.SSL.Connection.Connection.shutdownqXBM2Crypto.SSL.Connection.Connection.set_client_CA_list_from_contextqX:M2Crypto.SSL.Connection.Connection.get_socket_read_timeoutqX+M2Crypto.SSL.Context.Context.load_client_caqX.M2Crypto.SSL.Connection.Connection.get_versionqX6M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapperqX.M2Crypto.SSL.Connection.Connection.get_ciphersqX-M2Crypto.SSL.Connection.Connection.settimeoutqX'M2Crypto.SSL.SSLServer.ForkingSSLServerqX+M2Crypto.SSL.Checker.Checker.numericIpMatchqX1M2Crypto.SSL.Context.Context.get_allow_unknown_caqX(M2Crypto.SSL.Context.Context.set_optionsqX2M2Crypto.SSL.Connection.Connection.get_cipher_listqX(M2Crypto.SSL.Session.Session.set_timeoutqX.M2Crypto.SSL.Connection.Connection.setblockingqX%M2Crypto.SSL.Checker.WrongCertificateqX.M2Crypto.SSL.TwistedProtocolWrapper.connectTCPqX/M2Crypto.SSL.Context.Context.set_session_id_ctxq X'M2Crypto.SSL.Connection.Connection.recvq!X0M2Crypto.SSL.Session.Session.m2_ssl_session_freeq"X-M2Crypto.SSL.Connection.Connection.getsockoptq#X2M2Crypto.SSL.Connection.Connection.set_cipher_listq$XEM2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.connectionLostq%X'M2Crypto.SSL.Connection.Connection.sendq&X(M2Crypto.SSL.Context.Context.add_sessionq'X*M2Crypto.SSL.Connection.Connection.pendingq(X:M2Crypto.SSL.Connection.Connection.set_socket_read_timeoutq)X;M2Crypto.SSL.Connection.Connection.get_socket_write_timeoutq*X"M2Crypto.SSL.Connection.Connectionq+XM2Crypto.SSL.Checker.WrongHostq,X(M2Crypto.SSL.Connection.Connection.writeq-X?M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.startTLSq.X-M2Crypto.SSL.SSLServer.SSLServer.handle_errorq/X)M2Crypto.SSL.Connection.Connection.acceptq0XM2Crypto.SSL.timeout.timeoutq1XM2Crypto.SSL.Checker.Checkerq2X,M2Crypto.SSL.Context.Context.m2_ssl_ctx_freeq3X-M2Crypto.SSL.Connection.Connection.get_cipherq4X0M2Crypto.SSL.Connection.Connection.get_peer_certq5X*M2Crypto.SSL.Connection.Connection.connectq6X-M2Crypto.SSL.TwistedProtocolWrapper.listenTCPq7X,M2Crypto.SSL.Connection.Connection.setup_sslq8X&M2Crypto.SSL.timeout.struct_to_timeoutq9X>M2Crypto.SSL.Connection.Connection.get_default_session_timeoutq:X-M2Crypto.SSL.Context.Context.load_verify_infoq;XM2Crypto.SSL.SSLErrorqX)M2Crypto.SSL.Checker.SSLVerificationErrorq?X+M2Crypto.SSL.Context.Context.load_client_CAq@X+M2Crypto.SSL.Context.Context.remove_sessionqAX8M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.create_socketqBX3M2Crypto.SSL.Context.Context.set_session_cache_modeqCX6M2Crypto.SSL.Connection.Connection.get_peer_cert_chainqDX4M2Crypto.SSL.Connection.Connection.get_verify_resultqEXEM2Crypto.SSL.Connection.Connection.set_post_connection_check_callbackqFXsslserver moduleqGNX3M2Crypto.SSL.Context.Context.get_session_cache_modeqHX&M2Crypto.SSL.Session.Session.write_bioqIX0M2Crypto.SSL.Context.Context.set_tmp_dh_callbackqJX-M2Crypto.SSL.Context.Context.get_verify_depthqKX.M2Crypto.SSL.TwistedProtocolWrapper.connectSSLqLX,M2Crypto.SSL.Context.Context.load_cert_chainqMX3M2Crypto.SSL.Connection.Connection.get_verify_depthqNX<M2Crypto.SSL.Connection.Connection.clientPostConnectionCheckqOXtimeout moduleqPNX M2Crypto.SSL.SSLServer.SSLServerqQX)M2Crypto.SSL.Connection.Connection.listenqRX!M2Crypto.SSL.timeout.timeout.packqSX(M2Crypto.SSL.Context.Context.set_tmp_rsaqTX-M2Crypto.SSL.Connection.Connection.setup_addrqUX0M2Crypto.SSL.Context.Context.get_session_timeoutqVX3M2Crypto.SSL.Connection.Connection.set_accept_stateqWX.M2Crypto.SSL.Connection.Connection.set_sessionqXX#M2Crypto.SSL.Session.Session.as_derqYX"M2Crypto.SSL.Cipher.Cipher.versionqZX,M2Crypto.SSL.Connection.Connection.get_stateq[X.M2Crypto.SSL.Connection.Connection.renegotiateq\Xssl_dispatcher moduleq]NX0M2Crypto.SSL.Connection.Connection.ssl_get_errorq^X*M2Crypto.SSL.Connection.Connection.set_bioq_X%M2Crypto.SSL.Session.Session.get_timeq`X&M2Crypto.SSL.Context.Context.load_certqaX.M2Crypto.SSL.Context.Context.set_info_callbackqbX-M2Crypto.SSL.Connection.Connection.setsockoptqcX(M2Crypto.SSL.cb.ssl_verify_callback_stubqdX*M2Crypto.SSL.ssl_dispatcher.ssl_dispatcherqeX cipher moduleqfNX)M2Crypto.SSL.Connection.Connection.filenoqgXconnection moduleqhNX*M2Crypto.SSL.Connection.Connection.sendallqiX"M2Crypto.SSL.Context.Context.closeqjX2M2Crypto.SSL.Context.Context.load_verify_locationsqkX'M2Crypto.SSL.Context.Context.set_verifyqlX5M2Crypto.SSL.Connection.Connection.set_session_id_ctxqmX7M2Crypto.SSL.Connection.Connection.set_tlsext_host_nameqnX.M2Crypto.SSL.Connection.Connection.connect_sslqoX2M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.connectqpX.M2Crypto.SSL.Connection.Connection.getpeernameqqX+M2Crypto.SSL.Context.Context.get_cert_storeqrX-M2Crypto.SSL.Connection.Connection.accept_sslqsX5M2Crypto.SSL.Context.Context.set_default_verify_pathsqtXEM2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.loseConnectionquXM2Crypto.SSL.Cipher.CipherqvX2M2Crypto.SSL.Connection.Connection.get_verify_modeqwXM2Crypto.SSL.Context.mapqxXM2Crypto.SSL.Context.ContextqyX+M2Crypto.SSL.Connection.Connection.makefileqzX,M2Crypto.SSL.Context.Context.set_cipher_listq{X4M2Crypto.SSL.cb.ssl_verify_callback_allow_unknown_caq|X.M2Crypto.SSL.Connection.Connection.m2_ssl_freeq}X<M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.clearq~X/M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.sendqX ssl packageqNX(M2Crypto.SSL.Session.Session.get_timeoutqXchecker moduleqNX,M2Crypto.SSL.Context.Context.get_verify_modeqX9M2Crypto.SSL.Context.Context.set_client_CA_list_from_fileqX"M2Crypto.SSL.Checker.NoCertificateqXM2Crypto.SSL.SSLTimeoutErrorqXcontext moduleqNX0M2Crypto.SSL.Context.Context.set_session_timeoutqX/M2Crypto.SSL.Connection.Connection.get_shutdownqX<M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.writeqX!M2Crypto.SSL.cb.ssl_info_callbackqX#M2Crypto.SSL.cb.ssl_verify_callbackqX1M2Crypto.SSL.Context.Context.set_tmp_rsa_callbackqXtwistedprotocolwrapper moduleqNX,M2Crypto.SSL.Connection.Connection.verify_okqXsession moduleqNX,M2Crypto.SSL.Connection.Connection.recv_intoqX.M2Crypto.SSL.Connection.Connection.get_contextqXM2Crypto.SSL.Context.ctxmapqX%M2Crypto.SSL.Session.Session.set_timeqXCM2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.dataReceivedqX)M2Crypto.SSL.SSLServer.ThreadingSSLServerqX'M2Crypto.SSL.Connection.Connection.readqX M2Crypto.SSL.Cipher.Cipher_StackqX$M2Crypto.SSL.Session.Session.as_textqXM2Crypto.SSL.Cipher.Cipher.nameqX-M2Crypto.SSL.TwistedProtocolWrapper.listenSSLqX cb moduleqNX<M2Crypto.SSL.Connection.Connection.serverPostConnectionCheckqX M2Crypto.SSL.timeout.struct_sizeqX/M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.recvqX?M2Crypto.SSL.Connection.Connection.set_client_CA_list_from_fileqX/M2Crypto.SSL.SSLServer.SSLServer.handle_requestqX'M2Crypto.SSL.Context.Context.set_tmp_dhqX/M2Crypto.SSL.Connection.Connection.set_shutdownqX!M2Crypto.SSL.Session.load_sessionqXM2Crypto.SSL.Session.SessionqX5M2Crypto.SSL.Connection.Connection.set_ssl_close_flagquUsubstitution_defsq}qUparse_messagesq]qcdocutils.nodes system_message q)q}q(U rawsourceqUUparentqcdocutils.nodes section q)q}q(hUU referencedqKhh)q}q(hUhKhhUsourceqX//home/matej/Build/m2crypto/doc/M2Crypto.SSL.rstqUtagnameqUsectionqU attributesq}q(Udupnamesq]qX ssl packageqaUclassesq]Ubackrefsq]Uidsq]qU ssl-packageqaUnamesq]uUlineqKUdocumentqhUchildrenq]q(cdocutils.nodes title q)q}q(hX SSL PackageqhhhhhUtitleqh}q(h]h]h]h]h]uhKhhh]qcdocutils.nodes Text qX SSL Packageqхq}q(hUhNhNhhhhubaubhh)q}q(hUhhhhhhh}q(h]h]h]h]q(Xmodule-M2Crypto.SSL.CheckerqUchecker-moduleqeh]qhauhK hhh]q(h)q}q(hX:mod:`Checker` Moduleqhhhhhhh}q(h]h]h]h]h]uhK hhh]q(csphinx.addnodes pending_xref q)q}q(hX:mod:`Checker`qhhhhhU pending_xrefqh}q(UreftypeXmodUrefwarnqU reftargetqXCheckerU refdomainXpyqh]h]U refexplicith]h]h]UrefdocqX M2Crypto.SSLqUpy:classqNU py:moduleqX M2Crypto.SSLquhK h]qcdocutils.nodes literal q)q}q(hhh}q(h]h]q(UxrefqhXpy-modqeh]h]h]uhhh]qhXCheckerqq}q(hUhhubahUliteralqubaubhX Moduleqq}q(hUhNhNhhhhubeubcsphinx.addnodes index q)r}r(hUhhhXT/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.CheckerrhUindexrh}r(h]h]h]h]h]Uentries]r(UsinglerXM2Crypto.SSL.Checker (module)Xmodule-M2Crypto.SSL.CheckerUNtrauhKhhh]ubcdocutils.nodes paragraph r)r }r (hX&SSL peer certificate checking routineshhhXT/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checkerr hU paragraphr h}r (h]h]h]h]h]uhKhhh]rhX&SSL peer certificate checking routinesrr}r(hUhNhNhhhj ubaubj)r}r(hXQCopyright (c) 2004-2007 Open Source Applications Foundation. All rights reserved.hhhj hj h}r(h]h]h]h]h]uhKhhh]rhXQCopyright (c) 2004-2007 Open Source Applications Foundation. All rights reserved.rr}r(hUhNhNhhhjubaubj)r}r(hX4Copyright 2008 Heikki Toivonen. All rights reserved.hhhj hj h}r(h]h]h]h]h]uhKhhh]rhX4Copyright 2008 Heikki Toivonen. All rights reserved.rr}r(hUhNhNhhhjubaubh)r }r!(hUhhhXi/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checker.SSLVerificationErrorr"hjh}r#(h]h]h]h]h]Uentries]r$(jXSSLVerificationErrorr%h?UNtr&auhNhhh]ubcsphinx.addnodes desc r')r(}r)(hUhhhj"hUdescr*h}r+(Unoindexr,Udomainr-Xpyh]h]h]h]h]Uobjtyper.X exceptionr/Udesctyper0j/uhNhhh]r1(csphinx.addnodes desc_signature r2)r3}r4(hj%hj(hXi/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checker.SSLVerificationErrorr5hUdesc_signaturer6h}r7(h]r8h?aUmoduler9cdocutils.nodes reprunicode r:XM2Crypto.SSL.Checkerr;r<}r=bh]h]h]h]r>h?aUfullnamer?j%Uclassr@UUfirstrAuhNhhh]rB(csphinx.addnodes desc_annotation rC)rD}rE(hX exception hj3hj5hUdesc_annotationrFh}rG(U xml:spacerHUpreserverIh]h]h]h]h]uhNhhh]rJhX exception rKrL}rM(hUhNhNhhhjDubaubcsphinx.addnodes desc_addname rN)rO}rP(hXM2Crypto.SSL.Checker.hj3hj5hU desc_addnamerQh}rR(jHjIh]h]h]h]h]uhNhhh]rShXM2Crypto.SSL.Checker.rTrU}rV(hUhNhNhhhjOubaubcsphinx.addnodes desc_name rW)rX}rY(hj%hj3hj5hU desc_namerZh}r[(jHjIh]h]h]h]h]uhNhhh]r\hXSSLVerificationErrorr]r^}r_(hUhNhNhhhjXubaubcsphinx.addnodes only r`)ra}rb(hUhj3hNhUonlyrch}rd(UexprUhtmlreh]h]h]h]h]uhNhhh]rfh)rg}rh(hUh}ri(UreftypeUviewcoderjUrefdochU refdomainUstdrkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/CheckerUrefidj%uhjah]rlcdocutils.nodes inline rm)rn}ro(hUh}rp(h]h]rqU viewcode-linkrrah]h]h]uhjgh]rshX[source]rtru}rv(hUhjnubahUinlinerwubahhubaubeubcsphinx.addnodes desc_content rx)ry}rz(hUhj(hj5hU desc_contentr{h}r|(h]h]h]h]h]uhNhhh]r}j)r~}r(hX$Bases: :class:`exceptions.Exception`hjyhj"hj h}r(h]h]h]h]h]uhKhhh]r(hXBases: rr}r(hUhNhNhhhj~ubh)r}r(hX:class:`exceptions.Exception`rhj~hhhhh}r(UreftypeXclasshhXexceptions.ExceptionU refdomainXpyrh]h]U refexplicith]h]h]hhhj%hXM2Crypto.SSL.CheckerruhKh]rh)r}r(hjh}r(h]h]r(hjXpy-classreh]h]h]uhjh]rhXexceptions.Exceptionrr}r(hUhjubahhubaubeubaubeubh)r}r(hUhhhXb/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checker.NoCertificaterhjh}r(h]h]h]h]h]Uentries]r(jX NoCertificaterhUNtrauhNhhh]ubj')r}r(hUhhhjhj*h}r(j,j-Xpyh]h]h]h]h]j.X exceptionrj0juhNhhh]r(j2)r}r(hjhjhXb/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checker.NoCertificaterhj6h}r(h]rhaj9j:XM2Crypto.SSL.Checkerrr}rbh]h]h]h]rhaj?jj@UjAuhNhhh]r(jC)r}r(hX exception hjhjhjFh}r(jHjIh]h]h]h]h]uhNhhh]rhX exception rr}r(hUhNhNhhhjubaubjN)r}r(hXM2Crypto.SSL.Checker.hjhjhjQh}r(jHjIh]h]h]h]h]uhNhhh]rhXM2Crypto.SSL.Checker.rr}r(hUhNhNhhhjubaubjW)r}r(hjhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX NoCertificaterr}r(hUhNhNhhhjubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/CheckerUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]rj)r}r(hX9Bases: :class:`M2Crypto.SSL.Checker.SSLVerificationError`hjhjhj h}r(h]h]h]h]h]uhKhhh]r(hXBases: rr}r(hUhNhNhhhjubh)r}r(hX2:class:`M2Crypto.SSL.Checker.SSLVerificationError`rhjhhhhh}r(UreftypeXclasshhX)M2Crypto.SSL.Checker.SSLVerificationErrorU refdomainXpyrh]h]U refexplicith]h]h]hhhjhjuhKh]rh)r}r(hjh}r(h]h]r(hjXpy-classreh]h]h]uhjh]rhX)M2Crypto.SSL.Checker.SSLVerificationErrorrr}r(hUhjubahhubaubeubaubeubh)r}r(hUhhhXe/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checker.WrongCertificaterhjh}r(h]h]h]h]h]Uentries]r(jXWrongCertificaterhUNtrauhNhhh]ubj')r}r(hUhhhjhj*h}r(j,j-Xpyh]h]h]h]h]j.X exceptionrj0juhNhhh]r(j2)r}r(hjhjhXe/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checker.WrongCertificaterhj6h}r(h]rhaj9j:XM2Crypto.SSL.Checkerrr}rbh]h]h]h]rhaj?jj@UjAuhNhhh]r(jC)r}r(hX exception hjhjhjFh}r(jHjIh]h]h]h]h]uhNhhh]rhX exception rr}r(hUhNhNhhhjubaubjN)r}r(hXM2Crypto.SSL.Checker.hjhjhjQh}r (jHjIh]h]h]h]h]uhNhhh]r hXM2Crypto.SSL.Checker.r r }r (hUhNhNhhhjubaubjW)r}r(hjhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXWrongCertificaterr}r(hUhNhNhhhjubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/CheckerUrefidjuhjh]rjm)r}r(hUh}r(h]h]r jrah]h]h]uhjh]r!hX[source]r"r#}r$(hUhjubahjwubahhubaubeubjx)r%}r&(hUhjhjhj{h}r'(h]h]h]h]h]uhNhhh]r(j)r)}r*(hX9Bases: :class:`M2Crypto.SSL.Checker.SSLVerificationError`hj%hjhj h}r+(h]h]h]h]h]uhKhhh]r,(hXBases: r-r.}r/(hUhNhNhhhj)ubh)r0}r1(hX2:class:`M2Crypto.SSL.Checker.SSLVerificationError`r2hj)hhhhh}r3(UreftypeXclasshhX)M2Crypto.SSL.Checker.SSLVerificationErrorU refdomainXpyr4h]h]U refexplicith]h]h]hhhjhjuhKh]r5h)r6}r7(hj2h}r8(h]h]r9(hj4Xpy-classr:eh]h]h]uhj0h]r;hX)M2Crypto.SSL.Checker.SSLVerificationErrorr<r=}r>(hUhj6ubahhubaubeubaubeubh)r?}r@(hUhhhX^/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checker.WrongHostrAhjh}rB(h]h]h]h]h]Uentries]rC(jX WrongHostrDh,UNtrEauhNhhh]ubj')rF}rG(hUhhhjAhj*h}rH(j,j-Xpyh]h]h]h]h]j.X exceptionrIj0jIuhNhhh]rJ(j2)rK}rL(hX;WrongHost(expectedHost, actualHost, fieldName='commonName')hjFhX^/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checker.WrongHostrMhj6h}rN(h]rOh,aj9j:XM2Crypto.SSL.CheckerrPrQ}rRbh]h]h]h]rSh,aj?jDj@UjAuhNhhh]rT(jC)rU}rV(hX exception hjKhjMhjFh}rW(jHjIh]h]h]h]h]uhNhhh]rXhX exception rYrZ}r[(hUhNhNhhhjUubaubjN)r\}r](hXM2Crypto.SSL.Checker.hjKhjMhjQh}r^(jHjIh]h]h]h]h]uhNhhh]r_hXM2Crypto.SSL.Checker.r`ra}rb(hUhNhNhhhj\ubaubjW)rc}rd(hjDhjKhjMhjZh}re(jHjIh]h]h]h]h]uhNhhh]rfhX WrongHostrgrh}ri(hUhNhNhhhjcubaubcsphinx.addnodes desc_parameterlist rj)rk}rl(hX0expectedHost, actualHost, fieldName='commonName'hjKhjMhUdesc_parameterlistrmh}rn(jHjIh]h]h]h]h]uhNhhh]ro(csphinx.addnodes desc_parameter rp)rq}rr(hX expectedHosth}rs(jHjIh]h]h]h]h]uhjkh]rthX expectedHostrurv}rw(hUhjqubahUdesc_parameterrxubjp)ry}rz(hX actualHosth}r{(jHjIh]h]h]h]h]uhjkh]r|hX actualHostr}r~}r(hUhjyubahjxubjp)r}r(hXfieldName='commonName'h}r(jHjIh]h]h]h]h]uhjkh]rhXfieldName='commonName'rr}r(hUhjubahjxubeubj`)r}r(hUhjKhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/CheckerUrefidjDuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjFhjMhj{h}r(h]h]h]h]h]uhNhhh]rj)r}r(hX9Bases: :class:`M2Crypto.SSL.Checker.SSLVerificationError`hjhjAhj h}r(h]h]h]h]h]uhKhhh]r(hXBases: rr}r(hUhNhNhhhjubh)r}r(hX2:class:`M2Crypto.SSL.Checker.SSLVerificationError`rhjhhhhh}r(UreftypeXclasshhX)M2Crypto.SSL.Checker.SSLVerificationErrorU refdomainXpyrh]h]U refexplicith]h]h]hhhjDhjuhK!h]rh)r}r(hjh}r(h]h]r(hjXpy-classreh]h]h]uhjh]rhX)M2Crypto.SSL.Checker.SSLVerificationErrorrr}r(hUhjubahhubaubeubaubeubh)r}r(hUhhhNhjh}r(h]h]h]h]h]Uentries]r(jX'Checker (class in M2Crypto.SSL.Checker)h2UNtrauhNhhh]ubj')r}r(hUhhhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xclassrj0juhNhhh]r(j2)r}r(hX<Checker(host=None, peerCertHash=None, peerCertDigest='sha1')hjhX\/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checker.Checkerrhj6h}r(h]rh2aj9j:XM2Crypto.SSL.Checkerrr}rbh]h]h]h]rh2aj?XCheckerrj@UjAuhNhhh]r(jC)r}r(hXclass hjhjhjFh}r(jHjIh]h]h]h]h]uhNhhh]rhXclass rr}r(hUhNhNhhhjubaubjN)r}r(hXM2Crypto.SSL.Checker.hjhjhjQh}r(jHjIh]h]h]h]h]uhNhhh]rhXM2Crypto.SSL.Checker.rr}r(hUhNhNhhhjubaubjW)r}r(hjhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXCheckerrr}r(hUhNhNhhhjubaubjj)r}r(hX3host=None, peerCertHash=None, peerCertDigest='sha1'hjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]r(jp)r}r(hX host=Noneh}r(jHjIh]h]h]h]h]uhjh]rhX host=Nonerr}r(hUhjubahjxubjp)r}r(hXpeerCertHash=Noneh}r(jHjIh]h]h]h]h]uhjh]rhXpeerCertHash=Nonerr}r(hUhjubahjxubjp)r}r(hXpeerCertDigest='sha1'h}r(jHjIh]h]h]h]h]uhjh]rhXpeerCertDigest='sha1'rr}r(hUhjubahjxubeubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/CheckerUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(h)r}r (hUhjhNhjh}r (h]h]h]h]h]Uentries]r (jX7numericIpMatch (M2Crypto.SSL.Checker.Checker attribute)hUNtr auhNhhh]ubj')r }r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.X attributerj0juhNhhh]r(j2)r}r(hXChecker.numericIpMatchhj hXk/home/matej/Build/m2crypto/M2Crypto/SSL/Checker.py:docstring of M2Crypto.SSL.Checker.Checker.numericIpMatchrhj6h}r(h]rhaj9j:XM2Crypto.SSL.Checkerrr}rbh]h]h]h]rhaj?XChecker.numericIpMatchj@jjAuhNhhh]r(jW)r}r(hXnumericIpMatchhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXnumericIpMatchr r!}r"(hUhNhNhhhjubaubjC)r#}r$(hX = <_sre.SRE_Pattern object>hjhjhjFh}r%(jHjIh]h]h]h]h]uhNhhh]r&hX = <_sre.SRE_Pattern object>r'r(}r)(hUhNhNhhhj#ubaubeubjx)r*}r+(hUhj hjhj{h}r,(h]h]h]h]h]uhNhhh]ubeubeubeubeubh)r-}r.(hUhhhhhhh}r/(h]h]h]h]r0(Xmodule-M2Crypto.SSL.Cipherr1U cipher-moduler2eh]r3hfauhKhhh]r4(h)r5}r6(hX:mod:`Cipher` Moduler7hj-hhhhh}r8(h]h]h]h]h]uhKhhh]r9(h)r:}r;(hX :mod:`Cipher`r<hj5hhhhh}r=(UreftypeXmodhhXCipherU refdomainXpyr>h]h]U refexplicith]h]h]hhhNhjuhKh]r?h)r@}rA(hj<h}rB(h]h]rC(hj>Xpy-modrDeh]h]h]uhj:h]rEhXCipherrFrG}rH(hUhj@ubahhubaubhX ModulerIrJ}rK(hUhNhNhhhj5ubeubh)rL}rM(hUhj-hXR/home/matej/Build/m2crypto/M2Crypto/SSL/Cipher.py:docstring of M2Crypto.SSL.CipherrNhjh}rO(h]h]h]h]h]Uentries]rP(jXM2Crypto.SSL.Cipher (module)Xmodule-M2Crypto.SSL.CipherUNtrQauhKhhh]ubj)rR}rS(hX SSL Ciphershj-hXR/home/matej/Build/m2crypto/M2Crypto/SSL/Cipher.py:docstring of M2Crypto.SSL.CipherrThj h}rU(h]h]h]h]h]uhKhhh]rVhX SSL CiphersrWrX}rY(hUhNhNhhhjRubaubj)rZ}r[(hX<Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.hj-hjThj h}r\(h]h]h]h]h]uhKhhh]r]hX<Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.r^r_}r`(hUhNhNhhhjZubaubh)ra}rb(hUhj-hNhjh}rc(h]h]h]h]h]Uentries]rd(jX%Cipher (class in M2Crypto.SSL.Cipher)hvUNtreauhNhhh]ubj')rf}rg(hUhj-hNhj*h}rh(j,j-Xpyh]h]h]h]h]j.Xclassrij0jiuhNhhh]rj(j2)rk}rl(hXCipher(cipher)hjfhXY/home/matej/Build/m2crypto/M2Crypto/SSL/Cipher.py:docstring of M2Crypto.SSL.Cipher.Cipherrmhj6h}rn(h]rohvaj9j:XM2Crypto.SSL.Cipherrprq}rrbh]h]h]h]rshvaj?XCipherrtj@UjAuhNhhh]ru(jC)rv}rw(hXclass hjkhjmhjFh}rx(jHjIh]h]h]h]h]uhNhhh]ryhXclass rzr{}r|(hUhNhNhhhjvubaubjN)r}}r~(hXM2Crypto.SSL.Cipher.hjkhjmhjQh}r(jHjIh]h]h]h]h]uhNhhh]rhXM2Crypto.SSL.Cipher.rr}r(hUhNhNhhhj}ubaubjW)r}r(hjthjkhjmhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXCipherrr}r(hUhNhNhhhjubaubjj)r}r(hXcipherhjkhjmhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXcipherh}r(jHjIh]h]h]h]h]uhjh]rhXcipherrr}r(hUhjubahjxubaubj`)r}r(hUhjkhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/CipherUrefidjtuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjfhjmhj{h}r(h]h]h]h]h]uhNhhh]r(h)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX*name() (M2Crypto.SSL.Cipher.Cipher method)hUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX Cipher.name()hjhX^/home/matej/Build/m2crypto/M2Crypto/SSL/Cipher.py:docstring of M2Crypto.SSL.Cipher.Cipher.namerhj6h}r(h]rhaj9j:XM2Crypto.SSL.Cipherrr}rbh]h]h]h]rhaj?X Cipher.namerj@jtjAuhNhhh]r(jW)r}r(hXnamehjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXnamerr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/CipherUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX-version() (M2Crypto.SSL.Cipher.Cipher method)hZUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXCipher.version()hjhXa/home/matej/Build/m2crypto/M2Crypto/SSL/Cipher.py:docstring of M2Crypto.SSL.Cipher.Cipher.versionrhj6h}r(h]rhZaj9j:XM2Crypto.SSL.Cipherrr}rbh]h]h]h]rhZaj?XCipher.versionrj@jtjAuhNhhh]r(jW)r}r(hXversionhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXversionrr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/CipherUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr }r (hUhjubahjwubahhubaubeubjx)r }r (hUhjhjhj{h}r (h]h]h]h]h]uhNhhh]ubeubeubeubh)r}r(hUhj-hNhjh}r(h]h]h]h]h]Uentries]r(jX+Cipher_Stack (class in M2Crypto.SSL.Cipher)hUNtrauhNhhh]ubj')r}r(hUhj-hNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xclassrj0juhNhhh]r(j2)r}r(hXCipher_Stack(stack)hjhX_/home/matej/Build/m2crypto/M2Crypto/SSL/Cipher.py:docstring of M2Crypto.SSL.Cipher.Cipher_Stackrhj6h}r(h]rhaj9j:XM2Crypto.SSL.Cipherrr}rbh]h]h]h]r haj?X Cipher_Stackr!j@UjAuhNhhh]r"(jC)r#}r$(hXclass hjhjhjFh}r%(jHjIh]h]h]h]h]uhNhhh]r&hXclass r'r(}r)(hUhNhNhhhj#ubaubjN)r*}r+(hXM2Crypto.SSL.Cipher.hjhjhjQh}r,(jHjIh]h]h]h]h]uhNhhh]r-hXM2Crypto.SSL.Cipher.r.r/}r0(hUhNhNhhhj*ubaubjW)r1}r2(hj!hjhjhjZh}r3(jHjIh]h]h]h]h]uhNhhh]r4hX Cipher_Stackr5r6}r7(hUhNhNhhhj1ubaubjj)r8}r9(hXstackhjhjhjmh}r:(jHjIh]h]h]h]h]uhNhhh]r;jp)r<}r=(hXstackh}r>(jHjIh]h]h]h]h]uhj8h]r?hXstackr@rA}rB(hUhj<ubahjxubaubj`)rC}rD(hUhjhNhjch}rE(Uexprjeh]h]h]h]h]uhNhhh]rFh)rG}rH(hUh}rI(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/CipherUrefidj!uhjCh]rJjm)rK}rL(hUh}rM(h]h]rNjrah]h]h]uhjGh]rOhX[source]rPrQ}rR(hUhjKubahjwubahhubaubeubjx)rS}rT(hUhjhjhj{h}rU(h]h]h]h]h]uhNhhh]ubeubeubh)rV}rW(hUhhhhhhh}rX(h]h]h]h]rY(Xmodule-M2Crypto.SSL.ConnectionrZUconnection-moduler[eh]r\hhauhKhhh]r](h)r^}r_(hX:mod:`Connection` Moduler`hjVhhhhh}ra(h]h]h]h]h]uhKhhh]rb(h)rc}rd(hX:mod:`Connection`rehj^hhhhh}rf(UreftypeXmodhhX ConnectionU refdomainXpyrgh]h]U refexplicith]h]h]hhhNhXM2Crypto.SSL.CipherrhuhKh]rih)rj}rk(hjeh}rl(h]h]rm(hjgXpy-modrneh]h]h]uhjch]rohX Connectionrprq}rr(hUhjjubahhubaubhX Modulersrt}ru(hUhNhNhhhj^ubeubh)rv}rw(hUhjVhXe/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connectionrxhjh}ry(h]h]h]h]h]Uentries]rz(jX M2Crypto.SSL.Connection (module)Xmodule-M2Crypto.SSL.ConnectionUNtr{auhKhhh]ubh)r|}r}(hUhjVhNhjh}r~(h]h]h]h]h]Uentries]r(jX-Connection (class in M2Crypto.SSL.Connection)h+UNtrauhNhhh]ubj')r}r(hUhjVhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xclassrj0juhNhhh]r(j2)r}r(hX$Connection(ctx, sock=None, family=2)hjhXe/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connectionrhj6h}r(h]rh+aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh+aj?X Connectionrj@UjAuhNhhh]r(jC)r}r(hXclass hjhjhjFh}r(jHjIh]h]h]h]h]uhNhhh]rhXclass rr}r(hUhNhNhhhjubaubjN)r}r(hXM2Crypto.SSL.Connection.hjhjhjQh}r(jHjIh]h]h]h]h]uhNhhh]rhXM2Crypto.SSL.Connection.rr}r(hUhNhNhhhjubaubjW)r}r(hjhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX Connectionrr}r(hUhNhNhhhjubaubjj)r}r(hXctx, sock=None, family=2hjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]r(jp)r}r(hXctxh}r(jHjIh]h]h]h]h]uhjh]rhXctxrr}r(hUhjubahjxubjp)r}r(hX sock=Noneh}r(jHjIh]h]h]h]h]uhjh]rhX sock=Nonerr}r(hUhjubahjxubjp)r}r(hXfamily=2h}r(jHjIh]h]h]h]h]uhjh]rhXfamily=2rr}r(hUhjubahjxubeubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hXAn SSL connection.hjhXe/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connectionhj h}r(h]h]h]h]h]uhKhhh]rhXAn SSL connection.rr}r(hUhNhNhhhjubaubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX4accept() (M2Crypto.SSL.Connection.Connection method)h0UNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.accept()hjhXl/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.acceptrhj6h}r(h]rh0aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh0aj?XConnection.acceptrj@jjAuhNhhh]r(jW)r}r(hXaccepthjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXacceptrr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r }r (hUhjhjhj{h}r (h]h]h]h]h]uhNhhh]r (j)r }r(hXAccept an SSL connection.hj hXl/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.acceptrhj h}r(h]h]h]h]h]uhKhhh]rhXAccept an SSL connection.rr}r(hUhNhNhhhj ubaubj)r}r(hXThe return value is a pair (ssl, addr) where ssl is a new SSL connection object and addr is the address bound to the other end of the SSL connection.hj hjhj h}r(h]h]h]h]h]uhKhhh]rhXThe return value is a pair (ssl, addr) where ssl is a new SSL connection object and addr is the address bound to the other end of the SSL connection.rr}r(hUhNhNhhhjubaubcdocutils.nodes field_list r)r}r(hUhj hNhU field_listrh}r (h]h]h]h]h]uhNhhh]r!cdocutils.nodes field r")r#}r$(hUh}r%(h]h]h]h]h]uhjh]r&(cdocutils.nodes field_name r')r(}r)(hXReturnshj#hjhU field_namer*h}r+(h]h]h]h]h]uhKh]r,hXReturnsr-r.}r/(hUhj(ubaubcdocutils.nodes field_body r0)r1}r2(hUh}r3(h]h]h]h]h]uhj#h]r4j)r5}r6(hXtuple of Connection and addr. Address can take very various forms (see socket documentation), for IPv4 it is tuple(str, int), for IPv6 a tuple of four (host, port, flowinfo, scopeid), where the last two are optional ints.h}r7(h]h]h]h]h]uhj1h]r8hXtuple of Connection and addr. Address can take very various forms (see socket documentation), for IPv4 it is tuple(str, int), for IPv6 a tuple of four (host, port, flowinfo, scopeid), where the last two are optional ints.r9r:}r;(hUhNhNhhhj5ubahj ubahU field_bodyr<ubehUfieldr=ubaubeubeubh)r>}r?(hUhjhNhjh}r@(h]h]h]h]h]Uentries]rA(jX8accept_ssl() (M2Crypto.SSL.Connection.Connection method)hsUNtrBauhNhhh]ubj')rC}rD(hUhjhNhj*h}rE(j,j-Xpyh]h]h]h]h]j.XmethodrFj0jFuhNhhh]rG(j2)rH}rI(hXConnection.accept_ssl()hjChXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.accept_sslrJhj6h}rK(h]rLhsaj9j:XM2Crypto.SSL.ConnectionrMrN}rObh]h]h]h]rPhsaj?XConnection.accept_sslrQj@jjAuhNhhh]rR(jW)rS}rT(hX accept_sslhjHhjJhjZh}rU(jHjIh]h]h]h]h]uhNhhh]rVhX accept_sslrWrX}rY(hUhNhNhhhjSubaubjj)rZ}r[(hUhjHhjJhjmh}r\(jHjIh]h]h]h]h]uhNhhh]ubj`)r]}r^(hUhjHhNhjch}r_(Uexprjeh]h]h]h]h]uhNhhh]r`h)ra}rb(hUh}rc(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjQuhj]h]rdjm)re}rf(hUh}rg(h]h]rhjrah]h]h]uhjah]rihX[source]rjrk}rl(hUhjeubahjwubahhubaubeubjx)rm}rn(hUhjChjJhj{h}ro(h]h]h]h]h]uhNhhh]rp(j)rq}rr(hX=Waits for a TLS/SSL client to initiate the TLS/SSL handshake.hjmhXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.accept_sslrshj h}rt(h]h]h]h]h]uhKhhh]ruhX=Waits for a TLS/SSL client to initiate the TLS/SSL handshake.rvrw}rx(hUhNhNhhhjqubaubj)ry}rz(hXjThe communication channel must already have been set and assigned to the ssl by setting an underlying BIO.hjmhjshj h}r{(h]h]h]h]h]uhKhhh]r|hXjThe communication channel must already have been set and assigned to the ssl by setting an underlying BIO.r}r~}r(hUhNhNhhhjyubaubj)r}r(hUhjmhNhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hXReturnshjhjJhj*h}r(h]h]h]h]h]uhKh]rhXReturnsrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX_0 The TLS/SSL handshake was not successful but was shut down controlled and by the specifications of the TLS/SSL protocol. Call get_error() with the return value ret to find out the reason. 1 The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been established. <0 The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur of action is need to continue the operation for non-blocking BIOs. Call get_error() with the return value ret to find out the reason.h}r(h]h]h]h]h]uhjh]rcdocutils.nodes definition_list r)r}r(hUhjhNhUdefinition_listrh}r(h]h]h]h]h]uhNhhh]r(cdocutils.nodes definition_list_item r)r}r(hX0 The TLS/SSL handshake was not successful but was shut down controlled and by the specifications of the TLS/SSL protocol. Call get_error() with the return value ret to find out the reason. hjhjshUdefinition_list_itemrh}r(h]h]h]h]h]uhK h]r(cdocutils.nodes term r)r}r(hX70 The TLS/SSL handshake was not successful but was shuthjhjshUtermrh}r(h]h]h]h]h]uhK h]rhX70 The TLS/SSL handshake was not successful but was shutrr}r(hUhjubaubcdocutils.nodes definition r)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hXdown controlled and by the specifications of the TLS/SSL protocol. Call get_error() with the return value ret to find out the reason.hjhjshj h}r(h]h]h]h]h]uhKh]rhXdown controlled and by the specifications of the TLS/SSL protocol. Call get_error() with the return value ret to find out the reason.rr}r(hUhjubaubahU definitionrubeubj)r}r(hX_1 The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been established. hjhjshjh}r(h]h]h]h]h]uhK h]r(j)r}r(hX31 The TLS/SSL handshake was successfully completed,hjhjshjh}r(h]h]h]h]h]uhK h]rhX31 The TLS/SSL handshake was successfully completed,rr}r(hUhjubaubj)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX*a TLS/SSL connection has been established.hjhjshj h}r(h]h]h]h]h]uhK h]rhX*a TLS/SSL connection has been established.rr}r(hUhjubaubahjubeubj)r}r(hX=<0 The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur of action is need to continue the operation for non-blocking BIOs. Call get_error() with the return value ret to find out the reason.hjhjshjh}r(h]h]h]h]h]uhKh]r(j)r}r(hX3<0 The TLS/SSL handshake was not successful becausehjhjshjh}r(h]h]h]h]h]uhKh]rhX3<0 The TLS/SSL handshake was not successful becauserr}r(hUhjubaubj)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur of action is need to continue the operation for non-blocking BIOs. Call get_error() with the return value ret to find out the reason.hjhjshj h}r(h]h]h]h]h]uhKh]rhX a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur of action is need to continue the operation for non-blocking BIOs. Call get_error() with the return value ret to find out the reason.rr}r(hUhjubaubahjubeubeubahj ubahj<ubehj=ubaubeubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX2bind() (M2Crypto.SSL.Connection.Connection method)h>UNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.bind(addr)hjhXj/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.bindrhj6h}r(h]rh>aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh>aj?XConnection.bindrj@jjAuhNhhh]r(jW)r}r(hXbindhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXbindrr}r(hUhNhNhhhjubaubjj)r}r(hXaddrhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXaddrh}r(jHjIh]h]h]h]h]uhjh]rhXaddrr r }r (hUhjubahjxubaubj`)r }r (hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhj h]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r (hUhjhXk/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.clearr!hjh}r"(h]h]h]h]h]Uentries]r#(jX3clear() (M2Crypto.SSL.Connection.Connection method)h=UNtr$auhNhhh]ubj')r%}r&(hUhjhj!hj*h}r'(j,j-Xpyh]h]h]h]h]j.Xmethodr(j0j(uhNhhh]r)(j2)r*}r+(hXConnection.clear()hj%hXk/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.clearr,hj6h}r-(h]r.h=aj9j:XM2Crypto.SSL.Connectionr/r0}r1bh]h]h]h]r2h=aj?XConnection.clearr3j@jjAuhNhhh]r4(jW)r5}r6(hXclearhj*hj,hjZh}r7(jHjIh]h]h]h]h]uhNhhh]r8hXclearr9r:}r;(hUhNhNhhhj5ubaubjj)r<}r=(hUhj*hj,hjmh}r>(jHjIh]h]h]h]h]uhNhhh]ubj`)r?}r@(hUhj*hNhjch}rA(Uexprjeh]h]h]h]h]uhNhhh]rBh)rC}rD(hUh}rE(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj3uhj?h]rFjm)rG}rH(hUh}rI(h]h]rJjrah]h]h]uhjCh]rKhX[source]rLrM}rN(hUhjGubahjwubahhubaubeubjx)rO}rP(hUhj%hj,hj{h}rQ(h]h]h]h]h]uhNhhh]rRj)rS}rT(hXIf there were errors in this connection, call clear() rather than close() to end it, so that bad sessions will be cleared from cache.hjOhj!hj h}rU(h]h]h]h]h]uhKhhh]rVhXIf there were errors in this connection, call clear() rather than close() to end it, so that bad sessions will be cleared from cache.rWrX}rY(hUhNhNhhhjSubaubaubeubh)rZ}r[(hUhjhNhjh}r\(h]h]h]h]h]Uentries]r](jXHclientPostConnectionCheck (M2Crypto.SSL.Connection.Connection attribute)hOUNtr^auhNhhh]ubj')r_}r`(hUhjhNhj*h}ra(j,j-Xpyh]h]h]h]h]j.X attributerbj0jbuhNhhh]rc(j2)rd}re(hX$Connection.clientPostConnectionCheckhj_hX/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.clientPostConnectionCheckrfhj6h}rg(h]rhhOaj9j:XM2Crypto.SSL.Connectionrirj}rkbh]h]h]h]rlhOaj?X$Connection.clientPostConnectionCheckj@jjAuhNhhh]rm(jW)rn}ro(hXclientPostConnectionCheckhjdhjfhjZh}rp(jHjIh]h]h]h]h]uhNhhh]rqhXclientPostConnectionCheckrrrs}rt(hUhNhNhhhjnubaubjC)ru}rv(hX* = hjdhjfhjFh}rw(jHjIh]h]h]h]h]uhNhhh]rxhX* = ryrz}r{(hUhNhNhhhjuubaubeubjx)r|}r}(hUhj_hjfhj{h}r~(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX3close() (M2Crypto.SSL.Connection.Connection method)hUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.close()hjhXk/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.closerhj6h}r(h]rhaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhaj?XConnection.closerj@jjAuhNhhh]r(jW)r}r(hXclosehjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXcloserr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhXm/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.connectrhjh}r(h]h]h]h]h]Uentries]r(jX5connect() (M2Crypto.SSL.Connection.Connection method)h6UNtrauhNhhh]ubj')r}r(hUhjhjhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.connect(addr)hjhXm/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.connectrhj6h}r(h]rh6aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh6aj?XConnection.connectrj@jjAuhNhhh]r(jW)r}r(hXconnecthjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXconnectrr}r(hUhNhNhhhjubaubjj)r}r(hXaddrhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXaddrh}r(jHjIh]h]h]h]h]uhjh]rhXaddrrr}r(hUhjubahjxubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hXOverloading socket.connect()hjhjhj h}r(h]h]h]h]h]uhKhhh]rhXOverloading socket.connect()rr}r(hUhNhNhhhjubaubj)r}r(hUhjhjhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhjhj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX6addr -- addresses have various depending on their typeh}r (h]h]h]h]h]uhjh]r (csphinx.addnodes literal_strong r )r }r (hXaddrh}r(h]h]U refspecificrh]h]h]uhjh]rhXaddrrr}r(hUhj ubahUliteral_strongrubhX – rr}r(hUhjubhX.addresses have various depending on their typerr}r(hUhNhNhhhjubehj ubahj<ubehj=ubaubj)r}r(hX:return:status of ssl_connect()hjhjhj h}r(h]h]h]h]h]uhKhhh]rhX:return:status of ssl_connect()rr }r!(hUhNhNhhhjubaubeubeubh)r"}r#(hUhjhNhjh}r$(h]h]h]h]h]Uentries]r%(jX9connect_ssl() (M2Crypto.SSL.Connection.Connection method)hoUNtr&auhNhhh]ubj')r'}r((hUhjhNhj*h}r)(j,j-Xpyh]h]h]h]h]j.Xmethodr*j0j*uhNhhh]r+(j2)r,}r-(hXConnection.connect_ssl()hj'hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.connect_sslr.hj6h}r/(h]r0hoaj9j:XM2Crypto.SSL.Connectionr1r2}r3bh]h]h]h]r4hoaj?XConnection.connect_sslr5j@jjAuhNhhh]r6(jW)r7}r8(hX connect_sslhj,hj.hjZh}r9(jHjIh]h]h]h]h]uhNhhh]r:hX connect_sslr;r<}r=(hUhNhNhhhj7ubaubjj)r>}r?(hUhj,hj.hjmh}r@(jHjIh]h]h]h]h]uhNhhh]ubj`)rA}rB(hUhj,hNhjch}rC(Uexprjeh]h]h]h]h]uhNhhh]rDh)rE}rF(hUh}rG(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj5uhjAh]rHjm)rI}rJ(hUh}rK(h]h]rLjrah]h]h]uhjEh]rMhX[source]rNrO}rP(hUhjIubahjwubahhubaubeubjx)rQ}rR(hUhj'hj.hj{h}rS(h]h]h]h]h]uhNhhh]ubeubh)rT}rU(hUhjhNhjh}rV(h]h]h]h]h]Uentries]rW(jX4fileno() (M2Crypto.SSL.Connection.Connection method)hgUNtrXauhNhhh]ubj')rY}rZ(hUhjhNhj*h}r[(j,j-Xpyh]h]h]h]h]j.Xmethodr\j0j\uhNhhh]r](j2)r^}r_(hXConnection.fileno()hjYhXl/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.filenor`hj6h}ra(h]rbhgaj9j:XM2Crypto.SSL.Connectionrcrd}rebh]h]h]h]rfhgaj?XConnection.filenorgj@jjAuhNhhh]rh(jW)ri}rj(hXfilenohj^hj`hjZh}rk(jHjIh]h]h]h]h]uhNhhh]rlhXfilenormrn}ro(hUhNhNhhhjiubaubjj)rp}rq(hUhj^hj`hjmh}rr(jHjIh]h]h]h]h]uhNhhh]ubj`)rs}rt(hUhj^hNhjch}ru(Uexprjeh]h]h]h]h]uhNhhh]rvh)rw}rx(hUh}ry(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjguhjsh]rzjm)r{}r|(hUh}r}(h]h]r~jrah]h]h]uhjwh]rhX[source]rr}r(hUhj{ubahjwubahhubaubeubjx)r}r(hUhjYhj`hj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_cipherrhjh}r(h]h]h]h]h]Uentries]r(jX8get_cipher() (M2Crypto.SSL.Connection.Connection method)h4UNtrauhNhhh]ubj')r}r(hUhjhjhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.get_cipher()hjhXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_cipherrhj6h}r(h]rh4aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh4aj?XConnection.get_cipherrj@jjAuhNhhh]r(jW)r}r(hX get_cipherhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX get_cipherrr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]rj)r}r(hXReturn an M2Crypto.SSL.Cipher object for this connection; if the connection has not been initialised with a cipher suite, return None.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhXReturn an M2Crypto.SSL.Cipher object for this connection; if the connection has not been initialised with a cipher suite, return None.rr}r(hUhNhNhhhjubaubaubeubh)r}r(hUhjhXu/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_cipher_listrhjh}r(h]h]h]h]h]Uentries]r(jX=get_cipher_list() (M2Crypto.SSL.Connection.Connection method)hUNtrauhNhhh]ubj')r}r(hUhjhjhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX!Connection.get_cipher_list(idx=0)hjhXu/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_cipher_listrhj6h}r(h]rhaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhaj?XConnection.get_cipher_listrj@jjAuhNhhh]r(jW)r}r(hXget_cipher_listhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXget_cipher_listrr}r(hUhNhNhhhjubaubjj)r}r(hXidx=0hjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXidx=0h}r(jHjIh]h]h]h]h]uhjh]rhXidx=0rr}r(hUhjubahjxubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]rj)r}r(hX@Return the cipher suites for this connection as a string object.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhX@Return the cipher suites for this connection as a string object.rr}r(hUhNhNhhhjubaubaubeubh)r}r(hUhjhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_ciphersrhjh}r(h]h]h]h]h]Uentries]r(jX9get_ciphers() (M2Crypto.SSL.Connection.Connection method)hUNtr auhNhhh]ubj')r }r (hUhjhjhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r(j2)r}r(hXConnection.get_ciphers()hj hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_ciphersrhj6h}r(h]rhaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhaj?XConnection.get_ciphersrj@jjAuhNhhh]r(jW)r}r(hX get_ciphershjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX get_ciphersrr}r (hUhNhNhhhjubaubjj)r!}r"(hUhjhjhjmh}r#(jHjIh]h]h]h]h]uhNhhh]ubj`)r$}r%(hUhjhNhjch}r&(Uexprjeh]h]h]h]h]uhNhhh]r'h)r(}r)(hUh}r*(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhj$h]r+jm)r,}r-(hUh}r.(h]h]r/jrah]h]h]uhj(h]r0hX[source]r1r2}r3(hUhj,ubahjwubahhubaubeubjx)r4}r5(hUhj hjhj{h}r6(h]h]h]h]h]uhNhhh]r7j)r8}r9(hXReturn an M2Crypto.SSL.Cipher_Stack object for this connection; if the connection has not been initialised with cipher suites, return None.hj4hjhj h}r:(h]h]h]h]h]uhKhhh]r;hXReturn an M2Crypto.SSL.Cipher_Stack object for this connection; if the connection has not been initialised with cipher suites, return None.r<r=}r>(hUhNhNhhhj8ubaubaubeubh)r?}r@(hUhjhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_contextrAhjh}rB(h]h]h]h]h]Uentries]rC(jX9get_context() (M2Crypto.SSL.Connection.Connection method)hUNtrDauhNhhh]ubj')rE}rF(hUhjhjAhj*h}rG(j,j-Xpyh]h]h]h]h]j.XmethodrHj0jHuhNhhh]rI(j2)rJ}rK(hXConnection.get_context()hjEhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_contextrLhj6h}rM(h]rNhaj9j:XM2Crypto.SSL.ConnectionrOrP}rQbh]h]h]h]rRhaj?XConnection.get_contextrSj@jjAuhNhhh]rT(jW)rU}rV(hX get_contexthjJhjLhjZh}rW(jHjIh]h]h]h]h]uhNhhh]rXhX get_contextrYrZ}r[(hUhNhNhhhjUubaubjj)r\}r](hUhjJhjLhjmh}r^(jHjIh]h]h]h]h]uhNhhh]ubj`)r_}r`(hUhjJhNhjch}ra(Uexprjeh]h]h]h]h]uhNhhh]rbh)rc}rd(hUh}re(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjSuhj_h]rfjm)rg}rh(hUh}ri(h]h]rjjrah]h]h]uhjch]rkhX[source]rlrm}rn(hUhjgubahjwubahhubaubeubjx)ro}rp(hUhjEhjLhj{h}rq(h]h]h]h]h]uhNhhh]rrj)rs}rt(hX:Return the Context object associated with this connection.hjohjAhj h}ru(h]h]h]h]h]uhKhhh]rvhX:Return the Context object associated with this connection.rwrx}ry(hUhNhNhhhjsubaubaubeubh)rz}r{(hUhjhNhjh}r|(h]h]h]h]h]Uentries]r}(jXIget_default_session_timeout() (M2Crypto.SSL.Connection.Connection method)h:UNtr~auhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX(Connection.get_default_session_timeout()hjhX/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_default_session_timeoutrhj6h}r(h]rh:aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh:aj?X&Connection.get_default_session_timeoutrj@jjAuhNhhh]r(jW)r}r(hXget_default_session_timeouthjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXget_default_session_timeoutrr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhXs/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_peer_certrhjh}r(h]h]h]h]h]Uentries]r(jX;get_peer_cert() (M2Crypto.SSL.Connection.Connection method)h5UNtrauhNhhh]ubj')r}r(hUhjhjhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.get_peer_cert()hjhXs/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_peer_certrhj6h}r(h]rh5aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh5aj?XConnection.get_peer_certrj@jjAuhNhhh]r(jW)r}r(hX get_peer_certhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX get_peer_certrr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hXReturn the peer certificate.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhXReturn the peer certificate.rr}r(hUhNhNhhhjubaubj)r}r(hX7If the peer did not provide a certificate, return None.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhX7If the peer did not provide a certificate, return None.rr}r(hUhNhNhhhjubaubeubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jXAget_peer_cert_chain() (M2Crypto.SSL.Connection.Connection method)hDUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX Connection.get_peer_cert_chain()hjhXy/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_peer_cert_chainrhj6h}r(h]rhDaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]r hDaj?XConnection.get_peer_cert_chainr j@jjAuhNhhh]r (jW)r }r (hXget_peer_cert_chainhjhjhjZh}r (jHjIh]h]h]h]h]uhNhhh]r hXget_peer_cert_chainr r }r (hUhNhNhhhj ubaubjj)r }r (hUhjhjhjmh}r (jHjIh]h]h]h]h]uhNhhh]ubj`)r }r (hUhjhNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhjhjhj{h}r (h]h]h]h]h]uhNhhh]r (j)r! }r" (hX`Return the peer certificate chain; if the peer did not provide a certificate chain, return None.hj hXy/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_peer_cert_chainr# hj h}r$ (h]h]h]h]h]uhKhhh]r% hX`Return the peer certificate chain; if the peer did not provide a certificate chain, return None.r& r' }r( (hUhNhNhhhj! ubaubj)r) }r* (hUhj hNhjh}r+ (h]h]h]h]h]uhNhhh]r, j")r- }r. (hUhj) hj# hj=h}r/ (h]h]h]h]h]uhKhhh]r0 (j')r1 }r2 (hXwarninghj- hj# hj*h}r3 (h]h]h]h]h]uhKh]r4 hXWarningr5 r6 }r7 (hUhj1 ubaubj0)r8 }r9 (hXThe returned chain will be valid only for as long as the connection object is alive. Once the connection object gets freed, the chain will be freed as well.h}r: (h]h]h]h]h]uhj- h]r; j)r< }r= (hXThe returned chain will be valid only for as long as the connection object is alive. Once the connection object gets freed, the chain will be freed as well.hj8 hj# hj h}r> (h]h]h]h]h]uhKh]r? hXThe returned chain will be valid only for as long as the connection object is alive. Once the connection object gets freed, the chain will be freed as well.r@ rA }rB (hUhj< ubaubahj<ubeubaubeubeubh)rC }rD (hUhjhNhjh}rE (h]h]h]h]h]Uentries]rF (jX9get_session() (M2Crypto.SSL.Connection.Connection method)h UNtrG auhNhhh]ubj')rH }rI (hUhjhNhj*h}rJ (j,j-Xpyh]h]h]h]h]j.XmethodrK j0jK uhNhhh]rL (j2)rM }rN (hXConnection.get_session()hjH hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_sessionrO hj6h}rP (h]rQ h aj9j:XM2Crypto.SSL.ConnectionrR rS }rT bh]h]h]h]rU h aj?XConnection.get_sessionrV j@jjAuhNhhh]rW (jW)rX }rY (hX get_sessionhjM hjO hjZh}rZ (jHjIh]h]h]h]h]uhNhhh]r[ hX get_sessionr\ r] }r^ (hUhNhNhhhjX ubaubjj)r_ }r` (hUhjM hjO hjmh}ra (jHjIh]h]h]h]h]uhNhhh]ubj`)rb }rc (hUhjM hNhjch}rd (Uexprjeh]h]h]h]h]uhNhhh]re h)rf }rg (hUh}rh (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjV uhjb h]ri jm)rj }rk (hUh}rl (h]h]rm jrah]h]h]uhjf h]rn hX[source]ro rp }rq (hUhjj ubahjwubahhubaubeubjx)rr }rs (hUhjH hjO hj{h}rt (h]h]h]h]h]uhNhhh]ubeubh)ru }rv (hUhjhXr/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_shutdownrw hjh}rx (h]h]h]h]h]Uentries]ry (jX:get_shutdown() (M2Crypto.SSL.Connection.Connection method)hUNtrz auhNhhh]ubj')r{ }r| (hUhjhjw hj*h}r} (j,j-Xpyh]h]h]h]h]j.Xmethodr~ j0j~ uhNhhh]r (j2)r }r (hXConnection.get_shutdown()hj{ hXr/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_shutdownr hj6h}r (h]r haj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r haj?XConnection.get_shutdownr j@jjAuhNhhh]r (jW)r }r (hX get_shutdownhj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hX get_shutdownr r }r (hUhNhNhhhj ubaubjj)r }r (hUhj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]ubj`)r }r (hUhj hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhj{ hj hj{h}r (h]h]h]h]h]uhNhhh]r j)r }r (hX0Get the current shutdown mode of the Connection.hj hjw hj h}r (h]h]h]h]h]uhKhhh]r hX0Get the current shutdown mode of the Connection.r r }r (hUhNhNhhhj ubaubaubeubh)r }r (hUhjhNhjh}r (h]h]h]h]h]Uentries]r (jXEget_socket_read_timeout() (M2Crypto.SSL.Connection.Connection method)hUNtr auhNhhh]ubj')r }r (hUhjhNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hX$Connection.get_socket_read_timeout()hj hX}/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_socket_read_timeoutr hj6h}r (h]r haj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r haj?X"Connection.get_socket_read_timeoutr j@jjAuhNhhh]r (jW)r }r (hXget_socket_read_timeouthj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hXget_socket_read_timeoutr r }r (hUhNhNhhhj ubaubjj)r }r (hUhj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]ubj`)r }r (hUhj hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhj hj hj{h}r (h]h]h]h]h]uhNhhh]ubeubh)r }r (hUhjhNhjh}r (h]h]h]h]h]Uentries]r (jXFget_socket_write_timeout() (M2Crypto.SSL.Connection.Connection method)h*UNtr auhNhhh]ubj')r }r (hUhjhNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hX%Connection.get_socket_write_timeout()hj hX~/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_socket_write_timeoutr hj6h}r (h]r h*aj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r h*aj?X#Connection.get_socket_write_timeoutr j@jjAuhNhhh]r (jW)r }r (hXget_socket_write_timeouthj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hXget_socket_write_timeoutr r }r (hUhNhNhhhj ubaubjj)r }r (hUhj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]ubj`)r }r (hUhj hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhj hj hj{h}r (h]h]h]h]h]uhNhhh]ubeubh)r }r (hUhjhNhjh}r (h]h]h]h]h]Uentries]r (jX7get_state() (M2Crypto.SSL.Connection.Connection method)h[UNtr auhNhhh]ubj')r }r (hUhjhNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hXConnection.get_state()hj hXo/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_stater hj6h}r! (h]r" h[aj9j:XM2Crypto.SSL.Connectionr# r$ }r% bh]h]h]h]r& h[aj?XConnection.get_stater' j@jjAuhNhhh]r( (jW)r) }r* (hX get_statehj hj hjZh}r+ (jHjIh]h]h]h]h]uhNhhh]r, hX get_stater- r. }r/ (hUhNhNhhhj) ubaubjj)r0 }r1 (hUhj hj hjmh}r2 (jHjIh]h]h]h]h]uhNhhh]ubj`)r3 }r4 (hUhj hNhjch}r5 (Uexprjeh]h]h]h]h]uhNhhh]r6 h)r7 }r8 (hUh}r9 (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj' uhj3 h]r: jm)r; }r< (hUh}r= (h]h]r> jrah]h]h]uhj7 h]r? hX[source]r@ rA }rB (hUhj; ubahjwubahhubaubeubjx)rC }rD (hUhj hj hj{h}rE (h]h]h]h]h]uhNhhh]rF (j)rG }rH (hX(Return the SSL state of this connection.hjC hXo/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_staterI hj h}rJ (h]h]h]h]h]uhKhhh]rK hX(Return the SSL state of this connection.rL rM }rN (hUhNhNhhhjG ubaubj)rO }rP (hXDuring its use, an SSL objects passes several states. The state is internally maintained. Querying the state information is not very informative before or when a connection has been established. It however can be of significant interest during the handshake.hjC hjI hj h}rQ (h]h]h]h]h]uhKhhh]rR hXDuring its use, an SSL objects passes several states. The state is internally maintained. Querying the state information is not very informative before or when a connection has been established. It however can be of significant interest during the handshake.rS rT }rU (hUhNhNhhhjO ubaubj)rV }rW (hUhjC hNhjh}rX (h]h]h]h]h]uhNhhh]rY j")rZ }r[ (hUh}r\ (h]h]h]h]h]uhjV h]r] (j')r^ }r_ (hXReturnshjZ hj hj*h}r` (h]h]h]h]h]uhKh]ra hXReturnsrb rc }rd (hUhj^ ubaubj0)re }rf (hUh}rg (h]h]h]h]h]uhjZ h]rh j)ri }rj (hXC6 letter string indicating the current state of the SSL object ssl.h}rk (h]h]h]h]h]uhje h]rl hXC6 letter string indicating the current state of the SSL object ssl.rm rn }ro (hUhNhNhhhji ubahj ubahj<ubehj=ubaubeubeubh)rp }rq (hUhjhXv/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_verify_depthrr hjh}rs (h]h]h]h]h]Uentries]rt (jX>get_verify_depth() (M2Crypto.SSL.Connection.Connection method)hNUNtru auhNhhh]ubj')rv }rw (hUhjhjr hj*h}rx (j,j-Xpyh]h]h]h]h]j.Xmethodry j0jy uhNhhh]rz (j2)r{ }r| (hXConnection.get_verify_depth()hjv hXv/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_verify_depthr} hj6h}r~ (h]r hNaj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r hNaj?XConnection.get_verify_depthr j@jjAuhNhhh]r (jW)r }r (hXget_verify_depthhj{ hj} hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hXget_verify_depthr r }r (hUhNhNhhhj ubaubjj)r }r (hUhj{ hj} hjmh}r (jHjIh]h]h]h]h]uhNhhh]ubj`)r }r (hUhj{ hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhjv hj} hj{h}r (h]h]h]h]h]uhNhhh]r j)r }r (hX/Return the peer certificate verification depth.hj hjr hj h}r (h]h]h]h]h]uhKhhh]r hX/Return the peer certificate verification depth.r r }r (hUhNhNhhhj ubaubaubeubh)r }r (hUhjhXu/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_verify_moder hjh}r (h]h]h]h]h]Uentries]r (jX=get_verify_mode() (M2Crypto.SSL.Connection.Connection method)hwUNtr auhNhhh]ubj')r }r (hUhjhj hj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hXConnection.get_verify_mode()hj hXu/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_verify_moder hj6h}r (h]r hwaj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r hwaj?XConnection.get_verify_moder j@jjAuhNhhh]r (jW)r }r (hXget_verify_modehj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hXget_verify_moder r }r (hUhNhNhhhj ubaubjj)r }r (hUhj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]ubj`)r }r (hUhj hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhj hj hj{h}r (h]h]h]h]h]uhNhhh]r j)r }r (hX.Return the peer certificate verification mode.hj hj hj h}r (h]h]h]h]h]uhKhhh]r hX.Return the peer certificate verification mode.r r }r (hUhNhNhhhj ubaubaubeubh)r }r (hUhjhXw/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_verify_resultr hjh}r (h]h]h]h]h]Uentries]r (jX?get_verify_result() (M2Crypto.SSL.Connection.Connection method)hEUNtr auhNhhh]ubj')r }r (hUhjhj hj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hXConnection.get_verify_result()hj hXw/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_verify_resultr hj6h}r (h]r hEaj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r hEaj?XConnection.get_verify_resultr j@jjAuhNhhh]r (jW)r }r (hXget_verify_resulthj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hXget_verify_resultr r }r (hUhNhNhhhj ubaubjj)r }r (hUhj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]ubj`)r }r (hUhj hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhj hj hj{h}r (h]h]h]h]h]uhNhhh]r j)r }r (hX0Return the peer certificate verification result.hj hj hj h}r (h]h]h]h]h]uhKhhh]r hX0Return the peer certificate verification result.r r }r (hUhNhNhhhj ubaubaubeubh)r! }r" (hUhjhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_versionr# hjh}r$ (h]h]h]h]h]Uentries]r% (jX9get_version() (M2Crypto.SSL.Connection.Connection method)hUNtr& auhNhhh]ubj')r' }r( (hUhjhj# hj*h}r) (j,j-Xpyh]h]h]h]h]j.Xmethodr* j0j* uhNhhh]r+ (j2)r, }r- (hXConnection.get_version()hj' hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.get_versionr. hj6h}r/ (h]r0 haj9j:XM2Crypto.SSL.Connectionr1 r2 }r3 bh]h]h]h]r4 haj?XConnection.get_versionr5 j@jjAuhNhhh]r6 (jW)r7 }r8 (hX get_versionhj, hj. hjZh}r9 (jHjIh]h]h]h]h]uhNhhh]r: hX get_versionr; r< }r= (hUhNhNhhhj7 ubaubjj)r> }r? (hUhj, hj. hjmh}r@ (jHjIh]h]h]h]h]uhNhhh]ubj`)rA }rB (hUhj, hNhjch}rC (Uexprjeh]h]h]h]h]uhNhhh]rD h)rE }rF (hUh}rG (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj5 uhjA h]rH jm)rI }rJ (hUh}rK (h]h]rL jrah]h]h]uhjE h]rM hX[source]rN rO }rP (hUhjI ubahjwubahhubaubeubjx)rQ }rR (hUhj' hj. hj{h}rS (h]h]h]h]h]uhNhhh]rT j)rU }rV (hX8Return the TLS/SSL protocol version for this connection.hjQ hj# hj h}rW (h]h]h]h]h]uhKhhh]rX hX8Return the TLS/SSL protocol version for this connection.rY rZ }r[ (hUhNhNhhhjU ubaubaubeubh)r\ }r] (hUhjhNhjh}r^ (h]h]h]h]h]Uentries]r_ (jX9getpeername() (M2Crypto.SSL.Connection.Connection method)hqUNtr` auhNhhh]ubj')ra }rb (hUhjhNhj*h}rc (j,j-Xpyh]h]h]h]h]j.Xmethodrd j0jd uhNhhh]re (j2)rf }rg (hXConnection.getpeername()hja hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.getpeernamerh hj6h}ri (h]rj hqaj9j:XM2Crypto.SSL.Connectionrk rl }rm bh]h]h]h]rn hqaj?XConnection.getpeernamero j@jjAuhNhhh]rp (jW)rq }rr (hX getpeernamehjf hjh hjZh}rs (jHjIh]h]h]h]h]uhNhhh]rt hX getpeernameru rv }rw (hUhNhNhhhjq ubaubjj)rx }ry (hUhjf hjh hjmh}rz (jHjIh]h]h]h]h]uhNhhh]ubj`)r{ }r| (hUhjf hNhjch}r} (Uexprjeh]h]h]h]h]uhNhhh]r~ h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjo uhj{ h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhja hjh hj{h}r (h]h]h]h]h]uhNhhh]r (j)r }r (hX;Return the remote address to which the socket is connected.hj hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.getpeernamer hj h}r (h]h]h]h]h]uhKhhh]r hX;Return the remote address to which the socket is connected.r r }r (hUhNhNhhhj ubaubj)r }r (hXThis is useful to find out the port number of a remote IPv4/v6 socket, for instance. On some systems this function is not supported.hj hj hj h}r (h]h]h]h]h]uhKhhh]r hXThis is useful to find out the port number of a remote IPv4/v6 socket, for instance. On some systems this function is not supported.r r }r (hUhNhNhhhj ubaubj)r }r (hUhj hNhjh}r (h]h]h]h]h]uhNhhh]r j")r }r (hUh}r (h]h]h]h]h]uhj h]r (j')r }r (hXReturnshj hjh hj*h}r (h]h]h]h]h]uhKh]r hXReturnsr r }r (hUhj ubaubj0)r }r (hUh}r (h]h]h]h]h]uhj h]r j)r }r (hUh}r (h]h]h]h]h]uhj h]hj ubahj<ubehj=ubaubeubeubh)r }r (hUhjhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.getsocknamer hjh}r (h]h]h]h]h]Uentries]r (jX9getsockname() (M2Crypto.SSL.Connection.Connection method)h UNtr auhNhhh]ubj')r }r (hUhjhj hj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hXConnection.getsockname()hj hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.getsocknamer hj6h}r (h]r h aj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r h aj?XConnection.getsocknamer j@jjAuhNhhh]r (jW)r }r (hX getsocknamehj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hX getsocknamer r }r (hUhNhNhhhj ubaubjj)r }r (hUhj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]ubj`)r }r (hUhj hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhj hj hj{h}r (h]h]h]h]h]uhNhhh]r (j)r }r (hX Return the socket's own address.hj hj hj h}r (h]h]h]h]h]uhKhhh]r hX"Return the socket’s own address.r r }r (hUhNhNhhhj ubaubj)r }r (hXThis is useful to find out the port number of an IPv4/v6 socket, for instance. (The format of the address returned depends on the address family -- see above.)hj hj hj h}r (h]h]h]h]h]uhKhhh]r hXThis is useful to find out the port number of an IPv4/v6 socket, for instance. (The format of the address returned depends on the address family – see above.)r r }r (hUhNhNhhhj ubaubj)r }r (hX%:return:socket's address as addr typehj hj hj h}r (h]h]h]h]h]uhKhhh]r hX':return:socket’s address as addr typer r }r (hUhNhNhhhj ubaubeubeubh)r }r (hUhjhNhjh}r (h]h]h]h]h]Uentries]r (jX8getsockopt() (M2Crypto.SSL.Connection.Connection method)h#UNtr auhNhhh]ubj')r }r (hUhjhNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hX2Connection.getsockopt(level, optname, buflen=None)hj hXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.getsockoptr hj6h}r (h]r h#aj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r h#aj?XConnection.getsockoptr j@jjAuhNhhh]r (jW)r }r (hX getsockopthj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hX getsockoptr r }r (hUhNhNhhhj ubaubjj)r }r (hXlevel, optname, buflen=Nonehj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]r (jp)r }r (hXlevelh}r (jHjIh]h]h]h]h]uhj h]r hXlevelr! r" }r# (hUhj ubahjxubjp)r$ }r% (hXoptnameh}r& (jHjIh]h]h]h]h]uhj h]r' hXoptnamer( r) }r* (hUhj$ ubahjxubjp)r+ }r, (hX buflen=Noneh}r- (jHjIh]h]h]h]h]uhj h]r. hX buflen=Noner/ r0 }r1 (hUhj+ ubahjxubeubj`)r2 }r3 (hUhj hNhjch}r4 (Uexprjeh]h]h]h]h]uhNhhh]r5 h)r6 }r7 (hUh}r8 (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj2 h]r9 jm)r: }r; (hUh}r< (h]h]r= jrah]h]h]uhj6 h]r> hX[source]r? r@ }rA (hUhj: ubahjwubahhubaubeubjx)rB }rC (hUhj hj hj{h}rD (h]h]h]h]h]uhNhhh]rE (j)rF }rG (hX)Get the value of the given socket option.hjB hXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.getsockopthj h}rH (h]h]h]h]h]uhKhhh]rI hX)Get the value of the given socket option.rJ rK }rL (hUhNhNhhhjF ubaubj)rM }rN (hUhjB hNhjh}rO (h]h]h]h]h]uhNhhh]rP (j")rQ }rR (hUh}rS (h]h]h]h]h]uhjM h]rT (j')rU }rV (hX ParametershjQ hj hj*h}rW (h]h]h]h]h]uhKh]rX hX ParametersrY rZ }r[ (hUhjU ubaubj0)r\ }r] (hUh}r^ (h]h]h]h]h]uhjQ h]r_ cdocutils.nodes bullet_list r` )ra }rb (hUh}rc (h]h]h]h]h]uhj\ h]rd (cdocutils.nodes list_item re )rf }rg (hUh}rh (h]h]h]h]h]uhja h]ri j)rj }rk (hXlevel -- level at which the option resides. To manipulate options at the sockets API level, level is specified as socket.SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate protocol controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of socket.SOL_TCP; see getprotoent(3).h}rl (h]h]h]h]h]uhjf h]rm (j )rn }ro (hXlevelh}rp (h]h]jh]h]h]uhjj h]rq hXlevelrr rs }rt (hUhjn ubahjubhX – ru rv }rw (hUhjj ubhXlevel at which the option resides. To manipulate options at the sockets API level, level is specified as socket.SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate protocol controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of socket.SOL_TCP; see getprotoent(3).rx ry }rz (hUhNhNhhhjj ubehj ubahU list_itemr{ ubje )r| }r} (hUh}r~ (h]h]h]h]h]uhja h]r j)r }r (hXoptname -- The value of the given socket option is described in the Unix man page getsockopt(2)). The needed symbolic constants (SO_* etc.) are defined in the socket module.h}r (h]h]h]h]h]uhj| h]r (j )r }r (hXoptnameh}r (h]h]jh]h]h]uhj h]r hXoptnamer r }r (hUhj ubahjubhX – r r }r (hUhj ubhXThe value of the given socket option is described in the Unix man page getsockopt(2)). The needed symbolic constants (SO_* etc.) are defined in the socket module.r r }r (hUhNhNhhhj ubehj ubahj{ ubje )r }r (hUh}r (h]h]h]h]h]uhja h]r j)r }r (hXbuflen -- If it is absent, an integer option is assumed and its integer value is returned by the function. If buflen is present, it specifies the maximum length of the buffer used to receive the option in, and this buffer is returned as a bytes object.h}r (h]h]h]h]h]uhj h]r (j )r }r (hXbuflenh}r (h]h]jh]h]h]uhj h]r hXbuflenr r }r (hUhj ubahjubhX – r r }r (hUhj ubhXIf it is absent, an integer option is assumed and its integer value is returned by the function. If buflen is present, it specifies the maximum length of the buffer used to receive the option in, and this buffer is returned as a bytes object.r r }r (hUhNhNhhhj ubehj ubahj{ ubehU bullet_listr ubahj<ubehj=ubj")r }r (hUh}r (h]h]h]h]h]uhjM h]r (j')r }r (hXReturnshj hj hj*h}r (h]h]h]h]h]uhKh]r hXReturnsr r }r (hUhj ubaubj0)r }r (hUh}r (h]h]h]h]h]uhj h]r j)r }r (hXEither integer or bytes value of the option. It is up to the caller to decode the contents of the buffer (see the optional built-in module struct for a way to decode C structures encoded as byte strings).h}r (h]h]h]h]h]uhj h]r hXEither integer or bytes value of the option. It is up to the caller to decode the contents of the buffer (see the optional built-in module struct for a way to decode C structures encoded as byte strings).r r }r (hUhNhNhhhj ubahj ubahj<ubehj=ubeubeubeubh)r }r (hUhjhNhjh}r (h]h]h]h]h]Uentries]r (jX4listen() (M2Crypto.SSL.Connection.Connection method)hRUNtr auhNhhh]ubj')r }r (hUhjhNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hXConnection.listen(qlen=5)hj hXl/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.listenr hj6h}r (h]r hRaj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r hRaj?XConnection.listenr j@jjAuhNhhh]r (jW)r }r (hXlistenhj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hXlistenr r }r (hUhNhNhhhj ubaubjj)r }r (hXqlen=5hj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]r jp)r }r (hXqlen=5h}r (jHjIh]h]h]h]h]uhj h]r hXqlen=5r r }r (hUhj ubahjxubaubj`)r }r (hUhj hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhj hj hj{h}r (h]h]h]h]h]uhNhhh]ubeubh)r }r (hUhjhNhjh}r (h]h]h]h]h]Uentries]r (jX9m2_bio_free() (M2Crypto.SSL.Connection.Connection method)hUNtr auhNhhh]ubj')r }r (hUhjhNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hXConnection.m2_bio_freehj hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.m2_bio_freer hj6h}r (h]r haj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r haj?XConnection.m2_bio_freej@jjAuhNhhh]r (jW)r }r (hX m2_bio_freehj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hX m2_bio_freer r }r (hUhNhNhhhj ubaubjj)r }r (hUhj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]ubeubjx)r }r (hUhj hj hj{h}r (h]h]h]h]h]uhNhhh]ubeubh)r }r (hUhjhNhjh}r (h]h]h]h]h]Uentries]r (jX9m2_ssl_free() (M2Crypto.SSL.Connection.Connection method)h}UNtr auhNhhh]ubj')r }r (hUhjhNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r! (j2)r" }r# (hXConnection.m2_ssl_freehj hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.m2_ssl_freer$ hj6h}r% (h]r& h}aj9j:XM2Crypto.SSL.Connectionr' r( }r) bh]h]h]h]r* h}aj?XConnection.m2_ssl_freej@jjAuhNhhh]r+ (jW)r, }r- (hX m2_ssl_freehj" hj$ hjZh}r. (jHjIh]h]h]h]h]uhNhhh]r/ hX m2_ssl_freer0 r1 }r2 (hUhNhNhhhj, ubaubjj)r3 }r4 (hUhj" hj$ hjmh}r5 (jHjIh]h]h]h]h]uhNhhh]ubeubjx)r6 }r7 (hUhj hj$ hj{h}r8 (h]h]h]h]h]uhNhhh]ubeubh)r9 }r: (hUhjhNhjh}r; (h]h]h]h]h]Uentries]r< (jX6makefile() (M2Crypto.SSL.Connection.Connection method)hzUNtr= auhNhhh]ubj')r> }r? (hUhjhNhj*h}r@ (j,j-Xpyh]h]h]h]h]j.XmethodrA j0jA uhNhhh]rB (j2)rC }rD (hX*Connection.makefile(mode='rb', bufsize=-1)hj> hXn/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.makefilerE hj6h}rF (h]rG hzaj9j:XM2Crypto.SSL.ConnectionrH rI }rJ bh]h]h]h]rK hzaj?XConnection.makefilerL j@jjAuhNhhh]rM (jW)rN }rO (hXmakefilehjC hjE hjZh}rP (jHjIh]h]h]h]h]uhNhhh]rQ hXmakefilerR rS }rT (hUhNhNhhhjN ubaubjj)rU }rV (hXmode='rb', bufsize=-1hjC hjE hjmh}rW (jHjIh]h]h]h]h]uhNhhh]rX (jp)rY }rZ (hX mode='rb'h}r[ (jHjIh]h]h]h]h]uhjU h]r\ hX mode='rb'r] r^ }r_ (hUhjY ubahjxubjp)r` }ra (hX bufsize=-1h}rb (jHjIh]h]h]h]h]uhjU h]rc hX bufsize=-1rd re }rf (hUhj` ubahjxubeubj`)rg }rh (hUhjC hNhjch}ri (Uexprjeh]h]h]h]h]uhNhhh]rj h)rk }rl (hUh}rm (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjL uhjg h]rn jm)ro }rp (hUh}rq (h]h]rr jrah]h]h]uhjk h]rs hX[source]rt ru }rv (hUhjo ubahjwubahhubaubeubjx)rw }rx (hUhj> hjE hj{h}ry (h]h]h]h]h]uhNhhh]ubeubh)rz }r{ (hUhjhXm/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.pendingr| hjh}r} (h]h]h]h]h]Uentries]r~ (jX5pending() (M2Crypto.SSL.Connection.Connection method)h(UNtr auhNhhh]ubj')r }r (hUhjhj| hj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hXConnection.pending()hj hXm/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.pendingr hj6h}r (h]r h(aj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r h(aj?XConnection.pendingr j@jjAuhNhhh]r (jW)r }r (hXpendinghj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hXpendingr r }r (hUhNhNhhhj ubaubjj)r }r (hUhj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]ubj`)r }r (hUhj hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhj hj hj{h}r (h]h]h]h]h]uhNhhh]r j)r }r (hXBReturn the numbers of octets that can be read from the connection.hj hj| hj h}r (h]h]h]h]h]uhKhhh]r hXBReturn the numbers of octets that can be read from the connection.r r }r (hUhNhNhhhj ubaubaubeubh)r }r (hUhjhNhjh}r (h]h]h]h]h]Uentries]r (jX2read() (M2Crypto.SSL.Connection.Connection method)hUNtr auhNhhh]ubj')r }r (hUhjhNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hXConnection.read(size=1024)hj hXj/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.readr hj6h}r (h]r haj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r haj?XConnection.readr j@jjAuhNhhh]r (jW)r }r (hXreadhj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hXreadr r }r (hUhNhNhhhj ubaubjj)r }r (hX size=1024hj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]r jp)r }r (hX size=1024h}r (jHjIh]h]h]h]h]uhj h]r hX size=1024r r }r (hUhj ubahjxubaubj`)r }r (hUhj hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhj hj hj{h}r (h]h]h]h]h]uhNhhh]ubeubh)r }r (hUhjhNhjh}r (h]h]h]h]h]Uentries]r (jX2recv() (M2Crypto.SSL.Connection.Connection method)h!UNtr auhNhhh]ubj')r }r (hUhjhNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hXConnection.recv(size=1024)hj hXj/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.recvr hj6h}r (h]r h!aj9j:XM2Crypto.SSL.Connectionr r }rbh]h]h]h]rh!aj?XConnection.recvj@jjAuhNhhh]r(jW)r}r(hXrecvhj hj hjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXrecvrr}r (hUhNhNhhhjubaubjj)r }r (hX size=1024hj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]r jp)r}r(hX size=1024h}r(jHjIh]h]h]h]h]uhj h]rhX size=1024rr}r(hUhjubahjxubaubeubjx)r}r(hUhj hj hj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhXo/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.recv_intorhjh}r(h]h]h]h]h]Uentries]r(jX7recv_into() (M2Crypto.SSL.Connection.Connection method)hUNtrauhNhhh]ubj')r}r(hUhjhjhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr!j0j!uhNhhh]r"(j2)r#}r$(hX$Connection.recv_into(buff, nbytes=0)hjhXo/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.recv_intor%hj6h}r&(h]r'haj9j:XM2Crypto.SSL.Connectionr(r)}r*bh]h]h]h]r+haj?XConnection.recv_intor,j@jjAuhNhhh]r-(jW)r.}r/(hX recv_intohj#hj%hjZh}r0(jHjIh]h]h]h]h]uhNhhh]r1hX recv_intor2r3}r4(hUhNhNhhhj.ubaubjj)r5}r6(hXbuff, nbytes=0hj#hj%hjmh}r7(jHjIh]h]h]h]h]uhNhhh]r8(jp)r9}r:(hXbuffh}r;(jHjIh]h]h]h]h]uhj5h]r<hXbuffr=r>}r?(hUhj9ubahjxubjp)r@}rA(hXnbytes=0h}rB(jHjIh]h]h]h]h]uhj5h]rChXnbytes=0rDrE}rF(hUhj@ubahjxubeubj`)rG}rH(hUhj#hNhjch}rI(Uexprjeh]h]h]h]h]uhNhhh]rJh)rK}rL(hUh}rM(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj,uhjGh]rNjm)rO}rP(hUh}rQ(h]h]rRjrah]h]h]uhjKh]rShX[source]rTrU}rV(hUhjOubahjwubahhubaubeubjx)rW}rX(hUhjhj%hj{h}rY(h]h]h]h]h]uhNhhh]rZ(j)r[}r\(hXA version of recv() that stores its data into a buffer rather than creating a new string. Receive up to buffersize bytes from the socket. If buffersize is not specified (or 0), receive up to the size available in the given buffer.hjWhjhj h}r](h]h]h]h]h]uhKhhh]r^hXA version of recv() that stores its data into a buffer rather than creating a new string. Receive up to buffersize bytes from the socket. If buffersize is not specified (or 0), receive up to the size available in the given buffer.r_r`}ra(hUhNhNhhhj[ubaubj)rb}rc(hX|@param buffer: a buffer for the received bytes @param nbytes: maximum number of bytes to read @return: number of bytes addedhjWhjhj h}rd(h]h]h]h]h]uhKhhh]rehX|@param buffer: a buffer for the received bytes @param nbytes: maximum number of bytes to read @return: number of bytes addedrfrg}rh(hUhNhNhhhjbubaubj)ri}rj(hX-See recv() for documentation about the flags.hjWhjhj h}rk(h]h]h]h]h]uhK hhh]rlhX-See recv() for documentation about the flags.rmrn}ro(hUhNhNhhhjiubaubeubeubh)rp}rq(hUhjhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.renegotiaterrhjh}rs(h]h]h]h]h]Uentries]rt(jX9renegotiate() (M2Crypto.SSL.Connection.Connection method)h\UNtruauhNhhh]ubj')rv}rw(hUhjhjrhj*h}rx(j,j-Xpyh]h]h]h]h]j.Xmethodryj0jyuhNhhh]rz(j2)r{}r|(hXConnection.renegotiate()hjvhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.renegotiater}hj6h}r~(h]rh\aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh\aj?XConnection.renegotiaterj@jjAuhNhhh]r(jW)r}r(hX renegotiatehj{hj}hjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX renegotiaterr}r(hUhNhNhhhjubaubjj)r}r(hUhj{hj}hjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhj{hNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjvhj}hj{h}r(h]h]h]h]h]uhNhhh]rj)r}r(hX-Renegotiate this connection's SSL parameters.hjhjrhj h}r(h]h]h]h]h]uhKhhh]rhX/Renegotiate this connection’s SSL parameters.rr}r(hUhNhNhhhjubaubaubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX2send() (M2Crypto.SSL.Connection.Connection method)h&UNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.send(data)hjhXj/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.sendrhj6h}r(h]rh&aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh&aj?XConnection.sendj@jjAuhNhhh]r(jW)r}r(hXsendhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXsendrr}r(hUhNhNhhhjubaubjj)r}r(hXdatahjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXdatah}r(jHjIh]h]h]h]h]uhjh]rhXdatarr}r(hUhjubahjxubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX5sendall() (M2Crypto.SSL.Connection.Connection method)hiUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.sendall(data)hjhXm/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.sendallrhj6h}r(h]rhiaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhiaj?XConnection.sendallj@jjAuhNhhh]r(jW)r}r(hXsendallhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXsendallrr}r(hUhNhNhhhjubaubjj)r}r(hXdatahjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXdatah}r(jHjIh]h]h]h]h]uhjh]rhXdatarr}r(hUhjubahjxubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jXGserverPostConnectionCheck() (M2Crypto.SSL.Connection.Connection method)hUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX1Connection.serverPostConnectionCheck(*args, **kw)hjhX/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.serverPostConnectionCheckr hj6h}r (h]r haj9j:XM2Crypto.SSL.Connectionr r }rbh]h]h]h]rhaj?X$Connection.serverPostConnectionCheckj@jjAuhNhhh]r(jW)r}r(hXserverPostConnectionCheckhjhj hjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXserverPostConnectionCheckrr}r(hUhNhNhhhjubaubjj)r}r(hX *args, **kwhjhj hjmh}r(jHjIh]h]h]h]h]uhNhhh]r(jp)r}r(hX*argsh}r(jHjIh]h]h]h]h]uhjh]rhX*argsr r!}r"(hUhjubahjxubjp)r#}r$(hX**kwh}r%(jHjIh]h]h]h]h]uhjh]r&hX**kwr'r(}r)(hUhj#ubahjxubeubeubjx)r*}r+(hUhjhj hj{h}r,(h]h]h]h]h]uhNhhh]ubeubh)r-}r.(hUhjhXv/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_accept_stater/hjh}r0(h]h]h]h]h]Uentries]r1(jX>set_accept_state() (M2Crypto.SSL.Connection.Connection method)hWUNtr2auhNhhh]ubj')r3}r4(hUhjhj/hj*h}r5(j,j-Xpyh]h]h]h]h]j.Xmethodr6j0j6uhNhhh]r7(j2)r8}r9(hXConnection.set_accept_state()hj3hXv/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_accept_stater:hj6h}r;(h]r<hWaj9j:XM2Crypto.SSL.Connectionr=r>}r?bh]h]h]h]r@hWaj?XConnection.set_accept_staterAj@jjAuhNhhh]rB(jW)rC}rD(hXset_accept_statehj8hj:hjZh}rE(jHjIh]h]h]h]h]uhNhhh]rFhXset_accept_staterGrH}rI(hUhNhNhhhjCubaubjj)rJ}rK(hUhj8hj:hjmh}rL(jHjIh]h]h]h]h]uhNhhh]ubj`)rM}rN(hUhj8hNhjch}rO(Uexprjeh]h]h]h]h]uhNhhh]rPh)rQ}rR(hUh}rS(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjAuhjMh]rTjm)rU}rV(hUh}rW(h]h]rXjrah]h]h]uhjQh]rYhX[source]rZr[}r\(hUhjUubahjwubahhubaubeubjx)r]}r^(hUhj3hj:hj{h}r_(h]h]h]h]h]uhNhhh]r`j)ra}rb(hX+Sets Connection to work in the server mode.hj]hj/hj h}rc(h]h]h]h]h]uhKhhh]rdhX+Sets Connection to work in the server mode.rerf}rg(hUhNhNhhhjaubaubaubeubh)rh}ri(hUhjhNhjh}rj(h]h]h]h]h]Uentries]rk(jX5set_bio() (M2Crypto.SSL.Connection.Connection method)h_UNtrlauhNhhh]ubj')rm}rn(hUhjhNhj*h}ro(j,j-Xpyh]h]h]h]h]j.Xmethodrpj0jpuhNhhh]rq(j2)rr}rs(hX%Connection.set_bio(readbio, writebio)hjmhXm/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_biorthj6h}ru(h]rvh_aj9j:XM2Crypto.SSL.Connectionrwrx}rybh]h]h]h]rzh_aj?XConnection.set_bior{j@jjAuhNhhh]r|(jW)r}}r~(hXset_biohjrhjthjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXset_biorr}r(hUhNhNhhhj}ubaubjj)r}r(hXreadbio, writebiohjrhjthjmh}r(jHjIh]h]h]h]h]uhNhhh]r(jp)r}r(hXreadbioh}r(jHjIh]h]h]h]h]uhjh]rhXreadbiorr}r(hUhjubahjxubjp)r}r(hXwritebioh}r(jHjIh]h]h]h]h]uhjh]rhXwritebiorr}r(hUhjubahjxubeubj`)r}r(hUhjrhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj{uhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjmhjthj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hX"Explicitly set read and write bioshjhXm/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_biorhj h}r(h]h]h]h]h]uhKhhh]rhX"Explicitly set read and write biosrr}r(hUhNhNhhhjubaubj)r}r(hX[Connects the BIOs for the read and write operations of the TLS/SSL (encrypted) side of ssl.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhX[Connects the BIOs for the read and write operations of the TLS/SSL (encrypted) side of ssl.rr}r(hUhNhNhhhjubaubj)r}r(hXThe SSL engine inherits the behaviour of both BIO objects, respectively. If a BIO is non-blocking, the Connection will also have non-blocking behaviour.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhXThe SSL engine inherits the behaviour of both BIO objects, respectively. If a BIO is non-blocking, the Connection will also have non-blocking behaviour.rr}r(hUhNhNhhhjubaubj)r}r(hXIf there was already a BIO connected to Connection, BIO_free() will be called (for both the reading and writing side, if different).hjhjhj h}r(h]h]h]h]h]uhK hhh]rhXIf there was already a BIO connected to Connection, BIO_free() will be called (for both the reading and writing side, if different).rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhjthj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj` )r}r(hUh}r(h]h]h]h]h]uhjh]r(je )r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hXreadbio -- BIO for readingh}r(h]h]h]h]h]uhjh]r(j )r}r(hXreadbioh}r(h]h]jh]h]h]uhjh]rhXreadbiorr}r(hUhjubahjubhX – rr}r(hUhjubhXBIO for readingrr}r(hUhNhNhhhjubehj ubahj{ ubje )r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hXwritebio -- BIO for writing.h}r(h]h]h]h]h]uhjh]r(j )r}r(hXwritebioh}r(h]h]jh]h]h]uhjh]rhXwritebiorr}r(hUhjubahjubhX – rr}r(hUhjubhXBIO for writing.rr}r(hUhNhNhhhjubehj ubahj{ ubehj ubahj<ubehj=ubaubeubeubh)r}r (hUhjhXu/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_cipher_listr hjh}r (h]h]h]h]h]Uentries]r (jX=set_cipher_list() (M2Crypto.SSL.Connection.Connection method)h$UNtr auhNhhh]ubj')r}r(hUhjhj hj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX'Connection.set_cipher_list(cipher_list)hjhXu/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_cipher_listrhj6h}r(h]rh$aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh$aj?XConnection.set_cipher_listrj@jjAuhNhhh]r(jW)r}r(hXset_cipher_listhjhjhjZh}r (jHjIh]h]h]h]h]uhNhhh]r!hXset_cipher_listr"r#}r$(hUhNhNhhhjubaubjj)r%}r&(hX cipher_listhjhjhjmh}r'(jHjIh]h]h]h]h]uhNhhh]r(jp)r)}r*(hX cipher_listh}r+(jHjIh]h]h]h]h]uhj%h]r,hX cipher_listr-r.}r/(hUhj)ubahjxubaubj`)r0}r1(hUhjhNhjch}r2(Uexprjeh]h]h]h]h]uhNhhh]r3h)r4}r5(hUh}r6(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhj0h]r7jm)r8}r9(hUh}r:(h]h]r;jrah]h]h]uhj4h]r<hX[source]r=r>}r?(hUhj8ubahjwubahhubaubeubjx)r@}rA(hUhjhjhj{h}rB(h]h]h]h]h]uhNhhh]rCj)rD}rE(hX*Set the cipher suites for this connection.hj@hj hj h}rF(h]h]h]h]h]uhKhhh]rGhX*Set the cipher suites for this connection.rHrI}rJ(hUhNhNhhhjDubaubaubeubh)rK}rL(hUhjhX/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_client_CA_list_from_contextrMhjh}rN(h]h]h]h]h]Uentries]rO(jXMset_client_CA_list_from_context() (M2Crypto.SSL.Connection.Connection method)hUNtrPauhNhhh]ubj')rQ}rR(hUhjhjMhj*h}rS(j,j-Xpyh]h]h]h]h]j.XmethodrTj0jTuhNhhh]rU(j2)rV}rW(hX,Connection.set_client_CA_list_from_context()hjQhX/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_client_CA_list_from_contextrXhj6h}rY(h]rZhaj9j:XM2Crypto.SSL.Connectionr[r\}r]bh]h]h]h]r^haj?X*Connection.set_client_CA_list_from_contextr_j@jjAuhNhhh]r`(jW)ra}rb(hXset_client_CA_list_from_contexthjVhjXhjZh}rc(jHjIh]h]h]h]h]uhNhhh]rdhXset_client_CA_list_from_contextrerf}rg(hUhNhNhhhjaubaubjj)rh}ri(hUhjVhjXhjmh}rj(jHjIh]h]h]h]h]uhNhhh]ubj`)rk}rl(hUhjVhNhjch}rm(Uexprjeh]h]h]h]h]uhNhhh]rnh)ro}rp(hUh}rq(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj_uhjkh]rrjm)rs}rt(hUh}ru(h]h]rvjrah]h]h]uhjoh]rwhX[source]rxry}rz(hUhjsubahjwubahhubaubeubjx)r{}r|(hUhjQhjXhj{h}r}(h]h]h]h]h]uhNhhh]r~(j)r}r(hXSet the acceptable client CA list. If the client returns a certificate, it must have been issued by one of the CAs listed in context.hj{hjMhj h}r(h]h]h]h]h]uhKhhh]rhXSet the acceptable client CA list. If the client returns a certificate, it must have been issued by one of the CAs listed in context.rr}r(hUhNhNhhhjubaubj)r}r(hXMakes sense only for servers.hj{hjMhj h}r(h]h]h]h]h]uhKhhh]rhXMakes sense only for servers.rr}r(hUhNhNhhhjubaubeubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jXJset_client_CA_list_from_file() (M2Crypto.SSL.Connection.Connection method)hUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX/Connection.set_client_CA_list_from_file(cafile)hjhX/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_client_CA_list_from_filerhj6h}r(h]rhaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhaj?X'Connection.set_client_CA_list_from_filerj@jjAuhNhhh]r(jW)r}r(hXset_client_CA_list_from_filehjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXset_client_CA_list_from_filerr}r(hUhNhNhhhjubaubjj)r}r(hXcafilehjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXcafileh}r(jHjIh]h]h]h]h]uhjh]rhXcafilerr}r(hUhjubahjxubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hX"Set the acceptable client CA list.hjhX/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_client_CA_list_from_filerhj h}r(h]h]h]h]h]uhKhhh]rhX"Set the acceptable client CA list.rr}r(hUhNhNhhhjubaubj)r}r(hXaIf the client returns a certificate, it must have been issued by one of the CAs listed in cafile.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhXaIf the client returns a certificate, it must have been issued by one of the CAs listed in cafile.rr}r(hUhNhNhhhjubaubj)r}r(hXMakes sense only for servers.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhXMakes sense only for servers.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]r(j")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhjhj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX2cafile -- Filename from which to load the CA list.h}r(h]h]h]h]h]uhjh]r(j )r}r(hXcafileh}r(h]h]jh]h]h]uhjh]rhXcafilerr}r(hUhjubahjubhX – rr}r(hUhjubhX(Filename from which to load the CA list.rr}r(hUhNhNhhhjubehj ubahj<ubehj=ubj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hXReturnshjhjhj*h}r(h]h]h]h]h]uhKh]r hXReturnsr r }r (hUhjubaubj0)r }r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX0 A failure while manipulating the STACK_OF(X509_NAME) object occurred or the X509_NAME could not be extracted from cacert. Check the error stack to find out the reason.1 The operation succeeded.h}r(h]h]h]h]h]uhj h]r(j)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]rj)r}r(hX0 A failure while manipulating the STACK_OF(X509_NAME) object occurred or the X509_NAME could not be extracted from cacert. Check the error stack to find out the reason. hjhjhjh}r(h]h]h]h]h]uhK h]r(j)r}r(hX60 A failure while manipulating the STACK_OF(X509_NAME)hjhjhjh}r(h]h]h]h]h]uhK h]r hX60 A failure while manipulating the STACK_OF(X509_NAME)r!r"}r#(hUhjubaubj)r$}r%(hUh}r&(h]h]h]h]h]uhjh]r'j)r(}r)(hXrobject occurred or the X509_NAME could not be extracted from cacert. Check the error stack to find out the reason.hj$hjhj h}r*(h]h]h]h]h]uhK h]r+hXrobject occurred or the X509_NAME could not be extracted from cacert. Check the error stack to find out the reason.r,r-}r.(hUhj(ubaubahjubeubaubj)r/}r0(hX1 The operation succeeded.hjhjhj h}r1(h]h]h]h]h]uhKhhh]r2hX1 The operation succeeded.r3r4}r5(hUhNhNhhhj/ubaubehj ubahj<ubehj=ubeubeubeubh)r6}r7(hUhjhXw/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_connect_stater8hjh}r9(h]h]h]h]h]Uentries]r:(jX?set_connect_state() (M2Crypto.SSL.Connection.Connection method)hUNtr;auhNhhh]ubj')r<}r=(hUhjhj8hj*h}r>(j,j-Xpyh]h]h]h]h]j.Xmethodr?j0j?uhNhhh]r@(j2)rA}rB(hXConnection.set_connect_state()hj<hXw/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_connect_staterChj6h}rD(h]rEhaj9j:XM2Crypto.SSL.ConnectionrFrG}rHbh]h]h]h]rIhaj?XConnection.set_connect_staterJj@jjAuhNhhh]rK(jW)rL}rM(hXset_connect_statehjAhjChjZh}rN(jHjIh]h]h]h]h]uhNhhh]rOhXset_connect_staterPrQ}rR(hUhNhNhhhjLubaubjj)rS}rT(hUhjAhjChjmh}rU(jHjIh]h]h]h]h]uhNhhh]ubj`)rV}rW(hUhjAhNhjch}rX(Uexprjeh]h]h]h]h]uhNhhh]rYh)rZ}r[(hUh}r\(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjJuhjVh]r]jm)r^}r_(hUh}r`(h]h]rajrah]h]h]uhjZh]rbhX[source]rcrd}re(hUhj^ubahjwubahhubaubeubjx)rf}rg(hUhj<hjChj{h}rh(h]h]h]h]h]uhNhhh]rij)rj}rk(hX+Sets Connection to work in the client mode.hjfhj8hj h}rl(h]h]h]h]h]uhKhhh]rmhX+Sets Connection to work in the client mode.rnro}rp(hUhNhNhhhjjubaubaubeubh)rq}rr(hUhjhNhjh}rs(h]h]h]h]h]Uentries]rt(jXPset_post_connection_check_callback() (M2Crypto.SSL.Connection.Connection method)hFUNtruauhNhhh]ubj')rv}rw(hUhjhNhj*h}rx(j,j-Xpyh]h]h]h]h]j.Xmethodryj0jyuhNhhh]rz(j2)r{}r|(hXBConnection.set_post_connection_check_callback(postConnectionCheck)hjvhX/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_post_connection_check_callbackr}hj6h}r~(h]rhFaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhFaj?X-Connection.set_post_connection_check_callbackrj@jjAuhNhhh]r(jW)r}r(hX"set_post_connection_check_callbackhj{hj}hjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX"set_post_connection_check_callbackrr}r(hUhNhNhhhjubaubjj)r}r(hXpostConnectionCheckhj{hj}hjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXpostConnectionCheckh}r(jHjIh]h]h]h]h]uhjh]rhXpostConnectionCheckrr}r(hUhjubahjxubaubj`)r}r(hUhj{hNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjvhj}hj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX9set_session() (M2Crypto.SSL.Connection.Connection method)hXUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.set_session(session)hjhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_sessionrhj6h}r(h]rhXaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhXaj?XConnection.set_sessionrj@jjAuhNhhh]r(jW)r}r(hX set_sessionhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX set_sessionrr}r(hUhNhNhhhjubaubjj)r}r(hXsessionhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXsessionh}r(jHjIh]h]h]h]h]uhjh]rhXsessionrr}r(hUhjubahjxubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX@set_session_id_ctx() (M2Crypto.SSL.Connection.Connection method)hmUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX!Connection.set_session_id_ctx(id)hjhXx/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_session_id_ctxrhj6h}r(h]rhmaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhmaj?XConnection.set_session_id_ctxrj@jjAuhNhhh]r(jW)r}r(hXset_session_id_ctxhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXset_session_id_ctxrr}r(hUhNhNhhhjubaubjj)r}r(hXidhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXidh}r(jHjIh]h]h]h]h]uhjh]rhXidr r }r (hUhjubahjxubaubj`)r }r (hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhj h]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r (hUhjhNhjh}r!(h]h]h]h]h]Uentries]r"(jX:set_shutdown() (M2Crypto.SSL.Connection.Connection method)hUNtr#auhNhhh]ubj')r$}r%(hUhjhNhj*h}r&(j,j-Xpyh]h]h]h]h]j.Xmethodr'j0j'uhNhhh]r((j2)r)}r*(hXConnection.set_shutdown(mode)hj$hXr/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_shutdownr+hj6h}r,(h]r-haj9j:XM2Crypto.SSL.Connectionr.r/}r0bh]h]h]h]r1haj?XConnection.set_shutdownr2j@jjAuhNhhh]r3(jW)r4}r5(hX set_shutdownhj)hj+hjZh}r6(jHjIh]h]h]h]h]uhNhhh]r7hX set_shutdownr8r9}r:(hUhNhNhhhj4ubaubjj)r;}r<(hXmodehj)hj+hjmh}r=(jHjIh]h]h]h]h]uhNhhh]r>jp)r?}r@(hXmodeh}rA(jHjIh]h]h]h]h]uhj;h]rBhXmoderCrD}rE(hUhj?ubahjxubaubj`)rF}rG(hUhj)hNhjch}rH(Uexprjeh]h]h]h]h]uhNhhh]rIh)rJ}rK(hUh}rL(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj2uhjFh]rMjm)rN}rO(hUh}rP(h]h]rQjrah]h]h]uhjJh]rRhX[source]rSrT}rU(hUhjNubahjwubahhubaubeubjx)rV}rW(hUhj$hj+hj{h}rX(h]h]h]h]h]uhNhhh]rY(j)rZ}r[(hX2Sets the shutdown state of the Connection to mode.hjVhXr/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_shutdownr\hj h}r](h]h]h]h]h]uhKhhh]r^hX2Sets the shutdown state of the Connection to mode.r_r`}ra(hUhNhNhhhjZubaubj)rb}rc(hXQThe shutdown state of an ssl connection is a bitmask of (use m2.SSL_* constants):hjVhj\hj h}rd(h]h]h]h]h]uhKhhh]rehXQThe shutdown state of an ssl connection is a bitmask of (use m2.SSL_* constants):rfrg}rh(hUhNhNhhhjbubaubj)ri}rj(hX0 No shutdown setting, yet.hjVhj\hj h}rk(h]h]h]h]h]uhKhhh]rlhX0 No shutdown setting, yet.rmrn}ro(hUhNhNhhhjiubaubj)rp}rq(hUhjVhj\hjh}rr(h]h]h]h]h]uhNhhh]rs(j)rt}ru(hXSSL_SENT_SHUTDOWN A "close notify" shutdown alert was sent to the peer, the connection is being considered closed and the session is closed and correct. hjphj\hjh}rv(h]h]h]h]h]uhK h]rw(j)rx}ry(hXSSL_SENT_SHUTDOWNhjthj\hjh}rz(h]h]h]h]h]uhK h]r{hXSSL_SENT_SHUTDOWNr|r}}r~(hUhjxubaubj)r}r(hUh}r(h]h]h]h]h]uhjth]rj)r}r(hXA "close notify" shutdown alert was sent to the peer, the connection is being considered closed and the session is closed and correct.hjhj\hj h}r(h]h]h]h]h]uhK h]rhXA “close notify” shutdown alert was sent to the peer, the connection is being considered closed and the session is closed and correct.rr}r(hUhjubaubahjubeubj)r}r(hXtSSL_RECEIVED_SHUTDOWN A shutdown alert was received form the peer, either a normal "close notify" or a fatal error. hjphj\hjh}r(h]h]h]h]h]uhKhhh]r(j)r}r(hXSSL_RECEIVED_SHUTDOWNhjhj\hjh}r(h]h]h]h]h]uhKh]rhXSSL_RECEIVED_SHUTDOWNrr}r(hUhjubaubj)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX]A shutdown alert was received form the peer, either a normal "close notify" or a fatal error.hjhj\hj h}r(h]h]h]h]h]uhKh]rhXaA shutdown alert was received form the peer, either a normal “close notify” or a fatal error.rr}r(hUhjubaubahjubeubeubj)r}r(hXHSSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same time.hjVhj\hj h}r(h]h]h]h]h]uhKhhh]rhXHSSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same time.rr}r(hUhNhNhhhjubaubj)r}r(hUhjVhNhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhj+hj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hXmode -- set the mode bitmask.h}r(h]h]h]h]h]uhjh]r(j )r}r(hXmodeh}r(h]h]jh]h]h]uhjh]rhXmoderr}r(hUhjubahjubhX – rr}r(hUhjubhXset the mode bitmask.rr}r(hUhNhNhhhjubehj ubahj<ubehj=ubaubeubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jXEset_socket_read_timeout() (M2Crypto.SSL.Connection.Connection method)h)UNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX)Connection.set_socket_read_timeout(timeo)hjhX}/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_socket_read_timeoutrhj6h}r(h]rh)aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh)aj?X"Connection.set_socket_read_timeoutrj@jjAuhNhhh]r(jW)r}r(hXset_socket_read_timeouthjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXset_socket_read_timeoutrr}r(hUhNhNhhhjubaubjj)r}r(hXtimeohjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXtimeoh}r(jHjIh]h]h]h]h]uhjh]rhXtimeorr}r(hUhjubahjxubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jXFset_socket_write_timeout() (M2Crypto.SSL.Connection.Connection method)hUNtr auhNhhh]ubj')r }r (hUhjhNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r(j2)r}r(hX*Connection.set_socket_write_timeout(timeo)hj hX~/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_socket_write_timeoutrhj6h}r(h]rhaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhaj?X#Connection.set_socket_write_timeoutrj@jjAuhNhhh]r(jW)r}r(hXset_socket_write_timeouthjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXset_socket_write_timeoutrr}r (hUhNhNhhhjubaubjj)r!}r"(hXtimeohjhjhjmh}r#(jHjIh]h]h]h]h]uhNhhh]r$jp)r%}r&(hXtimeoh}r'(jHjIh]h]h]h]h]uhj!h]r(hXtimeor)r*}r+(hUhj%ubahjxubaubj`)r,}r-(hUhjhNhjch}r.(Uexprjeh]h]h]h]h]uhNhhh]r/h)r0}r1(hUh}r2(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhj,h]r3jm)r4}r5(hUh}r6(h]h]r7jrah]h]h]uhj0h]r8hX[source]r9r:}r;(hUhj4ubahjwubahhubaubeubjx)r<}r=(hUhj hjhj{h}r>(h]h]h]h]h]uhNhhh]ubeubh)r?}r@(hUhjhNhjh}rA(h]h]h]h]h]Uentries]rB(jX@set_ssl_close_flag() (M2Crypto.SSL.Connection.Connection method)hUNtrCauhNhhh]ubj')rD}rE(hUhjhNhj*h}rF(j,j-Xpyh]h]h]h]h]j.XmethodrGj0jGuhNhhh]rH(j2)rI}rJ(hX#Connection.set_ssl_close_flag(flag)hjDhXx/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_ssl_close_flagrKhj6h}rL(h]rMhaj9j:XM2Crypto.SSL.ConnectionrNrO}rPbh]h]h]h]rQhaj?XConnection.set_ssl_close_flagrRj@jjAuhNhhh]rS(jW)rT}rU(hXset_ssl_close_flaghjIhjKhjZh}rV(jHjIh]h]h]h]h]uhNhhh]rWhXset_ssl_close_flagrXrY}rZ(hUhNhNhhhjTubaubjj)r[}r\(hXflaghjIhjKhjmh}r](jHjIh]h]h]h]h]uhNhhh]r^jp)r_}r`(hXflagh}ra(jHjIh]h]h]h]h]uhj[h]rbhXflagrcrd}re(hUhj_ubahjxubaubj`)rf}rg(hUhjIhNhjch}rh(Uexprjeh]h]h]h]h]uhNhhh]rih)rj}rk(hUh}rl(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjRuhjfh]rmjm)rn}ro(hUh}rp(h]h]rqjrah]h]h]uhjjh]rrhX[source]rsrt}ru(hUhjnubahjwubahhubaubeubjx)rv}rw(hUhjDhjKhj{h}rx(h]h]h]h]h]uhNhhh]ry(j)rz}r{(hXaBy default, SSL struct will be freed in __del__. Call with m2.bio_close to override this default.hjvhXx/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_ssl_close_flaghj h}r|(h]h]h]h]h]uhKhhh]r}hXaBy default, SSL struct will be freed in __del__. Call with m2.bio_close to override this default.r~r}r(hUhNhNhhhjzubaubj)r}r(hUhjvhNhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX ParametershjhjKhj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX-flag -- either m2.bio_close or m2.bio_nocloseh}r(h]h]h]h]h]uhjh]r(j )r}r(hXflagh}r(h]h]jh]h]h]uhjh]rhXflagrr}r(hUhjubahjubhX – rr}r(hUhjubhX%either m2.bio_close or m2.bio_nocloserr}r(hUhNhNhhhjubehj ubahj<ubehj=ubaubeubeubh)r}r(hUhjhXz/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_tlsext_host_namerhjh}r(h]h]h]h]h]Uentries]r(jXBset_tlsext_host_name() (M2Crypto.SSL.Connection.Connection method)hnUNtrauhNhhh]ubj')r}r(hUhjhjhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX%Connection.set_tlsext_host_name(name)hjhXz/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.set_tlsext_host_namerhj6h}r(h]rhnaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhnaj?XConnection.set_tlsext_host_namerj@jjAuhNhhh]r(jW)r}r(hXset_tlsext_host_namehjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXset_tlsext_host_namerr}r(hUhNhNhhhjubaubjj)r}r(hXnamehjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXnameh}r(jHjIh]h]h]h]h]uhjh]rhXnamerr}r(hUhjubahjxubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]rj)r}r(hXJSet the requested hostname for the SNI (Server Name Indication) extension.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhXJSet the requested hostname for the SNI (Server Name Indication) extension.rr}r(hUhNhNhhhjubaubaubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX9setblocking() (M2Crypto.SSL.Connection.Connection method)hUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.setblocking(mode)hjhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.setblockingrhj6h}r(h]rhaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhaj?XConnection.setblockingrj@jjAuhNhhh]r(jW)r}r(hX setblockinghjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX setblockingrr}r(hUhNhNhhhjubaubjj)r}r(hXmodehjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r (hXmodeh}r (jHjIh]h]h]h]h]uhjh]r hXmoder r }r(hUhjubahjxubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r (hUhjhjhj{h}r!(h]h]h]h]h]uhNhhh]r"(j)r#}r$(hX2Set this connection's underlying socket to _mode_.hjhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.setblockingr%hj h}r&(h]h]h]h]h]uhKhhh]r'hX4Set this connection’s underlying socket to _mode_.r(r)}r*(hUhNhNhhhj#ubaubj)r+}r,(hXSet blocking or non-blocking mode of the socket: if flag is 0, the socket is set to non-blocking, else to blocking mode. Initially all sockets are in blocking mode. In non-blocking mode, if a recv() call doesn't find any data, or if a send() call can't immediately dispose of the data, a error exception is raised; in blocking mode, the calls block until they can proceed. s.setblocking(0) is equivalent to s.settimeout(0.0); s.setblocking(1) is equivalent to s.settimeout(None).hjhj%hj h}r-(h]h]h]h]h]uhKhhh]r.hXSet blocking or non-blocking mode of the socket: if flag is 0, the socket is set to non-blocking, else to blocking mode. Initially all sockets are in blocking mode. In non-blocking mode, if a recv() call doesn’t find any data, or if a send() call can’t immediately dispose of the data, a error exception is raised; in blocking mode, the calls block until they can proceed. s.setblocking(0) is equivalent to s.settimeout(0.0); s.setblocking(1) is equivalent to s.settimeout(None).r/r0}r1(hUhNhNhhhj+ubaubj)r2}r3(hUhjhNhjh}r4(h]h]h]h]h]uhNhhh]r5j")r6}r7(hUh}r8(h]h]h]h]h]uhj2h]r9(j')r:}r;(hX Parametershj6hjhj*h}r<(h]h]h]h]h]uhKh]r=hX Parametersr>r?}r@(hUhj:ubaubj0)rA}rB(hUh}rC(h]h]h]h]h]uhj6h]rDj)rE}rF(hXmode -- new mode to be seth}rG(h]h]h]h]h]uhjAh]rH(j )rI}rJ(hXmodeh}rK(h]h]jh]h]h]uhjEh]rLhXmoderMrN}rO(hUhjIubahjubhX – rPrQ}rR(hUhjEubhXnew mode to be setrSrT}rU(hUhNhNhhhjEubehj ubahj<ubehj=ubaubeubeubh)rV}rW(hUhjhNhjh}rX(h]h]h]h]h]Uentries]rY(jX8setsockopt() (M2Crypto.SSL.Connection.Connection method)hcUNtrZauhNhhh]ubj')r[}r\(hUhjhNhj*h}r](j,j-Xpyh]h]h]h]h]j.Xmethodr^j0j^uhNhhh]r_(j2)r`}ra(hX1Connection.setsockopt(level, optname, value=None)hj[hXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.setsockoptrbhj6h}rc(h]rdhcaj9j:XM2Crypto.SSL.Connectionrerf}rgbh]h]h]h]rhhcaj?XConnection.setsockoptrij@jjAuhNhhh]rj(jW)rk}rl(hX setsockopthj`hjbhjZh}rm(jHjIh]h]h]h]h]uhNhhh]rnhX setsockoptrorp}rq(hUhNhNhhhjkubaubjj)rr}rs(hXlevel, optname, value=Nonehj`hjbhjmh}rt(jHjIh]h]h]h]h]uhNhhh]ru(jp)rv}rw(hXlevelh}rx(jHjIh]h]h]h]h]uhjrh]ryhXlevelrzr{}r|(hUhjvubahjxubjp)r}}r~(hXoptnameh}r(jHjIh]h]h]h]h]uhjrh]rhXoptnamerr}r(hUhj}ubahjxubjp)r}r(hX value=Noneh}r(jHjIh]h]h]h]h]uhjrh]rhX value=Nonerr}r(hUhjubahjxubeubj`)r}r(hUhj`hNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjiuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhj[hjbhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hX)Set the value of the given socket option.hjhXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.setsockopthj h}r(h]h]h]h]h]uhKhhh]rhX)Set the value of the given socket option.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]r(j")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhjbhj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj` )r}r(hUh}r(h]h]h]h]h]uhjh]r(je )r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX(level -- same as with getsockopt() aboveh}r(h]h]h]h]h]uhjh]r(j )r}r(hXlevelh}r(h]h]jh]h]h]uhjh]rhXlevelrr}r(hUhjubahjubhX – rr}r(hUhjubhXsame as with getsockopt() aboverr}r(hUhNhNhhhjubehj ubahj{ ubje )r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX*optname -- same as with getsockopt() aboveh}r(h]h]h]h]h]uhjh]r(j )r}r(hXoptnameh}r(h]h]jh]h]h]uhjh]rhXoptnamerr}r(hUhjubahjubhX – rr}r(hUhjubhXsame as with getsockopt() aboverr}r(hUhNhNhhhjubehj ubahj{ ubje )r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hXvalue -- an integer or a string representing a buffer. In the latter case it is up to the caller to ensure that the string contains the proper bits (see the optional built-in module struct for a way to encode C structures as strings).h}r(h]h]h]h]h]uhjh]r(j )r}r(hXvalueh}r(h]h]jh]h]h]uhjh]rhXvaluerr}r(hUhjubahjubhX – rr}r(hUhjubhXan integer or a string representing a buffer. In the latter case it is up to the caller to ensure that the string contains the proper bits (see the optional built-in module struct for a way to encode C structures as strings).rr}r(hUhNhNhhhjubehj ubahj{ ubehj ubahj<ubehj=ubj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hXReturnshjhjbhj*h}r(h]h]h]h]h]uhKh]rhXReturnsrr}r(hUhjubaubj0)r}r(hUh}r (h]h]h]h]h]uhjh]r j)r }r (hX2None for success or the error handler for failure.h}r (h]h]h]h]h]uhjh]rhX2None for success or the error handler for failure.rr}r(hUhNhNhhhj ubahj ubahj<ubehj=ubeubeubeubh)r}r(hUhjhXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.settimeoutrhjh}r(h]h]h]h]h]Uentries]r(jX8settimeout() (M2Crypto.SSL.Connection.Connection method)hUNtrauhNhhh]ubj')r}r(hUhjhjhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.settimeout(timeout)hjhXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.settimeoutrhj6h}r (h]r!haj9j:XM2Crypto.SSL.Connectionr"r#}r$bh]h]h]h]r%haj?XConnection.settimeoutr&j@jjAuhNhhh]r'(jW)r(}r)(hX settimeouthjhjhjZh}r*(jHjIh]h]h]h]h]uhNhhh]r+hX settimeoutr,r-}r.(hUhNhNhhhj(ubaubjj)r/}r0(hXtimeouthjhjhjmh}r1(jHjIh]h]h]h]h]uhNhhh]r2jp)r3}r4(hXtimeouth}r5(jHjIh]h]h]h]h]uhj/h]r6hXtimeoutr7r8}r9(hUhj3ubahjxubaubj`)r:}r;(hUhjhNhjch}r<(Uexprjeh]h]h]h]h]uhNhhh]r=h)r>}r?(hUh}r@(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidj&uhj:h]rAjm)rB}rC(hUh}rD(h]h]rEjrah]h]h]uhj>h]rFhX[source]rGrH}rI(hUhjBubahjwubahhubaubeubjx)rJ}rK(hUhjhjhj{h}rL(h]h]h]h]h]uhNhhh]rMj)rN}rO(hX?Set this connection's underlying socket's timeout to _timeout_.hjJhjhj h}rP(h]h]h]h]h]uhKhhh]rQhXCSet this connection’s underlying socket’s timeout to _timeout_.rRrS}rT(hUhNhNhhhjNubaubaubeubh)rU}rV(hUhjhNhjh}rW(h]h]h]h]h]Uentries]rX(jX8setup_addr() (M2Crypto.SSL.Connection.Connection method)hUUNtrYauhNhhh]ubj')rZ}r[(hUhjhNhj*h}r\(j,j-Xpyh]h]h]h]h]j.Xmethodr]j0j]uhNhhh]r^(j2)r_}r`(hXConnection.setup_addr(addr)hjZhXp/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.setup_addrrahj6h}rb(h]rchUaj9j:XM2Crypto.SSL.Connectionrdre}rfbh]h]h]h]rghUaj?XConnection.setup_addrrhj@jjAuhNhhh]ri(jW)rj}rk(hX setup_addrhj_hjahjZh}rl(jHjIh]h]h]h]h]uhNhhh]rmhX setup_addrrnro}rp(hUhNhNhhhjjubaubjj)rq}rr(hXaddrhj_hjahjmh}rs(jHjIh]h]h]h]h]uhNhhh]rtjp)ru}rv(hXaddrh}rw(jHjIh]h]h]h]h]uhjqh]rxhXaddrryrz}r{(hUhjuubahjxubaubj`)r|}r}(hUhj_hNhjch}r~(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjhuhj|h]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjZhjahj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX7setup_ssl() (M2Crypto.SSL.Connection.Connection method)h8UNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.setup_ssl()hjhXo/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.setup_sslrhj6h}r(h]rh8aj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rh8aj?XConnection.setup_sslrj@jjAuhNhhh]r(jW)r}r(hX setup_sslhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX setup_sslrr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX6shutdown() (M2Crypto.SSL.Connection.Connection method)hUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.shutdown(how)hjhXn/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.shutdownrhj6h}r(h]rhaj9j:XM2Crypto.SSL.Connectionrr}rbh]h]h]h]rhaj?XConnection.shutdownrj@jjAuhNhhh]r(jW)r}r(hXshutdownhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXshutdownrr}r(hUhNhNhhhjubaubjj)r}r(hXhowhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXhowh}r(jHjIh]h]h]h]h]uhjh]rhXhowrr}r(hUhjubahjxubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX;ssl_get_error() (M2Crypto.SSL.Connection.Connection method)h^UNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXConnection.ssl_get_error(ret)hjhXs/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.ssl_get_errorrhj6h}r(h]r h^aj9j:XM2Crypto.SSL.Connectionr r }r bh]h]h]h]r h^aj?XConnection.ssl_get_errorrj@jjAuhNhhh]r(jW)r}r(hX ssl_get_errorhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX ssl_get_errorrr}r(hUhNhNhhhjubaubjj)r}r(hXrethjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXreth}r(jHjIh]h]h]h]h]uhjh]rhXretrr }r!(hUhjubahjxubaubj`)r"}r#(hUhjhNhjch}r$(Uexprjeh]h]h]h]h]uhNhhh]r%h)r&}r'(hUh}r((UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjuhj"h]r)jm)r*}r+(hUh}r,(h]h]r-jrah]h]h]uhj&h]r.hX[source]r/r0}r1(hUhj*ubahjwubahhubaubeubjx)r2}r3(hUhjhjhj{h}r4(h]h]h]h]h]uhNhhh]ubeubh)r5}r6(hUhjhNhjh}r7(h]h]h]h]h]Uentries]r8(jX7verify_ok() (M2Crypto.SSL.Connection.Connection method)hUNtr9auhNhhh]ubj')r:}r;(hUhjhNhj*h}r<(j,j-Xpyh]h]h]h]h]j.Xmethodr=j0j=uhNhhh]r>(j2)r?}r@(hXConnection.verify_ok()hj:hXo/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.verify_okrAhj6h}rB(h]rChaj9j:XM2Crypto.SSL.ConnectionrDrE}rFbh]h]h]h]rGhaj?XConnection.verify_okrHj@jjAuhNhhh]rI(jW)rJ}rK(hX verify_okhj?hjAhjZh}rL(jHjIh]h]h]h]h]uhNhhh]rMhX verify_okrNrO}rP(hUhNhNhhhjJubaubjj)rQ}rR(hUhj?hjAhjmh}rS(jHjIh]h]h]h]h]uhNhhh]ubj`)rT}rU(hUhj?hNhjch}rV(Uexprjeh]h]h]h]h]uhNhhh]rWh)rX}rY(hUh}rZ(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjHuhjTh]r[jm)r\}r](hUh}r^(h]h]r_jrah]h]h]uhjXh]r`hX[source]rarb}rc(hUhj\ubahjwubahhubaubeubjx)rd}re(hUhj:hjAhj{h}rf(h]h]h]h]h]uhNhhh]ubeubh)rg}rh(hUhjhNhjh}ri(h]h]h]h]h]Uentries]rj(jX3write() (M2Crypto.SSL.Connection.Connection method)h-UNtrkauhNhhh]ubj')rl}rm(hUhjhNhj*h}rn(j,j-Xpyh]h]h]h]h]j.Xmethodroj0jouhNhhh]rp(j2)rq}rr(hXConnection.write(data)hjlhXk/home/matej/Build/m2crypto/M2Crypto/SSL/Connection.py:docstring of M2Crypto.SSL.Connection.Connection.writershj6h}rt(h]ruh-aj9j:XM2Crypto.SSL.Connectionrvrw}rxbh]h]h]h]ryh-aj?XConnection.writerzj@jjAuhNhhh]r{(jW)r|}r}(hXwritehjqhjshjZh}r~(jHjIh]h]h]h]h]uhNhhh]rhXwriterr}r(hUhNhNhhhj|ubaubjj)r}r(hXdatahjqhjshjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXdatah}r(jHjIh]h]h]h]h]uhjh]rhXdatarr}r(hUhjubahjxubaubj`)r}r(hUhjqhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU _modules/M2Crypto/SSL/ConnectionUrefidjzuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjlhjshj{h}r(h]h]h]h]h]uhNhhh]ubeubeubeubeubh)r}r(hUhhhhhhh}r(h]h]h]h]r(Xmodule-M2Crypto.SSL.ContextrUcontext-modulereh]rhauhK%hhh]r(h)r}r(hX:mod:`Context` Modulerhjhhhhh}r(h]h]h]h]h]uhK%hhh]r(h)r}r(hX:mod:`Context`rhjhhhhh}r(UreftypeXmodhhXContextU refdomainXpyrh]h]U refexplicith]h]h]hhhNhXM2Crypto.SSL.ConnectionruhK$h]rh)r}r(hjh}r(h]h]r(hjXpy-modreh]h]h]uhjh]rhXContextrr}r(hUhjubahhubaubhX Modulerr}r(hUhNhNhhhjubeubh)r}r(hUhjhX[/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.ctxmaprhjh}r(h]h]h]h]h]Uentries]r(jXM2Crypto.SSL.Context (module)Xmodule-M2Crypto.SSL.ContextUNtrauhKhhh]ubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX)ctxmap() (in module M2Crypto.SSL.Context)hUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xfunctionrj0juhNhhh]r(j2)r}r(hXctxmap()hjhX[/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.ctxmaprhj6h}r(h]rhaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhaj?Xctxmaprj@UjAuhNhhh]r(jN)r}r(hXM2Crypto.SSL.Context.hjhjhjQh}r(jHjIh]h]h]h]h]uhNhhh]rhXM2Crypto.SSL.Context.rr}r(hUhNhNhhhjubaubjW)r}r(hjhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXctxmaprr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjhNhjh}r(h]h]h]h]h]Uentries]r(jX'Context (class in M2Crypto.SSL.Context)hyUNtrauhNhhh]ubj')r}r(hUhjhNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xclassrj0juhNhhh]r (j2)r }r (hXEContext(protocol='tls', weak_crypto=None, post_connection_check=None)hjhX\/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Contextr hj6h}r (h]rhyaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhyaj?XContextrj@UjAuhNhhh]r(jC)r}r(hXclass hj hj hjFh}r(jHjIh]h]h]h]h]uhNhhh]rhXclass rr}r(hUhNhNhhhjubaubjN)r}r(hXM2Crypto.SSL.Context.hj hj hjQh}r(jHjIh]h]h]h]h]uhNhhh]rhXM2Crypto.SSL.Context.r r!}r"(hUhNhNhhhjubaubjW)r#}r$(hjhj hj hjZh}r%(jHjIh]h]h]h]h]uhNhhh]r&hXContextr'r(}r)(hUhNhNhhhj#ubaubjj)r*}r+(hX<protocol='tls', weak_crypto=None, post_connection_check=Nonehj hj hjmh}r,(jHjIh]h]h]h]h]uhNhhh]r-(jp)r.}r/(hXprotocol='tls'h}r0(jHjIh]h]h]h]h]uhj*h]r1hXprotocol='tls'r2r3}r4(hUhj.ubahjxubjp)r5}r6(hXweak_crypto=Noneh}r7(jHjIh]h]h]h]h]uhj*h]r8hXweak_crypto=Noner9r:}r;(hUhj5ubahjxubjp)r<}r=(hXpost_connection_check=Noneh}r>(jHjIh]h]h]h]h]uhj*h]r?hXpost_connection_check=Noner@rA}rB(hUhj<ubahjxubeubj`)rC}rD(hUhj hNhjch}rE(Uexprjeh]h]h]h]h]uhNhhh]rFh)rG}rH(hUh}rI(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjCh]rJjm)rK}rL(hUh}rM(h]h]rNjrah]h]h]uhjGh]rOhX[source]rPrQ}rR(hUhjKubahjwubahhubaubeubjx)rS}rT(hUhjhj hj{h}rU(h]h]h]h]h]uhNhhh]rV(j)rW}rX(hX'Context' for SSL connections.rYhjShX\/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.ContextrZhj h}r[(h]h]h]h]h]uhKhhh]r\hX"‘Context’ for SSL connections.r]r^}r_(hUhNhNhhhjWubaubh)r`}ra(hUhjShNhjh}rb(h]h]h]h]h]Uentries]rc(jX3add_session() (M2Crypto.SSL.Context.Context method)h'UNtrdauhNhhh]ubj')re}rf(hUhjShNhj*h}rg(j,j-Xpyh]h]h]h]h]j.Xmethodrhj0jhuhNhhh]ri(j2)rj}rk(hXContext.add_session(session)hjehXh/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.add_sessionrlhj6h}rm(h]rnh'aj9j:XM2Crypto.SSL.Contextrorp}rqbh]h]h]h]rrh'aj?XContext.add_sessionrsj@jjAuhNhhh]rt(jW)ru}rv(hX add_sessionhjjhjlhjZh}rw(jHjIh]h]h]h]h]uhNhhh]rxhX add_sessionryrz}r{(hUhNhNhhhjuubaubjj)r|}r}(hXsessionhjjhjlhjmh}r~(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXsessionh}r(jHjIh]h]h]h]h]uhj|h]rhXsessionrr}r(hUhjubahjxubaubj`)r}r(hUhjjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjsuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjehjlhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hXAdd the session to the context.hjhXh/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.add_sessionrhj h}r(h]h]h]h]h]uhKhhh]rhXAdd the session to the context.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]r(j")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhjlhj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX#session -- the session to be added.h}r(h]h]h]h]h]uhjh]r(j )r}r(hXsessionh}r(h]h]jh]h]h]uhjh]rhXsessionrr}r(hUhjubahjubhX – rr}r(hUhjubhXthe session to be added.rr}r(hUhNhNhhhjubehj ubahj<ubehj=ubj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hXReturnshjhjlhj*h}r(h]h]h]h]h]uhKh]rhXReturnsrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hXj0 The operation failed. It was tried to add the same (identical) session twice.1 The operation succeeded.h}r(h]h]h]h]h]uhjh]r(j)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]rj)r}r(hXP0 The operation failed. It was tried to add the same (identical) session twice. hjhjhjh}r(h]h]h]h]h]uhKh]r(j)r}r(hX40 The operation failed. It was tried to add the samehjhjhjh}r(h]h]h]h]h]uhKh]rhX40 The operation failed. It was tried to add the samerr}r(hUhjubaubj)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX(identical) session twice.hjhjhj h}r(h]h]h]h]h]uhKh]rhX(identical) session twice.rr}r(hUhjubaubahjubeubaubj)r}r(hX1 The operation succeeded.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhX1 The operation succeeded.rr}r(hUhNhNhhhjubaubehj ubahj<ubehj=ubeubeubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX-close() (M2Crypto.SSL.Context.Context method)hjUNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXContext.close()hjhXb/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.closerhj6h}r(h]r hjaj9j:XM2Crypto.SSL.Contextr r }r bh]h]h]h]r hjaj?X Context.closerj@jjAuhNhhh]r(jW)r}r(hXclosehjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXcloserr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]r!jm)r"}r#(hUh}r$(h]h]r%jrah]h]h]uhjh]r&hX[source]r'r(}r)(hUhj"ubahjwubahhubaubeubjx)r*}r+(hUhjhjhj{h}r,(h]h]h]h]h]uhNhhh]ubeubh)r-}r.(hUhjShXq/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_allow_unknown_car/hjh}r0(h]h]h]h]h]Uentries]r1(jX<get_allow_unknown_ca() (M2Crypto.SSL.Context.Context method)hUNtr2auhNhhh]ubj')r3}r4(hUhjShj/hj*h}r5(j,j-Xpyh]h]h]h]h]j.Xmethodr6j0j6uhNhhh]r7(j2)r8}r9(hXContext.get_allow_unknown_ca()hj3hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_allow_unknown_car:hj6h}r;(h]r<haj9j:XM2Crypto.SSL.Contextr=r>}r?bh]h]h]h]r@haj?XContext.get_allow_unknown_carAj@jjAuhNhhh]rB(jW)rC}rD(hXget_allow_unknown_cahj8hj:hjZh}rE(jHjIh]h]h]h]h]uhNhhh]rFhXget_allow_unknown_carGrH}rI(hUhNhNhhhjCubaubjj)rJ}rK(hUhj8hj:hjmh}rL(jHjIh]h]h]h]h]uhNhhh]ubj`)rM}rN(hUhj8hNhjch}rO(Uexprjeh]h]h]h]h]uhNhhh]rPh)rQ}rR(hUh}rS(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjAuhjMh]rTjm)rU}rV(hUh}rW(h]h]rXjrah]h]h]uhjQh]rYhX[source]rZr[}r\(hUhjUubahjwubahhubaubeubjx)r]}r^(hUhj3hj:hj{h}r_(h]h]h]h]h]uhNhhh]r`(j)ra}rb(hXeGet the context's setting that accepts/rejects a peer certificate if the certificate's CA is unknown.hj]hj/hj h}rc(h]h]h]h]h]uhKhhh]rdhXiGet the context’s setting that accepts/rejects a peer certificate if the certificate’s CA is unknown.rerf}rg(hUhNhNhhhjaubaubj)rh}ri(hXFIXME 2Bconverted to boolhj]hj/hj h}rj(h]h]h]h]h]uhKhhh]rkhXFIXME 2Bconverted to boolrlrm}rn(hUhNhNhhhjhubaubeubeubh)ro}rp(hUhjShNhjh}rq(h]h]h]h]h]Uentries]rr(jX6get_cert_store() (M2Crypto.SSL.Context.Context method)hrUNtrsauhNhhh]ubj')rt}ru(hUhjShNhj*h}rv(j,j-Xpyh]h]h]h]h]j.Xmethodrwj0jwuhNhhh]rx(j2)ry}rz(hXContext.get_cert_store()hjthXk/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_cert_storer{hj6h}r|(h]r}hraj9j:XM2Crypto.SSL.Contextr~r}rbh]h]h]h]rhraj?XContext.get_cert_storerj@jjAuhNhhh]r(jW)r}r(hXget_cert_storehjyhj{hjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXget_cert_storerr}r(hUhNhNhhhjubaubjj)r}r(hUhjyhj{hjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjyhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjthj{hj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hX7Get the certificate store associated with this context.hjhXk/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_cert_storerhj h}r(h]h]h]h]h]uhKhhh]rhX7Get the certificate store associated with this context.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUhjhjhj=h}r(h]h]h]h]h]uhKhhh]r(j')r}r(hXwarninghjhjhj*h}r(h]h]h]h]h]uhKh]rhXWarningrr}r(hUhjubaubj0)r}r(hXpThe store is NOT refcounted, and as such can not be relied to be valid once the context goes away or is changed.h}r(h]h]h]h]h]uhjh]rj)r}r(hXpThe store is NOT refcounted, and as such can not be relied to be valid once the context goes away or is changed.hjhjhj h}r(h]h]h]h]h]uhKh]rhXpThe store is NOT refcounted, and as such can not be relied to be valid once the context goes away or is changed.rr}r(hUhjubaubahj<ubeubaubeubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX>get_session_cache_mode() (M2Crypto.SSL.Context.Context method)hHUNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX Context.get_session_cache_mode()hjhXs/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_session_cache_moderhj6h}r(h]rhHaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhHaj?XContext.get_session_cache_moderj@jjAuhNhhh]r(jW)r}r(hXget_session_cache_modehjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXget_session_cache_moderr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hX!Gets the current session caching.hjhXs/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_session_cache_moderhj h}r(h]h]h]h]h]uhKhhh]rhX!Gets the current session caching.rr}r(hUhNhNhhhjubaubj)r}r(hX1The mode is set to m2.SSL_SESS_CACHE_* constants.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhX1The mode is set to m2.SSL_SESS_CACHE_* constants.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]r j")r }r (hUh}r (h]h]h]h]h]uhjh]r (j')r}r(hXReturnshj hjhj*h}r(h]h]h]h]h]uhKh]rhXReturnsrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhj h]rj)r}r(hX$the previously set cache mode value.h}r(h]h]h]h]h]uhjh]rhX$the previously set cache mode value.rr}r(hUhNhNhhhjubahj ubahj<ubehj=ubaubeubeubh)r }r!(hUhjShNhjh}r"(h]h]h]h]h]Uentries]r#(jX;get_session_timeout() (M2Crypto.SSL.Context.Context method)hVUNtr$auhNhhh]ubj')r%}r&(hUhjShNhj*h}r'(j,j-Xpyh]h]h]h]h]j.Xmethodr(j0j(uhNhhh]r)(j2)r*}r+(hXContext.get_session_timeout()hj%hXp/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_session_timeoutr,hj6h}r-(h]r.hVaj9j:XM2Crypto.SSL.Contextr/r0}r1bh]h]h]h]r2hVaj?XContext.get_session_timeoutr3j@jjAuhNhhh]r4(jW)r5}r6(hXget_session_timeouthj*hj,hjZh}r7(jHjIh]h]h]h]h]uhNhhh]r8hXget_session_timeoutr9r:}r;(hUhNhNhhhj5ubaubjj)r<}r=(hUhj*hj,hjmh}r>(jHjIh]h]h]h]h]uhNhhh]ubj`)r?}r@(hUhj*hNhjch}rA(Uexprjeh]h]h]h]h]uhNhhh]rBh)rC}rD(hUh}rE(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj3uhj?h]rFjm)rG}rH(hUh}rI(h]h]rJjrah]h]h]uhjCh]rKhX[source]rLrM}rN(hUhjGubahjwubahhubaubeubjx)rO}rP(hUhj%hj,hj{h}rQ(h]h]h]h]h]uhNhhh]rR(j)rS}rT(hXGet current session timeout.hjOhXp/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_session_timeoutrUhj h}rV(h]h]h]h]h]uhKhhh]rWhXGet current session timeout.rXrY}rZ(hUhNhNhhhjSubaubj)r[}r\(hXWhenever a new session is created, it is assigned a maximum lifetime. This lifetime is specified by storing the creation time of the session and the timeout value valid at this time. If the actual time is later than creation time plus timeout, the session is not reused.hjOhjUhj h}r](h]h]h]h]h]uhKhhh]r^hXWhenever a new session is created, it is assigned a maximum lifetime. This lifetime is specified by storing the creation time of the session and the timeout value valid at this time. If the actual time is later than creation time plus timeout, the session is not reused.r_r`}ra(hUhNhNhhhj[ubaubj)rb}rc(hXDue to this realization, all sessions behave according to the timeout value valid at the time of the session negotiation. Changes of the timeout value do not affect already established sessions.hjOhjUhj h}rd(h]h]h]h]h]uhK hhh]rehXDue to this realization, all sessions behave according to the timeout value valid at the time of the session negotiation. Changes of the timeout value do not affect already established sessions.rfrg}rh(hUhNhNhhhjbubaubj)ri}rj(hXExpired sessions are removed from the internal session cache, whenever SSL_CTX_flush_sessions(3) is called, either directly by the application or automatically (see SSL_CTX_set_session_cache_mode(3))hjOhjUhj h}rk(h]h]h]h]h]uhKhhh]rlhXExpired sessions are removed from the internal session cache, whenever SSL_CTX_flush_sessions(3) is called, either directly by the application or automatically (see SSL_CTX_set_session_cache_mode(3))rmrn}ro(hUhNhNhhhjiubaubj)rp}rq(hXThe default value for session timeout is decided on a per protocol basis, see SSL_get_default_timeout(3). All currently supported protocols have the same default timeout value of 300 seconds.hjOhjUhj h}rr(h]h]h]h]h]uhKhhh]rshXThe default value for session timeout is decided on a per protocol basis, see SSL_get_default_timeout(3). All currently supported protocols have the same default timeout value of 300 seconds.rtru}rv(hUhNhNhhhjpubaubj)rw}rx(hX?SSL_CTX_set_timeout() returns the previously set timeout value.hjOhjUhj h}ry(h]h]h]h]h]uhKhhh]rzhX?SSL_CTX_set_timeout() returns the previously set timeout value.r{r|}r}(hUhNhNhhhjwubaubj)r~}r(hUhjOhNhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUh}r(h]h]h]h]h]uhj~h]r(j')r}r(hXReturnshjhj,hj*h}r(h]h]h]h]h]uhKh]rhXReturnsrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX the currently set timeout value.h}r(h]h]h]h]h]uhjh]rhX the currently set timeout value.rr}r(hUhNhNhhhjubahj ubahj<ubehj=ubaubeubeubh)r}r(hUhjShXm/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_verify_depthrhjh}r(h]h]h]h]h]Uentries]r(jX8get_verify_depth() (M2Crypto.SSL.Context.Context method)hKUNtrauhNhhh]ubj')r}r(hUhjShjhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXContext.get_verify_depth()hjhXm/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_verify_depthrhj6h}r(h]rhKaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhKaj?XContext.get_verify_depthrj@jjAuhNhhh]r(jW)r}r(hXget_verify_depthhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXget_verify_depthrr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]rj)r}r(hX?Returns the verification mode currently set in the SSL Context.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhX?Returns the verification mode currently set in the SSL Context.rr}r(hUhNhNhhhjubaubaubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX7get_verify_mode() (M2Crypto.SSL.Context.Context method)hUNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXContext.get_verify_mode()hjhXl/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.get_verify_moderhj6h}r(h]rhaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhaj?XContext.get_verify_moderj@jjAuhNhhh]r(jW)r}r(hXget_verify_modehjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXget_verify_moderr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX1load_cert() (M2Crypto.SSL.Context.Context method)haUNtr auhNhhh]ubj')r }r (hUhjShNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r(j2)r}r(hXRContext.load_cert(certfile, keyfile=None, callback=)hj hXf/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_certrhj6h}r(h]rhaaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhaaj?XContext.load_certrj@jjAuhNhhh]r(jW)r}r(hX load_certhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhX load_certrr}r (hUhNhNhhhjubaubjj)r!}r"(hX?certfile, keyfile=None, callback=hjhjhjmh}r#(jHjIh]h]h]h]h]uhNhhh]r$(jp)r%}r&(hXcertfileh}r'(jHjIh]h]h]h]h]uhj!h]r(hXcertfiler)r*}r+(hUhj%ubahjxubjp)r,}r-(hX keyfile=Noneh}r.(jHjIh]h]h]h]h]uhj!h]r/hX keyfile=Noner0r1}r2(hUhj,ubahjxubjp)r3}r4(hX'callback=h}r5(jHjIh]h]h]h]h]uhj!h]r6hX'callback=r7r8}r9(hUhj3ubahjxubeubj`)r:}r;(hUhjhNhjch}r<(Uexprjeh]h]h]h]h]uhNhhh]r=h)r>}r?(hUh}r@(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhj:h]rAjm)rB}rC(hUh}rD(h]h]rEjrah]h]h]uhj>h]rFhX[source]rGrH}rI(hUhjBubahjwubahhubaubeubjx)rJ}rK(hUhj hjhj{h}rL(h]h]h]h]h]uhNhhh]rM(j)rN}rO(hX2Load certificate and private key into the context.hjJhXf/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_certrPhj h}rQ(h]h]h]h]h]uhKhhh]rRhX2Load certificate and private key into the context.rSrT}rU(hUhNhNhhhjNubaubj)rV}rW(hUhjJhNhjh}rX(h]h]h]h]h]uhNhhh]rYj")rZ}r[(hUh}r\(h]h]h]h]h]uhjVh]r](j')r^}r_(hX ParametershjZhjhj*h}r`(h]h]h]h]h]uhKh]rahX Parametersrbrc}rd(hUhj^ubaubj0)re}rf(hUh}rg(h]h]h]h]h]uhjZh]rhj` )ri}rj(hUh}rk(h]h]h]h]h]uhjeh]rl(je )rm}rn(hUh}ro(h]h]h]h]h]uhjih]rpj)rq}rr(hX;certfile -- File that contains the PEM-encoded certificate.h}rs(h]h]h]h]h]uhjmh]rt(j )ru}rv(hXcertfileh}rw(h]h]jh]h]h]uhjqh]rxhXcertfileryrz}r{(hUhjuubahjubhX – r|r}}r~(hUhjqubhX/File that contains the PEM-encoded certificate.rr}r(hUhNhNhhhjqubehj ubahj{ ubje )r}r(hUh}r(h]h]h]h]h]uhjih]rj)r}r(hXkeyfile -- File that contains the PEM-encoded private key. Default value of None indicates that the private key is to be found in 'certfile'.h}r(h]h]h]h]h]uhjh]r(j )r}r(hXkeyfileh}r(h]h]jh]h]h]uhjh]rhXkeyfilerr}r(hUhjubahjubhX – rr}r(hUhjubhXFile that contains the PEM-encoded private key. Default value of None indicates that the private key is to be found in ‘certfile’.rr}r(hUhNhNhhhjubehj ubahj{ ubje )r}r(hUh}r(h]h]h]h]h]uhjih]rj)r}r(hXcallback -- Callable object to be invoked if the private key is passphrase-protected. Default callback provides a simple terminal-style input for the passphrase.h}r(h]h]h]h]h]uhjh]r(j )r}r(hXcallbackh}r(h]h]jh]h]h]uhjh]rhXcallbackrr}r(hUhjubahjubhX – rr}r(hUhjubhXCallable object to be invoked if the private key is passphrase-protected. Default callback provides a simple terminal-style input for the passphrase.rr}r(hUhNhNhhhjubehj ubahj{ ubehj ubahj<ubehj=ubaubeubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX7load_cert_chain() (M2Crypto.SSL.Context.Context method)hMUNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX]Context.load_cert_chain(certchainfile, keyfile=None, callback=)hjhXl/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_cert_chainrhj6h}r(h]rhMaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhMaj?XContext.load_cert_chainrj@jjAuhNhhh]r(jW)r}r(hXload_cert_chainhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXload_cert_chainrr}r(hUhNhNhhhjubaubjj)r}r(hXDcertchainfile, keyfile=None, callback=hjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]r(jp)r}r(hX certchainfileh}r(jHjIh]h]h]h]h]uhjh]rhX certchainfilerr}r(hUhjubahjxubjp)r}r(hX keyfile=Noneh}r(jHjIh]h]h]h]h]uhjh]rhX keyfile=Nonerr}r(hUhjubahjxubjp)r}r(hX'callback=h}r(jHjIh]h]h]h]h]uhjh]rhX'callback=rr}r(hUhjubahjxubeubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hX8Load certificate chain and private key into the context.hjhXl/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_cert_chainrhj h}r(h]h]h]h]h]uhKhhh]rhX8Load certificate chain and private key into the context.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhjhj*h}r(h]h]h]h]h]uhKh]rhX Parametersr r }r (hUhjubaubj0)r }r (hUh}r(h]h]h]h]h]uhjh]rj` )r}r(hUh}r(h]h]h]h]h]uhj h]r(je )r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hXJcertchainfile -- File object containing the PEM-encoded certificate chain.h}r(h]h]h]h]h]uhjh]r(j )r}r(hX certchainfileh}r(h]h]jh]h]h]uhjh]rhX certchainfiler r!}r"(hUhjubahjubhX – r#r$}r%(hUhjubhX9File object containing the PEM-encoded certificate chain.r&r'}r((hUhNhNhhhjubehj ubahj{ ubje )r)}r*(hUh}r+(h]h]h]h]h]uhjh]r,j)r-}r.(hXkeyfile -- File object containing the PEM-encoded private key. Default value of None indicates that the private key is to be found in 'certchainfile'.h}r/(h]h]h]h]h]uhj)h]r0(j )r1}r2(hXkeyfileh}r3(h]h]jh]h]h]uhj-h]r4hXkeyfiler5r6}r7(hUhj1ubahjubhX – r8r9}r:(hUhj-ubhXFile object containing the PEM-encoded private key. Default value of None indicates that the private key is to be found in ‘certchainfile’.r;r<}r=(hUhNhNhhhj-ubehj ubahj{ ubje )r>}r?(hUh}r@(h]h]h]h]h]uhjh]rAj)rB}rC(hXcallback -- Callable object to be invoked if the private key is passphrase-protected. Default callback provides a simple terminal-style input for the passphrase.h}rD(h]h]h]h]h]uhj>h]rE(j )rF}rG(hXcallbackh}rH(h]h]jh]h]h]uhjBh]rIhXcallbackrJrK}rL(hUhjFubahjubhX – rMrN}rO(hUhjBubhXCallable object to be invoked if the private key is passphrase-protected. Default callback provides a simple terminal-style input for the passphrase.rPrQ}rR(hUhNhNhhhjBubehj ubahj{ ubehj ubahj<ubehj=ubaubeubeubh)rS}rT(hUhjShNhjh}rU(h]h]h]h]h]Uentries]rV(jX6load_client_CA() (M2Crypto.SSL.Context.Context method)h@UNtrWauhNhhh]ubj')rX}rY(hUhjShNhj*h}rZ(j,j-Xpyh]h]h]h]h]j.Xmethodr[j0j[uhNhhh]r\(j2)r]}r^(hXContext.load_client_CA(cafile)hjXhXk/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_client_CAr_hj6h}r`(h]rah@aj9j:XM2Crypto.SSL.Contextrbrc}rdbh]h]h]h]reh@aj?XContext.load_client_CAj@jjAuhNhhh]rf(jW)rg}rh(hXload_client_CAhj]hj_hjZh}ri(jHjIh]h]h]h]h]uhNhhh]rjhXload_client_CArkrl}rm(hUhNhNhhhjgubaubjj)rn}ro(hXcafilehj]hj_hjmh}rp(jHjIh]h]h]h]h]uhNhhh]rqjp)rr}rs(hXcafileh}rt(jHjIh]h]h]h]h]uhjnh]ruhXcafilervrw}rx(hUhjrubahjxubaubeubjx)ry}rz(hUhjXhj_hj{h}r{(h]h]h]h]h]uhNhhh]r|(j)r}}r~(hXgLoad CA certs into the context. These CA certs are sent to the peer during *SSLv3 certificate request*.hjyhXk/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_client_CArhj h}r(h]h]h]h]h]uhKhhh]r(hXKLoad CA certs into the context. These CA certs are sent to the peer during rr}r(hUhNhNhhhj}ubcdocutils.nodes emphasis r)r}r(hX*SSLv3 certificate request*h}r(h]h]h]h]h]uhj}h]rhXSSLv3 certificate requestrr}r(hUhjubahUemphasisrubhX.r}r(hUhNhNhhhj}ubeubj)r}r(hUhjyhNhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhj_hj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX_cafile -- File object containing one or more PEM-encoded CA certificates concatenated together.h}r(h]h]h]h]h]uhjh]r(j )r}r(hXcafileh}r(h]h]jh]h]h]uhjh]rhXcafilerr}r(hUhjubahjubhX – rr}r(hUhjubhXUFile object containing one or more PEM-encoded CA certificates concatenated together.rr}r(hUhNhNhhhjubehj ubahj<ubehj=ubaubeubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX6load_client_ca() (M2Crypto.SSL.Context.Context method)hUNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXContext.load_client_ca(cafile)hjhXk/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_client_carhj6h}r(h]rhaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhaj?XContext.load_client_caj@jjAuhNhhh]r(jW)r}r(hXload_client_cahjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXload_client_carr}r(hUhNhNhhhjubaubjj)r}r(hXcafilehjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXcafileh}r(jHjIh]h]h]h]h]uhjh]rhXcafilerr}r(hUhjubahjxubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hXgLoad CA certs into the context. These CA certs are sent to the peer during *SSLv3 certificate request*.hjhXk/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_client_carhj h}r(h]h]h]h]h]uhKhhh]r(hXKLoad CA certs into the context. These CA certs are sent to the peer during rr}r(hUhNhNhhhjubj)r}r(hX*SSLv3 certificate request*h}r(h]h]h]h]h]uhjh]rhXSSLv3 certificate requestrr}r(hUhjubahjubhX.r}r(hUhNhNhhhjubeubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhjhj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX_cafile -- File object containing one or more PEM-encoded CA certificates concatenated together.h}r(h]h]h]h]h]uhjh]r(j )r}r(hXcafileh}r(h]h]jh]h]h]uhjh]r hXcafiler r }r (hUhjubahjubhX – r r}r(hUhjubhXUFile object containing one or more PEM-encoded CA certificates concatenated together.rr}r(hUhNhNhhhjubehj ubahj<ubehj=ubaubeubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX8load_verify_info() (M2Crypto.SSL.Context.Context method)h;UNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX2Context.load_verify_info(cafile=None, capath=None)hjhXm/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_verify_inforhj6h}r (h]r!h;aj9j:XM2Crypto.SSL.Contextr"r#}r$bh]h]h]h]r%h;aj?XContext.load_verify_infoj@jjAuhNhhh]r&(jW)r'}r((hXload_verify_infohjhjhjZh}r)(jHjIh]h]h]h]h]uhNhhh]r*hXload_verify_infor+r,}r-(hUhNhNhhhj'ubaubjj)r.}r/(hXcafile=None, capath=Nonehjhjhjmh}r0(jHjIh]h]h]h]h]uhNhhh]r1(jp)r2}r3(hX cafile=Noneh}r4(jHjIh]h]h]h]h]uhj.h]r5hX cafile=Noner6r7}r8(hUhj2ubahjxubjp)r9}r:(hX capath=Noneh}r;(jHjIh]h]h]h]h]uhj.h]r<hX capath=Noner=r>}r?(hUhj9ubahjxubeubeubjx)r@}rA(hUhjhjhj{h}rB(h]h]h]h]h]uhNhhh]rC(j)rD}rE(hXLoad CA certs into the context.hj@hXm/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_verify_inforFhj h}rG(h]h]h]h]h]uhKhhh]rHhXLoad CA certs into the context.rIrJ}rK(hUhNhNhhhjDubaubj)rL}rM(hXFThese CA certs are used during verification of the peer's certificate.hj@hjFhj h}rN(h]h]h]h]h]uhKhhh]rOhXHThese CA certs are used during verification of the peer’s certificate.rPrQ}rR(hUhNhNhhhjLubaubj)rS}rT(hUhj@hNhjh}rU(h]h]h]h]h]uhNhhh]rV(j")rW}rX(hUh}rY(h]h]h]h]h]uhjSh]rZ(j')r[}r\(hX ParametershjWhjhj*h}r](h]h]h]h]h]uhKh]r^hX Parametersr_r`}ra(hUhj[ubaubj0)rb}rc(hUh}rd(h]h]h]h]h]uhjWh]rej` )rf}rg(hUh}rh(h]h]h]h]h]uhjbh]ri(je )rj}rk(hUh}rl(h]h]h]h]h]uhjfh]rmj)rn}ro(hXXcafile -- File containing one or more PEM-encoded CA certificates concatenated together.h}rp(h]h]h]h]h]uhjjh]rq(j )rr}rs(hXcafileh}rt(h]h]jh]h]h]uhjnh]ruhXcafilervrw}rx(hUhjrubahjubhX – ryrz}r{(hUhjnubhXNFile containing one or more PEM-encoded CA certificates concatenated together.r|r}}r~(hUhNhNhhhjnubehj ubahj{ ubje )r}r(hUh}r(h]h]h]h]h]uhjfh]rj)r}r(hXVcapath -- Directory containing PEM-encoded CA certificates (one certificate per file).h}r(h]h]h]h]h]uhjh]r(j )r}r(hXcapathh}r(h]h]jh]h]h]uhjh]rhXcapathrr}r(hUhjubahjubhX – rr}r(hUhjubhXLDirectory containing PEM-encoded CA certificates (one certificate per file).rr}r(hUhNhNhhhjubehj ubahj{ ubehj ubahj<ubehj=ubj")r}r(hUh}r(h]h]h]h]h]uhjSh]r(j')r}r(hXReturnshjhjhj*h}r(h]h]h]h]h]uhKh]rhXReturnsrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX0 if the operation failed because CAfile and CApath are NULL or the processing at one of the locations specified failed. Check the error stack to find out the reason.1 The operation succeeded.h}r(h]h]h]h]h]uhjh]r(j)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]rj)r}r(hX0 if the operation failed because CAfile and CApath are NULL or the processing at one of the locations specified failed. Check the error stack to find out the reason. hjhjFhjh}r(h]h]h]h]h]uhKh]r(j)r}r(hX<0 if the operation failed because CAfile and CApath are NULLhjhjFhjh}r(h]h]h]h]h]uhKh]rhX<0 if the operation failed because CAfile and CApath are NULLrr}r(hUhjubaubj)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hXior the processing at one of the locations specified failed. Check the error stack to find out the reason.hjhjFhj h}r(h]h]h]h]h]uhK h]rhXior the processing at one of the locations specified failed. Check the error stack to find out the reason.rr}r(hUhjubaubahjubeubaubj)r}r(hX1 The operation succeeded.hjhjFhj h}r(h]h]h]h]h]uhKhhh]rhX1 The operation succeeded.rr}r(hUhNhNhhhjubaubehj ubahj<ubehj=ubeubeubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX=load_verify_locations() (M2Crypto.SSL.Context.Context method)hkUNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX7Context.load_verify_locations(cafile=None, capath=None)hjhXr/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_verify_locationsrhj6h}r(h]rhkaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhkaj?XContext.load_verify_locationsrj@jjAuhNhhh]r(jW)r}r(hXload_verify_locationshjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXload_verify_locationsrr}r(hUhNhNhhhjubaubjj)r}r(hXcafile=None, capath=Nonehjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]r(jp)r}r(hX cafile=Noneh}r(jHjIh]h]h]h]h]uhjh]rhX cafile=Nonerr}r(hUhjubahjxubjp)r}r(hX capath=Noneh}r(jHjIh]h]h]h]h]uhjh]rhX capath=Nonerr}r(hUhjubahjxubeubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r (j)r }r (hXLoad CA certs into the context.hjhXr/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.load_verify_locationsr hj h}r (h]h]h]h]h]uhKhhh]rhXLoad CA certs into the context.rr}r(hUhNhNhhhj ubaubj)r}r(hXFThese CA certs are used during verification of the peer's certificate.hjhj hj h}r(h]h]h]h]h]uhKhhh]rhXHThese CA certs are used during verification of the peer’s certificate.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]r(j")r}r(hUh}r(h]h]h]h]h]uhjh]r (j')r!}r"(hX Parametershjhjhj*h}r#(h]h]h]h]h]uhKh]r$hX Parametersr%r&}r'(hUhj!ubaubj0)r(}r)(hUh}r*(h]h]h]h]h]uhjh]r+j` )r,}r-(hUh}r.(h]h]h]h]h]uhj(h]r/(je )r0}r1(hUh}r2(h]h]h]h]h]uhj,h]r3j)r4}r5(hXXcafile -- File containing one or more PEM-encoded CA certificates concatenated together.h}r6(h]h]h]h]h]uhj0h]r7(j )r8}r9(hXcafileh}r:(h]h]jh]h]h]uhj4h]r;hXcafiler<r=}r>(hUhj8ubahjubhX – r?r@}rA(hUhj4ubhXNFile containing one or more PEM-encoded CA certificates concatenated together.rBrC}rD(hUhNhNhhhj4ubehj ubahj{ ubje )rE}rF(hUh}rG(h]h]h]h]h]uhj,h]rHj)rI}rJ(hXVcapath -- Directory containing PEM-encoded CA certificates (one certificate per file).h}rK(h]h]h]h]h]uhjEh]rL(j )rM}rN(hXcapathh}rO(h]h]jh]h]h]uhjIh]rPhXcapathrQrR}rS(hUhjMubahjubhX – rTrU}rV(hUhjIubhXLDirectory containing PEM-encoded CA certificates (one certificate per file).rWrX}rY(hUhNhNhhhjIubehj ubahj{ ubehj ubahj<ubehj=ubj")rZ}r[(hUh}r\(h]h]h]h]h]uhjh]r](j')r^}r_(hXReturnshjZhjhj*h}r`(h]h]h]h]h]uhKh]rahXReturnsrbrc}rd(hUhj^ubaubj0)re}rf(hUh}rg(h]h]h]h]h]uhjZh]rhj)ri}rj(hX0 if the operation failed because CAfile and CApath are NULL or the processing at one of the locations specified failed. Check the error stack to find out the reason.1 The operation succeeded.h}rk(h]h]h]h]h]uhjeh]rl(j)rm}rn(hUhjihNhjh}ro(h]h]h]h]h]uhNhhh]rpj)rq}rr(hX0 if the operation failed because CAfile and CApath are NULL or the processing at one of the locations specified failed. Check the error stack to find out the reason. hjmhj hjh}rs(h]h]h]h]h]uhKh]rt(j)ru}rv(hX<0 if the operation failed because CAfile and CApath are NULLhjqhj hjh}rw(h]h]h]h]h]uhKh]rxhX<0 if the operation failed because CAfile and CApath are NULLryrz}r{(hUhjuubaubj)r|}r}(hUh}r~(h]h]h]h]h]uhjqh]rj)r}r(hXior the processing at one of the locations specified failed. Check the error stack to find out the reason.hj|hj hj h}r(h]h]h]h]h]uhK h]rhXior the processing at one of the locations specified failed. Check the error stack to find out the reason.rr}r(hUhjubaubahjubeubaubj)r}r(hX1 The operation succeeded.hjihj hj h}r(h]h]h]h]h]uhKhhh]rhX1 The operation succeeded.rr}r(hUhNhNhhhjubaubehj ubahj<ubehj=ubeubeubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX7m2_ssl_ctx_free() (M2Crypto.SSL.Context.Context method)h3UNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXContext.m2_ssl_ctx_freehjhXl/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.m2_ssl_ctx_freerhj6h}r(h]rh3aj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rh3aj?XContext.m2_ssl_ctx_freej@jjAuhNhhh]r(jW)r}r(hXm2_ssl_ctx_freehjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXm2_ssl_ctx_freerr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]ubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX6remove_session() (M2Crypto.SSL.Context.Context method)hAUNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hXContext.remove_session(session)hjhXk/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.remove_sessionrhj6h}r(h]rhAaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhAaj?XContext.remove_sessionrj@jjAuhNhhh]r(jW)r}r(hXremove_sessionhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXremove_sessionrr}r(hUhNhNhhhjubaubjj)r}r(hXsessionhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hXsessionh}r(jHjIh]h]h]h]h]uhjh]rhXsessionrr}r(hUhjubahjxubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hX$Remove the session from the context.hjhXk/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.remove_sessionrhj h}r(h]h]h]h]h]uhKhhh]rhX$Remove the session from the context.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]r(j")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhjhj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX%session -- the session to be removed.h}r(h]h]h]h]h]uhjh]r(j )r }r (hXsessionh}r (h]h]jh]h]h]uhjh]r hXsessionr r}r(hUhj ubahjubhX – rr}r(hUhjubhXthe session to be removed.rr}r(hUhNhNhhhjubehj ubahj<ubehj=ubj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hXReturnshjhjhj*h}r(h]h]h]h]h]uhKh]rhXReturnsrr}r (hUhjubaubj0)r!}r"(hUh}r#(h]h]h]h]h]uhjh]r$j)r%}r&(hXZ0 The operation failed. The session was not found in the cache.1 The operation succeeded.h}r'(h]h]h]h]h]uhj!h]r((j)r)}r*(hUhj%hNhjh}r+(h]h]h]h]h]uhNhhh]r,j)r-}r.(hX@0 The operation failed. The session was not found in the cache. hj)hjhjh}r/(h]h]h]h]h]uhKh]r0(j)r1}r2(hX40 The operation failed. The session was not found inhj-hjhjh}r3(h]h]h]h]h]uhKh]r4hX40 The operation failed. The session was not found inr5r6}r7(hUhj1ubaubj)r8}r9(hUh}r:(h]h]h]h]h]uhj-h]r;j)r<}r=(hX the cache.hj8hjhj h}r>(h]h]h]h]h]uhKh]r?hX the cache.r@rA}rB(hUhj<ubaubahjubeubaubj)rC}rD(hX1 The operation succeeded.hj%hjhj h}rE(h]h]h]h]h]uhKhhh]rFhX1 The operation succeeded.rGrH}rI(hUhNhNhhhjCubaubehj ubahj<ubehj=ubeubeubeubh)rJ}rK(hUhjShNhjh}rL(h]h]h]h]h]Uentries]rM(jX<set_allow_unknown_ca() (M2Crypto.SSL.Context.Context method)h UNtrNauhNhhh]ubj')rO}rP(hUhjShNhj*h}rQ(j,j-Xpyh]h]h]h]h]j.XmethodrRj0jRuhNhhh]rS(j2)rT}rU(hX Context.set_allow_unknown_ca(ok)hjOhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_allow_unknown_carVhj6h}rW(h]rXh aj9j:XM2Crypto.SSL.ContextrYrZ}r[bh]h]h]h]r\h aj?XContext.set_allow_unknown_car]j@jjAuhNhhh]r^(jW)r_}r`(hXset_allow_unknown_cahjThjVhjZh}ra(jHjIh]h]h]h]h]uhNhhh]rbhXset_allow_unknown_carcrd}re(hUhNhNhhhj_ubaubjj)rf}rg(hXokhjThjVhjmh}rh(jHjIh]h]h]h]h]uhNhhh]rijp)rj}rk(hXokh}rl(jHjIh]h]h]h]h]uhjfh]rmhXokrnro}rp(hUhjjubahjxubaubj`)rq}rr(hUhjThNhjch}rs(Uexprjeh]h]h]h]h]uhNhhh]rth)ru}rv(hUh}rw(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj]uhjqh]rxjm)ry}rz(hUh}r{(h]h]r|jrah]h]h]uhjuh]r}hX[source]r~r}r(hUhjyubahjwubahhubaubeubjx)r}r(hUhjOhjVhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hXWSet the context to accept/reject a peer certificate if the certificate's CA is unknown.hjhXq/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_allow_unknown_carhj h}r(h]h]h]h]h]uhKhhh]rhXYSet the context to accept/reject a peer certificate if the certificate’s CA is unknown.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]rj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX ParametershjhjVhj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX&ok -- True to accept, False to reject.h}r(h]h]h]h]h]uhjh]r(j )r}r(hXokh}r(h]h]jh]h]h]uhjh]rhXokrr}r(hUhjubahjubhX – rr}r(hUhjubhX True to accept, False to reject.rr}r(hUhNhNhhhjubehj ubahj<ubehj=ubaubeubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX7set_cipher_list() (M2Crypto.SSL.Context.Context method)h{UNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX$Context.set_cipher_list(cipher_list)hjhXl/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_cipher_listrhj6h}r(h]rh{aj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rh{aj?XContext.set_cipher_listrj@jjAuhNhhh]r(jW)r}r(hXset_cipher_listhjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXset_cipher_listrr}r(hUhNhNhhhjubaubjj)r}r(hX cipher_listhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]rjp)r}r(hX cipher_listh}r(jHjIh]h]h]h]h]uhjh]rhX cipher_listrr}r(hUhjubahjxubaubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hX#Sets the list of available ciphers.hjhXl/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_cipher_listrhj h}r(h]h]h]h]h]uhKhhh]rhX#Sets the list of available ciphers.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhNhjh}r(h]h]h]h]h]uhNhhh]r(j")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hX Parametershjhjhj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hXCcipher_list -- The format of the string is described in ciphers(1).h}r (h]h]h]h]h]uhjh]r (j )r }r (hX cipher_listh}r (h]h]jh]h]h]uhjh]rhX cipher_listrr}r(hUhj ubahjubhX – rr}r(hUhjubhX4The format of the string is described in ciphers(1).rr}r(hUhNhNhhhjubehj ubahj<ubehj=ubj")r}r(hUh}r(h]h]h]h]h]uhjh]r(j')r}r(hXReturnshjhjhj*h}r(h]h]h]h]h]uhKh]rhXReturnsr r!}r"(hUhjubaubj0)r#}r$(hUh}r%(h]h]h]h]h]uhjh]r&j)r'}r((hX<1 if any cipher could be selected and 0 on complete failure.h}r)(h]h]h]h]h]uhj#h]r*hX<1 if any cipher could be selected and 0 on complete failure.r+r,}r-(hUhNhNhhhj'ubahj ubahj<ubehj=ubeubeubeubh)r.}r/(hUhjShNhjh}r0(h]h]h]h]h]Uentries]r1(jXDset_client_CA_list_from_file() (M2Crypto.SSL.Context.Context method)hUNtr2auhNhhh]ubj')r3}r4(hUhjShNhj*h}r5(j,j-Xpyh]h]h]h]h]j.Xmethodr6j0j6uhNhhh]r7(j2)r8}r9(hX,Context.set_client_CA_list_from_file(cafile)hj3hXy/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_client_CA_list_from_filer:hj6h}r;(h]r<haj9j:XM2Crypto.SSL.Contextr=r>}r?bh]h]h]h]r@haj?X$Context.set_client_CA_list_from_filerAj@jjAuhNhhh]rB(jW)rC}rD(hXset_client_CA_list_from_filehj8hj:hjZh}rE(jHjIh]h]h]h]h]uhNhhh]rFhXset_client_CA_list_from_filerGrH}rI(hUhNhNhhhjCubaubjj)rJ}rK(hXcafilehj8hj:hjmh}rL(jHjIh]h]h]h]h]uhNhhh]rMjp)rN}rO(hXcafileh}rP(jHjIh]h]h]h]h]uhjJh]rQhXcafilerRrS}rT(hUhjNubahjxubaubj`)rU}rV(hUhj8hNhjch}rW(Uexprjeh]h]h]h]h]uhNhhh]rXh)rY}rZ(hUh}r[(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjAuhjUh]r\jm)r]}r^(hUh}r_(h]h]r`jrah]h]h]uhjYh]rahX[source]rbrc}rd(hUhj]ubahjwubahhubaubeubjx)re}rf(hUhj3hj:hj{h}rg(h]h]h]h]h]uhNhhh]rh(j)ri}rj(hXgLoad CA certs into the context. These CA certs are sent to the peer during *SSLv3 certificate request*.hjehXy/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_client_CA_list_from_filerkhj h}rl(h]h]h]h]h]uhKhhh]rm(hXKLoad CA certs into the context. These CA certs are sent to the peer during rnro}rp(hUhNhNhhhjiubj)rq}rr(hX*SSLv3 certificate request*h}rs(h]h]h]h]h]uhjih]rthXSSLv3 certificate requestrurv}rw(hUhjqubahjubhX.rx}ry(hUhNhNhhhjiubeubj)rz}r{(hUhjehNhjh}r|(h]h]h]h]h]uhNhhh]r}j")r~}r(hUh}r(h]h]h]h]h]uhjzh]r(j')r}r(hX Parametershj~hj:hj*h}r(h]h]h]h]h]uhKh]rhX Parametersrr}r(hUhjubaubj0)r}r(hUh}r(h]h]h]h]h]uhj~h]rj)r}r(hX_cafile -- File object containing one or more PEM-encoded CA certificates concatenated together.h}r(h]h]h]h]h]uhjh]r(j )r}r(hXcafileh}r(h]h]jh]h]h]uhjh]rhXcafilerr}r(hUhjubahjubhX – rr}r(hUhjubhXUFile object containing one or more PEM-encoded CA certificates concatenated together.rr}r(hUhNhNhhhjubehj ubahj<ubehj=ubaubeubeubh)r}r(hUhjShNhjh}r(h]h]h]h]h]Uentries]r(jX@set_default_verify_paths() (M2Crypto.SSL.Context.Context method)htUNtrauhNhhh]ubj')r}r(hUhjShNhj*h}r(j,j-Xpyh]h]h]h]h]j.Xmethodrj0juhNhhh]r(j2)r}r(hX"Context.set_default_verify_paths()rhjhXu/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_default_verify_pathsrhj6h}r(h]rhtaj9j:XM2Crypto.SSL.Contextrr}rbh]h]h]h]rhtaj?X Context.set_default_verify_pathsrj@jjAuhNhhh]r(jW)r}r(hXset_default_verify_pathshjhjhjZh}r(jHjIh]h]h]h]h]uhNhhh]rhXset_default_verify_pathsrr}r(hUhNhNhhhjubaubjj)r}r(hUhjhjhjmh}r(jHjIh]h]h]h]h]uhNhhh]ubj`)r}r(hUhjhNhjch}r(Uexprjeh]h]h]h]h]uhNhhh]rh)r}r(hUh}r(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjuhjh]rjm)r}r(hUh}r(h]h]rjrah]h]h]uhjh]rhX[source]rr}r(hUhjubahjwubahhubaubeubjx)r}r(hUhjhjhj{h}r(h]h]h]h]h]uhNhhh]r(j)r}r(hXSSpecifies that the default locations from which CA certs are loaded should be used.hjhXu/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_default_verify_pathsrhj h}r(h]h]h]h]h]uhKhhh]rhXSSpecifies that the default locations from which CA certs are loaded should be used.rr}r(hUhNhNhhhjubaubj)r}r(hXThere is one default directory and one default file. The default CA certificates directory is called "certs" in the default OpenSSL directory. Alternatively the SSL_CERT_DIR environment variable can be defined to override this location. The default CA certificates file is called "cert.pem" in the default OpenSSL directory. Alternatively the SSL_CERT_FILE environment variable can be defined to override this location.hjhjhj h}r(h]h]h]h]h]uhKhhh]rhXThere is one default directory and one default file. The default CA certificates directory is called “certs” in the default OpenSSL directory. Alternatively the SSL_CERT_DIR environment variable can be defined to override this location. The default CA certificates file is called “cert.pem” in the default OpenSSL directory. Alternatively the SSL_CERT_FILE environment variable can be defined to override this location.rr}r(hUhNhNhhhjubaubj)r}r(hUhjhjhjh}r(h]h]h]h]h]uhNhhh]rj)r}r(hX@return 0 if the operation failed. A missing default location is still treated as a success. No error code is set. 1 The operation succeeded.hjhjhjh}r(h]h]h]h]h]uhKh]r(j)r}r(hX@@return 0 if the operation failed. A missing default location isrhjhjhjh}r(h]h]h]h]h]uhKh]rhX@@return 0 if the operation failed. A missing default location isrr}r(hUhjubaubj)r}r(hUh}r(h]h]h]h]h]uhjh]r(cdocutils.nodes block_quote r)r}r(hUh}r(h]h]h]h]h]uhjh]rj)r}r(hX1still treated as a success. No error code is set.rhjhjhj h}r(h]h]h]h]h]uhK h]rhX1still treated as a success. No error code is set.rr }r (hUhjubaubahU block_quoter ubj)r }r (hX1 The operation succeeded.r hjhjhj h}r (h]h]h]h]h]uhKh]r hX1 The operation succeeded.r r }r (hUhj ubaubehjubeubaubeubeubh)r }r (hUhjShNhjh}r (h]h]h]h]h]Uentries]r (jX9set_info_callback() (M2Crypto.SSL.Context.Context method)hbUNtr auhNhhh]ubj')r }r (hUhjShNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hX@Context.set_info_callback(callback=)hj hXn/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_info_callbackr hj6h}r (h]r hbaj9j:XM2Crypto.SSL.Contextr r }r bh]h]h]h]r hbaj?XContext.set_info_callbackr j@jjAuhNhhh]r (jW)r }r! (hXset_info_callbackhj hj hjZh}r" (jHjIh]h]h]h]h]uhNhhh]r# hXset_info_callbackr$ r% }r& (hUhNhNhhhj ubaubjj)r' }r( (hX%callback=hj hj hjmh}r) (jHjIh]h]h]h]h]uhNhhh]r* jp)r+ }r, (hX%callback=h}r- (jHjIh]h]h]h]h]uhj' h]r. hX%callback=r/ r0 }r1 (hUhj+ ubahjxubaubj`)r2 }r3 (hUhj hNhjch}r4 (Uexprjeh]h]h]h]h]uhNhhh]r5 h)r6 }r7 (hUh}r8 (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj uhj2 h]r9 jm)r: }r; (hUh}r< (h]h]r= jrah]h]h]uhj6 h]r> hX[source]r? r@ }rA (hUhj: ubahjwubahhubaubeubjx)rB }rC (hUhj hj hj{h}rD (h]h]h]h]h]uhNhhh]rE (j)rF }rG (hX1Set a callback function to get state information.hjB hXn/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_info_callbackrH hj h}rI (h]h]h]h]h]uhKhhh]rJ hX1Set a callback function to get state information.rK rL }rM (hUhNhNhhhjF ubaubj)rN }rO (hXeIt can be used to get state information about the SSL connections that are created from this context.hjB hjH hj h}rP (h]h]h]h]h]uhKhhh]rQ hXeIt can be used to get state information about the SSL connections that are created from this context.rR rS }rT (hUhNhNhhhjN ubaubj)rU }rV (hUhjB hNhjh}rW (h]h]h]h]h]uhNhhh]rX j")rY }rZ (hUh}r[ (h]h]h]h]h]uhjU h]r\ (j')r] }r^ (hX ParametershjY hj hj*h}r_ (h]h]h]h]h]uhKh]r` hX Parametersra rb }rc (hUhj] ubaubj0)rd }re (hUh}rf (h]h]h]h]h]uhjY h]rg j)rh }ri (hXHcallback -- Callback function. The default prints information to stderr.h}rj (h]h]h]h]h]uhjd h]rk (j )rl }rm (hXcallbackh}rn (h]h]jh]h]h]uhjh h]ro hXcallbackrp rq }rr (hUhjl ubahjubhX – rs rt }ru (hUhjh ubhX<Callback function. The default prints information to stderr.rv rw }rx (hUhNhNhhhjh ubehj ubahj<ubehj=ubaubeubeubh)ry }rz (hUhjShNhjh}r{ (h]h]h]h]h]Uentries]r| (jX3set_options() (M2Crypto.SSL.Context.Context method)hUNtr} auhNhhh]ubj')r~ }r (hUhjShNhj*h}r (j,j-Xpyh]h]h]h]h]j.Xmethodr j0j uhNhhh]r (j2)r }r (hXContext.set_options(op)hj~ hXh/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_optionsr hj6h}r (h]r haj9j:XM2Crypto.SSL.Contextr r }r bh]h]h]h]r haj?XContext.set_optionsr j@jjAuhNhhh]r (jW)r }r (hX set_optionshj hj hjZh}r (jHjIh]h]h]h]h]uhNhhh]r hX set_optionsr r }r (hUhNhNhhhj ubaubjj)r }r (hXophj hj hjmh}r (jHjIh]h]h]h]h]uhNhhh]r jp)r }r (hXoph}r (jHjIh]h]h]h]h]uhj h]r hXopr r }r (hUhj ubahjxubaubj`)r }r (hUhj hNhjch}r (Uexprjeh]h]h]h]h]uhNhhh]r h)r }r (hUh}r (UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj uhj h]r jm)r }r (hUh}r (h]h]r jrah]h]h]uhj h]r hX[source]r r }r (hUhj ubahjwubahhubaubeubjx)r }r (hUhj~ hj hj{h}r (h]h]h]h]h]uhNhhh]r (j)r }r (hX;Adds the options set via bitmask in options to the Context.hj hXh/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_optionsr hj h}r (h]h]h]h]h]uhKhhh]r hX;Adds the options set via bitmask in options to the Context.r r }r (hUhNhNhhhj ubaubj)r }r (hX/!!! Options already set before are not cleared!hj hj hj h}r (h]h]h]h]h]uhKhhh]r hX/!!! Options already set before are not cleared!r r }r (hUhNhNhhhj ubaubj)r }r (hXThe behaviour of the SSL library can be changed by setting several options. The options are coded as bitmasks and can be combined by a logical or operation (|).hj hj hj h}r (h]h]h]h]h]uhKhhh]r hXThe behaviour of the SSL library can be changed by setting several options. The options are coded as bitmasks and can be combined by a logical or operation (|).r r }r (hUhNhNhhhj ubaubj)r }r (hXSSL.Context.set_options() and SSL.set_options() affect the (external) protocol behaviour of the SSL library. The (internal) behaviour of the API can be changed by using the similar SSL.Context.set_mode() and SSL.set_mode() functions.hj hj hj h}r (h]h]h]h]h]uhK hhh]r hXSSL.Context.set_options() and SSL.set_options() affect the (external) protocol behaviour of the SSL library. The (internal) behaviour of the API can be changed by using the similar SSL.Context.set_mode() and SSL.set_mode() functions.r r }r (hUhNhNhhhj ubaubj)r }r (hX During a handshake, the option settings of the SSL object are used. When a new SSL object is created from a context using SSL(), the current option setting is copied. Changes to ctx do not affect already created SSL objects. SSL.clear() does not affect the settings.hj hj hj h}r (h]h]h]h]h]uhKhhh]r hX During a handshake, the option settings of the SSL object are used. When a new SSL object is created from a context using SSL(), the current option setting is copied. Changes to ctx do not affect already created SSL objects. SSL.clear() does not affect the settings.r r }r (hUhNhNhhhj ubaubj)r }r (hUhj hNhjh}r (h]h]h]h]h]uhNhhh]r (j")r }r (hUh}r (h]h]h]h]h]uhj h]r (j')r }r (hX Parametershj hj hj*h}r (h]h]h]h]h]uhKh]r hX Parametersr r }r (hUhj ubaubj0)r }r (hUh}r (h]h]h]h]h]uhj h]r j)r }r (hXPop -- bitmask of additional options specified in SSL_CTX_set_options(3) manpage.h}r (h]h]h]h]h]uhj h]r (j )r }r (hXoph}r (h]h]jh]h]h]uhj h]r hXopr r }r (hUhj ubahjubhX – r r }r (hUhj ubhXJbitmask of additional options specified in SSL_CTX_set_options(3) manpage.r r }r (hUhNhNhhhj ubehj ubahj<ubehj=ubj")r }r (hUh}r (h]h]h]h]h]uhj h]r (j')r!}r!(hXReturnshj hj hj*h}r!(h]h]h]h]h]uhKh]r!hXReturnsr!r!}r!(hUhj!ubaubj0)r!}r!(hUh}r !(h]h]h]h]h]uhj h]r !j)r !}r !(hX-the new options bitmask after adding options.h}r !(h]h]h]h]h]uhj!h]r!hX-the new options bitmask after adding options.r!r!}r!(hUhNhNhhhj !ubahj ubahj<ubehj=ubeubeubeubh)r!}r!(hUhjShNhjh}r!(h]h]h]h]h]Uentries]r!(jX>set_session_cache_mode() (M2Crypto.SSL.Context.Context method)hCUNtr!auhNhhh]ubj')r!}r!(hUhjShNhj*h}r!(j,j-Xpyh]h]h]h]h]j.Xmethodr!j0j!uhNhhh]r!(j2)r!}r!(hX$Context.set_session_cache_mode(mode)hj!hXs/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_session_cache_moder!hj6h}r!(h]r !hCaj9j:XM2Crypto.SSL.Contextr!!r"!}r#!bh]h]h]h]r$!hCaj?XContext.set_session_cache_moder%!j@jjAuhNhhh]r&!(jW)r'!}r(!(hXset_session_cache_modehj!hj!hjZh}r)!(jHjIh]h]h]h]h]uhNhhh]r*!hXset_session_cache_moder+!r,!}r-!(hUhNhNhhhj'!ubaubjj)r.!}r/!(hXmodehj!hj!hjmh}r0!(jHjIh]h]h]h]h]uhNhhh]r1!jp)r2!}r3!(hXmodeh}r4!(jHjIh]h]h]h]h]uhj.!h]r5!hXmoder6!r7!}r8!(hUhj2!ubahjxubaubj`)r9!}r:!(hUhj!hNhjch}r;!(Uexprjeh]h]h]h]h]uhNhhh]r!(hUh}r?!(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj%!uhj9!h]r@!jm)rA!}rB!(hUh}rC!(h]h]rD!jrah]h]h]uhj=!h]rE!hX[source]rF!rG!}rH!(hUhjA!ubahjwubahhubaubeubjx)rI!}rJ!(hUhj!hj!hj{h}rK!(h]h]h]h]h]uhNhhh]rL!(j)rM!}rN!(hX!Enables/disables session caching.hjI!hXs/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_session_cache_moderO!hj h}rP!(h]h]h]h]h]uhKhhh]rQ!hX!Enables/disables session caching.rR!rS!}rT!(hUhNhNhhhjM!ubaubj)rU!}rV!(hX7The mode is set by using m2.SSL_SESS_CACHE_* constants.hjI!hjO!hj h}rW!(h]h]h]h]h]uhKhhh]rX!hX7The mode is set by using m2.SSL_SESS_CACHE_* constants.rY!rZ!}r[!(hUhNhNhhhjU!ubaubj)r\!}r]!(hUhjI!hNhjh}r^!(h]h]h]h]h]uhNhhh]r_!(j")r`!}ra!(hUh}rb!(h]h]h]h]h]uhj\!h]rc!(j')rd!}re!(hX Parametershj`!hj!hj*h}rf!(h]h]h]h]h]uhKh]rg!hX Parametersrh!ri!}rj!(hUhjd!ubaubj0)rk!}rl!(hUh}rm!(h]h]h]h]h]uhj`!h]rn!j)ro!}rp!(hXmode -- new mode value.h}rq!(h]h]h]h]h]uhjk!h]rr!(j )rs!}rt!(hXmodeh}ru!(h]h]jh]h]h]uhjo!h]rv!hXmoderw!rx!}ry!(hUhjs!ubahjubhX – rz!r{!}r|!(hUhjo!ubhXnew mode value.r}!r~!}r!(hUhNhNhhhjo!ubehj ubahj<ubehj=ubj")r!}r!(hUh}r!(h]h]h]h]h]uhj\!h]r!(j')r!}r!(hXReturnshj!hj!hj*h}r!(h]h]h]h]h]uhKh]r!hXReturnsr!r!}r!(hUhj!ubaubj0)r!}r!(hUh}r!(h]h]h]h]h]uhj!h]r!j)r!}r!(hX$the previously set cache mode value.h}r!(h]h]h]h]h]uhj!h]r!hX$the previously set cache mode value.r!r!}r!(hUhNhNhhhj!ubahj ubahj<ubehj=ubeubeubeubh)r!}r!(hUhjShNhjh}r!(h]h]h]h]h]Uentries]r!(jX:set_session_id_ctx() (M2Crypto.SSL.Context.Context method)h UNtr!auhNhhh]ubj')r!}r!(hUhjShNhj*h}r!(j,j-Xpyh]h]h]h]h]j.Xmethodr!j0j!uhNhhh]r!(j2)r!}r!(hXContext.set_session_id_ctx(id)hj!hXo/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_session_id_ctxr!hj6h}r!(h]r!h aj9j:XM2Crypto.SSL.Contextr!r!}r!bh]h]h]h]r!h aj?XContext.set_session_id_ctxr!j@jjAuhNhhh]r!(jW)r!}r!(hXset_session_id_ctxhj!hj!hjZh}r!(jHjIh]h]h]h]h]uhNhhh]r!hXset_session_id_ctxr!r!}r!(hUhNhNhhhj!ubaubjj)r!}r!(hXidhj!hj!hjmh}r!(jHjIh]h]h]h]h]uhNhhh]r!jp)r!}r!(hXidh}r!(jHjIh]h]h]h]h]uhj!h]r!hXidr!r!}r!(hUhj!ubahjxubaubj`)r!}r!(hUhj!hNhjch}r!(Uexprjeh]h]h]h]h]uhNhhh]r!h)r!}r!(hUh}r!(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj!uhj!h]r!jm)r!}r!(hUh}r!(h]h]r!jrah]h]h]uhj!h]r!hX[source]r!r!}r!(hUhj!ubahjwubahhubaubeubjx)r!}r!(hUhj!hj!hj{h}r!(h]h]h]h]h]uhNhhh]r!(j)r!}r!(hXESets the session id for the SSL.Context w/in a session can be reused.hj!hXo/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_session_id_ctxr!hj h}r!(h]h]h]h]h]uhKhhh]r!hXESets the session id for the SSL.Context w/in a session can be reused.r!r!}r!(hUhNhNhhhj!ubaubj)r!}r!(hUhj!hNhjh}r!(h]h]h]h]h]uhNhhh]r!j")r!}r!(hUh}r!(h]h]h]h]h]uhj!h]r!(j')r!}r!(hX Parametershj!hj!hj*h}r!(h]h]h]h]h]uhKh]r!hX Parametersr!r!}r!(hUhj!ubaubj0)r!}r!(hUh}r!(h]h]h]h]h]uhj!h]r!j)r!}r!(hXFid -- Sessions are generated within a certain context. When exporting/importing sessions with i2d_SSL_SESSION/d2i_SSL_SESSION it would be possible, to re-import a session generated from another context (e.g. another application), which might lead to malfunctions. Therefore each application must set its own session id context sid_ctx which is used to distinguish the contexts and is stored in exported sessions. The sid_ctx can be any kind of binary data with a given length, it is therefore possible to use e.g. the name of the application and/or the hostname and/or service name.h}r!(h]h]h]h]h]uhj!h]r!(j )r!}r!(hXidh}r!(h]h]jh]h]h]uhj!h]r!hXidr!r!}r!(hUhj!ubahjubhX – r!r!}r!(hUhj!ubhX@Sessions are generated within a certain context. When exporting/importing sessions with i2d_SSL_SESSION/d2i_SSL_SESSION it would be possible, to re-import a session generated from another context (e.g. another application), which might lead to malfunctions. Therefore each application must set its own session id context sid_ctx which is used to distinguish the contexts and is stored in exported sessions. The sid_ctx can be any kind of binary data with a given length, it is therefore possible to use e.g. the name of the application and/or the hostname and/or service name.r!r!}r!(hUhNhNhhhj!ubehj ubahj<ubehj=ubaubeubeubh)r!}r!(hUhjShNhjh}r!(h]h]h]h]h]Uentries]r"(jX;set_session_timeout() (M2Crypto.SSL.Context.Context method)hUNtr"auhNhhh]ubj')r"}r"(hUhjShNhj*h}r"(j,j-Xpyh]h]h]h]h]j.Xmethodr"j0j"uhNhhh]r"(j2)r"}r"(hX$Context.set_session_timeout(timeout)hj"hXp/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_session_timeoutr "hj6h}r "(h]r "haj9j:XM2Crypto.SSL.Contextr "r "}r"bh]h]h]h]r"haj?XContext.set_session_timeoutr"j@jjAuhNhhh]r"(jW)r"}r"(hXset_session_timeouthj"hj "hjZh}r"(jHjIh]h]h]h]h]uhNhhh]r"hXset_session_timeoutr"r"}r"(hUhNhNhhhj"ubaubjj)r"}r"(hXtimeouthj"hj "hjmh}r"(jHjIh]h]h]h]h]uhNhhh]r"jp)r"}r"(hXtimeouth}r"(jHjIh]h]h]h]h]uhj"h]r "hXtimeoutr!"r""}r#"(hUhj"ubahjxubaubj`)r$"}r%"(hUhj"hNhjch}r&"(Uexprjeh]h]h]h]h]uhNhhh]r'"h)r("}r)"(hUh}r*"(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj"uhj$"h]r+"jm)r,"}r-"(hUh}r."(h]h]r/"jrah]h]h]uhj("h]r0"hX[source]r1"r2"}r3"(hUhj,"ubahjwubahhubaubeubjx)r4"}r5"(hUhj"hj "hj{h}r6"(h]h]h]h]h]uhNhhh]r7"(j)r8"}r9"(hXSet new session timeout.hj4"hXp/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_session_timeoutr:"hj h}r;"(h]h]h]h]h]uhKhhh]r<"hXSet new session timeout.r="r>"}r?"(hUhNhNhhhj8"ubaubj)r@"}rA"(hXGSee self.get_session_timeout() for explanation of the session timeouts.hj4"hj:"hj h}rB"(h]h]h]h]h]uhKhhh]rC"hXGSee self.get_session_timeout() for explanation of the session timeouts.rD"rE"}rF"(hUhNhNhhhj@"ubaubj)rG"}rH"(hUhj4"hNhjh}rI"(h]h]h]h]h]uhNhhh]rJ"(j")rK"}rL"(hUh}rM"(h]h]h]h]h]uhjG"h]rN"(j')rO"}rP"(hX ParametershjK"hj "hj*h}rQ"(h]h]h]h]h]uhKh]rR"hX ParametersrS"rT"}rU"(hUhjO"ubaubj0)rV"}rW"(hUh}rX"(h]h]h]h]h]uhjK"h]rY"j)rZ"}r["(hXtimeout -- new timeout value.h}r\"(h]h]h]h]h]uhjV"h]r]"(j )r^"}r_"(hXtimeouth}r`"(h]h]jh]h]h]uhjZ"h]ra"hXtimeoutrb"rc"}rd"(hUhj^"ubahjubhX – re"rf"}rg"(hUhjZ"ubhXnew timeout value.rh"ri"}rj"(hUhNhNhhhjZ"ubehj ubahj<ubehj=ubj")rk"}rl"(hUh}rm"(h]h]h]h]h]uhjG"h]rn"(j')ro"}rp"(hXReturnshjk"hj "hj*h}rq"(h]h]h]h]h]uhKh]rr"hXReturnsrs"rt"}ru"(hUhjo"ubaubj0)rv"}rw"(hUh}rx"(h]h]h]h]h]uhjk"h]ry"j)rz"}r{"(hX!the previously set timeout value.h}r|"(h]h]h]h]h]uhjv"h]r}"hX!the previously set timeout value.r~"r"}r"(hUhNhNhhhjz"ubahj ubahj<ubehj=ubeubeubeubh)r"}r"(hUhjShNhjh}r"(h]h]h]h]h]Uentries]r"(jX2set_tmp_dh() (M2Crypto.SSL.Context.Context method)hUNtr"auhNhhh]ubj')r"}r"(hUhjShNhj*h}r"(j,j-Xpyh]h]h]h]h]j.Xmethodr"j0j"uhNhhh]r"(j2)r"}r"(hXContext.set_tmp_dh(dhpfile)hj"hXg/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_tmp_dhr"hj6h}r"(h]r"haj9j:XM2Crypto.SSL.Contextr"r"}r"bh]h]h]h]r"haj?XContext.set_tmp_dhr"j@jjAuhNhhh]r"(jW)r"}r"(hX set_tmp_dhhj"hj"hjZh}r"(jHjIh]h]h]h]h]uhNhhh]r"hX set_tmp_dhr"r"}r"(hUhNhNhhhj"ubaubjj)r"}r"(hXdhpfilehj"hj"hjmh}r"(jHjIh]h]h]h]h]uhNhhh]r"jp)r"}r"(hXdhpfileh}r"(jHjIh]h]h]h]h]uhj"h]r"hXdhpfiler"r"}r"(hUhj"ubahjxubaubj`)r"}r"(hUhj"hNhjch}r"(Uexprjeh]h]h]h]h]uhNhhh]r"h)r"}r"(hUh}r"(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj"uhj"h]r"jm)r"}r"(hUh}r"(h]h]r"jrah]h]h]uhj"h]r"hX[source]r"r"}r"(hUhj"ubahjwubahhubaubeubjx)r"}r"(hUhj"hj"hj{h}r"(h]h]h]h]h]uhNhhh]r"(j)r"}r"(hX.Load ephemeral DH parameters into the context.hj"hXg/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_tmp_dhr"hj h}r"(h]h]h]h]h]uhKhhh]r"hX.Load ephemeral DH parameters into the context.r"r"}r"(hUhNhNhhhj"ubaubj)r"}r"(hUhj"hNhjh}r"(h]h]h]h]h]uhNhhh]r"j")r"}r"(hUh}r"(h]h]h]h]h]uhj"h]r"(j')r"}r"(hX Parametershj"hj"hj*h}r"(h]h]h]h]h]uhKh]r"hX Parametersr"r"}r"(hUhj"ubaubj0)r"}r"(hUh}r"(h]h]h]h]h]uhj"h]r"j)r"}r"(hXIdhpfile -- Filename of the file containing the PEM-encoded DH parameters.h}r"(h]h]h]h]h]uhj"h]r"(j )r"}r"(hXdhpfileh}r"(h]h]jh]h]h]uhj"h]r"hXdhpfiler"r"}r"(hUhj"ubahjubhX – r"r"}r"(hUhj"ubhX>Filename of the file containing the PEM-encoded DH parameters.r"r"}r"(hUhNhNhhhj"ubehj ubahj<ubehj=ubaubeubeubh)r"}r"(hUhjShNhjh}r"(h]h]h]h]h]Uentries]r"(jX;set_tmp_dh_callback() (M2Crypto.SSL.Context.Context method)hJUNtr"auhNhhh]ubj')r"}r"(hUhjShNhj*h}r"(j,j-Xpyh]h]h]h]h]j.Xmethodr"j0j"uhNhhh]r"(j2)r"}r"(hX*Context.set_tmp_dh_callback(callback=None)hj"hXp/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_tmp_dh_callbackr"hj6h}r"(h]r"hJaj9j:XM2Crypto.SSL.Contextr"r"}r"bh]h]h]h]r"hJaj?XContext.set_tmp_dh_callbackr"j@jjAuhNhhh]r"(jW)r"}r"(hXset_tmp_dh_callbackhj"hj"hjZh}r"(jHjIh]h]h]h]h]uhNhhh]r#hXset_tmp_dh_callbackr#r#}r#(hUhNhNhhhj"ubaubjj)r#}r#(hX callback=Nonehj"hj"hjmh}r#(jHjIh]h]h]h]h]uhNhhh]r#jp)r#}r #(hX callback=Noneh}r #(jHjIh]h]h]h]h]uhj#h]r #hX callback=Noner #r #}r#(hUhj#ubahjxubaubj`)r#}r#(hUhj"hNhjch}r#(Uexprjeh]h]h]h]h]uhNhhh]r#h)r#}r#(hUh}r#(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj"uhj#h]r#jm)r#}r#(hUh}r#(h]h]r#jrah]h]h]uhj#h]r#hX[source]r#r#}r#(hUhj#ubahjwubahhubaubeubjx)r#}r #(hUhj"hj"hj{h}r!#(h]h]h]h]h]uhNhhh]r"#(j)r##}r$#(hX+Sets the callback function for SSL.Context.hj#hXp/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_tmp_dh_callbackr%#hj h}r&#(h]h]h]h]h]uhKhhh]r'#hX+Sets the callback function for SSL.Context.r(#r)#}r*#(hUhNhNhhhj##ubaubj)r+#}r,#(hUhj#hNhjh}r-#(h]h]h]h]h]uhNhhh]r.#j")r/#}r0#(hUh}r1#(h]h]h]h]h]uhj+#h]r2#(j')r3#}r4#(hX Parametershj/#hj"hj*h}r5#(h]h]h]h]h]uhKh]r6#hX Parametersr7#r8#}r9#(hUhj3#ubaubj0)r:#}r;#(hUh}r<#(h]h]h]h]h]uhj/#h]r=#j)r>#}r?#(hXBcallback -- Callable to be used when a DH parameters are required.h}r@#(h]h]h]h]h]uhj:#h]rA#(j )rB#}rC#(hXcallbackh}rD#(h]h]jh]h]h]uhj>#h]rE#hXcallbackrF#rG#}rH#(hUhjB#ubahjubhX – rI#rJ#}rK#(hUhj>#ubhX6Callable to be used when a DH parameters are required.rL#rM#}rN#(hUhNhNhhhj>#ubehj ubahj<ubehj=ubaubeubeubh)rO#}rP#(hUhjShNhjh}rQ#(h]h]h]h]h]Uentries]rR#(jX3set_tmp_rsa() (M2Crypto.SSL.Context.Context method)hTUNtrS#auhNhhh]ubj')rT#}rU#(hUhjShNhj*h}rV#(j,j-Xpyh]h]h]h]h]j.XmethodrW#j0jW#uhNhhh]rX#(j2)rY#}rZ#(hXContext.set_tmp_rsa(rsa)hjT#hXh/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_tmp_rsar[#hj6h}r\#(h]r]#hTaj9j:XM2Crypto.SSL.Contextr^#r_#}r`#bh]h]h]h]ra#hTaj?XContext.set_tmp_rsarb#j@jjAuhNhhh]rc#(jW)rd#}re#(hX set_tmp_rsahjY#hj[#hjZh}rf#(jHjIh]h]h]h]h]uhNhhh]rg#hX set_tmp_rsarh#ri#}rj#(hUhNhNhhhjd#ubaubjj)rk#}rl#(hXrsahjY#hj[#hjmh}rm#(jHjIh]h]h]h]h]uhNhhh]rn#jp)ro#}rp#(hXrsah}rq#(jHjIh]h]h]h]h]uhjk#h]rr#hXrsars#rt#}ru#(hUhjo#ubahjxubaubj`)rv#}rw#(hUhjY#hNhjch}rx#(Uexprjeh]h]h]h]h]uhNhhh]ry#h)rz#}r{#(hUh}r|#(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidjb#uhjv#h]r}#jm)r~#}r#(hUh}r#(h]h]r#jrah]h]h]uhjz#h]r#hX[source]r#r#}r#(hUhj~#ubahjwubahhubaubeubjx)r#}r#(hUhjT#hj[#hj{h}r#(h]h]h]h]h]uhNhhh]r#(j)r#}r#(hX(Load ephemeral RSA key into the context.hj#hXh/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_tmp_rsar#hj h}r#(h]h]h]h]h]uhKhhh]r#hX(Load ephemeral RSA key into the context.r#r#}r#(hUhNhNhhhj#ubaubj)r#}r#(hUhj#hNhjh}r#(h]h]h]h]h]uhNhhh]r#j")r#}r#(hUh}r#(h]h]h]h]h]uhj#h]r#(j')r#}r#(hX Parametershj#hj[#hj*h}r#(h]h]h]h]h]uhKh]r#hX Parametersr#r#}r#(hUhj#ubaubj0)r#}r#(hUh}r#(h]h]h]h]h]uhj#h]r#j)r#}r#(hXrsa -- RSA.RSA instance.h}r#(h]h]h]h]h]uhj#h]r#(j )r#}r#(hXrsah}r#(h]h]jh]h]h]uhj#h]r#hXrsar#r#}r#(hUhj#ubahjubhX – r#r#}r#(hUhj#ubhXRSA.RSA instance.r#r#}r#(hUhNhNhhhj#ubehj ubahj<ubehj=ubaubeubeubh)r#}r#(hUhjShXq/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_tmp_rsa_callbackr#hjh}r#(h]h]h]h]h]Uentries]r#(jX<set_tmp_rsa_callback() (M2Crypto.SSL.Context.Context method)hUNtr#auhNhhh]ubj')r#}r#(hUhjShj#hj*h}r#(j,j-Xpyh]h]h]h]h]j.Xmethodr#j0j#uhNhhh]r#(j2)r#}r#(hX+Context.set_tmp_rsa_callback(callback=None)hj#hXq/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_tmp_rsa_callbackr#hj6h}r#(h]r#haj9j:XM2Crypto.SSL.Contextr#r#}r#bh]h]h]h]r#haj?XContext.set_tmp_rsa_callbackr#j@jjAuhNhhh]r#(jW)r#}r#(hXset_tmp_rsa_callbackhj#hj#hjZh}r#(jHjIh]h]h]h]h]uhNhhh]r#hXset_tmp_rsa_callbackr#r#}r#(hUhNhNhhhj#ubaubjj)r#}r#(hX callback=Nonehj#hj#hjmh}r#(jHjIh]h]h]h]h]uhNhhh]r#jp)r#}r#(hX callback=Noneh}r#(jHjIh]h]h]h]h]uhj#h]r#hX callback=Noner#r#}r#(hUhj#ubahjxubaubj`)r#}r#(hUhj#hNhjch}r#(Uexprjeh]h]h]h]h]uhNhhh]r#h)r#}r#(hUh}r#(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj#uhj#h]r#jm)r#}r#(hUh}r#(h]h]r#jrah]h]h]uhj#h]r#hX[source]r#r#}r#(hUhj#ubahjwubahhubaubeubjx)r#}r#(hUhj#hj#hj{h}r#(h]h]h]h]h]uhNhhh]r#j)r#}r#(hXUSets the callback function to be used when a temporary/ephemeral RSA key is required.hj#hj#hj h}r#(h]h]h]h]h]uhKhhh]r#hXUSets the callback function to be used when a temporary/ephemeral RSA key is required.r#r#}r#(hUhNhNhhhj#ubaubaubeubh)r#}r#(hUhjShNhjh}r#(h]h]h]h]h]Uentries]r#(jX2set_verify() (M2Crypto.SSL.Context.Context method)hlUNtr#auhNhhh]ubj')r#}r#(hUhjShNhj*h}r$(j,j-Xpyh]h]h]h]h]j.Xmethodr$j0j$uhNhhh]r$(j2)r$}r$(hX.Context.set_verify(mode, depth, callback=None)hj#hXg/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_verifyr$hj6h}r$(h]r$hlaj9j:XM2Crypto.SSL.Contextr$r $}r $bh]h]h]h]r $hlaj?XContext.set_verifyr $j@jjAuhNhhh]r $(jW)r$}r$(hX set_verifyhj$hj$hjZh}r$(jHjIh]h]h]h]h]uhNhhh]r$hX set_verifyr$r$}r$(hUhNhNhhhj$ubaubjj)r$}r$(hXmode, depth, callback=Nonehj$hj$hjmh}r$(jHjIh]h]h]h]h]uhNhhh]r$(jp)r$}r$(hXmodeh}r$(jHjIh]h]h]h]h]uhj$h]r$hXmoder$r$}r$(hUhj$ubahjxubjp)r $}r!$(hXdepthh}r"$(jHjIh]h]h]h]h]uhj$h]r#$hXdepthr$$r%$}r&$(hUhj $ubahjxubjp)r'$}r($(hX callback=Noneh}r)$(jHjIh]h]h]h]h]uhj$h]r*$hX callback=Noner+$r,$}r-$(hUhj'$ubahjxubeubj`)r.$}r/$(hUhj$hNhjch}r0$(Uexprjeh]h]h]h]h]uhNhhh]r1$h)r2$}r3$(hUh}r4$(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/ContextUrefidj $uhj.$h]r5$jm)r6$}r7$(hUh}r8$(h]h]r9$jrah]h]h]uhj2$h]r:$hX[source]r;$r<$}r=$(hUhj6$ubahjwubahhubaubeubjx)r>$}r?$(hUhj#hj$hj{h}r@$(h]h]h]h]h]uhNhhh]rA$(j)rB$}rC$(hX{Set verify options. Most applications will need to call this method with the right options to make a secure SSL connection.hj>$hXg/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.Context.set_verifyrD$hj h}rE$(h]h]h]h]h]uhKhhh]rF$hX{Set verify options. Most applications will need to call this method with the right options to make a secure SSL connection.rG$rH$}rI$(hUhNhNhhhjB$ubaubj)rJ$}rK$(hUhj>$hNhjh}rL$(h]h]h]h]h]uhNhhh]rM$j")rN$}rO$(hUh}rP$(h]h]h]h]h]uhjJ$h]rQ$(j')rR$}rS$(hX ParametershjN$hj$hj*h}rT$(h]h]h]h]h]uhKh]rU$hX ParametersrV$rW$}rX$(hUhjR$ubaubj0)rY$}rZ$(hUh}r[$(h]h]h]h]h]uhjN$h]r\$j` )r]$}r^$(hUh}r_$(h]h]h]h]h]uhjY$h]r`$(je )ra$}rb$(hUh}rc$(h]h]h]h]h]uhj]$h]rd$j)re$}rf$(hXmode -- 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.h}rg$(h]h]h]h]h]uhja$h]rh$(j )ri$}rj$(hXmodeh}rk$(h]h]jh]h]h]uhje$h]rl$hXmoderm$rn$}ro$(hUhji$ubahjubhX – rp$rq$}rr$(hUhje$ubhXThe verification mode to use. Typically at least SSL.verify_peer is used. Clients would also typically add SSL.verify_fail_if_no_peer_cert.rs$rt$}ru$(hUhNhNhhhje$ubehj ubahj{ ubje )rv$}rw$(hUh}rx$(h]h]h]h]h]uhj]$h]ry$j)rz$}r{$(hXQdepth -- The maximum allowed depth of the certificate chain returned by the peer.h}r|$(h]h]h]h]h]uhjv$h]r}$(j )r~$}r$(hXdepthh}r$(h]h]jh]h]h]uhjz$h]r$hXdepthr$r$}r$(hUhj~$ubahjubhX – r$r$}r$(hUhjz$ubhXHThe maximum allowed depth of the certificate chain returned by the peer.r$r$}r$(hUhNhNhhhjz$ubehj ubahj{ ubje )r$}r$(hUh}r$(h]h]h]h]h]uhj]$h]r$j)r$}r$(hXLcallback -- Callable that can be used to specify custom verification checks.h}r$(h]h]h]h]h]uhj$h]r$(j )r$}r$(hXcallbackh}r$(h]h]jh]h]h]uhj$h]r$hXcallbackr$r$}r$(hUhj$ubahjubhX – r$r$}r$(hUhj$ubhX@Callable that can be used to specify custom verification checks.r$r$}r$(hUhNhNhhhj$ubehj ubahj{ ubehj ubahj<ubehj=ubaubeubeubeubeubh)r$}r$(hUhjhNhjh}r$(h]h]h]h]h]Uentries]r$(jX&map() (in module M2Crypto.SSL.Context)hxUNtr$auhNhhh]ubj')r$}r$(hUhjhNhj*h}r$(j,j-Xpyh]h]h]h]h]j.Xfunctionr$j0j$uhNhhh]r$(j2)r$}r$(hXmap()hj$hXX/home/matej/Build/m2crypto/M2Crypto/SSL/Context.py:docstring of M2Crypto.SSL.Context.mapr$hj6h}r$(h]r$hxaj9j:XM2Crypto.SSL.Contextr$r$}r$bh]h]h]h]r$hxaj?Xmapr$j@UjAuhNhhh]r$(jN)r$}r$(hXM2Crypto.SSL.Context.hj$hj$hjQh}r$(jHjIh]h]h]h]h]uhNhhh]r$hXM2Crypto.SSL.Context.r$r$}r$(hUhNhNhhhj$ubaubjW)r$}r$(hj$hj$hj$hjZh}r$(jHjIh]h]h]h]h]uhNhhh]r$hXmapr$r$}r$(hUhNhNhhhj$ubaubjj)r$}r$(hUhj$hj$hjmh}r$(jHjIh]h]h]h]h]uhNhhh]ubeubjx)r$}r$(hUhj$hj$hj{h}r$(h]h]h]h]h]uhNhhh]ubeubeubh)r$}r$(hUhhhhhhh}r$(h]h]h]h]r$(Xmodule-M2Crypto.SSL.SSLServerr$Usslserver-moduler$eh]r$hGauhK-hhh]r$(h)r$}r$(hX:mod:`SSLServer` Moduler$hj$hhhhh}r$(h]h]h]h]h]uhK-hhh]r$(h)r$}r$(hX:mod:`SSLServer`r$hj$hhhhh}r$(UreftypeXmodhhX SSLServerU refdomainXpyr$h]h]U refexplicith]h]h]hhhNhXM2Crypto.SSL.Contextr$uhK,h]r$h)r$}r$(hj$h}r$(h]h]r$(hj$Xpy-modr$eh]h]h]uhj$h]r$hX SSLServerr$r$}r$(hUhj$ubahhubaubhX Moduler$r$}r$(hUhNhNhhhj$ubeubh)r$}r$(hUhj$hXb/home/matej/Build/m2crypto/M2Crypto/SSL/SSLServer.py:docstring of M2Crypto.SSL.SSLServer.SSLServerr$hjh}r$(h]h]h]h]h]Uentries]r$(jXM2Crypto.SSL.SSLServer (module)Xmodule-M2Crypto.SSL.SSLServerUNtr$auhKhhh]ubh)r$}r$(hUhj$hNhjh}r$(h]h]h]h]h]Uentries]r$(jX+SSLServer (class in M2Crypto.SSL.SSLServer)hQUNtr$auhNhhh]ubj')r$}r$(hUhj$hNhj*h}r$(j,j-Xpyh]h]h]h]h]j.Xclassr$j0j$uhNhhh]r$(j2)r$}r$(hXSSSLServer(server_address, RequestHandlerClass, ssl_context, bind_and_activate=True)hj$hXb/home/matej/Build/m2crypto/M2Crypto/SSL/SSLServer.py:docstring of M2Crypto.SSL.SSLServer.SSLServerr$hj6h}r$(h]r$hQaj9j:XM2Crypto.SSL.SSLServerr$r$}r%bh]h]h]h]r%hQaj?X SSLServerr%j@UjAuhNhhh]r%(jC)r%}r%(hXclass hj$hj$hjFh}r%(jHjIh]h]h]h]h]uhNhhh]r%hXclass r%r %}r %(hUhNhNhhhj%ubaubjN)r %}r %(hXM2Crypto.SSL.SSLServer.hj$hj$hjQh}r %(jHjIh]h]h]h]h]uhNhhh]r%hXM2Crypto.SSL.SSLServer.r%r%}r%(hUhNhNhhhj %ubaubjW)r%}r%(hj%hj$hj$hjZh}r%(jHjIh]h]h]h]h]uhNhhh]r%hX SSLServerr%r%}r%(hUhNhNhhhj%ubaubjj)r%}r%(hXHserver_address, RequestHandlerClass, ssl_context, bind_and_activate=Truehj$hj$hjmh}r%(jHjIh]h]h]h]h]uhNhhh]r%(jp)r%}r%(hXserver_addressh}r%(jHjIh]h]h]h]h]uhj%h]r %hXserver_addressr!%r"%}r#%(hUhj%ubahjxubjp)r$%}r%%(hXRequestHandlerClassh}r&%(jHjIh]h]h]h]h]uhj%h]r'%hXRequestHandlerClassr(%r)%}r*%(hUhj$%ubahjxubjp)r+%}r,%(hX ssl_contexth}r-%(jHjIh]h]h]h]h]uhj%h]r.%hX ssl_contextr/%r0%}r1%(hUhj+%ubahjxubjp)r2%}r3%(hXbind_and_activate=Trueh}r4%(jHjIh]h]h]h]h]uhj%h]r5%hXbind_and_activate=Truer6%r7%}r8%(hUhj2%ubahjxubeubj`)r9%}r:%(hUhj$hNhjch}r;%(Uexprjeh]h]h]h]h]uhNhhh]r<%h)r=%}r>%(hUh}r?%(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SSLServerUrefidj%uhj9%h]r@%jm)rA%}rB%(hUh}rC%(h]h]rD%jrah]h]h]uhj=%h]rE%hX[source]rF%rG%}rH%(hUhjA%ubahjwubahhubaubeubjx)rI%}rJ%(hUhj$hj$hj{h}rK%(h]h]h]h]h]uhNhhh]rL%(j)rM%}rN%(hX&Bases: :class:`SocketServer.TCPServer`hjI%hXb/home/matej/Build/m2crypto/M2Crypto/SSL/SSLServer.py:docstring of M2Crypto.SSL.SSLServer.SSLServerhj h}rO%(h]h]h]h]h]uhKhhh]rP%(hXBases: rQ%rR%}rS%(hUhNhNhhhjM%ubh)rT%}rU%(hX:class:`SocketServer.TCPServer`rV%hjM%hhhhh}rW%(UreftypeXclasshhXSocketServer.TCPServerU refdomainXpyrX%h]h]U refexplicith]h]h]hhhj%hXM2Crypto.SSL.SSLServerrY%uhKh]rZ%h)r[%}r\%(hjV%h}r]%(h]h]r^%(hjX%Xpy-classr_%eh]h]h]uhjT%h]r`%hXSocketServer.TCPServerra%rb%}rc%(hUhj[%ubahhubaubeubh)rd%}re%(hUhjI%hNhjh}rf%(h]h]h]h]h]Uentries]rg%(jX8handle_error() (M2Crypto.SSL.SSLServer.SSLServer method)h/UNtrh%auhNhhh]ubj')ri%}rj%(hUhjI%hNhj*h}rk%(j,j-Xpyh]h]h]h]h]j.Xmethodrl%j0jl%uhNhhh]rm%(j2)rn%}ro%(hX/SSLServer.handle_error(request, client_address)hji%hXo/home/matej/Build/m2crypto/M2Crypto/SSL/SSLServer.py:docstring of M2Crypto.SSL.SSLServer.SSLServer.handle_errorrp%hj6h}rq%(h]rr%h/aj9j:XM2Crypto.SSL.SSLServerrs%rt%}ru%bh]h]h]h]rv%h/aj?XSSLServer.handle_errorrw%j@j%jAuhNhhh]rx%(jW)ry%}rz%(hX handle_errorhjn%hjp%hjZh}r{%(jHjIh]h]h]h]h]uhNhhh]r|%hX handle_errorr}%r~%}r%(hUhNhNhhhjy%ubaubjj)r%}r%(hXrequest, client_addresshjn%hjp%hjmh}r%(jHjIh]h]h]h]h]uhNhhh]r%(jp)r%}r%(hXrequesth}r%(jHjIh]h]h]h]h]uhj%h]r%hXrequestr%r%}r%(hUhj%ubahjxubjp)r%}r%(hXclient_addressh}r%(jHjIh]h]h]h]h]uhj%h]r%hXclient_addressr%r%}r%(hUhj%ubahjxubeubj`)r%}r%(hUhjn%hNhjch}r%(Uexprjeh]h]h]h]h]uhNhhh]r%h)r%}r%(hUh}r%(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SSLServerUrefidjw%uhj%h]r%jm)r%}r%(hUh}r%(h]h]r%jrah]h]h]uhj%h]r%hX[source]r%r%}r%(hUhj%ubahjwubahhubaubeubjx)r%}r%(hUhji%hjp%hj{h}r%(h]h]h]h]h]uhNhhh]ubeubh)r%}r%(hUhjI%hNhjh}r%(h]h]h]h]h]Uentries]r%(jX:handle_request() (M2Crypto.SSL.SSLServer.SSLServer method)hUNtr%auhNhhh]ubj')r%}r%(hUhjI%hNhj*h}r%(j,j-Xpyh]h]h]h]h]j.Xmethodr%j0j%uhNhhh]r%(j2)r%}r%(hXSSLServer.handle_request()hj%hXq/home/matej/Build/m2crypto/M2Crypto/SSL/SSLServer.py:docstring of M2Crypto.SSL.SSLServer.SSLServer.handle_requestr%hj6h}r%(h]r%haj9j:XM2Crypto.SSL.SSLServerr%r%}r%bh]h]h]h]r%haj?XSSLServer.handle_requestr%j@j%jAuhNhhh]r%(jW)r%}r%(hXhandle_requesthj%hj%hjZh}r%(jHjIh]h]h]h]h]uhNhhh]r%hXhandle_requestr%r%}r%(hUhNhNhhhj%ubaubjj)r%}r%(hUhj%hj%hjmh}r%(jHjIh]h]h]h]h]uhNhhh]ubj`)r%}r%(hUhj%hNhjch}r%(Uexprjeh]h]h]h]h]uhNhhh]r%h)r%}r%(hUh}r%(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SSLServerUrefidj%uhj%h]r%jm)r%}r%(hUh}r%(h]h]r%jrah]h]h]uhj%h]r%hX[source]r%r%}r%(hUhj%ubahjwubahhubaubeubjx)r%}r%(hUhj%hj%hj{h}r%(h]h]h]h]h]uhNhhh]ubeubeubeubh)r%}r%(hUhj$hXi/home/matej/Build/m2crypto/M2Crypto/SSL/SSLServer.py:docstring of M2Crypto.SSL.SSLServer.ForkingSSLServerr%hjh}r%(h]h]h]h]h]Uentries]r%(jX2ForkingSSLServer (class in M2Crypto.SSL.SSLServer)hUNtr%auhNhhh]ubj')r%}r%(hUhj$hj%hj*h}r%(j,j-Xpyh]h]h]h]h]j.Xclassr%j0j%uhNhhh]r%(j2)r%}r%(hXZForkingSSLServer(server_address, RequestHandlerClass, ssl_context, bind_and_activate=True)hj%hXi/home/matej/Build/m2crypto/M2Crypto/SSL/SSLServer.py:docstring of M2Crypto.SSL.SSLServer.ForkingSSLServerr%hj6h}r%(h]r%haj9j:XM2Crypto.SSL.SSLServerr%r%}r%bh]h]h]h]r%haj?XForkingSSLServerr%j@UjAuhNhhh]r%(jC)r%}r%(hXclass hj%hj%hjFh}r%(jHjIh]h]h]h]h]uhNhhh]r%hXclass r%r%}r%(hUhNhNhhhj%ubaubjN)r%}r%(hXM2Crypto.SSL.SSLServer.hj%hj%hjQh}r%(jHjIh]h]h]h]h]uhNhhh]r%hXM2Crypto.SSL.SSLServer.r%r%}r%(hUhNhNhhhj%ubaubjW)r%}r%(hj%hj%hj%hjZh}r%(jHjIh]h]h]h]h]uhNhhh]r%hXForkingSSLServerr%r&}r&(hUhNhNhhhj%ubaubjj)r&}r&(hXHserver_address, RequestHandlerClass, ssl_context, bind_and_activate=Truehj%hj%hjmh}r&(jHjIh]h]h]h]h]uhNhhh]r&(jp)r&}r&(hXserver_addressh}r&(jHjIh]h]h]h]h]uhj&h]r &hXserver_addressr &r &}r &(hUhj&ubahjxubjp)r &}r&(hXRequestHandlerClassh}r&(jHjIh]h]h]h]h]uhj&h]r&hXRequestHandlerClassr&r&}r&(hUhj &ubahjxubjp)r&}r&(hX ssl_contexth}r&(jHjIh]h]h]h]h]uhj&h]r&hX ssl_contextr&r&}r&(hUhj&ubahjxubjp)r&}r&(hXbind_and_activate=Trueh}r&(jHjIh]h]h]h]h]uhj&h]r&hXbind_and_activate=Truer&r &}r!&(hUhj&ubahjxubeubj`)r"&}r#&(hUhj%hNhjch}r$&(Uexprjeh]h]h]h]h]uhNhhh]r%&h)r&&}r'&(hUh}r(&(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SSLServerUrefidj%uhj"&h]r)&jm)r*&}r+&(hUh}r,&(h]h]r-&jrah]h]h]uhj&&h]r.&hX[source]r/&r0&}r1&(hUhj*&ubahjwubahhubaubeubjx)r2&}r3&(hUhj%hj%hj{h}r4&(h]h]h]h]h]uhNhhh]r5&j)r6&}r7&(hXTBases: :class:`SocketServer.ForkingMixIn`, :class:`M2Crypto.SSL.SSLServer.SSLServer`hj2&hj%hj h}r8&(h]h]h]h]h]uhKhhh]r9&(hXBases: r:&r;&}r<&(hUhNhNhhhj6&ubh)r=&}r>&(hX":class:`SocketServer.ForkingMixIn`r?&hj6&hhhhh}r@&(UreftypeXclasshhXSocketServer.ForkingMixInU refdomainXpyrA&h]h]U refexplicith]h]h]hhhj%hjY%uhKh]rB&h)rC&}rD&(hj?&h}rE&(h]h]rF&(hjA&Xpy-classrG&eh]h]h]uhj=&h]rH&hXSocketServer.ForkingMixInrI&rJ&}rK&(hUhjC&ubahhubaubhX, rL&rM&}rN&(hUhNhNhhhj6&ubh)rO&}rP&(hX):class:`M2Crypto.SSL.SSLServer.SSLServer`rQ&hj6&hhhhh}rR&(UreftypeXclasshhX M2Crypto.SSL.SSLServer.SSLServerU refdomainXpyrS&h]h]U refexplicith]h]h]hhhj%hjY%uhKh]rT&h)rU&}rV&(hjQ&h}rW&(h]h]rX&(hjS&Xpy-classrY&eh]h]h]uhjO&h]rZ&hX M2Crypto.SSL.SSLServer.SSLServerr[&r\&}r]&(hUhjU&ubahhubaubeubaubeubh)r^&}r_&(hUhj$hXk/home/matej/Build/m2crypto/M2Crypto/SSL/SSLServer.py:docstring of M2Crypto.SSL.SSLServer.ThreadingSSLServerr`&hjh}ra&(h]h]h]h]h]Uentries]rb&(jX4ThreadingSSLServer (class in M2Crypto.SSL.SSLServer)hUNtrc&auhNhhh]ubj')rd&}re&(hUhj$hj`&hj*h}rf&(j,j-Xpyh]h]h]h]h]j.Xclassrg&j0jg&uhNhhh]rh&(j2)ri&}rj&(hX\ThreadingSSLServer(server_address, RequestHandlerClass, ssl_context, bind_and_activate=True)hjd&hXk/home/matej/Build/m2crypto/M2Crypto/SSL/SSLServer.py:docstring of M2Crypto.SSL.SSLServer.ThreadingSSLServerrk&hj6h}rl&(h]rm&haj9j:XM2Crypto.SSL.SSLServerrn&ro&}rp&bh]h]h]h]rq&haj?XThreadingSSLServerrr&j@UjAuhNhhh]rs&(jC)rt&}ru&(hXclass hji&hjk&hjFh}rv&(jHjIh]h]h]h]h]uhNhhh]rw&hXclass rx&ry&}rz&(hUhNhNhhhjt&ubaubjN)r{&}r|&(hXM2Crypto.SSL.SSLServer.hji&hjk&hjQh}r}&(jHjIh]h]h]h]h]uhNhhh]r~&hXM2Crypto.SSL.SSLServer.r&r&}r&(hUhNhNhhhj{&ubaubjW)r&}r&(hjr&hji&hjk&hjZh}r&(jHjIh]h]h]h]h]uhNhhh]r&hXThreadingSSLServerr&r&}r&(hUhNhNhhhj&ubaubjj)r&}r&(hXHserver_address, RequestHandlerClass, ssl_context, bind_and_activate=Truehji&hjk&hjmh}r&(jHjIh]h]h]h]h]uhNhhh]r&(jp)r&}r&(hXserver_addressh}r&(jHjIh]h]h]h]h]uhj&h]r&hXserver_addressr&r&}r&(hUhj&ubahjxubjp)r&}r&(hXRequestHandlerClassh}r&(jHjIh]h]h]h]h]uhj&h]r&hXRequestHandlerClassr&r&}r&(hUhj&ubahjxubjp)r&}r&(hX ssl_contexth}r&(jHjIh]h]h]h]h]uhj&h]r&hX ssl_contextr&r&}r&(hUhj&ubahjxubjp)r&}r&(hXbind_and_activate=Trueh}r&(jHjIh]h]h]h]h]uhj&h]r&hXbind_and_activate=Truer&r&}r&(hUhj&ubahjxubeubj`)r&}r&(hUhji&hNhjch}r&(Uexprjeh]h]h]h]h]uhNhhh]r&h)r&}r&(hUh}r&(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SSLServerUrefidjr&uhj&h]r&jm)r&}r&(hUh}r&(h]h]r&jrah]h]h]uhj&h]r&hX[source]r&r&}r&(hUhj&ubahjwubahhubaubeubjx)r&}r&(hUhjd&hjk&hj{h}r&(h]h]h]h]h]uhNhhh]r&j)r&}r&(hXVBases: :class:`SocketServer.ThreadingMixIn`, :class:`M2Crypto.SSL.SSLServer.SSLServer`hj&hj`&hj h}r&(h]h]h]h]h]uhKhhh]r&(hXBases: r&r&}r&(hUhNhNhhhj&ubh)r&}r&(hX$:class:`SocketServer.ThreadingMixIn`r&hj&hhhhh}r&(UreftypeXclasshhXSocketServer.ThreadingMixInU refdomainXpyr&h]h]U refexplicith]h]h]hhhjr&hjY%uhKh]r&h)r&}r&(hj&h}r&(h]h]r&(hj&Xpy-classr&eh]h]h]uhj&h]r&hXSocketServer.ThreadingMixInr&r&}r&(hUhj&ubahhubaubhX, r&r&}r&(hUhNhNhhhj&ubh)r&}r&(hX):class:`M2Crypto.SSL.SSLServer.SSLServer`r&hj&hhhhh}r&(UreftypeXclasshhX M2Crypto.SSL.SSLServer.SSLServerU refdomainXpyr&h]h]U refexplicith]h]h]hhhjr&hjY%uhKh]r&h)r&}r&(hj&h}r&(h]h]r&(hj&Xpy-classr&eh]h]h]uhj&h]r&hX M2Crypto.SSL.SSLServer.SSLServerr&r&}r&(hUhj&ubahhubaubeubaubeubeubh)r&}r&(hUhhhhhhh}r&(h]h]h]h]r&(Xmodule-M2Crypto.SSL.Sessionr&Usession-moduler&eh]r&hauhK5hhh]r&(h)r&}r&(hX:mod:`Session` Moduler&hj&hhhhh}r&(h]h]h]h]h]uhK5hhh]r&(h)r&}r&(hX:mod:`Session`r&hj&hhhhh}r&(UreftypeXmodhhXSessionU refdomainXpyr&h]h]U refexplicith]h]h]hhhNhjY%uhK4h]r&h)r&}r&(hj&h}r&(h]h]r&(hj&Xpy-modr&eh]h]h]uhj&h]r&hXSessionr&r&}r'(hUhj&ubahhubaubhX Moduler'r'}r'(hUhNhNhhhj&ubeubh)r'}r'(hUhj&hXT/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Sessionr'hjh}r'(h]h]h]h]h]Uentries]r'(jXM2Crypto.SSL.Session (module)Xmodule-M2Crypto.SSL.SessionUNtr 'auhKhhh]ubj)r '}r '(hX SSL Sessionhj&hXT/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Sessionr 'hj h}r '(h]h]h]h]h]uhKhhh]r'hX SSL Sessionr'r'}r'(hUhNhNhhhj 'ubaubj)r'}r'(hX<Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.hj&hj 'hj h}r'(h]h]h]h]h]uhKhhh]r'hX<Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.r'r'}r'(hUhNhNhhhj'ubaubh)r'}r'(hUhj&hNhjh}r'(h]h]h]h]h]Uentries]r'(jX'Session (class in M2Crypto.SSL.Session)hUNtr'auhNhhh]ubj')r'}r'(hUhj&hNhj*h}r '(j,j-Xpyh]h]h]h]h]j.Xclassr!'j0j!'uhNhhh]r"'(j2)r#'}r$'(hXSession(session, _pyfree=0)hj'hX\/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Session.Sessionr%'hj6h}r&'(h]r''haj9j:XM2Crypto.SSL.Sessionr('r)'}r*'bh]h]h]h]r+'haj?XSessionr,'j@UjAuhNhhh]r-'(jC)r.'}r/'(hXclass hj#'hj%'hjFh}r0'(jHjIh]h]h]h]h]uhNhhh]r1'hXclass r2'r3'}r4'(hUhNhNhhhj.'ubaubjN)r5'}r6'(hXM2Crypto.SSL.Session.hj#'hj%'hjQh}r7'(jHjIh]h]h]h]h]uhNhhh]r8'hXM2Crypto.SSL.Session.r9'r:'}r;'(hUhNhNhhhj5'ubaubjW)r<'}r='(hj,'hj#'hj%'hjZh}r>'(jHjIh]h]h]h]h]uhNhhh]r?'hXSessionr@'rA'}rB'(hUhNhNhhhj<'ubaubjj)rC'}rD'(hXsession, _pyfree=0hj#'hj%'hjmh}rE'(jHjIh]h]h]h]h]uhNhhh]rF'(jp)rG'}rH'(hXsessionh}rI'(jHjIh]h]h]h]h]uhjC'h]rJ'hXsessionrK'rL'}rM'(hUhjG'ubahjxubjp)rN'}rO'(hX _pyfree=0h}rP'(jHjIh]h]h]h]h]uhjC'h]rQ'hX _pyfree=0rR'rS'}rT'(hUhjN'ubahjxubeubj`)rU'}rV'(hUhj#'hNhjch}rW'(Uexprjeh]h]h]h]h]uhNhhh]rX'h)rY'}rZ'(hUh}r['(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SessionUrefidj,'uhjU'h]r\'jm)r]'}r^'(hUh}r_'(h]h]r`'jrah]h]h]uhjY'h]ra'hX[source]rb'rc'}rd'(hUhj]'ubahjwubahhubaubeubjx)re'}rf'(hUhj'hj%'hj{h}rg'(h]h]h]h]h]uhNhhh]rh'(h)ri'}rj'(hUhje'hNhjh}rk'(h]h]h]h]h]Uentries]rl'(jX.as_der() (M2Crypto.SSL.Session.Session method)hYUNtrm'auhNhhh]ubj')rn'}ro'(hUhje'hNhj*h}rp'(j,j-Xpyh]h]h]h]h]j.Xmethodrq'j0jq'uhNhhh]rr'(j2)rs'}rt'(hXSession.as_der()hjn'hXc/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Session.Session.as_derru'hj6h}rv'(h]rw'hYaj9j:XM2Crypto.SSL.Sessionrx'ry'}rz'bh]h]h]h]r{'hYaj?XSession.as_derr|'j@j,'jAuhNhhh]r}'(jW)r~'}r'(hXas_derhjs'hju'hjZh}r'(jHjIh]h]h]h]h]uhNhhh]r'hXas_derr'r'}r'(hUhNhNhhhj~'ubaubjj)r'}r'(hUhjs'hju'hjmh}r'(jHjIh]h]h]h]h]uhNhhh]ubj`)r'}r'(hUhjs'hNhjch}r'(Uexprjeh]h]h]h]h]uhNhhh]r'h)r'}r'(hUh}r'(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SessionUrefidj|'uhj'h]r'jm)r'}r'(hUh}r'(h]h]r'jrah]h]h]uhj'h]r'hX[source]r'r'}r'(hUhj'ubahjwubahhubaubeubjx)r'}r'(hUhjn'hju'hj{h}r'(h]h]h]h]h]uhNhhh]ubeubh)r'}r'(hUhje'hNhjh}r'(h]h]h]h]h]Uentries]r'(jX/as_text() (M2Crypto.SSL.Session.Session method)hUNtr'auhNhhh]ubj')r'}r'(hUhje'hNhj*h}r'(j,j-Xpyh]h]h]h]h]j.Xmethodr'j0j'uhNhhh]r'(j2)r'}r'(hXSession.as_text()hj'hXd/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Session.Session.as_textr'hj6h}r'(h]r'haj9j:XM2Crypto.SSL.Sessionr'r'}r'bh]h]h]h]r'haj?XSession.as_textr'j@j,'jAuhNhhh]r'(jW)r'}r'(hXas_texthj'hj'hjZh}r'(jHjIh]h]h]h]h]uhNhhh]r'hXas_textr'r'}r'(hUhNhNhhhj'ubaubjj)r'}r'(hUhj'hj'hjmh}r'(jHjIh]h]h]h]h]uhNhhh]ubj`)r'}r'(hUhj'hNhjch}r'(Uexprjeh]h]h]h]h]uhNhhh]r'h)r'}r'(hUh}r'(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SessionUrefidj'uhj'h]r'jm)r'}r'(hUh}r'(h]h]r'jrah]h]h]uhj'h]r'hX[source]r'r'}r'(hUhj'ubahjwubahhubaubeubjx)r'}r'(hUhj'hj'hj{h}r'(h]h]h]h]h]uhNhhh]ubeubh)r'}r'(hUhje'hNhjh}r'(h]h]h]h]h]Uentries]r'(jX0get_time() (M2Crypto.SSL.Session.Session method)h`UNtr'auhNhhh]ubj')r'}r'(hUhje'hNhj*h}r'(j,j-Xpyh]h]h]h]h]j.Xmethodr'j0j'uhNhhh]r'(j2)r'}r'(hXSession.get_time()hj'hXe/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Session.Session.get_timer'hj6h}r'(h]r'h`aj9j:XM2Crypto.SSL.Sessionr'r'}r'bh]h]h]h]r'h`aj?XSession.get_timer'j@j,'jAuhNhhh]r'(jW)r'}r'(hXget_timehj'hj'hjZh}r'(jHjIh]h]h]h]h]uhNhhh]r'hXget_timer'r'}r'(hUhNhNhhhj'ubaubjj)r'}r'(hUhj'hj'hjmh}r'(jHjIh]h]h]h]h]uhNhhh]ubj`)r'}r'(hUhj'hNhjch}r'(Uexprjeh]h]h]h]h]uhNhhh]r'h)r'}r'(hUh}r'(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SessionUrefidj'uhj'h]r'jm)r'}r'(hUh}r'(h]h]r'jrah]h]h]uhj'h]r'hX[source]r'r'}r'(hUhj'ubahjwubahhubaubeubjx)r'}r'(hUhj'hj'hj{h}r'(h]h]h]h]h]uhNhhh]ubeubh)r'}r((hUhje'hNhjh}r((h]h]h]h]h]Uentries]r((jX3get_timeout() (M2Crypto.SSL.Session.Session method)hUNtr(auhNhhh]ubj')r(}r((hUhje'hNhj*h}r((j,j-Xpyh]h]h]h]h]j.Xmethodr(j0j(uhNhhh]r((j2)r (}r ((hXSession.get_timeout()hj(hXh/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Session.Session.get_timeoutr (hj6h}r ((h]r (haj9j:XM2Crypto.SSL.Sessionr(r(}r(bh]h]h]h]r(haj?XSession.get_timeoutr(j@j,'jAuhNhhh]r((jW)r(}r((hX get_timeouthj (hj (hjZh}r((jHjIh]h]h]h]h]uhNhhh]r(hX get_timeoutr(r(}r((hUhNhNhhhj(ubaubjj)r(}r((hUhj (hj (hjmh}r((jHjIh]h]h]h]h]uhNhhh]ubj`)r(}r((hUhj (hNhjch}r ((Uexprjeh]h]h]h]h]uhNhhh]r!(h)r"(}r#((hUh}r$((UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SessionUrefidj(uhj(h]r%(jm)r&(}r'((hUh}r(((h]h]r)(jrah]h]h]uhj"(h]r*(hX[source]r+(r,(}r-((hUhj&(ubahjwubahhubaubeubjx)r.(}r/((hUhj(hj (hj{h}r0((h]h]h]h]h]uhNhhh]ubeubh)r1(}r2((hUhje'hNhjh}r3((h]h]h]h]h]Uentries]r4((jX;m2_ssl_session_free() (M2Crypto.SSL.Session.Session method)h"UNtr5(auhNhhh]ubj')r6(}r7((hUhje'hNhj*h}r8((j,j-Xpyh]h]h]h]h]j.Xmethodr9(j0j9(uhNhhh]r:((j2)r;(}r<((hXSession.m2_ssl_session_freehj6(hXp/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Session.Session.m2_ssl_session_freer=(hj6h}r>((h]r?(h"aj9j:XM2Crypto.SSL.Sessionr@(rA(}rB(bh]h]h]h]rC(h"aj?XSession.m2_ssl_session_freej@j,'jAuhNhhh]rD((jW)rE(}rF((hXm2_ssl_session_freehj;(hj=(hjZh}rG((jHjIh]h]h]h]h]uhNhhh]rH(hXm2_ssl_session_freerI(rJ(}rK((hUhNhNhhhjE(ubaubjj)rL(}rM((hUhj;(hj=(hjmh}rN((jHjIh]h]h]h]h]uhNhhh]ubeubjx)rO(}rP((hUhj6(hj=(hj{h}rQ((h]h]h]h]h]uhNhhh]ubeubh)rR(}rS((hUhje'hNhjh}rT((h]h]h]h]h]Uentries]rU((jX0set_time() (M2Crypto.SSL.Session.Session method)hUNtrV(auhNhhh]ubj')rW(}rX((hUhje'hNhj*h}rY((j,j-Xpyh]h]h]h]h]j.XmethodrZ(j0jZ(uhNhhh]r[((j2)r\(}r]((hXSession.set_time(t)hjW(hXe/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Session.Session.set_timer^(hj6h}r_((h]r`(haj9j:XM2Crypto.SSL.Sessionra(rb(}rc(bh]h]h]h]rd(haj?XSession.set_timere(j@j,'jAuhNhhh]rf((jW)rg(}rh((hXset_timehj\(hj^(hjZh}ri((jHjIh]h]h]h]h]uhNhhh]rj(hXset_timerk(rl(}rm((hUhNhNhhhjg(ubaubjj)rn(}ro((hXthj\(hj^(hjmh}rp((jHjIh]h]h]h]h]uhNhhh]rq(jp)rr(}rs((hXth}rt((jHjIh]h]h]h]h]uhjn(h]ru(hXtrv(}rw((hUhjr(ubahjxubaubj`)rx(}ry((hUhj\(hNhjch}rz((Uexprjeh]h]h]h]h]uhNhhh]r{(h)r|(}r}((hUh}r~((UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SessionUrefidje(uhjx(h]r(jm)r(}r((hUh}r((h]h]r(jrah]h]h]uhj|(h]r(hX[source]r(r(}r((hUhj(ubahjwubahhubaubeubjx)r(}r((hUhjW(hj^(hj{h}r((h]h]h]h]h]uhNhhh]ubeubh)r(}r((hUhje'hNhjh}r((h]h]h]h]h]Uentries]r((jX3set_timeout() (M2Crypto.SSL.Session.Session method)hUNtr(auhNhhh]ubj')r(}r((hUhje'hNhj*h}r((j,j-Xpyh]h]h]h]h]j.Xmethodr(j0j(uhNhhh]r((j2)r(}r((hXSession.set_timeout(t)hj(hXh/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Session.Session.set_timeoutr(hj6h}r((h]r(haj9j:XM2Crypto.SSL.Sessionr(r(}r(bh]h]h]h]r(haj?XSession.set_timeoutr(j@j,'jAuhNhhh]r((jW)r(}r((hX set_timeouthj(hj(hjZh}r((jHjIh]h]h]h]h]uhNhhh]r(hX set_timeoutr(r(}r((hUhNhNhhhj(ubaubjj)r(}r((hXthj(hj(hjmh}r((jHjIh]h]h]h]h]uhNhhh]r(jp)r(}r((hXth}r((jHjIh]h]h]h]h]uhj(h]r(hXtr(}r((hUhj(ubahjxubaubj`)r(}r((hUhj(hNhjch}r((Uexprjeh]h]h]h]h]uhNhhh]r(h)r(}r((hUh}r((UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SessionUrefidj(uhj(h]r(jm)r(}r((hUh}r((h]h]r(jrah]h]h]uhj(h]r(hX[source]r(r(}r((hUhj(ubahjwubahhubaubeubjx)r(}r((hUhj(hj(hj{h}r((h]h]h]h]h]uhNhhh]ubeubh)r(}r((hUhje'hNhjh}r((h]h]h]h]h]Uentries]r((jX1write_bio() (M2Crypto.SSL.Session.Session method)hIUNtr(auhNhhh]ubj')r(}r((hUhje'hNhj*h}r((j,j-Xpyh]h]h]h]h]j.Xmethodr(j0j(uhNhhh]r((j2)r(}r((hXSession.write_bio(bio)hj(hXf/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Session.Session.write_bior(hj6h}r((h]r(hIaj9j:XM2Crypto.SSL.Sessionr(r(}r(bh]h]h]h]r(hIaj?XSession.write_bior(j@j,'jAuhNhhh]r((jW)r(}r((hX write_biohj(hj(hjZh}r((jHjIh]h]h]h]h]uhNhhh]r(hX write_bior(r(}r((hUhNhNhhhj(ubaubjj)r(}r((hXbiohj(hj(hjmh}r((jHjIh]h]h]h]h]uhNhhh]r(jp)r(}r((hXbioh}r((jHjIh]h]h]h]h]uhj(h]r(hXbior(r(}r((hUhj(ubahjxubaubj`)r(}r((hUhj(hNhjch}r((Uexprjeh]h]h]h]h]uhNhhh]r(h)r(}r((hUh}r((UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SessionUrefidj(uhj(h]r(jm)r(}r((hUh}r((h]h]r(jrah]h]h]uhj(h]r(hX[source]r(r(}r((hUhj(ubahjwubahhubaubeubjx)r(}r((hUhj(hj(hj{h}r((h]h]h]h]h]uhNhhh]ubeubeubeubh)r(}r((hUhj&hNhjh}r)(h]h]h]h]h]Uentries]r)(jX/load_session() (in module M2Crypto.SSL.Session)hUNtr)auhNhhh]ubj')r)}r)(hUhj&hNhj*h}r)(j,j-Xpyh]h]h]h]h]j.Xfunctionr)j0j)uhNhhh]r)(j2)r)}r )(hXload_session(pemfile)hj)hXa/home/matej/Build/m2crypto/M2Crypto/SSL/Session.py:docstring of M2Crypto.SSL.Session.load_sessionr )hj6h}r )(h]r )haj9j:XM2Crypto.SSL.Sessionr )r)}r)bh]h]h]h]r)haj?X load_sessionr)j@UjAuhNhhh]r)(jN)r)}r)(hXM2Crypto.SSL.Session.hj)hj )hjQh}r)(jHjIh]h]h]h]h]uhNhhh]r)hXM2Crypto.SSL.Session.r)r)}r)(hUhNhNhhhj)ubaubjW)r)}r)(hj)hj)hj )hjZh}r)(jHjIh]h]h]h]h]uhNhhh]r)hX load_sessionr)r)}r )(hUhNhNhhhj)ubaubjj)r!)}r")(hXpemfilehj)hj )hjmh}r#)(jHjIh]h]h]h]h]uhNhhh]r$)jp)r%)}r&)(hXpemfileh}r')(jHjIh]h]h]h]h]uhj!)h]r()hXpemfiler))r*)}r+)(hUhj%)ubahjxubaubj`)r,)}r-)(hUhj)hNhjch}r.)(Uexprjeh]h]h]h]h]uhNhhh]r/)h)r0)}r1)(hUh}r2)(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/SessionUrefidj)uhj,)h]r3)jm)r4)}r5)(hUh}r6)(h]h]r7)jrah]h]h]uhj0)h]r8)hX[source]r9)r:)}r;)(hUhj4)ubahjwubahhubaubeubjx)r<)}r=)(hUhj)hj )hj{h}r>)(h]h]h]h]h]uhNhhh]ubeubeubh)r?)}r@)(hUhhhhhhh}rA)(h]h]h]h]rB)(X*module-M2Crypto.SSL.TwistedProtocolWrapperrC)Utwistedprotocolwrapper-modulerD)eh]rE)hauhK=hhh]rF)(h)rG)}rH)(hX$:mod:`TwistedProtocolWrapper` ModulerI)hj?)hhhhh}rJ)(h]h]h]h]h]uhK=hhh]rK)(h)rL)}rM)(hX:mod:`TwistedProtocolWrapper`rN)hjG)hhhhh}rO)(UreftypeXmodhhXTwistedProtocolWrapperU refdomainXpyrP)h]h]U refexplicith]h]h]hhhNhXM2Crypto.SSL.SessionrQ)uhK, postConnectionCheck=)hj)hX}/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.connectSSLr)hj6h}r)(h]r)hLaj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr)r)}r)bh]h]h]h]r)hLaj?X connectSSLr)j@UjAuhNhhh]r)(jN)r)}r)(hX$M2Crypto.SSL.TwistedProtocolWrapper.hj)hj)hjQh}r)(jHjIh]h]h]h]h]uhNhhh]r)hX$M2Crypto.SSL.TwistedProtocolWrapper.r)r)}r)(hUhNhNhhhj)ubaubjW)r)}r)(hj)hj)hj)hjZh}r)(jHjIh]h]h]h]h]uhNhhh]r)hX connectSSLr)r)}r)(hUhNhNhhhj)ubaubjj)r)}r)(hXhost, port, factory, contextFactory, timeout=30, bindAddress=None, reactor=, postConnectionCheck=hj)hj)hjmh}r)(jHjIh]h]h]h]h]uhNhhh]r)(jp)r)}r)(hXhosth}r)(jHjIh]h]h]h]h]uhj)h]r)hXhostr)r)}r)(hUhj)ubahjxubjp)r)}r)(hXporth}r)(jHjIh]h]h]h]h]uhj)h]r)hXportr)r)}r)(hUhj)ubahjxubjp)r)}r)(hXfactoryh}r)(jHjIh]h]h]h]h]uhj)h]r)hXfactoryr)r)}r)(hUhj)ubahjxubjp)r)}r)(hXcontextFactoryh}r)(jHjIh]h]h]h]h]uhj)h]r)hXcontextFactoryr)r)}r)(hUhj)ubahjxubjp)r)}r)(hX timeout=30h}r)(jHjIh]h]h]h]h]uhj)h]r)hX timeout=30r)r)}r)(hUhj)ubahjxubjp)r)}r)(hXbindAddress=Noneh}r)(jHjIh]h]h]h]h]uhj)h]r)hXbindAddress=Noner)r)}r)(hUhj)ubahjxubjp)r)}r)(hX;reactor=h}r)(jHjIh]h]h]h]h]uhj)h]r)hX;reactor=r)r)}r)(hUhj)ubahjxubjp)r)}r)(hX;postConnectionCheck=h}r)(jHjIh]h]h]h]h]uhj)h]r)hX;postConnectionCheck=r)r)}r)(hUhj)ubahjxubeubj`)r)}r)(hUhj)hNhjch}r)(Uexprjeh]h]h]h]h]uhNhhh]r)h)r)}r)(hUh}r)(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj)uhj)h]r)jm)r)}r)(hUh}r)(h]h]r)jrah]h]h]uhj)h]r)hX[source]r)r)}r)(hUhj)ubahjwubahhubaubeubjx)r)}r)(hUhj)hj)hj{h}r)(h]h]h]h]h]uhNhhh]r)(j)r)}r)(hXDA convenience function to start an SSL/TLS connection using Twisted.hj)hj~)hj h}r)(h]h]h]h]h]uhKhhh]r)hXDA convenience function to start an SSL/TLS connection using Twisted.r)r)}r)(hUhNhNhhhj)ubaubj)r)}r)(hX%See IReactorSSL interface in Twisted.hj)hj~)hj h}r)(h]h]h]h]h]uhKhhh]r)hX%See IReactorSSL interface in Twisted.r)r)}r)(hUhNhNhhhj)ubaubeubeubh)r)}r)(hUhj?)hX}/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.connectTCPr*hjh}r*(h]h]h]h]h]Uentries]r*(jX<connectTCP() (in module M2Crypto.SSL.TwistedProtocolWrapper)hUNtr*auhNhhh]ubj')r*}r*(hUhj?)hj*hj*h}r*(j,j-Xpyh]h]h]h]h]j.Xfunctionr*j0j*uhNhhh]r*(j2)r *}r *(hXconnectTCP(host, port, factory, timeout=30, bindAddress=None, reactor=, postConnectionCheck=)hj*hX}/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.connectTCPr *hj6h}r *(h]r *haj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr*r*}r*bh]h]h]h]r*haj?X connectTCPr*j@UjAuhNhhh]r*(jN)r*}r*(hX$M2Crypto.SSL.TwistedProtocolWrapper.hj *hj *hjQh}r*(jHjIh]h]h]h]h]uhNhhh]r*hX$M2Crypto.SSL.TwistedProtocolWrapper.r*r*}r*(hUhNhNhhhj*ubaubjW)r*}r*(hj*hj *hj *hjZh}r*(jHjIh]h]h]h]h]uhNhhh]r*hX connectTCPr*r *}r!*(hUhNhNhhhj*ubaubjj)r"*}r#*(hXhost, port, factory, timeout=30, bindAddress=None, reactor=, postConnectionCheck=hj *hj *hjmh}r$*(jHjIh]h]h]h]h]uhNhhh]r%*(jp)r&*}r'*(hXhosth}r(*(jHjIh]h]h]h]h]uhj"*h]r)*hXhostr**r+*}r,*(hUhj&*ubahjxubjp)r-*}r.*(hXporth}r/*(jHjIh]h]h]h]h]uhj"*h]r0*hXportr1*r2*}r3*(hUhj-*ubahjxubjp)r4*}r5*(hXfactoryh}r6*(jHjIh]h]h]h]h]uhj"*h]r7*hXfactoryr8*r9*}r:*(hUhj4*ubahjxubjp)r;*}r<*(hX timeout=30h}r=*(jHjIh]h]h]h]h]uhj"*h]r>*hX timeout=30r?*r@*}rA*(hUhj;*ubahjxubjp)rB*}rC*(hXbindAddress=Noneh}rD*(jHjIh]h]h]h]h]uhj"*h]rE*hXbindAddress=NonerF*rG*}rH*(hUhjB*ubahjxubjp)rI*}rJ*(hX;reactor=h}rK*(jHjIh]h]h]h]h]uhj"*h]rL*hX;reactor=rM*rN*}rO*(hUhjI*ubahjxubjp)rP*}rQ*(hX;postConnectionCheck=h}rR*(jHjIh]h]h]h]h]uhj"*h]rS*hX;postConnectionCheck=rT*rU*}rV*(hUhjP*ubahjxubeubj`)rW*}rX*(hUhj *hNhjch}rY*(Uexprjeh]h]h]h]h]uhNhhh]rZ*h)r[*}r\*(hUh}r]*(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj*uhjW*h]r^*jm)r_*}r`*(hUh}ra*(h]h]rb*jrah]h]h]uhj[*h]rc*hX[source]rd*re*}rf*(hUhj_*ubahjwubahhubaubeubjx)rg*}rh*(hUhj*hj *hj{h}ri*(h]h]h]h]h]uhNhhh]rj*(j)rk*}rl*(hX?A convenience function to start a TCP connection using Twisted.hjg*hj*hj h}rm*(h]h]h]h]h]uhKhhh]rn*hX?A convenience function to start a TCP connection using Twisted.ro*rp*}rq*(hUhNhNhhhjk*ubaubj)rr*}rs*(hX:NOTE: You must call startTLS(ctx) to go into SSL/TLS mode.hjg*hj*hj h}rt*(h]h]h]h]h]uhKhhh]ru*hX:NOTE: You must call startTLS(ctx) to go into SSL/TLS mode.rv*rw*}rx*(hUhNhNhhhjr*ubaubj)ry*}rz*(hX%See IReactorTCP interface in Twisted.hjg*hj*hj h}r{*(h]h]h]h]h]uhKhhh]r|*hX%See IReactorTCP interface in Twisted.r}*r~*}r*(hUhNhNhhhjy*ubaubeubeubh)r*}r*(hUhj?)hX|/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.listenSSLr*hjh}r*(h]h]h]h]h]Uentries]r*(jX;listenSSL() (in module M2Crypto.SSL.TwistedProtocolWrapper)hUNtr*auhNhhh]ubj')r*}r*(hUhj?)hj*hj*h}r*(j,j-Xpyh]h]h]h]h]j.Xfunctionr*j0j*uhNhhh]r*(j2)r*}r*(hXlistenSSL(port, factory, contextFactory, backlog=5, interface='', reactor=, postConnectionCheck=)hj*hX|/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.listenSSLr*hj6h}r*(h]r*haj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr*r*}r*bh]h]h]h]r*haj?X listenSSLr*j@UjAuhNhhh]r*(jN)r*}r*(hX$M2Crypto.SSL.TwistedProtocolWrapper.hj*hj*hjQh}r*(jHjIh]h]h]h]h]uhNhhh]r*hX$M2Crypto.SSL.TwistedProtocolWrapper.r*r*}r*(hUhNhNhhhj*ubaubjW)r*}r*(hj*hj*hj*hjZh}r*(jHjIh]h]h]h]h]uhNhhh]r*hX listenSSLr*r*}r*(hUhNhNhhhj*ubaubjj)r*}r*(hXport, factory, contextFactory, backlog=5, interface='', reactor=, postConnectionCheck=hj*hj*hjmh}r*(jHjIh]h]h]h]h]uhNhhh]r*(jp)r*}r*(hXporth}r*(jHjIh]h]h]h]h]uhj*h]r*hXportr*r*}r*(hUhj*ubahjxubjp)r*}r*(hXfactoryh}r*(jHjIh]h]h]h]h]uhj*h]r*hXfactoryr*r*}r*(hUhj*ubahjxubjp)r*}r*(hXcontextFactoryh}r*(jHjIh]h]h]h]h]uhj*h]r*hXcontextFactoryr*r*}r*(hUhj*ubahjxubjp)r*}r*(hX backlog=5h}r*(jHjIh]h]h]h]h]uhj*h]r*hX backlog=5r*r*}r*(hUhj*ubahjxubjp)r*}r*(hX interface=''h}r*(jHjIh]h]h]h]h]uhj*h]r*hX interface=''r*r*}r*(hUhj*ubahjxubjp)r*}r*(hX;reactor=h}r*(jHjIh]h]h]h]h]uhj*h]r*hX;reactor=r*r*}r*(hUhj*ubahjxubjp)r*}r*(hXApostConnectionCheck=h}r*(jHjIh]h]h]h]h]uhj*h]r*hXApostConnectionCheck=r*r*}r*(hUhj*ubahjxubeubj`)r*}r*(hUhj*hNhjch}r*(Uexprjeh]h]h]h]h]uhNhhh]r*h)r*}r*(hUh}r*(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj*uhj*h]r*jm)r*}r*(hUh}r*(h]h]r*jrah]h]h]uhj*h]r*hX[source]r*r*}r*(hUhj*ubahjwubahhubaubeubjx)r*}r*(hUhj*hj*hj{h}r*(h]h]h]h]h]uhNhhh]r*(j)r*}r*(hXGA convenience function to listen for SSL/TLS connections using Twisted.hj*hj*hj h}r*(h]h]h]h]h]uhKhhh]r*hXGA convenience function to listen for SSL/TLS connections using Twisted.r*r*}r*(hUhNhNhhhj*ubaubj)r*}r*(hX%See IReactorSSL interface in Twisted.hj*hj*hj h}r*(h]h]h]h]h]uhKhhh]r*hX%See IReactorSSL interface in Twisted.r*r*}r*(hUhNhNhhhj*ubaubeubeubh)r*}r*(hUhj?)hX|/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.listenTCPr*hjh}r*(h]h]h]h]h]Uentries]r*(jX;listenTCP() (in module M2Crypto.SSL.TwistedProtocolWrapper)h7UNtr+auhNhhh]ubj')r+}r+(hUhj?)hj*hj*h}r+(j,j-Xpyh]h]h]h]h]j.Xfunctionr+j0j+uhNhhh]r+(j2)r+}r+(hXlistenTCP(port, factory, backlog=5, interface='', reactor=, postConnectionCheck=None)hj+hX|/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.listenTCPr+hj6h}r +(h]r +h7aj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr +r +}r +bh]h]h]h]r+h7aj?X listenTCPr+j@UjAuhNhhh]r+(jN)r+}r+(hX$M2Crypto.SSL.TwistedProtocolWrapper.hj+hj+hjQh}r+(jHjIh]h]h]h]h]uhNhhh]r+hX$M2Crypto.SSL.TwistedProtocolWrapper.r+r+}r+(hUhNhNhhhj+ubaubjW)r+}r+(hj+hj+hj+hjZh}r+(jHjIh]h]h]h]h]uhNhhh]r+hX listenTCPr+r+}r+(hUhNhNhhhj+ubaubjj)r+}r +(hX}port, factory, backlog=5, interface='', reactor=, postConnectionCheck=Nonehj+hj+hjmh}r!+(jHjIh]h]h]h]h]uhNhhh]r"+(jp)r#+}r$+(hXporth}r%+(jHjIh]h]h]h]h]uhj+h]r&+hXportr'+r(+}r)+(hUhj#+ubahjxubjp)r*+}r++(hXfactoryh}r,+(jHjIh]h]h]h]h]uhj+h]r-+hXfactoryr.+r/+}r0+(hUhj*+ubahjxubjp)r1+}r2+(hX backlog=5h}r3+(jHjIh]h]h]h]h]uhj+h]r4+hX backlog=5r5+r6+}r7+(hUhj1+ubahjxubjp)r8+}r9+(hX interface=''h}r:+(jHjIh]h]h]h]h]uhj+h]r;+hX interface=''r<+r=+}r>+(hUhj8+ubahjxubjp)r?+}r@+(hX;reactor=h}rA+(jHjIh]h]h]h]h]uhj+h]rB+hX;reactor=rC+rD+}rE+(hUhj?+ubahjxubjp)rF+}rG+(hXpostConnectionCheck=Noneh}rH+(jHjIh]h]h]h]h]uhj+h]rI+hXpostConnectionCheck=NonerJ+rK+}rL+(hUhjF+ubahjxubeubj`)rM+}rN+(hUhj+hNhjch}rO+(Uexprjeh]h]h]h]h]uhNhhh]rP+h)rQ+}rR+(hUh}rS+(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj+uhjM+h]rT+jm)rU+}rV+(hUh}rW+(h]h]rX+jrah]h]h]uhjQ+h]rY+hX[source]rZ+r[+}r\+(hUhjU+ubahjwubahhubaubeubjx)r]+}r^+(hUhj+hj+hj{h}r_+(h]h]h]h]h]uhNhhh]r`+(j)ra+}rb+(hXCA convenience function to listen for TCP connections using Twisted.hj]+hj*hj h}rc+(h]h]h]h]h]uhKhhh]rd+hXCA convenience function to listen for TCP connections using Twisted.re+rf+}rg+(hUhNhNhhhja+ubaubj)rh+}ri+(hX:NOTE: You must call startTLS(ctx) to go into SSL/TLS mode.hj]+hj*hj h}rj+(h]h]h]h]h]uhKhhh]rk+hX:NOTE: You must call startTLS(ctx) to go into SSL/TLS mode.rl+rm+}rn+(hUhNhNhhhjh+ubaubj)ro+}rp+(hX%See IReactorTCP interface in Twisted.hj]+hj*hj h}rq+(h]h]h]h]h]uhKhhh]rr+hX%See IReactorTCP interface in Twisted.rs+rt+}ru+(hUhNhNhhhjo+ubaubeubeubh)rv+}rw+(hUhj?)hNhjh}rx+(h]h]h]h]h]Uentries]ry+(jXATLSProtocolWrapper (class in M2Crypto.SSL.TwistedProtocolWrapper)hUNtrz+auhNhhh]ubj')r{+}r|+(hUhj?)hNhj*h}r}+(j,j-Xpyh]h]h]h]h]j.Xclassr~+j0j~+uhNhhh]r+(j2)r+}r+(hXkTLSProtocolWrapper(factory, wrappedProtocol, startPassThrough, client, contextFactory, postConnectionCheck)hj{+hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapperr+hj6h}r+(h]r+haj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr+r+}r+bh]h]h]h]r+haj?XTLSProtocolWrapperr+j@UjAuhNhhh]r+(jC)r+}r+(hXclass hj+hj+hjFh}r+(jHjIh]h]h]h]h]uhNhhh]r+hXclass r+r+}r+(hUhNhNhhhj+ubaubjN)r+}r+(hX$M2Crypto.SSL.TwistedProtocolWrapper.hj+hj+hjQh}r+(jHjIh]h]h]h]h]uhNhhh]r+hX$M2Crypto.SSL.TwistedProtocolWrapper.r+r+}r+(hUhNhNhhhj+ubaubjW)r+}r+(hj+hj+hj+hjZh}r+(jHjIh]h]h]h]h]uhNhhh]r+hXTLSProtocolWrapperr+r+}r+(hUhNhNhhhj+ubaubjj)r+}r+(hXWfactory, wrappedProtocol, startPassThrough, client, contextFactory, postConnectionCheckhj+hj+hjmh}r+(jHjIh]h]h]h]h]uhNhhh]r+(jp)r+}r+(hXfactoryh}r+(jHjIh]h]h]h]h]uhj+h]r+hXfactoryr+r+}r+(hUhj+ubahjxubjp)r+}r+(hXwrappedProtocolh}r+(jHjIh]h]h]h]h]uhj+h]r+hXwrappedProtocolr+r+}r+(hUhj+ubahjxubjp)r+}r+(hXstartPassThroughh}r+(jHjIh]h]h]h]h]uhj+h]r+hXstartPassThroughr+r+}r+(hUhj+ubahjxubjp)r+}r+(hXclienth}r+(jHjIh]h]h]h]h]uhj+h]r+hXclientr+r+}r+(hUhj+ubahjxubjp)r+}r+(hXcontextFactoryh}r+(jHjIh]h]h]h]h]uhj+h]r+hXcontextFactoryr+r+}r+(hUhj+ubahjxubjp)r+}r+(hXpostConnectionCheckh}r+(jHjIh]h]h]h]h]uhj+h]r+hXpostConnectionCheckr+r+}r+(hUhj+ubahjxubeubj`)r+}r+(hUhj+hNhjch}r+(Uexprjeh]h]h]h]h]uhNhhh]r+h)r+}r+(hUh}r+(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj+uhj+h]r+jm)r+}r+(hUh}r+(h]h]r+jrah]h]h]uhj+h]r+hX[source]r+r+}r+(hUhj+ubahjwubahhubaubeubjx)r+}r+(hUhj{+hj+hj{h}r+(h]h]h]h]h]uhNhhh]r+(j)r+}r+(hX:Bases: :class:`twisted.protocols.policies.ProtocolWrapper`hj+hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapperr+hj h}r+(h]h]h]h]h]uhKhhh]r+(hXBases: r+r+}r+(hUhNhNhhhj+ubh)r+}r+(hX3:class:`twisted.protocols.policies.ProtocolWrapper`r+hj+hhhhh}r+(UreftypeXclasshhX*twisted.protocols.policies.ProtocolWrapperU refdomainXpyr+h]h]U refexplicith]h]h]hhhj+hX#M2Crypto.SSL.TwistedProtocolWrapperr+uhK5h]r+h)r+}r+(hj+h}r+(h]h]r+(hj+Xpy-classr+eh]h]h]uhj+h]r+hX*twisted.protocols.policies.ProtocolWrapperr+r+}r+(hUhj+ubahhubaubeubj)r+}r+(hXA 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.hj+hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapperr+hj h}r+(h]h]h]h]h]uhKhhh]r+hXA 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.r+r,}r,(hUhNhNhhhj+ubaubh)r,}r,(hUhj+hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.clearr,hjh}r,(h]h]h]h]h]Uentries]r,(jXGclear() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)h~UNtr,auhNhhh]ubj')r,}r ,(hUhj+hj,hj*h}r ,(j,j-Xpyh]h]h]h]h]j.Xmethodr ,j0j ,uhNhhh]r ,(j2)r ,}r,(hXTLSProtocolWrapper.clear()hj,hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.clearr,hj6h}r,(h]r,h~aj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr,r,}r,bh]h]h]h]r,h~aj?XTLSProtocolWrapper.clearr,j@j+jAuhNhhh]r,(jW)r,}r,(hXclearhj ,hj,hjZh}r,(jHjIh]h]h]h]h]uhNhhh]r,hXclearr,r,}r,(hUhNhNhhhj,ubaubjj)r,}r ,(hUhj ,hj,hjmh}r!,(jHjIh]h]h]h]h]uhNhhh]ubj`)r",}r#,(hUhj ,hNhjch}r$,(Uexprjeh]h]h]h]h]uhNhhh]r%,h)r&,}r',(hUh}r(,(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj,uhj",h]r),jm)r*,}r+,(hUh}r,,(h]h]r-,jrah]h]h]uhj&,h]r.,hX[source]r/,r0,}r1,(hUhj*,ubahjwubahhubaubeubjx)r2,}r3,(hUhj,hj,hj{h}r4,(h]h]h]h]h]uhNhhh]r5,j)r6,}r7,(hX7Clear this instance, after which it is ready for reuse.hj2,hj,hj h}r8,(h]h]h]h]h]uhKhhh]r9,hX7Clear this instance, after which it is ready for reuse.r:,r;,}r<,(hUhNhNhhhj6,ubaubaubeubh)r=,}r>,(hUhj+hNhjh}r?,(h]h]h]h]h]Uentries]r@,(jXPconnectionLost() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)h%UNtrA,auhNhhh]ubj')rB,}rC,(hUhj+hNhj*h}rD,(j,j-Xpyh]h]h]h]h]j.XmethodrE,j0jE,uhNhhh]rF,(j2)rG,}rH,(hX)TLSProtocolWrapper.connectionLost(reason)hjB,hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.connectionLostrI,hj6h}rJ,(h]rK,h%aj9j:X#M2Crypto.SSL.TwistedProtocolWrapperrL,rM,}rN,bh]h]h]h]rO,h%aj?X!TLSProtocolWrapper.connectionLostrP,j@j+jAuhNhhh]rQ,(jW)rR,}rS,(hXconnectionLosthjG,hjI,hjZh}rT,(jHjIh]h]h]h]h]uhNhhh]rU,hXconnectionLostrV,rW,}rX,(hUhNhNhhhjR,ubaubjj)rY,}rZ,(hXreasonhjG,hjI,hjmh}r[,(jHjIh]h]h]h]h]uhNhhh]r\,jp)r],}r^,(hXreasonh}r_,(jHjIh]h]h]h]h]uhjY,h]r`,hXreasonra,rb,}rc,(hUhj],ubahjxubaubj`)rd,}re,(hUhjG,hNhjch}rf,(Uexprjeh]h]h]h]h]uhNhhh]rg,h)rh,}ri,(hUh}rj,(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidjP,uhjd,h]rk,jm)rl,}rm,(hUh}rn,(h]h]ro,jrah]h]h]uhjh,h]rp,hX[source]rq,rr,}rs,(hUhjl,ubahjwubahhubaubeubjx)rt,}ru,(hUhjB,hjI,hj{h}rv,(h]h]h]h]h]uhNhhh]ubeubh)rw,}rx,(hUhj+hNhjh}ry,(h]h]h]h]h]Uentries]rz,(jXPconnectionMade() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)h UNtr{,auhNhhh]ubj')r|,}r},(hUhj+hNhj*h}r~,(j,j-Xpyh]h]h]h]h]j.Xmethodr,j0j,uhNhhh]r,(j2)r,}r,(hX#TLSProtocolWrapper.connectionMade()hj|,hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.connectionMader,hj6h}r,(h]r,h aj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr,r,}r,bh]h]h]h]r,h aj?X!TLSProtocolWrapper.connectionMader,j@j+jAuhNhhh]r,(jW)r,}r,(hXconnectionMadehj,hj,hjZh}r,(jHjIh]h]h]h]h]uhNhhh]r,hXconnectionMader,r,}r,(hUhNhNhhhj,ubaubjj)r,}r,(hUhj,hj,hjmh}r,(jHjIh]h]h]h]h]uhNhhh]ubj`)r,}r,(hUhj,hNhjch}r,(Uexprjeh]h]h]h]h]uhNhhh]r,h)r,}r,(hUh}r,(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj,uhj,h]r,jm)r,}r,(hUh}r,(h]h]r,jrah]h]h]uhj,h]r,hX[source]r,r,}r,(hUhj,ubahjwubahhubaubeubjx)r,}r,(hUhj|,hj,hj{h}r,(h]h]h]h]h]uhNhhh]ubeubh)r,}r,(hUhj+hNhjh}r,(h]h]h]h]h]Uentries]r,(jXNdataReceived() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)hUNtr,auhNhhh]ubj')r,}r,(hUhj+hNhj*h}r,(j,j-Xpyh]h]h]h]h]j.Xmethodr,j0j,uhNhhh]r,(j2)r,}r,(hX%TLSProtocolWrapper.dataReceived(data)hj,hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.dataReceivedr,hj6h}r,(h]r,haj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr,r,}r,bh]h]h]h]r,haj?XTLSProtocolWrapper.dataReceivedr,j@j+jAuhNhhh]r,(jW)r,}r,(hX dataReceivedhj,hj,hjZh}r,(jHjIh]h]h]h]h]uhNhhh]r,hX dataReceivedr,r,}r,(hUhNhNhhhj,ubaubjj)r,}r,(hXdatahj,hj,hjmh}r,(jHjIh]h]h]h]h]uhNhhh]r,jp)r,}r,(hXdatah}r,(jHjIh]h]h]h]h]uhj,h]r,hXdatar,r,}r,(hUhj,ubahjxubaubj`)r,}r,(hUhj,hNhjch}r,(Uexprjeh]h]h]h]h]uhNhhh]r,h)r,}r,(hUh}r,(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj,uhj,h]r,jm)r,}r,(hUh}r,(h]h]r,jrah]h]h]uhj,h]r,hX[source]r,r,}r,(hUhj,ubahjwubahhubaubeubjx)r,}r,(hUhj,hj,hj{h}r,(h]h]h]h]h]uhNhhh]ubeubh)r,}r,(hUhj+hNhjh}r,(h]h]h]h]h]Uentries]r,(jXPloseConnection() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)huUNtr,auhNhhh]ubj')r,}r,(hUhj+hNhj*h}r,(j,j-Xpyh]h]h]h]h]j.Xmethodr,j0j,uhNhhh]r,(j2)r,}r,(hX#TLSProtocolWrapper.loseConnection()hj,hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.loseConnectionr,hj6h}r,(h]r,huaj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr,r,}r,bh]h]h]h]r,huaj?X!TLSProtocolWrapper.loseConnectionr,j@j+jAuhNhhh]r,(jW)r,}r,(hXloseConnectionhj,hj,hjZh}r,(jHjIh]h]h]h]h]uhNhhh]r,hXloseConnectionr,r,}r,(hUhNhNhhhj,ubaubjj)r,}r-(hUhj,hj,hjmh}r-(jHjIh]h]h]h]h]uhNhhh]ubj`)r-}r-(hUhj,hNhjch}r-(Uexprjeh]h]h]h]h]uhNhhh]r-h)r-}r-(hUh}r-(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj,uhj-h]r -jm)r -}r -(hUh}r -(h]h]r -jrah]h]h]uhj-h]r-hX[source]r-r-}r-(hUhj -ubahjwubahhubaubeubjx)r-}r-(hUhj,hj,hj{h}r-(h]h]h]h]h]uhNhhh]ubeubh)r-}r-(hUhj+hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.startTLSr-hjh}r-(h]h]h]h]h]Uentries]r-(jXJstartTLS() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)h.UNtr-auhNhhh]ubj')r-}r-(hUhj+hj-hj*h}r-(j,j-Xpyh]h]h]h]h]j.Xmethodr-j0j-uhNhhh]r-(j2)r -}r!-(hX TLSProtocolWrapper.startTLS(ctx)hj-hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.startTLSr"-hj6h}r#-(h]r$-h.aj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr%-r&-}r'-bh]h]h]h]r(-h.aj?XTLSProtocolWrapper.startTLSr)-j@j+jAuhNhhh]r*-(jW)r+-}r,-(hXstartTLShj -hj"-hjZh}r--(jHjIh]h]h]h]h]uhNhhh]r.-hXstartTLSr/-r0-}r1-(hUhNhNhhhj+-ubaubjj)r2-}r3-(hXctxhj -hj"-hjmh}r4-(jHjIh]h]h]h]h]uhNhhh]r5-jp)r6-}r7-(hXctxh}r8-(jHjIh]h]h]h]h]uhj2-h]r9-hXctxr:-r;-}r<-(hUhj6-ubahjxubaubj`)r=-}r>-(hUhj -hNhjch}r?-(Uexprjeh]h]h]h]h]uhNhhh]r@-h)rA-}rB-(hUh}rC-(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj)-uhj=-h]rD-jm)rE-}rF-(hUh}rG-(h]h]rH-jrah]h]h]uhjA-h]rI-hX[source]rJ-rK-}rL-(hUhjE-ubahjwubahhubaubeubjx)rM-}rN-(hUhj-hj"-hj{h}rO-(h]h]h]h]h]uhNhhh]rP-j)rQ-}rR-(hXWStart SSL/TLS. If this is not called, this instance just passes data through untouched.hjM-hj-hj h}rS-(h]h]h]h]h]uhKhhh]rT-hXWStart SSL/TLS. If this is not called, this instance just passes data through untouched.rU-rV-}rW-(hUhNhNhhhjQ-ubaubaubeubh)rX-}rY-(hUhj+hNhjh}rZ-(h]h]h]h]h]Uentries]r[-(jXGwrite() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)hUNtr\-auhNhhh]ubj')r]-}r^-(hUhj+hNhj*h}r_-(j,j-Xpyh]h]h]h]h]j.Xmethodr`-j0j`-uhNhhh]ra-(j2)rb-}rc-(hXTLSProtocolWrapper.write(data)hj]-hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.writerd-hj6h}re-(h]rf-haj9j:X#M2Crypto.SSL.TwistedProtocolWrapperrg-rh-}ri-bh]h]h]h]rj-haj?XTLSProtocolWrapper.writerk-j@j+jAuhNhhh]rl-(jW)rm-}rn-(hXwritehjb-hjd-hjZh}ro-(jHjIh]h]h]h]h]uhNhhh]rp-hXwriterq-rr-}rs-(hUhNhNhhhjm-ubaubjj)rt-}ru-(hXdatahjb-hjd-hjmh}rv-(jHjIh]h]h]h]h]uhNhhh]rw-jp)rx-}ry-(hXdatah}rz-(jHjIh]h]h]h]h]uhjt-h]r{-hXdatar|-r}-}r~-(hUhjx-ubahjxubaubj`)r-}r-(hUhjb-hNhjch}r-(Uexprjeh]h]h]h]h]uhNhhh]r-h)r-}r-(hUh}r-(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidjk-uhj-h]r-jm)r-}r-(hUh}r-(h]h]r-jrah]h]h]uhj-h]r-hX[source]r-r-}r-(hUhj-ubahjwubahhubaubeubjx)r-}r-(hUhj]-hjd-hj{h}r-(h]h]h]h]h]uhNhhh]ubeubh)r-}r-(hUhj+hNhjh}r-(h]h]h]h]h]Uentries]r-(jXOwriteSequence() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)h UNtr-auhNhhh]ubj')r-}r-(hUhj+hNhj*h}r-(j,j-Xpyh]h]h]h]h]j.Xmethodr-j0j-uhNhhh]r-(j2)r-}r-(hX&TLSProtocolWrapper.writeSequence(data)hj-hX/home/matej/Build/m2crypto/M2Crypto/SSL/TwistedProtocolWrapper.py:docstring of M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.writeSequencer-hj6h}r-(h]r-h aj9j:X#M2Crypto.SSL.TwistedProtocolWrapperr-r-}r-bh]h]h]h]r-h aj?X TLSProtocolWrapper.writeSequencer-j@j+jAuhNhhh]r-(jW)r-}r-(hX writeSequencehj-hj-hjZh}r-(jHjIh]h]h]h]h]uhNhhh]r-hX writeSequencer-r-}r-(hUhNhNhhhj-ubaubjj)r-}r-(hXdatahj-hj-hjmh}r-(jHjIh]h]h]h]h]uhNhhh]r-jp)r-}r-(hXdatah}r-(jHjIh]h]h]h]h]uhj-h]r-hXdatar-r-}r-(hUhj-ubahjxubaubj`)r-}r-(hUhj-hNhjch}r-(Uexprjeh]h]h]h]h]uhNhhh]r-h)r-}r-(hUh}r-(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU,_modules/M2Crypto/SSL/TwistedProtocolWrapperUrefidj-uhj-h]r-jm)r-}r-(hUh}r-(h]h]r-jrah]h]h]uhj-h]r-hX[source]r-r-}r-(hUhj-ubahjwubahhubaubeubjx)r-}r-(hUhj-hj-hj{h}r-(h]h]h]h]h]uhNhhh]ubeubeubeubeubh)r-}r-(hUhhhhhhh}r-(h]h]h]h]r-(Xmodule-M2Crypto.SSL.cbr-U cb-moduler-eh]r-hauhKEhhh]r-(h)r-}r-(hX:mod:`cb` Moduler-hj-hhhhh}r-(h]h]h]h]h]uhKEhhh]r-(h)r-}r-(hX :mod:`cb`r-hj-hhhhh}r-(UreftypeXmodhhXcbU refdomainXpyr-h]h]U refexplicith]h]h]hhhNhj+uhKDh]r-h)r-}r-(hj-h}r-(h]h]r-(hj-Xpy-modr-eh]h]h]uhj-h]r-hXcbr-r-}r-(hUhj-ubahhubaubhX Moduler-r-}r-(hUhNhNhhhj-ubeubh)r-}r-(hUhj-hXc/home/matej/Build/m2crypto/M2Crypto/SSL/cb.py:docstring of M2Crypto.SSL.cb.ssl_verify_callback_stubr-hjh}r-(h]h]h]h]h]Uentries]r-(jXM2Crypto.SSL.cb (module)Xmodule-M2Crypto.SSL.cbUNtr-auhKhhh]ubh)r-}r-(hUhj-hNhjh}r-(h]h]h]h]h]Uentries]r-(jX6ssl_verify_callback_stub() (in module M2Crypto.SSL.cb)hdUNtr-auhNhhh]ubj')r-}r-(hUhj-hNhj*h}r-(j,j-Xpyh]h]h]h]h]j.Xfunctionr-j0j-uhNhhh]r-(j2)r-}r-(hXEssl_verify_callback_stub(ssl_ctx_ptr, x509_ptr, errnum, errdepth, ok)hj-hXc/home/matej/Build/m2crypto/M2Crypto/SSL/cb.py:docstring of M2Crypto.SSL.cb.ssl_verify_callback_stubr-hj6h}r-(h]r-hdaj9j:XM2Crypto.SSL.cbr.r.}r.bh]h]h]h]r.hdaj?Xssl_verify_callback_stubr.j@UjAuhNhhh]r.(jN)r.}r.(hXM2Crypto.SSL.cb.hj-hj-hjQh}r.(jHjIh]h]h]h]h]uhNhhh]r .hXM2Crypto.SSL.cb.r .r .}r .(hUhNhNhhhj.ubaubjW)r .}r.(hj.hj-hj-hjZh}r.(jHjIh]h]h]h]h]uhNhhh]r.hXssl_verify_callback_stubr.r.}r.(hUhNhNhhhj .ubaubjj)r.}r.(hX+ssl_ctx_ptr, x509_ptr, errnum, errdepth, okhj-hj-hjmh}r.(jHjIh]h]h]h]h]uhNhhh]r.(jp)r.}r.(hX ssl_ctx_ptrh}r.(jHjIh]h]h]h]h]uhj.h]r.hX ssl_ctx_ptrr.r.}r.(hUhj.ubahjxubjp)r.}r .(hXx509_ptrh}r!.(jHjIh]h]h]h]h]uhj.h]r".hXx509_ptrr#.r$.}r%.(hUhj.ubahjxubjp)r&.}r'.(hXerrnumh}r(.(jHjIh]h]h]h]h]uhj.h]r).hXerrnumr*.r+.}r,.(hUhj&.ubahjxubjp)r-.}r..(hXerrdepthh}r/.(jHjIh]h]h]h]h]uhj.h]r0.hXerrdepthr1.r2.}r3.(hUhj-.ubahjxubjp)r4.}r5.(hXokh}r6.(jHjIh]h]h]h]h]uhj.h]r7.hXokr8.r9.}r:.(hUhj4.ubahjxubeubj`)r;.}r<.(hUhj-hNhjch}r=.(Uexprjeh]h]h]h]h]uhNhhh]r>.h)r?.}r@.(hUh}rA.(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/cbUrefidj.uhj;.h]rB.jm)rC.}rD.(hUh}rE.(h]h]rF.jrah]h]h]uhj?.h]rG.hX[source]rH.rI.}rJ.(hUhjC.ubahjwubahhubaubeubjx)rK.}rL.(hUhj-hj-hj{h}rM.(h]h]h]h]h]uhNhhh]ubeubh)rN.}rO.(hUhj-hNhjh}rP.(h]h]h]h]h]Uentries]rQ.(jX1ssl_verify_callback() (in module M2Crypto.SSL.cb)hUNtrR.auhNhhh]ubj')rS.}rT.(hUhj-hNhj*h}rU.(j,j-Xpyh]h]h]h]h]j.XfunctionrV.j0jV.uhNhhh]rW.(j2)rX.}rY.(hX@ssl_verify_callback(ssl_ctx_ptr, x509_ptr, errnum, errdepth, ok)hjS.hX^/home/matej/Build/m2crypto/M2Crypto/SSL/cb.py:docstring of M2Crypto.SSL.cb.ssl_verify_callbackrZ.hj6h}r[.(h]r\.haj9j:XM2Crypto.SSL.cbr].r^.}r_.bh]h]h]h]r`.haj?Xssl_verify_callbackra.j@UjAuhNhhh]rb.(jN)rc.}rd.(hXM2Crypto.SSL.cb.hjX.hjZ.hjQh}re.(jHjIh]h]h]h]h]uhNhhh]rf.hXM2Crypto.SSL.cb.rg.rh.}ri.(hUhNhNhhhjc.ubaubjW)rj.}rk.(hja.hjX.hjZ.hjZh}rl.(jHjIh]h]h]h]h]uhNhhh]rm.hXssl_verify_callbackrn.ro.}rp.(hUhNhNhhhjj.ubaubjj)rq.}rr.(hX+ssl_ctx_ptr, x509_ptr, errnum, errdepth, okhjX.hjZ.hjmh}rs.(jHjIh]h]h]h]h]uhNhhh]rt.(jp)ru.}rv.(hX ssl_ctx_ptrh}rw.(jHjIh]h]h]h]h]uhjq.h]rx.hX ssl_ctx_ptrry.rz.}r{.(hUhju.ubahjxubjp)r|.}r}.(hXx509_ptrh}r~.(jHjIh]h]h]h]h]uhjq.h]r.hXx509_ptrr.r.}r.(hUhj|.ubahjxubjp)r.}r.(hXerrnumh}r.(jHjIh]h]h]h]h]uhjq.h]r.hXerrnumr.r.}r.(hUhj.ubahjxubjp)r.}r.(hXerrdepthh}r.(jHjIh]h]h]h]h]uhjq.h]r.hXerrdepthr.r.}r.(hUhj.ubahjxubjp)r.}r.(hXokh}r.(jHjIh]h]h]h]h]uhjq.h]r.hXokr.r.}r.(hUhj.ubahjxubeubj`)r.}r.(hUhjX.hNhjch}r.(Uexprjeh]h]h]h]h]uhNhhh]r.h)r.}r.(hUh}r.(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/cbUrefidja.uhj.h]r.jm)r.}r.(hUh}r.(h]h]r.jrah]h]h]uhj.h]r.hX[source]r.r.}r.(hUhj.ubahjwubahhubaubeubjx)r.}r.(hUhjS.hjZ.hj{h}r.(h]h]h]h]h]uhNhhh]ubeubh)r.}r.(hUhj-hNhjh}r.(h]h]h]h]h]Uentries]r.(jXBssl_verify_callback_allow_unknown_ca() (in module M2Crypto.SSL.cb)h|UNtr.auhNhhh]ubj')r.}r.(hUhj-hNhj*h}r.(j,j-Xpyh]h]h]h]h]j.Xfunctionr.j0j.uhNhhh]r.(j2)r.}r.(hX/ssl_verify_callback_allow_unknown_ca(ok, store)hj.hXo/home/matej/Build/m2crypto/M2Crypto/SSL/cb.py:docstring of M2Crypto.SSL.cb.ssl_verify_callback_allow_unknown_car.hj6h}r.(h]r.h|aj9j:XM2Crypto.SSL.cbr.r.}r.bh]h]h]h]r.h|aj?X$ssl_verify_callback_allow_unknown_car.j@UjAuhNhhh]r.(jN)r.}r.(hXM2Crypto.SSL.cb.hj.hj.hjQh}r.(jHjIh]h]h]h]h]uhNhhh]r.hXM2Crypto.SSL.cb.r.r.}r.(hUhNhNhhhj.ubaubjW)r.}r.(hj.hj.hj.hjZh}r.(jHjIh]h]h]h]h]uhNhhh]r.hX$ssl_verify_callback_allow_unknown_car.r.}r.(hUhNhNhhhj.ubaubjj)r.}r.(hX ok, storehj.hj.hjmh}r.(jHjIh]h]h]h]h]uhNhhh]r.(jp)r.}r.(hXokh}r.(jHjIh]h]h]h]h]uhj.h]r.hXokr.r.}r.(hUhj.ubahjxubjp)r.}r.(hXstoreh}r.(jHjIh]h]h]h]h]uhj.h]r.hXstorer.r.}r.(hUhj.ubahjxubeubj`)r.}r.(hUhj.hNhjch}r.(Uexprjeh]h]h]h]h]uhNhhh]r.h)r.}r.(hUh}r.(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/cbUrefidj.uhj.h]r.jm)r.}r.(hUh}r.(h]h]r.jrah]h]h]uhj.h]r.hX[source]r.r.}r.(hUhj.ubahjwubahhubaubeubjx)r.}r.(hUhj.hj.hj{h}r.(h]h]h]h]h]uhNhhh]ubeubh)r.}r.(hUhj-hNhjh}r.(h]h]h]h]h]Uentries]r.(jX/ssl_info_callback() (in module M2Crypto.SSL.cb)hUNtr.auhNhhh]ubj')r.}r.(hUhj-hNhj*h}r.(j,j-Xpyh]h]h]h]h]j.Xfunctionr.j0j.uhNhhh]r.(j2)r.}r.(hX&ssl_info_callback(where, ret, ssl_ptr)hj.hX\/home/matej/Build/m2crypto/M2Crypto/SSL/cb.py:docstring of M2Crypto.SSL.cb.ssl_info_callbackr.hj6h}r/(h]r/haj9j:XM2Crypto.SSL.cbr/r/}r/bh]h]h]h]r/haj?Xssl_info_callbackr/j@UjAuhNhhh]r/(jN)r/}r /(hXM2Crypto.SSL.cb.hj.hj.hjQh}r /(jHjIh]h]h]h]h]uhNhhh]r /hXM2Crypto.SSL.cb.r /r /}r/(hUhNhNhhhj/ubaubjW)r/}r/(hj/hj.hj.hjZh}r/(jHjIh]h]h]h]h]uhNhhh]r/hXssl_info_callbackr/r/}r/(hUhNhNhhhj/ubaubjj)r/}r/(hXwhere, ret, ssl_ptrhj.hj.hjmh}r/(jHjIh]h]h]h]h]uhNhhh]r/(jp)r/}r/(hXwhereh}r/(jHjIh]h]h]h]h]uhj/h]r/hXwherer/r/}r /(hUhj/ubahjxubjp)r!/}r"/(hXreth}r#/(jHjIh]h]h]h]h]uhj/h]r$/hXretr%/r&/}r'/(hUhj!/ubahjxubjp)r(/}r)/(hXssl_ptrh}r*/(jHjIh]h]h]h]h]uhj/h]r+/hXssl_ptrr,/r-/}r./(hUhj(/ubahjxubeubj`)r//}r0/(hUhj.hNhjch}r1/(Uexprjeh]h]h]h]h]uhNhhh]r2/h)r3/}r4/(hUh}r5/(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/cbUrefidj/uhj//h]r6/jm)r7/}r8/(hUh}r9/(h]h]r:/jrah]h]h]uhj3/h]r;/hX[source]r/(hUhj7/ubahjwubahhubaubeubjx)r?/}r@/(hUhj.hj.hj{h}rA/(h]h]h]h]h]uhNhhh]ubeubeubh)rB/}rC/(hUhhhhhhh}rD/(h]h]h]h]rE/(X"module-M2Crypto.SSL.ssl_dispatcherrF/Ussl-dispatcher-modulerG/eh]rH/h]auhKMhhh]rI/(h)rJ/}rK/(hX:mod:`ssl_dispatcher` ModulerL/hjB/hhhhh}rM/(h]h]h]h]h]uhKMhhh]rN/(h)rO/}rP/(hX:mod:`ssl_dispatcher`rQ/hjJ/hhhhh}rR/(UreftypeXmodhhXssl_dispatcherU refdomainXpyrS/h]h]U refexplicith]h]h]hhhNhXM2Crypto.SSL.cbrT/uhKLh]rU/h)rV/}rW/(hjQ/h}rX/(h]h]rY/(hjS/Xpy-modrZ/eh]h]h]uhjO/h]r[/hXssl_dispatcherr\/r]/}r^/(hUhjV/ubahhubaubhX Moduler_/r`/}ra/(hUhNhNhhhjJ/ubeubh)rb/}rc/(hUhjB/hXq/home/matej/Build/m2crypto/M2Crypto/SSL/ssl_dispatcher.py:docstring of M2Crypto.SSL.ssl_dispatcher.ssl_dispatcherrd/hjh}re/(h]h]h]h]h]Uentries]rf/(jX$M2Crypto.SSL.ssl_dispatcher (module)X"module-M2Crypto.SSL.ssl_dispatcherUNtrg/auhKhhh]ubh)rh/}ri/(hUhjB/hNhjh}rj/(h]h]h]h]h]Uentries]rk/(jX5ssl_dispatcher (class in M2Crypto.SSL.ssl_dispatcher)heUNtrl/auhNhhh]ubj')rm/}rn/(hUhjB/hNhj*h}ro/(j,j-Xpyh]h]h]h]h]j.Xclassrp/j0jp/uhNhhh]rq/(j2)rr/}rs/(hX#ssl_dispatcher(sock=None, map=None)hjm/hXq/home/matej/Build/m2crypto/M2Crypto/SSL/ssl_dispatcher.py:docstring of M2Crypto.SSL.ssl_dispatcher.ssl_dispatcherrt/hj6h}ru/(h]rv/heaj9j:XM2Crypto.SSL.ssl_dispatcherrw/rx/}ry/bh]h]h]h]rz/heaj?Xssl_dispatcherr{/j@UjAuhNhhh]r|/(jC)r}/}r~/(hXclass hjr/hjt/hjFh}r/(jHjIh]h]h]h]h]uhNhhh]r/hXclass r/r/}r/(hUhNhNhhhj}/ubaubjN)r/}r/(hXM2Crypto.SSL.ssl_dispatcher.hjr/hjt/hjQh}r/(jHjIh]h]h]h]h]uhNhhh]r/hXM2Crypto.SSL.ssl_dispatcher.r/r/}r/(hUhNhNhhhj/ubaubjW)r/}r/(hj{/hjr/hjt/hjZh}r/(jHjIh]h]h]h]h]uhNhhh]r/hXssl_dispatcherr/r/}r/(hUhNhNhhhj/ubaubjj)r/}r/(hXsock=None, map=Nonehjr/hjt/hjmh}r/(jHjIh]h]h]h]h]uhNhhh]r/(jp)r/}r/(hX sock=Noneh}r/(jHjIh]h]h]h]h]uhj/h]r/hX sock=Noner/r/}r/(hUhj/ubahjxubjp)r/}r/(hXmap=Noneh}r/(jHjIh]h]h]h]h]uhj/h]r/hXmap=Noner/r/}r/(hUhj/ubahjxubeubj`)r/}r/(hUhjr/hNhjch}r/(Uexprjeh]h]h]h]h]uhNhhh]r/h)r/}r/(hUh}r/(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU$_modules/M2Crypto/SSL/ssl_dispatcherUrefidj{/uhj/h]r/jm)r/}r/(hUh}r/(h]h]r/jrah]h]h]uhj/h]r/hX[source]r/r/}r/(hUhj/ubahjwubahhubaubeubjx)r/}r/(hUhjm/hjt/hj{h}r/(h]h]h]h]h]uhNhhh]r/(j)r/}r/(hX#Bases: :class:`asyncore.dispatcher`hj/hXq/home/matej/Build/m2crypto/M2Crypto/SSL/ssl_dispatcher.py:docstring of M2Crypto.SSL.ssl_dispatcher.ssl_dispatcherhj h}r/(h]h]h]h]h]uhKhhh]r/(hXBases: r/r/}r/(hUhNhNhhhj/ubh)r/}r/(hX:class:`asyncore.dispatcher`r/hj/hhhhh}r/(UreftypeXclasshhXasyncore.dispatcherU refdomainXpyr/h]h]U refexplicith]h]h]hhhj{/hXM2Crypto.SSL.ssl_dispatcherr/uhKh]r/h)r/}r/(hj/h}r/(h]h]r/(hj/Xpy-classr/eh]h]h]uhj/h]r/hXasyncore.dispatcherr/r/}r/(hUhj/ubahhubaubeubh)r/}r/(hUhj/hNhjh}r/(h]h]h]h]h]Uentries]r/(jX=connect() (M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher method)hpUNtr/auhNhhh]ubj')r/}r/(hUhj/hNhj*h}r/(j,j-Xpyh]h]h]h]h]j.Xmethodr/j0j/uhNhhh]r/(j2)r/}r/(hXssl_dispatcher.connect(addr)hj/hXy/home/matej/Build/m2crypto/M2Crypto/SSL/ssl_dispatcher.py:docstring of M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.connectr/hj6h}r/(h]r/hpaj9j:XM2Crypto.SSL.ssl_dispatcherr/r/}r/bh]h]h]h]r/hpaj?Xssl_dispatcher.connectr/j@j{/jAuhNhhh]r/(jW)r/}r/(hXconnecthj/hj/hjZh}r/(jHjIh]h]h]h]h]uhNhhh]r/hXconnectr/r/}r/(hUhNhNhhhj/ubaubjj)r/}r/(hXaddrhj/hj/hjmh}r/(jHjIh]h]h]h]h]uhNhhh]r/jp)r/}r/(hXaddrh}r/(jHjIh]h]h]h]h]uhj/h]r/hXaddrr/r/}r/(hUhj/ubahjxubaubj`)r/}r/(hUhj/hNhjch}r/(Uexprjeh]h]h]h]h]uhNhhh]r/h)r/}r/(hUh}r/(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU$_modules/M2Crypto/SSL/ssl_dispatcherUrefidj/uhj/h]r/jm)r/}r/(hUh}r0(h]h]r0jrah]h]h]uhj/h]r0hX[source]r0r0}r0(hUhj/ubahjwubahhubaubeubjx)r0}r0(hUhj/hj/hj{h}r0(h]h]h]h]h]uhNhhh]ubeubh)r 0}r 0(hUhj/hNhjh}r 0(h]h]h]h]h]Uentries]r 0(jXCcreate_socket() (M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher method)hBUNtr 0auhNhhh]ubj')r0}r0(hUhj/hNhj*h}r0(j,j-Xpyh]h]h]h]h]j.Xmethodr0j0j0uhNhhh]r0(j2)r0}r0(hX)ssl_dispatcher.create_socket(ssl_context)hj0hX/home/matej/Build/m2crypto/M2Crypto/SSL/ssl_dispatcher.py:docstring of M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.create_socketr0hj6h}r0(h]r0hBaj9j:XM2Crypto.SSL.ssl_dispatcherr0r0}r0bh]h]h]h]r0hBaj?Xssl_dispatcher.create_socketr0j@j{/jAuhNhhh]r0(jW)r0}r0(hX create_sockethj0hj0hjZh}r 0(jHjIh]h]h]h]h]uhNhhh]r!0hX create_socketr"0r#0}r$0(hUhNhNhhhj0ubaubjj)r%0}r&0(hX ssl_contexthj0hj0hjmh}r'0(jHjIh]h]h]h]h]uhNhhh]r(0jp)r)0}r*0(hX ssl_contexth}r+0(jHjIh]h]h]h]h]uhj%0h]r,0hX ssl_contextr-0r.0}r/0(hUhj)0ubahjxubaubj`)r00}r10(hUhj0hNhjch}r20(Uexprjeh]h]h]h]h]uhNhhh]r30h)r40}r50(hUh}r60(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU$_modules/M2Crypto/SSL/ssl_dispatcherUrefidj0uhj00h]r70jm)r80}r90(hUh}r:0(h]h]r;0jrah]h]h]uhj40h]r<0hX[source]r=0r>0}r?0(hUhj80ubahjwubahhubaubeubjx)r@0}rA0(hUhj0hj0hj{h}rB0(h]h]h]h]h]uhNhhh]ubeubh)rC0}rD0(hUhj/hXv/home/matej/Build/m2crypto/M2Crypto/SSL/ssl_dispatcher.py:docstring of M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.recvrE0hjh}rF0(h]h]h]h]h]Uentries]rG0(jX:recv() (M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher method)hUNtrH0auhNhhh]ubj')rI0}rJ0(hUhj/hjE0hj*h}rK0(j,j-Xpyh]h]h]h]h]j.XmethodrL0j0jL0uhNhhh]rM0(j2)rN0}rO0(hX%ssl_dispatcher.recv(buffer_size=4096)hjI0hXv/home/matej/Build/m2crypto/M2Crypto/SSL/ssl_dispatcher.py:docstring of M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.recvrP0hj6h}rQ0(h]rR0haj9j:XM2Crypto.SSL.ssl_dispatcherrS0rT0}rU0bh]h]h]h]rV0haj?Xssl_dispatcher.recvrW0j@j{/jAuhNhhh]rX0(jW)rY0}rZ0(hXrecvhjN0hjP0hjZh}r[0(jHjIh]h]h]h]h]uhNhhh]r\0hXrecvr]0r^0}r_0(hUhNhNhhhjY0ubaubjj)r`0}ra0(hXbuffer_size=4096hjN0hjP0hjmh}rb0(jHjIh]h]h]h]h]uhNhhh]rc0jp)rd0}re0(hXbuffer_size=4096h}rf0(jHjIh]h]h]h]h]uhj`0h]rg0hXbuffer_size=4096rh0ri0}rj0(hUhjd0ubahjxubaubj`)rk0}rl0(hUhjN0hNhjch}rm0(Uexprjeh]h]h]h]h]uhNhhh]rn0h)ro0}rp0(hUh}rq0(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU$_modules/M2Crypto/SSL/ssl_dispatcherUrefidjW0uhjk0h]rr0jm)rs0}rt0(hUh}ru0(h]h]rv0jrah]h]h]uhjo0h]rw0hX[source]rx0ry0}rz0(hUhjs0ubahjwubahhubaubeubjx)r{0}r|0(hUhjI0hjP0hj{h}r}0(h]h]h]h]h]uhNhhh]r~0j)r0}r0(hXReceive data over SSL.hj{0hjE0hj h}r0(h]h]h]h]h]uhKhhh]r0hXReceive data over SSL.r0r0}r0(hUhNhNhhhj0ubaubaubeubh)r0}r0(hUhj/hXv/home/matej/Build/m2crypto/M2Crypto/SSL/ssl_dispatcher.py:docstring of M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.sendr0hjh}r0(h]h]h]h]h]Uentries]r0(jX:send() (M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher method)hUNtr0auhNhhh]ubj')r0}r0(hUhj/hj0hj*h}r0(j,j-Xpyh]h]h]h]h]j.Xmethodr0j0j0uhNhhh]r0(j2)r0}r0(hXssl_dispatcher.send(buffer)hj0hXv/home/matej/Build/m2crypto/M2Crypto/SSL/ssl_dispatcher.py:docstring of M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.sendr0hj6h}r0(h]r0haj9j:XM2Crypto.SSL.ssl_dispatcherr0r0}r0bh]h]h]h]r0haj?Xssl_dispatcher.sendr0j@j{/jAuhNhhh]r0(jW)r0}r0(hXsendhj0hj0hjZh}r0(jHjIh]h]h]h]h]uhNhhh]r0hXsendr0r0}r0(hUhNhNhhhj0ubaubjj)r0}r0(hXbufferhj0hj0hjmh}r0(jHjIh]h]h]h]h]uhNhhh]r0jp)r0}r0(hXbufferh}r0(jHjIh]h]h]h]h]uhj0h]r0hXbufferr0r0}r0(hUhj0ubahjxubaubj`)r0}r0(hUhj0hNhjch}r0(Uexprjeh]h]h]h]h]uhNhhh]r0h)r0}r0(hUh}r0(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU$_modules/M2Crypto/SSL/ssl_dispatcherUrefidj0uhj0h]r0jm)r0}r0(hUh}r0(h]h]r0jrah]h]h]uhj0h]r0hX[source]r0r0}r0(hUhj0ubahjwubahhubaubeubjx)r0}r0(hUhj0hj0hj{h}r0(h]h]h]h]h]uhNhhh]r0j)r0}r0(hXSend data over SSL.hj0hj0hj h}r0(h]h]h]h]h]uhKhhh]r0hXSend data over SSL.r0r0}r0(hUhNhNhhhj0ubaubaubeubeubeubeubh)r0}r0(hUhhhhhhh}r0(h]h]h]h]r0(Xmodule-M2Crypto.SSL.timeoutr0Utimeout-moduler0eh]r0hPauhKUhhh]r0(h)r0}r0(hX:mod:`timeout` Moduler0hj0hhhhh}r0(h]h]h]h]h]uhKUhhh]r0(h)r0}r0(hX:mod:`timeout`r0hj0hhhhh}r0(UreftypeXmodhhXtimeoutU refdomainXpyr0h]h]U refexplicith]h]h]hhhNhj/uhKTh]r0h)r0}r0(hj0h}r0(h]h]r0(hj0Xpy-modr0eh]h]h]uhj0h]r0hXtimeoutr0r0}r0(hUhj0ubahhubaubhX Moduler0r0}r0(hUhNhNhhhj0ubeubh)r0}r0(hUhj0hXT/home/matej/Build/m2crypto/M2Crypto/SSL/timeout.py:docstring of M2Crypto.SSL.timeoutr0hjh}r0(h]h]h]h]h]Uentries]r0(jXM2Crypto.SSL.timeout (module)Xmodule-M2Crypto.SSL.timeoutUNtr0auhKhhh]ubj)r0}r0(hX Support for SSL socket timeouts.r0hj0hXT/home/matej/Build/m2crypto/M2Crypto/SSL/timeout.py:docstring of M2Crypto.SSL.timeoutr0hj h}r0(h]h]h]h]h]uhKhhh]r0hX Support for SSL socket timeouts.r0r0}r0(hUhNhNhhhj0ubaubj)r0}r0(hX<Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.r0hj0hj0hj h}r0(h]h]h]h]h]uhKhhh]r0hX<Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.r0r0}r0(hUhNhNhhhj0ubaubj)r0}r1(hX4Copyright 2008 Heikki Toivonen. All rights reserved.r1hj0hj0hj h}r1(h]h]h]h]h]uhKhhh]r1hX4Copyright 2008 Heikki Toivonen. All rights reserved.r1r1}r1(hUhNhNhhhj0ubaubh)r1}r1(hUhj0hNhjh}r 1(h]h]h]h]h]Uentries]r 1(jX'timeout (class in M2Crypto.SSL.timeout)h1UNtr 1auhNhhh]ubj')r 1}r 1(hUhj0hNhj*h}r1(j,j-Xpyh]h]h]h]h]j.Xclassr1j0j1uhNhhh]r1(j2)r1}r1(hXtimeout(sec=600, microsec=0)hj 1hX\/home/matej/Build/m2crypto/M2Crypto/SSL/timeout.py:docstring of M2Crypto.SSL.timeout.timeoutr1hj6h}r1(h]r1h1aj9j:XM2Crypto.SSL.timeoutr1r1}r1bh]h]h]h]r1h1aj?Xtimeoutr1j@UjAuhNhhh]r1(jC)r1}r1(hXclass hj1hj1hjFh}r1(jHjIh]h]h]h]h]uhNhhh]r1hXclass r 1r!1}r"1(hUhNhNhhhj1ubaubjN)r#1}r$1(hXM2Crypto.SSL.timeout.hj1hj1hjQh}r%1(jHjIh]h]h]h]h]uhNhhh]r&1hXM2Crypto.SSL.timeout.r'1r(1}r)1(hUhNhNhhhj#1ubaubjW)r*1}r+1(hj1hj1hj1hjZh}r,1(jHjIh]h]h]h]h]uhNhhh]r-1hXtimeoutr.1r/1}r01(hUhNhNhhhj*1ubaubjj)r11}r21(hXsec=600, microsec=0hj1hj1hjmh}r31(jHjIh]h]h]h]h]uhNhhh]r41(jp)r51}r61(hXsec=600h}r71(jHjIh]h]h]h]h]uhj11h]r81hXsec=600r91r:1}r;1(hUhj51ubahjxubjp)r<1}r=1(hX microsec=0h}r>1(jHjIh]h]h]h]h]uhj11h]r?1hX microsec=0r@1rA1}rB1(hUhj<1ubahjxubeubj`)rC1}rD1(hUhj1hNhjch}rE1(Uexprjeh]h]h]h]h]uhNhhh]rF1h)rG1}rH1(hUh}rI1(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/timeoutUrefidj1uhjC1h]rJ1jm)rK1}rL1(hUh}rM1(h]h]rN1jrah]h]h]uhjG1h]rO1hX[source]rP1rQ1}rR1(hUhjK1ubahjwubahhubaubeubjx)rS1}rT1(hUhj 1hj1hj{h}rU1(h]h]h]h]h]uhNhhh]rV1(h)rW1}rX1(hUhjS1hNhjh}rY1(h]h]h]h]h]Uentries]rZ1(jX,pack() (M2Crypto.SSL.timeout.timeout method)hSUNtr[1auhNhhh]ubj')r\1}r]1(hUhjS1hNhj*h}r^1(j,j-Xpyh]h]h]h]h]j.Xmethodr_1j0j_1uhNhhh]r`1(j2)ra1}rb1(hXtimeout.pack()rc1hj\1hXa/home/matej/Build/m2crypto/M2Crypto/SSL/timeout.py:docstring of M2Crypto.SSL.timeout.timeout.packrd1hj6h}re1(h]rf1hSaj9j:XM2Crypto.SSL.timeoutrg1rh1}ri1bh]h]h]h]rj1hSaj?X timeout.packrk1j@j1jAuhNhhh]rl1(jW)rm1}rn1(hXpackhja1hjd1hjZh}ro1(jHjIh]h]h]h]h]uhNhhh]rp1hXpackrq1rr1}rs1(hUhNhNhhhjm1ubaubjj)rt1}ru1(hUhja1hjd1hjmh}rv1(jHjIh]h]h]h]h]uhNhhh]ubj`)rw1}rx1(hUhja1hNhjch}ry1(Uexprjeh]h]h]h]h]uhNhhh]rz1h)r{1}r|1(hUh}r}1(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/timeoutUrefidjk1uhjw1h]r~1jm)r1}r1(hUh}r1(h]h]r1jrah]h]h]uhj{1h]r1hX[source]r1r1}r1(hUhj1ubahjwubahhubaubeubjx)r1}r1(hUhj\1hjd1hj{h}r1(h]h]h]h]h]uhNhhh]ubeubeubeubh)r1}r1(hUhj0hNhjh}r1(h]h]h]h]h]Uentries]r1(jX4struct_to_timeout() (in module M2Crypto.SSL.timeout)h9UNtr1auhNhhh]ubj')r1}r1(hUhj0hNhj*h}r1(j,j-Xpyh]h]h]h]h]j.Xfunctionr1j0j1uhNhhh]r1(j2)r1}r1(hXstruct_to_timeout(binstr)hj1hXf/home/matej/Build/m2crypto/M2Crypto/SSL/timeout.py:docstring of M2Crypto.SSL.timeout.struct_to_timeoutr1hj6h}r1(h]r1h9aj9j:XM2Crypto.SSL.timeoutr1r1}r1bh]h]h]h]r1h9aj?Xstruct_to_timeoutr1j@UjAuhNhhh]r1(jN)r1}r1(hXM2Crypto.SSL.timeout.hj1hj1hjQh}r1(jHjIh]h]h]h]h]uhNhhh]r1hXM2Crypto.SSL.timeout.r1r1}r1(hUhNhNhhhj1ubaubjW)r1}r1(hj1hj1hj1hjZh}r1(jHjIh]h]h]h]h]uhNhhh]r1hXstruct_to_timeoutr1r1}r1(hUhNhNhhhj1ubaubjj)r1}r1(hXbinstrhj1hj1hjmh}r1(jHjIh]h]h]h]h]uhNhhh]r1jp)r1}r1(hXbinstrh}r1(jHjIh]h]h]h]h]uhj1h]r1hXbinstrr1r1}r1(hUhj1ubahjxubaubj`)r1}r1(hUhj1hNhjch}r1(Uexprjeh]h]h]h]h]uhNhhh]r1h)r1}r1(hUh}r1(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/timeoutUrefidj1uhj1h]r1jm)r1}r1(hUh}r1(h]h]r1jrah]h]h]uhj1h]r1hX[source]r1r1}r1(hUhj1ubahjwubahhubaubeubjx)r1}r1(hUhj1hj1hj{h}r1(h]h]h]h]h]uhNhhh]ubeubh)r1}r1(hUhj0hNhjh}r1(h]h]h]h]h]Uentries]r1(jX.struct_size() (in module M2Crypto.SSL.timeout)hUNtr1auhNhhh]ubj')r1}r1(hUhj0hNhj*h}r1(j,j-Xpyh]h]h]h]h]j.Xfunctionr1j0j1uhNhhh]r1(j2)r1}r1(hX struct_size()r1hj1hX`/home/matej/Build/m2crypto/M2Crypto/SSL/timeout.py:docstring of M2Crypto.SSL.timeout.struct_sizer1hj6h}r1(h]r1haj9j:XM2Crypto.SSL.timeoutr1r1}r1bh]h]h]h]r1haj?X struct_sizer1j@UjAuhNhhh]r1(jN)r1}r1(hXM2Crypto.SSL.timeout.hj1hj1hjQh}r1(jHjIh]h]h]h]h]uhNhhh]r1hXM2Crypto.SSL.timeout.r1r1}r1(hUhNhNhhhj1ubaubjW)r1}r1(hj1hj1hj1hjZh}r1(jHjIh]h]h]h]h]uhNhhh]r1hX struct_sizer1r1}r1(hUhNhNhhhj1ubaubjj)r1}r1(hUhj1hj1hjmh}r1(jHjIh]h]h]h]h]uhNhhh]ubj`)r1}r1(hUhj1hNhjch}r1(Uexprjeh]h]h]h]h]uhNhhh]r1h)r1}r1(hUh}r1(UreftypejjUrefdochU refdomainjkh]h]U refexplicith]h]h]U reftargetU_modules/M2Crypto/SSL/timeoutUrefidj1uhj1h]r1jm)r1}r1(hUh}r1(h]h]r1jrah]h]h]uhj1h]r1hX[source]r1r2}r2(hUhj1ubahjwubahhubaubeubjx)r2}r2(hUhj1hj1hj{h}r2(h]h]h]h]h]uhNhhh]ubeubeubeubhhhhh}r2(h]r2hah]h]h]r2Uid1r2ah]uhKhhh]r 2(h)r 2}r 2(hX:mod:`SSL` Packager 2hhhhhhh}r 2(h]h]h]h]h]uhKhhh]r2(h)r2}r2(hX :mod:`SSL`r2hj 2hhhhh}r2(UreftypeXmodhhXSSLU refdomainXpyr2h]h]U refexplicith]h]h]hhhNhNuhKh]r2h)r2}r2(hj2h}r2(h]h]r2(hj2Xpy-modr2eh]h]h]uhj2h]r2hXSSLr2r2}r2(hUhj2ubahhubaubhX Packager2r2}r 2(hUhNhNhhhj 2ubeubcdocutils.nodes target r!2)r"2}r#2(hUhhhXV/home/matej/Build/m2crypto/M2Crypto/SSL/__init__.py:docstring of M2Crypto.SSL.SSLErrorr$2hUtargetr%2h}r&2(h]h]r'2Xmodule-M2Crypto.SSLr(2ah]Uismodh]h]uhKhhh]ubh)r)2}r*2(hUhhhj$2hjh}r+2(h]h]h]h]h]Uentries]r,2(jXM2Crypto.SSL (module)Xmodule-M2Crypto.SSLUNtr-2auhKhhh]ubh)r.2}r/2(hUhhhXV/home/matej/Build/m2crypto/M2Crypto/SSL/__init__.py:docstring of M2Crypto.SSL.SSLErrorr02hjh}r12(h]h]h]h]h]Uentries]r22(jXSSLErrorr32h2hBases: :class:`M2Crypto.SSL.SSLError`, :class:`socket.timeout`hj2hj2hj h}r2(h]h]h]h]h]uhKhhh]r2(hXBases: r2r2}r2(hUhNhNhhhj2ubh)r2}r2(hX:class:`M2Crypto.SSL.SSLError`r2hj2hhhhh}r2(UreftypeXclasshhXM2Crypto.SSL.SSLErrorU refdomainXpyr2h]h]U refexplicith]h]h]hhhj2hhuhKh]r2h)r2}r2(hj2h}r2(h]h]r2(hj2Xpy-classr2eh]h]h]uhj2h]r2hXM2Crypto.SSL.SSLErrorr2r2}r2(hUhj2ubahhubaubhX, r2r2}r2(hUhNhNhhhj2ubh)r2}r2(hX:class:`socket.timeout`r2hj2hhhhh}r2(UreftypeXclasshhXsocket.timeoutU refdomainXpyr2h]h]U refexplicith]h]h]hhhj2hhuhKh]r2h)r2}r2(hj2h}r2(h]h]r2(hj2Xpy-classr2eh]h]h]uhj2h]r2hXsocket.timeoutr2r2}r2(hUhj2ubahhubaubeubaubeubeubhhhUsystem_messager2h}r2(h]UlevelKh]h]r2j2aUsourcehh]h]UlineKUtypeUINFOr2uhKhhh]r2j)r2}r2(hX.Duplicate implicit target name: "ssl package".h}r2(h]h]h]h]h]uhhh]r2hX2Duplicate implicit target name: “ssl package”.r2r2}r2(hUhj2ubahj ubaubaUcurrent_sourcer2NU decorationr2NUautofootnote_startr2KUnameidsr2}r2(hhhhhhh h h h h h h h h h hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhh h h!h!h"h"h#h#h$h$h%h%h&h&h'h'h(h(h)h)h*h*h+h+h,h,h-h-h.h.h/h/h0h0h1h1h2h2h3h3h4h4h5h5h6h6h7h7h8h8h9h9h:h:h;h;hh>h?h?h@h@hAhAhBhBhChChDhDhEhEhFhFhGj$hHhHhIhIhJhJhKhKhLhLhMhMhNhNhOhOhPj0hQhQhRhRhShShThThUhUhVhVhWhWhXhXhYhYhZhZh[h[h\h\h]jG/h^h^h_h_h`h`hahahbhbhchchdhdhehehfj2hghghhj[hihihjhjhkhkhlhlhmhmhnhnhohohphphqhqhrhrhshshththuhuhvhvhwhwhxhxhyhyhzhzh{h{h|h|h}h}h~h~hhhNhhhhhhhhhhhhhjhhhhhhhhhhhhhjD)hhhj&hhhhhhhhhhhhhhhhhhhhhhhj-hhhhhhhhhhhhhhhhhhhhuh]r2hahUU transformerr2NU footnote_refsr2}r2Urefnamesr2}r3Usymbol_footnotesr3]r3Uautofootnote_refsr3]r3Usymbol_footnote_refsr3]r3U citationsr3]r3hhU current_liner 3NUtransform_messagesr 3]r 3h)r 3}r 3(hUh}r3(h]UlevelKh]h]Usourcej$2h]h]UlineKUtypej2uh]r3j)r3}r3(hUh}r3(h]h]h]h]h]uhj 3h]r3hX9Hyperlink target "module-M2Crypto.SSL" is not referenced.r3r3}r3(hUhj3ubahj ubahj2ubaUreporterr3NUid_startr3KU autofootnotesr3]r3U citation_refsr3}r3Uindirect_targetsr3]r3Usettingsr3(cdocutils.frontend Values r 3or!3}r"3(Ufootnote_backlinksr#3KUrecord_dependenciesr$3NU rfc_base_urlr%3Uhttps://tools.ietf.org/html/r&3U tracebackr'3Upep_referencesr(3NUstrip_commentsr)3NU toc_backlinksr*3Uentryr+3U language_coder,3Uenr-3U datestampr.3NU report_levelr/3KU _destinationr03NU halt_levelr13KU strip_classesr23NhNUerror_encoding_error_handlerr33Ubackslashreplacer43Udebugr53NUembed_stylesheetr63Uoutput_encoding_error_handlerr73Ustrictr83U sectnum_xformr93KUdump_transformsr:3NU docinfo_xformr;3KUwarning_streamr<3NUpep_file_url_templater=3Upep-%04dr>3Uexit_status_levelr?3KUconfigr@3NUstrict_visitorrA3NUcloak_email_addressesrB3Utrim_footnote_reference_spacerC3UenvrD3NUdump_pseudo_xmlrE3NUexpose_internalsrF3NUsectsubtitle_xformrG3U source_linkrH3NUrfc_referencesrI3NUoutput_encodingrJ3Uutf-8rK3U source_urlrL3NUinput_encodingrM3U utf-8-sigrN3U_disable_configrO3NU id_prefixrP3UUcharacter_level_inline_markuprQ3U tab_widthrR3KUerror_encodingrS3UUTF-8rT3U_sourcerU3hUgettext_compactrV3U generatorrW3NUdump_internalsrX3NU smart_quotesrY3U pep_base_urlrZ3U https://www.python.org/dev/peps/r[3Usyntax_highlightr\3Ulongr]3Uinput_encoding_error_handlerr^3j83Uauto_id_prefixr_3Uidr`3Udoctitle_xformra3Ustrip_elements_with_classesrb3NU _config_filesrc3]Ufile_insertion_enabledrd3U raw_enabledre3KU dump_settingsrf3NubUsymbol_footnote_startrg3Kh}rh3(hjAhjhj h jM j(2j"2h jTj2j-h j,h j hjhjhAjhjVj$j!2)ri3}rj3(hUhj$hj$hj%2h}rk3(h]h]rl3j$ah]Uismodh]h]uhKhhh]ubhj hjhj, jZj!2)rm3}rn3(hUhjVhjxhj%2h}ro3(h]h]rp3jZah]Uismodh]h]uhKhhh]ubhj+hjhjhj%jG/jB/h j-hjj&j&hj8hj hjhj(hj"hjhjhj *h j!h!j h"j;(h#j h$jh%jG,h&jh'jjhhh(j h)jh*j h+jjjh-jqh.j -h/jn%h0jh1j1h2jh3jh4jh5jh6jh7j+h8jh9j1h:jh;jj1j!2)rq3}rr3(hUhj-hjNhj%2h}rs3(h]h]rt3j1ah]Uismodh]h]uhKhhh]ubhjh?j3j&j!2)ru3}rv3(hUhj&hj'hj%2h}rw3(h]h]rx3j&ah]Uismodh]h]uhKhhh]ubh@j]j2hhBj0hCj!hDjhEj hFj{hHjhIj(hJj"hKjhLj)hMjhNj{ hOjdj-j!2)ry3}rz3(hUhj-hj-hj%2h}r{3(h]h]r|3j-ah]Uismodh]h]uhKhhh]ubhRj hSja1hTjY#j0j0hVj*hWj8hXjhYjs'hZjh[j h\j{h^jh_jrh`j'hajhbj hcj`hdj-jD)j?)hUj_hgj^hijj$j$hjjhkjhlj$hmjhnjhoj,hpj/hqjf hrjyhsjHhtjj[jVhuj,hvjkhwj hxj$hyj hzjC h{jh|j.h}j" h~j ,hj0jF/j!2)r}3}r~3(hUhjB/hjd/hj%2h}r3(h]h]r3jF/ah]Uismodh]h]uhKhhh]ubhj (hjhj8hhhjhj2hQj$jj!2)r3}r3(hUhjhjhj%2h}r3(h]h]r3jah]Uismodh]h]uhKhhh]ubhj hjb-hj.hjX.hj#hejr/hj?j-j-hj!2)r3}r3(hUhhhjhj%2h}r3(h]h]r3hah]Uismodh]h]uhKhhh]ubhj#hjJhjj0j!2)r3}r3(hUhj0hj0hj%2h}r3(h]h]r3j0ah]Uismodh]h]uhKhhh]ubhj\(hj,hji&hj hjh,jKhj'hjhj*hjhj1hjN0jC)j!2)r3}r3(hUhj?)hja)hj%2h}r3(h]h]r3jC)ah]Uismodh]h]uhKhhh]ubhjhj%hj"hj)hj)hj#'hjIuUsubstitution_namesr3}r3hhh}r3(h]h]h]Usourcehh]h]uU footnotesr3]r3Urefidsr3}r3ub.M2Crypto-0.31.0/doc/doctrees/M2Crypto.doctree0000664000175000001440000516026413236336220021154 0ustar matejusers00000000000000cdocutils.nodes document q)q}q(U nametypesq}q(Xauthcookie moduleqNXM2Crypto.EC.EC.pubqX&M2Crypto.X509.X509_Store.set_verify_cbqX%M2Crypto.SMIME.SMIME.unset_x509_storeq XM2Crypto.AuthCookie.mixq X&M2Crypto.EVP.Cipher.m2_cipher_ctx_freeq XM2Crypto.EC.EC.save_pub_key_bioq X!M2Crypto.EVP.MessageDigest.updateq X&M2Crypto.X509.Request.m2_x509_req_freeqXM2Crypto.EC.pub_key_from_paramsqXM2Crypto.SMIME.SMIME.decryptqXM2Crypto.BIO.BIO.bio_ptrqXhttpslib moduleqNX M2Crypto.X509.new_stack_from_derqXM2Crypto.X509.X509.as_textqXM2Crypto.BIO.BIO.readableqX(M2Crypto.X509.X509_Name_Entry.set_objectqX!M2Crypto.SMIME.SMIME.load_key_bioqX"M2Crypto.EC.load_key_string_pubkeyqXM2Crypto.BIO.openfileqXM2Crypto.EVP.PKey.assign_rsaqXM2Crypto.EVP.PKey.as_derqX!M2Crypto.ftpslib.FTP_TLS.auth_sslqXM2Crypto.EC.EC.verify_dsa_asn1qXM2Crypto.EVP.PKey.reset_contextqX!M2Crypto.X509.Request.set_subjectqXM2Crypto.X509.Request.save_pemq XM2Crypto.RSA.RSA.save_key_derq!X&M2Crypto.X509.X509_Extension_Stack.popq"XM2Crypto.Rand.load_fileq#XM2Crypto.EC.EC.sign_dsaq$XM2Crypto.SMIME.smime_load_pkcs7q%XM2Crypto.DSA.DSA_pub.signq&XM2Crypto.SMIME.SMIME.unset_keyq'XM2Crypto.X509.X509_Stack.pushq(XM2Crypto.EVP.PKey.save_keyq)XM2Crypto.X509.X509.m2_x509_freeq*XM2Crypto.ftpslib.FTP_TLS.prot_pq+X subpackagesq,NX!M2Crypto.X509.load_request_stringq-X!M2Crypto.httpslib.HTTPSConnectionq.X"M2Crypto.ASN1.LocalTimezone.tznameq/XM2Crypto.X509.X509.as_pemq0X$M2Crypto.RSA.RSA_pub.private_encryptq1X&M2Crypto.X509.X509_Name_Entry.set_dataq2X1M2Crypto.httpslib.ProxyHTTPSConnection.endheadersq3XM2Crypto.EC.ECq4XM2Crypto.BIO.BIO.write_closeq5X(M2Crypto.AuthCookie.AuthCookie.isExpiredq6XM2Crypto.RSA.RSAq7XM2Crypto.X509.X509_Extensionq8Xm2crypto moduleq9NXM2Crypto.EC.load_pub_keyq:X!M2Crypto.util.passphrase_callbackq;XM2Crypto.BIO.BIO.should_retryqXM2Crypto.SMIME.Cipherq?X#M2Crypto.SMIME.SMIME.set_x509_stackq@X"M2Crypto.m2xmlrpclib.SSL_TransportqAXM2Crypto.AuthCookie.AuthCookieqBX$M2Crypto.RSA.RSA_pub.private_decryptqCX M2Crypto.X509.X509.get_ext_countqDXM2Crypto.RSA.RSA.public_decryptqEX)M2Crypto.X509.X509_Name.m2_x509_name_freeqFXM2Crypto.BIO.BIO.readlineqGXM2Crypto.RSA.RSA.check_keyqHXM2Crypto.ftpslib.FTP_TLSqIXM2Crypto.Engine.EngineErrorqJX)M2Crypto.X509.X509_Extension.set_criticalqKXM2Crypto.EVP.PKey.verify_initqLXM2Crypto.DSA.DSA_pub.save_keyqMX!M2Crypto.X509.Request.get_subjectqNXM2Crypto.EVP.HMAC.digestqOXM2Crypto.ASN1.ASN1_ObjectqPXM2Crypto.EVP.Cipher.finalqQXM2Crypto.ftpslib.FTP_TLS.prot_cqRX M2Crypto.X509.X509.check_purposeqSX M2Crypto.X509.X509.set_not_afterqTX-M2Crypto.ASN1.ASN1_String.m2_asn1_string_freeqUX M2Crypto.EVP.MessageDigest.finalqVX%M2Crypto.SMIME.SMIME.unset_x509_stackqWXm2crypto packageqXNX#M2Crypto.AuthCookie.AuthCookie.dataqYX)M2Crypto.EVP.MessageDigest.m2_md_ctx_freeqZX'M2Crypto.Engine.Engine.load_private_keyq[XM2Crypto.X509.Request.as_derq\XM2Crypto.m2urllib.open_httpsq]X"M2Crypto.Err.get_x509_verify_errorq^XM2Crypto.BIO.BIO.m2_bio_freeq_XM2Crypto.Rand.rand_statusq`XM2Crypto.X509.X509.verifyqaXM2Crypto.DSA.DSA.verify_asn1qbXM2Crypto.RSA.rsa_errorqcX&M2Crypto.X509.Request.set_subject_nameqdXM2Crypto.EC.ECErrorqeXM2Crypto.SMIME.PKCS7qfXM2Crypto.EC.EC.m2_ec_key_freeqgXM2Crypto.AuthCookie.unmix3qhX.M2Crypto.httpslib.ProxyHTTPSConnection.connectqiX$M2Crypto.util.no_passphrase_callbackqjX)M2Crypto.X509.X509_Extension.get_criticalqkXM2Crypto.RSA.load_keyqlXM2Crypto.DH.DH.compute_keyqmX-M2Crypto.m2urllib2.HTTPSHandler.https_requestqnXM2Crypto.BN.randfnameqoXM2Crypto.EVP.Cipher.set_paddingqpX"M2Crypto.BIO.CipherStream.SALT_LENqqX"M2Crypto.SMIME.PKCS7.m2_pkcs7_freeqrX5M2Crypto.X509.X509_Name_Entry.m2_x509_name_entry_freeqsXM2Crypto.EC.EC.check_keyqtXM2Crypto.EC.ec_errorquX M2Crypto.DSA.pub_key_from_paramsqvXM2Crypto.util.pkcs7_padqwXM2Crypto.X509.X509_Name.as_derqxXM2Crypto.EVP.MessageDigestqyX0M2Crypto.httpslib.ProxyHTTPSConnection.putheaderqzXM2Crypto.X509.X509Errorq{XM2Crypto.X509.X509.get_ext_atq|XM2Crypto.EVP.HMAC.finalq}XM2Crypto.DSA.DSAq~X*M2Crypto.m2urllib2.HTTPSHandler.https_openqXM2Crypto.X509.CRL.as_textqXM2Crypto.DSA.load_pub_key_bioqX!M2Crypto.RSA.RSA_pub.save_key_bioqX#M2Crypto.SMIME.SMIME.set_x509_storeqXM2Crypto.util.genparam_callbackqXM2Crypto.SMIME.PKCS7.typeqXM2Crypto.BIO.BIO.tellqXM2Crypto.EVP.PKey.get_rsaqX$M2Crypto.ASN1.ASN1_TIME.set_datetimeqXM2Crypto.SMIME.PKCS7_ErrorqXM2Crypto.RSA.RSA.as_pemqXM2Crypto.RSA.keygen_callbackqX)M2Crypto.httpslib.HTTPSConnection.connectqXM2Crypto.EVP.CipherqXM2Crypto.EVP.PKey.verify_finalqXM2Crypto.DH.load_paramsqXM2Crypto.BIO.MemoryBufferqXM2Crypto.m2urllib2.HTTPSHandlerqX%M2Crypto.ftpslib.FTP_TLS.ntransfercmdqXM2Crypto.X509.X509.get_subjectqX%M2Crypto.X509.X509_Extension.get_nameqXM2Crypto.Engine.Engine.get_idqXM2Crypto.threading.initqX"M2Crypto.X509.X509.get_fingerprintqXM2Crypto.X509.X509.check_caqXM2Crypto.RC4.RC4.rc4_freeqX,M2Crypto.AuthCookie.AuthCookieJar.makeCookieqXM2Crypto.EC.load_keyqXM2Crypto.util.UtilErrorqXM2Crypto.EC.EC_pubqX M2Crypto.ASN1.ASN1_TIME.set_timeqX*M2Crypto.AuthCookie.AuthCookie.headerValueqXM2Crypto.BN.rand_rangeqXM2Crypto.BIO.SSLBioqX asn1 moduleqNX'M2Crypto.X509.X509_Extension_Stack.pushqXM2Crypto.EVP.PKey.m2_pkey_freeqXM2Crypto.Err.get_error_libqX M2Crypto.RSA.RSA.private_encryptqXM2Crypto.Err.M2CryptoErrorqXM2Crypto.util.py3bytesqXM2Crypto.DSA.DSA.check_keyqXM2Crypto.DSA.DSA_pub.sign_asn1qXM2Crypto.BIO.IOBufferqX-M2Crypto.m2xmlrpclib.SSL_Transport.user_agentqXM2Crypto.RSA.RSA_pub.save_keyqXM2Crypto.X509.X509_Name_EntryqXM2Crypto.BIO.BIOqX&M2Crypto.Engine.Engine.ctrl_cmd_stringqXM2Crypto.RSA.RSA.save_key_bioqX"M2Crypto.X509.load_cert_der_stringqXM2Crypto.EC.get_builtin_curvesqXM2Crypto.Err.SSLErrorqXM2Crypto.BIO.FileqXM2Crypto.X509.X509.get_issuerqXM2Crypto.SMIME.SMIME.verifyqXM2Crypto.EVP.PKeyqXM2Crypto.RSA.RSAErrorqXM2Crypto.Err.peek_error_codeqXM2Crypto.Engine.Engine.initqX bio moduleqNXM2Crypto.ASN1.ASN1_IntegerqXM2Crypto.DSA.load_params_bioqXM2Crypto.threading.cleanupqX M2Crypto.X509.X509_Store_ContextqXM2Crypto.EVP.PKey.save_key_bioqXM2Crypto.BN.randqˆX$M2Crypto.X509.X509.set_serial_numberqÈXM2Crypto.DSA.DSA.save_pub_keyqĈXM2Crypto.EC.gen_paramsqňXM2Crypto.BIO.CipherStreamqƈXM2Crypto.EVP.hmacqLjXM2Crypto.ASN1.ASN1_StringqȈXM2Crypto.ASN1.LocalTimezoneqɈXM2Crypto.EVP.load_keyqʈXM2Crypto.Rand.rand_bytesqˈXM2Crypto.DSA.gen_paramsq̈XM2Crypto.X509.X509_Name.nidq͈XM2Crypto.SMIME.text_crlf_bioqΈXM2Crypto.EC.pub_key_from_derqψXM2Crypto.BIO.BIOErrorqЈXM2Crypto.DSA.DSA.save_keyqшX M2Crypto.DSA.DSA.save_params_bioq҈X%M2Crypto.BIO.CipherStream.write_closeqӈXM2Crypto.util.pkcs5_padqԈXM2Crypto.Engine.load_dynamicqՈX(M2Crypto.X509.X509_Name.add_entry_by_txtqֈXM2Crypto.RSA.RSA.public_encryptq׈XM2Crypto.X509.X509.signq؈XM2Crypto.DSA.DSA.verifyqوXM2Crypto.Err.get_errorqڈXM2Crypto.EC.load_pub_key_bioqۈXM2Crypto.RSA.RSA.signq܈XM2Crypto.EVP.PKey.updateq݈XM2Crypto.Err.get_error_reasonqވXM2Crypto.DH.load_params_bioq߈X!M2Crypto.EVP.MessageDigest.digestqX err moduleqNXm2xmlrpclib moduleqNXM2Crypto.EC.EC.save_key_bioqXM2Crypto.DSA.load_key_bioqXM2Crypto.EC.EC.save_pub_keyqXM2Crypto.Engine.EngineqXM2Crypto.X509.X509.set_issuerqX+M2Crypto.X509.X509_Store_Context.get1_chainqXM2Crypto.BIO.File.closeqXM2Crypto.X509.Request.signqX*M2Crypto.X509.X509_Name.get_entries_by_nidqXthreading moduleqNXM2Crypto.DSA.DSA_pub.check_keyqX ec moduleqNX#M2Crypto.X509.x509_store_default_cbqXM2Crypto.X509.X509_StackqXM2Crypto.DSA.load_pub_keyqXM2Crypto.Engine.Engine.get_nameqXM2Crypto.DSA.load_paramsqXM2Crypto.X509.X509.get_pubkeyqXM2Crypto.DH.set_paramsqX"M2Crypto.X509.CRL.m2_x509_crl_freeqX M2Crypto.BIO.IOBuffer.m2_bio_popqX$M2Crypto.AuthCookie.AuthCookie.valueqX M2Crypto.RSA.RSA.sign_rsassa_pssqX engine moduleqNXM2Crypto.RSA.RSA_pub.check_keyqX3M2Crypto.X509.X509_Extension.m2_x509_extension_freeqXM2Crypto.SMIME.load_pkcs7qXM2Crypto.RSA.load_pub_key_bioqXM2Crypto.X509.load_request_bioqXM2Crypto.Err.get_error_coderXM2Crypto.X509.X509.get_extrXM2Crypto.util.bin_to_hexrXM2Crypto.DH.DH.m2_dh_freerX M2Crypto.EVP.PKey.m2_md_ctx_freerXM2Crypto.BIO.BIO.readlinesrXM2Crypto.RSA.gen_keyrX%M2Crypto.ASN1.LocalTimezone.utcoffsetrXM2Crypto.Rand.rand_file_namerXM2Crypto.X509.X509.saver X"M2Crypto.BIO.MemoryBuffer.getvaluer X/M2Crypto.ASN1.ASN1_Integer.m2_asn1_integer_freer XM2Crypto.SMIME.SMIME.writer XM2Crypto.EVP.PKey.sign_updater XM2Crypto.EVP.PKey.get_modulusrXM2Crypto.SMIME.SMIMErXM2Crypto.BIO.BIO.writeablerXM2Crypto.X509.X509.set_subjectrX.M2Crypto.httpslib.HTTPSConnection.default_portrX&M2Crypto.Engine.Engine.load_public_keyrXM2Crypto.EC.load_key_stringrXM2Crypto.DSA.DSA.signrXM2Crypto.EVP.PKey.as_pemrX dsa modulerNXM2Crypto.DSA.DSA.save_key_biorX M2Crypto.X509.Request.set_pubkeyrX!M2Crypto.X509.X509.set_not_beforerX bn modulerNXM2Crypto.X509.X509_Name.as_hashrXM2Crypto.SMIME.load_pkcs7_derrXM2Crypto.SMIME.text_crlfrX4M2Crypto.AuthCookie.AuthCookieJar.isGoodCookieStringrXM2Crypto.BIO.BIO.seekr X(M2Crypto.X509.X509_Name_Entry.get_objectr!XM2Crypto.SMIME.SMIME.encryptr"XM2Crypto.EVP.load_key_bior#XM2Crypto.X509.new_extensionr$XM2Crypto.DH.DH.gen_keyr%XM2Crypto.ASN1.LocalTimezone.dstr&XM2Crypto.SMIME.SMIME_Errorr'XM2Crypto.EVP.PKey.sizer(X"M2Crypto.EVP.HMAC.m2_hmac_ctx_freer)XM2Crypto.RC4.RC4.set_keyr*XM2Crypto.X509.X509.as_derr+XM2Crypto.EVP.Cipher.updater,X#M2Crypto.AuthCookie.AuthCookie.namer-X1M2Crypto.X509.X509_Store_Context.get_current_certr.X x509 moduler/NX"M2Crypto.BIO.MemoryBuffer.read_allr0X#M2Crypto.X509.X509.set_subject_namer1X-M2Crypto.httpslib.HTTPSConnection.get_sessionr2XM2Crypto.EC.EC_pub.get_keyr3XM2Crypto.EVP.HMAC.updater4XM2Crypto.X509.load_certr5XM2Crypto.RSA.new_pub_keyr6XM2Crypto.Rand.save_filer7XM2Crypto.Err.get_error_messager8X smime moduler9NX&M2Crypto.httpslib.ProxyHTTPSConnectionr:XM2Crypto.X509.X509_Stack.as_derr;XM2Crypto.BIO.BIO.flushr<X!M2Crypto.DSA.DSA.save_pub_key_bior=XM2Crypto.X509.X509_Name.as_textr>X util moduler?NXM2Crypto.EC.load_key_bior@Xm2urllib modulerANXM2Crypto.DSA.DSA.save_paramsrBXM2Crypto.BIO.File.flushrCXM2Crypto.DSA.set_paramsrDXftpslib modulerENXM2Crypto.DSA.DSA.sign_asn1rFX!M2Crypto.ftpslib.FTP_TLS.auth_tlsrGXM2Crypto.SMIME.SMIME.set_cipherrHXM2Crypto.util.octx_to_numrIX!M2Crypto.AuthCookie.AuthCookieJarrJX M2Crypto.RSA.RSA.private_decryptrKX-M2Crypto.httpslib.HTTPSConnection.set_sessionrLX m2 modulerMNXM2Crypto.BIO.IOBuffer.closerNXM2Crypto.RC4.RC4.updaterOX M2Crypto.BIO.SSLBio.do_handshakerPX%M2Crypto.AuthCookie.AuthCookie.outputrQXM2Crypto.SMIME.PKCS7.write_derrRXM2Crypto.EVP.PKey.sign_finalrSXM2Crypto.EC.EC.save_keyrTX M2Crypto.EVP.load_key_bio_pubkeyrUXM2Crypto.DSA.DSAErrorrVXM2Crypto.X509.Request.as_textrWXM2Crypto.AuthCookie.unmixrXXM2Crypto.RSA.RSA.save_keyrYXM2Crypto.SMIME.load_pkcs7_biorZXM2Crypto.X509.CRLr[XM2Crypto.RSA.RSA.m2_rsa_freer\XM2Crypto.DH.DH.check_paramsr]X1M2Crypto.httpslib.ProxyHTTPSConnection.putrequestr^X rand moduler_NXM2Crypto.EC.EC_pub.save_keyr`XM2Crypto.X509.Request.saveraX!M2Crypto.X509.X509_Store.add_certrbXM2Crypto.Rand.rand_addrcX"M2Crypto.X509.X509_Extension_StackrdXM2Crypto.SMIME.PKCS7.writereX0M2Crypto.X509.X509_Store_Context.get_error_depthrfX7M2Crypto.X509.X509_Store_Context.m2_x509_store_ctx_freergXM2Crypto.X509.Request.as_pemrhXM2Crypto.EC.EC.compute_dh_keyriX#M2Crypto.Engine.load_dynamic_enginerjX#M2Crypto.X509.X509_Name.entry_countrkXM2Crypto.DH.DHrlXM2Crypto.RSA.RSA_pubrmXM2Crypto.BIO.MemoryBuffer.closernX!M2Crypto.X509.Request.set_versionroX#M2Crypto.EVP.load_key_string_pubkeyrpXM2Crypto.X509.load_cert_biorqXM2Crypto.DH.DHErrorrrX-M2Crypto.ASN1.ASN1_Object.m2_asn1_object_freersXM2Crypto.Rand.rand_seedrtXM2Crypto.RSA.load_key_stringruXM2Crypto.DH.gen_paramsrvX"M2Crypto.X509.X509_Store.load_inforwXM2Crypto.EVP.HMAC.resetrxXM2Crypto.util.py3strryX!M2Crypto.DSA.DSA_pub.save_key_biorzX rsa moduler{NX+M2Crypto.X509.X509_Store.m2_x509_store_freer|XM2Crypto.X509.X509_Namer}X.M2Crypto.AuthCookie.AuthCookieJar.isGoodCookier~XM2Crypto.X509.X509.set_versionrXM2Crypto.Rand.rand_pseudo_bytesrXM2Crypto.BIO.CipherStream.closerX+M2Crypto.X509.X509_Name_Entry.create_by_txtrXM2Crypto.RSA.RSA.pubrX!M2Crypto.SMIME.SMIME.unset_cipherrX rc4 modulerNXM2Crypto.Engine.Engine.finishrXM2Crypto.X509.load_requestrXM2Crypto.ASN1.ASN1_UTCTIMErX!M2Crypto.SMIME.load_pkcs7_bio_derrX%M2Crypto.BIO.MemoryBuffer.write_closerX'M2Crypto.X509.X509_Store.load_locationsrXcallback modulerNX)M2Crypto.ASN1.ASN1_TIME.m2_asn1_time_freerX*M2Crypto.m2xmlrpclib.SSL_Transport.requestrXM2Crypto.DSA.load_keyrX dh modulerNX"M2Crypto.Engine.Engine.set_defaultrXm2urllib2 modulerNX'M2Crypto.httpslib.HTTPSConnection.closerXM2Crypto.DSA.DSA.gen_keyrXM2Crypto.Err.get_error_funcrX$M2Crypto.ASN1.ASN1_TIME.get_datetimerXM2Crypto.X509.X509.add_extrXM2Crypto.Engine.cleanuprX M2Crypto.X509.Request.get_pubkeyrXM2Crypto.BIO.BIO.writerX%M2Crypto.X509.load_request_der_stringrX'M2Crypto.Engine.Engine.load_certificaterXM2Crypto.EC.EC.verify_dsarX!M2Crypto.BIO.IOBuffer.m2_bio_freerX"M2Crypto.AuthCookie.AuthCookie.macrX%M2Crypto.BIO.CipherStream.m2_bio_freerX&M2Crypto.X509.X509_Extension.get_valuerXM2Crypto.m2urllib2.build_openerrX<M2Crypto.X509.X509_Extension_Stack.m2_sk_x509_extension_freerX M2Crypto.X509.X509.get_not_afterrXM2Crypto.DSA.DSA.m2_dsa_freerXM2Crypto.EVP.PKey.finalrX!M2Crypto.X509.X509.get_not_beforerX%M2Crypto.Engine.Engine.m2_engine_freerX!M2Crypto.X509.Request.get_versionrX!M2Crypto.ASN1.ASN1_String.as_textrXM2Crypto.EC.EC.sign_dsa_asn1rXM2Crypto.EVP.HMACrXM2Crypto.X509.RequestrXM2Crypto.RC4.RC4.finalrXM2Crypto.RC4.RC4rXM2Crypto.X509.X509.set_pubkeyrX(M2Crypto.X509.X509_Stack.m2_sk_x509_freerXM2Crypto.DSA.DSA_pubrX%M2Crypto.AuthCookie.AuthCookie.expiryrXM2Crypto.X509.X509.get_versionrXM2Crypto.BIO.MemoryBuffer.readrXM2Crypto.BIO.File.resetrX$M2Crypto.X509.X509.get_serial_numberrX$M2Crypto.X509.Request.add_extensionsrXM2Crypto.SMIME.SMIME.load_keyrXM2Crypto.EVP.PKey.verify_updaterXM2Crypto.X509.X509_Stack.poprXM2Crypto.EVP.pbkdf2rXM2Crypto.EC.EC.as_pemrX evp modulerNXM2Crypto.ASN1.ASN1_TIMErXM2Crypto.X509.load_crlrXM2Crypto.RSA.RSA.save_pemrXM2Crypto.BIO.BIO.should_writerXM2Crypto.RSA.load_key_biorXM2Crypto.X509.X509.save_pemrXM2Crypto.BIO.BIO.should_readrX"M2Crypto.ASN1.ASN1_TIME.set_stringrXM2Crypto.DH.DH.print_paramsrX!M2Crypto.RSA.RSA.save_pub_key_biorXM2Crypto.DSA.DSA.set_paramsrX%M2Crypto.util.quiet_genparam_callbackrXM2Crypto.BIO.BIO.closerX"M2Crypto.RSA.RSA.verify_rsassa_pssrXM2Crypto.RSA.RSA.verifyrXM2Crypto.BIO.SSLBio.set_sslrXM2Crypto.EC.EC_pub.save_key_biorXM2Crypto.EVP.EVPErrorrXM2Crypto.X509.load_cert_stringrXM2Crypto.X509.X509_StorerXM2Crypto.X509.Request.verifyrXM2Crypto.BIO.BIO.resetrXM2Crypto.EC.EC.gen_keyrXM2Crypto.RSA.RSA.save_pub_keyrX#M2Crypto.SMIME.smime_load_pkcs7_biorXM2Crypto.EVP.PKey.sign_initrXM2Crypto.EVP.load_key_stringrXM2Crypto.SMIME.SMIME.signrX*M2Crypto.X509.X509_Store_Context.get_errorrXM2Crypto.BIO.BIO.readrX&M2Crypto.X509.X509_Name_Entry.get_datarX"M2Crypto.X509.X509.set_issuer_namerXM2Crypto.Engine.load_opensslrXM2Crypto.RSA.load_pub_keyrXM2Crypto.EC.EC_pub.get_derrXM2Crypto.BIO.BIO.filenorX!M2Crypto.X509.X509_Store.add_x509rX$M2Crypto.BIO.CipherStream.m2_bio_poprX!M2Crypto.RSA.RSA.save_key_der_biorX$M2Crypto.BIO.CipherStream.set_cipherruUsubstitution_defsr}rUparse_messagesr]rcdocutils.nodes system_message r)r}r(U rawsourcerUUparentrcdocutils.nodes section r)r}r(jUU referencedrKjj)r}r(jUjKjhUsourcerX+/home/matej/Build/m2crypto/doc/M2Crypto.rstrUtagnamerUsectionrU attributesr}r(Udupnamesr]rXm2crypto packageraUclassesr]Ubackrefsr]Uidsr]rUm2crypto-packageraUnamesr]uUlinerKUdocumentrhUchildrenr]r(cdocutils.nodes title r )r }r (jXM2Crypto Packager jjjjjUtitler j}r(j]j]j]j]j]ujKjhj]rcdocutils.nodes Text rXM2Crypto Packagerr}r(jUjNjNjhjj ubaubjj)r}r(jUjjjjjjj}r(j]j]j]j]r(Xmodule-M2Crypto.ASN1rU asn1-modulerej]rhaujK jhj]r(j )r}r(jX:mod:`ASN1` Modulerjjjjjj j}r(j]j]j]j]j]ujK jhj]r (csphinx.addnodes pending_xref r!)r"}r#(jX :mod:`ASN1`r$jjjjjU pending_xrefr%j}r&(UreftypeXmodUrefwarnr'U reftargetr(XASN1U refdomainXpyr)j]j]U refexplicitj]j]j]Urefdocr*XM2Cryptor+Upy:classr,NU py:moduler-XM2Crypto.__init__r.ujK j]r/cdocutils.nodes literal r0)r1}r2(jj$j}r3(j]j]r4(Uxrefr5j)Xpy-modr6ej]j]j]ujj"j]r7jXASN1r8r9}r:(jUjj1ubajUliteralr;ubaubjX Moduler<r=}r>(jUjNjNjhjjubeubcsphinx.addnodes index r?)r@}rA(jUjjjXS/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_IntegerrBjUindexrCj}rD(j]j]j]j]j]Uentries]rE(UsinglerFXM2Crypto.ASN1 (module)Xmodule-M2Crypto.ASN1UNtrGaujKjhj]ubj?)rH}rI(jUjjjNjjCj}rJ(j]j]j]j]j]Uentries]rK(jFX%ASN1_Integer (class in M2Crypto.ASN1)hUNtrLaujNjhj]ubcsphinx.addnodes desc rM)rN}rO(jUjjjNjUdescrPj}rQ(UnoindexrRUdomainrSXpyj]j]j]j]j]UobjtyperTXclassrUUdesctyperVjUujNjhj]rW(csphinx.addnodes desc_signature rX)rY}rZ(jX ASN1_Integer(asn1int, _pyfree=0)jjNjXS/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_Integerr[jUdesc_signaturer\j}r](j]r^haUmoduler_cdocutils.nodes reprunicode r`X M2Crypto.ASN1rarb}rcbj]j]j]j]rdhaUfullnamereX ASN1_IntegerrfUclassrgUUfirstrhujNjhj]ri(csphinx.addnodes desc_annotation rj)rk}rl(jXclass jjYjj[jUdesc_annotationrmj}rn(U xml:spaceroUpreserverpj]j]j]j]j]ujNjhj]rqjXclass rrrs}rt(jUjNjNjhjjkubaubcsphinx.addnodes desc_addname ru)rv}rw(jXM2Crypto.ASN1.jjYjj[jU desc_addnamerxj}ry(jojpj]j]j]j]j]ujNjhj]rzjXM2Crypto.ASN1.r{r|}r}(jUjNjNjhjjvubaubcsphinx.addnodes desc_name r~)r}r(jjfjjYjj[jU desc_namerj}r(jojpj]j]j]j]j]ujNjhj]rjX ASN1_Integerrr}r(jUjNjNjhjjubaubcsphinx.addnodes desc_parameterlist r)r}r(jXasn1int, _pyfree=0jjYjj[jUdesc_parameterlistrj}r(jojpj]j]j]j]j]ujNjhj]r(csphinx.addnodes desc_parameter r)r}r(jXasn1intj}r(jojpj]j]j]j]j]ujjj]rjXasn1intrr}r(jUjjubajUdesc_parameterrubj)r}r(jX _pyfree=0j}r(jojpj]j]j]j]j]ujjj]rjX _pyfree=0rr}r(jUjjubajjubeubcsphinx.addnodes only r)r}r(jUjjYjNjUonlyrj}r(UexprUhtmlrj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypeUviewcoderUrefdocj+U refdomainUstdrj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidjfujjj]rcdocutils.nodes inline r)r}r(jUj}r(j]j]rU viewcode-linkraj]j]j]ujjj]rjX[source]rr}r(jUjjubajUinlinerubajj%ubaubeubcsphinx.addnodes desc_content r)r}r(jUjjNjj[jU desc_contentrj}r(j]j]j]j]j]ujNjhj]r(j?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX:m2_asn1_integer_free() (M2Crypto.ASN1.ASN1_Integer method)j UNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX!ASN1_Integer.m2_asn1_integer_freejjjXh/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_Integer.m2_asn1_integer_freerjj\j}r(j]rj aj_j`X M2Crypto.ASN1rr}rbj]j]j]j]rj ajeX!ASN1_Integer.m2_asn1_integer_freejgjfjhujNjhj]r(j~)r}r(jXm2_asn1_integer_freejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXm2_asn1_integer_freerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX$ASN1_Object (class in M2Crypto.ASN1)hPUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jXASN1_Object(asn1obj, _pyfree=0)jjjXR/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_Objectrjj\j}r(j]rhPaj_j`X M2Crypto.ASN1rr}rbj]j]j]j]rhPajeX ASN1_ObjectrjgUjhujNjhj]r(jj)r}r(jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jXM2Crypto.ASN1.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.ASN1.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX ASN1_Objectrr}r(jUjNjNjhjjubaubj)r}r(jXasn1obj, _pyfree=0jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r (j)r }r (jXasn1objj}r (jojpj]j]j]j]j]ujjj]r jXasn1objrr}r(jUjj ubajjubj)r}r(jX _pyfree=0j}r(jojpj]j]j]j]j]ujjj]rjX _pyfree=0rr}r(jUjjubajjubeubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidjujjj]rj)r }r!(jUj}r"(j]j]r#jaj]j]j]ujjj]r$jX[source]r%r&}r'(jUjj ubajjubajj%ubaubeubj)r(}r)(jUjjjjjjj}r*(j]j]j]j]j]ujNjhj]r+(j?)r,}r-(jUjj(jNjjCj}r.(j]j]j]j]j]Uentries]r/(jFX8m2_asn1_object_free() (M2Crypto.ASN1.ASN1_Object method)jsUNtr0aujNjhj]ubjM)r1}r2(jUjj(jNjjPj}r3(jRjSXpyj]j]j]j]j]jTXmethodr4jVj4ujNjhj]r5(jX)r6}r7(jXASN1_Object.m2_asn1_object_freejj1jXf/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_Object.m2_asn1_object_freer8jj\j}r9(j]r:jsaj_j`X M2Crypto.ASN1r;r<}r=bj]j]j]j]r>jsajeXASN1_Object.m2_asn1_object_freejgjjhujNjhj]r?(j~)r@}rA(jXm2_asn1_object_freejj6jj8jjj}rB(jojpj]j]j]j]j]ujNjhj]rCjXm2_asn1_object_freerDrE}rF(jUjNjNjhjj@ubaubj)rG}rH(jUjj6jj8jjj}rI(jojpj]j]j]j]j]ujNjhj]ubeubj)rJ}rK(jUjj1jj8jjj}rL(j]j]j]j]j]ujNjhj]ubeubeubeubj?)rM}rN(jUjjjNjjCj}rO(j]j]j]j]j]Uentries]rP(jFX$ASN1_String (class in M2Crypto.ASN1)hUNtrQaujNjhj]ubjM)rR}rS(jUjjjNjjPj}rT(jRjSXpyj]j]j]j]j]jTXclassrUjVjUujNjhj]rV(jX)rW}rX(jXASN1_String(asn1str, _pyfree=0)jjRjXR/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_StringrYjj\j}rZ(j]r[haj_j`X M2Crypto.ASN1r\r]}r^bj]j]j]j]r_hajeX ASN1_Stringr`jgUjhujNjhj]ra(jj)rb}rc(jXclass jjWjjYjjmj}rd(jojpj]j]j]j]j]ujNjhj]rejXclass rfrg}rh(jUjNjNjhjjbubaubju)ri}rj(jXM2Crypto.ASN1.jjWjjYjjxj}rk(jojpj]j]j]j]j]ujNjhj]rljXM2Crypto.ASN1.rmrn}ro(jUjNjNjhjjiubaubj~)rp}rq(jj`jjWjjYjjj}rr(jojpj]j]j]j]j]ujNjhj]rsjX ASN1_Stringrtru}rv(jUjNjNjhjjpubaubj)rw}rx(jXasn1str, _pyfree=0jjWjjYjjj}ry(jojpj]j]j]j]j]ujNjhj]rz(j)r{}r|(jXasn1strj}r}(jojpj]j]j]j]j]ujjwj]r~jXasn1strrr}r(jUjj{ubajjubj)r}r(jX _pyfree=0j}r(jojpj]j]j]j]j]ujjwj]rjX _pyfree=0rr}r(jUjjubajjubeubj)r}r(jUjjWjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidj`ujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjRjjYjjj}r(j]j]j]j]j]ujNjhj]r(j?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX,as_text() (M2Crypto.ASN1.ASN1_String method)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXASN1_String.as_text(flags=0)jjjXZ/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_String.as_textrjj\j}r(j]rjaj_j`X M2Crypto.ASN1rr}rbj]j]j]j]rjajeXASN1_String.as_textrjgj`jhujNjhj]r(j~)r}r(jXas_textjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXas_textrr}r(jUjNjNjhjjubaubj)r}r(jXflags=0jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXflags=0j}r(jojpj]j]j]j]j]ujjj]rjXflags=0rr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(cdocutils.nodes paragraph r)r}r(jX;Output an ASN1_STRING structure according to the set flags.jjjXZ/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_String.as_textjU paragraphrj}r(j]j]j]j]j]ujKjhj]rjX;Output an ASN1_STRING structure according to the set flags.rr}r(jUjNjNjhjjubaubcdocutils.nodes field_list r)r}r(jUjjjNjU field_listrj}r(j]j]j]j]j]ujNjhj]r(cdocutils.nodes field r)r}r(jUj}r(j]j]j]j]j]ujjj]r(cdocutils.nodes field_name r)r}r(jX ParametersjjjjjU field_namerj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubcdocutils.nodes field_body r)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXflags -- determine the format of the output by using predetermined constants, see ASN1_STRING_print_ex(3) manpage for their meaning.j}r(j]j]j]j]j]ujjj]r(csphinx.addnodes literal_strong r)r}r(jXflagsj}r(j]j]U refspecificrj]j]j]ujjj]rjXflagsrr}r(jUjjubajUliteral_strongrubjX – rr }r (jUjjubjX{determine the format of the output by using predetermined constants, see ASN1_STRING_print_ex(3) manpage for their meaning.r r }r (jUjNjNjhjjubejjubajU field_bodyrubejUfieldrubj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r (jX output an ASN1_STRING structure.j}r!(j]j]j]j]j]ujjj]r"jX output an ASN1_STRING structure.r#r$}r%(jUjNjNjhjjubajjubajjubejjubeubeubeubj?)r&}r'(jUjjjNjjCj}r((j]j]j]j]j]Uentries]r)(jFX8m2_asn1_string_free() (M2Crypto.ASN1.ASN1_String method)hUUNtr*aujNjhj]ubjM)r+}r,(jUjjjNjjPj}r-(jRjSXpyj]j]j]j]j]jTXmethodr.jVj.ujNjhj]r/(jX)r0}r1(jXASN1_String.m2_asn1_string_freejj+jXf/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_String.m2_asn1_string_freer2jj\j}r3(j]r4hUaj_j`X M2Crypto.ASN1r5r6}r7bj]j]j]j]r8hUajeXASN1_String.m2_asn1_string_freejgj`jhujNjhj]r9(j~)r:}r;(jXm2_asn1_string_freejj0jj2jjj}r<(jojpj]j]j]j]j]ujNjhj]r=jXm2_asn1_string_freer>r?}r@(jUjNjNjhjj:ubaubj)rA}rB(jUjj0jj2jjj}rC(jojpj]j]j]j]j]ujNjhj]ubeubj)rD}rE(jUjj+jj2jjj}rF(j]j]j]j]j]ujNjhj]ubeubeubeubj?)rG}rH(jUjjjNjjCj}rI(j]j]j]j]j]Uentries]rJ(jFX"ASN1_TIME (class in M2Crypto.ASN1)jUNtrKaujNjhj]ubjM)rL}rM(jUjjjNjjPj}rN(jRjSXpyj]j]j]j]j]jTXclassrOjVjOujNjhj]rP(jX)rQ}rR(jX7ASN1_TIME(asn1_time=None, _pyfree=0, asn1_utctime=None)jjLjXP/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_TIMErSjj\j}rT(j]rUjaj_j`X M2Crypto.ASN1rVrW}rXbj]j]j]j]rYjajeX ASN1_TIMErZjgUjhujNjhj]r[(jj)r\}r](jXclass jjQjjSjjmj}r^(jojpj]j]j]j]j]ujNjhj]r_jXclass r`ra}rb(jUjNjNjhjj\ubaubju)rc}rd(jXM2Crypto.ASN1.jjQjjSjjxj}re(jojpj]j]j]j]j]ujNjhj]rfjXM2Crypto.ASN1.rgrh}ri(jUjNjNjhjjcubaubj~)rj}rk(jjZjjQjjSjjj}rl(jojpj]j]j]j]j]ujNjhj]rmjX ASN1_TIMErnro}rp(jUjNjNjhjjjubaubj)rq}rr(jX,asn1_time=None, _pyfree=0, asn1_utctime=NonejjQjjSjjj}rs(jojpj]j]j]j]j]ujNjhj]rt(j)ru}rv(jXasn1_time=Nonej}rw(jojpj]j]j]j]j]ujjqj]rxjXasn1_time=Noneryrz}r{(jUjjuubajjubj)r|}r}(jX _pyfree=0j}r~(jojpj]j]j]j]j]ujjqj]rjX _pyfree=0rr}r(jUjj|ubajjubj)r}r(jXasn1_utctime=Nonej}r(jojpj]j]j]j]j]ujjqj]rjXasn1_utctime=Nonerr}r(jUjjubajjubeubj)r}r(jUjjQjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1UrefidjZujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjLjjSjjj}r(j]j]j]j]j]ujNjhj]r(j?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX/get_datetime() (M2Crypto.ASN1.ASN1_TIME method)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXASN1_TIME.get_datetime()jjjX]/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_TIME.get_datetimerjj\j}r(j]rjaj_j`X M2Crypto.ASN1rr}rbj]j]j]j]rjajeXASN1_TIME.get_datetimerjgjZjhujNjhj]r(j~)r}r(jX get_datetimejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX get_datetimerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX4m2_asn1_time_free() (M2Crypto.ASN1.ASN1_TIME method)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXASN1_TIME.m2_asn1_time_freejjjXb/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_TIME.m2_asn1_time_freerjj\j}r(j]rjaj_j`X M2Crypto.ASN1rr}rbj]j]j]j]rjajeXASN1_TIME.m2_asn1_time_freejgjZjhujNjhj]r(j~)r}r(jXm2_asn1_time_freejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXm2_asn1_time_freerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX/set_datetime() (M2Crypto.ASN1.ASN1_TIME method)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXASN1_TIME.set_datetime(date)jjjX]/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_TIME.set_datetimerjj\j}r(j]rhaj_j`X M2Crypto.ASN1rr}rbj]j]j]j]rhajeXASN1_TIME.set_datetimerjgjZjhujNjhj]r(j~)r}r(jX set_datetimejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r jX set_datetimer r }r (jUjNjNjhjjubaubj)r }r(jXdatejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXdatej}r(jojpj]j]j]j]j]ujj j]rjXdaterr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidjujjj]rj)r }r!(jUj}r"(j]j]r#jaj]j]j]ujjj]r$jX[source]r%r&}r'(jUjj ubajjubajj%ubaubeubj)r(}r)(jUjjjjjjj}r*(j]j]j]j]j]ujNjhj]ubeubj?)r+}r,(jUjjjX[/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_TIME.set_stringr-jjCj}r.(j]j]j]j]j]Uentries]r/(jFX-set_string() (M2Crypto.ASN1.ASN1_TIME method)jUNtr0aujNjhj]ubjM)r1}r2(jUjjjj-jjPj}r3(jRjSXpyj]j]j]j]j]jTXmethodr4jVj4ujNjhj]r5(jX)r6}r7(jXASN1_TIME.set_string(string)jj1jX[/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_TIME.set_stringr8jj\j}r9(j]r:jaj_j`X M2Crypto.ASN1r;r<}r=bj]j]j]j]r>jajeXASN1_TIME.set_stringr?jgjZjhujNjhj]r@(j~)rA}rB(jX set_stringjj6jj8jjj}rC(jojpj]j]j]j]j]ujNjhj]rDjX set_stringrErF}rG(jUjNjNjhjjAubaubj)rH}rI(jXstringjj6jj8jjj}rJ(jojpj]j]j]j]j]ujNjhj]rKj)rL}rM(jXstringj}rN(jojpj]j]j]j]j]ujjHj]rOjXstringrPrQ}rR(jUjjLubajjubaubj)rS}rT(jUjj6jNjjj}rU(Uexprjj]j]j]j]j]ujNjhj]rVj!)rW}rX(jUj}rY(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidj?ujjSj]rZj)r[}r\(jUj}r](j]j]r^jaj]j]j]ujjWj]r_jX[source]r`ra}rb(jUjj[ubajjubajj%ubaubeubj)rc}rd(jUjj1jj8jjj}re(j]j]j]j]j]ujNjhj]rfj)rg}rh(jXSet time from UTC string.jjcjj-jjj}ri(j]j]j]j]j]ujKjhj]rjjXSet time from UTC string.rkrl}rm(jUjNjNjhjjgubaubaubeubj?)rn}ro(jUjjjXY/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_TIME.set_timerpjjCj}rq(j]j]j]j]j]Uentries]rr(jFX+set_time() (M2Crypto.ASN1.ASN1_TIME method)hUNtrsaujNjhj]ubjM)rt}ru(jUjjjjpjjPj}rv(jRjSXpyj]j]j]j]j]jTXmethodrwjVjwujNjhj]rx(jX)ry}rz(jXASN1_TIME.set_time(time)jjtjXY/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_TIME.set_timer{jj\j}r|(j]r}haj_j`X M2Crypto.ASN1r~r}rbj]j]j]j]rhajeXASN1_TIME.set_timerjgjZjhujNjhj]r(j~)r}r(jXset_timejjyjj{jjj}r(jojpj]j]j]j]j]ujNjhj]rjXset_timerr}r(jUjNjNjhjjubaubj)r}r(jXtimejjyjj{jjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXtimej}r(jojpj]j]j]j]j]ujjj]rjXtimerr}r(jUjjubajjubaubj)r}r(jUjjyjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjtjj{jjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jX(Set time from seconds since epoch (int).jjjjpjjj}r(j]j]j]j]j]ujKjhj]rjX(Set time from seconds since epoch (int).rr}r(jUjNjNjhjjubaubaubeubeubeubj?)r}r(jUjjjUjjCj}r(j]j]j]j]j]Uentries]r(jFX&ASN1_UTCTIME (in module M2Crypto.ASN1)jUNtraujNjhj]ubjM)r}r(jUjjjUjjPj}r(jRjSXpyj]j]j]j]j]jTX attributerjVjujNjhj]r(jX)r}r(jX ASN1_UTCTIMErjjjXS/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.ASN1_UTCTIMErjj\j}r(j]rjaj_j`X M2Crypto.ASN1rr}rbj]j]j]j]rjajejjgUjhujNjhj]r(ju)r}r(jXM2Crypto.ASN1.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.ASN1.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX ASN1_UTCTIMErr}r(jUjNjNjhjjubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jXalias of :class:`ASN1_TIME`jjjUjjj}r(j]j]j]j]j]ujKjhj]r(jX alias of rr}r(jUjNjNjhjjubj!)r}r(jX:class:`ASN1_TIME`rjjjjjj%j}r(UreftypeXclassj'j(X ASN1_TIMEU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,Nj-X M2Crypto.ASN1rujKKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-classrej]j]j]ujjj]rjX ASN1_TIMErr}r(jUjjubajj;ubaubeubaubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX&LocalTimezone (class in M2Crypto.ASN1)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jXLocalTimezone()jjjXT/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.LocalTimezonerjj\j}r(j]rhaj_j`X M2Crypto.ASN1rr}rbj]j]j]j]rhajeX LocalTimezonerjgUjhujNjhj]r(jj)r}r(jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr }r (jUjNjNjhjjubaubju)r }r (jXM2Crypto.ASN1.jjjjjjxj}r (jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.ASN1.rr}r(jUjNjNjhjj ubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX LocalTimezonerr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidjujjj]r j)r!}r"(jUj}r#(j]j]r$jaj]j]j]ujjj]r%jX[source]r&r'}r((jUjj!ubajjubajj%ubaubeubj)r)}r*(jUjjjjjjj}r+(j]j]j]j]j]ujNjhj]r,(j)r-}r.(jXBases: :class:`datetime.tzinfo`jj)jXT/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.LocalTimezonejjj}r/(j]j]j]j]j]ujKjhj]r0(jXBases: r1r2}r3(jUjNjNjhjj-ubj!)r4}r5(jX:class:`datetime.tzinfo`r6jj-jjjj%j}r7(UreftypeXclassj'j(Xdatetime.tzinfoU refdomainXpyr8j]j]U refexplicitj]j]j]j*j+j,jj-jujKPj]r9j0)r:}r;(jj6j}r<(j]j]r=(j5j8Xpy-classr>ej]j]j]ujj4j]r?jXdatetime.tzinfor@rA}rB(jUjj:ubajj;ubaubeubj)rC}rD(jX#Localtimezone from datetime manual.jj)jXT/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.LocalTimezonejjj}rE(j]j]j]j]j]ujKjhj]rFjX#Localtimezone from datetime manual.rGrH}rI(jUjNjNjhjjCubaubj?)rJ}rK(jUjj)jNjjCj}rL(j]j]j]j]j]Uentries]rM(jFX*dst() (M2Crypto.ASN1.LocalTimezone method)j&UNtrNaujNjhj]ubjM)rO}rP(jUjj)jNjjPj}rQ(jRjSXpyj]j]j]j]j]jTXmethodrRjVjRujNjhj]rS(jX)rT}rU(jXLocalTimezone.dst(dt)jjOjXX/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.LocalTimezone.dstrVjj\j}rW(j]rXj&aj_j`X M2Crypto.ASN1rYrZ}r[bj]j]j]j]r\j&ajeXLocalTimezone.dstr]jgjjhujNjhj]r^(j~)r_}r`(jXdstjjTjjVjjj}ra(jojpj]j]j]j]j]ujNjhj]rbjXdstrcrd}re(jUjNjNjhjj_ubaubj)rf}rg(jXdtjjTjjVjjj}rh(jojpj]j]j]j]j]ujNjhj]rij)rj}rk(jXdtj}rl(jojpj]j]j]j]j]ujjfj]rmjXdtrnro}rp(jUjjjubajjubaubj)rq}rr(jUjjTjNjjj}rs(Uexprjj]j]j]j]j]ujNjhj]rtj!)ru}rv(jUj}rw(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidj]ujjqj]rxj)ry}rz(jUj}r{(j]j]r|jaj]j]j]ujjuj]r}jX[source]r~r}r(jUjjyubajjubajj%ubaubeubj)r}r(jUjjOjjVjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjj)jNjjCj}r(j]j]j]j]j]Uentries]r(jFX-tzname() (M2Crypto.ASN1.LocalTimezone method)h/UNtraujNjhj]ubjM)r}r(jUjj)jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXLocalTimezone.tzname(dt)jjjX[/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.LocalTimezone.tznamerjj\j}r(j]rh/aj_j`X M2Crypto.ASN1rr}rbj]j]j]j]rh/ajeXLocalTimezone.tznamerjgjjhujNjhj]r(j~)r}r(jXtznamejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXtznamerr}r(jUjNjNjhjjubaubj)r}r(jXdtjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXdtj}r(jojpj]j]j]j]j]ujjj]rjXdtrr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjj)jNjjCj}r(j]j]j]j]j]Uentries]r(jFX0utcoffset() (M2Crypto.ASN1.LocalTimezone method)jUNtraujNjhj]ubjM)r}r(jUjj)jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXLocalTimezone.utcoffset(dt)jjjX^/home/matej/Build/m2crypto/M2Crypto/ASN1.py:docstring of M2Crypto.ASN1.LocalTimezone.utcoffsetrjj\j}r(j]rjaj_j`X M2Crypto.ASN1rr}rbj]j]j]j]rjajeXLocalTimezone.utcoffsetrjgjjhujNjhj]r(j~)r}r(jX utcoffsetjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX utcoffsetrr}r(jUjNjNjhjjubaubj)r}r(jXdtjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXdtj}r(jojpj]j]j]j]j]ujjj]rjXdtrr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ASN1Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubeubeubeubj)r}r(jUjjjjjjj}r(j]j]j]j]r(Xmodule-M2Crypto.AuthCookierUauthcookie-modulerej]rhaujKjhj]r(j )r}r(jX:mod:`AuthCookie` Modulerjjjjjj j}r(j]j]j]j]j]ujKjhj]r(j!)r}r(jX:mod:`AuthCookie`rjjjjjj%j}r(UreftypeXmodj'j(X AuthCookieU refdomainXpyr j]j]U refexplicitj]j]j]j*j+j,Nj-jujKj]r j0)r }r (jjj}r (j]j]r(j5j Xpy-modrej]j]j]ujjj]rjX AuthCookierr}r(jUjj ubajj;ubaubjX Modulerr}r(jUjNjNjhjjubeubj?)r}r(jUjjjX]/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookierjjCj}r(j]j]j]j]j]Uentries]r(jFXM2Crypto.AuthCookie (module)Xmodule-M2Crypto.AuthCookieUNtraujKjhj]ubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r (jFX)AuthCookie (class in M2Crypto.AuthCookie)hBUNtr!aujNjhj]ubjM)r"}r#(jUjjjNjjPj}r$(jRjSXpyj]j]j]j]j]jTXclassr%jVj%ujNjhj]r&(jX)r'}r((jX$AuthCookie(expiry, data, dough, mac)jj"jX]/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookier)jj\j}r*(j]r+hBaj_j`XM2Crypto.AuthCookier,r-}r.bj]j]j]j]r/hBajeX AuthCookier0jgUjhujNjhj]r1(jj)r2}r3(jXclass jj'jj)jjmj}r4(jojpj]j]j]j]j]ujNjhj]r5jXclass r6r7}r8(jUjNjNjhjj2ubaubju)r9}r:(jXM2Crypto.AuthCookie.jj'jj)jjxj}r;(jojpj]j]j]j]j]ujNjhj]r<jXM2Crypto.AuthCookie.r=r>}r?(jUjNjNjhjj9ubaubj~)r@}rA(jj0jj'jj)jjj}rB(jojpj]j]j]j]j]ujNjhj]rCjX AuthCookierDrE}rF(jUjNjNjhjj@ubaubj)rG}rH(jXexpiry, data, dough, macjj'jj)jjj}rI(jojpj]j]j]j]j]ujNjhj]rJ(j)rK}rL(jXexpiryj}rM(jojpj]j]j]j]j]ujjGj]rNjXexpiryrOrP}rQ(jUjjKubajjubj)rR}rS(jXdataj}rT(jojpj]j]j]j]j]ujjGj]rUjXdatarVrW}rX(jUjjRubajjubj)rY}rZ(jXdoughj}r[(jojpj]j]j]j]j]ujjGj]r\jXdoughr]r^}r_(jUjjYubajjubj)r`}ra(jXmacj}rb(jojpj]j]j]j]j]ujjGj]rcjXmacrdre}rf(jUjj`ubajjubeubj)rg}rh(jUjj'jNjjj}ri(Uexprjj]j]j]j]j]ujNjhj]rjj!)rk}rl(jUj}rm(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidj0ujjgj]rnj)ro}rp(jUj}rq(j]j]rrjaj]j]j]ujjkj]rsjX[source]rtru}rv(jUjjoubajjubajj%ubaubeubj)rw}rx(jUjj"jj)jjj}ry(j]j]j]j]j]ujNjhj]rz(j?)r{}r|(jUjjwjXb/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.datar}jjCj}r~(j]j]j]j]j]Uentries]r(jFX.data() (M2Crypto.AuthCookie.AuthCookie method)hYUNtraujNjhj]ubjM)r}r(jUjjwjj}jjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXAuthCookie.data()jjjXb/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.datarjj\j}r(j]rhYaj_j`XM2Crypto.AuthCookierr}rbj]j]j]j]rhYajeXAuthCookie.datarjgj0jhujNjhj]r(j~)r}r(jXdatajjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXdatarr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jX&Return the data portion of the cookie.jjjj}jjj}r(j]j]j]j]j]ujKjhj]rjX&Return the data portion of the cookie.rr}r(jUjNjNjhjjubaubaubeubj?)r}r(jUjjwjXd/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.expiryrjjCj}r(j]j]j]j]j]Uentries]r(jFX0expiry() (M2Crypto.AuthCookie.AuthCookie method)jUNtraujNjhj]ubjM)r}r(jUjjwjjjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXAuthCookie.expiry()jjjXd/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.expiryrjj\j}r(j]rjaj_j`XM2Crypto.AuthCookierr}rbj]j]j]j]rjajeXAuthCookie.expiryrjgj0jhujNjhj]r(j~)r}r(jXexpiryjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXexpiryrr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jX Return the cookie's expiry time.jjjjjjj}r(j]j]j]j]j]ujKjhj]rjX"Return the cookie’s expiry time.rr}r(jUjNjNjhjjubaubaubeubj?)r}r(jUjjwjNjjCj}r(j]j]j]j]j]Uentries]r(jFX5headerValue() (M2Crypto.AuthCookie.AuthCookie method)hUNtraujNjhj]ubjM)r}r(jUjjwjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXAuthCookie.headerValue()jjjXi/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.headerValuerjj\j}r(j]rhaj_j`XM2Crypto.AuthCookierr}rbj]j]j]j]rhajeXAuthCookie.headerValuerjgj0jhujNjhj]r(j~)r}r(jX headerValuejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r jX headerValuer r }r (jUjNjNjhjjubaubj)r }r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r }r!(jUjjjjjjj}r"(j]j]j]j]j]ujNjhj]ubeubj?)r#}r$(jUjjwjXg/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.isExpiredr%jjCj}r&(j]j]j]j]j]Uentries]r'(jFX3isExpired() (M2Crypto.AuthCookie.AuthCookie method)h6UNtr(aujNjhj]ubjM)r)}r*(jUjjwjj%jjPj}r+(jRjSXpyj]j]j]j]j]jTXmethodr,jVj,ujNjhj]r-(jX)r.}r/(jXAuthCookie.isExpired()jj)jXg/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.isExpiredr0jj\j}r1(j]r2h6aj_j`XM2Crypto.AuthCookier3r4}r5bj]j]j]j]r6h6ajeXAuthCookie.isExpiredr7jgj0jhujNjhj]r8(j~)r9}r:(jX isExpiredjj.jj0jjj}r;(jojpj]j]j]j]j]ujNjhj]r<jX isExpiredr=r>}r?(jUjNjNjhjj9ubaubj)r@}rA(jUjj.jj0jjj}rB(jojpj]j]j]j]j]ujNjhj]ubj)rC}rD(jUjj.jNjjj}rE(Uexprjj]j]j]j]j]ujNjhj]rFj!)rG}rH(jUj}rI(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidj7ujjCj]rJj)rK}rL(jUj}rM(j]j]rNjaj]j]j]ujjGj]rOjX[source]rPrQ}rR(jUjjKubajjubajj%ubaubeubj)rS}rT(jUjj)jj0jjj}rU(j]j]j]j]j]ujNjhj]rVj)rW}rX(jX0Return 1 if the cookie has expired, 0 otherwise.jjSjj%jjj}rY(j]j]j]j]j]ujKjhj]rZjX0Return 1 if the cookie has expired, 0 otherwise.r[r\}r](jUjNjNjhjjWubaubaubeubj?)r^}r_(jUjjwjXa/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.macr`jjCj}ra(j]j]j]j]j]Uentries]rb(jFX-mac() (M2Crypto.AuthCookie.AuthCookie method)jUNtrcaujNjhj]ubjM)rd}re(jUjjwjj`jjPj}rf(jRjSXpyj]j]j]j]j]jTXmethodrgjVjgujNjhj]rh(jX)ri}rj(jXAuthCookie.mac()jjdjXa/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.macrkjj\j}rl(j]rmjaj_j`XM2Crypto.AuthCookiernro}rpbj]j]j]j]rqjajeXAuthCookie.macrrjgj0jhujNjhj]rs(j~)rt}ru(jXmacjjijjkjjj}rv(jojpj]j]j]j]j]ujNjhj]rwjXmacrxry}rz(jUjNjNjhjjtubaubj)r{}r|(jUjjijjkjjj}r}(jojpj]j]j]j]j]ujNjhj]ubj)r~}r(jUjjijNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidjrujj~j]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjdjjkjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jXReturn the cookie's MAC.jjjj`jjj}r(j]j]j]j]j]ujKjhj]rjXReturn the cookie’s MAC.rr}r(jUjNjNjhjjubaubaubeubj?)r}r(jUjjwjNjjCj}r(j]j]j]j]j]Uentries]r(jFX.name() (M2Crypto.AuthCookie.AuthCookie method)j-UNtraujNjhj]ubjM)r}r(jUjjwjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXAuthCookie.name()jjjXb/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.namerjj\j}r(j]rj-aj_j`XM2Crypto.AuthCookierr}rbj]j]j]j]rj-ajeXAuthCookie.namerjgj0jhujNjhj]r(j~)r}r(jXnamejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXnamerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjwjXd/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.outputrjjCj}r(j]j]j]j]j]Uentries]r(jFX0output() (M2Crypto.AuthCookie.AuthCookie method)jQUNtraujNjhj]ubjM)r}r(jUjjwjjjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX'AuthCookie.output(header='Set-Cookie:')jjjXd/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.outputrjj\j}r(j]rjQaj_j`XM2Crypto.AuthCookierr}rbj]j]j]j]rjQajeXAuthCookie.outputrjgj0jhujNjhj]r(j~)r}r(jXoutputjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXoutputrr}r(jUjNjNjhjjubaubj)r}r(jXheader='Set-Cookie:'jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXheader='Set-Cookie:'j}r(jojpj]j]j]j]j]ujjj]rjXheader='Set-Cookie:'rr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]r r }r (jUjjubajjubajj%ubaubeubj)r }r (jUjjjjjjj}r (j]j]j]j]j]ujNjhj]r j)r }r (jX2Return the cookie's output in "Set-Cookie" format.jj jjjjj}r (j]j]j]j]j]ujKjhj]r jX8Return the cookie’s output in “Set-Cookie” format.r r }r (jUjNjNjhjj ubaubaubeubj?)r }r (jUjjwjXc/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.valuer jjCj}r (j]j]j]j]j]Uentries]r (jFX/value() (M2Crypto.AuthCookie.AuthCookie method)hUNtr aujNjhj]ubjM)r }r (jUjjwjj jjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jXAuthCookie.value()jj jXc/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookie.valuer jj\j}r (j]r haj_j`XM2Crypto.AuthCookier r }r bj]j]j]j]r! hajeXAuthCookie.valuer" jgj0jhujNjhj]r# (j~)r$ }r% (jXvaluejj jj jjj}r& (jojpj]j]j]j]j]ujNjhj]r' jXvaluer( r) }r* (jUjNjNjhjj$ ubaubj)r+ }r, (jUjj jj jjj}r- (jojpj]j]j]j]j]ujNjhj]ubj)r. }r/ (jUjj jNjjj}r0 (Uexprjj]j]j]j]j]ujNjhj]r1 j!)r2 }r3 (jUj}r4 (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidj" ujj. j]r5 j)r6 }r7 (jUj}r8 (j]j]r9 jaj]j]j]ujj2 j]r: jX[source]r; r< }r= (jUjj6 ubajjubajj%ubaubeubj)r> }r? (jUjj jj jjj}r@ (j]j]j]j]j]ujNjhj]rA j)rB }rC (jX<Return the cookie's output minus the "Set-Cookie: " portion.jj> jj jjj}rD (j]j]j]j]j]ujKjhj]rE jXBReturn the cookie’s output minus the “Set-Cookie: ” portion.rF rG }rH (jUjNjNjhjjB ubaubaubeubeubeubj?)rI }rJ (jUjjjNjjCj}rK (j]j]j]j]j]Uentries]rL (jFX,AuthCookieJar (class in M2Crypto.AuthCookie)jJUNtrM aujNjhj]ubjM)rN }rO (jUjjjNjjPj}rP (jRjSXpyj]j]j]j]j]jTXclassrQ jVjQ ujNjhj]rR (jX)rS }rT (jXAuthCookieJar()jjN jX`/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookieJarrU jj\j}rV (j]rW jJaj_j`XM2Crypto.AuthCookierX rY }rZ bj]j]j]j]r[ jJajeX AuthCookieJarr\ jgUjhujNjhj]r] (jj)r^ }r_ (jXclass jjS jjU jjmj}r` (jojpj]j]j]j]j]ujNjhj]ra jXclass rb rc }rd (jUjNjNjhjj^ ubaubju)re }rf (jXM2Crypto.AuthCookie.jjS jjU jjxj}rg (jojpj]j]j]j]j]ujNjhj]rh jXM2Crypto.AuthCookie.ri rj }rk (jUjNjNjhjje ubaubj~)rl }rm (jj\ jjS jjU jjj}rn (jojpj]j]j]j]j]ujNjhj]ro jX AuthCookieJarrp rq }rr (jUjNjNjhjjl ubaubj)rs }rt (jUjjS jNjjj}ru (Uexprjj]j]j]j]j]ujNjhj]rv j!)rw }rx (jUj}ry (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidj\ ujjs j]rz j)r{ }r| (jUj}r} (j]j]r~ jaj]j]j]ujjw j]r jX[source]r r }r (jUjj{ ubajjubajj%ubaubeubj)r }r (jUjjN jjU jjj}r (j]j]j]j]j]ujNjhj]r (j?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r (jFX9isGoodCookie() (M2Crypto.AuthCookie.AuthCookieJar method)j~UNtr aujNjhj]ubjM)r }r (jUjj jNjjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jX"AuthCookieJar.isGoodCookie(cookie)jj jXm/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookieJar.isGoodCookier jj\j}r (j]r j~aj_j`XM2Crypto.AuthCookier r }r bj]j]j]j]r j~ajeXAuthCookieJar.isGoodCookier jgj\ jhujNjhj]r (j~)r }r (jX isGoodCookiejj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jX isGoodCookier r }r (jUjNjNjhjj ubaubj)r }r (jXcookiejj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r j)r }r (jXcookiej}r (jojpj]j]j]j]j]ujj j]r jXcookier r }r (jUjj ubajjubaubj)r }r (jUjj jNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r j!)r }r (jUj}r (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidj ujj j]r j)r }r (jUj}r (j]j]r jaj]j]j]ujj j]r jX[source]r r }r (jUjj ubajjubajj%ubaubeubj)r }r (jUjj jj jjj}r (j]j]j]j]j]ujNjhj]ubeubj?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r (jFX?isGoodCookieString() (M2Crypto.AuthCookie.AuthCookieJar method)jUNtr aujNjhj]ubjM)r }r (jUjj jNjjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jX:AuthCookieJar.isGoodCookieString(cookie_str, _debug=False)jj jXs/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookieJar.isGoodCookieStringr jj\j}r (j]r jaj_j`XM2Crypto.AuthCookier r }r bj]j]j]j]r jajeX AuthCookieJar.isGoodCookieStringr jgj\ jhujNjhj]r (j~)r }r (jXisGoodCookieStringjj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jXisGoodCookieStringr r }r (jUjNjNjhjj ubaubj)r }r (jXcookie_str, _debug=Falsejj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r (j)r }r (jX cookie_strj}r (jojpj]j]j]j]j]ujj j]r jX cookie_strr r }r (jUjj ubajjubj)r }r (jX _debug=Falsej}r (jojpj]j]j]j]j]ujj j]r jX _debug=Falser r }r (jUjj ubajjubeubj)r }r (jUjj jNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r j!)r }r (jUj}r (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidj ujj j]r j)r }r (jUj}r (j]j]r jaj]j]j]ujj j]r jX[source]r r }r (jUjj ubajjubajj%ubaubeubj)r }r (jUjj jj jjj}r (j]j]j]j]j]ujNjhj]ubeubj?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r (jFX7makeCookie() (M2Crypto.AuthCookie.AuthCookieJar method)hUNtr aujNjhj]ubjM)r }r (jUjj jNjjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jX&AuthCookieJar.makeCookie(expiry, data)jj jXk/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookieJar.makeCookier jj\j}r (j]r haj_j`XM2Crypto.AuthCookier r }r bj]j]j]j]r hajeXAuthCookieJar.makeCookier jgj\ jhujNjhj]r (j~)r }r (jX makeCookiejj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jX makeCookier r }r (jUjNjNjhjj ubaubj)r }r (jX expiry, datajj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r! (j)r" }r# (jXexpiryj}r$ (jojpj]j]j]j]j]ujj j]r% jXexpiryr& r' }r( (jUjj" ubajjubj)r) }r* (jXdataj}r+ (jojpj]j]j]j]j]ujj j]r, jXdatar- r. }r/ (jUjj) ubajjubeubj)r0 }r1 (jUjj jNjjj}r2 (Uexprjj]j]j]j]j]ujNjhj]r3 j!)r4 }r5 (jUj}r6 (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidj ujj0 j]r7 j)r8 }r9 (jUj}r: (j]j]r; jaj]j]j]ujj4 j]r< jX[source]r= r> }r? (jUjj8 ubajjubajj%ubaubeubj)r@ }rA (jUjj jj jjj}rB (j]j]j]j]j]ujNjhj]rC (j)rD }rE (jX Make a cookiejj@ jXk/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.AuthCookieJar.makeCookiejjj}rF (j]j]j]j]j]ujKjhj]rG jX Make a cookierH rI }rJ (jUjNjNjhjjD ubaubj)rK }rL (jUjj@ jNjjj}rM (j]j]j]j]j]ujNjhj]rN (j)rO }rP (jUj}rQ (j]j]j]j]j]ujjK j]rR (j)rS }rT (jX ParametersjjO jj jjj}rU (j]j]j]j]j]ujKj]rV jX ParametersrW rX }rY (jUjjS ubaubj)rZ }r[ (jUj}r\ (j]j]j]j]j]ujjO j]r] cdocutils.nodes bullet_list r^ )r_ }r` (jUj}ra (j]j]j]j]j]ujjZ j]rb (cdocutils.nodes list_item rc )rd }re (jUj}rf (j]j]j]j]j]ujj_ j]rg j)rh }ri (jX,expiry -- expiration time (float in seconds)j}rj (j]j]j]j]j]ujjd j]rk (j)rl }rm (jXexpiryj}rn (j]j]jj]j]j]ujjh j]ro jXexpiryrp rq }rr (jUjjl ubajjubjX – rs rt }ru (jUjjh ubjX"expiration time (float in seconds)rv rw }rx (jUjNjNjhjjh ubejjubajU list_itemry ubjc )rz }r{ (jUj}r| (j]j]j]j]j]ujj_ j]r} j)r~ }r (jXdata -- cookie contentj}r (j]j]j]j]j]ujjz j]r (j)r }r (jXdataj}r (j]j]jj]j]j]ujj~ j]r jXdatar r }r (jUjj ubajjubjX – r r }r (jUjj~ ubjXcookie contentr r }r (jUjNjNjhjj~ ubejjubajjy ubejU bullet_listr ubajjubejjubj)r }r (jUj}r (j]j]j]j]j]ujjK j]r (j)r }r (jXReturnsjj jj jjj}r (j]j]j]j]j]ujKj]r jXReturnsr r }r (jUjj ubaubj)r }r (jUj}r (j]j]j]j]j]ujj j]r j)r }r (jXAuthCookie objectj}r (j]j]j]j]j]ujj j]r jXAuthCookie objectr r }r (jUjNjNjhjj ubajjubajjubejjubeubeubeubeubeubj?)r }r (jUjjjNjjCj}r (j]j]j]j]j]Uentries]r (jFX%mix() (in module M2Crypto.AuthCookie)h UNtr aujNjhj]ubjM)r }r (jUjjjNjjPj}r (jRjSXpyj]j]j]j]j]jTXfunctionr jVj ujNjhj]r (jX)r }r (jX2mix(expiry, data, format='exp=%f&data=%s&digest=')jj jXV/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.mixr jj\j}r (j]r h aj_j`XM2Crypto.AuthCookier r }r bj]j]j]j]r h ajeXmixr jgUjhujNjhj]r (ju)r }r (jXM2Crypto.AuthCookie.jj jj jjxj}r (jojpj]j]j]j]j]ujNjhj]r jXM2Crypto.AuthCookie.r r }r (jUjNjNjhjj ubaubj~)r }r (jj jj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jXmixr r }r (jUjNjNjhjj ubaubj)r }r (jX-expiry, data, format='exp=%f&data=%s&digest='jj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r (j)r }r (jXexpiryj}r (jojpj]j]j]j]j]ujj j]r jXexpiryr r }r (jUjj ubajjubj)r }r (jXdataj}r (jojpj]j]j]j]j]ujj j]r jXdatar r }r (jUjj ubajjubj)r }r (jXformat='exp=%f&data=%s&digest='j}r (jojpj]j]j]j]j]ujj j]r jXformat='exp=%f&data=%s&digest='r r }r (jUjj ubajjubeubj)r }r (jUjj jNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r j!)r }r (jUj}r (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidj ujj j]r j)r }r (jUj}r (j]j]r jaj]j]j]ujj j]r jX[source]r r }r (jUjj ubajjubajj%ubaubeubj)r }r (jUjj jj jjj}r (j]j]j]j]j]ujNjhj]ubeubj?)r }r (jUjjjNjjCj}r (j]j]j]j]j]Uentries]r (jFX'unmix() (in module M2Crypto.AuthCookie)jXUNtr aujNjhj]ubjM)r }r (jUjjjNjjPj}r (jRjSXpyj]j]j]j]j]jTXfunctionr jVj ujNjhj]r (jX)r }r (jX-unmix(dough, regex=<_sre.SRE_Pattern object>)jj jXX/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.unmixr jj\j}r (j]r jXaj_j`XM2Crypto.AuthCookier r }r bj]j]j]j]r jXajeXunmixr jgUjhujNjhj]r (ju)r }r (jXM2Crypto.AuthCookie.jj jj jjxj}r (jojpj]j]j]j]j]ujNjhj]r jXM2Crypto.AuthCookie.r r }r (jUjNjNjhjj ubaubj~)r }r (jj jj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jXunmixr r }r (jUjNjNjhjj ubaubj)r }r (jX&dough, regex=<_sre.SRE_Pattern object>jj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r (j)r }r (jXdoughj}r (jojpj]j]j]j]j]ujj j]r jXdoughr r! }r" (jUjj ubajjubj)r# }r$ (jXregex=<_sre.SRE_Pattern object>j}r% (jojpj]j]j]j]j]ujj j]r& jXregex=<_sre.SRE_Pattern object>r' r( }r) (jUjj# ubajjubeubj)r* }r+ (jUjj jNjjj}r, (Uexprjj]j]j]j]j]ujNjhj]r- j!)r. }r/ (jUj}r0 (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidj ujj* j]r1 j)r2 }r3 (jUj}r4 (j]j]r5 jaj]j]j]ujj. j]r6 jX[source]r7 r8 }r9 (jUjj2 ubajjubajj%ubaubeubj)r: }r; (jUjj jj jjj}r< (j]j]j]j]j]ujNjhj]ubeubj?)r= }r> (jUjjjNjjCj}r? (j]j]j]j]j]Uentries]r@ (jFX(unmix3() (in module M2Crypto.AuthCookie)hhUNtrA aujNjhj]ubjM)rB }rC (jUjjjNjjPj}rD (jRjSXpyj]j]j]j]j]jTXfunctionrE jVjE ujNjhj]rF (jX)rG }rH (jX.unmix3(dough, regex=<_sre.SRE_Pattern object>)jjB jXY/home/matej/Build/m2crypto/M2Crypto/AuthCookie.py:docstring of M2Crypto.AuthCookie.unmix3rI jj\j}rJ (j]rK hhaj_j`XM2Crypto.AuthCookierL rM }rN bj]j]j]j]rO hhajeXunmix3rP jgUjhujNjhj]rQ (ju)rR }rS (jXM2Crypto.AuthCookie.jjG jjI jjxj}rT (jojpj]j]j]j]j]ujNjhj]rU jXM2Crypto.AuthCookie.rV rW }rX (jUjNjNjhjjR ubaubj~)rY }rZ (jjP jjG jjI jjj}r[ (jojpj]j]j]j]j]ujNjhj]r\ jXunmix3r] r^ }r_ (jUjNjNjhjjY ubaubj)r` }ra (jX&dough, regex=<_sre.SRE_Pattern object>jjG jjI jjj}rb (jojpj]j]j]j]j]ujNjhj]rc (j)rd }re (jXdoughj}rf (jojpj]j]j]j]j]ujj` j]rg jXdoughrh ri }rj (jUjjd ubajjubj)rk }rl (jXregex=<_sre.SRE_Pattern object>j}rm (jojpj]j]j]j]j]ujj` j]rn jXregex=<_sre.SRE_Pattern object>ro rp }rq (jUjjk ubajjubeubj)rr }rs (jUjjG jNjjj}rt (Uexprjj]j]j]j]j]ujNjhj]ru j!)rv }rw (jUj}rx (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/AuthCookieUrefidjP ujjr j]ry j)rz }r{ (jUj}r| (j]j]r} jaj]j]j]ujjv j]r~ jX[source]r r }r (jUjjz ubajjubajj%ubaubeubj)r }r (jUjjB jjI jjj}r (j]j]j]j]j]ujNjhj]ubeubeubj)r }r (jUjjjjjjj}r (j]j]j]j]r (Xmodule-M2Crypto.BIOr U bio-moduler ej]r haujKjhj]r (j )r }r (jX:mod:`BIO` Moduler jj jjjj j}r (j]j]j]j]j]ujKjhj]r (j!)r }r (jX :mod:`BIO`r jj jjjj%j}r (UreftypeXmodj'j(XBIOU refdomainXpyr j]j]U refexplicitj]j]j]j*j+j,Nj-XM2Crypto.AuthCookier ujKj]r j0)r }r (jj j}r (j]j]r (j5j Xpy-modr ej]j]j]ujj j]r jXBIOr r }r (jUjj ubajj;ubaubjX Moduler r }r (jUjNjNjhjj ubeubj?)r }r (jUjj jXH/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIOr jjCj}r (j]j]j]j]j]Uentries]r (jFXM2Crypto.BIO (module)Xmodule-M2Crypto.BIOUNtr aujKjhj]ubj?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r (jFXBIO (class in M2Crypto.BIO)hUNtr aujNjhj]ubjM)r }r (jUjj jNjjPj}r (jRjSXpyj]j]j]j]j]jTXclassr jVj ujNjhj]r (jX)r }r (jX(BIO(bio=None, _pyfree=0, _close_cb=None)jj jXH/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIOr jj\j}r (j]r haj_j`X M2Crypto.BIOr r }r bj]j]j]j]r hajeXBIOr jgUjhujNjhj]r (jj)r }r (jXclass jj jj jjmj}r (jojpj]j]j]j]j]ujNjhj]r jXclass r r }r (jUjNjNjhjj ubaubju)r }r (jX M2Crypto.BIO.jj jj jjxj}r (jojpj]j]j]j]j]ujNjhj]r jX M2Crypto.BIO.r r }r (jUjNjNjhjj ubaubj~)r }r (jj jj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jXBIOr r }r (jUjNjNjhjj ubaubj)r }r (jX#bio=None, _pyfree=0, _close_cb=Nonejj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r (j)r }r (jXbio=Nonej}r (jojpj]j]j]j]j]ujj j]r jXbio=Noner r }r (jUjj ubajjubj)r }r (jX _pyfree=0j}r (jojpj]j]j]j]j]ujj j]r jX _pyfree=0r r }r (jUjj ubajjubj)r }r (jX_close_cb=Nonej}r (jojpj]j]j]j]j]ujj j]r jX_close_cb=Noner r }r (jUjj ubajjubeubj)r }r (jUjj jNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r j!)r }r (jUj}r (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidj ujj j]r j)r }r (jUj}r (j]j]r jaj]j]j]ujj j]r jX[source]r r }r (jUjj ubajjubajj%ubaubeubj)r }r (jUjj jj jjj}r (j]j]j]j]j]ujNjhj]r (j)r }r (jXBases: :class:`object`jj jXH/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIOjjj}r (j]j]j]j]j]ujKjhj]r (jXBases: r r }r (jUjNjNjhjj ubj!)r }r (jX:class:`object`r jj jjjj%j}r (UreftypeXclassj'j(XobjectU refdomainXpyr j]j]U refexplicitj]j]j]j*j+j,j j-X M2Crypto.BIOr ujKj]r j0)r }r (jj j}r (j]j]r (j5j Xpy-classr ej]j]j]ujj j]r jXobjectr r }r (jUjj ubajj;ubaubeubj)r }r (jX)Abstract object interface to the BIO API.jj jXH/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIOjjj}r (j]j]j]j]j]ujKjhj]r jX)Abstract object interface to the BIO API.r r }r (jUjNjNjhjj ubaubj?)r }r! (jUjj jNjjCj}r" (j]j]j]j]j]Uentries]r# (jFX#bio_ptr() (M2Crypto.BIO.BIO method)hUNtr$ aujNjhj]ubjM)r% }r& (jUjj jNjjPj}r' (jRjSXpyj]j]j]j]j]jTXmethodr( jVj( ujNjhj]r) (jX)r* }r+ (jX BIO.bio_ptr()jj% jXP/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.bio_ptrr, jj\j}r- (j]r. haj_j`X M2Crypto.BIOr/ r0 }r1 bj]j]j]j]r2 hajeX BIO.bio_ptrjgj jhujNjhj]r3 (j~)r4 }r5 (jXbio_ptrjj* jj, jjj}r6 (jojpj]j]j]j]j]ujNjhj]r7 jXbio_ptrr8 r9 }r: (jUjNjNjhjj4 ubaubj)r; }r< (jUjj* jj, jjj}r= (jojpj]j]j]j]j]ujNjhj]ubeubj)r> }r? (jUjj% jj, jjj}r@ (j]j]j]j]j]ujNjhj]ubeubj?)rA }rB (jUjj jNjjCj}rC (j]j]j]j]j]Uentries]rD (jFX!close() (M2Crypto.BIO.BIO method)jUNtrE aujNjhj]ubjM)rF }rG (jUjj jNjjPj}rH (jRjSXpyj]j]j]j]j]jTXmethodrI jVjI ujNjhj]rJ (jX)rK }rL (jX BIO.close()jjF jXN/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.closerM jj\j}rN (j]rO jaj_j`X M2Crypto.BIOrP rQ }rR bj]j]j]j]rS jajeX BIO.closerT jgj jhujNjhj]rU (j~)rV }rW (jXclosejjK jjM jjj}rX (jojpj]j]j]j]j]ujNjhj]rY jXcloserZ r[ }r\ (jUjNjNjhjjV ubaubj)r] }r^ (jUjjK jjM jjj}r_ (jojpj]j]j]j]j]ujNjhj]ubj)r` }ra (jUjjK jNjjj}rb (Uexprjj]j]j]j]j]ujNjhj]rc j!)rd }re (jUj}rf (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjT ujj` j]rg j)rh }ri (jUj}rj (j]j]rk jaj]j]j]ujjd j]rl jX[source]rm rn }ro (jUjjh ubajjubajj%ubaubeubj)rp }rq (jUjjF jjM jjj}rr (j]j]j]j]j]ujNjhj]ubeubj?)rs }rt (jUjj jNjjCj}ru (j]j]j]j]j]Uentries]rv (jFX"fileno() (M2Crypto.BIO.BIO method)jUNtrw aujNjhj]ubjM)rx }ry (jUjj jNjjPj}rz (jRjSXpyj]j]j]j]j]jTXmethodr{ jVj{ ujNjhj]r| (jX)r} }r~ (jX BIO.fileno()jjx jXO/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.filenor jj\j}r (j]r jaj_j`X M2Crypto.BIOr r }r bj]j]j]j]r jajeX BIO.filenor jgj jhujNjhj]r (j~)r }r (jXfilenojj} jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jXfilenor r }r (jUjNjNjhjj ubaubj)r }r (jUjj} jj jjj}r (jojpj]j]j]j]j]ujNjhj]ubj)r }r (jUjj} jNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r j!)r }r (jUj}r (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidj ujj j]r j)r }r (jUj}r (j]j]r jaj]j]j]ujj j]r jX[source]r r }r (jUjj ubajjubajj%ubaubeubj)r }r (jUjjx jj jjj}r (j]j]j]j]j]ujNjhj]ubeubj?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r (jFX!flush() (M2Crypto.BIO.BIO method)j<UNtr aujNjhj]ubjM)r }r (jUjj jNjjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jX BIO.flush()jj jXN/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.flushr jj\j}r (j]r j<aj_j`X M2Crypto.BIOr r }r bj]j]j]j]r j<ajeX BIO.flushr jgj jhujNjhj]r (j~)r }r (jXflushjj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jXflushr r }r (jUjNjNjhjj ubaubj)r }r (jUjj jj jjj}r (jojpj]j]j]j]j]ujNjhj]ubj)r }r (jUjj jNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r j!)r }r (jUj}r (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidj ujj j]r j)r }r (jUj}r (j]j]r jaj]j]j]ujj j]r jX[source]r r }r (jUjj ubajjubajj%ubaubeubj)r }r (jUjj jj jjj}r (j]j]j]j]j]ujNjhj]r (j)r }r (jXFlush the buffers.jj jXN/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.flushjjj}r (j]j]j]j]j]ujKjhj]r jXFlush the buffers.r r }r (jUjNjNjhjj ubaubj)r }r (jUjj jNjjj}r (j]j]j]j]j]ujNjhj]r j)r }r (jUj}r (j]j]j]j]j]ujj j]r (j)r }r (jXReturnsjj jj jjj}r (j]j]j]j]j]ujKj]r jXReturnsr r }r (jUjj ubaubj)r }r (jUj}r (j]j]j]j]j]ujj j]r j)r }r (jX&1 for success, and 0 or -1 for failurej}r (j]j]j]j]j]ujj j]r jX&1 for success, and 0 or -1 for failurer r }r (jUjNjNjhjj ubajjubajjubejjubaubeubeubj?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r (jFX'm2_bio_free() (M2Crypto.BIO.BIO method)h_UNtr aujNjhj]ubjM)r }r (jUjj jNjjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jXBIO.m2_bio_freejj jXT/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.m2_bio_freer jj\j}r (j]r h_aj_j`X M2Crypto.BIOr r }r bj]j]j]j]r h_ajeXBIO.m2_bio_freejgj jhujNjhj]r (j~)r }r (jX m2_bio_freejj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jX m2_bio_freer r }r (jUjNjNjhjj ubaubj)r }r (jUjj jj jjj}r (jojpj]j]j]j]j]ujNjhj]ubeubj)r }r (jUjj jj jjj}r (j]j]j]j]j]ujNjhj]ubeubj?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r (jFX read() (M2Crypto.BIO.BIO method)jUNtr aujNjhj]ubjM)r }r (jUjj jNjjPj}r! (jRjSXpyj]j]j]j]j]jTXmethodr" jVj" ujNjhj]r# (jX)r$ }r% (jXBIO.read(size=None)jj jXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.readr& jj\j}r' (j]r( jaj_j`X M2Crypto.BIOr) r* }r+ bj]j]j]j]r, jajeXBIO.readr- jgj jhujNjhj]r. (j~)r/ }r0 (jXreadjj$ jj& jjj}r1 (jojpj]j]j]j]j]ujNjhj]r2 jXreadr3 r4 }r5 (jUjNjNjhjj/ ubaubj)r6 }r7 (jX size=Nonejj$ jj& jjj}r8 (jojpj]j]j]j]j]ujNjhj]r9 j)r: }r; (jX size=Nonej}r< (jojpj]j]j]j]j]ujj6 j]r= jX size=Noner> r? }r@ (jUjj: ubajjubaubj)rA }rB (jUjj$ jNjjj}rC (Uexprjj]j]j]j]j]ujNjhj]rD j!)rE }rF (jUj}rG (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidj- ujjA j]rH j)rI }rJ (jUj}rK (j]j]rL jaj]j]j]ujjE j]rM jX[source]rN rO }rP (jUjjI ubajjubajj%ubaubeubj)rQ }rR (jUjj jj& jjj}rS (j]j]j]j]j]ujNjhj]ubeubj?)rT }rU (jUjj jNjjCj}rV (j]j]j]j]j]Uentries]rW (jFX$readable() (M2Crypto.BIO.BIO method)hUNtrX aujNjhj]ubjM)rY }rZ (jUjj jNjjPj}r[ (jRjSXpyj]j]j]j]j]jTXmethodr\ jVj\ ujNjhj]r] (jX)r^ }r_ (jXBIO.readable()jjY jXQ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.readabler` jj\j}ra (j]rb haj_j`X M2Crypto.BIOrc rd }re bj]j]j]j]rf hajeX BIO.readablerg jgj jhujNjhj]rh (j~)ri }rj (jXreadablejj^ jj` jjj}rk (jojpj]j]j]j]j]ujNjhj]rl jXreadablerm rn }ro (jUjNjNjhjji ubaubj)rp }rq (jUjj^ jj` jjj}rr (jojpj]j]j]j]j]ujNjhj]ubj)rs }rt (jUjj^ jNjjj}ru (Uexprjj]j]j]j]j]ujNjhj]rv j!)rw }rx (jUj}ry (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjg ujjs j]rz j)r{ }r| (jUj}r} (j]j]r~ jaj]j]j]ujjw j]r jX[source]r r }r (jUjj{ ubajjubajj%ubaubeubj)r }r (jUjjY jj` jjj}r (j]j]j]j]j]ujNjhj]ubeubj?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r (jFX$readline() (M2Crypto.BIO.BIO method)hGUNtr aujNjhj]ubjM)r }r (jUjj jNjjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jXBIO.readline(size=4096)jj jXQ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.readliner jj\j}r (j]r hGaj_j`X M2Crypto.BIOr r }r bj]j]j]j]r hGajeX BIO.readliner jgj jhujNjhj]r (j~)r }r (jXreadlinejj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jXreadliner r }r (jUjNjNjhjj ubaubj)r }r (jX size=4096jj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r j)r }r (jX size=4096j}r (jojpj]j]j]j]j]ujj j]r jX size=4096r r }r (jUjj ubajjubaubj)r }r (jUjj jNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r j!)r }r (jUj}r (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidj ujj j]r j)r }r (jUj}r (j]j]r jaj]j]j]ujj j]r jX[source]r r }r (jUjj ubajjubajj%ubaubeubj)r }r (jUjj jj jjj}r (j]j]j]j]j]ujNjhj]ubeubj?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r (jFX%readlines() (M2Crypto.BIO.BIO method)jUNtr aujNjhj]ubjM)r }r (jUjj jNjjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jX!BIO.readlines(sizehint='ignored')jj jXR/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.readlinesr jj\j}r (j]r jaj_j`X M2Crypto.BIOr r }r bj]j]j]j]r jajeX BIO.readlinesr jgj jhujNjhj]r (j~)r }r (jX readlinesjj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jX readlinesr r }r (jUjNjNjhjj ubaubj)r }r (jXsizehint='ignored'jj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r j)r }r (jXsizehint='ignored'j}r (jojpj]j]j]j]j]ujj j]r jXsizehint='ignored'r r }r (jUjj ubajjubaubj)r }r (jUjj jNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r j!)r }r (jUj}r (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidj ujj j]r j)r }r (jUj}r (j]j]r jaj]j]j]ujj j]r jX[source]r r }r (jUjj ubajjubajj%ubaubeubj)r }r (jUjj jj jjj}r (j]j]j]j]j]ujNjhj]ubeubj?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r (jFX!reset() (M2Crypto.BIO.BIO method)jUNtr aujNjhj]ubjM)r }r(jUjj jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX BIO.reset()jj jXN/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.resetrjj\j}r(j]rjaj_j`X M2Crypto.BIOr r }r bj]j]j]j]r jajeX BIO.resetr jgj jhujNjhj]r(j~)r}r(jXresetjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXresetrr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidj ujjj]r j)r!}r"(jUj}r#(j]j]r$jaj]j]j]ujjj]r%jX[source]r&r'}r((jUjj!ubajjubajj%ubaubeubj)r)}r*(jUjj jjjjj}r+(j]j]j]j]j]ujNjhj]r,(j)r-}r.(jX!Set the bio to its initial state.jj)jXN/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.resetjjj}r/(j]j]j]j]j]ujKjhj]r0jX!Set the bio to its initial state.r1r2}r3(jUjNjNjhjj-ubaubj)r4}r5(jUjj)jNjjj}r6(j]j]j]j]j]ujNjhj]r7j)r8}r9(jUj}r:(j]j]j]j]j]ujj4j]r;(j)r<}r=(jXReturnsjj8jjjjj}r>(j]j]j]j]j]ujKj]r?jXReturnsr@rA}rB(jUjj<ubaubj)rC}rD(jUj}rE(j]j]j]j]j]ujj8j]rFj)rG}rH(jX&1 for success, and 0 or -1 for failurej}rI(j]j]j]j]j]ujjCj]rJjX&1 for success, and 0 or -1 for failurerKrL}rM(jUjNjNjhjjGubajjubajjubejjubaubeubeubj?)rN}rO(jUjj jXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.seekrPjjCj}rQ(j]j]j]j]j]Uentries]rR(jFX seek() (M2Crypto.BIO.BIO method)j UNtrSaujNjhj]ubjM)rT}rU(jUjj jjPjjPj}rV(jRjSXpyj]j]j]j]j]jTXmethodrWjVjWujNjhj]rX(jX)rY}rZ(jX BIO.seek(off)jjTjXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.seekr[jj\j}r\(j]r]j aj_j`X M2Crypto.BIOr^r_}r`bj]j]j]j]raj ajeXBIO.seekrbjgj jhujNjhj]rc(j~)rd}re(jXseekjjYjj[jjj}rf(jojpj]j]j]j]j]ujNjhj]rgjXseekrhri}rj(jUjNjNjhjjdubaubj)rk}rl(jXoffjjYjj[jjj}rm(jojpj]j]j]j]j]ujNjhj]rnj)ro}rp(jXoffj}rq(jojpj]j]j]j]j]ujjkj]rrjXoffrsrt}ru(jUjjoubajjubaubj)rv}rw(jUjjYjNjjj}rx(Uexprjj]j]j]j]j]ujNjhj]ryj!)rz}r{(jUj}r|(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjbujjvj]r}j)r~}r(jUj}r(j]j]rjaj]j]j]ujjzj]rjX[source]rr}r(jUjj~ubajjubajj%ubaubeubj)r}r(jUjjTjj[jjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jX&Seek to the specified absolute offset.jjjjPjjj}r(j]j]j]j]j]ujKjhj]rjX&Seek to the specified absolute offset.rr}r(jUjNjNjhjjubaubaubeubj?)r}r(jUjj jXT/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.should_readrjjCj}r(j]j]j]j]j]Uentries]r(jFX'should_read() (M2Crypto.BIO.BIO method)jUNtraujNjhj]ubjM)r}r(jUjj jjjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXBIO.should_read()jjjXT/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.should_readrjj\j}r(j]rjaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjajeXBIO.should_readrjgj jhujNjhj]r(j~)r}r(jX should_readjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX should_readrr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jXShould we read more data?jjjjjjj}r(j]j]j]j]j]ujKjhj]rjXShould we read more data?rr}r(jUjNjNjhjjubaubaubeubj?)r}r(jUjj jXU/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.should_retryrjjCj}r(j]j]j]j]j]Uentries]r(jFX(should_retry() (M2Crypto.BIO.BIO method)hjXShould we write more data?r?r@}rA(jUjNjNjhjj;ubaubaubeubj?)rB}rC(jUjj jXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.tellrDjjCj}rE(j]j]j]j]j]Uentries]rF(jFX tell() (M2Crypto.BIO.BIO method)hUNtrGaujNjhj]ubjM)rH}rI(jUjj jjDjjPj}rJ(jRjSXpyj]j]j]j]j]jTXmethodrKjVjKujNjhj]rL(jX)rM}rN(jX BIO.tell()jjHjXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.tellrOjj\j}rP(j]rQhaj_j`X M2Crypto.BIOrRrS}rTbj]j]j]j]rUhajeXBIO.tellrVjgj jhujNjhj]rW(j~)rX}rY(jXtelljjMjjOjjj}rZ(jojpj]j]j]j]j]ujNjhj]r[jXtellr\r]}r^(jUjNjNjhjjXubaubj)r_}r`(jUjjMjjOjjj}ra(jojpj]j]j]j]j]ujNjhj]ubj)rb}rc(jUjjMjNjjj}rd(Uexprjj]j]j]j]j]ujNjhj]rej!)rf}rg(jUj}rh(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjVujjbj]rij)rj}rk(jUj}rl(j]j]rmjaj]j]j]ujjfj]rnjX[source]rorp}rq(jUjjjubajjubajj%ubaubeubj)rr}rs(jUjjHjjOjjj}rt(j]j]j]j]j]ujNjhj]ruj)rv}rw(jXReturn the current offset.jjrjjDjjj}rx(j]j]j]j]j]ujKjhj]ryjXReturn the current offset.rzr{}r|(jUjNjNjhjjvubaubaubeubj?)r}}r~(jUjj jNjjCj}r(j]j]j]j]j]Uentries]r(jFX!write() (M2Crypto.BIO.BIO method)jUNtraujNjhj]ubjM)r}r(jUjj jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXBIO.write(data)jjjXN/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.writerjj\j}r(j]rjaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjajeX BIO.writerjgj jhujNjhj]r(j~)r}r(jXwritejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXwriterr}r(jUjNjNjhjjubaubj)r}r(jXdatajjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXdataj}r(jojpj]j]j]j]j]ujjj]rjXdatarr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jXWrite data to BIO.jjjXN/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.writejjj}r(j]j]j]j]j]ujKjhj]rjXWrite data to BIO.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXGeither data written, or [0, -1] for nothing written, -2 not implementedj}r(j]j]j]j]j]ujjj]rjXGeither data written, or [0, -1] for nothing written, -2 not implementedrr}r(jUjNjNjhjjubajjubajjubejjubaubeubeubj?)r}r(jUjj jNjjCj}r(j]j]j]j]j]Uentries]r(jFX'write_close() (M2Crypto.BIO.BIO method)h5UNtraujNjhj]ubjM)r}r(jUjj jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXBIO.write_close()jjjXT/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.write_closerjj\j}r(j]rh5aj_j`X M2Crypto.BIOrr}rbj]j]j]j]rh5ajeXBIO.write_closerjgj jhujNjhj]r(j~)r}r(jX write_closejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX write_closerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r (jUjjjjjjj}r (j]j]j]j]j]ujNjhj]ubeubj?)r }r (jUjj jNjjCj}r (j]j]j]j]j]Uentries]r(jFX%writeable() (M2Crypto.BIO.BIO method)jUNtraujNjhj]ubjM)r}r(jUjj jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXBIO.writeable()jjjXR/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIO.writeablerjj\j}r(j]rjaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjajeX BIO.writeablerjgj jhujNjhj]r(j~)r }r!(jX writeablejjjjjjj}r"(jojpj]j]j]j]j]ujNjhj]r#jX writeabler$r%}r&(jUjNjNjhjj ubaubj)r'}r((jUjjjjjjj}r)(jojpj]j]j]j]j]ujNjhj]ubj)r*}r+(jUjjjNjjj}r,(Uexprjj]j]j]j]j]ujNjhj]r-j!)r.}r/(jUj}r0(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujj*j]r1j)r2}r3(jUj}r4(j]j]r5jaj]j]j]ujj.j]r6jX[source]r7r8}r9(jUjj2ubajjubajj%ubaubeubj)r:}r;(jUjjjjjjj}r<(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r=}r>(jUjj jXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIOErrorr?jjCj}r@(j]j]j]j]j]Uentries]rA(jFXBIOErrorrBhUNtrCaujNjhj]ubjM)rD}rE(jUjj jj?jjPj}rF(jRjSXpyj]j]j]j]j]jTX exceptionrGjVjGujNjhj]rH(jX)rI}rJ(jjBjjDjXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.BIOErrorrKjj\j}rL(j]rMhaj_j`X M2Crypto.BIOrNrO}rPbj]j]j]j]rQhajejBjgUjhujNjhj]rR(jj)rS}rT(jX exception jjIjjKjjmj}rU(jojpj]j]j]j]j]ujNjhj]rVjX exception rWrX}rY(jUjNjNjhjjSubaubju)rZ}r[(jX M2Crypto.BIO.jjIjjKjjxj}r\(jojpj]j]j]j]j]ujNjhj]r]jX M2Crypto.BIO.r^r_}r`(jUjNjNjhjjZubaubj~)ra}rb(jjBjjIjjKjjj}rc(jojpj]j]j]j]j]ujNjhj]rdjXBIOErrorrerf}rg(jUjNjNjhjjaubaubj)rh}ri(jUjjIjNjjj}rj(Uexprjj]j]j]j]j]ujNjhj]rkj!)rl}rm(jUj}rn(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjBujjhj]roj)rp}rq(jUj}rr(j]j]rsjaj]j]j]ujjlj]rtjX[source]rurv}rw(jUjjpubajjubajj%ubaubeubj)rx}ry(jUjjDjjKjjj}rz(j]j]j]j]j]ujNjhj]r{j)r|}r}(jX$Bases: :class:`exceptions.Exception`jjxjj?jjj}r~(j]j]j]j]j]ujKjhj]r(jXBases: rr}r(jUjNjNjhjj|ubj!)r}r(jX:class:`exceptions.Exception`rjj|jjjj%j}r(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,jBj-j ujKqj]rj0)r}r(jjj}r(j]j]r(j5jXpy-classrej]j]j]ujjj]rjXexceptions.Exceptionrr}r(jUjjubajj;ubaubeubaubeubj?)r}r(jUjj jNjjCj}r(j]j]j]j]j]Uentries]r(jFX$CipherStream (class in M2Crypto.BIO)hUNtraujNjhj]ubjM)r}r(jUjj jNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jXCipherStream(obio)jjjXQ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.CipherStreamrjj\j}r(j]rhaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rhajeX CipherStreamrjgUjhujNjhj]r(jj)r}r(jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jX M2Crypto.BIO.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjX M2Crypto.BIO.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX CipherStreamrr}r(jUjNjNjhjjubaubj)r}r(jXobiojjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXobioj}r(jojpj]j]j]j]j]ujjj]rjXobiorr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX Bases: :class:`M2Crypto.BIO.BIO`jjjXQ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.CipherStreamjjj}r(j]j]j]j]j]ujKjhj]r(jXBases: rr}r(jUjNjNjhjjubj!)r}r(jX:class:`M2Crypto.BIO.BIO`rjjjjjj%j}r(UreftypeXclassj'j(XM2Crypto.BIO.BIOU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,jj-j ujKwj]rj0)r}r(jjj}r(j]j]r(j5jXpy-classrej]j]j]ujjj]rjXM2Crypto.BIO.BIOrr}r(jUjjubajj;ubaubeubj)r}r(jX!Object interface to BIO_f_cipher.jjjXQ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.CipherStreamjjj}r(j]j]j]j]j]ujKjhj]rjX!Object interface to BIO_f_cipher.rr}r(jUjNjNjhjjubaubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX.SALT_LEN (M2Crypto.BIO.CipherStream attribute)hqUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTX attributerjVjujNjhj]r(jX)r}r(jXCipherStream.SALT_LENjjjXZ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.CipherStream.SALT_LENrjj\j}r(j]rhqaj_j`X M2Crypto.BIOrr}r bj]j]j]j]r hqajeXCipherStream.SALT_LENjgjjhujNjhj]r (j~)r }r (jXSALT_LENjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXSALT_LENrr}r(jUjNjNjhjj ubaubjj)r}r(jX = 8jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjX = 8rr}r(jUjNjNjhjjubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r (jFX*close() (M2Crypto.BIO.CipherStream method)jUNtr!aujNjhj]ubjM)r"}r#(jUjjjNjjPj}r$(jRjSXpyj]j]j]j]j]jTXmethodr%jVj%ujNjhj]r&(jX)r'}r((jXCipherStream.close()jj"jXW/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.CipherStream.closer)jj\j}r*(j]r+jaj_j`X M2Crypto.BIOr,r-}r.bj]j]j]j]r/jajeXCipherStream.closer0jgjjhujNjhj]r1(j~)r2}r3(jXclosejj'jj)jjj}r4(jojpj]j]j]j]j]ujNjhj]r5jXcloser6r7}r8(jUjNjNjhjj2ubaubj)r9}r:(jUjj'jj)jjj}r;(jojpj]j]j]j]j]ujNjhj]ubj)r<}r=(jUjj'jNjjj}r>(Uexprjj]j]j]j]j]ujNjhj]r?j!)r@}rA(jUj}rB(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidj0ujj<j]rCj)rD}rE(jUj}rF(j]j]rGjaj]j]j]ujj@j]rHjX[source]rIrJ}rK(jUjjDubajjubajj%ubaubeubj)rL}rM(jUjj"jj)jjj}rN(j]j]j]j]j]ujNjhj]ubeubj?)rO}rP(jUjjjNjjCj}rQ(j]j]j]j]j]Uentries]rR(jFX0m2_bio_free() (M2Crypto.BIO.CipherStream method)jUNtrSaujNjhj]ubjM)rT}rU(jUjjjNjjPj}rV(jRjSXpyj]j]j]j]j]jTXmethodrWjVjWujNjhj]rX(jX)rY}rZ(jXCipherStream.m2_bio_freejjTjX]/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.CipherStream.m2_bio_freer[jj\j}r\(j]r]jaj_j`X M2Crypto.BIOr^r_}r`bj]j]j]j]rajajeXCipherStream.m2_bio_freejgjjhujNjhj]rb(j~)rc}rd(jX m2_bio_freejjYjj[jjj}re(jojpj]j]j]j]j]ujNjhj]rfjX m2_bio_freergrh}ri(jUjNjNjhjjcubaubj)rj}rk(jUjjYjj[jjj}rl(jojpj]j]j]j]j]ujNjhj]ubeubj)rm}rn(jUjjTjj[jjj}ro(j]j]j]j]j]ujNjhj]ubeubj?)rp}rq(jUjjjNjjCj}rr(j]j]j]j]j]Uentries]rs(jFX/m2_bio_pop() (M2Crypto.BIO.CipherStream method)jUNtrtaujNjhj]ubjM)ru}rv(jUjjjNjjPj}rw(jRjSXpyj]j]j]j]j]jTXmethodrxjVjxujNjhj]ry(jX)rz}r{(jXCipherStream.m2_bio_popjjujX\/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.CipherStream.m2_bio_popr|jj\j}r}(j]r~jaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjajeXCipherStream.m2_bio_popjgjjhujNjhj]r(j~)r}r(jX m2_bio_popjjzjj|jjj}r(jojpj]j]j]j]j]ujNjhj]rjX m2_bio_poprr}r(jUjNjNjhjjubaubj)r}r(jUjjzjj|jjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjujj|jjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX/set_cipher() (M2Crypto.BIO.CipherStream method)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX*CipherStream.set_cipher(algo, key, iv, op)jjjX\/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.CipherStream.set_cipherrjj\j}r(j]rjaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjajeXCipherStream.set_cipherrjgjjhujNjhj]r(j~)r}r(jX set_cipherjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX set_cipherrr}r(jUjNjNjhjjubaubj)r}r(jXalgo, key, iv, opjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXalgoj}r(jojpj]j]j]j]j]ujjj]rjXalgorr}r(jUjjubajjubj)r}r(jXkeyj}r(jojpj]j]j]j]j]ujjj]rjXkeyrr}r(jUjjubajjubj)r}r(jXivj}r(jojpj]j]j]j]j]ujjj]rjXivrr}r(jUjjubajjubj)r}r(jXopj}r(jojpj]j]j]j]j]ujjj]rjXoprr}r(jUjjubajjubeubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX0write_close() (M2Crypto.BIO.CipherStream method)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXCipherStream.write_close()jjjX]/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.CipherStream.write_closerjj\j}r(j]rhaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rhajeXCipherStream.write_closerjgjjhujNjhj]r(j~)r}r(jX write_closejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX write_closerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r (j]j]r jaj]j]j]ujjj]r jX[source]r r }r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r}r(jUjj jNjjCj}r(j]j]j]j]j]Uentries]r(jFXFile (class in M2Crypto.BIO)hUNtraujNjhj]ubjM)r}r(jUjj jNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jX'File(pyfile, close_pyfile=1, mode='rb')jjjXI/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.Filerjj\j}r(j]r haj_j`X M2Crypto.BIOr!r"}r#bj]j]j]j]r$hajeXFiler%jgUjhujNjhj]r&(jj)r'}r((jXclass jjjjjjmj}r)(jojpj]j]j]j]j]ujNjhj]r*jXclass r+r,}r-(jUjNjNjhjj'ubaubju)r.}r/(jX M2Crypto.BIO.jjjjjjxj}r0(jojpj]j]j]j]j]ujNjhj]r1jX M2Crypto.BIO.r2r3}r4(jUjNjNjhjj.ubaubj~)r5}r6(jj%jjjjjjj}r7(jojpj]j]j]j]j]ujNjhj]r8jXFiler9r:}r;(jUjNjNjhjj5ubaubj)r<}r=(jX!pyfile, close_pyfile=1, mode='rb'jjjjjjj}r>(jojpj]j]j]j]j]ujNjhj]r?(j)r@}rA(jXpyfilej}rB(jojpj]j]j]j]j]ujj<j]rCjXpyfilerDrE}rF(jUjj@ubajjubj)rG}rH(jXclose_pyfile=1j}rI(jojpj]j]j]j]j]ujj<j]rJjXclose_pyfile=1rKrL}rM(jUjjGubajjubj)rN}rO(jX mode='rb'j}rP(jojpj]j]j]j]j]ujj<j]rQjX mode='rb'rRrS}rT(jUjjNubajjubeubj)rU}rV(jUjjjNjjj}rW(Uexprjj]j]j]j]j]ujNjhj]rXj!)rY}rZ(jUj}r[(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidj%ujjUj]r\j)r]}r^(jUj}r_(j]j]r`jaj]j]j]ujjYj]rajX[source]rbrc}rd(jUjj]ubajjubajj%ubaubeubj)re}rf(jUjjjjjjj}rg(j]j]j]j]j]ujNjhj]rh(j)ri}rj(jX Bases: :class:`M2Crypto.BIO.BIO`jjejXI/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.Filejjj}rk(j]j]j]j]j]ujKjhj]rl(jXBases: rmrn}ro(jUjNjNjhjjiubj!)rp}rq(jX:class:`M2Crypto.BIO.BIO`rrjjijjjj%j}rs(UreftypeXclassj'j(XM2Crypto.BIO.BIOU refdomainXpyrtj]j]U refexplicitj]j]j]j*j+j,j%j-j ujKj]ruj0)rv}rw(jjrj}rx(j]j]ry(j5jtXpy-classrzej]j]j]ujjpj]r{jXM2Crypto.BIO.BIOr|r}}r~(jUjjvubajj;ubaubeubj)r}r(jXObject interface to BIO_s_pyfd.jjejXI/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.Filerjjj}r(j]j]j]j]j]ujKjhj]rjXObject interface to BIO_s_pyfd.rr}r(jUjNjNjhjjubaubj)r}r(jXThis class interfaces Python to OpenSSL functions that expect BIO. For general file manipulation in Python, use Python's builtin file object.jjejjjjj}r(j]j]j]j]j]ujKjhj]rjXThis class interfaces Python to OpenSSL functions that expect BIO. For general file manipulation in Python, use Python’s builtin file object.rr}r(jUjNjNjhjjubaubj?)r}r(jUjjejNjjCj}r(j]j]j]j]j]Uentries]r(jFX"close() (M2Crypto.BIO.File method)hUNtraujNjhj]ubjM)r}r(jUjjejNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX File.close()jjjXO/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.File.closerjj\j}r(j]rhaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rhajeX File.closerjgj%jhujNjhj]r(j~)r}r(jXclosejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXcloserr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjejNjjCj}r(j]j]j]j]j]Uentries]r(jFX"flush() (M2Crypto.BIO.File method)jCUNtraujNjhj]ubjM)r}r(jUjjejNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX File.flush()jjjXO/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.File.flushrjj\j}r(j]rjCaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjCajeX File.flushrjgj%jhujNjhj]r(j~)r}r(jXflushjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXflushrr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjejNjjCj}r(j]j]j]j]j]Uentries]r(jFX"reset() (M2Crypto.BIO.File method)jUNtraujNjhj]ubjM)r}r(jUjjejNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX File.reset()jjjXO/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.File.resetrjj\j}r(j]rjaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjajeX File.resetrjgj%jhujNjhj]r(j~)r}r(jXresetjjjjjjj}r (jojpj]j]j]j]j]ujNjhj]r jXresetr r }r (jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r (jUjjubajjubajj%ubaubeubj)r!}r"(jUjjjjjjj}r#(j]j]j]j]j]ujNjhj]r$(j)r%}r&(jX!Set the bio to its initial state.jj!jXO/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.File.resetjjj}r'(j]j]j]j]j]ujKjhj]r(jX!Set the bio to its initial state.r)r*}r+(jUjNjNjhjj%ubaubj)r,}r-(jUjj!jNjjj}r.(j]j]j]j]j]ujNjhj]r/j)r0}r1(jUj}r2(j]j]j]j]j]ujj,j]r3(j)r4}r5(jXReturnsjj0jjjjj}r6(j]j]j]j]j]ujKj]r7jXReturnsr8r9}r:(jUjj4ubaubj)r;}r<(jUj}r=(j]j]j]j]j]ujj0j]r>j)r?}r@(jX!0 for success, and -1 for failurej}rA(j]j]j]j]j]ujj;j]rBjX!0 for success, and -1 for failurerCrD}rE(jUjNjNjhjj?ubajjubajjubejjubaubeubeubeubeubj?)rF}rG(jUjj jNjjCj}rH(j]j]j]j]j]Uentries]rI(jFX IOBuffer (class in M2Crypto.BIO)hUNtrJaujNjhj]ubjM)rK}rL(jUjj jNjjPj}rM(jRjSXpyj]j]j]j]j]jTXclassrNjVjNujNjhj]rO(jX)rP}rQ(jX*IOBuffer(under_bio, mode='rwb', _pyfree=1)jjKjXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.IOBufferrRjj\j}rS(j]rThaj_j`X M2Crypto.BIOrUrV}rWbj]j]j]j]rXhajeXIOBufferrYjgUjhujNjhj]rZ(jj)r[}r\(jXclass jjPjjRjjmj}r](jojpj]j]j]j]j]ujNjhj]r^jXclass r_r`}ra(jUjNjNjhjj[ubaubju)rb}rc(jX M2Crypto.BIO.jjPjjRjjxj}rd(jojpj]j]j]j]j]ujNjhj]rejX M2Crypto.BIO.rfrg}rh(jUjNjNjhjjbubaubj~)ri}rj(jjYjjPjjRjjj}rk(jojpj]j]j]j]j]ujNjhj]rljXIOBufferrmrn}ro(jUjNjNjhjjiubaubj)rp}rq(jX under_bio, mode='rwb', _pyfree=1jjPjjRjjj}rr(jojpj]j]j]j]j]ujNjhj]rs(j)rt}ru(jX under_bioj}rv(jojpj]j]j]j]j]ujjpj]rwjX under_biorxry}rz(jUjjtubajjubj)r{}r|(jX mode='rwb'j}r}(jojpj]j]j]j]j]ujjpj]r~jX mode='rwb'rr}r(jUjj{ubajjubj)r}r(jX _pyfree=1j}r(jojpj]j]j]j]j]ujjpj]rjX _pyfree=1rr}r(jUjjubajjubeubj)r}r(jUjjPjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjYujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjKjjRjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX Bases: :class:`M2Crypto.BIO.BIO`jjjXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.IOBufferjjj}r(j]j]j]j]j]ujKjhj]r(jXBases: rr}r(jUjNjNjhjjubj!)r}r(jX:class:`M2Crypto.BIO.BIO`rjjjjjj%j}r(UreftypeXclassj'j(XM2Crypto.BIO.BIOU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,jYj-j ujKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-classrej]j]j]ujjj]rjXM2Crypto.BIO.BIOrr}r(jUjjubajj;ubaubeubj)r}r(jX!Object interface to BIO_f_buffer.jjjXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.IOBufferrjjj}r(j]j]j]j]j]ujKjhj]rjX!Object interface to BIO_f_buffer.rr}r(jUjNjNjhjjubaubj)r}r(jX|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.jjjjjjj}r(j]j]j]j]j]ujKjhj]rjX~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.rr}r(jUjNjNjhjjubaubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX&close() (M2Crypto.BIO.IOBuffer method)jNUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXIOBuffer.close()jjjXS/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.IOBuffer.closerjj\j}r(j]rjNaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjNajeXIOBuffer.closerjgjYjhujNjhj]r(j~)r}r(jXclosejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXcloserr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX,m2_bio_free() (M2Crypto.BIO.IOBuffer method)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXIOBuffer.m2_bio_freejjjXY/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.IOBuffer.m2_bio_freerjj\j}r(j]rjaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjajeXIOBuffer.m2_bio_freejgjYjhujNjhj]r(j~)r}r (jX m2_bio_freejjjjjjj}r (jojpj]j]j]j]j]ujNjhj]r jX m2_bio_freer r }r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX+m2_bio_pop() (M2Crypto.BIO.IOBuffer method)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r (jXIOBuffer.m2_bio_popjjjXX/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.IOBuffer.m2_bio_popr!jj\j}r"(j]r#haj_j`X M2Crypto.BIOr$r%}r&bj]j]j]j]r'hajeXIOBuffer.m2_bio_popjgjYjhujNjhj]r((j~)r)}r*(jX m2_bio_popjjjj!jjj}r+(jojpj]j]j]j]j]ujNjhj]r,jX m2_bio_popr-r.}r/(jUjNjNjhjj)ubaubj)r0}r1(jUjjjj!jjj}r2(jojpj]j]j]j]j]ujNjhj]ubeubj)r3}r4(jUjjjj!jjj}r5(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r6}r7(jUjj jNjjCj}r8(j]j]j]j]j]Uentries]r9(jFX$MemoryBuffer (class in M2Crypto.BIO)hUNtr:aujNjhj]ubjM)r;}r<(jUjj jNjjPj}r=(jRjSXpyj]j]j]j]j]jTXclassr>jVj>ujNjhj]r?(jX)r@}rA(jXMemoryBuffer(data=None)jj;jXQ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.MemoryBufferrBjj\j}rC(j]rDhaj_j`X M2Crypto.BIOrErF}rGbj]j]j]j]rHhajeX MemoryBufferrIjgUjhujNjhj]rJ(jj)rK}rL(jXclass jj@jjBjjmj}rM(jojpj]j]j]j]j]ujNjhj]rNjXclass rOrP}rQ(jUjNjNjhjjKubaubju)rR}rS(jX M2Crypto.BIO.jj@jjBjjxj}rT(jojpj]j]j]j]j]ujNjhj]rUjX M2Crypto.BIO.rVrW}rX(jUjNjNjhjjRubaubj~)rY}rZ(jjIjj@jjBjjj}r[(jojpj]j]j]j]j]ujNjhj]r\jX MemoryBufferr]r^}r_(jUjNjNjhjjYubaubj)r`}ra(jX data=Nonejj@jjBjjj}rb(jojpj]j]j]j]j]ujNjhj]rcj)rd}re(jX data=Nonej}rf(jojpj]j]j]j]j]ujj`j]rgjX data=Nonerhri}rj(jUjjdubajjubaubj)rk}rl(jUjj@jNjjj}rm(Uexprjj]j]j]j]j]ujNjhj]rnj!)ro}rp(jUj}rq(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjIujjkj]rrj)rs}rt(jUj}ru(j]j]rvjaj]j]j]ujjoj]rwjX[source]rxry}rz(jUjjsubajjubajj%ubaubeubj)r{}r|(jUjj;jjBjjj}r}(j]j]j]j]j]ujNjhj]r~(j)r}r(jX Bases: :class:`M2Crypto.BIO.BIO`jj{jXQ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.MemoryBufferjjj}r(j]j]j]j]j]ujKjhj]r(jXBases: rr}r(jUjNjNjhjjubj!)r}r(jX:class:`M2Crypto.BIO.BIO`rjjjjjj%j}r(UreftypeXclassj'j(XM2Crypto.BIO.BIOU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,jIj-j ujKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-classrej]j]j]ujjj]rjXM2Crypto.BIO.BIOrr}r(jUjjubajj;ubaubeubj)r}r(jXObject interface to BIO_s_mem.jj{jXQ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.MemoryBufferrjjj}r(j]j]j]j]j]ujKjhj]rjXObject interface to BIO_s_mem.rr}r(jUjNjNjhjjubaubj)r}r(jX5Empirical 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.jj{jjjjj}r(j]j]j]j]j]ujKjhj]rjX5Empirical 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.rr}r(jUjNjNjhjjubaubj?)r}r(jUjj{jNjjCj}r(j]j]j]j]j]Uentries]r(jFX*close() (M2Crypto.BIO.MemoryBuffer method)jnUNtraujNjhj]ubjM)r}r(jUjj{jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXMemoryBuffer.close()jjjXW/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.MemoryBuffer.closerjj\j}r(j]rjnaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjnajeXMemoryBuffer.closejgjIjhujNjhj]r(j~)r}r(jXclosejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXcloserr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjj{jNjjCj}r(j]j]j]j]j]Uentries]r(jFX-getvalue() (M2Crypto.BIO.MemoryBuffer method)j UNtraujNjhj]ubjM)r}r(jUjj{jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXMemoryBuffer.getvalue(size=0)jjjXZ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.MemoryBuffer.getvaluerjj\j}r(j]rj aj_j`X M2Crypto.BIOrr}rbj]j]j]j]rj ajeXMemoryBuffer.getvaluejgjIjhujNjhj]r(j~)r}r(jXgetvaluejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXgetvaluerr}r(jUjNjNjhjjubaubj)r}r(jXsize=0jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXsize=0j}r(jojpj]j]j]j]j]ujjj]rjXsize=0rr}r(jUjjubajjubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjj{jNjjCj}r(j]j]j]j]j]Uentries]r(jFX)read() (M2Crypto.BIO.MemoryBuffer method)jUNtraujNjhj]ubjM)r}r(jUjj{jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXMemoryBuffer.read(size=0)jjjXV/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.MemoryBuffer.readrjj\j}r(j]rjaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjajeXMemoryBuffer.readrjgjIjhujNjhj]r(j~)r}r(jXreadjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXreadrr}r (jUjNjNjhjjubaubj)r }r (jXsize=0jjjjjjj}r (jojpj]j]j]j]j]ujNjhj]r j)r}r(jXsize=0j}r(jojpj]j]j]j]j]ujj j]rjXsize=0rr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]r jaj]j]j]ujjj]r!jX[source]r"r#}r$(jUjjubajjubajj%ubaubeubj)r%}r&(jUjjjjjjj}r'(j]j]j]j]j]ujNjhj]ubeubj?)r(}r)(jUjj{jNjjCj}r*(j]j]j]j]j]Uentries]r+(jFX-read_all() (M2Crypto.BIO.MemoryBuffer method)j0UNtr,aujNjhj]ubjM)r-}r.(jUjj{jNjjPj}r/(jRjSXpyj]j]j]j]j]jTXmethodr0jVj0ujNjhj]r1(jX)r2}r3(jXMemoryBuffer.read_all(size=0)jj-jXZ/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.MemoryBuffer.read_allr4jj\j}r5(j]r6j0aj_j`X M2Crypto.BIOr7r8}r9bj]j]j]j]r:j0ajeXMemoryBuffer.read_alljgjIjhujNjhj]r;(j~)r<}r=(jXread_alljj2jj4jjj}r>(jojpj]j]j]j]j]ujNjhj]r?jXread_allr@rA}rB(jUjNjNjhjj<ubaubj)rC}rD(jXsize=0jj2jj4jjj}rE(jojpj]j]j]j]j]ujNjhj]rFj)rG}rH(jXsize=0j}rI(jojpj]j]j]j]j]ujjCj]rJjXsize=0rKrL}rM(jUjjGubajjubaubeubj)rN}rO(jUjj-jj4jjj}rP(j]j]j]j]j]ujNjhj]ubeubj?)rQ}rR(jUjj{jNjjCj}rS(j]j]j]j]j]Uentries]rT(jFX0write_close() (M2Crypto.BIO.MemoryBuffer method)jUNtrUaujNjhj]ubjM)rV}rW(jUjj{jNjjPj}rX(jRjSXpyj]j]j]j]j]jTXmethodrYjVjYujNjhj]rZ(jX)r[}r\(jXMemoryBuffer.write_close()jjVjX]/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.MemoryBuffer.write_closer]jj\j}r^(j]r_jaj_j`X M2Crypto.BIOr`ra}rbbj]j]j]j]rcjajeXMemoryBuffer.write_closerdjgjIjhujNjhj]re(j~)rf}rg(jX write_closejj[jj]jjj}rh(jojpj]j]j]j]j]ujNjhj]rijX write_closerjrk}rl(jUjNjNjhjjfubaubj)rm}rn(jUjj[jj]jjj}ro(jojpj]j]j]j]j]ujNjhj]ubj)rp}rq(jUjj[jNjjj}rr(Uexprjj]j]j]j]j]ujNjhj]rsj!)rt}ru(jUj}rv(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjdujjpj]rwj)rx}ry(jUj}rz(j]j]r{jaj]j]j]ujjtj]r|jX[source]r}r~}r(jUjjxubajjubajj%ubaubeubj)r}r(jUjjVjj]jjj}r(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r}r(jUjj jNjjCj}r(j]j]j]j]j]Uentries]r(jFXSSLBio (class in M2Crypto.BIO)hUNtraujNjhj]ubjM)r}r(jUjj jNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jXSSLBio(_pyfree=1)jjjXK/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.SSLBiorjj\j}r(j]rhaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rhajeXSSLBiorjgUjhujNjhj]r(jj)r}r(jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jX M2Crypto.BIO.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjX M2Crypto.BIO.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXSSLBiorr}r(jUjNjNjhjjubaubj)r}r(jX _pyfree=1jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jX _pyfree=1j}r(jojpj]j]j]j]j]ujjj]rjX _pyfree=1rr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX Bases: :class:`M2Crypto.BIO.BIO`jjjXK/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.SSLBiojjj}r(j]j]j]j]j]ujKjhj]r(jXBases: rr}r(jUjNjNjhjjubj!)r}r(jX:class:`M2Crypto.BIO.BIO`rjjjNjj%j}r(UreftypeXclassj'j(XM2Crypto.BIO.BIOU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,jj-j ujNj]rj0)r}r(jjj}r(j]j]r(j5jXpy-classrej]j]j]ujjj]rjXM2Crypto.BIO.BIOrr}r(jUjjubajj;ubaubeubj)r}r(jXObject interface to BIO_f_ssl.jjjXK/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.SSLBiojjj}r(j]j]j]j]j]ujKjhj]rjXObject interface to BIO_f_ssl.rr}r(jUjNjNjhjjubaubj?)r}r(jUjjjXX/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.SSLBio.do_handshakerjjCj}r(j]j]j]j]j]Uentries]r(jFX+do_handshake() (M2Crypto.BIO.SSLBio method)jPUNtraujNjhj]ubjM)r}r(jUjjjjjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXSSLBio.do_handshake()jjjXX/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.SSLBio.do_handshakerjj\j}r(j]rjPaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rjPajeXSSLBio.do_handshakerjgjjhujNjhj]r(j~)r}r(jX do_handshakejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX do_handshakerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r }r (jUjjjNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r j!)r }r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujj j]rj)r}r(jUj}r(j]j]rjaj]j]j]ujj j]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jXDo the handshake.jjjjjjj}r(j]j]j]j]j]ujKjhj]r jXDo the handshake.r!r"}r#(jUjNjNjhjjubaubj)r$}r%(jXWReturn 1 if the handshake completes Return 0 or a negative number if there is a problemjjjjjjj}r&(j]j]j]j]j]ujKjhj]r'jXWReturn 1 if the handshake completes Return 0 or a negative number if there is a problemr(r)}r*(jUjNjNjhjj$ubaubeubeubj?)r+}r,(jUjjjXS/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.SSLBio.set_sslr-jjCj}r.(j]j]j]j]j]Uentries]r/(jFX&set_ssl() (M2Crypto.BIO.SSLBio method)jUNtr0aujNjhj]ubjM)r1}r2(jUjjjj-jjPj}r3(jRjSXpyj]j]j]j]j]jTXmethodr4jVj4ujNjhj]r5(jX)r6}r7(jX"SSLBio.set_ssl(conn, close_flag=0)jj1jXS/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.SSLBio.set_sslr8jj\j}r9(j]r:jaj_j`X M2Crypto.BIOr;r<}r=bj]j]j]j]r>jajeXSSLBio.set_sslr?jgjjhujNjhj]r@(j~)rA}rB(jXset_ssljj6jj8jjj}rC(jojpj]j]j]j]j]ujNjhj]rDjXset_sslrErF}rG(jUjNjNjhjjAubaubj)rH}rI(jXconn, close_flag=0jj6jj8jjj}rJ(jojpj]j]j]j]j]ujNjhj]rK(j)rL}rM(jXconnj}rN(jojpj]j]j]j]j]ujjHj]rOjXconnrPrQ}rR(jUjjLubajjubj)rS}rT(jX close_flag=0j}rU(jojpj]j]j]j]j]ujjHj]rVjX close_flag=0rWrX}rY(jUjjSubajjubeubj)rZ}r[(jUjj6jNjjj}r\(Uexprjj]j]j]j]j]ujNjhj]r]j!)r^}r_(jUj}r`(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidj?ujjZj]raj)rb}rc(jUj}rd(j]j]rejaj]j]j]ujj^j]rfjX[source]rgrh}ri(jUjjbubajjubajj%ubaubeubj)rj}rk(jUjj1jj8jjj}rl(j]j]j]j]j]ujNjhj]rmj)rn}ro(jXLSets the bio to the SSL pointer which is contained in the connection object.jjjjj-jjj}rp(j]j]j]j]j]ujKjhj]rqjXLSets the bio to the SSL pointer which is contained in the connection object.rrrs}rt(jUjNjNjhjjnubaubaubeubeubeubj?)ru}rv(jUjj jNjjCj}rw(j]j]j]j]j]Uentries]rx(jFX#openfile() (in module M2Crypto.BIO)hUNtryaujNjhj]ubjM)rz}r{(jUjj jNjjPj}r|(jRjSXpyj]j]j]j]j]jTXfunctionr}jVj}ujNjhj]r~(jX)r}r(jXopenfile(filename, mode='rb')jjzjXM/home/matej/Build/m2crypto/M2Crypto/BIO.py:docstring of M2Crypto.BIO.openfilerjj\j}r(j]rhaj_j`X M2Crypto.BIOrr}rbj]j]j]j]rhajeXopenfilerjgUjhujNjhj]r(ju)r}r(jX M2Crypto.BIO.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjX M2Crypto.BIO.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXopenfilerr}r(jUjNjNjhjjubaubj)r}r(jXfilename, mode='rb'jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXfilenamej}r(jojpj]j]j]j]j]ujjj]rjXfilenamerr}r(jUjjubajjubj)r}r(jX mode='rb'j}r(jojpj]j]j]j]j]ujjj]rjX mode='rb'rr}r(jUjjubajjubeubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BIOUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjzjjjjj}r(j]j]j]j]j]ujNjhj]ubeubeubj)r}r(jUjjjjjjj}r(j]j]j]j]r(Xmodule-M2Crypto.BNrU bn-modulerej]rjaujK%jhj]r(j )r}r(jX:mod:`BN` Modulerjjjjjj j}r(j]j]j]j]j]ujK%jhj]r(j!)r}r(jX :mod:`BN`rjjjjjj%j}r(UreftypeXmodj'j(XBNU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,Nj-j ujK$j]rj0)r}r(jjj}r(j]j]r(j5jXpy-modrej]j]j]ujjj]rjXBNrr}r(jUjjubajj;ubaubjX Modulerr}r(jUjNjNjhjjubeubj?)r}r(jUjjjXG/home/matej/Build/m2crypto/M2Crypto/BN.py:docstring of M2Crypto.BN.randrjjCj}r(j]j]j]j]j]Uentries]r(jFXM2Crypto.BN (module)Xmodule-M2Crypto.BNUNtraujKjhj]ubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFXrand() (in module M2Crypto.BN)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXrand(bits, top=-1, bottom=0)jjjXG/home/matej/Build/m2crypto/M2Crypto/BN.py:docstring of M2Crypto.BN.randrjj\j}r(j]rhaj_j`X M2Crypto.BNrr}rbj]j]j]j]rhajeXrandrjgUjhujNjhj]r(ju)r}r(jX M2Crypto.BN.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjX M2Crypto.BN.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXrandrr}r(jUjNjNjhjjubaubj)r}r(jXbits, top=-1, bottom=0jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r }r (jXbitsj}r (jojpj]j]j]j]j]ujjj]r jXbitsr r}r(jUjj ubajjubj)r}r(jXtop=-1j}r(jojpj]j]j]j]j]ujjj]rjXtop=-1rr}r(jUjjubajjubj)r}r(jXbottom=0j}r(jojpj]j]j]j]j]ujjj]rjXbottom=0rr}r(jUjjubajjubeubj)r}r(jUjjjNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r!j!)r"}r#(jUj}r$(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BNUrefidjujjj]r%j)r&}r'(jUj}r((j]j]r)jaj]j]j]ujj"j]r*jX[source]r+r,}r-(jUjj&ubajjubajj%ubaubeubj)r.}r/(jUjjjjjjj}r0(j]j]j]j]j]ujNjhj]r1(j)r2}r3(jX0Generate cryptographically strong random number.jj.jXG/home/matej/Build/m2crypto/M2Crypto/BN.py:docstring of M2Crypto.BN.randjjj}r4(j]j]j]j]j]ujKjhj]r5jX0Generate cryptographically strong random number.r6r7}r8(jUjNjNjhjj2ubaubj)r9}r:(jUjj.jNjjj}r;(j]j]j]j]j]ujNjhj]r<j)r=}r>(jUj}r?(j]j]j]j]j]ujj9j]r@(j)rA}rB(jX Parametersjj=jjjjj}rC(j]j]j]j]j]ujKj]rDjX ParametersrErF}rG(jUjjAubaubj)rH}rI(jUj}rJ(j]j]j]j]j]ujj=j]rKj^ )rL}rM(jUj}rN(j]j]j]j]j]ujjHj]rO(jc )rP}rQ(jUj}rR(j]j]j]j]j]ujjLj]rSj)rT}rU(jX(bits -- Length of random number in bits.j}rV(j]j]j]j]j]ujjPj]rW(j)rX}rY(jXbitsj}rZ(j]j]jj]j]j]ujjTj]r[jXbitsr\r]}r^(jUjjXubajjubjX – r_r`}ra(jUjjTubjX Length of random number in bits.rbrc}rd(jUjNjNjhjjTubejjubajjy ubjc )re}rf(jUj}rg(j]j]j]j]j]ujjLj]rhj)ri}rj(jXtop -- If -1, the most significant bit can be 0. If 0, the most significant bit is 1, and if 1, the two most significant bits will be 1.j}rk(j]j]j]j]j]ujjej]rl(j)rm}rn(jXtopj}ro(j]j]jj]j]j]ujjij]rpjXtoprqrr}rs(jUjjmubajjubjX – rtru}rv(jUjjiubjXIf -1, the most significant bit can be 0. If 0, the most significant bit is 1, and if 1, the two most significant bits will be 1.rwrx}ry(jUjNjNjhjjiubejjubajjy ubjc )rz}r{(jUj}r|(j]j]j]j]j]ujjLj]r}j)r~}r(jX4bottom -- If bottom is true, the number will be odd.j}r(j]j]j]j]j]ujjzj]r(j)r}r(jXbottomj}r(j]j]jj]j]j]ujj~j]rjXbottomrr}r(jUjjubajjubjX – rr}r(jUjj~ubjX*If bottom is true, the number will be odd.rr}r(jUjNjNjhjj~ubejjubajjy ubejj ubajjubejjubaubeubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX$rand_range() (in module M2Crypto.BN)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXrand_range(range)jjjXM/home/matej/Build/m2crypto/M2Crypto/BN.py:docstring of M2Crypto.BN.rand_rangerjj\j}r(j]rhaj_j`X M2Crypto.BNrr}rbj]j]j]j]rhajeX rand_rangerjgUjhujNjhj]r(ju)r}r(jX M2Crypto.BN.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjX M2Crypto.BN.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX rand_rangerr}r(jUjNjNjhjjubaubj)r}r(jXrangejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXrangej}r(jojpj]j]j]j]j]ujjj]rjXrangerr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BNUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX$Generate a random number in a range.jjjXM/home/matej/Build/m2crypto/M2Crypto/BN.py:docstring of M2Crypto.BN.rand_rangejjj}r(j]j]j]j]j]ujKjhj]rjX$Generate a random number in a range.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXrange -- Upper limit for range.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXrangej}r(j]j]jj]j]j]ujjj]rjXrangerr}r(jUjjubajjubjX – rr}r(jUjjubjXUpper limit for range.rr}r(jUjNjNjhjjubejjubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r (j]j]j]j]j]ujjj]r j)r }r (jX'A random number in the range [0, range)j}r (j]j]j]j]j]ujjj]rjX'A random number in the range [0, range)rr}r(jUjNjNjhjj ubajjubajjubejjubeubeubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX#randfname() (in module M2Crypto.BN)hoUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXrandfname(length)jjjXL/home/matej/Build/m2crypto/M2Crypto/BN.py:docstring of M2Crypto.BN.randfnamerjj\j}r(j]r hoaj_j`X M2Crypto.BNr!r"}r#bj]j]j]j]r$hoajeX randfnamer%jgUjhujNjhj]r&(ju)r'}r((jX M2Crypto.BN.jjjjjjxj}r)(jojpj]j]j]j]j]ujNjhj]r*jX M2Crypto.BN.r+r,}r-(jUjNjNjhjj'ubaubj~)r.}r/(jj%jjjjjjj}r0(jojpj]j]j]j]j]ujNjhj]r1jX randfnamer2r3}r4(jUjNjNjhjj.ubaubj)r5}r6(jXlengthjjjjjjj}r7(jojpj]j]j]j]j]ujNjhj]r8j)r9}r:(jXlengthj}r;(jojpj]j]j]j]j]ujj5j]r<jXlengthr=r>}r?(jUjj9ubajjubaubj)r@}rA(jUjjjNjjj}rB(Uexprjj]j]j]j]j]ujNjhj]rCj!)rD}rE(jUj}rF(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/BNUrefidj%ujj@j]rGj)rH}rI(jUj}rJ(j]j]rKjaj]j]j]ujjDj]rLjX[source]rMrN}rO(jUjjHubajjubajj%ubaubeubj)rP}rQ(jUjjjjjjj}rR(j]j]j]j]j]ujNjhj]rS(j)rT}rU(jXiReturn a random filename, which is simply a string where all the characters are from the set [a-zA-Z0-9].jjPjXL/home/matej/Build/m2crypto/M2Crypto/BN.py:docstring of M2Crypto.BN.randfnamejjj}rV(j]j]j]j]j]ujKjhj]rWjXiReturn a random filename, which is simply a string where all the characters are from the set [a-zA-Z0-9].rXrY}rZ(jUjNjNjhjjTubaubj)r[}r\(jUjjPjNjjj}r](j]j]j]j]j]ujNjhj]r^(j)r_}r`(jUj}ra(j]j]j]j]j]ujj[j]rb(j)rc}rd(jX Parametersjj_jjjjj}re(j]j]j]j]j]ujKj]rfjX Parametersrgrh}ri(jUjjcubaubj)rj}rk(jUj}rl(j]j]j]j]j]ujj_j]rmj)rn}ro(jX'length -- Length of filename to return.j}rp(j]j]j]j]j]ujjjj]rq(j)rr}rs(jXlengthj}rt(j]j]jj]j]j]ujjnj]rujXlengthrvrw}rx(jUjjrubajjubjX – ryrz}r{(jUjjnubjXLength of filename to return.r|r}}r~(jUjNjNjhjjnubejjubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujj[j]r(j)r}r(jXReturnsjjjjjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXrandom filename stringj}r(j]j]j]j]j]ujjj]rjXrandom filename stringrr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubeubj)r}r(jUjjjjjjj}r(j]j]j]j]r(Xmodule-M2Crypto.DHrU dh-modulerej]rjaujK-jhj]r(j )r}r(jX:mod:`DH` Modulerjjjjjj j}r(j]j]j]j]j]ujK-jhj]r(j!)r}r(jX :mod:`DH`rjjjjjj%j}r(UreftypeXmodj'j(XDHU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,Nj-X M2Crypto.BNrujK,j]rj0)r}r(jjj}r(j]j]r(j5jXpy-modrej]j]j]ujjj]rjXDHrr}r(jUjjubajj;ubaubjX Modulerr}r(jUjNjNjhjjubeubj?)r}r(jUjjjXE/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.DHrjjCj}r(j]j]j]j]j]Uentries]r(jFXM2Crypto.DH (module)Xmodule-M2Crypto.DHUNtraujKjhj]ubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFXDH (class in M2Crypto.DH)jlUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jXDH(dh, _pyfree=0)jjjXE/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.DHrjj\j}r(j]rjlaj_j`X M2Crypto.DHrr}rbj]j]j]j]rjlajeXDHrjgUjhujNjhj]r(jj)r}r(jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jX M2Crypto.DH.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjX M2Crypto.DH.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXDHrr}r(jUjNjNjhjjubaubj)r}r(jX dh, _pyfree=0jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXdhj}r(jojpj]j]j]j]j]ujjj]rjXdhrr}r(jUjjubajjubj)r}r(jX _pyfree=0j}r(jojpj]j]j]j]j]ujjj]rjX _pyfree=0rr}r(jUjjubajjubeubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DHUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r (j]j]j]j]j]ujNjhj]r (j)r }r (jX=Object interface to the Diffie-Hellman key exchange protocol.jjjXE/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.DHjjj}r (j]j]j]j]j]ujKjhj]rjX=Object interface to the Diffie-Hellman key exchange protocol.rr}r(jUjNjNjhjj ubaubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX&check_params() (M2Crypto.DH.DH method)j]UNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXDH.check_params()jjjXR/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.DH.check_paramsrjj\j}r(j]r j]aj_j`X M2Crypto.DHr!r"}r#bj]j]j]j]r$j]ajeXDH.check_paramsr%jgjjhujNjhj]r&(j~)r'}r((jX check_paramsjjjjjjj}r)(jojpj]j]j]j]j]ujNjhj]r*jX check_paramsr+r,}r-(jUjNjNjhjj'ubaubj)r.}r/(jUjjjjjjj}r0(jojpj]j]j]j]j]ujNjhj]ubj)r1}r2(jUjjjNjjj}r3(Uexprjj]j]j]j]j]ujNjhj]r4j!)r5}r6(jUj}r7(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DHUrefidj%ujj1j]r8j)r9}r:(jUj}r;(j]j]r<jaj]j]j]ujj5j]r=jX[source]r>r?}r@(jUjj9ubajjubajj%ubaubeubj)rA}rB(jUjjjjjjj}rC(j]j]j]j]j]ujNjhj]ubeubj?)rD}rE(jUjjjNjjCj}rF(j]j]j]j]j]Uentries]rG(jFX%compute_key() (M2Crypto.DH.DH method)hmUNtrHaujNjhj]ubjM)rI}rJ(jUjjjNjjPj}rK(jRjSXpyj]j]j]j]j]jTXmethodrLjVjLujNjhj]rM(jX)rN}rO(jXDH.compute_key(pubkey)jjIjXQ/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.DH.compute_keyrPjj\j}rQ(j]rRhmaj_j`X M2Crypto.DHrSrT}rUbj]j]j]j]rVhmajeXDH.compute_keyrWjgjjhujNjhj]rX(j~)rY}rZ(jX compute_keyjjNjjPjjj}r[(jojpj]j]j]j]j]ujNjhj]r\jX compute_keyr]r^}r_(jUjNjNjhjjYubaubj)r`}ra(jXpubkeyjjNjjPjjj}rb(jojpj]j]j]j]j]ujNjhj]rcj)rd}re(jXpubkeyj}rf(jojpj]j]j]j]j]ujj`j]rgjXpubkeyrhri}rj(jUjjdubajjubaubj)rk}rl(jUjjNjNjjj}rm(Uexprjj]j]j]j]j]ujNjhj]rnj!)ro}rp(jUj}rq(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DHUrefidjWujjkj]rrj)rs}rt(jUj}ru(j]j]rvjaj]j]j]ujjoj]rwjX[source]rxry}rz(jUjjsubajjubajj%ubaubeubj)r{}r|(jUjjIjjPjjj}r}(j]j]j]j]j]ujNjhj]ubeubj?)r~}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX!gen_key() (M2Crypto.DH.DH method)j%UNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX DH.gen_key()jjjXM/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.DH.gen_keyrjj\j}r(j]rj%aj_j`X M2Crypto.DHrr}rbj]j]j]j]rj%ajeX DH.gen_keyrjgjjhujNjhj]r(j~)r}r(jXgen_keyjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXgen_keyrr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DHUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX$m2_dh_free() (M2Crypto.DH.DH method)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX DH.m2_dh_freejjjXP/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.DH.m2_dh_freerjj\j}r(j]rjaj_j`X M2Crypto.DHrr}rbj]j]j]j]rjajeX DH.m2_dh_freejgjjhujNjhj]r(j~)r}r(jX m2_dh_freejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX m2_dh_freerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX&print_params() (M2Crypto.DH.DH method)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXDH.print_params(bio)jjjXR/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.DH.print_paramsrjj\j}r(j]rjaj_j`X M2Crypto.DHrr}rbj]j]j]j]rjajeXDH.print_paramsrjgjjhujNjhj]r(j~)r}r(jX print_paramsjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX print_paramsrr}r(jUjNjNjhjjubaubj)r}r(jXbiojjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXbioj}r(jojpj]j]j]j]j]ujjj]rjXbiorr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DHUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r (jUjjjjjjj}r (j]j]j]j]j]ujNjhj]ubeubeubeubj?)r }r (jUjjjXJ/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.DHErrorr jjCj}r(j]j]j]j]j]Uentries]r(jFXDHErrorrjrUNtraujNjhj]ubjM)r}r(jUjjjj jjPj}r(jRjSXpyj]j]j]j]j]jTX exceptionrjVjujNjhj]r(jX)r}r(jjjjjXJ/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.DHErrorrjj\j}r(j]rjraj_j`X M2Crypto.DHrr}rbj]j]j]j]rjrajejjgUjhujNjhj]r (jj)r!}r"(jX exception jjjjjjmj}r#(jojpj]j]j]j]j]ujNjhj]r$jX exception r%r&}r'(jUjNjNjhjj!ubaubju)r(}r)(jX M2Crypto.DH.jjjjjjxj}r*(jojpj]j]j]j]j]ujNjhj]r+jX M2Crypto.DH.r,r-}r.(jUjNjNjhjj(ubaubj~)r/}r0(jjjjjjjjj}r1(jojpj]j]j]j]j]ujNjhj]r2jXDHErrorr3r4}r5(jUjNjNjhjj/ubaubj)r6}r7(jUjjjNjjj}r8(Uexprjj]j]j]j]j]ujNjhj]r9j!)r:}r;(jUj}r<(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DHUrefidjujj6j]r=j)r>}r?(jUj}r@(j]j]rAjaj]j]j]ujj:j]rBjX[source]rCrD}rE(jUjj>ubajjubajj%ubaubeubj)rF}rG(jUjjjjjjj}rH(j]j]j]j]j]ujNjhj]rIj)rJ}rK(jX$Bases: :class:`exceptions.Exception`jjFjj jjj}rL(j]j]j]j]j]ujKjhj]rM(jXBases: rNrO}rP(jUjNjNjhjjJubj!)rQ}rR(jX:class:`exceptions.Exception`rSjjJjjjj%j}rT(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyrUj]j]U refexplicitj]j]j]j*j+j,jj-X M2Crypto.DHrVujK$j]rWj0)rX}rY(jjSj}rZ(j]j]r[(j5jUXpy-classr\ej]j]j]ujjQj]r]jXexceptions.Exceptionr^r_}r`(jUjjXubajj;ubaubeubaubeubj?)ra}rb(jUjjjNjjCj}rc(j]j]j]j]j]Uentries]rd(jFX$gen_params() (in module M2Crypto.DH)jvUNtreaujNjhj]ubjM)rf}rg(jUjjjNjjPj}rh(jRjSXpyj]j]j]j]j]jTXfunctionrijVjiujNjhj]rj(jX)rk}rl(jX:gen_params(plen, g, callback=)jjfjXM/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.gen_paramsrmjj\j}rn(j]rojvaj_j`X M2Crypto.DHrprq}rrbj]j]j]j]rsjvajeX gen_paramsrtjgUjhujNjhj]ru(ju)rv}rw(jX M2Crypto.DH.jjkjjmjjxj}rx(jojpj]j]j]j]j]ujNjhj]ryjX M2Crypto.DH.rzr{}r|(jUjNjNjhjjvubaubj~)r}}r~(jjtjjkjjmjjj}r(jojpj]j]j]j]j]ujNjhj]rjX gen_paramsrr}r(jUjNjNjhjj}ubaubj)r}r(jX.plen, g, callback=jjkjjmjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXplenj}r(jojpj]j]j]j]j]ujjj]rjXplenrr}r(jUjjubajjubj)r}r(jXgj}r(jojpj]j]j]j]j]ujjj]rjXgr}r(jUjjubajjubj)r}r(jX%callback=j}r(jojpj]j]j]j]j]ujjj]rjX%callback=rr}r(jUjjubajjubeubj)r}r(jUjjkjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DHUrefidjtujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjfjjmjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX%load_params() (in module M2Crypto.DH)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXload_params(file)jjjXN/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.load_paramsrjj\j}r(j]rhaj_j`X M2Crypto.DHrr}rbj]j]j]j]rhajeX load_paramsrjgUjhujNjhj]r(ju)r}r(jX M2Crypto.DH.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjX M2Crypto.DH.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX load_paramsrr}r(jUjNjNjhjjubaubj)r}r(jXfilejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXfilej}r(jojpj]j]j]j]j]ujjj]rjXfilerr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DHUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX)load_params_bio() (in module M2Crypto.DH)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXload_params_bio(bio)jjjXR/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.load_params_biorjj\j}r(j]rhaj_j`X M2Crypto.DHrr}rbj]j]j]j]rhajeXload_params_biorjgUjhujNjhj]r(ju)r}r(jX M2Crypto.DH.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjX M2Crypto.DH.r r }r (jUjNjNjhjjubaubj~)r }r (jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXload_params_biorr}r(jUjNjNjhjj ubaubj)r}r(jXbiojjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXbioj}r(jojpj]j]j]j]j]ujjj]rjXbiorr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r!j!)r"}r#(jUj}r$(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DHUrefidjujjj]r%j)r&}r'(jUj}r((j]j]r)jaj]j]j]ujj"j]r*jX[source]r+r,}r-(jUjj&ubajjubajj%ubaubeubj)r.}r/(jUjjjjjjj}r0(j]j]j]j]j]ujNjhj]ubeubj?)r1}r2(jUjjjNjjCj}r3(j]j]j]j]j]Uentries]r4(jFX$set_params() (in module M2Crypto.DH)hUNtr5aujNjhj]ubjM)r6}r7(jUjjjNjjPj}r8(jRjSXpyj]j]j]j]j]jTXfunctionr9jVj9ujNjhj]r:(jX)r;}r<(jXset_params(p, g)jj6jXM/home/matej/Build/m2crypto/M2Crypto/DH.py:docstring of M2Crypto.DH.set_paramsr=jj\j}r>(j]r?haj_j`X M2Crypto.DHr@rA}rBbj]j]j]j]rChajeX set_paramsrDjgUjhujNjhj]rE(ju)rF}rG(jX M2Crypto.DH.jj;jj=jjxj}rH(jojpj]j]j]j]j]ujNjhj]rIjX M2Crypto.DH.rJrK}rL(jUjNjNjhjjFubaubj~)rM}rN(jjDjj;jj=jjj}rO(jojpj]j]j]j]j]ujNjhj]rPjX set_paramsrQrR}rS(jUjNjNjhjjMubaubj)rT}rU(jXp, gjj;jj=jjj}rV(jojpj]j]j]j]j]ujNjhj]rW(j)rX}rY(jXpj}rZ(jojpj]j]j]j]j]ujjTj]r[jXpr\}r](jUjjXubajjubj)r^}r_(jXgj}r`(jojpj]j]j]j]j]ujjTj]rajXgrb}rc(jUjj^ubajjubeubj)rd}re(jUjj;jNjjj}rf(Uexprjj]j]j]j]j]ujNjhj]rgj!)rh}ri(jUj}rj(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DHUrefidjDujjdj]rkj)rl}rm(jUj}rn(j]j]rojaj]j]j]ujjhj]rpjX[source]rqrr}rs(jUjjlubajjubajj%ubaubeubj)rt}ru(jUjj6jj=jjj}rv(j]j]j]j]j]ujNjhj]ubeubeubj)rw}rx(jUjjjjjjj}ry(j]j]j]j]rz(Xmodule-M2Crypto.DSAr{U dsa-moduler|ej]r}jaujK5jhj]r~(j )r}r(jX:mod:`DSA` Modulerjjwjjjj j}r(j]j]j]j]j]ujK5jhj]r(j!)r}r(jX :mod:`DSA`rjjjjjj%j}r(UreftypeXmodj'j(XDSAU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,Nj-jVujK4j]rj0)r}r(jjj}r(j]j]r(j5jXpy-modrej]j]j]ujjj]rjXDSArr}r(jUjjubajj;ubaubjX Modulerr}r(jUjNjNjhjjubeubj?)r}r(jUjjwjXH/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSArjjCj}r(j]j]j]j]j]Uentries]r(jFXM2Crypto.DSA (module)Xmodule-M2Crypto.DSAUNtraujKjhj]ubj?)r}r(jUjjwjNjjCj}r(j]j]j]j]j]Uentries]r(jFXDSA (class in M2Crypto.DSA)h~UNtraujNjhj]ubjM)r}r(jUjjwjNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jXDSA(dsa, _pyfree=0)jjjXH/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSArjj\j}r(j]rh~aj_j`X M2Crypto.DSArr}rbj]j]j]j]rh~ajeXDSArjgUjhujNjhj]r(jj)r}r(jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jX M2Crypto.DSA.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjX M2Crypto.DSA.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXDSArr}r(jUjNjNjhjjubaubj)r}r(jXdsa, _pyfree=0jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXdsaj}r(jojpj]j]j]j]j]ujjj]rjXdsarr}r(jUjjubajjubj)r}r(jX _pyfree=0j}r(jojpj]j]j]j]j]ujjj]rjX _pyfree=0rr}r(jUjjubajjubeubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jXWThis class is a context supporting DSA key and parameter values, signing and verifying.jjjXH/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSArjjj}r(j]j]j]j]j]ujKjhj]rjXWThis class is a context supporting DSA key and parameter values, signing and verifying.rr}r(jUjNjNjhjjubaubj)r}r(jXSimple example::jjjjjjj}r(j]j]j]j]j]ujKjhj]rjXSimple example:rr}r(jUjNjNjhjjubaubcdocutils.nodes literal_block r)r}r(jX>from M2Crypto import EVP, DSA, util message = 'Kilroy was here!' md = EVP.MessageDigest('sha1') md.update(message) digest = md.final() dsa = DSA.gen_params(1024) dsa.gen_key() r, s = dsa.sign(digest) good = dsa.verify(digest, r, s) if good: print(' ** success **') else: print(' ** verification failed **')jjjXR/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.check_keyjU literal_blockrj}r(jojpj]j]j]j]j]ujKjhj]rjX>from M2Crypto import EVP, DSA, util message = 'Kilroy was here!' md = EVP.MessageDigest('sha1') md.update(message) digest = md.final() dsa = DSA.gen_params(1024) dsa.gen_key() r, s = dsa.sign(digest) good = dsa.verify(digest, r, s) if good: print(' ** success **') else: print(' ** verification failed **')rr}r(jUjjubaubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX%check_key() (M2Crypto.DSA.DSA method)hUNtraujNjhj]ubjM)r }r (jUjjjNjjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r}r(jXDSA.check_key()jj jXR/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.check_keyrjj\j}r(j]rhaj_j`X M2Crypto.DSArr}rbj]j]j]j]rhajeX DSA.check_keyrjgjjhujNjhj]r(j~)r}r(jX check_keyjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX check_keyrr}r(jUjNjNjhjjubaubj)r }r!(jUjjjjjjj}r"(jojpj]j]j]j]j]ujNjhj]ubj)r#}r$(jUjjjNjjj}r%(Uexprjj]j]j]j]j]ujNjhj]r&j!)r'}r((jUj}r)(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjujj#j]r*j)r+}r,(jUj}r-(j]j]r.jaj]j]j]ujj'j]r/jX[source]r0r1}r2(jUjj+ubajjubajj%ubaubeubj)r3}r4(jUjj jjjjj}r5(j]j]j]j]j]ujNjhj]r6(j)r7}r8(jX8Check to be sure the DSA object has a valid private key.jj3jXR/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.check_keyjjj}r9(j]j]j]j]j]ujKjhj]r:jX8Check to be sure the DSA object has a valid private key.r;r<}r=(jUjNjNjhjj7ubaubj)r>}r?(jUjj3jNjjj}r@(j]j]j]j]j]ujNjhj]rAj)rB}rC(jUj}rD(j]j]j]j]j]ujj>j]rE(j)rF}rG(jXReturnsjjBjjjjj}rH(j]j]j]j]j]ujKj]rIjXReturnsrJrK}rL(jUjjFubaubj)rM}rN(jUj}rO(j]j]j]j]j]ujjBj]rPj)rQ}rR(jX1 (true) if a valid private keyj}rS(j]j]j]j]j]ujjMj]rTjX1 (true) if a valid private keyrUrV}rW(jUjNjNjhjjQubajjubajjubejjubaubeubeubj?)rX}rY(jUjjjXP/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.gen_keyrZjjCj}r[(j]j]j]j]j]Uentries]r\(jFX#gen_key() (M2Crypto.DSA.DSA method)jUNtr]aujNjhj]ubjM)r^}r_(jUjjjjZjjPj}r`(jRjSXpyj]j]j]j]j]jTXmethodrajVjaujNjhj]rb(jX)rc}rd(jX DSA.gen_key()jj^jXP/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.gen_keyrejj\j}rf(j]rgjaj_j`X M2Crypto.DSArhri}rjbj]j]j]j]rkjajeX DSA.gen_keyrljgjjhujNjhj]rm(j~)rn}ro(jXgen_keyjjcjjejjj}rp(jojpj]j]j]j]j]ujNjhj]rqjXgen_keyrrrs}rt(jUjNjNjhjjnubaubj)ru}rv(jUjjcjjejjj}rw(jojpj]j]j]j]j]ujNjhj]ubj)rx}ry(jUjjcjNjjj}rz(Uexprjj]j]j]j]j]ujNjhj]r{j!)r|}r}(jUj}r~(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjlujjxj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujj|j]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjj^jjejjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jXGenerate a key pair.jjjjZjjj}r(j]j]j]j]j]ujKjhj]rjXGenerate a key pair.rr}r(jUjNjNjhjjubaubaubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX'm2_dsa_free() (M2Crypto.DSA.DSA method)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXDSA.m2_dsa_freejjjXT/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.m2_dsa_freerjj\j}r(j]rjaj_j`X M2Crypto.DSArr}rbj]j]j]j]rjajeXDSA.m2_dsa_freejgjjhujNjhj]r(j~)r}r(jX m2_dsa_freejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX m2_dsa_freerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX$save_key() (M2Crypto.DSA.DSA method)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXUDSA.save_key(filename, cipher='aes_128_cbc', callback=)jjjXQ/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_keyrjj\j}r(j]rhaj_j`X M2Crypto.DSArr}rbj]j]j]j]rhajeX DSA.save_keyrjgjjhujNjhj]r(j~)r}r(jXsave_keyjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXsave_keyrr}r(jUjNjNjhjjubaubj)r}r(jXGfilename, cipher='aes_128_cbc', callback=jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXfilenamej}r(jojpj]j]j]j]j]ujjj]rjXfilenamerr}r(jUjjubajjubj)r}r(jXcipher='aes_128_cbc'j}r(jojpj]j]j]j]j]ujjj]rjXcipher='aes_128_cbc'rr}r(jUjjubajjubj)r}r(jX'callback=j}r(jojpj]j]j]j]j]ujjj]rjX'callback=rr}r(jUjjubajjubeubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX Save the DSA key pair to a file.jjjXQ/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_keyjjj}r(j]j]j]j]j]ujKjhj]rjX Save the DSA key pair to a file.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r (jUj}r (j]j]j]j]j]ujjj]r (j)r }r (jX Parametersjjjjjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjj ubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj^ )r}r(jUj}r(j]j]j]j]j]ujjj]r(jc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r (jX/filename -- Save the DSA key pair to this file.j}r!(j]j]j]j]j]ujjj]r"(j)r#}r$(jXfilenamej}r%(j]j]jj]j]j]ujjj]r&jXfilenamer'r(}r)(jUjj#ubajjubjX – r*r+}r,(jUjjubjX#Save the DSA key pair to this file.r-r.}r/(jUjNjNjhjjubejjubajjy ubjc )r0}r1(jUj}r2(j]j]j]j]j]ujjj]r3j)r4}r5(jXNcipher -- name of symmetric key algorithm and mode to encrypt the private key.j}r6(j]j]j]j]j]ujj0j]r7(j)r8}r9(jXcipherj}r:(j]j]jj]j]j]ujj4j]r;jXcipherr<r=}r>(jUjj8ubajjubjX – r?r@}rA(jUjj4ubjXDname of symmetric key algorithm and mode to encrypt the private key.rBrC}rD(jUjNjNjhjj4ubejjubajjy ubejj ubajjubejjubj)rE}rF(jUj}rG(j]j]j]j]j]ujjj]rH(j)rI}rJ(jXReturnsjjEjjjjj}rK(j]j]j]j]j]ujKj]rLjXReturnsrMrN}rO(jUjjIubaubj)rP}rQ(jUj}rR(j]j]j]j]j]ujjEj]rSj)rT}rU(jX1 (true) if successfulj}rV(j]j]j]j]j]ujjPj]rWjX1 (true) if successfulrXrY}rZ(jUjNjNjhjjTubajjubajjubejjubeubeubeubj?)r[}r\(jUjjjNjjCj}r](j]j]j]j]j]Uentries]r^(jFX(save_key_bio() (M2Crypto.DSA.DSA method)jUNtr_aujNjhj]ubjM)r`}ra(jUjjjNjjPj}rb(jRjSXpyj]j]j]j]j]jTXmethodrcjVjcujNjhj]rd(jX)re}rf(jXTDSA.save_key_bio(bio, cipher='aes_128_cbc', callback=)jj`jXU/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_key_biorgjj\j}rh(j]rijaj_j`X M2Crypto.DSArjrk}rlbj]j]j]j]rmjajeXDSA.save_key_biornjgjjhujNjhj]ro(j~)rp}rq(jX save_key_biojjejjgjjj}rr(jojpj]j]j]j]j]ujNjhj]rsjX save_key_biortru}rv(jUjNjNjhjjpubaubj)rw}rx(jXBbio, cipher='aes_128_cbc', callback=jjejjgjjj}ry(jojpj]j]j]j]j]ujNjhj]rz(j)r{}r|(jXbioj}r}(jojpj]j]j]j]j]ujjwj]r~jXbiorr}r(jUjj{ubajjubj)r}r(jXcipher='aes_128_cbc'j}r(jojpj]j]j]j]j]ujjwj]rjXcipher='aes_128_cbc'rr}r(jUjjubajjubj)r}r(jX'callback=j}r(jojpj]j]j]j]j]ujjwj]rjX'callback=rr}r(jUjjubajjubeubj)r}r(jUjjejNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjnujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjj`jjgjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX"Save DSA key pair to a BIO object.jjjXU/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_key_biojjj}r(j]j]j]j]j]ujKjhj]rjX"Save DSA key pair to a BIO object.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjgjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj^ )r}r(jUj}r(j]j]j]j]j]ujjj]r(jc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jX*bio -- Save DSA parameters to this object.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXbioj}r(j]j]jj]j]j]ujjj]rjXbiorr}r(jUjjubajjubjX – rr}r(jUjjubjX#Save DSA parameters to this object.rr}r(jUjNjNjhjjubejjubajjy ubjc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXNcipher -- name of symmetric key algorithm and mode to encrypt the private key.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXcipherj}r(j]j]jj]j]j]ujjj]rjXcipherrr}r(jUjjubajjubjX – rr}r(jUjjubjXDname of symmetric key algorithm and mode to encrypt the private key.rr}r(jUjNjNjhjjubejjubajjy ubejj ubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjgjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jX1 (true) if successfulj}r(j]j]j]j]j]ujjj]rjX1 (true) if successfulrr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX'save_params() (M2Crypto.DSA.DSA method)jBUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jXDSA.save_params(filename)jjjXT/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_paramsrjj\j}r(j]rjBaj_j`X M2Crypto.DSArr}rbj]j]j]j]rjBajeXDSA.save_paramsrjgjjhujNjhj]r(j~)r}r(jX save_paramsjj jjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX save_paramsrr}r(jUjNjNjhjjubaubj)r}r(jXfilenamejj jjjjj}r (jojpj]j]j]j]j]ujNjhj]r!j)r"}r#(jXfilenamej}r$(jojpj]j]j]j]j]ujjj]r%jXfilenamer&r'}r((jUjj"ubajjubaubj)r)}r*(jUjj jNjjj}r+(Uexprjj]j]j]j]j]ujNjhj]r,j!)r-}r.(jUj}r/(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjujj)j]r0j)r1}r2(jUj}r3(j]j]r4jaj]j]j]ujj-j]r5jX[source]r6r7}r8(jUjj1ubajjubajj%ubaubeubj)r9}r:(jUjjjjjjj}r;(j]j]j]j]j]ujNjhj]r<(j)r=}r>(jX"Save the DSA parameters to a file.jj9jXT/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_paramsjjj}r?(j]j]j]j]j]ujKjhj]r@jX"Save the DSA parameters to a file.rArB}rC(jUjNjNjhjj=ubaubj)rD}rE(jUjj9jNjjj}rF(j]j]j]j]j]ujNjhj]rG(j)rH}rI(jUj}rJ(j]j]j]j]j]ujjDj]rK(j)rL}rM(jX ParametersjjHjjjjj}rN(j]j]j]j]j]ujKj]rOjX ParametersrPrQ}rR(jUjjLubaubj)rS}rT(jUj}rU(j]j]j]j]j]ujjHj]rVj)rW}rX(jX1filename -- Save the DSA parameters to this file.j}rY(j]j]j]j]j]ujjSj]rZ(j)r[}r\(jXfilenamej}r](j]j]jj]j]j]ujjWj]r^jXfilenamer_r`}ra(jUjj[ubajjubjX – rbrc}rd(jUjjWubjX%Save the DSA parameters to this file.rerf}rg(jUjNjNjhjjWubejjubajjubejjubj)rh}ri(jUj}rj(j]j]j]j]j]ujjDj]rk(j)rl}rm(jXReturnsjjhjjjjj}rn(j]j]j]j]j]ujKj]rojXReturnsrprq}rr(jUjjlubaubj)rs}rt(jUj}ru(j]j]j]j]j]ujjhj]rvj)rw}rx(jX1 (true) if successfulj}ry(j]j]j]j]j]ujjsj]rzjX1 (true) if successfulr{r|}r}(jUjNjNjhjjwubajjubajjubejjubeubeubeubj?)r~}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX+save_params_bio() (M2Crypto.DSA.DSA method)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXDSA.save_params_bio(bio)jjjXX/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_params_biorjj\j}r(j]rhaj_j`X M2Crypto.DSArr}rbj]j]j]j]rhajeXDSA.save_params_biorjgjjhujNjhj]r(j~)r}r(jXsave_params_biojjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXsave_params_biorr}r(jUjNjNjhjjubaubj)r}r(jXbiojjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXbioj}r(jojpj]j]j]j]j]ujjj]rjXbiorr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX$Save DSA parameters to a BIO object.jjjXX/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_params_biojjj}r(j]j]j]j]j]ujKjhj]rjX$Save DSA parameters to a BIO object.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jX*bio -- Save DSA parameters to this object.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXbioj}r(j]j]jj]j]j]ujjj]rjXbiorr}r(jUjjubajjubjX – rr}r(jUjjubjX#Save DSA parameters to this object.rr}r(jUjNjNjhjjubejjubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jX1 (true) if successfulj}r(j]j]j]j]j]ujjj]rjX1 (true) if successfulrr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX(save_pub_key() (M2Crypto.DSA.DSA method)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXDSA.save_pub_key(filename)jjjXU/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_pub_keyrjj\j}r(j]rhaj_j`X M2Crypto.DSAr r }r bj]j]j]j]r hajeXDSA.save_pub_keyr jgjjhujNjhj]r(j~)r}r(jX save_pub_keyjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX save_pub_keyrr}r(jUjNjNjhjjubaubj)r}r(jXfilenamejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXfilenamej}r(jojpj]j]j]j]j]ujjj]rjXfilenamerr}r (jUjjubajjubaubj)r!}r"(jUjjjNjjj}r#(Uexprjj]j]j]j]j]ujNjhj]r$j!)r%}r&(jUj}r'(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj ujj!j]r(j)r)}r*(jUj}r+(j]j]r,jaj]j]j]ujj%j]r-jX[source]r.r/}r0(jUjj)ubajjubajj%ubaubeubj)r1}r2(jUjjjjjjj}r3(j]j]j]j]j]ujNjhj]r4(j)r5}r6(jX4Save the DSA public key (with parameters) to a file.jj1jXU/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_pub_keyjjj}r7(j]j]j]j]j]ujKjhj]r8jX4Save the DSA public key (with parameters) to a file.r9r:}r;(jUjNjNjhjj5ubaubj)r<}r=(jUjj1jNjjj}r>(j]j]j]j]j]ujNjhj]r?(j)r@}rA(jUj}rB(j]j]j]j]j]ujj<j]rC(j)rD}rE(jX Parametersjj@jjjjj}rF(j]j]j]j]j]ujKj]rGjX ParametersrHrI}rJ(jUjjDubaubj)rK}rL(jUj}rM(j]j]j]j]j]ujj@j]rNj)rO}rP(jX?filename -- Save DSA public key (with parameters) to this file.j}rQ(j]j]j]j]j]ujjKj]rR(j)rS}rT(jXfilenamej}rU(j]j]jj]j]j]ujjOj]rVjXfilenamerWrX}rY(jUjjSubajjubjX – rZr[}r\(jUjjOubjX3Save DSA public key (with parameters) to this file.r]r^}r_(jUjNjNjhjjOubejjubajjubejjubj)r`}ra(jUj}rb(j]j]j]j]j]ujj<j]rc(j)rd}re(jXReturnsjj`jjjjj}rf(j]j]j]j]j]ujKj]rgjXReturnsrhri}rj(jUjjdubaubj)rk}rl(jUj}rm(j]j]j]j]j]ujj`j]rnj)ro}rp(jX1 (true) if successfulj}rq(j]j]j]j]j]ujjkj]rrjX1 (true) if successfulrsrt}ru(jUjNjNjhjjoubajjubajjubejjubeubeubeubj?)rv}rw(jUjjjNjjCj}rx(j]j]j]j]j]Uentries]ry(jFX,save_pub_key_bio() (M2Crypto.DSA.DSA method)j=UNtrzaujNjhj]ubjM)r{}r|(jUjjjNjjPj}r}(jRjSXpyj]j]j]j]j]jTXmethodr~jVj~ujNjhj]r(jX)r}r(jXDSA.save_pub_key_bio(bio)jj{jXY/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_pub_key_biorjj\j}r(j]rj=aj_j`X M2Crypto.DSArr}rbj]j]j]j]rj=ajeXDSA.save_pub_key_biorjgjjhujNjhj]r(j~)r}r(jXsave_pub_key_biojjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXsave_pub_key_biorr}r(jUjNjNjhjjubaubj)r}r(jXbiojjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXbioj}r(jojpj]j]j]j]j]ujjj]rjXbiorr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjj{jjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX6Save DSA public key (with parameters) to a BIO object.jjjXY/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.save_pub_key_biojjj}r(j]j]j]j]j]ujKjhj]rjX6Save DSA public key (with parameters) to a BIO object.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jX<bio -- Save DSA public key (with parameters) to this object.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXbioj}r(j]j]jj]j]j]ujjj]rjXbiorr}r(jUjjubajjubjX – rr}r(jUjjubjX5Save DSA public key (with parameters) to this object.rr}r(jUjNjNjhjjubejjubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jX1 (true) if successfulj}r(j]j]j]j]j]ujjj]rjX1 (true) if successfulrr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX&set_params() (M2Crypto.DSA.DSA method)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXDSA.set_params(p, q, g)jjjXS/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.set_paramsrjj\j}r(j]r jaj_j`X M2Crypto.DSAr r }r bj]j]j]j]r jajeXDSA.set_paramsr jgjjhujNjhj]r (j~)r }r (jX set_paramsjjjjjjj}r (jojpj]j]j]j]j]ujNjhj]r jX set_paramsr r }r (jUjNjNjhjj ubaubj)r }r (jXp, q, gjjjjjjj}r (jojpj]j]j]j]j]ujNjhj]r (j)r }r (jXpj}r (jojpj]j]j]j]j]ujj j]r jXpr }r (jUjj ubajjubj)r }r (jXqj}r (jojpj]j]j]j]j]ujj j]r jXqr }r (jUjj ubajjubj)r }r (jXgj}r (jojpj]j]j]j]j]ujj j]r! jXgr" }r# (jUjj ubajjubeubj)r$ }r% (jUjjjNjjj}r& (Uexprjj]j]j]j]j]ujNjhj]r' j!)r( }r) (jUj}r* (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj ujj$ j]r+ j)r, }r- (jUj}r. (j]j]r/ jaj]j]j]ujj( j]r0 jX[source]r1 r2 }r3 (jUjj, ubajjubajj%ubaubeubj)r4 }r5 (jUjjjjjjj}r6 (j]j]j]j]j]ujNjhj]r7 (j)r8 }r9 (jXSet new parameters.jj4 jXS/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.set_paramsr: jjj}r; (j]j]j]j]j]ujKjhj]r< jXSet new parameters.r= r> }r? (jUjNjNjhjj8 ubaubj)r@ }rA (jUjj4 jNjjj}rB (j]j]j]j]j]ujNjhj]rC j)rD }rE (jUj}rF (j]j]j]j]j]ujj@ j]rG (j)rH }rI (jX ParametersjjD jjjjj}rJ (j]j]j]j]j]ujKj]rK jX ParametersrL rM }rN (jUjjH ubaubj)rO }rP (jUj}rQ (j]j]j]j]j]ujjD j]rR j^ )rS }rT (jUj}rU (j]j]j]j]j]ujjO j]rV (jc )rW }rX (jUj}rY (j]j]j]j]j]ujjS j]rZ j)r[ }r\ (jX4p -- MPI binary representation ... format that consists of the number's length in bytes represented as a 4-byte big-endian number, and the number itself in big-endian format, where the most significant bit signals a negative number (the representation of numbers with the MSB set is prefixed with null byte).j}r] (j]j]j]j]j]ujjW j]r^ (j)r_ }r` (jXpj}ra (j]j]jj]j]j]ujj[ j]rb jXprc }rd (jUjj_ ubajjubjX – re rf }rg (jUjj[ ubjX1MPI binary representation … format that consists of the number’s length in bytes represented as a 4-byte big-endian number, and the number itself in big-endian format, where the most significant bit signals a negative number (the representation of numbers with the MSB set is prefixed with null byte).rh ri }rj (jUjNjNjhjj[ ubejjubajjy ubjc )rk }rl (jUj}rm (j]j]j]j]j]ujjS j]rn j)ro }rp (jX q -- dittoj}rq (j]j]j]j]j]ujjk j]rr (j)rs }rt (jXqj}ru (j]j]jj]j]j]ujjo j]rv jXqrw }rx (jUjjs ubajjubjX – ry rz }r{ (jUjjo ubjXdittor| r} }r~ (jUjNjNjhjjo ubejjubajjy ubjc )r }r (jUj}r (j]j]j]j]j]ujjS j]r j)r }r (jX g -- dittoj}r (j]j]j]j]j]ujj j]r (j)r }r (jXgj}r (j]j]jj]j]j]ujj j]r jXgr }r (jUjj ubajjubjX – r r }r (jUjj ubjXdittor r }r (jUjNjNjhjj ubejjubajjy ubejj ubajjubejjubaubcdocutils.nodes definition_list r )r }r (jUjj4 jj: jUdefinition_listr j}r (j]j]j]j]j]ujNjhj]r cdocutils.nodes definition_list_item r )r }r (jX@warning: This does not change the private key, so it may be unsafe to use this method. It is better to use gen_params function to create a new DSA object.jj jj: jUdefinition_list_itemr j}r (j]j]j]j]j]ujK j]r (cdocutils.nodes term r )r }r (jX<@warning: This does not change the private key, so it may bejj jj: jUtermr j}r (j]j]j]j]j]ujK j]r jX<@warning: This does not change the private key, so it may ber r }r (jUjj ubaubcdocutils.nodes definition r )r }r (jUj}r (j]j]j]j]j]ujj j]r j)r }r (jX^unsafe to use this method. It is better to use gen_params function to create a new DSA object.jj jj: jjj}r (j]j]j]j]j]ujK j]r jX^unsafe to use this method. It is better to use gen_params function to create a new DSA object.r r }r (jUjj ubaubajU definitionr ubeubaubeubeubj?)r }r (jUjjjNjjCj}r (j]j]j]j]j]Uentries]r (jFX sign() (M2Crypto.DSA.DSA method)jUNtr aujNjhj]ubjM)r }r (jUjjjNjjPj}r (jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jXDSA.sign(digest)jj jXM/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.signr jj\j}r (j]r jaj_j`X M2Crypto.DSAr r }r bj]j]j]j]r jajeXDSA.signr jgjjhujNjhj]r (j~)r }r (jXsignjj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r jXsignr r }r (jUjNjNjhjj ubaubj)r }r (jXdigestjj jj jjj}r (jojpj]j]j]j]j]ujNjhj]r j)r }r (jXdigestj}r (jojpj]j]j]j]j]ujj j]r jXdigestr r }r (jUjj ubajjubaubj)r }r (jUjj jNjjj}r (Uexprjj]j]j]j]j]ujNjhj]r j!)r }r (jUj}r (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj ujj j]r j)r }r (jUj}r (j]j]r jaj]j]j]ujj j]r jX[source]r r }r (jUjj ubajjubajj%ubaubeubj)r }r (jUjj jj jjj}r (j]j]j]j]j]ujNjhj]r (j)r }r (jXSign the digest.jj jXM/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.signjjj}r (j]j]j]j]j]ujKjhj]r jXSign the digest.r r }r (jUjNjNjhjj ubaubj)r }r (jUjj jNjjj}r (j]j]j]j]j]ujNjhj]r (j)r }r (jUj}r (j]j]j]j]j]ujj j]r (j)r }r!(jX Parametersjj jj jjj}r!(j]j]j]j]j]ujKj]r!jX Parametersr!r!}r!(jUjj ubaubj)r!}r!(jUj}r!(j]j]j]j]j]ujj j]r !j)r !}r !(jXTdigest -- SHA-1 hash of message (same as output from MessageDigest, a "byte string")j}r !(j]j]j]j]j]ujj!j]r !(j)r!}r!(jXdigestj}r!(j]j]jj]j]j]ujj !j]r!jXdigestr!r!}r!(jUjj!ubajjubjX – r!r!}r!(jUjj !ubjXNSHA-1 hash of message (same as output from MessageDigest, a “byte string”)r!r!}r!(jUjNjNjhjj !ubejjubajjubejjubj)r!}r!(jUj}r!(j]j]j]j]j]ujj j]r!(j)r!}r !(jXReturnsjj!jj jjj}r!!(j]j]j]j]j]ujKj]r"!jXReturnsr#!r$!}r%!(jUjj!ubaubj)r&!}r'!(jUj}r(!(j]j]j]j]j]ujj!j]r)!j)r*!}r+!(jXCDSA signature, a tuple of two values, r and s, both "byte strings".j}r,!(j]j]j]j]j]ujj&!j]r-!jXGDSA signature, a tuple of two values, r and s, both “byte strings”.r.!r/!}r0!(jUjNjNjhjj*!ubajjubajjubejjubeubeubeubj?)r1!}r2!(jUjjjNjjCj}r3!(j]j]j]j]j]Uentries]r4!(jFX%sign_asn1() (M2Crypto.DSA.DSA method)jFUNtr5!aujNjhj]ubjM)r6!}r7!(jUjjjNjjPj}r8!(jRjSXpyj]j]j]j]j]jTXmethodr9!jVj9!ujNjhj]r:!(jX)r;!}r!(j]r?!jFaj_j`X M2Crypto.DSAr@!rA!}rB!bj]j]j]j]rC!jFajeX DSA.sign_asn1rD!jgjjhujNjhj]rE!(j~)rF!}rG!(jX sign_asn1jj;!jj=!jjj}rH!(jojpj]j]j]j]j]ujNjhj]rI!jX sign_asn1rJ!rK!}rL!(jUjNjNjhjjF!ubaubj)rM!}rN!(jXdigestjj;!jj=!jjj}rO!(jojpj]j]j]j]j]ujNjhj]rP!j)rQ!}rR!(jXdigestj}rS!(jojpj]j]j]j]j]ujjM!j]rT!jXdigestrU!rV!}rW!(jUjjQ!ubajjubaubj)rX!}rY!(jUjj;!jNjjj}rZ!(Uexprjj]j]j]j]j]ujNjhj]r[!j!)r\!}r]!(jUj}r^!(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjD!ujjX!j]r_!j)r`!}ra!(jUj}rb!(j]j]rc!jaj]j]j]ujj\!j]rd!jX[source]re!rf!}rg!(jUjj`!ubajjubajj%ubaubeubj)rh!}ri!(jUjj6!jj=!jjj}rj!(j]j]j]j]j]ujNjhj]ubeubj?)rk!}rl!(jUjjjNjjCj}rm!(j]j]j]j]j]Uentries]rn!(jFX"verify() (M2Crypto.DSA.DSA method)hUNtro!aujNjhj]ubjM)rp!}rq!(jUjjjNjjPj}rr!(jRjSXpyj]j]j]j]j]jTXmethodrs!jVjs!ujNjhj]rt!(jX)ru!}rv!(jXDSA.verify(digest, r, s)jjp!jXO/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.verifyrw!jj\j}rx!(j]ry!haj_j`X M2Crypto.DSArz!r{!}r|!bj]j]j]j]r}!hajeX DSA.verifyr~!jgjjhujNjhj]r!(j~)r!}r!(jXverifyjju!jjw!jjj}r!(jojpj]j]j]j]j]ujNjhj]r!jXverifyr!r!}r!(jUjNjNjhjj!ubaubj)r!}r!(jX digest, r, sjju!jjw!jjj}r!(jojpj]j]j]j]j]ujNjhj]r!(j)r!}r!(jXdigestj}r!(jojpj]j]j]j]j]ujj!j]r!jXdigestr!r!}r!(jUjj!ubajjubj)r!}r!(jXrj}r!(jojpj]j]j]j]j]ujj!j]r!jXrr!}r!(jUjj!ubajjubj)r!}r!(jXsj}r!(jojpj]j]j]j]j]ujj!j]r!jXsr!}r!(jUjj!ubajjubeubj)r!}r!(jUjju!jNjjj}r!(Uexprjj]j]j]j]j]ujNjhj]r!j!)r!}r!(jUj}r!(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj~!ujj!j]r!j)r!}r!(jUj}r!(j]j]r!jaj]j]j]ujj!j]r!jX[source]r!r!}r!(jUjj!ubajjubajj%ubaubeubj)r!}r!(jUjjp!jjw!jjj}r!(j]j]j]j]j]ujNjhj]r!(j)r!}r!(jXFVerify a newly calculated digest against the signature values r and s.jj!jXO/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.verifyjjj}r!(j]j]j]j]j]ujKjhj]r!jXFVerify a newly calculated digest against the signature values r and s.r!r!}r!(jUjNjNjhjj!ubaubj)r!}r!(jUjj!jNjjj}r!(j]j]j]j]j]ujNjhj]r!(j)r!}r!(jUj}r!(j]j]j]j]j]ujj!j]r!(j)r!}r!(jX Parametersjj!jjw!jjj}r!(j]j]j]j]j]ujKj]r!jX Parametersr!r!}r!(jUjj!ubaubj)r!}r!(jUj}r!(j]j]j]j]j]ujj!j]r!j^ )r!}r!(jUj}r!(j]j]j]j]j]ujj!j]r!(jc )r!}r!(jUj}r!(j]j]j]j]j]ujj!j]r!j)r!}r!(jXTdigest -- SHA-1 hash of message (same as output from MessageDigest, a "byte string")j}r!(j]j]j]j]j]ujj!j]r!(j)r!}r!(jXdigestj}r!(j]j]jj]j]j]ujj!j]r!jXdigestr!r!}r!(jUjj!ubajjubjX – r!r!}r!(jUjj!ubjXNSHA-1 hash of message (same as output from MessageDigest, a “byte string”)r!r!}r!(jUjNjNjhjj!ubejjubajjy ubjc )r!}r!(jUj}r!(j]j]j]j]j]ujj!j]r!j)r!}r!(jX.r -- r value of the signature, a "byte string"j}r!(j]j]j]j]j]ujj!j]r!(j)r!}r!(jXrj}r!(j]j]jj]j]j]ujj!j]r!jXrr!}r!(jUjj!ubajjubjX – r!r!}r!(jUjj!ubjX-r value of the signature, a “byte string”r!r!}r!(jUjNjNjhjj!ubejjubajjy ubjc )r!}r!(jUj}r!(j]j]j]j]j]ujj!j]r!j)r!}r!(jX.s -- s value of the signature, a "byte string"j}r!(j]j]j]j]j]ujj!j]r"(j)r"}r"(jXsj}r"(j]j]jj]j]j]ujj!j]r"jXsr"}r"(jUjj"ubajjubjX – r"r"}r "(jUjj!ubjX-s value of the signature, a “byte string”r "r "}r "(jUjNjNjhjj!ubejjubajjy ubejj ubajjubejjubj)r "}r"(jUj}r"(j]j]j]j]j]ujj!j]r"(j)r"}r"(jXReturnsjj "jjw!jjj}r"(j]j]j]j]j]ujKj]r"jXReturnsr"r"}r"(jUjj"ubaubj)r"}r"(jUj}r"(j]j]j]j]j]ujj "j]r"j)r"}r"(jX)1 (true) if verify succeeded, 0 if failedj}r"(j]j]j]j]j]ujj"j]r"jX)1 (true) if verify succeeded, 0 if failedr "r!"}r""(jUjNjNjhjj"ubajjubajjubejjubeubeubeubj?)r#"}r$"(jUjjjNjjCj}r%"(j]j]j]j]j]Uentries]r&"(jFX'verify_asn1() (M2Crypto.DSA.DSA method)hbUNtr'"aujNjhj]ubjM)r("}r)"(jUjjjNjjPj}r*"(jRjSXpyj]j]j]j]j]jTXmethodr+"jVj+"ujNjhj]r,"(jX)r-"}r."(jXDSA.verify_asn1(digest, blob)jj("jXT/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA.verify_asn1r/"jj\j}r0"(j]r1"hbaj_j`X M2Crypto.DSAr2"r3"}r4"bj]j]j]j]r5"hbajeXDSA.verify_asn1r6"jgjjhujNjhj]r7"(j~)r8"}r9"(jX verify_asn1jj-"jj/"jjj}r:"(jojpj]j]j]j]j]ujNjhj]r;"jX verify_asn1r<"r="}r>"(jUjNjNjhjj8"ubaubj)r?"}r@"(jX digest, blobjj-"jj/"jjj}rA"(jojpj]j]j]j]j]ujNjhj]rB"(j)rC"}rD"(jXdigestj}rE"(jojpj]j]j]j]j]ujj?"j]rF"jXdigestrG"rH"}rI"(jUjjC"ubajjubj)rJ"}rK"(jXblobj}rL"(jojpj]j]j]j]j]ujj?"j]rM"jXblobrN"rO"}rP"(jUjjJ"ubajjubeubj)rQ"}rR"(jUjj-"jNjjj}rS"(Uexprjj]j]j]j]j]ujNjhj]rT"j!)rU"}rV"(jUj}rW"(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj6"ujjQ"j]rX"j)rY"}rZ"(jUj}r["(j]j]r\"jaj]j]j]ujjU"j]r]"jX[source]r^"r_"}r`"(jUjjY"ubajjubajj%ubaubeubj)ra"}rb"(jUjj("jj/"jjj}rc"(j]j]j]j]j]ujNjhj]ubeubeubeubj?)rd"}re"(jUjjwjXM/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSAErrorrf"jjCj}rg"(j]j]j]j]j]Uentries]rh"(jFXDSAErrorri"jVUNtrj"aujNjhj]ubjM)rk"}rl"(jUjjwjjf"jjPj}rm"(jRjSXpyj]j]j]j]j]jTX exceptionrn"jVjn"ujNjhj]ro"(jX)rp"}rq"(jji"jjk"jXM/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSAErrorrr"jj\j}rs"(j]rt"jVaj_j`X M2Crypto.DSAru"rv"}rw"bj]j]j]j]rx"jVajeji"jgUjhujNjhj]ry"(jj)rz"}r{"(jX exception jjp"jjr"jjmj}r|"(jojpj]j]j]j]j]ujNjhj]r}"jX exception r~"r"}r"(jUjNjNjhjjz"ubaubju)r"}r"(jX M2Crypto.DSA.jjp"jjr"jjxj}r"(jojpj]j]j]j]j]ujNjhj]r"jX M2Crypto.DSA.r"r"}r"(jUjNjNjhjj"ubaubj~)r"}r"(jji"jjp"jjr"jjj}r"(jojpj]j]j]j]j]ujNjhj]r"jXDSAErrorr"r"}r"(jUjNjNjhjj"ubaubj)r"}r"(jUjjp"jNjjj}r"(Uexprjj]j]j]j]j]ujNjhj]r"j!)r"}r"(jUj}r"(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidji"ujj"j]r"j)r"}r"(jUj}r"(j]j]r"jaj]j]j]ujj"j]r"jX[source]r"r"}r"(jUjj"ubajjubajj%ubaubeubj)r"}r"(jUjjk"jjr"jjj}r"(j]j]j]j]j]ujNjhj]r"j)r"}r"(jX$Bases: :class:`exceptions.Exception`jj"jjf"jjj}r"(j]j]j]j]j]ujKjhj]r"(jXBases: r"r"}r"(jUjNjNjhjj"ubj!)r"}r"(jX:class:`exceptions.Exception`r"jj"jjjj%j}r"(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyr"j]j]U refexplicitj]j]j]j*j+j,ji"j-X M2Crypto.DSAr"ujKj]r"j0)r"}r"(jj"j}r"(j]j]r"(j5j"Xpy-classr"ej]j]j]ujj"j]r"jXexceptions.Exceptionr"r"}r"(jUjj"ubajj;ubaubeubaubeubj?)r"}r"(jUjjwjNjjCj}r"(j]j]j]j]j]Uentries]r"(jFXDSA_pub (class in M2Crypto.DSA)jUNtr"aujNjhj]ubjM)r"}r"(jUjjwjNjjPj}r"(jRjSXpyj]j]j]j]j]jTXclassr"jVj"ujNjhj]r"(jX)r"}r"(jXDSA_pub(dsa, _pyfree=0)jj"jXL/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA_pubr"jj\j}r"(j]r"jaj_j`X M2Crypto.DSAr"r"}r"bj]j]j]j]r"jajeXDSA_pubr"jgUjhujNjhj]r"(jj)r"}r"(jXclass jj"jj"jjmj}r"(jojpj]j]j]j]j]ujNjhj]r"jXclass r"r"}r"(jUjNjNjhjj"ubaubju)r"}r"(jX M2Crypto.DSA.jj"jj"jjxj}r"(jojpj]j]j]j]j]ujNjhj]r"jX M2Crypto.DSA.r"r"}r"(jUjNjNjhjj"ubaubj~)r"}r"(jj"jj"jj"jjj}r"(jojpj]j]j]j]j]ujNjhj]r"jXDSA_pubr"r"}r"(jUjNjNjhjj"ubaubj)r"}r"(jXdsa, _pyfree=0jj"jj"jjj}r"(jojpj]j]j]j]j]ujNjhj]r"(j)r"}r"(jXdsaj}r"(jojpj]j]j]j]j]ujj"j]r"jXdsar"r"}r"(jUjj"ubajjubj)r"}r"(jX _pyfree=0j}r"(jojpj]j]j]j]j]ujj"j]r"jX _pyfree=0r"r"}r"(jUjj"ubajjubeubj)r"}r"(jUjj"jNjjj}r"(Uexprjj]j]j]j]j]ujNjhj]r"j!)r"}r"(jUj}r"(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj"ujj"j]r"j)r"}r"(jUj}r#(j]j]r#jaj]j]j]ujj"j]r#jX[source]r#r#}r#(jUjj"ubajjubajj%ubaubeubj)r#}r#(jUjj"jj"jjj}r#(j]j]j]j]j]ujNjhj]r #(j)r #}r #(jX Bases: :class:`M2Crypto.DSA.DSA`jj#jXL/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA_pubjjj}r #(j]j]j]j]j]ujKjhj]r #(jXBases: r#r#}r#(jUjNjNjhjj #ubj!)r#}r#(jX:class:`M2Crypto.DSA.DSA`r#jj #jjjj%j}r#(UreftypeXclassj'j(XM2Crypto.DSA.DSAU refdomainXpyr#j]j]U refexplicitj]j]j]j*j+j,j"j-j"ujKj]r#j0)r#}r#(jj#j}r#(j]j]r#(j5j#Xpy-classr#ej]j]j]ujj#j]r#jXM2Crypto.DSA.DSAr#r#}r#(jUjj#ubajj;ubaubeubj)r #}r!#(jX|This class is a DSA context that only supports a public key and verification. It does NOT support a private key or signing.jj#jXL/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA_pubjjj}r"#(j]j]j]j]j]ujKjhj]r##jX|This class is a DSA context that only supports a public key and verification. It does NOT support a private key or signing.r$#r%#}r&#(jUjNjNjhjj #ubaubj?)r'#}r(#(jUjj#jNjjCj}r)#(j]j]j]j]j]Uentries]r*#(jFX)check_key() (M2Crypto.DSA.DSA_pub method)hUNtr+#aujNjhj]ubjM)r,#}r-#(jUjj#jNjjPj}r.#(jRjSXpyj]j]j]j]j]jTXmethodr/#jVj/#ujNjhj]r0#(jX)r1#}r2#(jXDSA_pub.check_key()jj,#jXV/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA_pub.check_keyr3#jj\j}r4#(j]r5#haj_j`X M2Crypto.DSAr6#r7#}r8#bj]j]j]j]r9#hajeXDSA_pub.check_keyr:#jgj"jhujNjhj]r;#(j~)r<#}r=#(jX check_keyjj1#jj3#jjj}r>#(jojpj]j]j]j]j]ujNjhj]r?#jX check_keyr@#rA#}rB#(jUjNjNjhjj<#ubaubj)rC#}rD#(jUjj1#jj3#jjj}rE#(jojpj]j]j]j]j]ujNjhj]ubj)rF#}rG#(jUjj1#jNjjj}rH#(Uexprjj]j]j]j]j]ujNjhj]rI#j!)rJ#}rK#(jUj}rL#(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj:#ujjF#j]rM#j)rN#}rO#(jUj}rP#(j]j]rQ#jaj]j]j]ujjJ#j]rR#jX[source]rS#rT#}rU#(jUjjN#ubajjubajj%ubaubeubj)rV#}rW#(jUjj,#jj3#jjj}rX#(j]j]j]j]j]ujNjhj]rY#j)rZ#}r[#(jUjjV#jNjjj}r\#(j]j]j]j]j]ujNjhj]r]#j)r^#}r_#(jUj}r`#(j]j]j]j]j]ujjZ#j]ra#(j)rb#}rc#(jXReturnsjj^#jj3#jjj}rd#(j]j]j]j]j]ujKj]re#jXReturnsrf#rg#}rh#(jUjjb#ubaubj)ri#}rj#(jUj}rk#(j]j]j]j]j]ujj^#j]rl#j)rm#}rn#(jXdoes DSA_pub contain a pub key?j}ro#(j]j]j]j]j]ujji#j]rp#jXdoes DSA_pub contain a pub key?rq#rr#}rs#(jUjNjNjhjjm#ubajjubajjubejjubaubaubeubj?)rt#}ru#(jUjj#jNjjCj}rv#(j]j]j]j]j]Uentries]rw#(jFX(save_key() (M2Crypto.DSA.DSA_pub method)hMUNtrx#aujNjhj]ubjM)ry#}rz#(jUjj#jNjjPj}r{#(jRjSXpyj]j]j]j]j]jTXmethodr|#jVj|#ujNjhj]r}#(jX)r~#}r#(jXDSA_pub.save_key(filename)jjy#jXU/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA_pub.save_keyr#jj\j}r#(j]r#hMaj_j`X M2Crypto.DSAr#r#}r#bj]j]j]j]r#hMajeXDSA_pub.save_keyjgj"jhujNjhj]r#(j~)r#}r#(jXsave_keyjj~#jj#jjj}r#(jojpj]j]j]j]j]ujNjhj]r#jXsave_keyr#r#}r#(jUjNjNjhjj#ubaubj)r#}r#(jXfilenamejj~#jj#jjj}r#(jojpj]j]j]j]j]ujNjhj]r#j)r#}r#(jXfilenamej}r#(jojpj]j]j]j]j]ujj#j]r#jXfilenamer#r#}r#(jUjj#ubajjubaubeubj)r#}r#(jUjjy#jj#jjj}r#(j]j]j]j]j]ujNjhj]r#(j)r#}r#(jX4Save the DSA public key (with parameters) to a file.jj#jXU/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA_pub.save_keyjjj}r#(j]j]j]j]j]ujKjhj]r#jX4Save the DSA public key (with parameters) to a file.r#r#}r#(jUjNjNjhjj#ubaubj)r#}r#(jUjj#jNjjj}r#(j]j]j]j]j]ujNjhj]r#(j)r#}r#(jUj}r#(j]j]j]j]j]ujj#j]r#(j)r#}r#(jX Parametersjj#jj#jjj}r#(j]j]j]j]j]ujKj]r#jX Parametersr#r#}r#(jUjj#ubaubj)r#}r#(jUj}r#(j]j]j]j]j]ujj#j]r#j)r#}r#(jX?filename -- Save DSA public key (with parameters) to this file.j}r#(j]j]j]j]j]ujj#j]r#(j)r#}r#(jXfilenamej}r#(j]j]jj]j]j]ujj#j]r#jXfilenamer#r#}r#(jUjj#ubajjubjX – r#r#}r#(jUjj#ubjX3Save DSA public key (with parameters) to this file.r#r#}r#(jUjNjNjhjj#ubejjubajjubejjubj)r#}r#(jUj}r#(j]j]j]j]j]ujj#j]r#(j)r#}r#(jXReturnsjj#jj#jjj}r#(j]j]j]j]j]ujKj]r#jXReturnsr#r#}r#(jUjj#ubaubj)r#}r#(jUj}r#(j]j]j]j]j]ujj#j]r#j)r#}r#(jX1 (true) if successfulj}r#(j]j]j]j]j]ujj#j]r#jX1 (true) if successfulr#r#}r#(jUjNjNjhjj#ubajjubajjubejjubeubeubeubj?)r#}r#(jUjj#jNjjCj}r#(j]j]j]j]j]Uentries]r#(jFX,save_key_bio() (M2Crypto.DSA.DSA_pub method)jzUNtr#aujNjhj]ubjM)r#}r#(jUjj#jNjjPj}r#(jRjSXpyj]j]j]j]j]jTXmethodr#jVj#ujNjhj]r#(jX)r#}r#(jXDSA_pub.save_key_bio(bio)jj#jXY/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA_pub.save_key_bior#jj\j}r#(j]r#jzaj_j`X M2Crypto.DSAr#r#}r#bj]j]j]j]r#jzajeXDSA_pub.save_key_biojgj"jhujNjhj]r#(j~)r#}r#(jX save_key_biojj#jj#jjj}r#(jojpj]j]j]j]j]ujNjhj]r#jX save_key_bior#r#}r#(jUjNjNjhjj#ubaubj)r#}r#(jXbiojj#jj#jjj}r#(jojpj]j]j]j]j]ujNjhj]r#j)r#}r#(jXbioj}r$(jojpj]j]j]j]j]ujj#j]r$jXbior$r$}r$(jUjj#ubajjubaubeubj)r$}r$(jUjj#jj#jjj}r$(j]j]j]j]j]ujNjhj]r$(j)r $}r $(jX6Save DSA public key (with parameters) to a BIO object.jj$jXY/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA_pub.save_key_biojjj}r $(j]j]j]j]j]ujKjhj]r $jX6Save DSA public key (with parameters) to a BIO object.r $r$}r$(jUjNjNjhjj $ubaubj)r$}r$(jUjj$jNjjj}r$(j]j]j]j]j]ujNjhj]r$(j)r$}r$(jUj}r$(j]j]j]j]j]ujj$j]r$(j)r$}r$(jX Parametersjj$jj#jjj}r$(j]j]j]j]j]ujKj]r$jX Parametersr$r$}r$(jUjj$ubaubj)r$}r $(jUj}r!$(j]j]j]j]j]ujj$j]r"$j)r#$}r$$(jX<bio -- Save DSA public key (with parameters) to this object.j}r%$(j]j]j]j]j]ujj$j]r&$(j)r'$}r($(jXbioj}r)$(j]j]jj]j]j]ujj#$j]r*$jXbior+$r,$}r-$(jUjj'$ubajjubjX – r.$r/$}r0$(jUjj#$ubjX5Save DSA public key (with parameters) to this object.r1$r2$}r3$(jUjNjNjhjj#$ubejjubajjubejjubj)r4$}r5$(jUj}r6$(j]j]j]j]j]ujj$j]r7$(j)r8$}r9$(jXReturnsjj4$jj#jjj}r:$(j]j]j]j]j]ujKj]r;$jXReturnsr<$r=$}r>$(jUjj8$ubaubj)r?$}r@$(jUj}rA$(j]j]j]j]j]ujj4$j]rB$j)rC$}rD$(jX1 (true) if successfulj}rE$(j]j]j]j]j]ujj?$j]rF$jX1 (true) if successfulrG$rH$}rI$(jUjNjNjhjjC$ubajjubajjubejjubeubeubeubj?)rJ$}rK$(jUjj#jNjjCj}rL$(j]j]j]j]j]Uentries]rM$(jFX$sign() (M2Crypto.DSA.DSA_pub method)h&UNtrN$aujNjhj]ubjM)rO$}rP$(jUjj#jNjjPj}rQ$(jRjSXpyj]j]j]j]j]jTXmethodrR$jVjR$ujNjhj]rS$(jX)rT$}rU$(jXDSA_pub.sign(*argv)jjO$jXQ/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA_pub.signrV$jj\j}rW$(j]rX$h&aj_j`X M2Crypto.DSArY$rZ$}r[$bj]j]j]j]r\$h&ajeX DSA_pub.signr]$jgj"jhujNjhj]r^$(j~)r_$}r`$(jXsignjjT$jjV$jjj}ra$(jojpj]j]j]j]j]ujNjhj]rb$jXsignrc$rd$}re$(jUjNjNjhjj_$ubaubj)rf$}rg$(jX*argvjjT$jjV$jjj}rh$(jojpj]j]j]j]j]ujNjhj]ri$j)rj$}rk$(jX*argvj}rl$(jojpj]j]j]j]j]ujjf$j]rm$jX*argvrn$ro$}rp$(jUjjj$ubajjubaubj)rq$}rr$(jUjjT$jNjjj}rs$(Uexprjj]j]j]j]j]ujNjhj]rt$j!)ru$}rv$(jUj}rw$(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj]$ujjq$j]rx$j)ry$}rz$(jUj}r{$(j]j]r|$jaj]j]j]ujju$j]r}$jX[source]r~$r$}r$(jUjjy$ubajjubajj%ubaubeubj)r$}r$(jUjjO$jjV$jjj}r$(j]j]j]j]j]ujNjhj]ubeubj?)r$}r$(jUjj#jNjjCj}r$(j]j]j]j]j]Uentries]r$(jFX)sign_asn1() (M2Crypto.DSA.DSA_pub method)hUNtr$aujNjhj]ubjM)r$}r$(jUjj#jNjjPj}r$(jRjSXpyj]j]j]j]j]jTXmethodr$jVj$ujNjhj]r$(jX)r$}r$(jXDSA_pub.sign_asn1(*argv)jj$jXV/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.DSA_pub.sign_asn1r$jj\j}r$(j]r$haj_j`X M2Crypto.DSAr$r$}r$bj]j]j]j]r$hajeXDSA_pub.sign_asn1jgj"jhujNjhj]r$(j~)r$}r$(jX sign_asn1jj$jj$jjj}r$(jojpj]j]j]j]j]ujNjhj]r$jX sign_asn1r$r$}r$(jUjNjNjhjj$ubaubj)r$}r$(jX*argvjj$jj$jjj}r$(jojpj]j]j]j]j]ujNjhj]r$j)r$}r$(jX*argvj}r$(jojpj]j]j]j]j]ujj$j]r$jX*argvr$r$}r$(jUjj$ubajjubaubeubj)r$}r$(jUjj$jj$jjj}r$(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r$}r$(jUjjwjNjjCj}r$(j]j]j]j]j]Uentries]r$(jFX%gen_params() (in module M2Crypto.DSA)hUNtr$aujNjhj]ubjM)r$}r$(jUjjwjNjjPj}r$(jRjSXpyj]j]j]j]j]jTXfunctionr$jVj$ujNjhj]r$(jX)r$}r$(jX7gen_params(bits, callback=)jj$jXO/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.gen_paramsr$jj\j}r$(j]r$haj_j`X M2Crypto.DSAr$r$}r$bj]j]j]j]r$hajeX gen_paramsr$jgUjhujNjhj]r$(ju)r$}r$(jX M2Crypto.DSA.jj$jj$jjxj}r$(jojpj]j]j]j]j]ujNjhj]r$jX M2Crypto.DSA.r$r$}r$(jUjNjNjhjj$ubaubj~)r$}r$(jj$jj$jj$jjj}r$(jojpj]j]j]j]j]ujNjhj]r$jX gen_paramsr$r$}r$(jUjNjNjhjj$ubaubj)r$}r$(jX+bits, callback=jj$jj$jjj}r$(jojpj]j]j]j]j]ujNjhj]r$(j)r$}r$(jXbitsj}r$(jojpj]j]j]j]j]ujj$j]r$jXbitsr$r$}r$(jUjj$ubajjubj)r$}r$(jX%callback=j}r$(jojpj]j]j]j]j]ujj$j]r$jX%callback=r$r$}r$(jUjj$ubajjubeubj)r$}r$(jUjj$jNjjj}r$(Uexprjj]j]j]j]j]ujNjhj]r$j!)r$}r$(jUj}r$(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj$ujj$j]r$j)r$}r$(jUj}r$(j]j]r$jaj]j]j]ujj$j]r$jX[source]r$r$}r$(jUjj$ubajjubajj%ubaubeubj)r$}r$(jUjj$jj$jjj}r$(j]j]j]j]j]ujNjhj]r$(j)r$}r$(jX]Factory function that generates DSA parameters and instantiates a DSA object from the output.jj$jXO/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.gen_paramsjjj}r$(j]j]j]j]j]ujKjhj]r$jX]Factory function that generates DSA parameters and instantiates a DSA object from the output.r$r$}r$(jUjNjNjhjj$ubaubj)r$}r$(jUjj$jNjjj}r$(j]j]j]j]j]ujNjhj]r%(j)r%}r%(jUj}r%(j]j]j]j]j]ujj$j]r%(j)r%}r%(jX Parametersjj%jj$jjj}r%(j]j]j]j]j]ujKj]r%jX Parametersr %r %}r %(jUjj%ubaubj)r %}r %(jUj}r%(j]j]j]j]j]ujj%j]r%j^ )r%}r%(jUj}r%(j]j]j]j]j]ujj %j]r%(jc )r%}r%(jUj}r%(j]j]j]j]j]ujj%j]r%j)r%}r%(jXSbits -- The length of the prime to be generated. If 'bits' < 512, it is set to 512.j}r%(j]j]j]j]j]ujj%j]r%(j)r%}r%(jXbitsj}r%(j]j]jj]j]j]ujj%j]r%jXbitsr %r!%}r"%(jUjj%ubajjubjX – r#%r$%}r%%(jUjj%ubjXOThe length of the prime to be generated. If ‘bits’ < 512, it is set to 512.r&%r'%}r(%(jUjNjNjhjj%ubejjubajjy ubjc )r)%}r*%(jUj}r+%(j]j]j]j]j]ujj%j]r,%j)r-%}r.%(jXcallback -- A Python callback object that will be invoked during parameter generation; it usual purpose is to provide visual feedback.j}r/%(j]j]j]j]j]ujj)%j]r0%(j)r1%}r2%(jXcallbackj}r3%(j]j]jj]j]j]ujj-%j]r4%jXcallbackr5%r6%}r7%(jUjj1%ubajjubjX – r8%r9%}r:%(jUjj-%ubjXzA Python callback object that will be invoked during parameter generation; it usual purpose is to provide visual feedback.r;%r<%}r=%(jUjNjNjhjj-%ubejjubajjy ubejj ubajjubejjubj)r>%}r?%(jUj}r@%(j]j]j]j]j]ujj$j]rA%(j)rB%}rC%(jXReturnsjj>%jj$jjj}rD%(j]j]j]j]j]ujKj]rE%jXReturnsrF%rG%}rH%(jUjjB%ubaubj)rI%}rJ%(jUj}rK%(j]j]j]j]j]ujj>%j]rL%j)rM%}rN%(jXinstance of DSA.j}rO%(j]j]j]j]j]ujjI%j]rP%jXinstance of DSA.rQ%rR%}rS%(jUjNjNjhjjM%ubajjubajjubejjubeubeubeubj?)rT%}rU%(jUjjwjNjjCj}rV%(j]j]j]j]j]Uentries]rW%(jFX#load_key() (in module M2Crypto.DSA)jUNtrX%aujNjhj]ubjM)rY%}rZ%(jUjjwjNjjPj}r[%(jRjSXpyj]j]j]j]j]jTXfunctionr\%jVj\%ujNjhj]r]%(jX)r^%}r_%(jX7load_key(file, callback=)jjY%jXM/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_keyr`%jj\j}ra%(j]rb%jaj_j`X M2Crypto.DSArc%rd%}re%bj]j]j]j]rf%jajeXload_keyrg%jgUjhujNjhj]rh%(ju)ri%}rj%(jX M2Crypto.DSA.jj^%jj`%jjxj}rk%(jojpj]j]j]j]j]ujNjhj]rl%jX M2Crypto.DSA.rm%rn%}ro%(jUjNjNjhjji%ubaubj~)rp%}rq%(jjg%jj^%jj`%jjj}rr%(jojpj]j]j]j]j]ujNjhj]rs%jXload_keyrt%ru%}rv%(jUjNjNjhjjp%ubaubj)rw%}rx%(jX-file, callback=jj^%jj`%jjj}ry%(jojpj]j]j]j]j]ujNjhj]rz%(j)r{%}r|%(jXfilej}r}%(jojpj]j]j]j]j]ujjw%j]r~%jXfiler%r%}r%(jUjj{%ubajjubj)r%}r%(jX'callback=j}r%(jojpj]j]j]j]j]ujjw%j]r%jX'callback=r%r%}r%(jUjj%ubajjubeubj)r%}r%(jUjj^%jNjjj}r%(Uexprjj]j]j]j]j]ujNjhj]r%j!)r%}r%(jUj}r%(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjg%ujj%j]r%j)r%}r%(jUj}r%(j]j]r%jaj]j]j]ujj%j]r%jX[source]r%r%}r%(jUjj%ubajjubajj%ubaubeubj)r%}r%(jUjjY%jj`%jjj}r%(j]j]j]j]j]ujNjhj]r%(j)r%}r%(jXPFactory function that instantiates a DSA object from a PEM encoded DSA key pair.jj%jXM/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_keyjjj}r%(j]j]j]j]j]ujKjhj]r%jXPFactory function that instantiates a DSA object from a PEM encoded DSA key pair.r%r%}r%(jUjNjNjhjj%ubaubj)r%}r%(jUjj%jNjjj}r%(j]j]j]j]j]ujNjhj]r%(j)r%}r%(jUj}r%(j]j]j]j]j]ujj%j]r%(j)r%}r%(jX Parametersjj%jj`%jjj}r%(j]j]j]j]j]ujKj]r%jX Parametersr%r%}r%(jUjj%ubaubj)r%}r%(jUj}r%(j]j]j]j]j]ujj%j]r%j^ )r%}r%(jUj}r%(j]j]j]j]j]ujj%j]r%(jc )r%}r%(jUj}r%(j]j]j]j]j]ujj%j]r%j)r%}r%(jXYfile -- Names the file (a path) that contains the PEM representation of the DSA key pair.j}r%(j]j]j]j]j]ujj%j]r%(j)r%}r%(jXfilej}r%(j]j]jj]j]j]ujj%j]r%jXfiler%r%}r%(jUjj%ubajjubjX – r%r%}r%(jUjj%ubjXQNames the file (a path) that contains the PEM representation of the DSA key pair.r%r%}r%(jUjNjNjhjj%ubejjubajjy ubjc )r%}r%(jUj}r%(j]j]j]j]j]ujj%j]r%j)r%}r%(jXfcallback -- A Python callback object that will be invoked if the DSA key pair is passphrase-protected.j}r%(j]j]j]j]j]ujj%j]r%(j)r%}r%(jXcallbackj}r%(j]j]jj]j]j]ujj%j]r%jXcallbackr%r%}r%(jUjj%ubajjubjX – r%r%}r%(jUjj%ubjXZA Python callback object that will be invoked if the DSA key pair is passphrase-protected.r%r%}r%(jUjNjNjhjj%ubejjubajjy ubejj ubajjubejjubj)r%}r%(jUj}r%(j]j]j]j]j]ujj%j]r%(j)r%}r%(jXReturnsjj%jj`%jjj}r%(j]j]j]j]j]ujKj]r%jXReturnsr%r%}r%(jUjj%ubaubj)r%}r%(jUj}r%(j]j]j]j]j]ujj%j]r%j)r%}r%(jXinstance of DSA.j}r%(j]j]j]j]j]ujj%j]r%jXinstance of DSA.r%r%}r%(jUjNjNjhjj%ubajjubajjubejjubeubeubeubj?)r%}r%(jUjjwjNjjCj}r%(j]j]j]j]j]Uentries]r%(jFX'load_key_bio() (in module M2Crypto.DSA)hUNtr%aujNjhj]ubjM)r&}r&(jUjjwjNjjPj}r&(jRjSXpyj]j]j]j]j]jTXfunctionr&jVj&ujNjhj]r&(jX)r&}r&(jX:load_key_bio(bio, callback=)jj&jXQ/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_key_bior&jj\j}r&(j]r &haj_j`X M2Crypto.DSAr &r &}r &bj]j]j]j]r &hajeX load_key_bior&jgUjhujNjhj]r&(ju)r&}r&(jX M2Crypto.DSA.jj&jj&jjxj}r&(jojpj]j]j]j]j]ujNjhj]r&jX M2Crypto.DSA.r&r&}r&(jUjNjNjhjj&ubaubj~)r&}r&(jj&jj&jj&jjj}r&(jojpj]j]j]j]j]ujNjhj]r&jX load_key_bior&r&}r&(jUjNjNjhjj&ubaubj)r&}r&(jX,bio, callback=jj&jj&jjj}r &(jojpj]j]j]j]j]ujNjhj]r!&(j)r"&}r#&(jXbioj}r$&(jojpj]j]j]j]j]ujj&j]r%&jXbior&&r'&}r(&(jUjj"&ubajjubj)r)&}r*&(jX'callback=j}r+&(jojpj]j]j]j]j]ujj&j]r,&jX'callback=r-&r.&}r/&(jUjj)&ubajjubeubj)r0&}r1&(jUjj&jNjjj}r2&(Uexprjj]j]j]j]j]ujNjhj]r3&j!)r4&}r5&(jUj}r6&(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj&ujj0&j]r7&j)r8&}r9&(jUj}r:&(j]j]r;&jaj]j]j]ujj4&j]r<&jX[source]r=&r>&}r?&(jUjj8&ubajjubajj%ubaubeubj)r@&}rA&(jUjj&jj&jjj}rB&(j]j]j]j]j]ujNjhj]rC&(j)rD&}rE&(jXPFactory function that instantiates a DSA object from a PEM encoded DSA key pair.jj@&jXQ/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_key_biojjj}rF&(j]j]j]j]j]ujKjhj]rG&jXPFactory function that instantiates a DSA object from a PEM encoded DSA key pair.rH&rI&}rJ&(jUjNjNjhjjD&ubaubj)rK&}rL&(jUjj@&jNjjj}rM&(j]j]j]j]j]ujNjhj]rN&(j)rO&}rP&(jUj}rQ&(j]j]j]j]j]ujjK&j]rR&(j)rS&}rT&(jX ParametersjjO&jj&jjj}rU&(j]j]j]j]j]ujKj]rV&jX ParametersrW&rX&}rY&(jUjjS&ubaubj)rZ&}r[&(jUj}r\&(j]j]j]j]j]ujjO&j]r]&j^ )r^&}r_&(jUj}r`&(j]j]j]j]j]ujjZ&j]ra&(jc )rb&}rc&(jUj}rd&(j]j]j]j]j]ujj^&j]re&j)rf&}rg&(jX;bio -- Contains the PEM representation of the DSA key pair.j}rh&(j]j]j]j]j]ujjb&j]ri&(j)rj&}rk&(jXbioj}rl&(j]j]jj]j]j]ujjf&j]rm&jXbiorn&ro&}rp&(jUjjj&ubajjubjX – rq&rr&}rs&(jUjjf&ubjX4Contains the PEM representation of the DSA key pair.rt&ru&}rv&(jUjNjNjhjjf&ubejjubajjy ubjc )rw&}rx&(jUj}ry&(j]j]j]j]j]ujj^&j]rz&j)r{&}r|&(jXfcallback -- A Python callback object that will be invoked if the DSA key pair is passphrase-protected.j}r}&(j]j]j]j]j]ujjw&j]r~&(j)r&}r&(jXcallbackj}r&(j]j]jj]j]j]ujj{&j]r&jXcallbackr&r&}r&(jUjj&ubajjubjX – r&r&}r&(jUjj{&ubjXZA Python callback object that will be invoked if the DSA key pair is passphrase-protected.r&r&}r&(jUjNjNjhjj{&ubejjubajjy ubejj ubajjubejjubj)r&}r&(jUj}r&(j]j]j]j]j]ujjK&j]r&(j)r&}r&(jXReturnsjj&jj&jjj}r&(j]j]j]j]j]ujKj]r&jXReturnsr&r&}r&(jUjj&ubaubj)r&}r&(jUj}r&(j]j]j]j]j]ujj&j]r&j)r&}r&(jXinstance of DSA.j}r&(j]j]j]j]j]ujj&j]r&jXinstance of DSA.r&r&}r&(jUjNjNjhjj&ubajjubajjubejjubeubeubeubj?)r&}r&(jUjjwjNjjCj}r&(j]j]j]j]j]Uentries]r&(jFX&load_params() (in module M2Crypto.DSA)hUNtr&aujNjhj]ubjM)r&}r&(jUjjwjNjjPj}r&(jRjSXpyj]j]j]j]j]jTXfunctionr&jVj&ujNjhj]r&(jX)r&}r&(jX:load_params(file, callback=)jj&jXP/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_paramsr&jj\j}r&(j]r&haj_j`X M2Crypto.DSAr&r&}r&bj]j]j]j]r&hajeX load_paramsr&jgUjhujNjhj]r&(ju)r&}r&(jX M2Crypto.DSA.jj&jj&jjxj}r&(jojpj]j]j]j]j]ujNjhj]r&jX M2Crypto.DSA.r&r&}r&(jUjNjNjhjj&ubaubj~)r&}r&(jj&jj&jj&jjj}r&(jojpj]j]j]j]j]ujNjhj]r&jX load_paramsr&r&}r&(jUjNjNjhjj&ubaubj)r&}r&(jX-file, callback=jj&jj&jjj}r&(jojpj]j]j]j]j]ujNjhj]r&(j)r&}r&(jXfilej}r&(jojpj]j]j]j]j]ujj&j]r&jXfiler&r&}r&(jUjj&ubajjubj)r&}r&(jX'callback=j}r&(jojpj]j]j]j]j]ujj&j]r&jX'callback=r&r&}r&(jUjj&ubajjubeubj)r&}r&(jUjj&jNjjj}r&(Uexprjj]j]j]j]j]ujNjhj]r&j!)r&}r&(jUj}r&(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj&ujj&j]r&j)r&}r&(jUj}r&(j]j]r&jaj]j]j]ujj&j]r&jX[source]r&r&}r&(jUjj&ubajjubajj%ubaubeubj)r&}r&(jUjj&jj&jjj}r&(j]j]j]j]j]ujNjhj]r&(j)r&}r&(jXPFactory function that instantiates a DSA object with DSA parameters from a file.jj&jXP/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_paramsjjj}r&(j]j]j]j]j]ujKjhj]r&jXPFactory function that instantiates a DSA object with DSA parameters from a file.r&r&}r&(jUjNjNjhjj&ubaubj)r&}r&(jUjj&jNjjj}r&(j]j]j]j]j]ujNjhj]r&(j)r&}r&(jUj}r&(j]j]j]j]j]ujj&j]r&(j)r&}r&(jX Parametersjj&jj&jjj}r&(j]j]j]j]j]ujKj]r&jX Parametersr&r&}r'(jUjj&ubaubj)r'}r'(jUj}r'(j]j]j]j]j]ujj&j]r'j^ )r'}r'(jUj}r'(j]j]j]j]j]ujj'j]r'(jc )r '}r '(jUj}r '(j]j]j]j]j]ujj'j]r 'j)r '}r'(jX[file -- Names the file (a path) that contains the PEM representation of the DSA parameters.j}r'(j]j]j]j]j]ujj 'j]r'(j)r'}r'(jXfilej}r'(j]j]jj]j]j]ujj 'j]r'jXfiler'r'}r'(jUjj'ubajjubjX – r'r'}r'(jUjj 'ubjXSNames the file (a path) that contains the PEM representation of the DSA parameters.r'r'}r'(jUjNjNjhjj 'ubejjubajjy ubjc )r'}r'(jUj}r '(j]j]j]j]j]ujj'j]r!'j)r"'}r#'(jXmcallback -- A Python callback object that will be invoked if the DSA parameters file is passphrase-protected.j}r$'(j]j]j]j]j]ujj'j]r%'(j)r&'}r''(jXcallbackj}r('(j]j]jj]j]j]ujj"'j]r)'jXcallbackr*'r+'}r,'(jUjj&'ubajjubjX – r-'r.'}r/'(jUjj"'ubjXaA Python callback object that will be invoked if the DSA parameters file is passphrase-protected.r0'r1'}r2'(jUjNjNjhjj"'ubejjubajjy ubejj ubajjubejjubj)r3'}r4'(jUj}r5'(j]j]j]j]j]ujj&j]r6'(j)r7'}r8'(jXReturnsjj3'jj&jjj}r9'(j]j]j]j]j]ujKj]r:'jXReturnsr;'r<'}r='(jUjj7'ubaubj)r>'}r?'(jUj}r@'(j]j]j]j]j]ujj3'j]rA'j)rB'}rC'(jXinstance of DSA.j}rD'(j]j]j]j]j]ujj>'j]rE'jXinstance of DSA.rF'rG'}rH'(jUjNjNjhjjB'ubajjubajjubejjubeubeubeubj?)rI'}rJ'(jUjjwjNjjCj}rK'(j]j]j]j]j]Uentries]rL'(jFX*load_params_bio() (in module M2Crypto.DSA)hUNtrM'aujNjhj]ubjM)rN'}rO'(jUjjwjNjjPj}rP'(jRjSXpyj]j]j]j]j]jTXfunctionrQ'jVjQ'ujNjhj]rR'(jX)rS'}rT'(jX=load_params_bio(bio, callback=)jjN'jXT/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_params_biorU'jj\j}rV'(j]rW'haj_j`X M2Crypto.DSArX'rY'}rZ'bj]j]j]j]r['hajeXload_params_bior\'jgUjhujNjhj]r]'(ju)r^'}r_'(jX M2Crypto.DSA.jjS'jjU'jjxj}r`'(jojpj]j]j]j]j]ujNjhj]ra'jX M2Crypto.DSA.rb'rc'}rd'(jUjNjNjhjj^'ubaubj~)re'}rf'(jj\'jjS'jjU'jjj}rg'(jojpj]j]j]j]j]ujNjhj]rh'jXload_params_biori'rj'}rk'(jUjNjNjhjje'ubaubj)rl'}rm'(jX,bio, callback=jjS'jjU'jjj}rn'(jojpj]j]j]j]j]ujNjhj]ro'(j)rp'}rq'(jXbioj}rr'(jojpj]j]j]j]j]ujjl'j]rs'jXbiort'ru'}rv'(jUjjp'ubajjubj)rw'}rx'(jX'callback=j}ry'(jojpj]j]j]j]j]ujjl'j]rz'jX'callback=r{'r|'}r}'(jUjjw'ubajjubeubj)r~'}r'(jUjjS'jNjjj}r'(Uexprjj]j]j]j]j]ujNjhj]r'j!)r'}r'(jUj}r'(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj\'ujj~'j]r'j)r'}r'(jUj}r'(j]j]r'jaj]j]j]ujj'j]r'jX[source]r'r'}r'(jUjj'ubajjubajj%ubaubeubj)r'}r'(jUjjN'jjU'jjj}r'(j]j]j]j]j]ujNjhj]r'(j)r'}r'(jX_Factory function that instantiates a DSA object with DSA parameters from a M2Crypto.BIO object.jj'jXT/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_params_biojjj}r'(j]j]j]j]j]ujKjhj]r'jX_Factory function that instantiates a DSA object with DSA parameters from a M2Crypto.BIO object.r'r'}r'(jUjNjNjhjj'ubaubj)r'}r'(jUjj'jNjjj}r'(j]j]j]j]j]ujNjhj]r'(j)r'}r'(jUj}r'(j]j]j]j]j]ujj'j]r'(j)r'}r'(jX Parametersjj'jjU'jjj}r'(j]j]j]j]j]ujKj]r'jX Parametersr'r'}r'(jUjj'ubaubj)r'}r'(jUj}r'(j]j]j]j]j]ujj'j]r'j^ )r'}r'(jUj}r'(j]j]j]j]j]ujj'j]r'(jc )r'}r'(jUj}r'(j]j]j]j]j]ujj'j]r'j)r'}r'(jX=bio -- Contains the PEM representation of the DSA parameters.j}r'(j]j]j]j]j]ujj'j]r'(j)r'}r'(jXbioj}r'(j]j]jj]j]j]ujj'j]r'jXbior'r'}r'(jUjj'ubajjubjX – r'r'}r'(jUjj'ubjX6Contains the PEM representation of the DSA parameters.r'r'}r'(jUjNjNjhjj'ubejjubajjy ubjc )r'}r'(jUj}r'(j]j]j]j]j]ujj'j]r'j)r'}r'(jXmcallback -- A Python callback object that will be invoked if the DSA parameters file is passphrase-protected.j}r'(j]j]j]j]j]ujj'j]r'(j)r'}r'(jXcallbackj}r'(j]j]jj]j]j]ujj'j]r'jXcallbackr'r'}r'(jUjj'ubajjubjX – r'r'}r'(jUjj'ubjXaA Python callback object that will be invoked if the DSA parameters file is passphrase-protected.r'r'}r'(jUjNjNjhjj'ubejjubajjy ubejj ubajjubejjubj)r'}r'(jUj}r'(j]j]j]j]j]ujj'j]r'(j)r'}r'(jXReturnsjj'jjU'jjj}r'(j]j]j]j]j]ujKj]r'jXReturnsr'r'}r'(jUjj'ubaubj)r'}r'(jUj}r'(j]j]j]j]j]ujj'j]r'j)r'}r'(jXinstance of DSA.j}r'(j]j]j]j]j]ujj'j]r'jXinstance of DSA.r'r'}r'(jUjNjNjhjj'ubajjubajjubejjubeubeubeubj?)r'}r'(jUjjwjNjjCj}r'(j]j]j]j]j]Uentries]r'(jFX'load_pub_key() (in module M2Crypto.DSA)hUNtr'aujNjhj]ubjM)r'}r'(jUjjwjNjjPj}r'(jRjSXpyj]j]j]j]j]jTXfunctionr'jVj'ujNjhj]r'(jX)r'}r'(jX;load_pub_key(file, callback=)jj'jXQ/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_pub_keyr'jj\j}r'(j]r'haj_j`X M2Crypto.DSAr'r(}r(bj]j]j]j]r(hajeX load_pub_keyr(jgUjhujNjhj]r((ju)r(}r((jX M2Crypto.DSA.jj'jj'jjxj}r((jojpj]j]j]j]j]ujNjhj]r(jX M2Crypto.DSA.r (r (}r ((jUjNjNjhjj(ubaubj~)r (}r ((jj(jj'jj'jjj}r((jojpj]j]j]j]j]ujNjhj]r(jX load_pub_keyr(r(}r((jUjNjNjhjj (ubaubj)r(}r((jX-file, callback=jj'jj'jjj}r((jojpj]j]j]j]j]ujNjhj]r((j)r(}r((jXfilej}r((jojpj]j]j]j]j]ujj(j]r(jXfiler(r(}r((jUjj(ubajjubj)r(}r((jX'callback=j}r ((jojpj]j]j]j]j]ujj(j]r!(jX'callback=r"(r#(}r$((jUjj(ubajjubeubj)r%(}r&((jUjj'jNjjj}r'((Uexprjj]j]j]j]j]ujNjhj]r((j!)r)(}r*((jUj}r+((UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj(ujj%(j]r,(j)r-(}r.((jUj}r/((j]j]r0(jaj]j]j]ujj)(j]r1(jX[source]r2(r3(}r4((jUjj-(ubajjubajj%ubaubeubj)r5(}r6((jUjj'jj'jjj}r7((j]j]j]j]j]ujNjhj]r8((j)r9(}r:((jXFactory function that instantiates a DSA_pub object using a DSA public key contained in PEM file. The PEM file must contain the parameters in addition to the public key.jj5(jXQ/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_pub_keyjjj}r;((j]j]j]j]j]ujKjhj]r<(jXFactory function that instantiates a DSA_pub object using a DSA public key contained in PEM file. The PEM file must contain the parameters in addition to the public key.r=(r>(}r?((jUjNjNjhjj9(ubaubj)r@(}rA((jUjj5(jNjjj}rB((j]j]j]j]j]ujNjhj]rC((j)rD(}rE((jUj}rF((j]j]j]j]j]ujj@(j]rG((j)rH(}rI((jX ParametersjjD(jj'jjj}rJ((j]j]j]j]j]ujKj]rK(jX ParametersrL(rM(}rN((jUjjH(ubaubj)rO(}rP((jUj}rQ((j]j]j]j]j]ujjD(j]rR(j^ )rS(}rT((jUj}rU((j]j]j]j]j]ujjO(j]rV((jc )rW(}rX((jUj}rY((j]j]j]j]j]ujjS(j]rZ(j)r[(}r\((jX[file -- Names the file (a path) that contains the PEM representation of the DSA public key.j}r]((j]j]j]j]j]ujjW(j]r^((j)r_(}r`((jXfilej}ra((j]j]jj]j]j]ujj[(j]rb(jXfilerc(rd(}re((jUjj_(ubajjubjX – rf(rg(}rh((jUjj[(ubjXSNames the file (a path) that contains the PEM representation of the DSA public key.ri(rj(}rk((jUjNjNjhjj[(ubejjubajjy ubjc )rl(}rm((jUj}rn((j]j]j]j]j]ujjS(j]ro(j)rp(}rq((jXlcallback -- A Python callback object that will be invoked should the DSA public key be passphrase-protected.j}rr((j]j]j]j]j]ujjl(j]rs((j)rt(}ru((jXcallbackj}rv((j]j]jj]j]j]ujjp(j]rw(jXcallbackrx(ry(}rz((jUjjt(ubajjubjX – r{(r|(}r}((jUjjp(ubjX`A Python callback object that will be invoked should the DSA public key be passphrase-protected.r~(r(}r((jUjNjNjhjjp(ubejjubajjy ubejj ubajjubejjubj)r(}r((jUj}r((j]j]j]j]j]ujj@(j]r((j)r(}r((jXReturnsjj(jj'jjj}r((j]j]j]j]j]ujKj]r(jXReturnsr(r(}r((jUjj(ubaubj)r(}r((jUj}r((j]j]j]j]j]ujj(j]r(j)r(}r((jXinstance of DSA_pub.j}r((j]j]j]j]j]ujj(j]r(jXinstance of DSA_pub.r(r(}r((jUjNjNjhjj(ubajjubajjubejjubeubeubeubj?)r(}r((jUjjwjNjjCj}r((j]j]j]j]j]Uentries]r((jFX+load_pub_key_bio() (in module M2Crypto.DSA)hUNtr(aujNjhj]ubjM)r(}r((jUjjwjNjjPj}r((jRjSXpyj]j]j]j]j]jTXfunctionr(jVj(ujNjhj]r((jX)r(}r((jX>load_pub_key_bio(bio, callback=)jj(jXU/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_pub_key_bior(jj\j}r((j]r(haj_j`X M2Crypto.DSAr(r(}r(bj]j]j]j]r(hajeXload_pub_key_bior(jgUjhujNjhj]r((ju)r(}r((jX M2Crypto.DSA.jj(jj(jjxj}r((jojpj]j]j]j]j]ujNjhj]r(jX M2Crypto.DSA.r(r(}r((jUjNjNjhjj(ubaubj~)r(}r((jj(jj(jj(jjj}r((jojpj]j]j]j]j]ujNjhj]r(jXload_pub_key_bior(r(}r((jUjNjNjhjj(ubaubj)r(}r((jX,bio, callback=jj(jj(jjj}r((jojpj]j]j]j]j]ujNjhj]r((j)r(}r((jXbioj}r((jojpj]j]j]j]j]ujj(j]r(jXbior(r(}r((jUjj(ubajjubj)r(}r((jX'callback=j}r((jojpj]j]j]j]j]ujj(j]r(jX'callback=r(r(}r((jUjj(ubajjubeubj)r(}r((jUjj(jNjjj}r((Uexprjj]j]j]j]j]ujNjhj]r(j!)r(}r((jUj}r((UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj(ujj(j]r(j)r(}r((jUj}r((j]j]r(jaj]j]j]ujj(j]r(jX[source]r(r(}r((jUjj(ubajjubajj%ubaubeubj)r(}r((jUjj(jj(jjj}r((j]j]j]j]j]ujNjhj]r((j)r(}r((jXFactory function that instantiates a DSA_pub object using a DSA public key contained in PEM format. The PEM must contain the parameters in addition to the public key.jj(jXU/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.load_pub_key_biojjj}r((j]j]j]j]j]ujKjhj]r(jXFactory function that instantiates a DSA_pub object using a DSA public key contained in PEM format. The PEM must contain the parameters in addition to the public key.r(r(}r((jUjNjNjhjj(ubaubj)r(}r((jUjj(jNjjj}r((j]j]j]j]j]ujNjhj]r((j)r(}r((jUj}r((j]j]j]j]j]ujj(j]r((j)r(}r((jX Parametersjj(jj(jjj}r((j]j]j]j]j]ujKj]r(jX Parametersr(r(}r((jUjj(ubaubj)r(}r((jUj}r((j]j]j]j]j]ujj(j]r(j^ )r(}r((jUj}r((j]j]j]j]j]ujj(j]r((jc )r(}r((jUj}r)(j]j]j]j]j]ujj(j]r)j)r)}r)(jXKbio -- Contains the PEM representation of the DSA public key (with params).j}r)(j]j]j]j]j]ujj(j]r)(j)r)}r)(jXbioj}r)(j]j]jj]j]j]ujj)j]r )jXbior )r )}r )(jUjj)ubajjubjX – r )r)}r)(jUjj)ubjXDContains the PEM representation of the DSA public key (with params).r)r)}r)(jUjNjNjhjj)ubejjubajjy ubjc )r)}r)(jUj}r)(j]j]j]j]j]ujj(j]r)j)r)}r)(jXlcallback -- A Python callback object that will be invoked should the DSA public key be passphrase-protected.j}r)(j]j]j]j]j]ujj)j]r)(j)r)}r)(jXcallbackj}r)(j]j]jj]j]j]ujj)j]r)jXcallbackr)r )}r!)(jUjj)ubajjubjX – r")r#)}r$)(jUjj)ubjX`A Python callback object that will be invoked should the DSA public key be passphrase-protected.r%)r&)}r')(jUjNjNjhjj)ubejjubajjy ubejj ubajjubejjubj)r()}r))(jUj}r*)(j]j]j]j]j]ujj(j]r+)(j)r,)}r-)(jXReturnsjj()jj(jjj}r.)(j]j]j]j]j]ujKj]r/)jXReturnsr0)r1)}r2)(jUjj,)ubaubj)r3)}r4)(jUj}r5)(j]j]j]j]j]ujj()j]r6)j)r7)}r8)(jXinstance of DSA_pub.j}r9)(j]j]j]j]j]ujj3)j]r:)jXinstance of DSA_pub.r;)r<)}r=)(jUjNjNjhjj7)ubajjubajjubejjubeubeubeubj?)r>)}r?)(jUjjwjNjjCj}r@)(j]j]j]j]j]Uentries]rA)(jFX.pub_key_from_params() (in module M2Crypto.DSA)hvUNtrB)aujNjhj]ubjM)rC)}rD)(jUjjwjNjjPj}rE)(jRjSXpyj]j]j]j]j]jTXfunctionrF)jVjF)ujNjhj]rG)(jX)rH)}rI)(jX!pub_key_from_params(p, q, g, pub)jjC)jXX/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.pub_key_from_paramsrJ)jj\j}rK)(j]rL)hvaj_j`X M2Crypto.DSArM)rN)}rO)bj]j]j]j]rP)hvajeXpub_key_from_paramsrQ)jgUjhujNjhj]rR)(ju)rS)}rT)(jX M2Crypto.DSA.jjH)jjJ)jjxj}rU)(jojpj]j]j]j]j]ujNjhj]rV)jX M2Crypto.DSA.rW)rX)}rY)(jUjNjNjhjjS)ubaubj~)rZ)}r[)(jjQ)jjH)jjJ)jjj}r\)(jojpj]j]j]j]j]ujNjhj]r])jXpub_key_from_paramsr^)r_)}r`)(jUjNjNjhjjZ)ubaubj)ra)}rb)(jX p, q, g, pubjjH)jjJ)jjj}rc)(jojpj]j]j]j]j]ujNjhj]rd)(j)re)}rf)(jXpj}rg)(jojpj]j]j]j]j]ujja)j]rh)jXpri)}rj)(jUjje)ubajjubj)rk)}rl)(jXqj}rm)(jojpj]j]j]j]j]ujja)j]rn)jXqro)}rp)(jUjjk)ubajjubj)rq)}rr)(jXgj}rs)(jojpj]j]j]j]j]ujja)j]rt)jXgru)}rv)(jUjjq)ubajjubj)rw)}rx)(jXpubj}ry)(jojpj]j]j]j]j]ujja)j]rz)jXpubr{)r|)}r})(jUjjw)ubajjubeubj)r~)}r)(jUjjH)jNjjj}r)(Uexprjj]j]j]j]j]ujNjhj]r)j!)r)}r)(jUj}r)(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidjQ)ujj~)j]r)j)r)}r)(jUj}r)(j]j]r)jaj]j]j]ujj)j]r)jX[source]r)r)}r)(jUjj)ubajjubajj%ubaubeubj)r)}r)(jUjjC)jjJ)jjj}r)(j]j]j]j]j]ujNjhj]r)(j)r)}r)(jXbFactory function that instantiates a DSA_pub object using the parameters and public key specified.jj)jXX/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.pub_key_from_paramsjjj}r)(j]j]j]j]j]ujKjhj]r)jXbFactory function that instantiates a DSA_pub object using the parameters and public key specified.r)r)}r)(jUjNjNjhjj)ubaubj)r)}r)(jUjj)jNjjj}r)(j]j]j]j]j]ujNjhj]r)(j)r)}r)(jUj}r)(j]j]j]j]j]ujj)j]r)(j)r)}r)(jX Parametersjj)jjJ)jjj}r)(j]j]j]j]j]ujKj]r)jX Parametersr)r)}r)(jUjj)ubaubj)r)}r)(jUj}r)(j]j]j]j]j]ujj)j]r)j^ )r)}r)(jUj}r)(j]j]j]j]j]ujj)j]r)(jc )r)}r)(jUj}r)(j]j]j]j]j]ujj)j]r)j)r)}r)(jXp -- value of pj}r)(j]j]j]j]j]ujj)j]r)(j)r)}r)(jXpj}r)(j]j]jj]j]j]ujj)j]r)jXpr)}r)(jUjj)ubajjubjX – r)r)}r)(jUjj)ubjX value of pr)r)}r)(jUjNjNjhjj)ubejjubajjy ubjc )r)}r)(jUj}r)(j]j]j]j]j]ujj)j]r)j)r)}r)(jXq -- value of qj}r)(j]j]j]j]j]ujj)j]r)(j)r)}r)(jXqj}r)(j]j]jj]j]j]ujj)j]r)jXqr)}r)(jUjj)ubajjubjX – r)r)}r)(jUjj)ubjX value of qr)r)}r)(jUjNjNjhjj)ubejjubajjy ubjc )r)}r)(jUj}r)(j]j]j]j]j]ujj)j]r)j)r)}r)(jXg -- value of gj}r)(j]j]j]j]j]ujj)j]r)(j)r)}r)(jXgj}r)(j]j]jj]j]j]ujj)j]r)jXgr)}r)(jUjj)ubajjubjX – r)r)}r)(jUjj)ubjX value of gr)r)}r)(jUjNjNjhjj)ubejjubajjy ubjc )r)}r)(jUj}r)(j]j]j]j]j]ujj)j]r)j)r)}r)(jXpub -- value of the public keyj}r)(j]j]j]j]j]ujj)j]r)(j)r)}r)(jXpubj}r)(j]j]jj]j]j]ujj)j]r)jXpubr)r)}r)(jUjj)ubajjubjX – r)r)}r)(jUjj)ubjXvalue of the public keyr)r)}r*(jUjNjNjhjj)ubejjubajjy ubejj ubajjubejjubj)r*}r*(jUj}r*(j]j]j]j]j]ujj)j]r*(j)r*}r*(jXReturnsjj*jjJ)jjj}r*(j]j]j]j]j]ujKj]r*jXReturnsr *r *}r *(jUjj*ubaubj)r *}r *(jUj}r*(j]j]j]j]j]ujj*j]r*j)r*}r*(jXinstance of DSA_pub.j}r*(j]j]j]j]j]ujj *j]r*jXinstance of DSA_pub.r*r*}r*(jUjNjNjhjj*ubajjubajjubejjubeubeubeubj?)r*}r*(jUjjwjNjjCj}r*(j]j]j]j]j]Uentries]r*(jFX%set_params() (in module M2Crypto.DSA)jDUNtr*aujNjhj]ubjM)r*}r*(jUjjwjNjjPj}r*(jRjSXpyj]j]j]j]j]jTXfunctionr*jVj*ujNjhj]r *(jX)r!*}r"*(jXset_params(p, q, g)jj*jXO/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.set_paramsr#*jj\j}r$*(j]r%*jDaj_j`X M2Crypto.DSAr&*r'*}r(*bj]j]j]j]r)*jDajeX set_paramsr**jgUjhujNjhj]r+*(ju)r,*}r-*(jX M2Crypto.DSA.jj!*jj#*jjxj}r.*(jojpj]j]j]j]j]ujNjhj]r/*jX M2Crypto.DSA.r0*r1*}r2*(jUjNjNjhjj,*ubaubj~)r3*}r4*(jj**jj!*jj#*jjj}r5*(jojpj]j]j]j]j]ujNjhj]r6*jX set_paramsr7*r8*}r9*(jUjNjNjhjj3*ubaubj)r:*}r;*(jXp, q, gjj!*jj#*jjj}r<*(jojpj]j]j]j]j]ujNjhj]r=*(j)r>*}r?*(jXpj}r@*(jojpj]j]j]j]j]ujj:*j]rA*jXprB*}rC*(jUjj>*ubajjubj)rD*}rE*(jXqj}rF*(jojpj]j]j]j]j]ujj:*j]rG*jXqrH*}rI*(jUjjD*ubajjubj)rJ*}rK*(jXgj}rL*(jojpj]j]j]j]j]ujj:*j]rM*jXgrN*}rO*(jUjjJ*ubajjubeubj)rP*}rQ*(jUjj!*jNjjj}rR*(Uexprjj]j]j]j]j]ujNjhj]rS*j!)rT*}rU*(jUj}rV*(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/DSAUrefidj**ujjP*j]rW*j)rX*}rY*(jUj}rZ*(j]j]r[*jaj]j]j]ujjT*j]r\*jX[source]r]*r^*}r_*(jUjjX*ubajjubajj%ubaubeubj)r`*}ra*(jUjj*jj#*jjj}rb*(j]j]j]j]j]ujNjhj]rc*(j)rd*}re*(jXDFactory function that instantiates a DSA object with DSA parameters.jj`*jXO/home/matej/Build/m2crypto/M2Crypto/DSA.py:docstring of M2Crypto.DSA.set_paramsjjj}rf*(j]j]j]j]j]ujKjhj]rg*jXDFactory function that instantiates a DSA object with DSA parameters.rh*ri*}rj*(jUjNjNjhjjd*ubaubj)rk*}rl*(jUjj`*jNjjj}rm*(j]j]j]j]j]ujNjhj]rn*(j)ro*}rp*(jUj}rq*(j]j]j]j]j]ujjk*j]rr*(j)rs*}rt*(jX Parametersjjo*jj#*jjj}ru*(j]j]j]j]j]ujKj]rv*jX Parametersrw*rx*}ry*(jUjjs*ubaubj)rz*}r{*(jUj}r|*(j]j]j]j]j]ujjo*j]r}*j^ )r~*}r*(jUj}r*(j]j]j]j]j]ujjz*j]r*(jc )r*}r*(jUj}r*(j]j]j]j]j]ujj~*j]r*j)r*}r*(jX p -- value of p, a "byte string"j}r*(j]j]j]j]j]ujj*j]r*(j)r*}r*(jXpj}r*(j]j]jj]j]j]ujj*j]r*jXpr*}r*(jUjj*ubajjubjX – r*r*}r*(jUjj*ubjXvalue of p, a “byte string”r*r*}r*(jUjNjNjhjj*ubejjubajjy ubjc )r*}r*(jUj}r*(j]j]j]j]j]ujj~*j]r*j)r*}r*(jX q -- value of q, a "byte string"j}r*(j]j]j]j]j]ujj*j]r*(j)r*}r*(jXqj}r*(j]j]jj]j]j]ujj*j]r*jXqr*}r*(jUjj*ubajjubjX – r*r*}r*(jUjj*ubjXvalue of q, a “byte string”r*r*}r*(jUjNjNjhjj*ubejjubajjy ubjc )r*}r*(jUj}r*(j]j]j]j]j]ujj~*j]r*j)r*}r*(jX g -- value of g, a "byte string"j}r*(j]j]j]j]j]ujj*j]r*(j)r*}r*(jXgj}r*(j]j]jj]j]j]ujj*j]r*jXgr*}r*(jUjj*ubajjubjX – r*r*}r*(jUjj*ubjXvalue of g, a “byte string”r*r*}r*(jUjNjNjhjj*ubejjubajjy ubejj ubajjubejjubj)r*}r*(jUj}r*(j]j]j]j]j]ujjk*j]r*(j)r*}r*(jXReturnsjj*jj#*jjj}r*(j]j]j]j]j]ujKj]r*jXReturnsr*r*}r*(jUjj*ubaubj)r*}r*(jUj}r*(j]j]j]j]j]ujj*j]r*j)r*}r*(jXinstance of DSA.j}r*(j]j]j]j]j]ujj*j]r*jXinstance of DSA.r*r*}r*(jUjNjNjhjj*ubajjubajjubejjubeubeubeubeubj)r*}r*(jUjjjjjjj}r*(j]j]j]j]r*(Xmodule-M2Crypto.ECr*U ec-moduler*ej]r*haujK=jhj]r*(j )r*}r*(jX:mod:`EC` Moduler*jj*jjjj j}r*(j]j]j]j]j]ujK=jhj]r*(j!)r*}r*(jX :mod:`EC`r*jj*jjjj%j}r*(UreftypeXmodj'j(XECU refdomainXpyr*j]j]U refexplicitj]j]j]j*j+j,Nj-j"ujK+(jUj}r?+(j]j]r@+jaj]j]j]ujj9+j]rA+jX[source]rB+rC+}rD+(jUjj=+ubajjubajj%ubaubeubj)rE+}rF+(jUjj*jj+jjj}rG+(j]j]j]j]j]ujNjhj]rH+(j)rI+}rJ+(jX"Object interface to a EC key pair.jjE+jXE/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.ECjjj}rK+(j]j]j]j]j]ujKjhj]rL+jX"Object interface to a EC key pair.rM+rN+}rO+(jUjNjNjhjjI+ubaubj?)rP+}rQ+(jUjjE+jXL/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.as_pemrR+jjCj}rS+(j]j]j]j]j]Uentries]rT+(jFX as_pem() (M2Crypto.EC.EC method)jUNtrU+aujNjhj]ubjM)rV+}rW+(jUjjE+jjR+jjPj}rX+(jRjSXpyj]j]j]j]j]jTXmethodrY+jVjY+ujNjhj]rZ+(jX)r[+}r\+(jXHEC.as_pem(cipher='aes_128_cbc', callback=)jjV+jXL/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.as_pemr]+jj\j}r^+(j]r_+jaj_j`X M2Crypto.ECr`+ra+}rb+bj]j]j]j]rc+jajeX EC.as_pemrd+jgj +jhujNjhj]re+(j~)rf+}rg+(jXas_pemjj[+jj]+jjj}rh+(jojpj]j]j]j]j]ujNjhj]ri+jXas_pemrj+rk+}rl+(jUjNjNjhjjf+ubaubj)rm+}rn+(jX=cipher='aes_128_cbc', callback=jj[+jj]+jjj}ro+(jojpj]j]j]j]j]ujNjhj]rp+(j)rq+}rr+(jXcipher='aes_128_cbc'j}rs+(jojpj]j]j]j]j]ujjm+j]rt+jXcipher='aes_128_cbc'ru+rv+}rw+(jUjjq+ubajjubj)rx+}ry+(jX'callback=j}rz+(jojpj]j]j]j]j]ujjm+j]r{+jX'callback=r|+r}+}r~+(jUjjx+ubajjubeubj)r+}r+(jUjj[+jNjjj}r+(Uexprjj]j]j]j]j]ujNjhj]r+j!)r+}r+(jUj}r+(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidjd+ujj+j]r+j)r+}r+(jUj}r+(j]j]r+jaj]j]j]ujj+j]r+jX[source]r+r+}r+(jUjj+ubajjubajj%ubaubeubj)r+}r+(jUjjV+jj]+jjj}r+(j]j]j]j]j]ujNjhj]r+j)r+}r+(jXsReturns the key(pair) as a string in PEM format. If no password is passed and the cipher is set it exits with errorjj+jjR+jjj}r+(j]j]j]j]j]ujKjhj]r+jXsReturns the key(pair) as a string in PEM format. If no password is passed and the cipher is set it exits with errorr+r+}r+(jUjNjNjhjj+ubaubaubeubj?)r+}r+(jUjjE+jNjjCj}r+(j]j]j]j]j]Uentries]r+(jFX#check_key() (M2Crypto.EC.EC method)htUNtr+aujNjhj]ubjM)r+}r+(jUjjE+jNjjPj}r+(jRjSXpyj]j]j]j]j]jTXmethodr+jVj+ujNjhj]r+(jX)r+}r+(jXEC.check_key()jj+jXO/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.check_keyr+jj\j}r+(j]r+htaj_j`X M2Crypto.ECr+r+}r+bj]j]j]j]r+htajeX EC.check_keyr+jgj +jhujNjhj]r+(j~)r+}r+(jX check_keyjj+jj+jjj}r+(jojpj]j]j]j]j]ujNjhj]r+jX check_keyr+r+}r+(jUjNjNjhjj+ubaubj)r+}r+(jUjj+jj+jjj}r+(jojpj]j]j]j]j]ujNjhj]ubj)r+}r+(jUjj+jNjjj}r+(Uexprjj]j]j]j]j]ujNjhj]r+j!)r+}r+(jUj}r+(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj+ujj+j]r+j)r+}r+(jUj}r+(j]j]r+jaj]j]j]ujj+j]r+jX[source]r+r+}r+(jUjj+ubajjubajj%ubaubeubj)r+}r+(jUjj+jj+jjj}r+(j]j]j]j]j]ujNjhj]ubeubj?)r+}r+(jUjjE+jXT/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.compute_dh_keyr+jjCj}r+(j]j]j]j]j]Uentries]r+(jFX(compute_dh_key() (M2Crypto.EC.EC method)jiUNtr+aujNjhj]ubjM)r+}r+(jUjjE+jj+jjPj}r+(jRjSXpyj]j]j]j]j]jTXmethodr+jVj+ujNjhj]r+(jX)r+}r+(jXEC.compute_dh_key(pub_key)jj+jXT/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.compute_dh_keyr+jj\j}r+(j]r+jiaj_j`X M2Crypto.ECr+r+}r+bj]j]j]j]r+jiajeXEC.compute_dh_keyr+jgj +jhujNjhj]r+(j~)r+}r+(jXcompute_dh_keyjj+jj+jjj}r+(jojpj]j]j]j]j]ujNjhj]r+jXcompute_dh_keyr+r+}r+(jUjNjNjhjj+ubaubj)r+}r+(jXpub_keyjj+jj+jjj}r+(jojpj]j]j]j]j]ujNjhj]r+j)r+}r+(jXpub_keyj}r+(jojpj]j]j]j]j]ujj+j]r+jXpub_keyr+r+}r+(jUjj+ubajjubaubj)r+}r+(jUjj+jNjjj}r+(Uexprjj]j]j]j]j]ujNjhj]r+j!)r+}r+(jUj}r+(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj+ujj+j]r+j)r+}r+(jUj}r+(j]j]r+jaj]j]j]ujj+j]r,jX[source]r,r,}r,(jUjj+ubajjubajj%ubaubeubj)r,}r,(jUjj+jj+jjj}r,(j]j]j]j]j]ujNjhj]r,j)r,}r ,(jXCompute the ECDH shared key of this key pair and the given public key object. They must both use the same curve. Returns the shared key in binary as a buffer object. No Key Derivation Function is applied.jj,jj+jjj}r ,(j]j]j]j]j]ujKjhj]r ,jXCompute the ECDH shared key of this key pair and the given public key object. They must both use the same curve. Returns the shared key in binary as a buffer object. No Key Derivation Function is applied.r ,r ,}r,(jUjNjNjhjj,ubaubaubeubj?)r,}r,(jUjjE+jXM/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.gen_keyr,jjCj}r,(j]j]j]j]j]Uentries]r,(jFX!gen_key() (M2Crypto.EC.EC method)jUNtr,aujNjhj]ubjM)r,}r,(jUjjE+jj,jjPj}r,(jRjSXpyj]j]j]j]j]jTXmethodr,jVj,ujNjhj]r,(jX)r,}r,(jX EC.gen_key()jj,jXM/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.gen_keyr,jj\j}r,(j]r,jaj_j`X M2Crypto.ECr,r ,}r!,bj]j]j]j]r",jajeX EC.gen_keyr#,jgj +jhujNjhj]r$,(j~)r%,}r&,(jXgen_keyjj,jj,jjj}r',(jojpj]j]j]j]j]ujNjhj]r(,jXgen_keyr),r*,}r+,(jUjNjNjhjj%,ubaubj)r,,}r-,(jUjj,jj,jjj}r.,(jojpj]j]j]j]j]ujNjhj]ubj)r/,}r0,(jUjj,jNjjj}r1,(Uexprjj]j]j]j]j]ujNjhj]r2,j!)r3,}r4,(jUj}r5,(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj#,ujj/,j]r6,j)r7,}r8,(jUj}r9,(j]j]r:,jaj]j]j]ujj3,j]r;,jX[source]r<,r=,}r>,(jUjj7,ubajjubajj%ubaubeubj)r?,}r@,(jUjj,jj,jjj}rA,(j]j]j]j]j]ujNjhj]rB,(j)rC,}rD,(jX1Generates the key pair from its parameters. Use::jj?,jj,jjj}rE,(j]j]j]j]j]ujKjhj]rF,jX0Generates the key pair from its parameters. Use:rG,rH,}rI,(jUjNjNjhjjC,ubaubj)rJ,}rK,(jX0keypair = EC.gen_params(curve) keypair.gen_key()jj?,jj,jjj}rL,(jojpj]j]j]j]j]ujK&jhj]rM,jX0keypair = EC.gen_params(curve) keypair.gen_key()rN,rO,}rP,(jUjjJ,ubaubj)rQ,}rR,(jXto create an EC key pair.jj?,jj,jjj}rS,(j]j]j]j]j]ujKjhj]rT,jXto create an EC key pair.rU,rV,}rW,(jUjNjNjhjjQ,ubaubeubeubj?)rX,}rY,(jUjjE+jNjjCj}rZ,(j]j]j]j]j]Uentries]r[,(jFX(m2_ec_key_free() (M2Crypto.EC.EC method)hgUNtr\,aujNjhj]ubjM)r],}r^,(jUjjE+jNjjPj}r_,(jRjSXpyj]j]j]j]j]jTXmethodr`,jVj`,ujNjhj]ra,(jX)rb,}rc,(jXEC.m2_ec_key_freejj],jXT/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.m2_ec_key_freerd,jj\j}re,(j]rf,hgaj_j`X M2Crypto.ECrg,rh,}ri,bj]j]j]j]rj,hgajeXEC.m2_ec_key_freejgj +jhujNjhj]rk,(j~)rl,}rm,(jXm2_ec_key_freejjb,jjd,jjj}rn,(jojpj]j]j]j]j]ujNjhj]ro,jXm2_ec_key_freerp,rq,}rr,(jUjNjNjhjjl,ubaubj)rs,}rt,(jUjjb,jjd,jjj}ru,(jojpj]j]j]j]j]ujNjhj]ubeubj)rv,}rw,(jUjj],jjd,jjj}rx,(j]j]j]j]j]ujNjhj]ubeubj?)ry,}rz,(jUjjE+jNjjCj}r{,(j]j]j]j]j]Uentries]r|,(jFXpub() (M2Crypto.EC.EC method)hUNtr},aujNjhj]ubjM)r~,}r,(jUjjE+jNjjPj}r,(jRjSXpyj]j]j]j]j]jTXmethodr,jVj,ujNjhj]r,(jX)r,}r,(jXEC.pub()jj~,jXI/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.pubr,jj\j}r,(j]r,haj_j`X M2Crypto.ECr,r,}r,bj]j]j]j]r,hajeXEC.pubr,jgj +jhujNjhj]r,(j~)r,}r,(jXpubjj,jj,jjj}r,(jojpj]j]j]j]j]ujNjhj]r,jXpubr,r,}r,(jUjNjNjhjj,ubaubj)r,}r,(jUjj,jj,jjj}r,(jojpj]j]j]j]j]ujNjhj]ubj)r,}r,(jUjj,jNjjj}r,(Uexprjj]j]j]j]j]ujNjhj]r,j!)r,}r,(jUj}r,(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj,ujj,j]r,j)r,}r,(jUj}r,(j]j]r,jaj]j]j]ujj,j]r,jX[source]r,r,}r,(jUjj,ubajjubajj%ubaubeubj)r,}r,(jUjj~,jj,jjj}r,(j]j]j]j]j]ujNjhj]ubeubj?)r,}r,(jUjjE+jNjjCj}r,(j]j]j]j]j]Uentries]r,(jFX"save_key() (M2Crypto.EC.EC method)jTUNtr,aujNjhj]ubjM)r,}r,(jUjjE+jNjjPj}r,(jRjSXpyj]j]j]j]j]jTXmethodr,jVj,ujNjhj]r,(jX)r,}r,(jXPEC.save_key(file, cipher='aes_128_cbc', callback=)jj,jXN/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.save_keyr,jj\j}r,(j]r,jTaj_j`X M2Crypto.ECr,r,}r,bj]j]j]j]r,jTajeX EC.save_keyr,jgj +jhujNjhj]r,(j~)r,}r,(jXsave_keyjj,jj,jjj}r,(jojpj]j]j]j]j]ujNjhj]r,jXsave_keyr,r,}r,(jUjNjNjhjj,ubaubj)r,}r,(jXCfile, cipher='aes_128_cbc', callback=jj,jj,jjj}r,(jojpj]j]j]j]j]ujNjhj]r,(j)r,}r,(jXfilej}r,(jojpj]j]j]j]j]ujj,j]r,jXfiler,r,}r,(jUjj,ubajjubj)r,}r,(jXcipher='aes_128_cbc'j}r,(jojpj]j]j]j]j]ujj,j]r,jXcipher='aes_128_cbc'r,r,}r,(jUjj,ubajjubj)r,}r,(jX'callback=j}r,(jojpj]j]j]j]j]ujj,j]r,jX'callback=r,r,}r,(jUjj,ubajjubeubj)r,}r,(jUjj,jNjjj}r,(Uexprjj]j]j]j]j]ujNjhj]r,j!)r,}r,(jUj}r,(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj,ujj,j]r,j)r,}r,(jUj}r,(j]j]r,jaj]j]j]ujj,j]r,jX[source]r,r,}r,(jUjj,ubajjubajj%ubaubeubj)r,}r,(jUjj,jj,jjj}r,(j]j]j]j]j]ujNjhj]r,(j)r,}r,(jX*Save the key pair to a file in PEM format.jj,jXN/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.save_keyjjj}r,(j]j]j]j]j]ujKjhj]r,jX*Save the key pair to a file in PEM format.r,r,}r,(jUjNjNjhjj,ubaubj)r,}r,(jUjj,jNjjj}r,(j]j]j]j]j]ujNjhj]r,j)r,}r-(jUj}r-(j]j]j]j]j]ujj,j]r-(j)r-}r-(jX Parametersjj,jj,jjj}r-(j]j]j]j]j]ujKj]r-jX Parametersr-r-}r -(jUjj-ubaubj)r -}r -(jUj}r -(j]j]j]j]j]ujj,j]r -j^ )r-}r-(jUj}r-(j]j]j]j]j]ujj -j]r-(jc )r-}r-(jUj}r-(j]j]j]j]j]ujj-j]r-j)r-}r-(jX(file -- Name of filename to save key to.j}r-(j]j]j]j]j]ujj-j]r-(j)r-}r-(jXfilej}r-(j]j]jj]j]j]ujj-j]r-jXfiler-r-}r -(jUjj-ubajjubjX – r!-r"-}r#-(jUjj-ubjX Name of filename to save key to.r$-r%-}r&-(jUjNjNjhjj-ubejjubajjy ubjc )r'-}r(-(jUj}r)-(j]j]j]j]j]ujj-j]r*-j)r+-}r,-(jXcipher -- Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear.j}r--(j]j]j]j]j]ujj'-j]r.-(j)r/-}r0-(jXcipherj}r1-(j]j]jj]j]j]ujj+-j]r2-jXcipherr3-r4-}r5-(jUjj/-ubajjubjX – r6-r7-}r8-(jUjj+-ubjXSymmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then the key is saved in the clear.r9-r:-}r;-(jUjNjNjhjj+-ubejjubajjy ubjc )r<-}r=-(jUj}r>-(j]j]j]j]j]ujj-j]r?-j)r@-}rA-(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.j}rB-(j]j]j]j]j]ujj<-j]rC-(j)rD-}rE-(jXcallbackj}rF-(j]j]jj]j]j]ujj@-j]rG-jXcallbackrH-rI-}rJ-(jUjjD-ubajjubjX – rK-rL-}rM-(jUjj@-ubjXA Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.rN-rO-}rP-(jUjNjNjhjj@-ubejjubajjy ubejj ubajjubejjubaubeubeubj?)rQ-}rR-(jUjjE+jNjjCj}rS-(j]j]j]j]j]Uentries]rT-(jFX&save_key_bio() (M2Crypto.EC.EC method)hUNtrU-aujNjhj]ubjM)rV-}rW-(jUjjE+jNjjPj}rX-(jRjSXpyj]j]j]j]j]jTXmethodrY-jVjY-ujNjhj]rZ-(jX)r[-}r\-(jXSEC.save_key_bio(bio, cipher='aes_128_cbc', callback=)jjV-jXR/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.save_key_bior]-jj\j}r^-(j]r_-haj_j`X M2Crypto.ECr`-ra-}rb-bj]j]j]j]rc-hajeXEC.save_key_biord-jgj +jhujNjhj]re-(j~)rf-}rg-(jX save_key_biojj[-jj]-jjj}rh-(jojpj]j]j]j]j]ujNjhj]ri-jX save_key_biorj-rk-}rl-(jUjNjNjhjjf-ubaubj)rm-}rn-(jXBbio, cipher='aes_128_cbc', callback=jj[-jj]-jjj}ro-(jojpj]j]j]j]j]ujNjhj]rp-(j)rq-}rr-(jXbioj}rs-(jojpj]j]j]j]j]ujjm-j]rt-jXbioru-rv-}rw-(jUjjq-ubajjubj)rx-}ry-(jXcipher='aes_128_cbc'j}rz-(jojpj]j]j]j]j]ujjm-j]r{-jXcipher='aes_128_cbc'r|-r}-}r~-(jUjjx-ubajjubj)r-}r-(jX'callback=j}r-(jojpj]j]j]j]j]ujjm-j]r-jX'callback=r-r-}r-(jUjj-ubajjubeubj)r-}r-(jUjj[-jNjjj}r-(Uexprjj]j]j]j]j]ujNjhj]r-j!)r-}r-(jUj}r-(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidjd-ujj-j]r-j)r-}r-(jUj}r-(j]j]r-jaj]j]j]ujj-j]r-jX[source]r-r-}r-(jUjj-ubajjubajj%ubaubeubj)r-}r-(jUjjV-jj]-jjj}r-(j]j]j]j]j]ujNjhj]r-(j)r-}r-(jX>Save the key pair to an M2Crypto.BIO.BIO object in PEM format.jj-jXR/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.save_key_biojjj}r-(j]j]j]j]j]ujKjhj]r-jX>Save the key pair to an M2Crypto.BIO.BIO object in PEM format.r-r-}r-(jUjNjNjhjj-ubaubj)r-}r-(jUjj-jNjjj}r-(j]j]j]j]j]ujNjhj]r-j)r-}r-(jUj}r-(j]j]j]j]j]ujj-j]r-(j)r-}r-(jX Parametersjj-jj]-jjj}r-(j]j]j]j]j]ujKj]r-jX Parametersr-r-}r-(jUjj-ubaubj)r-}r-(jUj}r-(j]j]j]j]j]ujj-j]r-j^ )r-}r-(jUj}r-(j]j]j]j]j]ujj-j]r-(jc )r-}r-(jUj}r-(j]j]j]j]j]ujj-j]r-j)r-}r-(jX.bio -- M2Crypto.BIO.BIO object to save key to.j}r-(j]j]j]j]j]ujj-j]r-(j)r-}r-(jXbioj}r-(j]j]jj]j]j]ujj-j]r-jXbior-r-}r-(jUjj-ubajjubjX – r-r-}r-(jUjj-ubjX'M2Crypto.BIO.BIO object to save key to.r-r-}r-(jUjNjNjhjj-ubejjubajjy ubjc )r-}r-(jUj}r-(j]j]j]j]j]ujj-j]r-j)r-}r-(jXcipher -- Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear.j}r-(j]j]j]j]j]ujj-j]r-(j)r-}r-(jXcipherj}r-(j]j]jj]j]j]ujj-j]r-jXcipherr-r-}r-(jUjj-ubajjubjX – r-r-}r-(jUjj-ubjXSymmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then the key is saved in the clear.r-r-}r-(jUjNjNjhjj-ubejjubajjy ubjc )r-}r-(jUj}r-(j]j]j]j]j]ujj-j]r-j)r-}r-(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.j}r-(j]j]j]j]j]ujj-j]r-(j)r-}r-(jXcallbackj}r-(j]j]jj]j]j]ujj-j]r-jXcallbackr-r-}r-(jUjj-ubajjubjX – r-r-}r-(jUjj-ubjXA Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.r-r-}r-(jUjNjNjhjj-ubejjubajjy ubejj ubajjubejjubaubeubeubj?)r-}r-(jUjjE+jNjjCj}r-(j]j]j]j]j]Uentries]r-(jFX&save_pub_key() (M2Crypto.EC.EC method)hUNtr-aujNjhj]ubjM)r-}r-(jUjjE+jNjjPj}r-(jRjSXpyj]j]j]j]j]jTXmethodr-jVj-ujNjhj]r.(jX)r.}r.(jXEC.save_pub_key(file)jj-jXR/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.save_pub_keyr.jj\j}r.(j]r.haj_j`X M2Crypto.ECr.r.}r.bj]j]j]j]r .hajeXEC.save_pub_keyr .jgj +jhujNjhj]r .(j~)r .}r .(jX save_pub_keyjj.jj.jjj}r.(jojpj]j]j]j]j]ujNjhj]r.jX save_pub_keyr.r.}r.(jUjNjNjhjj .ubaubj)r.}r.(jXfilejj.jj.jjj}r.(jojpj]j]j]j]j]ujNjhj]r.j)r.}r.(jXfilej}r.(jojpj]j]j]j]j]ujj.j]r.jXfiler.r.}r.(jUjj.ubajjubaubj)r.}r.(jUjj.jNjjj}r .(Uexprjj]j]j]j]j]ujNjhj]r!.j!)r".}r#.(jUj}r$.(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj .ujj.j]r%.j)r&.}r'.(jUj}r(.(j]j]r).jaj]j]j]ujj".j]r*.jX[source]r+.r,.}r-.(jUjj&.ubajjubajj%ubaubeubj)r..}r/.(jUjj-jj.jjj}r0.(j]j]j]j]j]ujNjhj]r1.(j)r2.}r3.(jX0Save the public key to a filename in PEM format.jj..jXR/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.save_pub_keyjjj}r4.(j]j]j]j]j]ujKjhj]r5.jX0Save the public key to a filename in PEM format.r6.r7.}r8.(jUjNjNjhjj2.ubaubj)r9.}r:.(jUjj..jNjjj}r;.(j]j]j]j]j]ujNjhj]r<.j)r=.}r>.(jUj}r?.(j]j]j]j]j]ujj9.j]r@.(j)rA.}rB.(jX Parametersjj=.jj.jjj}rC.(j]j]j]j]j]ujKj]rD.jX ParametersrE.rF.}rG.(jUjjA.ubaubj)rH.}rI.(jUj}rJ.(j]j]j]j]j]ujj=.j]rK.j)rL.}rM.(jX(file -- Name of filename to save key to.j}rN.(j]j]j]j]j]ujjH.j]rO.(j)rP.}rQ.(jXfilej}rR.(j]j]jj]j]j]ujjL.j]rS.jXfilerT.rU.}rV.(jUjjP.ubajjubjX – rW.rX.}rY.(jUjjL.ubjX Name of filename to save key to.rZ.r[.}r\.(jUjNjNjhjjL.ubejjubajjubejjubaubeubeubj?)r].}r^.(jUjjE+jNjjCj}r_.(j]j]j]j]j]Uentries]r`.(jFX*save_pub_key_bio() (M2Crypto.EC.EC method)h UNtra.aujNjhj]ubjM)rb.}rc.(jUjjE+jNjjPj}rd.(jRjSXpyj]j]j]j]j]jTXmethodre.jVje.ujNjhj]rf.(jX)rg.}rh.(jXEC.save_pub_key_bio(bio)jjb.jXV/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.save_pub_key_biori.jj\j}rj.(j]rk.h aj_j`X M2Crypto.ECrl.rm.}rn.bj]j]j]j]ro.h ajeXEC.save_pub_key_biorp.jgj +jhujNjhj]rq.(j~)rr.}rs.(jXsave_pub_key_biojjg.jji.jjj}rt.(jojpj]j]j]j]j]ujNjhj]ru.jXsave_pub_key_biorv.rw.}rx.(jUjNjNjhjjr.ubaubj)ry.}rz.(jXbiojjg.jji.jjj}r{.(jojpj]j]j]j]j]ujNjhj]r|.j)r}.}r~.(jXbioj}r.(jojpj]j]j]j]j]ujjy.j]r.jXbior.r.}r.(jUjj}.ubajjubaubj)r.}r.(jUjjg.jNjjj}r.(Uexprjj]j]j]j]j]ujNjhj]r.j!)r.}r.(jUj}r.(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidjp.ujj.j]r.j)r.}r.(jUj}r.(j]j]r.jaj]j]j]ujj.j]r.jX[source]r.r.}r.(jUjj.ubajjubajj%ubaubeubj)r.}r.(jUjjb.jji.jjj}r.(j]j]j]j]j]ujNjhj]r.(j)r.}r.(jX@Save the public key to an M2Crypto.BIO.BIO object in PEM format.jj.jXV/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.save_pub_key_biojjj}r.(j]j]j]j]j]ujKjhj]r.jX@Save the public key to an M2Crypto.BIO.BIO object in PEM format.r.r.}r.(jUjNjNjhjj.ubaubj)r.}r.(jUjj.jNjjj}r.(j]j]j]j]j]ujNjhj]r.j)r.}r.(jUj}r.(j]j]j]j]j]ujj.j]r.(j)r.}r.(jX Parametersjj.jji.jjj}r.(j]j]j]j]j]ujKj]r.jX Parametersr.r.}r.(jUjj.ubaubj)r.}r.(jUj}r.(j]j]j]j]j]ujj.j]r.j)r.}r.(jX.bio -- M2Crypto.BIO.BIO object to save key to.j}r.(j]j]j]j]j]ujj.j]r.(j)r.}r.(jXbioj}r.(j]j]jj]j]j]ujj.j]r.jXbior.r.}r.(jUjj.ubajjubjX – r.r.}r.(jUjj.ubjX'M2Crypto.BIO.BIO object to save key to.r.r.}r.(jUjNjNjhjj.ubejjubajjubejjubaubeubeubj?)r.}r.(jUjjE+jXN/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.sign_dsar.jjCj}r.(j]j]j]j]j]Uentries]r.(jFX"sign_dsa() (M2Crypto.EC.EC method)h$UNtr.aujNjhj]ubjM)r.}r.(jUjjE+jj.jjPj}r.(jRjSXpyj]j]j]j]j]jTXmethodr.jVj.ujNjhj]r.(jX)r.}r.(jXEC.sign_dsa(digest)jj.jXN/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.sign_dsar.jj\j}r.(j]r.h$aj_j`X M2Crypto.ECr.r.}r.bj]j]j]j]r.h$ajeX EC.sign_dsar.jgj +jhujNjhj]r.(j~)r.}r.(jXsign_dsajj.jj.jjj}r.(jojpj]j]j]j]j]ujNjhj]r.jXsign_dsar.r.}r.(jUjNjNjhjj.ubaubj)r.}r.(jXdigestjj.jj.jjj}r.(jojpj]j]j]j]j]ujNjhj]r.j)r.}r.(jXdigestj}r.(jojpj]j]j]j]j]ujj.j]r.jXdigestr.r.}r.(jUjj.ubajjubaubj)r.}r.(jUjj.jNjjj}r.(Uexprjj]j]j]j]j]ujNjhj]r.j!)r.}r.(jUj}r.(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj.ujj.j]r.j)r.}r.(jUj}r.(j]j]r.jaj]j]j]ujj.j]r.jX[source]r.r.}r.(jUjj.ubajjubajj%ubaubeubj)r.}r.(jUjj.jj.jjj}r.(j]j]j]j]j]ujNjhj]r.j)r.}r/(jX]Sign the given digest using ECDSA. Returns a tuple (r,s), the two ECDSA signature parameters.jj.jj.jjj}r/(j]j]j]j]j]ujKjhj]r/jX]Sign the given digest using ECDSA. Returns a tuple (r,s), the two ECDSA signature parameters.r/r/}r/(jUjNjNjhjj.ubaubaubeubj?)r/}r/(jUjjE+jNjjCj}r/(j]j]j]j]j]Uentries]r /(jFX'sign_dsa_asn1() (M2Crypto.EC.EC method)jUNtr /aujNjhj]ubjM)r /}r /(jUjjE+jNjjPj}r /(jRjSXpyj]j]j]j]j]jTXmethodr/jVj/ujNjhj]r/(jX)r/}r/(jXEC.sign_dsa_asn1(digest)jj /jXS/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.sign_dsa_asn1r/jj\j}r/(j]r/jaj_j`X M2Crypto.ECr/r/}r/bj]j]j]j]r/jajeXEC.sign_dsa_asn1r/jgj +jhujNjhj]r/(j~)r/}r/(jX sign_dsa_asn1jj/jj/jjj}r/(jojpj]j]j]j]j]ujNjhj]r/jX sign_dsa_asn1r/r /}r!/(jUjNjNjhjj/ubaubj)r"/}r#/(jXdigestjj/jj/jjj}r$/(jojpj]j]j]j]j]ujNjhj]r%/j)r&/}r'/(jXdigestj}r(/(jojpj]j]j]j]j]ujj"/j]r)/jXdigestr*/r+/}r,/(jUjj&/ubajjubaubj)r-/}r./(jUjj/jNjjj}r//(Uexprjj]j]j]j]j]ujNjhj]r0/j!)r1/}r2/(jUj}r3/(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj/ujj-/j]r4/j)r5/}r6/(jUj}r7/(j]j]r8/jaj]j]j]ujj1/j]r9/jX[source]r:/r;/}r/(jUjj /jj/jjj}r?/(j]j]j]j]j]ujNjhj]ubeubj?)r@/}rA/(jUjjE+jXP/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.verify_dsarB/jjCj}rC/(j]j]j]j]j]Uentries]rD/(jFX$verify_dsa() (M2Crypto.EC.EC method)jUNtrE/aujNjhj]ubjM)rF/}rG/(jUjjE+jjB/jjPj}rH/(jRjSXpyj]j]j]j]j]jTXmethodrI/jVjI/ujNjhj]rJ/(jX)rK/}rL/(jXEC.verify_dsa(digest, r, s)jjF/jXP/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.verify_dsarM/jj\j}rN/(j]rO/jaj_j`X M2Crypto.ECrP/rQ/}rR/bj]j]j]j]rS/jajeX EC.verify_dsarT/jgj +jhujNjhj]rU/(j~)rV/}rW/(jX verify_dsajjK/jjM/jjj}rX/(jojpj]j]j]j]j]ujNjhj]rY/jX verify_dsarZ/r[/}r\/(jUjNjNjhjjV/ubaubj)r]/}r^/(jX digest, r, sjjK/jjM/jjj}r_/(jojpj]j]j]j]j]ujNjhj]r`/(j)ra/}rb/(jXdigestj}rc/(jojpj]j]j]j]j]ujj]/j]rd/jXdigestre/rf/}rg/(jUjja/ubajjubj)rh/}ri/(jXrj}rj/(jojpj]j]j]j]j]ujj]/j]rk/jXrrl/}rm/(jUjjh/ubajjubj)rn/}ro/(jXsj}rp/(jojpj]j]j]j]j]ujj]/j]rq/jXsrr/}rs/(jUjjn/ubajjubeubj)rt/}ru/(jUjjK/jNjjj}rv/(Uexprjj]j]j]j]j]ujNjhj]rw/j!)rx/}ry/(jUj}rz/(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidjT/ujjt/j]r{/j)r|/}r}/(jUj}r~/(j]j]r/jaj]j]j]ujjx/j]r/jX[source]r/r/}r/(jUjj|/ubajjubajj%ubaubeubj)r/}r/(jUjjF/jjM/jjj}r/(j]j]j]j]j]ujNjhj]r/j)r/}r/(jXPVerify the given digest using ECDSA. r and s are the ECDSA signature parameters.jj/jjB/jjj}r/(j]j]j]j]j]ujKjhj]r/jXPVerify the given digest using ECDSA. r and s are the ECDSA signature parameters.r/r/}r/(jUjNjNjhjj/ubaubaubeubj?)r/}r/(jUjjE+jNjjCj}r/(j]j]j]j]j]Uentries]r/(jFX)verify_dsa_asn1() (M2Crypto.EC.EC method)hUNtr/aujNjhj]ubjM)r/}r/(jUjjE+jNjjPj}r/(jRjSXpyj]j]j]j]j]jTXmethodr/jVj/ujNjhj]r/(jX)r/}r/(jX EC.verify_dsa_asn1(digest, blob)jj/jXU/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC.verify_dsa_asn1r/jj\j}r/(j]r/haj_j`X M2Crypto.ECr/r/}r/bj]j]j]j]r/hajeXEC.verify_dsa_asn1r/jgj +jhujNjhj]r/(j~)r/}r/(jXverify_dsa_asn1jj/jj/jjj}r/(jojpj]j]j]j]j]ujNjhj]r/jXverify_dsa_asn1r/r/}r/(jUjNjNjhjj/ubaubj)r/}r/(jX digest, blobjj/jj/jjj}r/(jojpj]j]j]j]j]ujNjhj]r/(j)r/}r/(jXdigestj}r/(jojpj]j]j]j]j]ujj/j]r/jXdigestr/r/}r/(jUjj/ubajjubj)r/}r/(jXblobj}r/(jojpj]j]j]j]j]ujj/j]r/jXblobr/r/}r/(jUjj/ubajjubeubj)r/}r/(jUjj/jNjjj}r/(Uexprjj]j]j]j]j]ujNjhj]r/j!)r/}r/(jUj}r/(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj/ujj/j]r/j)r/}r/(jUj}r/(j]j]r/jaj]j]j]ujj/j]r/jX[source]r/r/}r/(jUjj/ubajjubajj%ubaubeubj)r/}r/(jUjj/jj/jjj}r/(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r/}r/(jUjj*jXJ/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.ECErrorr/jjCj}r/(j]j]j]j]j]Uentries]r/(jFXECErrorr/heUNtr/aujNjhj]ubjM)r/}r/(jUjj*jj/jjPj}r/(jRjSXpyj]j]j]j]j]jTX exceptionr/jVj/ujNjhj]r/(jX)r/}r/(jj/jj/jXJ/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.ECErrorr/jj\j}r/(j]r/heaj_j`X M2Crypto.ECr/r/}r/bj]j]j]j]r/heajej/jgUjhujNjhj]r/(jj)r/}r/(jX exception jj/jj/jjmj}r/(jojpj]j]j]j]j]ujNjhj]r/jX exception r/r/}r/(jUjNjNjhjj/ubaubju)r/}r/(jX M2Crypto.EC.jj/jj/jjxj}r/(jojpj]j]j]j]j]ujNjhj]r/jX M2Crypto.EC.r/r/}r/(jUjNjNjhjj/ubaubj~)r/}r/(jj/jj/jj/jjj}r/(jojpj]j]j]j]j]ujNjhj]r/jXECErrorr/r/}r/(jUjNjNjhjj/ubaubj)r/}r/(jUjj/jNjjj}r/(Uexprjj]j]j]j]j]ujNjhj]r/j!)r/}r0(jUj}r0(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj/ujj/j]r0j)r0}r0(jUj}r0(j]j]r0jaj]j]j]ujj/j]r0jX[source]r0r 0}r 0(jUjj0ubajjubajj%ubaubeubj)r 0}r 0(jUjj/jj/jjj}r 0(j]j]j]j]j]ujNjhj]r0j)r0}r0(jX$Bases: :class:`exceptions.Exception`jj 0jj/jjj}r0(j]j]j]j]j]ujKjhj]r0(jXBases: r0r0}r0(jUjNjNjhjj0ubj!)r0}r0(jX:class:`exceptions.Exception`r0jj0jjjj%j}r0(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyr0j]j]U refexplicitj]j]j]j*j+j,j/j-X M2Crypto.ECr0ujKj]r0j0)r0}r0(jj0j}r0(j]j]r 0(j5j0Xpy-classr!0ej]j]j]ujj0j]r"0jXexceptions.Exceptionr#0r$0}r%0(jUjj0ubajj;ubaubeubaubeubj?)r&0}r'0(jUjj*jNjjCj}r(0(j]j]j]j]j]Uentries]r)0(jFXEC_pub (class in M2Crypto.EC)hUNtr*0aujNjhj]ubjM)r+0}r,0(jUjj*jNjjPj}r-0(jRjSXpyj]j]j]j]j]jTXclassr.0jVj.0ujNjhj]r/0(jX)r00}r10(jXEC_pub(ec, _pyfree=0)jj+0jXI/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pubr20jj\j}r30(j]r40haj_j`X M2Crypto.ECr50r60}r70bj]j]j]j]r80hajeXEC_pubr90jgUjhujNjhj]r:0(jj)r;0}r<0(jXclass jj00jj20jjmj}r=0(jojpj]j]j]j]j]ujNjhj]r>0jXclass r?0r@0}rA0(jUjNjNjhjj;0ubaubju)rB0}rC0(jX M2Crypto.EC.jj00jj20jjxj}rD0(jojpj]j]j]j]j]ujNjhj]rE0jX M2Crypto.EC.rF0rG0}rH0(jUjNjNjhjjB0ubaubj~)rI0}rJ0(jj90jj00jj20jjj}rK0(jojpj]j]j]j]j]ujNjhj]rL0jXEC_pubrM0rN0}rO0(jUjNjNjhjjI0ubaubj)rP0}rQ0(jX ec, _pyfree=0jj00jj20jjj}rR0(jojpj]j]j]j]j]ujNjhj]rS0(j)rT0}rU0(jXecj}rV0(jojpj]j]j]j]j]ujjP0j]rW0jXecrX0rY0}rZ0(jUjjT0ubajjubj)r[0}r\0(jX _pyfree=0j}r]0(jojpj]j]j]j]j]ujjP0j]r^0jX _pyfree=0r_0r`0}ra0(jUjj[0ubajjubeubj)rb0}rc0(jUjj00jNjjj}rd0(Uexprjj]j]j]j]j]ujNjhj]re0j!)rf0}rg0(jUj}rh0(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj90ujjb0j]ri0j)rj0}rk0(jUj}rl0(j]j]rm0jaj]j]j]ujjf0j]rn0jX[source]ro0rp0}rq0(jUjjj0ubajjubajj%ubaubeubj)rr0}rs0(jUjj+0jj20jjj}rt0(j]j]j]j]j]ujNjhj]ru0(j)rv0}rw0(jXBases: :class:`M2Crypto.EC.EC`jjr0jXI/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pubjjj}rx0(j]j]j]j]j]ujKjhj]ry0(jXBases: rz0r{0}r|0(jUjNjNjhjjv0ubj!)r}0}r~0(jX:class:`M2Crypto.EC.EC`r0jjv0jjjj%j}r0(UreftypeXclassj'j(XM2Crypto.EC.ECU refdomainXpyr0j]j]U refexplicitj]j]j]j*j+j,j90j-j0ujKj]r0j0)r0}r0(jj0j}r0(j]j]r0(j5j0Xpy-classr0ej]j]j]ujj}0j]r0jXM2Crypto.EC.ECr0r0}r0(jUjj0ubajj;ubaubeubj)r0}r0(jXTObject interface to an EC public key. ((don't like this implementation inheritance))jjr0jXI/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pubjjj}r0(j]j]j]j]j]ujKjhj]r0jXVObject interface to an EC public key. ((don’t like this implementation inheritance))r0r0}r0(jUjNjNjhjj0ubaubj?)r0}r0(jUjjr0jXQ/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pub.get_derr0jjCj}r0(j]j]j]j]j]Uentries]r0(jFX%get_der() (M2Crypto.EC.EC_pub method)jUNtr0aujNjhj]ubjM)r0}r0(jUjjr0jj0jjPj}r0(jRjSXpyj]j]j]j]j]jTXmethodr0jVj0ujNjhj]r0(jX)r0}r0(jXEC_pub.get_der()jj0jXQ/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pub.get_derr0jj\j}r0(j]r0jaj_j`X M2Crypto.ECr0r0}r0bj]j]j]j]r0jajeXEC_pub.get_derr0jgj90jhujNjhj]r0(j~)r0}r0(jXget_derjj0jj0jjj}r0(jojpj]j]j]j]j]ujNjhj]r0jXget_derr0r0}r0(jUjNjNjhjj0ubaubj)r0}r0(jUjj0jj0jjj}r0(jojpj]j]j]j]j]ujNjhj]ubj)r0}r0(jUjj0jNjjj}r0(Uexprjj]j]j]j]j]ujNjhj]r0j!)r0}r0(jUj}r0(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj0ujj0j]r0j)r0}r0(jUj}r0(j]j]r0jaj]j]j]ujj0j]r0jX[source]r0r0}r0(jUjj0ubajjubajj%ubaubeubj)r0}r0(jUjj0jj0jjj}r0(j]j]j]j]j]ujNjhj]r0j)r0}r0(jX8Returns the public key in DER format as a buffer object.jj0jj0jjj}r0(j]j]j]j]j]ujKjhj]r0jX8Returns the public key in DER format as a buffer object.r0r0}r0(jUjNjNjhjj0ubaubaubeubj?)r0}r0(jUjjr0jXQ/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pub.get_keyr0jjCj}r0(j]j]j]j]j]Uentries]r0(jFX%get_key() (M2Crypto.EC.EC_pub method)j3UNtr0aujNjhj]ubjM)r0}r0(jUjjr0jj0jjPj}r0(jRjSXpyj]j]j]j]j]jTXmethodr0jVj0ujNjhj]r0(jX)r0}r0(jXEC_pub.get_key()jj0jXQ/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pub.get_keyr0jj\j}r0(j]r0j3aj_j`X M2Crypto.ECr0r0}r0bj]j]j]j]r0j3ajeXEC_pub.get_keyr0jgj90jhujNjhj]r0(j~)r0}r0(jXget_keyjj0jj0jjj}r0(jojpj]j]j]j]j]ujNjhj]r0jXget_keyr0r0}r0(jUjNjNjhjj0ubaubj)r0}r0(jUjj0jj0jjj}r0(jojpj]j]j]j]j]ujNjhj]ubj)r0}r0(jUjj0jNjjj}r0(Uexprjj]j]j]j]j]ujNjhj]r0j!)r0}r0(jUj}r0(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj0ujj0j]r0j)r0}r0(jUj}r0(j]j]r0jaj]j]j]ujj0j]r0jX[source]r0r0}r0(jUjj0ubajjubajj%ubaubeubj)r0}r0(jUjj0jj0jjj}r1(j]j]j]j]j]ujNjhj]r1j)r1}r1(jX(Returns the public key as a byte string.jj0jj0jjj}r1(j]j]j]j]j]ujKjhj]r1jX(Returns the public key as a byte string.r1r1}r1(jUjNjNjhjj1ubaubaubeubj?)r 1}r 1(jUjjr0jNjjCj}r 1(j]j]j]j]j]Uentries]r 1(jFX&save_key() (M2Crypto.EC.EC_pub method)j`UNtr 1aujNjhj]ubjM)r1}r1(jUjjr0jNjjPj}r1(jRjSXpyj]j]j]j]j]jTXmethodr1jVj1ujNjhj]r1(jX)r1}r1(jXEC_pub.save_key(file)jj1jXR/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pub.save_keyr1jj\j}r1(j]r1j`aj_j`X M2Crypto.ECr1r1}r1bj]j]j]j]r1j`ajeXEC_pub.save_keyjgj90jhujNjhj]r1(j~)r1}r1(jXsave_keyjj1jj1jjj}r1(jojpj]j]j]j]j]ujNjhj]r 1jXsave_keyr!1r"1}r#1(jUjNjNjhjj1ubaubj)r$1}r%1(jXfilejj1jj1jjj}r&1(jojpj]j]j]j]j]ujNjhj]r'1j)r(1}r)1(jXfilej}r*1(jojpj]j]j]j]j]ujj$1j]r+1jXfiler,1r-1}r.1(jUjj(1ubajjubaubeubj)r/1}r01(jUjj1jj1jjj}r11(j]j]j]j]j]ujNjhj]r21(j)r31}r41(jX0Save the public key to a filename in PEM format.jj/1jXR/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pub.save_keyjjj}r51(j]j]j]j]j]ujKjhj]r61jX0Save the public key to a filename in PEM format.r71r81}r91(jUjNjNjhjj31ubaubj)r:1}r;1(jUjj/1jNjjj}r<1(j]j]j]j]j]ujNjhj]r=1j)r>1}r?1(jUj}r@1(j]j]j]j]j]ujj:1j]rA1(j)rB1}rC1(jX Parametersjj>1jj1jjj}rD1(j]j]j]j]j]ujKj]rE1jX ParametersrF1rG1}rH1(jUjjB1ubaubj)rI1}rJ1(jUj}rK1(j]j]j]j]j]ujj>1j]rL1j)rM1}rN1(jX(file -- Name of filename to save key to.j}rO1(j]j]j]j]j]ujjI1j]rP1(j)rQ1}rR1(jXfilej}rS1(j]j]jj]j]j]ujjM1j]rT1jXfilerU1rV1}rW1(jUjjQ1ubajjubjX – rX1rY1}rZ1(jUjjM1ubjX Name of filename to save key to.r[1r\1}r]1(jUjNjNjhjjM1ubejjubajjubejjubaubeubeubj?)r^1}r_1(jUjjr0jNjjCj}r`1(j]j]j]j]j]Uentries]ra1(jFX*save_key_bio() (M2Crypto.EC.EC_pub method)jUNtrb1aujNjhj]ubjM)rc1}rd1(jUjjr0jNjjPj}re1(jRjSXpyj]j]j]j]j]jTXmethodrf1jVjf1ujNjhj]rg1(jX)rh1}ri1(jXEC_pub.save_key_bio(bio)jjc1jXV/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pub.save_key_biorj1jj\j}rk1(j]rl1jaj_j`X M2Crypto.ECrm1rn1}ro1bj]j]j]j]rp1jajeXEC_pub.save_key_biojgj90jhujNjhj]rq1(j~)rr1}rs1(jX save_key_biojjh1jjj1jjj}rt1(jojpj]j]j]j]j]ujNjhj]ru1jX save_key_biorv1rw1}rx1(jUjNjNjhjjr1ubaubj)ry1}rz1(jXbiojjh1jjj1jjj}r{1(jojpj]j]j]j]j]ujNjhj]r|1j)r}1}r~1(jXbioj}r1(jojpj]j]j]j]j]ujjy1j]r1jXbior1r1}r1(jUjj}1ubajjubaubeubj)r1}r1(jUjjc1jjj1jjj}r1(j]j]j]j]j]ujNjhj]r1(j)r1}r1(jX@Save the public key to an M2Crypto.BIO.BIO object in PEM format.jj1jXV/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.EC_pub.save_key_biojjj}r1(j]j]j]j]j]ujKjhj]r1jX@Save the public key to an M2Crypto.BIO.BIO object in PEM format.r1r1}r1(jUjNjNjhjj1ubaubj)r1}r1(jUjj1jNjjj}r1(j]j]j]j]j]ujNjhj]r1j)r1}r1(jUj}r1(j]j]j]j]j]ujj1j]r1(j)r1}r1(jX Parametersjj1jjj1jjj}r1(j]j]j]j]j]ujKj]r1jX Parametersr1r1}r1(jUjj1ubaubj)r1}r1(jUj}r1(j]j]j]j]j]ujj1j]r1j)r1}r1(jX.bio -- M2Crypto.BIO.BIO object to save key to.j}r1(j]j]j]j]j]ujj1j]r1(j)r1}r1(jXbioj}r1(j]j]jj]j]j]ujj1j]r1jXbior1r1}r1(jUjj1ubajjubjX – r1r1}r1(jUjj1ubjX'M2Crypto.BIO.BIO object to save key to.r1r1}r1(jUjNjNjhjj1ubejjubajjubejjubaubeubeubeubeubj?)r1}r1(jUjj*jNjjCj}r1(j]j]j]j]j]Uentries]r1(jFX"ec_error() (in module M2Crypto.EC)huUNtr1aujNjhj]ubjM)r1}r1(jUjj*jNjjPj}r1(jRjSXpyj]j]j]j]j]jTXfunctionr1jVj1ujNjhj]r1(jX)r1}r1(jX ec_error()jj1jXK/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.ec_errorr1jj\j}r1(j]r1huaj_j`X M2Crypto.ECr1r1}r1bj]j]j]j]r1huajeXec_errorr1jgUjhujNjhj]r1(ju)r1}r1(jX M2Crypto.EC.jj1jj1jjxj}r1(jojpj]j]j]j]j]ujNjhj]r1jX M2Crypto.EC.r1r1}r1(jUjNjNjhjj1ubaubj~)r1}r1(jj1jj1jj1jjj}r1(jojpj]j]j]j]j]ujNjhj]r1jXec_errorr1r1}r1(jUjNjNjhjj1ubaubj)r1}r1(jUjj1jj1jjj}r1(jojpj]j]j]j]j]ujNjhj]ubj)r1}r1(jUjj1jNjjj}r1(Uexprjj]j]j]j]j]ujNjhj]r1j!)r1}r1(jUj}r1(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj1ujj1j]r1j)r1}r1(jUj}r1(j]j]r1jaj]j]j]ujj1j]r1jX[source]r1r1}r1(jUjj1ubajjubajj%ubaubeubj)r1}r1(jUjj1jj1jjj}r1(j]j]j]j]j]ujNjhj]ubeubj?)r1}r1(jUjj*jNjjCj}r1(j]j]j]j]j]Uentries]r1(jFX$gen_params() (in module M2Crypto.EC)hUNtr1aujNjhj]ubjM)r1}r1(jUjj*jNjjPj}r1(jRjSXpyj]j]j]j]j]jTXfunctionr1jVj1ujNjhj]r1(jX)r1}r1(jXgen_params(curve)jj1jXM/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.gen_paramsr1jj\j}r1(j]r1haj_j`X M2Crypto.ECr1r1}r1bj]j]j]j]r1hajeX gen_paramsr1jgUjhujNjhj]r2(ju)r2}r2(jX M2Crypto.EC.jj1jj1jjxj}r2(jojpj]j]j]j]j]ujNjhj]r2jX M2Crypto.EC.r2r2}r2(jUjNjNjhjj2ubaubj~)r2}r 2(jj1jj1jj1jjj}r 2(jojpj]j]j]j]j]ujNjhj]r 2jX gen_paramsr 2r 2}r2(jUjNjNjhjj2ubaubj)r2}r2(jXcurvejj1jj1jjj}r2(jojpj]j]j]j]j]ujNjhj]r2j)r2}r2(jXcurvej}r2(jojpj]j]j]j]j]ujj2j]r2jXcurver2r2}r2(jUjj2ubajjubaubj)r2}r2(jUjj1jNjjj}r2(Uexprjj]j]j]j]j]ujNjhj]r2j!)r2}r2(jUj}r 2(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj1ujj2j]r!2j)r"2}r#2(jUj}r$2(j]j]r%2jaj]j]j]ujj2j]r&2jX[source]r'2r(2}r)2(jUjj"2ubajjubajj%ubaubeubj)r*2}r+2(jUjj1jj1jjj}r,2(j]j]j]j]j]ujNjhj]r-2(j)r.2}r/2(jX[Factory function that generates EC parameters and instantiates a EC object from the output.jj*2jXM/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.gen_paramsjjj}r02(j]j]j]j]j]ujKjhj]r12jX[Factory function that generates EC parameters and instantiates a EC object from the output.r22r32}r42(jUjNjNjhjj.2ubaubj)r52}r62(jUjj*2jNjjj}r72(j]j]j]j]j]ujNjhj]r82j)r92}r:2(jUj}r;2(j]j]j]j]j]ujj52j]r<2(j)r=2}r>2(jX Parametersjj92jj1jjj}r?2(j]j]j]j]j]ujKj]r@2jX ParametersrA2rB2}rC2(jUjj=2ubaubj)rD2}rE2(jUj}rF2(j]j]j]j]j]ujj92j]rG2j)rH2}rI2(jX5curve -- This is the OpenSSL nid of the curve to use.j}rJ2(j]j]j]j]j]ujjD2j]rK2(j)rL2}rM2(jXcurvej}rN2(j]j]jj]j]j]ujjH2j]rO2jXcurverP2rQ2}rR2(jUjjL2ubajjubjX – rS2rT2}rU2(jUjjH2ubjX,This is the OpenSSL nid of the curve to use.rV2rW2}rX2(jUjNjNjhjjH2ubejjubajjubejjubaubeubeubj?)rY2}rZ2(jUjj*jNjjCj}r[2(j]j]j]j]j]Uentries]r\2(jFX,get_builtin_curves() (in module M2Crypto.EC)hUNtr]2aujNjhj]ubjM)r^2}r_2(jUjj*jNjjPj}r`2(jRjSXpyj]j]j]j]j]jTXfunctionra2jVja2ujNjhj]rb2(jX)rc2}rd2(jXget_builtin_curves()jj^2jXU/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.get_builtin_curvesre2jj\j}rf2(j]rg2haj_j`X M2Crypto.ECrh2ri2}rj2bj]j]j]j]rk2hajeXget_builtin_curvesrl2jgUjhujNjhj]rm2(ju)rn2}ro2(jX M2Crypto.EC.jjc2jje2jjxj}rp2(jojpj]j]j]j]j]ujNjhj]rq2jX M2Crypto.EC.rr2rs2}rt2(jUjNjNjhjjn2ubaubj~)ru2}rv2(jjl2jjc2jje2jjj}rw2(jojpj]j]j]j]j]ujNjhj]rx2jXget_builtin_curvesry2rz2}r{2(jUjNjNjhjju2ubaubj)r|2}r}2(jUjjc2jje2jjj}r~2(jojpj]j]j]j]j]ujNjhj]ubj)r2}r2(jUjjc2jNjjj}r2(Uexprjj]j]j]j]j]ujNjhj]r2j!)r2}r2(jUj}r2(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidjl2ujj2j]r2j)r2}r2(jUj}r2(j]j]r2jaj]j]j]ujj2j]r2jX[source]r2r2}r2(jUjj2ubajjubajj%ubaubeubj)r2}r2(jUjj^2jje2jjj}r2(j]j]j]j]j]ujNjhj]ubeubj?)r2}r2(jUjj*jNjjCj}r2(j]j]j]j]j]Uentries]r2(jFX"load_key() (in module M2Crypto.EC)hUNtr2aujNjhj]ubjM)r2}r2(jUjj*jNjjPj}r2(jRjSXpyj]j]j]j]j]jTXfunctionr2jVj2ujNjhj]r2(jX)r2}r2(jX7load_key(file, callback=)jj2jXK/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_keyr2jj\j}r2(j]r2haj_j`X M2Crypto.ECr2r2}r2bj]j]j]j]r2hajeXload_keyr2jgUjhujNjhj]r2(ju)r2}r2(jX M2Crypto.EC.jj2jj2jjxj}r2(jojpj]j]j]j]j]ujNjhj]r2jX M2Crypto.EC.r2r2}r2(jUjNjNjhjj2ubaubj~)r2}r2(jj2jj2jj2jjj}r2(jojpj]j]j]j]j]ujNjhj]r2jXload_keyr2r2}r2(jUjNjNjhjj2ubaubj)r2}r2(jX-file, callback=jj2jj2jjj}r2(jojpj]j]j]j]j]ujNjhj]r2(j)r2}r2(jXfilej}r2(jojpj]j]j]j]j]ujj2j]r2jXfiler2r2}r2(jUjj2ubajjubj)r2}r2(jX'callback=j}r2(jojpj]j]j]j]j]ujj2j]r2jX'callback=r2r2}r2(jUjj2ubajjubeubj)r2}r2(jUjj2jNjjj}r2(Uexprjj]j]j]j]j]ujNjhj]r2j!)r2}r2(jUj}r2(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj2ujj2j]r2j)r2}r2(jUj}r2(j]j]r2jaj]j]j]ujj2j]r2jX[source]r2r2}r2(jUjj2ubajjubajj%ubaubeubj)r2}r2(jUjj2jj2jjj}r2(j]j]j]j]j]ujNjhj]r2(j)r2}r2(jX/Factory function that instantiates a EC object.jj2jXK/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_keyjjj}r2(j]j]j]j]j]ujKjhj]r2jX/Factory function that instantiates a EC object.r2r2}r2(jUjNjNjhjj2ubaubj)r2}r2(jUjj2jNjjj}r2(j]j]j]j]j]ujNjhj]r2j)r2}r2(jUj}r2(j]j]j]j]j]ujj2j]r2(j)r2}r2(jX Parametersjj2jj2jjj}r2(j]j]j]j]j]ujKj]r2jX Parametersr2r2}r2(jUjj2ubaubj)r2}r2(jUj}r2(j]j]j]j]j]ujj2j]r2j^ )r2}r2(jUj}r2(j]j]j]j]j]ujj2j]r2(jc )r2}r2(jUj}r2(j]j]j]j]j]ujj2j]r2j)r2}r2(jXSfile -- Names the filename that contains the PEM representation of the EC key pair.j}r2(j]j]j]j]j]ujj2j]r3(j)r3}r3(jXfilej}r3(j]j]jj]j]j]ujj2j]r3jXfiler3r3}r3(jUjj3ubajjubjX – r3r 3}r 3(jUjj2ubjXKNames the filename that contains the PEM representation of the EC key pair.r 3r 3}r 3(jUjNjNjhjj2ubejjubajjy ubjc )r3}r3(jUj}r3(j]j]j]j]j]ujj2j]r3j)r3}r3(jXccallback -- Python callback object that will be invoked if the EC key pair is passphrase-protected.j}r3(j]j]j]j]j]ujj3j]r3(j)r3}r3(jXcallbackj}r3(j]j]jj]j]j]ujj3j]r3jXcallbackr3r3}r3(jUjj3ubajjubjX – r3r3}r3(jUjj3ubjXWPython callback object that will be invoked if the EC key pair is passphrase-protected.r 3r!3}r"3(jUjNjNjhjj3ubejjubajjy ubejj ubajjubejjubaubeubeubj?)r#3}r$3(jUjj*jNjjCj}r%3(j]j]j]j]j]Uentries]r&3(jFX&load_key_bio() (in module M2Crypto.EC)j@UNtr'3aujNjhj]ubjM)r(3}r)3(jUjj*jNjjPj}r*3(jRjSXpyj]j]j]j]j]jTXfunctionr+3jVj+3ujNjhj]r,3(jX)r-3}r.3(jX:load_key_bio(bio, callback=)jj(3jXO/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_key_bior/3jj\j}r03(j]r13j@aj_j`X M2Crypto.ECr23r33}r43bj]j]j]j]r53j@ajeX load_key_bior63jgUjhujNjhj]r73(ju)r83}r93(jX M2Crypto.EC.jj-3jj/3jjxj}r:3(jojpj]j]j]j]j]ujNjhj]r;3jX M2Crypto.EC.r<3r=3}r>3(jUjNjNjhjj83ubaubj~)r?3}r@3(jj63jj-3jj/3jjj}rA3(jojpj]j]j]j]j]ujNjhj]rB3jX load_key_biorC3rD3}rE3(jUjNjNjhjj?3ubaubj)rF3}rG3(jX,bio, callback=jj-3jj/3jjj}rH3(jojpj]j]j]j]j]ujNjhj]rI3(j)rJ3}rK3(jXbioj}rL3(jojpj]j]j]j]j]ujjF3j]rM3jXbiorN3rO3}rP3(jUjjJ3ubajjubj)rQ3}rR3(jX'callback=j}rS3(jojpj]j]j]j]j]ujjF3j]rT3jX'callback=rU3rV3}rW3(jUjjQ3ubajjubeubj)rX3}rY3(jUjj-3jNjjj}rZ3(Uexprjj]j]j]j]j]ujNjhj]r[3j!)r\3}r]3(jUj}r^3(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj63ujjX3j]r_3j)r`3}ra3(jUj}rb3(j]j]rc3jaj]j]j]ujj\3j]rd3jX[source]re3rf3}rg3(jUjj`3ubajjubajj%ubaubeubj)rh3}ri3(jUjj(3jj/3jjj}rj3(j]j]j]j]j]ujNjhj]rk3(j)rl3}rm3(jX/Factory function that instantiates a EC object.jjh3jXO/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_key_biojjj}rn3(j]j]j]j]j]ujKjhj]ro3jX/Factory function that instantiates a EC object.rp3rq3}rr3(jUjNjNjhjjl3ubaubj)rs3}rt3(jUjjh3jNjjj}ru3(j]j]j]j]j]ujNjhj]rv3j)rw3}rx3(jUj}ry3(j]j]j]j]j]ujjs3j]rz3(j)r{3}r|3(jX Parametersjjw3jj/3jjj}r}3(j]j]j]j]j]ujKj]r~3jX Parametersr3r3}r3(jUjj{3ubaubj)r3}r3(jUj}r3(j]j]j]j]j]ujjw3j]r3j^ )r3}r3(jUj}r3(j]j]j]j]j]ujj3j]r3(jc )r3}r3(jUj}r3(j]j]j]j]j]ujj3j]r3j)r3}r3(jXSbio -- M2Crypto.BIO object that contains the PEM representation of the EC key pair.j}r3(j]j]j]j]j]ujj3j]r3(j)r3}r3(jXbioj}r3(j]j]jj]j]j]ujj3j]r3jXbior3r3}r3(jUjj3ubajjubjX – r3r3}r3(jUjj3ubjXLM2Crypto.BIO object that contains the PEM representation of the EC key pair.r3r3}r3(jUjNjNjhjj3ubejjubajjy ubjc )r3}r3(jUj}r3(j]j]j]j]j]ujj3j]r3j)r3}r3(jXccallback -- Python callback object that will be invoked if the EC key pair is passphrase-protected.j}r3(j]j]j]j]j]ujj3j]r3(j)r3}r3(jXcallbackj}r3(j]j]jj]j]j]ujj3j]r3jXcallbackr3r3}r3(jUjj3ubajjubjX – r3r3}r3(jUjj3ubjXWPython callback object that will be invoked if the EC key pair is passphrase-protected.r3r3}r3(jUjNjNjhjj3ubejjubajjy ubejj ubajjubejjubaubeubeubj?)r3}r3(jUjj*jNjjCj}r3(j]j]j]j]j]Uentries]r3(jFX)load_key_string() (in module M2Crypto.EC)jUNtr3aujNjhj]ubjM)r3}r3(jUjj*jNjjPj}r3(jRjSXpyj]j]j]j]j]jTXfunctionr3jVj3ujNjhj]r3(jX)r3}r3(jX@load_key_string(string, callback=)jj3jXR/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_key_stringr3jj\j}r3(j]r3jaj_j`X M2Crypto.ECr3r3}r3bj]j]j]j]r3jajeXload_key_stringr3jgUjhujNjhj]r3(ju)r3}r3(jX M2Crypto.EC.jj3jj3jjxj}r3(jojpj]j]j]j]j]ujNjhj]r3jX M2Crypto.EC.r3r3}r3(jUjNjNjhjj3ubaubj~)r3}r3(jj3jj3jj3jjj}r3(jojpj]j]j]j]j]ujNjhj]r3jXload_key_stringr3r3}r3(jUjNjNjhjj3ubaubj)r3}r3(jX/string, callback=jj3jj3jjj}r3(jojpj]j]j]j]j]ujNjhj]r3(j)r3}r3(jXstringj}r3(jojpj]j]j]j]j]ujj3j]r3jXstringr3r3}r3(jUjj3ubajjubj)r3}r3(jX'callback=j}r3(jojpj]j]j]j]j]ujj3j]r3jX'callback=r3r3}r3(jUjj3ubajjubeubj)r3}r3(jUjj3jNjjj}r3(Uexprjj]j]j]j]j]ujNjhj]r3j!)r3}r3(jUj}r3(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj3ujj3j]r3j)r3}r3(jUj}r3(j]j]r3jaj]j]j]ujj3j]r3jX[source]r3r3}r3(jUjj3ubajjubajj%ubaubeubj)r3}r3(jUjj3jj3jjj}r3(j]j]j]j]j]ujNjhj]r3(j)r3}r3(jX"Load an EC key pair from a string.jj3jXR/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_key_stringjjj}r3(j]j]j]j]j]ujKjhj]r4jX"Load an EC key pair from a string.r4r4}r4(jUjNjNjhjj3ubaubj)r4}r4(jUjj3jNjjj}r4(j]j]j]j]j]ujNjhj]r4(j)r4}r 4(jUj}r 4(j]j]j]j]j]ujj4j]r 4(j)r 4}r 4(jX Parametersjj4jj3jjj}r4(j]j]j]j]j]ujKj]r4jX Parametersr4r4}r4(jUjj 4ubaubj)r4}r4(jUj}r4(j]j]j]j]j]ujj4j]r4j^ )r4}r4(jUj}r4(j]j]j]j]j]ujj4j]r4(jc )r4}r4(jUj}r4(j]j]j]j]j]ujj4j]r4j)r4}r 4(jX6string -- String containing EC key pair in PEM format.j}r!4(j]j]j]j]j]ujj4j]r"4(j)r#4}r$4(jXstringj}r%4(j]j]jj]j]j]ujj4j]r&4jXstringr'4r(4}r)4(jUjj#4ubajjubjX – r*4r+4}r,4(jUjj4ubjX,String containing EC key pair in PEM format.r-4r.4}r/4(jUjNjNjhjj4ubejjubajjy ubjc )r04}r14(jUj}r24(j]j]j]j]j]ujj4j]r34j)r44}r54(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback.j}r64(j]j]j]j]j]ujj04j]r74(j)r84}r94(jXcallbackj}r:4(j]j]jj]j]j]ujj44j]r;4jXcallbackr<4r=4}r>4(jUjj84ubajjubjX – r?4r@4}rA4(jUjj44ubjXA Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback.rB4rC4}rD4(jUjNjNjhjj44ubejjubajjy ubejj ubajjubejjubj)rE4}rF4(jUj}rG4(j]j]j]j]j]ujj4j]rH4(j)rI4}rJ4(jXReturnsjjE4jj3jjj}rK4(j]j]j]j]j]ujKj]rL4jXReturnsrM4rN4}rO4(jUjjI4ubaubj)rP4}rQ4(jUj}rR4(j]j]j]j]j]ujjE4j]rS4j)rT4}rU4(jXM2Crypto.EC.EC object.j}rV4(j]j]j]j]j]ujjP4j]rW4jXM2Crypto.EC.EC object.rX4rY4}rZ4(jUjNjNjhjjT4ubajjubajjubejjubeubeubeubj?)r[4}r\4(jUjj*jNjjCj}r]4(j]j]j]j]j]Uentries]r^4(jFX0load_key_string_pubkey() (in module M2Crypto.EC)hUNtr_4aujNjhj]ubjM)r`4}ra4(jUjj*jNjjPj}rb4(jRjSXpyj]j]j]j]j]jTXfunctionrc4jVjc4ujNjhj]rd4(jX)re4}rf4(jXGload_key_string_pubkey(string, callback=)jj`4jXY/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_key_string_pubkeyrg4jj\j}rh4(j]ri4haj_j`X M2Crypto.ECrj4rk4}rl4bj]j]j]j]rm4hajeXload_key_string_pubkeyrn4jgUjhujNjhj]ro4(ju)rp4}rq4(jX M2Crypto.EC.jje4jjg4jjxj}rr4(jojpj]j]j]j]j]ujNjhj]rs4jX M2Crypto.EC.rt4ru4}rv4(jUjNjNjhjjp4ubaubj~)rw4}rx4(jjn4jje4jjg4jjj}ry4(jojpj]j]j]j]j]ujNjhj]rz4jXload_key_string_pubkeyr{4r|4}r}4(jUjNjNjhjjw4ubaubj)r~4}r4(jX/string, callback=jje4jjg4jjj}r4(jojpj]j]j]j]j]ujNjhj]r4(j)r4}r4(jXstringj}r4(jojpj]j]j]j]j]ujj~4j]r4jXstringr4r4}r4(jUjj4ubajjubj)r4}r4(jX'callback=j}r4(jojpj]j]j]j]j]ujj~4j]r4jX'callback=r4r4}r4(jUjj4ubajjubeubj)r4}r4(jUjje4jNjjj}r4(Uexprjj]j]j]j]j]ujNjhj]r4j!)r4}r4(jUj}r4(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidjn4ujj4j]r4j)r4}r4(jUj}r4(j]j]r4jaj]j]j]ujj4j]r4jX[source]r4r4}r4(jUjj4ubajjubajj%ubaubeubj)r4}r4(jUjj`4jjg4jjj}r4(j]j]j]j]j]ujNjhj]r4(j)r4}r4(jX7Load an M2Crypto.EC.PKey from a public key as a string.jj4jXY/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_key_string_pubkeyjjj}r4(j]j]j]j]j]ujKjhj]r4jX7Load an M2Crypto.EC.PKey from a public key as a string.r4r4}r4(jUjNjNjhjj4ubaubj)r4}r4(jUjj4jNjjj}r4(j]j]j]j]j]ujNjhj]r4(j)r4}r4(jUj}r4(j]j]j]j]j]ujj4j]r4(j)r4}r4(jX Parametersjj4jjg4jjj}r4(j]j]j]j]j]ujKj]r4jX Parametersr4r4}r4(jUjj4ubaubj)r4}r4(jUj}r4(j]j]j]j]j]ujj4j]r4j^ )r4}r4(jUj}r4(j]j]j]j]j]ujj4j]r4(jc )r4}r4(jUj}r4(j]j]j]j]j]ujj4j]r4j)r4}r4(jX2string -- String containing the key in PEM format.j}r4(j]j]j]j]j]ujj4j]r4(j)r4}r4(jXstringj}r4(j]j]jj]j]j]ujj4j]r4jXstringr4r4}r4(jUjj4ubajjubjX – r4r4}r4(jUjj4ubjX(String containing the key in PEM format.r4r4}r4(jUjNjNjhjj4ubejjubajjy ubjc )r4}r4(jUj}r4(j]j]j]j]j]ujj4j]r4j)r4}r4(jXkcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key.j}r4(j]j]j]j]j]ujj4j]r4(j)r4}r4(jXcallbackj}r4(j]j]jj]j]j]ujj4j]r4jXcallbackr4r4}r4(jUjj4ubajjubjX – r4r4}r4(jUjj4ubjX_A Python callable object that is invoked to acquire a passphrase with which to protect the key.r4r4}r4(jUjNjNjhjj4ubejjubajjy ubejj ubajjubejjubj)r4}r4(jUj}r4(j]j]j]j]j]ujj4j]r4(j)r4}r4(jXReturnsjj4jjg4jjj}r4(j]j]j]j]j]ujKj]r4jXReturnsr4r4}r4(jUjj4ubaubj)r4}r4(jUj}r4(j]j]j]j]j]ujj4j]r4j)r4}r4(jXM2Crypto.EC.PKey object.j}r4(j]j]j]j]j]ujj4j]r4jXM2Crypto.EC.PKey object.r4r5}r5(jUjNjNjhjj4ubajjubajjubejjubeubeubeubj?)r5}r5(jUjj*jNjjCj}r5(j]j]j]j]j]Uentries]r5(jFX&load_pub_key() (in module M2Crypto.EC)h:UNtr5aujNjhj]ubjM)r5}r5(jUjj*jNjjPj}r 5(jRjSXpyj]j]j]j]j]jTXfunctionr 5jVj 5ujNjhj]r 5(jX)r 5}r 5(jXload_pub_key(file)jj5jXO/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_pub_keyr5jj\j}r5(j]r5h:aj_j`X M2Crypto.ECr5r5}r5bj]j]j]j]r5h:ajeX load_pub_keyr5jgUjhujNjhj]r5(ju)r5}r5(jX M2Crypto.EC.jj 5jj5jjxj}r5(jojpj]j]j]j]j]ujNjhj]r5jX M2Crypto.EC.r5r5}r5(jUjNjNjhjj5ubaubj~)r5}r5(jj5jj 5jj5jjj}r 5(jojpj]j]j]j]j]ujNjhj]r!5jX load_pub_keyr"5r#5}r$5(jUjNjNjhjj5ubaubj)r%5}r&5(jXfilejj 5jj5jjj}r'5(jojpj]j]j]j]j]ujNjhj]r(5j)r)5}r*5(jXfilej}r+5(jojpj]j]j]j]j]ujj%5j]r,5jXfiler-5r.5}r/5(jUjj)5ubajjubaubj)r05}r15(jUjj 5jNjjj}r25(Uexprjj]j]j]j]j]ujNjhj]r35j!)r45}r55(jUj}r65(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj5ujj05j]r75j)r85}r95(jUj}r:5(j]j]r;5jaj]j]j]ujj45j]r<5jX[source]r=5r>5}r?5(jUjj85ubajjubajj%ubaubeubj)r@5}rA5(jUjj5jj5jjj}rB5(j]j]j]j]j]ujNjhj]rC5(j)rD5}rE5(jX$Load an EC public key from filename.jj@5jXO/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_pub_keyjjj}rF5(j]j]j]j]j]ujKjhj]rG5jX$Load an EC public key from filename.rH5rI5}rJ5(jUjNjNjhjjD5ubaubj)rK5}rL5(jUjj@5jNjjj}rM5(j]j]j]j]j]ujNjhj]rN5(j)rO5}rP5(jUj}rQ5(j]j]j]j]j]ujjK5j]rR5(j)rS5}rT5(jX ParametersjjO5jj5jjj}rU5(j]j]j]j]j]ujKj]rV5jX ParametersrW5rX5}rY5(jUjjS5ubaubj)rZ5}r[5(jUj}r\5(j]j]j]j]j]ujjO5j]r]5j)r^5}r_5(jX@file -- Name of filename containing EC public key in PEM format.j}r`5(j]j]j]j]j]ujjZ5j]ra5(j)rb5}rc5(jXfilej}rd5(j]j]jj]j]j]ujj^5j]re5jXfilerf5rg5}rh5(jUjjb5ubajjubjX – ri5rj5}rk5(jUjj^5ubjX8Name of filename containing EC public key in PEM format.rl5rm5}rn5(jUjNjNjhjj^5ubejjubajjubejjubj)ro5}rp5(jUj}rq5(j]j]j]j]j]ujjK5j]rr5(j)rs5}rt5(jXReturnsjjo5jj5jjj}ru5(j]j]j]j]j]ujKj]rv5jXReturnsrw5rx5}ry5(jUjjs5ubaubj)rz5}r{5(jUj}r|5(j]j]j]j]j]ujjo5j]r}5j)r~5}r5(jXM2Crypto.EC.EC_pub object.j}r5(j]j]j]j]j]ujjz5j]r5jXM2Crypto.EC.EC_pub object.r5r5}r5(jUjNjNjhjj~5ubajjubajjubejjubeubeubeubj?)r5}r5(jUjj*jNjjCj}r5(j]j]j]j]j]Uentries]r5(jFX*load_pub_key_bio() (in module M2Crypto.EC)hUNtr5aujNjhj]ubjM)r5}r5(jUjj*jNjjPj}r5(jRjSXpyj]j]j]j]j]jTXfunctionr5jVj5ujNjhj]r5(jX)r5}r5(jXload_pub_key_bio(bio)jj5jXS/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_pub_key_bior5jj\j}r5(j]r5haj_j`X M2Crypto.ECr5r5}r5bj]j]j]j]r5hajeXload_pub_key_bior5jgUjhujNjhj]r5(ju)r5}r5(jX M2Crypto.EC.jj5jj5jjxj}r5(jojpj]j]j]j]j]ujNjhj]r5jX M2Crypto.EC.r5r5}r5(jUjNjNjhjj5ubaubj~)r5}r5(jj5jj5jj5jjj}r5(jojpj]j]j]j]j]ujNjhj]r5jXload_pub_key_bior5r5}r5(jUjNjNjhjj5ubaubj)r5}r5(jXbiojj5jj5jjj}r5(jojpj]j]j]j]j]ujNjhj]r5j)r5}r5(jXbioj}r5(jojpj]j]j]j]j]ujj5j]r5jXbior5r5}r5(jUjj5ubajjubaubj)r5}r5(jUjj5jNjjj}r5(Uexprjj]j]j]j]j]ujNjhj]r5j!)r5}r5(jUj}r5(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj5ujj5j]r5j)r5}r5(jUj}r5(j]j]r5jaj]j]j]ujj5j]r5jX[source]r5r5}r5(jUjj5ubajjubajj%ubaubeubj)r5}r5(jUjj5jj5jjj}r5(j]j]j]j]j]ujNjhj]r5(j)r5}r5(jX6Load an EC public key from an M2Crypto.BIO.BIO object.jj5jXS/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.load_pub_key_biojjj}r5(j]j]j]j]j]ujKjhj]r5jX6Load an EC public key from an M2Crypto.BIO.BIO object.r5r5}r5(jUjNjNjhjj5ubaubj)r5}r5(jUjj5jNjjj}r5(j]j]j]j]j]ujNjhj]r5(j)r5}r5(jUj}r5(j]j]j]j]j]ujj5j]r5(j)r5}r5(jX Parametersjj5jj5jjj}r5(j]j]j]j]j]ujKj]r5jX Parametersr5r5}r5(jUjj5ubaubj)r5}r5(jUj}r5(j]j]j]j]j]ujj5j]r5j)r5}r5(jXFbio -- M2Crypto.BIO.BIO object containing EC public key in PEM format.j}r5(j]j]j]j]j]ujj5j]r5(j)r5}r5(jXbioj}r5(j]j]jj]j]j]ujj5j]r5jXbior5r5}r5(jUjj5ubajjubjX – r5r5}r5(jUjj5ubjX?M2Crypto.BIO.BIO object containing EC public key in PEM format.r5r5}r5(jUjNjNjhjj5ubejjubajjubejjubj)r5}r5(jUj}r5(j]j]j]j]j]ujj5j]r5(j)r5}r5(jXReturnsjj5jj5jjj}r5(j]j]j]j]j]ujKj]r5jXReturnsr5r5}r5(jUjj5ubaubj)r5}r5(jUj}r5(j]j]j]j]j]ujj5j]r6j)r6}r6(jXM2Crypto.EC.EC_pub object.j}r6(j]j]j]j]j]ujj5j]r6jXM2Crypto.EC.EC_pub object.r6r6}r6(jUjNjNjhjj6ubajjubajjubejjubeubeubeubj?)r6}r 6(jUjj*jXS/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.pub_key_from_derr 6jjCj}r 6(j]j]j]j]j]Uentries]r 6(jFX*pub_key_from_der() (in module M2Crypto.EC)hUNtr 6aujNjhj]ubjM)r6}r6(jUjj*jj 6jjPj}r6(jRjSXpyj]j]j]j]j]jTXfunctionr6jVj6ujNjhj]r6(jX)r6}r6(jXpub_key_from_der(der)jj6jXS/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.pub_key_from_derr6jj\j}r6(j]r6haj_j`X M2Crypto.ECr6r6}r6bj]j]j]j]r6hajeXpub_key_from_derr6jgUjhujNjhj]r6(ju)r6}r6(jX M2Crypto.EC.jj6jj6jjxj}r 6(jojpj]j]j]j]j]ujNjhj]r!6jX M2Crypto.EC.r"6r#6}r$6(jUjNjNjhjj6ubaubj~)r%6}r&6(jj6jj6jj6jjj}r'6(jojpj]j]j]j]j]ujNjhj]r(6jXpub_key_from_derr)6r*6}r+6(jUjNjNjhjj%6ubaubj)r,6}r-6(jXderjj6jj6jjj}r.6(jojpj]j]j]j]j]ujNjhj]r/6j)r06}r16(jXderj}r26(jojpj]j]j]j]j]ujj,6j]r36jXderr46r56}r66(jUjj06ubajjubaubj)r76}r86(jUjj6jNjjj}r96(Uexprjj]j]j]j]j]ujNjhj]r:6j!)r;6}r<6(jUj}r=6(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidj6ujj76j]r>6j)r?6}r@6(jUj}rA6(j]j]rB6jaj]j]j]ujj;6j]rC6jX[source]rD6rE6}rF6(jUjj?6ubajjubajj%ubaubeubj)rG6}rH6(jUjj6jj6jjj}rI6(j]j]j]j]j]ujNjhj]rJ6j)rK6}rL6(jXCreate EC_pub from DER.jjG6jj 6jjj}rM6(j]j]j]j]j]ujKjhj]rN6jXCreate EC_pub from DER.rO6rP6}rQ6(jUjNjNjhjjK6ubaubaubeubj?)rR6}rS6(jUjj*jXV/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.pub_key_from_paramsrT6jjCj}rU6(j]j]j]j]j]Uentries]rV6(jFX-pub_key_from_params() (in module M2Crypto.EC)hUNtrW6aujNjhj]ubjM)rX6}rY6(jUjj*jjT6jjPj}rZ6(jRjSXpyj]j]j]j]j]jTXfunctionr[6jVj[6ujNjhj]r\6(jX)r]6}r^6(jX!pub_key_from_params(curve, bytes)jjX6jXV/home/matej/Build/m2crypto/M2Crypto/EC.py:docstring of M2Crypto.EC.pub_key_from_paramsr_6jj\j}r`6(j]ra6haj_j`X M2Crypto.ECrb6rc6}rd6bj]j]j]j]re6hajeXpub_key_from_paramsrf6jgUjhujNjhj]rg6(ju)rh6}ri6(jX M2Crypto.EC.jj]6jj_6jjxj}rj6(jojpj]j]j]j]j]ujNjhj]rk6jX M2Crypto.EC.rl6rm6}rn6(jUjNjNjhjjh6ubaubj~)ro6}rp6(jjf6jj]6jj_6jjj}rq6(jojpj]j]j]j]j]ujNjhj]rr6jXpub_key_from_paramsrs6rt6}ru6(jUjNjNjhjjo6ubaubj)rv6}rw6(jX curve, bytesjj]6jj_6jjj}rx6(jojpj]j]j]j]j]ujNjhj]ry6(j)rz6}r{6(jXcurvej}r|6(jojpj]j]j]j]j]ujjv6j]r}6jXcurver~6r6}r6(jUjjz6ubajjubj)r6}r6(jXbytesj}r6(jojpj]j]j]j]j]ujjv6j]r6jXbytesr6r6}r6(jUjj6ubajjubeubj)r6}r6(jUjj]6jNjjj}r6(Uexprjj]j]j]j]j]ujNjhj]r6j!)r6}r6(jUj}r6(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ECUrefidjf6ujj6j]r6j)r6}r6(jUj}r6(j]j]r6jaj]j]j]ujj6j]r6jX[source]r6r6}r6(jUjj6ubajjubajj%ubaubeubj)r6}r6(jUjjX6jj_6jjj}r6(j]j]j]j]j]ujNjhj]r6j)r6}r6(jX/Create EC_pub from curve name and octet string.jj6jjT6jjj}r6(j]j]j]j]j]ujKjhj]r6jX/Create EC_pub from curve name and octet string.r6r6}r6(jUjNjNjhjj6ubaubaubeubeubj)r6}r6(jUjjjjjjj}r6(j]j]j]j]r6(Xmodule-M2Crypto.EVPr6U evp-moduler6ej]r6jaujKEjhj]r6(j )r6}r6(jX:mod:`EVP` Moduler6jj6jjjj j}r6(j]j]j]j]j]ujKEjhj]r6(j!)r6}r6(jX :mod:`EVP`r6jj6jjjj%j}r6(UreftypeXmodj'j(XEVPU refdomainXpyr6j]j]U refexplicitj]j]j]j*j+j,Nj-j0ujKDj]r6j0)r6}r6(jj6j}r6(j]j]r6(j5j6Xpy-modr6ej]j]j]ujj6j]r6jXEVPr6r6}r6(jUjj6ubajj;ubaubjX Moduler6r6}r6(jUjNjNjhjj6ubeubj?)r6}r6(jUjj6jXK/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.Cipherr6jjCj}r6(j]j]j]j]j]Uentries]r6(jFXM2Crypto.EVP (module)Xmodule-M2Crypto.EVPUNtr6aujKjhj]ubj?)r6}r6(jUjj6jNjjCj}r6(j]j]j]j]j]Uentries]r6(jFXCipher (class in M2Crypto.EVP)hUNtr6aujNjhj]ubjM)r6}r6(jUjj6jNjjPj}r6(jRjSXpyj]j]j]j]j]jTXclassr6jVj6ujNjhj]r6(jX)r6}r6(jXRCipher(alg, key, iv, op, key_as_bytes=0, d='md5', salt='12345678', i=1, padding=1)jj6jXK/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.Cipherr6jj\j}r6(j]r6haj_j`X M2Crypto.EVPr6r6}r6bj]j]j]j]r6hajeXCipherr6jgUjhujNjhj]r6(jj)r6}r6(jXclass jj6jj6jjmj}r6(jojpj]j]j]j]j]ujNjhj]r6jXclass r6r6}r6(jUjNjNjhjj6ubaubju)r6}r6(jX M2Crypto.EVP.jj6jj6jjxj}r6(jojpj]j]j]j]j]ujNjhj]r6jX M2Crypto.EVP.r6r6}r6(jUjNjNjhjj6ubaubj~)r6}r6(jj6jj6jj6jjj}r6(jojpj]j]j]j]j]ujNjhj]r6jXCipherr6r6}r6(jUjNjNjhjj6ubaubj)r6}r6(jXJalg, key, iv, op, key_as_bytes=0, d='md5', salt='12345678', i=1, padding=1jj6jj6jjj}r6(jojpj]j]j]j]j]ujNjhj]r6(j)r6}r6(jXalgj}r6(jojpj]j]j]j]j]ujj6j]r6jXalgr6r6}r6(jUjj6ubajjubj)r6}r6(jXkeyj}r6(jojpj]j]j]j]j]ujj6j]r7jXkeyr7r7}r7(jUjj6ubajjubj)r7}r7(jXivj}r7(jojpj]j]j]j]j]ujj6j]r7jXivr7r 7}r 7(jUjj7ubajjubj)r 7}r 7(jXopj}r 7(jojpj]j]j]j]j]ujj6j]r7jXopr7r7}r7(jUjj 7ubajjubj)r7}r7(jXkey_as_bytes=0j}r7(jojpj]j]j]j]j]ujj6j]r7jXkey_as_bytes=0r7r7}r7(jUjj7ubajjubj)r7}r7(jXd='md5'j}r7(jojpj]j]j]j]j]ujj6j]r7jXd='md5'r7r7}r7(jUjj7ubajjubj)r 7}r!7(jXsalt='12345678'j}r"7(jojpj]j]j]j]j]ujj6j]r#7jXsalt='12345678'r$7r%7}r&7(jUjj 7ubajjubj)r'7}r(7(jXi=1j}r)7(jojpj]j]j]j]j]ujj6j]r*7jXi=1r+7r,7}r-7(jUjj'7ubajjubj)r.7}r/7(jX padding=1j}r07(jojpj]j]j]j]j]ujj6j]r17jX padding=1r27r37}r47(jUjj.7ubajjubeubj)r57}r67(jUjj6jNjjj}r77(Uexprjj]j]j]j]j]ujNjhj]r87j!)r97}r:7(jUj}r;7(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj6ujj57j]r<7j)r=7}r>7(jUj}r?7(j]j]r@7jaj]j]j]ujj97j]rA7jX[source]rB7rC7}rD7(jUjj=7ubajjubajj%ubaubeubj)rE7}rF7(jUjj6jj6jjj}rG7(j]j]j]j]j]ujNjhj]rH7(j?)rI7}rJ7(jUjjE7jNjjCj}rK7(j]j]j]j]j]Uentries]rL7(jFX$final() (M2Crypto.EVP.Cipher method)hQUNtrM7aujNjhj]ubjM)rN7}rO7(jUjjE7jNjjPj}rP7(jRjSXpyj]j]j]j]j]jTXmethodrQ7jVjQ7ujNjhj]rR7(jX)rS7}rT7(jXCipher.final()jjN7jXQ/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.Cipher.finalrU7jj\j}rV7(j]rW7hQaj_j`X M2Crypto.EVPrX7rY7}rZ7bj]j]j]j]r[7hQajeX Cipher.finalr\7jgj6jhujNjhj]r]7(j~)r^7}r_7(jXfinaljjS7jjU7jjj}r`7(jojpj]j]j]j]j]ujNjhj]ra7jXfinalrb7rc7}rd7(jUjNjNjhjj^7ubaubj)re7}rf7(jUjjS7jjU7jjj}rg7(jojpj]j]j]j]j]ujNjhj]ubj)rh7}ri7(jUjjS7jNjjj}rj7(Uexprjj]j]j]j]j]ujNjhj]rk7j!)rl7}rm7(jUj}rn7(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj\7ujjh7j]ro7j)rp7}rq7(jUj}rr7(j]j]rs7jaj]j]j]ujjl7j]rt7jX[source]ru7rv7}rw7(jUjjp7ubajjubajj%ubaubeubj)rx7}ry7(jUjjN7jjU7jjj}rz7(j]j]j]j]j]ujNjhj]ubeubj?)r{7}r|7(jUjjE7jNjjCj}r}7(j]j]j]j]j]Uentries]r~7(jFX1m2_cipher_ctx_free() (M2Crypto.EVP.Cipher method)h UNtr7aujNjhj]ubjM)r7}r7(jUjjE7jNjjPj}r7(jRjSXpyj]j]j]j]j]jTXmethodr7jVj7ujNjhj]r7(jX)r7}r7(jXCipher.m2_cipher_ctx_freejj7jX^/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.Cipher.m2_cipher_ctx_freer7jj\j}r7(j]r7h aj_j`X M2Crypto.EVPr7r7}r7bj]j]j]j]r7h ajeXCipher.m2_cipher_ctx_freejgj6jhujNjhj]r7(j~)r7}r7(jXm2_cipher_ctx_freejj7jj7jjj}r7(jojpj]j]j]j]j]ujNjhj]r7jXm2_cipher_ctx_freer7r7}r7(jUjNjNjhjj7ubaubj)r7}r7(jUjj7jj7jjj}r7(jojpj]j]j]j]j]ujNjhj]ubeubj)r7}r7(jUjj7jj7jjj}r7(j]j]j]j]j]ujNjhj]ubeubj?)r7}r7(jUjjE7jXW/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.Cipher.set_paddingr7jjCj}r7(j]j]j]j]j]Uentries]r7(jFX*set_padding() (M2Crypto.EVP.Cipher method)hpUNtr7aujNjhj]ubjM)r7}r7(jUjjE7jj7jjPj}r7(jRjSXpyj]j]j]j]j]jTXmethodr7jVj7ujNjhj]r7(jX)r7}r7(jXCipher.set_padding(padding=1)jj7jXW/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.Cipher.set_paddingr7jj\j}r7(j]r7hpaj_j`X M2Crypto.EVPr7r7}r7bj]j]j]j]r7hpajeXCipher.set_paddingr7jgj6jhujNjhj]r7(j~)r7}r7(jX set_paddingjj7jj7jjj}r7(jojpj]j]j]j]j]ujNjhj]r7jX set_paddingr7r7}r7(jUjNjNjhjj7ubaubj)r7}r7(jX padding=1jj7jj7jjj}r7(jojpj]j]j]j]j]ujNjhj]r7j)r7}r7(jX padding=1j}r7(jojpj]j]j]j]j]ujj7j]r7jX padding=1r7r7}r7(jUjj7ubajjubaubj)r7}r7(jUjj7jNjjj}r7(Uexprjj]j]j]j]j]ujNjhj]r7j!)r7}r7(jUj}r7(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj7ujj7j]r7j)r7}r7(jUj}r7(j]j]r7jaj]j]j]ujj7j]r7jX[source]r7r7}r7(jUjj7ubajjubajj%ubaubeubj)r7}r7(jUjj7jj7jjj}r7(j]j]j]j]j]ujNjhj]r7j)r7}r7(jXActually always return 1jj7jj7jjj}r7(j]j]j]j]j]ujKjhj]r7jXActually always return 1r7r7}r7(jUjNjNjhjj7ubaubaubeubj?)r7}r7(jUjjE7jNjjCj}r7(j]j]j]j]j]Uentries]r7(jFX%update() (M2Crypto.EVP.Cipher method)j,UNtr7aujNjhj]ubjM)r7}r7(jUjjE7jNjjPj}r7(jRjSXpyj]j]j]j]j]jTXmethodr7jVj7ujNjhj]r7(jX)r7}r7(jXCipher.update(data)jj7jXR/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.Cipher.updater7jj\j}r7(j]r7j,aj_j`X M2Crypto.EVPr7r7}r7bj]j]j]j]r7j,ajeX Cipher.updater7jgj6jhujNjhj]r7(j~)r7}r7(jXupdatejj7jj7jjj}r7(jojpj]j]j]j]j]ujNjhj]r7jXupdater7r7}r7(jUjNjNjhjj7ubaubj)r7}r7(jXdatajj7jj7jjj}r7(jojpj]j]j]j]j]ujNjhj]r7j)r7}r8(jXdataj}r8(jojpj]j]j]j]j]ujj7j]r8jXdatar8r8}r8(jUjj7ubajjubaubj)r8}r8(jUjj7jNjjj}r8(Uexprjj]j]j]j]j]ujNjhj]r 8j!)r 8}r 8(jUj}r 8(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj7ujj8j]r 8j)r8}r8(jUj}r8(j]j]r8jaj]j]j]ujj 8j]r8jX[source]r8r8}r8(jUjj8ubajjubajj%ubaubeubj)r8}r8(jUjj7jj7jjj}r8(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r8}r8(jUjj6jXM/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.EVPErrorr8jjCj}r8(j]j]j]j]j]Uentries]r8(jFXEVPErrorr8jUNtr8aujNjhj]ubjM)r 8}r!8(jUjj6jj8jjPj}r"8(jRjSXpyj]j]j]j]j]jTX exceptionr#8jVj#8ujNjhj]r$8(jX)r%8}r&8(jj8jj 8jXM/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.EVPErrorr'8jj\j}r(8(j]r)8jaj_j`X M2Crypto.EVPr*8r+8}r,8bj]j]j]j]r-8jajej8jgUjhujNjhj]r.8(jj)r/8}r08(jX exception jj%8jj'8jjmj}r18(jojpj]j]j]j]j]ujNjhj]r28jX exception r38r48}r58(jUjNjNjhjj/8ubaubju)r68}r78(jX M2Crypto.EVP.jj%8jj'8jjxj}r88(jojpj]j]j]j]j]ujNjhj]r98jX M2Crypto.EVP.r:8r;8}r<8(jUjNjNjhjj68ubaubj~)r=8}r>8(jj8jj%8jj'8jjj}r?8(jojpj]j]j]j]j]ujNjhj]r@8jXEVPErrorrA8rB8}rC8(jUjNjNjhjj=8ubaubj)rD8}rE8(jUjj%8jNjjj}rF8(Uexprjj]j]j]j]j]ujNjhj]rG8j!)rH8}rI8(jUj}rJ8(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj8ujjD8j]rK8j)rL8}rM8(jUj}rN8(j]j]rO8jaj]j]j]ujjH8j]rP8jX[source]rQ8rR8}rS8(jUjjL8ubajjubajj%ubaubeubj)rT8}rU8(jUjj 8jj'8jjj}rV8(j]j]j]j]j]ujNjhj]rW8j)rX8}rY8(jX$Bases: :class:`exceptions.Exception`jjT8jj8jjj}rZ8(j]j]j]j]j]ujKjhj]r[8(jXBases: r\8r]8}r^8(jUjNjNjhjjX8ubj!)r_8}r`8(jX:class:`exceptions.Exception`ra8jjX8jjjj%j}rb8(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyrc8j]j]U refexplicitj]j]j]j*j+j,j8j-X M2Crypto.EVPrd8ujKj]re8j0)rf8}rg8(jja8j}rh8(j]j]ri8(j5jc8Xpy-classrj8ej]j]j]ujj_8j]rk8jXexceptions.Exceptionrl8rm8}rn8(jUjjf8ubajj;ubaubeubaubeubj?)ro8}rp8(jUjj6jNjjCj}rq8(j]j]j]j]j]Uentries]rr8(jFXHMAC (class in M2Crypto.EVP)jUNtrs8aujNjhj]ubjM)rt8}ru8(jUjj6jNjjPj}rv8(jRjSXpyj]j]j]j]j]jTXclassrw8jVjw8ujNjhj]rx8(jX)ry8}rz8(jXHMAC(key, algo='sha1')jjt8jXI/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.HMACr{8jj\j}r|8(j]r}8jaj_j`X M2Crypto.EVPr~8r8}r8bj]j]j]j]r8jajeXHMACr8jgUjhujNjhj]r8(jj)r8}r8(jXclass jjy8jj{8jjmj}r8(jojpj]j]j]j]j]ujNjhj]r8jXclass r8r8}r8(jUjNjNjhjj8ubaubju)r8}r8(jX M2Crypto.EVP.jjy8jj{8jjxj}r8(jojpj]j]j]j]j]ujNjhj]r8jX M2Crypto.EVP.r8r8}r8(jUjNjNjhjj8ubaubj~)r8}r8(jj8jjy8jj{8jjj}r8(jojpj]j]j]j]j]ujNjhj]r8jXHMACr8r8}r8(jUjNjNjhjj8ubaubj)r8}r8(jXkey, algo='sha1'jjy8jj{8jjj}r8(jojpj]j]j]j]j]ujNjhj]r8(j)r8}r8(jXkeyj}r8(jojpj]j]j]j]j]ujj8j]r8jXkeyr8r8}r8(jUjj8ubajjubj)r8}r8(jX algo='sha1'j}r8(jojpj]j]j]j]j]ujj8j]r8jX algo='sha1'r8r8}r8(jUjj8ubajjubeubj)r8}r8(jUjjy8jNjjj}r8(Uexprjj]j]j]j]j]ujNjhj]r8j!)r8}r8(jUj}r8(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj8ujj8j]r8j)r8}r8(jUj}r8(j]j]r8jaj]j]j]ujj8j]r8jX[source]r8r8}r8(jUjj8ubajjubajj%ubaubeubj)r8}r8(jUjjt8jj{8jjj}r8(j]j]j]j]j]ujNjhj]r8(j?)r8}r8(jUjj8jNjjCj}r8(j]j]j]j]j]Uentries]r8(jFX#digest() (M2Crypto.EVP.HMAC method)hOUNtr8aujNjhj]ubjM)r8}r8(jUjj8jNjjPj}r8(jRjSXpyj]j]j]j]j]jTXmethodr8jVj8ujNjhj]r8(jX)r8}r8(jX HMAC.digest()jj8jXP/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.HMAC.digestr8jj\j}r8(j]r8hOaj_j`X M2Crypto.EVPr8r8}r8bj]j]j]j]r8hOajeX HMAC.digestjgj8jhujNjhj]r8(j~)r8}r8(jXdigestjj8jj8jjj}r8(jojpj]j]j]j]j]ujNjhj]r8jXdigestr8r8}r8(jUjNjNjhjj8ubaubj)r8}r8(jUjj8jj8jjj}r8(jojpj]j]j]j]j]ujNjhj]ubeubj)r8}r8(jUjj8jj8jjj}r8(j]j]j]j]j]ujNjhj]ubeubj?)r8}r8(jUjj8jNjjCj}r8(j]j]j]j]j]Uentries]r8(jFX"final() (M2Crypto.EVP.HMAC method)h}UNtr8aujNjhj]ubjM)r8}r8(jUjj8jNjjPj}r8(jRjSXpyj]j]j]j]j]jTXmethodr8jVj8ujNjhj]r8(jX)r8}r8(jX HMAC.final()jj8jXO/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.HMAC.finalr8jj\j}r8(j]r8h}aj_j`X M2Crypto.EVPr8r8}r8bj]j]j]j]r8h}ajeX HMAC.finalr8jgj8jhujNjhj]r8(j~)r8}r8(jXfinaljj8jj8jjj}r8(jojpj]j]j]j]j]ujNjhj]r8jXfinalr8r8}r8(jUjNjNjhjj8ubaubj)r8}r8(jUjj8jj8jjj}r8(jojpj]j]j]j]j]ujNjhj]ubj)r8}r9(jUjj8jNjjj}r9(Uexprjj]j]j]j]j]ujNjhj]r9j!)r9}r9(jUj}r9(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj8ujj8j]r9j)r9}r9(jUj}r 9(j]j]r 9jaj]j]j]ujj9j]r 9jX[source]r 9r 9}r9(jUjj9ubajjubajj%ubaubeubj)r9}r9(jUjj8jj8jjj}r9(j]j]j]j]j]ujNjhj]ubeubj?)r9}r9(jUjj8jNjjCj}r9(j]j]j]j]j]Uentries]r9(jFX-m2_hmac_ctx_free() (M2Crypto.EVP.HMAC method)j)UNtr9aujNjhj]ubjM)r9}r9(jUjj8jNjjPj}r9(jRjSXpyj]j]j]j]j]jTXmethodr9jVj9ujNjhj]r9(jX)r9}r9(jXHMAC.m2_hmac_ctx_freejj9jXZ/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.HMAC.m2_hmac_ctx_freer9jj\j}r9(j]r 9j)aj_j`X M2Crypto.EVPr!9r"9}r#9bj]j]j]j]r$9j)ajeXHMAC.m2_hmac_ctx_freejgj8jhujNjhj]r%9(j~)r&9}r'9(jXm2_hmac_ctx_freejj9jj9jjj}r(9(jojpj]j]j]j]j]ujNjhj]r)9jXm2_hmac_ctx_freer*9r+9}r,9(jUjNjNjhjj&9ubaubj)r-9}r.9(jUjj9jj9jjj}r/9(jojpj]j]j]j]j]ujNjhj]ubeubj)r09}r19(jUjj9jj9jjj}r29(j]j]j]j]j]ujNjhj]ubeubj?)r39}r49(jUjj8jNjjCj}r59(j]j]j]j]j]Uentries]r69(jFX"reset() (M2Crypto.EVP.HMAC method)jxUNtr79aujNjhj]ubjM)r89}r99(jUjj8jNjjPj}r:9(jRjSXpyj]j]j]j]j]jTXmethodr;9jVj;9ujNjhj]r<9(jX)r=9}r>9(jXHMAC.reset(key)jj89jXO/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.HMAC.resetr?9jj\j}r@9(j]rA9jxaj_j`X M2Crypto.EVPrB9rC9}rD9bj]j]j]j]rE9jxajeX HMAC.resetrF9jgj8jhujNjhj]rG9(j~)rH9}rI9(jXresetjj=9jj?9jjj}rJ9(jojpj]j]j]j]j]ujNjhj]rK9jXresetrL9rM9}rN9(jUjNjNjhjjH9ubaubj)rO9}rP9(jXkeyjj=9jj?9jjj}rQ9(jojpj]j]j]j]j]ujNjhj]rR9j)rS9}rT9(jXkeyj}rU9(jojpj]j]j]j]j]ujjO9j]rV9jXkeyrW9rX9}rY9(jUjjS9ubajjubaubj)rZ9}r[9(jUjj=9jNjjj}r\9(Uexprjj]j]j]j]j]ujNjhj]r]9j!)r^9}r_9(jUj}r`9(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidjF9ujjZ9j]ra9j)rb9}rc9(jUj}rd9(j]j]re9jaj]j]j]ujj^9j]rf9jX[source]rg9rh9}ri9(jUjjb9ubajjubajj%ubaubeubj)rj9}rk9(jUjj89jj?9jjj}rl9(j]j]j]j]j]ujNjhj]ubeubj?)rm9}rn9(jUjj8jNjjCj}ro9(j]j]j]j]j]Uentries]rp9(jFX#update() (M2Crypto.EVP.HMAC method)j4UNtrq9aujNjhj]ubjM)rr9}rs9(jUjj8jNjjPj}rt9(jRjSXpyj]j]j]j]j]jTXmethodru9jVju9ujNjhj]rv9(jX)rw9}rx9(jXHMAC.update(data)jjr9jXP/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.HMAC.updatery9jj\j}rz9(j]r{9j4aj_j`X M2Crypto.EVPr|9r}9}r~9bj]j]j]j]r9j4ajeX HMAC.updater9jgj8jhujNjhj]r9(j~)r9}r9(jXupdatejjw9jjy9jjj}r9(jojpj]j]j]j]j]ujNjhj]r9jXupdater9r9}r9(jUjNjNjhjj9ubaubj)r9}r9(jXdatajjw9jjy9jjj}r9(jojpj]j]j]j]j]ujNjhj]r9j)r9}r9(jXdataj}r9(jojpj]j]j]j]j]ujj9j]r9jXdatar9r9}r9(jUjj9ubajjubaubj)r9}r9(jUjjw9jNjjj}r9(Uexprjj]j]j]j]j]ujNjhj]r9j!)r9}r9(jUj}r9(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj9ujj9j]r9j)r9}r9(jUj}r9(j]j]r9jaj]j]j]ujj9j]r9jX[source]r9r9}r9(jUjj9ubajjubajj%ubaubeubj)r9}r9(jUjjr9jjy9jjj}r9(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r9}r9(jUjj6jNjjCj}r9(j]j]j]j]j]Uentries]r9(jFX%MessageDigest (class in M2Crypto.EVP)hyUNtr9aujNjhj]ubjM)r9}r9(jUjj6jNjjPj}r9(jRjSXpyj]j]j]j]j]jTXclassr9jVj9ujNjhj]r9(jX)r9}r9(jXMessageDigest(algo)jj9jXR/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.MessageDigestr9jj\j}r9(j]r9hyaj_j`X M2Crypto.EVPr9r9}r9bj]j]j]j]r9hyajeX MessageDigestr9jgUjhujNjhj]r9(jj)r9}r9(jXclass jj9jj9jjmj}r9(jojpj]j]j]j]j]ujNjhj]r9jXclass r9r9}r9(jUjNjNjhjj9ubaubju)r9}r9(jX M2Crypto.EVP.jj9jj9jjxj}r9(jojpj]j]j]j]j]ujNjhj]r9jX M2Crypto.EVP.r9r9}r9(jUjNjNjhjj9ubaubj~)r9}r9(jj9jj9jj9jjj}r9(jojpj]j]j]j]j]ujNjhj]r9jX MessageDigestr9r9}r9(jUjNjNjhjj9ubaubj)r9}r9(jXalgojj9jj9jjj}r9(jojpj]j]j]j]j]ujNjhj]r9j)r9}r9(jXalgoj}r9(jojpj]j]j]j]j]ujj9j]r9jXalgor9r9}r9(jUjj9ubajjubaubj)r9}r9(jUjj9jNjjj}r9(Uexprjj]j]j]j]j]ujNjhj]r9j!)r9}r9(jUj}r9(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj9ujj9j]r9j)r9}r9(jUj}r9(j]j]r9jaj]j]j]ujj9j]r9jX[source]r9r9}r9(jUjj9ubajjubajj%ubaubeubj)r9}r9(jUjj9jj9jjj}r9(j]j]j]j]j]ujNjhj]r9(j)r9}r9(jXMessage Digestjj9jXR/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.MessageDigestjjj}r9(j]j]j]j]j]ujKjhj]r9jXMessage Digestr9r9}r9(jUjNjNjhjj9ubaubj?)r9}r9(jUjj9jNjjCj}r9(j]j]j]j]j]Uentries]r9(jFX,digest() (M2Crypto.EVP.MessageDigest method)hUNtr9aujNjhj]ubjM)r9}r9(jUjj9jNjjPj}r9(jRjSXpyj]j]j]j]j]jTXmethodr9jVj9ujNjhj]r:(jX)r:}r:(jXMessageDigest.digest()jj9jXY/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.MessageDigest.digestr:jj\j}r:(j]r:haj_j`X M2Crypto.EVPr:r:}r:bj]j]j]j]r :hajeXMessageDigest.digestjgj9jhujNjhj]r :(j~)r :}r :(jXdigestjj:jj:jjj}r :(jojpj]j]j]j]j]ujNjhj]r:jXdigestr:r:}r:(jUjNjNjhjj :ubaubj)r:}r:(jUjj:jj:jjj}r:(jojpj]j]j]j]j]ujNjhj]ubeubj)r:}r:(jUjj9jj:jjj}r:(j]j]j]j]j]ujNjhj]ubeubj?)r:}r:(jUjj9jNjjCj}r:(j]j]j]j]j]Uentries]r:(jFX+final() (M2Crypto.EVP.MessageDigest method)hVUNtr:aujNjhj]ubjM)r:}r:(jUjj9jNjjPj}r:(jRjSXpyj]j]j]j]j]jTXmethodr :jVj :ujNjhj]r!:(jX)r":}r#:(jXMessageDigest.final()jj:jXX/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.MessageDigest.finalr$:jj\j}r%:(j]r&:hVaj_j`X M2Crypto.EVPr':r(:}r):bj]j]j]j]r*:hVajeXMessageDigest.finalr+:jgj9jhujNjhj]r,:(j~)r-:}r.:(jXfinaljj":jj$:jjj}r/:(jojpj]j]j]j]j]ujNjhj]r0:jXfinalr1:r2:}r3:(jUjNjNjhjj-:ubaubj)r4:}r5:(jUjj":jj$:jjj}r6:(jojpj]j]j]j]j]ujNjhj]ubj)r7:}r8:(jUjj":jNjjj}r9:(Uexprjj]j]j]j]j]ujNjhj]r::j!)r;:}r<:(jUj}r=:(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj+:ujj7:j]r>:j)r?:}r@:(jUj}rA:(j]j]rB:jaj]j]j]ujj;:j]rC:jX[source]rD:rE:}rF:(jUjj?:ubajjubajj%ubaubeubj)rG:}rH:(jUjj:jj$:jjj}rI:(j]j]j]j]j]ujNjhj]ubeubj?)rJ:}rK:(jUjj9jNjjCj}rL:(j]j]j]j]j]Uentries]rM:(jFX4m2_md_ctx_free() (M2Crypto.EVP.MessageDigest method)hZUNtrN:aujNjhj]ubjM)rO:}rP:(jUjj9jNjjPj}rQ:(jRjSXpyj]j]j]j]j]jTXmethodrR:jVjR:ujNjhj]rS:(jX)rT:}rU:(jXMessageDigest.m2_md_ctx_freejjO:jXa/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.MessageDigest.m2_md_ctx_freerV:jj\j}rW:(j]rX:hZaj_j`X M2Crypto.EVPrY:rZ:}r[:bj]j]j]j]r\:hZajeXMessageDigest.m2_md_ctx_freejgj9jhujNjhj]r]:(j~)r^:}r_:(jXm2_md_ctx_freejjT:jjV:jjj}r`:(jojpj]j]j]j]j]ujNjhj]ra:jXm2_md_ctx_freerb:rc:}rd:(jUjNjNjhjj^:ubaubj)re:}rf:(jUjjT:jjV:jjj}rg:(jojpj]j]j]j]j]ujNjhj]ubeubj)rh:}ri:(jUjjO:jjV:jjj}rj:(j]j]j]j]j]ujNjhj]ubeubj?)rk:}rl:(jUjj9jNjjCj}rm:(j]j]j]j]j]Uentries]rn:(jFX,update() (M2Crypto.EVP.MessageDigest method)h UNtro:aujNjhj]ubjM)rp:}rq:(jUjj9jNjjPj}rr:(jRjSXpyj]j]j]j]j]jTXmethodrs:jVjs:ujNjhj]rt:(jX)ru:}rv:(jXMessageDigest.update(data)jjp:jXY/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.MessageDigest.updaterw:jj\j}rx:(j]ry:h aj_j`X M2Crypto.EVPrz:r{:}r|:bj]j]j]j]r}:h ajeXMessageDigest.updater~:jgj9jhujNjhj]r:(j~)r:}r:(jXupdatejju:jjw:jjj}r:(jojpj]j]j]j]j]ujNjhj]r:jXupdater:r:}r:(jUjNjNjhjj:ubaubj)r:}r:(jXdatajju:jjw:jjj}r:(jojpj]j]j]j]j]ujNjhj]r:j)r:}r:(jXdataj}r:(jojpj]j]j]j]j]ujj:j]r:jXdatar:r:}r:(jUjj:ubajjubaubj)r:}r:(jUjju:jNjjj}r:(Uexprjj]j]j]j]j]ujNjhj]r:j!)r:}r:(jUj}r:(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj~:ujj:j]r:j)r:}r:(jUj}r:(j]j]r:jaj]j]j]ujj:j]r:jX[source]r:r:}r:(jUjj:ubajjubajj%ubaubeubj)r:}r:(jUjjp:jjw:jjj}r:(j]j]j]j]j]ujNjhj]r:(j)r:}r:(jXAdd data to be digested.jj:jXY/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.MessageDigest.updatejjj}r:(j]j]j]j]j]ujKjhj]r:jXAdd data to be digested.r:r:}r:(jUjNjNjhjj:ubaubj)r:}r:(jUjj:jNjjj}r:(j]j]j]j]j]ujNjhj]r:j)r:}r:(jUj}r:(j]j]j]j]j]ujj:j]r:(j)r:}r:(jXReturnsjj:jjw:jjj}r:(j]j]j]j]j]ujKj]r:jXReturnsr:r:}r:(jUjj:ubaubj)r:}r:(jUj}r:(j]j]j]j]j]ujj:j]r:j)r:}r:(jX:-1 for Python error, 1 for success, 0 for OpenSSL failure.j}r:(j]j]j]j]j]ujj:j]r:jX:-1 for Python error, 1 for success, 0 for OpenSSL failure.r:r:}r:(jUjNjNjhjj:ubajjubajjubejjubaubeubeubeubeubj?)r:}r:(jUjj6jNjjCj}r:(j]j]j]j]j]Uentries]r:(jFXPKey (class in M2Crypto.EVP)hUNtr:aujNjhj]ubjM)r:}r:(jUjj6jNjjPj}r:(jRjSXpyj]j]j]j]j]jTXclassr:jVj:ujNjhj]r:(jX)r:}r:(jX%PKey(pkey=None, _pyfree=0, md='sha1')jj:jXI/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKeyr:jj\j}r:(j]r:haj_j`X M2Crypto.EVPr:r:}r:bj]j]j]j]r:hajeXPKeyr:jgUjhujNjhj]r:(jj)r:}r:(jXclass jj:jj:jjmj}r:(jojpj]j]j]j]j]ujNjhj]r:jXclass r:r:}r:(jUjNjNjhjj:ubaubju)r:}r:(jX M2Crypto.EVP.jj:jj:jjxj}r:(jojpj]j]j]j]j]ujNjhj]r:jX M2Crypto.EVP.r:r:}r:(jUjNjNjhjj:ubaubj~)r:}r:(jj:jj:jj:jjj}r:(jojpj]j]j]j]j]ujNjhj]r:jXPKeyr:r:}r:(jUjNjNjhjj:ubaubj)r:}r:(jXpkey=None, _pyfree=0, md='sha1'jj:jj:jjj}r:(jojpj]j]j]j]j]ujNjhj]r:(j)r:}r:(jX pkey=Nonej}r:(jojpj]j]j]j]j]ujj:j]r:jX pkey=Noner:r:}r:(jUjj:ubajjubj)r:}r:(jX _pyfree=0j}r:(jojpj]j]j]j]j]ujj:j]r:jX _pyfree=0r;r;}r;(jUjj:ubajjubj)r;}r;(jX md='sha1'j}r;(jojpj]j]j]j]j]ujj:j]r;jX md='sha1'r;r;}r ;(jUjj;ubajjubeubj)r ;}r ;(jUjj:jNjjj}r ;(Uexprjj]j]j]j]j]ujNjhj]r ;j!)r;}r;(jUj}r;(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj:ujj ;j]r;j)r;}r;(jUj}r;(j]j]r;jaj]j]j]ujj;j]r;jX[source]r;r;}r;(jUjj;ubajjubajj%ubaubeubj)r;}r;(jUjj:jj:jjj}r;(j]j]j]j]j]ujNjhj]r;(j)r;}r;(jX Public Keyjj;jXI/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKeyjjj}r ;(j]j]j]j]j]ujKjhj]r!;jX Public Keyr";r#;}r$;(jUjNjNjhjj;ubaubj?)r%;}r&;(jUjj;jXP/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.as_derr';jjCj}r(;(j]j]j]j]j]Uentries]r);(jFX#as_der() (M2Crypto.EVP.PKey method)hUNtr*;aujNjhj]ubjM)r+;}r,;(jUjj;jj';jjPj}r-;(jRjSXpyj]j]j]j]j]jTXmethodr.;jVj.;ujNjhj]r/;(jX)r0;}r1;(jX PKey.as_der()jj+;jXP/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.as_derr2;jj\j}r3;(j]r4;haj_j`X M2Crypto.EVPr5;r6;}r7;bj]j]j]j]r8;hajeX PKey.as_derr9;jgj:jhujNjhj]r:;(j~)r;;}r<;(jXas_derjj0;jj2;jjj}r=;(jojpj]j]j]j]j]ujNjhj]r>;jXas_derr?;r@;}rA;(jUjNjNjhjj;;ubaubj)rB;}rC;(jUjj0;jj2;jjj}rD;(jojpj]j]j]j]j]ujNjhj]ubj)rE;}rF;(jUjj0;jNjjj}rG;(Uexprjj]j]j]j]j]ujNjhj]rH;j!)rI;}rJ;(jUj}rK;(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj9;ujjE;j]rL;j)rM;}rN;(jUj}rO;(j]j]rP;jaj]j]j]ujjI;j]rQ;jX[source]rR;rS;}rT;(jUjjM;ubajjubajj%ubaubeubj)rU;}rV;(jUjj+;jj2;jjj}rW;(j]j]j]j]j]ujNjhj]rX;j)rY;}rZ;(jX$Return key in DER format in a stringjjU;jj';jjj}r[;(j]j]j]j]j]ujKjhj]r\;jX$Return key in DER format in a stringr];r^;}r_;(jUjNjNjhjjY;ubaubaubeubj?)r`;}ra;(jUjj;jNjjCj}rb;(j]j]j]j]j]Uentries]rc;(jFX#as_pem() (M2Crypto.EVP.PKey method)jUNtrd;aujNjhj]ubjM)re;}rf;(jUjj;jNjjPj}rg;(jRjSXpyj]j]j]j]j]jTXmethodrh;jVjh;ujNjhj]ri;(jX)rj;}rk;(jXJPKey.as_pem(cipher='aes_128_cbc', callback=)jje;jXP/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.as_pemrl;jj\j}rm;(j]rn;jaj_j`X M2Crypto.EVPro;rp;}rq;bj]j]j]j]rr;jajeX PKey.as_pemrs;jgj:jhujNjhj]rt;(j~)ru;}rv;(jXas_pemjjj;jjl;jjj}rw;(jojpj]j]j]j]j]ujNjhj]rx;jXas_pemry;rz;}r{;(jUjNjNjhjju;ubaubj)r|;}r};(jX=cipher='aes_128_cbc', callback=jjj;jjl;jjj}r~;(jojpj]j]j]j]j]ujNjhj]r;(j)r;}r;(jXcipher='aes_128_cbc'j}r;(jojpj]j]j]j]j]ujj|;j]r;jXcipher='aes_128_cbc'r;r;}r;(jUjj;ubajjubj)r;}r;(jX'callback=j}r;(jojpj]j]j]j]j]ujj|;j]r;jX'callback=r;r;}r;(jUjj;ubajjubeubj)r;}r;(jUjjj;jNjjj}r;(Uexprjj]j]j]j]j]ujNjhj]r;j!)r;}r;(jUj}r;(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidjs;ujj;j]r;j)r;}r;(jUj}r;(j]j]r;jaj]j]j]ujj;j]r;jX[source]r;r;}r;(jUjj;ubajjubajj%ubaubeubj)r;}r;(jUjje;jjl;jjj}r;(j]j]j]j]j]ujNjhj]r;(j)r;}r;(jX%Return key in PEM format in a string.jj;jXP/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.as_pemjjj}r;(j]j]j]j]j]ujKjhj]r;jX%Return key in PEM format in a string.r;r;}r;(jUjNjNjhjj;ubaubj)r;}r;(jUjj;jNjjj}r;(j]j]j]j]j]ujNjhj]r;j)r;}r;(jUj}r;(j]j]j]j]j]ujj;j]r;(j)r;}r;(jX Parametersjj;jjl;jjj}r;(j]j]j]j]j]ujKj]r;jX Parametersr;r;}r;(jUjj;ubaubj)r;}r;(jUj}r;(j]j]j]j]j]ujj;j]r;j^ )r;}r;(jUj}r;(j]j]j]j]j]ujj;j]r;(jc )r;}r;(jUj}r;(j]j]j]j]j]ujj;j]r;j)r;}r;(jXcipher -- Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear.j}r;(j]j]j]j]j]ujj;j]r;(j)r;}r;(jXcipherj}r;(j]j]jj]j]j]ujj;j]r;jXcipherr;r;}r;(jUjj;ubajjubjX – r;r;}r;(jUjj;ubjX;Symmetric cipher to protect the key. The default cipher is r;r;}r;(jUjNjNjhjj;ubj0)r;}r;(jX``'aes_128_cbc'``jj;jNjj;j}r;(j]j]j]j]j]ujNjhj]r;jX 'aes_128_cbc'r;r;}r;(jUjNjNjhjj;ubaubjX8. If cipher is None, then the key is saved in the clear.r;r;}r;(jUjNjNjhjj;ubejjubajjy ubjc )r;}r;(jUj}r;(j]j]j]j]j]ujj;j]r;j)r;}r;(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.j}r;(j]j]j]j]j]ujj;j]r;(j)r;}r;(jXcallbackj}r;(j]j]jj]j]j]ujj;j]r;jXcallbackr;r;}r;(jUjj;ubajjubjX – r;r;}r;(jUjj;ubjXA Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.r;r;}r;(jUjNjNjhjj;ubejjubajjy ubejj ubajjubejjubaubeubeubj?)r;}r;(jUjj;jNjjCj}r;(j]j]j]j]j]Uentries]r;(jFX'assign_rsa() (M2Crypto.EVP.PKey method)hUNtr;aujNjhj]ubjM)r;}r;(jUjj;jNjjPj}r;(jRjSXpyj]j]j]j]j]jTXmethodr;jVj;ujNjhj]r;(jX)r;}r;(jXPKey.assign_rsa(rsa, capture=1)jj;jXT/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.assign_rsar<jj\j}r<(j]r<haj_j`X M2Crypto.EVPr<r<}r<bj]j]j]j]r<hajeXPKey.assign_rsar<jgj:jhujNjhj]r<(j~)r <}r <(jX assign_rsajj;jj<jjj}r <(jojpj]j]j]j]j]ujNjhj]r <jX assign_rsar <r<}r<(jUjNjNjhjj <ubaubj)r<}r<(jXrsa, capture=1jj;jj<jjj}r<(jojpj]j]j]j]j]ujNjhj]r<(j)r<}r<(jXrsaj}r<(jojpj]j]j]j]j]ujj<j]r<jXrsar<r<}r<(jUjj<ubajjubj)r<}r<(jX capture=1j}r<(jojpj]j]j]j]j]ujj<j]r<jX capture=1r<r <}r!<(jUjj<ubajjubeubj)r"<}r#<(jUjj;jNjjj}r$<(Uexprjj]j]j]j]j]ujNjhj]r%<j!)r&<}r'<(jUj}r(<(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj<ujj"<j]r)<j)r*<}r+<(jUj}r,<(j]j]r-<jaj]j]j]ujj&<j]r.<jX[source]r/<r0<}r1<(jUjj*<ubajjubajj%ubaubeubj)r2<}r3<(jUjj;jj<jjj}r4<(j]j]j]j]j]ujNjhj]r5<(j)r6<}r7<(jX Assign the RSA key pair to self.jj2<jXT/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.assign_rsajjj}r8<(j]j]j]j]j]ujKjhj]r9<jX Assign the RSA key pair to self.r:<r;<}r<<(jUjNjNjhjj6<ubaubj)r=<}r><(jUjj2<jNjjj}r?<(j]j]j]j]j]ujNjhj]r@<(j)rA<}rB<(jUj}rC<(j]j]j]j]j]ujj=<j]rD<(j)rE<}rF<(jX ParametersjjA<jj<jjj}rG<(j]j]j]j]j]ujKj]rH<jX ParametersrI<rJ<}rK<(jUjjE<ubaubj)rL<}rM<(jUj}rN<(j]j]j]j]j]ujjA<j]rO<j^ )rP<}rQ<(jUj}rR<(j]j]j]j]j]ujjL<j]rS<(jc )rT<}rU<(jUj}rV<(j]j]j]j]j]ujjP<j]rW<j)rX<}rY<(jX6rsa -- M2Crypto.RSA.RSA object to be assigned to self.j}rZ<(j]j]j]j]j]ujjT<j]r[<(j)r\<}r]<(jXrsaj}r^<(j]j]jj]j]j]ujjX<j]r_<jXrsar`<ra<}rb<(jUjj\<ubajjubjX – rc<rd<}re<(jUjjX<ubjX/M2Crypto.RSA.RSA object to be assigned to self.rf<rg<}rh<(jUjNjNjhjjX<ubejjubajjy ubjc )ri<}rj<(jUj}rk<(j]j]j]j]j]ujjP<j]rl<j)rm<}rn<(jXcapture -- If true (default), this PKey object will own the RSA object, meaning that once the PKey object gets deleted it is no longer safe to use the RSA object.j}ro<(j]j]j]j]j]ujji<j]rp<(j)rq<}rr<(jXcapturej}rs<(j]j]jj]j]j]ujjm<j]rt<jXcaptureru<rv<}rw<(jUjjq<ubajjubjX – rx<ry<}rz<(jUjjm<ubjXIf true (default), this PKey object will own the RSA object, meaning that once the PKey object gets deleted it is no longer safe to use the RSA object.r{<r|<}r}<(jUjNjNjhjjm<ubejjubajjy ubejj ubajjubejjubj)r~<}r<(jUj}r<(j]j]j]j]j]ujj=<j]r<(j)r<}r<(jXReturnsjj~<jj<jjj}r<(j]j]j]j]j]ujKj]r<jXReturnsr<r<}r<(jUjj<ubaubj)r<}r<(jUj}r<(j]j]j]j]j]ujj~<j]r<j)r<}r<(jX'Return 1 for success and 0 for failure.j}r<(j]j]j]j]j]ujj<j]r<jX'Return 1 for success and 0 for failure.r<r<}r<(jUjNjNjhjj<ubajjubajjubejjubeubeubeubj?)r<}r<(jUjj;jNjjCj}r<(j]j]j]j]j]Uentries]r<(jFX"final() (M2Crypto.EVP.PKey method)jUNtr<aujNjhj]ubjM)r<}r<(jUjj;jNjjPj}r<(jRjSXpyj]j]j]j]j]jTXmethodr<jVj<ujNjhj]r<(jX)r<}r<(jX PKey.final()jj<jXO/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.finalr<jj\j}r<(j]r<jaj_j`X M2Crypto.EVPr<r<}r<bj]j]j]j]r<jajeX PKey.finaljgj:jhujNjhj]r<(j~)r<}r<(jXfinaljj<jj<jjj}r<(jojpj]j]j]j]j]ujNjhj]r<jXfinalr<r<}r<(jUjNjNjhjj<ubaubj)r<}r<(jUjj<jj<jjj}r<(jojpj]j]j]j]j]ujNjhj]ubeubj)r<}r<(jUjj<jj<jjj}r<(j]j]j]j]j]ujNjhj]r<(j)r<}r<(jXReturn signature.jj<jXO/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.finaljjj}r<(j]j]j]j]j]ujKjhj]r<jXReturn signature.r<r<}r<(jUjNjNjhjj<ubaubj)r<}r<(jUjj<jNjjj}r<(j]j]j]j]j]ujNjhj]r<j)r<}r<(jUj}r<(j]j]j]j]j]ujj<j]r<(j)r<}r<(jXReturnsjj<jj<jjj}r<(j]j]j]j]j]ujKj]r<jXReturnsr<r<}r<(jUjj<ubaubj)r<}r<(jUj}r<(j]j]j]j]j]ujj<j]r<j)r<}r<(jXThe signature.j}r<(j]j]j]j]j]ujj<j]r<jXThe signature.r<r<}r<(jUjNjNjhjj<ubajjubajjubejjubaubeubeubj?)r<}r<(jUjj;jXU/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.get_modulusr<jjCj}r<(j]j]j]j]j]Uentries]r<(jFX(get_modulus() (M2Crypto.EVP.PKey method)jUNtr<aujNjhj]ubjM)r<}r<(jUjj;jj<jjPj}r<(jRjSXpyj]j]j]j]j]jTXmethodr<jVj<ujNjhj]r<(jX)r<}r<(jXPKey.get_modulus()jj<jXU/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.get_modulusr<jj\j}r<(j]r<jaj_j`X M2Crypto.EVPr<r<}r<bj]j]j]j]r<jajeXPKey.get_modulusr<jgj:jhujNjhj]r<(j~)r<}r<(jX get_modulusjj<jj<jjj}r<(jojpj]j]j]j]j]ujNjhj]r<jX get_modulusr<r<}r<(jUjNjNjhjj<ubaubj)r<}r<(jUjj<jj<jjj}r<(jojpj]j]j]j]j]ujNjhj]ubj)r<}r<(jUjj<jNjjj}r<(Uexprjj]j]j]j]j]ujNjhj]r<j!)r<}r<(jUj}r<(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj<ujj<j]r<j)r<}r=(jUj}r=(j]j]r=jaj]j]j]ujj<j]r=jX[source]r=r=}r=(jUjj<ubajjubajj%ubaubeubj)r=}r=(jUjj<jj<jjj}r =(j]j]j]j]j]ujNjhj]r =j)r =}r =(jX!Return the modulus in hex format.jj=jj<jjj}r =(j]j]j]j]j]ujKjhj]r=jX!Return the modulus in hex format.r=r=}r=(jUjNjNjhjj =ubaubaubeubj?)r=}r=(jUjj;jXQ/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.get_rsar=jjCj}r=(j]j]j]j]j]Uentries]r=(jFX$get_rsa() (M2Crypto.EVP.PKey method)hUNtr=aujNjhj]ubjM)r=}r=(jUjj;jj=jjPj}r=(jRjSXpyj]j]j]j]j]jTXmethodr=jVj=ujNjhj]r=(jX)r=}r=(jXPKey.get_rsa()jj=jXQ/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.get_rsar=jj\j}r =(j]r!=haj_j`X M2Crypto.EVPr"=r#=}r$=bj]j]j]j]r%=hajeX PKey.get_rsar&=jgj:jhujNjhj]r'=(j~)r(=}r)=(jXget_rsajj=jj=jjj}r*=(jojpj]j]j]j]j]ujNjhj]r+=jXget_rsar,=r-=}r.=(jUjNjNjhjj(=ubaubj)r/=}r0=(jUjj=jj=jjj}r1=(jojpj]j]j]j]j]ujNjhj]ubj)r2=}r3=(jUjj=jNjjj}r4=(Uexprjj]j]j]j]j]ujNjhj]r5=j!)r6=}r7=(jUj}r8=(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj&=ujj2=j]r9=j)r:=}r;=(jUj}r<=(j]j]r==jaj]j]j]ujj6=j]r>=jX[source]r?=r@=}rA=(jUjj:=ubajjubajj%ubaubeubj)rB=}rC=(jUjj=jj=jjj}rD=(j]j]j]j]j]ujNjhj]rE=j)rF=}rG=(jXJReturn the underlying RSA key if that is what the EVP instance is holding.jjB=jj=jjj}rH=(j]j]j]j]j]ujKjhj]rI=jXJReturn the underlying RSA key if that is what the EVP instance is holding.rJ=rK=}rL=(jUjNjNjhjjF=ubaubaubeubj?)rM=}rN=(jUjj;jNjjCj}rO=(j]j]j]j]j]Uentries]rP=(jFX+m2_md_ctx_free() (M2Crypto.EVP.PKey method)jUNtrQ=aujNjhj]ubjM)rR=}rS=(jUjj;jNjjPj}rT=(jRjSXpyj]j]j]j]j]jTXmethodrU=jVjU=ujNjhj]rV=(jX)rW=}rX=(jXPKey.m2_md_ctx_freejjR=jXX/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.m2_md_ctx_freerY=jj\j}rZ=(j]r[=jaj_j`X M2Crypto.EVPr\=r]=}r^=bj]j]j]j]r_=jajeXPKey.m2_md_ctx_freejgj:jhujNjhj]r`=(j~)ra=}rb=(jXm2_md_ctx_freejjW=jjY=jjj}rc=(jojpj]j]j]j]j]ujNjhj]rd=jXm2_md_ctx_freere=rf=}rg=(jUjNjNjhjja=ubaubj)rh=}ri=(jUjjW=jjY=jjj}rj=(jojpj]j]j]j]j]ujNjhj]ubeubj)rk=}rl=(jUjjR=jjY=jjj}rm=(j]j]j]j]j]ujNjhj]ubeubj?)rn=}ro=(jUjj;jNjjCj}rp=(j]j]j]j]j]Uentries]rq=(jFX)m2_pkey_free() (M2Crypto.EVP.PKey method)hUNtrr=aujNjhj]ubjM)rs=}rt=(jUjj;jNjjPj}ru=(jRjSXpyj]j]j]j]j]jTXmethodrv=jVjv=ujNjhj]rw=(jX)rx=}ry=(jXPKey.m2_pkey_freejjs=jXV/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.m2_pkey_freerz=jj\j}r{=(j]r|=haj_j`X M2Crypto.EVPr}=r~=}r=bj]j]j]j]r=hajeXPKey.m2_pkey_freejgj:jhujNjhj]r=(j~)r=}r=(jX m2_pkey_freejjx=jjz=jjj}r=(jojpj]j]j]j]j]ujNjhj]r=jX m2_pkey_freer=r=}r=(jUjNjNjhjj=ubaubj)r=}r=(jUjjx=jjz=jjj}r=(jojpj]j]j]j]j]ujNjhj]ubeubj)r=}r=(jUjjs=jjz=jjj}r=(j]j]j]j]j]ujNjhj]ubeubj?)r=}r=(jUjj;jNjjCj}r=(j]j]j]j]j]Uentries]r=(jFX*reset_context() (M2Crypto.EVP.PKey method)hUNtr=aujNjhj]ubjM)r=}r=(jUjj;jNjjPj}r=(jRjSXpyj]j]j]j]j]jTXmethodr=jVj=ujNjhj]r=(jX)r=}r=(jXPKey.reset_context(md='sha1')jj=jXW/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.reset_contextr=jj\j}r=(j]r=haj_j`X M2Crypto.EVPr=r=}r=bj]j]j]j]r=hajeXPKey.reset_contextr=jgj:jhujNjhj]r=(j~)r=}r=(jX reset_contextjj=jj=jjj}r=(jojpj]j]j]j]j]ujNjhj]r=jX reset_contextr=r=}r=(jUjNjNjhjj=ubaubj)r=}r=(jX md='sha1'jj=jj=jjj}r=(jojpj]j]j]j]j]ujNjhj]r=j)r=}r=(jX md='sha1'j}r=(jojpj]j]j]j]j]ujj=j]r=jX md='sha1'r=r=}r=(jUjj=ubajjubaubj)r=}r=(jUjj=jNjjj}r=(Uexprjj]j]j]j]j]ujNjhj]r=j!)r=}r=(jUj}r=(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj=ujj=j]r=j)r=}r=(jUj}r=(j]j]r=jaj]j]j]ujj=j]r=jX[source]r=r=}r=(jUjj=ubajjubajj%ubaubeubj)r=}r=(jUjj=jj=jjj}r=(j]j]j]j]j]ujNjhj]r=(j)r=}r=(jX&Reset internal message digest context.jj=jXW/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.reset_contextjjj}r=(j]j]j]j]j]ujKjhj]r=jX&Reset internal message digest context.r=r=}r=(jUjNjNjhjj=ubaubj)r=}r=(jUjj=jNjjj}r=(j]j]j]j]j]ujNjhj]r=j)r=}r=(jUj}r=(j]j]j]j]j]ujj=j]r=(j)r=}r=(jX Parametersjj=jj=jjj}r=(j]j]j]j]j]ujKj]r=jX Parametersr=r=}r=(jUjj=ubaubj)r=}r=(jUj}r=(j]j]j]j]j]ujj=j]r=j)r=}r=(jX#md -- The message digest algorithm.j}r=(j]j]j]j]j]ujj=j]r=(j)r=}r=(jXmdj}r=(j]j]jj]j]j]ujj=j]r=jXmdr=r=}r=(jUjj=ubajjubjX – r=r=}r=(jUjj=ubjXThe message digest algorithm.r=r=}r=(jUjNjNjhjj=ubejjubajjubejjubaubeubeubj?)r=}r=(jUjj;jNjjCj}r=(j]j]j]j]j]Uentries]r=(jFX%save_key() (M2Crypto.EVP.PKey method)h)UNtr=aujNjhj]ubjM)r=}r=(jUjj;jNjjPj}r=(jRjSXpyj]j]j]j]j]jTXmethodr=jVj=ujNjhj]r=(jX)r=}r>(jXRPKey.save_key(file, cipher='aes_128_cbc', callback=)jj=jXR/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.save_keyr>jj\j}r>(j]r>h)aj_j`X M2Crypto.EVPr>r>}r>bj]j]j]j]r>h)ajeX PKey.save_keyr>jgj:jhujNjhj]r >(j~)r >}r >(jXsave_keyjj=jj>jjj}r >(jojpj]j]j]j]j]ujNjhj]r >jXsave_keyr>r>}r>(jUjNjNjhjj >ubaubj)r>}r>(jXCfile, cipher='aes_128_cbc', callback=jj=jj>jjj}r>(jojpj]j]j]j]j]ujNjhj]r>(j)r>}r>(jXfilej}r>(jojpj]j]j]j]j]ujj>j]r>jXfiler>r>}r>(jUjj>ubajjubj)r>}r>(jXcipher='aes_128_cbc'j}r>(jojpj]j]j]j]j]ujj>j]r>jXcipher='aes_128_cbc'r >r!>}r">(jUjj>ubajjubj)r#>}r$>(jX'callback=j}r%>(jojpj]j]j]j]j]ujj>j]r&>jX'callback=r'>r(>}r)>(jUjj#>ubajjubeubj)r*>}r+>(jUjj=jNjjj}r,>(Uexprjj]j]j]j]j]ujNjhj]r->j!)r.>}r/>(jUj}r0>(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj>ujj*>j]r1>j)r2>}r3>(jUj}r4>(j]j]r5>jaj]j]j]ujj.>j]r6>jX[source]r7>r8>}r9>(jUjj2>ubajjubajj%ubaubeubj)r:>}r;>(jUjj=jj>jjj}r<>(j]j]j]j]j]ujNjhj]r=>(j)r>>}r?>(jX*Save the key pair to a file in PEM format.jj:>jXR/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.save_keyjjj}r@>(j]j]j]j]j]ujKjhj]rA>jX*Save the key pair to a file in PEM format.rB>rC>}rD>(jUjNjNjhjj>>ubaubj)rE>}rF>(jUjj:>jNjjj}rG>(j]j]j]j]j]ujNjhj]rH>j)rI>}rJ>(jUj}rK>(j]j]j]j]j]ujjE>j]rL>(j)rM>}rN>(jX ParametersjjI>jj>jjj}rO>(j]j]j]j]j]ujKj]rP>jX ParametersrQ>rR>}rS>(jUjjM>ubaubj)rT>}rU>(jUj}rV>(j]j]j]j]j]ujjI>j]rW>j^ )rX>}rY>(jUj}rZ>(j]j]j]j]j]ujjT>j]r[>(jc )r\>}r]>(jUj}r^>(j]j]j]j]j]ujjX>j]r_>j)r`>}ra>(jX$file -- Name of file to save key to.j}rb>(j]j]j]j]j]ujj\>j]rc>(j)rd>}re>(jXfilej}rf>(j]j]jj]j]j]ujj`>j]rg>jXfilerh>ri>}rj>(jUjjd>ubajjubjX – rk>rl>}rm>(jUjj`>ubjXName of file to save key to.rn>ro>}rp>(jUjNjNjhjj`>ubejjubajjy ubjc )rq>}rr>(jUj}rs>(j]j]j]j]j]ujjX>j]rt>j)ru>}rv>(jXcipher -- Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear.j}rw>(j]j]j]j]j]ujjq>j]rx>(j)ry>}rz>(jXcipherj}r{>(j]j]jj]j]j]ujju>j]r|>jXcipherr}>r~>}r>(jUjjy>ubajjubjX – r>r>}r>(jUjju>ubjXSymmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then the key is saved in the clear.r>r>}r>(jUjNjNjhjju>ubejjubajjy ubjc )r>}r>(jUj}r>(j]j]j]j]j]ujjX>j]r>j)r>}r>(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.j}r>(j]j]j]j]j]ujj>j]r>(j)r>}r>(jXcallbackj}r>(j]j]jj]j]j]ujj>j]r>jXcallbackr>r>}r>(jUjj>ubajjubjX – r>r>}r>(jUjj>ubjXA Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.r>r>}r>(jUjNjNjhjj>ubejjubajjy ubejj ubajjubejjubaubeubeubj?)r>}r>(jUjj;jNjjCj}r>(j]j]j]j]j]Uentries]r>(jFX)save_key_bio() (M2Crypto.EVP.PKey method)hUNtr>aujNjhj]ubjM)r>}r>(jUjj;jNjjPj}r>(jRjSXpyj]j]j]j]j]jTXmethodr>jVj>ujNjhj]r>(jX)r>}r>(jXUPKey.save_key_bio(bio, cipher='aes_128_cbc', callback=)jj>jXV/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.save_key_bior>jj\j}r>(j]r>haj_j`X M2Crypto.EVPr>r>}r>bj]j]j]j]r>hajeXPKey.save_key_bior>jgj:jhujNjhj]r>(j~)r>}r>(jX save_key_biojj>jj>jjj}r>(jojpj]j]j]j]j]ujNjhj]r>jX save_key_bior>r>}r>(jUjNjNjhjj>ubaubj)r>}r>(jXBbio, cipher='aes_128_cbc', callback=jj>jj>jjj}r>(jojpj]j]j]j]j]ujNjhj]r>(j)r>}r>(jXbioj}r>(jojpj]j]j]j]j]ujj>j]r>jXbior>r>}r>(jUjj>ubajjubj)r>}r>(jXcipher='aes_128_cbc'j}r>(jojpj]j]j]j]j]ujj>j]r>jXcipher='aes_128_cbc'r>r>}r>(jUjj>ubajjubj)r>}r>(jX'callback=j}r>(jojpj]j]j]j]j]ujj>j]r>jX'callback=r>r>}r>(jUjj>ubajjubeubj)r>}r>(jUjj>jNjjj}r>(Uexprjj]j]j]j]j]ujNjhj]r>j!)r>}r>(jUj}r>(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj>ujj>j]r>j)r>}r>(jUj}r>(j]j]r>jaj]j]j]ujj>j]r>jX[source]r>r>}r>(jUjj>ubajjubajj%ubaubeubj)r>}r>(jUjj>jj>jjj}r>(j]j]j]j]j]ujNjhj]r>(j)r>}r>(jXASave the key pair to the M2Crypto.BIO object 'bio' in PEM format.jj>jXV/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.save_key_biojjj}r>(j]j]j]j]j]ujKjhj]r>jXESave the key pair to the M2Crypto.BIO object ‘bio’ in PEM format.r>r>}r>(jUjNjNjhjj>ubaubj)r>}r>(jUjj>jNjjj}r>(j]j]j]j]j]ujNjhj]r>j)r>}r>(jUj}r>(j]j]j]j]j]ujj>j]r>(j)r>}r>(jX Parametersjj>jj>jjj}r>(j]j]j]j]j]ujKj]r>jX Parametersr>r>}r>(jUjj>ubaubj)r>}r>(jUj}r>(j]j]j]j]j]ujj>j]r>j^ )r>}r>(jUj}r?(j]j]j]j]j]ujj>j]r?(jc )r?}r?(jUj}r?(j]j]j]j]j]ujj>j]r?j)r?}r?(jX*bio -- M2Crypto.BIO object to save key to.j}r?(j]j]j]j]j]ujj?j]r ?(j)r ?}r ?(jXbioj}r ?(j]j]jj]j]j]ujj?j]r ?jXbior?r?}r?(jUjj ?ubajjubjX – r?r?}r?(jUjj?ubjX#M2Crypto.BIO object to save key to.r?r?}r?(jUjNjNjhjj?ubejjubajjy ubjc )r?}r?(jUj}r?(j]j]j]j]j]ujj>j]r?j)r?}r?(jXcipher -- Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear.j}r?(j]j]j]j]j]ujj?j]r?(j)r?}r ?(jXcipherj}r!?(j]j]jj]j]j]ujj?j]r"?jXcipherr#?r$?}r%?(jUjj?ubajjubjX – r&?r'?}r(?(jUjj?ubjXSymmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then the key is saved in the clear.r)?r*?}r+?(jUjNjNjhjj?ubejjubajjy ubjc )r,?}r-?(jUj}r.?(j]j]j]j]j]ujj>j]r/?j)r0?}r1?(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.j}r2?(j]j]j]j]j]ujj,?j]r3?(j)r4?}r5?(jXcallbackj}r6?(j]j]jj]j]j]ujj0?j]r7?jXcallbackr8?r9?}r:?(jUjj4?ubajjubjX – r;?r?r??}r@?(jUjNjNjhjj0?ubejjubajjy ubejj ubajjubejjubaubeubeubj?)rA?}rB?(jUjj;jNjjCj}rC?(j]j]j]j]j]Uentries]rD?(jFX'sign_final() (M2Crypto.EVP.PKey method)jSUNtrE?aujNjhj]ubjM)rF?}rG?(jUjj;jNjjPj}rH?(jRjSXpyj]j]j]j]j]jTXmethodrI?jVjI?ujNjhj]rJ?(jX)rK?}rL?(jXPKey.sign_final()jjF?jXT/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.sign_finalrM?jj\j}rN?(j]rO?jSaj_j`X M2Crypto.EVPrP?rQ?}rR?bj]j]j]j]rS?jSajeXPKey.sign_finalrT?jgj:jhujNjhj]rU?(j~)rV?}rW?(jX sign_finaljjK?jjM?jjj}rX?(jojpj]j]j]j]j]ujNjhj]rY?jX sign_finalrZ?r[?}r\?(jUjNjNjhjjV?ubaubj)r]?}r^?(jUjjK?jjM?jjj}r_?(jojpj]j]j]j]j]ujNjhj]ubj)r`?}ra?(jUjjK?jNjjj}rb?(Uexprjj]j]j]j]j]ujNjhj]rc?j!)rd?}re?(jUj}rf?(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidjT?ujj`?j]rg?j)rh?}ri?(jUj}rj?(j]j]rk?jaj]j]j]ujjd?j]rl?jX[source]rm?rn?}ro?(jUjjh?ubajjubajj%ubaubeubj)rp?}rq?(jUjjF?jjM?jjj}rr?(j]j]j]j]j]ujNjhj]rs?(j)rt?}ru?(jXReturn signature.jjp?jXT/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.sign_finaljjj}rv?(j]j]j]j]j]ujKjhj]rw?jXReturn signature.rx?ry?}rz?(jUjNjNjhjjt?ubaubj)r{?}r|?(jUjjp?jNjjj}r}?(j]j]j]j]j]ujNjhj]r~?j)r?}r?(jUj}r?(j]j]j]j]j]ujj{?j]r?(j)r?}r?(jXReturnsjj?jjM?jjj}r?(j]j]j]j]j]ujKj]r?jXReturnsr?r?}r?(jUjj?ubaubj)r?}r?(jUj}r?(j]j]j]j]j]ujj?j]r?j)r?}r?(jXThe signature.j}r?(j]j]j]j]j]ujj?j]r?jXThe signature.r?r?}r?(jUjNjNjhjj?ubajjubajjubejjubaubeubeubj?)r?}r?(jUjj;jXS/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.sign_initr?jjCj}r?(j]j]j]j]j]Uentries]r?(jFX&sign_init() (M2Crypto.EVP.PKey method)jUNtr?aujNjhj]ubjM)r?}r?(jUjj;jj?jjPj}r?(jRjSXpyj]j]j]j]j]jTXmethodr?jVj?ujNjhj]r?(jX)r?}r?(jXPKey.sign_init()jj?jXS/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.sign_initr?jj\j}r?(j]r?jaj_j`X M2Crypto.EVPr?r?}r?bj]j]j]j]r?jajeXPKey.sign_initr?jgj:jhujNjhj]r?(j~)r?}r?(jX sign_initjj?jj?jjj}r?(jojpj]j]j]j]j]ujNjhj]r?jX sign_initr?r?}r?(jUjNjNjhjj?ubaubj)r?}r?(jUjj?jj?jjj}r?(jojpj]j]j]j]j]ujNjhj]ubj)r?}r?(jUjj?jNjjj}r?(Uexprjj]j]j]j]j]ujNjhj]r?j!)r?}r?(jUj}r?(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj?ujj?j]r?j)r?}r?(jUj}r?(j]j]r?jaj]j]j]ujj?j]r?jX[source]r?r?}r?(jUjj?ubajjubajj%ubaubeubj)r?}r?(jUjj?jj?jjj}r?(j]j]j]j]j]ujNjhj]r?j)r?}r?(jX'Initialise signing operation with self.jj?jj?jjj}r?(j]j]j]j]j]ujKjhj]r?jX'Initialise signing operation with self.r?r?}r?(jUjNjNjhjj?ubaubaubeubj?)r?}r?(jUjj;jNjjCj}r?(j]j]j]j]j]Uentries]r?(jFX(sign_update() (M2Crypto.EVP.PKey method)j UNtr?aujNjhj]ubjM)r?}r?(jUjj;jNjjPj}r?(jRjSXpyj]j]j]j]j]jTXmethodr?jVj?ujNjhj]r?(jX)r?}r?(jXPKey.sign_update(data)jj?jXU/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.sign_updater?jj\j}r?(j]r?j aj_j`X M2Crypto.EVPr?r?}r?bj]j]j]j]r?j ajeXPKey.sign_updater?jgj:jhujNjhj]r?(j~)r?}r?(jX sign_updatejj?jj?jjj}r?(jojpj]j]j]j]j]ujNjhj]r?jX sign_updater?r?}r?(jUjNjNjhjj?ubaubj)r?}r?(jXdatajj?jj?jjj}r?(jojpj]j]j]j]j]ujNjhj]r?j)r?}r?(jXdataj}r?(jojpj]j]j]j]j]ujj?j]r?jXdatar?r?}r?(jUjj?ubajjubaubj)r?}r?(jUjj?jNjjj}r?(Uexprjj]j]j]j]j]ujNjhj]r?j!)r?}r?(jUj}r?(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj?ujj?j]r?j)r?}r@(jUj}r@(j]j]r@jaj]j]j]ujj?j]r@jX[source]r@r@}r@(jUjj?ubajjubajj%ubaubeubj)r@}r@(jUjj?jj?jjj}r @(j]j]j]j]j]ujNjhj]r @(j)r @}r @(jXFeed data to signing operation.jj@jXU/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.sign_updatejjj}r @(j]j]j]j]j]ujKjhj]r@jXFeed data to signing operation.r@r@}r@(jUjNjNjhjj @ubaubj)r@}r@(jUjj@jNjjj}r@(j]j]j]j]j]ujNjhj]r@j)r@}r@(jUj}r@(j]j]j]j]j]ujj@j]r@(j)r@}r@(jX Parametersjj@jj?jjj}r@(j]j]j]j]j]ujKj]r@jX Parametersr@r@}r @(jUjj@ubaubj)r!@}r"@(jUj}r#@(j]j]j]j]j]ujj@j]r$@j)r%@}r&@(jXdata -- Data to be signed.j}r'@(j]j]j]j]j]ujj!@j]r(@(j)r)@}r*@(jXdataj}r+@(j]j]jj]j]j]ujj%@j]r,@jXdatar-@r.@}r/@(jUjj)@ubajjubjX – r0@r1@}r2@(jUjj%@ubjXData to be signed.r3@r4@}r5@(jUjNjNjhjj%@ubejjubajjubejjubaubeubeubj?)r6@}r7@(jUjj;jXN/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.sizer8@jjCj}r9@(j]j]j]j]j]Uentries]r:@(jFX!size() (M2Crypto.EVP.PKey method)j(UNtr;@aujNjhj]ubjM)r<@}r=@(jUjj;jj8@jjPj}r>@(jRjSXpyj]j]j]j]j]jTXmethodr?@jVj?@ujNjhj]r@@(jX)rA@}rB@(jX PKey.size()jj<@jXN/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.sizerC@jj\j}rD@(j]rE@j(aj_j`X M2Crypto.EVPrF@rG@}rH@bj]j]j]j]rI@j(ajeX PKey.sizerJ@jgj:jhujNjhj]rK@(j~)rL@}rM@(jXsizejjA@jjC@jjj}rN@(jojpj]j]j]j]j]ujNjhj]rO@jXsizerP@rQ@}rR@(jUjNjNjhjjL@ubaubj)rS@}rT@(jUjjA@jjC@jjj}rU@(jojpj]j]j]j]j]ujNjhj]ubj)rV@}rW@(jUjjA@jNjjj}rX@(Uexprjj]j]j]j]j]ujNjhj]rY@j!)rZ@}r[@(jUj}r\@(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidjJ@ujjV@j]r]@j)r^@}r_@(jUj}r`@(j]j]ra@jaj]j]j]ujjZ@j]rb@jX[source]rc@rd@}re@(jUjj^@ubajjubajj%ubaubeubj)rf@}rg@(jUjj<@jjC@jjj}rh@(j]j]j]j]j]ujNjhj]ri@j)rj@}rk@(jX$Return the size of the key in bytes.jjf@jj8@jjj}rl@(j]j]j]j]j]ujKjhj]rm@jX$Return the size of the key in bytes.rn@ro@}rp@(jUjNjNjhjjj@ubaubaubeubj?)rq@}rr@(jUjj;jNjjCj}rs@(j]j]j]j]j]Uentries]rt@(jFX#update() (M2Crypto.EVP.PKey method)hUNtru@aujNjhj]ubjM)rv@}rw@(jUjj;jNjjPj}rx@(jRjSXpyj]j]j]j]j]jTXmethodry@jVjy@ujNjhj]rz@(jX)r{@}r|@(jXPKey.update(data)jjv@jXP/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.updater}@jj\j}r~@(j]r@haj_j`X M2Crypto.EVPr@r@}r@bj]j]j]j]r@hajeX PKey.updatejgj:jhujNjhj]r@(j~)r@}r@(jXupdatejj{@jj}@jjj}r@(jojpj]j]j]j]j]ujNjhj]r@jXupdater@r@}r@(jUjNjNjhjj@ubaubj)r@}r@(jXdatajj{@jj}@jjj}r@(jojpj]j]j]j]j]ujNjhj]r@j)r@}r@(jXdataj}r@(jojpj]j]j]j]j]ujj@j]r@jXdatar@r@}r@(jUjj@ubajjubaubeubj)r@}r@(jUjjv@jj}@jjj}r@(j]j]j]j]j]ujNjhj]r@(j)r@}r@(jXFeed data to signing operation.jj@jXP/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.updatejjj}r@(j]j]j]j]j]ujKjhj]r@jXFeed data to signing operation.r@r@}r@(jUjNjNjhjj@ubaubj)r@}r@(jUjj@jNjjj}r@(j]j]j]j]j]ujNjhj]r@j)r@}r@(jUj}r@(j]j]j]j]j]ujj@j]r@(j)r@}r@(jX Parametersjj@jj}@jjj}r@(j]j]j]j]j]ujKj]r@jX Parametersr@r@}r@(jUjj@ubaubj)r@}r@(jUj}r@(j]j]j]j]j]ujj@j]r@j)r@}r@(jXdata -- Data to be signed.j}r@(j]j]j]j]j]ujj@j]r@(j)r@}r@(jXdataj}r@(j]j]jj]j]j]ujj@j]r@jXdatar@r@}r@(jUjj@ubajjubjX – r@r@}r@(jUjj@ubjXData to be signed.r@r@}r@(jUjNjNjhjj@ubejjubajjubejjubaubeubeubj?)r@}r@(jUjj;jNjjCj}r@(j]j]j]j]j]Uentries]r@(jFX)verify_final() (M2Crypto.EVP.PKey method)hUNtr@aujNjhj]ubjM)r@}r@(jUjj;jNjjPj}r@(jRjSXpyj]j]j]j]j]jTXmethodr@jVj@ujNjhj]r@(jX)r@}r@(jXPKey.verify_final(sign)jj@jXV/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.verify_finalr@jj\j}r@(j]r@haj_j`X M2Crypto.EVPr@r@}r@bj]j]j]j]r@hajeXPKey.verify_finalr@jgj:jhujNjhj]r@(j~)r@}r@(jX verify_finaljj@jj@jjj}r@(jojpj]j]j]j]j]ujNjhj]r@jX verify_finalr@r@}r@(jUjNjNjhjj@ubaubj)r@}r@(jXsignjj@jj@jjj}r@(jojpj]j]j]j]j]ujNjhj]r@j)r@}r@(jXsignj}r@(jojpj]j]j]j]j]ujj@j]r@jXsignr@r@}r@(jUjj@ubajjubaubj)r@}r@(jUjj@jNjjj}r@(Uexprjj]j]j]j]j]ujNjhj]r@j!)r@}r@(jUj}r@(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj@ujj@j]r@j)r@}r@(jUj}r@(j]j]r@jaj]j]j]ujj@j]r@jX[source]r@r@}r@(jUjj@ubajjubajj%ubaubeubj)r@}r@(jUjj@jj@jjj}r@(j]j]j]j]j]ujNjhj]rA(j)rA}rA(jXReturn result of verification.jj@jXV/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.verify_finaljjj}rA(j]j]j]j]j]ujKjhj]rAjXReturn result of verification.rArA}rA(jUjNjNjhjjAubaubj)rA}r A(jUjj@jNjjj}r A(j]j]j]j]j]ujNjhj]r A(j)r A}r A(jUj}rA(j]j]j]j]j]ujjAj]rA(j)rA}rA(jX Parametersjj Ajj@jjj}rA(j]j]j]j]j]ujKj]rAjX ParametersrArA}rA(jUjjAubaubj)rA}rA(jUj}rA(j]j]j]j]j]ujj Aj]rAj)rA}rA(jX)sign -- Signature to use for verificationj}rA(j]j]j]j]j]ujjAj]rA(j)rA}r A(jXsignj}r!A(j]j]jj]j]j]ujjAj]r"AjXsignr#Ar$A}r%A(jUjjAubajjubjX – r&Ar'A}r(A(jUjjAubjX!Signature to use for verificationr)Ar*A}r+A(jUjNjNjhjjAubejjubajjubejjubj)r,A}r-A(jUj}r.A(j]j]j]j]j]ujjAj]r/A(j)r0A}r1A(jXReturnsjj,Ajj@jjj}r2A(j]j]j]j]j]ujKj]r3AjXReturnsr4Ar5A}r6A(jUjj0Aubaubj)r7A}r8A(jUj}r9A(j]j]j]j]j]ujj,Aj]r:Aj)r;A}rAjXHResult of verification: 1 for success, 0 for failure, -1 on other error.r?Ar@A}rAA(jUjNjNjhjj;Aubajjubajjubejjubeubeubeubj?)rBA}rCA(jUjj;jXU/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.verify_initrDAjjCj}rEA(j]j]j]j]j]Uentries]rFA(jFX(verify_init() (M2Crypto.EVP.PKey method)hLUNtrGAaujNjhj]ubjM)rHA}rIA(jUjj;jjDAjjPj}rJA(jRjSXpyj]j]j]j]j]jTXmethodrKAjVjKAujNjhj]rLA(jX)rMA}rNA(jXPKey.verify_init()jjHAjXU/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.verify_initrOAjj\j}rPA(j]rQAhLaj_j`X M2Crypto.EVPrRArSA}rTAbj]j]j]j]rUAhLajeXPKey.verify_initrVAjgj:jhujNjhj]rWA(j~)rXA}rYA(jX verify_initjjMAjjOAjjj}rZA(jojpj]j]j]j]j]ujNjhj]r[AjX verify_initr\Ar]A}r^A(jUjNjNjhjjXAubaubj)r_A}r`A(jUjjMAjjOAjjj}raA(jojpj]j]j]j]j]ujNjhj]ubj)rbA}rcA(jUjjMAjNjjj}rdA(Uexprjj]j]j]j]j]ujNjhj]reAj!)rfA}rgA(jUj}rhA(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidjVAujjbAj]riAj)rjA}rkA(jUj}rlA(j]j]rmAjaj]j]j]ujjfAj]rnAjX[source]roArpA}rqA(jUjjjAubajjubajj%ubaubeubj)rrA}rsA(jUjjHAjjOAjjj}rtA(j]j]j]j]j]ujNjhj]ruAj)rvA}rwA(jX6Initialise signature verification operation with self.jjrAjjDAjjj}rxA(j]j]j]j]j]ujKjhj]ryAjX6Initialise signature verification operation with self.rzAr{A}r|A(jUjNjNjhjjvAubaubaubeubj?)r}A}r~A(jUjj;jNjjCj}rA(j]j]j]j]j]Uentries]rA(jFX*verify_update() (M2Crypto.EVP.PKey method)jUNtrAaujNjhj]ubjM)rA}rA(jUjj;jNjjPj}rA(jRjSXpyj]j]j]j]j]jTXmethodrAjVjAujNjhj]rA(jX)rA}rA(jXPKey.verify_update(data)jjAjXW/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.verify_updaterAjj\j}rA(j]rAjaj_j`X M2Crypto.EVPrArA}rAbj]j]j]j]rAjajeXPKey.verify_updaterAjgj:jhujNjhj]rA(j~)rA}rA(jX verify_updatejjAjjAjjj}rA(jojpj]j]j]j]j]ujNjhj]rAjX verify_updaterArA}rA(jUjNjNjhjjAubaubj)rA}rA(jXdatajjAjjAjjj}rA(jojpj]j]j]j]j]ujNjhj]rAj)rA}rA(jXdataj}rA(jojpj]j]j]j]j]ujjAj]rAjXdatarArA}rA(jUjjAubajjubaubj)rA}rA(jUjjAjNjjj}rA(Uexprjj]j]j]j]j]ujNjhj]rAj!)rA}rA(jUj}rA(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidjAujjAj]rAj)rA}rA(jUj}rA(j]j]rAjaj]j]j]ujjAj]rAjX[source]rArA}rA(jUjjAubajjubajj%ubaubeubj)rA}rA(jUjjAjjAjjj}rA(j]j]j]j]j]ujNjhj]rA(j)rA}rA(jX$Feed data to verification operation.jjAjXW/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.PKey.verify_updatejjj}rA(j]j]j]j]j]ujKjhj]rAjX$Feed data to verification operation.rArA}rA(jUjNjNjhjjAubaubj)rA}rA(jUjjAjNjjj}rA(j]j]j]j]j]ujNjhj]rA(j)rA}rA(jUj}rA(j]j]j]j]j]ujjAj]rA(j)rA}rA(jX ParametersjjAjjAjjj}rA(j]j]j]j]j]ujKj]rAjX ParametersrArA}rA(jUjjAubaubj)rA}rA(jUj}rA(j]j]j]j]j]ujjAj]rAj)rA}rA(jXdata -- Data to be verified.j}rA(j]j]j]j]j]ujjAj]rA(j)rA}rA(jXdataj}rA(j]j]jj]j]j]ujjAj]rAjXdatarArA}rA(jUjjAubajjubjX – rArA}rA(jUjjAubjXData to be verified.rArA}rA(jUjNjNjhjjAubejjubajjubejjubj)rA}rA(jUj}rA(j]j]j]j]j]ujjAj]rA(j)rA}rA(jXReturnsjjAjjAjjj}rA(j]j]j]j]j]ujKj]rAjXReturnsrArA}rA(jUjjAubaubj)rA}rA(jUj}rA(j]j]j]j]j]ujjAj]rAj)rA}rA(jX6-1 on Python error, 1 for success, 0 for OpenSSL errorj}rA(j]j]j]j]j]ujjAj]rAjX6-1 on Python error, 1 for success, 0 for OpenSSL errorrArA}rA(jUjNjNjhjjAubajjubajjubejjubeubeubeubeubeubj?)rA}rA(jUjj6jNjjCj}rA(j]j]j]j]j]Uentries]rA(jFXhmac() (in module M2Crypto.EVP)hUNtrAaujNjhj]ubjM)rA}rA(jUjj6jNjjPj}rB(jRjSXpyj]j]j]j]j]jTXfunctionrBjVjBujNjhj]rB(jX)rB}rB(jXhmac(key, data, algo='sha1')jjAjXI/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.hmacrBjj\j}rB(j]rBhaj_j`X M2Crypto.EVPrBr B}r Bbj]j]j]j]r BhajeXhmacr BjgUjhujNjhj]r B(ju)rB}rB(jX M2Crypto.EVP.jjBjjBjjxj}rB(jojpj]j]j]j]j]ujNjhj]rBjX M2Crypto.EVP.rBrB}rB(jUjNjNjhjjBubaubj~)rB}rB(jj BjjBjjBjjj}rB(jojpj]j]j]j]j]ujNjhj]rBjXhmacrBrB}rB(jUjNjNjhjjBubaubj)rB}rB(jXkey, data, algo='sha1'jjBjjBjjj}rB(jojpj]j]j]j]j]ujNjhj]rB(j)r B}r!B(jXkeyj}r"B(jojpj]j]j]j]j]ujjBj]r#BjXkeyr$Br%B}r&B(jUjj Bubajjubj)r'B}r(B(jXdataj}r)B(jojpj]j]j]j]j]ujjBj]r*BjXdatar+Br,B}r-B(jUjj'Bubajjubj)r.B}r/B(jX algo='sha1'j}r0B(jojpj]j]j]j]j]ujjBj]r1BjX algo='sha1'r2Br3B}r4B(jUjj.Bubajjubeubj)r5B}r6B(jUjjBjNjjj}r7B(Uexprjj]j]j]j]j]ujNjhj]r8Bj!)r9B}r:B(jUj}r;B(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj Bujj5Bj]rB(jUj}r?B(j]j]r@Bjaj]j]j]ujj9Bj]rABjX[source]rBBrCB}rDB(jUjj=Bubajjubajj%ubaubeubj)rEB}rFB(jUjjAjjBjjj}rGB(j]j]j]j]j]ujNjhj]ubeubj?)rHB}rIB(jUjj6jNjjCj}rJB(j]j]j]j]j]Uentries]rKB(jFX#load_key() (in module M2Crypto.EVP)hUNtrLBaujNjhj]ubjM)rMB}rNB(jUjj6jNjjPj}rOB(jRjSXpyj]j]j]j]j]jTXfunctionrPBjVjPBujNjhj]rQB(jX)rRB}rSB(jX7load_key(file, callback=)jjMBjXM/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.load_keyrTBjj\j}rUB(j]rVBhaj_j`X M2Crypto.EVPrWBrXB}rYBbj]j]j]j]rZBhajeXload_keyr[BjgUjhujNjhj]r\B(ju)r]B}r^B(jX M2Crypto.EVP.jjRBjjTBjjxj}r_B(jojpj]j]j]j]j]ujNjhj]r`BjX M2Crypto.EVP.raBrbB}rcB(jUjNjNjhjj]Bubaubj~)rdB}reB(jj[BjjRBjjTBjjj}rfB(jojpj]j]j]j]j]ujNjhj]rgBjXload_keyrhBriB}rjB(jUjNjNjhjjdBubaubj)rkB}rlB(jX-file, callback=jjRBjjTBjjj}rmB(jojpj]j]j]j]j]ujNjhj]rnB(j)roB}rpB(jXfilej}rqB(jojpj]j]j]j]j]ujjkBj]rrBjXfilersBrtB}ruB(jUjjoBubajjubj)rvB}rwB(jX'callback=j}rxB(jojpj]j]j]j]j]ujjkBj]ryBjX'callback=rzBr{B}r|B(jUjjvBubajjubeubj)r}B}r~B(jUjjRBjNjjj}rB(Uexprjj]j]j]j]j]ujNjhj]rBj!)rB}rB(jUj}rB(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidj[Bujj}Bj]rBj)rB}rB(jUj}rB(j]j]rBjaj]j]j]ujjBj]rBjX[source]rBrB}rB(jUjjBubajjubajj%ubaubeubj)rB}rB(jUjjMBjjTBjjj}rB(j]j]j]j]j]ujNjhj]rB(j)rB}rB(jX$Load an M2Crypto.EVP.PKey from file.jjBjXM/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.load_keyjjj}rB(j]j]j]j]j]ujKjhj]rBjX$Load an M2Crypto.EVP.PKey from file.rBrB}rB(jUjNjNjhjjBubaubj)rB}rB(jUjjBjNjjj}rB(j]j]j]j]j]ujNjhj]rB(j)rB}rB(jUj}rB(j]j]j]j]j]ujjBj]rB(j)rB}rB(jX ParametersjjBjjTBjjj}rB(j]j]j]j]j]ujKj]rBjX ParametersrBrB}rB(jUjjBubaubj)rB}rB(jUj}rB(j]j]j]j]j]ujjBj]rBj^ )rB}rB(jUj}rB(j]j]j]j]j]ujjBj]rB(jc )rB}rB(jUj}rB(j]j]j]j]j]ujjBj]rBj)rB}rB(jX6file -- Name of file containing the key in PEM format.j}rB(j]j]j]j]j]ujjBj]rB(j)rB}rB(jXfilej}rB(j]j]jj]j]j]ujjBj]rBjXfilerBrB}rB(jUjjBubajjubjX – rBrB}rB(jUjjBubjX.Name of file containing the key in PEM format.rBrB}rB(jUjNjNjhjjBubejjubajjy ubjc )rB}rB(jUj}rB(j]j]j]j]j]ujjBj]rBj)rB}rB(jXkcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key.j}rB(j]j]j]j]j]ujjBj]rB(j)rB}rB(jXcallbackj}rB(j]j]jj]j]j]ujjBj]rBjXcallbackrBrB}rB(jUjjBubajjubjX – rBrB}rB(jUjjBubjX_A Python callable object that is invoked to acquire a passphrase with which to protect the key.rBrB}rB(jUjNjNjhjjBubejjubajjy ubejj ubajjubejjubj)rB}rB(jUj}rB(j]j]j]j]j]ujjBj]rB(j)rB}rB(jXReturnsjjBjjTBjjj}rB(j]j]j]j]j]ujKj]rBjXReturnsrBrB}rB(jUjjBubaubj)rB}rB(jUj}rB(j]j]j]j]j]ujjBj]rBj)rB}rB(jXM2Crypto.EVP.PKey object.j}rB(j]j]j]j]j]ujjBj]rBjXM2Crypto.EVP.PKey object.rBrB}rB(jUjNjNjhjjBubajjubajjubejjubeubeubeubj?)rB}rB(jUjj6jNjjCj}rB(j]j]j]j]j]Uentries]rB(jFX'load_key_bio() (in module M2Crypto.EVP)j#UNtrBaujNjhj]ubjM)rB}rB(jUjj6jNjjPj}rB(jRjSXpyj]j]j]j]j]jTXfunctionrBjVjBujNjhj]rB(jX)rB}rB(jX:load_key_bio(bio, callback=)jjBjXQ/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.load_key_biorBjj\j}rB(j]rBj#aj_j`X M2Crypto.EVPrBrB}rCbj]j]j]j]rCj#ajeX load_key_biorCjgUjhujNjhj]rC(ju)rC}rC(jX M2Crypto.EVP.jjBjjBjjxj}rC(jojpj]j]j]j]j]ujNjhj]rCjX M2Crypto.EVP.rCr C}r C(jUjNjNjhjjCubaubj~)r C}r C(jjCjjBjjBjjj}r C(jojpj]j]j]j]j]ujNjhj]rCjX load_key_biorCrC}rC(jUjNjNjhjj Cubaubj)rC}rC(jX,bio, callback=jjBjjBjjj}rC(jojpj]j]j]j]j]ujNjhj]rC(j)rC}rC(jXbioj}rC(jojpj]j]j]j]j]ujjCj]rCjXbiorCrC}rC(jUjjCubajjubj)rC}rC(jX'callback=j}rC(jojpj]j]j]j]j]ujjCj]r CjX'callback=r!Cr"C}r#C(jUjjCubajjubeubj)r$C}r%C(jUjjBjNjjj}r&C(Uexprjj]j]j]j]j]ujNjhj]r'Cj!)r(C}r)C(jUj}r*C(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidjCujj$Cj]r+Cj)r,C}r-C(jUj}r.C(j]j]r/Cjaj]j]j]ujj(Cj]r0CjX[source]r1Cr2C}r3C(jUjj,Cubajjubajj%ubaubeubj)r4C}r5C(jUjjBjjBjjj}r6C(j]j]j]j]j]ujNjhj]r7C(j)r8C}r9C(jX6Load an M2Crypto.EVP.PKey from an M2Crypto.BIO object.jj4CjXQ/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.load_key_biojjj}r:C(j]j]j]j]j]ujKjhj]r;CjX6Load an M2Crypto.EVP.PKey from an M2Crypto.BIO object.rC(jUjNjNjhjj8Cubaubj)r?C}r@C(jUjj4CjNjjj}rAC(j]j]j]j]j]ujNjhj]rBC(j)rCC}rDC(jUj}rEC(j]j]j]j]j]ujj?Cj]rFC(j)rGC}rHC(jX ParametersjjCCjjBjjj}rIC(j]j]j]j]j]ujKj]rJCjX ParametersrKCrLC}rMC(jUjjGCubaubj)rNC}rOC(jUj}rPC(j]j]j]j]j]ujjCCj]rQCj^ )rRC}rSC(jUj}rTC(j]j]j]j]j]ujjNCj]rUC(jc )rVC}rWC(jUj}rXC(j]j]j]j]j]ujjRCj]rYCj)rZC}r[C(jX<bio -- M2Crypto.BIO object containing the key in PEM format.j}r\C(j]j]j]j]j]ujjVCj]r]C(j)r^C}r_C(jXbioj}r`C(j]j]jj]j]j]ujjZCj]raCjXbiorbCrcC}rdC(jUjj^CubajjubjX – reCrfC}rgC(jUjjZCubjX5M2Crypto.BIO object containing the key in PEM format.rhCriC}rjC(jUjNjNjhjjZCubejjubajjy ubjc )rkC}rlC(jUj}rmC(j]j]j]j]j]ujjRCj]rnCj)roC}rpC(jXkcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key.j}rqC(j]j]j]j]j]ujjkCj]rrC(j)rsC}rtC(jXcallbackj}ruC(j]j]jj]j]j]ujjoCj]rvCjXcallbackrwCrxC}ryC(jUjjsCubajjubjX – rzCr{C}r|C(jUjjoCubjX_A Python callable object that is invoked to acquire a passphrase with which to protect the key.r}Cr~C}rC(jUjNjNjhjjoCubejjubajjy ubejj ubajjubejjubj)rC}rC(jUj}rC(j]j]j]j]j]ujj?Cj]rC(j)rC}rC(jXReturnsjjCjjBjjj}rC(j]j]j]j]j]ujKj]rCjXReturnsrCrC}rC(jUjjCubaubj)rC}rC(jUj}rC(j]j]j]j]j]ujjCj]rCj)rC}rC(jXM2Crypto.EVP.PKey object.j}rC(j]j]j]j]j]ujjCj]rCjXM2Crypto.EVP.PKey object.rCrC}rC(jUjNjNjhjjCubajjubajjubejjubeubeubeubj?)rC}rC(jUjj6jNjjCj}rC(j]j]j]j]j]Uentries]rC(jFX.load_key_bio_pubkey() (in module M2Crypto.EVP)jUUNtrCaujNjhj]ubjM)rC}rC(jUjj6jNjjPj}rC(jRjSXpyj]j]j]j]j]jTXfunctionrCjVjCujNjhj]rC(jX)rC}rC(jXAload_key_bio_pubkey(bio, callback=)jjCjXX/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.load_key_bio_pubkeyrCjj\j}rC(j]rCjUaj_j`X M2Crypto.EVPrCrC}rCbj]j]j]j]rCjUajeXload_key_bio_pubkeyrCjgUjhujNjhj]rC(ju)rC}rC(jX M2Crypto.EVP.jjCjjCjjxj}rC(jojpj]j]j]j]j]ujNjhj]rCjX M2Crypto.EVP.rCrC}rC(jUjNjNjhjjCubaubj~)rC}rC(jjCjjCjjCjjj}rC(jojpj]j]j]j]j]ujNjhj]rCjXload_key_bio_pubkeyrCrC}rC(jUjNjNjhjjCubaubj)rC}rC(jX,bio, callback=jjCjjCjjj}rC(jojpj]j]j]j]j]ujNjhj]rC(j)rC}rC(jXbioj}rC(jojpj]j]j]j]j]ujjCj]rCjXbiorCrC}rC(jUjjCubajjubj)rC}rC(jX'callback=j}rC(jojpj]j]j]j]j]ujjCj]rCjX'callback=rCrC}rC(jUjjCubajjubeubj)rC}rC(jUjjCjNjjj}rC(Uexprjj]j]j]j]j]ujNjhj]rCj!)rC}rC(jUj}rC(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidjCujjCj]rCj)rC}rC(jUj}rC(j]j]rCjaj]j]j]ujjCj]rCjX[source]rCrC}rC(jUjjCubajjubajj%ubaubeubj)rC}rC(jUjjCjjCjjj}rC(j]j]j]j]j]ujNjhj]rC(j)rC}rC(jXELoad an M2Crypto.EVP.PKey from a public key as a M2Crypto.BIO object.jjCjXX/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.load_key_bio_pubkeyjjj}rC(j]j]j]j]j]ujKjhj]rCjXELoad an M2Crypto.EVP.PKey from a public key as a M2Crypto.BIO object.rCrC}rC(jUjNjNjhjjCubaubj)rC}rC(jUjjCjNjjj}rC(j]j]j]j]j]ujNjhj]rC(j)rC}rC(jUj}rC(j]j]j]j]j]ujjCj]rC(j)rC}rC(jX ParametersjjCjjCjjj}rC(j]j]j]j]j]ujKj]rCjX ParametersrCrC}rC(jUjjCubaubj)rC}rC(jUj}rC(j]j]j]j]j]ujjCj]rCj^ )rC}rC(jUj}rC(j]j]j]j]j]ujjCj]rC(jc )rC}rC(jUj}rC(j]j]j]j]j]ujjCj]rDj)rD}rD(jX<bio -- M2Crypto.BIO object containing the key in PEM format.j}rD(j]j]j]j]j]ujjCj]rD(j)rD}rD(jXbioj}rD(j]j]jj]j]j]ujjDj]rDjXbior Dr D}r D(jUjjDubajjubjX – r Dr D}rD(jUjjDubjX5M2Crypto.BIO object containing the key in PEM format.rDrD}rD(jUjNjNjhjjDubejjubajjy ubjc )rD}rD(jUj}rD(j]j]j]j]j]ujjCj]rDj)rD}rD(jXkcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key.j}rD(j]j]j]j]j]ujjDj]rD(j)rD}rD(jXcallbackj}rD(j]j]jj]j]j]ujjDj]rDjXcallbackrDrD}r D(jUjjDubajjubjX – r!Dr"D}r#D(jUjjDubjX_A Python callable object that is invoked to acquire a passphrase with which to protect the key.r$Dr%D}r&D(jUjNjNjhjjDubejjubajjy ubejj ubajjubejjubj)r'D}r(D(jUj}r)D(j]j]j]j]j]ujjCj]r*D(j)r+D}r,D(jXReturnsjj'DjjCjjj}r-D(j]j]j]j]j]ujKj]r.DjXReturnsr/Dr0D}r1D(jUjj+Dubaubj)r2D}r3D(jUj}r4D(j]j]j]j]j]ujj'Dj]r5Dj)r6D}r7D(jXM2Crypto.EVP.PKey object.j}r8D(j]j]j]j]j]ujj2Dj]r9DjXM2Crypto.EVP.PKey object.r:Dr;D}rD(jUjj6jNjjCj}r?D(j]j]j]j]j]Uentries]r@D(jFX*load_key_string() (in module M2Crypto.EVP)jUNtrADaujNjhj]ubjM)rBD}rCD(jUjj6jNjjPj}rDD(jRjSXpyj]j]j]j]j]jTXfunctionrEDjVjEDujNjhj]rFD(jX)rGD}rHD(jX@load_key_string(string, callback=)jjBDjXT/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.load_key_stringrIDjj\j}rJD(j]rKDjaj_j`X M2Crypto.EVPrLDrMD}rNDbj]j]j]j]rODjajeXload_key_stringrPDjgUjhujNjhj]rQD(ju)rRD}rSD(jX M2Crypto.EVP.jjGDjjIDjjxj}rTD(jojpj]j]j]j]j]ujNjhj]rUDjX M2Crypto.EVP.rVDrWD}rXD(jUjNjNjhjjRDubaubj~)rYD}rZD(jjPDjjGDjjIDjjj}r[D(jojpj]j]j]j]j]ujNjhj]r\DjXload_key_stringr]Dr^D}r_D(jUjNjNjhjjYDubaubj)r`D}raD(jX/string, callback=jjGDjjIDjjj}rbD(jojpj]j]j]j]j]ujNjhj]rcD(j)rdD}reD(jXstringj}rfD(jojpj]j]j]j]j]ujj`Dj]rgDjXstringrhDriD}rjD(jUjjdDubajjubj)rkD}rlD(jX'callback=j}rmD(jojpj]j]j]j]j]ujj`Dj]rnDjX'callback=roDrpD}rqD(jUjjkDubajjubeubj)rrD}rsD(jUjjGDjNjjj}rtD(Uexprjj]j]j]j]j]ujNjhj]ruDj!)rvD}rwD(jUj}rxD(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidjPDujjrDj]ryDj)rzD}r{D(jUj}r|D(j]j]r}Djaj]j]j]ujjvDj]r~DjX[source]rDrD}rD(jUjjzDubajjubajj%ubaubeubj)rD}rD(jUjjBDjjIDjjj}rD(j]j]j]j]j]ujNjhj]rD(j)rD}rD(jX(Load an M2Crypto.EVP.PKey from a string.jjDjXT/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.load_key_stringjjj}rD(j]j]j]j]j]ujKjhj]rDjX(Load an M2Crypto.EVP.PKey from a string.rDrD}rD(jUjNjNjhjjDubaubj)rD}rD(jUjjDjNjjj}rD(j]j]j]j]j]ujNjhj]rD(j)rD}rD(jUj}rD(j]j]j]j]j]ujjDj]rD(j)rD}rD(jX ParametersjjDjjIDjjj}rD(j]j]j]j]j]ujKj]rDjX ParametersrDrD}rD(jUjjDubaubj)rD}rD(jUj}rD(j]j]j]j]j]ujjDj]rDj^ )rD}rD(jUj}rD(j]j]j]j]j]ujjDj]rD(jc )rD}rD(jUj}rD(j]j]j]j]j]ujjDj]rDj)rD}rD(jX2string -- String containing the key in PEM format.j}rD(j]j]j]j]j]ujjDj]rD(j)rD}rD(jXstringj}rD(j]j]jj]j]j]ujjDj]rDjXstringrDrD}rD(jUjjDubajjubjX – rDrD}rD(jUjjDubjX(String containing the key in PEM format.rDrD}rD(jUjNjNjhjjDubejjubajjy ubjc )rD}rD(jUj}rD(j]j]j]j]j]ujjDj]rDj)rD}rD(jXkcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key.j}rD(j]j]j]j]j]ujjDj]rD(j)rD}rD(jXcallbackj}rD(j]j]jj]j]j]ujjDj]rDjXcallbackrDrD}rD(jUjjDubajjubjX – rDrD}rD(jUjjDubjX_A Python callable object that is invoked to acquire a passphrase with which to protect the key.rDrD}rD(jUjNjNjhjjDubejjubajjy ubejj ubajjubejjubj)rD}rD(jUj}rD(j]j]j]j]j]ujjDj]rD(j)rD}rD(jXReturnsjjDjjIDjjj}rD(j]j]j]j]j]ujKj]rDjXReturnsrDrD}rD(jUjjDubaubj)rD}rD(jUj}rD(j]j]j]j]j]ujjDj]rDj)rD}rD(jXM2Crypto.EVP.PKey object.j}rD(j]j]j]j]j]ujjDj]rDjXM2Crypto.EVP.PKey object.rDrD}rD(jUjNjNjhjjDubajjubajjubejjubeubeubeubj?)rD}rD(jUjj6jNjjCj}rD(j]j]j]j]j]Uentries]rD(jFX1load_key_string_pubkey() (in module M2Crypto.EVP)jpUNtrDaujNjhj]ubjM)rD}rD(jUjj6jNjjPj}rD(jRjSXpyj]j]j]j]j]jTXfunctionrDjVjDujNjhj]rD(jX)rD}rD(jXGload_key_string_pubkey(string, callback=)jjDjX[/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.load_key_string_pubkeyrDjj\j}rD(j]rDjpaj_j`X M2Crypto.EVPrDrD}rDbj]j]j]j]rDjpajeXload_key_string_pubkeyrDjgUjhujNjhj]rD(ju)rD}rD(jX M2Crypto.EVP.jjDjjDjjxj}rD(jojpj]j]j]j]j]ujNjhj]rDjX M2Crypto.EVP.rDrD}rD(jUjNjNjhjjDubaubj~)rE}rE(jjDjjDjjDjjj}rE(jojpj]j]j]j]j]ujNjhj]rEjXload_key_string_pubkeyrErE}rE(jUjNjNjhjjEubaubj)rE}rE(jX/string, callback=jjDjjDjjj}r E(jojpj]j]j]j]j]ujNjhj]r E(j)r E}r E(jXstringj}r E(jojpj]j]j]j]j]ujjEj]rEjXstringrErE}rE(jUjj Eubajjubj)rE}rE(jX'callback=j}rE(jojpj]j]j]j]j]ujjEj]rEjX'callback=rErE}rE(jUjjEubajjubeubj)rE}rE(jUjjDjNjjj}rE(Uexprjj]j]j]j]j]ujNjhj]rEj!)rE}rE(jUj}rE(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EVPUrefidjDujjEj]r Ej)r!E}r"E(jUj}r#E(j]j]r$Ejaj]j]j]ujjEj]r%EjX[source]r&Er'E}r(E(jUjj!Eubajjubajj%ubaubeubj)r)E}r*E(jUjjDjjDjjj}r+E(j]j]j]j]j]ujNjhj]r,E(j)r-E}r.E(jX8Load an M2Crypto.EVP.PKey from a public key as a string.jj)EjX[/home/matej/Build/m2crypto/M2Crypto/EVP.py:docstring of M2Crypto.EVP.load_key_string_pubkeyjjj}r/E(j]j]j]j]j]ujKjhj]r0EjX8Load an M2Crypto.EVP.PKey from a public key as a string.r1Er2E}r3E(jUjNjNjhjj-Eubaubj)r4E}r5E(jUjj)EjNjjj}r6E(j]j]j]j]j]ujNjhj]r7E(j)r8E}r9E(jUj}r:E(j]j]j]j]j]ujj4Ej]r;E(j)rE(j]j]j]j]j]ujKj]r?EjX Parametersr@ErAE}rBE(jUjjF(jUjNjNjhjj.Fubejjubajjy ubjc )r?F}r@F(jUj}rAF(j]j]j]j]j]ujjEj]rBFj)rCF}rDF(jX#keylen -- Length of key to produce.j}rEF(j]j]j]j]j]ujj?Fj]rFF(j)rGF}rHF(jXkeylenj}rIF(j]j]jj]j]j]ujjCFj]rJFjXkeylenrKFrLF}rMF(jUjjGFubajjubjX – rNFrOF}rPF(jUjjCFubjXLength of key to produce.rQFrRF}rSF(jUjNjNjhjjCFubejjubajjy ubejj ubajjubejjubj)rTF}rUF(jUj}rVF(j]j]j]j]j]ujjEj]rWF(j)rXF}rYF(jXReturnsjjTFjjEjjj}rZF(j]j]j]j]j]ujKj]r[FjXReturnsr\Fr]F}r^F(jUjjXFubaubj)r_F}r`F(jUj}raF(j]j]j]j]j]ujjTFj]rbFj)rcF}rdF(jXKey.j}reF(j]j]j]j]j]ujj_Fj]rfFjXKey.rgFrhF}riF(jUjNjNjhjjcFubajjubajjubejjubeubeubeubeubj)rjF}rkF(jUjjjjjjj}rlF(j]j]j]j]rmF(Xmodule-M2Crypto.EnginernFU engine-moduleroFej]rpFhaujKMjhj]rqF(j )rrF}rsF(jX:mod:`Engine` ModulertFjjjFjjjj j}ruF(j]j]j]j]j]ujKMjhj]rvF(j!)rwF}rxF(jX :mod:`Engine`ryFjjrFjjjj%j}rzF(UreftypeXmodj'j(XEngineU refdomainXpyr{Fj]j]U refexplicitj]j]j]j*j+j,Nj-jd8ujKLj]r|Fj0)r}F}r~F(jjyFj}rF(j]j]rF(j5j{FXpy-modrFej]j]j]ujjwFj]rFjXEnginerFrF}rF(jUjj}Fubajj;ubaubjX ModulerFrF}rF(jUjNjNjhjjrFubeubj?)rF}rF(jUjjjFjXJ/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.EnginerFjjCj}rF(j]j]j]j]j]Uentries]rF(jFXM2Crypto.Engine (module)Xmodule-M2Crypto.EngineUNtrFaujKjhj]ubj)rF}rF(jX(M2Crypto wrapper for OpenSSL ENGINE API.jjjFjXJ/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.EnginerFjjj}rF(j]j]j]j]j]ujKjhj]rFjX(M2Crypto wrapper for OpenSSL ENGINE API.rFrF}rF(jUjNjNjhjjFubaubj)rF}rF(jXPavel Shramov IMEC MSUjjjFjjFjjj}rF(j]j]j]j]j]ujKjhj]rFjXPavel Shramov IMEC MSUrFrF}rF(jUjNjNjhjjFubaubj?)rF}rF(jUjjjFjNjjCj}rF(j]j]j]j]j]Uentries]rF(jFX!Engine (class in M2Crypto.Engine)hUNtrFaujNjhj]ubjM)rF}rF(jUjjjFjNjjPj}rF(jRjSXpyj]j]j]j]j]jTXclassrFjVjFujNjhj]rF(jX)rF}rF(jX%Engine(id=None, _ptr=None, _pyfree=1)jjFjXQ/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.EnginerFjj\j}rF(j]rFhaj_j`XM2Crypto.EnginerFrF}rFbj]j]j]j]rFhajeXEnginerFjgUjhujNjhj]rF(jj)rF}rF(jXclass jjFjjFjjmj}rF(jojpj]j]j]j]j]ujNjhj]rFjXclass rFrF}rF(jUjNjNjhjjFubaubju)rF}rF(jXM2Crypto.Engine.jjFjjFjjxj}rF(jojpj]j]j]j]j]ujNjhj]rFjXM2Crypto.Engine.rFrF}rF(jUjNjNjhjjFubaubj~)rF}rF(jjFjjFjjFjjj}rF(jojpj]j]j]j]j]ujNjhj]rFjXEnginerFrF}rF(jUjNjNjhjjFubaubj)rF}rF(jXid=None, _ptr=None, _pyfree=1jjFjjFjjj}rF(jojpj]j]j]j]j]ujNjhj]rF(j)rF}rF(jXid=Nonej}rF(jojpj]j]j]j]j]ujjFj]rFjXid=NonerFrF}rF(jUjjFubajjubj)rF}rF(jX _ptr=Nonej}rF(jojpj]j]j]j]j]ujjFj]rFjX _ptr=NonerFrF}rF(jUjjFubajjubj)rF}rF(jX _pyfree=1j}rF(jojpj]j]j]j]j]ujjFj]rFjX _pyfree=1rFrF}rF(jUjjFubajjubeubj)rF}rF(jUjjFjNjjj}rF(Uexprjj]j]j]j]j]ujNjhj]rFj!)rF}rF(jUj}rF(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidjFujjFj]rFj)rF}rF(jUj}rF(j]j]rFjaj]j]j]ujjFj]rFjX[source]rFrF}rF(jUjjFubajjubajj%ubaubeubj)rF}rF(jUjjFjjFjjj}rF(j]j]j]j]j]ujNjhj]rF(j)rF}rF(jXWrapper for ENGINE object.jjFjXQ/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Enginejjj}rF(j]j]j]j]j]ujKjhj]rFjXWrapper for ENGINE object.rFrF}rF(jUjNjNjhjjFubaubj?)rF}rF(jUjjFjXa/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.ctrl_cmd_stringrFjjCj}rF(j]j]j]j]j]Uentries]rG(jFX1ctrl_cmd_string() (M2Crypto.Engine.Engine method)hUNtrGaujNjhj]ubjM)rG}rG(jUjjFjjFjjPj}rG(jRjSXpyj]j]j]j]j]jTXmethodrGjVjGujNjhj]rG(jX)rG}rG(jX,Engine.ctrl_cmd_string(cmd, arg, optional=0)jjGjXa/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.ctrl_cmd_stringr Gjj\j}r G(j]r Ghaj_j`XM2Crypto.Enginer Gr G}rGbj]j]j]j]rGhajeXEngine.ctrl_cmd_stringrGjgjFjhujNjhj]rG(j~)rG}rG(jXctrl_cmd_stringjjGjj Gjjj}rG(jojpj]j]j]j]j]ujNjhj]rGjXctrl_cmd_stringrGrG}rG(jUjNjNjhjjGubaubj)rG}rG(jXcmd, arg, optional=0jjGjj Gjjj}rG(jojpj]j]j]j]j]ujNjhj]rG(j)rG}rG(jXcmdj}rG(jojpj]j]j]j]j]ujjGj]r GjXcmdr!Gr"G}r#G(jUjjGubajjubj)r$G}r%G(jXargj}r&G(jojpj]j]j]j]j]ujjGj]r'GjXargr(Gr)G}r*G(jUjj$Gubajjubj)r+G}r,G(jX optional=0j}r-G(jojpj]j]j]j]j]ujjGj]r.GjX optional=0r/Gr0G}r1G(jUjj+Gubajjubeubj)r2G}r3G(jUjjGjNjjj}r4G(Uexprjj]j]j]j]j]ujNjhj]r5Gj!)r6G}r7G(jUj}r8G(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidjGujj2Gj]r9Gj)r:G}r;G(jUj}rGjX[source]r?Gr@G}rAG(jUjj:Gubajjubajj%ubaubeubj)rBG}rCG(jUjjGjj Gjjj}rDG(j]j]j]j]j]ujNjhj]rEGj)rFG}rGG(jXCall ENGINE_ctrl_cmd_stringjjBGjjFjjj}rHG(j]j]j]j]j]ujKjhj]rIGjXCall ENGINE_ctrl_cmd_stringrJGrKG}rLG(jUjNjNjhjjFGubaubaubeubj?)rMG}rNG(jUjjFjXX/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.finishrOGjjCj}rPG(j]j]j]j]j]Uentries]rQG(jFX(finish() (M2Crypto.Engine.Engine method)jUNtrRGaujNjhj]ubjM)rSG}rTG(jUjjFjjOGjjPj}rUG(jRjSXpyj]j]j]j]j]jTXmethodrVGjVjVGujNjhj]rWG(jX)rXG}rYG(jXEngine.finish()jjSGjXX/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.finishrZGjj\j}r[G(j]r\Gjaj_j`XM2Crypto.Enginer]Gr^G}r_Gbj]j]j]j]r`GjajeX Engine.finishraGjgjFjhujNjhj]rbG(j~)rcG}rdG(jXfinishjjXGjjZGjjj}reG(jojpj]j]j]j]j]ujNjhj]rfGjXfinishrgGrhG}riG(jUjNjNjhjjcGubaubj)rjG}rkG(jUjjXGjjZGjjj}rlG(jojpj]j]j]j]j]ujNjhj]ubj)rmG}rnG(jUjjXGjNjjj}roG(Uexprjj]j]j]j]j]ujNjhj]rpGj!)rqG}rrG(jUj}rsG(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidjaGujjmGj]rtGj)ruG}rvG(jUj}rwG(j]j]rxGjaj]j]j]ujjqGj]ryGjX[source]rzGr{G}r|G(jUjjuGubajjubajj%ubaubeubj)r}G}r~G(jUjjSGjjZGjjj}rG(j]j]j]j]j]ujNjhj]rGj)rG}rG(jX<Release a functional and structural reference to the engine.jj}GjjOGjjj}rG(j]j]j]j]j]ujKjhj]rGjX<Release a functional and structural reference to the engine.rGrG}rG(jUjNjNjhjjGubaubaubeubj?)rG}rG(jUjjFjXX/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.get_idrGjjCj}rG(j]j]j]j]j]Uentries]rG(jFX(get_id() (M2Crypto.Engine.Engine method)hUNtrGaujNjhj]ubjM)rG}rG(jUjjFjjGjjPj}rG(jRjSXpyj]j]j]j]j]jTXmethodrGjVjGujNjhj]rG(jX)rG}rG(jXEngine.get_id()jjGjXX/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.get_idrGjj\j}rG(j]rGhaj_j`XM2Crypto.EnginerGrG}rGbj]j]j]j]rGhajeX Engine.get_idrGjgjFjhujNjhj]rG(j~)rG}rG(jXget_idjjGjjGjjj}rG(jojpj]j]j]j]j]ujNjhj]rGjXget_idrGrG}rG(jUjNjNjhjjGubaubj)rG}rG(jUjjGjjGjjj}rG(jojpj]j]j]j]j]ujNjhj]ubj)rG}rG(jUjjGjNjjj}rG(Uexprjj]j]j]j]j]ujNjhj]rGj!)rG}rG(jUj}rG(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidjGujjGj]rGj)rG}rG(jUj}rG(j]j]rGjaj]j]j]ujjGj]rGjX[source]rGrG}rG(jUjjGubajjubajj%ubaubeubj)rG}rG(jUjjGjjGjjj}rG(j]j]j]j]j]ujNjhj]rGj)rG}rG(jXReturn engine idjjGjjGjjj}rG(j]j]j]j]j]ujKjhj]rGjXReturn engine idrGrG}rG(jUjNjNjhjjGubaubaubeubj?)rG}rG(jUjjFjXZ/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.get_namerGjjCj}rG(j]j]j]j]j]Uentries]rG(jFX*get_name() (M2Crypto.Engine.Engine method)hUNtrGaujNjhj]ubjM)rG}rG(jUjjFjjGjjPj}rG(jRjSXpyj]j]j]j]j]jTXmethodrGjVjGujNjhj]rG(jX)rG}rG(jXEngine.get_name()jjGjXZ/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.get_namerGjj\j}rG(j]rGhaj_j`XM2Crypto.EnginerGrG}rGbj]j]j]j]rGhajeXEngine.get_namerGjgjFjhujNjhj]rG(j~)rG}rG(jXget_namejjGjjGjjj}rG(jojpj]j]j]j]j]ujNjhj]rGjXget_namerGrG}rG(jUjNjNjhjjGubaubj)rG}rG(jUjjGjjGjjj}rG(jojpj]j]j]j]j]ujNjhj]ubj)rG}rG(jUjjGjNjjj}rG(Uexprjj]j]j]j]j]ujNjhj]rGj!)rG}rG(jUj}rG(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidjGujjGj]rGj)rG}rG(jUj}rG(j]j]rGjaj]j]j]ujjGj]rGjX[source]rGrG}rG(jUjjGubajjubajj%ubaubeubj)rG}rG(jUjjGjjGjjj}rG(j]j]j]j]j]ujNjhj]rGj)rG}rG(jXReturn engine namejjGjjGjjj}rG(j]j]j]j]j]ujKjhj]rGjXReturn engine namerGrG}rG(jUjNjNjhjjGubaubaubeubj?)rG}rG(jUjjFjNjjCj}rH(j]j]j]j]j]Uentries]rH(jFX&init() (M2Crypto.Engine.Engine method)hUNtrHaujNjhj]ubjM)rH}rH(jUjjFjNjjPj}rH(jRjSXpyj]j]j]j]j]jTXmethodrHjVjHujNjhj]rH(jX)rH}r H(jX Engine.init()jjHjXV/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.initr Hjj\j}r H(j]r Hhaj_j`XM2Crypto.Enginer HrH}rHbj]j]j]j]rHhajeX Engine.initrHjgjFjhujNjhj]rH(j~)rH}rH(jXinitjjHjj Hjjj}rH(jojpj]j]j]j]j]ujNjhj]rHjXinitrHrH}rH(jUjNjNjhjjHubaubj)rH}rH(jUjjHjj Hjjj}rH(jojpj]j]j]j]j]ujNjhj]ubj)rH}rH(jUjjHjNjjj}rH(Uexprjj]j]j]j]j]ujNjhj]r Hj!)r!H}r"H(jUj}r#H(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidjHujjHj]r$Hj)r%H}r&H(jUj}r'H(j]j]r(Hjaj]j]j]ujj!Hj]r)HjX[source]r*Hr+H}r,H(jUjj%Hubajjubajj%ubaubeubj)r-H}r.H(jUjjHjj Hjjj}r/H(j]j]j]j]j]ujNjhj]r0H(j)r1H}r2H(jX,Obtain a functional reference to the engine.jj-HjXV/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.initjjj}r3H(j]j]j]j]j]ujKjhj]r4HjX,Obtain a functional reference to the engine.r5Hr6H}r7H(jUjNjNjhjj1Hubaubj)r8H}r9H(jUjj-HjNjjj}r:H(j]j]j]j]j]ujNjhj]r;Hj)rH(j]j]j]j]j]ujj8Hj]r?H(j)r@H}rAH(jXReturnsjjI(jXm2_engine_freejj3Ijj5Ijjj}r?I(jojpj]j]j]j]j]ujNjhj]r@IjXm2_engine_freerAIrBI}rCI(jUjNjNjhjj=Iubaubj)rDI}rEI(jUjj3Ijj5Ijjj}rFI(jojpj]j]j]j]j]ujNjhj]ubeubj)rGI}rHI(jUjj.Ijj5Ijjj}rII(j]j]j]j]j]ujNjhj]ubeubj?)rJI}rKI(jUjjFjNjjCj}rLI(j]j]j]j]j]Uentries]rMI(jFX-set_default() (M2Crypto.Engine.Engine method)jUNtrNIaujNjhj]ubjM)rOI}rPI(jUjjFjNjjPj}rQI(jRjSXpyj]j]j]j]j]jTXmethodrRIjVjRIujNjhj]rSI(jX)rTI}rUI(jX!Engine.set_default(methods=65535)jjOIjX]/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.set_defaultrVIjj\j}rWI(j]rXIjaj_j`XM2Crypto.EnginerYIrZI}r[Ibj]j]j]j]r\IjajeXEngine.set_defaultr]IjgjFjhujNjhj]r^I(j~)r_I}r`I(jX set_defaultjjTIjjVIjjj}raI(jojpj]j]j]j]j]ujNjhj]rbIjX set_defaultrcIrdI}reI(jUjNjNjhjj_Iubaubj)rfI}rgI(jX methods=65535jjTIjjVIjjj}rhI(jojpj]j]j]j]j]ujNjhj]riIj)rjI}rkI(jX methods=65535j}rlI(jojpj]j]j]j]j]ujjfIj]rmIjX methods=65535rnIroI}rpI(jUjjjIubajjubaubj)rqI}rrI(jUjjTIjNjjj}rsI(Uexprjj]j]j]j]j]ujNjhj]rtIj!)ruI}rvI(jUj}rwI(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidj]IujjqIj]rxIj)ryI}rzI(jUj}r{I(j]j]r|Ijaj]j]j]ujjuIj]r}IjX[source]r~IrI}rI(jUjjyIubajjubajj%ubaubeubj)rI}rI(jUjjOIjjVIjjj}rI(j]j]j]j]j]ujNjhj]rI(j)rI}rI(jX<Use this engine as default for methods specified in argumentjjIjX]/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.Engine.set_defaultjjj}rI(j]j]j]j]j]ujKjhj]rIjX<Use this engine as default for methods specified in argumentrIrI}rI(jUjNjNjhjjIubaubj)rI}rI(jUjjIjNjjj}rI(j]j]j]j]j]ujNjhj]rIj)rI}rI(jUj}rI(j]j]j]j]j]ujjIj]rI(j)rI}rI(jX ParametersjjIjjVIjjj}rI(j]j]j]j]j]ujKj]rIjX ParametersrIrI}rI(jUjjIubaubj)rI}rI(jUj}rI(j]j]j]j]j]ujjIj]rIj)rI}rI(jX?methods -- Possible values are bitwise OR of m2.ENGINE_METHOD_*j}rI(j]j]j]j]j]ujjIj]rI(j)rI}rI(jXmethodsj}rI(j]j]jj]j]j]ujjIj]rIjXmethodsrIrI}rI(jUjjIubajjubjX – rIrI}rI(jUjjIubjX4Possible values are bitwise OR of m2.ENGINE_METHOD_*rIrI}rI(jUjNjNjhjjIubejjubajjubejjubaubeubeubeubeubj?)rI}rI(jUjjjFjXV/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.EngineErrorrIjjCj}rI(j]j]j]j]j]Uentries]rI(jFX EngineErrorrIhJUNtrIaujNjhj]ubjM)rI}rI(jUjjjFjjIjjPj}rI(jRjSXpyj]j]j]j]j]jTX exceptionrIjVjIujNjhj]rI(jX)rI}rI(jjIjjIjXV/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.EngineErrorrIjj\j}rI(j]rIhJaj_j`XM2Crypto.EnginerIrI}rIbj]j]j]j]rIhJajejIjgUjhujNjhj]rI(jj)rI}rI(jX exception jjIjjIjjmj}rI(jojpj]j]j]j]j]ujNjhj]rIjX exception rIrI}rI(jUjNjNjhjjIubaubju)rI}rI(jXM2Crypto.Engine.jjIjjIjjxj}rI(jojpj]j]j]j]j]ujNjhj]rIjXM2Crypto.Engine.rIrI}rI(jUjNjNjhjjIubaubj~)rI}rI(jjIjjIjjIjjj}rI(jojpj]j]j]j]j]ujNjhj]rIjX EngineErrorrIrI}rI(jUjNjNjhjjIubaubj)rI}rI(jUjjIjNjjj}rI(Uexprjj]j]j]j]j]ujNjhj]rIj!)rI}rI(jUj}rI(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidjIujjIj]rIj)rI}rI(jUj}rI(j]j]rIjaj]j]j]ujjIj]rIjX[source]rIrI}rI(jUjjIubajjubajj%ubaubeubj)rI}rI(jUjjIjjIjjj}rI(j]j]j]j]j]ujNjhj]rIj)rI}rI(jX$Bases: :class:`exceptions.Exception`jjIjjIjjj}rI(j]j]j]j]j]ujKjhj]rI(jXBases: rIrI}rI(jUjNjNjhjjIubj!)rI}rI(jX:class:`exceptions.Exception`rIjjIjjjj%j}rI(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyrIj]j]U refexplicitj]j]j]j*j+j,jIj-XM2Crypto.EnginerIujKTj]rIj0)rI}rI(jjIj}rI(j]j]rJ(j5jIXpy-classrJej]j]j]ujjIj]rJjXexceptions.ExceptionrJrJ}rJ(jUjjIubajj;ubaubeubaubeubj?)rJ}rJ(jUjjjFjXR/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.cleanuprJjjCj}r J(j]j]j]j]j]Uentries]r J(jFX%cleanup() (in module M2Crypto.Engine)jUNtr JaujNjhj]ubjM)r J}r J(jUjjjFjjJjjPj}rJ(jRjSXpyj]j]j]j]j]jTXfunctionrJjVjJujNjhj]rJ(jX)rJ}rJ(jX cleanup()jj JjXR/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.cleanuprJjj\j}rJ(j]rJjaj_j`XM2Crypto.EnginerJrJ}rJbj]j]j]j]rJjajeXcleanuprJjgUjhujNjhj]rJ(ju)rJ}rJ(jXM2Crypto.Engine.jjJjjJjjxj}rJ(jojpj]j]j]j]j]ujNjhj]rJjXM2Crypto.Engine.r Jr!J}r"J(jUjNjNjhjjJubaubj~)r#J}r$J(jjJjjJjjJjjj}r%J(jojpj]j]j]j]j]ujNjhj]r&JjXcleanupr'Jr(J}r)J(jUjNjNjhjj#Jubaubj)r*J}r+J(jUjjJjjJjjj}r,J(jojpj]j]j]j]j]ujNjhj]ubj)r-J}r.J(jUjjJjNjjj}r/J(Uexprjj]j]j]j]j]ujNjhj]r0Jj!)r1J}r2J(jUj}r3J(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidjJujj-Jj]r4Jj)r5J}r6J(jUj}r7J(j]j]r8Jjaj]j]j]ujj1Jj]r9JjX[source]r:Jr;J}rJ(jUjj JjjJjjj}r?J(j]j]j]j]j]ujNjhj]r@Jj)rAJ}rBJ(jXbIf you load any engines, you need to clean up after your application is finished with the engines.jj=JjjJjjj}rCJ(j]j]j]j]j]ujKjhj]rDJjXbIf you load any engines, you need to clean up after your application is finished with the engines.rEJrFJ}rGJ(jUjNjNjhjjAJubaubaubeubj?)rHJ}rIJ(jUjjjFjXW/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.load_dynamicrJJjjCj}rKJ(j]j]j]j]j]Uentries]rLJ(jFX*load_dynamic() (in module M2Crypto.Engine)hUNtrMJaujNjhj]ubjM)rNJ}rOJ(jUjjjFjjJJjjPj}rPJ(jRjSXpyj]j]j]j]j]jTXfunctionrQJjVjQJujNjhj]rRJ(jX)rSJ}rTJ(jXload_dynamic()jjNJjXW/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.load_dynamicrUJjj\j}rVJ(j]rWJhaj_j`XM2Crypto.EnginerXJrYJ}rZJbj]j]j]j]r[JhajeX load_dynamicr\JjgUjhujNjhj]r]J(ju)r^J}r_J(jXM2Crypto.Engine.jjSJjjUJjjxj}r`J(jojpj]j]j]j]j]ujNjhj]raJjXM2Crypto.Engine.rbJrcJ}rdJ(jUjNjNjhjj^Jubaubj~)reJ}rfJ(jj\JjjSJjjUJjjj}rgJ(jojpj]j]j]j]j]ujNjhj]rhJjX load_dynamicriJrjJ}rkJ(jUjNjNjhjjeJubaubj)rlJ}rmJ(jUjjSJjjUJjjj}rnJ(jojpj]j]j]j]j]ujNjhj]ubj)roJ}rpJ(jUjjSJjNjjj}rqJ(Uexprjj]j]j]j]j]ujNjhj]rrJj!)rsJ}rtJ(jUj}ruJ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidj\JujjoJj]rvJj)rwJ}rxJ(jUj}ryJ(j]j]rzJjaj]j]j]ujjsJj]r{JjX[source]r|Jr}J}r~J(jUjjwJubajjubajj%ubaubeubj)rJ}rJ(jUjjNJjjUJjjj}rJ(j]j]j]j]j]ujNjhj]rJj)rJ}rJ(jXLoad dynamic enginejjJjjJJjjj}rJ(j]j]j]j]j]ujKjhj]rJjXLoad dynamic enginerJrJ}rJ(jUjNjNjhjjJubaubaubeubj?)rJ}rJ(jUjjjFjX^/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.load_dynamic_enginerJjjCj}rJ(j]j]j]j]j]Uentries]rJ(jFX1load_dynamic_engine() (in module M2Crypto.Engine)jjUNtrJaujNjhj]ubjM)rJ}rJ(jUjjjFjjJjjPj}rJ(jRjSXpyj]j]j]j]j]jTXfunctionrJjVjJujNjhj]rJ(jX)rJ}rJ(jXload_dynamic_engine(id, sopath)jjJjX^/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.load_dynamic_enginerJjj\j}rJ(j]rJjjaj_j`XM2Crypto.EnginerJrJ}rJbj]j]j]j]rJjjajeXload_dynamic_enginerJjgUjhujNjhj]rJ(ju)rJ}rJ(jXM2Crypto.Engine.jjJjjJjjxj}rJ(jojpj]j]j]j]j]ujNjhj]rJjXM2Crypto.Engine.rJrJ}rJ(jUjNjNjhjjJubaubj~)rJ}rJ(jjJjjJjjJjjj}rJ(jojpj]j]j]j]j]ujNjhj]rJjXload_dynamic_enginerJrJ}rJ(jUjNjNjhjjJubaubj)rJ}rJ(jX id, sopathjjJjjJjjj}rJ(jojpj]j]j]j]j]ujNjhj]rJ(j)rJ}rJ(jXidj}rJ(jojpj]j]j]j]j]ujjJj]rJjXidrJrJ}rJ(jUjjJubajjubj)rJ}rJ(jXsopathj}rJ(jojpj]j]j]j]j]ujjJj]rJjXsopathrJrJ}rJ(jUjjJubajjubeubj)rJ}rJ(jUjjJjNjjj}rJ(Uexprjj]j]j]j]j]ujNjhj]rJj!)rJ}rJ(jUj}rJ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidjJujjJj]rJj)rJ}rJ(jUj}rJ(j]j]rJjaj]j]j]ujjJj]rJjX[source]rJrJ}rJ(jUjjJubajjubajj%ubaubeubj)rJ}rJ(jUjjJjjJjjj}rJ(j]j]j]j]j]ujNjhj]rJj)rJ}rJ(jX>Load and return dymanic engine from sopath and assign id to itjjJjjJjjj}rJ(j]j]j]j]j]ujKjhj]rJjX>Load and return dymanic engine from sopath and assign id to itrJrJ}rJ(jUjNjNjhjjJubaubaubeubj?)rJ}rJ(jUjjjFjXW/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.load_opensslrJjjCj}rJ(j]j]j]j]j]Uentries]rJ(jFX*load_openssl() (in module M2Crypto.Engine)jUNtrJaujNjhj]ubjM)rJ}rJ(jUjjjFjjJjjPj}rJ(jRjSXpyj]j]j]j]j]jTXfunctionrJjVjJujNjhj]rJ(jX)rJ}rJ(jXload_openssl()jjJjXW/home/matej/Build/m2crypto/M2Crypto/Engine.py:docstring of M2Crypto.Engine.load_opensslrJjj\j}rJ(j]rJjaj_j`XM2Crypto.EnginerJrJ}rJbj]j]j]j]rJjajeX load_opensslrJjgUjhujNjhj]rJ(ju)rJ}rJ(jXM2Crypto.Engine.jjJjjJjjxj}rJ(jojpj]j]j]j]j]ujNjhj]rJjXM2Crypto.Engine.rJrJ}rJ(jUjNjNjhjjJubaubj~)rJ}rJ(jjJjjJjjJjjj}rJ(jojpj]j]j]j]j]ujNjhj]rJjX load_opensslrJrJ}rJ(jUjNjNjhjjJubaubj)rJ}rK(jUjjJjjJjjj}rK(jojpj]j]j]j]j]ujNjhj]ubj)rK}rK(jUjjJjNjjj}rK(Uexprjj]j]j]j]j]ujNjhj]rKj!)rK}rK(jUj}rK(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/EngineUrefidjJujjKj]r Kj)r K}r K(jUj}r K(j]j]r Kjaj]j]j]ujjKj]rKjX[source]rKrK}rK(jUjj Kubajjubajj%ubaubeubj)rK}rK(jUjjJjjJjjj}rK(j]j]j]j]j]ujNjhj]rKj)rK}rK(jXLoad openssl enginejjKjjJjjj}rK(j]j]j]j]j]ujKjhj]rKjXLoad openssl enginerKrK}rK(jUjNjNjhjjKubaubaubeubeubj)rK}rK(jUjjjjjjj}rK(j]j]j]j]r K(Xmodule-M2Crypto.Errr!KU err-moduler"Kej]r#KhaujKUjhj]r$K(j )r%K}r&K(jX:mod:`Err` Moduler'KjjKjjjj j}r(K(j]j]j]j]j]ujKUjhj]r)K(j!)r*K}r+K(jX :mod:`Err`r,Kjj%Kjjjj%j}r-K(UreftypeXmodj'j(XErrU refdomainXpyr.Kj]j]U refexplicitj]j]j]j*j+j,Nj-jIujKTj]r/Kj0)r0K}r1K(jj,Kj}r2K(j]j]r3K(j5j.KXpy-modr4Kej]j]j]ujj*Kj]r5KjXErrr6Kr7K}r8K(jUjj0Kubajj;ubaubjX Moduler9Kr:K}r;K(jUjNjNjhjj%Kubeubj?)rKjjCj}r?K(j]j]j]j]j]Uentries]r@K(jFXM2Crypto.Err (module)Xmodule-M2Crypto.ErrUNtrAKaujKjhj]ubj?)rBK}rCK(jUjjKjXR/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.M2CryptoErrorrDKjjCj}rEK(j]j]j]j]j]Uentries]rFK(jFX M2CryptoErrorrGKhUNtrHKaujNjhj]ubjM)rIK}rJK(jUjjKjjDKjjPj}rKK(jRjSXpyj]j]j]j]j]jTX exceptionrLKjVjLKujNjhj]rMK(jX)rNK}rOK(jjGKjjIKjXR/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.M2CryptoErrorrPKjj\j}rQK(j]rRKhaj_j`X M2Crypto.ErrrSKrTK}rUKbj]j]j]j]rVKhajejGKjgUjhujNjhj]rWK(jj)rXK}rYK(jX exception jjNKjjPKjjmj}rZK(jojpj]j]j]j]j]ujNjhj]r[KjX exception r\Kr]K}r^K(jUjNjNjhjjXKubaubju)r_K}r`K(jX M2Crypto.Err.jjNKjjPKjjxj}raK(jojpj]j]j]j]j]ujNjhj]rbKjX M2Crypto.Err.rcKrdK}reK(jUjNjNjhjj_Kubaubj~)rfK}rgK(jjGKjjNKjjPKjjj}rhK(jojpj]j]j]j]j]ujNjhj]riKjX M2CryptoErrorrjKrkK}rlK(jUjNjNjhjjfKubaubj)rmK}rnK(jUjjNKjNjjj}roK(Uexprjj]j]j]j]j]ujNjhj]rpKj!)rqK}rrK(jUj}rsK(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ErrUrefidjGKujjmKj]rtKj)ruK}rvK(jUj}rwK(j]j]rxKjaj]j]j]ujjqKj]ryKjX[source]rzKr{K}r|K(jUjjuKubajjubajj%ubaubeubj)r}K}r~K(jUjjIKjjPKjjj}rK(j]j]j]j]j]ujNjhj]rKj)rK}rK(jX$Bases: :class:`exceptions.Exception`jj}KjjDKjjj}rK(j]j]j]j]j]ujKjhj]rK(jXBases: rKrK}rK(jUjNjNjhjjKubj!)rK}rK(jX:class:`exceptions.Exception`rKjjKjjjj%j}rK(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyrKj]j]U refexplicitj]j]j]j*j+j,jGKj-X M2Crypto.ErrrKujKj]rKj0)rK}rK(jjKj}rK(j]j]rK(j5jKXpy-classrKej]j]j]ujjKj]rKjXexceptions.ExceptionrKrK}rK(jUjjKubajj;ubaubeubaubeubj?)rK}rK(jUjjKjXM/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.SSLErrorrKjjCj}rK(j]j]j]j]j]Uentries]rK(jFXSSLErrorrKhUNtrKaujNjhj]ubjM)rK}rK(jUjjKjjKjjPj}rK(jRjSXpyj]j]j]j]j]jTX exceptionrKjVjKujNjhj]rK(jX)rK}rK(jXSSLError(err, client_addr)jjKjXM/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.SSLErrorrKjj\j}rK(j]rKhaj_j`X M2Crypto.ErrrKrK}rKbj]j]j]j]rKhajejKjgUjhujNjhj]rK(jj)rK}rK(jX exception jjKjjKjjmj}rK(jojpj]j]j]j]j]ujNjhj]rKjX exception rKrK}rK(jUjNjNjhjjKubaubju)rK}rK(jX M2Crypto.Err.jjKjjKjjxj}rK(jojpj]j]j]j]j]ujNjhj]rKjX M2Crypto.Err.rKrK}rK(jUjNjNjhjjKubaubj~)rK}rK(jjKjjKjjKjjj}rK(jojpj]j]j]j]j]ujNjhj]rKjXSSLErrorrKrK}rK(jUjNjNjhjjKubaubj)rK}rK(jXerr, client_addrjjKjjKjjj}rK(jojpj]j]j]j]j]ujNjhj]rK(j)rK}rK(jXerrj}rK(jojpj]j]j]j]j]ujjKj]rKjXerrrKrK}rK(jUjjKubajjubj)rK}rK(jX client_addrj}rK(jojpj]j]j]j]j]ujjKj]rKjX client_addrrKrK}rK(jUjjKubajjubeubj)rK}rK(jUjjKjNjjj}rK(Uexprjj]j]j]j]j]ujNjhj]rKj!)rK}rK(jUj}rK(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ErrUrefidjKujjKj]rKj)rK}rK(jUj}rK(j]j]rKjaj]j]j]ujjKj]rKjX[source]rKrK}rK(jUjjKubajjubajj%ubaubeubj)rK}rK(jUjjKjjKjjj}rK(j]j]j]j]j]ujNjhj]rKj)rK}rK(jX$Bases: :class:`exceptions.Exception`jjKjjKjjj}rK(j]j]j]j]j]ujKjhj]rK(jXBases: rKrK}rK(jUjNjNjhjjKubj!)rK}rK(jX:class:`exceptions.Exception`rKjjKjjjj%j}rK(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyrKj]j]U refexplicitj]j]j]j*j+j,jKj-jKujKj]rKj0)rK}rK(jjKj}rK(j]j]rK(j5jKXpy-classrKej]j]j]ujjKj]rKjXexceptions.ExceptionrKrK}rK(jUjjKubajj;ubaubeubaubeubj?)rK}rL(jUjjKjNjjCj}rL(j]j]j]j]j]Uentries]rL(jFX$get_error() (in module M2Crypto.Err)hUNtrLaujNjhj]ubjM)rL}rL(jUjjKjNjjPj}rL(jRjSXpyj]j]j]j]j]jTXfunctionrLjVjLujNjhj]rL(jX)r L}r L(jX get_error()jjLjXN/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.get_errorr Ljj\j}r L(j]r Lhaj_j`X M2Crypto.ErrrLrL}rLbj]j]j]j]rLhajeX get_errorrLjgUjhujNjhj]rL(ju)rL}rL(jX M2Crypto.Err.jj Ljj Ljjxj}rL(jojpj]j]j]j]j]ujNjhj]rLjX M2Crypto.Err.rLrL}rL(jUjNjNjhjjLubaubj~)rL}rL(jjLjj Ljj Ljjj}rL(jojpj]j]j]j]j]ujNjhj]rLjX get_errorrLr L}r!L(jUjNjNjhjjLubaubj)r"L}r#L(jUjj Ljj Ljjj}r$L(jojpj]j]j]j]j]ujNjhj]ubj)r%L}r&L(jUjj LjNjjj}r'L(Uexprjj]j]j]j]j]ujNjhj]r(Lj!)r)L}r*L(jUj}r+L(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ErrUrefidjLujj%Lj]r,Lj)r-L}r.L(jUj}r/L(j]j]r0Ljaj]j]j]ujj)Lj]r1LjX[source]r2Lr3L}r4L(jUjj-Lubajjubajj%ubaubeubj)r5L}r6L(jUjjLjj Ljjj}r7L(j]j]j]j]j]ujNjhj]ubeubj?)r8L}r9L(jUjjKjNjjCj}r:L(j]j]j]j]j]Uentries]r;L(jFX)get_error_code() (in module M2Crypto.Err)jUNtrL(jUjjKjNjjPj}r?L(jRjSXpyj]j]j]j]j]jTXfunctionr@LjVj@LujNjhj]rAL(jX)rBL}rCL(jXget_error_code()jj=LjXS/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.get_error_coderDLjj\j}rEL(j]rFLjaj_j`X M2Crypto.ErrrGLrHL}rILbj]j]j]j]rJLjajeXget_error_coderKLjgUjhujNjhj]rLL(ju)rML}rNL(jX M2Crypto.Err.jjBLjjDLjjxj}rOL(jojpj]j]j]j]j]ujNjhj]rPLjX M2Crypto.Err.rQLrRL}rSL(jUjNjNjhjjMLubaubj~)rTL}rUL(jjKLjjBLjjDLjjj}rVL(jojpj]j]j]j]j]ujNjhj]rWLjXget_error_coderXLrYL}rZL(jUjNjNjhjjTLubaubj)r[L}r\L(jUjjBLjjDLjjj}r]L(jojpj]j]j]j]j]ujNjhj]ubj)r^L}r_L(jUjjBLjNjjj}r`L(Uexprjj]j]j]j]j]ujNjhj]raLj!)rbL}rcL(jUj}rdL(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ErrUrefidjKLujj^Lj]reLj)rfL}rgL(jUj}rhL(j]j]riLjaj]j]j]ujjbLj]rjLjX[source]rkLrlL}rmL(jUjjfLubajjubajj%ubaubeubj)rnL}roL(jUjj=LjjDLjjj}rpL(j]j]j]j]j]ujNjhj]ubeubj?)rqL}rrL(jUjjKjNjjCj}rsL(j]j]j]j]j]Uentries]rtL(jFX)get_error_func() (in module M2Crypto.Err)jUNtruLaujNjhj]ubjM)rvL}rwL(jUjjKjNjjPj}rxL(jRjSXpyj]j]j]j]j]jTXfunctionryLjVjyLujNjhj]rzL(jX)r{L}r|L(jXget_error_func(err)jjvLjXS/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.get_error_funcr}Ljj\j}r~L(j]rLjaj_j`X M2Crypto.ErrrLrL}rLbj]j]j]j]rLjajeXget_error_funcrLjgUjhujNjhj]rL(ju)rL}rL(jX M2Crypto.Err.jj{Ljj}Ljjxj}rL(jojpj]j]j]j]j]ujNjhj]rLjX M2Crypto.Err.rLrL}rL(jUjNjNjhjjLubaubj~)rL}rL(jjLjj{Ljj}Ljjj}rL(jojpj]j]j]j]j]ujNjhj]rLjXget_error_funcrLrL}rL(jUjNjNjhjjLubaubj)rL}rL(jXerrjj{Ljj}Ljjj}rL(jojpj]j]j]j]j]ujNjhj]rLj)rL}rL(jXerrj}rL(jojpj]j]j]j]j]ujjLj]rLjXerrrLrL}rL(jUjjLubajjubaubj)rL}rL(jUjj{LjNjjj}rL(Uexprjj]j]j]j]j]ujNjhj]rLj!)rL}rL(jUj}rL(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ErrUrefidjLujjLj]rLj)rL}rL(jUj}rL(j]j]rLjaj]j]j]ujjLj]rLjX[source]rLrL}rL(jUjjLubajjubajj%ubaubeubj)rL}rL(jUjjvLjj}Ljjj}rL(j]j]j]j]j]ujNjhj]ubeubj?)rL}rL(jUjjKjNjjCj}rL(j]j]j]j]j]Uentries]rL(jFX(get_error_lib() (in module M2Crypto.Err)hUNtrLaujNjhj]ubjM)rL}rL(jUjjKjNjjPj}rL(jRjSXpyj]j]j]j]j]jTXfunctionrLjVjLujNjhj]rL(jX)rL}rL(jXget_error_lib(err)jjLjXR/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.get_error_librLjj\j}rL(j]rLhaj_j`X M2Crypto.ErrrLrL}rLbj]j]j]j]rLhajeX get_error_librLjgUjhujNjhj]rL(ju)rL}rL(jX M2Crypto.Err.jjLjjLjjxj}rL(jojpj]j]j]j]j]ujNjhj]rLjX M2Crypto.Err.rLrL}rL(jUjNjNjhjjLubaubj~)rL}rL(jjLjjLjjLjjj}rL(jojpj]j]j]j]j]ujNjhj]rLjX get_error_librLrL}rL(jUjNjNjhjjLubaubj)rL}rL(jXerrjjLjjLjjj}rL(jojpj]j]j]j]j]ujNjhj]rLj)rL}rL(jXerrj}rL(jojpj]j]j]j]j]ujjLj]rLjXerrrLrL}rL(jUjjLubajjubaubj)rL}rL(jUjjLjNjjj}rL(Uexprjj]j]j]j]j]ujNjhj]rLj!)rL}rL(jUj}rL(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ErrUrefidjLujjLj]rLj)rL}rL(jUj}rL(j]j]rLjaj]j]j]ujjLj]rLjX[source]rLrL}rL(jUjjLubajjubajj%ubaubeubj)rL}rL(jUjjLjjLjjj}rL(j]j]j]j]j]ujNjhj]ubeubj?)rL}rL(jUjjKjNjjCj}rL(j]j]j]j]j]Uentries]rL(jFX,get_error_message() (in module M2Crypto.Err)j8UNtrLaujNjhj]ubjM)rL}rL(jUjjKjNjjPj}rL(jRjSXpyj]j]j]j]j]jTXfunctionrLjVjLujNjhj]rL(jX)rL}rL(jXget_error_message()jjLjXV/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.get_error_messagerLjj\j}rM(j]rMj8aj_j`X M2Crypto.ErrrMrM}rMbj]j]j]j]rMj8ajeXget_error_messagerMjgUjhujNjhj]rM(ju)rM}r M(jX M2Crypto.Err.jjLjjLjjxj}r M(jojpj]j]j]j]j]ujNjhj]r MjX M2Crypto.Err.r Mr M}rM(jUjNjNjhjjMubaubj~)rM}rM(jjMjjLjjLjjj}rM(jojpj]j]j]j]j]ujNjhj]rMjXget_error_messagerMrM}rM(jUjNjNjhjjMubaubj)rM}rM(jUjjLjjLjjj}rM(jojpj]j]j]j]j]ujNjhj]ubj)rM}rM(jUjjLjNjjj}rM(Uexprjj]j]j]j]j]ujNjhj]rMj!)rM}rM(jUj}rM(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ErrUrefidjMujjMj]r Mj)r!M}r"M(jUj}r#M(j]j]r$Mjaj]j]j]ujjMj]r%MjX[source]r&Mr'M}r(M(jUjj!Mubajjubajj%ubaubeubj)r)M}r*M(jUjjLjjLjjj}r+M(j]j]j]j]j]ujNjhj]ubeubj?)r,M}r-M(jUjjKjNjjCj}r.M(j]j]j]j]j]Uentries]r/M(jFX+get_error_reason() (in module M2Crypto.Err)hUNtr0MaujNjhj]ubjM)r1M}r2M(jUjjKjNjjPj}r3M(jRjSXpyj]j]j]j]j]jTXfunctionr4MjVj4MujNjhj]r5M(jX)r6M}r7M(jXget_error_reason(err)jj1MjXU/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.get_error_reasonr8Mjj\j}r9M(j]r:Mhaj_j`X M2Crypto.Errr;MrMhajeXget_error_reasonr?MjgUjhujNjhj]r@M(ju)rAM}rBM(jX M2Crypto.Err.jj6Mjj8Mjjxj}rCM(jojpj]j]j]j]j]ujNjhj]rDMjX M2Crypto.Err.rEMrFM}rGM(jUjNjNjhjjAMubaubj~)rHM}rIM(jj?Mjj6Mjj8Mjjj}rJM(jojpj]j]j]j]j]ujNjhj]rKMjXget_error_reasonrLMrMM}rNM(jUjNjNjhjjHMubaubj)rOM}rPM(jXerrjj6Mjj8Mjjj}rQM(jojpj]j]j]j]j]ujNjhj]rRMj)rSM}rTM(jXerrj}rUM(jojpj]j]j]j]j]ujjOMj]rVMjXerrrWMrXM}rYM(jUjjSMubajjubaubj)rZM}r[M(jUjj6MjNjjj}r\M(Uexprjj]j]j]j]j]ujNjhj]r]Mj!)r^M}r_M(jUj}r`M(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ErrUrefidj?MujjZMj]raMj)rbM}rcM(jUj}rdM(j]j]reMjaj]j]j]ujj^Mj]rfMjX[source]rgMrhM}riM(jUjjbMubajjubajj%ubaubeubj)rjM}rkM(jUjj1Mjj8Mjjj}rlM(j]j]j]j]j]ujNjhj]ubeubj?)rmM}rnM(jUjjKjNjjCj}roM(j]j]j]j]j]Uentries]rpM(jFX0get_x509_verify_error() (in module M2Crypto.Err)h^UNtrqMaujNjhj]ubjM)rrM}rsM(jUjjKjNjjPj}rtM(jRjSXpyj]j]j]j]j]jTXfunctionruMjVjuMujNjhj]rvM(jX)rwM}rxM(jXget_x509_verify_error(err)jjrMjXZ/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.get_x509_verify_errorryMjj\j}rzM(j]r{Mh^aj_j`X M2Crypto.Errr|Mr}M}r~Mbj]j]j]j]rMh^ajeXget_x509_verify_errorrMjgUjhujNjhj]rM(ju)rM}rM(jX M2Crypto.Err.jjwMjjyMjjxj}rM(jojpj]j]j]j]j]ujNjhj]rMjX M2Crypto.Err.rMrM}rM(jUjNjNjhjjMubaubj~)rM}rM(jjMjjwMjjyMjjj}rM(jojpj]j]j]j]j]ujNjhj]rMjXget_x509_verify_errorrMrM}rM(jUjNjNjhjjMubaubj)rM}rM(jXerrjjwMjjyMjjj}rM(jojpj]j]j]j]j]ujNjhj]rMj)rM}rM(jXerrj}rM(jojpj]j]j]j]j]ujjMj]rMjXerrrMrM}rM(jUjjMubajjubaubj)rM}rM(jUjjwMjNjjj}rM(Uexprjj]j]j]j]j]ujNjhj]rMj!)rM}rM(jUj}rM(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ErrUrefidjMujjMj]rMj)rM}rM(jUj}rM(j]j]rMjaj]j]j]ujjMj]rMjX[source]rMrM}rM(jUjjMubajjubajj%ubaubeubj)rM}rM(jUjjrMjjyMjjj}rM(j]j]j]j]j]ujNjhj]ubeubj?)rM}rM(jUjjKjNjjCj}rM(j]j]j]j]j]Uentries]rM(jFX*peek_error_code() (in module M2Crypto.Err)hUNtrMaujNjhj]ubjM)rM}rM(jUjjKjNjjPj}rM(jRjSXpyj]j]j]j]j]jTXfunctionrMjVjMujNjhj]rM(jX)rM}rM(jXpeek_error_code()jjMjXT/home/matej/Build/m2crypto/M2Crypto/Err.py:docstring of M2Crypto.Err.peek_error_coderMjj\j}rM(j]rMhaj_j`X M2Crypto.ErrrMrM}rMbj]j]j]j]rMhajeXpeek_error_coderMjgUjhujNjhj]rM(ju)rM}rM(jX M2Crypto.Err.jjMjjMjjxj}rM(jojpj]j]j]j]j]ujNjhj]rMjX M2Crypto.Err.rMrM}rM(jUjNjNjhjjMubaubj~)rM}rM(jjMjjMjjMjjj}rM(jojpj]j]j]j]j]ujNjhj]rMjXpeek_error_coderMrM}rM(jUjNjNjhjjMubaubj)rM}rM(jUjjMjjMjjj}rM(jojpj]j]j]j]j]ujNjhj]ubj)rM}rM(jUjjMjNjjj}rM(Uexprjj]j]j]j]j]ujNjhj]rMj!)rM}rM(jUj}rM(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ErrUrefidjMujjMj]rMj)rM}rM(jUj}rM(j]j]rMjaj]j]j]ujjMj]rMjX[source]rMrM}rM(jUjjMubajjubajj%ubaubeubj)rM}rM(jUjjMjjMjjj}rM(j]j]j]j]j]ujNjhj]ubeubeubj)rM}rM(jUjjjjjjj}rM(j]j]j]j]rM(Xmodule-M2Crypto.RC4rMU rc4-modulerMej]rMjaujK]jhj]rM(j )rM}rM(jX:mod:`RC4` ModulerMjjMjjjj j}rM(j]j]j]j]j]ujK]jhj]rM(j!)rM}rM(jX :mod:`RC4`rMjjMjjjj%j}rM(UreftypeXmodj'j(XRC4U refdomainXpyrMj]j]U refexplicitj]j]j]j*j+j,Nj-jKujK\j]rMj0)rM}rM(jjMj}rM(j]j]rM(j5jMXpy-modrMej]j]j]ujjMj]rMjXRC4rNrN}rN(jUjjMubajj;ubaubjX ModulerNrN}rN(jUjNjNjhjjMubeubj?)rN}rN(jUjjMjXH/home/matej/Build/m2crypto/M2Crypto/RC4.py:docstring of M2Crypto.RC4.RC4rNjjCj}r N(j]j]j]j]j]Uentries]r N(jFXM2Crypto.RC4 (module)Xmodule-M2Crypto.RC4UNtr NaujKjhj]ubj?)r N}r N(jUjjMjNjjCj}rN(j]j]j]j]j]Uentries]rN(jFXRC4 (class in M2Crypto.RC4)jUNtrNaujNjhj]ubjM)rN}rN(jUjjMjNjjPj}rN(jRjSXpyj]j]j]j]j]jTXclassrNjVjNujNjhj]rN(jX)rN}rN(jX RC4(key=None)jjNjXH/home/matej/Build/m2crypto/M2Crypto/RC4.py:docstring of M2Crypto.RC4.RC4rNjj\j}rN(j]rNjaj_j`X M2Crypto.RC4rNrN}rNbj]j]j]j]rNjajeXRC4rNjgUjhujNjhj]r N(jj)r!N}r"N(jXclass jjNjjNjjmj}r#N(jojpj]j]j]j]j]ujNjhj]r$NjXclass r%Nr&N}r'N(jUjNjNjhjj!Nubaubju)r(N}r)N(jX M2Crypto.RC4.jjNjjNjjxj}r*N(jojpj]j]j]j]j]ujNjhj]r+NjX M2Crypto.RC4.r,Nr-N}r.N(jUjNjNjhjj(Nubaubj~)r/N}r0N(jjNjjNjjNjjj}r1N(jojpj]j]j]j]j]ujNjhj]r2NjXRC4r3Nr4N}r5N(jUjNjNjhjj/Nubaubj)r6N}r7N(jXkey=NonejjNjjNjjj}r8N(jojpj]j]j]j]j]ujNjhj]r9Nj)r:N}r;N(jXkey=Nonej}rNr?N}r@N(jUjj:Nubajjubaubj)rAN}rBN(jUjjNjNjjj}rCN(Uexprjj]j]j]j]j]ujNjhj]rDNj!)rEN}rFN(jUj}rGN(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RC4UrefidjNujjANj]rHNj)rIN}rJN(jUj}rKN(j]j]rLNjaj]j]j]ujjENj]rMNjX[source]rNNrON}rPN(jUjjINubajjubajj%ubaubeubj)rQN}rRN(jUjjNjjNjjj}rSN(j]j]j]j]j]ujNjhj]rTN(j)rUN}rVN(jX*Object interface to the stream cipher RC4.jjQNjXH/home/matej/Build/m2crypto/M2Crypto/RC4.py:docstring of M2Crypto.RC4.RC4jjj}rWN(j]j]j]j]j]ujKjhj]rXNjX*Object interface to the stream cipher RC4.rYNrZN}r[N(jUjNjNjhjjUNubaubj?)r\N}r]N(jUjjQNjNjjCj}r^N(j]j]j]j]j]Uentries]r_N(jFX!final() (M2Crypto.RC4.RC4 method)jUNtr`NaujNjhj]ubjM)raN}rbN(jUjjQNjNjjPj}rcN(jRjSXpyj]j]j]j]j]jTXmethodrdNjVjdNujNjhj]reN(jX)rfN}rgN(jX RC4.final()jjaNjXN/home/matej/Build/m2crypto/M2Crypto/RC4.py:docstring of M2Crypto.RC4.RC4.finalrhNjj\j}riN(j]rjNjaj_j`X M2Crypto.RC4rkNrlN}rmNbj]j]j]j]rnNjajeX RC4.finalroNjgjNjhujNjhj]rpN(j~)rqN}rrN(jXfinaljjfNjjhNjjj}rsN(jojpj]j]j]j]j]ujNjhj]rtNjXfinalruNrvN}rwN(jUjNjNjhjjqNubaubj)rxN}ryN(jUjjfNjjhNjjj}rzN(jojpj]j]j]j]j]ujNjhj]ubj)r{N}r|N(jUjjfNjNjjj}r}N(Uexprjj]j]j]j]j]ujNjhj]r~Nj!)rN}rN(jUj}rN(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RC4UrefidjoNujj{Nj]rNj)rN}rN(jUj}rN(j]j]rNjaj]j]j]ujjNj]rNjX[source]rNrN}rN(jUjjNubajjubajj%ubaubeubj)rN}rN(jUjjaNjjhNjjj}rN(j]j]j]j]j]ujNjhj]ubeubj?)rN}rN(jUjjQNjNjjCj}rN(j]j]j]j]j]Uentries]rN(jFX$rc4_free() (M2Crypto.RC4.RC4 method)hUNtrNaujNjhj]ubjM)rN}rN(jUjjQNjNjjPj}rN(jRjSXpyj]j]j]j]j]jTXmethodrNjVjNujNjhj]rN(jX)rN}rN(jX RC4.rc4_freejjNjXQ/home/matej/Build/m2crypto/M2Crypto/RC4.py:docstring of M2Crypto.RC4.RC4.rc4_freerNjj\j}rN(j]rNhaj_j`X M2Crypto.RC4rNrN}rNbj]j]j]j]rNhajeX RC4.rc4_freejgjNjhujNjhj]rN(j~)rN}rN(jXrc4_freejjNjjNjjj}rN(jojpj]j]j]j]j]ujNjhj]rNjXrc4_freerNrN}rN(jUjNjNjhjjNubaubj)rN}rN(jUjjNjjNjjj}rN(jojpj]j]j]j]j]ujNjhj]ubeubj)rN}rN(jUjjNjjNjjj}rN(j]j]j]j]j]ujNjhj]ubeubj?)rN}rN(jUjjQNjNjjCj}rN(j]j]j]j]j]Uentries]rN(jFX#set_key() (M2Crypto.RC4.RC4 method)j*UNtrNaujNjhj]ubjM)rN}rN(jUjjQNjNjjPj}rN(jRjSXpyj]j]j]j]j]jTXmethodrNjVjNujNjhj]rN(jX)rN}rN(jXRC4.set_key(key)jjNjXP/home/matej/Build/m2crypto/M2Crypto/RC4.py:docstring of M2Crypto.RC4.RC4.set_keyrNjj\j}rN(j]rNj*aj_j`X M2Crypto.RC4rNrN}rNbj]j]j]j]rNj*ajeX RC4.set_keyrNjgjNjhujNjhj]rN(j~)rN}rN(jXset_keyjjNjjNjjj}rN(jojpj]j]j]j]j]ujNjhj]rNjXset_keyrNrN}rN(jUjNjNjhjjNubaubj)rN}rN(jXkeyjjNjjNjjj}rN(jojpj]j]j]j]j]ujNjhj]rNj)rN}rN(jXkeyj}rN(jojpj]j]j]j]j]ujjNj]rNjXkeyrNrN}rN(jUjjNubajjubaubj)rN}rN(jUjjNjNjjj}rN(Uexprjj]j]j]j]j]ujNjhj]rNj!)rN}rN(jUj}rN(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RC4UrefidjNujjNj]rNj)rN}rN(jUj}rN(j]j]rNjaj]j]j]ujjNj]rNjX[source]rNrN}rN(jUjjNubajjubajj%ubaubeubj)rN}rN(jUjjNjjNjjj}rN(j]j]j]j]j]ujNjhj]ubeubj?)rN}rN(jUjjQNjNjjCj}rN(j]j]j]j]j]Uentries]rN(jFX"update() (M2Crypto.RC4.RC4 method)jOUNtrNaujNjhj]ubjM)rN}rN(jUjjQNjNjjPj}rN(jRjSXpyj]j]j]j]j]jTXmethodrNjVjNujNjhj]rN(jX)rN}rN(jXRC4.update(data)jjNjXO/home/matej/Build/m2crypto/M2Crypto/RC4.py:docstring of M2Crypto.RC4.RC4.updaterNjj\j}rN(j]rNjOaj_j`X M2Crypto.RC4rNrN}rNbj]j]j]j]rNjOajeX RC4.updaterNjgjNjhujNjhj]rN(j~)rN}rN(jXupdatejjNjjNjjj}rO(jojpj]j]j]j]j]ujNjhj]rOjXupdaterOrO}rO(jUjNjNjhjjNubaubj)rO}rO(jXdatajjNjjNjjj}rO(jojpj]j]j]j]j]ujNjhj]rOj)r O}r O(jXdataj}r O(jojpj]j]j]j]j]ujjOj]r OjXdatar OrO}rO(jUjj Oubajjubaubj)rO}rO(jUjjNjNjjj}rO(Uexprjj]j]j]j]j]ujNjhj]rOj!)rO}rO(jUj}rO(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RC4UrefidjNujjOj]rOj)rO}rO(jUj}rO(j]j]rOjaj]j]j]ujjOj]rOjX[source]rOrO}rO(jUjjOubajjubajj%ubaubeubj)r O}r!O(jUjjNjjNjjj}r"O(j]j]j]j]j]ujNjhj]ubeubeubeubeubj)r#O}r$O(jUjjjjjjj}r%O(j]j]j]j]r&O(Xmodule-M2Crypto.RSAr'OU rsa-moduler(Oej]r)Oj{aujKejhj]r*O(j )r+O}r,O(jX:mod:`RSA` Moduler-Ojj#Ojjjj j}r.O(j]j]j]j]j]ujKejhj]r/O(j!)r0O}r1O(jX :mod:`RSA`r2Ojj+Ojjjj%j}r3O(UreftypeXmodj'j(XRSAU refdomainXpyr4Oj]j]U refexplicitj]j]j]j*j+j,Nj-X M2Crypto.RC4r5OujKdj]r6Oj0)r7O}r8O(jj2Oj}r9O(j]j]r:O(j5j4OXpy-modr;Oej]j]j]ujj0Oj]rO}r?O(jUjj7Oubajj;ubaubjX Moduler@OrAO}rBO(jUjNjNjhjj+Oubeubj?)rCO}rDO(jUjj#OjXH/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSArEOjjCj}rFO(j]j]j]j]j]Uentries]rGO(jFXM2Crypto.RSA (module)Xmodule-M2Crypto.RSAUNtrHOaujKjhj]ubj?)rIO}rJO(jUjj#OjNjjCj}rKO(j]j]j]j]j]Uentries]rLO(jFXRSA (class in M2Crypto.RSA)h7UNtrMOaujNjhj]ubjM)rNO}rOO(jUjj#OjNjjPj}rPO(jRjSXpyj]j]j]j]j]jTXclassrQOjVjQOujNjhj]rRO(jX)rSO}rTO(jXRSA(rsa, _pyfree=0)jjNOjXH/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSArUOjj\j}rVO(j]rWOh7aj_j`X M2Crypto.RSArXOrYO}rZObj]j]j]j]r[Oh7ajeXRSAr\OjgUjhujNjhj]r]O(jj)r^O}r_O(jXclass jjSOjjUOjjmj}r`O(jojpj]j]j]j]j]ujNjhj]raOjXclass rbOrcO}rdO(jUjNjNjhjj^Oubaubju)reO}rfO(jX M2Crypto.RSA.jjSOjjUOjjxj}rgO(jojpj]j]j]j]j]ujNjhj]rhOjX M2Crypto.RSA.riOrjO}rkO(jUjNjNjhjjeOubaubj~)rlO}rmO(jj\OjjSOjjUOjjj}rnO(jojpj]j]j]j]j]ujNjhj]roOjXRSArpOrqO}rrO(jUjNjNjhjjlOubaubj)rsO}rtO(jXrsa, _pyfree=0jjSOjjUOjjj}ruO(jojpj]j]j]j]j]ujNjhj]rvO(j)rwO}rxO(jXrsaj}ryO(jojpj]j]j]j]j]ujjsOj]rzOjXrsar{Or|O}r}O(jUjjwOubajjubj)r~O}rO(jX _pyfree=0j}rO(jojpj]j]j]j]j]ujjsOj]rOjX _pyfree=0rOrO}rO(jUjj~Oubajjubeubj)rO}rO(jUjjSOjNjjj}rO(Uexprjj]j]j]j]j]ujNjhj]rOj!)rO}rO(jUj}rO(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj\OujjOj]rOj)rO}rO(jUj}rO(j]j]rOjaj]j]j]ujjOj]rOjX[source]rOrO}rO(jUjjOubajjubajj%ubaubeubj)rO}rO(jUjjNOjjUOjjj}rO(j]j]j]j]j]ujNjhj]rO(j)rO}rO(jX RSA Key Pair.jjOjXH/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSAjjj}rO(j]j]j]j]j]ujKjhj]rOjX RSA Key Pair.rOrO}rO(jUjNjNjhjjOubaubj?)rO}rO(jUjjOjXO/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.as_pemrOjjCj}rO(j]j]j]j]j]Uentries]rO(jFX"as_pem() (M2Crypto.RSA.RSA method)hUNtrOaujNjhj]ubjM)rO}rO(jUjjOjjOjjPj}rO(jRjSXpyj]j]j]j]j]jTXmethodrOjVjOujNjhj]rO(jX)rO}rO(jXIRSA.as_pem(cipher='aes_128_cbc', callback=)jjOjXO/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.as_pemrOjj\j}rO(j]rOhaj_j`X M2Crypto.RSArOrO}rObj]j]j]j]rOhajeX RSA.as_pemrOjgj\OjhujNjhj]rO(j~)rO}rO(jXas_pemjjOjjOjjj}rO(jojpj]j]j]j]j]ujNjhj]rOjXas_pemrOrO}rO(jUjNjNjhjjOubaubj)rO}rO(jX=cipher='aes_128_cbc', callback=jjOjjOjjj}rO(jojpj]j]j]j]j]ujNjhj]rO(j)rO}rO(jXcipher='aes_128_cbc'j}rO(jojpj]j]j]j]j]ujjOj]rOjXcipher='aes_128_cbc'rOrO}rO(jUjjOubajjubj)rO}rO(jX'callback=j}rO(jojpj]j]j]j]j]ujjOj]rOjX'callback=rOrO}rO(jUjjOubajjubeubj)rO}rO(jUjjOjNjjj}rO(Uexprjj]j]j]j]j]ujNjhj]rOj!)rO}rO(jUj}rO(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjOujjOj]rOj)rO}rO(jUj}rO(j]j]rOjaj]j]j]ujjOj]rOjX[source]rOrO}rO(jUjjOubajjubajj%ubaubeubj)rO}rO(jUjjOjjOjjj}rO(j]j]j]j]j]ujNjhj]rOj)rO}rO(jX0Returns the key(pair) as a string in PEM format.jjOjjOjjj}rO(j]j]j]j]j]ujKjhj]rOjX0Returns the key(pair) as a string in PEM format.rOrO}rO(jUjNjNjhjjOubaubaubeubj?)rO}rO(jUjjOjNjjCj}rO(j]j]j]j]j]Uentries]rO(jFX%check_key() (M2Crypto.RSA.RSA method)hHUNtrOaujNjhj]ubjM)rO}rO(jUjjOjNjjPj}rO(jRjSXpyj]j]j]j]j]jTXmethodrOjVjOujNjhj]rO(jX)rO}rO(jXRSA.check_key()jjOjXR/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.check_keyrOjj\j}rO(j]rOhHaj_j`X M2Crypto.RSArOrO}rObj]j]j]j]rOhHajeX RSA.check_keyrOjgj\OjhujNjhj]rO(j~)rO}rP(jX check_keyjjOjjOjjj}rP(jojpj]j]j]j]j]ujNjhj]rPjX check_keyrPrP}rP(jUjNjNjhjjOubaubj)rP}rP(jUjjOjjOjjj}rP(jojpj]j]j]j]j]ujNjhj]ubj)r P}r P(jUjjOjNjjj}r P(Uexprjj]j]j]j]j]ujNjhj]r Pj!)r P}rP(jUj}rP(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjOujj Pj]rPj)rP}rP(jUj}rP(j]j]rPjaj]j]j]ujj Pj]rPjX[source]rPrP}rP(jUjjPubajjubajj%ubaubeubj)rP}rP(jUjjOjjOjjj}rP(j]j]j]j]j]ujNjhj]rPj)rP}rP(jUjjPjNjjj}rP(j]j]j]j]j]ujNjhj]r Pj)r!P}r"P(jUj}r#P(j]j]j]j]j]ujjPj]r$P(j)r%P}r&P(jXReturnsjj!PjjOjjj}r'P(j]j]j]j]j]ujKj]r(PjXReturnsr)Pr*P}r+P(jUjj%Pubaubj)r,P}r-P(jUj}r.P(j]j]j]j]j]ujj!Pj]r/Pj)r0P}r1P(jXreturns 1 if rsa is a valid RSA key, and 0 otherwise. -1 is returned if an error occurs while checking the key. If the key is invalid or an error occurred, the reason code can be obtained using ERR_get_error(3).j}r2P(j]j]j]j]j]ujj,Pj]r3PjXreturns 1 if rsa is a valid RSA key, and 0 otherwise. -1 is returned if an error occurs while checking the key. If the key is invalid or an error occurred, the reason code can be obtained using ERR_get_error(3).r4Pr5P}r6P(jUjNjNjhjj0Pubajjubajjubejjubaubaubeubj?)r7P}r8P(jUjjOjNjjCj}r9P(j]j]j]j]j]Uentries]r:P(jFX'm2_rsa_free() (M2Crypto.RSA.RSA method)j\UNtr;PaujNjhj]ubjM)rP(jRjSXpyj]j]j]j]j]jTXmethodr?PjVj?PujNjhj]r@P(jX)rAP}rBP(jXRSA.m2_rsa_freejjQ}r?Q(jUj}r@Q(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjQujj:Qj]rAQj)rBQ}rCQ(jUj}rDQ(j]j]rEQjaj]j]j]ujj>Qj]rFQjX[source]rGQrHQ}rIQ(jUjjBQubajjubajj%ubaubeubj)rJQ}rKQ(jUjjQjjQjjj}rLQ(j]j]j]j]j]ujNjhj]ubeubj?)rMQ}rNQ(jUjjOjNjjCj}rOQ(j]j]j]j]j]Uentries]rPQ(jFX*public_encrypt() (M2Crypto.RSA.RSA method)hUNtrQQaujNjhj]ubjM)rRQ}rSQ(jUjjOjNjjPj}rTQ(jRjSXpyj]j]j]j]j]jTXmethodrUQjVjUQujNjhj]rVQ(jX)rWQ}rXQ(jX!RSA.public_encrypt(data, padding)jjRQjXW/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.public_encryptrYQjj\j}rZQ(j]r[Qhaj_j`X M2Crypto.RSAr\Qr]Q}r^Qbj]j]j]j]r_QhajeXRSA.public_encryptr`Qjgj\OjhujNjhj]raQ(j~)rbQ}rcQ(jXpublic_encryptjjWQjjYQjjj}rdQ(jojpj]j]j]j]j]ujNjhj]reQjXpublic_encryptrfQrgQ}rhQ(jUjNjNjhjjbQubaubj)riQ}rjQ(jX data, paddingjjWQjjYQjjj}rkQ(jojpj]j]j]j]j]ujNjhj]rlQ(j)rmQ}rnQ(jXdataj}roQ(jojpj]j]j]j]j]ujjiQj]rpQjXdatarqQrrQ}rsQ(jUjjmQubajjubj)rtQ}ruQ(jXpaddingj}rvQ(jojpj]j]j]j]j]ujjiQj]rwQjXpaddingrxQryQ}rzQ(jUjjtQubajjubeubj)r{Q}r|Q(jUjjWQjNjjj}r}Q(Uexprjj]j]j]j]j]ujNjhj]r~Qj!)rQ}rQ(jUj}rQ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj`Qujj{Qj]rQj)rQ}rQ(jUj}rQ(j]j]rQjaj]j]j]ujjQj]rQjX[source]rQrQ}rQ(jUjjQubajjubajj%ubaubeubj)rQ}rQ(jUjjRQjjYQjjj}rQ(j]j]j]j]j]ujNjhj]ubeubj?)rQ}rQ(jUjjOjNjjCj}rQ(j]j]j]j]j]Uentries]rQ(jFX$save_key() (M2Crypto.RSA.RSA method)jYUNtrQaujNjhj]ubjM)rQ}rQ(jUjjOjNjjPj}rQ(jRjSXpyj]j]j]j]j]jTXmethodrQjVjQujNjhj]rQ(jX)rQ}rQ(jXQRSA.save_key(file, cipher='aes_128_cbc', callback=)jjQjXQ/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_keyrQjj\j}rQ(j]rQjYaj_j`X M2Crypto.RSArQrQ}rQbj]j]j]j]rQjYajeX RSA.save_keyrQjgj\OjhujNjhj]rQ(j~)rQ}rQ(jXsave_keyjjQjjQjjj}rQ(jojpj]j]j]j]j]ujNjhj]rQjXsave_keyrQrQ}rQ(jUjNjNjhjjQubaubj)rQ}rQ(jXCfile, cipher='aes_128_cbc', callback=jjQjjQjjj}rQ(jojpj]j]j]j]j]ujNjhj]rQ(j)rQ}rQ(jXfilej}rQ(jojpj]j]j]j]j]ujjQj]rQjXfilerQrQ}rQ(jUjjQubajjubj)rQ}rQ(jXcipher='aes_128_cbc'j}rQ(jojpj]j]j]j]j]ujjQj]rQjXcipher='aes_128_cbc'rQrQ}rQ(jUjjQubajjubj)rQ}rQ(jX'callback=j}rQ(jojpj]j]j]j]j]ujjQj]rQjX'callback=rQrQ}rQ(jUjjQubajjubeubj)rQ}rQ(jUjjQjNjjj}rQ(Uexprjj]j]j]j]j]ujNjhj]rQj!)rQ}rQ(jUj}rQ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjQujjQj]rQj)rQ}rQ(jUj}rQ(j]j]rQjaj]j]j]ujjQj]rQjX[source]rQrQ}rQ(jUjjQubajjubajj%ubaubeubj)rQ}rQ(jUjjQjjQjjj}rQ(j]j]j]j]j]ujNjhj]rQ(j)rQ}rQ(jX*Save the key pair to a file in PEM format.jjQjXQ/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_keyjjj}rQ(j]j]j]j]j]ujKjhj]rQjX*Save the key pair to a file in PEM format.rQrQ}rQ(jUjNjNjhjjQubaubj)rQ}rQ(jUjjQjNjjj}rQ(j]j]j]j]j]ujNjhj]rQj)rQ}rQ(jUj}rQ(j]j]j]j]j]ujjQj]rQ(j)rQ}rQ(jX ParametersjjQjjQjjj}rQ(j]j]j]j]j]ujKj]rQjX ParametersrQrQ}rQ(jUjjQubaubj)rQ}rQ(jUj}rQ(j]j]j]j]j]ujjQj]rQj^ )rQ}rQ(jUj}rQ(j]j]j]j]j]ujjQj]rQ(jc )rQ}rQ(jUj}rQ(j]j]j]j]j]ujjQj]rQj)rQ}rQ(jX$file -- Name of file to save key to.j}rQ(j]j]j]j]j]ujjQj]rQ(j)rQ}rQ(jXfilej}rQ(j]j]jj]j]j]ujjQj]rRjXfilerRrR}rR(jUjjQubajjubjX – rRrR}rR(jUjjQubjXName of file to save key to.rRrR}r R(jUjNjNjhjjQubejjubajjy ubjc )r R}r R(jUj}r R(j]j]j]j]j]ujjQj]r Rj)rR}rR(jXcipher -- Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear.j}rR(j]j]j]j]j]ujj Rj]rR(j)rR}rR(jXcipherj}rR(j]j]jj]j]j]ujjRj]rRjXcipherrRrR}rR(jUjjRubajjubjX – rRrR}rR(jUjjRubjXSymmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then the key is saved in the clear.rRrR}rR(jUjNjNjhjjRubejjubajjy ubjc )rR}r R(jUj}r!R(j]j]j]j]j]ujjQj]r"Rj)r#R}r$R(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.j}r%R(j]j]j]j]j]ujjRj]r&R(j)r'R}r(R(jXcallbackj}r)R(j]j]jj]j]j]ujj#Rj]r*RjXcallbackr+Rr,R}r-R(jUjj'RubajjubjX – r.Rr/R}r0R(jUjj#RubjXA Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.r1Rr2R}r3R(jUjNjNjhjj#Rubejjubajjy ubejj ubajjubejjubaubeubeubj?)r4R}r5R(jUjjOjNjjCj}r6R(j]j]j]j]j]Uentries]r7R(jFX(save_key_bio() (M2Crypto.RSA.RSA method)hUNtr8RaujNjhj]ubjM)r9R}r:R(jUjjOjNjjPj}r;R(jRjSXpyj]j]j]j]j]jTXmethodrR}r?R(jXTRSA.save_key_bio(bio, cipher='aes_128_cbc', callback=)jj9RjXU/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_key_bior@Rjj\j}rAR(j]rBRhaj_j`X M2Crypto.RSArCRrDR}rERbj]j]j]j]rFRhajeXRSA.save_key_biorGRjgj\OjhujNjhj]rHR(j~)rIR}rJR(jX save_key_biojj>Rjj@Rjjj}rKR(jojpj]j]j]j]j]ujNjhj]rLRjX save_key_biorMRrNR}rOR(jUjNjNjhjjIRubaubj)rPR}rQR(jXBbio, cipher='aes_128_cbc', callback=jj>Rjj@Rjjj}rRR(jojpj]j]j]j]j]ujNjhj]rSR(j)rTR}rUR(jXbioj}rVR(jojpj]j]j]j]j]ujjPRj]rWRjXbiorXRrYR}rZR(jUjjTRubajjubj)r[R}r\R(jXcipher='aes_128_cbc'j}r]R(jojpj]j]j]j]j]ujjPRj]r^RjXcipher='aes_128_cbc'r_Rr`R}raR(jUjj[Rubajjubj)rbR}rcR(jX'callback=j}rdR(jojpj]j]j]j]j]ujjPRj]reRjX'callback=rfRrgR}rhR(jUjjbRubajjubeubj)riR}rjR(jUjj>RjNjjj}rkR(Uexprjj]j]j]j]j]ujNjhj]rlRj!)rmR}rnR(jUj}roR(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjGRujjiRj]rpRj)rqR}rrR(jUj}rsR(j]j]rtRjaj]j]j]ujjmRj]ruRjX[source]rvRrwR}rxR(jUjjqRubajjubajj%ubaubeubj)ryR}rzR(jUjj9Rjj@Rjjj}r{R(j]j]j]j]j]ujNjhj]r|R(j)r}R}r~R(jX>Save the key pair to an M2Crypto.BIO.BIO object in PEM format.jjyRjXU/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_key_biojjj}rR(j]j]j]j]j]ujKjhj]rRjX>Save the key pair to an M2Crypto.BIO.BIO object in PEM format.rRrR}rR(jUjNjNjhjj}Rubaubj)rR}rR(jUjjyRjNjjj}rR(j]j]j]j]j]ujNjhj]rRj)rR}rR(jUj}rR(j]j]j]j]j]ujjRj]rR(j)rR}rR(jX ParametersjjRjj@Rjjj}rR(j]j]j]j]j]ujKj]rRjX ParametersrRrR}rR(jUjjRubaubj)rR}rR(jUj}rR(j]j]j]j]j]ujjRj]rRj^ )rR}rR(jUj}rR(j]j]j]j]j]ujjRj]rR(jc )rR}rR(jUj}rR(j]j]j]j]j]ujjRj]rRj)rR}rR(jX.bio -- M2Crypto.BIO.BIO object to save key to.j}rR(j]j]j]j]j]ujjRj]rR(j)rR}rR(jXbioj}rR(j]j]jj]j]j]ujjRj]rRjXbiorRrR}rR(jUjjRubajjubjX – rRrR}rR(jUjjRubjX'M2Crypto.BIO.BIO object to save key to.rRrR}rR(jUjNjNjhjjRubejjubajjy ubjc )rR}rR(jUj}rR(j]j]j]j]j]ujjRj]rRj)rR}rR(jXcipher -- Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear.j}rR(j]j]j]j]j]ujjRj]rR(j)rR}rR(jXcipherj}rR(j]j]jj]j]j]ujjRj]rRjXcipherrRrR}rR(jUjjRubajjubjX – rRrR}rR(jUjjRubjXSymmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then the key is saved in the clear.rRrR}rR(jUjNjNjhjjRubejjubajjy ubjc )rR}rR(jUj}rR(j]j]j]j]j]ujjRj]rRj)rR}rR(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.j}rR(j]j]j]j]j]ujjRj]rR(j)rR}rR(jXcallbackj}rR(j]j]jj]j]j]ujjRj]rRjXcallbackrRrR}rR(jUjjRubajjubjX – rRrR}rR(jUjjRubjXA Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.rRrR}rR(jUjNjNjhjjRubejjubajjy ubejj ubajjubejjubaubeubeubj?)rR}rR(jUjjOjNjjCj}rR(j]j]j]j]j]Uentries]rR(jFX(save_key_der() (M2Crypto.RSA.RSA method)h!UNtrRaujNjhj]ubjM)rR}rR(jUjjOjNjjPj}rR(jRjSXpyj]j]j]j]j]jTXmethodrRjVjRujNjhj]rR(jX)rR}rR(jXRSA.save_key_der(file)jjRjXU/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_key_derrRjj\j}rR(j]rRh!aj_j`X M2Crypto.RSArRrR}rRbj]j]j]j]rRh!ajeXRSA.save_key_derrRjgj\OjhujNjhj]rR(j~)rR}rR(jX save_key_derjjRjjRjjj}rR(jojpj]j]j]j]j]ujNjhj]rRjX save_key_derrRrR}rR(jUjNjNjhjjRubaubj)rR}rR(jXfilejjRjjRjjj}rR(jojpj]j]j]j]j]ujNjhj]rRj)rR}rR(jXfilej}rR(jojpj]j]j]j]j]ujjRj]rRjXfilerRrR}rS(jUjjRubajjubaubj)rS}rS(jUjjRjNjjj}rS(Uexprjj]j]j]j]j]ujNjhj]rSj!)rS}rS(jUj}rS(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjRujjSj]rSj)r S}r S(jUj}r S(j]j]r Sjaj]j]j]ujjSj]r SjX[source]rSrS}rS(jUjj Subajjubajj%ubaubeubj)rS}rS(jUjjRjjRjjj}rS(j]j]j]j]j]ujNjhj]rS(j)rS}rS(jX*Save the key pair to a file in DER format.jjSjXU/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_key_derjjj}rS(j]j]j]j]j]ujKjhj]rSjX*Save the key pair to a file in DER format.rSrS}rS(jUjNjNjhjjSubaubj)rS}rS(jUjjSjNjjj}rS(j]j]j]j]j]ujNjhj]rSj)r S}r!S(jUj}r"S(j]j]j]j]j]ujjSj]r#S(j)r$S}r%S(jX Parametersjj SjjRjjj}r&S(j]j]j]j]j]ujKj]r'SjX Parametersr(Sr)S}r*S(jUjj$Subaubj)r+S}r,S(jUj}r-S(j]j]j]j]j]ujj Sj]r.Sj)r/S}r0S(jXfile -- Filename to save key toj}r1S(j]j]j]j]j]ujj+Sj]r2S(j)r3S}r4S(jXfilej}r5S(j]j]jj]j]j]ujj/Sj]r6SjXfiler7Sr8S}r9S(jUjj3SubajjubjX – r:Sr;S}rS}r?S(jUjNjNjhjj/Subejjubajjubejjubaubeubeubj?)r@S}rAS(jUjjOjNjjCj}rBS(j]j]j]j]j]Uentries]rCS(jFX,save_key_der_bio() (M2Crypto.RSA.RSA method)jUNtrDSaujNjhj]ubjM)rES}rFS(jUjjOjNjjPj}rGS(jRjSXpyj]j]j]j]j]jTXmethodrHSjVjHSujNjhj]rIS(jX)rJS}rKS(jXRSA.save_key_der_bio(bio)jjESjXY/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_key_der_biorLSjj\j}rMS(j]rNSjaj_j`X M2Crypto.RSArOSrPS}rQSbj]j]j]j]rRSjajeXRSA.save_key_der_biorSSjgj\OjhujNjhj]rTS(j~)rUS}rVS(jXsave_key_der_biojjJSjjLSjjj}rWS(jojpj]j]j]j]j]ujNjhj]rXSjXsave_key_der_biorYSrZS}r[S(jUjNjNjhjjUSubaubj)r\S}r]S(jXbiojjJSjjLSjjj}r^S(jojpj]j]j]j]j]ujNjhj]r_Sj)r`S}raS(jXbioj}rbS(jojpj]j]j]j]j]ujj\Sj]rcSjXbiordSreS}rfS(jUjj`Subajjubaubj)rgS}rhS(jUjjJSjNjjj}riS(Uexprjj]j]j]j]j]ujNjhj]rjSj!)rkS}rlS(jUj}rmS(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjSSujjgSj]rnSj)roS}rpS(jUj}rqS(j]j]rrSjaj]j]j]ujjkSj]rsSjX[source]rtSruS}rvS(jUjjoSubajjubajj%ubaubeubj)rwS}rxS(jUjjESjjLSjjj}ryS(j]j]j]j]j]ujNjhj]rzS(j)r{S}r|S(jX>Save the key pair to an M2Crypto.BIO.BIO object in DER format.jjwSjXY/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_key_der_biojjj}r}S(j]j]j]j]j]ujKjhj]r~SjX>Save the key pair to an M2Crypto.BIO.BIO object in DER format.rSrS}rS(jUjNjNjhjj{Subaubj)rS}rS(jUjjwSjNjjj}rS(j]j]j]j]j]ujNjhj]rSj)rS}rS(jUj}rS(j]j]j]j]j]ujjSj]rS(j)rS}rS(jX ParametersjjSjjLSjjj}rS(j]j]j]j]j]ujKj]rSjX ParametersrSrS}rS(jUjjSubaubj)rS}rS(jUj}rS(j]j]j]j]j]ujjSj]rSj)rS}rS(jX.bio -- M2Crypto.BIO.BIO object to save key to.j}rS(j]j]j]j]j]ujjSj]rS(j)rS}rS(jXbioj}rS(j]j]jj]j]j]ujjSj]rSjXbiorSrS}rS(jUjjSubajjubjX – rSrS}rS(jUjjSubjX'M2Crypto.BIO.BIO object to save key to.rSrS}rS(jUjNjNjhjjSubejjubajjubejjubaubeubeubj?)rS}rS(jUjjOjNjjCj}rS(j]j]j]j]j]Uentries]rS(jFX$save_pem() (M2Crypto.RSA.RSA method)jUNtrSaujNjhj]ubjM)rS}rS(jUjjOjNjjPj}rS(jRjSXpyj]j]j]j]j]jTXmethodrSjVjSujNjhj]rS(jX)rS}rS(jXQRSA.save_pem(file, cipher='aes_128_cbc', callback=)jjSjXQ/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_pemrSjj\j}rS(j]rSjaj_j`X M2Crypto.RSArSrS}rSbj]j]j]j]rSjajeX RSA.save_pemjgj\OjhujNjhj]rS(j~)rS}rS(jXsave_pemjjSjjSjjj}rS(jojpj]j]j]j]j]ujNjhj]rSjXsave_pemrSrS}rS(jUjNjNjhjjSubaubj)rS}rS(jXCfile, cipher='aes_128_cbc', callback=jjSjjSjjj}rS(jojpj]j]j]j]j]ujNjhj]rS(j)rS}rS(jXfilej}rS(jojpj]j]j]j]j]ujjSj]rSjXfilerSrS}rS(jUjjSubajjubj)rS}rS(jXcipher='aes_128_cbc'j}rS(jojpj]j]j]j]j]ujjSj]rSjXcipher='aes_128_cbc'rSrS}rS(jUjjSubajjubj)rS}rS(jX'callback=j}rS(jojpj]j]j]j]j]ujjSj]rSjX'callback=rSrS}rS(jUjjSubajjubeubeubj)rS}rS(jUjjSjjSjjj}rS(j]j]j]j]j]ujNjhj]rS(j)rS}rS(jX*Save the key pair to a file in PEM format.jjSjXQ/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_pemjjj}rS(j]j]j]j]j]ujKjhj]rSjX*Save the key pair to a file in PEM format.rSrS}rS(jUjNjNjhjjSubaubj)rS}rS(jUjjSjNjjj}rS(j]j]j]j]j]ujNjhj]rSj)rS}rS(jUj}rS(j]j]j]j]j]ujjSj]rS(j)rS}rS(jX ParametersjjSjjSjjj}rS(j]j]j]j]j]ujKj]rSjX ParametersrSrS}rS(jUjjSubaubj)rS}rS(jUj}rS(j]j]j]j]j]ujjSj]rSj^ )rS}rS(jUj}rS(j]j]j]j]j]ujjSj]rS(jc )rS}rS(jUj}rS(j]j]j]j]j]ujjSj]rSj)rT}rT(jX$file -- Name of file to save key to.j}rT(j]j]j]j]j]ujjSj]rT(j)rT}rT(jXfilej}rT(j]j]jj]j]j]ujjTj]rTjXfilerTr T}r T(jUjjTubajjubjX – r Tr T}r T(jUjjTubjXName of file to save key to.rTrT}rT(jUjNjNjhjjTubejjubajjy ubjc )rT}rT(jUj}rT(j]j]j]j]j]ujjSj]rTj)rT}rT(jXcipher -- Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear.j}rT(j]j]j]j]j]ujjTj]rT(j)rT}rT(jXcipherj}rT(j]j]jj]j]j]ujjTj]rTjXcipherrTrT}rT(jUjjTubajjubjX – r Tr!T}r"T(jUjjTubjXSymmetric cipher to protect the key. The default cipher is ‘aes_128_cbc’. If cipher is None, then the key is saved in the clear.r#Tr$T}r%T(jUjNjNjhjjTubejjubajjy ubjc )r&T}r'T(jUj}r(T(j]j]j]j]j]ujjSj]r)Tj)r*T}r+T(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.j}r,T(j]j]j]j]j]ujj&Tj]r-T(j)r.T}r/T(jXcallbackj}r0T(j]j]jj]j]j]ujj*Tj]r1TjXcallbackr2Tr3T}r4T(jUjj.TubajjubjX – r5Tr6T}r7T(jUjj*TubjXA Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback.r8Tr9T}r:T(jUjNjNjhjj*Tubejjubajjy ubejj ubajjubejjubaubeubeubj?)r;T}rT(jFX(save_pub_key() (M2Crypto.RSA.RSA method)jUNtr?TaujNjhj]ubjM)r@T}rAT(jUjjOjNjjPj}rBT(jRjSXpyj]j]j]j]j]jTXmethodrCTjVjCTujNjhj]rDT(jX)rET}rFT(jXRSA.save_pub_key(file)jj@TjXU/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_pub_keyrGTjj\j}rHT(j]rITjaj_j`X M2Crypto.RSArJTrKT}rLTbj]j]j]j]rMTjajeXRSA.save_pub_keyrNTjgj\OjhujNjhj]rOT(j~)rPT}rQT(jX save_pub_keyjjETjjGTjjj}rRT(jojpj]j]j]j]j]ujNjhj]rSTjX save_pub_keyrTTrUT}rVT(jUjNjNjhjjPTubaubj)rWT}rXT(jXfilejjETjjGTjjj}rYT(jojpj]j]j]j]j]ujNjhj]rZTj)r[T}r\T(jXfilej}r]T(jojpj]j]j]j]j]ujjWTj]r^TjXfiler_Tr`T}raT(jUjj[Tubajjubaubj)rbT}rcT(jUjjETjNjjj}rdT(Uexprjj]j]j]j]j]ujNjhj]reTj!)rfT}rgT(jUj}rhT(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjNTujjbTj]riTj)rjT}rkT(jUj}rlT(j]j]rmTjaj]j]j]ujjfTj]rnTjX[source]roTrpT}rqT(jUjjjTubajjubajj%ubaubeubj)rrT}rsT(jUjj@TjjGTjjj}rtT(j]j]j]j]j]ujNjhj]ruT(j)rvT}rwT(jX,Save the public key to a file in PEM format.jjrTjXU/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_pub_keyjjj}rxT(j]j]j]j]j]ujKjhj]ryTjX,Save the public key to a file in PEM format.rzTr{T}r|T(jUjNjNjhjjvTubaubj)r}T}r~T(jUjjrTjNjjj}rT(j]j]j]j]j]ujNjhj]rTj)rT}rT(jUj}rT(j]j]j]j]j]ujj}Tj]rT(j)rT}rT(jX ParametersjjTjjGTjjj}rT(j]j]j]j]j]ujKj]rTjX ParametersrTrT}rT(jUjjTubaubj)rT}rT(jUj}rT(j]j]j]j]j]ujjTj]rTj)rT}rT(jX$file -- Name of file to save key to.j}rT(j]j]j]j]j]ujjTj]rT(j)rT}rT(jXfilej}rT(j]j]jj]j]j]ujjTj]rTjXfilerTrT}rT(jUjjTubajjubjX – rTrT}rT(jUjjTubjXName of file to save key to.rTrT}rT(jUjNjNjhjjTubejjubajjubejjubaubeubeubj?)rT}rT(jUjjOjNjjCj}rT(j]j]j]j]j]Uentries]rT(jFX,save_pub_key_bio() (M2Crypto.RSA.RSA method)jUNtrTaujNjhj]ubjM)rT}rT(jUjjOjNjjPj}rT(jRjSXpyj]j]j]j]j]jTXmethodrTjVjTujNjhj]rT(jX)rT}rT(jXRSA.save_pub_key_bio(bio)jjTjXY/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_pub_key_biorTjj\j}rT(j]rTjaj_j`X M2Crypto.RSArTrT}rTbj]j]j]j]rTjajeXRSA.save_pub_key_biorTjgj\OjhujNjhj]rT(j~)rT}rT(jXsave_pub_key_biojjTjjTjjj}rT(jojpj]j]j]j]j]ujNjhj]rTjXsave_pub_key_biorTrT}rT(jUjNjNjhjjTubaubj)rT}rT(jXbiojjTjjTjjj}rT(jojpj]j]j]j]j]ujNjhj]rTj)rT}rT(jXbioj}rT(jojpj]j]j]j]j]ujjTj]rTjXbiorTrT}rT(jUjjTubajjubaubj)rT}rT(jUjjTjNjjj}rT(Uexprjj]j]j]j]j]ujNjhj]rTj!)rT}rT(jUj}rT(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjTujjTj]rTj)rT}rT(jUj}rT(j]j]rTjaj]j]j]ujjTj]rTjX[source]rTrT}rT(jUjjTubajjubajj%ubaubeubj)rT}rT(jUjjTjjTjjj}rT(j]j]j]j]j]ujNjhj]rT(j)rT}rT(jX@Save the public key to an M2Crypto.BIO.BIO object in PEM format.jjTjXY/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.save_pub_key_biojjj}rT(j]j]j]j]j]ujKjhj]rTjX@Save the public key to an M2Crypto.BIO.BIO object in PEM format.rTrT}rT(jUjNjNjhjjTubaubj)rT}rT(jUjjTjNjjj}rT(j]j]j]j]j]ujNjhj]rTj)rT}rT(jUj}rT(j]j]j]j]j]ujjTj]rT(j)rT}rT(jX ParametersjjTjjTjjj}rT(j]j]j]j]j]ujKj]rTjX ParametersrTrT}rT(jUjjTubaubj)rT}rT(jUj}rT(j]j]j]j]j]ujjTj]rTj)rT}rT(jX.bio -- M2Crypto.BIO.BIO object to save key to.j}rT(j]j]j]j]j]ujjTj]rT(j)rT}rT(jXbioj}rT(j]j]jj]j]j]ujjTj]rTjXbiorTrT}rU(jUjjTubajjubjX – rUrU}rU(jUjjTubjX'M2Crypto.BIO.BIO object to save key to.rUrU}rU(jUjNjNjhjjTubejjubajjubejjubaubeubeubj?)rU}rU(jUjjOjNjjCj}r U(j]j]j]j]j]Uentries]r U(jFX sign() (M2Crypto.RSA.RSA method)hUNtr UaujNjhj]ubjM)r U}r U(jUjjOjNjjPj}rU(jRjSXpyj]j]j]j]j]jTXmethodrUjVjUujNjhj]rU(jX)rU}rU(jXRSA.sign(digest, algo='sha1')jj UjXM/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.signrUjj\j}rU(j]rUhaj_j`X M2Crypto.RSArUrU}rUbj]j]j]j]rUhajeXRSA.signrUjgj\OjhujNjhj]rU(j~)rU}rU(jXsignjjUjjUjjj}rU(jojpj]j]j]j]j]ujNjhj]rUjXsignr Ur!U}r"U(jUjNjNjhjjUubaubj)r#U}r$U(jXdigest, algo='sha1'jjUjjUjjj}r%U(jojpj]j]j]j]j]ujNjhj]r&U(j)r'U}r(U(jXdigestj}r)U(jojpj]j]j]j]j]ujj#Uj]r*UjXdigestr+Ur,U}r-U(jUjj'Uubajjubj)r.U}r/U(jX algo='sha1'j}r0U(jojpj]j]j]j]j]ujj#Uj]r1UjX algo='sha1'r2Ur3U}r4U(jUjj.Uubajjubeubj)r5U}r6U(jUjjUjNjjj}r7U(Uexprjj]j]j]j]j]ujNjhj]r8Uj!)r9U}r:U(jUj}r;U(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjUujj5Uj]rU(jUj}r?U(j]j]r@Ujaj]j]j]ujj9Uj]rAUjX[source]rBUrCU}rDU(jUjj=Uubajjubajj%ubaubeubj)rEU}rFU(jUjj UjjUjjj}rGU(j]j]j]j]j]ujNjhj]rHU(j)rIU}rJU(jX#Signs a digest with the private keyjjEUjXM/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.signjjj}rKU(j]j]j]j]j]ujKjhj]rLUjX#Signs a digest with the private keyrMUrNU}rOU(jUjNjNjhjjIUubaubj)rPU}rQU(jUjjEUjNjjj}rRU(j]j]j]j]j]ujNjhj]rSU(j)rTU}rUU(jUj}rVU(j]j]j]j]j]ujjPUj]rWU(j)rXU}rYU(jX ParametersjjTUjjUjjj}rZU(j]j]j]j]j]ujKj]r[UjX Parametersr\Ur]U}r^U(jUjjXUubaubj)r_U}r`U(jUj}raU(j]j]j]j]j]ujjTUj]rbUj^ )rcU}rdU(jUj}reU(j]j]j]j]j]ujj_Uj]rfU(jc )rgU}rhU(jUj}riU(j]j]j]j]j]ujjcUj]rjUj)rkU}rlU(jX5digest -- A digest created by using the digest methodj}rmU(j]j]j]j]j]ujjgUj]rnU(j)roU}rpU(jXdigestj}rqU(j]j]jj]j]j]ujjkUj]rrUjXdigestrsUrtU}ruU(jUjjoUubajjubjX – rvUrwU}rxU(jUjjkUubjX+A digest created by using the digest methodryUrzU}r{U(jUjNjNjhjjkUubejjubajjy ubjc )r|U}r}U(jUj}r~U(j]j]j]j]j]ujjcUj]rUj)rU}rU(jXpalgo -- The method that created the digest. Legal values like 'sha1','sha224', 'sha256', 'ripemd160', and 'md5'.j}rU(j]j]j]j]j]ujj|Uj]rU(j)rU}rU(jXalgoj}rU(j]j]jj]j]j]ujjUj]rUjXalgorUrU}rU(jUjjUubajjubjX – rUrU}rU(jUjjUubjX|The method that created the digest. Legal values like ‘sha1’,’sha224’, ‘sha256’, ‘ripemd160’, and ‘md5’.rUrU}rU(jUjNjNjhjjUubejjubajjy ubejj ubajjubejjubj)rU}rU(jUj}rU(j]j]j]j]j]ujjPUj]rU(j)rU}rU(jXReturnsjjUjjUjjj}rU(j]j]j]j]j]ujKj]rUjXReturnsrUrU}rU(jUjjUubaubj)rU}rU(jUj}rU(j]j]j]j]j]ujjUj]rUj)rU}rU(jXa string which is the signaturej}rU(j]j]j]j]j]ujjUj]rUjXa string which is the signaturerUrU}rU(jUjNjNjhjjUubajjubajjubejjubeubeubeubj?)rU}rU(jUjjOjNjjCj}rU(j]j]j]j]j]Uentries]rU(jFX+sign_rsassa_pss() (M2Crypto.RSA.RSA method)hUNtrUaujNjhj]ubjM)rU}rU(jUjjOjNjjPj}rU(jRjSXpyj]j]j]j]j]jTXmethodrUjVjUujNjhj]rU(jX)rU}rU(jX8RSA.sign_rsassa_pss(digest, algo='sha1', salt_length=20)jjUjXX/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.sign_rsassa_pssrUjj\j}rU(j]rUhaj_j`X M2Crypto.RSArUrU}rUbj]j]j]j]rUhajeXRSA.sign_rsassa_pssrUjgj\OjhujNjhj]rU(j~)rU}rU(jXsign_rsassa_pssjjUjjUjjj}rU(jojpj]j]j]j]j]ujNjhj]rUjXsign_rsassa_pssrUrU}rU(jUjNjNjhjjUubaubj)rU}rU(jX#digest, algo='sha1', salt_length=20jjUjjUjjj}rU(jojpj]j]j]j]j]ujNjhj]rU(j)rU}rU(jXdigestj}rU(jojpj]j]j]j]j]ujjUj]rUjXdigestrUrU}rU(jUjjUubajjubj)rU}rU(jX algo='sha1'j}rU(jojpj]j]j]j]j]ujjUj]rUjX algo='sha1'rUrU}rU(jUjjUubajjubj)rU}rU(jXsalt_length=20j}rU(jojpj]j]j]j]j]ujjUj]rUjXsalt_length=20rUrU}rU(jUjjUubajjubeubj)rU}rU(jUjjUjNjjj}rU(Uexprjj]j]j]j]j]ujNjhj]rUj!)rU}rU(jUj}rU(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjUujjUj]rUj)rU}rU(jUj}rU(j]j]rUjaj]j]j]ujjUj]rUjX[source]rUrU}rU(jUjjUubajjubajj%ubaubeubj)rU}rU(jUjjUjjUjjj}rU(j]j]j]j]j]ujNjhj]rU(j)rU}rU(jX4Signs a digest with the private key using RSASSA-PSSjjUjXX/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.sign_rsassa_pssjjj}rU(j]j]j]j]j]ujKjhj]rUjX4Signs a digest with the private key using RSASSA-PSSrUrU}rU(jUjNjNjhjjUubaubj)rU}rU(jUjjUjNjjj}rU(j]j]j]j]j]ujNjhj]rU(j)rU}rU(jUj}rU(j]j]j]j]j]ujjUj]rU(j)rU}rV(jX ParametersjjUjjUjjj}rV(j]j]j]j]j]ujKj]rVjX ParametersrVrV}rV(jUjjUubaubj)rV}rV(jUj}rV(j]j]j]j]j]ujjUj]r Vj^ )r V}r V(jUj}r V(j]j]j]j]j]ujjVj]r V(jc )rV}rV(jUj}rV(j]j]j]j]j]ujj Vj]rVj)rV}rV(jX5digest -- A digest created by using the digest methodj}rV(j]j]j]j]j]ujjVj]rV(j)rV}rV(jXdigestj}rV(j]j]jj]j]j]ujjVj]rVjXdigestrVrV}rV(jUjjVubajjubjX – rVrV}rV(jUjjVubjX+A digest created by using the digest methodr Vr!V}r"V(jUjNjNjhjjVubejjubajjy ubjc )r#V}r$V(jUj}r%V(j]j]j]j]j]ujj Vj]r&Vj)r'V}r(V(jX,salt_length -- The length of the salt to usej}r)V(j]j]j]j]j]ujj#Vj]r*V(j)r+V}r,V(jX salt_lengthj}r-V(j]j]jj]j]j]ujj'Vj]r.VjX salt_lengthr/Vr0V}r1V(jUjj+VubajjubjX – r2Vr3V}r4V(jUjj'VubjXThe length of the salt to user5Vr6V}r7V(jUjNjNjhjj'Vubejjubajjy ubjc )r8V}r9V(jUj}r:V(j]j]j]j]j]ujj Vj]r;Vj)rV(j]j]j]j]j]ujj8Vj]r?V(j)r@V}rAV(jXalgoj}rBV(j]j]jj]j]j]ujjW(j)r?W}r@W(jXdataj}rAW(jojpj]j]j]j]j]ujj;Wj]rBWjXdatarCWrDW}rEW(jUjj?Wubajjubj)rFW}rGW(jX signaturej}rHW(jojpj]j]j]j]j]ujj;Wj]rIWjX signaturerJWrKW}rLW(jUjjFWubajjubj)rMW}rNW(jX algo='sha1'j}rOW(jojpj]j]j]j]j]ujj;Wj]rPWjX algo='sha1'rQWrRW}rSW(jUjjMWubajjubj)rTW}rUW(jXsalt_length=20j}rVW(jojpj]j]j]j]j]ujj;Wj]rWWjXsalt_length=20rXWrYW}rZW(jUjjTWubajjubeubj)r[W}r\W(jUjj)WjNjjj}r]W(Uexprjj]j]j]j]j]ujNjhj]r^Wj!)r_W}r`W(jUj}raW(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj2Wujj[Wj]rbWj)rcW}rdW(jUj}reW(j]j]rfWjaj]j]j]ujj_Wj]rgWjX[source]rhWriW}rjW(jUjjcWubajjubajj%ubaubeubj)rkW}rlW(jUjj$Wjj+Wjjj}rmW(j]j]j]j]j]ujNjhj]rnW(j)roW}rpW(jX!Verifies the signature RSASSA-PSSjjkWjXZ/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA.verify_rsassa_pssjjj}rqW(j]j]j]j]j]ujKjhj]rrWjX!Verifies the signature RSASSA-PSSrsWrtW}ruW(jUjNjNjhjjoWubaubj)rvW}rwW(jUjjkWjNjjj}rxW(j]j]j]j]j]ujNjhj]ryW(j)rzW}r{W(jUj}r|W(j]j]j]j]j]ujjvWj]r}W(j)r~W}rW(jX ParametersjjzWjj+Wjjj}rW(j]j]j]j]j]ujKj]rWjX ParametersrWrW}rW(jUjj~Wubaubj)rW}rW(jUj}rW(j]j]j]j]j]ujjzWj]rWj^ )rW}rW(jUj}rW(j]j]j]j]j]ujjWj]rW(jc )rW}rW(jUj}rW(j]j]j]j]j]ujjWj]rWj)rW}rW(jX!data -- Data that has been signedj}rW(j]j]j]j]j]ujjWj]rW(j)rW}rW(jXdataj}rW(j]j]jj]j]j]ujjWj]rWjXdatarWrW}rW(jUjjWubajjubjX – rWrW}rW(jUjjWubjXData that has been signedrWrW}rW(jUjNjNjhjjWubejjubajjy ubjc )rW}rW(jUj}rW(j]j]j]j]j]ujjWj]rWj)rW}rW(jX1signature -- The signature signed with RSASSA-PSSj}rW(j]j]j]j]j]ujjWj]rW(j)rW}rW(jX signaturej}rW(j]j]jj]j]j]ujjWj]rWjX signaturerWrW}rW(jUjjWubajjubjX – rWrW}rW(jUjjWubjX$The signature signed with RSASSA-PSSrWrW}rW(jUjNjNjhjjWubejjubajjy ubjc )rW}rW(jUj}rW(j]j]j]j]j]ujjWj]rWj)rW}rW(jX3salt_length -- The length of the salt that was usedj}rW(j]j]j]j]j]ujjWj]rW(j)rW}rW(jX salt_lengthj}rW(j]j]jj]j]j]ujjWj]rWjX salt_lengthrWrW}rW(jUjjWubajjubjX – rWrW}rW(jUjjWubjX$The length of the salt that was usedrWrW}rW(jUjNjNjhjjWubejjubajjy ubjc )rW}rW(jUj}rW(j]j]j]j]j]ujjWj]rWj)rW}rW(jXqalgo -- The hash algorithm to use Legal values are for example 'sha1','sha224', 'sha256', 'ripemd160', and 'md5'.j}rW(j]j]j]j]j]ujjWj]rW(j)rW}rW(jXalgoj}rW(j]j]jj]j]j]ujjWj]rWjXalgorWrW}rW(jUjjWubajjubjX – rWrW}rW(jUjjWubjX}The hash algorithm to use Legal values are for example ‘sha1’,’sha224’, ‘sha256’, ‘ripemd160’, and ‘md5’.rWrW}rW(jUjNjNjhjjWubejjubajjy ubejj ubajjubejjubj)rW}rW(jUj}rW(j]j]j]j]j]ujjvWj]rW(j)rW}rW(jXReturnsjjWjj+Wjjj}rW(j]j]j]j]j]ujKj]rWjXReturnsrWrW}rW(jUjjWubaubj)rW}rW(jUj}rW(j]j]j]j]j]ujjWj]rWj)rW}rW(jX?1 or 0, depending on whether the signature was verified or not.j}rW(j]j]j]j]j]ujjWj]rWjX?1 or 0, depending on whether the signature was verified or not.rWrW}rW(jUjNjNjhjjWubajjubajjubejjubeubeubeubeubeubj?)rW}rW(jUjj#OjXM/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSAErrorrWjjCj}rW(j]j]j]j]j]Uentries]rW(jFXRSAErrorrWhUNtrWaujNjhj]ubjM)rW}rW(jUjj#OjjWjjPj}rX(jRjSXpyj]j]j]j]j]jTX exceptionrXjVjXujNjhj]rX(jX)rX}rX(jjWjjWjXM/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSAErrorrXjj\j}rX(j]rXhaj_j`X M2Crypto.RSArXr X}r Xbj]j]j]j]r XhajejWjgUjhujNjhj]r X(jj)r X}rX(jX exception jjXjjXjjmj}rX(jojpj]j]j]j]j]ujNjhj]rXjX exception rXrX}rX(jUjNjNjhjj Xubaubju)rX}rX(jX M2Crypto.RSA.jjXjjXjjxj}rX(jojpj]j]j]j]j]ujNjhj]rXjX M2Crypto.RSA.rXrX}rX(jUjNjNjhjjXubaubj~)rX}rX(jjWjjXjjXjjj}rX(jojpj]j]j]j]j]ujNjhj]rXjXRSAErrorrXr X}r!X(jUjNjNjhjjXubaubj)r"X}r#X(jUjjXjNjjj}r$X(Uexprjj]j]j]j]j]ujNjhj]r%Xj!)r&X}r'X(jUj}r(X(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjWujj"Xj]r)Xj)r*X}r+X(jUj}r,X(j]j]r-Xjaj]j]j]ujj&Xj]r.XjX[source]r/Xr0X}r1X(jUjj*Xubajjubajj%ubaubeubj)r2X}r3X(jUjjWjjXjjj}r4X(j]j]j]j]j]ujNjhj]r5Xj)r6X}r7X(jX$Bases: :class:`exceptions.Exception`jj2XjjWjjj}r8X(j]j]j]j]j]ujKjhj]r9X(jXBases: r:Xr;X}rX(jX:class:`exceptions.Exception`r?Xjj6Xjjjj%j}r@X(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyrAXj]j]U refexplicitj]j]j]j*j+j,jWj-X M2Crypto.RSArBXujKj]rCXj0)rDX}rEX(jj?Xj}rFX(j]j]rGX(j5jAXXpy-classrHXej]j]j]ujj=Xj]rIXjXexceptions.ExceptionrJXrKX}rLX(jUjjDXubajj;ubaubeubaubeubj?)rMX}rNX(jUjj#OjNjjCj}rOX(j]j]j]j]j]Uentries]rPX(jFXRSA_pub (class in M2Crypto.RSA)jmUNtrQXaujNjhj]ubjM)rRX}rSX(jUjj#OjNjjPj}rTX(jRjSXpyj]j]j]j]j]jTXclassrUXjVjUXujNjhj]rVX(jX)rWX}rXX(jXRSA_pub(rsa, _pyfree=0)jjRXjXL/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA_pubrYXjj\j}rZX(j]r[Xjmaj_j`X M2Crypto.RSAr\Xr]X}r^Xbj]j]j]j]r_XjmajeXRSA_pubr`XjgUjhujNjhj]raX(jj)rbX}rcX(jXclass jjWXjjYXjjmj}rdX(jojpj]j]j]j]j]ujNjhj]reXjXclass rfXrgX}rhX(jUjNjNjhjjbXubaubju)riX}rjX(jX M2Crypto.RSA.jjWXjjYXjjxj}rkX(jojpj]j]j]j]j]ujNjhj]rlXjX M2Crypto.RSA.rmXrnX}roX(jUjNjNjhjjiXubaubj~)rpX}rqX(jj`XjjWXjjYXjjj}rrX(jojpj]j]j]j]j]ujNjhj]rsXjXRSA_pubrtXruX}rvX(jUjNjNjhjjpXubaubj)rwX}rxX(jXrsa, _pyfree=0jjWXjjYXjjj}ryX(jojpj]j]j]j]j]ujNjhj]rzX(j)r{X}r|X(jXrsaj}r}X(jojpj]j]j]j]j]ujjwXj]r~XjXrsarXrX}rX(jUjj{Xubajjubj)rX}rX(jX _pyfree=0j}rX(jojpj]j]j]j]j]ujjwXj]rXjX _pyfree=0rXrX}rX(jUjjXubajjubeubj)rX}rX(jUjjWXjNjjj}rX(Uexprjj]j]j]j]j]ujNjhj]rXj!)rX}rX(jUj}rX(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj`XujjXj]rXj)rX}rX(jUj}rX(j]j]rXjaj]j]j]ujjXj]rXjX[source]rXrX}rX(jUjjXubajjubajj%ubaubeubj)rX}rX(jUjjRXjjYXjjj}rX(j]j]j]j]j]ujNjhj]rX(j)rX}rX(jX Bases: :class:`M2Crypto.RSA.RSA`jjXjXL/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA_pubjjj}rX(j]j]j]j]j]ujKjhj]rX(jXBases: rXrX}rX(jUjNjNjhjjXubj!)rX}rX(jX:class:`M2Crypto.RSA.RSA`rXjjXjjjj%j}rX(UreftypeXclassj'j(XM2Crypto.RSA.RSAU refdomainXpyrXj]j]U refexplicitj]j]j]j*j+j,j`Xj-jBXujKj]rXj0)rX}rX(jjXj}rX(j]j]rX(j5jXXpy-classrXej]j]j]ujjXj]rXjXM2Crypto.RSA.RSArXrX}rX(jUjjXubajj;ubaubeubj)rX}rX(jX&Object interface to an RSA public key.jjXjXL/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA_pubjjj}rX(j]j]j]j]j]ujKjhj]rXjX&Object interface to an RSA public key.rXrX}rX(jUjNjNjhjjXubaubj?)rX}rX(jUjjXjNjjCj}rX(j]j]j]j]j]Uentries]rX(jFX)check_key() (M2Crypto.RSA.RSA_pub method)hUNtrXaujNjhj]ubjM)rX}rX(jUjjXjNjjPj}rX(jRjSXpyj]j]j]j]j]jTXmethodrXjVjXujNjhj]rX(jX)rX}rX(jXRSA_pub.check_key()jjXjXV/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA_pub.check_keyrXjj\j}rX(j]rXhaj_j`X M2Crypto.RSArXrX}rXbj]j]j]j]rXhajeXRSA_pub.check_keyrXjgj`XjhujNjhj]rX(j~)rX}rX(jX check_keyjjXjjXjjj}rX(jojpj]j]j]j]j]ujNjhj]rXjX check_keyrXrX}rX(jUjNjNjhjjXubaubj)rX}rX(jUjjXjjXjjj}rX(jojpj]j]j]j]j]ujNjhj]ubj)rX}rX(jUjjXjNjjj}rX(Uexprjj]j]j]j]j]ujNjhj]rXj!)rX}rX(jUj}rX(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjXujjXj]rXj)rX}rX(jUj}rX(j]j]rXjaj]j]j]ujjXj]rXjX[source]rXrX}rX(jUjjXubajjubajj%ubaubeubj)rX}rX(jUjjXjjXjjj}rX(j]j]j]j]j]ujNjhj]ubeubj?)rX}rX(jUjjXjNjjCj}rX(j]j]j]j]j]Uentries]rX(jFX/private_decrypt() (M2Crypto.RSA.RSA_pub method)hCUNtrXaujNjhj]ubjM)rX}rX(jUjjXjNjjPj}rX(jRjSXpyj]j]j]j]j]jTXmethodrXjVjXujNjhj]rX(jX)rX}rX(jXRSA_pub.private_decrypt(*argv)jjXjX\/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA_pub.private_decryptrXjj\j}rX(j]rXhCaj_j`X M2Crypto.RSArXrX}rXbj]j]j]j]rXhCajeXRSA_pub.private_decryptrXjgj`XjhujNjhj]rY(j~)rY}rY(jXprivate_decryptjjXjjXjjj}rY(jojpj]j]j]j]j]ujNjhj]rYjXprivate_decryptrYrY}rY(jUjNjNjhjjYubaubj)rY}r Y(jX*argvjjXjjXjjj}r Y(jojpj]j]j]j]j]ujNjhj]r Yj)r Y}r Y(jX*argvj}rY(jojpj]j]j]j]j]ujjYj]rYjX*argvrYrY}rY(jUjj Yubajjubaubj)rY}rY(jUjjXjNjjj}rY(Uexprjj]j]j]j]j]ujNjhj]rYj!)rY}rY(jUj}rY(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjXujjYj]rYj)rY}rY(jUj}rY(j]j]rYjaj]j]j]ujjYj]rYjX[source]r Yr!Y}r"Y(jUjjYubajjubajj%ubaubeubj)r#Y}r$Y(jUjjXjjXjjj}r%Y(j]j]j]j]j]ujNjhj]ubeubj?)r&Y}r'Y(jUjjXjNjjCj}r(Y(j]j]j]j]j]Uentries]r)Y(jFX/private_encrypt() (M2Crypto.RSA.RSA_pub method)h1UNtr*YaujNjhj]ubjM)r+Y}r,Y(jUjjXjNjjPj}r-Y(jRjSXpyj]j]j]j]j]jTXmethodr.YjVj.YujNjhj]r/Y(jX)r0Y}r1Y(jXRSA_pub.private_encrypt(*argv)jj+YjX\/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA_pub.private_encryptr2Yjj\j}r3Y(j]r4Yh1aj_j`X M2Crypto.RSAr5Yr6Y}r7Ybj]j]j]j]r8Yh1ajeXRSA_pub.private_encryptr9Yjgj`XjhujNjhj]r:Y(j~)r;Y}rYjXprivate_encryptr?Yr@Y}rAY(jUjNjNjhjj;Yubaubj)rBY}rCY(jX*argvjj0Yjj2Yjjj}rDY(jojpj]j]j]j]j]ujNjhj]rEYj)rFY}rGY(jX*argvj}rHY(jojpj]j]j]j]j]ujjBYj]rIYjX*argvrJYrKY}rLY(jUjjFYubajjubaubj)rMY}rNY(jUjj0YjNjjj}rOY(Uexprjj]j]j]j]j]ujNjhj]rPYj!)rQY}rRY(jUj}rSY(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj9YujjMYj]rTYj)rUY}rVY(jUj}rWY(j]j]rXYjaj]j]j]ujjQYj]rYYjX[source]rZYr[Y}r\Y(jUjjUYubajjubajj%ubaubeubj)r]Y}r^Y(jUjj+Yjj2Yjjj}r_Y(j]j]j]j]j]ujNjhj]ubeubj?)r`Y}raY(jUjjXjXU/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA_pub.save_keyrbYjjCj}rcY(j]j]j]j]j]Uentries]rdY(jFX(save_key() (M2Crypto.RSA.RSA_pub method)hUNtreYaujNjhj]ubjM)rfY}rgY(jUjjXjjbYjjPj}rhY(jRjSXpyj]j]j]j]j]jTXmethodriYjVjiYujNjhj]rjY(jX)rkY}rlY(jX#RSA_pub.save_key(file, *args, **kw)jjfYjXU/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA_pub.save_keyrmYjj\j}rnY(j]roYhaj_j`X M2Crypto.RSArpYrqY}rrYbj]j]j]j]rsYhajeXRSA_pub.save_keyrtYjgj`XjhujNjhj]ruY(j~)rvY}rwY(jXsave_keyjjkYjjmYjjj}rxY(jojpj]j]j]j]j]ujNjhj]ryYjXsave_keyrzYr{Y}r|Y(jUjNjNjhjjvYubaubj)r}Y}r~Y(jXfile, *args, **kwjjkYjjmYjjj}rY(jojpj]j]j]j]j]ujNjhj]rY(j)rY}rY(jXfilej}rY(jojpj]j]j]j]j]ujj}Yj]rYjXfilerYrY}rY(jUjjYubajjubj)rY}rY(jX*argsj}rY(jojpj]j]j]j]j]ujj}Yj]rYjX*argsrYrY}rY(jUjjYubajjubj)rY}rY(jX**kwj}rY(jojpj]j]j]j]j]ujj}Yj]rYjX**kwrYrY}rY(jUjjYubajjubeubj)rY}rY(jUjjkYjNjjj}rY(Uexprjj]j]j]j]j]ujNjhj]rYj!)rY}rY(jUj}rY(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjtYujjYj]rYj)rY}rY(jUj}rY(j]j]rYjaj]j]j]ujjYj]rYjX[source]rYrY}rY(jUjjYubajjubajj%ubaubeubj)rY}rY(jUjjfYjjmYjjj}rY(j]j]j]j]j]ujNjhj]rYj)rY}rY(jXSave public key to file.jjYjjbYjjj}rY(j]j]j]j]j]ujKjhj]rYjXSave public key to file.rYrY}rY(jUjNjNjhjjYubaubaubeubj?)rY}rY(jUjjXjXY/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA_pub.save_key_biorYjjCj}rY(j]j]j]j]j]Uentries]rY(jFX,save_key_bio() (M2Crypto.RSA.RSA_pub method)hUNtrYaujNjhj]ubjM)rY}rY(jUjjXjjYjjPj}rY(jRjSXpyj]j]j]j]j]jTXmethodrYjVjYujNjhj]rY(jX)rY}rY(jX&RSA_pub.save_key_bio(bio, *args, **kw)jjYjXY/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.RSA_pub.save_key_biorYjj\j}rY(j]rYhaj_j`X M2Crypto.RSArYrY}rYbj]j]j]j]rYhajeXRSA_pub.save_key_biorYjgj`XjhujNjhj]rY(j~)rY}rY(jX save_key_biojjYjjYjjj}rY(jojpj]j]j]j]j]ujNjhj]rYjX save_key_biorYrY}rY(jUjNjNjhjjYubaubj)rY}rY(jXbio, *args, **kwjjYjjYjjj}rY(jojpj]j]j]j]j]ujNjhj]rY(j)rY}rY(jXbioj}rY(jojpj]j]j]j]j]ujjYj]rYjXbiorYrY}rY(jUjjYubajjubj)rY}rY(jX*argsj}rY(jojpj]j]j]j]j]ujjYj]rYjX*argsrYrY}rY(jUjjYubajjubj)rY}rY(jX**kwj}rY(jojpj]j]j]j]j]ujjYj]rYjX**kwrYrY}rY(jUjjYubajjubeubj)rY}rY(jUjjYjNjjj}rY(Uexprjj]j]j]j]j]ujNjhj]rYj!)rY}rY(jUj}rY(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjYujjYj]rYj)rY}rY(jUj}rY(j]j]rYjaj]j]j]ujjYj]rYjX[source]rYrY}rY(jUjjYubajjubajj%ubaubeubj)rY}rY(jUjjYjjYjjj}rY(j]j]j]j]j]ujNjhj]rYj)rY}rY(jXSave public key to BIO.jjYjjYjjj}rY(j]j]j]j]j]ujKjhj]rYjXSave public key to BIO.rYrZ}rZ(jUjNjNjhjjYubaubaubeubeubeubj?)rZ}rZ(jUjj#OjNjjCj}rZ(j]j]j]j]j]Uentries]rZ(jFX"gen_key() (in module M2Crypto.RSA)jUNtrZaujNjhj]ubjM)rZ}rZ(jUjj#OjNjjPj}r Z(jRjSXpyj]j]j]j]j]jTXfunctionr ZjVj ZujNjhj]r Z(jX)r Z}r Z(jX5gen_key(bits, e, callback=)jjZjXL/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.gen_keyrZjj\j}rZ(j]rZjaj_j`X M2Crypto.RSArZrZ}rZbj]j]j]j]rZjajeXgen_keyrZjgUjhujNjhj]rZ(ju)rZ}rZ(jX M2Crypto.RSA.jj ZjjZjjxj}rZ(jojpj]j]j]j]j]ujNjhj]rZjX M2Crypto.RSA.rZrZ}rZ(jUjNjNjhjjZubaubj~)rZ}rZ(jjZjj ZjjZjjj}r Z(jojpj]j]j]j]j]ujNjhj]r!ZjXgen_keyr"Zr#Z}r$Z(jUjNjNjhjjZubaubj)r%Z}r&Z(jX,bits, e, callback=jj ZjjZjjj}r'Z(jojpj]j]j]j]j]ujNjhj]r(Z(j)r)Z}r*Z(jXbitsj}r+Z(jojpj]j]j]j]j]ujj%Zj]r,ZjXbitsr-Zr.Z}r/Z(jUjj)Zubajjubj)r0Z}r1Z(jXej}r2Z(jojpj]j]j]j]j]ujj%Zj]r3ZjXer4Z}r5Z(jUjj0Zubajjubj)r6Z}r7Z(jX#callback=j}r8Z(jojpj]j]j]j]j]ujj%Zj]r9ZjX#callback=r:Zr;Z}rZ(jUjj ZjNjjj}r?Z(Uexprjj]j]j]j]j]ujNjhj]r@Zj!)rAZ}rBZ(jUj}rCZ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjZujj=Zj]rDZj)rEZ}rFZ(jUj}rGZ(j]j]rHZjaj]j]j]ujjAZj]rIZjX[source]rJZrKZ}rLZ(jUjjEZubajjubajj%ubaubeubj)rMZ}rNZ(jUjjZjjZjjj}rOZ(j]j]j]j]j]ujNjhj]rPZ(j)rQZ}rRZ(jXGenerate an RSA key pair.jjMZjXL/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.gen_keyjjj}rSZ(j]j]j]j]j]ujKjhj]rTZjXGenerate an RSA key pair.rUZrVZ}rWZ(jUjNjNjhjjQZubaubj)rXZ}rYZ(jUjjMZjNjjj}rZZ(j]j]j]j]j]ujNjhj]r[Z(j)r\Z}r]Z(jUj}r^Z(j]j]j]j]j]ujjXZj]r_Z(j)r`Z}raZ(jX Parametersjj\ZjjZjjj}rbZ(j]j]j]j]j]ujKj]rcZjX ParametersrdZreZ}rfZ(jUjj`Zubaubj)rgZ}rhZ(jUj}riZ(j]j]j]j]j]ujj\Zj]rjZj^ )rkZ}rlZ(jUj}rmZ(j]j]j]j]j]ujjgZj]rnZ(jc )roZ}rpZ(jUj}rqZ(j]j]j]j]j]ujjkZj]rrZj)rsZ}rtZ(jXbits -- Key length, in bits.j}ruZ(j]j]j]j]j]ujjoZj]rvZ(j)rwZ}rxZ(jXbitsj}ryZ(j]j]jj]j]j]ujjsZj]rzZjXbitsr{Zr|Z}r}Z(jUjjwZubajjubjX – r~ZrZ}rZ(jUjjsZubjXKey length, in bits.rZrZ}rZ(jUjNjNjhjjsZubejjubajjy ubjc )rZ}rZ(jUj}rZ(j]j]j]j]j]ujjkZj]rZj)rZ}rZ(jXe -- The RSA public exponent.j}rZ(j]j]j]j]j]ujjZj]rZ(j)rZ}rZ(jXej}rZ(j]j]jj]j]j]ujjZj]rZjXerZ}rZ(jUjjZubajjubjX – rZrZ}rZ(jUjjZubjXThe RSA public exponent.rZrZ}rZ(jUjNjNjhjjZubejjubajjy ubjc )rZ}rZ(jUj}rZ(j]j]j]j]j]ujjkZj]rZj)rZ}rZ(jXcallback -- A Python callable object that is invoked during key generation; its usual purpose is to provide visual feedback. The default callback is keygen_callback.j}rZ(j]j]j]j]j]ujjZj]rZ(j)rZ}rZ(jXcallbackj}rZ(j]j]jj]j]j]ujjZj]rZjXcallbackrZrZ}rZ(jUjjZubajjubjX – rZrZ}rZ(jUjjZubjXA Python callable object that is invoked during key generation; its usual purpose is to provide visual feedback. The default callback is keygen_callback.rZrZ}rZ(jUjNjNjhjjZubejjubajjy ubejj ubajjubejjubj)rZ}rZ(jUj}rZ(j]j]j]j]j]ujjXZj]rZ(j)rZ}rZ(jXReturnsjjZjjZjjj}rZ(j]j]j]j]j]ujKj]rZjXReturnsrZrZ}rZ(jUjjZubaubj)rZ}rZ(jUj}rZ(j]j]j]j]j]ujjZj]rZj)rZ}rZ(jXM2Crypto.RSA.RSA object.j}rZ(j]j]j]j]j]ujjZj]rZjXM2Crypto.RSA.RSA object.rZrZ}rZ(jUjNjNjhjjZubajjubajjubejjubeubeubeubj?)rZ}rZ(jUjj#OjXT/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.keygen_callbackrZjjCj}rZ(j]j]j]j]j]Uentries]rZ(jFX*keygen_callback() (in module M2Crypto.RSA)hUNtrZaujNjhj]ubjM)rZ}rZ(jUjj#OjjZjjPj}rZ(jRjSXpyj]j]j]j]j]jTXfunctionrZjVjZujNjhj]rZ(jX)rZ}rZ(jX;keygen_callback(p, n, out=', mode 'w'>)jjZjXT/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.keygen_callbackrZjj\j}rZ(j]rZhaj_j`X M2Crypto.RSArZrZ}rZbj]j]j]j]rZhajeXkeygen_callbackrZjgUjhujNjhj]rZ(ju)rZ}rZ(jX M2Crypto.RSA.jjZjjZjjxj}rZ(jojpj]j]j]j]j]ujNjhj]rZjX M2Crypto.RSA.rZrZ}rZ(jUjNjNjhjjZubaubj~)rZ}rZ(jjZjjZjjZjjj}rZ(jojpj]j]j]j]j]ujNjhj]rZjXkeygen_callbackrZrZ}rZ(jUjNjNjhjjZubaubj)rZ}rZ(jX*p, n, out=', mode 'w'>jjZjjZjjj}rZ(jojpj]j]j]j]j]ujNjhj]rZ(j)rZ}rZ(jXpj}rZ(jojpj]j]j]j]j]ujjZj]rZjXprZ}rZ(jUjjZubajjubj)rZ}rZ(jXnj}rZ(jojpj]j]j]j]j]ujjZj]rZjXnrZ}rZ(jUjjZubajjubj)rZ}rZ(jXout='j}rZ(jojpj]j]j]j]j]ujjZj]rZjXout='rZrZ}rZ(jUjjZubajjubj)rZ}rZ(jX mode 'w'>j}r[(jojpj]j]j]j]j]ujjZj]r[jX mode 'w'>r[r[}r[(jUjjZubajjubeubj)r[}r[(jUjjZjNjjj}r[(Uexprjj]j]j]j]j]ujNjhj]r[j!)r [}r [(jUj}r [(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidjZujj[j]r [j)r [}r[(jUj}r[(j]j]r[jaj]j]j]ujj [j]r[jX[source]r[r[}r[(jUjj [ubajjubajj%ubaubeubj)r[}r[(jUjjZjjZjjj}r[(j]j]j]j]j]ujNjhj]r[j)r[}r[(jXDefault callback for gen_key().jj[jjZjjj}r[(j]j]j]j]j]ujKjhj]r[jXDefault callback for gen_key().r[r[}r[(jUjNjNjhjj[ubaubaubeubj?)r [}r![(jUjj#OjNjjCj}r"[(j]j]j]j]j]Uentries]r#[(jFX#load_key() (in module M2Crypto.RSA)hlUNtr$[aujNjhj]ubjM)r%[}r&[(jUjj#OjNjjPj}r'[(jRjSXpyj]j]j]j]j]jTXfunctionr([jVj([ujNjhj]r)[(jX)r*[}r+[(jX7load_key(file, callback=)jj%[jXM/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.load_keyr,[jj\j}r-[(j]r.[hlaj_j`X M2Crypto.RSAr/[r0[}r1[bj]j]j]j]r2[hlajeXload_keyr3[jgUjhujNjhj]r4[(ju)r5[}r6[(jX M2Crypto.RSA.jj*[jj,[jjxj}r7[(jojpj]j]j]j]j]ujNjhj]r8[jX M2Crypto.RSA.r9[r:[}r;[(jUjNjNjhjj5[ubaubj~)r<[}r=[(jj3[jj*[jj,[jjj}r>[(jojpj]j]j]j]j]ujNjhj]r?[jXload_keyr@[rA[}rB[(jUjNjNjhjj<[ubaubj)rC[}rD[(jX-file, callback=jj*[jj,[jjj}rE[(jojpj]j]j]j]j]ujNjhj]rF[(j)rG[}rH[(jXfilej}rI[(jojpj]j]j]j]j]ujjC[j]rJ[jXfilerK[rL[}rM[(jUjjG[ubajjubj)rN[}rO[(jX'callback=j}rP[(jojpj]j]j]j]j]ujjC[j]rQ[jX'callback=rR[rS[}rT[(jUjjN[ubajjubeubj)rU[}rV[(jUjj*[jNjjj}rW[(Uexprjj]j]j]j]j]ujNjhj]rX[j!)rY[}rZ[(jUj}r[[(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj3[ujjU[j]r\[j)r][}r^[(jUj}r_[(j]j]r`[jaj]j]j]ujjY[j]ra[jX[source]rb[rc[}rd[(jUjj][ubajjubajj%ubaubeubj)re[}rf[(jUjj%[jj,[jjj}rg[(j]j]j]j]j]ujNjhj]rh[(j)ri[}rj[(jXLoad an RSA key pair from file.jje[jXM/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.load_keyjjj}rk[(j]j]j]j]j]ujKjhj]rl[jXLoad an RSA key pair from file.rm[rn[}ro[(jUjNjNjhjji[ubaubj)rp[}rq[(jUjje[jNjjj}rr[(j]j]j]j]j]ujNjhj]rs[(j)rt[}ru[(jUj}rv[(j]j]j]j]j]ujjp[j]rw[(j)rx[}ry[(jX Parametersjjt[jj,[jjj}rz[(j]j]j]j]j]ujKj]r{[jX Parametersr|[r}[}r~[(jUjjx[ubaubj)r[}r[(jUj}r[(j]j]j]j]j]ujjt[j]r[j^ )r[}r[(jUj}r[(j]j]j]j]j]ujj[j]r[(jc )r[}r[(jUj}r[(j]j]j]j]j]ujj[j]r[j)r[}r[(jX=file -- Name of file containing RSA public key in PEM format.j}r[(j]j]j]j]j]ujj[j]r[(j)r[}r[(jXfilej}r[(j]j]jj]j]j]ujj[j]r[jXfiler[r[}r[(jUjj[ubajjubjX – r[r[}r[(jUjj[ubjX5Name of file containing RSA public key in PEM format.r[r[}r[(jUjNjNjhjj[ubejjubajjy ubjc )r[}r[(jUj}r[(j]j]j]j]j]ujj[j]r[j)r[}r[(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback.j}r[(j]j]j]j]j]ujj[j]r[(j)r[}r[(jXcallbackj}r[(j]j]jj]j]j]ujj[j]r[jXcallbackr[r[}r[(jUjj[ubajjubjX – r[r[}r[(jUjj[ubjXA Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback.r[r[}r[(jUjNjNjhjj[ubejjubajjy ubejj ubajjubejjubj)r[}r[(jUj}r[(j]j]j]j]j]ujjp[j]r[(j)r[}r[(jXReturnsjj[jj,[jjj}r[(j]j]j]j]j]ujKj]r[jXReturnsr[r[}r[(jUjj[ubaubj)r[}r[(jUj}r[(j]j]j]j]j]ujj[j]r[j)r[}r[(jXM2Crypto.RSA.RSA object.j}r[(j]j]j]j]j]ujj[j]r[jXM2Crypto.RSA.RSA object.r[r[}r[(jUjNjNjhjj[ubajjubajjubejjubeubeubeubj?)r[}r[(jUjj#OjNjjCj}r[(j]j]j]j]j]Uentries]r[(jFX'load_key_bio() (in module M2Crypto.RSA)jUNtr[aujNjhj]ubjM)r[}r[(jUjj#OjNjjPj}r[(jRjSXpyj]j]j]j]j]jTXfunctionr[jVj[ujNjhj]r[(jX)r[}r[(jX:load_key_bio(bio, callback=)jj[jXQ/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.load_key_bior[jj\j}r[(j]r[jaj_j`X M2Crypto.RSAr[r[}r[bj]j]j]j]r[jajeX load_key_bior[jgUjhujNjhj]r[(ju)r[}r[(jX M2Crypto.RSA.jj[jj[jjxj}r[(jojpj]j]j]j]j]ujNjhj]r[jX M2Crypto.RSA.r[r[}r[(jUjNjNjhjj[ubaubj~)r[}r[(jj[jj[jj[jjj}r[(jojpj]j]j]j]j]ujNjhj]r[jX load_key_bior[r[}r[(jUjNjNjhjj[ubaubj)r[}r[(jX,bio, callback=jj[jj[jjj}r[(jojpj]j]j]j]j]ujNjhj]r[(j)r[}r[(jXbioj}r[(jojpj]j]j]j]j]ujj[j]r[jXbior[r[}r[(jUjj[ubajjubj)r[}r[(jX'callback=j}r[(jojpj]j]j]j]j]ujj[j]r[jX'callback=r[r[}r[(jUjj[ubajjubeubj)r[}r[(jUjj[jNjjj}r[(Uexprjj]j]j]j]j]ujNjhj]r[j!)r\}r\(jUj}r\(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj[ujj[j]r\j)r\}r\(jUj}r\(j]j]r\jaj]j]j]ujj\j]r\jX[source]r \r \}r \(jUjj\ubajjubajj%ubaubeubj)r \}r \(jUjj[jj[jjj}r\(j]j]j]j]j]ujNjhj]r\(j)r\}r\(jX5Load an RSA key pair from an M2Crypto.BIO.BIO object.jj \jXQ/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.load_key_biojjj}r\(j]j]j]j]j]ujKjhj]r\jX5Load an RSA key pair from an M2Crypto.BIO.BIO object.r\r\}r\(jUjNjNjhjj\ubaubj)r\}r\(jUjj \jNjjj}r\(j]j]j]j]j]ujNjhj]r\(j)r\}r\(jUj}r\(j]j]j]j]j]ujj\j]r\(j)r\}r \(jX Parametersjj\jj[jjj}r!\(j]j]j]j]j]ujKj]r"\jX Parametersr#\r$\}r%\(jUjj\ubaubj)r&\}r'\(jUj}r(\(j]j]j]j]j]ujj\j]r)\j^ )r*\}r+\(jUj}r,\(j]j]j]j]j]ujj&\j]r-\(jc )r.\}r/\(jUj}r0\(j]j]j]j]j]ujj*\j]r1\j)r2\}r3\(jXEbio -- M2Crypto.BIO.BIO object containing RSA key pair in PEM format.j}r4\(j]j]j]j]j]ujj.\j]r5\(j)r6\}r7\(jXbioj}r8\(j]j]jj]j]j]ujj2\j]r9\jXbior:\r;\}r<\(jUjj6\ubajjubjX – r=\r>\}r?\(jUjj2\ubjX>M2Crypto.BIO.BIO object containing RSA key pair in PEM format.r@\rA\}rB\(jUjNjNjhjj2\ubejjubajjy ubjc )rC\}rD\(jUj}rE\(j]j]j]j]j]ujj*\j]rF\j)rG\}rH\(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback.j}rI\(j]j]j]j]j]ujjC\j]rJ\(j)rK\}rL\(jXcallbackj}rM\(j]j]jj]j]j]ujjG\j]rN\jXcallbackrO\rP\}rQ\(jUjjK\ubajjubjX – rR\rS\}rT\(jUjjG\ubjXA Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback.rU\rV\}rW\(jUjNjNjhjjG\ubejjubajjy ubejj ubajjubejjubj)rX\}rY\(jUj}rZ\(j]j]j]j]j]ujj\j]r[\(j)r\\}r]\(jXReturnsjjX\jj[jjj}r^\(j]j]j]j]j]ujKj]r_\jXReturnsr`\ra\}rb\(jUjj\\ubaubj)rc\}rd\(jUj}re\(j]j]j]j]j]ujjX\j]rf\j)rg\}rh\(jXM2Crypto.RSA.RSA object.j}ri\(j]j]j]j]j]ujjc\j]rj\jXM2Crypto.RSA.RSA object.rk\rl\}rm\(jUjNjNjhjjg\ubajjubajjubejjubeubeubeubj?)rn\}ro\(jUjj#OjNjjCj}rp\(j]j]j]j]j]Uentries]rq\(jFX*load_key_string() (in module M2Crypto.RSA)juUNtrr\aujNjhj]ubjM)rs\}rt\(jUjj#OjNjjPj}ru\(jRjSXpyj]j]j]j]j]jTXfunctionrv\jVjv\ujNjhj]rw\(jX)rx\}ry\(jX@load_key_string(string, callback=)jjs\jXT/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.load_key_stringrz\jj\j}r{\(j]r|\juaj_j`X M2Crypto.RSAr}\r~\}r\bj]j]j]j]r\juajeXload_key_stringr\jgUjhujNjhj]r\(ju)r\}r\(jX M2Crypto.RSA.jjx\jjz\jjxj}r\(jojpj]j]j]j]j]ujNjhj]r\jX M2Crypto.RSA.r\r\}r\(jUjNjNjhjj\ubaubj~)r\}r\(jj\jjx\jjz\jjj}r\(jojpj]j]j]j]j]ujNjhj]r\jXload_key_stringr\r\}r\(jUjNjNjhjj\ubaubj)r\}r\(jX/string, callback=jjx\jjz\jjj}r\(jojpj]j]j]j]j]ujNjhj]r\(j)r\}r\(jXstringj}r\(jojpj]j]j]j]j]ujj\j]r\jXstringr\r\}r\(jUjj\ubajjubj)r\}r\(jX'callback=j}r\(jojpj]j]j]j]j]ujj\j]r\jX'callback=r\r\}r\(jUjj\ubajjubeubj)r\}r\(jUjjx\jNjjj}r\(Uexprjj]j]j]j]j]ujNjhj]r\j!)r\}r\(jUj}r\(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj\ujj\j]r\j)r\}r\(jUj}r\(j]j]r\jaj]j]j]ujj\j]r\jX[source]r\r\}r\(jUjj\ubajjubajj%ubaubeubj)r\}r\(jUjjs\jjz\jjj}r\(j]j]j]j]j]ujNjhj]r\(j)r\}r\(jX#Load an RSA key pair from a string.jj\jXT/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.load_key_stringjjj}r\(j]j]j]j]j]ujKjhj]r\jX#Load an RSA key pair from a string.r\r\}r\(jUjNjNjhjj\ubaubj)r\}r\(jUjj\jNjjj}r\(j]j]j]j]j]ujNjhj]r\(j)r\}r\(jUj}r\(j]j]j]j]j]ujj\j]r\(j)r\}r\(jX Parametersjj\jjz\jjj}r\(j]j]j]j]j]ujKj]r\jX Parametersr\r\}r\(jUjj\ubaubj)r\}r\(jUj}r\(j]j]j]j]j]ujj\j]r\j^ )r\}r\(jUj}r\(j]j]j]j]j]ujj\j]r\(jc )r\}r\(jUj}r\(j]j]j]j]j]ujj\j]r\j)r\}r\(jX7string -- String containing RSA key pair in PEM format.j}r\(j]j]j]j]j]ujj\j]r\(j)r\}r\(jXstringj}r\(j]j]jj]j]j]ujj\j]r\jXstringr\r\}r\(jUjj\ubajjubjX – r\r\}r\(jUjj\ubjX-String containing RSA key pair in PEM format.r\r\}r\(jUjNjNjhjj\ubejjubajjy ubjc )r\}r\(jUj}r\(j]j]j]j]j]ujj\j]r\j)r\}r\(jXcallback -- A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback.j}r\(j]j]j]j]j]ujj\j]r\(j)r\}r\(jXcallbackj}r\(j]j]jj]j]j]ujj\j]r\jXcallbackr\r\}r\(jUjj\ubajjubjX – r\r\}r\(jUjj\ubjXA Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback.r\r\}r\(jUjNjNjhjj\ubejjubajjy ubejj ubajjubejjubj)r\}r](jUj}r](j]j]j]j]j]ujj\j]r](j)r]}r](jXReturnsjj\jjz\jjj}r](j]j]j]j]j]ujKj]r]jXReturnsr]r]}r ](jUjj]ubaubj)r ]}r ](jUj}r ](j]j]j]j]j]ujj\j]r ]j)r]}r](jXM2Crypto.RSA.RSA object.j}r](j]j]j]j]j]ujj ]j]r]jXM2Crypto.RSA.RSA object.r]r]}r](jUjNjNjhjj]ubajjubajjubejjubeubeubeubj?)r]}r](jUjj#OjNjjCj}r](j]j]j]j]j]Uentries]r](jFX'load_pub_key() (in module M2Crypto.RSA)jUNtr]aujNjhj]ubjM)r]}r](jUjj#OjNjjPj}r](jRjSXpyj]j]j]j]j]jTXfunctionr]jVj]ujNjhj]r](jX)r]}r ](jXload_pub_key(file)jj]jXQ/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.load_pub_keyr!]jj\j}r"](j]r#]jaj_j`X M2Crypto.RSAr$]r%]}r&]bj]j]j]j]r']jajeX load_pub_keyr(]jgUjhujNjhj]r)](ju)r*]}r+](jX M2Crypto.RSA.jj]jj!]jjxj}r,](jojpj]j]j]j]j]ujNjhj]r-]jX M2Crypto.RSA.r.]r/]}r0](jUjNjNjhjj*]ubaubj~)r1]}r2](jj(]jj]jj!]jjj}r3](jojpj]j]j]j]j]ujNjhj]r4]jX load_pub_keyr5]r6]}r7](jUjNjNjhjj1]ubaubj)r8]}r9](jXfilejj]jj!]jjj}r:](jojpj]j]j]j]j]ujNjhj]r;]j)r<]}r=](jXfilej}r>](jojpj]j]j]j]j]ujj8]j]r?]jXfiler@]rA]}rB](jUjj<]ubajjubaubj)rC]}rD](jUjj]jNjjj}rE](Uexprjj]j]j]j]j]ujNjhj]rF]j!)rG]}rH](jUj}rI](UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj(]ujjC]j]rJ]j)rK]}rL](jUj}rM](j]j]rN]jaj]j]j]ujjG]j]rO]jX[source]rP]rQ]}rR](jUjjK]ubajjubajj%ubaubeubj)rS]}rT](jUjj]jj!]jjj}rU](j]j]j]j]j]ujNjhj]rV](j)rW]}rX](jX!Load an RSA public key from file.jjS]jXQ/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.load_pub_keyjjj}rY](j]j]j]j]j]ujKjhj]rZ]jX!Load an RSA public key from file.r[]r\]}r]](jUjNjNjhjjW]ubaubj)r^]}r_](jUjjS]jNjjj}r`](j]j]j]j]j]ujNjhj]ra](j)rb]}rc](jUj}rd](j]j]j]j]j]ujj^]j]re](j)rf]}rg](jX Parametersjjb]jj!]jjj}rh](j]j]j]j]j]ujKj]ri]jX Parametersrj]rk]}rl](jUjjf]ubaubj)rm]}rn](jUj}ro](j]j]j]j]j]ujjb]j]rp]j)rq]}rr](jX=file -- Name of file containing RSA public key in PEM format.j}rs](j]j]j]j]j]ujjm]j]rt](j)ru]}rv](jXfilej}rw](j]j]jj]j]j]ujjq]j]rx]jXfilery]rz]}r{](jUjju]ubajjubjX – r|]r}]}r~](jUjjq]ubjX5Name of file containing RSA public key in PEM format.r]r]}r](jUjNjNjhjjq]ubejjubajjubejjubj)r]}r](jUj}r](j]j]j]j]j]ujj^]j]r](j)r]}r](jXReturnsjj]jj!]jjj}r](j]j]j]j]j]ujKj]r]jXReturnsr]r]}r](jUjj]ubaubj)r]}r](jUj}r](j]j]j]j]j]ujj]j]r]j)r]}r](jXM2Crypto.RSA.RSA_pub object.j}r](j]j]j]j]j]ujj]j]r]jXM2Crypto.RSA.RSA_pub object.r]r]}r](jUjNjNjhjj]ubajjubajjubejjubeubeubeubj?)r]}r](jUjj#OjNjjCj}r](j]j]j]j]j]Uentries]r](jFX+load_pub_key_bio() (in module M2Crypto.RSA)hUNtr]aujNjhj]ubjM)r]}r](jUjj#OjNjjPj}r](jRjSXpyj]j]j]j]j]jTXfunctionr]jVj]ujNjhj]r](jX)r]}r](jXload_pub_key_bio(bio)jj]jXU/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.load_pub_key_bior]jj\j}r](j]r]haj_j`X M2Crypto.RSAr]r]}r]bj]j]j]j]r]hajeXload_pub_key_bior]jgUjhujNjhj]r](ju)r]}r](jX M2Crypto.RSA.jj]jj]jjxj}r](jojpj]j]j]j]j]ujNjhj]r]jX M2Crypto.RSA.r]r]}r](jUjNjNjhjj]ubaubj~)r]}r](jj]jj]jj]jjj}r](jojpj]j]j]j]j]ujNjhj]r]jXload_pub_key_bior]r]}r](jUjNjNjhjj]ubaubj)r]}r](jXbiojj]jj]jjj}r](jojpj]j]j]j]j]ujNjhj]r]j)r]}r](jXbioj}r](jojpj]j]j]j]j]ujj]j]r]jXbior]r]}r](jUjj]ubajjubaubj)r]}r](jUjj]jNjjj}r](Uexprjj]j]j]j]j]ujNjhj]r]j!)r]}r](jUj}r](UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj]ujj]j]r]j)r]}r](jUj}r](j]j]r]jaj]j]j]ujj]j]r]jX[source]r]r]}r](jUjj]ubajjubajj%ubaubeubj)r]}r](jUjj]jj]jjj}r](j]j]j]j]j]ujNjhj]r](j)r]}r](jX7Load an RSA public key from an M2Crypto.BIO.BIO object.jj]jXU/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.load_pub_key_biojjj}r](j]j]j]j]j]ujKjhj]r]jX7Load an RSA public key from an M2Crypto.BIO.BIO object.r]r]}r](jUjNjNjhjj]ubaubj)r]}r](jUjj]jNjjj}r](j]j]j]j]j]ujNjhj]r](j)r]}r](jUj}r](j]j]j]j]j]ujj]j]r](j)r]}r](jX Parametersjj]jj]jjj}r](j]j]j]j]j]ujKj]r]jX Parametersr]r]}r](jUjj]ubaubj)r]}r](jUj}r](j]j]j]j]j]ujj]j]r]j)r]}r](jXGbio -- M2Crypto.BIO.BIO object containing RSA public key in PEM format.j}r](j]j]j]j]j]ujj]j]r](j)r]}r](jXbioj}r](j]j]jj]j]j]ujj]j]r]jXbior]r]}r](jUjj]ubajjubjX – r]r^}r^(jUjj]ubjX@M2Crypto.BIO.BIO object containing RSA public key in PEM format.r^r^}r^(jUjNjNjhjj]ubejjubajjubejjubj)r^}r^(jUj}r^(j]j]j]j]j]ujj]j]r^(j)r ^}r ^(jXReturnsjj^jj]jjj}r ^(j]j]j]j]j]ujKj]r ^jXReturnsr ^r^}r^(jUjj ^ubaubj)r^}r^(jUj}r^(j]j]j]j]j]ujj^j]r^j)r^}r^(jXM2Crypto.RSA.RSA_pub object.j}r^(j]j]j]j]j]ujj^j]r^jXM2Crypto.RSA.RSA_pub object.r^r^}r^(jUjNjNjhjj^ubajjubajjubejjubeubeubeubj?)r^}r^(jUjj#OjNjjCj}r^(j]j]j]j]j]Uentries]r^(jFX&new_pub_key() (in module M2Crypto.RSA)j6UNtr^aujNjhj]ubjM)r ^}r!^(jUjj#OjNjjPj}r"^(jRjSXpyj]j]j]j]j]jTXfunctionr#^jVj#^ujNjhj]r$^(jX)r%^}r&^(jXnew_pub_key(e_n)jj ^jXP/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.new_pub_keyr'^jj\j}r(^(j]r)^j6aj_j`X M2Crypto.RSAr*^r+^}r,^bj]j]j]j]r-^j6ajeX new_pub_keyr.^jgUjhujNjhj]r/^(ju)r0^}r1^(jX M2Crypto.RSA.jj%^jj'^jjxj}r2^(jojpj]j]j]j]j]ujNjhj]r3^jX M2Crypto.RSA.r4^r5^}r6^(jUjNjNjhjj0^ubaubj~)r7^}r8^(jj.^jj%^jj'^jjj}r9^(jojpj]j]j]j]j]ujNjhj]r:^jX new_pub_keyr;^r<^}r=^(jUjNjNjhjj7^ubaubj)r>^}r?^(jXe_njj%^jj'^jjj}r@^(jojpj]j]j]j]j]ujNjhj]rA^j)rB^}rC^(jXe_nj}rD^(jojpj]j]j]j]j]ujj>^j]rE^jXe_nrF^rG^}rH^(jUjjB^ubajjubaubj)rI^}rJ^(jUjj%^jNjjj}rK^(Uexprjj]j]j]j]j]ujNjhj]rL^j!)rM^}rN^(jUj}rO^(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj.^ujjI^j]rP^j)rQ^}rR^(jUj}rS^(j]j]rT^jaj]j]j]ujjM^j]rU^jX[source]rV^rW^}rX^(jUjjQ^ubajjubajj%ubaubeubj)rY^}rZ^(jUjj ^jj'^jjj}r[^(j]j]j]j]j]ujNjhj]r\^(j)r]^}r^^(jX3Instantiate an RSA_pub object from an (e, n) tuple.jjY^jXP/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.new_pub_keyjjj}r_^(j]j]j]j]j]ujKjhj]r`^jX3Instantiate an RSA_pub object from an (e, n) tuple.ra^rb^}rc^(jUjNjNjhjj]^ubaubj)rd^}re^(jUjjY^jNjjj}rf^(j]j]j]j]j]ujNjhj]rg^(j)rh^}ri^(jUj}rj^(j]j]j]j]j]ujjd^j]rk^(j)rl^}rm^(jX Parametersjjh^jj'^jjj}rn^(j]j]j]j]j]ujKj]ro^jX Parametersrp^rq^}rr^(jUjjl^ubaubj)rs^}rt^(jUj}ru^(j]j]j]j]j]ujjh^j]rv^j^ )rw^}rx^(jUj}ry^(j]j]j]j]j]ujjs^j]rz^(jc )r{^}r|^(jUj}r}^(j]j]j]j]j]ujjw^j]r~^j)r^}r^(jXe -- The RSA public exponent; it is a string in OpenSSL's MPINT format - 4-byte big-endian bit-count followed by the appropriate number of bits.j}r^(j]j]j]j]j]ujj{^j]r^(j)r^}r^(jXej}r^(j]j]jj]j]j]ujj^j]r^jXer^}r^(jUjj^ubajjubjX – r^r^}r^(jUjj^ubjXThe RSA public exponent; it is a string in OpenSSL’s MPINT format - 4-byte big-endian bit-count followed by the appropriate number of bits.r^r^}r^(jUjNjNjhjj^ubejjubajjy ubjc )r^}r^(jUj}r^(j]j]j]j]j]ujjw^j]r^j)r^}r^(jXn -- The RSA composite of primes; it is a string in OpenSSL's MPINT format - 4-byte big-endian bit-count followed by the appropriate number of bits.j}r^(j]j]j]j]j]ujj^j]r^(j)r^}r^(jXnj}r^(j]j]jj]j]j]ujj^j]r^jXnr^}r^(jUjj^ubajjubjX – r^r^}r^(jUjj^ubjXThe RSA composite of primes; it is a string in OpenSSL’s MPINT format - 4-byte big-endian bit-count followed by the appropriate number of bits.r^r^}r^(jUjNjNjhjj^ubejjubajjy ubejj ubajjubejjubj)r^}r^(jUj}r^(j]j]j]j]j]ujjd^j]r^(j)r^}r^(jXReturnsjj^jj'^jjj}r^(j]j]j]j]j]ujKj]r^jXReturnsr^r^}r^(jUjj^ubaubj)r^}r^(jUj}r^(j]j]j]j]j]ujj^j]r^j)r^}r^(jXM2Crypto.RSA.RSA_pub object.j}r^(j]j]j]j]j]ujj^j]r^jXM2Crypto.RSA.RSA_pub object.r^r^}r^(jUjNjNjhjj^ubajjubajjubejjubeubeubeubj?)r^}r^(jUjj#OjNjjCj}r^(j]j]j]j]j]Uentries]r^(jFX$rsa_error() (in module M2Crypto.RSA)hcUNtr^aujNjhj]ubjM)r^}r^(jUjj#OjNjjPj}r^(jRjSXpyj]j]j]j]j]jTXfunctionr^jVj^ujNjhj]r^(jX)r^}r^(jX rsa_error()jj^jXN/home/matej/Build/m2crypto/M2Crypto/RSA.py:docstring of M2Crypto.RSA.rsa_errorr^jj\j}r^(j]r^hcaj_j`X M2Crypto.RSAr^r^}r^bj]j]j]j]r^hcajeX rsa_errorr^jgUjhujNjhj]r^(ju)r^}r^(jX M2Crypto.RSA.jj^jj^jjxj}r^(jojpj]j]j]j]j]ujNjhj]r^jX M2Crypto.RSA.r^r^}r^(jUjNjNjhjj^ubaubj~)r^}r^(jj^jj^jj^jjj}r^(jojpj]j]j]j]j]ujNjhj]r^jX rsa_errorr^r^}r^(jUjNjNjhjj^ubaubj)r^}r^(jUjj^jj^jjj}r^(jojpj]j]j]j]j]ujNjhj]ubj)r^}r^(jUjj^jNjjj}r^(Uexprjj]j]j]j]j]ujNjhj]r^j!)r^}r^(jUj}r^(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RSAUrefidj^ujj^j]r^j)r^}r^(jUj}r^(j]j]r^jaj]j]j]ujj^j]r^jX[source]r^r^}r^(jUjj^ubajjubajj%ubaubeubj)r^}r^(jUjj^jj^jjj}r^(j]j]j]j]j]ujNjhj]ubeubeubj)r^}r^(jUjjjjjjj}r^(j]j]j]j]r^(Xmodule-M2Crypto.Randr^U rand-moduler^ej]r^j_aujKmjhj]r^(j )r^}r^(jX:mod:`Rand` Moduler^jj^jjjj j}r^(j]j]j]j]j]ujKmjhj]r^(j!)r^}r_(jX :mod:`Rand`r_jj^jjjj%j}r_(UreftypeXmodj'j(XRandU refdomainXpyr_j]j]U refexplicitj]j]j]j*j+j,Nj-jBXujKlj]r_j0)r_}r_(jj_j}r_(j]j]r_(j5j_Xpy-modr _ej]j]j]ujj^j]r _jXRandr _r _}r _(jUjj_ubajj;ubaubjX Moduler_r_}r_(jUjNjNjhjj^ubeubj?)r_}r_(jUjj^jXF/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Randr_jjCj}r_(j]j]j]j]j]Uentries]r_(jFXM2Crypto.Rand (module)Xmodule-M2Crypto.RandUNtr_aujKjhj]ubj)r_}r_(jXDM2Crypto wrapper for OpenSSL PRNG. Requires OpenSSL 0.9.5 and above.jj^jXF/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Randr_jjj}r_(j]j]j]j]j]ujKjhj]r_jXDM2Crypto wrapper for OpenSSL PRNG. Requires OpenSSL 0.9.5 and above.r_r_}r_(jUjNjNjhjj_ubaubj)r_}r _(jXuCopyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Copyright (c) 2014-2017 Matej Cepl. All rights reserved.jj^jj_jjj}r!_(j]j]j]j]j]ujKjhj]r"_jXuCopyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Copyright (c) 2014-2017 Matej Cepl. All rights reserved.r#_r$_}r%_(jUjNjNjhjj_ubaubj)r&_}r'_(jX(See LICENCE for the license information.jj^jj_jjj}r(_(j]j]j]j]j]ujKjhj]r)_jX(See LICENCE for the license information.r*_r+_}r,_(jUjNjNjhjj&_ubaubj?)r-_}r._(jUjj^jNjjCj}r/_(j]j]j]j]j]Uentries]r0_(jFX%rand_seed() (in module M2Crypto.Rand)jtUNtr1_aujNjhj]ubjM)r2_}r3_(jUjj^jNjjPj}r4_(jRjSXpyj]j]j]j]j]jTXfunctionr5_jVj5_ujNjhj]r6_(jX)r7_}r8_(jXrand_seed(seed)jj2_jXP/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.rand_seedr9_jj\j}r:_(j]r;_jtaj_j`X M2Crypto.Randr<_r=_}r>_bj]j]j]j]r?_jtajeX rand_seedr@_jgUjhujNjhj]rA_(ju)rB_}rC_(jXM2Crypto.Rand.jj7_jj9_jjxj}rD_(jojpj]j]j]j]j]ujNjhj]rE_jXM2Crypto.Rand.rF_rG_}rH_(jUjNjNjhjjB_ubaubj~)rI_}rJ_(jj@_jj7_jj9_jjj}rK_(jojpj]j]j]j]j]ujNjhj]rL_jX rand_seedrM_rN_}rO_(jUjNjNjhjjI_ubaubj)rP_}rQ_(jXseedjj7_jj9_jjj}rR_(jojpj]j]j]j]j]ujNjhj]rS_j)rT_}rU_(jXseedj}rV_(jojpj]j]j]j]j]ujjP_j]rW_jXseedrX_rY_}rZ_(jUjjT_ubajjubaubj)r[_}r\_(jUjj7_jNjjj}r]_(Uexprjj]j]j]j]j]ujNjhj]r^_j!)r__}r`_(jUj}ra_(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RandUrefidj@_ujj[_j]rb_j)rc_}rd_(jUj}re_(j]j]rf_jaj]j]j]ujj__j]rg_jX[source]rh_ri_}rj_(jUjjc_ubajjubajj%ubaubeubj)rk_}rl_(jUjj2_jj9_jjj}rm_(j]j]j]j]j]ujNjhj]rn_(j)ro_}rp_(jX3Equivalent to rand_add() when len(seed) == entropy.jjk_jXP/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.rand_seedjjj}rq_(j]j]j]j]j]ujKjhj]rr_jX3Equivalent to rand_add() when len(seed) == entropy.rs_rt_}ru_(jUjNjNjhjjo_ubaubj)rv_}rw_(jUjjk_jNjjj}rx_(j]j]j]j]j]ujNjhj]ry_j)rz_}r{_(jUj}r|_(j]j]j]j]j]ujjv_j]r}_(j)r~_}r_(jX Parametersjjz_jj9_jjj}r_(j]j]j]j]j]ujKj]r_jX Parametersr_r_}r_(jUjj~_ubaubj)r_}r_(jUj}r_(j]j]j]j]j]ujjz_j]r_j)r_}r_(jX0seed -- added data (see description at rand_add)j}r_(j]j]j]j]j]ujj_j]r_(j)r_}r_(jXseedj}r_(j]j]jj]j]j]ujj_j]r_jXseedr_r_}r_(jUjj_ubajjubjX – r_r_}r_(jUjj_ubjX(added data (see description at rand_add)r_r_}r_(jUjNjNjhjj_ubejjubajjubejjubaubeubeubj?)r_}r_(jUjj^jXO/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.rand_addr_jjCj}r_(j]j]j]j]j]Uentries]r_(jFX$rand_add() (in module M2Crypto.Rand)jcUNtr_aujNjhj]ubjM)r_}r_(jUjj^jj_jjPj}r_(jRjSXpyj]j]j]j]j]jTXfunctionr_jVj_ujNjhj]r_(jX)r_}r_(jXrand_add(blob, entropy)jj_jXO/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.rand_addr_jj\j}r_(j]r_jcaj_j`X M2Crypto.Randr_r_}r_bj]j]j]j]r_jcajeXrand_addr_jgUjhujNjhj]r_(ju)r_}r_(jXM2Crypto.Rand.jj_jj_jjxj}r_(jojpj]j]j]j]j]ujNjhj]r_jXM2Crypto.Rand.r_r_}r_(jUjNjNjhjj_ubaubj~)r_}r_(jj_jj_jj_jjj}r_(jojpj]j]j]j]j]ujNjhj]r_jXrand_addr_r_}r_(jUjNjNjhjj_ubaubj)r_}r_(jX blob, entropyjj_jj_jjj}r_(jojpj]j]j]j]j]ujNjhj]r_(j)r_}r_(jXblobj}r_(jojpj]j]j]j]j]ujj_j]r_jXblobr_r_}r_(jUjj_ubajjubj)r_}r_(jXentropyj}r_(jojpj]j]j]j]j]ujj_j]r_jXentropyr_r_}r_(jUjj_ubajjubeubj)r_}r_(jUjj_jNjjj}r_(Uexprjj]j]j]j]j]ujNjhj]r_j!)r_}r_(jUj}r_(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RandUrefidj_ujj_j]r_j)r_}r_(jUj}r_(j]j]r_jaj]j]j]ujj_j]r_jX[source]r_r_}r_(jUjj_ubajjubajj%ubaubeubj)r_}r_(jUjj_jj_jjj}r_(j]j]j]j]j]ujNjhj]r_(j)r_}r_(jXMixes blob into the PRNG state.jj_jj_jjj}r_(j]j]j]j]j]ujKjhj]r_jXMixes blob into the PRNG state.r_r_}r_(jUjNjNjhjj_ubaubj)r_}r_(jUjj_jj_jjj}r_(j]j]j]j]j]ujNjhj]r_j)r_}r_(jUj}r_(j]j]j]j]j]ujj_j]r_(j)r_}r_(jX Parametersjj_jj_jjj}r_(j]j]j]j]j]ujKj]r_jX Parametersr_r_}r_(jUjj_ubaubj)r_}r_(jUj}r_(j]j]j]j]j]ujj_j]r_j^ )r_}r_(jUj}r`(j]j]j]j]j]ujj_j]r`(jc )r`}r`(jUj}r`(j]j]j]j]j]ujj_j]r`j)r`}r`(jXblob -- added dataj}r`(j]j]j]j]j]ujj`j]r `(j)r `}r `(jXblobj}r `(j]j]jj]j]j]ujj`j]r `jXblobr`r`}r`(jUjj `ubajjubjX – r`r`}r`(jUjj`ubjX added datar`r`}r`(jUjNjNjhjj`ubejjubajjy ubjc )r`}r`(jUj}r`(j]j]j]j]j]ujj_j]r`j)r`}r`(jXkentropy -- (the lower bound of) an estimate of how much randomness is contained in blob, measured in bytes.j}r`(j]j]j]j]j]ujj`j]r`(j)r`}r `(jXentropyj}r!`(j]j]jj]j]j]ujj`j]r"`jXentropyr#`r$`}r%`(jUjj`ubajjubjX – r&`r'`}r(`(jUjj`ubjX`(the lower bound of) an estimate of how much randomness is contained in blob, measured in bytes.r)`r*`}r+`(jUjNjNjhjj`ubejjubajjy ubejj ubajjubejjubaubj)r,`}r-`(jXThus, if the data at buf are unpredictable to an adversary, this increases the uncertainty about the state and makes the PRNG output less predictable. Suitable input comes from user interaction (random key presses, mouse movements) and certain hardware events.jj_jj_jjj}r.`(j]j]j]j]j]ujKjhj]r/`jXThus, if the data at buf are unpredictable to an adversary, this increases the uncertainty about the state and makes the PRNG output less predictable. Suitable input comes from user interaction (random key presses, mouse movements) and certain hardware events.r0`r1`}r2`(jUjNjNjhjj,`ubaubj)r3`}r4`(jXtDetails about sources of randomness and how to estimate their entropy can be found in the literature, e.g. RFC 1750.jj_jj_jjj}r5`(j]j]j]j]j]ujK jhj]r6`jXtDetails about sources of randomness and how to estimate their entropy can be found in the literature, e.g. RFC 1750.r7`r8`}r9`(jUjNjNjhjj3`ubaubeubeubj?)r:`}r;`(jUjj^jNjjCj}r<`(j]j]j]j]j]Uentries]r=`(jFX%load_file() (in module M2Crypto.Rand)h#UNtr>`aujNjhj]ubjM)r?`}r@`(jUjj^jNjjPj}rA`(jRjSXpyj]j]j]j]j]jTXfunctionrB`jVjB`ujNjhj]rC`(jX)rD`}rE`(jXload_file(filename, max_bytes)jj?`jXP/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.load_filerF`jj\j}rG`(j]rH`h#aj_j`X M2Crypto.RandrI`rJ`}rK`bj]j]j]j]rL`h#ajeX load_filerM`jgUjhujNjhj]rN`(ju)rO`}rP`(jXM2Crypto.Rand.jjD`jjF`jjxj}rQ`(jojpj]j]j]j]j]ujNjhj]rR`jXM2Crypto.Rand.rS`rT`}rU`(jUjNjNjhjjO`ubaubj~)rV`}rW`(jjM`jjD`jjF`jjj}rX`(jojpj]j]j]j]j]ujNjhj]rY`jX load_filerZ`r[`}r\`(jUjNjNjhjjV`ubaubj)r]`}r^`(jXfilename, max_bytesjjD`jjF`jjj}r_`(jojpj]j]j]j]j]ujNjhj]r``(j)ra`}rb`(jXfilenamej}rc`(jojpj]j]j]j]j]ujj]`j]rd`jXfilenamere`rf`}rg`(jUjja`ubajjubj)rh`}ri`(jX max_bytesj}rj`(jojpj]j]j]j]j]ujj]`j]rk`jX max_bytesrl`rm`}rn`(jUjjh`ubajjubeubj)ro`}rp`(jUjjD`jNjjj}rq`(Uexprjj]j]j]j]j]ujNjhj]rr`j!)rs`}rt`(jUj}ru`(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RandUrefidjM`ujjo`j]rv`j)rw`}rx`(jUj}ry`(j]j]rz`jaj]j]j]ujjs`j]r{`jX[source]r|`r}`}r~`(jUjjw`ubajjubajj%ubaubeubj)r`}r`(jUjj?`jjF`jjj}r`(j]j]j]j]j]ujNjhj]r`(j)r`}r`(jXDRead a number of bytes from file filename and adds them to the PRNG.jj`jXP/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.load_filer`jjj}r`(j]j]j]j]j]ujKjhj]r`jXDRead a number of bytes from file filename and adds them to the PRNG.r`r`}r`(jUjNjNjhjj`ubaubj)r`}r`(jXIf max_bytes is non-negative, up to to max_bytes are read; starting with OpenSSL 0.9.5, if max_bytes is -1, the complete file is read.jj`jj`jjj}r`(j]j]j]j]j]ujKjhj]r`jXIf max_bytes is non-negative, up to to max_bytes are read; starting with OpenSSL 0.9.5, if max_bytes is -1, the complete file is read.r`r`}r`(jUjNjNjhjj`ubaubj)r`}r`(jUjj`jNjjj}r`(j]j]j]j]j]ujNjhj]r`(j)r`}r`(jUj}r`(j]j]j]j]j]ujj`j]r`(j)r`}r`(jX Parametersjj`jjF`jjj}r`(j]j]j]j]j]ujKj]r`jX Parametersr`r`}r`(jUjj`ubaubj)r`}r`(jUj}r`(j]j]j]j]j]ujj`j]r`j^ )r`}r`(jUj}r`(j]j]j]j]j]ujj`j]r`(jc )r`}r`(jUj}r`(j]j]j]j]j]ujj`j]r`j)r`}r`(jX filename -- j}r`(j]j]j]j]j]ujj`j]r`(j)r`}r`(jXfilenamej}r`(j]j]jj]j]j]ujj`j]r`jXfilenamer`r`}r`(jUjj`ubajjubjX – r`r`}r`(jUjj`ubejjubajjy ubjc )r`}r`(jUj}r`(j]j]j]j]j]ujj`j]r`j)r`}r`(jX max_bytes -- j}r`(j]j]j]j]j]ujj`j]r`(j)r`}r`(jX max_bytesj}r`(j]j]jj]j]j]ujj`j]r`jX max_bytesr`r`}r`(jUjj`ubajjubjX – r`r`}r`(jUjj`ubejjubajjy ubejj ubajjubejjubj)r`}r`(jUj}r`(j]j]j]j]j]ujj`j]r`(j)r`}r`(jXReturnsjj`jjF`jjj}r`(j]j]j]j]j]ujKj]r`jXReturnsr`r`}r`(jUjj`ubaubj)r`}r`(jUj}r`(j]j]j]j]j]ujj`j]r`j)r`}r`(jXthe number of bytes read.j}r`(j]j]j]j]j]ujj`j]r`jXthe number of bytes read.r`r`}r`(jUjNjNjhjj`ubajjubajjubejjubeubeubeubj?)r`}r`(jUjj^jNjjCj}r`(j]j]j]j]j]Uentries]r`(jFX%save_file() (in module M2Crypto.Rand)j7UNtr`aujNjhj]ubjM)r`}r`(jUjj^jNjjPj}r`(jRjSXpyj]j]j]j]j]jTXfunctionr`jVj`ujNjhj]r`(jX)r`}r`(jXsave_file(filename)jj`jXP/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.save_filer`jj\j}r`(j]r`j7aj_j`X M2Crypto.Randr`r`}r`bj]j]j]j]r`j7ajeX save_filer`jgUjhujNjhj]r`(ju)r`}r`(jXM2Crypto.Rand.jj`jj`jjxj}r`(jojpj]j]j]j]j]ujNjhj]r`jXM2Crypto.Rand.r`r`}r`(jUjNjNjhjj`ubaubj~)r`}ra(jj`jj`jj`jjj}ra(jojpj]j]j]j]j]ujNjhj]rajX save_filerara}ra(jUjNjNjhjj`ubaubj)ra}ra(jXfilenamejj`jj`jjj}ra(jojpj]j]j]j]j]ujNjhj]r aj)r a}r a(jXfilenamej}r a(jojpj]j]j]j]j]ujjaj]r ajXfilenamerara}ra(jUjj aubajjubaubj)ra}ra(jUjj`jNjjj}ra(Uexprjj]j]j]j]j]ujNjhj]raj!)ra}ra(jUj}ra(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RandUrefidj`ujjaj]raj)ra}ra(jUj}ra(j]j]rajaj]j]j]ujjaj]rajX[source]rara}r a(jUjjaubajjubajj%ubaubeubj)r!a}r"a(jUjj`jj`jjj}r#a(j]j]j]j]j]ujNjhj]r$a(j)r%a}r&a(jX8Write a number of random bytes (currently 1024) to file.jj!ajXP/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.save_filer'ajjj}r(a(j]j]j]j]j]ujKjhj]r)ajX8Write a number of random bytes (currently 1024) to file.r*ar+a}r,a(jUjNjNjhjj%aubaubj)r-a}r.a(jX[The file then can be used to initialize the PRNG by calling load_file() in a later session.jj!ajj'ajjj}r/a(j]j]j]j]j]ujKjhj]r0ajX[The file then can be used to initialize the PRNG by calling load_file() in a later session.r1ar2a}r3a(jUjNjNjhjj-aubaubj)r4a}r5a(jUjj!ajNjjj}r6a(j]j]j]j]j]ujNjhj]r7a(j)r8a}r9a(jUj}r:a(j]j]j]j]j]ujj4aj]r;a(j)ra(j]j]j]j]j]ujKj]r?ajX Parametersr@arAa}rBa(jUjjb}r?b(jUjNjNjhjj8bubaubj)r@b}rAb(jXPseudo-random byte sequences generated by this method will be unique if they are of sufficient length, but are not necessarily unpredictable. They can be used for non-cryptographic purposes and for certain purposes in cryptographic protocols, but usually not for key generation etc.jj4bjj:bjjj}rBb(j]j]j]j]j]ujKjhj]rCbjXPseudo-random byte sequences generated by this method will be unique if they are of sufficient length, but are not necessarily unpredictable. They can be used for non-cryptographic purposes and for certain purposes in cryptographic protocols, but usually not for key generation etc.rDbrEb}rFb(jUjNjNjhjj@bubaubj)rGb}rHb(jXOutput of the function is mixed into the entropy pool before retrieving the new pseudo-random bytes unless disabled at compile time (see FAQ).jj4bjj:bjjj}rIb(j]j]j]j]j]ujK jhj]rJbjXOutput of the function is mixed into the entropy pool before retrieving the new pseudo-random bytes unless disabled at compile time (see FAQ).rKbrLb}rMb(jUjNjNjhjjGbubaubj)rNb}rOb(jUjj4bjNjjj}rPb(j]j]j]j]j]ujNjhj]rQb(j)rRb}rSb(jUj}rTb(j]j]j]j]j]ujjNbj]rUb(j)rVb}rWb(jX ParametersjjRbjjbjjj}rXb(j]j]j]j]j]ujKj]rYbjX ParametersrZbr[b}r\b(jUjjVbubaubj)r]b}r^b(jUj}r_b(j]j]j]j]j]ujjRbj]r`bj)rab}rbb(jX%num -- number of bytes to be returnedj}rcb(j]j]j]j]j]ujj]bj]rdb(j)reb}rfb(jXnumj}rgb(j]j]jj]j]j]ujjabj]rhbjXnumribrjb}rkb(jUjjebubajjubjX – rlbrmb}rnb(jUjjabubjXnumber of bytes to be returnedrobrpb}rqb(jUjNjNjhjjabubejjubajjubejjubj)rrb}rsb(jUj}rtb(j]j]j]j]j]ujjNbj]rub(j)rvb}rwb(jXReturnsjjrbjjbjjj}rxb(j]j]j]j]j]ujKj]rybjXReturnsrzbr{b}r|b(jUjjvbubaubj)r}b}r~b(jUj}rb(j]j]j]j]j]ujjrbj]rbj)rb}rb(jX random bytesj}rb(j]j]j]j]j]ujj}bj]rbjX random bytesrbrb}rb(jUjNjNjhjjbubajjubajjubejjubeubeubeubj?)rb}rb(jUjj^jNjjCj}rb(j]j]j]j]j]Uentries]rb(jFX*rand_file_name() (in module M2Crypto.Rand)jUNtrbaujNjhj]ubjM)rb}rb(jUjj^jNjjPj}rb(jRjSXpyj]j]j]j]j]jTXfunctionrbjVjbujNjhj]rb(jX)rb}rb(jXrand_file_name()jjbjXU/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.rand_file_namerbjj\j}rb(j]rbjaj_j`X M2Crypto.Randrbrb}rbbj]j]j]j]rbjajeXrand_file_namerbjgUjhujNjhj]rb(ju)rb}rb(jXM2Crypto.Rand.jjbjjbjjxj}rb(jojpj]j]j]j]j]ujNjhj]rbjXM2Crypto.Rand.rbrb}rb(jUjNjNjhjjbubaubj~)rb}rb(jjbjjbjjbjjj}rb(jojpj]j]j]j]j]ujNjhj]rbjXrand_file_namerbrb}rb(jUjNjNjhjjbubaubj)rb}rb(jUjjbjjbjjj}rb(jojpj]j]j]j]j]ujNjhj]ubj)rb}rb(jUjjbjNjjj}rb(Uexprjj]j]j]j]j]ujNjhj]rbj!)rb}rb(jUj}rb(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RandUrefidjbujjbj]rbj)rb}rb(jUj}rb(j]j]rbjaj]j]j]ujjbj]rbjX[source]rbrb}rb(jUjjbubajjubajj%ubaubeubj)rb}rb(jUjjbjjbjjj}rb(j]j]j]j]j]ujNjhj]rb(j)rb}rb(jX1Generate a default path for the random seed file.jjbjXU/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.rand_file_namejjj}rb(j]j]j]j]j]ujKjhj]rbjX1Generate a default path for the random seed file.rbrb}rb(jUjNjNjhjjbubaubj)rb}rb(jUjjbjNjjj}rb(j]j]j]j]j]ujNjhj]rbj)rb}rb(jUj}rb(j]j]j]j]j]ujjbj]rb(j)rb}rb(jXReturnsjjbjjbjjj}rb(j]j]j]j]j]ujKj]rbjXReturnsrbrb}rb(jUjjbubaubj)rb}rb(jUj}rb(j]j]j]j]j]ujjbj]rbj)rb}rb(jXstring with the filename. The seed file is $RANDFILE if that environment variable is set, $HOME/.rnd otherwise. If $HOME is not set either, an error occurs.j}rb(j]j]j]j]j]ujjbj]rbjXstring with the filename. The seed file is $RANDFILE if that environment variable is set, $HOME/.rnd otherwise. If $HOME is not set either, an error occurs.rbrb}rb(jUjNjNjhjjbubajjubajjubejjubaubeubeubj?)rb}rb(jUjj^jNjjCj}rb(j]j]j]j]j]Uentries]rb(jFX'rand_status() (in module M2Crypto.Rand)h`UNtrbaujNjhj]ubjM)rb}rb(jUjj^jNjjPj}rb(jRjSXpyj]j]j]j]j]jTXfunctionrbjVjbujNjhj]rb(jX)rb}rb(jX rand_status()jjbjXR/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.rand_statusrbjj\j}rb(j]rbh`aj_j`X M2Crypto.Randrbrb}rbbj]j]j]j]rbh`ajeX rand_statusrbjgUjhujNjhj]rb(ju)rb}rb(jXM2Crypto.Rand.jjbjjbjjxj}rb(jojpj]j]j]j]j]ujNjhj]rbjXM2Crypto.Rand.rbrb}rb(jUjNjNjhjjbubaubj~)rb}rc(jjbjjbjjbjjj}rc(jojpj]j]j]j]j]ujNjhj]rcjX rand_statusrcrc}rc(jUjNjNjhjjbubaubj)rc}rc(jUjjbjjbjjj}rc(jojpj]j]j]j]j]ujNjhj]ubj)r c}r c(jUjjbjNjjj}r c(Uexprjj]j]j]j]j]ujNjhj]r cj!)r c}rc(jUj}rc(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/RandUrefidjbujj cj]rcj)rc}rc(jUj}rc(j]j]rcjaj]j]j]ujj cj]rcjX[source]rcrc}rc(jUjjcubajjubajj%ubaubeubj)rc}rc(jUjjbjjbjjj}rc(j]j]j]j]j]ujNjhj]rc(j)rc}rc(jX.Check whether there is enough entropy in PRNG.jjcjXR/home/matej/Build/m2crypto/M2Crypto/Rand.py:docstring of M2Crypto.Rand.rand_statusjjj}rc(j]j]j]j]j]ujKjhj]r cjX.Check whether there is enough entropy in PRNG.r!cr"c}r#c(jUjNjNjhjjcubaubj)r$c}r%c(jUjjcjNjjj}r&c(j]j]j]j]j]ujNjhj]r'cj)r(c}r)c(jUj}r*c(j]j]j]j]j]ujj$cj]r+c(j)r,c}r-c(jXReturnsjj(cjjbjjj}r.c(j]j]j]j]j]ujKj]r/cjXReturnsr0cr1c}r2c(jUjj,cubaubj)r3c}r4c(jUj}r5c(j]j]j]j]j]ujj(cj]r6cj)r7c}r8c(jX<1 if the PRNG has been seeded with enough data, 0 otherwise.j}r9c(j]j]j]j]j]ujj3cj]r:cjX<1 if the PRNG has been seeded with enough data, 0 otherwise.r;crc}r?c(jUjjjjjjj}r@c(j]j]j]j]rAc(Xmodule-M2Crypto.SMIMErBcU smime-modulerCcej]rDcj9aujKujhj]rEc(j )rFc}rGc(jX:mod:`SMIME` ModulerHcjj>cjjjj j}rIc(j]j]j]j]j]ujKujhj]rJc(j!)rKc}rLc(jX :mod:`SMIME`rMcjjFcjjjj%j}rNc(UreftypeXmodj'j(XSMIMEU refdomainXpyrOcj]j]U refexplicitj]j]j]j*j+j,Nj-X M2Crypto.RandrPcujKtj]rQcj0)rRc}rSc(jjMcj}rTc(j]j]rUc(j5jOcXpy-modrVcej]j]j]ujjKcj]rWcjXSMIMErXcrYc}rZc(jUjjRcubajj;ubaubjX Moduler[cr\c}r]c(jUjNjNjhjjFcubeubj?)r^c}r_c(jUjj>cjXO/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.Cipherr`cjjCj}rac(j]j]j]j]j]Uentries]rbc(jFXM2Crypto.SMIME (module)Xmodule-M2Crypto.SMIMEUNtrccaujKjhj]ubj?)rdc}rec(jUjj>cjXO/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.CipherrfcjjCj}rgc(j]j]j]j]j]Uentries]rhc(jFX Cipher (class in M2Crypto.SMIME)h?UNtricaujNjhj]ubjM)rjc}rkc(jUjj>cjjfcjjPj}rlc(jRjSXpyj]j]j]j]j]jTXclassrmcjVjmcujNjhj]rnc(jX)roc}rpc(jX Cipher(algo)jjjcjXO/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.Cipherrqcjj\j}rrc(j]rsch?aj_j`XM2Crypto.SMIMErtcruc}rvcbj]j]j]j]rwch?ajeXCipherrxcjgUjhujNjhj]ryc(jj)rzc}r{c(jXclass jjocjjqcjjmj}r|c(jojpj]j]j]j]j]ujNjhj]r}cjXclass r~crc}rc(jUjNjNjhjjzcubaubju)rc}rc(jXM2Crypto.SMIME.jjocjjqcjjxj}rc(jojpj]j]j]j]j]ujNjhj]rcjXM2Crypto.SMIME.rcrc}rc(jUjNjNjhjjcubaubj~)rc}rc(jjxcjjocjjqcjjj}rc(jojpj]j]j]j]j]ujNjhj]rcjXCipherrcrc}rc(jUjNjNjhjjcubaubj)rc}rc(jXalgojjocjjqcjjj}rc(jojpj]j]j]j]j]ujNjhj]rcj)rc}rc(jXalgoj}rc(jojpj]j]j]j]j]ujjcj]rcjXalgorcrc}rc(jUjjcubajjubaubj)rc}rc(jUjjocjNjjj}rc(Uexprjj]j]j]j]j]ujNjhj]rcj!)rc}rc(jUj}rc(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjxcujjcj]rcj)rc}rc(jUj}rc(j]j]rcjaj]j]j]ujjcj]rcjX[source]rcrc}rc(jUjjcubajjubajj%ubaubeubj)rc}rc(jUjjjcjjqcjjj}rc(j]j]j]j]j]ujNjhj]rcj)rc}rc(jXMObject interface to EVP_CIPHER without all the frills of M2Crypto.EVP.Cipher.jjcjjfcjjj}rc(j]j]j]j]j]ujKjhj]rcjXMObject interface to EVP_CIPHER without all the frills of M2Crypto.EVP.Cipher.rcrc}rc(jUjNjNjhjjcubaubaubeubj?)rc}rc(jUjj>cjNjjCj}rc(j]j]j]j]j]Uentries]rc(jFXPKCS7 (class in M2Crypto.SMIME)hfUNtrcaujNjhj]ubjM)rc}rc(jUjj>cjNjjPj}rc(jRjSXpyj]j]j]j]j]jTXclassrcjVjcujNjhj]rc(jX)rc}rc(jXPKCS7(pkcs7=None, _pyfree=0)jjcjXN/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.PKCS7rcjj\j}rc(j]rchfaj_j`XM2Crypto.SMIMErcrc}rcbj]j]j]j]rchfajeXPKCS7rcjgUjhujNjhj]rc(jj)rc}rc(jXclass jjcjjcjjmj}rc(jojpj]j]j]j]j]ujNjhj]rcjXclass rcrc}rc(jUjNjNjhjjcubaubju)rc}rc(jXM2Crypto.SMIME.jjcjjcjjxj}rc(jojpj]j]j]j]j]ujNjhj]rcjXM2Crypto.SMIME.rcrc}rc(jUjNjNjhjjcubaubj~)rc}rc(jjcjjcjjcjjj}rc(jojpj]j]j]j]j]ujNjhj]rcjXPKCS7rcrc}rc(jUjNjNjhjjcubaubj)rc}rc(jXpkcs7=None, _pyfree=0jjcjjcjjj}rc(jojpj]j]j]j]j]ujNjhj]rc(j)rc}rc(jX pkcs7=Nonej}rc(jojpj]j]j]j]j]ujjcj]rcjX pkcs7=Nonercrc}rc(jUjjcubajjubj)rc}rc(jX _pyfree=0j}rc(jojpj]j]j]j]j]ujjcj]rcjX _pyfree=0rcrc}rc(jUjjcubajjubeubj)rc}rc(jUjjcjNjjj}rc(Uexprjj]j]j]j]j]ujNjhj]rcj!)rc}rc(jUj}rc(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjcujjcj]rcj)rc}rc(jUj}rc(j]j]rcjaj]j]j]ujjcj]rcjX[source]rcrc}rd(jUjjcubajjubajj%ubaubeubj)rd}rd(jUjjcjjcjjj}rd(j]j]j]j]j]ujNjhj]rd(j?)rd}rd(jUjjdjNjjCj}rd(j]j]j]j]j]Uentries]rd(jFX,get0_signers() (M2Crypto.SMIME.PKCS7 method)h>UNtr daujNjhj]ubjM)r d}r d(jUjjdjNjjPj}r d(jRjSXpyj]j]j]j]j]jTXmethodr djVj dujNjhj]rd(jX)rd}rd(jX"PKCS7.get0_signers(certs, flags=0)jj djX[/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.PKCS7.get0_signersrdjj\j}rd(j]rdh>aj_j`XM2Crypto.SMIMErdrd}rdbj]j]j]j]rdh>ajeXPKCS7.get0_signersrdjgjcjhujNjhj]rd(j~)rd}rd(jX get0_signersjjdjjdjjj}rd(jojpj]j]j]j]j]ujNjhj]rdjX get0_signersrdrd}r d(jUjNjNjhjjdubaubj)r!d}r"d(jXcerts, flags=0jjdjjdjjj}r#d(jojpj]j]j]j]j]ujNjhj]r$d(j)r%d}r&d(jXcertsj}r'd(jojpj]j]j]j]j]ujj!dj]r(djXcertsr)dr*d}r+d(jUjj%dubajjubj)r,d}r-d(jXflags=0j}r.d(jojpj]j]j]j]j]ujj!dj]r/djXflags=0r0dr1d}r2d(jUjj,dubajjubeubj)r3d}r4d(jUjjdjNjjj}r5d(Uexprjj]j]j]j]j]ujNjhj]r6dj!)r7d}r8d(jUj}r9d(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjdujj3dj]r:dj)r;d}rdjaj]j]j]ujj7dj]r?djX[source]r@drAd}rBd(jUjj;dubajjubajj%ubaubeubj)rCd}rDd(jUjj djjdjjj}rEd(j]j]j]j]j]ujNjhj]ubeubj?)rFd}rGd(jUjjdjNjjCj}rHd(j]j]j]j]j]Uentries]rId(jFX-m2_pkcs7_free() (M2Crypto.SMIME.PKCS7 method)hrUNtrJdaujNjhj]ubjM)rKd}rLd(jUjjdjNjjPj}rMd(jRjSXpyj]j]j]j]j]jTXmethodrNdjVjNdujNjhj]rOd(jX)rPd}rQd(jXPKCS7.m2_pkcs7_freejjKdjX\/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.PKCS7.m2_pkcs7_freerRdjj\j}rSd(j]rTdhraj_j`XM2Crypto.SMIMErUdrVd}rWdbj]j]j]j]rXdhrajeXPKCS7.m2_pkcs7_freejgjcjhujNjhj]rYd(j~)rZd}r[d(jX m2_pkcs7_freejjPdjjRdjjj}r\d(jojpj]j]j]j]j]ujNjhj]r]djX m2_pkcs7_freer^dr_d}r`d(jUjNjNjhjjZdubaubj)rad}rbd(jUjjPdjjRdjjj}rcd(jojpj]j]j]j]j]ujNjhj]ubeubj)rdd}red(jUjjKdjjRdjjj}rfd(j]j]j]j]j]ujNjhj]ubeubj?)rgd}rhd(jUjjdjNjjCj}rid(j]j]j]j]j]Uentries]rjd(jFX$type() (M2Crypto.SMIME.PKCS7 method)hUNtrkdaujNjhj]ubjM)rld}rmd(jUjjdjNjjPj}rnd(jRjSXpyj]j]j]j]j]jTXmethodrodjVjodujNjhj]rpd(jX)rqd}rrd(jXPKCS7.type(text_name=0)jjldjXS/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.PKCS7.typersdjj\j}rtd(j]rudhaj_j`XM2Crypto.SMIMErvdrwd}rxdbj]j]j]j]rydhajeX PKCS7.typerzdjgjcjhujNjhj]r{d(j~)r|d}r}d(jXtypejjqdjjsdjjj}r~d(jojpj]j]j]j]j]ujNjhj]rdjXtyperdrd}rd(jUjNjNjhjj|dubaubj)rd}rd(jX text_name=0jjqdjjsdjjj}rd(jojpj]j]j]j]j]ujNjhj]rdj)rd}rd(jX text_name=0j}rd(jojpj]j]j]j]j]ujjdj]rdjX text_name=0rdrd}rd(jUjjdubajjubaubj)rd}rd(jUjjqdjNjjj}rd(Uexprjj]j]j]j]j]ujNjhj]rdj!)rd}rd(jUj}rd(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjzdujjdj]rdj)rd}rd(jUj}rd(j]j]rdjaj]j]j]ujjdj]rdjX[source]rdrd}rd(jUjjdubajjubajj%ubaubeubj)rd}rd(jUjjldjjsdjjj}rd(j]j]j]j]j]ujNjhj]ubeubj?)rd}rd(jUjjdjNjjCj}rd(j]j]j]j]j]Uentries]rd(jFX%write() (M2Crypto.SMIME.PKCS7 method)jeUNtrdaujNjhj]ubjM)rd}rd(jUjjdjNjjPj}rd(jRjSXpyj]j]j]j]j]jTXmethodrdjVjdujNjhj]rd(jX)rd}rd(jXPKCS7.write(bio)jjdjXT/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.PKCS7.writerdjj\j}rd(j]rdjeaj_j`XM2Crypto.SMIMErdrd}rdbj]j]j]j]rdjeajeX PKCS7.writerdjgjcjhujNjhj]rd(j~)rd}rd(jXwritejjdjjdjjj}rd(jojpj]j]j]j]j]ujNjhj]rdjXwriterdrd}rd(jUjNjNjhjjdubaubj)rd}rd(jXbiojjdjjdjjj}rd(jojpj]j]j]j]j]ujNjhj]rdj)rd}rd(jXbioj}rd(jojpj]j]j]j]j]ujjdj]rdjXbiordrd}rd(jUjjdubajjubaubj)rd}rd(jUjjdjNjjj}rd(Uexprjj]j]j]j]j]ujNjhj]rdj!)rd}rd(jUj}rd(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjdujjdj]rdj)rd}rd(jUj}rd(j]j]rdjaj]j]j]ujjdj]rdjX[source]rdrd}rd(jUjjdubajjubajj%ubaubeubj)rd}rd(jUjjdjjdjjj}rd(j]j]j]j]j]ujNjhj]ubeubj?)rd}rd(jUjjdjNjjCj}rd(j]j]j]j]j]Uentries]rd(jFX)write_der() (M2Crypto.SMIME.PKCS7 method)jRUNtrdaujNjhj]ubjM)rd}rd(jUjjdjNjjPj}rd(jRjSXpyj]j]j]j]j]jTXmethodrdjVjdujNjhj]rd(jX)rd}rd(jXPKCS7.write_der(bio)jjdjXX/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.PKCS7.write_derrdjj\j}rd(j]rdjRaj_j`XM2Crypto.SMIMErdrd}rdbj]j]j]j]rdjRajeXPKCS7.write_derrdjgjcjhujNjhj]rd(j~)rd}rd(jX write_derjjdjjdjjj}rd(jojpj]j]j]j]j]ujNjhj]rdjX write_derrdrd}rd(jUjNjNjhjjdubaubj)rd}rd(jXbiojjdjjdjjj}rd(jojpj]j]j]j]j]ujNjhj]rdj)rd}rd(jXbioj}rd(jojpj]j]j]j]j]ujjdj]rdjXbiordre}re(jUjjdubajjubaubj)re}re(jUjjdjNjjj}re(Uexprjj]j]j]j]j]ujNjhj]rej!)re}re(jUj}re(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjdujjej]r ej)r e}r e(jUj}r e(j]j]r ejaj]j]j]ujjej]rejX[source]rere}re(jUjj eubajjubajj%ubaubeubj)re}re(jUjjdjjdjjj}re(j]j]j]j]j]ujNjhj]ubeubeubeubj?)re}re(jUjj>cjXT/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.PKCS7_ErrorrejjCj}re(j]j]j]j]j]Uentries]re(jFX PKCS7_ErrorrehUNtreaujNjhj]ubjM)re}re(jUjj>cjjejjPj}re(jRjSXpyj]j]j]j]j]jTX exceptionrejVjeujNjhj]r e(jX)r!e}r"e(jjejjejXT/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.PKCS7_Errorr#ejj\j}r$e(j]r%ehaj_j`XM2Crypto.SMIMEr&er'e}r(ebj]j]j]j]r)ehajejejgUjhujNjhj]r*e(jj)r+e}r,e(jX exception jj!ejj#ejjmj}r-e(jojpj]j]j]j]j]ujNjhj]r.ejX exception r/er0e}r1e(jUjNjNjhjj+eubaubju)r2e}r3e(jXM2Crypto.SMIME.jj!ejj#ejjxj}r4e(jojpj]j]j]j]j]ujNjhj]r5ejXM2Crypto.SMIME.r6er7e}r8e(jUjNjNjhjj2eubaubj~)r9e}r:e(jjejj!ejj#ejjj}r;e(jojpj]j]j]j]j]ujNjhj]re}r?e(jUjNjNjhjj9eubaubj)r@e}rAe(jUjj!ejNjjj}rBe(Uexprjj]j]j]j]j]ujNjhj]rCej!)rDe}rEe(jUj}rFe(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjeujj@ej]rGej)rHe}rIe(jUj}rJe(j]j]rKejaj]j]j]ujjDej]rLejX[source]rMerNe}rOe(jUjjHeubajjubajj%ubaubeubj)rPe}rQe(jUjjejj#ejjj}rRe(j]j]j]j]j]ujNjhj]rSej)rTe}rUe(jX$Bases: :class:`exceptions.Exception`jjPejjejjj}rVe(j]j]j]j]j]ujKjhj]rWe(jXBases: rXerYe}rZe(jUjNjNjhjjTeubj!)r[e}r\e(jX:class:`exceptions.Exception`r]ejjTejjjj%j}r^e(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyr_ej]j]U refexplicitj]j]j]j*j+j,jej-XM2Crypto.SMIMEr`eujK)j]raej0)rbe}rce(jj]ej}rde(j]j]ree(j5j_eXpy-classrfeej]j]j]ujj[ej]rgejXexceptions.Exceptionrherie}rje(jUjjbeubajj;ubaubeubaubeubj?)rke}rle(jUjj>cjNjjCj}rme(j]j]j]j]j]Uentries]rne(jFXSMIME (class in M2Crypto.SMIME)jUNtroeaujNjhj]ubjM)rpe}rqe(jUjj>cjNjjPj}rre(jRjSXpyj]j]j]j]j]jTXclassrsejVjseujNjhj]rte(jX)rue}rve(jXSMIMErwejjpejXN/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIMErxejj\j}rye(j]rzejaj_j`XM2Crypto.SMIMEr{er|e}r}ebj]j]j]j]r~ejajejwejgUjhujNjhj]re(jj)re}re(jXclass jjuejjxejjmj}re(jojpj]j]j]j]j]ujNjhj]rejXclass rere}re(jUjNjNjhjjeubaubju)re}re(jXM2Crypto.SMIME.jjuejjxejjxj}re(jojpj]j]j]j]j]ujNjhj]rejXM2Crypto.SMIME.rere}re(jUjNjNjhjjeubaubj~)re}re(jjwejjuejjxejjj}re(jojpj]j]j]j]j]ujNjhj]rejXSMIMErere}re(jUjNjNjhjjeubaubj)re}re(jUjjuejNjjj}re(Uexprjj]j]j]j]j]ujNjhj]rej!)re}re(jUj}re(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjweujjej]rej)re}re(jUj}re(j]j]rejaj]j]j]ujjej]rejX[source]rere}re(jUjjeubajjubajj%ubaubeubj)re}re(jUjjpejjxejjj}re(j]j]j]j]j]ujNjhj]re(j?)re}re(jUjjejNjjCj}re(j]j]j]j]j]Uentries]re(jFX'decrypt() (M2Crypto.SMIME.SMIME method)hUNtreaujNjhj]ubjM)re}re(jUjjejNjjPj}re(jRjSXpyj]j]j]j]j]jTXmethodrejVjeujNjhj]re(jX)re}re(jXSMIME.decrypt(pkcs7, flags=0)jjejXV/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.decryptrejj\j}re(j]rehaj_j`XM2Crypto.SMIMErere}rebj]j]j]j]rehajeX SMIME.decryptrejgjwejhujNjhj]re(j~)re}re(jXdecryptjjejjejjj}re(jojpj]j]j]j]j]ujNjhj]rejXdecryptrere}re(jUjNjNjhjjeubaubj)re}re(jXpkcs7, flags=0jjejjejjj}re(jojpj]j]j]j]j]ujNjhj]re(j)re}re(jXpkcs7j}re(jojpj]j]j]j]j]ujjej]rejXpkcs7rere}re(jUjjeubajjubj)re}re(jXflags=0j}re(jojpj]j]j]j]j]ujjej]rejXflags=0rere}re(jUjjeubajjubeubj)re}re(jUjjejNjjj}re(Uexprjj]j]j]j]j]ujNjhj]rej!)re}re(jUj}re(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjeujjej]rej)re}re(jUj}re(j]j]rejaj]j]j]ujjej]rejX[source]rere}re(jUjjeubajjubajj%ubaubeubj)re}re(jUjjejjejjj}re(j]j]j]j]j]ujNjhj]ubeubj?)re}re(jUjjejNjjCj}re(j]j]j]j]j]Uentries]re(jFX'encrypt() (M2Crypto.SMIME.SMIME method)j"UNtreaujNjhj]ubjM)re}re(jUjjejNjjPj}re(jRjSXpyj]j]j]j]j]jTXmethodrejVjeujNjhj]re(jX)re}re(jX SMIME.encrypt(data_bio, flags=0)jjejXV/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.encryptrejj\j}re(j]rej"aj_j`XM2Crypto.SMIMErere}rebj]j]j]j]rej"ajeX SMIME.encryptrejgjwejhujNjhj]re(j~)re}rf(jXencryptjjejjejjj}rf(jojpj]j]j]j]j]ujNjhj]rfjXencryptrfrf}rf(jUjNjNjhjjeubaubj)rf}rf(jXdata_bio, flags=0jjejjejjj}rf(jojpj]j]j]j]j]ujNjhj]r f(j)r f}r f(jXdata_bioj}r f(jojpj]j]j]j]j]ujjfj]r fjXdata_biorfrf}rf(jUjj fubajjubj)rf}rf(jXflags=0j}rf(jojpj]j]j]j]j]ujjfj]rfjXflags=0rfrf}rf(jUjjfubajjubeubj)rf}rf(jUjjejNjjj}rf(Uexprjj]j]j]j]j]ujNjhj]rfj!)rf}rf(jUj}rf(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjeujjfj]rfj)r f}r!f(jUj}r"f(j]j]r#fjaj]j]j]ujjfj]r$fjX[source]r%fr&f}r'f(jUjj fubajjubajj%ubaubeubj)r(f}r)f(jUjjejjejjj}r*f(j]j]j]j]j]ujNjhj]ubeubj?)r+f}r,f(jUjjejNjjCj}r-f(j]j]j]j]j]Uentries]r.f(jFX(load_key() (M2Crypto.SMIME.SMIME method)jUNtr/faujNjhj]ubjM)r0f}r1f(jUjjejNjjPj}r2f(jRjSXpyj]j]j]j]j]jTXmethodr3fjVj3fujNjhj]r4f(jX)r5f}r6f(jXOSMIME.load_key(keyfile, certfile=None, callback=)jj0fjXW/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.load_keyr7fjj\j}r8f(j]r9fjaj_j`XM2Crypto.SMIMEr:fr;f}rfjgjwejhujNjhj]r?f(j~)r@f}rAf(jXload_keyjj5fjj7fjjj}rBf(jojpj]j]j]j]j]ujNjhj]rCfjXload_keyrDfrEf}rFf(jUjNjNjhjj@fubaubj)rGf}rHf(jX?keyfile, certfile=None, callback=jj5fjj7fjjj}rIf(jojpj]j]j]j]j]ujNjhj]rJf(j)rKf}rLf(jXkeyfilej}rMf(jojpj]j]j]j]j]ujjGfj]rNfjXkeyfilerOfrPf}rQf(jUjjKfubajjubj)rRf}rSf(jX certfile=Nonej}rTf(jojpj]j]j]j]j]ujjGfj]rUfjX certfile=NonerVfrWf}rXf(jUjjRfubajjubj)rYf}rZf(jX'callback=j}r[f(jojpj]j]j]j]j]ujjGfj]r\fjX'callback=r]fr^f}r_f(jUjjYfubajjubeubj)r`f}raf(jUjj5fjNjjj}rbf(Uexprjj]j]j]j]j]ujNjhj]rcfj!)rdf}ref(jUj}rff(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidj>fujj`fj]rgfj)rhf}rif(jUj}rjf(j]j]rkfjaj]j]j]ujjdfj]rlfjX[source]rmfrnf}rof(jUjjhfubajjubajj%ubaubeubj)rpf}rqf(jUjj0fjj7fjjj}rrf(j]j]j]j]j]ujNjhj]ubeubj?)rsf}rtf(jUjjejNjjCj}ruf(j]j]j]j]j]Uentries]rvf(jFX,load_key_bio() (M2Crypto.SMIME.SMIME method)hUNtrwfaujNjhj]ubjM)rxf}ryf(jUjjejNjjPj}rzf(jRjSXpyj]j]j]j]j]jTXmethodr{fjVj{fujNjhj]r|f(jX)r}f}r~f(jXQSMIME.load_key_bio(keybio, certbio=None, callback=)jjxfjX[/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.load_key_biorfjj\j}rf(j]rfhaj_j`XM2Crypto.SMIMErfrf}rfbj]j]j]j]rfhajeXSMIME.load_key_biorfjgjwejhujNjhj]rf(j~)rf}rf(jX load_key_biojj}fjjfjjj}rf(jojpj]j]j]j]j]ujNjhj]rfjX load_key_biorfrf}rf(jUjNjNjhjjfubaubj)rf}rf(jX=keybio, certbio=None, callback=jj}fjjfjjj}rf(jojpj]j]j]j]j]ujNjhj]rf(j)rf}rf(jXkeybioj}rf(jojpj]j]j]j]j]ujjfj]rfjXkeybiorfrf}rf(jUjjfubajjubj)rf}rf(jX certbio=Nonej}rf(jojpj]j]j]j]j]ujjfj]rfjX certbio=Nonerfrf}rf(jUjjfubajjubj)rf}rf(jX'callback=j}rf(jojpj]j]j]j]j]ujjfj]rfjX'callback=rfrf}rf(jUjjfubajjubeubj)rf}rf(jUjj}fjNjjj}rf(Uexprjj]j]j]j]j]ujNjhj]rfj!)rf}rf(jUj}rf(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjfujjfj]rfj)rf}rf(jUj}rf(j]j]rfjaj]j]j]ujjfj]rfjX[source]rfrf}rf(jUjjfubajjubajj%ubaubeubj)rf}rf(jUjjxfjjfjjj}rf(j]j]j]j]j]ujNjhj]ubeubj?)rf}rf(jUjjejNjjCj}rf(j]j]j]j]j]Uentries]rf(jFX*set_cipher() (M2Crypto.SMIME.SMIME method)jHUNtrfaujNjhj]ubjM)rf}rf(jUjjejNjjPj}rf(jRjSXpyj]j]j]j]j]jTXmethodrfjVjfujNjhj]rf(jX)rf}rf(jXSMIME.set_cipher(cipher)jjfjXY/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.set_cipherrfjj\j}rf(j]rfjHaj_j`XM2Crypto.SMIMErfrf}rfbj]j]j]j]rfjHajeXSMIME.set_cipherrfjgjwejhujNjhj]rf(j~)rf}rf(jX set_cipherjjfjjfjjj}rf(jojpj]j]j]j]j]ujNjhj]rfjX set_cipherrfrf}rf(jUjNjNjhjjfubaubj)rf}rf(jXcipherjjfjjfjjj}rf(jojpj]j]j]j]j]ujNjhj]rfj)rf}rf(jXcipherj}rf(jojpj]j]j]j]j]ujjfj]rfjXcipherrfrf}rf(jUjjfubajjubaubj)rf}rf(jUjjfjNjjj}rf(Uexprjj]j]j]j]j]ujNjhj]rfj!)rf}rf(jUj}rf(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjfujjfj]rfj)rf}rf(jUj}rf(j]j]rfjaj]j]j]ujjfj]rfjX[source]rfrf}rf(jUjjfubajjubajj%ubaubeubj)rf}rf(jUjjfjjfjjj}rf(j]j]j]j]j]ujNjhj]ubeubj?)rf}rf(jUjjejNjjCj}rf(j]j]j]j]j]Uentries]rf(jFX.set_x509_stack() (M2Crypto.SMIME.SMIME method)h@UNtrfaujNjhj]ubjM)rf}rf(jUjjejNjjPj}rf(jRjSXpyj]j]j]j]j]jTXmethodrfjVjfujNjhj]rf(jX)rf}rg(jXSMIME.set_x509_stack(stack)jjfjX]/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.set_x509_stackrgjj\j}rg(j]rgh@aj_j`XM2Crypto.SMIMErgrg}rgbj]j]j]j]rgh@ajeXSMIME.set_x509_stackrgjgjwejhujNjhj]r g(j~)r g}r g(jXset_x509_stackjjfjjgjjj}r g(jojpj]j]j]j]j]ujNjhj]r gjXset_x509_stackrgrg}rg(jUjNjNjhjj gubaubj)rg}rg(jXstackjjfjjgjjj}rg(jojpj]j]j]j]j]ujNjhj]rgj)rg}rg(jXstackj}rg(jojpj]j]j]j]j]ujjgj]rgjXstackrgrg}rg(jUjjgubajjubaubj)rg}rg(jUjjfjNjjj}rg(Uexprjj]j]j]j]j]ujNjhj]rgj!)r g}r!g(jUj}r"g(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjgujjgj]r#gj)r$g}r%g(jUj}r&g(j]j]r'gjaj]j]j]ujj gj]r(gjX[source]r)gr*g}r+g(jUjj$gubajjubajj%ubaubeubj)r,g}r-g(jUjjfjjgjjj}r.g(j]j]j]j]j]ujNjhj]ubeubj?)r/g}r0g(jUjjejNjjCj}r1g(j]j]j]j]j]Uentries]r2g(jFX.set_x509_store() (M2Crypto.SMIME.SMIME method)hUNtr3gaujNjhj]ubjM)r4g}r5g(jUjjejNjjPj}r6g(jRjSXpyj]j]j]j]j]jTXmethodr7gjVj7gujNjhj]r8g(jX)r9g}r:g(jXSMIME.set_x509_store(store)jj4gjX]/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.set_x509_storer;gjj\j}rgr?g}r@gbj]j]j]j]rAghajeXSMIME.set_x509_storerBgjgjwejhujNjhj]rCg(j~)rDg}rEg(jXset_x509_storejj9gjj;gjjj}rFg(jojpj]j]j]j]j]ujNjhj]rGgjXset_x509_storerHgrIg}rJg(jUjNjNjhjjDgubaubj)rKg}rLg(jXstorejj9gjj;gjjj}rMg(jojpj]j]j]j]j]ujNjhj]rNgj)rOg}rPg(jXstorej}rQg(jojpj]j]j]j]j]ujjKgj]rRgjXstorerSgrTg}rUg(jUjjOgubajjubaubj)rVg}rWg(jUjj9gjNjjj}rXg(Uexprjj]j]j]j]j]ujNjhj]rYgj!)rZg}r[g(jUj}r\g(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjBgujjVgj]r]gj)r^g}r_g(jUj}r`g(j]j]ragjaj]j]j]ujjZgj]rbgjX[source]rcgrdg}reg(jUjj^gubajjubajj%ubaubeubj)rfg}rgg(jUjj4gjj;gjjj}rhg(j]j]j]j]j]ujNjhj]ubeubj?)rig}rjg(jUjjejNjjCj}rkg(j]j]j]j]j]Uentries]rlg(jFX$sign() (M2Crypto.SMIME.SMIME method)jUNtrmgaujNjhj]ubjM)rng}rog(jUjjejNjjPj}rpg(jRjSXpyj]j]j]j]j]jTXmethodrqgjVjqgujNjhj]rrg(jX)rsg}rtg(jX*SMIME.sign(data_bio, flags=0, algo='sha1')jjngjXS/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.signrugjj\j}rvg(j]rwgjaj_j`XM2Crypto.SMIMErxgryg}rzgbj]j]j]j]r{gjajeX SMIME.signr|gjgjwejhujNjhj]r}g(j~)r~g}rg(jXsignjjsgjjugjjj}rg(jojpj]j]j]j]j]ujNjhj]rgjXsignrgrg}rg(jUjNjNjhjj~gubaubj)rg}rg(jXdata_bio, flags=0, algo='sha1'jjsgjjugjjj}rg(jojpj]j]j]j]j]ujNjhj]rg(j)rg}rg(jXdata_bioj}rg(jojpj]j]j]j]j]ujjgj]rgjXdata_biorgrg}rg(jUjjgubajjubj)rg}rg(jXflags=0j}rg(jojpj]j]j]j]j]ujjgj]rgjXflags=0rgrg}rg(jUjjgubajjubj)rg}rg(jX algo='sha1'j}rg(jojpj]j]j]j]j]ujjgj]rgjX algo='sha1'rgrg}rg(jUjjgubajjubeubj)rg}rg(jUjjsgjNjjj}rg(Uexprjj]j]j]j]j]ujNjhj]rgj!)rg}rg(jUj}rg(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidj|gujjgj]rgj)rg}rg(jUj}rg(j]j]rgjaj]j]j]ujjgj]rgjX[source]rgrg}rg(jUjjgubajjubajj%ubaubeubj)rg}rg(jUjjngjjugjjj}rg(j]j]j]j]j]ujNjhj]ubeubj?)rg}rg(jUjjejNjjCj}rg(j]j]j]j]j]Uentries]rg(jFX,unset_cipher() (M2Crypto.SMIME.SMIME method)jUNtrgaujNjhj]ubjM)rg}rg(jUjjejNjjPj}rg(jRjSXpyj]j]j]j]j]jTXmethodrgjVjgujNjhj]rg(jX)rg}rg(jXSMIME.unset_cipher()jjgjX[/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.unset_cipherrgjj\j}rg(j]rgjaj_j`XM2Crypto.SMIMErgrg}rgbj]j]j]j]rgjajeXSMIME.unset_cipherrgjgjwejhujNjhj]rg(j~)rg}rg(jX unset_cipherjjgjjgjjj}rg(jojpj]j]j]j]j]ujNjhj]rgjX unset_cipherrgrg}rg(jUjNjNjhjjgubaubj)rg}rg(jUjjgjjgjjj}rg(jojpj]j]j]j]j]ujNjhj]ubj)rg}rg(jUjjgjNjjj}rg(Uexprjj]j]j]j]j]ujNjhj]rgj!)rg}rg(jUj}rg(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjgujjgj]rgj)rg}rg(jUj}rg(j]j]rgjaj]j]j]ujjgj]rgjX[source]rgrg}rg(jUjjgubajjubajj%ubaubeubj)rg}rg(jUjjgjjgjjj}rg(j]j]j]j]j]ujNjhj]ubeubj?)rg}rg(jUjjejNjjCj}rg(j]j]j]j]j]Uentries]rg(jFX)unset_key() (M2Crypto.SMIME.SMIME method)h'UNtrgaujNjhj]ubjM)rg}rg(jUjjejNjjPj}rg(jRjSXpyj]j]j]j]j]jTXmethodrgjVjgujNjhj]rg(jX)rg}rg(jXSMIME.unset_key()jjgjXX/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.unset_keyrgjj\j}rg(j]rgh'aj_j`XM2Crypto.SMIMErgrg}rgbj]j]j]j]rgh'ajeXSMIME.unset_keyrgjgjwejhujNjhj]rg(j~)rg}rg(jX unset_keyjjgjjgjjj}rg(jojpj]j]j]j]j]ujNjhj]rgjX unset_keyrgrg}rg(jUjNjNjhjjgubaubj)rg}rh(jUjjgjjgjjj}rh(jojpj]j]j]j]j]ujNjhj]ubj)rh}rh(jUjjgjNjjj}rh(Uexprjj]j]j]j]j]ujNjhj]rhj!)rh}rh(jUj}rh(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjgujjhj]r hj)r h}r h(jUj}r h(j]j]r hjaj]j]j]ujjhj]rhjX[source]rhrh}rh(jUjj hubajjubajj%ubaubeubj)rh}rh(jUjjgjjgjjj}rh(j]j]j]j]j]ujNjhj]ubeubj?)rh}rh(jUjjejNjjCj}rh(j]j]j]j]j]Uentries]rh(jFX0unset_x509_stack() (M2Crypto.SMIME.SMIME method)hWUNtrhaujNjhj]ubjM)rh}rh(jUjjejNjjPj}rh(jRjSXpyj]j]j]j]j]jTXmethodrhjVjhujNjhj]rh(jX)rh}r h(jXSMIME.unset_x509_stack()jjhjX_/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME.unset_x509_stackr!hjj\j}r"h(j]r#hhWaj_j`XM2Crypto.SMIMEr$hr%h}r&hbj]j]j]j]r'hhWajeXSMIME.unset_x509_stackr(hjgjwejhujNjhj]r)h(j~)r*h}r+h(jXunset_x509_stackjjhjj!hjjj}r,h(jojpj]j]j]j]j]ujNjhj]r-hjXunset_x509_stackr.hr/h}r0h(jUjNjNjhjj*hubaubj)r1h}r2h(jUjjhjj!hjjj}r3h(jojpj]j]j]j]j]ujNjhj]ubj)r4h}r5h(jUjjhjNjjj}r6h(Uexprjj]j]j]j]j]ujNjhj]r7hj!)r8h}r9h(jUj}r:h(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidj(hujj4hj]r;hj)rh(j]j]r?hjaj]j]j]ujj8hj]r@hjX[source]rAhrBh}rCh(jUjjcjXT/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME_ErrorrijjCj}ri(j]j]j]j]j]Uentries]ri(jFX SMIME_Errorrij'UNtriaujNjhj]ubjM)ri}ri(jUjj>cjjijjPj}ri(jRjSXpyj]j]j]j]j]jTX exceptionrijVjiujNjhj]ri(jX)ri}ri(jjijjijXT/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.SMIME_Errorrijj\j}ri(j]r ij'aj_j`XM2Crypto.SMIMEr!ir"i}r#ibj]j]j]j]r$ij'ajejijgUjhujNjhj]r%i(jj)r&i}r'i(jX exception jjijjijjmj}r(i(jojpj]j]j]j]j]ujNjhj]r)ijX exception r*ir+i}r,i(jUjNjNjhjj&iubaubju)r-i}r.i(jXM2Crypto.SMIME.jjijjijjxj}r/i(jojpj]j]j]j]j]ujNjhj]r0ijXM2Crypto.SMIME.r1ir2i}r3i(jUjNjNjhjj-iubaubj~)r4i}r5i(jjijjijjijjj}r6i(jojpj]j]j]j]j]ujNjhj]r7ijX SMIME_Errorr8ir9i}r:i(jUjNjNjhjj4iubaubj)r;i}rij!)r?i}r@i(jUj}rAi(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjiujj;ij]rBij)rCi}rDi(jUj}rEi(j]j]rFijaj]j]j]ujj?ij]rGijX[source]rHirIi}rJi(jUjjCiubajjubajj%ubaubeubj)rKi}rLi(jUjjijjijjj}rMi(j]j]j]j]j]ujNjhj]rNij)rOi}rPi(jX$Bases: :class:`exceptions.Exception`jjKijjijjj}rQi(j]j]j]j]j]ujKjhj]rRi(jXBases: rSirTi}rUi(jUjNjNjhjjOiubj!)rVi}rWi(jX:class:`exceptions.Exception`rXijjOijjjj%j}rYi(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyrZij]j]U refexplicitj]j]j]j*j+j,jij-j`eujKlj]r[ij0)r\i}r]i(jjXij}r^i(j]j]r_i(j5jZiXpy-classr`iej]j]j]ujjVij]raijXexceptions.Exceptionrbirci}rdi(jUjj\iubajj;ubaubeubaubeubj?)rei}rfi(jUjj>cjNjjCj}rgi(j]j]j]j]j]Uentries]rhi(jFX'load_pkcs7() (in module M2Crypto.SMIME)hUNtriiaujNjhj]ubjM)rji}rki(jUjj>cjNjjPj}rli(jRjSXpyj]j]j]j]j]jTXfunctionrmijVjmiujNjhj]rni(jX)roi}rpi(jXload_pkcs7(p7file)jjjijXS/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.load_pkcs7rqijj\j}rri(j]rsihaj_j`XM2Crypto.SMIMErtirui}rvibj]j]j]j]rwihajeX load_pkcs7rxijgUjhujNjhj]ryi(ju)rzi}r{i(jXM2Crypto.SMIME.jjoijjqijjxj}r|i(jojpj]j]j]j]j]ujNjhj]r}ijXM2Crypto.SMIME.r~iri}ri(jUjNjNjhjjziubaubj~)ri}ri(jjxijjoijjqijjj}ri(jojpj]j]j]j]j]ujNjhj]rijX load_pkcs7riri}ri(jUjNjNjhjjiubaubj)ri}ri(jXp7filejjoijjqijjj}ri(jojpj]j]j]j]j]ujNjhj]rij)ri}ri(jXp7filej}ri(jojpj]j]j]j]j]ujjij]rijXp7fileriri}ri(jUjjiubajjubaubj)ri}ri(jUjjoijNjjj}ri(Uexprjj]j]j]j]j]ujNjhj]rij!)ri}ri(jUj}ri(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjxiujjij]rij)ri}ri(jUj}ri(j]j]rijaj]j]j]ujjij]rijX[source]riri}ri(jUjjiubajjubajj%ubaubeubj)ri}ri(jUjjjijjqijjj}ri(j]j]j]j]j]ujNjhj]ubeubj?)ri}ri(jUjj>cjNjjCj}ri(j]j]j]j]j]Uentries]ri(jFX+load_pkcs7_bio() (in module M2Crypto.SMIME)jZUNtriaujNjhj]ubjM)ri}ri(jUjj>cjNjjPj}ri(jRjSXpyj]j]j]j]j]jTXfunctionrijVjiujNjhj]ri(jX)ri}ri(jXload_pkcs7_bio(p7_bio)jjijXW/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.load_pkcs7_biorijj\j}ri(j]rijZaj_j`XM2Crypto.SMIMEriri}ribj]j]j]j]rijZajeXload_pkcs7_biorijgUjhujNjhj]ri(ju)ri}ri(jXM2Crypto.SMIME.jjijjijjxj}ri(jojpj]j]j]j]j]ujNjhj]rijXM2Crypto.SMIME.riri}ri(jUjNjNjhjjiubaubj~)ri}ri(jjijjijjijjj}ri(jojpj]j]j]j]j]ujNjhj]rijXload_pkcs7_bioriri}ri(jUjNjNjhjjiubaubj)ri}ri(jXp7_biojjijjijjj}ri(jojpj]j]j]j]j]ujNjhj]rij)ri}ri(jXp7_bioj}ri(jojpj]j]j]j]j]ujjij]rijXp7_bioriri}ri(jUjjiubajjubaubj)ri}ri(jUjjijNjjj}ri(Uexprjj]j]j]j]j]ujNjhj]rij!)ri}ri(jUj}ri(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjiujjij]rij)ri}ri(jUj}ri(j]j]rijaj]j]j]ujjij]rijX[source]riri}ri(jUjjiubajjubajj%ubaubeubj)ri}ri(jUjjijjijjj}ri(j]j]j]j]j]ujNjhj]ubeubj?)ri}ri(jUjj>cjNjjCj}ri(j]j]j]j]j]Uentries]ri(jFX/load_pkcs7_bio_der() (in module M2Crypto.SMIME)jUNtriaujNjhj]ubjM)ri}ri(jUjj>cjNjjPj}ri(jRjSXpyj]j]j]j]j]jTXfunctionrijVjiujNjhj]ri(jX)ri}ri(jXload_pkcs7_bio_der(p7_bio)jjijX[/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.load_pkcs7_bio_derrijj\j}ri(j]rijaj_j`XM2Crypto.SMIMEriri}ribj]j]j]j]rijajeXload_pkcs7_bio_derrijgUjhujNjhj]ri(ju)ri}ri(jXM2Crypto.SMIME.jjijjijjxj}ri(jojpj]j]j]j]j]ujNjhj]rijXM2Crypto.SMIME.rjrj}rj(jUjNjNjhjjiubaubj~)rj}rj(jjijjijjijjj}rj(jojpj]j]j]j]j]ujNjhj]rjjXload_pkcs7_bio_derrjrj}r j(jUjNjNjhjjjubaubj)r j}r j(jXp7_biojjijjijjj}r j(jojpj]j]j]j]j]ujNjhj]r jj)rj}rj(jXp7_bioj}rj(jojpj]j]j]j]j]ujj jj]rjjXp7_biorjrj}rj(jUjjjubajjubaubj)rj}rj(jUjjijNjjj}rj(Uexprjj]j]j]j]j]ujNjhj]rjj!)rj}rj(jUj}rj(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjiujjjj]rjj)rj}rj(jUj}rj(j]j]r jjaj]j]j]ujjjj]r!jjX[source]r"jr#j}r$j(jUjjjubajjubajj%ubaubeubj)r%j}r&j(jUjjijjijjj}r'j(j]j]j]j]j]ujNjhj]ubeubj?)r(j}r)j(jUjj>cjNjjCj}r*j(j]j]j]j]j]Uentries]r+j(jFX+load_pkcs7_der() (in module M2Crypto.SMIME)jUNtr,jaujNjhj]ubjM)r-j}r.j(jUjj>cjNjjPj}r/j(jRjSXpyj]j]j]j]j]jTXfunctionr0jjVj0jujNjhj]r1j(jX)r2j}r3j(jXload_pkcs7_der(p7file)jj-jjXW/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.load_pkcs7_derr4jjj\j}r5j(j]r6jjaj_j`XM2Crypto.SMIMEr7jr8j}r9jbj]j]j]j]r:jjajeXload_pkcs7_derr;jjgUjhujNjhj]rj(jXM2Crypto.SMIME.jj2jjj4jjjxj}r?j(jojpj]j]j]j]j]ujNjhj]r@jjXM2Crypto.SMIME.rAjrBj}rCj(jUjNjNjhjj=jubaubj~)rDj}rEj(jj;jjj2jjj4jjjj}rFj(jojpj]j]j]j]j]ujNjhj]rGjjXload_pkcs7_derrHjrIj}rJj(jUjNjNjhjjDjubaubj)rKj}rLj(jXp7filejj2jjj4jjjj}rMj(jojpj]j]j]j]j]ujNjhj]rNjj)rOj}rPj(jXp7filej}rQj(jojpj]j]j]j]j]ujjKjj]rRjjXp7filerSjrTj}rUj(jUjjOjubajjubaubj)rVj}rWj(jUjj2jjNjjj}rXj(Uexprjj]j]j]j]j]ujNjhj]rYjj!)rZj}r[j(jUj}r\j(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidj;jujjVjj]r]jj)r^j}r_j(jUj}r`j(j]j]rajjaj]j]j]ujjZjj]rbjjX[source]rcjrdj}rej(jUjj^jubajjubajj%ubaubeubj)rfj}rgj(jUjj-jjj4jjjj}rhj(j]j]j]j]j]ujNjhj]ubeubj?)rij}rjj(jUjj>cjNjjCj}rkj(j]j]j]j]j]Uentries]rlj(jFX-smime_load_pkcs7() (in module M2Crypto.SMIME)h%UNtrmjaujNjhj]ubjM)rnj}roj(jUjj>cjNjjPj}rpj(jRjSXpyj]j]j]j]j]jTXfunctionrqjjVjqjujNjhj]rrj(jX)rsj}rtj(jXsmime_load_pkcs7(p7file)jjnjjXY/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.smime_load_pkcs7rujjj\j}rvj(j]rwjh%aj_j`XM2Crypto.SMIMErxjryj}rzjbj]j]j]j]r{jh%ajeXsmime_load_pkcs7r|jjgUjhujNjhj]r}j(ju)r~j}rj(jXM2Crypto.SMIME.jjsjjjujjjxj}rj(jojpj]j]j]j]j]ujNjhj]rjjXM2Crypto.SMIME.rjrj}rj(jUjNjNjhjj~jubaubj~)rj}rj(jj|jjjsjjjujjjj}rj(jojpj]j]j]j]j]ujNjhj]rjjXsmime_load_pkcs7rjrj}rj(jUjNjNjhjjjubaubj)rj}rj(jXp7filejjsjjjujjjj}rj(jojpj]j]j]j]j]ujNjhj]rjj)rj}rj(jXp7filej}rj(jojpj]j]j]j]j]ujjjj]rjjXp7filerjrj}rj(jUjjjubajjubaubj)rj}rj(jUjjsjjNjjj}rj(Uexprjj]j]j]j]j]ujNjhj]rjj!)rj}rj(jUj}rj(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidj|jujjjj]rjj)rj}rj(jUj}rj(j]j]rjjaj]j]j]ujjjj]rjjX[source]rjrj}rj(jUjjjubajjubajj%ubaubeubj)rj}rj(jUjjnjjjujjjj}rj(j]j]j]j]j]ujNjhj]ubeubj?)rj}rj(jUjj>cjNjjCj}rj(j]j]j]j]j]Uentries]rj(jFX1smime_load_pkcs7_bio() (in module M2Crypto.SMIME)jUNtrjaujNjhj]ubjM)rj}rj(jUjj>cjNjjPj}rj(jRjSXpyj]j]j]j]j]jTXfunctionrjjVjjujNjhj]rj(jX)rj}rj(jXsmime_load_pkcs7_bio(p7_bio)jjjjX]/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.smime_load_pkcs7_biorjjj\j}rj(j]rjjaj_j`XM2Crypto.SMIMErjrj}rjbj]j]j]j]rjjajeXsmime_load_pkcs7_biorjjgUjhujNjhj]rj(ju)rj}rj(jXM2Crypto.SMIME.jjjjjjjjxj}rj(jojpj]j]j]j]j]ujNjhj]rjjXM2Crypto.SMIME.rjrj}rj(jUjNjNjhjjjubaubj~)rj}rj(jjjjjjjjjjjj}rj(jojpj]j]j]j]j]ujNjhj]rjjXsmime_load_pkcs7_biorjrj}rj(jUjNjNjhjjjubaubj)rj}rj(jXp7_biojjjjjjjjj}rj(jojpj]j]j]j]j]ujNjhj]rjj)rj}rj(jXp7_bioj}rj(jojpj]j]j]j]j]ujjjj]rjjXp7_biorjrj}rj(jUjjjubajjubaubj)rj}rj(jUjjjjNjjj}rj(Uexprjj]j]j]j]j]ujNjhj]rjj!)rj}rj(jUj}rj(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjjujjjj]rjj)rj}rj(jUj}rj(j]j]rjjaj]j]j]ujjjj]rjjX[source]rjrj}rj(jUjjjubajjubajj%ubaubeubj)rj}rj(jUjjjjjjjjj}rj(j]j]j]j]j]ujNjhj]ubeubj?)rj}rj(jUjj>cjNjjCj}rj(j]j]j]j]j]Uentries]rj(jFX&text_crlf() (in module M2Crypto.SMIME)jUNtrjaujNjhj]ubjM)rj}rj(jUjj>cjNjjPj}rj(jRjSXpyj]j]j]j]j]jTXfunctionrjjVjjujNjhj]rj(jX)rj}rj(jXtext_crlf(text)jjjjXR/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.text_crlfrjjj\j}rj(j]rjjaj_j`XM2Crypto.SMIMErjrj}rjbj]j]j]j]rjjajeX text_crlfrjjgUjhujNjhj]rj(ju)rk}rk(jXM2Crypto.SMIME.jjjjjjjjxj}rk(jojpj]j]j]j]j]ujNjhj]rkjXM2Crypto.SMIME.rkrk}rk(jUjNjNjhjjkubaubj~)rk}rk(jjjjjjjjjjjj}r k(jojpj]j]j]j]j]ujNjhj]r kjX text_crlfr kr k}r k(jUjNjNjhjjkubaubj)rk}rk(jXtextjjjjjjjjj}rk(jojpj]j]j]j]j]ujNjhj]rkj)rk}rk(jXtextj}rk(jojpj]j]j]j]j]ujjkj]rkjXtextrkrk}rk(jUjjkubajjubaubj)rk}rk(jUjjjjNjjj}rk(Uexprjj]j]j]j]j]ujNjhj]rkj!)rk}rk(jUj}rk(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidjjujjkj]r kj)r!k}r"k(jUj}r#k(j]j]r$kjaj]j]j]ujjkj]r%kjX[source]r&kr'k}r(k(jUjj!kubajjubajj%ubaubeubj)r)k}r*k(jUjjjjjjjjj}r+k(j]j]j]j]j]ujNjhj]ubeubj?)r,k}r-k(jUjj>cjNjjCj}r.k(j]j]j]j]j]Uentries]r/k(jFX*text_crlf_bio() (in module M2Crypto.SMIME)hUNtr0kaujNjhj]ubjM)r1k}r2k(jUjj>cjNjjPj}r3k(jRjSXpyj]j]j]j]j]jTXfunctionr4kjVj4kujNjhj]r5k(jX)r6k}r7k(jXtext_crlf_bio(bio_in)jj1kjXV/home/matej/Build/m2crypto/M2Crypto/SMIME.py:docstring of M2Crypto.SMIME.text_crlf_bior8kjj\j}r9k(j]r:khaj_j`XM2Crypto.SMIMEr;krkhajeX text_crlf_bior?kjgUjhujNjhj]r@k(ju)rAk}rBk(jXM2Crypto.SMIME.jj6kjj8kjjxj}rCk(jojpj]j]j]j]j]ujNjhj]rDkjXM2Crypto.SMIME.rEkrFk}rGk(jUjNjNjhjjAkubaubj~)rHk}rIk(jj?kjj6kjj8kjjj}rJk(jojpj]j]j]j]j]ujNjhj]rKkjX text_crlf_biorLkrMk}rNk(jUjNjNjhjjHkubaubj)rOk}rPk(jXbio_injj6kjj8kjjj}rQk(jojpj]j]j]j]j]ujNjhj]rRkj)rSk}rTk(jXbio_inj}rUk(jojpj]j]j]j]j]ujjOkj]rVkjXbio_inrWkrXk}rYk(jUjjSkubajjubaubj)rZk}r[k(jUjj6kjNjjj}r\k(Uexprjj]j]j]j]j]ujNjhj]r]kj!)r^k}r_k(jUj}r`k(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/SMIMEUrefidj?kujjZkj]rakj)rbk}rck(jUj}rdk(j]j]rekjaj]j]j]ujj^kj]rfkjX[source]rgkrhk}rik(jUjjbkubajjubajj%ubaubeubj)rjk}rkk(jUjj1kjj8kjjj}rlk(j]j]j]j]j]ujNjhj]ubeubeubj)rmk}rnk(jUjjjjjjj}rok(j]j]j]j]rpk(Xmodule-M2Crypto.X509rqkU x509-modulerrkej]rskj/aujK}jhj]rtk(j )ruk}rvk(jX:mod:`X509` Modulerwkjjmkjjjj j}rxk(j]j]j]j]j]ujK}jhj]ryk(j!)rzk}r{k(jX :mod:`X509`r|kjjukjjjj%j}r}k(UreftypeXmodj'j(XX509U refdomainXpyr~kj]j]U refexplicitj]j]j]j*j+j,Nj-j`eujK|j]rkj0)rk}rk(jj|kj}rk(j]j]rk(j5j~kXpy-modrkej]j]j]ujjzkj]rkjXX509rkrk}rk(jUjjkubajj;ubaubjX Modulerkrk}rk(jUjNjNjhjjukubeubj?)rk}rk(jUjjmkjXJ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.CRLrkjjCj}rk(j]j]j]j]j]Uentries]rk(jFXM2Crypto.X509 (module)Xmodule-M2Crypto.X509UNtrkaujKjhj]ubj?)rk}rk(jUjjmkjNjjCj}rk(j]j]j]j]j]Uentries]rk(jFXCRL (class in M2Crypto.X509)j[UNtrkaujNjhj]ubjM)rk}rk(jUjjmkjNjjPj}rk(jRjSXpyj]j]j]j]j]jTXclassrkjVjkujNjhj]rk(jX)rk}rk(jXCRL(crl=None, _pyfree=0)jjkjXJ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.CRLrkjj\j}rk(j]rkj[aj_j`X M2Crypto.X509rkrk}rkbj]j]j]j]rkj[ajeXCRLrkjgUjhujNjhj]rk(jj)rk}rk(jXclass jjkjjkjjmj}rk(jojpj]j]j]j]j]ujNjhj]rkjXclass rkrk}rk(jUjNjNjhjjkubaubju)rk}rk(jXM2Crypto.X509.jjkjjkjjxj}rk(jojpj]j]j]j]j]ujNjhj]rkjXM2Crypto.X509.rkrk}rk(jUjNjNjhjjkubaubj~)rk}rk(jjkjjkjjkjjj}rk(jojpj]j]j]j]j]ujNjhj]rkjXCRLrkrk}rk(jUjNjNjhjjkubaubj)rk}rk(jXcrl=None, _pyfree=0jjkjjkjjj}rk(jojpj]j]j]j]j]ujNjhj]rk(j)rk}rk(jXcrl=Nonej}rk(jojpj]j]j]j]j]ujjkj]rkjXcrl=Nonerkrk}rk(jUjjkubajjubj)rk}rk(jX _pyfree=0j}rk(jojpj]j]j]j]j]ujjkj]rkjX _pyfree=0rkrk}rk(jUjjkubajjubeubj)rk}rk(jUjjkjNjjj}rk(Uexprjj]j]j]j]j]ujNjhj]rkj!)rk}rk(jUj}rk(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjkujjkj]rkj)rk}rk(jUj}rk(j]j]rkjaj]j]j]ujjkj]rkjX[source]rkrk}rk(jUjjkubajjubajj%ubaubeubj)rk}rk(jUjjkjjkjjj}rk(j]j]j]j]j]ujNjhj]rk(j)rk}rk(jX X509 Certificate Revocation ListjjkjXJ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.CRLjjj}rk(j]j]j]j]j]ujKjhj]rkjX X509 Certificate Revocation Listrkrk}rk(jUjNjNjhjjkubaubj?)rk}rk(jUjjkjNjjCj}rk(j]j]j]j]j]Uentries]rk(jFX$as_text() (M2Crypto.X509.CRL method)hUNtrkaujNjhj]ubjM)rk}rk(jUjjkjNjjPj}rk(jRjSXpyj]j]j]j]j]jTXmethodrkjVjkujNjhj]rk(jX)rk}rk(jX CRL.as_text()jjkjXR/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.CRL.as_textrkjj\j}rk(j]rkhaj_j`X M2Crypto.X509rkrk}rkbj]j]j]j]rkhajeX CRL.as_textrkjgjkjhujNjhj]rk(j~)rk}rk(jXas_textjjkjjkjjj}rl(jojpj]j]j]j]j]ujNjhj]rljXas_textrlrl}rl(jUjNjNjhjjkubaubj)rl}rl(jUjjkjjkjjj}rl(jojpj]j]j]j]j]ujNjhj]ubj)rl}r l(jUjjkjNjjj}r l(Uexprjj]j]j]j]j]ujNjhj]r lj!)r l}r l(jUj}rl(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjkujjlj]rlj)rl}rl(jUj}rl(j]j]rljaj]j]j]ujj lj]rljX[source]rlrl}rl(jUjjlubajjubajj%ubaubeubj)rl}rl(jUjjkjjkjjj}rl(j]j]j]j]j]ujNjhj]rl(j)rl}rl(jX%Return CRL in PEM format in a string.jjljXR/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.CRL.as_textjjj}rl(j]j]j]j]j]ujKjhj]rljX%Return CRL in PEM format in a string.r lr!l}r"l(jUjNjNjhjjlubaubj)r#l}r$l(jUjjljNjjj}r%l(j]j]j]j]j]ujNjhj]r&lj)r'l}r(l(jUj}r)l(j]j]j]j]j]ujj#lj]r*l(j)r+l}r,l(jXReturnsjj'ljjkjjj}r-l(j]j]j]j]j]ujKj]r.ljXReturnsr/lr0l}r1l(jUjj+lubaubj)r2l}r3l(jUj}r4l(j]j]j]j]j]ujj'lj]r5lj)r6l}r7l(jX(String containing the CRL in PEM format.j}r8l(j]j]j]j]j]ujj2lj]r9ljX(String containing the CRL in PEM format.r:lr;l}rl(jUjjkjNjjCj}r?l(j]j]j]j]j]Uentries]r@l(jFX-m2_x509_crl_free() (M2Crypto.X509.CRL method)hUNtrAlaujNjhj]ubjM)rBl}rCl(jUjjkjNjjPj}rDl(jRjSXpyj]j]j]j]j]jTXmethodrEljVjElujNjhj]rFl(jX)rGl}rHl(jXCRL.m2_x509_crl_freejjBljX[/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.CRL.m2_x509_crl_freerIljj\j}rJl(j]rKlhaj_j`X M2Crypto.X509rLlrMl}rNlbj]j]j]j]rOlhajeXCRL.m2_x509_crl_freejgjkjhujNjhj]rPl(j~)rQl}rRl(jXm2_x509_crl_freejjGljjIljjj}rSl(jojpj]j]j]j]j]ujNjhj]rTljXm2_x509_crl_freerUlrVl}rWl(jUjNjNjhjjQlubaubj)rXl}rYl(jUjjGljjIljjj}rZl(jojpj]j]j]j]j]ujNjhj]ubeubj)r[l}r\l(jUjjBljjIljjj}r]l(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r^l}r_l(jUjjmkjNjjCj}r`l(j]j]j]j]j]Uentries]ral(jFX Request (class in M2Crypto.X509)jUNtrblaujNjhj]ubjM)rcl}rdl(jUjjmkjNjjPj}rel(jRjSXpyj]j]j]j]j]jTXclassrfljVjflujNjhj]rgl(jX)rhl}ril(jXRequest(req=None, _pyfree=0)jjcljXN/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Requestrjljj\j}rkl(j]rlljaj_j`X M2Crypto.X509rmlrnl}rolbj]j]j]j]rpljajeXRequestrqljgUjhujNjhj]rrl(jj)rsl}rtl(jXclass jjhljjjljjmj}rul(jojpj]j]j]j]j]ujNjhj]rvljXclass rwlrxl}ryl(jUjNjNjhjjslubaubju)rzl}r{l(jXM2Crypto.X509.jjhljjjljjxj}r|l(jojpj]j]j]j]j]ujNjhj]r}ljXM2Crypto.X509.r~lrl}rl(jUjNjNjhjjzlubaubj~)rl}rl(jjqljjhljjjljjj}rl(jojpj]j]j]j]j]ujNjhj]rljXRequestrlrl}rl(jUjNjNjhjjlubaubj)rl}rl(jXreq=None, _pyfree=0jjhljjjljjj}rl(jojpj]j]j]j]j]ujNjhj]rl(j)rl}rl(jXreq=Nonej}rl(jojpj]j]j]j]j]ujjlj]rljXreq=Nonerlrl}rl(jUjjlubajjubj)rl}rl(jX _pyfree=0j}rl(jojpj]j]j]j]j]ujjlj]rljX _pyfree=0rlrl}rl(jUjjlubajjubeubj)rl}rl(jUjjhljNjjj}rl(Uexprjj]j]j]j]j]ujNjhj]rlj!)rl}rl(jUj}rl(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjqlujjlj]rlj)rl}rl(jUj}rl(j]j]rljaj]j]j]ujjlj]rljX[source]rlrl}rl(jUjjlubajjubajj%ubaubeubj)rl}rl(jUjjcljjjljjj}rl(j]j]j]j]j]ujNjhj]rl(j)rl}rl(jXX509 Certificate Request.jjljXN/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Requestjjj}rl(j]j]j]j]j]ujKjhj]rljXX509 Certificate Request.rlrl}rl(jUjNjNjhjjlubaubj?)rl}rl(jUjjljNjjCj}rl(j]j]j]j]j]Uentries]rl(jFX/add_extensions() (M2Crypto.X509.Request method)jUNtrlaujNjhj]ubjM)rl}rl(jUjjljNjjPj}rl(jRjSXpyj]j]j]j]j]jTXmethodrljVjlujNjhj]rl(jX)rl}rl(jX!Request.add_extensions(ext_stack)jjljX]/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.add_extensionsrljj\j}rl(j]rljaj_j`X M2Crypto.X509rlrl}rlbj]j]j]j]rljajeXRequest.add_extensionsrljgjqljhujNjhj]rl(j~)rl}rl(jXadd_extensionsjjljjljjj}rl(jojpj]j]j]j]j]ujNjhj]rljXadd_extensionsrlrl}rl(jUjNjNjhjjlubaubj)rl}rl(jX ext_stackjjljjljjj}rl(jojpj]j]j]j]j]ujNjhj]rlj)rl}rl(jX ext_stackj}rl(jojpj]j]j]j]j]ujjlj]rljX ext_stackrlrl}rl(jUjjlubajjubaubj)rl}rl(jUjjljNjjj}rl(Uexprjj]j]j]j]j]ujNjhj]rlj!)rl}rl(jUj}rl(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjlujjlj]rlj)rl}rl(jUj}rl(j]j]rljaj]j]j]ujjlj]rljX[source]rlrl}rl(jUjjlubajjubajj%ubaubeubj)rl}rl(jUjjljjljjj}rl(j]j]j]j]j]ujNjhj]rl(j)rl}rl(jX$Add X509 extensions to this request.jjljX]/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.add_extensionsjjj}rl(j]j]j]j]j]ujKjhj]rljX$Add X509 extensions to this request.rlrl}rl(jUjNjNjhjjlubaubj)rl}rl(jUjjljNjjj}rl(j]j]j]j]j]ujNjhj]rl(j)rl}rl(jUj}rl(j]j]j]j]j]ujjlj]rl(j)rl}rm(jX Parametersjjljjljjj}rm(j]j]j]j]j]ujKj]rmjX Parametersrmrm}rm(jUjjlubaubj)rm}rm(jUj}rm(j]j]j]j]j]ujjlj]r mj)r m}r m(jX(ext_stack -- Stack of extensions to add.j}r m(j]j]j]j]j]ujjmj]r m(j)rm}rm(jX ext_stackj}rm(j]j]jj]j]j]ujj mj]rmjX ext_stackrmrm}rm(jUjjmubajjubjX – rmrm}rm(jUjj mubjXStack of extensions to add.rmrm}rm(jUjNjNjhjj mubejjubajjubejjubj)rm}rm(jUj}rm(j]j]j]j]j]ujjlj]rm(j)rm}r m(jXReturnsjjmjjljjj}r!m(j]j]j]j]j]ujKj]r"mjXReturnsr#mr$m}r%m(jUjjmubaubj)r&m}r'm(jUj}r(m(j]j]j]j]j]ujjmj]r)mj)r*m}r+m(jX1 for success and 0 for failurej}r,m(j]j]j]j]j]ujj&mj]r-mjX1 for success and 0 for failurer.mr/m}r0m(jUjNjNjhjj*mubajjubajjubejjubeubeubeubj?)r1m}r2m(jUjjljNjjCj}r3m(j]j]j]j]j]Uentries]r4m(jFX'as_der() (M2Crypto.X509.Request method)h\UNtr5maujNjhj]ubjM)r6m}r7m(jUjjljNjjPj}r8m(jRjSXpyj]j]j]j]j]jTXmethodr9mjVj9mujNjhj]r:m(jX)r;m}rm(j]r?mh\aj_j`X M2Crypto.X509r@mrAm}rBmbj]j]j]j]rCmh\ajeXRequest.as_derrDmjgjqljhujNjhj]rEm(j~)rFm}rGm(jXas_derjj;mjj=mjjj}rHm(jojpj]j]j]j]j]ujNjhj]rImjXas_derrJmrKm}rLm(jUjNjNjhjjFmubaubj)rMm}rNm(jUjj;mjj=mjjj}rOm(jojpj]j]j]j]j]ujNjhj]ubj)rPm}rQm(jUjj;mjNjjj}rRm(Uexprjj]j]j]j]j]ujNjhj]rSmj!)rTm}rUm(jUj}rVm(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509UrefidjDmujjPmj]rWmj)rXm}rYm(jUj}rZm(j]j]r[mjaj]j]j]ujjTmj]r\mjX[source]r]mr^m}r_m(jUjjXmubajjubajj%ubaubeubj)r`m}ram(jUjj6mjj=mjjj}rbm(j]j]j]j]j]ujNjhj]ubeubj?)rcm}rdm(jUjjljNjjCj}rem(j]j]j]j]j]Uentries]rfm(jFX'as_pem() (M2Crypto.X509.Request method)jhUNtrgmaujNjhj]ubjM)rhm}rim(jUjjljNjjPj}rjm(jRjSXpyj]j]j]j]j]jTXmethodrkmjVjkmujNjhj]rlm(jX)rmm}rnm(jXRequest.as_pem()jjhmjXU/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.as_pemromjj\j}rpm(j]rqmjhaj_j`X M2Crypto.X509rrmrsm}rtmbj]j]j]j]rumjhajeXRequest.as_pemrvmjgjqljhujNjhj]rwm(j~)rxm}rym(jXas_pemjjmmjjomjjj}rzm(jojpj]j]j]j]j]ujNjhj]r{mjXas_pemr|mr}m}r~m(jUjNjNjhjjxmubaubj)rm}rm(jUjjmmjjomjjj}rm(jojpj]j]j]j]j]ujNjhj]ubj)rm}rm(jUjjmmjNjjj}rm(Uexprjj]j]j]j]j]ujNjhj]rmj!)rm}rm(jUj}rm(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjvmujjmj]rmj)rm}rm(jUj}rm(j]j]rmjaj]j]j]ujjmj]rmjX[source]rmrm}rm(jUjjmubajjubajj%ubaubeubj)rm}rm(jUjjhmjjomjjj}rm(j]j]j]j]j]ujNjhj]ubeubj?)rm}rm(jUjjljNjjCj}rm(j]j]j]j]j]Uentries]rm(jFX(as_text() (M2Crypto.X509.Request method)jWUNtrmaujNjhj]ubjM)rm}rm(jUjjljNjjPj}rm(jRjSXpyj]j]j]j]j]jTXmethodrmjVjmujNjhj]rm(jX)rm}rm(jXRequest.as_text()jjmjXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.as_textrmjj\j}rm(j]rmjWaj_j`X M2Crypto.X509rmrm}rmbj]j]j]j]rmjWajeXRequest.as_textrmjgjqljhujNjhj]rm(j~)rm}rm(jXas_textjjmjjmjjj}rm(jojpj]j]j]j]j]ujNjhj]rmjXas_textrmrm}rm(jUjNjNjhjjmubaubj)rm}rm(jUjjmjjmjjj}rm(jojpj]j]j]j]j]ujNjhj]ubj)rm}rm(jUjjmjNjjj}rm(Uexprjj]j]j]j]j]ujNjhj]rmj!)rm}rm(jUj}rm(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjmujjmj]rmj)rm}rm(jUj}rm(j]j]rmjaj]j]j]ujjmj]rmjX[source]rmrm}rm(jUjjmubajjubajj%ubaubeubj)rm}rm(jUjjmjjmjjj}rm(j]j]j]j]j]ujNjhj]ubeubj?)rm}rm(jUjjljNjjCj}rm(j]j]j]j]j]Uentries]rm(jFX+get_pubkey() (M2Crypto.X509.Request method)jUNtrmaujNjhj]ubjM)rm}rm(jUjjljNjjPj}rm(jRjSXpyj]j]j]j]j]jTXmethodrmjVjmujNjhj]rm(jX)rm}rm(jXRequest.get_pubkey()jjmjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.get_pubkeyrmjj\j}rm(j]rmjaj_j`X M2Crypto.X509rmrm}rmbj]j]j]j]rmjajeXRequest.get_pubkeyrmjgjqljhujNjhj]rm(j~)rm}rm(jX get_pubkeyjjmjjmjjj}rm(jojpj]j]j]j]j]ujNjhj]rmjX get_pubkeyrmrm}rm(jUjNjNjhjjmubaubj)rm}rm(jUjjmjjmjjj}rm(jojpj]j]j]j]j]ujNjhj]ubj)rm}rm(jUjjmjNjjj}rm(Uexprjj]j]j]j]j]ujNjhj]rmj!)rm}rm(jUj}rm(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjmujjmj]rmj)rm}rm(jUj}rm(j]j]rmjaj]j]j]ujjmj]rmjX[source]rmrm}rm(jUjjmubajjubajj%ubaubeubj)rm}rm(jUjjmjjmjjj}rm(j]j]j]j]j]ujNjhj]rm(j)rm}rm(jX#Get the public key for the request.jjmjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.get_pubkeyjjj}rm(j]j]j]j]j]ujKjhj]rmjX#Get the public key for the request.rmrm}rn(jUjNjNjhjjmubaubj)rn}rn(jUjjmjNjjj}rn(j]j]j]j]j]ujNjhj]rnj)rn}rn(jUj}rn(j]j]j]j]j]ujjnj]rn(j)r n}r n(jXReturnsjjnjjmjjj}r n(j]j]j]j]j]ujKj]r njXReturnsr nrn}rn(jUjj nubaubj)rn}rn(jUj}rn(j]j]j]j]j]ujjnj]rnj)rn}rn(jXPublic key from the request.j}rn(j]j]j]j]j]ujjnj]rnjXPublic key from the request.rnrn}rn(jUjNjNjhjjnubajjubajjubejjubaubeubeubj?)rn}rn(jUjjljNjjCj}rn(j]j]j]j]j]Uentries]rn(jFX,get_subject() (M2Crypto.X509.Request method)hNUNtrnaujNjhj]ubjM)r n}r!n(jUjjljNjjPj}r"n(jRjSXpyj]j]j]j]j]jTXmethodr#njVj#nujNjhj]r$n(jX)r%n}r&n(jXRequest.get_subject()jj njXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.get_subjectr'njj\j}r(n(j]r)nhNaj_j`X M2Crypto.X509r*nr+n}r,nbj]j]j]j]r-nhNajeXRequest.get_subjectr.njgjqljhujNjhj]r/n(j~)r0n}r1n(jX get_subjectjj%njj'njjj}r2n(jojpj]j]j]j]j]ujNjhj]r3njX get_subjectr4nr5n}r6n(jUjNjNjhjj0nubaubj)r7n}r8n(jUjj%njj'njjj}r9n(jojpj]j]j]j]j]ujNjhj]ubj)r:n}r;n(jUjj%njNjjj}rn}r?n(jUj}r@n(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj.nujj:nj]rAnj)rBn}rCn(jUj}rDn(j]j]rEnjaj]j]j]ujj>nj]rFnjX[source]rGnrHn}rIn(jUjjBnubajjubajj%ubaubeubj)rJn}rKn(jUjj njj'njjj}rLn(j]j]j]j]j]ujNjhj]ubeubj?)rMn}rNn(jUjjljNjjCj}rOn(j]j]j]j]j]Uentries]rPn(jFX,get_version() (M2Crypto.X509.Request method)jUNtrQnaujNjhj]ubjM)rRn}rSn(jUjjljNjjPj}rTn(jRjSXpyj]j]j]j]j]jTXmethodrUnjVjUnujNjhj]rVn(jX)rWn}rXn(jXRequest.get_version()jjRnjXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.get_versionrYnjj\j}rZn(j]r[njaj_j`X M2Crypto.X509r\nr]n}r^nbj]j]j]j]r_njajeXRequest.get_versionr`njgjqljhujNjhj]ran(j~)rbn}rcn(jX get_versionjjWnjjYnjjj}rdn(jojpj]j]j]j]j]ujNjhj]renjX get_versionrfnrgn}rhn(jUjNjNjhjjbnubaubj)rin}rjn(jUjjWnjjYnjjj}rkn(jojpj]j]j]j]j]ujNjhj]ubj)rln}rmn(jUjjWnjNjjj}rnn(Uexprjj]j]j]j]j]ujNjhj]ronj!)rpn}rqn(jUj}rrn(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj`nujjlnj]rsnj)rtn}run(jUj}rvn(j]j]rwnjaj]j]j]ujjpnj]rxnjX[source]rynrzn}r{n(jUjjtnubajjubajj%ubaubeubj)r|n}r}n(jUjjRnjjYnjjj}r~n(j]j]j]j]j]ujNjhj]rn(j)rn}rn(jX Get version.jj|njXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.get_versionjjj}rn(j]j]j]j]j]ujKjhj]rnjX Get version.rnrn}rn(jUjNjNjhjjnubaubj)rn}rn(jUjj|njNjjj}rn(j]j]j]j]j]ujNjhj]rnj)rn}rn(jUj}rn(j]j]j]j]j]ujjnj]rn(j)rn}rn(jXReturnsjjnjjYnjjj}rn(j]j]j]j]j]ujKj]rnjXReturnsrnrn}rn(jUjjnubaubj)rn}rn(jUj}rn(j]j]j]j]j]ujjnj]rnj)rn}rn(jXReturns version.j}rn(j]j]j]j]j]ujjnj]rnjXReturns version.rnrn}rn(jUjNjNjhjjnubajjubajjubejjubaubeubeubj?)rn}rn(jUjjljNjjCj}rn(j]j]j]j]j]Uentries]rn(jFX1m2_x509_req_free() (M2Crypto.X509.Request method)hUNtrnaujNjhj]ubjM)rn}rn(jUjjljNjjPj}rn(jRjSXpyj]j]j]j]j]jTXmethodrnjVjnujNjhj]rn(jX)rn}rn(jXRequest.m2_x509_req_freejjnjX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.m2_x509_req_freernjj\j}rn(j]rnhaj_j`X M2Crypto.X509rnrn}rnbj]j]j]j]rnhajeXRequest.m2_x509_req_freejgjqljhujNjhj]rn(j~)rn}rn(jXm2_x509_req_freejjnjjnjjj}rn(jojpj]j]j]j]j]ujNjhj]rnjXm2_x509_req_freernrn}rn(jUjNjNjhjjnubaubj)rn}rn(jUjjnjjnjjj}rn(jojpj]j]j]j]j]ujNjhj]ubeubj)rn}rn(jUjjnjjnjjj}rn(j]j]j]j]j]ujNjhj]ubeubj?)rn}rn(jUjjljNjjCj}rn(j]j]j]j]j]Uentries]rn(jFX%save() (M2Crypto.X509.Request method)jaUNtrnaujNjhj]ubjM)rn}rn(jUjjljNjjPj}rn(jRjSXpyj]j]j]j]j]jTXmethodrnjVjnujNjhj]rn(jX)rn}rn(jX Request.save(filename, format=1)jjnjXS/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.savernjj\j}rn(j]rnjaaj_j`X M2Crypto.X509rnrn}rnbj]j]j]j]rnjaajeX Request.savernjgjqljhujNjhj]rn(j~)rn}rn(jXsavejjnjjnjjj}rn(jojpj]j]j]j]j]ujNjhj]rnjXsavernrn}rn(jUjNjNjhjjnubaubj)rn}rn(jXfilename, format=1jjnjjnjjj}rn(jojpj]j]j]j]j]ujNjhj]rn(j)rn}rn(jXfilenamej}rn(jojpj]j]j]j]j]ujjnj]rnjXfilenamernrn}rn(jUjjnubajjubj)rn}rn(jXformat=1j}rn(jojpj]j]j]j]j]ujjnj]rnjXformat=1rnrn}rn(jUjjnubajjubeubj)rn}rn(jUjjnjNjjj}rn(Uexprjj]j]j]j]j]ujNjhj]rnj!)rn}rn(jUj}rn(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjnujjnj]rnj)rn}rn(jUj}rn(j]j]rnjaj]j]j]ujjnj]rnjX[source]rnrn}rn(jUjjnubajjubajj%ubaubeubj)ro}ro(jUjjnjjnjjj}ro(j]j]j]j]j]ujNjhj]ro(j)ro}ro(jXHSaves X.509 certificate request to a file. Default output format is PEM.jjojXS/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.savejjj}ro(j]j]j]j]j]ujKjhj]rojXHSaves X.509 certificate request to a file. Default output format is PEM.ror o}r o(jUjNjNjhjjoubaubj)r o}r o(jUjjojNjjj}r o(j]j]j]j]j]ujNjhj]ro(j)ro}ro(jUj}ro(j]j]j]j]j]ujj oj]ro(j)ro}ro(jX Parametersjjojjnjjj}ro(j]j]j]j]j]ujKj]rojX Parametersroro}ro(jUjjoubaubj)ro}ro(jUj}ro(j]j]j]j]j]ujjoj]roj^ )ro}ro(jUj}r o(j]j]j]j]j]ujjoj]r!o(jc )r"o}r#o(jUj}r$o(j]j]j]j]j]ujjoj]r%oj)r&o}r'o(jX:filename -- Name of the file the request will be saved to.j}r(o(j]j]j]j]j]ujj"oj]r)o(j)r*o}r+o(jXfilenamej}r,o(j]j]jj]j]j]ujj&oj]r-ojXfilenamer.or/o}r0o(jUjj*oubajjubjX – r1or2o}r3o(jUjj&oubjX.Name of the file the request will be saved to.r4or5o}r6o(jUjNjNjhjj&oubejjubajjy ubjc )r7o}r8o(jUj}r9o(j]j]j]j]j]ujjoj]r:oj)r;o}ro(j)r?o}r@o(jXformatj}rAo(j]j]jj]j]j]ujj;oj]rBojXformatrCorDo}rEo(jUjj?oubajjubjX – rForGo}rHo(jUjj;oubjXControls what output format is used to save the request. Either FORMAT_PEM or FORMAT_DER to save in PEM or DER format. Raises ValueError if an unknown format is used.rIorJo}rKo(jUjNjNjhjj;oubejjubajjy ubejj ubajjubejjubj)rLo}rMo(jUj}rNo(j]j]j]j]j]ujj oj]rOo(j)rPo}rQo(jXReturnsjjLojjnjjj}rRo(j]j]j]j]j]ujKj]rSojXReturnsrTorUo}rVo(jUjjPoubaubj)rWo}rXo(jUj}rYo(j]j]j]j]j]ujjLoj]rZoj)r[o}r\o(jXN1 for success, 0 for failure. The error code can be obtained by ERR_get_error.j}r]o(j]j]j]j]j]ujjWoj]r^ojXN1 for success, 0 for failure. The error code can be obtained by ERR_get_error.r_or`o}rao(jUjNjNjhjj[oubajjubajjubejjubeubeubeubj?)rbo}rco(jUjjljNjjCj}rdo(j]j]j]j]j]Uentries]reo(jFX)save_pem() (M2Crypto.X509.Request method)h UNtrfoaujNjhj]ubjM)rgo}rho(jUjjljNjjPj}rio(jRjSXpyj]j]j]j]j]jTXmethodrjojVjjoujNjhj]rko(jX)rlo}rmo(jXRequest.save_pem(filename)jjgojXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.save_pemrnojj\j}roo(j]rpoh aj_j`X M2Crypto.X509rqorro}rsobj]j]j]j]rtoh ajeXRequest.save_pemruojgjqljhujNjhj]rvo(j~)rwo}rxo(jXsave_pemjjlojjnojjj}ryo(jojpj]j]j]j]j]ujNjhj]rzojXsave_pemr{or|o}r}o(jUjNjNjhjjwoubaubj)r~o}ro(jXfilenamejjlojjnojjj}ro(jojpj]j]j]j]j]ujNjhj]roj)ro}ro(jXfilenamej}ro(jojpj]j]j]j]j]ujj~oj]rojXfilenameroro}ro(jUjjoubajjubaubj)ro}ro(jUjjlojNjjj}ro(Uexprjj]j]j]j]j]ujNjhj]roj!)ro}ro(jUj}ro(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjuoujjoj]roj)ro}ro(jUj}ro(j]j]rojaj]j]j]ujjoj]rojX[source]roro}ro(jUjjoubajjubajj%ubaubeubj)ro}ro(jUjjgojjnojjj}ro(j]j]j]j]j]ujNjhj]ubeubj?)ro}ro(jUjjljNjjCj}ro(j]j]j]j]j]Uentries]ro(jFX+set_pubkey() (M2Crypto.X509.Request method)jUNtroaujNjhj]ubjM)ro}ro(jUjjljNjjPj}ro(jRjSXpyj]j]j]j]j]jTXmethodrojVjoujNjhj]ro(jX)ro}ro(jXRequest.set_pubkey(pkey)jjojXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.set_pubkeyrojj\j}ro(j]rojaj_j`X M2Crypto.X509roro}robj]j]j]j]rojajeXRequest.set_pubkeyrojgjqljhujNjhj]ro(j~)ro}ro(jX set_pubkeyjjojjojjj}ro(jojpj]j]j]j]j]ujNjhj]rojX set_pubkeyroro}ro(jUjNjNjhjjoubaubj)ro}ro(jXpkeyjjojjojjj}ro(jojpj]j]j]j]j]ujNjhj]roj)ro}ro(jXpkeyj}ro(jojpj]j]j]j]j]ujjoj]rojXpkeyroro}ro(jUjjoubajjubaubj)ro}ro(jUjjojNjjj}ro(Uexprjj]j]j]j]j]ujNjhj]roj!)ro}ro(jUj}ro(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjoujjoj]roj)ro}ro(jUj}ro(j]j]rojaj]j]j]ujjoj]rojX[source]roro}ro(jUjjoubajjubajj%ubaubeubj)ro}ro(jUjjojjojjj}ro(j]j]j]j]j]ujNjhj]ro(j)ro}ro(jX#Set the public key for the request.jjojXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.set_pubkeyjjj}ro(j]j]j]j]j]ujKjhj]rojX#Set the public key for the request.roro}ro(jUjNjNjhjjoubaubj)ro}ro(jUjjojNjjj}ro(j]j]j]j]j]ujNjhj]ro(j)ro}ro(jUj}ro(j]j]j]j]j]ujjoj]ro(j)ro}ro(jX Parametersjjojjojjj}ro(j]j]j]j]j]ujKj]rojX Parametersroro}ro(jUjjoubaubj)ro}ro(jUj}ro(j]j]j]j]j]ujjoj]roj)ro}ro(jXpkey -- Public keyj}ro(j]j]j]j]j]ujjoj]ro(j)ro}ro(jXpkeyj}ro(j]j]jj]j]j]ujjoj]rojXpkeyroro}ro(jUjjoubajjubjX – roro}ro(jUjjoubjX Public keyrorp}rp(jUjNjNjhjjoubejjubajjubejjubj)rp}rp(jUj}rp(j]j]j]j]j]ujjoj]rp(j)rp}rp(jXReturnsjjpjjojjj}rp(j]j]j]j]j]ujKj]r pjXReturnsr pr p}r p(jUjjpubaubj)r p}rp(jUj}rp(j]j]j]j]j]ujjpj]rpj)rp}rp(jX'Return 1 for success and 0 for failure.j}rp(j]j]j]j]j]ujj pj]rpjX'Return 1 for success and 0 for failure.rprp}rp(jUjNjNjhjjpubajjubajjubejjubeubeubeubj?)rp}rp(jUjjljNjjCj}rp(j]j]j]j]j]Uentries]rp(jFX,set_subject() (M2Crypto.X509.Request method)hUNtrpaujNjhj]ubjM)rp}rp(jUjjljNjjPj}rp(jRjSXpyj]j]j]j]j]jTXmethodr pjVj pujNjhj]r!p(jX)r"p}r#p(jXRequest.set_subject(name)jjpjXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.set_subjectr$pjj\j}r%p(j]r&phaj_j`X M2Crypto.X509r'pr(p}r)pbj]j]j]j]r*phajeXRequest.set_subjectjgjqljhujNjhj]r+p(j~)r,p}r-p(jX set_subjectjj"pjj$pjjj}r.p(jojpj]j]j]j]j]ujNjhj]r/pjX set_subjectr0pr1p}r2p(jUjNjNjhjj,pubaubj)r3p}r4p(jXnamejj"pjj$pjjj}r5p(jojpj]j]j]j]j]ujNjhj]r6pj)r7p}r8p(jXnamej}r9p(jojpj]j]j]j]j]ujj3pj]r:pjXnamer;prp}r?p(jUjjpjj$pjjj}r@p(j]j]j]j]j]ujNjhj]rAp(j)rBp}rCp(jXSet subject name.jj>pjXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.set_subjectjjj}rDp(j]j]j]j]j]ujKjhj]rEpjXSet subject name.rFprGp}rHp(jUjNjNjhjjBpubaubj)rIp}rJp(jUjj>pjNjjj}rKp(j]j]j]j]j]ujNjhj]rLp(j)rMp}rNp(jUj}rOp(j]j]j]j]j]ujjIpj]rPp(j)rQp}rRp(jX ParametersjjMpjj$pjjj}rSp(j]j]j]j]j]ujKj]rTpjX ParametersrUprVp}rWp(jUjjQpubaubj)rXp}rYp(jUj}rZp(j]j]j]j]j]ujjMpj]r[pj)r\p}r]p(jXname -- subjectName field.j}r^p(j]j]j]j]j]ujjXpj]r_p(j)r`p}rap(jXnamej}rbp(j]j]jj]j]j]ujj\pj]rcpjXnamerdprep}rfp(jUjj`pubajjubjX – rgprhp}rip(jUjj\pubjXsubjectName field.rjprkp}rlp(jUjNjNjhjj\pubejjubajjubejjubj)rmp}rnp(jUj}rop(j]j]j]j]j]ujjIpj]rpp(j)rqp}rrp(jXReturnsjjmpjj$pjjj}rsp(j]j]j]j]j]ujKj]rtpjXReturnsruprvp}rwp(jUjjqpubaubj)rxp}ryp(jUj}rzp(j]j]j]j]j]ujjmpj]r{pj)r|p}r}p(jX1 for success and 0 for failurej}r~p(j]j]j]j]j]ujjxpj]rpjX1 for success and 0 for failurerprp}rp(jUjNjNjhjj|pubajjubajjubejjubeubeubeubj?)rp}rp(jUjjljNjjCj}rp(j]j]j]j]j]Uentries]rp(jFX1set_subject_name() (M2Crypto.X509.Request method)hdUNtrpaujNjhj]ubjM)rp}rp(jUjjljNjjPj}rp(jRjSXpyj]j]j]j]j]jTXmethodrpjVjpujNjhj]rp(jX)rp}rp(jXRequest.set_subject_name(name)jjpjX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.set_subject_namerpjj\j}rp(j]rphdaj_j`X M2Crypto.X509rprp}rpbj]j]j]j]rphdajeXRequest.set_subject_namerpjgjqljhujNjhj]rp(j~)rp}rp(jXset_subject_namejjpjjpjjj}rp(jojpj]j]j]j]j]ujNjhj]rpjXset_subject_namerprp}rp(jUjNjNjhjjpubaubj)rp}rp(jXnamejjpjjpjjj}rp(jojpj]j]j]j]j]ujNjhj]rpj)rp}rp(jXnamej}rp(jojpj]j]j]j]j]ujjpj]rpjXnamerprp}rp(jUjjpubajjubaubj)rp}rp(jUjjpjNjjj}rp(Uexprjj]j]j]j]j]ujNjhj]rpj!)rp}rp(jUj}rp(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjpujjpj]rpj)rp}rp(jUj}rp(j]j]rpjaj]j]j]ujjpj]rpjX[source]rprp}rp(jUjjpubajjubajj%ubaubeubj)rp}rp(jUjjpjjpjjj}rp(j]j]j]j]j]ujNjhj]rp(j)rp}rp(jXSet subject name.jjpjX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.set_subject_namejjj}rp(j]j]j]j]j]ujKjhj]rpjXSet subject name.rprp}rp(jUjNjNjhjjpubaubj)rp}rp(jUjjpjNjjj}rp(j]j]j]j]j]ujNjhj]rp(j)rp}rp(jUj}rp(j]j]j]j]j]ujjpj]rp(j)rp}rp(jX Parametersjjpjjpjjj}rp(j]j]j]j]j]ujKj]rpjX Parametersrprp}rp(jUjjpubaubj)rp}rp(jUj}rp(j]j]j]j]j]ujjpj]rpj)rp}rp(jXname -- subjectName field.j}rp(j]j]j]j]j]ujjpj]rp(j)rp}rp(jXnamej}rp(j]j]jj]j]j]ujjpj]rpjXnamerprp}rp(jUjjpubajjubjX – rprp}rp(jUjjpubjXsubjectName field.rprp}rp(jUjNjNjhjjpubejjubajjubejjubj)rp}rp(jUj}rp(j]j]j]j]j]ujjpj]rp(j)rp}rp(jXReturnsjjpjjpjjj}rp(j]j]j]j]j]ujKj]rpjXReturnsrprp}rp(jUjjpubaubj)rp}rp(jUj}rp(j]j]j]j]j]ujjpj]rpj)rp}rp(jX1 for success and 0 for failurej}rp(j]j]j]j]j]ujjpj]rpjX1 for success and 0 for failurerprp}rp(jUjNjNjhjjpubajjubajjubejjubeubeubeubj?)rp}rq(jUjjljNjjCj}rq(j]j]j]j]j]Uentries]rq(jFX,set_version() (M2Crypto.X509.Request method)joUNtrqaujNjhj]ubjM)rq}rq(jUjjljNjjPj}rq(jRjSXpyj]j]j]j]j]jTXmethodrqjVjqujNjhj]rq(jX)r q}r q(jXRequest.set_version(version)jjqjXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.set_versionr qjj\j}r q(j]r qjoaj_j`X M2Crypto.X509rqrq}rqbj]j]j]j]rqjoajeXRequest.set_versionrqjgjqljhujNjhj]rq(j~)rq}rq(jX set_versionjj qjj qjjj}rq(jojpj]j]j]j]j]ujNjhj]rqjX set_versionrqrq}rq(jUjNjNjhjjqubaubj)rq}rq(jXversionjj qjj qjjj}rq(jojpj]j]j]j]j]ujNjhj]rqj)rq}r q(jXversionj}r!q(jojpj]j]j]j]j]ujjqj]r"qjXversionr#qr$q}r%q(jUjjqubajjubaubj)r&q}r'q(jUjj qjNjjj}r(q(Uexprjj]j]j]j]j]ujNjhj]r)qj!)r*q}r+q(jUj}r,q(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjqujj&qj]r-qj)r.q}r/q(jUj}r0q(j]j]r1qjaj]j]j]ujj*qj]r2qjX[source]r3qr4q}r5q(jUjj.qubajjubajj%ubaubeubj)r6q}r7q(jUjjqjj qjjj}r8q(j]j]j]j]j]ujNjhj]r9q(j)r:q}r;q(jX Set version.jj6qjXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.set_versionjjj}rqr?q}r@q(jUjNjNjhjj:qubaubj)rAq}rBq(jUjj6qjNjjj}rCq(j]j]j]j]j]ujNjhj]rDq(j)rEq}rFq(jUj}rGq(j]j]j]j]j]ujjAqj]rHq(j)rIq}rJq(jX ParametersjjEqjj qjjj}rKq(j]j]j]j]j]ujKj]rLqjX ParametersrMqrNq}rOq(jUjjIqubaubj)rPq}rQq(jUj}rRq(j]j]j]j]j]ujjEqj]rSqj)rTq}rUq(jXversion -- Version number.j}rVq(j]j]j]j]j]ujjPqj]rWq(j)rXq}rYq(jXversionj}rZq(j]j]jj]j]j]ujjTqj]r[qjXversionr\qr]q}r^q(jUjjXqubajjubjX – r_qr`q}raq(jUjjTqubjXVersion number.rbqrcq}rdq(jUjNjNjhjjTqubejjubajjubejjubj)req}rfq(jUj}rgq(j]j]j]j]j]ujjAqj]rhq(j)riq}rjq(jXReturnsjjeqjj qjjj}rkq(j]j]j]j]j]ujKj]rlqjXReturnsrmqrnq}roq(jUjjiqubaubj)rpq}rqq(jUj}rrq(j]j]j]j]j]ujjeqj]rsqj)rtq}ruq(jXReturns 0 on failure.j}rvq(j]j]j]j]j]ujjpqj]rwqjXReturns 0 on failure.rxqryq}rzq(jUjNjNjhjjtqubajjubajjubejjubeubeubeubj?)r{q}r|q(jUjjljNjjCj}r}q(j]j]j]j]j]Uentries]r~q(jFX%sign() (M2Crypto.X509.Request method)hUNtrqaujNjhj]ubjM)rq}rq(jUjjljNjjPj}rq(jRjSXpyj]j]j]j]j]jTXmethodrqjVjqujNjhj]rq(jX)rq}rq(jXRequest.sign(pkey, md)jjqjXS/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.signrqjj\j}rq(j]rqhaj_j`X M2Crypto.X509rqrq}rqbj]j]j]j]rqhajeX Request.signrqjgjqljhujNjhj]rq(j~)rq}rq(jXsignjjqjjqjjj}rq(jojpj]j]j]j]j]ujNjhj]rqjXsignrqrq}rq(jUjNjNjhjjqubaubj)rq}rq(jXpkey, mdjjqjjqjjj}rq(jojpj]j]j]j]j]ujNjhj]rq(j)rq}rq(jXpkeyj}rq(jojpj]j]j]j]j]ujjqj]rqjXpkeyrqrq}rq(jUjjqubajjubj)rq}rq(jXmdj}rq(jojpj]j]j]j]j]ujjqj]rqjXmdrqrq}rq(jUjjqubajjubeubj)rq}rq(jUjjqjNjjj}rq(Uexprjj]j]j]j]j]ujNjhj]rqj!)rq}rq(jUj}rq(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjqujjqj]rqj)rq}rq(jUj}rq(j]j]rqjaj]j]j]ujjqj]rqjX[source]rqrq}rq(jUjjqubajjubajj%ubaubeubj)rq}rq(jUjjqjjqjjj}rq(j]j]j]j]j]ujNjhj]rqj)rq}rq(jUjjqjNjjj}rq(j]j]j]j]j]ujNjhj]rq(j)rq}rq(jUj}rq(j]j]j]j]j]ujjqj]rq(j)rq}rq(jX Parametersjjqjjqjjj}rq(j]j]j]j]j]ujKj]rqjX Parametersrqrq}rq(jUjjqubaubj)rq}rq(jUj}rq(j]j]j]j]j]ujjqj]rqj^ )rq}rq(jUj}rq(j]j]j]j]j]ujjqj]rq(jc )rq}rq(jUj}rq(j]j]j]j]j]ujjqj]rqj)rq}rq(jXpkey -- PKey to be signedj}rq(j]j]j]j]j]ujjqj]rq(j)rq}rq(jXpkeyj}rq(j]j]jj]j]j]ujjqj]rqjXpkeyrqrq}rq(jUjjqubajjubjX – rqrq}rq(jUjjqubjXPKey to be signedrqrq}rq(jUjNjNjhjjqubejjubajjy ubjc )rq}rq(jUj}rq(j]j]j]j]j]ujjqj]rqj)rq}rq(jXmd -- used algorigthmj}rq(j]j]j]j]j]ujjqj]rq(j)rq}rq(jXmdj}rq(j]j]jj]j]j]ujjqj]rqjXmdrqrq}rq(jUjjqubajjubjX – rqrq}rq(jUjjqubjXused algorigthmrqrq}rq(jUjNjNjhjjqubejjubajjy ubejj ubajjubejjubj)rq}rq(jUj}rr(j]j]j]j]j]ujjqj]rr(j)rr}rr(jXReturnsjjqjjqjjj}rr(j]j]j]j]j]ujKj]rrjXReturnsrrrr}rr(jUjjrubaubj)r r}r r(jUj}r r(j]j]j]j]j]ujjqj]r rj)r r}rr(jX1 for success and 0 for failurej}rr(j]j]j]j]j]ujj rj]rrjX1 for success and 0 for failurerrrr}rr(jUjNjNjhjj rubajjubajjubejjubeubaubeubj?)rr}rr(jUjjljNjjCj}rr(j]j]j]j]j]Uentries]rr(jFX'verify() (M2Crypto.X509.Request method)jUNtrraujNjhj]ubjM)rr}rr(jUjjljNjjPj}rr(jRjSXpyj]j]j]j]j]jTXmethodrrjVjrujNjhj]rr(jX)rr}rr(jXRequest.verify(pkey)jjrjXU/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.Request.verifyr rjj\j}r!r(j]r"rjaj_j`X M2Crypto.X509r#rr$r}r%rbj]j]j]j]r&rjajeXRequest.verifyr'rjgjqljhujNjhj]r(r(j~)r)r}r*r(jXverifyjjrjj rjjj}r+r(jojpj]j]j]j]j]ujNjhj]r,rjXverifyr-rr.r}r/r(jUjNjNjhjj)rubaubj)r0r}r1r(jXpkeyjjrjj rjjj}r2r(jojpj]j]j]j]j]ujNjhj]r3rj)r4r}r5r(jXpkeyj}r6r(jojpj]j]j]j]j]ujj0rj]r7rjXpkeyr8rr9r}r:r(jUjj4rubajjubaubj)r;r}rrj!)r?r}r@r(jUj}rAr(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj'rujj;rj]rBrj)rCr}rDr(jUj}rEr(j]j]rFrjaj]j]j]ujj?rj]rGrjX[source]rHrrIr}rJr(jUjjCrubajjubajj%ubaubeubj)rKr}rLr(jUjjrjj rjjj}rMr(j]j]j]j]j]ujNjhj]rNrj)rOr}rPr(jUjjKrjNjjj}rQr(j]j]j]j]j]ujNjhj]rRr(j)rSr}rTr(jUj}rUr(j]j]j]j]j]ujjOrj]rVr(j)rWr}rXr(jX ParametersjjSrjj rjjj}rYr(j]j]j]j]j]ujKj]rZrjX Parametersr[rr\r}r]r(jUjjWrubaubj)r^r}r_r(jUj}r`r(j]j]j]j]j]ujjSrj]rarj)rbr}rcr(jXpkey -- PKey to be verifiedj}rdr(j]j]j]j]j]ujj^rj]rer(j)rfr}rgr(jXpkeyj}rhr(j]j]jj]j]j]ujjbrj]rirjXpkeyrjrrkr}rlr(jUjjfrubajjubjX – rmrrnr}ror(jUjjbrubjXPKey to be verifiedrprrqr}rrr(jUjNjNjhjjbrubejjubajjubejjubj)rsr}rtr(jUj}rur(j]j]j]j]j]ujjOrj]rvr(j)rwr}rxr(jXReturnsjjsrjj rjjj}ryr(j]j]j]j]j]ujKj]rzrjXReturnsr{rr|r}r}r(jUjjwrubaubj)r~r}rr(jUj}rr(j]j]j]j]j]ujjsrj]rrj)rr}rr(jX1 for success and 0 for failurej}rr(j]j]j]j]j]ujj~rj]rrjX1 for success and 0 for failurerrrr}rr(jUjNjNjhjjrubajjubajjubejjubeubaubeubeubeubj?)rr}rr(jUjjmkjNjjCj}rr(j]j]j]j]j]Uentries]rr(jFXX509 (class in M2Crypto.X509)h=UNtrraujNjhj]ubjM)rr}rr(jUjjmkjNjjPj}rr(jRjSXpyj]j]j]j]j]jTXclassrrjVjrujNjhj]rr(jX)rr}rr(jXX509(x509=None, _pyfree=0)jjrjXK/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509rrjj\j}rr(j]rrh=aj_j`X M2Crypto.X509rrrr}rrbj]j]j]j]rrh=ajeXX509rrjgUjhujNjhj]rr(jj)rr}rr(jXclass jjrjjrjjmj}rr(jojpj]j]j]j]j]ujNjhj]rrjXclass rrrr}rr(jUjNjNjhjjrubaubju)rr}rr(jXM2Crypto.X509.jjrjjrjjxj}rr(jojpj]j]j]j]j]ujNjhj]rrjXM2Crypto.X509.rrrr}rr(jUjNjNjhjjrubaubj~)rr}rr(jjrjjrjjrjjj}rr(jojpj]j]j]j]j]ujNjhj]rrjXX509rrrr}rr(jUjNjNjhjjrubaubj)rr}rr(jXx509=None, _pyfree=0jjrjjrjjj}rr(jojpj]j]j]j]j]ujNjhj]rr(j)rr}rr(jX x509=Nonej}rr(jojpj]j]j]j]j]ujjrj]rrjX x509=Nonerrrr}rr(jUjjrubajjubj)rr}rr(jX _pyfree=0j}rr(jojpj]j]j]j]j]ujjrj]rrjX _pyfree=0rrrr}rr(jUjjrubajjubeubj)rr}rr(jUjjrjNjjj}rr(Uexprjj]j]j]j]j]ujNjhj]rrj!)rr}rr(jUj}rr(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjrujjrj]rrj)rr}rr(jUj}rr(j]j]rrjaj]j]j]ujjrj]rrjX[source]rrrr}rr(jUjjrubajjubajj%ubaubeubj)rr}rr(jUjjrjjrjjj}rr(j]j]j]j]j]ujNjhj]rr(j)rr}rr(jXX.509 CertificatejjrjXK/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509jjj}rr(j]j]j]j]j]ujKjhj]rrjXX.509 Certificaterrrr}rr(jUjNjNjhjjrubaubj?)rr}rr(jUjjrjXS/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.add_extrrjjCj}rr(j]j]j]j]j]Uentries]rr(jFX%add_ext() (M2Crypto.X509.X509 method)jUNtrraujNjhj]ubjM)rr}rr(jUjjrjjrjjPj}rr(jRjSXpyj]j]j]j]j]jTXmethodrrjVjrujNjhj]rr(jX)rr}rr(jXX509.add_ext(ext)jjrjXS/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.add_extrrjj\j}rr(j]rrjaj_j`X M2Crypto.X509rrrr}rrbj]j]j]j]rrjajeX X509.add_extrrjgjrjhujNjhj]rr(j~)rr}rr(jXadd_extjjrjjrjjj}rr(jojpj]j]j]j]j]ujNjhj]rrjXadd_extrrrr}rr(jUjNjNjhjjrubaubj)rr}rr(jXextjjrjjrjjj}rr(jojpj]j]j]j]j]ujNjhj]rsj)rs}rs(jXextj}rs(jojpj]j]j]j]j]ujjrj]rsjXextrsrs}rs(jUjjsubajjubaubj)rs}r s(jUjjrjNjjj}r s(Uexprjj]j]j]j]j]ujNjhj]r sj!)r s}r s(jUj}rs(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjrujjsj]rsj)rs}rs(jUj}rs(j]j]rsjaj]j]j]ujj sj]rsjX[source]rsrs}rs(jUjjsubajjubajj%ubaubeubj)rs}rs(jUjjrjjrjjj}rs(j]j]j]j]j]ujNjhj]rs(j)rs}rs(jX'Add X509 extension to this certificate.jjsjjrjjj}rs(j]j]j]j]j]ujKjhj]rsjX'Add X509 extension to this certificate.r sr!s}r"s(jUjNjNjhjjsubaubj)r#s}r$s(jUjjsjjrjjj}r%s(j]j]j]j]j]ujNjhj]r&sj)r's}r(s(jUj}r)s(j]j]j]j]j]ujj#sj]r*s(j)r+s}r,s(jX Parametersjj'sjjrjjj}r-s(j]j]j]j]j]ujKj]r.sjX Parametersr/sr0s}r1s(jUjj+subaubj)r2s}r3s(jUj}r4s(j]j]j]j]j]ujj'sj]r5sj)r6s}r7s(jXext -- Extensionj}r8s(j]j]j]j]j]ujj2sj]r9s(j)r:s}r;s(jXextj}rsr?s}r@s(jUjj:subajjubjX – rAsrBs}rCs(jUjj6subjX ExtensionrDsrEs}rFs(jUjNjNjhjj6subejjubajjubejjubaubj)rGs}rHs(jX':return 1 for success and 0 for failurejjsjjrjjj}rIs(j]j]j]j]j]ujKjhj]rJsjX':return 1 for success and 0 for failurerKsrLs}rMs(jUjNjNjhjjGsubaubeubeubj?)rNs}rOs(jUjjrjNjjCj}rPs(j]j]j]j]j]Uentries]rQs(jFX$as_der() (M2Crypto.X509.X509 method)j+UNtrRsaujNjhj]ubjM)rSs}rTs(jUjjrjNjjPj}rUs(jRjSXpyj]j]j]j]j]jTXmethodrVsjVjVsujNjhj]rWs(jX)rXs}rYs(jX X509.as_der()jjSsjXR/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.as_derrZsjj\j}r[s(j]r\sj+aj_j`X M2Crypto.X509r]sr^s}r_sbj]j]j]j]r`sj+ajeX X509.as_derrasjgjrjhujNjhj]rbs(j~)rcs}rds(jXas_derjjXsjjZsjjj}res(jojpj]j]j]j]j]ujNjhj]rfsjXas_derrgsrhs}ris(jUjNjNjhjjcsubaubj)rjs}rks(jUjjXsjjZsjjj}rls(jojpj]j]j]j]j]ujNjhj]ubj)rms}rns(jUjjXsjNjjj}ros(Uexprjj]j]j]j]j]ujNjhj]rpsj!)rqs}rrs(jUj}rss(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjasujjmsj]rtsj)rus}rvs(jUj}rws(j]j]rxsjaj]j]j]ujjqsj]rysjX[source]rzsr{s}r|s(jUjjusubajjubajj%ubaubeubj)r}s}r~s(jUjjSsjjZsjjj}rs(j]j]j]j]j]ujNjhj]ubeubj?)rs}rs(jUjjrjNjjCj}rs(j]j]j]j]j]Uentries]rs(jFX$as_pem() (M2Crypto.X509.X509 method)h0UNtrsaujNjhj]ubjM)rs}rs(jUjjrjNjjPj}rs(jRjSXpyj]j]j]j]j]jTXmethodrsjVjsujNjhj]rs(jX)rs}rs(jX X509.as_pem()jjsjXR/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.as_pemrsjj\j}rs(j]rsh0aj_j`X M2Crypto.X509rsrs}rsbj]j]j]j]rsh0ajeX X509.as_pemrsjgjrjhujNjhj]rs(j~)rs}rs(jXas_pemjjsjjsjjj}rs(jojpj]j]j]j]j]ujNjhj]rsjXas_pemrsrs}rs(jUjNjNjhjjsubaubj)rs}rs(jUjjsjjsjjj}rs(jojpj]j]j]j]j]ujNjhj]ubj)rs}rs(jUjjsjNjjj}rs(Uexprjj]j]j]j]j]ujNjhj]rsj!)rs}rs(jUj}rs(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjsujjsj]rsj)rs}rs(jUj}rs(j]j]rsjaj]j]j]ujjsj]rsjX[source]rsrs}rs(jUjjsubajjubajj%ubaubeubj)rs}rs(jUjjsjjsjjj}rs(j]j]j]j]j]ujNjhj]ubeubj?)rs}rs(jUjjrjNjjCj}rs(j]j]j]j]j]Uentries]rs(jFX%as_text() (M2Crypto.X509.X509 method)hUNtrsaujNjhj]ubjM)rs}rs(jUjjrjNjjPj}rs(jRjSXpyj]j]j]j]j]jTXmethodrsjVjsujNjhj]rs(jX)rs}rs(jXX509.as_text()jjsjXS/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.as_textrsjj\j}rs(j]rshaj_j`X M2Crypto.X509rsrs}rsbj]j]j]j]rshajeX X509.as_textrsjgjrjhujNjhj]rs(j~)rs}rs(jXas_textjjsjjsjjj}rs(jojpj]j]j]j]j]ujNjhj]rsjXas_textrsrs}rs(jUjNjNjhjjsubaubj)rs}rs(jUjjsjjsjjj}rs(jojpj]j]j]j]j]ujNjhj]ubj)rs}rs(jUjjsjNjjj}rs(Uexprjj]j]j]j]j]ujNjhj]rsj!)rs}rs(jUj}rs(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjsujjsj]rsj)rs}rs(jUj}rs(j]j]rsjaj]j]j]ujjsj]rsjX[source]rsrs}rs(jUjjsubajjubajj%ubaubeubj)rs}rs(jUjjsjjsjjj}rs(j]j]j]j]j]ujNjhj]ubeubj?)rs}rs(jUjjrjNjjCj}rs(j]j]j]j]j]Uentries]rs(jFX&check_ca() (M2Crypto.X509.X509 method)hUNtrsaujNjhj]ubjM)rs}rs(jUjjrjNjjPj}rs(jRjSXpyj]j]j]j]j]jTXmethodrsjVjsujNjhj]rs(jX)rs}rs(jXX509.check_ca()jjsjXT/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.check_carsjj\j}rs(j]rshaj_j`X M2Crypto.X509rsrs}rsbj]j]j]j]rshajeX X509.check_carsjgjrjhujNjhj]rs(j~)rs}rs(jXcheck_cajjsjjsjjj}rs(jojpj]j]j]j]j]ujNjhj]rsjXcheck_carsrs}rs(jUjNjNjhjjsubaubj)rt}rt(jUjjsjjsjjj}rt(jojpj]j]j]j]j]ujNjhj]ubj)rt}rt(jUjjsjNjjj}rt(Uexprjj]j]j]j]j]ujNjhj]rtj!)rt}rt(jUj}r t(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjsujjtj]r tj)r t}r t(jUj}r t(j]j]rtjaj]j]j]ujjtj]rtjX[source]rtrt}rt(jUjj tubajjubajj%ubaubeubj)rt}rt(jUjjsjjsjjj}rt(j]j]j]j]j]ujNjhj]rt(j)rt}rt(jXECheck if the certificate is a Certificate Authority (CA) certificate.jjtjXT/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.check_cartjjj}rt(j]j]j]j]j]ujKjhj]rtjXECheck if the certificate is a Certificate Authority (CA) certificate.rtrt}rt(jUjNjNjhjjtubaubj)rt}r t(jUjjtjNjjj}r!t(j]j]j]j]j]ujNjhj]r"t(j)r#t}r$t(jUj}r%t(j]j]j]j]j]ujjtj]r&t(j)r't}r(t(jXReturnsjj#tjjsjjj}r)t(j]j]j]j]j]ujKj]r*tjXReturnsr+tr,t}r-t(jUjj'tubaubj)r.t}r/t(jUj}r0t(j]j]j]j]j]ujj#tj]r1tj)r2t}r3t(jX20 if the certificate is not CA, nonzero otherwise.j}r4t(j]j]j]j]j]ujj.tj]r5tjX20 if the certificate is not CA, nonzero otherwise.r6tr7t}r8t(jUjNjNjhjj2tubajjubajjubejjubj)r9t}r:t(jUjjtjjtjjj}r;t(j]j]j]j]j]ujKjhj]rt(jXrequiresjj9tjjtjjj}r?t(j]j]j]j]j]ujKj]r@tjXRequiresrAtrBt}rCt(jUjj=tubaubj)rDt}rEt(jXOpenSSL 0.9.8 or newerrFtj}rGt(j]j]j]j]j]ujj9tj]rHtj)rIt}rJt(jjFtjjDtjjtjjj}rKt(j]j]j]j]j]ujKj]rLtjXOpenSSL 0.9.8 or newerrMtrNt}rOt(jUjjItubaubajjubeubeubeubeubj?)rPt}rQt(jUjjrjNjjCj}rRt(j]j]j]j]j]Uentries]rSt(jFX+check_purpose() (M2Crypto.X509.X509 method)hSUNtrTtaujNjhj]ubjM)rUt}rVt(jUjjrjNjjPj}rWt(jRjSXpyj]j]j]j]j]jTXmethodrXtjVjXtujNjhj]rYt(jX)rZt}r[t(jXX509.check_purpose(id, ca)jjUtjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.check_purposer\tjj\j}r]t(j]r^thSaj_j`X M2Crypto.X509r_tr`t}ratbj]j]j]j]rbthSajeXX509.check_purposerctjgjrjhujNjhj]rdt(j~)ret}rft(jX check_purposejjZtjj\tjjj}rgt(jojpj]j]j]j]j]ujNjhj]rhtjX check_purposeritrjt}rkt(jUjNjNjhjjetubaubj)rlt}rmt(jXid, cajjZtjj\tjjj}rnt(jojpj]j]j]j]j]ujNjhj]rot(j)rpt}rqt(jXidj}rrt(jojpj]j]j]j]j]ujjltj]rstjXidrttrut}rvt(jUjjptubajjubj)rwt}rxt(jXcaj}ryt(jojpj]j]j]j]j]ujjltj]rztjXcar{tr|t}r}t(jUjjwtubajjubeubj)r~t}rt(jUjjZtjNjjj}rt(Uexprjj]j]j]j]j]ujNjhj]rtj!)rt}rt(jUj}rt(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjctujj~tj]rtj)rt}rt(jUj}rt(j]j]rtjaj]j]j]ujjtj]rtjX[source]rtrt}rt(jUjjtubajjubajj%ubaubeubj)rt}rt(jUjjUtjj\tjjj}rt(j]j]j]j]j]ujNjhj]rt(j)rt}rt(jX=Check if the certificate's purpose matches the asked purpose.jjtjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.check_purposejjj}rt(j]j]j]j]j]ujKjhj]rtjX?Check if the certificate’s purpose matches the asked purpose.rtrt}rt(jUjNjNjhjjtubaubj)rt}rt(jUjjtjNjjj}rt(j]j]j]j]j]ujNjhj]rt(j)rt}rt(jUj}rt(j]j]j]j]j]ujjtj]rt(j)rt}rt(jX Parametersjjtjj\tjjj}rt(j]j]j]j]j]ujKj]rtjX Parametersrtrt}rt(jUjjtubaubj)rt}rt(jUj}rt(j]j]j]j]j]ujjtj]rtj^ )rt}rt(jUj}rt(j]j]j]j]j]ujjtj]rt(jc )rt}rt(jUj}rt(j]j]j]j]j]ujjtj]rtj)rt}rt(jX/id -- Purpose id. See X509_PURPOSE_* constants.j}rt(j]j]j]j]j]ujjtj]rt(j)rt}rt(jXidj}rt(j]j]jj]j]j]ujjtj]rtjXidrtrt}rt(jUjjtubajjubjX – rtrt}rt(jUjjtubjX)Purpose id. See X509_PURPOSE_* constants.rtrt}rt(jUjNjNjhjjtubejjubajjy ubjc )rt}rt(jUj}rt(j]j]j]j]j]ujjtj]rtj)rt}rt(jX5ca -- 1 if the certificate should be CA, 0 otherwise.j}rt(j]j]j]j]j]ujjtj]rt(j)rt}rt(jXcaj}rt(j]j]jj]j]j]ujjtj]rtjXcartrt}rt(jUjjtubajjubjX – rtrt}rt(jUjjtubjX/1 if the certificate should be CA, 0 otherwise.rtrt}rt(jUjNjNjhjjtubejjubajjy ubejj ubajjubejjubj)rt}rt(jUj}rt(j]j]j]j]j]ujjtj]rt(j)rt}rt(jXReturnsjjtjj\tjjj}rt(j]j]j]j]j]ujKj]rtjXReturnsrtrt}rt(jUjjtubaubj)rt}rt(jUj}rt(j]j]j]j]j]ujjtj]rtj)rt}rt(jX?0 if the certificate purpose does not match, nonzero otherwise.j}rt(j]j]j]j]j]ujjtj]rtjX?0 if the certificate purpose does not match, nonzero otherwise.rtrt}rt(jUjNjNjhjjtubajjubajjubejjubeubeubeubj?)rt}rt(jUjjrjNjjCj}rt(j]j]j]j]j]Uentries]rt(jFX%get_ext() (M2Crypto.X509.X509 method)jUNtrtaujNjhj]ubjM)rt}rt(jUjjrjNjjPj}rt(jRjSXpyj]j]j]j]j]jTXmethodrtjVjtujNjhj]rt(jX)rt}rt(jXX509.get_ext(name)jjtjXS/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_extrtjj\j}rt(j]rtjaj_j`X M2Crypto.X509rtru}rubj]j]j]j]rujajeX X509.get_extrujgjrjhujNjhj]ru(j~)ru}ru(jXget_extjjtjjtjjj}ru(jojpj]j]j]j]j]ujNjhj]rujXget_extr ur u}r u(jUjNjNjhjjuubaubj)r u}r u(jXnamejjtjjtjjj}ru(jojpj]j]j]j]j]ujNjhj]ruj)ru}ru(jXnamej}ru(jojpj]j]j]j]j]ujj uj]rujXnameruru}ru(jUjjuubajjubaubj)ru}ru(jUjjtjNjjj}ru(Uexprjj]j]j]j]j]ujNjhj]ruj!)ru}ru(jUj}ru(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjuujjuj]ruj)ru}r u(jUj}r!u(j]j]r"ujaj]j]j]ujjuj]r#ujX[source]r$ur%u}r&u(jUjjuubajjubajj%ubaubeubj)r'u}r(u(jUjjtjjtjjj}r)u(j]j]j]j]j]ujNjhj]r*u(j)r+u}r,u(jXGet X509 extension by name.jj'ujXS/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_extjjj}r-u(j]j]j]j]j]ujKjhj]r.ujXGet X509 extension by name.r/ur0u}r1u(jUjNjNjhjj+uubaubj)r2u}r3u(jUjj'ujNjjj}r4u(j]j]j]j]j]ujNjhj]r5u(j)r6u}r7u(jUj}r8u(j]j]j]j]j]ujj2uj]r9u(j)r:u}r;u(jX Parametersjj6ujjtjjj}rur?u}r@u(jUjj:uubaubj)rAu}rBu(jUj}rCu(j]j]j]j]j]ujj6uj]rDuj)rEu}rFu(jXname -- Name of the extensionj}rGu(j]j]j]j]j]ujjAuj]rHu(j)rIu}rJu(jXnamej}rKu(j]j]jj]j]j]ujjEuj]rLujXnamerMurNu}rOu(jUjjIuubajjubjX – rPurQu}rRu(jUjjEuubjXName of the extensionrSurTu}rUu(jUjNjNjhjjEuubejjubajjubejjubj)rVu}rWu(jUj}rXu(j]j]j]j]j]ujj2uj]rYu(j)rZu}r[u(jXReturnsjjVujjtjjj}r\u(j]j]j]j]j]ujKj]r]ujXReturnsr^ur_u}r`u(jUjjZuubaubj)rau}rbu(jUj}rcu(j]j]j]j]j]ujjVuj]rduj)reu}rfu(jXX509_Extensionj}rgu(j]j]j]j]j]ujjauj]rhujXX509_Extensionriurju}rku(jUjNjNjhjjeuubajjubajjubejjubeubeubeubj?)rlu}rmu(jUjjrjNjjCj}rnu(j]j]j]j]j]Uentries]rou(jFX(get_ext_at() (M2Crypto.X509.X509 method)h|UNtrpuaujNjhj]ubjM)rqu}rru(jUjjrjNjjPj}rsu(jRjSXpyj]j]j]j]j]jTXmethodrtujVjtuujNjhj]ruu(jX)rvu}rwu(jXX509.get_ext_at(index)jjqujXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_ext_atrxujj\j}ryu(j]rzuh|aj_j`X M2Crypto.X509r{ur|u}r}ubj]j]j]j]r~uh|ajeXX509.get_ext_atrujgjrjhujNjhj]ru(j~)ru}ru(jX get_ext_atjjvujjxujjj}ru(jojpj]j]j]j]j]ujNjhj]rujX get_ext_atruru}ru(jUjNjNjhjjuubaubj)ru}ru(jXindexjjvujjxujjj}ru(jojpj]j]j]j]j]ujNjhj]ruj)ru}ru(jXindexj}ru(jojpj]j]j]j]j]ujjuj]rujXindexruru}ru(jUjjuubajjubaubj)ru}ru(jUjjvujNjjj}ru(Uexprjj]j]j]j]j]ujNjhj]ruj!)ru}ru(jUj}ru(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjuujjuj]ruj)ru}ru(jUj}ru(j]j]rujaj]j]j]ujjuj]rujX[source]ruru}ru(jUjjuubajjubajj%ubaubeubj)ru}ru(jUjjqujjxujjj}ru(j]j]j]j]j]ujNjhj]ru(j)ru}ru(jXGet X509 extension by index.jjujXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_ext_atjjj}ru(j]j]j]j]j]ujKjhj]rujXGet X509 extension by index.ruru}ru(jUjNjNjhjjuubaubj)ru}ru(jUjjujNjjj}ru(j]j]j]j]j]ujNjhj]ru(j)ru}ru(jUj}ru(j]j]j]j]j]ujjuj]ru(j)ru}ru(jX Parametersjjujjxujjj}ru(j]j]j]j]j]ujKj]rujX Parametersruru}ru(jUjjuubaubj)ru}ru(jUj}ru(j]j]j]j]j]ujjuj]ruj)ru}ru(jXindex -- Name of the extensionj}ru(j]j]j]j]j]ujjuj]ru(j)ru}ru(jXindexj}ru(j]j]jj]j]j]ujjuj]rujXindexruru}ru(jUjjuubajjubjX – ruru}ru(jUjjuubjXName of the extensionruru}ru(jUjNjNjhjjuubejjubajjubejjubj)ru}ru(jUj}ru(j]j]j]j]j]ujjuj]ru(j)ru}ru(jXReturnsjjujjxujjj}ru(j]j]j]j]j]ujKj]rujXReturnsruru}ru(jUjjuubaubj)ru}ru(jUj}ru(j]j]j]j]j]ujjuj]ruj)ru}ru(jXX509_Extensionj}ru(j]j]j]j]j]ujjuj]rujXX509_Extensionruru}ru(jUjNjNjhjjuubajjubajjubejjubeubeubeubj?)ru}ru(jUjjrjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_ext_countrujjCj}ru(j]j]j]j]j]Uentries]ru(jFX+get_ext_count() (M2Crypto.X509.X509 method)hDUNtruaujNjhj]ubjM)ru}ru(jUjjrjjujjPj}ru(jRjSXpyj]j]j]j]j]jTXmethodrujVjuujNjhj]ru(jX)ru}ru(jXX509.get_ext_count()jjujXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_ext_countrujj\j}ru(j]ruhDaj_j`X M2Crypto.X509ruru}rubj]j]j]j]ruhDajeXX509.get_ext_countrujgjrjhujNjhj]ru(j~)ru}ru(jX get_ext_countjjujjujjj}rv(jojpj]j]j]j]j]ujNjhj]rvjX get_ext_countrvrv}rv(jUjNjNjhjjuubaubj)rv}rv(jUjjujjujjj}rv(jojpj]j]j]j]j]ujNjhj]ubj)rv}r v(jUjjujNjjj}r v(Uexprjj]j]j]j]j]ujNjhj]r vj!)r v}r v(jUj}rv(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjuujjvj]rvj)rv}rv(jUj}rv(j]j]rvjaj]j]j]ujj vj]rvjX[source]rvrv}rv(jUjjvubajjubajj%ubaubeubj)rv}rv(jUjjujjujjj}rv(j]j]j]j]j]ujNjhj]rvj)rv}rv(jXGet X509 extension count.jjvjjujjj}rv(j]j]j]j]j]ujKjhj]rvjXGet X509 extension count.r vr!v}r"v(jUjNjNjhjjvubaubaubeubj?)r#v}r$v(jUjjrjNjjCj}r%v(j]j]j]j]j]Uentries]r&v(jFX-get_fingerprint() (M2Crypto.X509.X509 method)hUNtr'vaujNjhj]ubjM)r(v}r)v(jUjjrjNjjPj}r*v(jRjSXpyj]j]j]j]j]jTXmethodr+vjVj+vujNjhj]r,v(jX)r-v}r.v(jXX509.get_fingerprint(md='md5')jj(vjX[/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_fingerprintr/vjj\j}r0v(j]r1vhaj_j`X M2Crypto.X509r2vr3v}r4vbj]j]j]j]r5vhajeXX509.get_fingerprintr6vjgjrjhujNjhj]r7v(j~)r8v}r9v(jXget_fingerprintjj-vjj/vjjj}r:v(jojpj]j]j]j]j]ujNjhj]r;vjXget_fingerprintrv(jUjNjNjhjj8vubaubj)r?v}r@v(jXmd='md5'jj-vjj/vjjj}rAv(jojpj]j]j]j]j]ujNjhj]rBvj)rCv}rDv(jXmd='md5'j}rEv(jojpj]j]j]j]j]ujj?vj]rFvjXmd='md5'rGvrHv}rIv(jUjjCvubajjubaubj)rJv}rKv(jUjj-vjNjjj}rLv(Uexprjj]j]j]j]j]ujNjhj]rMvj!)rNv}rOv(jUj}rPv(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj6vujjJvj]rQvj)rRv}rSv(jUj}rTv(j]j]rUvjaj]j]j]ujjNvj]rVvjX[source]rWvrXv}rYv(jUjjRvubajjubajj%ubaubeubj)rZv}r[v(jUjj(vjj/vjjj}r\v(j]j]j]j]j]ujNjhj]r]v(j)r^v}r_v(jX'Get the fingerprint of the certificate.jjZvjX[/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_fingerprintjjj}r`v(j]j]j]j]j]ujKjhj]ravjX'Get the fingerprint of the certificate.rbvrcv}rdv(jUjNjNjhjj^vubaubj)rev}rfv(jUjjZvjNjjj}rgv(j]j]j]j]j]ujNjhj]rhv(j)riv}rjv(jUj}rkv(j]j]j]j]j]ujjevj]rlv(j)rmv}rnv(jX Parametersjjivjj/vjjj}rov(j]j]j]j]j]ujKj]rpvjX Parametersrqvrrv}rsv(jUjjmvubaubj)rtv}ruv(jUj}rvv(j]j]j]j]j]ujjivj]rwvj)rxv}ryv(jX&md -- Message digest algorithm to use.j}rzv(j]j]j]j]j]ujjtvj]r{v(j)r|v}r}v(jXmdj}r~v(j]j]jj]j]j]ujjxvj]rvjXmdrvrv}rv(jUjj|vubajjubjX – rvrv}rv(jUjjxvubjX Message digest algorithm to use.rvrv}rv(jUjNjNjhjjxvubejjubajjubejjubj)rv}rv(jUj}rv(j]j]j]j]j]ujjevj]rv(j)rv}rv(jXReturnsjjvjj/vjjj}rv(j]j]j]j]j]ujKj]rvjXReturnsrvrv}rv(jUjjvubaubj)rv}rv(jUj}rv(j]j]j]j]j]ujjvj]rvj)rv}rv(jX0String containing the fingerprint in hex format.j}rv(j]j]j]j]j]ujjvj]rvjX0String containing the fingerprint in hex format.rvrv}rv(jUjNjNjhjjvubajjubajjubejjubeubeubeubj?)rv}rv(jUjjrjNjjCj}rv(j]j]j]j]j]Uentries]rv(jFX(get_issuer() (M2Crypto.X509.X509 method)hUNtrvaujNjhj]ubjM)rv}rv(jUjjrjNjjPj}rv(jRjSXpyj]j]j]j]j]jTXmethodrvjVjvujNjhj]rv(jX)rv}rv(jXX509.get_issuer()jjvjXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_issuerrvjj\j}rv(j]rvhaj_j`X M2Crypto.X509rvrv}rvbj]j]j]j]rvhajeXX509.get_issuerrvjgjrjhujNjhj]rv(j~)rv}rv(jX get_issuerjjvjjvjjj}rv(jojpj]j]j]j]j]ujNjhj]rvjX get_issuerrvrv}rv(jUjNjNjhjjvubaubj)rv}rv(jUjjvjjvjjj}rv(jojpj]j]j]j]j]ujNjhj]ubj)rv}rv(jUjjvjNjjj}rv(Uexprjj]j]j]j]j]ujNjhj]rvj!)rv}rv(jUj}rv(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjvujjvj]rvj)rv}rv(jUj}rv(j]j]rvjaj]j]j]ujjvj]rvjX[source]rvrv}rv(jUjjvubajjubajj%ubaubeubj)rv}rv(jUjjvjjvjjj}rv(j]j]j]j]j]ujNjhj]ubeubj?)rv}rv(jUjjrjNjjCj}rv(j]j]j]j]j]Uentries]rv(jFX+get_not_after() (M2Crypto.X509.X509 method)jUNtrvaujNjhj]ubjM)rv}rv(jUjjrjNjjPj}rv(jRjSXpyj]j]j]j]j]jTXmethodrvjVjvujNjhj]rv(jX)rv}rv(jXX509.get_not_after()jjvjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_not_afterrvjj\j}rv(j]rvjaj_j`X M2Crypto.X509rvrv}rvbj]j]j]j]rvjajeXX509.get_not_afterrvjgjrjhujNjhj]rv(j~)rv}rv(jX get_not_afterjjvjjvjjj}rv(jojpj]j]j]j]j]ujNjhj]rvjX get_not_afterrvrv}rv(jUjNjNjhjjvubaubj)rv}rv(jUjjvjjvjjj}rv(jojpj]j]j]j]j]ujNjhj]ubj)rv}rv(jUjjvjNjjj}rv(Uexprjj]j]j]j]j]ujNjhj]rvj!)rv}rv(jUj}rv(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjvujjvj]rvj)rv}rv(jUj}rv(j]j]rvjaj]j]j]ujjvj]rvjX[source]rvrv}rv(jUjjvubajjubajj%ubaubeubj)rw}rw(jUjjvjjvjjj}rw(j]j]j]j]j]ujNjhj]ubeubj?)rw}rw(jUjjrjNjjCj}rw(j]j]j]j]j]Uentries]rw(jFX,get_not_before() (M2Crypto.X509.X509 method)jUNtrwaujNjhj]ubjM)rw}r w(jUjjrjNjjPj}r w(jRjSXpyj]j]j]j]j]jTXmethodr wjVj wujNjhj]r w(jX)r w}rw(jXX509.get_not_before()jjwjXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_not_beforerwjj\j}rw(j]rwjaj_j`X M2Crypto.X509rwrw}rwbj]j]j]j]rwjajeXX509.get_not_beforerwjgjrjhujNjhj]rw(j~)rw}rw(jXget_not_beforejj wjjwjjj}rw(jojpj]j]j]j]j]ujNjhj]rwjXget_not_beforerwrw}rw(jUjNjNjhjjwubaubj)rw}r w(jUjj wjjwjjj}r!w(jojpj]j]j]j]j]ujNjhj]ubj)r"w}r#w(jUjj wjNjjj}r$w(Uexprjj]j]j]j]j]ujNjhj]r%wj!)r&w}r'w(jUj}r(w(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjwujj"wj]r)wj)r*w}r+w(jUj}r,w(j]j]r-wjaj]j]j]ujj&wj]r.wjX[source]r/wr0w}r1w(jUjj*wubajjubajj%ubaubeubj)r2w}r3w(jUjjwjjwjjj}r4w(j]j]j]j]j]ujNjhj]ubeubj?)r5w}r6w(jUjjrjNjjCj}r7w(j]j]j]j]j]Uentries]r8w(jFX(get_pubkey() (M2Crypto.X509.X509 method)hUNtr9waujNjhj]ubjM)r:w}r;w(jUjjrjNjjPj}rw(jX)r?w}r@w(jXX509.get_pubkey()jj:wjXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_pubkeyrAwjj\j}rBw(j]rCwhaj_j`X M2Crypto.X509rDwrEw}rFwbj]j]j]j]rGwhajeXX509.get_pubkeyrHwjgjrjhujNjhj]rIw(j~)rJw}rKw(jX get_pubkeyjj?wjjAwjjj}rLw(jojpj]j]j]j]j]ujNjhj]rMwjX get_pubkeyrNwrOw}rPw(jUjNjNjhjjJwubaubj)rQw}rRw(jUjj?wjjAwjjj}rSw(jojpj]j]j]j]j]ujNjhj]ubj)rTw}rUw(jUjj?wjNjjj}rVw(Uexprjj]j]j]j]j]ujNjhj]rWwj!)rXw}rYw(jUj}rZw(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509UrefidjHwujjTwj]r[wj)r\w}r]w(jUj}r^w(j]j]r_wjaj]j]j]ujjXwj]r`wjX[source]rawrbw}rcw(jUjj\wubajjubajj%ubaubeubj)rdw}rew(jUjj:wjjAwjjj}rfw(j]j]j]j]j]ujNjhj]ubeubj?)rgw}rhw(jUjjrjNjjCj}riw(j]j]j]j]j]Uentries]rjw(jFX/get_serial_number() (M2Crypto.X509.X509 method)jUNtrkwaujNjhj]ubjM)rlw}rmw(jUjjrjNjjPj}rnw(jRjSXpyj]j]j]j]j]jTXmethodrowjVjowujNjhj]rpw(jX)rqw}rrw(jXX509.get_serial_number()jjlwjX]/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_serial_numberrswjj\j}rtw(j]ruwjaj_j`X M2Crypto.X509rvwrww}rxwbj]j]j]j]rywjajeXX509.get_serial_numberrzwjgjrjhujNjhj]r{w(j~)r|w}r}w(jXget_serial_numberjjqwjjswjjj}r~w(jojpj]j]j]j]j]ujNjhj]rwjXget_serial_numberrwrw}rw(jUjNjNjhjj|wubaubj)rw}rw(jUjjqwjjswjjj}rw(jojpj]j]j]j]j]ujNjhj]ubj)rw}rw(jUjjqwjNjjj}rw(Uexprjj]j]j]j]j]ujNjhj]rwj!)rw}rw(jUj}rw(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjzwujjwj]rwj)rw}rw(jUj}rw(j]j]rwjaj]j]j]ujjwj]rwjX[source]rwrw}rw(jUjjwubajjubajj%ubaubeubj)rw}rw(jUjjlwjjswjjj}rw(j]j]j]j]j]ujNjhj]ubeubj?)rw}rw(jUjjrjNjjCj}rw(j]j]j]j]j]Uentries]rw(jFX)get_subject() (M2Crypto.X509.X509 method)hUNtrwaujNjhj]ubjM)rw}rw(jUjjrjNjjPj}rw(jRjSXpyj]j]j]j]j]jTXmethodrwjVjwujNjhj]rw(jX)rw}rw(jXX509.get_subject()jjwjXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_subjectrwjj\j}rw(j]rwhaj_j`X M2Crypto.X509rwrw}rwbj]j]j]j]rwhajeXX509.get_subjectrwjgjrjhujNjhj]rw(j~)rw}rw(jX get_subjectjjwjjwjjj}rw(jojpj]j]j]j]j]ujNjhj]rwjX get_subjectrwrw}rw(jUjNjNjhjjwubaubj)rw}rw(jUjjwjjwjjj}rw(jojpj]j]j]j]j]ujNjhj]ubj)rw}rw(jUjjwjNjjj}rw(Uexprjj]j]j]j]j]ujNjhj]rwj!)rw}rw(jUj}rw(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjwujjwj]rwj)rw}rw(jUj}rw(j]j]rwjaj]j]j]ujjwj]rwjX[source]rwrw}rw(jUjjwubajjubajj%ubaubeubj)rw}rw(jUjjwjjwjjj}rw(j]j]j]j]j]ujNjhj]ubeubj?)rw}rw(jUjjrjNjjCj}rw(j]j]j]j]j]Uentries]rw(jFX)get_version() (M2Crypto.X509.X509 method)jUNtrwaujNjhj]ubjM)rw}rw(jUjjrjNjjPj}rw(jRjSXpyj]j]j]j]j]jTXmethodrwjVjwujNjhj]rw(jX)rw}rw(jXX509.get_version()jjwjXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.get_versionrwjj\j}rw(j]rwjaj_j`X M2Crypto.X509rwrw}rwbj]j]j]j]rwjajeXX509.get_versionrwjgjrjhujNjhj]rw(j~)rw}rw(jX get_versionjjwjjwjjj}rw(jojpj]j]j]j]j]ujNjhj]rwjX get_versionrwrw}rw(jUjNjNjhjjwubaubj)rw}rw(jUjjwjjwjjj}rw(jojpj]j]j]j]j]ujNjhj]ubj)rw}rw(jUjjwjNjjj}rw(Uexprjj]j]j]j]j]ujNjhj]rwj!)rw}rw(jUj}rw(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjwujjwj]rwj)rw}rw(jUj}rw(j]j]rwjaj]j]j]ujjwj]rwjX[source]rwrw}rw(jUjjwubajjubajj%ubaubeubj)rw}rw(jUjjwjjwjjj}rw(j]j]j]j]j]ujNjhj]ubeubj?)rw}rw(jUjjrjNjjCj}rw(j]j]j]j]j]Uentries]rx(jFX*m2_x509_free() (M2Crypto.X509.X509 method)h*UNtrxaujNjhj]ubjM)rx}rx(jUjjrjNjjPj}rx(jRjSXpyj]j]j]j]j]jTXmethodrxjVjxujNjhj]rx(jX)rx}rx(jXX509.m2_x509_freejjxjXX/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.m2_x509_freer xjj\j}r x(j]r xh*aj_j`X M2Crypto.X509r xr x}rxbj]j]j]j]rxh*ajeXX509.m2_x509_freejgjrjhujNjhj]rx(j~)rx}rx(jX m2_x509_freejjxjj xjjj}rx(jojpj]j]j]j]j]ujNjhj]rxjX m2_x509_freerxrx}rx(jUjNjNjhjjxubaubj)rx}rx(jUjjxjj xjjj}rx(jojpj]j]j]j]j]ujNjhj]ubeubj)rx}rx(jUjjxjj xjjj}rx(j]j]j]j]j]ujNjhj]ubeubj?)rx}rx(jUjjrjNjjCj}r x(j]j]j]j]j]Uentries]r!x(jFX"save() (M2Crypto.X509.X509 method)j UNtr"xaujNjhj]ubjM)r#x}r$x(jUjjrjNjjPj}r%x(jRjSXpyj]j]j]j]j]jTXmethodr&xjVj&xujNjhj]r'x(jX)r(x}r)x(jXX509.save(filename, format=1)jj#xjXP/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.saver*xjj\j}r+x(j]r,xj aj_j`X M2Crypto.X509r-xr.x}r/xbj]j]j]j]r0xj ajeX X509.saver1xjgjrjhujNjhj]r2x(j~)r3x}r4x(jXsavejj(xjj*xjjj}r5x(jojpj]j]j]j]j]ujNjhj]r6xjXsaver7xr8x}r9x(jUjNjNjhjj3xubaubj)r:x}r;x(jXfilename, format=1jj(xjj*xjjj}rx}r?x(jXfilenamej}r@x(jojpj]j]j]j]j]ujj:xj]rAxjXfilenamerBxrCx}rDx(jUjj>xubajjubj)rEx}rFx(jXformat=1j}rGx(jojpj]j]j]j]j]ujj:xj]rHxjXformat=1rIxrJx}rKx(jUjjExubajjubeubj)rLx}rMx(jUjj(xjNjjj}rNx(Uexprjj]j]j]j]j]ujNjhj]rOxj!)rPx}rQx(jUj}rRx(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj1xujjLxj]rSxj)rTx}rUx(jUj}rVx(j]j]rWxjaj]j]j]ujjPxj]rXxjX[source]rYxrZx}r[x(jUjjTxubajjubajj%ubaubeubj)r\x}r]x(jUjj#xjj*xjjj}r^x(j]j]j]j]j]ujNjhj]r_x(j)r`x}rax(jX@Saves X.509 certificate to a file. Default output format is PEM.jj\xjXP/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.savejjj}rbx(j]j]j]j]j]ujKjhj]rcxjX@Saves X.509 certificate to a file. Default output format is PEM.rdxrex}rfx(jUjNjNjhjj`xubaubj)rgx}rhx(jUjj\xjNjjj}rix(j]j]j]j]j]ujNjhj]rjx(j)rkx}rlx(jUj}rmx(j]j]j]j]j]ujjgxj]rnx(j)rox}rpx(jX Parametersjjkxjj*xjjj}rqx(j]j]j]j]j]ujKj]rrxjX Parametersrsxrtx}rux(jUjjoxubaubj)rvx}rwx(jUj}rxx(j]j]j]j]j]ujjkxj]ryxj^ )rzx}r{x(jUj}r|x(j]j]j]j]j]ujjvxj]r}x(jc )r~x}rx(jUj}rx(j]j]j]j]j]ujjzxj]rxj)rx}rx(jX7filename -- Name of the file the cert will be saved to.j}rx(j]j]j]j]j]ujj~xj]rx(j)rx}rx(jXfilenamej}rx(j]j]jj]j]j]ujjxj]rxjXfilenamerxrx}rx(jUjjxubajjubjX – rxrx}rx(jUjjxubjX+Name of the file the cert will be saved to.rxrx}rx(jUjNjNjhjjxubejjubajjy ubjc )rx}rx(jUj}rx(j]j]j]j]j]ujjzxj]rxj)rx}rx(jXformat -- Controls what output format is used to save the cert. Either FORMAT_PEM or FORMAT_DER to save in PEM or DER format. Raises a ValueError if an unknow format is used.j}rx(j]j]j]j]j]ujjxj]rx(j)rx}rx(jXformatj}rx(j]j]jj]j]j]ujjxj]rxjXformatrxrx}rx(jUjjxubajjubjX – rxrx}rx(jUjjxubjXControls what output format is used to save the cert. Either FORMAT_PEM or FORMAT_DER to save in PEM or DER format. Raises a ValueError if an unknow format is used.rxrx}rx(jUjNjNjhjjxubejjubajjy ubejj ubajjubejjubj)rx}rx(jUj}rx(j]j]j]j]j]ujjgxj]rx(j)rx}rx(jXReturnsjjxjj*xjjj}rx(j]j]j]j]j]ujKj]rxjXReturnsrxrx}rx(jUjjxubaubj)rx}rx(jUj}rx(j]j]j]j]j]ujjxj]rxj)rx}rx(jX1 for success or 0 for failurej}rx(j]j]j]j]j]ujjxj]rxjX1 for success or 0 for failurerxrx}rx(jUjNjNjhjjxubajjubajjubejjubeubeubeubj?)rx}rx(jUjjrjNjjCj}rx(j]j]j]j]j]Uentries]rx(jFX&save_pem() (M2Crypto.X509.X509 method)jUNtrxaujNjhj]ubjM)rx}rx(jUjjrjNjjPj}rx(jRjSXpyj]j]j]j]j]jTXmethodrxjVjxujNjhj]rx(jX)rx}rx(jXX509.save_pem(filename)jjxjXT/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.save_pemrxjj\j}rx(j]rxjaj_j`X M2Crypto.X509rxrx}rxbj]j]j]j]rxjajeX X509.save_pemrxjgjrjhujNjhj]rx(j~)rx}rx(jXsave_pemjjxjjxjjj}rx(jojpj]j]j]j]j]ujNjhj]rxjXsave_pemrxrx}rx(jUjNjNjhjjxubaubj)rx}rx(jXfilenamejjxjjxjjj}rx(jojpj]j]j]j]j]ujNjhj]rxj)rx}rx(jXfilenamej}rx(jojpj]j]j]j]j]ujjxj]rxjXfilenamerxrx}rx(jUjjxubajjubaubj)rx}rx(jUjjxjNjjj}rx(Uexprjj]j]j]j]j]ujNjhj]rxj!)rx}rx(jUj}rx(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjxujjxj]rxj)rx}rx(jUj}rx(j]j]rxjaj]j]j]ujjxj]rxjX[source]rxrx}rx(jUjjxubajjubajj%ubaubeubj)rx}rx(jUjjxjjxjjj}rx(j]j]j]j]j]ujNjhj]rxj)rx}rx(jUjjxjNjjj}rx(j]j]j]j]j]ujNjhj]rx(j)rx}rx(jUj}rx(j]j]j]j]j]ujjxj]ry(j)ry}ry(jX Parametersjjxjjxjjj}ry(j]j]j]j]j]ujKj]ryjX Parametersryry}ry(jUjjyubaubj)ry}r y(jUj}r y(j]j]j]j]j]ujjxj]r yj)r y}r y(jX)filename -- name of the file to be loadedj}ry(j]j]j]j]j]ujjyj]ry(j)ry}ry(jXfilenamej}ry(j]j]jj]j]j]ujj yj]ryjXfilenameryry}ry(jUjjyubajjubjX – ryry}ry(jUjj yubjXname of the file to be loadedryry}ry(jUjNjNjhjj yubejjubajjubejjubj)ry}ry(jUj}ry(j]j]j]j]j]ujjxj]r y(j)r!y}r"y(jXReturnsjjyjjxjjj}r#y(j]j]j]j]j]ujKj]r$yjXReturnsr%yr&y}r'y(jUjj!yubaubj)r(y}r)y(jUj}r*y(j]j]j]j]j]ujjyj]r+yj)r,y}r-y(jX1 for success or 0 for failurej}r.y(j]j]j]j]j]ujj(yj]r/yjX1 for success or 0 for failurer0yr1y}r2y(jUjNjNjhjj,yubajjubajjubejjubeubaubeubj?)r3y}r4y(jUjjrjXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_issuerr5yjjCj}r6y(j]j]j]j]j]Uentries]r7y(jFX(set_issuer() (M2Crypto.X509.X509 method)hUNtr8yaujNjhj]ubjM)r9y}r:y(jUjjrjj5yjjPj}r;y(jRjSXpyj]j]j]j]j]jTXmethodry}r?y(jXX509.set_issuer(name)jj9yjXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_issuerr@yjj\j}rAy(j]rByhaj_j`X M2Crypto.X509rCyrDy}rEybj]j]j]j]rFyhajeXX509.set_issuerrGyjgjrjhujNjhj]rHy(j~)rIy}rJy(jX set_issuerjj>yjj@yjjj}rKy(jojpj]j]j]j]j]ujNjhj]rLyjX set_issuerrMyrNy}rOy(jUjNjNjhjjIyubaubj)rPy}rQy(jXnamejj>yjj@yjjj}rRy(jojpj]j]j]j]j]ujNjhj]rSyj)rTy}rUy(jXnamej}rVy(jojpj]j]j]j]j]ujjPyj]rWyjXnamerXyrYy}rZy(jUjjTyubajjubaubj)r[y}r\y(jUjj>yjNjjj}r]y(Uexprjj]j]j]j]j]ujNjhj]r^yj!)r_y}r`y(jUj}ray(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509UrefidjGyujj[yj]rbyj)rcy}rdy(jUj}rey(j]j]rfyjaj]j]j]ujj_yj]rgyjX[source]rhyriy}rjy(jUjjcyubajjubajj%ubaubeubj)rky}rly(jUjj9yjj@yjjj}rmy(j]j]j]j]j]ujNjhj]rny(j)roy}rpy(jXSet issuer name.jjkyjj5yjjj}rqy(j]j]j]j]j]ujKjhj]rryjXSet issuer name.rsyrty}ruy(jUjNjNjhjjoyubaubj)rvy}rwy(jUjjkyjj5yjjj}rxy(j]j]j]j]j]ujNjhj]ryyj)rzy}r{y(jUj}r|y(j]j]j]j]j]ujjvyj]r}y(j)r~y}ry(jX Parametersjjzyjj5yjjj}ry(j]j]j]j]j]ujKj]ryjX Parametersryry}ry(jUjj~yubaubj)ry}ry(jUj}ry(j]j]j]j]j]ujjzyj]ryj)ry}ry(jXname -- subjectName field.j}ry(j]j]j]j]j]ujjyj]ry(j)ry}ry(jXnamej}ry(j]j]jj]j]j]ujjyj]ryjXnameryry}ry(jUjjyubajjubjX – ryry}ry(jUjjyubjXsubjectName field.ryry}ry(jUjNjNjhjjyubejjubajjubejjubaubj)ry}ry(jX':return 1 for success and 0 for failurejjkyjj5yjjj}ry(j]j]j]j]j]ujKjhj]ryjX':return 1 for success and 0 for failureryry}ry(jUjNjNjhjjyubaubeubeubj?)ry}ry(jUjjrjNjjCj}ry(j]j]j]j]j]Uentries]ry(jFX-set_issuer_name() (M2Crypto.X509.X509 method)jUNtryaujNjhj]ubjM)ry}ry(jUjjrjNjjPj}ry(jRjSXpyj]j]j]j]j]jTXmethodryjVjyujNjhj]ry(jX)ry}ry(jXX509.set_issuer_name(name)jjyjX[/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_issuer_nameryjj\j}ry(j]ryjaj_j`X M2Crypto.X509ryry}rybj]j]j]j]ryjajeXX509.set_issuer_nameryjgjrjhujNjhj]ry(j~)ry}ry(jXset_issuer_namejjyjjyjjj}ry(jojpj]j]j]j]j]ujNjhj]ryjXset_issuer_nameryry}ry(jUjNjNjhjjyubaubj)ry}ry(jXnamejjyjjyjjj}ry(jojpj]j]j]j]j]ujNjhj]ryj)ry}ry(jXnamej}ry(jojpj]j]j]j]j]ujjyj]ryjXnameryry}ry(jUjjyubajjubaubj)ry}ry(jUjjyjNjjj}ry(Uexprjj]j]j]j]j]ujNjhj]ryj!)ry}ry(jUj}ry(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjyujjyj]ryj)ry}ry(jUj}ry(j]j]ryjaj]j]j]ujjyj]ryjX[source]ryry}ry(jUjjyubajjubajj%ubaubeubj)ry}ry(jUjjyjjyjjj}ry(j]j]j]j]j]ujNjhj]ryj)ry}ry(jUjjyjNjjj}ry(j]j]j]j]j]ujNjhj]ryj)ry}ry(jUj}ry(j]j]j]j]j]ujjyj]ry(j)ry}ry(jXReturnsjjyjjyjjj}ry(j]j]j]j]j]ujKj]ryjXReturnsryry}ry(jUjjyubaubj)ry}ry(jUj}ry(j]j]j]j]j]ujjyj]ryj)ry}ry(jX1 on success, 0 on failurej}ry(j]j]j]j]j]ujjyj]ryjX1 on success, 0 on failureryry}ry(jUjNjNjhjjyubajjubajjubejjubaubaubeubj?)ry}ry(jUjjrjNjjCj}ry(j]j]j]j]j]Uentries]ry(jFX+set_not_after() (M2Crypto.X509.X509 method)hTUNtryaujNjhj]ubjM)ry}ry(jUjjrjNjjPj}ry(jRjSXpyj]j]j]j]j]jTXmethodryjVjyujNjhj]ry(jX)rz}rz(jXX509.set_not_after(asn1_time)jjyjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_not_afterrzjj\j}rz(j]rzhTaj_j`X M2Crypto.X509rzrz}rzbj]j]j]j]rzhTajeXX509.set_not_afterr zjgjrjhujNjhj]r z(j~)r z}r z(jX set_not_afterjjzjjzjjj}r z(jojpj]j]j]j]j]ujNjhj]rzjX set_not_afterrzrz}rz(jUjNjNjhjj zubaubj)rz}rz(jX asn1_timejjzjjzjjj}rz(jojpj]j]j]j]j]ujNjhj]rzj)rz}rz(jX asn1_timej}rz(jojpj]j]j]j]j]ujjzj]rzjX asn1_timerzrz}rz(jUjjzubajjubaubj)rz}rz(jUjjzjNjjj}rz(Uexprjj]j]j]j]j]ujNjhj]r zj!)r!z}r"z(jUj}r#z(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj zujjzj]r$zj)r%z}r&z(jUj}r'z(j]j]r(zjaj]j]j]ujj!zj]r)zjX[source]r*zr+z}r,z(jUjj%zubajjubajj%ubaubeubj)r-z}r.z(jUjjyjjzjjj}r/z(j]j]j]j]j]ujNjhj]r0zj)r1z}r2z(jUjj-zjNjjj}r3z(j]j]j]j]j]ujNjhj]r4zj)r5z}r6z(jUj}r7z(j]j]j]j]j]ujj1zj]r8z(j)r9z}r:z(jXReturnsjj5zjjzjjj}r;z(j]j]j]j]j]ujKj]rz}r?z(jUjj9zubaubj)r@z}rAz(jUj}rBz(j]j]j]j]j]ujj5zj]rCzj)rDz}rEz(jX1 on success, 0 on failurej}rFz(j]j]j]j]j]ujj@zj]rGzjX1 on success, 0 on failurerHzrIz}rJz(jUjNjNjhjjDzubajjubajjubejjubaubaubeubj?)rKz}rLz(jUjjrjNjjCj}rMz(j]j]j]j]j]Uentries]rNz(jFX,set_not_before() (M2Crypto.X509.X509 method)jUNtrOzaujNjhj]ubjM)rPz}rQz(jUjjrjNjjPj}rRz(jRjSXpyj]j]j]j]j]jTXmethodrSzjVjSzujNjhj]rTz(jX)rUz}rVz(jXX509.set_not_before(asn1_time)jjPzjXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_not_beforerWzjj\j}rXz(j]rYzjaj_j`X M2Crypto.X509rZzr[z}r\zbj]j]j]j]r]zjajeXX509.set_not_beforer^zjgjrjhujNjhj]r_z(j~)r`z}raz(jXset_not_beforejjUzjjWzjjj}rbz(jojpj]j]j]j]j]ujNjhj]rczjXset_not_beforerdzrez}rfz(jUjNjNjhjj`zubaubj)rgz}rhz(jX asn1_timejjUzjjWzjjj}riz(jojpj]j]j]j]j]ujNjhj]rjzj)rkz}rlz(jX asn1_timej}rmz(jojpj]j]j]j]j]ujjgzj]rnzjX asn1_timerozrpz}rqz(jUjjkzubajjubaubj)rrz}rsz(jUjjUzjNjjj}rtz(Uexprjj]j]j]j]j]ujNjhj]ruzj!)rvz}rwz(jUj}rxz(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj^zujjrzj]ryzj)rzz}r{z(jUj}r|z(j]j]r}zjaj]j]j]ujjvzj]r~zjX[source]rzrz}rz(jUjjzzubajjubajj%ubaubeubj)rz}rz(jUjjPzjjWzjjj}rz(j]j]j]j]j]ujNjhj]rzj)rz}rz(jUjjzjNjjj}rz(j]j]j]j]j]ujNjhj]rzj)rz}rz(jUj}rz(j]j]j]j]j]ujjzj]rz(j)rz}rz(jXReturnsjjzjjWzjjj}rz(j]j]j]j]j]ujKj]rzjXReturnsrzrz}rz(jUjjzubaubj)rz}rz(jUj}rz(j]j]j]j]j]ujjzj]rzj)rz}rz(jX1 on success, 0 on failurej}rz(j]j]j]j]j]ujjzj]rzjX1 on success, 0 on failurerzrz}rz(jUjNjNjhjjzubajjubajjubejjubaubaubeubj?)rz}rz(jUjjrjXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_pubkeyrzjjCj}rz(j]j]j]j]j]Uentries]rz(jFX(set_pubkey() (M2Crypto.X509.X509 method)jUNtrzaujNjhj]ubjM)rz}rz(jUjjrjjzjjPj}rz(jRjSXpyj]j]j]j]j]jTXmethodrzjVjzujNjhj]rz(jX)rz}rz(jXX509.set_pubkey(pkey)jjzjXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_pubkeyrzjj\j}rz(j]rzjaj_j`X M2Crypto.X509rzrz}rzbj]j]j]j]rzjajeXX509.set_pubkeyrzjgjrjhujNjhj]rz(j~)rz}rz(jX set_pubkeyjjzjjzjjj}rz(jojpj]j]j]j]j]ujNjhj]rzjX set_pubkeyrzrz}rz(jUjNjNjhjjzubaubj)rz}rz(jXpkeyjjzjjzjjj}rz(jojpj]j]j]j]j]ujNjhj]rzj)rz}rz(jXpkeyj}rz(jojpj]j]j]j]j]ujjzj]rzjXpkeyrzrz}rz(jUjjzubajjubaubj)rz}rz(jUjjzjNjjj}rz(Uexprjj]j]j]j]j]ujNjhj]rzj!)rz}rz(jUj}rz(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjzujjzj]rzj)rz}rz(jUj}rz(j]j]rzjaj]j]j]ujjzj]rzjX[source]rzrz}rz(jUjjzubajjubajj%ubaubeubj)rz}rz(jUjjzjjzjjj}rz(j]j]j]j]j]ujNjhj]rz(j)rz}rz(jX&Set the public key for the certificatejjzjjzjjj}rz(j]j]j]j]j]ujKjhj]rzjX&Set the public key for the certificaterzrz}rz(jUjNjNjhjjzubaubj)rz}rz(jUjjzjjzjjj}rz(j]j]j]j]j]ujNjhj]rzj)rz}rz(jUj}rz(j]j]j]j]j]ujjzj]rz(j)rz}rz(jX Parametersjjzjjzjjj}rz(j]j]j]j]j]ujKj]rzjX Parametersrzrz}rz(jUjjzubaubj)rz}rz(jUj}rz(j]j]j]j]j]ujjzj]rzj)rz}rz(jXpkey -- Public keyj}rz(j]j]j]j]j]ujjzj]rz(j)rz}rz(jXpkeyj}rz(j]j]jj]j]j]ujjzj]rzjXpkeyrzrz}r{(jUjjzubajjubjX – r{r{}r{(jUjjzubjX Public keyr{r{}r{(jUjNjNjhjjzubejjubajjubejjubaubj)r{}r{(jX':return 1 for success and 0 for failurejjzjjzjjj}r {(j]j]j]j]j]ujKjhj]r {jX':return 1 for success and 0 for failurer {r {}r {(jUjNjNjhjj{ubaubeubeubj?)r{}r{(jUjjrjX]/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_serial_numberr{jjCj}r{(j]j]j]j]j]Uentries]r{(jFX/set_serial_number() (M2Crypto.X509.X509 method)hUNtr{aujNjhj]ubjM)r{}r{(jUjjrjj{jjPj}r{(jRjSXpyj]j]j]j]j]jTXmethodr{jVj{ujNjhj]r{(jX)r{}r{(jXX509.set_serial_number(serial)jj{jX]/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_serial_numberr{jj\j}r{(j]r{haj_j`X M2Crypto.X509r{r{}r {bj]j]j]j]r!{hajeXX509.set_serial_numberr"{jgjrjhujNjhj]r#{(j~)r${}r%{(jXset_serial_numberjj{jj{jjj}r&{(jojpj]j]j]j]j]ujNjhj]r'{jXset_serial_numberr({r){}r*{(jUjNjNjhjj${ubaubj)r+{}r,{(jXserialjj{jj{jjj}r-{(jojpj]j]j]j]j]ujNjhj]r.{j)r/{}r0{(jXserialj}r1{(jojpj]j]j]j]j]ujj+{j]r2{jXserialr3{r4{}r5{(jUjj/{ubajjubaubj)r6{}r7{(jUjj{jNjjj}r8{(Uexprjj]j]j]j]j]ujNjhj]r9{j!)r:{}r;{(jUj}r<{(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj"{ujj6{j]r={j)r>{}r?{(jUj}r@{(j]j]rA{jaj]j]j]ujj:{j]rB{jX[source]rC{rD{}rE{(jUjj>{ubajjubajj%ubaubeubj)rF{}rG{(jUjj{jj{jjj}rH{(j]j]j]j]j]ujNjhj]rI{(j)rJ{}rK{(jXSet serial number.jjF{jj{jjj}rL{(j]j]j]j]j]ujKjhj]rM{jXSet serial number.rN{rO{}rP{(jUjNjNjhjjJ{ubaubj)rQ{}rR{(jUjjF{jj{jjj}rS{(j]j]j]j]j]ujNjhj]rT{j)rU{}rV{(jUj}rW{(j]j]j]j]j]ujjQ{j]rX{(j)rY{}rZ{(jX ParametersjjU{jj{jjj}r[{(j]j]j]j]j]ujKj]r\{jX Parametersr]{r^{}r_{(jUjjY{ubaubj)r`{}ra{(jUj}rb{(j]j]j]j]j]ujjU{j]rc{j)rd{}re{(jXserial -- Serial number.j}rf{(j]j]j]j]j]ujj`{j]rg{(j)rh{}ri{(jXserialj}rj{(j]j]jj]j]j]ujjd{j]rk{jXserialrl{rm{}rn{(jUjjh{ubajjubjX – ro{rp{}rq{(jUjjd{ubjXSerial number.rr{rs{}rt{(jUjNjNjhjjd{ubejjubajjubejjubaubj)ru{}rv{(jX(:return 1 for success and 0 for failure.jjF{jj{jjj}rw{(j]j]j]j]j]ujKjhj]rx{jX(:return 1 for success and 0 for failure.ry{rz{}r{{(jUjNjNjhjju{ubaubeubeubj?)r|{}r}{(jUjjrjXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_subjectr~{jjCj}r{(j]j]j]j]j]Uentries]r{(jFX)set_subject() (M2Crypto.X509.X509 method)jUNtr{aujNjhj]ubjM)r{}r{(jUjjrjj~{jjPj}r{(jRjSXpyj]j]j]j]j]jTXmethodr{jVj{ujNjhj]r{(jX)r{}r{(jXX509.set_subject(name)jj{jXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_subjectr{jj\j}r{(j]r{jaj_j`X M2Crypto.X509r{r{}r{bj]j]j]j]r{jajeXX509.set_subjectr{jgjrjhujNjhj]r{(j~)r{}r{(jX set_subjectjj{jj{jjj}r{(jojpj]j]j]j]j]ujNjhj]r{jX set_subjectr{r{}r{(jUjNjNjhjj{ubaubj)r{}r{(jXnamejj{jj{jjj}r{(jojpj]j]j]j]j]ujNjhj]r{j)r{}r{(jXnamej}r{(jojpj]j]j]j]j]ujj{j]r{jXnamer{r{}r{(jUjj{ubajjubaubj)r{}r{(jUjj{jNjjj}r{(Uexprjj]j]j]j]j]ujNjhj]r{j!)r{}r{(jUj}r{(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj{ujj{j]r{j)r{}r{(jUj}r{(j]j]r{jaj]j]j]ujj{j]r{jX[source]r{r{}r{(jUjj{ubajjubajj%ubaubeubj)r{}r{(jUjj{jj{jjj}r{(j]j]j]j]j]ujNjhj]r{(j)r{}r{(jXSet subject name.jj{jj~{jjj}r{(j]j]j]j]j]ujKjhj]r{jXSet subject name.r{r{}r{(jUjNjNjhjj{ubaubj)r{}r{(jUjj{jj~{jjj}r{(j]j]j]j]j]ujNjhj]r{j)r{}r{(jUj}r{(j]j]j]j]j]ujj{j]r{(j)r{}r{(jX Parametersjj{jj~{jjj}r{(j]j]j]j]j]ujKj]r{jX Parametersr{r{}r{(jUjj{ubaubj)r{}r{(jUj}r{(j]j]j]j]j]ujj{j]r{j)r{}r{(jXname -- subjectName field.j}r{(j]j]j]j]j]ujj{j]r{(j)r{}r{(jXnamej}r{(j]j]jj]j]j]ujj{j]r{jXnamer{r{}r{(jUjj{ubajjubjX – r{r{}r{(jUjj{ubjXsubjectName field.r{r{}r{(jUjNjNjhjj{ubejjubajjubejjubaubj)r{}r{(jX':return 1 for success and 0 for failurejj{jj~{jjj}r{(j]j]j]j]j]ujKjhj]r{jX':return 1 for success and 0 for failurer{r{}r{(jUjNjNjhjj{ubaubeubeubj?)r{}r{(jUjjrjNjjCj}r{(j]j]j]j]j]Uentries]r{(jFX.set_subject_name() (M2Crypto.X509.X509 method)j1UNtr{aujNjhj]ubjM)r{}r{(jUjjrjNjjPj}r{(jRjSXpyj]j]j]j]j]jTXmethodr{jVj{ujNjhj]r{(jX)r{}r{(jXX509.set_subject_name(name)jj{jX\/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_subject_namer{jj\j}r{(j]r{j1aj_j`X M2Crypto.X509r{r{}r{bj]j]j]j]r{j1ajeXX509.set_subject_namer{jgjrjhujNjhj]r{(j~)r{}r|(jXset_subject_namejj{jj{jjj}r|(jojpj]j]j]j]j]ujNjhj]r|jXset_subject_namer|r|}r|(jUjNjNjhjj{ubaubj)r|}r|(jXnamejj{jj{jjj}r|(jojpj]j]j]j]j]ujNjhj]r |j)r |}r |(jXnamej}r |(jojpj]j]j]j]j]ujj|j]r |jXnamer|r|}r|(jUjj |ubajjubaubj)r|}r|(jUjj{jNjjj}r|(Uexprjj]j]j]j]j]ujNjhj]r|j!)r|}r|(jUj}r|(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj{ujj|j]r|j)r|}r|(jUj}r|(j]j]r|jaj]j]j]ujj|j]r|jX[source]r|r|}r |(jUjj|ubajjubajj%ubaubeubj)r!|}r"|(jUjj{jj{jjj}r#|(j]j]j]j]j]ujNjhj]r$|j)r%|}r&|(jUjj!|jNjjj}r'|(j]j]j]j]j]ujNjhj]r(|j)r)|}r*|(jUj}r+|(j]j]j]j]j]ujj%|j]r,|(j)r-|}r.|(jXReturnsjj)|jj{jjj}r/|(j]j]j]j]j]ujKj]r0|jXReturnsr1|r2|}r3|(jUjj-|ubaubj)r4|}r5|(jUj}r6|(j]j]j]j]j]ujj)|j]r7|j)r8|}r9|(jX1 on success, 0 on failurej}r:|(j]j]j]j]j]ujj4|j]r;|jX1 on success, 0 on failurer<|r=|}r>|(jUjNjNjhjj8|ubajjubajjubejjubaubaubeubj?)r?|}r@|(jUjjrjNjjCj}rA|(j]j]j]j]j]Uentries]rB|(jFX)set_version() (M2Crypto.X509.X509 method)jUNtrC|aujNjhj]ubjM)rD|}rE|(jUjjrjNjjPj}rF|(jRjSXpyj]j]j]j]j]jTXmethodrG|jVjG|ujNjhj]rH|(jX)rI|}rJ|(jXX509.set_version(version)jjD|jXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_versionrK|jj\j}rL|(j]rM|jaj_j`X M2Crypto.X509rN|rO|}rP|bj]j]j]j]rQ|jajeXX509.set_versionrR|jgjrjhujNjhj]rS|(j~)rT|}rU|(jX set_versionjjI|jjK|jjj}rV|(jojpj]j]j]j]j]ujNjhj]rW|jX set_versionrX|rY|}rZ|(jUjNjNjhjjT|ubaubj)r[|}r\|(jXversionjjI|jjK|jjj}r]|(jojpj]j]j]j]j]ujNjhj]r^|j)r_|}r`|(jXversionj}ra|(jojpj]j]j]j]j]ujj[|j]rb|jXversionrc|rd|}re|(jUjj_|ubajjubaubj)rf|}rg|(jUjjI|jNjjj}rh|(Uexprjj]j]j]j]j]ujNjhj]ri|j!)rj|}rk|(jUj}rl|(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509UrefidjR|ujjf|j]rm|j)rn|}ro|(jUj}rp|(j]j]rq|jaj]j]j]ujjj|j]rr|jX[source]rs|rt|}ru|(jUjjn|ubajjubajj%ubaubeubj)rv|}rw|(jUjjD|jjK|jjj}rx|(j]j]j]j]j]ujNjhj]ry|(j)rz|}r{|(jXSet version of the certificate.jjv|jXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.set_versionjjj}r||(j]j]j]j]j]ujKjhj]r}|jXSet version of the certificate.r~|r|}r|(jUjNjNjhjjz|ubaubj)r|}r|(jUjjv|jNjjj}r|(j]j]j]j]j]ujNjhj]r|(j)r|}r|(jUj}r|(j]j]j]j]j]ujj|j]r|(j)r|}r|(jX Parametersjj|jjK|jjj}r|(j]j]j]j]j]ujKj]r|jX Parametersr|r|}r|(jUjj|ubaubj)r|}r|(jUj}r|(j]j]j]j]j]ujj|j]r|j)r|}r|(jXversion -- Version number.j}r|(j]j]j]j]j]ujj|j]r|(j)r|}r|(jXversionj}r|(j]j]jj]j]j]ujj|j]r|jXversionr|r|}r|(jUjj|ubajjubjX – r|r|}r|(jUjj|ubjXVersion number.r|r|}r|(jUjNjNjhjj|ubejjubajjubejjubj)r|}r|(jUj}r|(j]j]j]j]j]ujj|j]r|(j)r|}r|(jXReturnsjj|jjK|jjj}r|(j]j]j]j]j]ujKj]r|jXReturnsr|r|}r|(jUjj|ubaubj)r|}r|(jUj}r|(j]j]j]j]j]ujj|j]r|j)r|}r|(jXReturns 0 on failure.j}r|(j]j]j]j]j]ujj|j]r|jXReturns 0 on failure.r|r|}r|(jUjNjNjhjj|ubajjubajjubejjubeubeubeubj?)r|}r|(jUjjrjXP/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.signr|jjCj}r|(j]j]j]j]j]Uentries]r|(jFX"sign() (M2Crypto.X509.X509 method)hUNtr|aujNjhj]ubjM)r|}r|(jUjjrjj|jjPj}r|(jRjSXpyj]j]j]j]j]jTXmethodr|jVj|ujNjhj]r|(jX)r|}r|(jXX509.sign(pkey, md)jj|jXP/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.signr|jj\j}r|(j]r|haj_j`X M2Crypto.X509r|r|}r|bj]j]j]j]r|hajeX X509.signr|jgjrjhujNjhj]r|(j~)r|}r|(jXsignjj|jj|jjj}r|(jojpj]j]j]j]j]ujNjhj]r|jXsignr|r|}r|(jUjNjNjhjj|ubaubj)r|}r|(jXpkey, mdjj|jj|jjj}r|(jojpj]j]j]j]j]ujNjhj]r|(j)r|}r|(jXpkeyj}r|(jojpj]j]j]j]j]ujj|j]r|jXpkeyr|r|}r|(jUjj|ubajjubj)r|}r|(jXmdj}r|(jojpj]j]j]j]j]ujj|j]r|jXmdr|r|}r|(jUjj|ubajjubeubj)r|}r|(jUjj|jNjjj}r|(Uexprjj]j]j]j]j]ujNjhj]r|j!)r|}r|(jUj}r|(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj|ujj|j]r|j)r|}r|(jUj}r|(j]j]r|jaj]j]j]ujj|j]r|jX[source]r|r|}r|(jUjj|ubajjubajj%ubaubeubj)r|}r|(jUjj|jj|jjj}r|(j]j]j]j]j]ujNjhj]r|(j)r|}r|(jXSign the certificate.jj|jj|jjj}r}(j]j]j]j]j]ujKjhj]r}jXSign the certificate.r}r}}r}(jUjNjNjhjj|ubaubj)r}}r}(jUjj|jj|jjj}r}(j]j]j]j]j]ujNjhj]r}j)r }}r }(jUj}r }(j]j]j]j]j]ujj}j]r }(j)r }}r}(jX Parametersjj }jj|jjj}r}(j]j]j]j]j]ujKj]r}jX Parametersr}r}}r}(jUjj }ubaubj)r}}r}(jUj}r}(j]j]j]j]j]ujj }j]r}j^ )r}}r}(jUj}r}(j]j]j]j]j]ujj}j]r}(jc )r}}r}(jUj}r}(j]j]j]j]j]ujj}j]r}j)r }}r!}(jXpkey -- Public keyj}r"}(j]j]j]j]j]ujj}j]r#}(j)r$}}r%}(jXpkeyj}r&}(j]j]jj]j]j]ujj }j]r'}jXpkeyr(}r)}}r*}(jUjj$}ubajjubjX – r+}r,}}r-}(jUjj }ubjX Public keyr.}r/}}r0}(jUjNjNjhjj }ubejjubajjy ubjc )r1}}r2}(jUj}r3}(j]j]j]j]j]ujj}j]r4}j)r5}}r6}(jXFmd -- Message digest algorithm to use for signing, for example 'sha1'.j}r7}(j]j]j]j]j]ujj1}j]r8}(j)r9}}r:}(jXmdj}r;}(j]j]jj]j]j]ujj5}j]r<}jXmdr=}r>}}r?}(jUjj9}ubajjubjX – r@}rA}}rB}(jUjj5}ubjXDMessage digest algorithm to use for signing, for example ‘sha1’.rC}rD}}rE}(jUjNjNjhjj5}ubejjubajjy ubejj ubajjubejjubaubj)rF}}rG}(jX :return intjj|jj|jjj}rH}(j]j]j]j]j]ujKjhj]rI}jX :return intrJ}rK}}rL}(jUjNjNjhjjF}ubaubeubeubj?)rM}}rN}(jUjjrjNjjCj}rO}(j]j]j]j]j]Uentries]rP}(jFX$verify() (M2Crypto.X509.X509 method)haUNtrQ}aujNjhj]ubjM)rR}}rS}(jUjjrjNjjPj}rT}(jRjSXpyj]j]j]j]j]jTXmethodrU}jVjU}ujNjhj]rV}(jX)rW}}rX}(jXX509.verify(pkey=None)jjR}jXR/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509.verifyrY}jj\j}rZ}(j]r[}haaj_j`X M2Crypto.X509r\}r]}}r^}bj]j]j]j]r_}haajeX X509.verifyr`}jgjrjhujNjhj]ra}(j~)rb}}rc}(jXverifyjjW}jjY}jjj}rd}(jojpj]j]j]j]j]ujNjhj]re}jXverifyrf}rg}}rh}(jUjNjNjhjjb}ubaubj)ri}}rj}(jX pkey=NonejjW}jjY}jjj}rk}(jojpj]j]j]j]j]ujNjhj]rl}j)rm}}rn}(jX pkey=Nonej}ro}(jojpj]j]j]j]j]ujji}j]rp}jX pkey=Nonerq}rr}}rs}(jUjjm}ubajjubaubj)rt}}ru}(jUjjW}jNjjj}rv}(Uexprjj]j]j]j]j]ujNjhj]rw}j!)rx}}ry}(jUj}rz}(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj`}ujjt}j]r{}j)r|}}r}}(jUj}r~}(j]j]r}jaj]j]j]ujjx}j]r}jX[source]r}r}}r}(jUjj|}ubajjubajj%ubaubeubj)r}}r}(jUjjR}jjY}jjj}r}(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r}}r}(jUjjmkjXP/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509Errorr}jjCj}r}(j]j]j]j]j]Uentries]r}(jFX X509Errorr}h{UNtr}aujNjhj]ubjM)r}}r}(jUjjmkjj}jjPj}r}(jRjSXpyj]j]j]j]j]jTX exceptionr}jVj}ujNjhj]r}(jX)r}}r}(jj}jj}jXP/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509Errorr}jj\j}r}(j]r}h{aj_j`X M2Crypto.X509r}r}}r}bj]j]j]j]r}h{ajej}jgUjhujNjhj]r}(jj)r}}r}(jX exception jj}jj}jjmj}r}(jojpj]j]j]j]j]ujNjhj]r}jX exception r}r}}r}(jUjNjNjhjj}ubaubju)r}}r}(jXM2Crypto.X509.jj}jj}jjxj}r}(jojpj]j]j]j]j]ujNjhj]r}jXM2Crypto.X509.r}r}}r}(jUjNjNjhjj}ubaubj~)r}}r}(jj}jj}jj}jjj}r}(jojpj]j]j]j]j]ujNjhj]r}jX X509Errorr}r}}r}(jUjNjNjhjj}ubaubj)r}}r}(jUjj}jNjjj}r}(Uexprjj]j]j]j]j]ujNjhj]r}j!)r}}r}(jUj}r}(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj}ujj}j]r}j)r}}r}(jUj}r}(j]j]r}jaj]j]j]ujj}j]r}jX[source]r}r}}r}(jUjj}ubajjubajj%ubaubeubj)r}}r}(jUjj}jj}jjj}r}(j]j]j]j]j]ujNjhj]r}j)r}}r}(jX$Bases: :class:`exceptions.Exception`jj}jj}jjj}r}(j]j]j]j]j]ujKjhj]r}(jXBases: r}r}}r}(jUjNjNjhjj}ubj!)r}}r}(jX:class:`exceptions.Exception`r}jj}jNjj%j}r}(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyr}j]j]U refexplicitj]j]j]j*j+j,j}j-X M2Crypto.X509r}ujNj]r}j0)r}}r}(jj}j}r}(j]j]r}(j5j}Xpy-classr}ej]j]j]ujj}j]r}jXexceptions.Exceptionr}r}}r}(jUjj}ubajj;ubaubeubaubeubj?)r}}r}(jUjjmkjNjjCj}r}(j]j]j]j]j]Uentries]r}(jFX'X509_Extension (class in M2Crypto.X509)h8UNtr}aujNjhj]ubjM)r}}r}(jUjjmkjNjjPj}r}(jRjSXpyj]j]j]j]j]jTXclassr}jVj}ujNjhj]r}(jX)r}}r}(jX,X509_Extension(x509_ext_ptr=None, _pyfree=1)jj}jXU/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extensionr}jj\j}r}(j]r}h8aj_j`X M2Crypto.X509r}r}}r}bj]j]j]j]r}h8ajeXX509_Extensionr}jgUjhujNjhj]r}(jj)r}}r}(jXclass jj}jj}jjmj}r}(jojpj]j]j]j]j]ujNjhj]r}jXclass r}r}}r}(jUjNjNjhjj}ubaubju)r}}r}(jXM2Crypto.X509.jj}jj}jjxj}r}(jojpj]j]j]j]j]ujNjhj]r}jXM2Crypto.X509.r}r}}r}(jUjNjNjhjj}ubaubj~)r~}r~(jj}jj}jj}jjj}r~(jojpj]j]j]j]j]ujNjhj]r~jXX509_Extensionr~r~}r~(jUjNjNjhjj~ubaubj)r~}r~(jXx509_ext_ptr=None, _pyfree=1jj}jj}jjj}r ~(jojpj]j]j]j]j]ujNjhj]r ~(j)r ~}r ~(jXx509_ext_ptr=Nonej}r ~(jojpj]j]j]j]j]ujj~j]r~jXx509_ext_ptr=Noner~r~}r~(jUjj ~ubajjubj)r~}r~(jX _pyfree=1j}r~(jojpj]j]j]j]j]ujj~j]r~jX _pyfree=1r~r~}r~(jUjj~ubajjubeubj)r~}r~(jUjj}jNjjj}r~(Uexprjj]j]j]j]j]ujNjhj]r~j!)r~}r~(jUj}r~(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj}ujj~j]r ~j)r!~}r"~(jUj}r#~(j]j]r$~jaj]j]j]ujj~j]r%~jX[source]r&~r'~}r(~(jUjj!~ubajjubajj%ubaubeubj)r)~}r*~(jUjj}jj}jjj}r+~(j]j]j]j]j]ujNjhj]r,~(j)r-~}r.~(jXX509 Extensionjj)~jXU/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extensionjjj}r/~(j]j]j]j]j]ujKjhj]r0~jXX509 Extensionr1~r2~}r3~(jUjNjNjhjj-~ubaubj?)r4~}r5~(jUjj)~jNjjCj}r6~(j]j]j]j]j]Uentries]r7~(jFX4get_critical() (M2Crypto.X509.X509_Extension method)hkUNtr8~aujNjhj]ubjM)r9~}r:~(jUjj)~jNjjPj}r;~(jRjSXpyj]j]j]j]j]jTXmethodr<~jVj<~ujNjhj]r=~(jX)r>~}r?~(jXX509_Extension.get_critical()jj9~jXb/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension.get_criticalr@~jj\j}rA~(j]rB~hkaj_j`X M2Crypto.X509rC~rD~}rE~bj]j]j]j]rF~hkajeXX509_Extension.get_criticalrG~jgj}jhujNjhj]rH~(j~)rI~}rJ~(jX get_criticaljj>~jj@~jjj}rK~(jojpj]j]j]j]j]ujNjhj]rL~jX get_criticalrM~rN~}rO~(jUjNjNjhjjI~ubaubj)rP~}rQ~(jUjj>~jj@~jjj}rR~(jojpj]j]j]j]j]ujNjhj]ubj)rS~}rT~(jUjj>~jNjjj}rU~(Uexprjj]j]j]j]j]ujNjhj]rV~j!)rW~}rX~(jUj}rY~(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509UrefidjG~ujjS~j]rZ~j)r[~}r\~(jUj}r]~(j]j]r^~jaj]j]j]ujjW~j]r_~jX[source]r`~ra~}rb~(jUjj[~ubajjubajj%ubaubeubj)rc~}rd~(jUjj9~jj@~jjj}re~(j]j]j]j]j]ujNjhj]rf~(j)rg~}rh~(jX3Return whether or not this is a critical extension.jjc~jXb/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension.get_criticaljjj}ri~(j]j]j]j]j]ujKjhj]rj~jX3Return whether or not this is a critical extension.rk~rl~}rm~(jUjNjNjhjjg~ubaubj)rn~}ro~(jUjjc~jNjjj}rp~(j]j]j]j]j]ujNjhj]rq~j)rr~}rs~(jUj}rt~(j]j]j]j]j]ujjn~j]ru~(j)rv~}rw~(jXReturnsjjr~jj@~jjj}rx~(j]j]j]j]j]ujKj]ry~jXReturnsrz~r{~}r|~(jUjjv~ubaubj)r}~}r~~(jUj}r~(j]j]j]j]j]ujjr~j]r~j)r~}r~(jX(Nonzero if this is a critical extension.j}r~(j]j]j]j]j]ujj}~j]r~jX(Nonzero if this is a critical extension.r~r~}r~(jUjNjNjhjj~ubajjubajjubejjubaubeubeubj?)r~}r~(jUjj)~jX^/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension.get_namer~jjCj}r~(j]j]j]j]j]Uentries]r~(jFX0get_name() (M2Crypto.X509.X509_Extension method)hUNtr~aujNjhj]ubjM)r~}r~(jUjj)~jj~jjPj}r~(jRjSXpyj]j]j]j]j]jTXmethodr~jVj~ujNjhj]r~(jX)r~}r~(jXX509_Extension.get_name()jj~jX^/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension.get_namer~jj\j}r~(j]r~haj_j`X M2Crypto.X509r~r~}r~bj]j]j]j]r~hajeXX509_Extension.get_namer~jgj}jhujNjhj]r~(j~)r~}r~(jXget_namejj~jj~jjj}r~(jojpj]j]j]j]j]ujNjhj]r~jXget_namer~r~}r~(jUjNjNjhjj~ubaubj)r~}r~(jUjj~jj~jjj}r~(jojpj]j]j]j]j]ujNjhj]ubj)r~}r~(jUjj~jNjjj}r~(Uexprjj]j]j]j]j]ujNjhj]r~j!)r~}r~(jUj}r~(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj~ujj~j]r~j)r~}r~(jUj}r~(j]j]r~jaj]j]j]ujj~j]r~jX[source]r~r~}r~(jUjj~ubajjubajj%ubaubeubj)r~}r~(jUjj~jj~jjj}r~(j]j]j]j]j]ujNjhj]r~j)r~}r~(jX5Get the extension name, for example 'subjectAltName'.jj~jj~jjj}r~(j]j]j]j]j]ujKjhj]r~jX9Get the extension name, for example ‘subjectAltName’.r~r~}r~(jUjNjNjhjj~ubaubaubeubj?)r~}r~(jUjj)~jNjjCj}r~(j]j]j]j]j]Uentries]r~(jFX1get_value() (M2Crypto.X509.X509_Extension method)jUNtr~aujNjhj]ubjM)r~}r~(jUjj)~jNjjPj}r~(jRjSXpyj]j]j]j]j]jTXmethodr~jVj~ujNjhj]r~(jX)r~}r~(jX*X509_Extension.get_value(flag=0, indent=0)jj~jX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension.get_valuer~jj\j}r~(j]r~jaj_j`X M2Crypto.X509r~r~}r~bj]j]j]j]r~jajeXX509_Extension.get_valuer~jgj}jhujNjhj]r~(j~)r~}r~(jX get_valuejj~jj~jjj}r~(jojpj]j]j]j]j]ujNjhj]r~jX get_valuer~r~}r~(jUjNjNjhjj~ubaubj)r~}r~(jXflag=0, indent=0jj~jj~jjj}r~(jojpj]j]j]j]j]ujNjhj]r~(j)r~}r~(jXflag=0j}r~(jojpj]j]j]j]j]ujj~j]r~jXflag=0r~r~}r~(jUjj~ubajjubj)r~}r~(jXindent=0j}r~(jojpj]j]j]j]j]ujj~j]r~jXindent=0r~r~}r~(jUjj~ubajjubeubj)r~}r~(jUjj~jNjjj}r~(Uexprjj]j]j]j]j]ujNjhj]r~j!)r~}r~(jUj}r~(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj~ujj~j]r~j)r~}r~(jUj}r~(j]j]r~jaj]j]j]ujj~j]r~jX[source]r~r~}r(jUjj~ubajjubajj%ubaubeubj)r}r(jUjj~jj~jjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX;Get the extension value, for example 'DNS:www.example.com'.jjjX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension.get_valuejjj}r(j]j]j]j]j]ujKjhj]r(jX(Get the extension value, for example ‘r r }r (jUjNjNjhjjubcdocutils.nodes reference r )r }r(jXDNS:www.example.comrj}r(Urefurijj]j]j]j]j]ujjj]rjXDNS:www.example.comrr}r(jUjj ubajU referencerubjX’.rr}r(jUjNjNjhjjubeubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jUj}r(j]j]j]j]j]ujjj]r (j)r!}r"(jX Parametersjjjj~jjj}r#(j]j]j]j]j]ujKj]r$jX Parametersr%r&}r'(jUjj!ubaubj)r(}r)(jUj}r*(j]j]j]j]j]ujjj]r+j^ )r,}r-(jUj}r.(j]j]j]j]j]ujj(j]r/(jc )r0}r1(jUj}r2(j]j]j]j]j]ujj,j]r3j)r4}r5(jX.flag -- Flag to control what and how to print.j}r6(j]j]j]j]j]ujj0j]r7(j)r8}r9(jXflagj}r:(j]j]jj]j]j]ujj4j]r;jXflagr<r=}r>(jUjj8ubajjubjX – r?r@}rA(jUjj4ubjX&Flag to control what and how to print.rBrC}rD(jUjNjNjhjj4ubejjubajjy ubjc )rE}rF(jUj}rG(j]j]j]j]j]ujj,j]rHj)rI}rJ(jX7indent -- How many spaces to print before actual value.j}rK(j]j]j]j]j]ujjEj]rL(j)rM}rN(jXindentj}rO(j]j]jj]j]j]ujjIj]rPjXindentrQrR}rS(jUjjMubajjubjX – rTrU}rV(jUjjIubjX-How many spaces to print before actual value.rWrX}rY(jUjNjNjhjjIubejjubajjy ubejj ubajjubejjubaubeubeubj?)rZ}r[(jUjj)~jNjjCj}r\(j]j]j]j]j]Uentries]r](jFX>m2_x509_extension_free() (M2Crypto.X509.X509_Extension method)hUNtr^aujNjhj]ubjM)r_}r`(jUjj)~jNjjPj}ra(jRjSXpyj]j]j]j]j]jTXmethodrbjVjbujNjhj]rc(jX)rd}re(jX%X509_Extension.m2_x509_extension_freejj_jXl/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension.m2_x509_extension_freerfjj\j}rg(j]rhhaj_j`X M2Crypto.X509rirj}rkbj]j]j]j]rlhajeX%X509_Extension.m2_x509_extension_freejgj}jhujNjhj]rm(j~)rn}ro(jXm2_x509_extension_freejjdjjfjjj}rp(jojpj]j]j]j]j]ujNjhj]rqjXm2_x509_extension_freerrrs}rt(jUjNjNjhjjnubaubj)ru}rv(jUjjdjjfjjj}rw(jojpj]j]j]j]j]ujNjhj]ubeubj)rx}ry(jUjj_jjfjjj}rz(j]j]j]j]j]ujNjhj]ubeubj?)r{}r|(jUjj)~jNjjCj}r}(j]j]j]j]j]Uentries]r~(jFX4set_critical() (M2Crypto.X509.X509_Extension method)hKUNtraujNjhj]ubjM)r}r(jUjj)~jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX'X509_Extension.set_critical(critical=1)jjjXb/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension.set_criticalrjj\j}r(j]rhKaj_j`X M2Crypto.X509rr}rbj]j]j]j]rhKajeXX509_Extension.set_criticalrjgj}jhujNjhj]r(j~)r}r(jX set_criticaljjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX set_criticalrr}r(jUjNjNjhjjubaubj)r}r(jX critical=1jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jX critical=1j}r(jojpj]j]j]j]j]ujjj]rjX critical=1rr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jXUMark this extension critical or noncritical. By default an extension is not critical.jjjXb/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension.set_criticaljjj}r(j]j]j]j]j]ujKjhj]rjXUMark this extension critical or noncritical. By default an extension is not critical.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXcritical -- Nonzero sets this extension as critical. Calling this method without arguments will set this extension to critical.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXcriticalj}r(j]j]jj]j]j]ujjj]rjXcriticalrr}r(jUjjubajjubjX – rr}r(jUjjubjXsNonzero sets this extension as critical. Calling this method without arguments will set this extension to critical.rr}r(jUjNjNjhjjubejjubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jX1 for success, 0 for failurej}r(j]j]j]j]j]ujjj]rjX1 for success, 0 for failurerr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubeubeubj?)r}r(jUjjmkjNjjCj}r(j]j]j]j]j]Uentries]r(jFX-X509_Extension_Stack (class in M2Crypto.X509)jdUNtraujNjhj]ubjM)r}r(jUjjmkjNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jX+X509_Extension_Stack(stack=None, _pyfree=0)jjjX[/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension_Stackrjj\j}r(j]rjdaj_j`X M2Crypto.X509rr}rbj]j]j]j]r jdajeXX509_Extension_Stackr jgUjhujNjhj]r (jj)r }r (jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjj ubaubju)r}r(jXM2Crypto.X509.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr}r(jUjNjNjhjjubaubj~)r}r(jj jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXX509_Extension_Stackrr}r (jUjNjNjhjjubaubj)r!}r"(jXstack=None, _pyfree=0jjjjjjj}r#(jojpj]j]j]j]j]ujNjhj]r$(j)r%}r&(jX stack=Nonej}r'(jojpj]j]j]j]j]ujj!j]r(jX stack=Noner)r*}r+(jUjj%ubajjubj)r,}r-(jX _pyfree=0j}r.(jojpj]j]j]j]j]ujj!j]r/jX _pyfree=0r0r1}r2(jUjj,ubajjubeubj)r3}r4(jUjjjNjjj}r5(Uexprjj]j]j]j]j]ujNjhj]r6j!)r7}r8(jUj}r9(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj ujj3j]r:j)r;}r<(jUj}r=(j]j]r>jaj]j]j]ujj7j]r?jX[source]r@rA}rB(jUjj;ubajjubajj%ubaubeubj)rC}rD(jUjjjjjjj}rE(j]j]j]j]j]ujNjhj]rF(j)rG}rH(jXX509 Extension StackjjCjX[/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension_StackrIjjj}rJ(j]j]j]j]j]ujKjhj]rKjXX509 Extension StackrLrM}rN(jUjNjNjhjjGubaubj)rO}rP(jUjjCjNjjj}rQ(j]j]j]j]j]ujNjhj]rRj)rS}rT(jUjjOjjIjjj}rU(j]j]j]j]j]ujKjhj]rV(j)rW}rX(jXwarningjjSjjIjjj}rY(j]j]j]j]j]ujKj]rZjXWarningr[r\}r](jUjjWubaubj)r^}r_(jXDo not modify the underlying OpenSSL stack except through this interface, or use any OpenSSL functions that do so indirectly. Doing so will get the OpenSSL stack and the internal pystack of this class out of sync, leading to python memory leaks, exceptions or even python crashes! j}r`(j]j]j]j]j]ujjSj]raj)rb}rc(jXDo not modify the underlying OpenSSL stack except through this interface, or use any OpenSSL functions that do so indirectly. Doing so will get the OpenSSL stack and the internal pystack of this class out of sync, leading to python memory leaks, exceptions or even python crashes!jj^jjIjjj}rd(j]j]j]j]j]ujKj]rejXDo not modify the underlying OpenSSL stack except through this interface, or use any OpenSSL functions that do so indirectly. Doing so will get the OpenSSL stack and the internal pystack of this class out of sync, leading to python memory leaks, exceptions or even python crashes!rfrg}rh(jUjjbubaubajjubeubaubj?)ri}rj(jUjjCjNjjCj}rk(j]j]j]j]j]Uentries]rl(jFXGm2_sk_x509_extension_free() (M2Crypto.X509.X509_Extension_Stack method)jUNtrmaujNjhj]ubjM)rn}ro(jUjjCjNjjPj}rp(jRjSXpyj]j]j]j]j]jTXmethodrqjVjqujNjhj]rr(jX)rs}rt(jX.X509_Extension_Stack.m2_sk_x509_extension_freejjnjXu/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension_Stack.m2_sk_x509_extension_freerujj\j}rv(j]rwjaj_j`X M2Crypto.X509rxry}rzbj]j]j]j]r{jajeX.X509_Extension_Stack.m2_sk_x509_extension_freejgj jhujNjhj]r|(j~)r}}r~(jXm2_sk_x509_extension_freejjsjjujjj}r(jojpj]j]j]j]j]ujNjhj]rjXm2_sk_x509_extension_freerr}r(jUjNjNjhjj}ubaubj)r}r(jUjjsjjujjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjnjjujjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjCjNjjCj}r(j]j]j]j]j]Uentries]r(jFX1pop() (M2Crypto.X509.X509_Extension_Stack method)h"UNtraujNjhj]ubjM)r}r(jUjjCjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXX509_Extension_Stack.pop()jjjX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension_Stack.poprjj\j}r(j]rh"aj_j`X M2Crypto.X509rr}rbj]j]j]j]rh"ajeXX509_Extension_Stack.poprjgj jhujNjhj]r(j~)r}r(jXpopjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXpoprr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX)Pop X509_Extension object from the stack.jjjX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension_Stack.popjjj}r(j]j]j]j]j]ujKjhj]rjX)Pop X509_Extension object from the stack.rr€}rÀ(jUjNjNjhjjubaubj)rĀ}rŀ(jUjjjNjjj}rƀ(j]j]j]j]j]ujNjhj]rǀj)rȀ}rɀ(jUj}rʀ(j]j]j]j]j]ujjĀj]rˀ(j)r̀}r̀(jXReturnsjjȀjjjjj}r΀(j]j]j]j]j]ujKj]rπjXReturnsrЀrр}rҀ(jUjj̀ubaubj)rӀ}rԀ(jUj}rՀ(j]j]j]j]j]ujjȀj]rրj)r׀}r؀(jXX509_Extension poppedj}rـ(j]j]j]j]j]ujjӀj]rڀjXX509_Extension poppedrۀr܀}r݀(jUjNjNjhjj׀ubajjubajjubejjubaubeubeubj?)rހ}r߀(jUjjCjNjjCj}r(j]j]j]j]j]Uentries]r(jFX2push() (M2Crypto.X509.X509_Extension_Stack method)hUNtraujNjhj]ubjM)r}r(jUjjCjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX#X509_Extension_Stack.push(x509_ext)jjjX`/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension_Stack.pushrjj\j}r(j]rhaj_j`X M2Crypto.X509rr}rbj]j]j]j]rhajeXX509_Extension_Stack.pushrjgj jhujNjhj]r(j~)r}r(jXpushjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXpushrr}r(jUjNjNjhjjubaubj)r}r(jXx509_extjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXx509_extj}r(jojpj]j]j]j]j]ujjj]rjXx509_extrr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r }r (jUj}r (UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]r j)r }r(jUj}r(j]j]rjaj]j]j]ujj j]rjX[source]rr}r(jUjj ubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX*Push X509_Extension object onto the stack.jjjX`/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Extension_Stack.pushjjj}r(j]j]j]j]j]ujKjhj]rjX*Push X509_Extension object onto the stack.rr}r(jUjNjNjhjjubaubj)r }r!(jUjjjNjjj}r"(j]j]j]j]j]ujNjhj]r#(j)r$}r%(jUj}r&(j]j]j]j]j]ujj j]r'(j)r(}r)(jX Parametersjj$jjjjj}r*(j]j]j]j]j]ujKj]r+jX Parametersr,r-}r.(jUjj(ubaubj)r/}r0(jUj}r1(j]j]j]j]j]ujj$j]r2j)r3}r4(jX>x509_ext -- X509_Extension object to be pushed onto the stack.j}r5(j]j]j]j]j]ujj/j]r6(j)r7}r8(jXx509_extj}r9(j]j]jj]j]j]ujj3j]r:jXx509_extr;r<}r=(jUjj7ubajjubjX – r>r?}r@(jUjj3ubjX2X509_Extension object to be pushed onto the stack.rArB}rC(jUjNjNjhjj3ubejjubajjubejjubj)rD}rE(jUj}rF(j]j]j]j]j]ujj j]rG(j)rH}rI(jXReturnsjjDjjjjj}rJ(j]j]j]j]j]ujKj]rKjXReturnsrLrM}rN(jUjjHubaubj)rO}rP(jUj}rQ(j]j]j]j]j]ujjDj]rRj)rS}rT(jX&The number of extensions on the stack.j}rU(j]j]j]j]j]ujjOj]rVjX&The number of extensions on the stack.rWrX}rY(jUjNjNjhjjSubajjubajjubejjubeubeubeubeubeubj?)rZ}r[(jUjjmkjNjjCj}r\(j]j]j]j]j]Uentries]r](jFX"X509_Name (class in M2Crypto.X509)j}UNtr^aujNjhj]ubjM)r_}r`(jUjjmkjNjjPj}ra(jRjSXpyj]j]j]j]j]jTXclassrbjVjbujNjhj]rc(jX)rd}re(jX$X509_Name(x509_name=None, _pyfree=0)jj_jXP/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Namerfjj\j}rg(j]rhj}aj_j`X M2Crypto.X509rirj}rkbj]j]j]j]rlj}ajeX X509_NamermjgUjhujNjhj]rn(jj)ro}rp(jXclass jjdjjfjjmj}rq(jojpj]j]j]j]j]ujNjhj]rrjXclass rsrt}ru(jUjNjNjhjjoubaubju)rv}rw(jXM2Crypto.X509.jjdjjfjjxj}rx(jojpj]j]j]j]j]ujNjhj]ryjXM2Crypto.X509.rzr{}r|(jUjNjNjhjjvubaubj~)r}}r~(jjmjjdjjfjjj}r(jojpj]j]j]j]j]ujNjhj]rjX X509_Namerr}r(jUjNjNjhjj}ubaubj)r}r(jXx509_name=None, _pyfree=0jjdjjfjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXx509_name=Nonej}r(jojpj]j]j]j]j]ujjj]rjXx509_name=Nonerr}r(jUjjubajjubj)r}r(jX _pyfree=0j}r(jojpj]j]j]j]j]ujjj]rjX _pyfree=0rr}r(jUjjubajjubeubj)r}r(jUjjdjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjmujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjj_jjfjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX X509 NamejjjXP/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Namejjj}r(j]j]j]j]j]ujKjhj]rjX X509 Namerr}r(jUjNjNjhjjubaubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX3add_entry_by_txt() (M2Crypto.X509.X509_Name method)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX=X509_Name.add_entry_by_txt(field, type, entry, len, loc, set)jjjXa/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.add_entry_by_txtrjj\j}r(j]rhaj_j`X M2Crypto.X509rr}rbj]j]j]j]rÁhajeXX509_Name.add_entry_by_txtrājgjmjhujNjhj]rŁ(j~)rƁ}rǁ(jXadd_entry_by_txtjjjjjjj}rȁ(jojpj]j]j]j]j]ujNjhj]rɁjXadd_entry_by_txtrʁrˁ}ŕ(jUjNjNjhjjƁubaubj)ŕ}r΁(jX!field, type, entry, len, loc, setjjjjjjj}rρ(jojpj]j]j]j]j]ujNjhj]rЁ(j)rс}rҁ(jXfieldj}rӁ(jojpj]j]j]j]j]ujj́j]rԁjXfieldrՁrց}rׁ(jUjjсubajjubj)r؁}rف(jXtypej}rځ(jojpj]j]j]j]j]ujj́j]rہjXtyper܁r݁}rށ(jUjj؁ubajjubj)r߁}r(jXentryj}r(jojpj]j]j]j]j]ujj́j]rjXentryrr}r(jUjj߁ubajjubj)r}r(jXlenj}r(jojpj]j]j]j]j]ujj́j]rjXlenrr}r(jUjjubajjubj)r}r(jXlocj}r(jojpj]j]j]j]j]ujj́j]rjXlocrr}r(jUjjubajjubj)r}r(jXsetj}r(jojpj]j]j]j]j]ujj́j]rjXsetrr}r(jUjjubajjubeubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjāujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr }r (jUjjubajjubajj%ubaubeubj)r }r (jUjjjjjjj}r (j]j]j]j]j]ujNjhj]r(j)r}r(jX9Add X509_Name field whose name is identified by its name.jj jXa/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.add_entry_by_txtrjjj}r(j]j]j]j]j]ujKjhj]rjX9Add X509_Name field whose name is identified by its name.rr}r(jUjNjNjhjjubaubj)r}r(jUjj jNjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r (jX Parametersjjjjjjj}r!(j]j]j]j]j]ujKj]r"jX Parametersr#r$}r%(jUjjubaubj)r&}r'(jUj}r((j]j]j]j]j]ujjj]r)j^ )r*}r+(jUj}r,(j]j]j]j]j]ujj&j]r-(jc )r.}r/(jUj}r0(j]j]j]j]j]ujj*j]r1j)r2}r3(jXfield -- name of the entryj}r4(j]j]j]j]j]ujj.j]r5(j)r6}r7(jXfieldj}r8(j]j]jj]j]j]ujj2j]r9jXfieldr:r;}r<(jUjj6ubajjubjX – r=r>}r?(jUjj2ubjXname of the entryr@rA}rB(jUjNjNjhjj2ubejjubajjy ubjc )rC}rD(jUj}rE(j]j]j]j]j]ujj*j]rFj)rG}rH(jXWtype -- use MBSTRING_ASC or MBSTRING_UTF8 (or standard ASN1 type like V_ASN1_IA5STRING)j}rI(j]j]j]j]j]ujjCj]rJ(j)rK}rL(jXtypej}rM(j]j]jj]j]j]ujjGj]rNjXtyperOrP}rQ(jUjjKubajjubjX – rRrS}rT(jUjjGubjXOuse MBSTRING_ASC or MBSTRING_UTF8 (or standard ASN1 type like V_ASN1_IA5STRING)rUrV}rW(jUjNjNjhjjGubejjubajjy ubjc )rX}rY(jUj}rZ(j]j]j]j]j]ujj*j]r[j)r\}r](jXentry -- valuej}r^(j]j]j]j]j]ujjXj]r_(j)r`}ra(jXentryj}rb(j]j]jj]j]j]ujj\j]rcjXentryrdre}rf(jUjj`ubajjubjX – rgrh}ri(jUjj\ubjXvaluerjrk}rl(jUjNjNjhjj\ubejjubajjy ubjc )rm}rn(jUj}ro(j]j]j]j]j]ujj*j]rpj)rq}rr(jXIlen -- buf_len of the entry (-1 and the length is computed automagically)j}rs(j]j]j]j]j]ujjmj]rt(j)ru}rv(jXlenj}rw(j]j]jj]j]j]ujjqj]rxjXlenryrz}r{(jUjjuubajjubjX – r|r}}r~(jUjjqubjXBbuf_len of the entry (-1 and the length is computed automagically)rr}r(jUjNjNjhjjqubejjubajjy ubejj ubajjubejjubaubj)r}r(jXThe ``loc`` and ``set`` parameters determine where a new entry should be added. For almost all applications loc can be set to -1 and set to 0. This adds a new entry to the end of name as a single valued RelativeDistinguishedName (RDN).jj jjjjj}r(j]j]j]j]j]ujK jhj]r(jXThe rr}r(jUjNjNjhjjubj0)r}r(jX``loc``j}r(j]j]j]j]j]ujjj]rjXlocrr}r(jUjjubajj;ubjX and rr}r(jUjNjNjhjjubj0)r}r(jX``set``j}r(j]j]j]j]j]ujjj]rjXsetrr}r(jUjjubajj;ubjX parameters determine where a new entry should be added. For almost all applications loc can be set to -1 and set to 0. This adds a new entry to the end of name as a single valued RelativeDistinguishedName (RDN).rr}r(jUjNjNjhjjubeubj)r}r(jUjj jNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj^ )r}r(jUj}r(j]j]j]j]j]ujjj]r(jc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXXloc -- determines the index where the new entry is inserted: if it is -1 it is appended.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXlocj}r(j]j]jj]j]j]ujjj]rjXlocrr}r‚(jUjjubajjubjX – rÂrĂ}rł(jUjjubjXQdetermines the index where the new entry is inserted: if it is -1 it is appended.rƂrǂ}rȂ(jUjNjNjhjjubejjubajjy ubjc )rɂ}rʂ(jUj}r˂(j]j]j]j]j]ujjj]r̂j)r͂}r΂(jXset -- determines how the new type is added. If it is zero a new RDN is created. If set is -1 or 1 it is added to the previous or next RDN structure respectively. This will then be a multivalued RDN: since multivalues RDNs are very seldom used set is almost always set to zero.j}rς(j]j]j]j]j]ujjɂj]rЂ(j)rт}r҂(jXsetj}rӂ(j]j]jj]j]j]ujj͂j]rԂjXsetrՂrւ}rׂ(jUjjтubajjubjX – r؂rق}rڂ(jUjj͂ubjXdetermines how the new type is added. If it is zero a new RDN is created. If set is -1 or 1 it is added to the previous or next RDN structure respectively. This will then be a multivalued RDN: since multivalues RDNs are very seldom used set is almost always set to zero.rۂr܂}r݂(jUjNjNjhjj͂ubejjubajjy ubejj ubajjubejjubj)rނ}r߂(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjނjjjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjނj]rj)r}r(jX(1 for success of 0 if an error occurred.j}r(j]j]j]j]j]ujjj]rjX(1 for success of 0 if an error occurred.rr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX)as_der() (M2Crypto.X509.X509_Name method)hxUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXX509_Name.as_der()jjjXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.as_derrjj\j}r(j]rhxaj_j`X M2Crypto.X509rr}rbj]j]j]j]rhxajeXX509_Name.as_derrjgjmjhujNjhj]r(j~)r }r (jXas_derjjjjjjj}r (jojpj]j]j]j]j]ujNjhj]r jXas_derr r}r(jUjNjNjhjj ubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]r r!}r"(jUjjubajjubajj%ubaubeubj)r#}r$(jUjjjjjjj}r%(j]j]j]j]j]ujNjhj]ubeubj?)r&}r'(jUjjjNjjCj}r((j]j]j]j]j]Uentries]r)(jFX*as_hash() (M2Crypto.X509.X509_Name method)jUNtr*aujNjhj]ubjM)r+}r,(jUjjjNjjPj}r-(jRjSXpyj]j]j]j]j]jTXmethodr.jVj.ujNjhj]r/(jX)r0}r1(jXX509_Name.as_hash()jj+jXX/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.as_hashr2jj\j}r3(j]r4jaj_j`X M2Crypto.X509r5r6}r7bj]j]j]j]r8jajeXX509_Name.as_hashr9jgjmjhujNjhj]r:(j~)r;}r<(jXas_hashjj0jj2jjj}r=(jojpj]j]j]j]j]ujNjhj]r>jXas_hashr?r@}rA(jUjNjNjhjj;ubaubj)rB}rC(jUjj0jj2jjj}rD(jojpj]j]j]j]j]ujNjhj]ubj)rE}rF(jUjj0jNjjj}rG(Uexprjj]j]j]j]j]ujNjhj]rHj!)rI}rJ(jUj}rK(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj9ujjEj]rLj)rM}rN(jUj}rO(j]j]rPjaj]j]j]ujjIj]rQjX[source]rRrS}rT(jUjjMubajjubajj%ubaubeubj)rU}rV(jUjj+jj2jjj}rW(j]j]j]j]j]ujNjhj]ubeubj?)rX}rY(jUjjjNjjCj}rZ(j]j]j]j]j]Uentries]r[(jFX*as_text() (M2Crypto.X509.X509_Name method)j>UNtr\aujNjhj]ubjM)r]}r^(jUjjjNjjPj}r_(jRjSXpyj]j]j]j]j]jTXmethodr`jVj`ujNjhj]ra(jX)rb}rc(jX$X509_Name.as_text(indent=0, flags=0)jj]jXX/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.as_textrdjj\j}re(j]rfj>aj_j`X M2Crypto.X509rgrh}ribj]j]j]j]rjj>ajeXX509_Name.as_textrkjgjmjhujNjhj]rl(j~)rm}rn(jXas_textjjbjjdjjj}ro(jojpj]j]j]j]j]ujNjhj]rpjXas_textrqrr}rs(jUjNjNjhjjmubaubj)rt}ru(jXindent=0, flags=0jjbjjdjjj}rv(jojpj]j]j]j]j]ujNjhj]rw(j)rx}ry(jXindent=0j}rz(jojpj]j]j]j]j]ujjtj]r{jXindent=0r|r}}r~(jUjjxubajjubj)r}r(jXflags=0j}r(jojpj]j]j]j]j]ujjtj]rjXflags=0rr}r(jUjjubajjubeubj)r}r(jUjjbjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjkujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjj]jjdjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX%as_text returns the name as a string.jjjXX/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.as_textjjj}r(j]j]j]j]j]ujKjhj]rjX%as_text returns the name as a string.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjdjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj^ )r}r(jUj}r(j]j]j]j]j]ujjj]r(jc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXHindent -- Each line in multiline format is indented by this many spaces.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXindentj}rƒ(j]j]jj]j]j]ujjj]rÃjXindentrărŃ}rƃ(jUjjubajjubjX – rǃrȃ}rɃ(jUjjubjX>Each line in multiline format is indented by this many spaces.rʃr˃}r̃(jUjNjNjhjjubejjubajjy ubjc )r̓}r΃(jUj}rσ(j]j]j]j]j]ujjj]rЃj)rу}r҃(jX?flags -- Flags that control how the output should be formatted.j}rӃ(j]j]j]j]j]ujj̓j]rԃ(j)rՃ}rփ(jXflagsj}r׃(j]j]jj]j]j]ujjуj]r؃jXflagsrكrڃ}rۃ(jUjjՃubajjubjX – r܃r݃}rރ(jUjjуubjX6Flags that control how the output should be formatted.r߃r}r(jUjNjNjhjjуubejjubajjy ubejj ubajjubejjubaubeubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX.entry_count() (M2Crypto.X509.X509_Name method)jkUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXX509_Name.entry_count()jjjX\/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.entry_countrjj\j}r(j]rjkaj_j`X M2Crypto.X509rr}rbj]j]j]j]rjkajeXX509_Name.entry_countrjgjmjhujNjhj]r(j~)r}r(jX entry_countjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX entry_countrr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]rj)r }r (jUj}r (j]j]r jaj]j]j]ujjj]r jX[source]rr}r(jUjj ubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX5get_entries_by_nid() (M2Crypto.X509.X509_Name method)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX!X509_Name.get_entries_by_nid(nid)jjjXc/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.get_entries_by_nidr jj\j}r!(j]r"haj_j`X M2Crypto.X509r#r$}r%bj]j]j]j]r&hajeXX509_Name.get_entries_by_nidr'jgjmjhujNjhj]r((j~)r)}r*(jXget_entries_by_nidjjjj jjj}r+(jojpj]j]j]j]j]ujNjhj]r,jXget_entries_by_nidr-r.}r/(jUjNjNjhjj)ubaubj)r0}r1(jXnidjjjj jjj}r2(jojpj]j]j]j]j]ujNjhj]r3j)r4}r5(jXnidj}r6(jojpj]j]j]j]j]ujj0j]r7jXnidr8r9}r:(jUjj4ubajjubaubj)r;}r<(jUjjjNjjj}r=(Uexprjj]j]j]j]j]ujNjhj]r>j!)r?}r@(jUj}rA(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj'ujj;j]rBj)rC}rD(jUj}rE(j]j]rFjaj]j]j]ujj?j]rGjX[source]rHrI}rJ(jUjjCubajjubajj%ubaubeubj)rK}rL(jUjjjj jjj}rM(j]j]j]j]j]ujNjhj]rN(j)rO}rP(jX%Retrieve the next index matching nid.jjKjXc/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.get_entries_by_nidjjj}rQ(j]j]j]j]j]ujKjhj]rRjX%Retrieve the next index matching nid.rSrT}rU(jUjNjNjhjjOubaubj)rV}rW(jUjjKjNjjj}rX(j]j]j]j]j]ujNjhj]rY(j)rZ}r[(jUj}r\(j]j]j]j]j]ujjVj]r](j)r^}r_(jX ParametersjjZjj jjj}r`(j]j]j]j]j]ujKj]rajX Parametersrbrc}rd(jUjj^ubaubj)re}rf(jUj}rg(j]j]j]j]j]ujjZj]rhj)ri}rj(jX/nid -- name of the entry (as m2.NID* constants)j}rk(j]j]j]j]j]ujjej]rl(j)rm}rn(jXnidj}ro(j]j]jj]j]j]ujjij]rpjXnidrqrr}rs(jUjjmubajjubjX – rtru}rv(jUjjiubjX(name of the entry (as m2.NID* constants)rwrx}ry(jUjNjNjhjjiubejjubajjubejjubj)rz}r{(jUj}r|(j]j]j]j]j]ujjVj]r}(j)r~}r(jXReturnsjjzjj jjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjj~ubaubj)r}r(jUj}r(j]j]j]j]j]ujjzj]rj)r}r(jXlist of X509_Name_Entry itemsj}r(j]j]j]j]j]ujjj]rjXlist of X509_Name_Entry itemsrr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX4m2_x509_name_free() (M2Crypto.X509.X509_Name method)hFUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXX509_Name.m2_x509_name_freejjjXb/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.m2_x509_name_freerjj\j}r(j]rhFaj_j`X M2Crypto.X509rr}rbj]j]j]j]rhFajeXX509_Name.m2_x509_name_freejgjmjhujNjhj]r(j~)r}r(jXm2_x509_name_freejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXm2_x509_name_freerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX'nid (M2Crypto.X509.X509_Name attribute)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTX attributerjVjujNjhj]r(jX)r}r(jX X509_Name.nidjjjXT/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name.nidrjj\j}r(j]rhaj_j`X M2Crypto.X509rr}r„bj]j]j]j]rÄhajeX X509_Name.nidjgjmjhujNjhj]rĄ(j~)rń}rƄ(jXnidjjjjjjj}rDŽ(jojpj]j]j]j]j]ujNjhj]rȄjXnidrɄrʄ}r˄(jUjNjNjhjjńubaubjj)r̄}r̈́(jX' = {'C': 14, 'serialNumber': 105, 'organizationName': 17, 'CN': 13, 'SP': 16, 'commonName': 13, 'L': 15, 'stateOrProvinceName': 16, 'ST': 16, 'emailAddress': 48, 'O': 17, 'localityName': 15, 'GN': 99, 'surname': 100, 'OU': 18, 'givenName': 99, 'Email': 48, 'organizationUnitName': 18, 'SN': 100}jjjjjjmj}r΄(jojpj]j]j]j]j]ujNjhj]rτjX' = {'C': 14, 'serialNumber': 105, 'organizationName': 17, 'CN': 13, 'SP': 16, 'commonName': 13, 'L': 15, 'stateOrProvinceName': 16, 'ST': 16, 'emailAddress': 48, 'O': 17, 'localityName': 15, 'GN': 99, 'surname': 100, 'OU': 18, 'givenName': 99, 'Email': 48, 'organizationUnitName': 18, 'SN': 100}rЄrф}r҄(jUjNjNjhjj̄ubaubeubj)rӄ}rԄ(jUjjjjjjj}rՄ(j]j]j]j]j]ujNjhj]ubeubeubeubj?)rք}rׄ(jUjjmkjNjjCj}r؄(j]j]j]j]j]Uentries]rل(jFX(X509_Name_Entry (class in M2Crypto.X509)hUNtrڄaujNjhj]ubjM)rۄ}r܄(jUjjmkjNjjPj}r݄(jRjSXpyj]j]j]j]j]jTXclassrބjVjބujNjhj]r߄(jX)r}r(jX+X509_Name_Entry(x509_name_entry, _pyfree=0)jjۄjXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name_Entryrjj\j}r(j]rhaj_j`X M2Crypto.X509rr}rbj]j]j]j]rhajeXX509_Name_EntryrjgUjhujNjhj]r(jj)r}r(jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jXM2Crypto.X509.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXX509_Name_Entryrr}r(jUjNjNjhjjubaubj)r}r(jXx509_name_entry, _pyfree=0jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXx509_name_entryj}r(jojpj]j]j]j]j]ujjj]rjXx509_name_entryrr }r (jUjjubajjubj)r }r (jX _pyfree=0j}r (jojpj]j]j]j]j]ujjj]rjX _pyfree=0rr}r(jUjj ubajjubeubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr }r!(jUjjubajjubajj%ubaubeubj)r"}r#(jUjjۄjjjjj}r$(j]j]j]j]j]ujNjhj]r%(j)r&}r'(jXX509 Name Entryjj"jXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name_Entryjjj}r((j]j]j]j]j]ujKjhj]r)jXX509 Name Entryr*r+}r,(jUjNjNjhjj&ubaubj?)r-}r.(jUjj"jNjjCj}r/(j]j]j]j]j]Uentries]r0(jFX6create_by_txt() (M2Crypto.X509.X509_Name_Entry method)jUNtr1aujNjhj]ubjM)r2}r3(jUjj"jNjjPj}r4(jRjSXpyj]j]j]j]j]jTXmethodr5jVj5ujNjhj]r6(jX)r7}r8(jX6X509_Name_Entry.create_by_txt(field, type, entry, len)jj2jXd/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name_Entry.create_by_txtr9jj\j}r:(j]r;jaj_j`X M2Crypto.X509r<r=}r>bj]j]j]j]r?jajeXX509_Name_Entry.create_by_txtr@jgjjhujNjhj]rA(j~)rB}rC(jX create_by_txtjj7jj9jjj}rD(jojpj]j]j]j]j]ujNjhj]rEjX create_by_txtrFrG}rH(jUjNjNjhjjBubaubj)rI}rJ(jXfield, type, entry, lenjj7jj9jjj}rK(jojpj]j]j]j]j]ujNjhj]rL(j)rM}rN(jXfieldj}rO(jojpj]j]j]j]j]ujjIj]rPjXfieldrQrR}rS(jUjjMubajjubj)rT}rU(jXtypej}rV(jojpj]j]j]j]j]ujjIj]rWjXtyperXrY}rZ(jUjjTubajjubj)r[}r\(jXentryj}r](jojpj]j]j]j]j]ujjIj]r^jXentryr_r`}ra(jUjj[ubajjubj)rb}rc(jXlenj}rd(jojpj]j]j]j]j]ujjIj]rejXlenrfrg}rh(jUjjbubajjubeubj)ri}rj(jUjj7jNjjj}rk(Uexprjj]j]j]j]j]ujNjhj]rlj!)rm}rn(jUj}ro(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj@ujjij]rpj)rq}rr(jUj}rs(j]j]rtjaj]j]j]ujjmj]rujX[source]rvrw}rx(jUjjqubajjubajj%ubaubeubj)ry}rz(jUjj2jj9jjj}r{(j]j]j]j]j]ujNjhj]ubeubj?)r|}r}(jUjj"jNjjCj}r~(j]j]j]j]j]Uentries]r(jFX1get_data() (M2Crypto.X509.X509_Name_Entry method)jUNtraujNjhj]ubjM)r}r(jUjj"jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXX509_Name_Entry.get_data()jjjX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name_Entry.get_datarjj\j}r(j]rjaj_j`X M2Crypto.X509rr}rbj]j]j]j]rjajeXX509_Name_Entry.get_datarjgjjhujNjhj]r(j~)r}r(jXget_datajjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXget_datarr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjj"jNjjCj}r(j]j]j]j]j]Uentries]r(jFX3get_object() (M2Crypto.X509.X509_Name_Entry method)j!UNtraujNjhj]ubjM)r}r(jUjj"jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXX509_Name_Entry.get_object()jjjXa/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name_Entry.get_objectrjj\j}r(j]rj!aj_j`X M2Crypto.X509rr}rbj]j]j]j]rj!ajeXX509_Name_Entry.get_objectrjgjjhujNjhj]r…(j~)rÅ}rą(jX get_objectjjjjjjj}rŅ(jojpj]j]j]j]j]ujNjhj]rƅjX get_objectrDžrȅ}rɅ(jUjNjNjhjjÅubaubj)rʅ}r˅(jUjjjjjjj}r̅(jojpj]j]j]j]j]ujNjhj]ubj)rͅ}r΅(jUjjjNjjj}rυ(Uexprjj]j]j]j]j]ujNjhj]rЅj!)rх}r҅(jUj}rӅ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjͅj]rԅj)rՅ}rօ(jUj}rׅ(j]j]r؅jaj]j]j]ujjхj]rمjX[source]rڅrۅ}r܅(jUjjՅubajjubajj%ubaubeubj)r݅}rޅ(jUjjjjjjj}r߅(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjj"jNjjCj}r(j]j]j]j]j]Uentries]r(jFX@m2_x509_name_entry_free() (M2Crypto.X509.X509_Name_Entry method)hsUNtraujNjhj]ubjM)r}r(jUjj"jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX'X509_Name_Entry.m2_x509_name_entry_freejjjXn/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name_Entry.m2_x509_name_entry_freerjj\j}r(j]rhsaj_j`X M2Crypto.X509rr}rbj]j]j]j]rhsajeX'X509_Name_Entry.m2_x509_name_entry_freejgjjhujNjhj]r(j~)r}r(jXm2_x509_name_entry_freejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXm2_x509_name_entry_freerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjj"jNjjCj}r(j]j]j]j]j]Uentries]r(jFX1set_data() (M2Crypto.X509.X509_Name_Entry method)h2UNtraujNjhj]ubjM)r}r(jUjj"jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodr jVj ujNjhj]r (jX)r }r (jX)X509_Name_Entry.set_data(data, type=4097)jjjX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name_Entry.set_datar jj\j}r(j]rh2aj_j`X M2Crypto.X509rr}rbj]j]j]j]rh2ajeXX509_Name_Entry.set_datarjgjjhujNjhj]r(j~)r}r(jXset_datajj jj jjj}r(jojpj]j]j]j]j]ujNjhj]rjXset_datarr}r(jUjNjNjhjjubaubj)r}r(jXdata, type=4097jj jj jjj}r(jojpj]j]j]j]j]ujNjhj]r (j)r!}r"(jXdataj}r#(jojpj]j]j]j]j]ujjj]r$jXdatar%r&}r'(jUjj!ubajjubj)r(}r)(jX type=4097j}r*(jojpj]j]j]j]j]ujjj]r+jX type=4097r,r-}r.(jUjj(ubajjubeubj)r/}r0(jUjj jNjjj}r1(Uexprjj]j]j]j]j]ujNjhj]r2j!)r3}r4(jUj}r5(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujj/j]r6j)r7}r8(jUj}r9(j]j]r:jaj]j]j]ujj3j]r;jX[source]r<r=}r>(jUjj7ubajjubajj%ubaubeubj)r?}r@(jUjjjj jjj}rA(j]j]j]j]j]ujNjhj]rB(j)rC}rD(jXSets the field name to asn1objjj?jX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name_Entry.set_datajjj}rE(j]j]j]j]j]ujKjhj]rFjXSets the field name to asn1objrGrH}rI(jUjNjNjhjjCubaubj)rJ}rK(jUjj?jNjjj}rL(j]j]j]j]j]ujNjhj]rM(j)rN}rO(jUj}rP(j]j]j]j]j]ujjJj]rQ(j)rR}rS(jX ParametersjjNjj jjj}rT(j]j]j]j]j]ujKj]rUjX ParametersrVrW}rX(jUjjRubaubj)rY}rZ(jUj}r[(j]j]j]j]j]ujjNj]r\j)r]}r^(jX'data -- data in a binary form to be setj}r_(j]j]j]j]j]ujjYj]r`(j)ra}rb(jXdataj}rc(j]j]jj]j]j]ujj]j]rdjXdatarerf}rg(jUjjaubajjubjX – rhri}rj(jUjj]ubjXdata in a binary form to be setrkrl}rm(jUjNjNjhjj]ubejjubajjubejjubj)rn}ro(jUj}rp(j]j]j]j]j]ujjJj]rq(j)rr}rs(jXReturnsjjnjj jjj}rt(j]j]j]j]j]ujKj]rujXReturnsrvrw}rx(jUjjrubaubj)ry}rz(jUj}r{(j]j]j]j]j]ujjnj]r|j)r}}r~(jX0 on failure, 1 on successj}r(j]j]j]j]j]ujjyj]rjX0 on failure, 1 on successrr}r(jUjNjNjhjj}ubajjubajjubejjubeubeubeubj?)r}r(jUjj"jNjjCj}r(j]j]j]j]j]Uentries]r(jFX3set_object() (M2Crypto.X509.X509_Name_Entry method)hUNtraujNjhj]ubjM)r}r(jUjj"jNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX#X509_Name_Entry.set_object(asn1obj)jjjXa/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name_Entry.set_objectrjj\j}r(j]rhaj_j`X M2Crypto.X509rr}rbj]j]j]j]rhajeXX509_Name_Entry.set_objectrjgjjhujNjhj]r(j~)r}r(jX set_objectjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX set_objectrr}r(jUjNjNjhjjubaubj)r}r(jXasn1objjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXasn1objj}r(jojpj]j]j]j]j]ujjj]rjXasn1objrr}r(jUjjubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jXSets the field name to asn1objjjjXa/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Name_Entry.set_objectjjj}r(j]j]j]j]j]ujKjhj]r†jXSets the field name to asn1objrÆrĆ}rņ(jUjNjNjhjjubaubj)rƆ}rdž(jUjjjNjjj}rȆ(j]j]j]j]j]ujNjhj]rɆ(j)rʆ}rˆ(jUj}r̆(j]j]j]j]j]ujjƆj]r͆(j)rΆ}rφ(jX Parametersjjʆjjjjj}rІ(j]j]j]j]j]ujKj]rцjX Parametersr҆rӆ}rԆ(jUjjΆubaubj)rՆ}rֆ(jUj}r׆(j]j]j]j]j]ujjʆj]r؆j)rن}rچ(jX asn1obj -- j}rۆ(j]j]j]j]j]ujjՆj]r܆(j)r݆}rކ(jXasn1objj}r߆(j]j]jj]j]j]ujjنj]rjXasn1objrr}r(jUjj݆ubajjubjX – rr}r(jUjjنubejjubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujjƆj]r(j)r}r(jXReturnsjjjjjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jX0 on failure, 1 on successj}r(j]j]j]j]j]ujjj]rjX0 on failure, 1 on successrr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubeubeubj?)r}r(jUjjmkjNjjCj}r(j]j]j]j]j]Uentries]r(jFX#X509_Stack (class in M2Crypto.X509)hUNtraujNjhj]ubjM)r}r(jUjjmkjNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jX1X509_Stack(stack=None, _pyfree=0, _pyfree_x509=0)jjjXQ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Stackr jj\j}r (j]r haj_j`X M2Crypto.X509r r }rbj]j]j]j]rhajeX X509_StackrjgUjhujNjhj]r(jj)r}r(jXclass jjjj jjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jXM2Crypto.X509.jjjj jjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr}r(jUjNjNjhjjubaubj~)r }r!(jjjjjj jjj}r"(jojpj]j]j]j]j]ujNjhj]r#jX X509_Stackr$r%}r&(jUjNjNjhjj ubaubj)r'}r((jX%stack=None, _pyfree=0, _pyfree_x509=0jjjj jjj}r)(jojpj]j]j]j]j]ujNjhj]r*(j)r+}r,(jX stack=Nonej}r-(jojpj]j]j]j]j]ujj'j]r.jX stack=Noner/r0}r1(jUjj+ubajjubj)r2}r3(jX _pyfree=0j}r4(jojpj]j]j]j]j]ujj'j]r5jX _pyfree=0r6r7}r8(jUjj2ubajjubj)r9}r:(jX_pyfree_x509=0j}r;(jojpj]j]j]j]j]ujj'j]r<jX_pyfree_x509=0r=r>}r?(jUjj9ubajjubeubj)r@}rA(jUjjjNjjj}rB(Uexprjj]j]j]j]j]ujNjhj]rCj!)rD}rE(jUj}rF(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujj@j]rGj)rH}rI(jUj}rJ(j]j]rKjaj]j]j]ujjDj]rLjX[source]rMrN}rO(jUjjHubajjubajj%ubaubeubj)rP}rQ(jUjjjj jjj}rR(j]j]j]j]j]ujNjhj]rS(j)rT}rU(jX X509 StackjjPjXQ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_StackrVjjj}rW(j]j]j]j]j]ujKjhj]rXjX X509 StackrYrZ}r[(jUjNjNjhjjTubaubj)r\}r](jUjjPjNjjj}r^(j]j]j]j]j]ujNjhj]r_j)r`}ra(jUjj\jjVjjj}rb(j]j]j]j]j]ujKjhj]rc(j)rd}re(jXwarningjj`jjVjjj}rf(j]j]j]j]j]ujKj]rgjXWarningrhri}rj(jUjjdubaubj)rk}rl(jXDo not modify the underlying OpenSSL stack except through this interface, or use any OpenSSL functions that do so indirectly. Doing so will get the OpenSSL stack and the internal pystack of this class out of sync, leading to python memory leaks, exceptions or even python crashes! j}rm(j]j]j]j]j]ujj`j]rnj)ro}rp(jXDo not modify the underlying OpenSSL stack except through this interface, or use any OpenSSL functions that do so indirectly. Doing so will get the OpenSSL stack and the internal pystack of this class out of sync, leading to python memory leaks, exceptions or even python crashes!jjkjjVjjj}rq(j]j]j]j]j]ujKj]rrjXDo not modify the underlying OpenSSL stack except through this interface, or use any OpenSSL functions that do so indirectly. Doing so will get the OpenSSL stack and the internal pystack of this class out of sync, leading to python memory leaks, exceptions or even python crashes!rsrt}ru(jUjjoubaubajjubeubaubj?)rv}rw(jUjjPjXX/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Stack.as_derrxjjCj}ry(j]j]j]j]j]Uentries]rz(jFX*as_der() (M2Crypto.X509.X509_Stack method)j;UNtr{aujNjhj]ubjM)r|}r}(jUjjPjjxjjPj}r~(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXX509_Stack.as_der()jj|jXX/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Stack.as_derrjj\j}r(j]rj;aj_j`X M2Crypto.X509rr}rbj]j]j]j]rj;ajeXX509_Stack.as_derrjgjjhujNjhj]r(j~)r}r(jXas_derjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXas_derrr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjj|jjjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jX(Return the stack as a DER encoded stringjjjjxjjj}r(j]j]j]j]j]ujKjhj]rjX(Return the stack as a DER encoded stringrr}r(jUjNjNjhjjubaubaubeubj?)r}r(jUjjPjNjjCj}r(j]j]j]j]j]Uentries]r(jFX3m2_sk_x509_free() (M2Crypto.X509.X509_Stack method)jUNtraujNjhj]ubjM)r}r(jUjjPjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXX509_Stack.m2_sk_x509_freejjjXa/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Stack.m2_sk_x509_freerjj\j}r(j]rjaj_j`X M2Crypto.X509rr}r‡bj]j]j]j]rÇjajeXX509_Stack.m2_sk_x509_freejgjjhujNjhj]rć(j~)rŇ}rƇ(jXm2_sk_x509_freejjjjjjj}rLJ(jojpj]j]j]j]j]ujNjhj]rȇjXm2_sk_x509_freerɇrʇ}rˇ(jUjNjNjhjjŇubaubj)ṙ}r͇(jUjjjjjjj}r·(jojpj]j]j]j]j]ujNjhj]ubeubj)rχ}rЇ(jUjjjjjjj}rч(j]j]j]j]j]ujNjhj]ubeubj?)r҇}rӇ(jUjjPjNjjCj}rԇ(j]j]j]j]j]Uentries]rՇ(jFX'pop() (M2Crypto.X509.X509_Stack method)jUNtrևaujNjhj]ubjM)rׇ}r؇(jUjjPjNjjPj}rه(jRjSXpyj]j]j]j]j]jTXmethodrڇjVjڇujNjhj]rۇ(jX)r܇}r݇(jXX509_Stack.pop()jjׇjXU/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Stack.poprއjj\j}r߇(j]rjaj_j`X M2Crypto.X509rr}rbj]j]j]j]rjajeXX509_Stack.poprjgjjhujNjhj]r(j~)r}r(jXpopjj܇jjއjjj}r(jojpj]j]j]j]j]ujNjhj]rjXpoprr}r(jUjNjNjhjjubaubj)r}r(jUjj܇jjއjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjj܇jNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjׇjjއjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX!pop a certificate from the stack.jjjXU/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Stack.popjjj}r(j]j]j]j]j]ujKjhj]rjX!pop a certificate from the stack.r r }r (jUjNjNjhjjubaubj)r }r (jUjjjNjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jUj}r(j]j]j]j]j]ujj j]r(j)r}r(jXReturnsjjjjއjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r (jX@X509 object that was popped, or None if there is nothing to pop.j}r!(j]j]j]j]j]ujjj]r"jX@X509 object that was popped, or None if there is nothing to pop.r#r$}r%(jUjNjNjhjjubajjubajjubejjubaubeubeubj?)r&}r'(jUjjPjNjjCj}r((j]j]j]j]j]Uentries]r)(jFX(push() (M2Crypto.X509.X509_Stack method)h(UNtr*aujNjhj]ubjM)r+}r,(jUjjPjNjjPj}r-(jRjSXpyj]j]j]j]j]jTXmethodr.jVj.ujNjhj]r/(jX)r0}r1(jXX509_Stack.push(x509)jj+jXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Stack.pushr2jj\j}r3(j]r4h(aj_j`X M2Crypto.X509r5r6}r7bj]j]j]j]r8h(ajeXX509_Stack.pushr9jgjjhujNjhj]r:(j~)r;}r<(jXpushjj0jj2jjj}r=(jojpj]j]j]j]j]ujNjhj]r>jXpushr?r@}rA(jUjNjNjhjj;ubaubj)rB}rC(jXx509jj0jj2jjj}rD(jojpj]j]j]j]j]ujNjhj]rEj)rF}rG(jXx509j}rH(jojpj]j]j]j]j]ujjBj]rIjXx509rJrK}rL(jUjjFubajjubaubj)rM}rN(jUjj0jNjjj}rO(Uexprjj]j]j]j]j]ujNjhj]rPj!)rQ}rR(jUj}rS(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj9ujjMj]rTj)rU}rV(jUj}rW(j]j]rXjaj]j]j]ujjQj]rYjX[source]rZr[}r\(jUjjUubajjubajj%ubaubeubj)r]}r^(jUjj+jj2jjj}r_(j]j]j]j]j]ujNjhj]r`(j)ra}rb(jX(push an X509 certificate onto the stack.jj]jXV/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Stack.pushjjj}rc(j]j]j]j]j]ujKjhj]rdjX(push an X509 certificate onto the stack.rerf}rg(jUjNjNjhjjaubaubj)rh}ri(jUjj]jNjjj}rj(j]j]j]j]j]ujNjhj]rk(j)rl}rm(jUj}rn(j]j]j]j]j]ujjhj]ro(j)rp}rq(jX Parametersjjljj2jjj}rr(j]j]j]j]j]ujKj]rsjX Parametersrtru}rv(jUjjpubaubj)rw}rx(jUj}ry(j]j]j]j]j]ujjlj]rzj)r{}r|(jXx509 -- X509 object.j}r}(j]j]j]j]j]ujjwj]r~(j)r}r(jXx509j}r(j]j]jj]j]j]ujj{j]rjXx509rr}r(jUjjubajjubjX – rr}r(jUjj{ubjX X509 object.rr}r(jUjNjNjhjj{ubejjubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujjhj]r(j)r}r(jXReturnsjjjj2jjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jX2The number of X509 objects currently on the stack.j}r(j]j]j]j]j]ujjj]rjX2The number of X509 objects currently on the stack.rr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubeubeubj?)r}r(jUjjmkjNjjCj}r(j]j]j]j]j]Uentries]r(jFX#X509_Store (class in M2Crypto.X509)jUNtraujNjhj]ubjM)r}r(jUjjmkjNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jX!X509_Store(store=None, _pyfree=0)jjjXQ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Storerjj\j}r(j]rjaj_j`X M2Crypto.X509rr}rbj]j]j]j]rjajeX X509_StorerjgUjhujNjhj]r(jj)r}r(jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jXM2Crypto.X509.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rˆrÈ}rĈ(jUjNjNjhjjubaubj~)rň}rƈ(jjjjjjjjj}rLj(jojpj]j]j]j]j]ujNjhj]rȈjX X509_StorerɈrʈ}rˈ(jUjNjNjhjjňubaubj)r̈}r͈(jXstore=None, _pyfree=0jjjjjjj}rΈ(jojpj]j]j]j]j]ujNjhj]rψ(j)rЈ}rш(jX store=Nonej}r҈(jojpj]j]j]j]j]ujj̈j]rӈjX store=NonerԈrՈ}rֈ(jUjjЈubajjubj)r׈}r؈(jX _pyfree=0j}rو(jojpj]j]j]j]j]ujj̈j]rڈjX _pyfree=0rۈr܈}r݈(jUjj׈ubajjubeubj)rވ}r߈(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjވj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX X509 StorejjjXQ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Storejjj}r(j]j]j]j]j]ujKjhj]rjX X509 Storerr}r(jUjNjNjhjjubaubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX,add_cert() (M2Crypto.X509.X509_Store method)jbUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXX509_Store.add_cert(x509)jjjXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store.add_certrjj\j}r(j]rjbaj_j`X M2Crypto.X509rr }r bj]j]j]j]r jbajeXX509_Store.add_certjgjjhujNjhj]r (j~)r }r(jXadd_certjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXadd_certrr}r(jUjNjNjhjj ubaubj)r}r(jXx509jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXx509j}r(jojpj]j]j]j]j]ujjj]rjXx509rr}r(jUjjubajjubaubeubj)r}r (jUjjjjjjj}r!(j]j]j]j]j]ujNjhj]ubeubj?)r"}r#(jUjjjNjjCj}r$(j]j]j]j]j]Uentries]r%(jFX,add_x509() (M2Crypto.X509.X509_Store method)jUNtr&aujNjhj]ubjM)r'}r((jUjjjNjjPj}r)(jRjSXpyj]j]j]j]j]jTXmethodr*jVj*ujNjhj]r+(jX)r,}r-(jXX509_Store.add_x509(x509)jj'jXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store.add_x509r.jj\j}r/(j]r0jaj_j`X M2Crypto.X509r1r2}r3bj]j]j]j]r4jajeXX509_Store.add_x509r5jgjjhujNjhj]r6(j~)r7}r8(jXadd_x509jj,jj.jjj}r9(jojpj]j]j]j]j]ujNjhj]r:jXadd_x509r;r<}r=(jUjNjNjhjj7ubaubj)r>}r?(jXx509jj,jj.jjj}r@(jojpj]j]j]j]j]ujNjhj]rAj)rB}rC(jXx509j}rD(jojpj]j]j]j]j]ujj>j]rEjXx509rFrG}rH(jUjjBubajjubaubj)rI}rJ(jUjj,jNjjj}rK(Uexprjj]j]j]j]j]ujNjhj]rLj!)rM}rN(jUj}rO(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj5ujjIj]rPj)rQ}rR(jUj}rS(j]j]rTjaj]j]j]ujjMj]rUjX[source]rVrW}rX(jUjjQubajjubajj%ubaubeubj)rY}rZ(jUjj'jj.jjj}r[(j]j]j]j]j]ujNjhj]ubeubj?)r\}r](jUjjjNjjCj}r^(j]j]j]j]j]Uentries]r_(jFX-load_info() (M2Crypto.X509.X509_Store method)jwUNtr`aujNjhj]ubjM)ra}rb(jUjjjNjjPj}rc(jRjSXpyj]j]j]j]j]jTXmethodrdjVjdujNjhj]re(jX)rf}rg(jXX509_Store.load_info(file)jjajX[/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store.load_inforhjj\j}ri(j]rjjwaj_j`X M2Crypto.X509rkrl}rmbj]j]j]j]rnjwajeXX509_Store.load_inforojgjjhujNjhj]rp(j~)rq}rr(jX load_infojjfjjhjjj}rs(jojpj]j]j]j]j]ujNjhj]rtjX load_inforurv}rw(jUjNjNjhjjqubaubj)rx}ry(jXfilejjfjjhjjj}rz(jojpj]j]j]j]j]ujNjhj]r{j)r|}r}(jXfilej}r~(jojpj]j]j]j]j]ujjxj]rjXfilerr}r(jUjj|ubajjubaubj)r}r(jUjjfjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjoujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjajjhjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjhjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXfile -- filenamej}r(j]j]j]j]j]ujjj]r(j)r}r(jXfilej}r(j]j]jj]j]j]ujjj]rjXfilerr}r(jUjjubajjubjX – rr}r(jUjjubjXfilenamerr}r(jUjNjNjhjjubejjubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjhjjj}r(j]j]j]j]j]ujKj]r‰jXReturnsrÉrĉ}rʼn(jUjjubaubj)rƉ}rlj(jUj}rȉ(j]j]j]j]j]ujjj]rɉj)rʉ}rˉ(jX1 on success, 0 on failurej}r̉(j]j]j]j]j]ujjƉj]r͉jX1 on success, 0 on failurerΉrω}rЉ(jUjNjNjhjjʉubajjubajjubejjubeubaubeubj?)rщ}r҉(jUjjjNjjCj}rӉ(j]j]j]j]j]Uentries]rԉ(jFX2load_locations() (M2Crypto.X509.X509_Store method)jUNtrՉaujNjhj]ubjM)r։}r׉(jUjjjNjjPj}r؉(jRjSXpyj]j]j]j]j]jTXmethodrىjVjىujNjhj]rډ(jX)rۉ}r܉(jXX509_Store.load_locations(file)jj։jX`/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store.load_locationsr݉jj\j}rމ(j]r߉jaj_j`X M2Crypto.X509rr}rbj]j]j]j]rjajeXX509_Store.load_locationsjgjjhujNjhj]r(j~)r}r(jXload_locationsjjۉjj݉jjj}r(jojpj]j]j]j]j]ujNjhj]rjXload_locationsrr}r(jUjNjNjhjjubaubj)r}r(jXfilejjۉjj݉jjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXfilej}r(jojpj]j]j]j]j]ujjj]rjXfilerr}r(jUjjubajjubaubeubj)r}r(jUjj։jj݉jjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjj݉jjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r (jUjjubaubj)r }r (jUj}r (j]j]j]j]j]ujjj]r j)r}r(jXfile -- filenamej}r(j]j]j]j]j]ujj j]r(j)r}r(jXfilej}r(j]j]jj]j]j]ujjj]rjXfilerr}r(jUjjubajjubjX – rr}r(jUjjubjXfilenamerr}r(jUjNjNjhjjubejjubajjubejjubj)r}r (jUj}r!(j]j]j]j]j]ujjj]r"(j)r#}r$(jXReturnsjjjj݉jjj}r%(j]j]j]j]j]ujKj]r&jXReturnsr'r(}r)(jUjj#ubaubj)r*}r+(jUj}r,(j]j]j]j]j]ujjj]r-j)r.}r/(jX1 on success, 0 on failurej}r0(j]j]j]j]j]ujj*j]r1jX1 on success, 0 on failurer2r3}r4(jUjNjNjhjj.ubajjubajjubejjubeubaubeubj?)r5}r6(jUjjjNjjCj}r7(j]j]j]j]j]Uentries]r8(jFX6m2_x509_store_free() (M2Crypto.X509.X509_Store method)j|UNtr9aujNjhj]ubjM)r:}r;(jUjjjNjjPj}r<(jRjSXpyj]j]j]j]j]jTXmethodr=jVj=ujNjhj]r>(jX)r?}r@(jXX509_Store.m2_x509_store_freejj:jXd/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store.m2_x509_store_freerAjj\j}rB(j]rCj|aj_j`X M2Crypto.X509rDrE}rFbj]j]j]j]rGj|ajeXX509_Store.m2_x509_store_freejgjjhujNjhj]rH(j~)rI}rJ(jXm2_x509_store_freejj?jjAjjj}rK(jojpj]j]j]j]j]ujNjhj]rLjXm2_x509_store_freerMrN}rO(jUjNjNjhjjIubaubj)rP}rQ(jUjj?jjAjjj}rR(jojpj]j]j]j]j]ujNjhj]ubeubj)rS}rT(jUjj:jjAjjj}rU(j]j]j]j]j]ujNjhj]ubeubj?)rV}rW(jUjjjNjjCj}rX(j]j]j]j]j]Uentries]rY(jFX1set_verify_cb() (M2Crypto.X509.X509_Store method)hUNtrZaujNjhj]ubjM)r[}r\(jUjjjNjjPj}r](jRjSXpyj]j]j]j]j]jTXmethodr^jVj^ujNjhj]r_(jX)r`}ra(jX'X509_Store.set_verify_cb(callback=None)jj[jX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store.set_verify_cbrbjj\j}rc(j]rdhaj_j`X M2Crypto.X509rerf}rgbj]j]j]j]rhhajeXX509_Store.set_verify_cbrijgjjhujNjhj]rj(j~)rk}rl(jX set_verify_cbjj`jjbjjj}rm(jojpj]j]j]j]j]ujNjhj]rnjX set_verify_cbrorp}rq(jUjNjNjhjjkubaubj)rr}rs(jX callback=Nonejj`jjbjjj}rt(jojpj]j]j]j]j]ujNjhj]ruj)rv}rw(jX callback=Nonej}rx(jojpj]j]j]j]j]ujjrj]ryjX callback=Nonerzr{}r|(jUjjvubajjubaubj)r}}r~(jUjj`jNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjiujj}j]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjj[jjbjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jXnSet callback which will be called when the store is verified. Wrapper over OpenSSL X509_STORE_set_verify_cb().jjjX_/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store.set_verify_cbrjjj}r(j]j]j]j]j]ujKjhj]rjXnSet callback which will be called when the store is verified. Wrapper over OpenSSL X509_STORE_set_verify_cb().rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjbjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXcallback -- Callable to specify verification options. Type of the callable must be: (int, X509_Store_Context) -> int. If None: set the standard options.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXcallbackj}r(j]j]jj]j]j]ujjj]rjXcallbackrr}r(jUjjubajjubjX – rr}r(jUjjubjXCallable to specify verification options. Type of the callable must be: (int, X509_Store_Context) -> int. If None: set the standard options.rr}r(jUjNjNjhjjubejjubajjubejjubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujK jhj]r(j)r}rŠ(jXnotejjjjjjj}rÊ(j]j]j]j]j]ujKj]rĊjXNoterŊrƊ}rNJ(jUjjubaubj)rȊ}rɊ(jXcompile-time or run-time errors in the callback would result in mysterious errors during verification, which could be hard to trace. j}rʊ(j]j]j]j]j]ujjj]rˊj)r̊}r͊(jXcompile-time or run-time errors in the callback would result in mysterious errors during verification, which could be hard to trace.jjȊjjjjj}rΊ(j]j]j]j]j]ujK j]rϊjXcompile-time or run-time errors in the callback would result in mysterious errors during verification, which could be hard to trace.rЊrъ}rҊ(jUjj̊ubaubajjubeubj)rӊ}rԊ(jUjjjjjjj}rՊ(j]j]j]j]j]ujK jhj]r֊(j)r׊}r؊(jXnotejjӊjjjjj}rي(j]j]j]j]j]ujKj]rڊjXNoterۊr܊}r݊(jUjj׊ubaubj)rފ}rߊ(jXIPython exceptions raised in callbacks do not propagate to verify() call. j}r(j]j]j]j]j]ujjӊj]rj)r}r(jXHPython exceptions raised in callbacks do not propagate to verify() call.jjފjjjjj}r(j]j]j]j]j]ujK j]rjXHPython exceptions raised in callbacks do not propagate to verify() call.rr}r(jUjjubaubajjubeubj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjbjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXNonej}r(j]j]j]j]j]ujjj]rjXNonerr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubeubeubj?)r}r(jUjjmkjNjjCj}r(j]j]j]j]j]Uentries]r(jFX+X509_Store_Context (class in M2Crypto.X509)hUNtraujNjhj]ubjM)r}r(jUjjmkjNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r }r (jX-X509_Store_Context(x509_store_ctx, _pyfree=0)jjjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Contextr jj\j}r (j]r haj_j`X M2Crypto.X509rr}rbj]j]j]j]rhajeXX509_Store_ContextrjgUjhujNjhj]r(jj)r}r(jXclass jj jj jjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jXM2Crypto.X509.jj jj jjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr }r!(jUjNjNjhjjubaubj~)r"}r#(jjjj jj jjj}r$(jojpj]j]j]j]j]ujNjhj]r%jXX509_Store_Contextr&r'}r((jUjNjNjhjj"ubaubj)r)}r*(jXx509_store_ctx, _pyfree=0jj jj jjj}r+(jojpj]j]j]j]j]ujNjhj]r,(j)r-}r.(jXx509_store_ctxj}r/(jojpj]j]j]j]j]ujj)j]r0jXx509_store_ctxr1r2}r3(jUjj-ubajjubj)r4}r5(jX _pyfree=0j}r6(jojpj]j]j]j]j]ujj)j]r7jX _pyfree=0r8r9}r:(jUjj4ubajjubeubj)r;}r<(jUjj jNjjj}r=(Uexprjj]j]j]j]j]ujNjhj]r>j!)r?}r@(jUj}rA(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujj;j]rBj)rC}rD(jUj}rE(j]j]rFjaj]j]j]ujj?j]rGjX[source]rHrI}rJ(jUjjCubajjubajj%ubaubeubj)rK}rL(jUjjjj jjj}rM(j]j]j]j]j]ujNjhj]rN(j)rO}rP(jXX509 Store ContextjjKjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Contextjjj}rQ(j]j]j]j]j]ujKjhj]rRjXX509 Store ContextrSrT}rU(jUjNjNjhjjOubaubj?)rV}rW(jUjjKjNjjCj}rX(j]j]j]j]j]Uentries]rY(jFX6get1_chain() (M2Crypto.X509.X509_Store_Context method)hUNtrZaujNjhj]ubjM)r[}r\(jUjjKjNjjPj}r](jRjSXpyj]j]j]j]j]jTXmethodr^jVj^ujNjhj]r_(jX)r`}ra(jXX509_Store_Context.get1_chain()jj[jXd/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Context.get1_chainrbjj\j}rc(j]rdhaj_j`X M2Crypto.X509rerf}rgbj]j]j]j]rhhajeXX509_Store_Context.get1_chainrijgjjhujNjhj]rj(j~)rk}rl(jX get1_chainjj`jjbjjj}rm(jojpj]j]j]j]j]ujNjhj]rnjX get1_chainrorp}rq(jUjNjNjhjjkubaubj)rr}rs(jUjj`jjbjjj}rt(jojpj]j]j]j]j]ujNjhj]ubj)ru}rv(jUjj`jNjjj}rw(Uexprjj]j]j]j]j]ujNjhj]rxj!)ry}rz(jUj}r{(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjiujjuj]r|j)r}}r~(jUj}r(j]j]rjaj]j]j]ujjyj]rjX[source]rr}r(jUjj}ubajjubajj%ubaubeubj)r}r(jUjj[jjbjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jXGet certificate chain.jjjXd/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Context.get1_chainjjj}r(j]j]j]j]j]ujKjhj]rjXGet certificate chain.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjbjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXoReference counted (i.e. safe to use even after the store context goes away) stack of certificates in the chain.j}r(j]j]j]j]j]ujjj]rjXoReference counted (i.e. safe to use even after the store context goes away) stack of certificates in the chain.rr}r(jUjNjNjhjjubajjubajjubejjubaubeubeubj?)r}r(jUjjKjNjjCj}r(j]j]j]j]j]Uentries]r(jFX<get_current_cert() (M2Crypto.X509.X509_Store_Context method)j.UNtraujNjhj]ubjM)r}r(jUjjKjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX%X509_Store_Context.get_current_cert()jjjXj/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Context.get_current_certrjj\j}r(j]rj.aj_j`X M2Crypto.X509rr}rbj]j]j]j]rj.ajeX#X509_Store_Context.get_current_certrjgjjhujNjhj]r(j~)r}r(jXget_current_certjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r‹jXget_current_certrËrċ}rŋ(jUjNjNjhjjubaubj)rƋ}rNj(jUjjjjjjj}rȋ(jojpj]j]j]j]j]ujNjhj]ubj)rɋ}rʋ(jUjjjNjjj}rˋ(Uexprjj]j]j]j]j]ujNjhj]r̋j!)r͋}r΋(jUj}rϋ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjɋj]rЋj)rы}rҋ(jUj}rӋ(j]j]rԋjaj]j]j]ujj͋j]rՋjX[source]r֋r׋}r؋(jUjjыubajjubajj%ubaubeubj)rً}rڋ(jUjjjjjjj}rۋ(j]j]j]j]j]ujNjhj]r܋(j)r݋}rދ(jXGet current X.509 certificate.jjًjXj/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Context.get_current_certrߋjjj}r(j]j]j]j]j]ujKjhj]rjXGet current X.509 certificate.rr}r(jUjNjNjhjj݋ubaubj)r}r(jUjjًjNjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jUjjjjߋjjj}r(j]j]j]j]j]ujKjhj]r(j)r}r(jXwarningjjjjߋjjj}r(j]j]j]j]j]ujKj]rjXWarningrr}r(jUjjubaubj)r}r(jXThe returned certificate is NOT refcounted, so you can not rely on it being valid once the store context goes away or is modified.j}r(j]j]j]j]j]ujjj]rj)r}r(jXThe returned certificate is NOT refcounted, so you can not rely on it being valid once the store context goes away or is modified.jjjjߋjjj}r(j]j]j]j]j]ujKj]rjXThe returned certificate is NOT refcounted, so you can not rely on it being valid once the store context goes away or is modified.rr}r(jUjjubaubajjubeubaubeubeubj?)r}r(jUjjKjXc/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Context.get_errorrjjCj}r(j]j]j]j]j]Uentries]r(jFX5get_error() (M2Crypto.X509.X509_Store_Context method)jUNtraujNjhj]ubjM)r}r(jUjjKjjjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r (jX)r }r (jXX509_Store_Context.get_error()jjjXc/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Context.get_errorr jj\j}r (j]rjaj_j`X M2Crypto.X509rr}rbj]j]j]j]rjajeXX509_Store_Context.get_errorrjgjjhujNjhj]r(j~)r}r(jX get_errorjj jj jjj}r(jojpj]j]j]j]j]ujNjhj]rjX get_errorrr}r(jUjNjNjhjjubaubj)r}r(jUjj jj jjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r (jUjj jNjjj}r!(Uexprjj]j]j]j]j]ujNjhj]r"j!)r#}r$(jUj}r%(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]r&j)r'}r((jUj}r)(j]j]r*jaj]j]j]ujj#j]r+jX[source]r,r-}r.(jUjj'ubajjubajj%ubaubeubj)r/}r0(jUjjjj jjj}r1(j]j]j]j]j]ujNjhj]r2j)r3}r4(jXGet error code.jj/jjjjj}r5(j]j]j]j]j]ujKjhj]r6jXGet error code.r7r8}r9(jUjNjNjhjj3ubaubaubeubj?)r:}r;(jUjjKjXi/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Context.get_error_depthr<jjCj}r=(j]j]j]j]j]Uentries]r>(jFX;get_error_depth() (M2Crypto.X509.X509_Store_Context method)jfUNtr?aujNjhj]ubjM)r@}rA(jUjjKjj<jjPj}rB(jRjSXpyj]j]j]j]j]jTXmethodrCjVjCujNjhj]rD(jX)rE}rF(jX$X509_Store_Context.get_error_depth()jj@jXi/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Context.get_error_depthrGjj\j}rH(j]rIjfaj_j`X M2Crypto.X509rJrK}rLbj]j]j]j]rMjfajeX"X509_Store_Context.get_error_depthrNjgjjhujNjhj]rO(j~)rP}rQ(jXget_error_depthjjEjjGjjj}rR(jojpj]j]j]j]j]ujNjhj]rSjXget_error_depthrTrU}rV(jUjNjNjhjjPubaubj)rW}rX(jUjjEjjGjjj}rY(jojpj]j]j]j]j]ujNjhj]ubj)rZ}r[(jUjjEjNjjj}r\(Uexprjj]j]j]j]j]ujNjhj]r]j!)r^}r_(jUj}r`(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509UrefidjNujjZj]raj)rb}rc(jUj}rd(j]j]rejaj]j]j]ujj^j]rfjX[source]rgrh}ri(jUjjbubajjubajj%ubaubeubj)rj}rk(jUjj@jjGjjj}rl(j]j]j]j]j]ujNjhj]rmj)rn}ro(jXGet error depth.jjjjj<jjj}rp(j]j]j]j]j]ujKjhj]rqjXGet error depth.rrrs}rt(jUjNjNjhjjnubaubaubeubj?)ru}rv(jUjjKjNjjCj}rw(j]j]j]j]j]Uentries]rx(jFXBm2_x509_store_ctx_free() (M2Crypto.X509.X509_Store_Context method)jgUNtryaujNjhj]ubjM)rz}r{(jUjjKjNjjPj}r|(jRjSXpyj]j]j]j]j]jTXmethodr}jVj}ujNjhj]r~(jX)r}r(jX)X509_Store_Context.m2_x509_store_ctx_freejjzjXp/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.X509_Store_Context.m2_x509_store_ctx_freerjj\j}r(j]rjgaj_j`X M2Crypto.X509rr}rbj]j]j]j]rjgajeX)X509_Store_Context.m2_x509_store_ctx_freejgjjhujNjhj]r(j~)r}r(jXm2_x509_store_ctx_freejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXm2_x509_store_ctx_freerr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubeubj)r}r(jUjjzjjjjj}r(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r}r(jUjjmkjNjjCj}r(j]j]j]j]j]Uentries]r(jFX%load_cert() (in module M2Crypto.X509)j5UNtraujNjhj]ubjM)r}r(jUjjmkjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXload_cert(file, format=1)jjjXP/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_certrjj\j}r(j]rj5aj_j`X M2Crypto.X509rr}rbj]j]j]j]rj5ajeX load_certrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.X509.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX load_certrr}r(jUjNjNjhjjubaubj)r}r(jXfile, format=1jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXfilej}r(jojpj]j]j]j]j]ujjj]rjXfilerrŒ}rÌ(jUjjubajjubj)rČ}rŌ(jXformat=1j}rƌ(jojpj]j]j]j]j]ujjj]rnjjXformat=1rȌrɌ}rʌ(jUjjČubajjubeubj)rˌ}ř(jUjjjNjjj}r͌(Uexprjj]j]j]j]j]ujNjhj]rΌj!)rό}rЌ(jUj}rь(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjˌj]rҌj)rӌ}rԌ(jUj}rՌ(j]j]r֌jaj]j]j]ujjόj]r׌jX[source]r،rٌ}rڌ(jUjjӌubajjubajj%ubaubeubj)rی}r܌(jUjjjjjjj}r݌(j]j]j]j]j]ujNjhj]rތ(j)rߌ}r(jXLoad certificate from file.jjیjXP/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_certjjj}r(j]j]j]j]j]ujKjhj]rjXLoad certificate from file.rr}r(jUjNjNjhjjߌubaubj)r}r(jUjjیjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj^ )r}r(jUj}r(j]j]j]j]j]ujjj]r(jc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXHfile -- Name of file containing certificate in either DER or PEM format.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXfilej}r(j]j]jj]j]j]ujjj]rjXfiler r }r (jUjjubajjubjX – r r }r(jUjjubjX@Name of file containing certificate in either DER or PEM format.rr}r(jUjNjNjhjjubejjubajjy ubjc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXKformat -- Describes the format of the file to be loaded, either PEM or DER.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXformatj}r(j]j]jj]j]j]ujjj]rjXformatrr}r (jUjjubajjubjX – r!r"}r#(jUjjubjXADescribes the format of the file to be loaded, either PEM or DER.r$r%}r&(jUjNjNjhjjubejjubajjy ubejj ubajjubejjubj)r'}r((jUj}r)(j]j]j]j]j]ujjj]r*(j)r+}r,(jXReturnsjj'jjjjj}r-(j]j]j]j]j]ujKj]r.jXReturnsr/r0}r1(jUjj+ubaubj)r2}r3(jUj}r4(j]j]j]j]j]ujj'j]r5j)r6}r7(jXM2Crypto.X509.X509 object.j}r8(j]j]j]j]j]ujj2j]r9jXM2Crypto.X509.X509 object.r:r;}r<(jUjNjNjhjj6ubajjubajjubejjubeubeubeubj?)r=}r>(jUjjmkjNjjCj}r?(j]j]j]j]j]Uentries]r@(jFX)load_cert_bio() (in module M2Crypto.X509)jqUNtrAaujNjhj]ubjM)rB}rC(jUjjmkjNjjPj}rD(jRjSXpyj]j]j]j]j]jTXfunctionrEjVjEujNjhj]rF(jX)rG}rH(jXload_cert_bio(bio, format=1)jjBjXT/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_cert_biorIjj\j}rJ(j]rKjqaj_j`X M2Crypto.X509rLrM}rNbj]j]j]j]rOjqajeX load_cert_biorPjgUjhujNjhj]rQ(ju)rR}rS(jXM2Crypto.X509.jjGjjIjjxj}rT(jojpj]j]j]j]j]ujNjhj]rUjXM2Crypto.X509.rVrW}rX(jUjNjNjhjjRubaubj~)rY}rZ(jjPjjGjjIjjj}r[(jojpj]j]j]j]j]ujNjhj]r\jX load_cert_bior]r^}r_(jUjNjNjhjjYubaubj)r`}ra(jX bio, format=1jjGjjIjjj}rb(jojpj]j]j]j]j]ujNjhj]rc(j)rd}re(jXbioj}rf(jojpj]j]j]j]j]ujj`j]rgjXbiorhri}rj(jUjjdubajjubj)rk}rl(jXformat=1j}rm(jojpj]j]j]j]j]ujj`j]rnjXformat=1rorp}rq(jUjjkubajjubeubj)rr}rs(jUjjGjNjjj}rt(Uexprjj]j]j]j]j]ujNjhj]ruj!)rv}rw(jUj}rx(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509UrefidjPujjrj]ryj)rz}r{(jUj}r|(j]j]r}jaj]j]j]ujjvj]r~jX[source]rr}r(jUjjzubajjubajj%ubaubeubj)r}r(jUjjBjjIjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jXLoad certificate from a bio.jjjXT/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_cert_biojjj}r(j]j]j]j]j]ujKjhj]rjXLoad certificate from a bio.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX ParametersjjjjIjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj^ )r}r(jUj}r(j]j]j]j]j]ujjj]r(jc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXAbio -- BIO pointing at a certificate in either DER or PEM format.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXbioj}r(j]j]jj]j]j]ujjj]rjXbiorr}r(jUjjubajjubjX – rr}r(jUjjubjX:BIO pointing at a certificate in either DER or PEM format.rr}r(jUjNjNjhjjubejjubajjy ubjc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jX{format -- Describes the format of the cert to be loaded, either PEM or DER (via constants FORMAT_PEM and FORMAT_FORMAT_DER)j}r(j]j]j]j]j]ujjj]r(j)r}r(jXformatj}rÍ(j]j]jj]j]j]ujjj]rčjXformatrōrƍ}rǍ(jUjjubajjubjX – rȍrɍ}rʍ(jUjjubjXqDescribes the format of the cert to be loaded, either PEM or DER (via constants FORMAT_PEM and FORMAT_FORMAT_DER)rˍr̍}r͍(jUjNjNjhjjubejjubajjy ubejj ubajjubejjubj)r΍}rύ(jUj}rЍ(j]j]j]j]j]ujjj]rэ(j)rҍ}rӍ(jXReturnsjj΍jjIjjj}rԍ(j]j]j]j]j]ujKj]rՍjXReturnsr֍r׍}r؍(jUjjҍubaubj)rٍ}rڍ(jUj}rۍ(j]j]j]j]j]ujj΍j]r܍j)rݍ}rލ(jXM2Crypto.X509.X509 object.j}rߍ(j]j]j]j]j]ujjٍj]rjXM2Crypto.X509.X509 object.rr}r(jUjNjNjhjjݍubajjubajjubejjubeubeubeubj?)r}r(jUjjmkjNjjCj}r(j]j]j]j]j]Uentries]r(jFX0load_cert_der_string() (in module M2Crypto.X509)hUNtraujNjhj]ubjM)r}r(jUjjmkjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXload_cert_der_string(string)jjjX[/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_cert_der_stringrjj\j}r(j]rhaj_j`X M2Crypto.X509rr}rbj]j]j]j]rhajeXload_cert_der_stringrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.X509.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXload_cert_der_stringrr}r(jUjNjNjhjjubaubj)r}r(jXstringjjjjjjj}r (jojpj]j]j]j]j]ujNjhj]r j)r }r (jXstringj}r (jojpj]j]j]j]j]ujjj]rjXstringrr}r(jUjj ubajjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr }r!(jUjjubajjubajj%ubaubeubj)r"}r#(jUjjjjjjj}r$(j]j]j]j]j]ujNjhj]r%(j)r&}r'(jXLoad certificate from a string.jj"jX[/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_cert_der_stringjjj}r((j]j]j]j]j]ujKjhj]r)jXLoad certificate from a string.r*r+}r,(jUjNjNjhjj&ubaubj)r-}r.(jUjj"jNjjj}r/(j]j]j]j]j]ujNjhj]r0(j)r1}r2(jUj}r3(j]j]j]j]j]ujj-j]r4(j)r5}r6(jX Parametersjj1jjjjj}r7(j]j]j]j]j]ujKj]r8jX Parametersr9r:}r;(jUjj5ubaubj)r<}r=(jUj}r>(j]j]j]j]j]ujj1j]r?j)r@}rA(jX8string -- String containing a certificate in DER format.j}rB(j]j]j]j]j]ujj<j]rC(j)rD}rE(jXstringj}rF(j]j]jj]j]j]ujj@j]rGjXstringrHrI}rJ(jUjjDubajjubjX – rKrL}rM(jUjj@ubjX.String containing a certificate in DER format.rNrO}rP(jUjNjNjhjj@ubejjubajjubejjubj)rQ}rR(jUj}rS(j]j]j]j]j]ujj-j]rT(j)rU}rV(jXReturnsjjQjjjjj}rW(j]j]j]j]j]ujKj]rXjXReturnsrYrZ}r[(jUjjUubaubj)r\}r](jUj}r^(j]j]j]j]j]ujjQj]r_j)r`}ra(jXM2Crypto.X509.X509 object.j}rb(j]j]j]j]j]ujj\j]rcjXM2Crypto.X509.X509 object.rdre}rf(jUjNjNjhjj`ubajjubajjubejjubeubeubeubj?)rg}rh(jUjjmkjNjjCj}ri(j]j]j]j]j]Uentries]rj(jFX,load_cert_string() (in module M2Crypto.X509)jUNtrkaujNjhj]ubjM)rl}rm(jUjjmkjNjjPj}rn(jRjSXpyj]j]j]j]j]jTXfunctionrojVjoujNjhj]rp(jX)rq}rr(jX"load_cert_string(string, format=1)jjljXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_cert_stringrsjj\j}rt(j]rujaj_j`X M2Crypto.X509rvrw}rxbj]j]j]j]ryjajeXload_cert_stringrzjgUjhujNjhj]r{(ju)r|}r}(jXM2Crypto.X509.jjqjjsjjxj}r~(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr}r(jUjNjNjhjj|ubaubj~)r}r(jjzjjqjjsjjj}r(jojpj]j]j]j]j]ujNjhj]rjXload_cert_stringrr}r(jUjNjNjhjjubaubj)r}r(jXstring, format=1jjqjjsjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXstringj}r(jojpj]j]j]j]j]ujjj]rjXstringrr}r(jUjjubajjubj)r}r(jXformat=1j}r(jojpj]j]j]j]j]ujjj]rjXformat=1rr}r(jUjjubajjubeubj)r}r(jUjjqjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjzujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjljjsjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jXLoad certificate from a string.jjjXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_cert_stringjjj}r(j]j]j]j]j]ujKjhj]rjXLoad certificate from a string.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjsjjj}r(j]j]j]j]j]ujKj]rŽjX ParametersrÎrĎ}rŎ(jUjjubaubj)rƎ}rǎ(jUj}rȎ(j]j]j]j]j]ujjj]rɎj^ )rʎ}rˎ(jUj}r̎(j]j]j]j]j]ujjƎj]r͎(jc )rΎ}rώ(jUj}rЎ(j]j]j]j]j]ujjʎj]rюj)rҎ}rӎ(jXFstring -- String containing a certificate in either DER or PEM format.j}rԎ(j]j]j]j]j]ujjΎj]rՎ(j)r֎}r׎(jXstringj}r؎(j]j]jj]j]j]ujjҎj]rَjXstringrڎrێ}r܎(jUjj֎ubajjubjX – rݎrގ}rߎ(jUjjҎubjX<String containing a certificate in either DER or PEM format.rr}r(jUjNjNjhjjҎubejjubajjy ubjc )r}r(jUj}r(j]j]j]j]j]ujjʎj]rj)r}r(jX{format -- Describes the format of the cert to be loaded, either PEM or DER (via constants FORMAT_PEM and FORMAT_FORMAT_DER)j}r(j]j]j]j]j]ujjj]r(j)r}r(jXformatj}r(j]j]jj]j]j]ujjj]rjXformatrr}r(jUjjubajjubjX – rr}r(jUjjubjXqDescribes the format of the cert to be loaded, either PEM or DER (via constants FORMAT_PEM and FORMAT_FORMAT_DER)rr}r(jUjNjNjhjjubejjubajjy ubejj ubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjsjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXM2Crypto.X509.X509 object.j}r (j]j]j]j]j]ujjj]r jXM2Crypto.X509.X509 object.r r }r (jUjNjNjhjjubajjubajjubejjubeubeubeubj?)r}r(jUjjmkjNjjCj}r(j]j]j]j]j]Uentries]r(jFX$load_crl() (in module M2Crypto.X509)jUNtraujNjhj]ubjM)r}r(jUjjmkjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXload_crl(file)jjjXO/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_crlrjj\j}r(j]rjaj_j`X M2Crypto.X509rr}rbj]j]j]j]r jajeXload_crlr!jgUjhujNjhj]r"(ju)r#}r$(jXM2Crypto.X509.jjjjjjxj}r%(jojpj]j]j]j]j]ujNjhj]r&jXM2Crypto.X509.r'r(}r)(jUjNjNjhjj#ubaubj~)r*}r+(jj!jjjjjjj}r,(jojpj]j]j]j]j]ujNjhj]r-jXload_crlr.r/}r0(jUjNjNjhjj*ubaubj)r1}r2(jXfilejjjjjjj}r3(jojpj]j]j]j]j]ujNjhj]r4j)r5}r6(jXfilej}r7(jojpj]j]j]j]j]ujj1j]r8jXfiler9r:}r;(jUjj5ubajjubaubj)r<}r=(jUjjjNjjj}r>(Uexprjj]j]j]j]j]ujNjhj]r?j!)r@}rA(jUj}rB(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj!ujj<j]rCj)rD}rE(jUj}rF(j]j]rGjaj]j]j]ujj@j]rHjX[source]rIrJ}rK(jUjjDubajjubajj%ubaubeubj)rL}rM(jUjjjjjjj}rN(j]j]j]j]j]ujNjhj]rO(j)rP}rQ(jXLoad CRL from file.jjLjXO/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_crljjj}rR(j]j]j]j]j]ujKjhj]rSjXLoad CRL from file.rTrU}rV(jUjNjNjhjjPubaubj)rW}rX(jUjjLjNjjj}rY(j]j]j]j]j]ujNjhj]rZ(j)r[}r\(jUj}r](j]j]j]j]j]ujjWj]r^(j)r_}r`(jX Parametersjj[jjjjj}ra(j]j]j]j]j]ujKj]rbjX Parametersrcrd}re(jUjj_ubaubj)rf}rg(jUj}rh(j]j]j]j]j]ujj[j]rij)rj}rk(jX2file -- Name of file containing CRL in PEM format.j}rl(j]j]j]j]j]ujjfj]rm(j)rn}ro(jXfilej}rp(j]j]jj]j]j]ujjjj]rqjXfilerrrs}rt(jUjjnubajjubjX – rurv}rw(jUjjjubjX*Name of file containing CRL in PEM format.rxry}rz(jUjNjNjhjjjubejjubajjubejjubj)r{}r|(jUj}r}(j]j]j]j]j]ujjWj]r~(j)r}r(jXReturnsjj{jjjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujj{j]rj)r}r(jXM2Crypto.X509.CRL object.j}r(j]j]j]j]j]ujjj]rjXM2Crypto.X509.CRL object.rr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubj?)r}r(jUjjmkjNjjCj}r(j]j]j]j]j]Uentries]r(jFX(load_request() (in module M2Crypto.X509)jUNtraujNjhj]ubjM)r}r(jUjjmkjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXload_request(file, format=1)jjjXS/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_requestrjj\j}r(j]rjaj_j`X M2Crypto.X509rr}rbj]j]j]j]rjajeX load_requestrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.X509.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX load_requestrr}r(jUjNjNjhjjubaubj)r}r(jXfile, format=1jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXfilej}r(jojpj]j]j]j]j]ujjj]rjXfilerr}r(jUjjubajjubj)r}r(jXformat=1j}r(jojpj]j]j]j]j]ujjj]rjXformat=1rÏrď}rŏ(jUjjubajjubeubj)rƏ}rǏ(jUjjjNjjj}rȏ(Uexprjj]j]j]j]j]ujNjhj]rɏj!)rʏ}rˏ(jUj}ȑ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509UrefidjujjƏj]r͏j)rΏ}rϏ(jUj}rЏ(j]j]rяjaj]j]j]ujjʏj]rҏjX[source]rӏrԏ}rՏ(jUjjΏubajjubajj%ubaubeubj)r֏}r׏(jUjjjjjjj}r؏(j]j]j]j]j]ujNjhj]rُ(j)rڏ}rۏ(jX#Load certificate request from file.jj֏jXS/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_requestjjj}r܏(j]j]j]j]j]ujKjhj]rݏjX#Load certificate request from file.rޏrߏ}r(jUjNjNjhjjڏubaubj)r}r(jUjj֏jNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj^ )r}r(jUj}r(j]j]j]j]j]ujjj]r(jc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXPfile -- Name of file containing certificate request in either PEM or DER format.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXfilej}r(j]j]jj]j]j]ujjj]rjXfilerr}r(jUjjubajjubjX – rr}r (jUjjubjXHName of file containing certificate request in either PEM or DER format.r r }r (jUjNjNjhjjubejjubajjy ubjc )r }r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXwformat -- Describes the format of the file to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER)j}r(j]j]j]j]j]ujj j]r(j)r}r(jXformatj}r(j]j]jj]j]j]ujjj]rjXformatrr}r(jUjjubajjubjX – rr}r(jUjjubjXmDescribes the format of the file to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER)rr }r!(jUjNjNjhjjubejjubajjy ubejj ubajjubejjubj)r"}r#(jUj}r$(j]j]j]j]j]ujjj]r%(j)r&}r'(jXReturnsjj"jjjjj}r((j]j]j]j]j]ujKj]r)jXReturnsr*r+}r,(jUjj&ubaubj)r-}r.(jUj}r/(j]j]j]j]j]ujj"j]r0j)r1}r2(jXRequest object.j}r3(j]j]j]j]j]ujj-j]r4jXRequest object.r5r6}r7(jUjNjNjhjj1ubajjubajjubejjubeubeubeubj?)r8}r9(jUjjmkjNjjCj}r:(j]j]j]j]j]Uentries]r;(jFX,load_request_bio() (in module M2Crypto.X509)hUNtr<aujNjhj]ubjM)r=}r>(jUjjmkjNjjPj}r?(jRjSXpyj]j]j]j]j]jTXfunctionr@jVj@ujNjhj]rA(jX)rB}rC(jXload_request_bio(bio, format=1)jj=jXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_request_biorDjj\j}rE(j]rFhaj_j`X M2Crypto.X509rGrH}rIbj]j]j]j]rJhajeXload_request_biorKjgUjhujNjhj]rL(ju)rM}rN(jXM2Crypto.X509.jjBjjDjjxj}rO(jojpj]j]j]j]j]ujNjhj]rPjXM2Crypto.X509.rQrR}rS(jUjNjNjhjjMubaubj~)rT}rU(jjKjjBjjDjjj}rV(jojpj]j]j]j]j]ujNjhj]rWjXload_request_biorXrY}rZ(jUjNjNjhjjTubaubj)r[}r\(jX bio, format=1jjBjjDjjj}r](jojpj]j]j]j]j]ujNjhj]r^(j)r_}r`(jXbioj}ra(jojpj]j]j]j]j]ujj[j]rbjXbiorcrd}re(jUjj_ubajjubj)rf}rg(jXformat=1j}rh(jojpj]j]j]j]j]ujj[j]rijXformat=1rjrk}rl(jUjjfubajjubeubj)rm}rn(jUjjBjNjjj}ro(Uexprjj]j]j]j]j]ujNjhj]rpj!)rq}rr(jUj}rs(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509UrefidjKujjmj]rtj)ru}rv(jUj}rw(j]j]rxjaj]j]j]ujjqj]ryjX[source]rzr{}r|(jUjjuubajjubajj%ubaubeubj)r}}r~(jUjj=jjDjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX$Load certificate request from a bio.jj}jXW/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_request_biojjj}r(j]j]j]j]j]ujKjhj]rjX$Load certificate request from a bio.rr}r(jUjNjNjhjjubaubj)r}r(jUjj}jNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX ParametersjjjjDjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj^ )r}r(jUj}r(j]j]j]j]j]ujjj]r(jc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXIbio -- BIO pointing at a certificate request in either DER or PEM format.j}r(j]j]j]j]j]ujjj]r(j)r}r(jXbioj}r(j]j]jj]j]j]ujjj]rjXbiorr}r(jUjjubajjubjX – rr}r(jUjjubjXBBIO pointing at a certificate request in either DER or PEM format.rr}r(jUjNjNjhjjubejjubajjy ubjc )r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXzformat -- Describes the format of the request to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER)j}r(j]j]j]j]j]ujjj]r(j)r}r(jXformatj}r(j]j]jj]j]j]ujjj]rjXformatrr}r(jUjjubajjubjX – rÐrĐ}rŐ(jUjjubjXpDescribes the format of the request to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER)rƐrǐ}rȐ(jUjNjNjhjjubejjubajjy ubejj ubajjubejjubj)rɐ}rʐ(jUj}rː(j]j]j]j]j]ujjj]r̐(j)r͐}rΐ(jXReturnsjjɐjjDjjj}rϐ(j]j]j]j]j]ujKj]rАjXReturnsrѐrҐ}rӐ(jUjj͐ubaubj)rԐ}rՐ(jUj}r֐(j]j]j]j]j]ujjɐj]rאj)rؐ}rِ(jXM2Crypto.X509.Request object.j}rڐ(j]j]j]j]j]ujjԐj]rېjXM2Crypto.X509.Request object.rܐrݐ}rސ(jUjNjNjhjjؐubajjubajjubejjubeubeubeubj?)rߐ}r(jUjjmkjNjjCj}r(j]j]j]j]j]Uentries]r(jFX3load_request_der_string() (in module M2Crypto.X509)jUNtraujNjhj]ubjM)r}r(jUjjmkjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXload_request_der_string(string)jjjX^/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_request_der_stringrjj\j}r(j]rjaj_j`X M2Crypto.X509rr}rbj]j]j]j]rjajeXload_request_der_stringrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.X509.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXload_request_der_stringrr}r(jUjNjNjhjjubaubj)r}r(jXstringjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXstringj}r(jojpj]j]j]j]j]ujjj]r jXstringr r }r (jUjjubajjubaubj)r }r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjujj j]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r (j)r!}r"(jX'Load certificate request from a string.jjjX^/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_request_der_stringjjj}r#(j]j]j]j]j]ujKjhj]r$jX'Load certificate request from a string.r%r&}r'(jUjNjNjhjj!ubaubj)r(}r)(jUjjjNjjj}r*(j]j]j]j]j]ujNjhj]r+(j)r,}r-(jUj}r.(j]j]j]j]j]ujj(j]r/(j)r0}r1(jX Parametersjj,jjjjj}r2(j]j]j]j]j]ujKj]r3jX Parametersr4r5}r6(jUjj0ubaubj)r7}r8(jUj}r9(j]j]j]j]j]ujj,j]r:j)r;}r<(jX@string -- String containing a certificate request in DER format.j}r=(j]j]j]j]j]ujj7j]r>(j)r?}r@(jXstringj}rA(j]j]jj]j]j]ujj;j]rBjXstringrCrD}rE(jUjj?ubajjubjX – rFrG}rH(jUjj;ubjX6String containing a certificate request in DER format.rIrJ}rK(jUjNjNjhjj;ubejjubajjubejjubj)rL}rM(jUj}rN(j]j]j]j]j]ujj(j]rO(j)rP}rQ(jXReturnsjjLjjjjj}rR(j]j]j]j]j]ujKj]rSjXReturnsrTrU}rV(jUjjPubaubj)rW}rX(jUj}rY(j]j]j]j]j]ujjLj]rZj)r[}r\(jXM2Crypto.X509.Request object.j}r](j]j]j]j]j]ujjWj]r^jXM2Crypto.X509.Request object.r_r`}ra(jUjNjNjhjj[ubajjubajjubejjubeubeubeubj?)rb}rc(jUjjmkjNjjCj}rd(j]j]j]j]j]Uentries]re(jFX/load_request_string() (in module M2Crypto.X509)h-UNtrfaujNjhj]ubjM)rg}rh(jUjjmkjNjjPj}ri(jRjSXpyj]j]j]j]j]jTXfunctionrjjVjjujNjhj]rk(jX)rl}rm(jX%load_request_string(string, format=1)jjgjXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_request_stringrnjj\j}ro(j]rph-aj_j`X M2Crypto.X509rqrr}rsbj]j]j]j]rth-ajeXload_request_stringrujgUjhujNjhj]rv(ju)rw}rx(jXM2Crypto.X509.jjljjnjjxj}ry(jojpj]j]j]j]j]ujNjhj]rzjXM2Crypto.X509.r{r|}r}(jUjNjNjhjjwubaubj~)r~}r(jjujjljjnjjj}r(jojpj]j]j]j]j]ujNjhj]rjXload_request_stringrr}r(jUjNjNjhjj~ubaubj)r}r(jXstring, format=1jjljjnjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXstringj}r(jojpj]j]j]j]j]ujjj]rjXstringrr}r(jUjjubajjubj)r}r(jXformat=1j}r(jojpj]j]j]j]j]ujjj]rjXformat=1rr}r(jUjjubajjubeubj)r}r(jUjjljNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjuujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjgjjnjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX'Load certificate request from a string.jjjXZ/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.load_request_stringjjj}r(j]j]j]j]j]ujKjhj]rjX'Load certificate request from a string.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jX Parametersjjjjnjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r‘(jUj}rÑ(j]j]j]j]j]ujjj]rđj^ )rő}rƑ(jUj}rǑ(j]j]j]j]j]ujjj]rȑ(jc )rɑ}rʑ(jUj}rˑ(j]j]j]j]j]ujjőj]ȓj)r͑}rΑ(jXNstring -- String containing a certificate request in either DER or PEM format.j}rϑ(j]j]j]j]j]ujjɑj]rБ(j)rё}rґ(jXstringj}rӑ(j]j]jj]j]j]ujj͑j]rԑjXstringrՑr֑}rב(jUjjёubajjubjX – rؑrّ}rڑ(jUjj͑ubjXDString containing a certificate request in either DER or PEM format.rۑrܑ}rݑ(jUjNjNjhjj͑ubejjubajjy ubjc )rޑ}rߑ(jUj}r(j]j]j]j]j]ujjőj]rj)r}r(jXzformat -- Describes the format of the request to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER)j}r(j]j]j]j]j]ujjޑj]r(j)r}r(jXformatj}r(j]j]jj]j]j]ujjj]rjXformatrr}r(jUjjubajjubjX – rr}r(jUjjubjXpDescribes the format of the request to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER)rr}r(jUjNjNjhjjubejjubajjy ubejj ubajjubejjubj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjnjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj)r}r(jXM2Crypto.X509.Request object.j}r(j]j]j]j]j]ujjj]rjXM2Crypto.X509.Request object.rr}r(jUjNjNjhjjubajjubajjubejjubeubeubeubj?)r }r (jUjjmkjXT/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.new_extensionr jjCj}r (j]j]j]j]j]Uentries]r (jFX)new_extension() (in module M2Crypto.X509)j$UNtraujNjhj]ubjM)r}r(jUjjmkjj jjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jX1new_extension(name, value, critical=0, _pyfree=1)jjjXT/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.new_extensionrjj\j}r(j]rj$aj_j`X M2Crypto.X509rr}rbj]j]j]j]rj$ajeX new_extensionrjgUjhujNjhj]r(ju)r}r (jXM2Crypto.X509.jjjjjjxj}r!(jojpj]j]j]j]j]ujNjhj]r"jXM2Crypto.X509.r#r$}r%(jUjNjNjhjjubaubj~)r&}r'(jjjjjjjjj}r((jojpj]j]j]j]j]ujNjhj]r)jX new_extensionr*r+}r,(jUjNjNjhjj&ubaubj)r-}r.(jX"name, value, critical=0, _pyfree=1jjjjjjj}r/(jojpj]j]j]j]j]ujNjhj]r0(j)r1}r2(jXnamej}r3(jojpj]j]j]j]j]ujj-j]r4jXnamer5r6}r7(jUjj1ubajjubj)r8}r9(jXvaluej}r:(jojpj]j]j]j]j]ujj-j]r;jXvaluer<r=}r>(jUjj8ubajjubj)r?}r@(jX critical=0j}rA(jojpj]j]j]j]j]ujj-j]rBjX critical=0rCrD}rE(jUjj?ubajjubj)rF}rG(jX _pyfree=1j}rH(jojpj]j]j]j]j]ujj-j]rIjX _pyfree=1rJrK}rL(jUjjFubajjubeubj)rM}rN(jUjjjNjjj}rO(Uexprjj]j]j]j]j]ujNjhj]rPj!)rQ}rR(jUj}rS(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509UrefidjujjMj]rTj)rU}rV(jUj}rW(j]j]rXjaj]j]j]ujjQj]rYjX[source]rZr[}r\(jUjjUubajjubajj%ubaubeubj)r]}r^(jUjjjjjjj}r_(j]j]j]j]j]ujNjhj]r`j)ra}rb(jX#Create new X509_Extension instance.jj]jj jjj}rc(j]j]j]j]j]ujKjhj]rdjX#Create new X509_Extension instance.rerf}rg(jUjNjNjhjjaubaubaubeubj?)rh}ri(jUjjmkjNjjCj}rj(j]j]j]j]j]Uentries]rk(jFX.new_stack_from_der() (in module M2Crypto.X509)hUNtrlaujNjhj]ubjM)rm}rn(jUjjmkjNjjPj}ro(jRjSXpyj]j]j]j]j]jTXfunctionrpjVjpujNjhj]rq(jX)rr}rs(jXnew_stack_from_der(der_string)jjmjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.new_stack_from_derrtjj\j}ru(j]rvhaj_j`X M2Crypto.X509rwrx}rybj]j]j]j]rzhajeXnew_stack_from_derr{jgUjhujNjhj]r|(ju)r}}r~(jXM2Crypto.X509.jjrjjtjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr}r(jUjNjNjhjj}ubaubj~)r}r(jj{jjrjjtjjj}r(jojpj]j]j]j]j]ujNjhj]rjXnew_stack_from_derrr}r(jUjNjNjhjjubaubj)r}r(jX der_stringjjrjjtjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jX der_stringj}r(jojpj]j]j]j]j]ujjj]rjX der_stringrr}r(jUjjubajjubaubj)r}r(jUjjrjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidj{ujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjmjjtjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX(Create a new X509_Stack from DER string.jjjXY/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.new_stack_from_derjjj}r(j]j]j]j]j]ujKjhj]rjX(Create a new X509_Stack from DER string.rr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jUj}r(j]j]j]j]j]ujjj]r(j)r}r(jXReturnsjjjjtjjj}r(j]j]j]j]j]ujKj]rjXReturnsrr}r(jUjjubaubj)r}r(jUj}r’(j]j]j]j]j]ujjj]rÒj)rĒ}rŒ(jX X509_Stackj}rƒ(j]j]j]j]j]ujjj]rǒjX X509_StackrȒrɒ}rʒ(jUjNjNjhjjĒubajjubajjubejjubaubeubeubj?)r˒}r̒(jUjjmkjNjjCj}r͒(j]j]j]j]j]Uentries]rΒ(jFX1x509_store_default_cb() (in module M2Crypto.X509)hUNtrϒaujNjhj]ubjM)rВ}rђ(jUjjmkjNjjPj}rҒ(jRjSXpyj]j]j]j]j]jTXfunctionrӒjVjӒujNjhj]rԒ(jX)rՒ}r֒(jXx509_store_default_cb(ok, ctx)jjВjX\/home/matej/Build/m2crypto/M2Crypto/X509.py:docstring of M2Crypto.X509.x509_store_default_cbrגjj\j}rؒ(j]rْhaj_j`X M2Crypto.X509rڒrے}rܒbj]j]j]j]rݒhajeXx509_store_default_cbrޒjgUjhujNjhj]rߒ(ju)r}r(jXM2Crypto.X509.jjՒjjגjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.X509.rr}r(jUjNjNjhjjubaubj~)r}r(jjޒjjՒjjגjjj}r(jojpj]j]j]j]j]ujNjhj]rjXx509_store_default_cbrr}r(jUjNjNjhjjubaubj)r}r(jXok, ctxjjՒjjגjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXokj}r(jojpj]j]j]j]j]ujjj]rjXokrr}r(jUjjubajjubj)r}r(jXctxj}r(jojpj]j]j]j]j]ujjj]rjXctxrr}r(jUjjubajjubeubj)r}r(jUjjՒjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/X509Urefidjޒujjj]rj)r}r (jUj}r (j]j]r jaj]j]j]ujjj]r jX[source]r r}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjВjjגjjj}r(j]j]j]j]j]ujNjhj]ubeubeubj)r}r(jUjjjjjjj}r(j]j]j]j]r(Xmodule-M2Crypto.callbackrUcallback-modulerej]rjaujKjhj]r(j )r}r(jX:mod:`callback` Modulerjjjjjj j}r(j]j]j]j]j]ujKjhj]r(j!)r }r!(jX:mod:`callback`r"jjjjjj%j}r#(UreftypeXmodj'j(XcallbackU refdomainXpyr$j]j]U refexplicitj]j]j]j*j+j,Nj-j}ujKj]r%j0)r&}r'(jj"j}r((j]j]r)(j5j$Xpy-modr*ej]j]j]ujj j]r+jXcallbackr,r-}r.(jUjj&ubajj;ubaubjX Moduler/r0}r1(jUjNjNjhjjubeubj?)r2}r3(jUjjjXN/home/matej/Build/m2crypto/M2Crypto/callback.py:docstring of M2Crypto.callbackr4jjCj}r5(j]j]j]j]j]Uentries]r6(jFXM2Crypto.callback (module)Xmodule-M2Crypto.callbackUNtr7aujKjhj]ubeubj)r8}r9(jUjjjjjjj}r:(j]j]j]j]r;(Xmodule-M2Crypto.ftpslibr<Uftpslib-moduler=ej]r>jEaujKjhj]r?(j )r@}rA(jX:mod:`ftpslib` ModulerBjj8jjjj j}rC(j]j]j]j]j]ujKjhj]rD(j!)rE}rF(jX:mod:`ftpslib`rGjj@jjjj%j}rH(UreftypeXmodj'j(XftpslibU refdomainXpyrIj]j]U refexplicitj]j]j]j*j+j,Nj-XM2Crypto.callbackrJujKj]rKj0)rL}rM(jjGj}rN(j]j]rO(j5jIXpy-modrPej]j]j]ujjEj]rQjXftpslibrRrS}rT(jUjjLubajj;ubaubjX ModulerUrV}rW(jUjNjNjhjj@ubeubj?)rX}rY(jUjj8jXT/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLSrZjjCj}r[(j]j]j]j]j]Uentries]r\(jFXM2Crypto.ftpslib (module)Xmodule-M2Crypto.ftpslibUNtr]aujKjhj]ubj?)r^}r_(jUjj8jNjjCj}r`(j]j]j]j]j]Uentries]ra(jFX#FTP_TLS (class in M2Crypto.ftpslib)hIUNtrbaujNjhj]ubjM)rc}rd(jUjj8jNjjPj}re(jRjSXpyj]j]j]j]j]jTXclassrfjVjfujNjhj]rg(jX)rh}ri(jX FTP_TLS(host=None, ssl_ctx=None)jjcjXT/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLSrjjj\j}rk(j]rlhIaj_j`XM2Crypto.ftpslibrmrn}robj]j]j]j]rphIajeXFTP_TLSrqjgUjhujNjhj]rr(jj)rs}rt(jXclass jjhjjjjjmj}ru(jojpj]j]j]j]j]ujNjhj]rvjXclass rwrx}ry(jUjNjNjhjjsubaubju)rz}r{(jXM2Crypto.ftpslib.jjhjjjjjxj}r|(jojpj]j]j]j]j]ujNjhj]r}jXM2Crypto.ftpslib.r~r}r(jUjNjNjhjjzubaubj~)r}r(jjqjjhjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXFTP_TLSrr}r(jUjNjNjhjjubaubj)r}r(jXhost=None, ssl_ctx=Nonejjhjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jX host=Nonej}r(jojpj]j]j]j]j]ujjj]rjX host=Nonerr}r(jUjjubajjubj)r}r(jX ssl_ctx=Nonej}r(jojpj]j]j]j]j]ujjj]rjX ssl_ctx=Nonerr}r(jUjjubajjubeubj)r}r(jUjjhjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ftpslibUrefidjqujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjcjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jXBases: :class:`ftplib.FTP`jjjXT/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLSjjj}r(j]j]j]j]j]ujKjhj]r(jXBases: rr}r(jUjNjNjhjjubj!)r}r(jX:class:`ftplib.FTP`rjjjjjj%j}r(UreftypeXclassj'j(X ftplib.FTPU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,jqj-XM2Crypto.ftpslibrujKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-classrej]j]j]ujjj]rjX ftplib.FTPr“rÓ}rē(jUjjubajj;ubaubeubj)rœ}rƓ(jX+Python OO interface to client-side FTP/TLS.jjjXT/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLSjjj}rǓ(j]j]j]j]j]ujKjhj]rȓjX+Python OO interface to client-side FTP/TLS.rɓrʓ}r˓(jUjNjNjhjjœubaubj?)r̓}r͓(jUjjjX]/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLS.auth_sslrΓjjCj}rϓ(j]j]j]j]j]Uentries]rГ(jFX,auth_ssl() (M2Crypto.ftpslib.FTP_TLS method)hUNtrѓaujNjhj]ubjM)rғ}rӓ(jUjjjjΓjjPj}rԓ(jRjSXpyj]j]j]j]j]jTXmethodrՓjVjՓujNjhj]r֓(jX)rד}rؓ(jXFTP_TLS.auth_ssl()jjғjX]/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLS.auth_sslrٓjj\j}rړ(j]rۓhaj_j`XM2Crypto.ftpslibrܓrݓ}rޓbj]j]j]j]rߓhajeXFTP_TLS.auth_sslrjgjqjhujNjhj]r(j~)r}r(jXauth_ssljjדjjٓjjj}r(jojpj]j]j]j]j]ujNjhj]rjXauth_sslrr}r(jUjNjNjhjjubaubj)r}r(jUjjדjjٓjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjדjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ftpslibUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjғjjٓjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jX;Secure the control connection per AUTH SSL, aka AUTH TLS-P.jjjjΓjjj}r(j]j]j]j]j]ujKjhj]rjX;Secure the control connection per AUTH SSL, aka AUTH TLS-P.rr}r(jUjNjNjhjjubaubaubeubj?)r}r(jUjjjX]/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLS.auth_tlsr jjCj}r (j]j]j]j]j]Uentries]r (jFX,auth_tls() (M2Crypto.ftpslib.FTP_TLS method)jGUNtr aujNjhj]ubjM)r }r(jUjjjj jjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXFTP_TLS.auth_tls()jj jX]/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLS.auth_tlsrjj\j}r(j]rjGaj_j`XM2Crypto.ftpslibrr}rbj]j]j]j]rjGajeXFTP_TLS.auth_tlsrjgjqjhujNjhj]r(j~)r}r(jXauth_tlsjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r jXauth_tlsr!r"}r#(jUjNjNjhjjubaubj)r$}r%(jUjjjjjjj}r&(jojpj]j]j]j]j]ujNjhj]ubj)r'}r((jUjjjNjjj}r)(Uexprjj]j]j]j]j]ujNjhj]r*j!)r+}r,(jUj}r-(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ftpslibUrefidjujj'j]r.j)r/}r0(jUj}r1(j]j]r2jaj]j]j]ujj+j]r3jX[source]r4r5}r6(jUjj/ubajjubajj%ubaubeubj)r7}r8(jUjj jjjjj}r9(j]j]j]j]j]ujNjhj]r:j)r;}r<(jX;Secure the control connection per AUTH TLS, aka AUTH TLS-C.jj7jj jjj}r=(j]j]j]j]j]ujKjhj]r>jX;Secure the control connection per AUTH TLS, aka AUTH TLS-C.r?r@}rA(jUjNjNjhjj;ubaubaubeubj?)rB}rC(jUjjjXa/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLS.ntransfercmdrDjjCj}rE(j]j]j]j]j]Uentries]rF(jFX0ntransfercmd() (M2Crypto.ftpslib.FTP_TLS method)hUNtrGaujNjhj]ubjM)rH}rI(jUjjjjDjjPj}rJ(jRjSXpyj]j]j]j]j]jTXmethodrKjVjKujNjhj]rL(jX)rM}rN(jX$FTP_TLS.ntransfercmd(cmd, rest=None)jjHjXa/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLS.ntransfercmdrOjj\j}rP(j]rQhaj_j`XM2Crypto.ftpslibrRrS}rTbj]j]j]j]rUhajeXFTP_TLS.ntransfercmdrVjgjqjhujNjhj]rW(j~)rX}rY(jX ntransfercmdjjMjjOjjj}rZ(jojpj]j]j]j]j]ujNjhj]r[jX ntransfercmdr\r]}r^(jUjNjNjhjjXubaubj)r_}r`(jXcmd, rest=NonejjMjjOjjj}ra(jojpj]j]j]j]j]ujNjhj]rb(j)rc}rd(jXcmdj}re(jojpj]j]j]j]j]ujj_j]rfjXcmdrgrh}ri(jUjjcubajjubj)rj}rk(jX rest=Nonej}rl(jojpj]j]j]j]j]ujj_j]rmjX rest=Nonernro}rp(jUjjjubajjubeubj)rq}rr(jUjjMjNjjj}rs(Uexprjj]j]j]j]j]ujNjhj]rtj!)ru}rv(jUj}rw(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ftpslibUrefidjVujjqj]rxj)ry}rz(jUj}r{(j]j]r|jaj]j]j]ujjuj]r}jX[source]r~r}r(jUjjyubajjubajj%ubaubeubj)r}r(jUjjHjjOjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jXInitiate a data transfer.jjjjDjjj}r(j]j]j]j]j]ujKjhj]rjXInitiate a data transfer.rr}r(jUjNjNjhjjubaubaubeubj?)r}r(jUjjjX[/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLS.prot_crjjCj}r(j]j]j]j]j]Uentries]r(jFX*prot_c() (M2Crypto.ftpslib.FTP_TLS method)hRUNtraujNjhj]ubjM)r}r(jUjjjjjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXFTP_TLS.prot_c()jjjX[/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLS.prot_crjj\j}r(j]rhRaj_j`XM2Crypto.ftpslibrr}rbj]j]j]j]rhRajeXFTP_TLS.prot_crjgjqjhujNjhj]r(j~)r}r(jXprot_cjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXprot_crr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ftpslibUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jX$Set up data connection in the clear.jjjjjjj}r”(j]j]j]j]j]ujKjhj]rÔjX$Set up data connection in the clear.rĔrŔ}rƔ(jUjNjNjhjjubaubaubeubj?)rǔ}rȔ(jUjjjX[/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLS.prot_prɔjjCj}rʔ(j]j]j]j]j]Uentries]r˔(jFX*prot_p() (M2Crypto.ftpslib.FTP_TLS method)h+UNtr̔aujNjhj]ubjM)r͔}rΔ(jUjjjjɔjjPj}rϔ(jRjSXpyj]j]j]j]j]jTXmethodrДjVjДujNjhj]rє(jX)rҔ}rӔ(jXFTP_TLS.prot_p()jj͔jX[/home/matej/Build/m2crypto/M2Crypto/ftpslib.py:docstring of M2Crypto.ftpslib.FTP_TLS.prot_prԔjj\j}rՔ(j]r֔h+aj_j`XM2Crypto.ftpslibrהrؔ}rٔbj]j]j]j]rڔh+ajeXFTP_TLS.prot_pr۔jgjqjhujNjhj]rܔ(j~)rݔ}rޔ(jXprot_pjjҔjjԔjjj}rߔ(jojpj]j]j]j]j]ujNjhj]rjXprot_prr}r(jUjNjNjhjjݔubaubj)r}r(jUjjҔjjԔjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjҔjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/ftpslibUrefidj۔ujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjj͔jjԔjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jXSet up secure data connection.jjjjɔjjj}r(j]j]j]j]j]ujKjhj]rjXSet up secure data connection.rr}r(jUjNjNjhjjubaubaubeubeubeubeubj)r}r(jUjjjjjjj}r(j]j]j]j]r(Xmodule-M2Crypto.httpslibrUhttpslib-modulerej]rhaujKjhj]r (j )r }r (jX:mod:`httpslib` Moduler jjjjjj j}r (j]j]j]j]j]ujKjhj]r(j!)r}r(jX:mod:`httpslib`rjj jjjj%j}r(UreftypeXmodj'j(XhttpslibU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,Nj-jujKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-modrej]j]j]ujjj]rjXhttpslibrr}r(jUjjubajj;ubaubjX Modulerr}r (jUjNjNjhjj ubeubj?)r!}r"(jUjjjX^/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.HTTPSConnectionr#jjCj}r$(j]j]j]j]j]Uentries]r%(jFXM2Crypto.httpslib (module)Xmodule-M2Crypto.httpslibUNtr&aujKjhj]ubj?)r'}r((jUjjjNjjCj}r)(j]j]j]j]j]Uentries]r*(jFX,HTTPSConnection (class in M2Crypto.httpslib)h.UNtr+aujNjhj]ubjM)r,}r-(jUjjjNjjPj}r.(jRjSXpyj]j]j]j]j]jTXclassr/jVj/ujNjhj]r0(jX)r1}r2(jX4HTTPSConnection(host, port=None, strict=None, **ssl)jj,jX^/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.HTTPSConnectionr3jj\j}r4(j]r5h.aj_j`XM2Crypto.httpslibr6r7}r8bj]j]j]j]r9h.ajeXHTTPSConnectionr:jgUjhujNjhj]r;(jj)r<}r=(jXclass jj1jj3jjmj}r>(jojpj]j]j]j]j]ujNjhj]r?jXclass r@rA}rB(jUjNjNjhjj<ubaubju)rC}rD(jXM2Crypto.httpslib.jj1jj3jjxj}rE(jojpj]j]j]j]j]ujNjhj]rFjXM2Crypto.httpslib.rGrH}rI(jUjNjNjhjjCubaubj~)rJ}rK(jj:jj1jj3jjj}rL(jojpj]j]j]j]j]ujNjhj]rMjXHTTPSConnectionrNrO}rP(jUjNjNjhjjJubaubj)rQ}rR(jX#host, port=None, strict=None, **ssljj1jj3jjj}rS(jojpj]j]j]j]j]ujNjhj]rT(j)rU}rV(jXhostj}rW(jojpj]j]j]j]j]ujjQj]rXjXhostrYrZ}r[(jUjjUubajjubj)r\}r](jX port=Nonej}r^(jojpj]j]j]j]j]ujjQj]r_jX port=Noner`ra}rb(jUjj\ubajjubj)rc}rd(jX strict=Nonej}re(jojpj]j]j]j]j]ujjQj]rfjX strict=Nonergrh}ri(jUjjcubajjubj)rj}rk(jX**sslj}rl(jojpj]j]j]j]j]ujjQj]rmjX**sslrnro}rp(jUjjjubajjubeubj)rq}rr(jUjj1jNjjj}rs(Uexprjj]j]j]j]j]ujNjhj]rtj!)ru}rv(jUj}rw(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/httpslibUrefidj:ujjqj]rxj)ry}rz(jUj}r{(j]j]r|jaj]j]j]ujjuj]r}jX[source]r~r}r(jUjjyubajjubajj%ubaubeubj)r}r(jUjj,jj3jjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX&Bases: :class:`httplib.HTTPConnection`jjjX^/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.HTTPSConnectionjjj}r(j]j]j]j]j]ujKjhj]r(jXBases: rr}r(jUjNjNjhjjubj!)r}r(jX:class:`httplib.HTTPConnection`rjjjjjj%j}r(UreftypeXclassj'j(Xhttplib.HTTPConnectionU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,j:j-XM2Crypto.httpslibrujKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-classrej]j]j]ujjj]rjXhttplib.HTTPConnectionrr}r(jUjjubajj;ubaubeubj)r}r(jX7This class allows communication via SSL using M2Crypto.jjjX^/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.HTTPSConnectionjjj}r(j]j]j]j]j]ujKjhj]rjX7This class allows communication via SSL using M2Crypto.rr}r(jUjNjNjhjjubaubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX2close() (M2Crypto.httpslib.HTTPSConnection method)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXHTTPSConnection.close()jjjXd/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.HTTPSConnection.closerjj\j}r(j]rjaj_j`XM2Crypto.httpslibrr}rbj]j]j]j]rjajeXHTTPSConnection.closerjgj:jhujNjhj]r(j~)r}r(jXclosejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXcloserr}r(jUjNjNjhjjubaubj)r}r(jUjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r•}rÕ(jUjjjNjjj}rĕ(Uexprjj]j]j]j]j]ujNjhj]rŕj!)rƕ}rǕ(jUj}rȕ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/httpslibUrefidjujj•j]rɕj)rʕ}r˕(jUj}r̕(j]j]r͕jaj]j]j]ujjƕj]rΕjX[source]rϕrЕ}rѕ(jUjjʕubajjubajj%ubaubeubj)rҕ}rӕ(jUjjjjjjj}rԕ(j]j]j]j]j]ujNjhj]ubeubj?)rՕ}r֕(jUjjjNjjCj}rו(j]j]j]j]j]Uentries]rؕ(jFX4connect() (M2Crypto.httpslib.HTTPSConnection method)hUNtrٕaujNjhj]ubjM)rڕ}rە(jUjjjNjjPj}rܕ(jRjSXpyj]j]j]j]j]jTXmethodrݕjVjݕujNjhj]rޕ(jX)rߕ}r(jXHTTPSConnection.connect()jjڕjXf/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.HTTPSConnection.connectrjj\j}r(j]rhaj_j`XM2Crypto.httpslibrr}rbj]j]j]j]rhajeXHTTPSConnection.connectrjgj:jhujNjhj]r(j~)r}r(jXconnectjjߕjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXconnectrr}r(jUjNjNjhjjubaubj)r}r(jUjjߕjjjjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjߕjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/httpslibUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjڕjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r (j]j]j]j]j]Uentries]r (jFX:default_port (M2Crypto.httpslib.HTTPSConnection attribute)jUNtr aujNjhj]ubjM)r }r (jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTX attributerjVjujNjhj]r(jX)r}r(jXHTTPSConnection.default_portjj jXk/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.HTTPSConnection.default_portrjj\j}r(j]rjaj_j`XM2Crypto.httpslibrr}rbj]j]j]j]rjajeXHTTPSConnection.default_portjgj:jhujNjhj]r(j~)r}r(jX default_portjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX default_portrr }r!(jUjNjNjhjjubaubjj)r"}r#(jX = 443jjjjjjmj}r$(jojpj]j]j]j]j]ujNjhj]r%jX = 443r&r'}r((jUjNjNjhjj"ubaubeubj)r)}r*(jUjj jjjjj}r+(j]j]j]j]j]ujNjhj]ubeubj?)r,}r-(jUjjjNjjCj}r.(j]j]j]j]j]Uentries]r/(jFX8get_session() (M2Crypto.httpslib.HTTPSConnection method)j2UNtr0aujNjhj]ubjM)r1}r2(jUjjjNjjPj}r3(jRjSXpyj]j]j]j]j]jTXmethodr4jVj4ujNjhj]r5(jX)r6}r7(jXHTTPSConnection.get_session()jj1jXj/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.HTTPSConnection.get_sessionr8jj\j}r9(j]r:j2aj_j`XM2Crypto.httpslibr;r<}r=bj]j]j]j]r>j2ajeXHTTPSConnection.get_sessionr?jgj:jhujNjhj]r@(j~)rA}rB(jX get_sessionjj6jj8jjj}rC(jojpj]j]j]j]j]ujNjhj]rDjX get_sessionrErF}rG(jUjNjNjhjjAubaubj)rH}rI(jUjj6jj8jjj}rJ(jojpj]j]j]j]j]ujNjhj]ubj)rK}rL(jUjj6jNjjj}rM(Uexprjj]j]j]j]j]ujNjhj]rNj!)rO}rP(jUj}rQ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/httpslibUrefidj?ujjKj]rRj)rS}rT(jUj}rU(j]j]rVjaj]j]j]ujjOj]rWjX[source]rXrY}rZ(jUjjSubajjubajj%ubaubeubj)r[}r\(jUjj1jj8jjj}r](j]j]j]j]j]ujNjhj]ubeubj?)r^}r_(jUjjjNjjCj}r`(j]j]j]j]j]Uentries]ra(jFX8set_session() (M2Crypto.httpslib.HTTPSConnection method)jLUNtrbaujNjhj]ubjM)rc}rd(jUjjjNjjPj}re(jRjSXpyj]j]j]j]j]jTXmethodrfjVjfujNjhj]rg(jX)rh}ri(jX$HTTPSConnection.set_session(session)jjcjXj/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.HTTPSConnection.set_sessionrjjj\j}rk(j]rljLaj_j`XM2Crypto.httpslibrmrn}robj]j]j]j]rpjLajeXHTTPSConnection.set_sessionrqjgj:jhujNjhj]rr(j~)rs}rt(jX set_sessionjjhjjjjjj}ru(jojpj]j]j]j]j]ujNjhj]rvjX set_sessionrwrx}ry(jUjNjNjhjjsubaubj)rz}r{(jXsessionjjhjjjjjj}r|(jojpj]j]j]j]j]ujNjhj]r}j)r~}r(jXsessionj}r(jojpj]j]j]j]j]ujjzj]rjXsessionrr}r(jUjj~ubajjubaubj)r}r(jUjjhjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/httpslibUrefidjqujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjcjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX1ProxyHTTPSConnection (class in M2Crypto.httpslib)j:UNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jXWProxyHTTPSConnection(host, port=None, strict=None, username=None, password=None, **ssl)jjjXc/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.ProxyHTTPSConnectionrjj\j}r(j]rj:aj_j`XM2Crypto.httpslibrr}rbj]j]j]j]rj:ajeXProxyHTTPSConnectionrjgUjhujNjhj]r(jj)r}r(jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jXM2Crypto.httpslib.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.httpslib.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXProxyHTTPSConnectionrr}r(jUjNjNjhjjubaubj)r–}rÖ(jXAhost, port=None, strict=None, username=None, password=None, **ssljjjjjjj}rĖ(jojpj]j]j]j]j]ujNjhj]rŖ(j)rƖ}rǖ(jXhostj}rȖ(jojpj]j]j]j]j]ujj–j]rɖjXhostrʖr˖}r̖(jUjjƖubajjubj)r͖}rΖ(jX port=Nonej}rϖ(jojpj]j]j]j]j]ujj–j]rЖjX port=NonerіrҖ}rӖ(jUjj͖ubajjubj)rԖ}rՖ(jX strict=Nonej}r֖(jojpj]j]j]j]j]ujj–j]rזjX strict=Nonerؖrٖ}rږ(jUjjԖubajjubj)rۖ}rܖ(jX username=Nonej}rݖ(jojpj]j]j]j]j]ujj–j]rޖjX username=Nonerߖr}r(jUjjۖubajjubj)r}r(jX password=Nonej}r(jojpj]j]j]j]j]ujj–j]rjX password=Nonerr}r(jUjjubajjubj)r}r(jX**sslj}r(jojpj]j]j]j]j]ujj–j]rjX**sslrr}r(jUjjubajjubeubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/httpslibUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX1Bases: :class:`M2Crypto.httpslib.HTTPSConnection`jjjXc/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.ProxyHTTPSConnectionjjj}r(j]j]j]j]j]ujKjhj]r(jXBases: rr }r (jUjNjNjhjjubj!)r }r (jX*:class:`M2Crypto.httpslib.HTTPSConnection`r jjjjjj%j}r(UreftypeXclassj'j(X!M2Crypto.httpslib.HTTPSConnectionU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,jj-jujK%j]rj0)r}r(jj j}r(j]j]r(j5jXpy-classrej]j]j]ujj j]rjX!M2Crypto.httpslib.HTTPSConnectionrr}r(jUjjubajj;ubaubeubj)r}r(jX>An HTTPS Connection that uses a proxy and the CONNECT request.jjjXc/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.ProxyHTTPSConnectionrjjj}r(j]j]j]j]j]ujKjhj]rjX>An HTTPS Connection that uses a proxy and the CONNECT request.rr }r!(jUjNjNjhjjubaubj)r"}r#(jXWhen the connection is initiated, CONNECT is first sent to the proxy (along with authorization headers, if supplied). If successful, an SSL connection will be established over the socket through the proxy and to the target host.jjjjjjj}r$(j]j]j]j]j]ujKjhj]r%jXWhen the connection is initiated, CONNECT is first sent to the proxy (along with authorization headers, if supplied). If successful, an SSL connection will be established over the socket through the proxy and to the target host.r&r'}r((jUjNjNjhjj"ubaubj)r)}r*(jXXFinally, the actual request is sent over the SSL connection tunneling through the proxy.jjjjjjj}r+(j]j]j]j]j]ujKjhj]r,jXXFinally, the actual request is sent over the SSL connection tunneling through the proxy.r-r.}r/(jUjNjNjhjj)ubaubj?)r0}r1(jUjjjNjjCj}r2(j]j]j]j]j]Uentries]r3(jFX9connect() (M2Crypto.httpslib.ProxyHTTPSConnection method)hiUNtr4aujNjhj]ubjM)r5}r6(jUjjjNjjPj}r7(jRjSXpyj]j]j]j]j]jTXmethodr8jVj8ujNjhj]r9(jX)r:}r;(jXProxyHTTPSConnection.connect()jj5jXk/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.ProxyHTTPSConnection.connectr<jj\j}r=(j]r>hiaj_j`XM2Crypto.httpslibr?r@}rAbj]j]j]j]rBhiajeXProxyHTTPSConnection.connectrCjgjjhujNjhj]rD(j~)rE}rF(jXconnectjj:jj<jjj}rG(jojpj]j]j]j]j]ujNjhj]rHjXconnectrIrJ}rK(jUjNjNjhjjEubaubj)rL}rM(jUjj:jj<jjj}rN(jojpj]j]j]j]j]ujNjhj]ubj)rO}rP(jUjj:jNjjj}rQ(Uexprjj]j]j]j]j]ujNjhj]rRj!)rS}rT(jUj}rU(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/httpslibUrefidjCujjOj]rVj)rW}rX(jUj}rY(j]j]rZjaj]j]j]ujjSj]r[jX[source]r\r]}r^(jUjjWubajjubajj%ubaubeubj)r_}r`(jUjj5jj<jjj}ra(j]j]j]j]j]ujNjhj]ubeubj?)rb}rc(jUjjjNjjCj}rd(j]j]j]j]j]Uentries]re(jFX<endheaders() (M2Crypto.httpslib.ProxyHTTPSConnection method)h3UNtrfaujNjhj]ubjM)rg}rh(jUjjjNjjPj}ri(jRjSXpyj]j]j]j]j]jTXmethodrjjVjjujNjhj]rk(jX)rl}rm(jX0ProxyHTTPSConnection.endheaders(*args, **kwargs)jjgjXn/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.ProxyHTTPSConnection.endheadersrnjj\j}ro(j]rph3aj_j`XM2Crypto.httpslibrqrr}rsbj]j]j]j]rth3ajeXProxyHTTPSConnection.endheadersrujgjjhujNjhj]rv(j~)rw}rx(jX endheadersjjljjnjjj}ry(jojpj]j]j]j]j]ujNjhj]rzjX endheadersr{r|}r}(jUjNjNjhjjwubaubj)r~}r(jX*args, **kwargsjjljjnjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jX*argsj}r(jojpj]j]j]j]j]ujj~j]rjX*argsrr}r(jUjjubajjubj)r}r(jX**kwargsj}r(jojpj]j]j]j]j]ujj~j]rjX**kwargsrr}r(jUjjubajjubeubj)r}r(jUjjljNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/httpslibUrefidjuujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjgjjnjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX;putheader() (M2Crypto.httpslib.ProxyHTTPSConnection method)hzUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX-ProxyHTTPSConnection.putheader(header, value)jjjXm/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.ProxyHTTPSConnection.putheaderrjj\j}r(j]rhzaj_j`XM2Crypto.httpslibrr}rbj]j]j]j]rhzajeXProxyHTTPSConnection.putheaderrjgjjhujNjhj]r(j~)r}r(jX putheaderjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX putheaderrr}r(jUjNjNjhjjubaubj)r}r(jX header, valuejjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r—(j)r×}rė(jXheaderj}rŗ(jojpj]j]j]j]j]ujjj]rƗjXheaderrǗrȗ}rɗ(jUjj×ubajjubj)rʗ}r˗(jXvaluej}r̗(jojpj]j]j]j]j]ujjj]r͗jXvaluerΗrϗ}rЗ(jUjjʗubajjubeubj)rї}rҗ(jUjjjNjjj}rӗ(Uexprjj]j]j]j]j]ujNjhj]rԗj!)r՗}r֗(jUj}rח(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/httpslibUrefidjujjїj]rؗj)rٗ}rڗ(jUj}rۗ(j]j]rܗjaj]j]j]ujj՗j]rݗjX[source]rޗrߗ}r(jUjjٗubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjXn/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.ProxyHTTPSConnection.putrequestrjjCj}r(j]j]j]j]j]Uentries]r(jFX<putrequest() (M2Crypto.httpslib.ProxyHTTPSConnection method)j^UNtraujNjhj]ubjM)r}r(jUjjjjjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXQProxyHTTPSConnection.putrequest(method, url, skip_host=0, skip_accept_encoding=0)jjjXn/home/matej/Build/m2crypto/M2Crypto/httpslib.py:docstring of M2Crypto.httpslib.ProxyHTTPSConnection.putrequestrjj\j}r(j]rj^aj_j`XM2Crypto.httpslibrr}rbj]j]j]j]rj^ajeXProxyHTTPSConnection.putrequestrjgjjhujNjhj]r(j~)r}r(jX putrequestjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX putrequestrr}r(jUjNjNjhjjubaubj)r}r(jX0method, url, skip_host=0, skip_accept_encoding=0jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXmethodj}r(jojpj]j]j]j]j]ujjj]rjXmethodr r }r (jUjjubajjubj)r }r (jXurlj}r(jojpj]j]j]j]j]ujjj]rjXurlrr}r(jUjj ubajjubj)r}r(jX skip_host=0j}r(jojpj]j]j]j]j]ujjj]rjX skip_host=0rr}r(jUjjubajjubj)r}r(jXskip_accept_encoding=0j}r(jojpj]j]j]j]j]ujjj]rjXskip_accept_encoding=0rr}r (jUjjubajjubeubj)r!}r"(jUjjjNjjj}r#(Uexprjj]j]j]j]j]ujNjhj]r$j!)r%}r&(jUj}r'(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/httpslibUrefidjujj!j]r(j)r)}r*(jUj}r+(j]j]r,jaj]j]j]ujj%j]r-jX[source]r.r/}r0(jUjj)ubajjubajj%ubaubeubj)r1}r2(jUjjjjjjj}r3(j]j]j]j]j]ujNjhj]r4j)r5}r6(jX|putrequest is called before connect, so can interpret url and get real host/port to be used to make CONNECT request to proxyjj1jjjjj}r7(j]j]j]j]j]ujKjhj]r8jX|putrequest is called before connect, so can interpret url and get real host/port to be used to make CONNECT request to proxyr9r:}r;(jUjNjNjhjj5ubaubaubeubeubeubeubj)r<}r=(jUjjjjjjj}r>(j]j]j]j]r?(Xmodule-M2Crypto.m2r@U m2-modulerAej]rBjMaujKjhj]rC(j )rD}rE(jX:mod:`m2` ModulerFjj<jjjj j}rG(j]j]j]j]j]ujKjhj]rH(j!)rI}rJ(jX :mod:`m2`rKjjDjjjj%j}rL(UreftypeXmodj'j(Xm2U refdomainXpyrMj]j]U refexplicitj]j]j]j*j+j,Nj-jujKj]rNj0)rO}rP(jjKj}rQ(j]j]rR(j5jMXpy-modrSej]j]j]ujjIj]rTjXm2rUrV}rW(jUjjOubajj;ubaubjX ModulerXrY}rZ(jUjNjNjhjjDubeubj?)r[}r\(jUjj<jXB/home/matej/Build/m2crypto/M2Crypto/m2.py:docstring of M2Crypto.m2r]jjCj}r^(j]j]j]j]j]Uentries]r_(jFXM2Crypto.m2 (module)Xmodule-M2Crypto.m2UNtr`aujKjhj]ubeubj)ra}rb(jUjjjjjjj}rc(j]j]j]j]rd(Xmodule-M2Crypto.m2cryptoreUm2crypto-modulerfej]rgh9aujKjhj]rh(j )ri}rj(jX:mod:`m2crypto` Modulerkjjajjjj j}rl(j]j]j]j]j]ujKjhj]rm(j!)rn}ro(jX:mod:`m2crypto`rpjjijjjj%j}rq(UreftypeXmodj'j(Xm2cryptoU refdomainXpyrrj]j]U refexplicitj]j]j]j*j+j,Nj-X M2Crypto.m2rsujKj]rtj0)ru}rv(jjpj}rw(j]j]rx(j5jrXpy-modryej]j]j]ujjnj]rzjXm2cryptor{r|}r}(jUjjuubajj;ubaubjX Moduler~r}r(jUjNjNjhjjiubeubj?)r}r(jUjjajXN/home/matej/Build/m2crypto/M2Crypto/m2crypto.py:docstring of M2Crypto.m2cryptorjjCj}r(j]j]j]j]j]Uentries]r(jFXM2Crypto.m2crypto (module)Xmodule-M2Crypto.m2cryptoUNtraujKjhj]ubeubj)r}r(jUjjjjjjj}r(j]j]j]j]r(Xmodule-M2Crypto.m2urllibrUm2urllib-modulerej]rjAaujKjhj]r(j )r}r(jX:mod:`m2urllib` Modulerjjjjjj j}r(j]j]j]j]j]ujKjhj]r(j!)r}r(jX:mod:`m2urllib`rjjjjjj%j}r(UreftypeXmodj'j(Xm2urllibU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,Nj-XM2Crypto.m2cryptorujKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-modrej]j]j]ujjj]rjXm2urllibrr}r(jUjjubajj;ubaubjX Modulerr}r(jUjNjNjhjjubeubj?)r}r(jUjjjXY/home/matej/Build/m2crypto/M2Crypto/m2urllib.py:docstring of M2Crypto.m2urllib.open_httpsrjjCj}r(j]j]j]j]j]Uentries]r(jFXM2Crypto.m2urllib (module)Xmodule-M2Crypto.m2urllibUNtraujKjhj]ubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX*open_https() (in module M2Crypto.m2urllib)h]UNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jX2open_https(self, url, data=None, ssl_context=None)jjjXY/home/matej/Build/m2crypto/M2Crypto/m2urllib.py:docstring of M2Crypto.m2urllib.open_httpsrjj\j}r(j]rh]aj_j`XM2Crypto.m2urllibrr}rbj]j]j]j]rh]ajeX open_httpsrjgUjhujNjhj]r(ju)r˜}rØ(jXM2Crypto.m2urllib.jjjjjjxj}rĘ(jojpj]j]j]j]j]ujNjhj]rŘjXM2Crypto.m2urllib.rƘrǘ}rȘ(jUjNjNjhjj˜ubaubj~)rɘ}rʘ(jjjjjjjjj}r˘(jojpj]j]j]j]j]ujNjhj]r̘jX open_httpsr͘rΘ}rϘ(jUjNjNjhjjɘubaubj)rИ}rј(jX&self, url, data=None, ssl_context=Nonejjjjjjj}rҘ(jojpj]j]j]j]j]ujNjhj]rӘ(j)rԘ}r՘(jXselfj}r֘(jojpj]j]j]j]j]ujjИj]rטjXselfrؘr٘}rژ(jUjjԘubajjubj)rۘ}rܘ(jXurlj}rݘ(jojpj]j]j]j]j]ujjИj]rޘjXurlrߘr}r(jUjjۘubajjubj)r}r(jX data=Nonej}r(jojpj]j]j]j]j]ujjИj]rjX data=Nonerr}r(jUjjubajjubj)r}r(jXssl_context=Nonej}r(jojpj]j]j]j]j]ujjИj]rjXssl_context=Nonerr}r(jUjjubajjubeubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/m2urllibUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX!Open URL over the SSL connection.jjjXY/home/matej/Build/m2crypto/M2Crypto/m2urllib.py:docstring of M2Crypto.m2urllib.open_httpsjjj}r(j]j]j]j]j]ujKjhj]rjX!Open URL over the SSL connection.rr }r (jUjNjNjhjjubaubj)r }r (jUjjjNjjj}r (j]j]j]j]j]ujNjhj]r(j)r}r(jUj}r(j]j]j]j]j]ujj j]r(j)r}r(jX Parametersjjjjjjj}r(j]j]j]j]j]ujKj]rjX Parametersrr}r(jUjjubaubj)r}r(jUj}r(j]j]j]j]j]ujjj]rj^ )r}r(jUj}r (j]j]j]j]j]ujjj]r!(jc )r"}r#(jUj}r$(j]j]j]j]j]ujjj]r%j)r&}r'(jXurl -- URL to be openedj}r((j]j]j]j]j]ujj"j]r)(j)r*}r+(jXurlj}r,(j]j]jj]j]j]ujj&j]r-jXurlr.r/}r0(jUjj*ubajjubjX – r1r2}r3(jUjj&ubjXURL to be openedr4r5}r6(jUjNjNjhjj&ubejjubajjy ubjc )r7}r8(jUj}r9(j]j]j]j]j]ujjj]r:j)r;}r<(jX!data -- data for the POST requestj}r=(j]j]j]j]j]ujj7j]r>(j)r?}r@(jXdataj}rA(j]j]jj]j]j]ujj;j]rBjXdatarCrD}rE(jUjj?ubajjubjX – rFrG}rH(jUjj;ubjXdata for the POST requestrIrJ}rK(jUjNjNjhjj;ubejjubajjy ubjc )rL}rM(jUj}rN(j]j]j]j]j]ujjj]rOj)rP}rQ(jX%ssl_context -- SSL.Context to be usedj}rR(j]j]j]j]j]ujjLj]rS(j)rT}rU(jX ssl_contextj}rV(j]j]jj]j]j]ujjPj]rWjX ssl_contextrXrY}rZ(jUjjTubajjubjX – r[r\}r](jUjjPubjXSSL.Context to be usedr^r_}r`(jUjNjNjhjjPubejjubajjy ubejj ubajjubejjubj)ra}rb(jUj}rc(j]j]j]j]j]ujj j]rd(j)re}rf(jXReturnsjjajjjjj}rg(j]j]j]j]j]ujKj]rhjXReturnsrirj}rk(jUjjeubaubj)rl}rm(jUj}rn(j]j]j]j]j]ujjaj]roj)rp}rq(jUj}rr(j]j]j]j]j]ujjlj]jjubajjubejjubeubeubeubeubj)rs}rt(jUjjjjjjj}ru(j]j]j]j]rv(Xmodule-M2Crypto.m2urllib2rwUm2urllib2-modulerxej]ryjaujKjhj]rz(j )r{}r|(jX:mod:`m2urllib2` Moduler}jjsjjjj j}r~(j]j]j]j]j]ujKjhj]r(j!)r}r(jX:mod:`m2urllib2`rjj{jjjj%j}r(UreftypeXmodj'j(X m2urllib2U refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,Nj-XM2Crypto.m2urllibrujKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-modrej]j]j]ujjj]rjX m2urllib2rr}r(jUjjubajj;ubaubjX Modulerr}r(jUjNjNjhjj{ubeubj?)r}r(jUjjsjX]/home/matej/Build/m2crypto/M2Crypto/m2urllib2.py:docstring of M2Crypto.m2urllib2.HTTPSHandlerrjjCj}r(j]j]j]j]j]Uentries]r(jFXM2Crypto.m2urllib2 (module)Xmodule-M2Crypto.m2urllib2UNtraujKjhj]ubj?)r}r(jUjjsjNjjCj}r(j]j]j]j]j]Uentries]r(jFX*HTTPSHandler (class in M2Crypto.m2urllib2)hUNtraujNjhj]ubjM)r}r(jUjjsjNjjPj}r(jRjSXpyj]j]j]j]j]jTXclassrjVjujNjhj]r(jX)r}r(jXHTTPSHandler(ssl_context=None)rjjjX]/home/matej/Build/m2crypto/M2Crypto/m2urllib2.py:docstring of M2Crypto.m2urllib2.HTTPSHandlerrjj\j}r(j]rhaj_j`XM2Crypto.m2urllib2rr}rbj]j]j]j]rhajeX HTTPSHandlerrjgUjhujNjhj]r(jj)r}r(jXclass jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXclass rr}r(jUjNjNjhjjubaubju)r}r(jXM2Crypto.m2urllib2.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.m2urllib2.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX HTTPSHandlerrr™}rÙ(jUjNjNjhjjubaubj)rę}rř(jXssl_context=Nonejjjjjjj}rƙ(jojpj]j]j]j]j]ujNjhj]rǙj)rș}rə(jXssl_context=Nonej}rʙ(jojpj]j]j]j]j]ujjęj]r˙jXssl_context=Noner̙r͙}rΙ(jUjjșubajjubaubj)rϙ}rЙ(jUjjjNjjj}rљ(Uexprjj]j]j]j]j]ujNjhj]rҙj!)rә}rԙ(jUj}rՙ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/m2urllib2Urefidjujjϙj]r֙j)rי}rؙ(jUj}rٙ(j]j]rڙjaj]j]j]ujjәj]rۙjX[source]rܙrݙ}rޙ(jUjjיubajjubajj%ubaubeubj)rߙ}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX+Bases: :class:`urllib2.AbstractHTTPHandler`rjjߙjX]/home/matej/Build/m2crypto/M2Crypto/m2urllib2.py:docstring of M2Crypto.m2urllib2.HTTPSHandlerrjjj}r(j]j]j]j]j]ujKjhj]r(jXBases: rr}r(jUjNjNjhjjubj!)r}r(jX$:class:`urllib2.AbstractHTTPHandler`rjjjjjj%j}r(UreftypeXclassj'j(Xurllib2.AbstractHTTPHandlerU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,jj-XM2Crypto.m2urllib2rujKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-classrej]j]j]ujjj]rjXurllib2.AbstractHTTPHandlerrr}r(jUjjubajj;ubaubeubj?)r}r(jUjjߙjXh/home/matej/Build/m2crypto/M2Crypto/m2urllib2.py:docstring of M2Crypto.m2urllib2.HTTPSHandler.https_openrjjCj}r(j]j]j]j]j]Uentries]r(jFX5https_open() (M2Crypto.m2urllib2.HTTPSHandler method)hUNtraujNjhj]ubjM)r}r(jUjjߙjjjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jXHTTPSHandler.https_open(req)r jjjXh/home/matej/Build/m2crypto/M2Crypto/m2urllib2.py:docstring of M2Crypto.m2urllib2.HTTPSHandler.https_openr jj\j}r (j]r haj_j`XM2Crypto.m2urllib2r r}rbj]j]j]j]rhajeXHTTPSHandler.https_openrjgjjhujNjhj]r(j~)r}r(jX https_openjjjj jjj}r(jojpj]j]j]j]j]ujNjhj]rjX https_openrr}r(jUjNjNjhjjubaubj)r}r(jXreqjjjj jjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXreqj}r (jojpj]j]j]j]j]ujjj]r!jXreqr"r#}r$(jUjjubajjubaubj)r%}r&(jUjjjNjjj}r'(Uexprjj]j]j]j]j]ujNjhj]r(j!)r)}r*(jUj}r+(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/m2urllib2Urefidjujj%j]r,j)r-}r.(jUj}r/(j]j]r0jaj]j]j]ujj)j]r1jX[source]r2r3}r4(jUjj-ubajjubajj%ubaubeubj)r5}r6(jUjjjj jjj}r7(j]j]j]j]j]ujNjhj]r8(j)r9}r:(jX>Return an addinfourl object for the request, using http_class.r;jj5jjjjj}r<(j]j]j]j]j]ujKjhj]r=jX>Return an addinfourl object for the request, using http_class.r>r?}r@(jUjNjNjhjj9ubaubj)rA}rB(jXhttp_class must implement the HTTPConnection API from httplib. The addinfourl return value is a file-like object. It also has methods and attributes including:jj5jjjjj}rC(j]j]j]j]j]ujKjhj]rDjXhttp_class must implement the HTTPConnection API from httplib. The addinfourl return value is a file-like object. It also has methods and attributes including:rErF}rG(jUjNjNjhjjAubaubcdocutils.nodes block_quote rH)rI}rJ(jUjj5jNjU block_quoterKj}rL(j]j]j]j]j]ujNjhj]rMj^ )rN}rO(jUjjIjjjj j}rP(UbulletrQX-j]j]j]j]j]ujKj]rR(jc )rS}rT(jX:info(): return a mimetools.Message object for the headers j}rU(j]j]j]j]j]ujjNj]rVj)rW}rX(jX9info(): return a mimetools.Message object for the headersjjSjjjjj}rY(j]j]j]j]j]ujKj]rZjX9info(): return a mimetools.Message object for the headersr[r\}r](jUjjWubaubajjy ubjc )r^}r_(jX*geturl(): return the original request URL j}r`(j]j]j]j]j]ujjNj]raj)rb}rc(jX)geturl(): return the original request URLjj^jjjjj}rd(j]j]j]j]j]ujK j]rejX)geturl(): return the original request URLrfrg}rh(jUjjbubaubajjy ubjc )ri}rj(jXcode: HTTP status coderkj}rl(j]j]j]j]j]ujjNj]rmj)rn}ro(jjkjjijjjjj}rp(j]j]j]j]j]ujK j]rqjXcode: HTTP status coderrrs}rt(jUjjnubaubajjy ubeubaubeubeubj?)ru}rv(jUjjߙjNjjCj}rw(j]j]j]j]j]Uentries]rx(jFX8https_request() (M2Crypto.m2urllib2.HTTPSHandler method)hnUNtryaujNjhj]ubjM)rz}r{(jUjjߙjNjjPj}r|(jRjSXpyj]j]j]j]j]jTXmethodr}jVj}ujNjhj]r~(jX)r}r(jX#HTTPSHandler.https_request(request)jjzjXk/home/matej/Build/m2crypto/M2Crypto/m2urllib2.py:docstring of M2Crypto.m2urllib2.HTTPSHandler.https_requestrjj\j}r(j]rhnaj_j`XM2Crypto.m2urllib2rr}rbj]j]j]j]rhnajeXHTTPSHandler.https_requestjgjjhujNjhj]r(j~)r}r(jX https_requestjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX https_requestrr}r(jUjNjNjhjjubaubj)r}r(jXrequestjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXrequestj}r(jojpj]j]j]j]j]ujjj]rjXrequestrr}r(jUjjubajjubaubeubj)r}r(jUjjzjjjjj}r(j]j]j]j]j]ujNjhj]ubeubeubeubj?)r}r(jUjjsjX]/home/matej/Build/m2crypto/M2Crypto/m2urllib2.py:docstring of M2Crypto.m2urllib2.build_openerrjjCj}r(j]j]j]j]j]Uentries]r(jFX-build_opener() (in module M2Crypto.m2urllib2)jUNtraujNjhj]ubjM)r}r(jUjjsjjjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jX)build_opener(ssl_context=None, *handlers)jjjX]/home/matej/Build/m2crypto/M2Crypto/m2urllib2.py:docstring of M2Crypto.m2urllib2.build_openerrjj\j}r(j]rjaj_j`XM2Crypto.m2urllib2rr}rbj]j]j]j]rjajeX build_openerrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.m2urllib2.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.m2urllib2.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX build_openerrr}r(jUjNjNjhjjubaubj)rš}rÚ(jXssl_context=None, *handlersjjjjjjj}rĚ(jojpj]j]j]j]j]ujNjhj]rŚ(j)rƚ}rǚ(jXssl_context=Nonej}rȚ(jojpj]j]j]j]j]ujjšj]rɚjXssl_context=Nonerʚr˚}r̚(jUjjƚubajjubj)r͚}rΚ(jX *handlersj}rϚ(jojpj]j]j]j]j]ujjšj]rКjX *handlersrњrҚ}rӚ(jUjj͚ubajjubeubj)rԚ}r՚(jUjjjNjjj}r֚(Uexprjj]j]j]j]j]ujNjhj]rךj!)rؚ}rٚ(jUj}rښ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/m2urllib2UrefidjujjԚj]rۚj)rܚ}rݚ(jUj}rޚ(j]j]rߚjaj]j]j]ujjؚj]rjX[source]rr}r(jUjjܚubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]r(j)r}r(jX0Create an opener object from a list of handlers.jjjjjjj}r(j]j]j]j]j]ujKjhj]rjX0Create an opener object from a list of handlers.rr}r(jUjNjNjhjjubaubj)r}r(jXQThe opener will use several default handlers, including support for HTTP and FTP.jjjjjjj}r(j]j]j]j]j]ujKjhj]rjXQThe opener will use several default handlers, including support for HTTP and FTP.rr}r(jUjNjNjhjjubaubj)r}r(jXyIf any of the handlers passed as arguments are subclasses of the default handlers, the default handlers will not be used.jjjjjjj}r(j]j]j]j]j]ujKjhj]rjXyIf any of the handlers passed as arguments are subclasses of the default handlers, the default handlers will not be used.rr}r(jUjNjNjhjjubaubeubeubeubj)r}r(jUjjjjjjj}r(j]j]j]j]r(Xmodule-M2Crypto.m2xmlrpclibrUm2xmlrpclib-modulerej]rhaujKjhj]r(j )r}r(jX:mod:`m2xmlrpclib` Modulerjjjjjj j}r(j]j]j]j]j]ujKjhj]r (j!)r }r (jX:mod:`m2xmlrpclib`r jjjjjj%j}r (UreftypeXmodj'j(X m2xmlrpclibU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,Nj-jujKj]rj0)r}r(jj j}r(j]j]r(j5jXpy-modrej]j]j]ujj j]rjX m2xmlrpclibrr}r(jUjjubajj;ubaubjX Modulerr}r(jUjNjNjhjjubeubj?)r}r(jUjjjXb/home/matej/Build/m2crypto/M2Crypto/m2xmlrpclib.py:docstring of M2Crypto.m2xmlrpclib.SSL_TransportrjjCj}r(j]j]j]j]j]Uentries]r (jFXM2Crypto.m2xmlrpclib (module)Xmodule-M2Crypto.m2xmlrpclibUNtr!aujKjhj]ubj?)r"}r#(jUjjjNjjCj}r$(j]j]j]j]j]Uentries]r%(jFX-SSL_Transport (class in M2Crypto.m2xmlrpclib)hAUNtr&aujNjhj]ubjM)r'}r((jUjjjNjjPj}r)(jRjSXpyj]j]j]j]j]jTXclassr*jVj*ujNjhj]r+(jX)r,}r-(jX,SSL_Transport(ssl_context=None, *args, **kw)jj'jXb/home/matej/Build/m2crypto/M2Crypto/m2xmlrpclib.py:docstring of M2Crypto.m2xmlrpclib.SSL_Transportr.jj\j}r/(j]r0hAaj_j`XM2Crypto.m2xmlrpclibr1r2}r3bj]j]j]j]r4hAajeX SSL_Transportr5jgUjhujNjhj]r6(jj)r7}r8(jXclass jj,jj.jjmj}r9(jojpj]j]j]j]j]ujNjhj]r:jXclass r;r<}r=(jUjNjNjhjj7ubaubju)r>}r?(jXM2Crypto.m2xmlrpclib.jj,jj.jjxj}r@(jojpj]j]j]j]j]ujNjhj]rAjXM2Crypto.m2xmlrpclib.rBrC}rD(jUjNjNjhjj>ubaubj~)rE}rF(jj5jj,jj.jjj}rG(jojpj]j]j]j]j]ujNjhj]rHjX SSL_TransportrIrJ}rK(jUjNjNjhjjEubaubj)rL}rM(jXssl_context=None, *args, **kwjj,jj.jjj}rN(jojpj]j]j]j]j]ujNjhj]rO(j)rP}rQ(jXssl_context=Nonej}rR(jojpj]j]j]j]j]ujjLj]rSjXssl_context=NonerTrU}rV(jUjjPubajjubj)rW}rX(jX*argsj}rY(jojpj]j]j]j]j]ujjLj]rZjX*argsr[r\}r](jUjjWubajjubj)r^}r_(jX**kwj}r`(jojpj]j]j]j]j]ujjLj]rajX**kwrbrc}rd(jUjj^ubajjubeubj)re}rf(jUjj,jNjjj}rg(Uexprjj]j]j]j]j]ujNjhj]rhj!)ri}rj(jUj}rk(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/m2xmlrpclibUrefidj5ujjej]rlj)rm}rn(jUj}ro(j]j]rpjaj]j]j]ujjij]rqjX[source]rrrs}rt(jUjjmubajjubajj%ubaubeubj)ru}rv(jUjj'jj.jjj}rw(j]j]j]j]j]ujNjhj]rx(j)ry}rz(jX#Bases: :class:`xmlrpclib.Transport`r{jjujXb/home/matej/Build/m2crypto/M2Crypto/m2xmlrpclib.py:docstring of M2Crypto.m2xmlrpclib.SSL_Transportr|jjj}r}(j]j]j]j]j]ujKjhj]r~(jXBases: rr}r(jUjNjNjhjjyubj!)r}r(jX:class:`xmlrpclib.Transport`rjjyjjjj%j}r(UreftypeXclassj'j(Xxmlrpclib.TransportU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,j5j-XM2Crypto.m2xmlrpclibrujKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-classrej]j]j]ujjj]rjXxmlrpclib.Transportrr}r(jUjjubajj;ubaubeubj?)r}r(jUjjujNjjCj}r(j]j]j]j]j]Uentries]r(jFX5request() (M2Crypto.m2xmlrpclib.SSL_Transport method)jUNtraujNjhj]ubjM)r}r(jUjjujNjjPj}r(jRjSXpyj]j]j]j]j]jTXmethodrjVjujNjhj]r(jX)r}r(jX=SSL_Transport.request(host, handler, request_body, verbose=0)jjjXj/home/matej/Build/m2crypto/M2Crypto/m2xmlrpclib.py:docstring of M2Crypto.m2xmlrpclib.SSL_Transport.requestrjj\j}r(j]rjaj_j`XM2Crypto.m2xmlrpclibrr}rbj]j]j]j]rjajeXSSL_Transport.requestrjgj5jhujNjhj]r(j~)r}r(jXrequestjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXrequestrr}r(jUjNjNjhjjubaubj)r}r(jX&host, handler, request_body, verbose=0jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXhostj}r(jojpj]j]j]j]j]ujjj]rjXhostrr}r(jUjjubajjubj)r}r(jXhandlerj}r(jojpj]j]j]j]j]ujjj]rjXhandlerrr}r(jUjjubajjubj)r}r(jX request_bodyj}r›(jojpj]j]j]j]j]ujjj]rÛjX request_bodyrěrś}rƛ(jUjjubajjubj)rǛ}rț(jX verbose=0j}rɛ(jojpj]j]j]j]j]ujjj]rʛjX verbose=0r˛r̛}r͛(jUjjǛubajjubeubj)rΛ}rϛ(jUjjjNjjj}rЛ(Uexprjj]j]j]j]j]ujNjhj]rћj!)rқ}rӛ(jUj}rԛ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/m2xmlrpclibUrefidjujjΛj]r՛j)r֛}rכ(jUj}r؛(j]j]rٛjaj]j]j]ujjқj]rڛjX[source]rۛrܛ}rݛ(jUjj֛ubajjubajj%ubaubeubj)rޛ}rߛ(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjujNjjCj}r(j]j]j]j]j]Uentries]r(jFX9user_agent (M2Crypto.m2xmlrpclib.SSL_Transport attribute)hUNtraujNjhj]ubjM)r}r(jUjjujNjjPj}r(jRjSXpyj]j]j]j]j]jTX attributerjVjujNjhj]r(jX)r}r(jXSSL_Transport.user_agentrjjjXm/home/matej/Build/m2crypto/M2Crypto/m2xmlrpclib.py:docstring of M2Crypto.m2xmlrpclib.SSL_Transport.user_agentrjj\j}r(j]rhaj_j`XM2Crypto.m2xmlrpclibrr}rbj]j]j]j]rhajeXSSL_Transport.user_agentjgj5jhujNjhj]r(j~)r}r(jX user_agentjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX user_agentrr}r(jUjNjNjhjjubaubjj)r}r(jXH = 'M2Crypto_XMLRPC/0.28.0 - xmlrpclib.py/1.0.1 (by www.pythonware.com)'jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjXH = 'M2Crypto_XMLRPC/0.28.0 - xmlrpclib.py/1.0.1 (by www.pythonware.com)'rr}r(jUjNjNjhjjubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubeubeubeubj)r}r(jUjjjjjjj}r (j]j]j]j]r (Xmodule-M2Crypto.threadingr Uthreading-moduler ej]r haujKjhj]r(j )r}r(jX:mod:`threading` Modulerjjjjjj j}r(j]j]j]j]j]ujKjhj]r(j!)r}r(jX:mod:`threading`rjjjjjj%j}r(UreftypeXmodj'j(X threadingU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,Nj-jujKj]rj0)r}r(jjj}r(j]j]r(j5jXpy-modrej]j]j]ujjj]rjX threadingr r!}r"(jUjjubajj;ubaubjX Moduler#r$}r%(jUjNjNjhjjubeubj?)r&}r'(jUjjjXX/home/matej/Build/m2crypto/M2Crypto/threading.py:docstring of M2Crypto.threading.cleanupr(jjCj}r)(j]j]j]j]j]Uentries]r*(jFXM2Crypto.threading (module)Xmodule-M2Crypto.threadingUNtr+aujKjhj]ubj?)r,}r-(jUjjjXX/home/matej/Build/m2crypto/M2Crypto/threading.py:docstring of M2Crypto.threading.cleanupr.jjCj}r/(j]j]j]j]j]Uentries]r0(jFX(cleanup() (in module M2Crypto.threading)hUNtr1aujNjhj]ubjM)r2}r3(jUjjjj.jjPj}r4(jRjSXpyj]j]j]j]j]jTXfunctionr5jVj5ujNjhj]r6(jX)r7}r8(jX cleanup()jj2jXX/home/matej/Build/m2crypto/M2Crypto/threading.py:docstring of M2Crypto.threading.cleanupr9jj\j}r:(j]r;haj_j`XM2Crypto.threadingr<r=}r>bj]j]j]j]r?hajeXcleanupr@jgUjhujNjhj]rA(ju)rB}rC(jXM2Crypto.threading.jj7jj9jjxj}rD(jojpj]j]j]j]j]ujNjhj]rEjXM2Crypto.threading.rFrG}rH(jUjNjNjhjjBubaubj~)rI}rJ(jj@jj7jj9jjj}rK(jojpj]j]j]j]j]ujNjhj]rLjXcleanuprMrN}rO(jUjNjNjhjjIubaubj)rP}rQ(jUjj7jj9jjj}rR(jojpj]j]j]j]j]ujNjhj]ubj)rS}rT(jUjj7jNjjj}rU(Uexprjj]j]j]j]j]ujNjhj]rVj!)rW}rX(jUj}rY(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/threadingUrefidj@ujjSj]rZj)r[}r\(jUj}r](j]j]r^jaj]j]j]ujjWj]r_jX[source]r`ra}rb(jUjj[ubajjubajj%ubaubeubj)rc}rd(jUjj2jj9jjj}re(j]j]j]j]j]ujNjhj]rfj)rg}rh(jX"End and cleanup threading support.jjcjj.jjj}ri(j]j]j]j]j]ujKjhj]rjjX"End and cleanup threading support.rkrl}rm(jUjNjNjhjjgubaubaubeubj?)rn}ro(jUjjjXU/home/matej/Build/m2crypto/M2Crypto/threading.py:docstring of M2Crypto.threading.initrpjjCj}rq(j]j]j]j]j]Uentries]rr(jFX%init() (in module M2Crypto.threading)hUNtrsaujNjhj]ubjM)rt}ru(jUjjjjpjjPj}rv(jRjSXpyj]j]j]j]j]jTXfunctionrwjVjwujNjhj]rx(jX)ry}rz(jXinit()jjtjXU/home/matej/Build/m2crypto/M2Crypto/threading.py:docstring of M2Crypto.threading.initr{jj\j}r|(j]r}haj_j`XM2Crypto.threadingr~r}rbj]j]j]j]rhajeXinitrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.threading.jjyjj{jjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.threading.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjyjj{jjj}r(jojpj]j]j]j]j]ujNjhj]rjXinitrr}r(jUjNjNjhjjubaubj)r}r(jUjjyjj{jjj}r(jojpj]j]j]j]j]ujNjhj]ubj)r}r(jUjjyjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/threadingUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjtjj{jjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jXInitialize threading support.jjjjpjjj}r(j]j]j]j]j]ujKjhj]rjXInitialize threading support.rr}r(jUjNjNjhjjubaubaubeubeubj)r}r(jUjjjjjjj}r(j]j]j]j]r(Xmodule-M2Crypto.utilrU util-modulerej]rj?aujKjhj]r(j )r}r(jX:mod:`util` Modulerjjjjjj j}r(j]j]j]j]j]ujKjhj]r(j!)r}r(jX :mod:`util`rjjjjjj%j}r(UreftypeXmodj'j(XutilU refdomainXpyrj]j]U refexplicitj]j]j]j*j+j,Nj-XM2Crypto.threadingrœujKj]rÜj0)rĜ}rŜ(jjj}rƜ(j]j]rǜ(j5jXpy-modrȜej]j]j]ujjj]rɜjXutilrʜr˜}r̜(jUjjĜubajj;ubaubjX Moduler͜rΜ}rϜ(jUjNjNjhjjubeubj?)rМ}rќ(jUjjjXP/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.UtilErrorrҜjjCj}rӜ(j]j]j]j]j]Uentries]rԜ(jFXM2Crypto.util (module)Xmodule-M2Crypto.utilUNtr՜aujKjhj]ubj?)r֜}rל(jUjjjXP/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.UtilErrorr؜jjCj}rٜ(j]j]j]j]j]Uentries]rڜ(jFX UtilErrorrۜhUNtrܜaujNjhj]ubjM)rݜ}rޜ(jUjjjj؜jjPj}rߜ(jRjSXpyj]j]j]j]j]jTX exceptionrjVjujNjhj]r(jX)r}r(jjۜjjݜjXP/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.UtilErrorrjj\j}r(j]rhaj_j`X M2Crypto.utilrr}rbj]j]j]j]rhajejۜjgUjhujNjhj]r(jj)r}r(jX exception jjjjjjmj}r(jojpj]j]j]j]j]ujNjhj]rjX exception rr}r(jUjNjNjhjjubaubju)r}r(jXM2Crypto.util.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.util.rr}r(jUjNjNjhjjubaubj~)r}r(jjۜjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX UtilErrorrr}r(jUjNjNjhjjubaubj)r}r(jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidjۜujjj]rj)r }r (jUj}r (j]j]r jaj]j]j]ujjj]r jX[source]rr}r(jUjj ubajjubajj%ubaubeubj)r}r(jUjjݜjjjjj}r(j]j]j]j]j]ujNjhj]rj)r}r(jX$Bases: :class:`exceptions.Exception`jjjj؜jjj}r(j]j]j]j]j]ujKjhj]r(jXBases: rr}r(jUjNjNjhjjubj!)r}r(jX:class:`exceptions.Exception`rjjjjjj%j}r(UreftypeXclassj'j(Xexceptions.ExceptionU refdomainXpyr j]j]U refexplicitj]j]j]j*j+j,jۜj-X M2Crypto.utilr!ujKj]r"j0)r#}r$(jjj}r%(j]j]r&(j5j Xpy-classr'ej]j]j]ujjj]r(jXexceptions.Exceptionr)r*}r+(jUjj#ubajj;ubaubeubaubeubj?)r,}r-(jUjjjNjjCj}r.(j]j]j]j]j]Uentries]r/(jFX&bin_to_hex() (in module M2Crypto.util)jUNtr0aujNjhj]ubjM)r1}r2(jUjjjNjjPj}r3(jRjSXpyj]j]j]j]j]jTXfunctionr4jVj4ujNjhj]r5(jX)r6}r7(jX bin_to_hex(b)jj1jXQ/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.bin_to_hexr8jj\j}r9(j]r:jaj_j`X M2Crypto.utilr;r<}r=bj]j]j]j]r>jajeX bin_to_hexr?jgUjhujNjhj]r@(ju)rA}rB(jXM2Crypto.util.jj6jj8jjxj}rC(jojpj]j]j]j]j]ujNjhj]rDjXM2Crypto.util.rErF}rG(jUjNjNjhjjAubaubj~)rH}rI(jj?jj6jj8jjj}rJ(jojpj]j]j]j]j]ujNjhj]rKjX bin_to_hexrLrM}rN(jUjNjNjhjjHubaubj)rO}rP(jXbjj6jj8jjj}rQ(jojpj]j]j]j]j]ujNjhj]rRj)rS}rT(jXbj}rU(jojpj]j]j]j]j]ujjOj]rVjXbrW}rX(jUjjSubajjubaubj)rY}rZ(jUjj6jNjjj}r[(Uexprjj]j]j]j]j]ujNjhj]r\j!)r]}r^(jUj}r_(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidj?ujjYj]r`j)ra}rb(jUj}rc(j]j]rdjaj]j]j]ujj]j]rejX[source]rfrg}rh(jUjjaubajjubajj%ubaubeubj)ri}rj(jUjj1jj8jjj}rk(j]j]j]j]j]ujNjhj]ubeubj?)rl}rm(jUjjjNjjCj}rn(j]j]j]j]j]Uentries]ro(jFX-genparam_callback() (in module M2Crypto.util)hUNtrpaujNjhj]ubjM)rq}rr(jUjjjNjjPj}rs(jRjSXpyj]j]j]j]j]jTXfunctionrtjVjtujNjhj]ru(jX)rv}rw(jX=genparam_callback(p, n, out=', mode 'w'>)jjqjXX/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.genparam_callbackrxjj\j}ry(j]rzhaj_j`X M2Crypto.utilr{r|}r}bj]j]j]j]r~hajeXgenparam_callbackrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.util.jjvjjxjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.util.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjvjjxjjj}r(jojpj]j]j]j]j]ujNjhj]rjXgenparam_callbackrr}r(jUjNjNjhjjubaubj)r}r(jX*p, n, out=', mode 'w'>jjvjjxjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXpj}r(jojpj]j]j]j]j]ujjj]rjXpr}r(jUjjubajjubj)r}r(jXnj}r(jojpj]j]j]j]j]ujjj]rjXnr}r(jUjjubajjubj)r}r(jXout='j}r(jojpj]j]j]j]j]ujjj]rjXout='rr}r(jUjjubajjubj)r}r(jX mode 'w'>j}r(jojpj]j]j]j]j]ujjj]rjX mode 'w'>rr}r(jUjjubajjubeubj)r}r(jUjjvjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidjujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjqjjxjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]rÝ(jFX2no_passphrase_callback() (in module M2Crypto.util)hjUNtrĝaujNjhj]ubjM)rŝ}rƝ(jUjjjNjjPj}rǝ(jRjSXpyj]j]j]j]j]jTXfunctionrȝjVjȝujNjhj]rɝ(jX)rʝ}r˝(jXno_passphrase_callback(*args)jjŝjX]/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.no_passphrase_callbackr̝jj\j}r͝(j]rΝhjaj_j`X M2Crypto.utilrϝrН}rѝbj]j]j]j]rҝhjajeXno_passphrase_callbackrӝjgUjhujNjhj]rԝ(ju)r՝}r֝(jXM2Crypto.util.jjʝjj̝jjxj}rם(jojpj]j]j]j]j]ujNjhj]r؝jXM2Crypto.util.rٝrڝ}r۝(jUjNjNjhjj՝ubaubj~)rܝ}rݝ(jjӝjjʝjj̝jjj}rޝ(jojpj]j]j]j]j]ujNjhj]rߝjXno_passphrase_callbackrr}r(jUjNjNjhjjܝubaubj)r}r(jX*argsjjʝjj̝jjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jX*argsj}r(jojpj]j]j]j]j]ujjj]rjX*argsrr}r(jUjjubajjubaubj)r}r(jUjjʝjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidjӝujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjŝjj̝jjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX'octx_to_num() (in module M2Crypto.util)jIUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionr jVj ujNjhj]r (jX)r }r (jXoctx_to_num(x)jjjXR/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.octx_to_numr jj\j}r(j]rjIaj_j`X M2Crypto.utilrr}rbj]j]j]j]rjIajeX octx_to_numrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.util.jj jj jjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.util.rr}r(jUjNjNjhjjubaubj~)r}r(jjjj jj jjj}r(jojpj]j]j]j]j]ujNjhj]r jX octx_to_numr!r"}r#(jUjNjNjhjjubaubj)r$}r%(jXxjj jj jjj}r&(jojpj]j]j]j]j]ujNjhj]r'j)r(}r)(jXxj}r*(jojpj]j]j]j]j]ujj$j]r+jXxr,}r-(jUjj(ubajjubaubj)r.}r/(jUjj jNjjj}r0(Uexprjj]j]j]j]j]ujNjhj]r1j!)r2}r3(jUj}r4(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidjujj.j]r5j)r6}r7(jUj}r8(j]j]r9jaj]j]j]ujj2j]r:jX[source]r;r<}r=(jUjj6ubajjubajj%ubaubeubj)r>}r?(jUjjjj jjj}r@(j]j]j]j]j]ujNjhj]ubeubj?)rA}rB(jUjjjNjjCj}rC(j]j]j]j]j]Uentries]rD(jFX/passphrase_callback() (in module M2Crypto.util)h;UNtrEaujNjhj]ubjM)rF}rG(jUjjjNjjPj}rH(jRjSXpyj]j]j]j]j]jTXfunctionrIjVjIujNjhj]rJ(jX)rK}rL(jXQpassphrase_callback(v, prompt1='Enter passphrase:', prompt2='Verify passphrase:')jjFjXZ/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.passphrase_callbackrMjj\j}rN(j]rOh;aj_j`X M2Crypto.utilrPrQ}rRbj]j]j]j]rSh;ajeXpassphrase_callbackrTjgUjhujNjhj]rU(ju)rV}rW(jXM2Crypto.util.jjKjjMjjxj}rX(jojpj]j]j]j]j]ujNjhj]rYjXM2Crypto.util.rZr[}r\(jUjNjNjhjjVubaubj~)r]}r^(jjTjjKjjMjjj}r_(jojpj]j]j]j]j]ujNjhj]r`jXpassphrase_callbackrarb}rc(jUjNjNjhjj]ubaubj)rd}re(jX<v, prompt1='Enter passphrase:', prompt2='Verify passphrase:'jjKjjMjjj}rf(jojpj]j]j]j]j]ujNjhj]rg(j)rh}ri(jXvj}rj(jojpj]j]j]j]j]ujjdj]rkjXvrl}rm(jUjjhubajjubj)rn}ro(jXprompt1='Enter passphrase:'j}rp(jojpj]j]j]j]j]ujjdj]rqjXprompt1='Enter passphrase:'rrrs}rt(jUjjnubajjubj)ru}rv(jXprompt2='Verify passphrase:'j}rw(jojpj]j]j]j]j]ujjdj]rxjXprompt2='Verify passphrase:'ryrz}r{(jUjjuubajjubeubj)r|}r}(jUjjKjNjjj}r~(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidjTujj|j]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjFjjMjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX%pkcs5_pad() (in module M2Crypto.util)hUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jXpkcs5_pad(data, blklen=8)jjjXP/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.pkcs5_padrjj\j}r(j]rhaj_j`X M2Crypto.utilrr}rbj]j]j]j]rhajeX pkcs5_padrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.util.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.util.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX pkcs5_padrr}r(jUjNjNjhjjubaubj)r}r(jXdata, blklen=8jjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXdataj}r(jojpj]j]j]j]j]ujjj]rjXdatarr}r(jUjjubajjubj)r}r(jXblklen=8j}r(jojpj]j]j]j]j]ujjj]rjXblklen=8rrž}rÞ(jUjjubajjubeubj)rĞ}rŞ(jUjjjNjjj}rƞ(Uexprjj]j]j]j]j]ujNjhj]rǞj!)rȞ}rɞ(jUj}rʞ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidjujjĞj]r˞j)r̞}r͞(jUj}rΞ(j]j]rϞjaj]j]j]ujjȞj]rОjX[source]rўrҞ}rӞ(jUjj̞ubajjubajj%ubaubeubj)rԞ}r՞(jUjjjjjjj}r֞(j]j]j]j]j]ujNjhj]ubeubj?)rמ}r؞(jUjjjNjjCj}rٞ(j]j]j]j]j]Uentries]rڞ(jFX%pkcs7_pad() (in module M2Crypto.util)hwUNtr۞aujNjhj]ubjM)rܞ}rݞ(jUjjjNjjPj}rޞ(jRjSXpyj]j]j]j]j]jTXfunctionrߞjVjߞujNjhj]r(jX)r}r(jXpkcs7_pad(data, blklen)jjܞjXP/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.pkcs7_padrjj\j}r(j]rhwaj_j`X M2Crypto.utilrr}rbj]j]j]j]rhwajeX pkcs7_padrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.util.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.util.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjX pkcs7_padrr}r(jUjNjNjhjjubaubj)r}r(jX data, blklenjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]r(j)r}r(jXdataj}r(jojpj]j]j]j]j]ujjj]rjXdatarr}r(jUjjubajjubj)r}r(jXblklenj}r(jojpj]j]j]j]j]ujjj]rjXblklenr r }r (jUjjubajjubeubj)r }r (jUjjjNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidjujj j]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjܞjjjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r (jUjjjNjjCj}r!(j]j]j]j]j]Uentries]r"(jFX$py3bytes() (in module M2Crypto.util)hUNtr#aujNjhj]ubjM)r$}r%(jUjjjNjjPj}r&(jRjSXpyj]j]j]j]j]jTXfunctionr'jVj'ujNjhj]r((jX)r)}r*(jX py3bytes(x)jj$jXO/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.py3bytesr+jj\j}r,(j]r-haj_j`X M2Crypto.utilr.r/}r0bj]j]j]j]r1hajeXpy3bytesr2jgUjhujNjhj]r3(ju)r4}r5(jXM2Crypto.util.jj)jj+jjxj}r6(jojpj]j]j]j]j]ujNjhj]r7jXM2Crypto.util.r8r9}r:(jUjNjNjhjj4ubaubj~)r;}r<(jj2jj)jj+jjj}r=(jojpj]j]j]j]j]ujNjhj]r>jXpy3bytesr?r@}rA(jUjNjNjhjj;ubaubj)rB}rC(jXxjj)jj+jjj}rD(jojpj]j]j]j]j]ujNjhj]rEj)rF}rG(jXxj}rH(jojpj]j]j]j]j]ujjBj]rIjXxrJ}rK(jUjjFubajjubaubj)rL}rM(jUjj)jNjjj}rN(Uexprjj]j]j]j]j]ujNjhj]rOj!)rP}rQ(jUj}rR(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidj2ujjLj]rSj)rT}rU(jUj}rV(j]j]rWjaj]j]j]ujjPj]rXjX[source]rYrZ}r[(jUjjTubajjubajj%ubaubeubj)r\}r](jUjj$jj+jjj}r^(j]j]j]j]j]ujNjhj]ubeubj?)r_}r`(jUjjjNjjCj}ra(j]j]j]j]j]Uentries]rb(jFX"py3str() (in module M2Crypto.util)jyUNtrcaujNjhj]ubjM)rd}re(jUjjjNjjPj}rf(jRjSXpyj]j]j]j]j]jTXfunctionrgjVjgujNjhj]rh(jX)ri}rj(jX py3str(x)jjdjXM/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.py3strrkjj\j}rl(j]rmjyaj_j`X M2Crypto.utilrnro}rpbj]j]j]j]rqjyajeXpy3strrrjgUjhujNjhj]rs(ju)rt}ru(jXM2Crypto.util.jjijjkjjxj}rv(jojpj]j]j]j]j]ujNjhj]rwjXM2Crypto.util.rxry}rz(jUjNjNjhjjtubaubj~)r{}r|(jjrjjijjkjjj}r}(jojpj]j]j]j]j]ujNjhj]r~jXpy3strrr}r(jUjNjNjhjj{ubaubj)r}r(jXxjjijjkjjj}r(jojpj]j]j]j]j]ujNjhj]rj)r}r(jXxj}r(jojpj]j]j]j]j]ujjj]rjXxr}r(jUjjubajjubaubj)r}r(jUjjijNjjj}r(Uexprjj]j]j]j]j]ujNjhj]rj!)r}r(jUj}r(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidjrujjj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjdjjkjjj}r(j]j]j]j]j]ujNjhj]ubeubj?)r}r(jUjjjNjjCj}r(j]j]j]j]j]Uentries]r(jFX3quiet_genparam_callback() (in module M2Crypto.util)jUNtraujNjhj]ubjM)r}r(jUjjjNjjPj}r(jRjSXpyj]j]j]j]j]jTXfunctionrjVjujNjhj]r(jX)r}r(jX"quiet_genparam_callback(p, n, out)jjjX^/home/matej/Build/m2crypto/M2Crypto/util.py:docstring of M2Crypto.util.quiet_genparam_callbackrjj\j}r(j]rjaj_j`X M2Crypto.utilrr}rbj]j]j]j]rjajeXquiet_genparam_callbackrjgUjhujNjhj]r(ju)r}r(jXM2Crypto.util.jjjjjjxj}r(jojpj]j]j]j]j]ujNjhj]rjXM2Crypto.util.rr}r(jUjNjNjhjjubaubj~)r}r(jjjjjjjjj}r(jojpj]j]j]j]j]ujNjhj]rjXquiet_genparam_callbackrr}r(jUjNjNjhjjubaubj)rŸ}rß(jX p, n, outjjjjjjj}rğ(jojpj]j]j]j]j]ujNjhj]rş(j)rƟ}rǟ(jXpj}rȟ(jojpj]j]j]j]j]ujjŸj]rɟjXprʟ}r˟(jUjjƟubajjubj)r̟}r͟(jXnj}rΟ(jojpj]j]j]j]j]ujjŸj]rϟjXnrП}rџ(jUjj̟ubajjubj)rҟ}rӟ(jXoutj}rԟ(jojpj]j]j]j]j]ujjŸj]r՟jXoutr֟rן}r؟(jUjjҟubajjubeubj)rٟ}rڟ(jUjjjNjjj}r۟(Uexprjj]j]j]j]j]ujNjhj]rܟj!)rݟ}rޟ(jUj}rߟ(UreftypejUrefdocj+U refdomainjj]j]U refexplicitj]j]j]U reftargetU_modules/M2Crypto/utilUrefidjujjٟj]rj)r}r(jUj}r(j]j]rjaj]j]j]ujjݟj]rjX[source]rr}r(jUjjubajjubajj%ubaubeubj)r}r(jUjjjjjjj}r(j]j]j]j]j]ujNjhj]ubeubeubj)r}r(jUjjjjjjj}r(j]j]j]j]rU subpackagesraj]rh,aujKjhj]r(j )r}r(jX Subpackagesrjjjjjj j}r(j]j]j]j]j]ujKjhj]rjX Subpackagesrr}r(jUjNjNjhjjubaubcdocutils.nodes compound r)r}r(jUjjjjjUcompoundrj}r(j]j]rUtoctree-wrapperraj]j]j]ujKjhj]rcsphinx.addnodes toctree r)r}r(jUjjjjjUtoctreerj}r(UnumberedrKU includehiddenr jj+Ucaptionr NUglobr j]j]U titlesonlyr j]j]j]Uentriesr ]rNX M2Crypto.SSLrraUhiddenrU includefilesr]rjaUmaxdepthrJujKj]ubaubeubeubjjjjj}r(j]rjaj]j]j]rUid1raj]ujKjhj]r(j )r}r(jX:mod:`M2Crypto` Packagerjjjjjj j}r(j]j]j]j]j]ujKjhj]r(j!)r}r (jX:mod:`M2Crypto`r!jjjjjj%j}r"(UreftypeXmodj'j(XM2CryptoU refdomainXpyr#j]j]U refexplicitj]j]j]j*j+j,Nj-NujKj]r$j0)r%}r&(jj!j}r'(j]j]r((j5j#Xpy-modr)ej]j]j]ujjj]r*jXM2Cryptor+r,}r-(jUjj%ubajj;ubaubjX Packager.r/}r0(jUjNjNjhjjubeubcdocutils.nodes target r1)r2}r3(jUjjjXN/home/matej/Build/m2crypto/M2Crypto/__init__.py:docstring of M2Crypto.__init__r4jUtargetr5j}r6(j]j]r7Xmodule-M2Crypto.__init__r8aj]Uismodj]j]ujKjhj]ubj?)r9}r:(jUjjjj4jjCj}r;(j]j]j]j]j]Uentries]r<(jFXM2Crypto.__init__ (module)Xmodule-M2Crypto.__init__UNtr=aujKjhj]ubeubjjjUsystem_messager>j}r?(j]UlevelKj]j]r@jaUsourcejj]j]UlineKUtypeUINFOrAujKjhj]rBj)rC}rD(jX3Duplicate implicit target name: "m2crypto package".j}rE(j]j]j]j]j]ujjj]rFjX7Duplicate implicit target name: “m2crypto package”.rGrH}rI(jUjjCubajjubaubaUcurrent_sourcerJNU decorationrKNUautofootnote_startrLKUnameidsrM}rN(hjhhhhh h h h h h h h h h hhhhhhhhhjhhhhhhhhhhhhhhhhhhhhhhhhhhh h h!h!h"h"h#h#h$h$h%h%h&h&h'h'h(h(h)h)h*h*h+h+h,jh-h-h.h.h/h/h0h0h1h1h2h2h3h3h4h4h5h5h6h6h7h7h8h8h9jfh:h:h;h;hh>h?h?h@h@hAhAhBhBhChChDhDhEhEhFhFhGhGhHhHhIhIhJhJhKhKhLhLhMhMhNhNhOhOhPhPhQhQhRhRhShShThThUhUhVhVhWhWhXNhYhYhZhZh[h[h\h\h]h]h^h^h_h_h`h`hahahbhbhchchdhdhehehfhfhghghhhhhihihjhjhkhkhlhlhmhmhnhnhohohphphqhqhrhrhshshththuhuhvhvhwhwhxhxhyhyhzhzh{h{h|h|h}h}h~h~hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhjhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhj hhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhhj"Khjhhhhhhhhhhhhhhhhhhhj hhhj*hhhhhhhhhhhhhhhhhhhhhhhjoFhhhhhhhhhhjjjjjjjjjjjjjjjjjjj j j j j j j j j j jjjjjjjjjjjjjjjjjjjj|jjjjjjjjjjjjjjjjj j j!j!j"j"j#j#j$j$j%j%j&j&j'j'j(j(j)j)j*j*j+j+j,j,j-j-j.j.j/jrkj0j0j1j1j2j2j3j3j4j4j5j5j6j6j7j7j8j8j9jCcj:j:j;j;j<j<j=j=j>j>j?jj@j@jAjjBjBjCjCjDjDjEj=jFjFjGjGjHjHjIjIjJjJjKjKjLjLjMjAjNjNjOjOjPjPjQjQjRjRjSjSjTjTjUjUjVjVjWjWjXjXjYjYjZjZj[j[j\j\j]j]j^j^j_j^j`j`jajajbjbjcjcjdjdjejejfjfjgjgjhjhjijijjjjjkjkjljljmjmjnjnjojojpjpjqjqjrjrjsjsjtjtjujujvjvjwjwjxjxjyjyjzjzj{j(Oj|j|j}j}j~j~jjjjjjjjjjjjjjMjjjjjjjjjjjjjjjjjjjjjjjjjjxjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj6jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjuj]rOjajUU transformerrPNU footnote_refsrQ}rRUrefnamesrS}rTUsymbol_footnotesrU]rVUautofootnote_refsrW]rXUsymbol_footnote_refsrY]rZU citationsr[]r\jhU current_liner]NUtransform_messagesr^]r_j)r`}ra(jUj}rb(j]UlevelKj]j]Usourcej4j]j]UlineKUtypejAuj]rcj)rd}re(jUj}rf(j]j]j]j]j]ujj`j]rgjX>Hyperlink target "module-M2Crypto.__init__" is not referenced.rhri}rj(jUjjdubajjubajj>ubaUreporterrkNUid_startrlKU autofootnotesrm]rnU citation_refsro}rpUindirect_targetsrq]rrUsettingsrs(cdocutils.frontend Values rtoru}rv(Ufootnote_backlinksrwKUrecord_dependenciesrxNU rfc_base_urlryUhttps://tools.ietf.org/html/rzU tracebackr{Upep_referencesr|NUstrip_commentsr}NU toc_backlinksr~UentryrU language_coderUenrU datestamprNU report_levelrKU _destinationrNU halt_levelrKU strip_classesrNj NUerror_encoding_error_handlerrUbackslashreplacerUdebugrNUembed_stylesheetrUoutput_encoding_error_handlerrUstrictrU sectnum_xformrKUdump_transformsrNU docinfo_xformrKUwarning_streamrNUpep_file_url_templaterUpep-%04drUexit_status_levelrKUconfigrNUstrict_visitorrNUcloak_email_addressesrUtrim_footnote_reference_spacerUenvrNUdump_pseudo_xmlrNUexpose_internalsrNUsectsubtitle_xformrU source_linkrNUrfc_referencesrNUoutput_encodingrUutf-8rU source_urlrNUinput_encodingrU utf-8-sigrU_disable_configrNU id_prefixrUUcharacter_level_inline_markuprU tab_widthrKUerror_encodingrUUTF-8rU_sourcerjUgettext_compactrU generatorrNUdump_internalsrNU smart_quotesrU pep_base_urlrU https://www.python.org/dev/peps/rUsyntax_highlightrUlongrUinput_encoding_error_handlerrjUauto_id_prefixrUidrUdoctitle_xformrUstrip_elements_with_classesrNU _config_filesr]Ufile_insertion_enabledrU raw_enabledrKU dump_settingsrNubUsymbol_footnote_startrKj}r(hj>Rhj,hj`h jQhh j h j7jjK/h ju:hjnj*j*j*j1)r}r(jUjj*jj*jj5j}r(j]j]rj*aj]Uismodj]j]ujKjhj]ubjjhj]6hjehj* hjrhjshj$hjhj}fhje4hjhj;hj0;hjדhj/hj=hj"ph jloh!jRh"jh#jD`h$j.h%jsjh&jT$h'jgh(j0h)j=h*jxh+jҔjjh-jlh.j1h/jh0jsh1j0Yh2j jrkjmkh3jljWjmh5jh6j.h7jSOh8j}jwj1)r}r (jUjjsjjjj5j}rà(j]j]rĠjwaj]Uismodj]j]ujKjhj]ubh:j 5jjh;jKhjdh?joch@jfhAj,hBj'hCjXhDjuhEjQhFjhGj hHjOhIjhhJjIhKjj6j1)rŠ}rƠ(jUjj6jj6jj5j}rǠ(j]j]rȠj6aj]Uismodj]j]ujKjhj]ubhLjMAhMj~#hNj%nhOj8hPjhQjS7hRjhSjZthTjzhUj0hVj":hWjhhYjhZjT:h[jHh\j;mh]jh^jwMh_j h`jbhajW}hbj-"hcj^hdjphej/hfjchgjb,hhjG hij:hjjʝhkj>~hlj*[hmjNjMjMhojjjhpj7hqjhrjPdhsjj!Kj1)rɠ}rʠ(jUjjKjj>Kjj5j}rˠ(j]j]r̠j!Kaj]Uismodj]j]ujKjhj]ubhtj+huj1hvjH)hwjhxjhyj9hzjh{j}h|jvuh}j8h~jhjhjkhj(hjYhj9gjjhjvhjqdhjMhj=hjjjhj!ehjOhjZhjߕj~j jBcj1)r͠}rΠ(jUjj>cjj`cjj5j}rϠ(j]j]rРjBcaj]Uismodj]j]ujKjhj]ubhj@hjhj@hjhjMhjwhj~hjGhjyhj-vhjshjNhj hj2hjhj00hjyhjhjhnjjj1)rѠ}rҠ(jUjjjj4jj5j}rӠ(j]j]rԠjaj]Uismodj]j]ujKjhj]ubhjj8j2hjhjx=hjLhjPhjNKhj)hjhjPhjkYhjhj j(Oj#OhjGhj^ hjc2hjKhjhjvhjhhj:hjXhjMj'Oj1)rՠ}r֠(jUjj#OjjEOjj5j}rנ(j]j]rؠj'Oaj]Uismodj]j]ujKjhj]ubjfjahjHjj1)r٠}rڠ(jUjjjjjj5j}r۠(j]j]rܠjaj]Uismodj]j]ujKjhj]ubjj1)rݠ}rޠ(jUjjjjBjj5j}rߠ(j]j]rjaj]Uismodj]j]ujKjhj]ubhjYhjS'hj7hj jj1)r}r(jUjjjjjj5j}r(j]j]rjaj]Uismodj]j]ujKjhj]ubhj>hjhj{hjhj1hjhjBhjWhjhjRBhjuahj$hjhj6khj6hjIhjj j1)r}r(jUjjjj(jj5j}r(j]j]rj aj]Uismodj]j]ujKjhj]ubhjhjhjhjSJhjhjWQhj|hju!hj Lhj5hjUhj{@hj6Mhjhj:hj[-hj&hj.j"KjKhj>yhj`hjhjqhjhj1#hjՒhjj^j^hj'hjGhj&hj?whj;hjGlhjhj hjUhjhjXhjdhjoihj]hjBjjBLj^j1)r}r(jUjj^jj_jj5j}r(j]j]rj^aj]Uismodj]j]ujKjhj]ubjjtjj6jjjjW=jj jj Zjjjjbj j(xj jj jj jhj j?jj<jjuejjjj{jjjjHjj3jj jjj;jjejjojjUzjj0jj2jjjjjj j jYj!jj"jej#jBj$jj%jj&jTjxjsj'jij(jA@j)j9j*jNj+jXsj,j7j-jj.jjqkj1)r}r(jUjjmkjjkjj5j}r(j]j]rjqkaj]Uismodj]j]ujKjhj]ubj0j2j1j{j2j6j=j8j3j0j4jw9j5jj6j%^j7j`j8jLj:jj;jj<j j=jj>jbj@j-3jBj jCjjDj!*jFj;!jGjjHjfhj6jIj jJjS j6j6jKjbPjLjhjNjjOjNjPjj j1)r}r(jUjj jj jj5j}r(j]j]rj aj]Uismodj]j]ujKjhj]ubjQjjRjdjSjK?jAj<jTj,jUjCjVjp"h4j+jXj jCcj>cjj1)r}r(jUjjjjҜjj5j}r(j]j]rjaj]Uismodj]j]ujKjhj]ubjYjQjZjij{j1)r}r(jUjjwjjjj5j}r(j]j]rj{aj]Uismodj]j]ujKjhj]ubj[jkj\jAPj]jj^jj`j1hjFjajnjbjjcj_jdjjejdjfjEjgjjhjmmjij+jjjJjkjjljjmjWXjnjjoj qj<j1)r}r(jUjj8jjZjj5j}r(j]j]rj<aj]Uismodj]j]ujKjhj]ubjpjDj|jwjqjGjrjjsj6jtj7_jujx\jvjkjwjfjj1)r}r(jUjjjjjj5j}r(j]j]rjaj]Uismodj]j]ujKjhj]ubjoFjjFjnFj1)r}r(jUjjjFjjFjj5j}r(j]j]rjnFaj]Uismodj]j]ujKjhj]ubjxj=9jyjijzj#j|j?j}jdjjI|jjbjj'jj7jjPjjjjgjjXGjjj jjjjjijj[jjۉhjjjjjjj^%jj1)r }r (jUjjjjjj5j}r (j]j]r jaj]Uismodj]j]ujKjhj]ubjjTIjjjjcj@j1)r }r(jUjj<jj]jj5j}r(j]j]rj@aj]Uismodj]j]ujKjhj]ubjj{LjMj1)r}r(jUjjMjjNjj5j}r(j]j]rjMaj]Uismodj]j]ujKjhj]ubjjjjrjjJjjmjjjjjj]Hh jg.j j jjjjijjYjj~jjjjsjjvjjjj<jj wjj3IjjWnjjjj/jjy8jjhljjfNjjNjej1)r}r(jUjjajjjj5j}r(j]j]rjeaj]Uismodj]j]ujKjhj]ubjjjjjjzjjjj"jjjjwjjjjjjjj1)r}r(jUjjjj#jj5j}r(j]j]rjaj]Uismodj]j]ujKjhj]ubjjqwjj1)r}r(jUjjjjjj5j}r(j]j]r jaj]Uismodj]j]ujKjhj]ubjjljj5fjjAjj܇jjEjj[+jjQjjjjSjjjj[jjxjjjj6jjjjTjjjjjjjjK jj)WjjmVjj6jjh1jj%8jjqjjjjjjrjjjj,jjETjjjjj?jjGDjjsgjj jj$ jjjjyjjJjj]jj0jj} jj,jjzjjJSjjuUsubstitution_namesr!}r"jjj}r#(j]j]j]Usourcejj]j]uU footnotesr$]r%Urefidsr&}r'ub.M2Crypto-0.31.0/doc/doctrees/ZServerSSL-HOWTO.doctree0000664000175000001440000013527713236336220022356 0ustar matejusers00000000000000cdocutils.nodes document q)q}q(U nametypesq}q(Xpython with m2cryptoqNXwebdav-over-httpsqNX installationqNX introductionq NXtestingq NXxmlrpc-over-httpsq NX preparationq NXwebdav-source-over-httpsq NXhttpsqNXzserverssl-howtoqXcontentsqNX conclusionqNuUsubstitution_defsq}qUparse_messagesq]q(cdocutils.nodes system_message q)q}q(U rawsourceqUUparentqcdocutils.nodes section q)q}q(hUU referencedqKhhUsourceqX3/home/matej/Build/m2crypto/doc/ZServerSSL-HOWTO.rstq Uexpect_referenced_by_nameq!}q"hcdocutils.nodes target q#)q$}q%(hX.. _zserverssl-howto:hhhh Utagnameq&Utargetq'U attributesq(}q)(Uidsq*]Ubackrefsq+]Udupnamesq,]Uclassesq-]Unamesq.]Urefidq/Uzserverssl-howtoq0uUlineq1KUdocumentq2hUchildrenq3]ubsh&Usectionq4h(}q5(h,]q6Xzserverssl-howtoq7ah-]h+]h*]q8(h0Uid1q9eh.]q:hauh1Kh2hUexpect_referenced_by_idq;}q)q?}q@(hXZServerSSL-HOWTOqAhhhh h&UtitleqBh(}qC(UautoqDKh*]h+]h,]h-]h.]h/Uid3qEuh1Kh2hh3]qF(cdocutils.nodes generated qG)qH}qI(hUhh?hNh&U generatedqJh(}qK(h,]h-]qLUsectnumqMah+]h*]h.]uh1Nh2hh3]qNcdocutils.nodes Text qOX1.   qPqQ}qR(hUhNh1Nh2hhhHubaubhOXZServerSSL-HOWTOqSqT}qU(hUhNh1Nh2hhh?ubeubcdocutils.nodes field_list qV)qW}qX(hUhhhh h&U field_listqYh(}qZ(h,]h-]h+]h*]h.]uh1Kh2hh3]q[(cdocutils.nodes field q\)q]}q^(hUhhWhh h&Ufieldq_h(}q`(h,]h-]h+]h*]h.]uh1Kh2hh3]qa(cdocutils.nodes field_name qb)qc}qd(hXauthorhh]hh h&U field_nameqeh(}qf(h,]h-]h+]h*]h.]uh1Kh3]qghOXauthorqhqi}qj(hUhhcubaubcdocutils.nodes field_body qk)ql}qm(hXPheng Siong Ng qnh(}qo(h,]h-]h+]h*]h.]uhh]h3]qpcdocutils.nodes paragraph qq)qr}qs(hhnhhlhh h&U paragraphqth(}qu(h,]h-]h+]h*]h.]uh1Kh3]qv(hOXPheng Siong Ng q}q(hUhhrubeubah&U field_bodyqubeubh\)q}q(hUhhWhh h&h_h(}q(h,]h-]h+]h*]h.]uh1K h2hh3]q(hb)q}q(hX copyrighthhhh h&heh(}q(h,]h-]h+]h*]h.]uh1Kh3]qhOX copyrightqq}q(hUhhubaubhk)q}q(hX © 2000, 2001 by Ng Pheng Siong.qh(}q(h,]h-]h+]h*]h.]uhhh3]qhq)q}q(hhhhhh h&hth(}q(h,]h-]h+]h*]h.]uh1K h3]qhOX © 2000, 2001 by Ng Pheng Siong.qq}q(hUhhubaubah&hubeubh\)q}q(hUhhWhh h&h_h(}q(h,]h-]h+]h*]h.]uh1K h2hh3]q(hb)q}q(hXdatehhhh h&heh(}q(h,]h-]h+]h*]h.]uh1Kh3]qhOXdateqq}q(hUhhubaubhk)q}q(hX 2003-06-22 h(}q(h,]h-]h+]h*]h.]uhhh3]qhq)q}q(hX 2003-06-22hhhh h&hth(}q(h,]h-]h+]h*]h.]uh1K h3]qhOX 2003-06-22qq}q(hUhhubaubah&hubeubeubcdocutils.nodes topic q)q}q(hUhhhh h&Utopicqh(}q(h,]h-]qUcontentsqah+]h*]qUcontentsqah.]qhauh1K h2hh3]q(h>)q}q(hXContentsh(}q(h,]h-]h+]h*]h.]uhhh3]qhOXContentsq…q}q(hUhhubah&hBubcdocutils.nodes bullet_list q)q}q(hUhhhNh&U bullet_listqh(}q(h,]h-]qUauto-tocqah+]h*]h.]uh1Nh2hh3]qcdocutils.nodes list_item q)q}q(hUh(}q(h,]h-]h+]h*]h.]uhhh3]q(hq)q}q(hUh(}q(h,]h-]h+]h*]h.]uhhh3]qhz)q}q(hUh(}q(h*]qhEah+]h,]h-]h.]Urefidh0uhhh3]q(hG)q}q(hUhhhNh&hJh(}q(h,]h-]qhMah+]h*]h.]uh1Nh3]qhOX1.   qq}q(hUhhubaubhOXZServerSSL-HOWTOqㅁq}q(hUhhubeh&hubah&htubh)q}q(hUh(}q(h,]h-]qhah+]h*]h.]uhhh3]q(h)q}q(hUh(}q(h,]h-]h+]h*]h.]uhhh3]qhq)q}q(hUh(}q(h,]h-]h+]h*]h.]uhhh3]qhz)q}q(hUh(}q(h*]qUid4qah+]h,]h-]h.]UrefidU introductionquhhh3]q(hG)q}q(hUhhhNh&hJh(}q(h,]h-]qhMah+]h*]h.]uh1Nh3]qhOX 1.1.   qr}r(hUhhubaubhOX Introductionrr}r(hUhhubeh&hubah&htubah&U list_itemrubh)r}r(hUh(}r(h,]h-]h+]h*]h.]uhhh3]r hq)r }r (hUh(}r (h,]h-]h+]h*]h.]uhjh3]r hz)r}r(hUh(}r(h*]rUid5rah+]h,]h-]h.]UrefidU preparationruhj h3]r(hG)r}r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh3]rhOX 1.2.   rr}r(hUhjubaubhOX Preparationrr}r(hUhjubeh&hubah&htubah&jubh)r }r!(hUh(}r"(h,]h-]h+]h*]h.]uhhh3]r#hq)r$}r%(hUh(}r&(h,]h-]h+]h*]h.]uhj h3]r'hz)r(}r)(hUh(}r*(h*]r+Uid6r,ah+]h,]h-]h.]UrefidU installationr-uhj$h3]r.(hG)r/}r0(hUhj(hNh&hJh(}r1(h,]h-]r2hMah+]h*]h.]uh1Nh3]r3hOX 1.3.   r4r5}r6(hUhj/ubaubhOX Installationr7r8}r9(hUhj(ubeh&hubah&htubah&jubh)r:}r;(hUh(}r<(h,]h-]h+]h*]h.]uhhh3]r=hq)r>}r?(hUh(}r@(h,]h-]h+]h*]h.]uhj:h3]rAhz)rB}rC(hUh(}rD(h*]rEUid7rFah+]h,]h-]h.]UrefidUtestingrGuhj>h3]rH(hG)rI}rJ(hUhjBhNh&hJh(}rK(h,]h-]rLhMah+]h*]h.]uh1Nh3]rMhOX 1.4.   rNrO}rP(hUhjIubaubhOXTestingrQrR}rS(hUhjBubeh&hubah&htubah&jubh)rT}rU(hUh(}rV(h,]h-]h+]h*]h.]uhhh3]rWhq)rX}rY(hUh(}rZ(h,]h-]h+]h*]h.]uhjTh3]r[hz)r\}r](hUh(}r^(h*]r_Uid8r`ah+]h,]h-]h.]UrefidUhttpsrauhjXh3]rb(hG)rc}rd(hUhj\hNh&hJh(}re(h,]h-]rfhMah+]h*]h.]uh1Nh3]rghOX 1.5.   rhri}rj(hUhjcubaubhOXHTTPSrkrl}rm(hUhj\ubeh&hubah&htubah&jubh)rn}ro(hUh(}rp(h,]h-]h+]h*]h.]uhhh3]rqhq)rr}rs(hUh(}rt(h,]h-]h+]h*]h.]uhjnh3]ruhz)rv}rw(hUh(}rx(h*]ryUid9rzah+]h,]h-]h.]UrefidUwebdav-over-httpsr{uhjrh3]r|(hG)r}}r~(hUhjvhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh3]rhOX 1.6.   rr}r(hUhj}ubaubhOXWebDAV-over-HTTPSrr}r(hUhjvubeh&hubah&htubah&jubh)r}r(hUh(}r(h,]h-]h+]h*]h.]uhhh3]rhq)r}r(hUh(}r(h,]h-]h+]h*]h.]uhjh3]rhz)r}r(hUh(}r(h*]rUid10rah+]h,]h-]h.]UrefidUwebdav-source-over-httpsruhjh3]r(hG)r}r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh3]rhOX 1.7.   rr}r(hUhjubaubhOXWebDAV-Source-over-HTTPSrr}r(hUhjubeh&hubah&htubah&jubh)r}r(hUh(}r(h,]h-]h+]h*]h.]uhhh3]rhq)r}r(hUh(}r(h,]h-]h+]h*]h.]uhjh3]rhz)r}r(hUh(}r(h*]rUid11rah+]h,]h-]h.]UrefidUpython-with-m2cryptoruhjh3]r(hG)r}r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh3]rhOX 1.8.   rr}r(hUhjubaubhOXPython with M2Cryptorr}r(hUhjubeh&hubah&htubah&jubh)r}r(hUh(}r(h,]h-]h+]h*]h.]uhhh3]rhq)r}r(hUh(}r(h,]h-]h+]h*]h.]uhjh3]rhz)r}r(hUh(}r(h*]rUid12rah+]h,]h-]h.]UrefidUid2ruhjh3]r(hG)r}r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh3]rhOX 1.9.   rr}r(hUhjubaubhOXHTTPSrr}r(hUhjubeh&hubah&htubah&jubh)r}r(hUh(}r(h,]h-]h+]h*]h.]uhhh3]rhq)r}r(hUh(}r(h,]h-]h+]h*]h.]uhjh3]rhz)r}r(hUh(}r(h*]rUid13rah+]h,]h-]h.]UrefidUxmlrpc-over-httpsruhjh3]r(hG)r}r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh3]rhOX 1.10.   rr}r(hUhjubaubhOXXMLRPC-over-HTTPSrr}r(hUhjubeh&hubah&htubah&jubh)r}r(hUh(}r(h,]h-]h+]h*]h.]uhhh3]rhq)r}r(hUh(}r(h,]h-]h+]h*]h.]uhjh3]rhz)r}r(hUh(}r(h*]rUid14rah+]h,]h-]h.]UrefidU conclusionruhjh3]r(hG)r}r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh3]rhOX 1.11.   rr}r(hUhjubaubhOX Conclusionrr}r (hUhjubeh&hubah&htubah&jubeh&hubeh&jubaubeubh)r }r (hUhhhh h&h4h(}r (h,]h-]h+]h*]r hah.]rh auh1Kh2hh3]r(h>)r}r(hX Introductionrhj hh h&hBh(}r(hDKh*]h+]h,]h-]h.]h/huh1Kh2hh3]r(hG)r}r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh2hh3]rhOX 1.1.   rr}r(hUhNh1Nh2hhjubaubhOX Introductionrr}r(hUhNh1Nh2hhjubeubhq)r }r!(hX0ZServerSSL adds to Zope's ZServer the following:r"hj hh h&hth(}r#(h,]h-]h+]h*]h.]uh1Kh2hh3]r$hOX2ZServerSSL adds to Zope’s ZServer the following:r%r&}r'(hUhNh1Nh2hhj ubaubh)r(}r)(hUhj hh h&hh(}r*(Ubulletr+X-h*]h+]h,]h-]h.]uh1Kh2hh3]r,(h)r-}r.(hX HTTPS serverr/hj(hh h&jh(}r0(h,]h-]h+]h*]h.]uh1Nh2hh3]r1hq)r2}r3(hj/hj-hh h&hth(}r4(h,]h-]h+]h*]h.]uh1Kh3]r5hOX HTTPS serverr6r7}r8(hUhj2ubaubaubh)r9}r:(hX WebDAV-source-over-HTTPS server hj(hh h&jh(}r;(h,]h-]h+]h*]h.]uh1Nh2hh3]r<hq)r=}r>(hXWebDAV-source-over-HTTPS serverhj9hh h&hth(}r?(h,]h-]h+]h*]h.]uh1Kh3]r@hOXWebDAV-source-over-HTTPS serverrArB}rC(hUhj=ubaubaubeubhq)rD}rE(hXgWith the HTTPS server, ZServerSSL also provides WebDAV-over-HTTPS and XMLRPC-over-HTTPS access to Zope.hj hh h&hth(}rF(h,]h-]h+]h*]h.]uh1Kh2hh3]rGhOXgWith the HTTPS server, ZServerSSL also provides WebDAV-over-HTTPS and XMLRPC-over-HTTPS access to Zope.rHrI}rJ(hUhNh1Nh2hhjDubaubhq)rK}rL(hXThese instructions apply to both Un\*x and Windows installations of Zope 2.6.1. To avoid cluttering the presentation, Windows pathnames are shown in Un\*x fashion.hj hh h&hth(}rM(h,]h-]h+]h*]h.]uh1Kh2hh3]rNhOXThese instructions apply to both Un*x and Windows installations of Zope 2.6.1. To avoid cluttering the presentation, Windows pathnames are shown in Un*x fashion.rOrP}rQ(hUhNh1Nh2hhjKubaubeubh)rR}rS(hUhhhh h&h4h(}rT(h,]h-]h+]h*]rUjah.]rVh auh1K"h2hh3]rW(h>)rX}rY(hX PreparationrZhjRhh h&hBh(}r[(hDKh*]h+]h,]h-]h.]h/juh1K"h2hh3]r\(hG)r]}r^(hUhjXhNh&hJh(}r_(h,]h-]r`hMah+]h*]h.]uh1Nh2hh3]rahOX 1.2.   rbrc}rd(hUhNh1Nh2hhj]ubaubhOX Preparationrerf}rg(hUhNh1Nh2hhjXubeubcdocutils.nodes enumerated_list rh)ri}rj(hUhjRhh h&Uenumerated_listrkh(}rl(UsuffixrmU.h*]h+]h,]UprefixrnUh-]h.]UenumtyperoUarabicrpuh1K$h2hh3]rq(h)rr}rs(hXDDownload M2Crypto 0.11, contained in the file ``m2crypto-0.11.zip``.rthjihh h&jh(}ru(h,]h-]h+]h*]h.]uh1Nh2hh3]rvhq)rw}rx(hjthjrhh h&hth(}ry(h,]h-]h+]h*]h.]uh1K$h3]rz(hOX.Download M2Crypto 0.11, contained in the file r{r|}r}(hUhjwubcdocutils.nodes literal r~)r}r(hX``m2crypto-0.11.zip``h(}r(h,]h-]h+]h*]h.]uhjwh3]rhOXm2crypto-0.11.ziprr}r(hUhjubah&UliteralrubhOX.r}r(hUhjwubeubaubh)r}r(hXUnpack ``m2crypto-0.11.zip``. This will create a directory ``m2crypto-0.11``. Henceforth, we refer to this directory as ``$M2``.hjihh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r(hXUnpack ``m2crypto-0.11.zip``. This will create a directory ``m2crypto-0.11``. Henceforth, we refer to this directory as ``$M2``.hjhh h&hth(}r(h,]h-]h+]h*]h.]uh1K%h3]r(hOXUnpack rr}r(hUhjubj~)r}r(hX``m2crypto-0.11.zip``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOXm2crypto-0.11.ziprr}r(hUhjubah&jubhOX. This will create a directory rr}r(hUhjubj~)r}r(hX``m2crypto-0.11``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX m2crypto-0.11rr}r(hUhjubah&jubhOX,. Henceforth, we refer to this directory as rr}r(hUhjubj~)r}r(hX``$M2``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX$M2rr}r(hUhjubah&jubhOX.r}r(hUhjubeubaubh)r}r(hX:Install M2Crypto per the instructions in ``$M2/INSTALL``. hjihh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r(hX9Install M2Crypto per the instructions in ``$M2/INSTALL``.hjhh h&hth(}r(h,]h-]h+]h*]h.]uh1K'h3]r(hOX)Install M2Crypto per the instructions in rr}r(hUhjubj~)r}r(hX``$M2/INSTALL``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX $M2/INSTALLrr}r(hUhjubah&jubhOX.r}r(hUhjubeubaubeubhq)r}r(hXcThe ZServerSSL distribution is in ``$M2/demo/Zope``. We shall refer to this directory as ``$ZSSL``.hjRhh h&hth(}r(h,]h-]h+]h*]h.]uh1K)h2hh3]r(hOX"The ZServerSSL distribution is in rr}r(hUhNh1Nh2hhjubj~)r}r(hX``$M2/demo/Zope``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX $M2/demo/Zoperr}r(hUhjubah&jubhOX&. We shall refer to this directory as rr}r(hUhNh1Nh2hhjubj~)r}r(hX ``$ZSSL``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX$ZSSLrr}r(hUhjubah&jubhOX.r}r(hUhNh1Nh2hhjubeubeubh)r}r(hUhhhh h&h4h(}r(h,]h-]h+]h*]rj-ah.]rhauh1K-h2hh3]r(h>)r}r(hX Installationrhjhh h&hBh(}r(hDKh*]h+]h,]h-]h.]h/j,uh1K-h2hh3]r(hG)r}r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh2hh3]rhOX 1.3.   rr}r(hUhNh1Nh2hhjubaubhOX Installationrr}r(hUhNh1Nh2hhjubeubhq)r}r(hX>Below, we refer to your Zope top-level directory as ``$ZOPE``.rhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1K/h2hh3]r(hOX4Below, we refer to your Zope top-level directory as rr}r(hUhNh1Nh2hhjubj~)r}r(hX ``$ZOPE``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX$ZOPErr}r(hUhjubah&jubhOX.r}r(hUhNh1Nh2hhjubeubjh)r}r(hUhjhh h&jkh(}r(jmU.h*]h+]h,]jnUh-]h.]jojpuh1K1h2hh3]r (h)r }r (hX&Copy ``$ZSSL/z2s.py`` into ``$ZOPE``. hjhh h&jh(}r (h,]h-]h+]h*]h.]uh1Nh2hh3]r hq)r}r(hX%Copy ``$ZSSL/z2s.py`` into ``$ZOPE``.hj hh h&hth(}r(h,]h-]h+]h*]h.]uh1K1h3]r(hOXCopy rr}r(hUhjubj~)r}r(hX``$ZSSL/z2s.py``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX $ZSSL/z2s.pyrr}r(hUhjubah&jubhOX into rr}r(hUhjubj~)r}r (hX ``$ZOPE``h(}r!(h,]h-]h+]h*]h.]uhjh3]r"hOX$ZOPEr#r$}r%(hUhjubah&jubhOX.r&}r'(hUhjubeubaubh)r(}r)(hXDepending on your operating system, modify ``$ZOPE/start`` or ``$ZOPE/start.bat`` to invoke ``$ZOPE/z2s.py``, instead of ``$ZOPE/z2.py``. The files ``$ZSSL/starts`` and ``$ZSSL/starts.bat`` serve as examples. hjhh h&jh(}r*(h,]h-]h+]h*]h.]uh1Nh2hh3]r+hq)r,}r-(hXDepending on your operating system, modify ``$ZOPE/start`` or ``$ZOPE/start.bat`` to invoke ``$ZOPE/z2s.py``, instead of ``$ZOPE/z2.py``. The files ``$ZSSL/starts`` and ``$ZSSL/starts.bat`` serve as examples.hj(hh h&hth(}r.(h,]h-]h+]h*]h.]uh1K3h3]r/(hOX+Depending on your operating system, modify r0r1}r2(hUhj,ubj~)r3}r4(hX``$ZOPE/start``h(}r5(h,]h-]h+]h*]h.]uhj,h3]r6hOX $ZOPE/startr7r8}r9(hUhj3ubah&jubhOX or r:r;}r<(hUhj,ubj~)r=}r>(hX``$ZOPE/start.bat``h(}r?(h,]h-]h+]h*]h.]uhj,h3]r@hOX$ZOPE/start.batrArB}rC(hUhj=ubah&jubhOX to invoke rDrE}rF(hUhj,ubj~)rG}rH(hX``$ZOPE/z2s.py``h(}rI(h,]h-]h+]h*]h.]uhj,h3]rJhOX $ZOPE/z2s.pyrKrL}rM(hUhjGubah&jubhOX , instead of rNrO}rP(hUhj,ubj~)rQ}rR(hX``$ZOPE/z2.py``h(}rS(h,]h-]h+]h*]h.]uhj,h3]rThOX $ZOPE/z2.pyrUrV}rW(hUhjQubah&jubhOX . The files rXrY}rZ(hUhj,ubj~)r[}r\(hX``$ZSSL/starts``h(}r](h,]h-]h+]h*]h.]uhj,h3]r^hOX $ZSSL/startsr_r`}ra(hUhj[ubah&jubhOX and rbrc}rd(hUhj,ubj~)re}rf(hX``$ZSSL/starts.bat``h(}rg(h,]h-]h+]h*]h.]uhj,h3]rhhOX$ZSSL/starts.batrirj}rk(hUhjeubah&jubhOX serve as examples.rlrm}rn(hUhj,ubeubaubh)ro}rp(hXtCopy ``$ZSSL/dh1024.pem`` into ``$ZOPE``. This file contains Diffie-Hellman parameters for use by the SSL protocol. hjhh h&jh(}rq(h,]h-]h+]h*]h.]uh1Nh2hh3]rrhq)rs}rt(hXsCopy ``$ZSSL/dh1024.pem`` into ``$ZOPE``. This file contains Diffie-Hellman parameters for use by the SSL protocol.hjohh h&hth(}ru(h,]h-]h+]h*]h.]uh1K8h3]rv(hOXCopy rwrx}ry(hUhjsubj~)rz}r{(hX``$ZSSL/dh1024.pem``h(}r|(h,]h-]h+]h*]h.]uhjsh3]r}hOX$ZSSL/dh1024.pemr~r}r(hUhjzubah&jubhOX into rr}r(hUhjsubj~)r}r(hX ``$ZOPE``h(}r(h,]h-]h+]h*]h.]uhjsh3]rhOX$ZOPErr}r(hUhjubah&jubhOXK. This file contains Diffie-Hellman parameters for use by the SSL protocol.rr}r(hUhjsubeubaubh)r}r(hXCopy ``$ZSSL/randpool.dat`` into ``$ZOPE``. This file contains seed material for the OpenSSL PRNG. Alternatively, create ``$ZOPE/randpool.dat`` thusly:: $ dd if=/dev/urandom of=randpool.dat bs=1024 count=1 hjhh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]r(hq)r}r(hXCopy ``$ZSSL/randpool.dat`` into ``$ZOPE``. This file contains seed material for the OpenSSL PRNG. Alternatively, create ``$ZOPE/randpool.dat`` thusly::hjhh h&hth(}r(h,]h-]h+]h*]h.]uh1K;h3]r(hOXCopy rr}r(hUhjubj~)r}r(hX``$ZSSL/randpool.dat``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX$ZSSL/randpool.datrr}r(hUhjubah&jubhOX into rr}r(hUhjubj~)r}r(hX ``$ZOPE``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX$ZOPErr}r(hUhjubah&jubhOXO. This file contains seed material for the OpenSSL PRNG. Alternatively, create rr}r(hUhjubj~)r}r(hX``$ZOPE/randpool.dat``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX$ZOPE/randpool.datrr}r(hUhjubah&jubhOX thusly:rr}r(hUhjubeubcdocutils.nodes literal_block r)r}r(hX4$ dd if=/dev/urandom of=randpool.dat bs=1024 count=1hjh&U literal_blockrh(}r(U xml:spacerUpreserverh*]h+]h,]h-]h.]uh1K?h3]rhOX4$ dd if=/dev/urandom of=randpool.dat bs=1024 count=1rr}r(hUhjubaubeubh)r}r(hXCopy ``$ZSSL/ca.pem`` to ``$ZOPE``. This file contains an example Certification Authority (CA) certificate. For information on operating your own CA, see :ref:`howto-ca` or one of numerous similar documents available on the web. hjhh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r(hXCopy ``$ZSSL/ca.pem`` to ``$ZOPE``. This file contains an example Certification Authority (CA) certificate. For information on operating your own CA, see :ref:`howto-ca` or one of numerous similar documents available on the web.hjhh h&hth(}r(h,]h-]h+]h*]h.]uh1KAh3]r(hOXCopy rr}r(hUhjubj~)r}r(hX``$ZSSL/ca.pem``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX $ZSSL/ca.pemrr}r(hUhjubah&jubhOX to rr}r(hUhjubj~)r}r(hX ``$ZOPE``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX$ZOPErr}r(hUhjubah&jubhOXx. This file contains an example Certification Authority (CA) certificate. For information on operating your own CA, see rr}r(hUhjubcsphinx.addnodes pending_xref r)r}r(hX:ref:`howto-ca`rhjhh h&U pending_xrefrh(}r(UreftypeXrefUrefwarnrU reftargetrXhowto-caU refdomainXstdrh*]h+]U refexplicith,]h-]h.]UrefdocrXZServerSSL-HOWTOruh1KAh3]rcdocutils.nodes inline r)r}r(hjh(}r(h,]h-]r(UxrefrjXstd-refreh+]h*]h.]uhjh3]rhOXhowto-carr}r(hUhjubah&UinlinerubaubhOX; or one of numerous similar documents available on the web.rr}r(hUhjubeubaubh)r}r(hXCopy ``$ZSSL/server.pem`` to ``$ZOPE``. This file contains an RSA key pair and its X.509v3 certificate issued by the above CA. You may also create your own key/certificate bundle. hjhh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r(hXCopy ``$ZSSL/server.pem`` to ``$ZOPE``. This file contains an RSA key pair and its X.509v3 certificate issued by the above CA. You may also create your own key/certificate bundle.hjhh h&hth(}r(h,]h-]h+]h*]h.]uh1KFh3]r(hOXCopy rr}r(hUhjubj~)r}r(hX``$ZSSL/server.pem``h(}r (h,]h-]h+]h*]h.]uhjh3]r hOX$ZSSL/server.pemr r }r (hUhjubah&jubhOX to rr}r(hUhjubj~)r}r(hX ``$ZOPE``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX$ZOPErr}r(hUhjubah&jubhOX. This file contains an RSA key pair and its X.509v3 certificate issued by the above CA. You may also create your own key/certificate bundle.rr}r(hUhjubeubaubh)r}r(hX=Copy ``$ZSSL/ZServer/HTTPS_Server.py`` to ``$ZOPE/ZServer``. hjhh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r (hX<Copy ``$ZSSL/ZServer/HTTPS_Server.py`` to ``$ZOPE/ZServer``.hjhh h&hth(}r!(h,]h-]h+]h*]h.]uh1KJh3]r"(hOXCopy r#r$}r%(hUhjubj~)r&}r'(hX!``$ZSSL/ZServer/HTTPS_Server.py``h(}r((h,]h-]h+]h*]h.]uhjh3]r)hOX$ZSSL/ZServer/HTTPS_Server.pyr*r+}r,(hUhj&ubah&jubhOX to r-r.}r/(hUhjubj~)r0}r1(hX``$ZOPE/ZServer``h(}r2(h,]h-]h+]h*]h.]uhjh3]r3hOX $ZOPE/ZServerr4r5}r6(hUhj0ubah&jubhOX.r7}r8(hUhjubeubaubh)r9}r:(hX_Copy ``$ZSSL/ZServer/__init__.py`` to ``$ZOPE/ZServer``. This overwrites the existing ``$ZOPE/ZServer/__init__.py``. Alternatively, apply the following patch to ``$ZOPE/ZServer/__init__.py``:: --- __init__.py.org Sat Jun 21 23:20:41 2003 +++ __init__.py Tue Jan 7 23:30:53 2003 @@ -84,6 +84,7 @@ import asyncore from medusa import resolver, logger from HTTPServer import zhttp_server, zhttp_handler +from HTTPS_Server import zhttps_server, zhttps_handler from PCGIServer import PCGIServer from FCGIServer import FCGIServer from FTPServer import FTPServer hjhh h&jh(}r;(h,]h-]h+]h*]h.]uh1Nh2hh3]r<(hq)r=}r>(hXCopy ``$ZSSL/ZServer/__init__.py`` to ``$ZOPE/ZServer``. This overwrites the existing ``$ZOPE/ZServer/__init__.py``. Alternatively, apply the following patch to ``$ZOPE/ZServer/__init__.py``::hj9hh h&hth(}r?(h,]h-]h+]h*]h.]uh1KLh3]r@(hOXCopy rArB}rC(hUhj=ubj~)rD}rE(hX``$ZSSL/ZServer/__init__.py``h(}rF(h,]h-]h+]h*]h.]uhj=h3]rGhOX$ZSSL/ZServer/__init__.pyrHrI}rJ(hUhjDubah&jubhOX to rKrL}rM(hUhj=ubj~)rN}rO(hX``$ZOPE/ZServer``h(}rP(h,]h-]h+]h*]h.]uhj=h3]rQhOX $ZOPE/ZServerrRrS}rT(hUhjNubah&jubhOX. This overwrites the existing rUrV}rW(hUhj=ubj~)rX}rY(hX``$ZOPE/ZServer/__init__.py``h(}rZ(h,]h-]h+]h*]h.]uhj=h3]r[hOX$ZOPE/ZServer/__init__.pyr\r]}r^(hUhjXubah&jubhOX.. Alternatively, apply the following patch to r_r`}ra(hUhj=ubj~)rb}rc(hX``$ZOPE/ZServer/__init__.py``h(}rd(h,]h-]h+]h*]h.]uhj=h3]rehOX$ZOPE/ZServer/__init__.pyrfrg}rh(hUhjbubah&jubhOX:ri}rj(hUhj=ubeubj)rk}rl(hXt--- __init__.py.org Sat Jun 21 23:20:41 2003 +++ __init__.py Tue Jan 7 23:30:53 2003 @@ -84,6 +84,7 @@ import asyncore from medusa import resolver, logger from HTTPServer import zhttp_server, zhttp_handler +from HTTPS_Server import zhttps_server, zhttps_handler from PCGIServer import PCGIServer from FCGIServer import FCGIServer from FTPServer import FTPServerhj9h&jh(}rm(jjh*]h+]h,]h-]h.]uh1KPh3]rnhOXt--- __init__.py.org Sat Jun 21 23:20:41 2003 +++ __init__.py Tue Jan 7 23:30:53 2003 @@ -84,6 +84,7 @@ import asyncore from medusa import resolver, logger from HTTPServer import zhttp_server, zhttp_handler +from HTTPS_Server import zhttps_server, zhttps_handler from PCGIServer import PCGIServer from FCGIServer import FCGIServer from FTPServer import FTPServerrorp}rq(hUhjkubaubeubh)rr}rs(hXKCopy ``$ZSSL/ZServer/medusa/https_server.py`` to ``$ZOPE/ZServer/medusa``. hjhh h&jh(}rt(h,]h-]h+]h*]h.]uh1Nh2hh3]ruhq)rv}rw(hXJCopy ``$ZSSL/ZServer/medusa/https_server.py`` to ``$ZOPE/ZServer/medusa``.hjrhh h&hth(}rx(h,]h-]h+]h*]h.]uh1K[h3]ry(hOXCopy rzr{}r|(hUhjvubj~)r}}r~(hX(``$ZSSL/ZServer/medusa/https_server.py``h(}r(h,]h-]h+]h*]h.]uhjvh3]rhOX$$ZSSL/ZServer/medusa/https_server.pyrr}r(hUhj}ubah&jubhOX to rr}r(hUhjvubj~)r}r(hX``$ZOPE/ZServer/medusa``h(}r(h,]h-]h+]h*]h.]uhjvh3]rhOX$ZOPE/ZServer/medusarr}r(hUhjubah&jubhOX.r}r(hUhjvubeubaubh)r}r(hXStop Zope, if it is running. hjhh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r(hXStop Zope, if it is running.hjhh h&hth(}r(h,]h-]h+]h*]h.]uh1K^h3]rhOXStop Zope, if it is running.rr}r(hUhjubaubaubh)r}r(hX.Start Zope with ZServerSSL thusly:: ./starts -X -f 9021 -w 9080 -W 9081 -y 9443 -Y 9444 This starts the following: - an FTP server on port 9021 - a HTTP server on port 9080 - a WebDAV-source server on port 9081 - a HTTPS server on port 9443 - a WebDAV-source-over-HTTPS server on port 9444 hjhNh&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]r(hq)r}r(hX#Start Zope with ZServerSSL thusly::rhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1K`h3]rhOX"Start Zope with ZServerSSL thusly:rr}r(hUhjubaubj)r}r(hX3./starts -X -f 9021 -w 9080 -W 9081 -y 9443 -Y 9444hjh&jh(}r(jjh*]h+]h,]h-]h.]uh1Kbh3]rhOX3./starts -X -f 9021 -w 9080 -W 9081 -y 9443 -Y 9444rr}r(hUhjubaubhq)r}r(hXThis starts the following:rhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kdh3]rhOXThis starts the following:rr}r(hUhjubaubh)r}r(hUhjhh h&hh(}r(j+X-h*]h+]h,]h-]h.]uh1Kfh3]r(h)r}r(hXan FTP server on port 9021rh(}r(h,]h-]h+]h*]h.]uhjh3]rhq)r}r(hjhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kfh3]rhOXan FTP server on port 9021rr}r(hUhjubaubah&jubh)r}r(hXa HTTP server on port 9080rh(}r(h,]h-]h+]h*]h.]uhjh3]rhq)r}r(hjhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kgh3]rhOXa HTTP server on port 9080rr}r(hUhjubaubah&jubh)r}r(hX#a WebDAV-source server on port 9081rh(}r(h,]h-]h+]h*]h.]uhjh3]rhq)r}r(hjhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Khh3]rhOX#a WebDAV-source server on port 9081rr}r(hUhjubaubah&jubh)r}r(hXa HTTPS server on port 9443rh(}r(h,]h-]h+]h*]h.]uhjh3]rhq)r}r(hjhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kih3]rhOXa HTTPS server on port 9443rr}r(hUhjubaubah&jubh)r}r(hX/a WebDAV-source-over-HTTPS server on port 9444 h(}r(h,]h-]h+]h*]h.]uhjh3]rhq)r}r(hX.a WebDAV-source-over-HTTPS server on port 9444rhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kjh3]rhOX.a WebDAV-source-over-HTTPS server on port 9444rr}r(hUhjubaubah&jubeubeubeubeubh)r}r(hUhhhh h&h4h(}r(h,]h-]h+]h*]rjGah.]rh auh1Kmh2hh3]r(h>)r}r(hXTestingrhjhh h&hBh(}r(hDKh*]h+]h,]h-]h.]h/jFuh1Kmh2hh3]r(hG)r}r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh2hh3]rhOX 1.4.   rr}r(hUhNh1Nh2hhjubaubhOXTestingr r }r (hUhNh1Nh2hhjubeubhq)r }r (hX>Below, we assume your Zope server is running on ``localhost``.rhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Koh2hh3]r(hOX0Below, we assume your Zope server is running on rr}r(hUhNh1Nh2hhj ubj~)r}r(hX ``localhost``h(}r(h,]h-]h+]h*]h.]uhj h3]rhOX localhostrr}r(hUhjubah&jubhOX.r}r(hUhNh1Nh2hhj ubeubeubh)r}r(hUhKhhhh h&h4h(}r(h,]r Xhttpsr!ah-]h+]h*]r"jaah.]uh1Krh2hh3]r#(h>)r$}r%(hXHTTPSr&hjhh h&hBh(}r'(hDKh*]h+]h,]h-]h.]h/j`uh1Krh2hh3]r((hG)r)}r*(hUhj$hNh&hJh(}r+(h,]h-]r,hMah+]h*]h.]uh1Nh2hh3]r-hOX 1.5.   r.r/}r0(hUhNh1Nh2hhj)ubaubhOXHTTPSr1r2}r3(hUhNh1Nh2hhj$ubeubhq)r4}r5(hX1This testing is done with Mozilla 1.1 on FreeBSD.r6hjhh h&hth(}r7(h,]h-]h+]h*]h.]uh1Kth2hh3]r8hOX1This testing is done with Mozilla 1.1 on FreeBSD.r9r:}r;(hUhNh1Nh2hhj4ubaubjh)r<}r=(hUhjhh h&jkh(}r>(jmU.h*]h+]h,]jnUh-]h.]jojpuh1Kvh2hh3]r?(h)r@}rA(hXxWith a browser, connect to https://localhost:9443/. Browse around. Check out your browser's HTTPS informational screens.hj<hh h&jh(}rB(h,]h-]h+]h*]h.]uh1Nh2hh3]rChq)rD}rE(hXxWith a browser, connect to https://localhost:9443/. Browse around. Check out your browser's HTTPS informational screens.hj@hh h&hth(}rF(h,]h-]h+]h*]h.]uh1Kvh3]rG(hOXWith a browser, connect to rHrI}rJ(hUhjDubhz)rK}rL(hXhttps://localhost:9443/rMh(}rN(UrefurijMh*]h+]h,]h-]h.]uhjDh3]rOhOXhttps://localhost:9443/rPrQ}rR(hUhjKubah&hubhOXH. Browse around. Check out your browser’s HTTPS informational screens.rSrT}rU(hUhjDubeubaubh)rV}rW(hXfConnect to https://localhost:9443/manage. Verify that you can access Zope's management functionality. hj<hh h&jh(}rX(h,]h-]h+]h*]h.]uh1Nh2hh3]rYhq)rZ}r[(hXeConnect to https://localhost:9443/manage. Verify that you can access Zope's management functionality.hjVhh h&hth(}r\(h,]h-]h+]h*]h.]uh1Kxh3]r](hOX Connect to r^r_}r`(hUhjZubhz)ra}rb(hXhttps://localhost:9443/managerch(}rd(Urefurijch*]h+]h,]h-]h.]uhjZh3]rehOXhttps://localhost:9443/managerfrg}rh(hUhjaubah&hubhOX?. Verify that you can access Zope’s management functionality.rirj}rk(hUhjZubeubaubeubeubh)rl}rm(hUhhhh h&h4h(}rn(h,]h-]h+]h*]roj{ah.]rphauh1K|h2hh3]rq(h>)rr}rs(hXWebDAV-over-HTTPSrthjlhh h&hBh(}ru(hDKh*]h+]h,]h-]h.]h/jzuh1K|h2hh3]rv(hG)rw}rx(hUhjrhNh&hJh(}ry(h,]h-]rzhMah+]h*]h.]uh1Nh2hh3]r{hOX 1.6.   r|r}}r~(hUhNh1Nh2hhjwubaubhOXWebDAV-over-HTTPSrr}r(hUhNh1Nh2hhjrubeubhq)r}r(hX6This testing is done with Cadaver 0.21.0 on FreeBSD.::rhjlhh h&hth(}r(h,]h-]h+]h*]h.]uh1K~h2hh3]rhOX5This testing is done with Cadaver 0.21.0 on FreeBSD.:rr}r(hUhNh1Nh2hhjubaubj)r}r(hX9$ cadaver https://localhost:9443/ WARNING: Untrusted server certificate presented: Issued to: M2Crypto, SG Issued by: M2Crypto, SG Do you wish to accept the certificate? (y/n) y dav:/> ls Listing collection `/': succeeded. Coll: Channels 0 Jun 19 00:04 Coll: Control_Panel 0 Jun 6 00:13 Coll: Examples 0 Jun 6 00:12 Coll: catalog 0 Jun 12 11:53 Coll: ngps 0 Jun 16 15:34 Coll: portal 0 Jun 21 15:21 Coll: skunk 0 Jun 18 21:18 Coll: temp_folder 0 Jun 22 17:57 Coll: zope 0 Jun 20 15:27 acl_users 0 Dec 30 1998 browser_id_manager 0 Jun 6 00:12 default.css 3037 Jun 21 16:38 error_log 0 Jun 6 00:12 index_html 313 Jun 12 13:36 portal0 0 Jun 21 15:21 session_data_manager 0 Jun 6 00:12 standard_error_message 1365 Jan 21 2001 standard_html_footer 50 Jun 12 12:30 standard_html_header 80 Jan 21 2001 standard_template.pt 282 Jun 6 00:12 zsyncer 0 Jun 17 15:28 dav:/> quit Connection to `localhost' closed. $hjlhh h&jh(}r(jjh*]h+]h,]h-]h.]uh1Kh2hh3]rhOX9$ cadaver https://localhost:9443/ WARNING: Untrusted server certificate presented: Issued to: M2Crypto, SG Issued by: M2Crypto, SG Do you wish to accept the certificate? (y/n) y dav:/> ls Listing collection `/': succeeded. Coll: Channels 0 Jun 19 00:04 Coll: Control_Panel 0 Jun 6 00:13 Coll: Examples 0 Jun 6 00:12 Coll: catalog 0 Jun 12 11:53 Coll: ngps 0 Jun 16 15:34 Coll: portal 0 Jun 21 15:21 Coll: skunk 0 Jun 18 21:18 Coll: temp_folder 0 Jun 22 17:57 Coll: zope 0 Jun 20 15:27 acl_users 0 Dec 30 1998 browser_id_manager 0 Jun 6 00:12 default.css 3037 Jun 21 16:38 error_log 0 Jun 6 00:12 index_html 313 Jun 12 13:36 portal0 0 Jun 21 15:21 session_data_manager 0 Jun 6 00:12 standard_error_message 1365 Jan 21 2001 standard_html_footer 50 Jun 12 12:30 standard_html_header 80 Jan 21 2001 standard_template.pt 282 Jun 6 00:12 zsyncer 0 Jun 17 15:28 dav:/> quit Connection to `localhost' closed. $rr}r(hUhjubaubeubh)r}r(hUhhhh h&h4h(}r(h,]h-]h+]h*]rjah.]rh auh1Kh2hh3]r(h>)r}r(hXWebDAV-Source-over-HTTPSrhjhh h&hBh(}r(hDKh*]h+]h,]h-]h.]h/juh1Kh2hh3]r(hG)r}r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh2hh3]rhOX 1.7.   rr}r(hUhNh1Nh2hhjubaubhOXWebDAV-Source-over-HTTPSrr}r(hUhNh1Nh2hhjubeubhq)r}r(hX1This testing is done with Mozilla 1.1 on FreeBSD.rhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kh2hh3]rhOX1This testing is done with Mozilla 1.1 on FreeBSD.rr}r(hUhNh1Nh2hhjubaubjh)r}r(hUhjhh h&jkh(}r(jmU.h*]h+]h,]jnUh-]h.]jojpuh1Kh2hh3]r(h)r}r(hX!Open the Mozilla Composer window.rhjhh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r(hjhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kh3]rhOX!Open the Mozilla Composer window.rr}r(hUhjubaubaubh)r}r(hX8Click "File", "Open Web Location". A dialog box appears.rhjhh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r(hjhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kh3]rhOX@Click “File”, “Open Web Location”. A dialog box appears.rr}r(hUhjubaubaubh)r}r(hX8Enter ``https://localhost:9444/index_html`` for the URL.rhjhh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r(hjhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kh3]r(hOXEnter rr}r(hUhjubj~)r}r(hX%``https://localhost:9444/index_html``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX!https://localhost:9444/index_htmlrr}r(hUhjubah&jubhOX for the URL.rr}r(hUhjubeubaubh)r}r(hX%Select "Open in new Composer window."rhjhh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r(hjhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kh3]rhOX)Select “Open in new Composer window.”rr}r(hUhjubaubaubh)r}r(hXJClick "Open". A new Composer window will open with ``index_html`` loaded. hjhh h&jh(}r(h,]h-]h+]h*]h.]uh1Nh2hh3]rhq)r}r(hXIClick "Open". A new Composer window will open with ``index_html`` loaded.hjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kh3]r(hOX7Click “Open”. A new Composer window will open with rr}r(hUhjubj~)r}r(hX``index_html``h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX index_htmlrr}r(hUhjubah&jubhOX loaded.rr}r(hUhjubeubaubeubeubh)r}r(hUhhhh h&h4h(}r(h,]h-]h+]h*]rjah.]rhauh1Kh2hh3]r(h>)r}r (hXPython with M2Cryptor hjhh h&hBh(}r (hDKh*]h+]h,]h-]h.]h/juh1Kh2hh3]r (hG)r }r(hUhjhNh&hJh(}r(h,]h-]rhMah+]h*]h.]uh1Nh2hh3]rhOX 1.8.   rr}r(hUhNh1Nh2hhj ubaubhOXPython with M2Cryptorr}r(hUhNh1Nh2hhjubeubhq)r}r(hXDThis testing is done with M2Crypto 0.11 and Python 2.2.2 on FreeBSD.rhjhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kh2hh3]rhOXDThis testing is done with M2Crypto 0.11 and Python 2.2.2 on FreeBSD.rr}r(hUhNh1Nh2hhjubaubeubh)r }r!(hUhKhhhh h&h4h(}r"(h,]r#j!ah-]h+]h*]r$jah.]uh1Kh2hh3]r%(h>)r&}r'(hXHTTPSr(hj hh h&hBh(}r)(hDKh*]h+]h,]h-]h.]h/juh1Kh2hh3]r*(hG)r+}r,(hUhj&hNh&hJh(}r-(h,]h-]r.hMah+]h*]h.]uh1Nh2hh3]r/hOX 1.9.   r0r1}r2(hUhNh1Nh2hhj+ubaubhOXHTTPSr3r4}r5(hUhNh1Nh2hhj&ubeubj)r6}r7(hXU>>> from M2Crypto import Rand, SSL, m2urllib >>> url = m2urllib.FancyURLopener() >>> url.addheader('Connection', 'close') >>> u = url.open('https://127.0.0.1:9443/') send: 'GET / HTTP/1.1\r\nHost: 127.0.0.1:9443\r\nAccept-Encoding: identity\r\nUser-agent: Python-urllib/1.15\r\nConnection: close\r\n\r\n' reply: 'HTTP/1.1 200 OK\r\n' header: Server: ZServerSSL/0.11 header: Date: Sun, 22 Jun 2003 13:42:34 GMT header: Connection: close header: Content-Type: text/html header: Etag: header: Content-Length: 535 >>> while 1: ... data = u.read() ... if not data: break ... print(data) ...hj hh h&jh(}r8(jjh*]h+]h,]h-]h.]uh1Kh2hh3]r9hOXU>>> from M2Crypto import Rand, SSL, m2urllib >>> url = m2urllib.FancyURLopener() >>> url.addheader('Connection', 'close') >>> u = url.open('https://127.0.0.1:9443/') send: 'GET / HTTP/1.1\r\nHost: 127.0.0.1:9443\r\nAccept-Encoding: identity\r\nUser-agent: Python-urllib/1.15\r\nConnection: close\r\n\r\n' reply: 'HTTP/1.1 200 OK\r\n' header: Server: ZServerSSL/0.11 header: Date: Sun, 22 Jun 2003 13:42:34 GMT header: Connection: close header: Content-Type: text/html header: Etag: header: Content-Length: 535 >>> while 1: ... data = u.read() ... if not data: break ... print(data) ...r:r;}r<(hUhj6ubaubj)r=}r>(hX Zope

NgPS Desktop Portal

  So many hacks.
  So little time.

Link Farm


Powered by Zopehj hh h&jh(}r?(jjh*]h+]h,]h-]h.]uh1Kh2hh3]r@hOX Zope

NgPS Desktop Portal

  So many hacks.
  So little time.

Link Farm


Powered by ZoperArB}rC(hUhj=ubaubj)rD}rE(hX>>> u.close() >>>hj hh h&jh(}rF(jjh*]h+]h,]h-]h.]uh1Kh2hh3]rGhOX>>> u.close() >>>rHrI}rJ(hUhjDubaubeubh)rK}rL(hUhhhh h&h4h(}rM(h,]h-]h+]h*]rNjah.]rOh auh1Kh2hh3]rP(h>)rQ}rR(hXXMLRPC-over-HTTPSrShjKhh h&hBh(}rT(hDKh*]h+]h,]h-]h.]h/juh1Kh2hh3]rU(hG)rV}rW(hUhjQhNh&hJh(}rX(h,]h-]rYhMah+]h*]h.]uh1Nh2hh3]rZhOX 1.10.   r[r\}r](hUhNh1Nh2hhjVubaubhOXXMLRPC-over-HTTPSr^r_}r`(hUhNh1Nh2hhjQubeubj)ra}rb(hX>>> from M2Crypto.m2xmlrpclib import Server, SSL_Transport >>> zs = Server('https://127.0.0.1:9443/', SSL_Transport()) >>> print(zs.propertyMap()) [{'type': 'string', 'id': 'title', 'mode': 'w'}] >>>hjKhh h&jh(}rc(jjh*]h+]h,]h-]h.]uh1Kh2hh3]rdhOX>>> from M2Crypto.m2xmlrpclib import Server, SSL_Transport >>> zs = Server('https://127.0.0.1:9443/', SSL_Transport()) >>> print(zs.propertyMap()) [{'type': 'string', 'id': 'title', 'mode': 'w'}] >>>rerf}rg(hUhjaubaubeubh)rh}ri(hUhhhh h&h4h(}rj(h,]h-]h+]h*]rkjah.]rlhauh1Kh2hh3]rm(h>)rn}ro(hX Conclusionrphjhhh h&hBh(}rq(hDKh*]h+]h,]h-]h.]h/juh1Kh2hh3]rr(hG)rs}rt(hUhjnhNh&hJh(}ru(h,]h-]rvhMah+]h*]h.]uh1Nh2hh3]rwhOX 1.11.   rxry}rz(hUhNh1Nh2hhjsubaubhOX Conclusionr{r|}r}(hUhNh1Nh2hhjnubeubhq)r~}r(hXWell, it works! ;-)rhjhhh h&hth(}r(h,]h-]h+]h*]h.]uh1Kh2hh3]rhOXWell, it works! ;-)rr}r(hUhNh1Nh2hhj~ubaubeubeubhh h&Usystem_messagerh(}r(h,]UlevelKh*]h+]rh9aUsourceh h-]h.]UlineKUtypeUINFOruh1Kh2hh3]rhq)r}r(hX3Duplicate implicit target name: "zserverssl-howto".h(}r(h,]h-]h+]h*]h.]uhhh3]rhOX7Duplicate implicit target name: “zserverssl-howto”.rr}r(hUhjubah&htubaubh)r}r(hUhj hh h&jh(}r(h,]UlevelKh*]h+]rjaUsourceh h-]h.]UlineKUtypejuh1Kh2hh3]rhq)r}r(hX(Duplicate implicit target name: "https".h(}r(h,]h-]h+]h*]h.]uhjh3]rhOX,Duplicate implicit target name: “https”.rr}r(hUhjubah&htubaubeUcurrent_sourcerNU decorationrNUautofootnote_startrKUnameidsr}r(hjhj{hj-h hh jGh jh jh jhNhh0hhhjuh3]r(h$hehUU transformerrNU footnote_refsr}rUrefnamesr}rUsymbol_footnotesr]rUautofootnote_refsr]rUsymbol_footnote_refsr]rU citationsr]rh2hU current_linerNUtransform_messagesr]rh)r}r(hUh(}r(h,]UlevelKh*]h+]Usourceh h-]h.]UlineKUtypejuh3]rhq)r}r(hUh(}r(h,]h-]h+]h*]h.]uhjh3]rhOX6Hyperlink target "zserverssl-howto" is not referenced.rr}r(hUhjubah&htubah&jubaUreporterrNUid_startrKU autofootnotesr]rU citation_refsr}rUindirect_targetsr]rUsettingsr(cdocutils.frontend Values ror}r(Ufootnote_backlinksrKUrecord_dependenciesrNU rfc_base_urlrUhttps://tools.ietf.org/html/rU tracebackrUpep_referencesrNUstrip_commentsrNU toc_backlinksrUentryrU language_coderUenrU datestamprNU report_levelrKU _destinationrNU halt_levelrKU strip_classesrNhBNUerror_encoding_error_handlerrUbackslashreplacerUdebugrNUembed_stylesheetrUoutput_encoding_error_handlerrUstrictrU sectnum_xformrKUdump_transformsrNU docinfo_xformrKUwarning_streamrNUpep_file_url_templaterUpep-%04drUexit_status_levelrKUconfigrNUstrict_visitorrNUcloak_email_addressesrUtrim_footnote_reference_spacerUenvrNUdump_pseudo_xmlrNUexpose_internalsrNUsectsubtitle_xformrU source_linkrNUrfc_referencesrNUoutput_encodingrUutf-8rU source_urlrNUinput_encodingrU utf-8-sigrU_disable_configrNU id_prefixrUUcharacter_level_inline_markuprU tab_widthrKUerror_encodingrUUTF-8rU_sourcerh Ugettext_compactrU generatorrNUdump_internalsrNU smart_quotesrU pep_base_urlrU https://www.python.org/dev/peps/rUsyntax_highlightrUlongrUinput_encoding_error_handlerrjUauto_id_prefixrUidrUdoctitle_xformr Ustrip_elements_with_classesr NU _config_filesr ]Ufile_insertion_enabledr U raw_enabledr KU dump_settingsrNubUsymbol_footnote_startrKh*}r(j{jlh0hhhj`j\jzjvhj jFjBhhjjjj hEhh9hjjjjjjjjjjjajjjhjjjGjjjKj-jjjRj,j(jjuUsubstitution_namesr}rh&h2h(}r(h,]h*]h+]Usourceh h-]h.]uU footnotesr]rUrefidsr}rh0]rh$asub.M2Crypto-0.31.0/doc/doctrees/environment.pickle0000664000175000001440000167565113236336220021672 0ustar matejusers00000000000000csphinx.environment BuildEnvironment q)q}q(Udlfilesqcsphinx.util FilenameUniqDict q)qc__builtin__ set q]RqbU reread_alwaysq h]Rq Utitlesq }q (X howto.sslq cdocutils.nodes title q)q}q(U rawsourceqUU attributesq}q(Udupnamesq]Uclassesq]Unamesq]Uidsq]Ubackrefsq]uUchildrenq]qcdocutils.nodes Text qX.HOWTO: Programming SSL in Python with M2Cryptoqq}q(hUUparentqhubaUtagnameq Utitleq!ubXindexq"h)q#}q$(hUh}q%(h]h]h]h]h]uh]q&hX&Welcome to M2Crypto’s documentation!q'q(}q)(hUhh#ubah h!ubXZServerSSL-HOWTOq*h)q+}q,(hUh}q-(h]h]h]h]h]uh]q.(cdocutils.nodes generated q/)q0}q1(hUhh+Usourceq2Nh U generatedq3h}q4(h]h]q5Usectnumq6ah]h]h]uUlineq7Nh]q8hX1.   q9q:}q;(hUhh0ubaubhXZServerSSL-HOWTOq(hUhh+ubeh h!ubXM2Cryptoq?h)q@}qA(hUh}qB(UdupnamesqC]UclassesqD]UbackrefsqE]UidsqF]UnamesqG]uh]qHhXM2Crypto PackageqIqJ}qK(hUhh@ubah UtitleqLubXhowto.caqMh)qN}qO(hUh}qP(h]h]h]h]h]uh]qQhX(HOWTO: Creating your own CA with OpenSSLqRqS}qT(hUhhNubah h!ubX M2Crypto.SSLqUh)qV}qW(hUh}qX(hC]hD]hE]hF]hG]uh]qYhX SSL PackageqZq[}q\(hUhhVubah hLubX howto.smimeq]h)q^}q_(hUh}q`(h]h]h]h]h]uh]qahX1HOWTO: Programming S/MIME in Python with M2Cryptoqbqc}qd(hUhh^ubah h!ubuU domaindataqe}qf(Ustd}qg(U anonlabels}qh(UsearchqihiUX howto-sslqjh U howto-sslqkUmodindexqlU py-modindexUXhowto-caqmhMUhowto-caqnUgenindexqohoUX howto-smimeqph]U howto-smimeqqXzserverssl-howtoqrh*Uzserverssl-howtoqsuUobjectsqt}U citations}Ulabels}qu(hihiUcsphinx.locale _TranslationProxy qvcsphinx.locale mygettext qwU Search Pageqxqyhwhxqzbhjh hkX.HOWTO: Programming SSL in Python with M2CryptohlU py-modindexUhvhwU Module Indexq{q|hwh{q}bhmhMhnX(HOWTO: Creating your own CA with OpenSSLhohoUhvhwUIndexq~qhwh~qbhph]hqX1HOWTO: Programming S/MIME in Python with M2Cryptohrh*hsX1.   ZServerSSL-HOWTOuUversionqKU citation_refs}U progoptions}uUc}q(ht}hKuUpy}q(ht}q(X;M2Crypto.SSL.Connection.Connection.set_socket_write_timeoutqhUXmethodqX-M2Crypto.SSL.Context.Context.load_verify_infoqhUXmethodqXM2Crypto.EC.EC.pubqh?XmethodX&M2Crypto.X509.X509_Store.set_verify_cbqh?XmethodX%M2Crypto.SMIME.SMIME.unset_x509_storeqh?XmethodXM2Crypto.AuthCookie.mixqh?XfunctionX&M2Crypto.EVP.Cipher.m2_cipher_ctx_freeqh?XmethodXM2Crypto.EC.EC.save_pub_key_bioqh?XmethodX!M2Crypto.EVP.MessageDigest.updateqh?XmethodX&M2Crypto.X509.Request.m2_x509_req_freeqh?XmethodXM2Crypto.SSL.SessionqhUUmoduleqX.M2Crypto.SSL.Connection.Connection.get_ciphersqhUXmethodqXM2Crypto.SSL.Session.SessionqhUXclassqX+M2Crypto.SSL.Checker.Checker.numericIpMatchqhUX attributeqX1M2Crypto.SSL.Context.Context.get_allow_unknown_caqhUXmethodqXM2Crypto.EC.pub_key_from_paramsqh?XfunctionX2M2Crypto.SSL.Connection.Connection.get_cipher_listqhUXmethodqX(M2Crypto.SSL.Session.Session.set_timeoutqhUXmethodqX!M2Crypto.SSL.Session.load_sessionqhUXfunctionqXM2Crypto.SMIME.SMIME.decryptqh?XmethodXM2Crypto.BIO.BIO.bio_ptrqh?XmethodX2M2Crypto.SSL.Connection.Connection.set_cipher_listqhUXmethodqX M2Crypto.X509.new_stack_from_derqh?XfunctionXM2Crypto.SSL.ConnectionqhUhXM2Crypto.X509.X509.as_textqh?XmethodXM2Crypto.DSA.DSA_pub.sign_asn1qh?XmethodX(M2Crypto.SSL.Context.Context.add_sessionqhUXmethodqX(M2Crypto.X509.X509_Name_Entry.set_objectqh?XmethodX!M2Crypto.SMIME.SMIME.load_key_bioqh?XmethodXEM2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.loseConnectionqhUXmethodqXM2Crypto.SSL.Checker.WrongHostqhUX exceptionqX)M2Crypto.SSL.Connection.Connection.acceptqhUXmethodqX"M2Crypto.EC.load_key_string_pubkeyqh?XfunctionXM2Crypto.SSL.Checker.CheckerqhUXclassqXM2Crypto.BIO.openfileqh?XfunctionXM2Crypto.callbackqh?hXM2Crypto.EVP.PKey.assign_rsaqh?XmethodXM2Crypto.SSL.Context.mapqhUXfunctionqXM2Crypto.EVP.PKey.as_derqh?XmethodXM2Crypto.SSL.SSLServerqhUhX!M2Crypto.ftpslib.FTP_TLS.auth_sslqh?XmethodXM2Crypto.EC.EC.verify_dsa_asn1qh?XmethodX?M2Crypto.SSL.Connection.Connection.set_client_CA_list_from_fileqhUXmethodqXM2Crypto.EVP.PKey.reset_contextqh?XmethodX!M2Crypto.X509.Request.set_subjectqh?XmethodXM2Crypto.X509.Request.save_pemqh?XmethodXM2Crypto.RSA.RSA.save_key_derqh?XmethodX(M2Crypto.SSL.Connection.Connection.clearqhUXmethodqdžX&M2Crypto.X509.X509_Extension_Stack.popqh?XmethodX'M2Crypto.SSL.Connection.Connection.bindqhUXmethodqʆX)M2Crypto.SSL.Checker.SSLVerificationErrorqhUX exceptionq̆X+M2Crypto.SSL.Context.Context.remove_sessionqhUXmethodqΆXM2Crypto.Rand.load_fileqh?XfunctionXM2Crypto.EC.EC.sign_dsaqh?XmethodXM2Crypto.SMIME.smime_load_pkcs7qh?XfunctionXM2Crypto.DSA.DSA_pub.signqh?XmethodXM2Crypto.SMIME.SMIME.unset_keyqh?XmethodXM2Crypto.X509.X509_Stack.pushqh?XmethodXEM2Crypto.SSL.Connection.Connection.set_post_connection_check_callbackqhUXmethodqֆXM2Crypto.EVP.PKey.save_keyqh?XmethodXM2Crypto.X509.X509.m2_x509_freeqh?XmethodXM2Crypto.ftpslib.FTP_TLS.prot_pqh?XmethodX!M2Crypto.X509.load_request_stringqh?XfunctionX!M2Crypto.httpslib.HTTPSConnectionqh?XclassX-M2Crypto.SSL.Connection.Connection.settimeoutqhUXmethodq݆X"M2Crypto.ASN1.LocalTimezone.tznameqh?XmethodXM2Crypto.X509.X509.as_pemqh?XmethodX$M2Crypto.RSA.RSA_pub.private_encryptqh?XmethodX&M2Crypto.X509.X509_Name_Entry.set_dataqh?XmethodXM2Crypto.SMIMEqh?hX1M2Crypto.httpslib.ProxyHTTPSConnection.endheadersqh?XmethodXM2Crypto.EC.ECqh?XclassX-M2Crypto.SSL.Context.Context.get_verify_depthqhUXmethodqX(M2Crypto.SSL.Context.Context.set_tmp_rsaqhUXmethodqXM2Crypto.BIO.BIO.write_closeqh?XmethodX M2Crypto.X509qh?hX M2Crypto.RC4qh?hXM2Crypto.RSA.RSAqh?XclassX.M2Crypto.SSL.Connection.Connection.set_sessionqhUXmethodqXM2Crypto.X509.X509_Extensionqh?XclassXM2Crypto.EC.load_pub_keyqh?XfunctionX!M2Crypto.util.passphrase_callbackqh?XfunctionXM2Crypto.BIO.BIO.should_retryqh?XmethodX%M2Crypto.SSL.Session.Session.get_timeqhUXmethodqXM2Crypto.X509.X509qh?XclassX-M2Crypto.SSL.Connection.Connection.setsockoptqhUXmethodqX!M2Crypto.SMIME.PKCS7.get0_signersqh?XmethodXM2Crypto.SMIME.Cipherqh?XclassX#M2Crypto.SMIME.SMIME.set_x509_stackqh?XmethodX"M2Crypto.m2xmlrpclib.SSL_Transportqh?XclassX*M2Crypto.SSL.Connection.Connection.sendallqhUXmethodqXM2Crypto.AuthCookie.AuthCookieqh?XclassXM2Crypto.SSL.timeoutqhUhX$M2Crypto.RSA.RSA_pub.private_decryptrh?XmethodX M2Crypto.X509.X509.get_ext_countrh?XmethodXM2Crypto.RSA.RSA.public_decryptrh?XmethodX"M2Crypto.SSL.Context.Context.closerhUXmethodrX)M2Crypto.X509.X509_Name.m2_x509_name_freerh?XmethodXM2Crypto.BIO.BIO.readlinerh?XmethodXM2Crypto.RSA.RSA.check_keyrh?XmethodXM2Crypto.ftpslib.FTP_TLSrh?XclassXM2Crypto.Engine.EngineErrorr h?X exceptionX)M2Crypto.X509.X509_Extension.set_criticalr h?XmethodXM2Crypto.EVP.PKey.verify_initr h?XmethodXM2Crypto.DSA.DSA_pub.save_keyr h?XmethodX!M2Crypto.X509.Request.get_subjectr h?XmethodXM2Crypto.EVP.HMAC.digestrh?XmethodXM2Crypto.ASN1.ASN1_Objectrh?XclassXM2Crypto.EVP.Cipher.finalrh?XmethodXM2Crypto.ftpslib.FTP_TLS.prot_crh?XmethodX M2Crypto.X509.X509.check_purposerh?XmethodX M2Crypto.X509.X509.set_not_afterrh?XmethodX-M2Crypto.ASN1.ASN1_String.m2_asn1_string_freerh?XmethodX M2Crypto.EVP.MessageDigest.finalrh?XmethodX%M2Crypto.SMIME.SMIME.unset_x509_stackrh?XmethodX<M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.clearrhUXmethodrX#M2Crypto.AuthCookie.AuthCookie.datarh?XmethodX)M2Crypto.EVP.MessageDigest.m2_md_ctx_freerh?XmethodX'M2Crypto.Engine.Engine.load_private_keyrh?XmethodXM2Crypto.X509.Request.as_derrh?XmethodXM2Crypto.m2urllib.open_httpsrh?XfunctionX(M2Crypto.SSL.Session.Session.get_timeoutrhUXmethodrX9M2Crypto.SSL.Context.Context.set_client_CA_list_from_filer hUXmethodr!X"M2Crypto.Err.get_x509_verify_errorr"h?XfunctionXM2Crypto.BIO.BIO.m2_bio_freer#h?XmethodXM2Crypto.Rand.rand_statusr$h?XfunctionXM2Crypto.X509.X509.verifyr%h?XmethodX<M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.writer&hUXmethodr'XM2Crypto.DSA.DSA.verify_asn1r(h?XmethodXM2Crypto.RSA.rsa_errorr)h?XfunctionX&M2Crypto.X509.Request.set_subject_namer*h?XmethodXM2Crypto.EC.ECErrorr+h?X exceptionX1M2Crypto.SSL.Context.Context.set_tmp_rsa_callbackr,hUXmethodr-XM2Crypto.SMIME.PKCS7r.h?XclassXM2Crypto.EC.EC.m2_ec_key_freer/h?XmethodXM2Crypto.AuthCookie.unmix3r0h?XfunctionX.M2Crypto.httpslib.ProxyHTTPSConnection.connectr1h?XmethodX$M2Crypto.util.no_passphrase_callbackr2h?XfunctionX,M2Crypto.SSL.Connection.Connection.verify_okr3hUXmethodr4X)M2Crypto.X509.X509_Extension.get_criticalr5h?XmethodXM2Crypto.RSA.load_keyr6h?XfunctionXM2Crypto.DH.DH.compute_keyr7h?XmethodX-M2Crypto.m2urllib2.HTTPSHandler.https_requestr8h?XmethodXM2Crypto.BN.randfnamer9h?XfunctionX%M2Crypto.SSL.Session.Session.set_timer:hUXmethodr;XM2Crypto.EVP.Cipher.set_paddingr<h?XmethodX"M2Crypto.BIO.CipherStream.SALT_LENr=h?X attributeX M2Crypto.SSL.Cipher.Cipher_Stackr>hUXclassr?X"M2Crypto.SMIME.PKCS7.m2_pkcs7_freer@h?XmethodX5M2Crypto.X509.X509_Name_Entry.m2_x509_name_entry_freerAh?XmethodXM2Crypto.EC.EC.check_keyrBh?XmethodXM2Crypto.EC.ec_errorrCh?XfunctionX M2Crypto.DSA.pub_key_from_paramsrDh?XfunctionXM2Crypto.util.pkcs7_padrEh?XfunctionX<M2Crypto.SSL.Connection.Connection.serverPostConnectionCheckrFhUXmethodrGX/M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.recvrHhUXmethodrIXM2Crypto.X509.X509_Name.as_derrJh?XmethodXM2Crypto.EVP.MessageDigestrKh?XclassX0M2Crypto.httpslib.ProxyHTTPSConnection.putheaderrLh?XmethodXM2Crypto.X509.X509ErrorrMh?X exceptionXM2Crypto.X509.X509.get_ext_atrNh?XmethodXM2Crypto.EVP.HMAC.finalrOh?XmethodXM2Crypto.DSA.DSArPh?XclassX*M2Crypto.m2urllib2.HTTPSHandler.https_openrQh?XmethodXM2Crypto.X509.CRL.as_textrRh?XmethodXM2Crypto.DSA.load_pub_key_biorSh?XfunctionX!M2Crypto.RSA.RSA_pub.save_key_biorTh?XmethodX#M2Crypto.SMIME.SMIME.set_x509_storerUh?XmethodX4M2Crypto.SSL.Connection.Connection.set_connect_staterVhUXmethodrWXM2Crypto.util.genparam_callbackrXh?XfunctionXM2Crypto.SMIME.PKCS7.typerYh?XmethodXM2Crypto.BIO.BIO.tellrZh?XmethodX(M2Crypto.SSL.Connection.Connection.closer[hUXmethodr\XM2Crypto.EVP.PKey.get_rsar]h?XmethodX$M2Crypto.ASN1.ASN1_TIME.set_datetimer^h?XmethodX0M2Crypto.SSL.Context.Context.get_session_timeoutr_hUXmethodr`XM2Crypto.SMIME.PKCS7_Errorrah?X exceptionX.M2Crypto.SSL.Connection.Connection.setblockingrbhUXmethodrcX:M2Crypto.SSL.Connection.Connection.get_socket_read_timeoutrdhUXmethodreXM2Crypto.RSA.RSA.as_pemrfh?XmethodXM2Crypto.RSA.keygen_callbackrgh?XfunctionX)M2Crypto.httpslib.HTTPSConnection.connectrhh?XmethodXM2Crypto.EVP.Cipherrih?XclassXM2Crypto.EVP.PKey.verify_finalrjh?XmethodXM2Crypto.DH.load_paramsrkh?XfunctionXM2Crypto.BIO.MemoryBufferrlh?XclassXM2Crypto.m2urllib2.HTTPSHandlerrmh?XclassXM2Crypto.AuthCookiernh?hXM2Crypto.SSL.timeout.timeoutrohUXclassrpX-M2Crypto.SSL.Connection.Connection.getsockoptrqhUXmethodrrX%M2Crypto.ftpslib.FTP_TLS.ntransfercmdrsh?XmethodXM2Crypto.X509.X509.get_subjectrth?XmethodX%M2Crypto.X509.X509_Extension.get_nameruh?XmethodXM2Crypto.Engine.Engine.get_idrvh?XmethodX/M2Crypto.SSL.Context.Context.set_session_id_ctxrwhUXmethodrxXM2Crypto.threading.initryh?XfunctionX"M2Crypto.X509.X509.get_fingerprintrzh?XmethodXM2Crypto.X509.X509.check_car{h?XmethodXM2Crypto.RC4.RC4.rc4_freer|h?XmethodX,M2Crypto.AuthCookie.AuthCookieJar.makeCookier}h?XmethodXM2Crypto.EC.load_keyr~h?XfunctionXM2Crypto.util.UtilErrorrh?X exceptionXM2Crypto.EC.EC_pubrh?XclassXM2Crypto.SSL.ssl_dispatcherrhUhX M2Crypto.ASN1.ASN1_TIME.set_timerh?XmethodX*M2Crypto.AuthCookie.AuthCookie.headerValuerh?XmethodXM2Crypto.BN.rand_rangerh?XfunctionX M2Crypto.EVPrh?hX*M2Crypto.SSL.ssl_dispatcher.ssl_dispatcherrhUXclassrXM2Crypto.BIO.SSLBiorh?XclassX'M2Crypto.X509.X509_Extension_Stack.pushrh?XmethodXM2Crypto.EVP.PKey.m2_pkey_freerh?XmethodXM2Crypto.Err.get_error_librh?XfunctionX M2Crypto.RSA.RSA.private_encryptrh?XmethodXM2Crypto.Err.M2CryptoErrorrh?X exceptionX*M2Crypto.SSL.Connection.Connection.set_biorhUXmethodrXM2Crypto.util.py3bytesrh?XfunctionXM2Crypto.DSA.DSA.check_keyrh?XmethodXM2Crypto.SSL.SSLErrorrhUX exceptionrXM2Crypto.BIO.IOBufferrh?XclassXM2Crypto.RSA.RSA_pub.save_keyrh?XmethodXM2Crypto.X509.X509_Name_Entryrh?XclassX M2Crypto.Errrh?hXM2Crypto.BIO.BIOrh?XclassX3M2Crypto.SSL.Context.Context.set_session_cache_moderhUXmethodrXCM2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.dataReceivedrhUXmethodrX&M2Crypto.Engine.Engine.ctrl_cmd_stringrh?XmethodX6M2Crypto.SSL.Connection.Connection.get_peer_cert_chainrhUXmethodrXM2Crypto.RSA.RSA.save_key_biorh?XmethodXM2Crypto.EC.get_builtin_curvesrh?XfunctionX4M2Crypto.SSL.Connection.Connection.get_verify_resultrhUXmethodrXM2Crypto.Err.SSLErrorrh?X exceptionXM2Crypto.BIO.Filerh?XclassXM2Crypto.X509.X509.get_issuerrh?XmethodXM2Crypto.SMIME.SMIME.verifyrh?XmethodX+M2Crypto.SSL.Context.Context.load_client_CArhUXmethodrXM2Crypto.EVP.PKeyrh?XclassXM2Crypto.RSA.RSAErrorrh?X exceptionXM2Crypto.Err.peek_error_coderh?XfunctionXM2Crypto.Engine.Engine.initrh?XmethodX,M2Crypto.SSL.Context.Context.load_cert_chainrhUXmethodrX3M2Crypto.SSL.Connection.Connection.get_verify_depthrhUXmethodrX$M2Crypto.SSL.Session.Session.as_textrhUXmethodrX)M2Crypto.SSL.Connection.Connection.listenrhUXmethodrXM2Crypto.ASN1.ASN1_Integerrh?XclassXM2Crypto.DSA.load_params_biorh?XfunctionXM2Crypto.threading.cleanuprh?XfunctionX M2Crypto.X509.X509_Store_Contextrh?XclassX-M2Crypto.SSL.Connection.Connection.setup_addrrhUXmethodrXM2Crypto.EVP.PKey.save_key_biorh?XmethodX-M2Crypto.SSL.SSLServer.SSLServer.handle_errorrhUXmethodrXM2Crypto.BN.randrh?XfunctionX$M2Crypto.X509.X509.set_serial_numberrh?XmethodX3M2Crypto.SSL.Connection.Connection.set_accept_staterhUXmethodrXM2Crypto.DSA.DSA.save_pub_keyrh?XmethodX"M2Crypto.SSL.Cipher.Cipher.versionrhUXmethodrX,M2Crypto.SSL.Connection.Connection.get_staterhUXmethodrXM2Crypto.EC.gen_paramsrh?XfunctionXM2Crypto.BIO.CipherStreamrh?XclassXM2Crypto.EVP.hmacrh?XfunctionX0M2Crypto.SSL.Connection.Connection.ssl_get_errorrhUXmethodrXM2Crypto.ASN1.ASN1_Stringrh?XclassXM2Crypto.ASN1.LocalTimezonerh?XclassXM2Crypto.EVP.load_keyrh?XfunctionXM2Crypto.Rand.rand_bytesrh?XfunctionXM2Crypto.DSA.gen_paramsrh?XfunctionXM2Crypto.X509.X509_Name.nidrh?X attributeX.M2Crypto.SSL.Context.Context.set_info_callbackrhUXmethodrXM2Crypto.SMIME.text_crlf_biorh?XfunctionXM2Crypto.EC.pub_key_from_derrh?XfunctionXM2Crypto.BIO.BIOErrorrh?X exceptionX M2Crypto.DHrh?hXM2Crypto.DSA.DSA.save_keyrh?XmethodXM2Crypto.SSL.CipherrhUhX M2Crypto.DSA.DSA.save_params_biorh?XmethodX%M2Crypto.BIO.CipherStream.write_closerh?XmethodX2M2Crypto.SSL.Context.Context.load_verify_locationsrhUXmethodrXM2Crypto.util.pkcs5_padrh?XfunctionXM2Crypto.Engine.load_dynamicrh?XfunctionX2M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.connectrhUXmethodrX(M2Crypto.X509.X509_Name.add_entry_by_txtrh?XmethodXM2Crypto.RSA.RSA.public_encryptrh?XmethodX.M2Crypto.SSL.Connection.Connection.getpeernamerhUXmethodrXM2Crypto.X509.X509.signrh?XmethodX-M2Crypto.SSL.Connection.Connection.accept_sslrhUXmethodrXM2Crypto.DSA.DSA.verifyrh?XmethodXM2Crypto.Err.get_errorrh?XfunctionX M2Crypto.ASN1rh?hXM2Crypto.DH.DHErrorrh?X exceptionXM2Crypto.EC.load_pub_key_biorh?XfunctionXM2Crypto.SSL.Context.ContextrhUXclassrXM2Crypto.RSA.RSA.signrh?XmethodXM2Crypto.EVP.PKey.updaterh?XmethodX.M2Crypto.SSL.Connection.Connection.m2_ssl_freerhUXmethodrXM2Crypto.Err.get_error_reasonrh?XfunctionXM2Crypto.DH.load_params_biorh?XfunctionX!M2Crypto.EVP.MessageDigest.digestrh?XmethodXM2Crypto.SSL.ContextrhUhXM2Crypto.EC.EC.save_key_biorh?XmethodXM2Crypto.DSA.load_key_biorh?XfunctionX"M2Crypto.SSL.Checker.NoCertificaterhUX exceptionrXM2Crypto.SSL.SSLTimeoutErrorrhUX exceptionrXM2Crypto.EC.EC.save_pub_keyrh?XmethodX/M2Crypto.SSL.Connection.Connection.get_shutdownrhUXmethodrXM2Crypto.Engine.Enginerh?XclassXM2Crypto.X509.X509.set_issuerrh?XmethodX+M2Crypto.X509.X509_Store_Context.get1_chainrh?XmethodXM2Crypto.httpslibrh?hXM2Crypto.BIO.File.closerh?XmethodXM2Crypto.X509.Request.signrh?XmethodX*M2Crypto.X509.X509_Name.get_entries_by_nidrh?XmethodXM2Crypto.DSA.DSA_pub.check_keyr h?XmethodX#M2Crypto.X509.x509_store_default_cbr h?XfunctionXM2Crypto.X509.X509_Stackr h?XclassXM2Crypto.SSL.Context.ctxmapr hUXfunctionr XM2Crypto.DSA.load_pub_keyrh?XfunctionX M2Crypto.Randrh?hXM2Crypto.Engine.Engine.get_namerh?XmethodXM2Crypto.DSA.load_paramsrh?XfunctionXM2Crypto.X509.X509.get_pubkeyrh?XmethodXM2Crypto.DH.set_paramsrh?XfunctionX"M2Crypto.X509.CRL.m2_x509_crl_freerh?XmethodX M2Crypto.BIO.IOBuffer.m2_bio_poprh?XmethodX$M2Crypto.AuthCookie.AuthCookie.valuerh?XmethodX M2Crypto.RSA.RSA.sign_rsassa_pssrh?XmethodX'M2Crypto.SSL.Context.Context.set_tmp_dhrhUXmethodrX"M2Crypto.X509.load_cert_der_stringrh?XfunctionXM2Crypto.RSA.RSA_pub.check_keyrh?XmethodX3M2Crypto.X509.X509_Extension.m2_x509_extension_freerh?XmethodXM2Crypto.SMIME.load_pkcs7rh?XfunctionXM2Crypto.RSA.load_pub_key_biorh?XfunctionXM2Crypto.X509.load_request_biorh?XfunctionXM2Crypto.Err.get_error_coder h?XfunctionX1M2Crypto.SSL.Context.Context.set_allow_unknown_car!hUXmethodr"XM2Crypto.threadingr#h?hXM2Crypto.X509.X509.get_extr$h?XmethodXM2Crypto.util.bin_to_hexr%h?XfunctionXM2Crypto.DH.DH.m2_dh_freer&h?XmethodX M2Crypto.EVP.PKey.m2_md_ctx_freer'h?XmethodX+M2Crypto.SSL.Connection.Connection.shutdownr(hUXmethodr)XM2Crypto.BIO.BIO.readlinesr*h?XmethodX8M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.create_socketr+hUXmethodr,XM2Crypto.RSA.gen_keyr-h?XfunctionX%M2Crypto.ASN1.LocalTimezone.utcoffsetr.h?XmethodX+M2Crypto.SSL.Context.Context.load_client_car/hUXmethodr0XM2Crypto.Rand.rand_file_namer1h?XfunctionX6M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapperr2hUXclassr3XM2Crypto.X509.X509.saver4h?XmethodX"M2Crypto.BIO.MemoryBuffer.getvaluer5h?XmethodX/M2Crypto.ASN1.ASN1_Integer.m2_asn1_integer_freer6h?XmethodXM2Crypto.BIO.BIO.readabler7h?XmethodXM2Crypto.SMIME.SMIME.writer8h?XmethodXM2Crypto.EVP.PKey.sign_updater9h?XmethodX.M2Crypto.SSL.TwistedProtocolWrapper.connectTCPr:hUXfunctionr;XM2Crypto.EVP.PKey.get_modulusr<h?XmethodXM2Crypto.SMIME.SMIMEr=h?XclassXM2Crypto.BIO.BIO.writeabler>h?XmethodXM2Crypto.X509.X509.set_subjectr?h?XmethodX.M2Crypto.httpslib.HTTPSConnection.default_portr@h?X attributeX%M2Crypto.SSL.Checker.WrongCertificaterAhUX exceptionrBX&M2Crypto.Engine.Engine.load_public_keyrCh?XmethodXM2Crypto.EC.load_key_stringrDh?XfunctionX0M2Crypto.SSL.Session.Session.m2_ssl_session_freerEhUXmethodrFXM2Crypto.DSA.DSA.signrGh?XmethodXM2Crypto.EVP.PKey.as_pemrHh?XmethodX&M2Crypto.SSL.timeout.struct_to_timeoutrIhUXfunctionrJXM2Crypto.DSA.DSA.save_key_biorKh?XmethodX M2Crypto.X509.Request.set_pubkeyrLh?XmethodX!M2Crypto.X509.X509.set_not_beforerMh?XmethodX"M2Crypto.SSL.Connection.ConnectionrNhUXclassrOXM2Crypto.X509.X509_Name.as_hashrPh?XmethodXM2Crypto.SMIME.load_pkcs7_derrQh?XfunctionXM2Crypto.SMIME.text_crlfrRh?XfunctionX M2Crypto.SSL.timeout.struct_sizerShUXfunctionrTX4M2Crypto.AuthCookie.AuthCookieJar.isGoodCookieStringrUh?XmethodX2M2Crypto.SSL.Connection.Connection.get_verify_moderVhUXmethodrWXM2Crypto.BIO.BIO.seekrXh?XmethodX(M2Crypto.X509.X509_Name_Entry.get_objectrYh?XmethodX-M2Crypto.SSL.TwistedProtocolWrapper.listenTCPrZhUXfunctionr[XM2Crypto.SMIME.SMIME.encryptr\h?XmethodX,M2Crypto.SSL.Connection.Connection.setup_sslr]hUXmethodr^XM2Crypto.EVP.load_key_bior_h?XfunctionXM2Crypto.DH.DH.gen_keyr`h?XmethodX#M2Crypto.SSL.TwistedProtocolWrapperrahUhXM2Crypto.ASN1.LocalTimezone.dstrbh?XmethodXM2Crypto.SMIME.SMIME_Errorrch?X exceptionXM2Crypto.EVP.PKey.sizerdh?XmethodX"M2Crypto.EVP.HMAC.m2_hmac_ctx_freereh?XmethodXM2Crypto.RC4.RC4.set_keyrfh?XmethodX&M2Crypto.SSL.Session.Session.write_biorghUXmethodrhXM2Crypto.X509.X509.as_derrih?XmethodXEM2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.connectionLostrjhUXmethodrkXM2Crypto.EVP.Cipher.updaterlh?XmethodX#M2Crypto.AuthCookie.AuthCookie.namermh?XmethodX3M2Crypto.SSL.Context.Context.get_session_cache_modernhUXmethodroX1M2Crypto.X509.X509_Store_Context.get_current_certrph?XmethodX"M2Crypto.BIO.MemoryBuffer.read_allrqh?XmethodX#M2Crypto.X509.X509.set_subject_namerrh?XmethodX-M2Crypto.httpslib.HTTPSConnection.get_sessionrsh?XmethodX+M2Crypto.SSL.Context.Context.get_cert_storerthUXmethodruXM2Crypto.EC.EC_pub.get_keyrvh?XmethodXM2Crypto.EVP.HMAC.updaterwh?XmethodXM2Crypto.X509.load_certrxh?XfunctionXM2Crypto.RSA.new_pub_keyryh?XfunctionX0M2Crypto.SSL.Context.Context.set_tmp_dh_callbackrzhUXmethodr{XM2Crypto.Rand.save_filer|h?XfunctionX<M2Crypto.SSL.Connection.Connection.clientPostConnectionCheckr}hUX attributer~XM2Crypto.Err.get_error_messagerh?XfunctionXM2Crypto.SSL.cbrhUhX/M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher.sendrhUXmethodrX&M2Crypto.httpslib.ProxyHTTPSConnectionrh?XclassXM2Crypto.X509.X509_Stack.as_derrh?XmethodX.M2Crypto.SSL.TwistedProtocolWrapper.connectSSLrhUXfunctionrXM2Crypto.X509.X509_Namerh?XclassXM2Crypto.BIO.BIO.flushrh?XmethodX!M2Crypto.DSA.DSA.save_pub_key_biorh?XmethodXM2Crypto.X509.X509_Name.as_textrh?XmethodX#M2Crypto.SSL.Session.Session.as_derrhUXmethodrX*M2Crypto.SSL.Connection.Connection.connectrhUXmethodrX.M2Crypto.SSL.Connection.Connection.get_versionrhUXmethodrXM2Crypto.EC.load_key_biorh?XfunctionXM2Crypto.DSA.DSA.save_paramsrh?XmethodXM2Crypto.BIO.File.flushrh?XmethodXM2Crypto.__init__rh?hXM2Crypto.DSA.set_paramsrh?XfunctionXM2Crypto.DSA.DSA.sign_asn1rh?XmethodX!M2Crypto.ftpslib.FTP_TLS.auth_tlsrh?XmethodXM2Crypto.SMIME.SMIME.set_cipherrh?XmethodXM2Crypto.util.octx_to_numrh?XfunctionX M2Crypto.RSArh?hX!M2Crypto.AuthCookie.AuthCookieJarrh?XclassX M2Crypto.RSA.RSA.private_decryptrh?XmethodX7M2Crypto.SSL.Connection.Connection.set_tlsext_host_namerhUXmethodrX-M2Crypto.httpslib.HTTPSConnection.set_sessionrh?XmethodXM2Crypto.BIO.IOBuffer.closerh?XmethodXM2Crypto.RC4.RC4.updaterh?XmethodXM2Crypto.ftpslibrh?hX M2Crypto.BIO.SSLBio.do_handshakerh?XmethodX%M2Crypto.AuthCookie.AuthCookie.outputrh?XmethodXM2Crypto.SMIME.PKCS7.write_derrh?XmethodXM2Crypto.EVP.PKey.sign_finalrh?XmethodX+M2Crypto.SSL.Connection.Connection.makefilerhUXmethodrXM2Crypto.EC.EC.save_keyrh?XmethodX4M2Crypto.SSL.cb.ssl_verify_callback_allow_unknown_carhUXfunctionrX M2Crypto.EVP.load_key_bio_pubkeyrh?XfunctionXM2Crypto.DSA.DSAErrorrh?X exceptionXM2Crypto.X509.Request.as_textrh?XmethodXM2Crypto.AuthCookie.unmixrh?XfunctionXM2Crypto.RSA.RSA.save_keyrh?XmethodX,M2Crypto.SSL.Context.Context.get_verify_moderhUXmethodrXM2Crypto.SMIME.load_pkcs7_biorh?XfunctionX M2Crypto.BIOrh?hXM2Crypto.X509.CRLrh?XclassXM2Crypto.RSA.RSA.m2_rsa_freerh?XmethodXM2Crypto.DH.DH.check_paramsrh?XmethodX1M2Crypto.httpslib.ProxyHTTPSConnection.putrequestrh?XmethodXM2Crypto.EC.EC_pub.save_keyrh?XmethodXM2Crypto.X509.Request.saverh?XmethodX!M2Crypto.X509.X509_Store.add_certrh?XmethodXM2Crypto.Rand.rand_addrh?XfunctionX"M2Crypto.X509.X509_Extension_Stackrh?XclassXM2Crypto.SMIME.PKCS7.writerh?XmethodX0M2Crypto.X509.X509_Store_Context.get_error_depthrh?XmethodX7M2Crypto.X509.X509_Store_Context.m2_x509_store_ctx_freerh?XmethodXM2Crypto.X509.Request.as_pemrh?XmethodXM2Crypto.EC.EC.compute_dh_keyrh?XmethodX#M2Crypto.Engine.load_dynamic_enginerh?XfunctionX#M2Crypto.X509.X509_Name.entry_countrh?XmethodX.M2Crypto.SSL.Connection.Connection.get_contextrhUXmethodrXM2Crypto.DH.DHrh?XclassXM2Crypto.RSA.RSA_pubrh?XclassXM2Crypto.BIO.MemoryBuffer.closerh?XmethodX'M2Crypto.SSL.Connection.Connection.readrhUXmethodrX!M2Crypto.X509.Request.set_versionrh?XmethodX#M2Crypto.EVP.load_key_string_pubkeyrh?XfunctionX M2Crypto.utilrh?hX M2Crypto.SSLrhUhXM2Crypto.X509.load_cert_biorh?XfunctionX M2Crypto.ECrh?hX-M2Crypto.ASN1.ASN1_Object.m2_asn1_object_freerh?XmethodXM2Crypto.Rand.rand_seedrh?XfunctionXM2Crypto.RSA.load_key_stringrh?XfunctionXM2Crypto.DH.gen_paramsrh?XfunctionX"M2Crypto.X509.X509_Store.load_inforh?XmethodX.M2Crypto.SSL.Connection.Connection.m2_bio_freerhUXmethodrX.M2Crypto.SSL.Connection.Connection.get_sessionrhUXmethodrXDM2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.writeSequencerhUXmethodrXEM2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.connectionMaderhUXmethodrX.M2Crypto.SSL.Connection.Connection.getsocknamerhUXmethodrXM2Crypto.EVP.HMAC.resetrh?XmethodXM2Crypto.util.py3strrh?XfunctionX!M2Crypto.DSA.DSA_pub.save_key_biorh?XmethodXBM2Crypto.SSL.Connection.Connection.set_client_CA_list_from_contextrhUXmethodrX+M2Crypto.X509.X509_Store.m2_x509_store_freerh?XmethodX(M2Crypto.AuthCookie.AuthCookie.isExpiredrh?XmethodX.M2Crypto.AuthCookie.AuthCookieJar.isGoodCookierh?XmethodXM2Crypto.X509.X509.set_versionrh?XmethodXM2Crypto.Rand.rand_pseudo_bytesrh?XfunctionXM2Crypto.BIO.CipherStream.closerh?XmethodX+M2Crypto.X509.X509_Name_Entry.create_by_txtrh?XmethodXM2Crypto.RSA.RSA.pubrh?XmethodX'M2Crypto.SSL.Connection.Connection.recvrhUXmethodrX!M2Crypto.SMIME.SMIME.unset_cipherrh?XmethodX'M2Crypto.SSL.SSLServer.ForkingSSLServerrhUXclassrXM2Crypto.Engine.Engine.finishrh?XmethodXM2Crypto.X509.load_requestrh?XfunctionX(M2Crypto.SSL.Context.Context.set_optionsrhUXmethodrXM2Crypto.ASN1.ASN1_UTCTIMErh?X attributeX!M2Crypto.SMIME.load_pkcs7_bio_derrh?XfunctionXM2Crypto.m2xmlrpclibrh?hX%M2Crypto.BIO.MemoryBuffer.write_closerh?XmethodX'M2Crypto.X509.X509_Store.load_locationsrh?XmethodXM2Crypto.SSL.CheckerrhUhX-M2Crypto.m2xmlrpclib.SSL_Transport.user_agentrh?X attributeX)M2Crypto.ASN1.ASN1_TIME.m2_asn1_time_freerh?XmethodX*M2Crypto.SSL.Connection.Connection.pendingrhUXmethodrX:M2Crypto.SSL.Connection.Connection.set_socket_read_timeoutrhUXmethodrX*M2Crypto.m2xmlrpclib.SSL_Transport.requestrh?XmethodXM2Crypto.DSA.load_keyrh?XfunctionXM2Crypto.RSA.RSA.save_pub_keyrh?XmethodX?M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper.startTLSrhUXmethodrX"M2Crypto.Engine.Engine.set_defaultrh?XmethodX,M2Crypto.SSL.Context.Context.m2_ssl_ctx_freer hUXmethodr X'M2Crypto.httpslib.HTTPSConnection.closer h?XmethodXM2Crypto.DSA.DSA.gen_keyr h?XmethodXM2Crypto.Err.get_error_funcr h?XfunctionX-M2Crypto.SSL.Connection.Connection.get_cipherrhUXmethodrX0M2Crypto.SSL.Connection.Connection.get_peer_certrhUXmethodrX>M2Crypto.SSL.Connection.Connection.get_default_session_timeoutrhUXmethodrX$M2Crypto.ASN1.ASN1_TIME.get_datetimerh?XmethodXM2Crypto.X509.X509.add_extrh?XmethodXM2Crypto.Engine.cleanuprh?XfunctionX M2Crypto.X509.Request.get_pubkeyrh?XmethodXM2Crypto.BIO.BIO.writerh?XmethodX%M2Crypto.X509.load_request_der_stringrh?XfunctionX'M2Crypto.Engine.Engine.load_certificaterh?XmethodXM2Crypto.EC.EC.verify_dsarh?XmethodXM2Crypto.m2urllib2rh?hX!M2Crypto.BIO.IOBuffer.m2_bio_freerh?XmethodX"M2Crypto.AuthCookie.AuthCookie.macrh?XmethodX%M2Crypto.BIO.CipherStream.m2_bio_freerh?XmethodX&M2Crypto.X509.X509_Extension.get_valuer h?XmethodXM2Crypto.m2urllib2.build_openerr!h?XfunctionX<M2Crypto.X509.X509_Extension_Stack.m2_sk_x509_extension_freer"h?XmethodX M2Crypto.X509.X509.get_not_afterr#h?XmethodX;M2Crypto.SSL.Connection.Connection.get_socket_write_timeoutr$hUXmethodr%XM2Crypto.DSA.DSA.m2_dsa_freer&h?XmethodXM2Crypto.EVP.PKey.finalr'h?XmethodX!M2Crypto.X509.X509.get_not_beforer(h?XmethodX%M2Crypto.Engine.Engine.m2_engine_freer)h?XmethodX!M2Crypto.X509.Request.get_versionr*h?XmethodX!M2Crypto.ASN1.ASN1_String.as_textr+h?XmethodXM2Crypto.EC.EC.sign_dsa_asn1r,h?XmethodXM2Crypto.EVP.HMACr-h?XclassXM2Crypto.X509.Requestr.h?XclassXM2Crypto.RC4.RC4.finalr/h?XmethodXM2Crypto.m2cryptor0h?hXM2Crypto.RC4.RC4r1h?XclassXM2Crypto.SSL.Cipher.Cipher.namer2hUXmethodr3X(M2Crypto.SSL.Connection.Connection.writer4hUXmethodr5X(M2Crypto.SSL.cb.ssl_verify_callback_stubr6hUXfunctionr7X!M2Crypto.SSL.timeout.timeout.packr8hUXmethodr9X-M2Crypto.SSL.TwistedProtocolWrapper.listenSSLr:hUXfunctionr;XM2Crypto.X509.X509.set_pubkeyr<h?XmethodX(M2Crypto.X509.X509_Stack.m2_sk_x509_freer=h?XmethodXM2Crypto.DSA.DSA_pubr>h?XclassX%M2Crypto.AuthCookie.AuthCookie.expiryr?h?XmethodXM2Crypto.X509.X509.get_versionr@h?XmethodXM2Crypto.m2urllibrAh?hXM2Crypto.BIO.MemoryBuffer.readrBh?XmethodXM2Crypto.BIO.File.resetrCh?XmethodX.M2Crypto.SSL.Connection.Connection.renegotiaterDhUXmethodrEX$M2Crypto.X509.X509.get_serial_numberrFh?XmethodX&M2Crypto.SSL.Context.Context.load_certrGhUXmethodrHX$M2Crypto.X509.Request.add_extensionsrIh?XmethodXM2Crypto.SMIME.SMIME.load_keyrJh?XmethodXM2Crypto.EVP.PKey.verify_updaterKh?XmethodXM2Crypto.X509.X509_Stack.poprLh?XmethodX)M2Crypto.SSL.Connection.Connection.filenorMhUXmethodrNX M2Crypto.DSArOh?hXM2Crypto.EVP.pbkdf2rPh?XfunctionXM2Crypto.EC.EC.as_pemrQh?XmethodX'M2Crypto.SSL.Context.Context.set_verifyrRhUXmethodrSX5M2Crypto.SSL.Connection.Connection.set_session_id_ctxrThUXmethodrUX)M2Crypto.SSL.SSLServer.ThreadingSSLServerrVhUXclassrWXM2Crypto.ASN1.ASN1_TIMErXh?XclassXM2Crypto.X509.load_crlrYh?XfunctionX M2Crypto.m2rZh?hXM2Crypto.RSA.RSA.save_pemr[h?XmethodXM2Crypto.BIO.BIO.should_writer\h?XmethodXM2Crypto.RSA.load_key_bior]h?XfunctionXM2Crypto.X509.X509.save_pemr^h?XmethodX!M2Crypto.SSL.cb.ssl_info_callbackr_hUXfunctionr`XM2Crypto.SSL.Cipher.CipherrahUXclassrbX/M2Crypto.SSL.SSLServer.SSLServer.handle_requestrchUXmethodrdXM2Crypto.BIO.BIO.should_readreh?XmethodX"M2Crypto.ASN1.ASN1_TIME.set_stringrfh?XmethodX,M2Crypto.SSL.Context.Context.set_cipher_listrghUXmethodrhXM2Crypto.DH.DH.print_paramsrih?XmethodX!M2Crypto.RSA.RSA.save_pub_key_biorjh?XmethodX5M2Crypto.SSL.Context.Context.set_default_verify_pathsrkhUXmethodrlXM2Crypto.DSA.DSA.set_paramsrmh?XmethodX%M2Crypto.util.quiet_genparam_callbackrnh?XfunctionXM2Crypto.Engineroh?hXM2Crypto.BIO.BIO.closerph?XmethodX"M2Crypto.RSA.RSA.verify_rsassa_pssrqh?XmethodX/M2Crypto.SSL.Connection.Connection.set_shutdownrrhUXmethodrsX0M2Crypto.SSL.Context.Context.set_session_timeoutrthUXmethodruXM2Crypto.RSA.RSA.verifyrvh?XmethodXM2Crypto.BIO.SSLBio.set_sslrwh?XmethodXM2Crypto.EC.EC_pub.save_key_biorxh?XmethodXM2Crypto.EVP.EVPErrorryh?X exceptionX#M2Crypto.SSL.cb.ssl_verify_callbackrzhUXfunctionr{XM2Crypto.X509.load_cert_stringr|h?XfunctionXM2Crypto.X509.X509_Storer}h?XclassXM2Crypto.X509.Request.verifyr~h?XmethodXM2Crypto.BIO.BIO.resetrh?XmethodXM2Crypto.EC.EC.gen_keyrh?XmethodX,M2Crypto.SSL.Connection.Connection.recv_intorhUXmethodrX'M2Crypto.SSL.Connection.Connection.sendrhUXmethodrXM2Crypto.X509.new_extensionrh?XfunctionX#M2Crypto.SMIME.smime_load_pkcs7_biorh?XfunctionXM2Crypto.EVP.PKey.sign_initrh?XmethodXM2Crypto.EVP.load_key_stringrh?XfunctionXM2Crypto.SMIME.SMIME.signrh?XmethodX*M2Crypto.X509.X509_Store_Context.get_errorrh?XmethodX M2Crypto.BNrh?hXM2Crypto.BIO.BIO.readrh?XmethodX.M2Crypto.SSL.Connection.Connection.connect_sslrhUXmethodrX&M2Crypto.X509.X509_Name_Entry.get_datarh?XmethodX"M2Crypto.X509.X509.set_issuer_namerh?XmethodXM2Crypto.Engine.load_opensslrh?XfunctionXM2Crypto.RSA.load_pub_keyrh?XfunctionXM2Crypto.EC.EC_pub.get_derrh?XmethodX M2Crypto.SSL.SSLServer.SSLServerrhUXclassrXM2Crypto.BIO.BIO.filenorh?XmethodX!M2Crypto.X509.X509_Store.add_x509rh?XmethodX$M2Crypto.BIO.CipherStream.m2_bio_poprh?XmethodX!M2Crypto.RSA.RSA.save_key_der_biorh?XmethodX5M2Crypto.SSL.Connection.Connection.set_ssl_close_flagrhUXmethodrX$M2Crypto.BIO.CipherStream.set_cipherrh?XmethoduUmodulesr}r(h(h?UUth(h?UUth(h?UUtjo(h?UUtj#(h?UUtjA(h?UUtj(h?UUtjn(h?UUtj(h?UUtj(h?UUtj(h?UUtj(h?UUtjO(h?UUtj(h?UUtj(h?UUtj(hUUUth(h?UUtj(h?UUtj(h?UUth(hUUUtjZ(h?UUtj(h?UUth(hUUUtj(h?UUtj(h?UUtj(hUUUtj0(h?UUtj(hUUUtj(hUUUth(hUUUtja(hUUUtj(h?UUth(hUUUtj(h?UUtj(hUUUtj(h?UUtj(hUUUtuhKuUjs}r(ht}j}hKuUrst}r(ht}hKuUcpp}r(U root_symbolcsphinx.domains.cpp Symbol r)r}r(UtemplateParamsrNhNU templateArgsrNU declarationrNUdocnamerNU identifierrNh]ubhKh}uuU glob_toctreesrh]RrUimagesrh)rh]RrbU doctreedirrX'/home/matej/Build/m2crypto/doc/doctreesrUversioning_conditionrUtoc_fignumbersr}U temp_datar}Uoriginal_image_urir}UversionrK4UsrcdirrX/home/matej/Build/m2crypto/docrUconfigrcsphinx.config Config r)r}r(Upygments_stylerUsphinxrUhtmlhelp_basenamerU M2CryptodocU master_docrUindexrU source_suffixr]rU.rstraUtexinfo_documentsr]r(jUM2CryptorXM2Crypto DocumentationrXMatej Cepl rjU One line description of project.U MiscellaneousrtraU copyrightrX 2017, Matej Cepl rU epub_titlerXM2CryptorUexclude_patternsr]rU_buildraU epub_authorrjjUU man_pagesr]r(jUm2cryptorj]rjaKtraUtemplates_pathr]rU _templatesraUlatex_documentsr]r(jU M2Crypto.texjX1Matej Cepl \textless{}mcepl@cepl.eu\textgreater{}UmanualrtraUhtml_static_pathr]rU_staticraUepub_copyrightrjUlatex_elementsr}U overridesr}UprojectrjU extensionsr]r(Usphinx.ext.autodocrUsphinx.ext.viewcodereUreleaserUUepub_publisherrjUsetuprNubUmetadatarccollections defaultdict rc__builtin__ dict rRr(h }rXorphanUsh"}rh*}rXorphanUsh?}rhM}rXorphanUshU}rh]}rXorphanUsuUversionchangesr}U_viewcode_modulesr}r(U M2Crypto.X509r(Xfrom __future__ import absolute_import """M2Crypto wrapper for OpenSSL X509 API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004-2007 OSAF. All Rights Reserved. Author: Heikki Toivonen """ import binascii import logging from M2Crypto import ASN1, BIO, EVP, Err, m2, util # noqa if util.py27plus: from typing import AnyStr, Optional # noqa FORMAT_DER = 0 FORMAT_PEM = 1 log = logging.getLogger(__name__) class X509Error(Exception): pass m2.x509_init(X509Error) V_OK = m2.X509_V_OK # type: int def x509_store_default_cb(ok, ctx): # type: (int, X509_Store_Context) -> int return ok def new_extension(name, value, critical=0, _pyfree=1): # type: (str, bytes, int, int) -> X509_Extension """ Create new X509_Extension instance. """ if name == 'subjectKeyIdentifier' and \ value.strip('0123456789abcdefABCDEF:') is not '': raise ValueError('value must be precomputed hash') ctx = m2.x509v3_set_nconf() if ctx is None: raise MemoryError( 'Not enough memory when creating a new X509 extension') x509_ext_ptr = m2.x509v3_ext_conf(None, ctx, name, value) if x509_ext_ptr is None: raise X509Error( "Cannot create X509_Extension with name '%s' and value '%s'" % (name, value)) x509_ext = X509_Extension(x509_ext_ptr, _pyfree) x509_ext.set_critical(critical) return x509_ext class X509_Extension: # noqa """ X509 Extension """ m2_x509_extension_free = m2.x509_extension_free def __init__(self, x509_ext_ptr=None, _pyfree=1): # type: (Optional[bytes], int) -> None self.x509_ext = x509_ext_ptr self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0) and self.x509_ext: self.m2_x509_extension_free(self.x509_ext) def _ptr(self): # type: () -> bytes return self.x509_ext def set_critical(self, critical=1): # type: (int) -> int """ Mark this extension critical or noncritical. By default an extension is not critical. :param critical: Nonzero sets this extension as critical. Calling this method without arguments will set this extension to critical. :return: 1 for success, 0 for failure """ return m2.x509_extension_set_critical(self.x509_ext, critical) def get_critical(self): # type: () -> int """ Return whether or not this is a critical extension. :return: Nonzero if this is a critical extension. """ return m2.x509_extension_get_critical(self.x509_ext) def get_name(self): # type: () -> str """ Get the extension name, for example 'subjectAltName'. """ return util.py3str(m2.x509_extension_get_name(self.x509_ext)) def get_value(self, flag=0, indent=0): # type: (int, int) -> str """ Get the extension value, for example 'DNS:www.example.com'. :param flag: Flag to control what and how to print. :param indent: How many spaces to print before actual value. """ buf = BIO.MemoryBuffer() m2.x509_ext_print(buf.bio_ptr(), self.x509_ext, flag, indent) return util.py3str(buf.read_all()) class X509_Extension_Stack: # noqa """ X509 Extension Stack :warning: Do not modify the underlying OpenSSL stack except through this interface, or use any OpenSSL functions that do so indirectly. Doing so will get the OpenSSL stack and the internal pystack of this class out of sync, leading to python memory leaks, exceptions or even python crashes! """ m2_sk_x509_extension_free = m2.sk_x509_extension_free def __init__(self, stack=None, _pyfree=0): # type: (Optional[bytes], int) -> None if stack is not None: self.stack = stack self._pyfree = _pyfree num = m2.sk_x509_extension_num(self.stack) for i in range(num): self.pystack.append(X509_Extension( m2.sk_x509_extension_value(self.stack, i), _pyfree=_pyfree)) else: self.stack = m2.sk_x509_extension_new_null() self._pyfree = 1 self.pystack = [] # This must be kept in sync with self.stack def __del__(self): # type: () -> None # see BIO.py - unbalanced __init__ / __del__ if getattr(self, '_pyfree', 0): self.m2_sk_x509_extension_free(self.stack) def __len__(self): # type: () -> int assert m2.sk_x509_extension_num(self.stack) == len(self.pystack) return len(self.pystack) def __getitem__(self, idx): # type: (int) -> X509_Extension return self.pystack[idx] def __iter__(self): return iter(self.pystack) def _ptr(self): # type: () -> bytes return self.stack def push(self, x509_ext): # type: (X509_Extension) -> int """ Push X509_Extension object onto the stack. :param x509_ext: X509_Extension object to be pushed onto the stack. :return: The number of extensions on the stack. """ self.pystack.append(x509_ext) ret = m2.sk_x509_extension_push(self.stack, x509_ext._ptr()) assert ret == len(self.pystack) return ret def pop(self): # type: () -> X509_Extension """ Pop X509_Extension object from the stack. :return: X509_Extension popped """ x509_ext_ptr = m2.sk_x509_extension_pop(self.stack) if x509_ext_ptr is None: assert len(self.pystack) == 0 return None return self.pystack.pop() class X509_Name_Entry: # noqa """ X509 Name Entry """ m2_x509_name_entry_free = m2.x509_name_entry_free def __init__(self, x509_name_entry, _pyfree=0): # type: (bytes, int) -> None """ :param x509_name_entry: this should be OpenSSL X509_NAME_ENTRY binary :param _pyfree: """ self.x509_name_entry = x509_name_entry self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_name_entry_free(self.x509_name_entry) def _ptr(self): # type: () -> bytes return self.x509_name_entry def set_object(self, asn1obj): # type: (ASN1.ASN1_Object) -> int """ Sets the field name to asn1obj :param asn1obj: :return: 0 on failure, 1 on success """ return m2.x509_name_entry_set_object(self.x509_name_entry, asn1obj._ptr()) def set_data(self, data, type=ASN1.MBSTRING_ASC): # type: (bytes, int) -> int """ Sets the field name to asn1obj :param data: data in a binary form to be set :return: 0 on failure, 1 on success """ return m2.x509_name_entry_set_data(self.x509_name_entry, type, data) def get_object(self): # type: () -> ASN1.ASN1_Object return ASN1.ASN1_Object( m2.x509_name_entry_get_object(self.x509_name_entry)) def get_data(self): # type: () -> ASN1.ASN1_String return ASN1.ASN1_String( m2.x509_name_entry_get_data(self.x509_name_entry)) def create_by_txt(self, field, type, entry, len): return m2.x509_name_entry_create_by_txt(self.x509_name_entry._ptr(), field, type, entry, len) class X509_Name: # noqa """ X509 Name """ nid = {'C': m2.NID_countryName, 'SP': m2.NID_stateOrProvinceName, 'ST': m2.NID_stateOrProvinceName, 'stateOrProvinceName': m2.NID_stateOrProvinceName, 'L': m2.NID_localityName, 'localityName': m2.NID_localityName, 'O': m2.NID_organizationName, 'organizationName': m2.NID_organizationName, 'OU': m2.NID_organizationalUnitName, 'organizationUnitName': m2.NID_organizationalUnitName, 'CN': m2.NID_commonName, 'commonName': m2.NID_commonName, 'Email': m2.NID_pkcs9_emailAddress, 'emailAddress': m2.NID_pkcs9_emailAddress, 'serialNumber': m2.NID_serialNumber, 'SN': m2.NID_surname, 'surname': m2.NID_surname, 'GN': m2.NID_givenName, 'givenName': m2.NID_givenName } m2_x509_name_free = m2.x509_name_free def __init__(self, x509_name=None, _pyfree=0): # type: (bytes, int) -> None """ :param x509_name: this should be OpenSSL X509_NAME binary :param _pyfree: """ if x509_name is not None: assert m2.x509_name_type_check(x509_name), "'x509_name' type error" self.x509_name = x509_name self._pyfree = _pyfree else: self.x509_name = m2.x509_name_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_name_free(self.x509_name) def __str__(self): # type: () -> bytes assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return m2.x509_name_oneline(self.x509_name) def __getattr__(self, attr): # type: (str) -> str if attr in self.nid: assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return util.py3str(m2.x509_name_by_nid(self.x509_name, self.nid[attr])) if attr in self.__dict__: return self.__dict__[attr] raise AttributeError(self, attr) def __setattr__(self, attr, value): # type: (str, AnyStr) -> int """ :return: 1 for success of 0 if an error occurred. """ if attr in self.nid: assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return m2.x509_name_set_by_nid(self.x509_name, self.nid[attr], util.py3bytes(value)) self.__dict__[attr] = value def __len__(self): # type: () -> int return m2.x509_name_entry_count(self.x509_name) def __getitem__(self, idx): # type: (int) -> X509_Name_Entry if not 0 <= idx < self.entry_count(): raise IndexError("index out of range") return X509_Name_Entry(m2.x509_name_get_entry(self.x509_name, idx)) def __iter__(self): for i in range(self.entry_count()): yield self[i] def _ptr(self): assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return self.x509_name def add_entry_by_txt(self, field, type, entry, len, loc, set): # entry_type: (str, int, bytes, int, int, int) -> int """ Add X509_Name field whose name is identified by its name. :param field: name of the entry :param type: use MBSTRING_ASC or MBSTRING_UTF8 (or standard ASN1 type like V_ASN1_IA5STRING) :param entry: value :param len: buf_len of the entry (-1 and the length is computed automagically) The ``loc`` and ``set`` parameters determine where a new entry should be added. For almost all applications loc can be set to -1 and set to 0. This adds a new entry to the end of name as a single valued RelativeDistinguishedName (RDN). :param loc: determines the index where the new entry is inserted: if it is -1 it is appended. :param set: determines how the new type is added. If it is zero a new RDN is created. If set is -1 or 1 it is added to the previous or next RDN structure respectively. This will then be a multivalued RDN: since multivalues RDNs are very seldom used set is almost always set to zero. :return: 1 for success of 0 if an error occurred. """ return m2.x509_name_add_entry_by_txt(self.x509_name, util.py3str(field), type, entry, len, loc, set) def entry_count(self): # type: () -> int return m2.x509_name_entry_count(self.x509_name) def get_entries_by_nid(self, nid): # type: (int) -> List[X509_Name_Entry] """ Retrieve the next index matching nid. :param nid: name of the entry (as m2.NID* constants) :return: list of X509_Name_Entry items """ ret = [] lastpos = -1 while True: lastpos = m2.x509_name_get_index_by_nid(self.x509_name, nid, lastpos) if lastpos == -1: break ret.append(self[lastpos]) return ret def as_text(self, indent=0, flags=m2.XN_FLAG_COMPAT): # type: (int, int) -> str """ as_text returns the name as a string. :param indent: Each line in multiline format is indented by this many spaces. :param flags: Flags that control how the output should be formatted. """ assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" buf = BIO.MemoryBuffer() m2.x509_name_print_ex(buf.bio_ptr(), self.x509_name, indent, flags) return util.py3str(buf.read_all()) def as_der(self): # type: () -> bytes assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return m2.x509_name_get_der(self.x509_name) def as_hash(self): # type: () -> int assert m2.x509_name_type_check(self.x509_name), \ "'x509_name' type error" return m2.x509_name_hash(self.x509_name) class X509: """ X.509 Certificate """ m2_x509_free = m2.x509_free def __init__(self, x509=None, _pyfree=0): # type: (Optional[bytes], int) -> None """ :param x509: binary representation of the underlying OpenSSL X509 object. :param _pyfree: """ if x509 is not None: assert m2.x509_type_check(x509), "'x509' type error" self.x509 = x509 self._pyfree = _pyfree else: self.x509 = m2.x509_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_free(self.x509) def _ptr(self): # type: () -> bytes assert m2.x509_type_check(self.x509), "'x509' type error" return self.x509 def as_text(self): # type: () -> str assert m2.x509_type_check(self.x509), "'x509' type error" buf = BIO.MemoryBuffer() m2.x509_print(buf.bio_ptr(), self.x509) return util.py3str(buf.read_all()) def as_der(self): # type: () -> bytes assert m2.x509_type_check(self.x509), "'x509' type error" return m2.i2d_x509(self.x509) def as_pem(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.x509_write_pem(buf.bio_ptr(), self.x509) return buf.read_all() def save_pem(self, filename): # type: (AnyStr) -> int """ :param filename: name of the file to be loaded :return: 1 for success or 0 for failure """ with BIO.openfile(filename, 'wb') as bio: return m2.x509_write_pem(bio.bio_ptr(), self.x509) def save(self, filename, format=FORMAT_PEM): # type: (AnyStr, int) -> int """ Saves X.509 certificate to a file. Default output format is PEM. :param filename: Name of the file the cert will be saved to. :param format: Controls what output format is used to save the cert. Either FORMAT_PEM or FORMAT_DER to save in PEM or DER format. Raises a ValueError if an unknow format is used. :return: 1 for success or 0 for failure """ with BIO.openfile(filename, 'wb') as bio: if format == FORMAT_PEM: return m2.x509_write_pem(bio.bio_ptr(), self.x509) elif format == FORMAT_DER: return m2.i2d_x509_bio(bio.bio_ptr(), self.x509) else: raise ValueError( "Unknown filetype. Must be either FORMAT_PEM or FORMAT_DER") def set_version(self, version): # type: (int) -> int """ Set version of the certificate. :param version: Version number. :return: Returns 0 on failure. """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_version(self.x509, version) def set_not_before(self, asn1_time): # type: (ASN1.ASN1_TIME) -> int """ :return: 1 on success, 0 on failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_not_before(self.x509, asn1_time._ptr()) def set_not_after(self, asn1_time): # type: (ASN1.ASN1_TIME) -> int """ :return: 1 on success, 0 on failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_not_after(self.x509, asn1_time._ptr()) def set_subject_name(self, name): # type: (X509_Name) -> int """ :return: 1 on success, 0 on failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_subject_name(self.x509, name.x509_name) def set_issuer_name(self, name): # type: (X509_Name) -> int """ :return: 1 on success, 0 on failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_issuer_name(self.x509, name.x509_name) def get_version(self): # type: () -> int assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_get_version(self.x509) def get_serial_number(self): # type: () -> ASN1.ASN1_Integer assert m2.x509_type_check(self.x509), "'x509' type error" asn1_integer = m2.x509_get_serial_number(self.x509) return m2.asn1_integer_get(asn1_integer) def set_serial_number(self, serial): # type: (ASN1.ASN1_Integer) -> int """ Set serial number. :param serial: Serial number. :return 1 for success and 0 for failure. """ assert m2.x509_type_check(self.x509), "'x509' type error" # This "magically" changes serial since asn1_integer # is C pointer to x509's internal serial number. asn1_integer = m2.x509_get_serial_number(self.x509) return m2.asn1_integer_set(asn1_integer, serial) # XXX Or should I do this? # asn1_integer = m2.asn1_integer_new() # m2.asn1_integer_set(asn1_integer, serial) # return m2.x509_set_serial_number(self.x509, asn1_integer) def get_not_before(self): # type: () -> ASN1.ASN1_TIME assert m2.x509_type_check(self.x509), "'x509' type error" return ASN1.ASN1_TIME(m2.x509_get_not_before(self.x509)) def get_not_after(self): # type: () -> ASN1.ASN1_TIME assert m2.x509_type_check(self.x509), "'x509' type error" out = ASN1.ASN1_TIME(m2.x509_get_not_after(self.x509)) if 'Bad time value' in str(out): raise X509Error( '''M2Crypto cannot handle dates after year 2050. See RFC 5280 4.1.2.5 for more information. ''') return out def get_pubkey(self): # type: () -> EVP.PKey assert m2.x509_type_check(self.x509), "'x509' type error" return EVP.PKey(m2.x509_get_pubkey(self.x509), _pyfree=1) def set_pubkey(self, pkey): # type: (EVP.PKey) -> int """ Set the public key for the certificate :param pkey: Public key :return 1 for success and 0 for failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_pubkey(self.x509, pkey.pkey) def get_issuer(self): # type: () -> X509_Name assert m2.x509_type_check(self.x509), "'x509' type error" return X509_Name(m2.x509_get_issuer_name(self.x509)) def set_issuer(self, name): # type: (X509_Name) -> int """ Set issuer name. :param name: subjectName field. :return 1 for success and 0 for failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_issuer_name(self.x509, name.x509_name) def get_subject(self): # type: () -> X509_Name assert m2.x509_type_check(self.x509), "'x509' type error" return X509_Name(m2.x509_get_subject_name(self.x509)) def set_subject(self, name): # type: (X509_Name) -> int """ Set subject name. :param name: subjectName field. :return 1 for success and 0 for failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_set_subject_name(self.x509, name.x509_name) def add_ext(self, ext): # type: (X509_Extension) -> int """ Add X509 extension to this certificate. :param ext: Extension :return 1 for success and 0 for failure """ assert m2.x509_type_check(self.x509), "'x509' type error" return m2.x509_add_ext(self.x509, ext.x509_ext, -1) def get_ext(self, name): # type: (str) -> X509_Extension """ Get X509 extension by name. :param name: Name of the extension :return: X509_Extension """ # Optimizations to reduce attribute accesses m2x509_get_ext = m2.x509_get_ext m2x509_extension_get_name = m2.x509_extension_get_name x509 = self.x509 name = util.py3bytes(name) for i in range(m2.x509_get_ext_count(x509)): ext_ptr = m2x509_get_ext(x509, i) if m2x509_extension_get_name(ext_ptr) == name: return X509_Extension(ext_ptr, _pyfree=0) raise LookupError def get_ext_at(self, index): # type: (int) -> X509_Extension """ Get X509 extension by index. :param index: Name of the extension :return: X509_Extension """ if index < 0 or index >= self.get_ext_count(): raise IndexError return X509_Extension(m2.x509_get_ext(self.x509, index), _pyfree=0) def get_ext_count(self): # type: () -> int """ Get X509 extension count. """ return m2.x509_get_ext_count(self.x509) def sign(self, pkey, md): # type: (EVP.PKey, str) -> int """ Sign the certificate. :param pkey: Public key :param md: Message digest algorithm to use for signing, for example 'sha1'. :return int """ assert m2.x509_type_check(self.x509), "'x509' type error" mda = getattr(m2, md, None) if mda is None: raise ValueError('unknown message digest', md) return m2.x509_sign(self.x509, pkey.pkey, mda()) def verify(self, pkey=None): # type: (Optional[EVP.PKey]) -> int assert m2.x509_type_check(self.x509), "'x509' type error" if pkey: return m2.x509_verify(self.x509, pkey.pkey) else: return m2.x509_verify(self.x509, self.get_pubkey().pkey) def check_ca(self): # type: () -> int """ Check if the certificate is a Certificate Authority (CA) certificate. :return: 0 if the certificate is not CA, nonzero otherwise. :requires: OpenSSL 0.9.8 or newer """ return m2.x509_check_ca(self.x509) def check_purpose(self, id, ca): # type: (int, int) -> int """ Check if the certificate's purpose matches the asked purpose. :param id: Purpose id. See X509_PURPOSE_* constants. :param ca: 1 if the certificate should be CA, 0 otherwise. :return: 0 if the certificate purpose does not match, nonzero otherwise. """ return m2.x509_check_purpose(self.x509, id, ca) def get_fingerprint(self, md='md5'): # type: (str) -> str """ Get the fingerprint of the certificate. :param md: Message digest algorithm to use. :return: String containing the fingerprint in hex format. """ der = self.as_der() md = EVP.MessageDigest(md) md.update(der) digest = md.final() return util.py3str(binascii.hexlify(digest).upper()) def load_cert(file, format=FORMAT_PEM): # type: (AnyStr, int) -> X509 """ Load certificate from file. :param file: Name of file containing certificate in either DER or PEM format. :param format: Describes the format of the file to be loaded, either PEM or DER. :return: M2Crypto.X509.X509 object. """ with BIO.openfile(file) as bio: if format == FORMAT_PEM: return load_cert_bio(bio) elif format == FORMAT_DER: cptr = m2.d2i_x509(bio._ptr()) return X509(cptr, _pyfree=1) else: raise ValueError( "Unknown format. Must be either FORMAT_DER or FORMAT_PEM") def load_cert_bio(bio, format=FORMAT_PEM): # type: (BIO.BIO, int) -> X509 """ Load certificate from a bio. :param bio: BIO pointing at a certificate in either DER or PEM format. :param format: Describes the format of the cert to be loaded, either PEM or DER (via constants FORMAT_PEM and FORMAT_FORMAT_DER) :return: M2Crypto.X509.X509 object. """ if format == FORMAT_PEM: cptr = m2.x509_read_pem(bio._ptr()) elif format == FORMAT_DER: cptr = m2.d2i_x509(bio._ptr()) else: raise ValueError( "Unknown format. Must be either FORMAT_DER or FORMAT_PEM") return X509(cptr, _pyfree=1) def load_cert_string(string, format=FORMAT_PEM): # type: (AnyStr, int) -> X509 """ Load certificate from a string. :param string: String containing a certificate in either DER or PEM format. :param format: Describes the format of the cert to be loaded, either PEM or DER (via constants FORMAT_PEM and FORMAT_FORMAT_DER) :return: M2Crypto.X509.X509 object. """ string = util.py3bytes(string) bio = BIO.MemoryBuffer(string) return load_cert_bio(bio, format) def load_cert_der_string(string): # type: (AnyStr) -> X509 """ Load certificate from a string. :param string: String containing a certificate in DER format. :return: M2Crypto.X509.X509 object. """ string = util.py3bytes(string) bio = BIO.MemoryBuffer(string) cptr = m2.d2i_x509(bio._ptr()) return X509(cptr, _pyfree=1) class X509_Store_Context: # noqa """ X509 Store Context """ m2_x509_store_ctx_free = m2.x509_store_ctx_free def __init__(self, x509_store_ctx, _pyfree=0): # type: (bytes, int) -> None """ :param x509_store_ctx: binary data for OpenSSL X509_STORE_CTX type """ self.ctx = x509_store_ctx self._pyfree = _pyfree def __del__(self): # type: () -> None # see BIO.py - unbalanced __init__ / __del__ if not hasattr(self, '_pyfree'): pass # print("OOPS") elif self._pyfree: self.m2_x509_store_ctx_free(self.ctx) def _ptr(self): return self.ctx def get_current_cert(self): # type: () -> X509 """ Get current X.509 certificate. :warning: The returned certificate is NOT refcounted, so you can not rely on it being valid once the store context goes away or is modified. """ return X509(m2.x509_store_ctx_get_current_cert(self.ctx), _pyfree=0) def get_error(self): # type: () -> int """ Get error code. """ return m2.x509_store_ctx_get_error(self.ctx) def get_error_depth(self): # type: () -> int """ Get error depth. """ return m2.x509_store_ctx_get_error_depth(self.ctx) def get1_chain(self): # type: () -> X509_Stack """ Get certificate chain. :return: Reference counted (i.e. safe to use even after the store context goes away) stack of certificates in the chain. """ return X509_Stack(m2.x509_store_ctx_get1_chain(self.ctx), 1, 1) class X509_Store: # noqa """ X509 Store """ m2_x509_store_free = m2.x509_store_free def __init__(self, store=None, _pyfree=0): # type: (Optional[bytes], int) -> None """ :param store: binary data for OpenSSL X509_STORE_CTX type. """ if store is not None: self.store = store self._pyfree = _pyfree else: self.store = m2.x509_store_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_store_free(self.store) def _ptr(self): return self.store def load_info(self, file): # type: (AnyStr) -> int """ :param file: filename :return: 1 on success, 0 on failure """ ret = m2.x509_store_load_locations(self.store, file) return ret load_locations = load_info def add_x509(self, x509): # type: (X509) -> int assert isinstance(x509, X509) return m2.x509_store_add_cert(self.store, x509._ptr()) def set_verify_cb(self, callback=None): # type: (Optional[callable]) -> None """ Set callback which will be called when the store is verified. Wrapper over OpenSSL X509_STORE_set_verify_cb(). :param callback: Callable to specify verification options. Type of the callable must be: (int, X509_Store_Context) -> int. If None: set the standard options. :note: compile-time or run-time errors in the callback would result in mysterious errors during verification, which could be hard to trace. :note: Python exceptions raised in callbacks do not propagate to verify() call. :return: None """ if callback is None: return self.set_verify_cb(x509_store_default_cb) if not callable(callback): raise X509Error("set_verify(): callback is not callable") return m2.x509_store_set_verify_cb(self.store, callback) add_cert = add_x509 class X509_Stack: # noqa """ X509 Stack :warning: Do not modify the underlying OpenSSL stack except through this interface, or use any OpenSSL functions that do so indirectly. Doing so will get the OpenSSL stack and the internal pystack of this class out of sync, leading to python memory leaks, exceptions or even python crashes! """ m2_sk_x509_free = m2.sk_x509_free def __init__(self, stack=None, _pyfree=0, _pyfree_x509=0): # type: (bytes, int, int) -> None if stack is not None: self.stack = stack self._pyfree = _pyfree self.pystack = [] # This must be kept in sync with self.stack num = m2.sk_x509_num(self.stack) for i in range(num): self.pystack.append(X509(m2.sk_x509_value(self.stack, i), _pyfree=_pyfree_x509)) else: self.stack = m2.sk_x509_new_null() self._pyfree = 1 self.pystack = [] # This must be kept in sync with self.stack def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_sk_x509_free(self.stack) def __len__(self): # type: () -> int assert m2.sk_x509_num(self.stack) == len(self.pystack) return len(self.pystack) def __getitem__(self, idx): # type: (int) -> X509 return self.pystack[idx] def __iter__(self): return iter(self.pystack) def _ptr(self): return self.stack def push(self, x509): # type: (X509) -> int """ push an X509 certificate onto the stack. :param x509: X509 object. :return: The number of X509 objects currently on the stack. """ assert isinstance(x509, X509) self.pystack.append(x509) ret = m2.sk_x509_push(self.stack, x509._ptr()) assert ret == len(self.pystack) return ret def pop(self): # type: () -> X509 """ pop a certificate from the stack. :return: X509 object that was popped, or None if there is nothing to pop. """ x509_ptr = m2.sk_x509_pop(self.stack) if x509_ptr is None: assert len(self.pystack) == 0 return None return self.pystack.pop() def as_der(self): # type: () -> bytes """ Return the stack as a DER encoded string """ return m2.get_der_encoding_stack(self.stack) def new_stack_from_der(der_string): # type: (bytes) -> X509_Stack """ Create a new X509_Stack from DER string. :return: X509_Stack """ der_string = util.py3bytes(der_string) stack_ptr = m2.make_stack_from_der_sequence(der_string) return X509_Stack(stack_ptr, 1, 1) class Request: """ X509 Certificate Request. """ m2_x509_req_free = m2.x509_req_free def __init__(self, req=None, _pyfree=0): # type: (Optional[int], int) -> None if req is not None: self.req = req self._pyfree = _pyfree else: self.req = m2.x509_req_new() m2.x509_req_set_version(self.req, 0) self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_req_free(self.req) def as_text(self): # type: () -> str buf = BIO.MemoryBuffer() m2.x509_req_print(buf.bio_ptr(), self.req) return util.py3str(buf.read_all()) def as_pem(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.x509_req_write_pem(buf.bio_ptr(), self.req) return buf.read_all() def as_der(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.i2d_x509_req_bio(buf.bio_ptr(), self.req) return buf.read_all() def save_pem(self, filename): # type: (AnyStr) -> int with BIO.openfile(filename, 'wb') as bio: return m2.x509_req_write_pem(bio.bio_ptr(), self.req) def save(self, filename, format=FORMAT_PEM): # type: (AnyStr, int) -> int """ Saves X.509 certificate request to a file. Default output format is PEM. :param filename: Name of the file the request will be saved to. :param format: Controls what output format is used to save the request. Either FORMAT_PEM or FORMAT_DER to save in PEM or DER format. Raises ValueError if an unknown format is used. :return: 1 for success, 0 for failure. The error code can be obtained by ERR_get_error. """ with BIO.openfile(filename, 'wb') as bio: if format == FORMAT_PEM: return m2.x509_req_write_pem(bio.bio_ptr(), self.req) elif format == FORMAT_DER: return m2.i2d_x509_req_bio(bio.bio_ptr(), self.req) else: raise ValueError( "Unknown filetype. Must be either FORMAT_DER or FORMAT_PEM") def get_pubkey(self): # type: () -> EVP.PKey """ Get the public key for the request. :return: Public key from the request. """ return EVP.PKey(m2.x509_req_get_pubkey(self.req), _pyfree=1) def set_pubkey(self, pkey): # type: (EVP.PKey) -> int """ Set the public key for the request. :param pkey: Public key :return: Return 1 for success and 0 for failure. """ return m2.x509_req_set_pubkey(self.req, pkey.pkey) def get_version(self): # type: () -> int """ Get version. :return: Returns version. """ return m2.x509_req_get_version(self.req) def set_version(self, version): # type: (int) -> int """ Set version. :param version: Version number. :return: Returns 0 on failure. """ return m2.x509_req_set_version(self.req, version) def get_subject(self): # type: () -> X509_Name return X509_Name(m2.x509_req_get_subject_name(self.req)) def set_subject_name(self, name): # type: (X509_Name) -> int """ Set subject name. :param name: subjectName field. :return: 1 for success and 0 for failure """ return m2.x509_req_set_subject_name(self.req, name.x509_name) set_subject = set_subject_name def add_extensions(self, ext_stack): # type: (X509_Extension_Stack) -> int """ Add X509 extensions to this request. :param ext_stack: Stack of extensions to add. :return: 1 for success and 0 for failure """ return m2.x509_req_add_extensions(self.req, ext_stack._ptr()) def verify(self, pkey): # type: (EVP.PKey) -> int """ :param pkey: PKey to be verified :return: 1 for success and 0 for failure """ return m2.x509_req_verify(self.req, pkey.pkey) def sign(self, pkey, md): # type: (EVP.PKey, str) -> int """ :param pkey: PKey to be signed :param md: used algorigthm :return: 1 for success and 0 for failure """ mda = getattr(m2, md, None) if mda is None: raise ValueError('unknown message digest', md) return m2.x509_req_sign(self.req, pkey.pkey, mda()) def load_request(file, format=FORMAT_PEM): # type: (AnyStr, int) -> Request """ Load certificate request from file. :param file: Name of file containing certificate request in either PEM or DER format. :param format: Describes the format of the file to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER) :return: Request object. """ with BIO.openfile(file) as f: if format == FORMAT_PEM: cptr = m2.x509_req_read_pem(f.bio_ptr()) elif format == FORMAT_DER: cptr = m2.d2i_x509_req(f.bio_ptr()) else: raise ValueError( "Unknown filetype. Must be either FORMAT_PEM or FORMAT_DER") if cptr is None: raise X509Error(Err.get_error()) return Request(cptr, 1) def load_request_bio(bio, format=FORMAT_PEM): # type: (BIO.BIO, int) -> Request """ Load certificate request from a bio. :param bio: BIO pointing at a certificate request in either DER or PEM format. :param format: Describes the format of the request to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER) :return: M2Crypto.X509.Request object. """ if format == FORMAT_PEM: cptr = m2.x509_req_read_pem(bio._ptr()) elif format == FORMAT_DER: cptr = m2.d2i_x509_req(bio._ptr()) else: raise ValueError( "Unknown format. Must be either FORMAT_DER or FORMAT_PEM") if cptr is None: raise X509Error(Err.get_error()) return Request(cptr, _pyfree=1) def load_request_string(string, format=FORMAT_PEM): # type: (AnyStr, int) -> Request """ Load certificate request from a string. :param string: String containing a certificate request in either DER or PEM format. :param format: Describes the format of the request to be loaded, either PEM or DER. (using constants FORMAT_PEM and FORMAT_DER) :return: M2Crypto.X509.Request object. """ string = util.py3bytes(string) bio = BIO.MemoryBuffer(string) return load_request_bio(bio, format) def load_request_der_string(string): # type: (AnyStr) -> Request """ Load certificate request from a string. :param string: String containing a certificate request in DER format. :return: M2Crypto.X509.Request object. """ string = util.py3bytes(string) bio = BIO.MemoryBuffer(string) return load_request_bio(bio, FORMAT_DER) class CRL: """ X509 Certificate Revocation List """ m2_x509_crl_free = m2.x509_crl_free def __init__(self, crl=None, _pyfree=0): # type: (Optional[bytes], int) -> None """ :param crl: binary representation of the underlying OpenSSL X509_CRL object. """ if crl is not None: self.crl = crl self._pyfree = _pyfree else: self.crl = m2.x509_crl_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_x509_crl_free(self.crl) def as_text(self): # type: () -> str """ Return CRL in PEM format in a string. :return: String containing the CRL in PEM format. """ buf = BIO.MemoryBuffer() m2.x509_crl_print(buf.bio_ptr(), self.crl) return util.py3str(buf.read_all()) def load_crl(file): # type: (AnyStr) -> CRL """ Load CRL from file. :param file: Name of file containing CRL in PEM format. :return: M2Crypto.X509.CRL object. """ with BIO.openfile(file) as f: cptr = m2.x509_crl_read_pem(f.bio_ptr()) if cptr is None: raise X509Error(Err.get_error()) return CRL(cptr, 1) r}r(X#X509_Store_Context.get_current_certXdefrMMX new_extensionrXdefrK&K:Xx509_store_default_cbrXdefrK!K$Xload_request_stringrXdefrM$M4XRequestrXclassrMTMXX509_Store.load_infoXdefrMMXX509_Store._ptrXdefrMMXload_request_bior Xdefr M M"XX509_Name_Entry.get_dataXdefr KMXRequest.set_versionXdefr MMX X509.as_textXdefr MMXX509rXclassrMMXX509_Name.as_textXdefrMMXRequest.as_pemXdefrMpMuXX509.check_purposeXdefrMMXX509_Stack.as_derXdefrM@MFXX509_Name.as_hashXdefrMMXX509_Name.__getitem__XdefrMXM]X X509._ptrXdefrMMXX509_Store_Context.__del__XdefrMyMXX509_Extension_Stack.__del__XdefrKKX X509ErrorrXclassrKKXload_crlrXdefrMiMxX load_certrXdefrMM.XX509_Stack.pushXdefrM#M1XX509.get_pubkeyXdefr MjMnXX509_Stack.__getitem__Xdefr!MMXX509.get_versionXdefr"M<M@XX509_Stack.popXdefr#M2M?XRequest.as_derXdefr$MvM{XX509.set_subject_nameXdefr%M,M3XRequest.get_pubkeyXdefr&MMXX509.get_not_afterXdefr'M_MiXX509_Stack.__del__Xdefr(MMX X509.as_pemXdefr)MMX X509.saveXdefr*MMXX509_Extension.__init__Xdefr+KCKGXX509_Stack.__len__Xdefr,MMX X509_Extension_Stack.__getitem__Xdefr-KKXload_cert_der_stringr.Xdefr/MYMfXX509_Store.set_verify_cbXdefr0MMXX509_Extension.__del__Xdefr1KHKLXX509_Extension.get_criticalXdefr2K^KfXRequest.set_pubkeyXdefr3MMXCRLr4Xclassr5MCMgXX509_Store_Contextr6Xclassr7MhMXnew_stack_from_derr8Xdefr9MHMRXX509_Name.as_derXdefr:MMX X509.as_derXdefr;MMX CRL.__init__Xdefr<MJMWXX509.set_issuerXdefr=MMXX509_Extension.get_nameXdefr>KgKmXX509.set_pubkeyXdefr?MoMzX Request.saveXdefr@MMXload_request_der_stringrAXdefrBM6MAX X509.signXdefrCMMXX509.get_serial_numberXdefrDMAMFXX509_Store_Context._ptrXdefrEMMXX509_Store_Context.__init__XdefrFMoMxXX509_Name.get_entries_by_nidXdefrGMMXX509.get_ext_countXdefrHMMX X509.__init__XdefrIMMX X509.save_pemXdefrJMMXX509.set_serial_numberXdefrKMGMUX X509_NamerLXclassrMMMXX509_Name_Entry._ptrXdefrNKKX X509_StackrOXclassrPMMFXX509_Name._ptrXdefrQMbMfXX509_Store.__init__XdefrRMMXX509_Extension.get_valueXdefrSKnKyXRequest.get_subjectXdefrTMMXX509_Name.__getattr__XdefrUM;MFXX509_Extension_Stack.__len__XdefrVKKXRequest.set_subject_nameXdefrWMMXX509_Name_Entry.set_dataXdefrXKKXX509.get_not_beforeXdefrYMZM^XX509_Name.__del__XdefrZM0M4XX509.set_subjectXdefr[MMXRequest.get_versionXdefr\MMX CRL.as_textXdefr]M]MgXRequest.__init__Xdefr^M[MdXRequest.as_textXdefr_MjMoXX509_Extension_Stack._ptrXdefr`KKXX509_Name.add_entry_by_txtXdefraMgMXX509_Store.__del__XdefrbMMXX509.get_issuerXdefrcM{MXX509_Stack.__iter__XdefrdMMX X509.get_extXdefreMMXX509_Stack.__init__XdefrfMMXRequest.add_extensionsXdefrgMMXX509.set_versionXdefrhMMX Request.signXdefriMMX X509.add_extXdefrjMMXX509_Name.__len__XdefrkMTMWXX509.set_not_afterXdefrlM$M+XX509_Name.__str__XdefrmM5M:XX509_Stack._ptrXdefrnM M"X X509_StoreroXclassrpMMXX509_Name.entry_countXdefrqMMX X509.check_caXdefrrMMXX509_Name_Entry.get_objectXdefrsKKXX509_Extension_Stack.pushXdefrtKKXX509_ExtensionruXclassrvK None self.cipher = rc4_new() if key: rc4_set_key(self.cipher, key) def __del__(self): # type: () -> None if getattr(self, 'cipher', None): self.rc4_free(self.cipher) def set_key(self, key): # type: (bytes) -> None rc4_set_key(self.cipher, key) def update(self, data): # type: (bytes) -> bytes return rc4_update(self.cipher, data) def final(self): # type: () -> str return '' r}r(X RC4.set_keyXdefrKKXRC4rXclassrK K%X RC4.finalXdefrK"K%X RC4.__del__XdefrKKX RC4.__init__XdefrKKX RC4.updateXdefrKK!u}r(XRC4h?X RC4.set_keyh?X RC4.finalh?X RC4.updateh?ujX M2Crypto.RC4rr}rbtUM2Crypto.Enginer(X# vim: sts=4 sw=4 et """ M2Crypto wrapper for OpenSSL ENGINE API. Pavel Shramov IMEC MSU """ from M2Crypto import EVP, Err, X509, m2, six, util if util.py27plus: from typing import AnyStr, Callable, Optional # noqa class EngineError(Exception): pass m2.engine_init_error(EngineError) class Engine: """Wrapper for ENGINE object.""" m2_engine_free = m2.engine_free def __init__(self, id=None, _ptr=None, _pyfree=1): # type: (Optional[bytes], Optional[bytes], int) -> None """Create new Engine from ENGINE pointer or obtain by id""" if not _ptr and not id: raise ValueError("No engine id specified") self._ptr = _ptr if not self._ptr: self._ptr = m2.engine_by_id(id) if not self._ptr: raise ValueError("Unknown engine: %s" % id) self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_engine_free(self._ptr) def init(self): # type: () -> int """Obtain a functional reference to the engine. :return: 0 on error, non-zero on success.""" return m2.engine_init(self._ptr) def finish(self): # type: () -> int """Release a functional and structural reference to the engine.""" return m2.engine_finish(self._ptr) def ctrl_cmd_string(self, cmd, arg, optional=0): # type: (bytes, Optional[bytes], int) -> int """Call ENGINE_ctrl_cmd_string""" if not m2.engine_ctrl_cmd_string(self._ptr, cmd, arg, optional): raise EngineError(Err.get_error()) def get_name(self): # type: () -> bytes """Return engine name""" return m2.engine_get_name(self._ptr) def get_id(self): # type: () -> bytes """Return engine id""" return m2.engine_get_id(self._ptr) def set_default(self, methods=m2.ENGINE_METHOD_ALL): # type: (int) -> int """ Use this engine as default for methods specified in argument :param methods: Possible values are bitwise OR of m2.ENGINE_METHOD_* """ return m2.engine_set_default(self._ptr, methods) def _engine_load_key(self, func, name, pin=None): # type: (Callable, bytes, Optional[bytes]) -> EVP.PKey """Helper function for loading keys""" ui = m2.ui_openssl() cbd = m2.engine_pkcs11_data_new(pin) try: kptr = func(self._ptr, name, ui, cbd) if not kptr: raise EngineError(Err.get_error()) key = EVP.PKey(kptr, _pyfree=1) finally: m2.engine_pkcs11_data_free(cbd) return key def load_private_key(self, name, pin=None): # type: (bytes, Optional[bytes]) -> X509.X509 """Load private key with engine methods (e.g from smartcard). If pin is not set it will be asked """ return self._engine_load_key(m2.engine_load_private_key, name, pin) def load_public_key(self, name, pin=None): # type: (bytes, Optional[bytes]) -> EVP.PKey """Load public key with engine methods (e.g from smartcard).""" return self._engine_load_key(m2.engine_load_public_key, name, pin) def load_certificate(self, name): # type: (bytes) -> X509.X509 """Load certificate from engine (e.g from smartcard). NOTE: This function may be not implemented by engine!""" cptr = m2.engine_load_certificate(self._ptr, name) if not cptr: raise EngineError("Certificate or card not found") return X509.X509(cptr, _pyfree=1) def load_dynamic_engine(id, sopath): # type: (bytes, AnyStr) -> Engine """Load and return dymanic engine from sopath and assign id to it""" if isinstance(sopath, six.text_type): sopath = sopath.encode('utf8') m2.engine_load_dynamic() e = Engine('dynamic') e.ctrl_cmd_string(b'SO_PATH', sopath) e.ctrl_cmd_string(b'ID', id) e.ctrl_cmd_string(b'LIST_ADD', '1') e.ctrl_cmd_string(b'LOAD', None) return e def load_dynamic(): # type: () -> None """Load dynamic engine""" m2.engine_load_dynamic() def load_openssl(): # type: () -> None """Load openssl engine""" m2.engine_load_openssl() def cleanup(): # type: () -> None """If you load any engines, you need to clean up after your application is finished with the engines.""" m2.engine_cleanup() r}r(XEngine.load_certificateXdefrKiKqXEnginerXclassrKKqXcleanuprXdefrKKXEngine.get_nameXdefrK None """ Initialize threading support. """ m2.threading_init() def cleanup(): # type: () -> None """ End and cleanup threading support. """ m2.threading_cleanup() r}r(XinitrXdefrK KXcleanuprXdefrKKu}r(Xinith?Xcleanuph?ujXM2Crypto.threadingrr}rbtUM2Crypto.m2urllibr(XYfrom __future__ import absolute_import, print_function """M2Crypto enhancement to Python's urllib for handling 'https' url's. FIXME: it is questionable whether we need this old-style module at all. urllib (not urllib2) is in Python 3 support just as a legacy API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" import base64 import warnings from M2Crypto import SSL, httpslib, six, util from M2Crypto.six.moves.urllib_response import addinfourl if util.py27plus: from typing import AnyStr, Optional # noqa # six.moves doesn't support star imports if six.PY3: from urllib.request import * # noqa for other modules to import from urllib.parse import * # noqa for other modules to import from urllib.error import * # noqa for other modules to import else: from urllib import * # noqa def open_https(self, url, data=None, ssl_context=None): # type: (AnyStr, Optional[bytes], Optional[SSL.Context]) -> addinfourl """ Open URL over the SSL connection. :param url: URL to be opened :param data: data for the POST request :param ssl_context: SSL.Context to be used :return: """ if six.PY3: warnings.warn('URLOpener has been deprecated in Py3k', DeprecationWarning) if ssl_context is not None and isinstance(ssl_context, SSL.Context): self.ctx = ssl_context else: self.ctx = SSL.Context() user_passwd = None if isinstance(url, six.string_types): try: # python 2 # http://pydoc.org/2.5.1/urllib.html host, selector = splithost(url) if host: user_passwd, host = splituser(host) host = unquote(host) realhost = host except NameError: # python 3 has no splithost # https://docs.python.org/3/library/urllib.parse.html parsed = urlparse(url) host = parsed.hostname if parsed.port: host += ":{0}".format(parsed.port) user_passwd = parsed.password if parsed.password: user_passwd += ":{0}".format(parsed.password) selector = parsed.path else: host, selector = url urltype, rest = splittype(selector) url = rest user_passwd = None if urltype.lower() != 'http': realhost = None else: try: # python 2 realhost, rest = splithost(rest) if realhost: user_passwd, realhost = splituser(realhost) if user_passwd: selector = "%s://%s%s" % (urltype, realhost, rest) except NameError: # python 3 has no splithost parsed = urlparse(rest) host = parsed.hostname if parsed.port: host += ":{0}".format(parsed.port) user_passwd = parsed.username if parsed.password: user_passwd += ":{0}".format(parsed.password) # print("proxy via http:", host, selector) if not host: raise IOError('http error', 'no host given') if user_passwd: with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) auth = base64.encodestring(user_passwd).strip() else: auth = None # Start here! h = httpslib.HTTPSConnection(host=host, ssl_context=self.ctx) # h.set_debuglevel(1) # Stop here! if data is not None: h.putrequest('POST', selector) h.putheader('Content-type', 'application/x-www-form-urlencoded') h.putheader('Content-length', '%d' % len(data)) else: h.putrequest('GET', selector) if auth: h.putheader('Authorization', 'Basic %s' % auth) for args in self.addheaders: h.putheader(*args) # for python3 - used to use apply h.endheaders() if data is not None: h.send(data + '\r\n') # Here again! resp = h.getresponse() fp = resp.fp return addinfourl(fp, resp.msg, "https:" + url) # Stop again. # Minor brain surgery. URLopener.open_https = open_https r}rX open_httpsrXdefrKKus}rX open_httpsh?sjXM2Crypto.m2urllibrr}rbtU M2Crypto.BIOr(XP*from __future__ import absolute_import """M2Crypto wrapper for OpenSSL BIO API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" import logging from M2Crypto import m2, six, util if util.py27plus: from typing import AnyStr, Callable, Iterable, Optional, Union # noqa log = logging.getLogger('BIO') class BIOError(Exception): pass m2.bio_init(BIOError) class BIO(object): """Abstract object interface to the BIO API.""" m2_bio_free = m2.bio_free def __init__(self, bio=None, _pyfree=0, _close_cb=None): # type: (Optional[BIO], int, Optional[Callable]) -> None self.bio = bio self._pyfree = _pyfree self._close_cb = _close_cb self.closed = 0 self.write_closed = 0 def __del__(self): if self._pyfree: self.m2_bio_free(self.bio) def _ptr(self): return self.bio # Deprecated. bio_ptr = _ptr def fileno(self): # type: () -> int return m2.bio_get_fd(self.bio) def readable(self): # type: () -> bool return not self.closed def read(self, size=None): # type: (int) -> Union[bytes, bytearray] if not self.readable(): raise IOError('cannot read') if size is None: buf = bytearray() while 1: data = m2.bio_read(self.bio, 4096) if not data: break buf += data return buf elif size == 0: return b'' elif size < 0: raise ValueError('read count is negative') else: return bytes(m2.bio_read(self.bio, size)) def readline(self, size=4096): # type: (int) -> bytes if not self.readable(): raise IOError('cannot read') buf = m2.bio_gets(self.bio, size) buf = '' if buf is None else buf return util.py3bytes(buf) def readlines(self, sizehint='ignored'): # type: (Union[AnyStr, int]) -> Iterable[bytes] if not self.readable(): raise IOError('cannot read') lines = [] while 1: buf = m2.bio_gets(self.bio, 4096) if buf is None: break lines.append(util.py3bytes(buf)) return lines def writeable(self): # type: () -> bool return (not self.closed) and (not self.write_closed) def write(self, data): # type: (AnyStr) -> int """Write data to BIO. :return: either data written, or [0, -1] for nothing written, -2 not implemented """ if not self.writeable(): raise IOError('cannot write') if isinstance(data, six.text_type): data = data.encode('utf8') return m2.bio_write(self.bio, data) def write_close(self): # type: () -> None self.write_closed = 1 def flush(self): # type: () -> None """Flush the buffers. :return: 1 for success, and 0 or -1 for failure """ m2.bio_flush(self.bio) def reset(self): # type: () -> int """Set the bio to its initial state. :return: 1 for success, and 0 or -1 for failure """ return m2.bio_reset(self.bio) def close(self): # type: () -> None self.closed = 1 if self._close_cb: self._close_cb() def should_retry(self): # type: () -> int """ Can the call be attempted again, or was there an error ie do_handshake """ return m2.bio_should_retry(self.bio) def should_read(self): # type: () -> int """Should we read more data?""" return m2.bio_should_read(self.bio) def should_write(self): # type: () -> int """Should we write more data?""" return m2.bio_should_write(self.bio) def tell(self): """Return the current offset.""" return m2.bio_tell(self.bio) def seek(self, off): """Seek to the specified absolute offset.""" return m2.bio_seek(self.bio, off) def __enter__(self): return self def __exit__(self, *args): # type: (*Any) -> int self.close() class MemoryBuffer(BIO): """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. """ def __init__(self, data=None): # type: (Optional[bytes]) -> None super(MemoryBuffer, self).__init__(self) if data is not None and not isinstance(data, bytes): raise TypeError( "data must be bytes or None, not %s" % (type(data).__name__, )) self.bio = m2.bio_new(m2.bio_s_mem()) self._pyfree = 1 if data is not None: m2.bio_write(self.bio, data) def __len__(self): # type: () -> int return m2.bio_ctrl_pending(self.bio) def read(self, size=0): # type: (int) -> bytes if not self.readable(): raise IOError('cannot read') if size: return m2.bio_read(self.bio, size) else: return m2.bio_read(self.bio, m2.bio_ctrl_pending(self.bio)) # Backwards-compatibility. getvalue = read_all = read def write_close(self): # type: () -> None super(MemoryBuffer, self).write_close() m2.bio_set_mem_eof_return(self.bio, 0) close = write_close class File(BIO): """Object interface to BIO_s_pyfd. This class interfaces Python to OpenSSL functions that expect BIO. For general file manipulation in Python, use Python's builtin file object. """ def __init__(self, pyfile, close_pyfile=1, mode='rb'): # type: (Union[io.BytesIO, AnyStr], int, AnyStr) -> None super(File, self).__init__(self, _pyfree=1) if isinstance(pyfile, six.string_types): pyfile = open(pyfile, mode) # This is for downward compatibility, but I don't think, that it is # good practice to have two handles for the same file. Whats about # concurrent write access? Last write, last wins? Especially since Py3 # has its own buffer management. See: # # https://docs.python.org/3.3/c-api/file.html # pyfile.flush() self.fname = pyfile.name self.pyfile = pyfile # Be wary of https://github.com/openssl/openssl/pull/1925 # BIO_new_fd is NEVER to be used before OpenSSL 1.1.1 if hasattr(m2, "bio_new_pyfd"): self.bio = m2.bio_new_pyfd(pyfile.fileno(), m2.bio_noclose) else: self.bio = m2.bio_new_pyfile(pyfile, m2.bio_noclose) self.close_pyfile = close_pyfile self.closed = False def flush(self): # type: () -> None super(File, self).flush() self.pyfile.flush() def close(self): # type: () -> None self.flush() super(File, self).close() if self.close_pyfile: self.pyfile.close() def reset(self): # type: () -> int """Set the bio to its initial state. :return: 0 for success, and -1 for failure """ return super(File, self).reset() def __del__(self): if not self.closed: m2.bio_free(self.bio) def openfile(filename, mode='rb'): # type: (AnyStr, AnyStr) -> File return File(open(filename, mode)) class IOBuffer(BIO): """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. """ m2_bio_pop = m2.bio_pop m2_bio_free = m2.bio_free def __init__(self, under_bio, mode='rwb', _pyfree=1): # type: (BIO, str, int) -> None super(IOBuffer, self).__init__(self, _pyfree=_pyfree) self.io = m2.bio_new(m2.bio_f_buffer()) self.bio = m2.bio_push(self.io, under_bio._ptr()) # This reference keeps the underlying BIO alive while we're not closed. self._under_bio = under_bio if 'w' in mode: self.write_closed = 0 else: self.write_closed = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_bio_pop(self.bio) self.m2_bio_free(self.io) def close(self): # type: () -> None BIO.close(self) class CipherStream(BIO): """Object interface to BIO_f_cipher.""" SALT_LEN = m2.PKCS5_SALT_LEN m2_bio_pop = m2.bio_pop m2_bio_free = m2.bio_free def __init__(self, obio): # type: (BIO) -> None super(CipherStream, self).__init__(self, _pyfree=1) self.obio = obio self.bio = m2.bio_new(m2.bio_f_cipher()) self.closed = 0 def __del__(self): # type: () -> None if not getattr(self, 'closed', 1): self.close() def close(self): # type: () -> None self.m2_bio_pop(self.bio) self.m2_bio_free(self.bio) self.closed = 1 def write_close(self): # type: () -> None self.obio.write_close() def set_cipher(self, algo, key, iv, op): # type: (str, AnyStr, AnyStr, int) -> None cipher = getattr(m2, algo, None) if cipher is None: raise ValueError('unknown cipher', algo) else: if not isinstance(key, bytes): key = key.encode('utf8') if not isinstance(iv, bytes): iv = iv.encode('utf8') m2.bio_set_cipher(self.bio, cipher(), key, iv, int(op)) m2.bio_push(self.bio, self.obio._ptr()) class SSLBio(BIO): """Object interface to BIO_f_ssl.""" def __init__(self, _pyfree=1): # type: (int) -> None super(SSLBio, self).__init__(self, _pyfree=_pyfree) self.bio = m2.bio_new(m2.bio_f_ssl()) self.closed = 0 def set_ssl(self, conn, close_flag=m2.bio_noclose): # type: (Connection, int) -> None """ Sets the bio to the SSL pointer which is contained in the connection object. """ self._pyfree = 0 m2.bio_set_ssl(self.bio, conn.ssl, close_flag) if close_flag == m2.bio_noclose: conn.set_ssl_close_flag(m2.bio_close) def do_handshake(self): # type: () -> int """Do the handshake. Return 1 if the handshake completes Return 0 or a negative number if there is a problem """ return m2.bio_do_handshake(self.bio) r}r(X BIO.readlinesXdefrKQK\X BIO.__init__XdefrKK#XCipherStream.write_closeXdefrMTMWXSSLBiorXclassrMfMXBIO.tellXdefrKKXBIO.should_retryXdefrKKX File.__del__XdefrMMX File.__init__XdefrKKXMemoryBuffer.write_closeXdefrKKՇXCipherStream.__init__XdefrMBMHXIOBuffer.__init__XdefrM#M.XBIOrXclassrKKXopenfilerXdefrMMX BIO.readlineXdefrKIKPX BIO.__enter__XdefrKKXBIOErrorrXclassrKKXIOBufferrXclassrMM8XBIO._ptrXdefrK(K*X File.flushXdefrKKX BIO.writeXdefrKaKmX BIO.__exit__XdefrKKXBIO.readXdefrK6KHXCipherStream.set_cipherXdefrMXMdX BIO.filenoXdefrK.K1XBIO.should_readXdefrKKXMemoryBuffer.__len__XdefrKKćX BIO.writeableXdefrK]K`X BIO.readableXdefrK2K5XBIO.seekXdefrKKXCipherStream.closeXdefr MNMSXSSLBio.__init__Xdefr MiMnXSSLBio.do_handshakeXdefr MzMXBIO.write_closeXdefr KnKqXMemoryBuffer.__init__Xdefr KKXCipherStream.__del__XdefrMIMMXBIO.should_writeXdefrKKX BIO.flushXdefrKrKyX File.resetXdefrMMXFilerXclassrKMXIOBuffer.__del__XdefrM/M4X File.closeXdefrMMXSSLBio.set_sslXdefrMoMyX BIO.resetXdefrKzKXMemoryBuffer.readXdefrKK͇X CipherStreamrXclassrM:MdXIOBuffer.closeXdefrM5M8X BIO.__del__XdefrK$K'X BIO.closeXdefrKKX MemoryBufferrXclassrKKׇu}r (X BIO.readlinesh?XCipherStream.write_closeh?XBIO.tellh?XBIO.should_retryh?XMemoryBuffer.write_closeh?XBIOh?Xopenfileh?X BIO.readlineh?XBIOErrorr!h?XIOBufferh?X File.flushh?X BIO.writeh?XBIO.seekh?XBIO.readh?XCipherStream.set_cipherh?X BIO.filenoh?XBIO.should_readh?X BIO.writeableh?X BIO.readableh?XCipherStream.closeh?XSSLBioh?XSSLBio.do_handshakeh?XBIO.write_closeh?XMemoryBuffer.readh?XBIO.should_writeh?X BIO.flushh?X File.reseth?XSSLBio.set_sslh?X File.closeh?X BIO.reseth?XFileh?X CipherStreamh?XIOBuffer.closeh?X BIO.closeh?X MemoryBufferh?ujX M2Crypto.BIOr"r#}r$btUM2Crypto.AuthCookier%(X5from __future__ import absolute_import """Secure Authenticator Cookies Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" import logging import re import time from M2Crypto import Rand, m2, util, six from M2Crypto.six.moves.http_cookies import SimpleCookie # pylint: disable=no-name-in-module,import-error if util.py27plus: from typing import re as type_re, AnyStr, Dict, Optional, Union # noqa _MIX_FORMAT = 'exp=%f&data=%s&digest=' _MIX_RE = re.compile(r'exp=(\d+\.\d+)&data=(.+)&digest=(\S*)') log = logging.getLogger(__name__) def mix(expiry, data, format=_MIX_FORMAT): # type: (float, AnyStr, str) -> AnyStr return format % (expiry, data) def unmix(dough, regex=_MIX_RE): # type: (AnyStr, type_re) -> object mo = regex.match(dough) if mo: return float(mo.group(1)), mo.group(2) else: return None def unmix3(dough, regex=_MIX_RE): # type: (AnyStr, type_re) -> Optional[tuple[float, AnyStr, AnyStr]] mo = regex.match(dough) if mo: return float(mo.group(1)), mo.group(2), mo.group(3) else: return None _TOKEN = '_M2AUTH_' # type: str class AuthCookieJar: _keylen = 20 # type: int def __init__(self): # type: () -> None self._key = Rand.rand_bytes(self._keylen) def _hmac(self, key, data): # type: (bytes, str) -> str return util.bin_to_hex(m2.hmac(key, util.py3bytes(data), m2.sha1())) def makeCookie(self, expiry, data): # type: (float, str) -> AuthCookie """ Make a cookie :param expiry: expiration time (float in seconds) :param data: cookie content :return: AuthCookie object """ if not isinstance(expiry, (six.integer_types, float)): raise ValueError('Expiration time must be number, not "%s' % expiry) dough = mix(expiry, data) return AuthCookie(expiry, data, dough, self._hmac(self._key, dough)) def isGoodCookie(self, cookie): # type: (AuthCookie) -> Union[bool, int] assert isinstance(cookie, AuthCookie) if cookie.isExpired(): return 0 c = self.makeCookie(cookie._expiry, cookie._data) return (c._expiry == cookie._expiry) \ and (c._data == cookie._data) \ and (c._mac == cookie._mac) \ and (c.output() == cookie.output()) def isGoodCookieString(self, cookie_str, _debug=False): # type: (Union[dict, bytes], bool) -> Union[bool, int] c = SimpleCookie() c.load(cookie_str) if _TOKEN not in c: log.error('_TOKEN not in c (keys = %s)', dir(c)) return 0 undough = unmix3(c[_TOKEN].value) if undough is None: log.error('undough is None') return 0 exp, data, mac = undough c2 = self.makeCookie(exp, data) if _debug and (c2._mac == mac): log.error('cookie_str = %s', cookie_str) log.error('c2.isExpired = %s', c2.isExpired()) log.error('mac = %s', mac) log.error('c2._mac = %s', c2._mac) log.error('c2._mac == mac: %s', str(c2._mac == mac)) return (not c2.isExpired()) and (c2._mac == mac) class AuthCookie: def __init__(self, expiry, data, dough, mac): # type: (float, str, str, str) -> None """ Create new authentication cookie :param expiry: expiration time (in seconds) :param data: cookie payload (as a string) :param dough: expiry & data concatenated to URL compliant string :param mac: SHA1-based HMAC of dough and random key """ self._expiry = expiry self._data = data self._mac = mac self._cookie = SimpleCookie() self._cookie[_TOKEN] = '%s%s' % (dough, mac) self._name = '%s%s' % (dough, mac) # WebKit only. def expiry(self): # type: () -> float """Return the cookie's expiry time.""" return self._expiry def data(self): # type: () -> str """Return the data portion of the cookie.""" return self._data def mac(self): # type: () -> str """Return the cookie's MAC.""" return self._mac def output(self, header="Set-Cookie:"): # type: (Optional[str]) -> str """Return the cookie's output in "Set-Cookie" format.""" return self._cookie.output(header=header) def value(self): # type: () -> str """Return the cookie's output minus the "Set-Cookie: " portion. """ return self._cookie[_TOKEN].value def isExpired(self): # type: () -> bool """Return 1 if the cookie has expired, 0 otherwise.""" return isinstance(self._expiry, (float, six.integer_types)) and \ (time.time() > self._expiry) # Following two methods are for WebKit only. # I may wish to push them to WKAuthCookie, but they are part # of the API now. Oh well. def name(self): # type: () -> str return self._name def headerValue(self): # type: () -> str return self.value() r&}r'(XAuthCookieJar.isGoodCookieXdefr(KKKUXAuthCookie.nameXdefr)KKX AuthCookier*Xclassr+KlKXunmixr,Xdefr-KK#XAuthCookie.valueXdefr.KKXAuthCookie.expiryXdefr/KKXAuthCookie.__init__Xdefr0KnKXAuthCookie.outputXdefr1KKX AuthCookieJarr2Xclassr3K1KjXAuthCookieJar.__init__Xdefr4K5K8XAuthCookie.isExpiredXdefr5KKXmixr6Xdefr7KKXAuthCookie.macXdefr8KKXAuthCookieJar.makeCookieXdefr9K=KJXAuthCookieJar._hmacXdefr:K9KKKXAuthCookie.dataXdefr?KKu}r@(XAuthCookie.nameh?XAuthCookieJar.isGoodCookieh?X AuthCookieJar.isGoodCookieStringh?XAuthCookie.valueh?XAuthCookie.expiryh?XAuthCookie.outputh?X AuthCookieJarh?XAuthCookie.isExpiredh?Xmixh?XAuthCookieJar.makeCookieh?XAuthCookie.mach?X AuthCookieh?Xunmixh?XAuthCookie.headerValueh?Xunmix3h?XAuthCookie.datah?ujXM2Crypto.AuthCookierArB}rCbtU M2Crypto.BNrD(Xfrom __future__ import absolute_import """ M2Crypto wrapper for OpenSSL BN (BIGNUM) API. Copyright (c) 2005 Open Source Applications Foundation. All rights reserved. """ from M2Crypto import m2, util if util.py27plus: from typing import Optional # noqa def rand(bits, top=-1, bottom=0): # type: (int, int, int) -> Optional[int] """ Generate cryptographically strong random number. :param bits: Length of random number in bits. :param top: If -1, the most significant bit can be 0. If 0, the most significant bit is 1, and if 1, the two most significant bits will be 1. :param bottom: If bottom is true, the number will be odd. """ return m2.bn_rand(bits, top, bottom) def rand_range(range): # type: (int) -> int """ Generate a random number in a range. :param range: Upper limit for range. :return: A random number in the range [0, range) """ return m2.bn_rand_range(range) def randfname(length): # type: (int) -> str """ Return a random filename, which is simply a string where all the characters are from the set [a-zA-Z0-9]. :param length: Length of filename to return. :return: random filename string """ import warnings warnings.warn( "Don't use BN.randfname(), use tempfile methods instead.", DeprecationWarning, stacklevel=2) letters = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890' lettersLen = len(letters) fname = [] # type: list for x in range(length): fname += [letters[m2.bn_rand_range(lettersLen)]] return ''.join(fname) rE}rF(XrandrGXdefrHKKX rand_rangerIXdefrJKK%X randfnamerKXdefrLK'K;u}rM(Xrandh?X rand_rangeh?X randfnameh?ujX M2Crypto.BNrNrO}rPbtU M2Crypto.ErrrQ(Xfrom __future__ import absolute_import """M2Crypto wrapper for OpenSSL Error API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" from M2Crypto import BIO, m2, util, six # noqa if util.py27plus: from typing import Optional # noqa def get_error(): # type: () -> Optional[str] err = BIO.MemoryBuffer() m2.err_print_errors(err.bio_ptr()) err_msg = err.read() if err_msg: return util.py3str(err_msg) def get_error_code(): # type: () -> int return m2.err_get_error() def peek_error_code(): # type: () -> int return m2.err_peek_error() def get_error_lib(err): # type: (int) -> str return util.py3str(m2.err_lib_error_string(err)) def get_error_func(err): # type: (int) -> str return util.py3str(m2.err_func_error_string(err)) def get_error_reason(err): # type: (int) -> str return util.py3str(m2.err_reason_error_string(err)) def get_error_message(): # type: () -> str return util.py3str(get_error_reason(get_error_code())) def get_x509_verify_error(err): # type: (int) -> str return util.py3str(m2.x509_get_verify_error(err)) class SSLError(Exception): def __init__(self, err, client_addr): # type: (int, util.AddrType) -> None self.err = err self.client_addr = client_addr def __str__(self): # type: () -> str if not isinstance(self.client_addr, six.text_type): s = self.client_addr.decode('utf8') else: s = self.client_addr return "%s: %s: %s" % (get_error_func(self.err), s, get_error_reason(self.err)) class M2CryptoError(Exception): pass rR}rS(Xget_error_messagerTXdefrUK.K1Xget_error_reasonrVXdefrWK)K,Xget_error_coderXXdefrYKKXpeek_error_coderZXdefr[KKX get_error_libr\Xdefr]KK"X M2CryptoErrorr^Xclassr_KHKJX get_errorr`XdefraK KXSSLError.__init__XdefrbK9K=XSSLErrorrcXclassrdK8KFXSSLError.__str__XdefreK>KFXget_error_funcrfXdefrgK$K'Xget_x509_verify_errorrhXdefriK3K6u}rj(Xget_error_reasonh?Xget_error_messageh?Xget_error_codeh?Xpeek_error_codeh?X get_error_libh?X M2CryptoErrorrkh?X get_errorh?XSSLErrorrlh?Xget_error_funch?Xget_x509_verify_errorh?ujX M2Crypto.Errrmrn}robtU M2Crypto.DHrp(Xu from __future__ import absolute_import """M2Crypto wrapper for OpenSSL DH API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" from M2Crypto import BIO, m2, util from M2Crypto.util import genparam_callback if util.py27plus: from typing import AnyStr, Callable # noqa class DHError(Exception): pass m2.dh_init(DHError) class DH: """Object interface to the Diffie-Hellman key exchange protocol. """ m2_dh_free = m2.dh_free def __init__(self, dh, _pyfree=0): # type: (bytes, int) -> None assert m2.dh_type_check(dh) self.dh = dh self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_dh_free(self.dh) def __len__(self): # type: () -> int assert m2.dh_type_check(self.dh), "'dh' type error" return m2.dh_size(self.dh) def __getattr__(self, name): # type: (str) -> bytes if name in ('p', 'g', 'pub', 'priv'): method = getattr(m2, 'dh_get_%s' % (name,)) assert m2.dh_type_check(self.dh), "'dh' type error" return method(self.dh) else: raise AttributeError def __setattr__(self, name, value): # type: (str, bytes) -> bytes if name in ('p', 'g'): raise DHError('set (p, g) via set_params()') elif name in ('pub', 'priv'): raise DHError('generate (pub, priv) via gen_key()') else: self.__dict__[name] = value def _ptr(self): return self.dh def check_params(self): # type: () -> int assert m2.dh_type_check(self.dh), "'dh' type error" return m2.dh_check(self.dh) def gen_key(self): # type: () -> None assert m2.dh_type_check(self.dh), "'dh' type error" m2.dh_generate_key(self.dh) def compute_key(self, pubkey): # type: (bytes) -> bytes assert m2.dh_type_check(self.dh), "'dh' type error" return m2.dh_compute_key(self.dh, pubkey) def print_params(self, bio): # type: (BIO.BIO) -> int assert m2.dh_type_check(self.dh), "'dh' type error" return m2.dhparams_print(bio._ptr(), self.dh) def gen_params(plen, g, callback=genparam_callback): # type: (int, int, Optional[Callable]) -> DH dh_parms = m2.dh_generate_parameters(plen, g, callback) dh_obj = DH(dh_parms, 1) return dh_obj def load_params(file): # type: (AnyStr) -> DH with BIO.openfile(file) as bio: return load_params_bio(bio) def load_params_bio(bio): # type: (BIO.BIO) -> DH return DH(m2.dh_read_parameters(bio._ptr()), 1) def set_params(p, g): # type: (bytes, bytes) -> DH dh = m2.dh_new() m2.dh_set_pg(dh, p, g) return DH(dh, 1) # def free_params(cptr): # m2.dh_free(cptr) DH_GENERATOR_2 = m2.DH_GENERATOR_2 DH_GENERATOR_5 = m2.DH_GENERATOR_5 rq}rr(X DH.gen_keyXdefrsKCKGXDH.check_paramsXdefrtK>KBXDH.print_paramsXdefruKMKQXDHrvXclassrwKKQX DH.__init__XdefrxKKXload_params_bioryXdefrzK`KcXDHErrorr{Xclassr|K KXDH.compute_keyXdefr}KHKLX load_paramsr~XdefrKZK^X DH.__del__XdefrKK#X DH.__len__XdefrK$K(X set_paramsrXdefrKeKjXDH.__setattr__XdefrK2K:XDH._ptrXdefrK;K=XDH.__getattr__XdefrK)K1X gen_paramsrXdefrKSKXu}r(X DH.gen_keyh?XDH.check_paramsh?X gen_paramsh?XDHh?XDH.compute_keyh?XDHErrorrh?X load_paramsh?X set_paramsh?XDH.print_paramsh?Xload_params_bioh?ujX M2Crypto.DHrr}rbtU M2Crypto.DSAr(X9from __future__ import absolute_import, print_function """ M2Crypto wrapper for OpenSSL DSA API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004 OSAF. All Rights Reserved. """ from M2Crypto import BIO, m2, util if util.py27plus: from typing import AnyStr, Callable, Tuple # noqa class DSAError(Exception): pass m2.dsa_init(DSAError) class DSA: """ This class is a context supporting DSA key and parameter values, signing and verifying. Simple example:: from M2Crypto import EVP, DSA, util message = 'Kilroy was here!' md = EVP.MessageDigest('sha1') md.update(message) digest = md.final() dsa = DSA.gen_params(1024) dsa.gen_key() r, s = dsa.sign(digest) good = dsa.verify(digest, r, s) if good: print(' ** success **') else: print(' ** verification failed **') """ m2_dsa_free = m2.dsa_free def __init__(self, dsa, _pyfree=0): # type: (bytes, int) -> None """ Use one of the factory functions to create an instance. :param dsa: binary representation of OpenSSL DSA type """ assert m2.dsa_type_check(dsa), "'dsa' type error" self.dsa = dsa self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_dsa_free(self.dsa) def __len__(self): # type: () -> int """ Return the key length. :return: the DSA key length in bits """ assert m2.dsa_type_check(self.dsa), "'dsa' type error" return m2.dsa_keylen(self.dsa) def __getattr__(self, name): # type: (str) -> bytes """ Return specified DSA parameters and key values. :param name: name of variable to be returned. Must be one of 'p', 'q', 'g', 'pub', 'priv'. :return: value of specified variable (a "byte string") """ if name in ['p', 'q', 'g', 'pub', 'priv']: method = getattr(m2, 'dsa_get_%s' % (name,)) assert m2.dsa_type_check(self.dsa), "'dsa' type error" return method(self.dsa) else: raise AttributeError def __setattr__(self, name, value): # type: (str, bytes) -> None if name in ['p', 'q', 'g']: raise DSAError('set (p, q, g) via set_params()') elif name in ['pub', 'priv']: raise DSAError('generate (pub, priv) via gen_key()') else: self.__dict__[name] = value def set_params(self, p, q, g): # type: (bytes, bytes, bytes) -> None """ Set new parameters. :param p: MPI binary representation ... format that consists of the number's length in bytes represented as a 4-byte big-endian number, and the number itself in big-endian format, where the most significant bit signals a negative number (the representation of numbers with the MSB set is prefixed with null byte). :param q: ditto :param g: ditto @warning: This does not change the private key, so it may be unsafe to use this method. It is better to use gen_params function to create a new DSA object. """ m2.dsa_set_pqg(self.dsa, p, q, g) def gen_key(self): # type: () -> None """ Generate a key pair. """ assert m2.dsa_type_check(self.dsa), "'dsa' type error" m2.dsa_gen_key(self.dsa) def save_params(self, filename): # type: (AnyStr) -> int """ Save the DSA parameters to a file. :param filename: Save the DSA parameters to this file. :return: 1 (true) if successful """ with BIO.openfile(filename, 'wb') as bio: ret = m2.dsa_write_params_bio(self.dsa, bio._ptr()) return ret def save_params_bio(self, bio): # type: (BIO.BIO) -> int """ Save DSA parameters to a BIO object. :param bio: Save DSA parameters to this object. :return: 1 (true) if successful """ return m2.dsa_write_params_bio(self.dsa, bio._ptr()) def save_key(self, filename, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (AnyStr, str, Callable) -> int """ Save the DSA key pair to a file. :param filename: Save the DSA key pair to this file. :param cipher: name of symmetric key algorithm and mode to encrypt the private key. :return: 1 (true) if successful """ with BIO.openfile(filename, 'wb') as bio: ret = self.save_key_bio(bio, cipher, callback) return ret def save_key_bio(self, bio, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (BIO.BIO, str, Callable) -> int """ Save DSA key pair to a BIO object. :param bio: Save DSA parameters to this object. :param cipher: name of symmetric key algorithm and mode to encrypt the private key. :return: 1 (true) if successful """ if cipher is None: return m2.dsa_write_key_bio_no_cipher(self.dsa, bio._ptr(), callback) else: ciph = getattr(m2, cipher, None) if ciph is None: raise DSAError('no such cipher: %s' % cipher) else: ciph = ciph() return m2.dsa_write_key_bio(self.dsa, bio._ptr(), ciph, callback) def save_pub_key(self, filename): # type: (AnyStr) -> int """ Save the DSA public key (with parameters) to a file. :param filename: Save DSA public key (with parameters) to this file. :return: 1 (true) if successful """ with BIO.openfile(filename, 'wb') as bio: ret = self.save_pub_key_bio(bio) return ret def save_pub_key_bio(self, bio): # type: (BIO.BIO) -> int """ Save DSA public key (with parameters) to a BIO object. :param bio: Save DSA public key (with parameters) to this object. :return: 1 (true) if successful """ return m2.dsa_write_pub_key_bio(self.dsa, bio._ptr()) def sign(self, digest): # type: (bytes) -> Tuple[bytes, bytes] """ Sign the digest. :param digest: SHA-1 hash of message (same as output from MessageDigest, a "byte string") :return: DSA signature, a tuple of two values, r and s, both "byte strings". """ assert self.check_key(), 'key is not initialised' return m2.dsa_sign(self.dsa, digest) def verify(self, digest, r, s): # type: (bytes, bytes, bytes) -> int """ Verify a newly calculated digest against the signature values r and s. :param digest: SHA-1 hash of message (same as output from MessageDigest, a "byte string") :param r: r value of the signature, a "byte string" :param s: s value of the signature, a "byte string" :return: 1 (true) if verify succeeded, 0 if failed """ assert self.check_key(), 'key is not initialised' return m2.dsa_verify(self.dsa, digest, r, s) def sign_asn1(self, digest): assert self.check_key(), 'key is not initialised' return m2.dsa_sign_asn1(self.dsa, digest) def verify_asn1(self, digest, blob): assert self.check_key(), 'key is not initialised' return m2.dsa_verify_asn1(self.dsa, digest, blob) def check_key(self): """ Check to be sure the DSA object has a valid private key. :return: 1 (true) if a valid private key """ assert m2.dsa_type_check(self.dsa), "'dsa' type error" return m2.dsa_check_key(self.dsa) class DSA_pub(DSA): # noqa """ This class is a DSA context that only supports a public key and verification. It does NOT support a private key or signing. """ def sign(self, *argv): # type: (*Any) -> None raise DSAError('DSA_pub object has no private key') sign_asn1 = sign def check_key(self): # type: () -> int """ :return: does DSA_pub contain a pub key? """ return m2.dsa_check_pub_key(self.dsa) save_key = DSA.save_pub_key save_key_bio = DSA.save_pub_key_bio # -------------------------------------------------------------- # factories and other functions def gen_params(bits, callback=util.genparam_callback): # type: (int, Callable) -> DSA """ Factory function that generates DSA parameters and instantiates a DSA object from the output. :param bits: The length of the prime to be generated. If 'bits' < 512, it is set to 512. :param callback: A Python callback object that will be invoked during parameter generation; it usual purpose is to provide visual feedback. :return: instance of DSA. """ dsa = m2.dsa_generate_parameters(bits, callback) if dsa is None: raise DSAError('problem generating DSA parameters') return DSA(dsa, 1) def set_params(p, q, g): # type: (bytes, bytes, bytes) -> DSA """ Factory function that instantiates a DSA object with DSA parameters. :param p: value of p, a "byte string" :param q: value of q, a "byte string" :param g: value of g, a "byte string" :return: instance of DSA. """ dsa = m2.dsa_new() m2.dsa_set_pqg(dsa, p, q, g) return DSA(dsa, 1) def load_params(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> DSA """ Factory function that instantiates a DSA object with DSA parameters from a file. :param file: Names the file (a path) that contains the PEM representation of the DSA parameters. :param callback: A Python callback object that will be invoked if the DSA parameters file is passphrase-protected. :return: instance of DSA. """ with BIO.openfile(file) as bio: ret = load_params_bio(bio, callback) return ret def load_params_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> DSA """ Factory function that instantiates a DSA object with DSA parameters from a M2Crypto.BIO object. :param bio: Contains the PEM representation of the DSA parameters. :param callback: A Python callback object that will be invoked if the DSA parameters file is passphrase-protected. :return: instance of DSA. """ dsa = m2.dsa_read_params(bio._ptr(), callback) if dsa is None: raise DSAError('problem loading DSA parameters') return DSA(dsa, 1) def load_key(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> DSA """ Factory function that instantiates a DSA object from a PEM encoded DSA key pair. :param file: Names the file (a path) that contains the PEM representation of the DSA key pair. :param callback: A Python callback object that will be invoked if the DSA key pair is passphrase-protected. :return: instance of DSA. """ with BIO.openfile(file) as bio: ret = load_key_bio(bio, callback) return ret def load_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> DSA """ Factory function that instantiates a DSA object from a PEM encoded DSA key pair. :param bio: Contains the PEM representation of the DSA key pair. :param callback: A Python callback object that will be invoked if the DSA key pair is passphrase-protected. :return: instance of DSA. """ dsa = m2.dsa_read_key(bio._ptr(), callback) if not dsa: raise DSAError('problem loading DSA key pair') return DSA(dsa, 1) def pub_key_from_params(p, q, g, pub): # type: (bytes, bytes, bytes, bytes) -> DSA_pub """ Factory function that instantiates a DSA_pub object using the parameters and public key specified. :param p: value of p :param q: value of q :param g: value of g :param pub: value of the public key :return: instance of DSA_pub. """ dsa = m2.dsa_new() m2.dsa_set_pqg(dsa, p, q, g) m2.dsa_set_pub(dsa, pub) return DSA_pub(dsa, 1) def load_pub_key(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> DSA_pub """ Factory function that instantiates a DSA_pub object using a DSA public key contained in PEM file. The PEM file must contain the parameters in addition to the public key. :param file: Names the file (a path) that contains the PEM representation of the DSA public key. :param callback: A Python callback object that will be invoked should the DSA public key be passphrase-protected. :return: instance of DSA_pub. """ with BIO.openfile(file) as bio: ret = load_pub_key_bio(bio, callback) return ret def load_pub_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> DSA_pub """ Factory function that instantiates a DSA_pub object using a DSA public key contained in PEM format. The PEM must contain the parameters in addition to the public key. :param bio: Contains the PEM representation of the DSA public key (with params). :param callback: A Python callback object that will be invoked should the DSA public key be passphrase-protected. :return: instance of DSA_pub. """ dsapub = m2.dsa_read_pub_key(bio._ptr(), callback) if not dsapub: raise DSAError('problem loading DSA public key') return DSA_pub(dsapub, 1) r}r(Xpub_key_from_paramsrXdefrMMX DSA.__del__XdefrK None AbstractHTTPHandler.__init__(self) if ssl_context is not None: assert isinstance(ssl_context, SSL.Context), ssl_context self.ctx = ssl_context else: self.ctx = SSL.Context() # Copied from urllib2, so we can set the ssl context. def https_open(self, req): # type: (Request) -> addinfourl """Return an addinfourl object for the request, using http_class. http_class must implement the HTTPConnection API from httplib. The addinfourl return value is a file-like object. It also has methods and attributes including: - info(): return a mimetools.Message object for the headers - geturl(): return the original request URL - code: HTTP status code """ # https://docs.python.org/3.3/library/urllib.request.html#urllib.request.Request.get_host try: # up to python-3.2 host = req.get_host() except AttributeError: # from python-3.3 host = req.host if not host: raise URLError('no host given') # Our change: Check to see if we're using a proxy. # Then create an appropriate ssl-aware connection. full_url = req.get_full_url() target_host = url_parse(full_url)[1] if target_host != host: request_uri = urldefrag(full_url)[0] h = httpslib.ProxyHTTPSConnection(host=host, ssl_context=self.ctx) else: try: # up to python-3.2 request_uri = req.get_selector() except AttributeError: # from python-3.3 request_uri = req.selector h = httpslib.HTTPSConnection(host=host, ssl_context=self.ctx) # End our change h.set_debuglevel(self._debuglevel) headers = dict(req.headers) headers.update(req.unredirected_hdrs) # We want to make an HTTP/1.1 request, but the addinfourl # class isn't prepared to deal with a persistent connection. # It will try to read all remaining data from the socket, # which will block while the server waits for the next request. # So make sure the connection gets closed after the (only) # request. headers["Connection"] = "close" try: h.request(req.get_method(), request_uri, req.data, headers) r = h.getresponse() except socket.error as err: # XXX what error? raise URLError(err) # Pick apart the HTTPResponse object to get the addinfourl # object initialized properly. # Wrap the HTTPResponse object in socket's file object adapter # for Windows. That adapter calls recv(), so delegate recv() # to read(). This weird wrapping allows the returned object to # have readline() and readlines() methods. r.recv = r.read if six.PY2: fp = socket._fileobject(r, close=True) else: r._decref_socketios = lambda: None r.ssl = h.sock.ssl r._timeout = -1.0 r.recv_into = lambda b: SSL.Connection.recv_into(r, b) fp = socket.SocketIO(r, 'rb') resp = addinfourl(fp, r.msg, req.get_full_url()) resp.code = r.status resp.msg = r.reason return resp https_request = AbstractHTTPHandler.do_request_ # Copied from urllib2 with modifications for ssl def build_opener(ssl_context=None, *handlers): # type: (Optional[SSL.Context], *object) -> OpenerDirector """Create an opener object from a list of handlers. The opener will use several default handlers, including support for HTTP and FTP. If any of the handlers passed as arguments are subclasses of the default handlers, the default handlers will not be used. """ def isclass(obj): return isinstance(obj, type) or hasattr(obj, "__bases__") opener = OpenerDirector() default_classes = [ProxyHandler, UnknownHandler, HTTPHandler, HTTPDefaultErrorHandler, HTTPRedirectHandler, FTPHandler, FileHandler, HTTPErrorProcessor] skip = [] for klass in default_classes: for check in handlers: if isclass(check): if issubclass(check, klass): skip.append(klass) elif isinstance(check, klass): skip.append(klass) for klass in skip: default_classes.remove(klass) for klass in default_classes: opener.add_handler(klass()) # Add the HTTPS handler with ssl_context if HTTPSHandler not in skip: opener.add_handler(HTTPSHandler(ssl_context)) for h in handlers: if isclass(h): h = h() opener.add_handler(h) return opener r}r(X build_openerrXdefrKKX_closing_fileobjectrXclassrK'K,X HTTPSHandlerrXclassrK6KXHTTPSHandler.__init__XdefrK7K@Xbuild_opener.isclassXdefrKKXHTTPSHandler.https_openXdefrKBKu}r(X HTTPSHandlerh?X build_openerh?XHTTPSHandler.https_openh?ujXM2Crypto.m2urllib2rr}rbtUM2Crypto.SSL.Cipherr(X"""SSL Ciphers Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" __all__ = ['Cipher', 'Cipher_Stack'] from M2Crypto import m2, util if util.py27plus: from typing import Iterable # noqa class Cipher: def __init__(self, cipher): # type: (str) -> None self.cipher = cipher def __len__(self): # type: () -> int return m2.ssl_cipher_get_bits(self.cipher) def __repr__(self): # type: () -> str return "%s-%s" % (self.name(), len(self)) def __str__(self): # type: () -> str return "%s-%s" % (self.name(), len(self)) def version(self): # type: () -> int return m2.ssl_cipher_get_version(self.cipher) def name(self): # type: () -> str return util.py3str(m2.ssl_cipher_get_name(self.cipher)) class Cipher_Stack: # noqa def __init__(self, stack): # type: (bytes) -> None """ :param stack: binary of the C-type STACK_OF(SSL_CIPHER) """ self.stack = stack def __len__(self): # type: () -> int return m2.sk_ssl_cipher_num(self.stack) def __getitem__(self, idx): # type: (int) -> Cipher if not 0 <= idx < m2.sk_ssl_cipher_num(self.stack): raise IndexError('index out of range') v = m2.sk_ssl_cipher_value(self.stack, idx) return Cipher(v) def __iter__(self): # type: () -> Iterable for i in range(m2.sk_ssl_cipher_num(self.stack)): yield self[i] r}r(XCipher.__init__XdefrK KXCipher.versionXdefrKK X Cipher.nameXdefrK!K$XCipher_Stack.__init__XdefrK'K-XCipher.__str__XdefrKKXCipher_Stack.__len__XdefrK.K1XCipher.__repr__XdefrKKXCipher_Stack.__iter__XdefrK9K=XCipherrXclassrK K$XCipher.__len__XdefrKKX Cipher_StackrXclassrK&K=XCipher_Stack.__getitem__XdefrK2K8u}r(XCipher.versionrhUXCipherrhUX Cipher_StackrhUX Cipher.namerhUujXM2Crypto.SSL.Cipherrr}rbtUM2Crypto.SMIMEr(X&from __future__ import absolute_import """M2Crypto wrapper for OpenSSL S/MIME API. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" from M2Crypto import BIO, EVP, Err, X509, m2, util if util.py27plus: from typing import AnyStr, Callable, Optional # noqa PKCS7_TEXT = m2.PKCS7_TEXT # type: int PKCS7_NOCERTS = m2.PKCS7_NOCERTS # type: int PKCS7_NOSIGS = m2.PKCS7_NOSIGS # type: int PKCS7_NOCHAIN = m2.PKCS7_NOCHAIN # type: int PKCS7_NOINTERN = m2.PKCS7_NOINTERN # type: int PKCS7_NOVERIFY = m2.PKCS7_NOVERIFY # type: int PKCS7_DETACHED = m2.PKCS7_DETACHED # type: int PKCS7_BINARY = m2.PKCS7_BINARY # type: int PKCS7_NOATTR = m2.PKCS7_NOATTR # type: int PKCS7_SIGNED = m2.PKCS7_SIGNED # type: int PKCS7_ENVELOPED = m2.PKCS7_ENVELOPED # type: int PKCS7_SIGNED_ENVELOPED = m2.PKCS7_SIGNED_ENVELOPED # Deprecated PKCS7_DATA = m2.PKCS7_DATA # type: int class PKCS7_Error(Exception): # noqa pass m2.pkcs7_init(PKCS7_Error) class PKCS7: m2_pkcs7_free = m2.pkcs7_free def __init__(self, pkcs7=None, _pyfree=0): # type: (Optional[bytes], int) -> None """PKCS7 object. :param pkcs7: binary representation of the OpenSSL type PKCS7 """ if pkcs7 is not None: self.pkcs7 = pkcs7 self._pyfree = _pyfree else: self.pkcs7 = m2.pkcs7_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_pkcs7_free(self.pkcs7) def _ptr(self): return self.pkcs7 def type(self, text_name=0): # type: (int) -> int if text_name: return m2.pkcs7_type_sn(self.pkcs7) else: return m2.pkcs7_type_nid(self.pkcs7) def write(self, bio): # type: (BIO.BIO) -> int return m2.pkcs7_write_bio(self.pkcs7, bio._ptr()) def write_der(self, bio): # type: (BIO.BIO) -> int return m2.pkcs7_write_bio_der(self.pkcs7, bio._ptr()) def get0_signers(self, certs, flags=0): # type: (X509.X509_Stack, int) -> X509.X509_Stack return X509.X509_Stack(m2.pkcs7_get0_signers(self.pkcs7, certs.stack, flags), 1) def load_pkcs7(p7file): # type: (AnyStr) -> PKCS7 bio = m2.bio_new_file(p7file, 'r') if bio is None: raise BIO.BIOError(Err.get_error()) try: p7_ptr = m2.pkcs7_read_bio(bio) finally: m2.bio_free(bio) if p7_ptr is None: raise PKCS7_Error(Err.get_error()) return PKCS7(p7_ptr, 1) def load_pkcs7_der(p7file): # type: (AnyStr) -> PKCS7 bio = m2.bio_new_file(p7file, 'r') if bio is None: raise BIO.BIOError(Err.get_error()) try: p7_ptr = m2.pkcs7_read_bio_der(bio) finally: m2.bio_free(bio) if p7_ptr is None: raise PKCS7_Error(Err.get_error()) return PKCS7(p7_ptr, 1) def load_pkcs7_bio(p7_bio): # type: (BIO.BIO) -> PKCS7 p7_ptr = m2.pkcs7_read_bio(p7_bio._ptr()) if p7_ptr is None: raise PKCS7_Error(Err.get_error()) return PKCS7(p7_ptr, 1) def load_pkcs7_bio_der(p7_bio): # type: (BIO.BIO) -> PKCS7 p7_ptr = m2.pkcs7_read_bio_der(p7_bio._ptr()) if p7_ptr is None: raise PKCS7_Error(Err.get_error()) return PKCS7(p7_ptr, 1) def smime_load_pkcs7(p7file): # type: (AnyStr) -> PKCS7 bio = m2.bio_new_file(p7file, 'r') if bio is None: raise BIO.BIOError(Err.get_error()) try: p7_ptr, bio_ptr = m2.smime_read_pkcs7(bio) finally: m2.bio_free(bio) if p7_ptr is None: raise SMIME_Error(Err.get_error()) if bio_ptr is None: return PKCS7(p7_ptr, 1), None else: return PKCS7(p7_ptr, 1), BIO.BIO(bio_ptr, 1) def smime_load_pkcs7_bio(p7_bio): # type: (BIO.BIO) -> PKCS7 p7_ptr, bio_ptr = m2.smime_read_pkcs7(p7_bio._ptr()) if p7_ptr is None: raise SMIME_Error(Err.get_error()) if bio_ptr is None: return PKCS7(p7_ptr, 1), None else: return PKCS7(p7_ptr, 1), BIO.BIO(bio_ptr, 1) class Cipher: """Object interface to EVP_CIPHER without all the frills of M2Crypto.EVP.Cipher. """ def __init__(self, algo): # type: (str) -> None cipher = getattr(m2, algo, None) if cipher is None: raise ValueError('unknown cipher', algo) self.cipher = cipher() def _ptr(self): return self.cipher class SMIME_Error(Exception): # noqa pass m2.smime_init(SMIME_Error) # FIXME class has no __init__ method class SMIME: def load_key(self, keyfile, certfile=None, callback=util.passphrase_callback): # type: (AnyStr, Optional[AnyStr], Callable) -> None if certfile is None: certfile = keyfile self.pkey = EVP.load_key(keyfile, callback) self.x509 = X509.load_cert(certfile) def load_key_bio(self, keybio, certbio=None, callback=util.passphrase_callback): # type: (BIO.BIO, Optional[BIO.BIO], Callable) -> None if certbio is None: certbio = keybio self.pkey = EVP.load_key_bio(keybio, callback) self.x509 = X509.load_cert_bio(certbio) def set_x509_stack(self, stack): # type: (X509.X509_Stack) -> None assert isinstance(stack, X509.X509_Stack) self.x509_stack = stack def set_x509_store(self, store): # type: (X509.X509_Store) -> None assert isinstance(store, X509.X509_Store) self.x509_store = store def set_cipher(self, cipher): # type: (Cipher) -> None assert isinstance(cipher, Cipher) self.cipher = cipher def unset_key(self): # type: () -> None del self.pkey del self.x509 def unset_x509_stack(self): # type: () -> None del self.x509_stack def unset_x509_store(self): # type: () -> None del self.x509_store def unset_cipher(self): # type: () -> None del self.cipher def encrypt(self, data_bio, flags=0): # type: (BIO.BIO, int) -> PKCS7 if not hasattr(self, 'cipher'): raise SMIME_Error('no cipher: use set_cipher()') if not hasattr(self, 'x509_stack'): raise SMIME_Error('no recipient certs: use set_x509_stack()') pkcs7 = m2.pkcs7_encrypt(self.x509_stack._ptr(), data_bio._ptr(), self.cipher._ptr(), flags) if pkcs7 is None: raise SMIME_Error(Err.get_error()) return PKCS7(pkcs7, 1) def decrypt(self, pkcs7, flags=0): # type: (PKCS7, int) -> Optional[bytes] if not hasattr(self, 'pkey'): raise SMIME_Error('no private key: use load_key()') if not hasattr(self, 'x509'): raise SMIME_Error('no certificate: load_key() used incorrectly?') blob = m2.pkcs7_decrypt(pkcs7._ptr(), self.pkey._ptr(), self.x509._ptr(), flags) if blob is None: raise SMIME_Error(Err.get_error()) return blob def sign(self, data_bio, flags=0, algo='sha1'): # type: (BIO.BIO, int, Optional[str]) -> PKCS7 if not hasattr(self, 'pkey'): raise SMIME_Error('no private key: use load_key()') hash = getattr(m2, algo, None) if hash is None: raise SMIME_Error('no such hash algorithm %s' % algo) if hasattr(self, 'x509_stack'): pkcs7 = m2.pkcs7_sign1(self.x509._ptr(), self.pkey._ptr(), self.x509_stack._ptr(), data_bio._ptr(), hash(), flags) if pkcs7 is None: raise SMIME_Error(Err.get_error()) return PKCS7(pkcs7, 1) else: pkcs7 = m2.pkcs7_sign0(self.x509._ptr(), self.pkey._ptr(), data_bio._ptr(), hash(), flags) if pkcs7 is None: raise SMIME_Error(Err.get_error()) return PKCS7(pkcs7, 1) def verify(self, pkcs7, data_bio=None, flags=0): # type: (PKCS7, BIO.BIO, int) -> Optional[bytes] if not hasattr(self, 'x509_stack'): raise SMIME_Error('no signer certs: use set_x509_stack()') if not hasattr(self, 'x509_store'): raise SMIME_Error('no x509 cert store: use set_x509_store()') assert isinstance(pkcs7, PKCS7), 'pkcs7 not an instance of PKCS7' p7 = pkcs7._ptr() if data_bio is None: blob = m2.pkcs7_verify0(p7, self.x509_stack._ptr(), self.x509_store._ptr(), flags) else: blob = m2.pkcs7_verify1(p7, self.x509_stack._ptr(), self.x509_store._ptr(), data_bio._ptr(), flags) if blob is None: raise SMIME_Error(Err.get_error()) return blob def write(self, out_bio, pkcs7, data_bio=None, flags=0): # type: (BIO.BIO, PKCS7, Optional[BIO.BIO], int) -> int assert isinstance(pkcs7, PKCS7) if data_bio is None: return m2.smime_write_pkcs7(out_bio._ptr(), pkcs7._ptr(), flags) else: return m2.smime_write_pkcs7_multi(out_bio._ptr(), pkcs7._ptr(), data_bio._ptr(), flags) def text_crlf(text): # type: (bytes) -> bytes bio_in = BIO.MemoryBuffer(text) bio_out = BIO.MemoryBuffer() if m2.smime_crlf_copy(bio_in._ptr(), bio_out._ptr()): return bio_out.read() else: raise SMIME_Error(Err.get_error()) def text_crlf_bio(bio_in): # type: (BIO.BIO) -> BIO.BIO bio_out = BIO.MemoryBuffer() if m2.smime_crlf_copy(bio_in._ptr(), bio_out._ptr()): return bio_out else: raise SMIME_Error(Err.get_error()) r}r(Xload_pkcs7_biorXdefrKpKvXSMIME.set_cipherXdefrKKԇXsmime_load_pkcs7_biorXdefrKKX PKCS7_ErrorrXclassrKKX SMIME.decryptXdefrKKXSMIME.unset_x509_storeXdefrKKXSMIME.set_x509_stackXdefrKKʇXSMIME.load_keyXdefrKKX SMIME.writeXdefrM)M1X Cipher._ptrXdefrKKX PKCS7.__del__XdefrK3K7XSMIME.set_x509_storeXdefr KKχX PKCS7._ptrXdefr K8K:XSMIME.unset_keyXdefr KKهX SMIME.verifyXdefr MM(XCipherr XclassrKKXSMIME.load_key_bioXdefrKKŇXSMIME.unset_x509_stackXdefrKK݇XPKCS7rXclassrK!KNXCipher.__init__XdefrKKX load_pkcs7rXdefrKPK^X PKCS7.writeXdefrKBKEXSMIME.unset_cipherXdefrKKXPKCS7.get0_signersXdefrKJKNX text_crlfrXdefrM3M;XSMIMErXclassrKM1Xload_pkcs7_bio_derrXdefrKxK~X SMIME.encryptXdefrKKX PKCS7.typeXdefr K;KAXPKCS7.write_derXdefr!KFKIX SMIME_Errorr"Xclassr#KKXload_pkcs7_derr$Xdefr%K`KnX SMIME.signXdefr&KMXsmime_load_pkcs7r'Xdefr(KKX text_crlf_bior)Xdefr*M=MDXPKCS7.__init__Xdefr+K%K2u}r,(Xload_pkcs7_bioh?XSMIME.set_cipherh?XPKCS7.get0_signersh?X PKCS7_Errorr-h?X load_pkcs7h?XSMIME.unset_x509_storeh?XSMIME.set_x509_stackh?XSMIME.load_keyh?X SMIME.writeh?Xload_pkcs7_bio_derh?XSMIME.set_x509_storeh?XSMIME.unset_keyh?X SMIME.verifyh?XCipherh?XSMIME.load_key_bioh?XSMIME.unset_x509_stackh?XPKCS7h?X SMIME.decrypth?X PKCS7.writeh?XSMIME.unset_cipherh?Xsmime_load_pkcs7_bioh?X text_crlfh?XSMIMEh?X SMIME.encrypth?X PKCS7.typeh?XPKCS7.write_derh?X SMIME_Errorr.h?Xload_pkcs7_derh?X SMIME.signh?Xsmime_load_pkcs7h?X text_crlf_bioh?ujXM2Crypto.SMIMEr/r0}r1btU M2Crypto.RSAr2(X(8from __future__ import absolute_import """M2Crypto wrapper for OpenSSL RSA API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" import sys from M2Crypto import BIO, Err, m2, util if util.py27plus: from typing import Any, AnyStr, Callable, Dict, List, IO, Optional, Tuple # noqa class RSAError(Exception): pass m2.rsa_init(RSAError) no_padding = m2.no_padding pkcs1_padding = m2.pkcs1_padding sslv23_padding = m2.sslv23_padding pkcs1_oaep_padding = m2.pkcs1_oaep_padding class RSA: """ RSA Key Pair. """ m2_rsa_free = m2.rsa_free def __init__(self, rsa, _pyfree=0): # type: (bytes, int) -> None """ :param rsa: binary representation of OpenSSL RSA type """ assert m2.rsa_type_check(rsa), "'rsa' type error" self.rsa = rsa self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_rsa_free(self.rsa) def __len__(self): # type: () -> int return m2.rsa_size(self.rsa) << 3 def __getattr__(self, name): # type: (str) -> bytes if name == 'e': return m2.rsa_get_e(self.rsa) elif name == 'n': return m2.rsa_get_n(self.rsa) else: raise AttributeError def pub(self): # type: () -> Tuple[bytes, bytes] assert self.check_key(), 'key is not initialised' return m2.rsa_get_e(self.rsa), m2.rsa_get_n(self.rsa) def public_encrypt(self, data, padding): # type: (bytes, int) -> bytes assert self.check_key(), 'key is not initialised' return m2.rsa_public_encrypt(self.rsa, data, padding) def public_decrypt(self, data, padding): # type: (bytes, int) -> bytes assert self.check_key(), 'key is not initialised' return m2.rsa_public_decrypt(self.rsa, data, padding) def private_encrypt(self, data, padding): # type: (bytes, int) -> bytes assert self.check_key(), 'key is not initialised' return m2.rsa_private_encrypt(self.rsa, data, padding) def private_decrypt(self, data, padding): # type: (bytes, int) -> bytes assert self.check_key(), 'key is not initialised' return m2.rsa_private_decrypt(self.rsa, data, padding) def save_key_bio(self, bio, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (BIO.BIO, Optional[str], Callable) -> int """ Save the key pair to an M2Crypto.BIO.BIO object in PEM format. :param bio: M2Crypto.BIO.BIO object to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ if cipher is None: return m2.rsa_write_key_no_cipher(self.rsa, bio._ptr(), callback) else: ciph = getattr(m2, cipher, None) if ciph is None: raise RSAError('not such cipher %s' % cipher) else: ciph = ciph() return m2.rsa_write_key(self.rsa, bio._ptr(), ciph, callback) def save_key(self, file, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (AnyStr, Optional[str], Callable) -> int """ Save the key pair to a file in PEM format. :param file: Name of file to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ with BIO.openfile(file, 'wb') as bio: return self.save_key_bio(bio, cipher, callback) save_pem = save_key def as_pem(self, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (Optional[str], Callable) -> bytes """ Returns the key(pair) as a string in PEM format. """ bio = BIO.MemoryBuffer() self.save_key_bio(bio, cipher, callback) return bio.read() def save_key_der_bio(self, bio): # type: (BIO.BIO) -> int """ Save the key pair to an M2Crypto.BIO.BIO object in DER format. :param bio: M2Crypto.BIO.BIO object to save key to. """ return m2.rsa_write_key_der(self.rsa, bio._ptr()) def save_key_der(self, file): # type: (AnyStr) -> int """ Save the key pair to a file in DER format. :param file: Filename to save key to """ with BIO.openfile(file, 'wb') as bio: return self.save_key_der_bio(bio) def save_pub_key_bio(self, bio): # type: (BIO.BIO) -> int """ Save the public key to an M2Crypto.BIO.BIO object in PEM format. :param bio: M2Crypto.BIO.BIO object to save key to. """ return m2.rsa_write_pub_key(self.rsa, bio._ptr()) def save_pub_key(self, file): # type: (AnyStr) -> int """ Save the public key to a file in PEM format. :param file: Name of file to save key to. """ with BIO.openfile(file, 'wb') as bio: return m2.rsa_write_pub_key(self.rsa, bio._ptr()) def check_key(self): # type: () -> int """ :return: returns 1 if rsa is a valid RSA key, and 0 otherwise. -1 is returned if an error occurs while checking the key. If the key is invalid or an error occurred, the reason code can be obtained using ERR_get_error(3). """ return m2.rsa_check_key(self.rsa) def sign_rsassa_pss(self, digest, algo='sha1', salt_length=20): # type: (bytes, str, int) -> bytes """ Signs a digest with the private key using RSASSA-PSS :param digest: A digest created by using the digest method :param salt_length: The length of the salt to use :param algo: The hash algorithm to use Legal values like 'sha1','sha224', 'sha256', 'ripemd160', and 'md5'. :return: a string which is the signature """ hash = getattr(m2, algo, None) if hash is None: raise RSAError('not such hash algorithm %s' % algo) signature = m2.rsa_padding_add_pkcs1_pss(self.rsa, digest, hash(), salt_length) return self.private_encrypt(signature, m2.no_padding) def verify_rsassa_pss(self, data, signature, algo='sha1', salt_length=20): # type: (bytes, bytes, str, int) -> int """ Verifies the signature RSASSA-PSS :param data: Data that has been signed :param signature: The signature signed with RSASSA-PSS :param salt_length: The length of the salt that was used :param algo: The hash algorithm to use Legal values are for example 'sha1','sha224', 'sha256', 'ripemd160', and 'md5'. :return: 1 or 0, depending on whether the signature was verified or not. """ hash = getattr(m2, algo, None) if hash is None: raise RSAError('not such hash algorithm %s' % algo) plain_signature = self.public_decrypt(signature, m2.no_padding) return m2.rsa_verify_pkcs1_pss(self.rsa, data, plain_signature, hash(), salt_length) def sign(self, digest, algo='sha1'): # type: (bytes, str) -> bytes """ Signs a digest with the private key :param digest: A digest created by using the digest method :param algo: The method that created the digest. Legal values like 'sha1','sha224', 'sha256', 'ripemd160', and 'md5'. :return: a string which is the signature """ digest_type = getattr(m2, 'NID_' + algo, None) if digest_type is None: raise ValueError('unknown algorithm', algo) return m2.rsa_sign(self.rsa, digest, digest_type) def verify(self, data, signature, algo='sha1'): # type: (bytes, bytes, str) -> int """ Verifies the signature with the public key :param data: Data that has been signed :param signature: The signature signed with the private key :param algo: The method use to create digest from the data before it was signed. Legal values like 'sha1','sha224', 'sha256', 'ripemd160', and 'md5'. :return: 1 or 0, depending on whether the signature was verified or not. """ digest_type = getattr(m2, 'NID_' + algo, None) if digest_type is None: raise ValueError('unknown algorithm', algo) return m2.rsa_verify(self.rsa, data, signature, digest_type) class RSA_pub(RSA): # noqa """ Object interface to an RSA public key. """ def __setattr__(self, name, value): # type: (str, bytes) -> None if name in ['e', 'n']: raise RSAError('use factory function new_pub_key() to set (e, n)') else: self.__dict__[name] = value def private_encrypt(self, *argv): # type: (*Any) -> None raise RSAError('RSA_pub object has no private key') def private_decrypt(self, *argv): # type: (*Any) -> None raise RSAError('RSA_pub object has no private key') def save_key(self, file, *args, **kw): # type: (AnyStr, *Any, **Any) -> int """ Save public key to file. """ return self.save_pub_key(file) def save_key_bio(self, bio, *args, **kw): # type: (BIO.BIO, *Any, **Any) -> int """ Save public key to BIO. """ return self.save_pub_key_bio(bio) # save_key_der # save_key_der_bio def check_key(self): # type: () -> int return m2.rsa_check_pub_key(self.rsa) def rsa_error(): # type: () -> None raise RSAError(Err.get_error_message()) def keygen_callback(p, n, out=sys.stdout): # type: (int, Any, IO[str]) -> None """ Default callback for gen_key(). """ ch = ['.', '+', '*', '\n'] out.write(ch[p]) out.flush() def gen_key(bits, e, callback=keygen_callback): # type: (int, int, Callable) -> RSA """ Generate an RSA key pair. :param bits: Key length, in bits. :param e: The RSA public exponent. :param callback: A Python callable object that is invoked during key generation; its usual purpose is to provide visual feedback. The default callback is keygen_callback. :return: M2Crypto.RSA.RSA object. """ return RSA(m2.rsa_generate_key(bits, e, callback), 1) def load_key(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> RSA """ Load an RSA key pair from file. :param file: Name of file containing RSA public key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback. :return: M2Crypto.RSA.RSA object. """ with BIO.openfile(file) as bio: return load_key_bio(bio, callback) def load_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> RSA """ Load an RSA key pair from an M2Crypto.BIO.BIO object. :param bio: M2Crypto.BIO.BIO object containing RSA key pair in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback. :return: M2Crypto.RSA.RSA object. """ rsa = m2.rsa_read_key(bio._ptr(), callback) if rsa is None: rsa_error() return RSA(rsa, 1) def load_key_string(string, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> RSA """ Load an RSA key pair from a string. :param string: String containing RSA key pair in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback. :return: M2Crypto.RSA.RSA object. """ bio = BIO.MemoryBuffer(string) return load_key_bio(bio, callback) def load_pub_key(file): # type: (AnyStr) -> RSA_pub """ Load an RSA public key from file. :param file: Name of file containing RSA public key in PEM format. :return: M2Crypto.RSA.RSA_pub object. """ with BIO.openfile(file) as bio: return load_pub_key_bio(bio) def load_pub_key_bio(bio): # type: (BIO.BIO) -> RSA_pub """ Load an RSA public key from an M2Crypto.BIO.BIO object. :param bio: M2Crypto.BIO.BIO object containing RSA public key in PEM format. :return: M2Crypto.RSA.RSA_pub object. """ rsa = m2.rsa_read_pub_key(bio._ptr()) if rsa is None: rsa_error() return RSA_pub(rsa, 1) def new_pub_key(e_n): # type: (Tuple[bytes, bytes]) -> RSA_pub """ Instantiate an RSA_pub object from an (e, n) tuple. :param e: The RSA public exponent; it is a string in OpenSSL's MPINT format - 4-byte big-endian bit-count followed by the appropriate number of bits. :param n: The RSA composite of primes; it is a string in OpenSSL's MPINT format - 4-byte big-endian bit-count followed by the appropriate number of bits. :return: M2Crypto.RSA.RSA_pub object. """ (e, n) = e_n rsa = m2.rsa_new() m2.rsa_set_en(rsa, e, n) return RSA_pub(rsa, 1) r3}r4(XRSA.pubXdefr5K;K?X RSA.__del__Xdefr6K)K-XRSA.save_pub_keyXdefr7KKXRSAr8Xclassr9KMXload_pub_key_bior:Xdefr;MMXRSA.save_key_der_bioXdefr<KKXload_keyr=Xdefr>MjMyXRSA.verify_rsassa_pssXdefr?KKXRSA.save_key_derXdefr@KKXRSA_pub.__setattr__XdefrAM"M(X rsa_errorrBXdefrCMHMKXRSA_pubrDXclassrEMMFXRSA_pub.private_decryptXdefrFM-M0XRSA.sign_rsassa_pssXdefrGKKևXRSA.private_encryptXdefrHKJKNXkeygen_callbackrIXdefrJMMMUXRSA_pub.check_keyXdefrKMCMFXRSA_pub.save_keyXdefrLM1M7XRSA_pub.private_encryptXdefrMM)M,XRSA.public_decryptXdefrNKEKIX RSA.__len__XdefrOK.K1X load_pub_keyrPXdefrQMMX RSA.save_keyXdefrRKoKX RSA.verifyXdefrSMMXRSA.public_encryptXdefrTK@KDXRSA_pub.save_key_bioXdefrUM8M>XRSA.signXdefrVKMXRSAErrorrWXclassrXKKX load_key_biorYXdefrZM{MX RSA.check_keyXdefr[KKXRSA.private_decryptXdefr\KOKSX new_pub_keyr]Xdefr^MMXload_key_stringr_Xdefr`MMXRSA.save_key_bioXdefraKTKnX RSA.__init__XdefrbK K(XRSA.__getattr__XdefrcK2K:XRSA.save_pub_key_bioXdefrdKKX RSA.as_pemXdefreKKXgen_keyrfXdefrgMWMhu}rh(XRSA.pubh?XRSA_pub.private_decrypth?XRSA.save_pub_keyh?X RSA.as_pemh?Xload_pub_key_bioh?XRSA.save_key_der_bioh?Xload_keyh?X RSA.check_keyh?XRSA.save_key_derh?X rsa_errorh?XRSA_pubh?XRSA.sign_rsassa_pssh?XRSA.private_encrypth?Xkeygen_callbackh?XRSA_pub.check_keyh?XRSA_pub.save_keyh?XRSA_pub.private_encrypth?XRSA.public_decrypth?X load_pub_keyh?X RSA.save_keyh?X RSA.verifyh?XRSA.public_encrypth?XRSA_pub.save_key_bioh?XRSA.signh?XRSAErrorrih?X load_key_bioh?XRSA.verify_rsassa_pssh?XRSA.private_decrypth?X new_pub_keyh?Xload_key_stringh?XRSA.save_key_bioh?Xgen_keyh?XRSA.save_pub_key_bioh?XRSAh?ujX M2Crypto.RSArjrk}rlbtU M2Crypto.Randrm(X9"""M2Crypto wrapper for OpenSSL PRNG. Requires OpenSSL 0.9.5 and above. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Copyright (c) 2014-2017 Matej Cepl. All rights reserved. See LICENCE for the license information. """ from __future__ import absolute_import from M2Crypto import m2, util if util.py27plus: from typing import AnyStr, Tuple __all__ = ['rand_seed', 'rand_add', 'load_file', 'save_file', 'rand_bytes', 'rand_pseudo_bytes', 'rand_file_name', 'rand_status'] def rand_add(blob, entropy): # type: (bytes, float) -> None """ Mixes blob into the PRNG state. :param blob: added data :param entropy: (the lower bound of) an estimate of how much randomness is contained in blob, measured in bytes. Thus, if the data at buf are unpredictable to an adversary, this increases the uncertainty about the state and makes the PRNG output less predictable. Suitable input comes from user interaction (random key presses, mouse movements) and certain hardware events. Details about sources of randomness and how to estimate their entropy can be found in the literature, e.g. RFC 1750. """ m2.rand_add(blob, entropy) # pylint: disable=no-member def rand_seed(seed): # type: (bytes) -> None """ Equivalent to rand_add() when len(seed) == entropy. :param seed: added data (see description at rand_add) """ m2.rand_seed(seed) # pylint: disable=no-member def rand_status(): # type: () -> int """ Check whether there is enough entropy in PRNG. :return: 1 if the PRNG has been seeded with enough data, 0 otherwise. """ return m2.rand_status() # pylint: disable=no-member def rand_file_name(): # type: () -> AnyStr """ Generate a default path for the random seed file. :return: string with the filename. The seed file is $RANDFILE if that environment variable is set, $HOME/.rnd otherwise. If $HOME is not set either, an error occurs. """ return util.py3str(m2.rand_file_name()) # pylint: disable=no-member def load_file(filename, max_bytes): # type: (bytes, int) -> int """ Read a number of bytes from file filename and adds them to the PRNG. If max_bytes is non-negative, up to to max_bytes are read; starting with OpenSSL 0.9.5, if max_bytes is -1, the complete file is read. :param filename: :param max_bytes: :return: the number of bytes read. """ return m2.rand_load_file(filename, max_bytes) # pylint: disable=no-member def save_file(filename): # type: (AnyStr) -> int """ Write a number of random bytes (currently 1024) to file. The file then can be used to initialize the PRNG by calling load_file() in a later session. :param filename: :return: returns the number of bytes written, and -1 if the bytes written were generated without appropriate seed. """ return m2.rand_save_file(filename) # pylint: disable=no-member def rand_bytes(num): # type: (int) -> bytes """ Return n cryptographically strong pseudo-random bytes. An error occurs if the PRNG has not been seeded with enough randomness to ensure an unpredictable byte sequence. :param num: number of bytes to be returned :return: random bytes """ out = m2.rand_bytes(num) # pylint: disable=no-member if out is None: raise ValueError('Not enough randomness.') elif out == -1: raise ValueError('Not supported by the current RAND method.') else: return out def rand_pseudo_bytes(num): # type: (int) -> Tuple[bytes, int] """ Return num pseudo-random bytes into buf. Pseudo-random byte sequences generated by this method will be unique if they are of sufficient length, but are not necessarily unpredictable. They can be used for non-cryptographic purposes and for certain purposes in cryptographic protocols, but usually not for key generation etc. Output of the function is mixed into the entropy pool before retrieving the new pseudo-random bytes unless disabled at compile time (see FAQ). :param num: number of bytes to be returned :return: random bytes """ import warnings if m2.OPENSSL_VERSION_NUMBER >= 0x10100000: warnings.warn('The underlying OpenSSL method has been ' + 'deprecated. Use Rand.rand_bytes instead.', DeprecationWarning) out = m2.rand_pseudo_bytes(num) # pylint: disable=no-member if out is None: raise ValueError('Not enough randomness.') else: return out rn}ro(Xrand_pseudo_bytesrpXdefrqK{KXrand_addrrXdefrsKK%X rand_seedrtXdefruK'K/X rand_bytesrvXdefrwKgKyX save_filerxXdefryKXKeX load_filerzXdefr{KIKVX rand_statusr|Xdefr}K1K:Xrand_file_namer~XdefrK' % self.reason class HTTPError(URLError, addinfourl): """Raised when HTTP error occurs, but also acts like non-error return""" __super_init = addinfourl.__init__ def __init__(self, url, code, msg, hdrs, fp): self.code = code self.msg = msg self.hdrs = hdrs self.fp = fp self.filename = url # The addinfourl classes depend on fp being a valid file # object. In some cases, the HTTPError may not have a valid # file object. If this happens, the simplest workaround is to # not initialize the base classes. if fp is not None: self.__super_init(fp, hdrs, url, code) def __str__(self): return 'HTTP Error %s: %s' % (self.code, self.msg) # since URLError specifies a .reason attribute, HTTPError should also # provide this attribute. See issue13211 fo discussion. @property def reason(self): return self.msg def info(self): return self.hdrs # copied from cookielib.py _cut_port_re = re.compile(r":\d+$") def request_host(request): """Return request-host, as defined by RFC 2965. Variation from RFC: returned value is lowercased, for convenient comparison. """ url = request.get_full_url() host = urlparse.urlparse(url)[1] if host == "": host = request.get_header("Host", "") # remove port, if present host = _cut_port_re.sub("", host, 1) return host.lower() class Request: def __init__(self, url, data=None, headers={}, origin_req_host=None, unverifiable=False): # unwrap('') --> 'type://host/path' self.__original = unwrap(url) self.__original, self.__fragment = splittag(self.__original) self.type = None # self.__r_type is what's left after doing the splittype self.host = None self.port = None self._tunnel_host = None self.data = data self.headers = {} for key, value in headers.items(): self.add_header(key, value) self.unredirected_hdrs = {} if origin_req_host is None: origin_req_host = request_host(self) self.origin_req_host = origin_req_host self.unverifiable = unverifiable def __getattr__(self, attr): # XXX this is a fallback mechanism to guard against these # methods getting called in a non-standard order. this may be # too complicated and/or unnecessary. # XXX should the __r_XXX attributes be public? if attr in ('_Request__r_type', '_Request__r_host'): getattr(self, 'get_' + attr[12:])() return self.__dict__[attr] raise AttributeError, attr def get_method(self): if self.has_data(): return "POST" else: return "GET" # XXX these helper methods are lame def add_data(self, data): self.data = data def has_data(self): return self.data is not None def get_data(self): return self.data def get_full_url(self): if self.__fragment: return '%s#%s' % (self.__original, self.__fragment) else: return self.__original def get_type(self): if self.type is None: self.type, self.__r_type = splittype(self.__original) if self.type is None: raise ValueError, "unknown url type: %s" % self.__original return self.type def get_host(self): if self.host is None: self.host, self.__r_host = splithost(self.__r_type) if self.host: self.host = unquote(self.host) return self.host def get_selector(self): return self.__r_host def set_proxy(self, host, type): if self.type == 'https' and not self._tunnel_host: self._tunnel_host = self.host else: self.type = type self.__r_host = self.__original self.host = host def has_proxy(self): return self.__r_host == self.__original def get_origin_req_host(self): return self.origin_req_host def is_unverifiable(self): return self.unverifiable def add_header(self, key, val): # useful for something like authentication self.headers[key.capitalize()] = val def add_unredirected_header(self, key, val): # will not be added to a redirected request self.unredirected_hdrs[key.capitalize()] = val def has_header(self, header_name): return (header_name in self.headers or header_name in self.unredirected_hdrs) def get_header(self, header_name, default=None): return self.headers.get( header_name, self.unredirected_hdrs.get(header_name, default)) def header_items(self): hdrs = self.unredirected_hdrs.copy() hdrs.update(self.headers) return hdrs.items() class OpenerDirector: def __init__(self): client_version = "Python-urllib/%s" % __version__ self.addheaders = [('User-agent', client_version)] # self.handlers is retained only for backward compatibility self.handlers = [] # manage the individual handlers self.handle_open = {} self.handle_error = {} self.process_response = {} self.process_request = {} def add_handler(self, handler): if not hasattr(handler, "add_parent"): raise TypeError("expected BaseHandler instance, got %r" % type(handler)) added = False for meth in dir(handler): if meth in ["redirect_request", "do_open", "proxy_open"]: # oops, coincidental match continue i = meth.find("_") protocol = meth[:i] condition = meth[i+1:] if condition.startswith("error"): j = condition.find("_") + i + 1 kind = meth[j+1:] try: kind = int(kind) except ValueError: pass lookup = self.handle_error.get(protocol, {}) self.handle_error[protocol] = lookup elif condition == "open": kind = protocol lookup = self.handle_open elif condition == "response": kind = protocol lookup = self.process_response elif condition == "request": kind = protocol lookup = self.process_request else: continue handlers = lookup.setdefault(kind, []) if handlers: bisect.insort(handlers, handler) else: handlers.append(handler) added = True if added: bisect.insort(self.handlers, handler) handler.add_parent(self) def close(self): # Only exists for backwards compatibility. pass def _call_chain(self, chain, kind, meth_name, *args): # Handlers raise an exception if no one else should try to handle # the request, or return None if they can't but another handler # could. Otherwise, they return the response. handlers = chain.get(kind, ()) for handler in handlers: func = getattr(handler, meth_name) result = func(*args) if result is not None: return result def open(self, fullurl, data=None, timeout=socket._GLOBAL_DEFAULT_TIMEOUT): # accept a URL or a Request object if isinstance(fullurl, basestring): req = Request(fullurl, data) else: req = fullurl if data is not None: req.add_data(data) req.timeout = timeout protocol = req.get_type() # pre-process request meth_name = protocol+"_request" for processor in self.process_request.get(protocol, []): meth = getattr(processor, meth_name) req = meth(req) response = self._open(req, data) # post-process response meth_name = protocol+"_response" for processor in self.process_response.get(protocol, []): meth = getattr(processor, meth_name) response = meth(req, response) return response def _open(self, req, data=None): result = self._call_chain(self.handle_open, 'default', 'default_open', req) if result: return result protocol = req.get_type() result = self._call_chain(self.handle_open, protocol, protocol + '_open', req) if result: return result return self._call_chain(self.handle_open, 'unknown', 'unknown_open', req) def error(self, proto, *args): if proto in ('http', 'https'): # XXX http[s] protocols are special-cased dict = self.handle_error['http'] # https is not different than http proto = args[2] # YUCK! meth_name = 'http_error_%s' % proto http_err = 1 orig_args = args else: dict = self.handle_error meth_name = proto + '_error' http_err = 0 args = (dict, proto, meth_name) + args result = self._call_chain(*args) if result: return result if http_err: args = (dict, 'default', 'http_error_default') + orig_args return self._call_chain(*args) # XXX probably also want an abstract factory that knows when it makes # sense to skip a superclass in favor of a subclass and when it might # make sense to include both def build_opener(*handlers): """Create an opener object from a list of handlers. The opener will use several default handlers, including support for HTTP, FTP and when applicable, HTTPS. If any of the handlers passed as arguments are subclasses of the default handlers, the default handlers will not be used. """ import types def isclass(obj): return isinstance(obj, (types.ClassType, type)) opener = OpenerDirector() default_classes = [ProxyHandler, UnknownHandler, HTTPHandler, HTTPDefaultErrorHandler, HTTPRedirectHandler, FTPHandler, FileHandler, HTTPErrorProcessor] if hasattr(httplib, 'HTTPS'): default_classes.append(HTTPSHandler) skip = set() for klass in default_classes: for check in handlers: if isclass(check): if issubclass(check, klass): skip.add(klass) elif isinstance(check, klass): skip.add(klass) for klass in skip: default_classes.remove(klass) for klass in default_classes: opener.add_handler(klass()) for h in handlers: if isclass(h): h = h() opener.add_handler(h) return opener class BaseHandler: handler_order = 500 def add_parent(self, parent): self.parent = parent def close(self): # Only exists for backwards compatibility pass def __lt__(self, other): if not hasattr(other, "handler_order"): # Try to preserve the old behavior of having custom classes # inserted after default ones (works only for custom user # classes which are not aware of handler_order). return True return self.handler_order < other.handler_order class HTTPErrorProcessor(BaseHandler): """Process HTTP error responses.""" handler_order = 1000 # after all other processing def http_response(self, request, response): code, msg, hdrs = response.code, response.msg, response.info() # According to RFC 2616, "2xx" code indicates that the client's # request was successfully received, understood, and accepted. if not (200 <= code < 300): response = self.parent.error( 'http', request, response, code, msg, hdrs) return response https_response = http_response class HTTPDefaultErrorHandler(BaseHandler): def http_error_default(self, req, fp, code, msg, hdrs): raise HTTPError(req.get_full_url(), code, msg, hdrs, fp) class HTTPRedirectHandler(BaseHandler): # maximum number of redirections to any single URL # this is needed because of the state that cookies introduce max_repeats = 4 # maximum total number of redirections (regardless of URL) before # assuming we're in a loop max_redirections = 10 def redirect_request(self, req, fp, code, msg, headers, newurl): """Return a Request or None in response to a redirect. This is called by the http_error_30x methods when a redirection response is received. If a redirection should take place, return a new Request to allow http_error_30x to perform the redirect. Otherwise, raise HTTPError if no-one else should try to handle this url. Return None if you can't but another Handler might. """ m = req.get_method() if (code in (301, 302, 303, 307) and m in ("GET", "HEAD") or code in (301, 302, 303) and m == "POST"): # Strictly (according to RFC 2616), 301 or 302 in response # to a POST MUST NOT cause a redirection without confirmation # from the user (of urllib2, in this case). In practice, # essentially all clients do redirect in this case, so we # do the same. # be conciliant with URIs containing a space newurl = newurl.replace(' ', '%20') newheaders = dict((k,v) for k,v in req.headers.items() if k.lower() not in ("content-length", "content-type") ) return Request(newurl, headers=newheaders, origin_req_host=req.get_origin_req_host(), unverifiable=True) else: raise HTTPError(req.get_full_url(), code, msg, headers, fp) # Implementation note: To avoid the server sending us into an # infinite loop, the request object needs to track what URLs we # have already seen. Do this by adding a handler-specific # attribute to the Request object. def http_error_302(self, req, fp, code, msg, headers): # Some servers (incorrectly) return multiple Location headers # (so probably same goes for URI). Use first header. if 'location' in headers: newurl = headers.getheaders('location')[0] elif 'uri' in headers: newurl = headers.getheaders('uri')[0] else: return # fix a possible malformed URL urlparts = urlparse.urlparse(newurl) if not urlparts.path and urlparts.netloc: urlparts = list(urlparts) urlparts[2] = "/" newurl = urlparse.urlunparse(urlparts) newurl = urlparse.urljoin(req.get_full_url(), newurl) # For security reasons we do not allow redirects to protocols # other than HTTP, HTTPS or FTP. newurl_lower = newurl.lower() if not (newurl_lower.startswith('http://') or newurl_lower.startswith('https://') or newurl_lower.startswith('ftp://')): raise HTTPError(newurl, code, msg + " - Redirection to url '%s' is not allowed" % newurl, headers, fp) # XXX Probably want to forget about the state of the current # request, although that might interact poorly with other # handlers that also use handler-specific request attributes new = self.redirect_request(req, fp, code, msg, headers, newurl) if new is None: return # loop detection # .redirect_dict has a key url if url was previously visited. if hasattr(req, 'redirect_dict'): visited = new.redirect_dict = req.redirect_dict if (visited.get(newurl, 0) >= self.max_repeats or len(visited) >= self.max_redirections): raise HTTPError(req.get_full_url(), code, self.inf_msg + msg, headers, fp) else: visited = new.redirect_dict = req.redirect_dict = {} visited[newurl] = visited.get(newurl, 0) + 1 # Don't close the fp until we are sure that we won't use it # with HTTPError. fp.read() fp.close() return self.parent.open(new, timeout=req.timeout) http_error_301 = http_error_303 = http_error_307 = http_error_302 inf_msg = "The HTTP server returned a redirect error that would " \ "lead to an infinite loop.\n" \ "The last 30x error message was:\n" def _parse_proxy(proxy): """Return (scheme, user, password, host/port) given a URL or an authority. If a URL is supplied, it must have an authority (host:port) component. According to RFC 3986, having an authority component means the URL must have two slashes after the scheme: >>> _parse_proxy('file:/ftp.example.com/') Traceback (most recent call last): ValueError: proxy URL with no authority: 'file:/ftp.example.com/' The first three items of the returned tuple may be None. Examples of authority parsing: >>> _parse_proxy('proxy.example.com') (None, None, None, 'proxy.example.com') >>> _parse_proxy('proxy.example.com:3128') (None, None, None, 'proxy.example.com:3128') The authority component may optionally include userinfo (assumed to be username:password): >>> _parse_proxy('joe:password@proxy.example.com') (None, 'joe', 'password', 'proxy.example.com') >>> _parse_proxy('joe:password@proxy.example.com:3128') (None, 'joe', 'password', 'proxy.example.com:3128') Same examples, but with URLs instead: >>> _parse_proxy('http://proxy.example.com/') ('http', None, None, 'proxy.example.com') >>> _parse_proxy('http://proxy.example.com:3128/') ('http', None, None, 'proxy.example.com:3128') >>> _parse_proxy('http://joe:password@proxy.example.com/') ('http', 'joe', 'password', 'proxy.example.com') >>> _parse_proxy('http://joe:password@proxy.example.com:3128') ('http', 'joe', 'password', 'proxy.example.com:3128') Everything after the authority is ignored: >>> _parse_proxy('ftp://joe:password@proxy.example.com/rubbish:3128') ('ftp', 'joe', 'password', 'proxy.example.com') Test for no trailing '/' case: >>> _parse_proxy('http://joe:password@proxy.example.com') ('http', 'joe', 'password', 'proxy.example.com') """ scheme, r_scheme = splittype(proxy) if not r_scheme.startswith("/"): # authority scheme = None authority = proxy else: # URL if not r_scheme.startswith("//"): raise ValueError("proxy URL with no authority: %r" % proxy) # We have an authority, so for RFC 3986-compliant URLs (by ss 3. # and 3.3.), path is empty or starts with '/' end = r_scheme.find("/", 2) if end == -1: end = None authority = r_scheme[2:end] userinfo, hostport = splituser(authority) if userinfo is not None: user, password = splitpasswd(userinfo) else: user = password = None return scheme, user, password, hostport class ProxyHandler(BaseHandler): # Proxies must be in front handler_order = 100 def __init__(self, proxies=None): if proxies is None: proxies = getproxies() assert hasattr(proxies, 'has_key'), "proxies must be a mapping" self.proxies = proxies for type, url in proxies.items(): setattr(self, '%s_open' % type, lambda r, proxy=url, type=type, meth=self.proxy_open: \ meth(r, proxy, type)) def proxy_open(self, req, proxy, type): orig_type = req.get_type() proxy_type, user, password, hostport = _parse_proxy(proxy) if proxy_type is None: proxy_type = orig_type req.get_host() if req.host and proxy_bypass(req.host): return None if user and password: user_pass = '%s:%s' % (unquote(user), unquote(password)) creds = base64.b64encode(user_pass).strip() req.add_header('Proxy-authorization', 'Basic ' + creds) hostport = unquote(hostport) req.set_proxy(hostport, proxy_type) if orig_type == proxy_type or orig_type == 'https': # let other handlers take care of it return None else: # need to start over, because the other handlers don't # grok the proxy's URL type # e.g. if we have a constructor arg proxies like so: # {'http': 'ftp://proxy.example.com'}, we may end up turning # a request for http://acme.example.com/a into one for # ftp://proxy.example.com/a return self.parent.open(req, timeout=req.timeout) class HTTPPasswordMgr: def __init__(self): self.passwd = {} def add_password(self, realm, uri, user, passwd): # uri could be a single URI or a sequence if isinstance(uri, basestring): uri = [uri] if not realm in self.passwd: self.passwd[realm] = {} for default_port in True, False: reduced_uri = tuple( [self.reduce_uri(u, default_port) for u in uri]) self.passwd[realm][reduced_uri] = (user, passwd) def find_user_password(self, realm, authuri): domains = self.passwd.get(realm, {}) for default_port in True, False: reduced_authuri = self.reduce_uri(authuri, default_port) for uris, authinfo in domains.iteritems(): for uri in uris: if self.is_suburi(uri, reduced_authuri): return authinfo return None, None def reduce_uri(self, uri, default_port=True): """Accept authority or URI and extract only the authority and path.""" # note HTTP URLs do not have a userinfo component parts = urlparse.urlsplit(uri) if parts[1]: # URI scheme = parts[0] authority = parts[1] path = parts[2] or '/' else: # host or host:port scheme = None authority = uri path = '/' host, port = splitport(authority) if default_port and port is None and scheme is not None: dport = {"http": 80, "https": 443, }.get(scheme) if dport is not None: authority = "%s:%d" % (host, dport) return authority, path def is_suburi(self, base, test): """Check if test is below base in a URI tree Both args must be URIs in reduced form. """ if base == test: return True if base[0] != test[0]: return False common = posixpath.commonprefix((base[1], test[1])) if len(common) == len(base[1]): return True return False class HTTPPasswordMgrWithDefaultRealm(HTTPPasswordMgr): def find_user_password(self, realm, authuri): user, password = HTTPPasswordMgr.find_user_password(self, realm, authuri) if user is not None: return user, password return HTTPPasswordMgr.find_user_password(self, None, authuri) class AbstractBasicAuthHandler: # XXX this allows for multiple auth-schemes, but will stupidly pick # the last one with a realm specified. # allow for double- and single-quoted realm values # (single quotes are a violation of the RFC, but appear in the wild) rx = re.compile('(?:.*,)*[ \t]*([^ \t]+)[ \t]+' 'realm=(["\']?)([^"\']*)\\2', re.I) # XXX could pre-emptively send auth info already accepted (RFC 2617, # end of section 2, and section 1.2 immediately after "credentials" # production). def __init__(self, password_mgr=None): if password_mgr is None: password_mgr = HTTPPasswordMgr() self.passwd = password_mgr self.add_password = self.passwd.add_password def http_error_auth_reqed(self, authreq, host, req, headers): # host may be an authority (without userinfo) or a URL with an # authority # XXX could be multiple headers authreq = headers.get(authreq, None) if authreq: mo = AbstractBasicAuthHandler.rx.search(authreq) if mo: scheme, quote, realm = mo.groups() if quote not in ['"', "'"]: warnings.warn("Basic Auth Realm was unquoted", UserWarning, 2) if scheme.lower() == 'basic': return self.retry_http_basic_auth(host, req, realm) def retry_http_basic_auth(self, host, req, realm): user, pw = self.passwd.find_user_password(realm, host) if pw is not None: raw = "%s:%s" % (user, pw) auth = 'Basic %s' % base64.b64encode(raw).strip() if req.get_header(self.auth_header, None) == auth: return None req.add_unredirected_header(self.auth_header, auth) return self.parent.open(req, timeout=req.timeout) else: return None class HTTPBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): auth_header = 'Authorization' def http_error_401(self, req, fp, code, msg, headers): url = req.get_full_url() response = self.http_error_auth_reqed('www-authenticate', url, req, headers) return response class ProxyBasicAuthHandler(AbstractBasicAuthHandler, BaseHandler): auth_header = 'Proxy-authorization' def http_error_407(self, req, fp, code, msg, headers): # http_error_auth_reqed requires that there is no userinfo component in # authority. Assume there isn't one, since urllib2 does not (and # should not, RFC 3986 s. 3.2.1) support requests for URLs containing # userinfo. authority = req.get_host() response = self.http_error_auth_reqed('proxy-authenticate', authority, req, headers) return response def randombytes(n): """Return n random bytes.""" # Use /dev/urandom if it is available. Fall back to random module # if not. It might be worthwhile to extend this function to use # other platform-specific mechanisms for getting random bytes. if os.path.exists("/dev/urandom"): f = open("/dev/urandom") s = f.read(n) f.close() return s else: L = [chr(random.randrange(0, 256)) for i in range(n)] return "".join(L) class AbstractDigestAuthHandler: # Digest authentication is specified in RFC 2617. # XXX The client does not inspect the Authentication-Info header # in a successful response. # XXX It should be possible to test this implementation against # a mock server that just generates a static set of challenges. # XXX qop="auth-int" supports is shaky def __init__(self, passwd=None): if passwd is None: passwd = HTTPPasswordMgr() self.passwd = passwd self.add_password = self.passwd.add_password self.retried = 0 self.nonce_count = 0 self.last_nonce = None def reset_retry_count(self): self.retried = 0 def http_error_auth_reqed(self, auth_header, host, req, headers): authreq = headers.get(auth_header, None) if self.retried > 5: # Don't fail endlessly - if we failed once, we'll probably # fail a second time. Hm. Unless the Password Manager is # prompting for the information. Crap. This isn't great # but it's better than the current 'repeat until recursion # depth exceeded' approach raise HTTPError(req.get_full_url(), 401, "digest auth failed", headers, None) else: self.retried += 1 if authreq: scheme = authreq.split()[0] if scheme.lower() == 'digest': return self.retry_http_digest_auth(req, authreq) def retry_http_digest_auth(self, req, auth): token, challenge = auth.split(' ', 1) chal = parse_keqv_list(parse_http_list(challenge)) auth = self.get_authorization(req, chal) if auth: auth_val = 'Digest %s' % auth if req.headers.get(self.auth_header, None) == auth_val: return None req.add_unredirected_header(self.auth_header, auth_val) resp = self.parent.open(req, timeout=req.timeout) return resp def get_cnonce(self, nonce): # The cnonce-value is an opaque # quoted string value provided by the client and used by both client # and server to avoid chosen plaintext attacks, to provide mutual # authentication, and to provide some message integrity protection. # This isn't a fabulous effort, but it's probably Good Enough. dig = hashlib.sha1("%s:%s:%s:%s" % (self.nonce_count, nonce, time.ctime(), randombytes(8))).hexdigest() return dig[:16] def get_authorization(self, req, chal): try: realm = chal['realm'] nonce = chal['nonce'] qop = chal.get('qop') algorithm = chal.get('algorithm', 'MD5') # mod_digest doesn't send an opaque, even though it isn't # supposed to be optional opaque = chal.get('opaque', None) except KeyError: return None H, KD = self.get_algorithm_impls(algorithm) if H is None: return None user, pw = self.passwd.find_user_password(realm, req.get_full_url()) if user is None: return None # XXX not implemented yet if req.has_data(): entdig = self.get_entity_digest(req.get_data(), chal) else: entdig = None A1 = "%s:%s:%s" % (user, realm, pw) A2 = "%s:%s" % (req.get_method(), # XXX selector: what about proxies and full urls req.get_selector()) if qop == 'auth': if nonce == self.last_nonce: self.nonce_count += 1 else: self.nonce_count = 1 self.last_nonce = nonce ncvalue = '%08x' % self.nonce_count cnonce = self.get_cnonce(nonce) noncebit = "%s:%s:%s:%s:%s" % (nonce, ncvalue, cnonce, qop, H(A2)) respdig = KD(H(A1), noncebit) elif qop is None: respdig = KD(H(A1), "%s:%s" % (nonce, H(A2))) else: # XXX handle auth-int. raise URLError("qop '%s' is not supported." % qop) # XXX should the partial digests be encoded too? base = 'username="%s", realm="%s", nonce="%s", uri="%s", ' \ 'response="%s"' % (user, realm, nonce, req.get_selector(), respdig) if opaque: base += ', opaque="%s"' % opaque if entdig: base += ', digest="%s"' % entdig base += ', algorithm="%s"' % algorithm if qop: base += ', qop=auth, nc=%s, cnonce="%s"' % (ncvalue, cnonce) return base def get_algorithm_impls(self, algorithm): # algorithm should be case-insensitive according to RFC2617 algorithm = algorithm.upper() # lambdas assume digest modules are imported at the top level if algorithm == 'MD5': H = lambda x: hashlib.md5(x).hexdigest() elif algorithm == 'SHA': H = lambda x: hashlib.sha1(x).hexdigest() # XXX MD5-sess else: raise ValueError("Unsupported digest authentication " "algorithm %r" % algorithm.lower()) KD = lambda s, d: H("%s:%s" % (s, d)) return H, KD def get_entity_digest(self, data, chal): # XXX not implemented yet return None class HTTPDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): """An authentication protocol defined by RFC 2069 Digest authentication improves on basic authentication because it does not transmit passwords in the clear. """ auth_header = 'Authorization' handler_order = 490 # before Basic auth def http_error_401(self, req, fp, code, msg, headers): host = urlparse.urlparse(req.get_full_url())[1] retry = self.http_error_auth_reqed('www-authenticate', host, req, headers) self.reset_retry_count() return retry class ProxyDigestAuthHandler(BaseHandler, AbstractDigestAuthHandler): auth_header = 'Proxy-Authorization' handler_order = 490 # before Basic auth def http_error_407(self, req, fp, code, msg, headers): host = req.get_host() retry = self.http_error_auth_reqed('proxy-authenticate', host, req, headers) self.reset_retry_count() return retry class AbstractHTTPHandler(BaseHandler): def __init__(self, debuglevel=0): self._debuglevel = debuglevel def set_http_debuglevel(self, level): self._debuglevel = level def do_request_(self, request): host = request.get_host() if not host: raise URLError('no host given') if request.has_data(): # POST data = request.get_data() if not request.has_header('Content-type'): request.add_unredirected_header( 'Content-type', 'application/x-www-form-urlencoded') if not request.has_header('Content-length'): request.add_unredirected_header( 'Content-length', '%d' % len(data)) sel_host = host if request.has_proxy(): scheme, sel = splittype(request.get_selector()) sel_host, sel_path = splithost(sel) if not request.has_header('Host'): request.add_unredirected_header('Host', sel_host) for name, value in self.parent.addheaders: name = name.capitalize() if not request.has_header(name): request.add_unredirected_header(name, value) return request def do_open(self, http_class, req, **http_conn_args): """Return an addinfourl object for the request, using http_class. http_class must implement the HTTPConnection API from httplib. The addinfourl return value is a file-like object. It also has methods and attributes including: - info(): return a mimetools.Message object for the headers - geturl(): return the original request URL - code: HTTP status code """ host = req.get_host() if not host: raise URLError('no host given') # will parse host:port h = http_class(host, timeout=req.timeout, **http_conn_args) h.set_debuglevel(self._debuglevel) headers = dict(req.unredirected_hdrs) headers.update(dict((k, v) for k, v in req.headers.items() if k not in headers)) # We want to make an HTTP/1.1 request, but the addinfourl # class isn't prepared to deal with a persistent connection. # It will try to read all remaining data from the socket, # which will block while the server waits for the next request. # So make sure the connection gets closed after the (only) # request. headers["Connection"] = "close" headers = dict( (name.title(), val) for name, val in headers.items()) if req._tunnel_host: tunnel_headers = {} proxy_auth_hdr = "Proxy-Authorization" if proxy_auth_hdr in headers: tunnel_headers[proxy_auth_hdr] = headers[proxy_auth_hdr] # Proxy-Authorization should not be sent to origin # server. del headers[proxy_auth_hdr] h.set_tunnel(req._tunnel_host, headers=tunnel_headers) try: h.request(req.get_method(), req.get_selector(), req.data, headers) except socket.error, err: # XXX what error? h.close() raise URLError(err) else: try: r = h.getresponse(buffering=True) except TypeError: # buffering kw not supported r = h.getresponse() # Pick apart the HTTPResponse object to get the addinfourl # object initialized properly. # Wrap the HTTPResponse object in socket's file object adapter # for Windows. That adapter calls recv(), so delegate recv() # to read(). This weird wrapping allows the returned object to # have readline() and readlines() methods. # XXX It might be better to extract the read buffering code # out of socket._fileobject() and into a base class. r.recv = r.read fp = socket._fileobject(r, close=True) resp = addinfourl(fp, r.msg, req.get_full_url()) resp.code = r.status resp.msg = r.reason return resp class HTTPHandler(AbstractHTTPHandler): def http_open(self, req): return self.do_open(httplib.HTTPConnection, req) http_request = AbstractHTTPHandler.do_request_ if hasattr(httplib, 'HTTPS'): class HTTPSHandler(AbstractHTTPHandler): def __init__(self, debuglevel=0, context=None): AbstractHTTPHandler.__init__(self, debuglevel) self._context = context def https_open(self, req): return self.do_open(httplib.HTTPSConnection, req, context=self._context) https_request = AbstractHTTPHandler.do_request_ class HTTPCookieProcessor(BaseHandler): def __init__(self, cookiejar=None): import cookielib if cookiejar is None: cookiejar = cookielib.CookieJar() self.cookiejar = cookiejar def http_request(self, request): self.cookiejar.add_cookie_header(request) return request def http_response(self, request, response): self.cookiejar.extract_cookies(response, request) return response https_request = http_request https_response = http_response class UnknownHandler(BaseHandler): def unknown_open(self, req): type = req.get_type() raise URLError('unknown url type: %s' % type) def parse_keqv_list(l): """Parse list of key=value strings where keys are not duplicated.""" parsed = {} for elt in l: k, v = elt.split('=', 1) if v[0] == '"' and v[-1] == '"': v = v[1:-1] parsed[k] = v return parsed def parse_http_list(s): """Parse lists as described by RFC 2068 Section 2. In particular, parse comma-separated lists where the elements of the list may include quoted-strings. A quoted-string could contain a comma. A non-quoted string could have quotes in the middle. Neither commas nor quotes count if they are escaped. Only double-quotes count, not single-quotes. """ res = [] part = '' escape = quote = False for cur in s: if escape: part += cur escape = False continue if quote: if cur == '\\': escape = True continue elif cur == '"': quote = False part += cur continue if cur == ',': res.append(part) part = '' continue if cur == '"': quote = True part += cur # append last part if part: res.append(part) return [part.strip() for part in res] def _safe_gethostbyname(host): try: return socket.gethostbyname(host) except socket.gaierror: return None class FileHandler(BaseHandler): # Use local file or FTP depending on form of URL def file_open(self, req): url = req.get_selector() if url[:2] == '//' and url[2:3] != '/' and (req.host and req.host != 'localhost'): req.type = 'ftp' return self.parent.open(req) else: return self.open_local_file(req) # names for the localhost names = None def get_names(self): if FileHandler.names is None: try: FileHandler.names = tuple( socket.gethostbyname_ex('localhost')[2] + socket.gethostbyname_ex(socket.gethostname())[2]) except socket.gaierror: FileHandler.names = (socket.gethostbyname('localhost'),) return FileHandler.names # not entirely sure what the rules are here def open_local_file(self, req): import email.utils import mimetypes host = req.get_host() filename = req.get_selector() localfile = url2pathname(filename) try: stats = os.stat(localfile) size = stats.st_size modified = email.utils.formatdate(stats.st_mtime, usegmt=True) mtype = mimetypes.guess_type(filename)[0] headers = mimetools.Message(StringIO( 'Content-type: %s\nContent-length: %d\nLast-modified: %s\n' % (mtype or 'text/plain', size, modified))) if host: host, port = splitport(host) if not host or \ (not port and _safe_gethostbyname(host) in self.get_names()): if host: origurl = 'file://' + host + filename else: origurl = 'file://' + filename return addinfourl(open(localfile, 'rb'), headers, origurl) except OSError, msg: # urllib2 users shouldn't expect OSErrors coming from urlopen() raise URLError(msg) raise URLError('file not on local host') class FTPHandler(BaseHandler): def ftp_open(self, req): import ftplib import mimetypes host = req.get_host() if not host: raise URLError('ftp error: no host given') host, port = splitport(host) if port is None: port = ftplib.FTP_PORT else: port = int(port) # username/password handling user, host = splituser(host) if user: user, passwd = splitpasswd(user) else: passwd = None host = unquote(host) user = user or '' passwd = passwd or '' try: host = socket.gethostbyname(host) except socket.error, msg: raise URLError(msg) path, attrs = splitattr(req.get_selector()) dirs = path.split('/') dirs = map(unquote, dirs) dirs, file = dirs[:-1], dirs[-1] if dirs and not dirs[0]: dirs = dirs[1:] try: fw = self.connect_ftp(user, passwd, host, port, dirs, req.timeout) type = file and 'I' or 'D' for attr in attrs: attr, value = splitvalue(attr) if attr.lower() == 'type' and \ value in ('a', 'A', 'i', 'I', 'd', 'D'): type = value.upper() fp, retrlen = fw.retrfile(file, type) headers = "" mtype = mimetypes.guess_type(req.get_full_url())[0] if mtype: headers += "Content-type: %s\n" % mtype if retrlen is not None and retrlen >= 0: headers += "Content-length: %d\n" % retrlen sf = StringIO(headers) headers = mimetools.Message(sf) return addinfourl(fp, headers, req.get_full_url()) except ftplib.all_errors, msg: raise URLError, ('ftp error: %s' % msg), sys.exc_info()[2] def connect_ftp(self, user, passwd, host, port, dirs, timeout): fw = ftpwrapper(user, passwd, host, port, dirs, timeout, persistent=False) ## fw.ftp.set_debuglevel(1) return fw class CacheFTPHandler(FTPHandler): # XXX would be nice to have pluggable cache strategies # XXX this stuff is definitely not thread safe def __init__(self): self.cache = {} self.timeout = {} self.soonest = 0 self.delay = 60 self.max_conns = 16 def setTimeout(self, t): self.delay = t def setMaxConns(self, m): self.max_conns = m def connect_ftp(self, user, passwd, host, port, dirs, timeout): key = user, host, port, '/'.join(dirs), timeout if key in self.cache: self.timeout[key] = time.time() + self.delay else: self.cache[key] = ftpwrapper(user, passwd, host, port, dirs, timeout) self.timeout[key] = time.time() + self.delay self.check_cache() return self.cache[key] def check_cache(self): # first check for old ones t = time.time() if self.soonest <= t: for k, v in self.timeout.items(): if v < t: self.cache[k].close() del self.cache[k] del self.timeout[k] self.soonest = min(self.timeout.values()) # then check the size if len(self.cache) == self.max_conns: for k, v in self.timeout.items(): if v == self.soonest: del self.cache[k] del self.timeout[k] break self.soonest = min(self.timeout.values()) def clear_cache(self): for conn in self.cache.values(): conn.close() self.cache.clear() self.timeout.clear() r}r(XRequest.get_origin_req_hostXdefrM4M6X randombytesrXdefrMMXHTTPRedirectHandlerrXclassrM.MXAbstractHTTPHandler.__init__XdefrM_MaXBaseHandler.__lt__XdefrMMX0AbstractDigestAuthHandler.retry_http_digest_authXdefrMMXURLError.__init__XdefrKKXHTTPDefaultErrorHandlerrXclassrM*M-XOpenerDirector.closeXdefrMMXFTPHandler.ftp_openXdefrMfMX/AbstractDigestAuthHandler.http_error_auth_reqedXdefrMMXProxyHandler.__init__XdefrMMXBaseHandler.add_parentXdefrM M XRequest.add_headerXdefrM:M=X$AbstractDigestAuthHandler.get_cnonceXdefrMMXparse_http_listrXdefrMM*X+AbstractDigestAuthHandler.get_authorizationXdefrMM*XOpenerDirectorrXclassrMPMXRequest.__getattr__XdefrKKXCacheFTPHandlerrXclassrMMX%ProxyDigestAuthHandler.http_error_407XdefrMVM\XUnknownHandlerrXclassrMMXHTTPDigestAuthHandlerrXclassrM?MOXRequest.get_typeXdefrMMX"AbstractDigestAuthHandler.__init__XdefrMMXAbstractHTTPHandler.do_request_XdefrMeMXCacheFTPHandler.clear_cacheXdefrMMX"HTTPPasswordMgr.find_user_passwordXdefrMM%Xparse_keqv_listrXdefrMMXRequest.has_headerXdefrMBMEX$HTTPRedirectHandler.redirect_requestXdefrM6MSXAbstractBasicAuthHandlerrXclassrMVMXHTTPError.reasonXdefrKKʇX$ProxyBasicAuthHandler.http_error_407XdefrMMX _parse_proxyrXdefrMMX'AbstractHTTPHandler.set_http_debuglevelXdefrMbMdX!AbstractBasicAuthHandler.__init__XdefrMdMiXFileHandler.open_local_fileXdefrMIMdXOpenerDirector.__init__XdefrMQM[XRequest.get_hostXdefrMM$X HTTPSHandlerrXclassrMMX FTPHandlerrXclassrMeMXOpenerDirector._openXdefrMMXRequest.has_proxyXdefrM1M3XOpenerDirector.errorXdefrMMXRequest.set_proxyXdefrM(M0XurlopenrXdefrKKXBaseHandler.closeXdefrM MX"HTTPRedirectHandler.http_error_302XdefrMXMXOpenerDirector._call_chainXdefrMMXRequest.get_full_urlXdefrMMXRequest.is_unverifiableXdefrM7M9X HTTPErrorProcessor.http_responseXdefrMM'XRequest.get_dataXdefrMMX HTTPCookieProcessor.http_requestXdefrMMXFileHandler.file_openXdefrM3M;XHTTPPasswordMgrWithDefaultRealmrXclassrMLMTXFTPHandler.connect_ftpXdefrMMX*HTTPDefaultErrorHandler.http_error_defaultXdefrM+M-XURLError.__str__XdefrKKX2HTTPPasswordMgrWithDefaultRealm.find_user_passwordXdefrMNMTXCacheFTPHandler.connect_ftpXdefrMMXAbstractHTTPHandlerrXclassrM]MXHTTPSHandler.https_openXdefrMMXHTTPCookieProcessor.__init__XdefrMMXHTTPHandler.http_openXdefrMMXbuild_opener.isclassXdefrMMXRequest.__init__XdefrKKXHTTPError.infoXdefrKK͇XRequest.header_itemsXdefrMKMOX#HTTPBasicAuthHandler.http_error_401XdefrMMX request_hostrXdefrKK߇X+AbstractDigestAuthHandler.get_entity_digestXdefrM:M=XOpenerDirector.add_handlerXdefrM\MXHTTPErrorProcessorrXclassrMM)XHTTPError.__str__XdefrKKćXHTTPSHandler.__init__XdefrMMX$HTTPDigestAuthHandler.http_error_401XdefrMIMOX HTTPHandlerrXclassrMMXRequest.add_dataXdefrMM XRequest.get_headerXdefrMFMJX-AbstractDigestAuthHandler.get_algorithm_implsXdefrM+M9X HTTPErrorrXclassrKK͇XHTTPCookieProcessorrXclassrMMXHTTPBasicAuthHandlerrXclassrMMXHTTPPasswordMgr.add_passwordXdefrMMXHTTPPasswordMgr.is_suburiXdefrM=MJX.AbstractBasicAuthHandler.http_error_auth_reqedXdefrMkMzXProxyBasicAuthHandlerrXclassrMMX!HTTPCookieProcessor.http_responseXdefrMMXCacheFTPHandler.setTimeoutXdefrMMXFileHandler.get_namesXdefrM>MGX build_openerrXdefrMMXCacheFTPHandler.__init__XdefrMMX ProxyHandlerrXclassrMM X BaseHandlerrXclassrMMX.AbstractBasicAuthHandler.retry_http_basic_authXdefrM{MXRequest.add_unredirected_headerXdefrM>MAXOpenerDirector.openXdefrMMXRequest.get_selectorXdefrM%M'X FileHandlerrXclassrM1MdXHTTPPasswordMgrrXclassrM MJXCacheFTPHandler.setMaxConnsXdefr MMXinstall_openerr Xdefr KKXURLErrorr Xclassr KKXProxyDigestAuthHandlerrXclassrMQM\XAbstractHTTPHandler.do_openXdefrMMXAbstractDigestAuthHandlerrXclassrMM=X_safe_gethostbynamerXdefrM+M0XRequestrXclassrKMOXCacheFTPHandler.check_cacheXdefrMMXHTTPPasswordMgr.reduce_uriXdefrM&M<XProxyHandler.proxy_openXdefrMM XHTTPPasswordMgr.__init__XdefrMMXUnknownHandler.unknown_openXdefrMMXHTTPError.__init__XdefrKKXRequest.get_methodXdefrMMX+AbstractDigestAuthHandler.reset_retry_countXdefrMMXRequest.has_dataXdefrM M u}jXM2Crypto.m2urllib2r r!}r"btUM2Crypto.SSL.Sessionr#(XQ"""SSL Session Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" __all__ = ['Session', 'load_session'] from M2Crypto import BIO, Err, m2, util from M2Crypto.SSL import SSLError if util.py27plus: from typing import AnyStr # noqa class Session: m2_ssl_session_free = m2.ssl_session_free def __init__(self, session, _pyfree=0): # type: (bytes, int) -> None assert session is not None self.session = session self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_ssl_session_free(self.session) def _ptr(self): # type: () -> bytes return self.session def as_text(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.ssl_session_print(buf.bio_ptr(), self.session) return buf.read_all() def as_der(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.i2d_ssl_session(buf.bio_ptr(), self.session) return buf.read_all() def write_bio(self, bio): # type: (BIO.BIO) -> int return m2.ssl_session_write_bio(bio.bio_ptr(), self.session) def get_time(self): # type: () -> int return m2.ssl_session_get_time(self.session) def set_time(self, t): # type: (int) -> int return m2.ssl_session_set_time(self.session, t) def get_timeout(self): # type: () -> int return m2.ssl_session_get_timeout(self.session) def set_timeout(self, t): # type: (int) -> int return m2.ssl_session_set_timeout(self.session, t) def load_session(pemfile): # type: (AnyStr) -> Session with BIO.openfile(pemfile) as f: cptr = m2.ssl_session_read_pem(f.bio_ptr()) if cptr is None: raise SSLError(Err.get_error()) return Session(cptr, 1) r$}r%(X Session._ptrXdefr&KKX load_sessionr'Xdefr(KAKHXSession.as_derXdefr)K&K+XSession.__init__Xdefr*KKXSession.get_timeoutXdefr+K8K;XSession.set_timeXdefr,K4K7XSession.as_textXdefr-K K%XSession.get_timeXdefr.K0K3XSessionr/Xclassr0K K?XSession.set_timeoutXdefr1Kr?}r@btUM2Crypto.m2xmlrpclibrA(XV from __future__ import absolute_import """M2Crypto enhancement to xmlrpclib. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" import base64 import M2Crypto from M2Crypto import SSL, httpslib, m2urllib, six, util if util.py27plus: from typing import Any, AnyStr, Callable, Optional # noqa from M2Crypto.six.moves.xmlrpc_client import ProtocolError, Transport # six.moves doesn't support star imports if six.PY3: from xmlrpc.client import * # noqa else: from xmlrpclib import * # noqa __version__ = M2Crypto.__version__ class SSL_Transport(Transport): # noqa user_agent = "M2Crypto_XMLRPC/%s - %s" % (__version__, Transport.user_agent) def __init__(self, ssl_context=None, *args, **kw): # type: (Optional[SSL.Context], *Any, **Any) -> None Transport.__init__(self, *args, **kw) if ssl_context is None: self.ssl_ctx = SSL.Context() else: self.ssl_ctx = ssl_context def request(self, host, handler, request_body, verbose=0): # type: (AnyStr, Callable, bytes, int) -> object # Handle username and password. user_passwd, host_port = m2urllib.splituser(host) _host, _port = m2urllib.splitport(host_port) h = httpslib.HTTPSConnection(_host, int(_port), ssl_context=self.ssl_ctx) if verbose: h.set_debuglevel(1) # What follows is as in xmlrpclib.Transport. (Except the authz bit.) h.putrequest("POST", handler) # required by HTTP/1.1 h.putheader("Host", _host) # required by XML-RPC h.putheader("User-Agent", self.user_agent) h.putheader("Content-Type", "text/xml") h.putheader("Content-Length", str(len(request_body))) # Authorisation. if user_passwd is not None: auth = base64.encodestring(user_passwd).strip() h.putheader('Authorization', 'Basic %s' % auth) h.endheaders() if request_body: h.send(request_body) errcode, errmsg, headers = h.getreply() if errcode != 200: raise ProtocolError( host + handler, errcode, errmsg, headers ) self.verbose = verbose return self.parse_response(h.getfile()) rB}rC(XSSL_Transport.requestXdefrDK&KPX SSL_TransportrEXclassrFKKPXSSL_Transport.__init__XdefrGKK%u}rH(XSSL_Transport.requesth?X SSL_Transporth?ujXM2Crypto.m2xmlrpclibrIrJ}rKbtUM2Crypto.ftpslibrL(X from __future__ import absolute_import """M2Crypto client-side FTP/TLS. This implementation complies with draft-murray-auth-ftp-ssl-07.txt. Example: >>> from M2Crypto import ftpslib >>> f = ftpslib.FTP_TLS() >>> f.connect('', 9021) '220 spinnaker.dyndns.org M2Crypto (Medusa) FTP/TLS server v0.07 ready.' >>> f.auth_tls() >>> f.set_pasv(0) >>> f.login('ftp', 'ngps@') '230 Ok.' >>> f.retrlines('LIST') -rw-rw-r-- 1 0 198 2326 Jul 3 1996 apache_pb.gif drwxrwxr-x 7 0 198 1536 Oct 10 2000 manual drwxrwxr-x 2 0 198 512 Oct 31 2000 modpy drwxrwxr-x 2 0 198 512 Oct 31 2000 bobo drwxr-xr-x 2 0 198 14336 May 28 15:54 postgresql drwxr-xr-x 4 100 198 512 May 16 17:19 home drwxr-xr-x 7 100 100 3584 Sep 23 2000 openacs drwxr-xr-x 10 0 0 512 Aug 5 2000 python1.5 -rw-r--r-- 1 100 198 326 Jul 29 03:29 index.html drwxr-xr-x 12 0 0 512 May 31 17:08 python2.1 '226 Transfer complete' >>> f.quit() '221 Goodbye.' >>> Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" # We want to import whole stdlib ftplib objects, because our users want # to use them. from ftplib import * # noqa # M2Crypto from M2Crypto import SSL class FTP_TLS(FTP): # noqa """Python OO interface to client-side FTP/TLS.""" def __init__(self, host=None, ssl_ctx=None): """Initialise the client. If 'host' is supplied, connect to it.""" if ssl_ctx is not None: self.ssl_ctx = ssl_ctx else: self.ssl_ctx = SSL.Context() FTP.__init__(self, host) self.prot = 0 def auth_tls(self): """Secure the control connection per AUTH TLS, aka AUTH TLS-C.""" self.voidcmd('AUTH TLS') s = SSL.Connection(self.ssl_ctx, self.sock) s.setup_ssl() s.set_connect_state() s.connect_ssl() self.sock = s self.file = self.sock.makefile() def auth_ssl(self): """Secure the control connection per AUTH SSL, aka AUTH TLS-P.""" raise NotImplementedError def prot_p(self): """Set up secure data connection.""" self.voidcmd('PBSZ 0') self.voidcmd('PROT P') self.prot = 1 def prot_c(self): """Set up data connection in the clear.""" self.voidcmd('PROT C') self.prot = 0 def ntransfercmd(self, cmd, rest=None): """Initiate a data transfer.""" conn, size = FTP.ntransfercmd(self, cmd, rest) if self.prot: conn = SSL.Connection(self.ssl_ctx, conn) conn.setup_ssl() conn.set_connect_state() conn.set_session(self.sock.get_session()) conn.connect_ssl() return conn, size rM}rN(XFTP_TLSrOXclassrPK,K\XFTP_TLS.auth_sslXdefrQKCKFXFTP_TLS.ntransfercmdXdefrRKRK\XFTP_TLS.prot_pXdefrSKGKLXFTP_TLS.auth_tlsXdefrTK9KBXFTP_TLS.__init__XdefrUK0K8XFTP_TLS.prot_cXdefrVKMKQu}rW(XFTP_TLSh?XFTP_TLS.auth_sslh?XFTP_TLS.ntransfercmdh?XFTP_TLS.prot_ph?XFTP_TLS.auth_tlsh?XFTP_TLS.prot_ch?ujXM2Crypto.ftpslibrXrY}rZbtU M2Crypto.ASN1r[(Xfrom __future__ import absolute_import """ M2Crypto wrapper for OpenSSL ASN1 API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2005 OSAF. All Rights Reserved. """ import datetime import time from M2Crypto import BIO, m2, util if util.py27plus: from typing import Any, Callable, Optional, Tuple # noqa MBSTRING_FLAG = 0x1000 MBSTRING_ASC = MBSTRING_FLAG | 1 MBSTRING_BMP = MBSTRING_FLAG | 2 class ASN1_Integer: # noqa m2_asn1_integer_free = m2.asn1_integer_free def __init__(self, asn1int, _pyfree=0): # type: (ASN1_Integer, int) -> None self.asn1int = asn1int self._pyfree = _pyfree def __cmp__(self, other): # type: (ASN1_Integer) -> int if not isinstance(other, ASN1_Integer): raise TypeError( "Comparisons supported only between ANS1_Integer objects") return m2.asn1_integer_cmp(self.asn1int, other.asn1int) def __del__(self): # type: () -> None if self._pyfree: self.m2_asn1_integer_free(self.asn1int) def __int__(self): # type: () -> int return m2.asn1_integer_get(self.asn1int) class ASN1_String: # noqa m2_asn1_string_free = m2.asn1_string_free def __init__(self, asn1str, _pyfree=0): # type: (ASN1_String, int) -> None self.asn1str = asn1str self._pyfree = _pyfree def __bytes__(self): # type: () -> bytes buf = BIO.MemoryBuffer() m2.asn1_string_print(buf.bio_ptr(), self.asn1str) return buf.read_all() def __str__(self): # type: () -> str return util.py3str(self.__bytes__()) def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_asn1_string_free(self.asn1str) def _ptr(self): return self.asn1str def as_text(self, flags=0): # type: (int) -> str """Output an ASN1_STRING structure according to the set flags. :param flags: determine the format of the output by using predetermined constants, see ASN1_STRING_print_ex(3) manpage for their meaning. :return: output an ASN1_STRING structure. """ buf = BIO.MemoryBuffer() m2.asn1_string_print_ex(buf.bio_ptr(), self.asn1str, flags) return util.py3str(buf.read_all()) class ASN1_Object: # noqa m2_asn1_object_free = m2.asn1_object_free def __init__(self, asn1obj, _pyfree=0): # type: (ASN1_Object, int) -> None self.asn1obj = asn1obj self._pyfree = _pyfree def __del__(self): # type: () -> None if self._pyfree: self.m2_asn1_object_free(self.asn1obj) def _ptr(self): return self.asn1obj class _UTC(datetime.tzinfo): def tzname(self, dt): # type: (Optional[datetime.datetime]) -> str return "UTC" def dst(self, dt): # type: (Optional[datetime.datetime]) -> datetime.timedelta return datetime.timedelta(0) def utcoffset(self, dt): # type: (Optional[datetime.datetime]) -> datetime.timedelta return datetime.timedelta(0) def __repr__(self): return "" % self.tzname(None) UTC = _UTC() # type: _UTC class LocalTimezone(datetime.tzinfo): """Localtimezone from datetime manual.""" def __init__(self): # type: () -> None self._stdoffset = datetime.timedelta(seconds=-time.timezone) if time.daylight: self._dstoffset = datetime.timedelta(seconds=-time.altzone) else: self._dstoffset = self._stdoffset self._dstdiff = self._dstoffset - self._stdoffset def utcoffset(self, dt): # type: (datetime.datetime) -> datetime.timedelta if self._isdst(dt): return self._dstoffset else: return self._stdoffset def dst(self, dt): # type: (datetime.datetime) -> datetime.timedelta if self._isdst(dt): return self._dstdiff else: return datetime.timedelta(0) def tzname(self, dt): # type: (datetime.datetime) -> str return time.tzname[self._isdst(dt).real] def _isdst(self, dt): # type: (datetime.datetime) -> bool tt = (dt.year, dt.month, dt.day, dt.hour, dt.minute, dt.second, dt.weekday(), 0, -1) stamp = time.mktime(tt) tt = time.localtime(stamp) return tt.tm_isdst > 0 class ASN1_TIME: # noqa _ssl_months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"] m2_asn1_time_free = m2.asn1_time_free def __init__(self, asn1_time=None, _pyfree=0, asn1_utctime=None): # type: (Optional[ASN1_TIME], Optional[int], Optional[ASN1_TIME]) -> None # handle old keyword parameter if asn1_time is None: asn1_time = asn1_utctime if asn1_time is not None: assert m2.asn1_time_type_check(asn1_time), \ "'asn1_time' type error'" self.asn1_time = asn1_time self._pyfree = _pyfree else: self.asn1_time = m2.asn1_time_new() self._pyfree = 1 def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_asn1_time_free(self.asn1_time) def __str__(self): # type: () -> str assert m2.asn1_time_type_check(self.asn1_time), \ "'asn1_time' type error'" buf = BIO.MemoryBuffer() m2.asn1_time_print(buf.bio_ptr(), self.asn1_time) return util.py3str(buf.read_all()) def _ptr(self): assert m2.asn1_time_type_check(self.asn1_time), \ "'asn1_time' type error'" return self.asn1_time def set_string(self, string): # type: (bytes) -> int """Set time from UTC string.""" assert m2.asn1_time_type_check(self.asn1_time), \ "'asn1_time' type error'" return m2.asn1_time_set_string(self.asn1_time, string) def set_time(self, time): # type: (int) -> ASN1_TIME """Set time from seconds since epoch (int).""" assert m2.asn1_time_type_check(self.asn1_time), \ "'asn1_time' type error'" return m2.asn1_time_set(self.asn1_time, time) def get_datetime(self): # type: () -> ASN1_TIME date = str(self) timezone = None if ' ' not in date: raise ValueError("Invalid date: %s" % date) month, rest = date.split(' ', 1) if month not in self._ssl_months: raise ValueError("Invalid date %s: Invalid month: %s" % (date, month)) if rest.endswith(' GMT'): timezone = UTC rest = rest[:-4] if '.' in rest: dt = datetime.datetime.strptime(rest, "%d %H:%M:%S.%f %Y") else: dt = datetime.datetime.strptime(rest, "%d %H:%M:%S %Y") dt = dt.replace(month=self._ssl_months.index(month) + 1) if timezone: dt = dt.replace(tzinfo=UTC) return dt def set_datetime(self, date): # type: (datetime.datetime) -> ASN1_TIME local = LocalTimezone() if date.tzinfo is None: date = date.replace(tzinfo=local) date = date.astimezone(local) return self.set_time(int(time.mktime(date.timetuple()))) ASN1_UTCTIME = ASN1_TIME r\}r](XASN1_TIME.__init__Xdefr^KKXLocalTimezone.__init__Xdefr_KKXASN1_Integer.__int__Xdefr`K.K1XASN1_Object._ptrXdefraKjKlXASN1_String.__str__XdefrbKBKEXLocalTimezone._isdstXdefrcKKX_UTCrdXclassreKnK}XASN1_String._ptrXdefrfKKKMXASN1_TIME.__del__XdefrgKKXASN1_String.as_textXdefrhKNKZXASN1_String.__del__XdefriKFKJXASN1_TIME.set_datetimeXdefrjKKX_UTC.dstXdefrkKsKvXASN1_Integer.__del__XdefrlK)K-X _UTC.tznameXdefrmKoKrX ASN1_TIMErnXclassroKKX ASN1_ObjectrpXclassrqK\KlXASN1_Object.__init__XdefrrK`KdXLocalTimezone.dstXdefrsKKX LocalTimezonertXclassruKKXASN1_TIME.set_stringXdefrvKKՇXASN1_TIME.__str__XdefrwKKɇXASN1_Integer.__cmp__XdefrxK!K(XASN1_TIME.set_timeXdefryKK܇X ASN1_IntegerrzXclassr{KK1XASN1_TIME._ptrXdefr|KK·XASN1_Integer.__init__Xdefr}KK XLocalTimezone.utcoffsetXdefr~KKXASN1_String.__bytes__XdefrKfrom __future__ import absolute_import """ M2Crypto wrapper for OpenSSL ECDH/ECDSA API. @requires: OpenSSL 0.9.8 or newer Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam. All rights reserved.""" from M2Crypto import BIO, Err, EVP, m2, util if util.py27plus: from typing import AnyStr, Callable, Dict, Optional, Tuple, Union # noqa EC_Key = bytes class ECError(Exception): pass m2.ec_init(ECError) # Curve identifier constants NID_secp112r1 = m2.NID_secp112r1 # type: int NID_secp112r2 = m2.NID_secp112r2 # type: int NID_secp128r1 = m2.NID_secp128r1 # type: int NID_secp128r2 = m2.NID_secp128r2 # type: int NID_secp160k1 = m2.NID_secp160k1 # type: int NID_secp160r1 = m2.NID_secp160r1 # type: int NID_secp160r2 = m2.NID_secp160r2 # type: int NID_secp192k1 = m2.NID_secp192k1 # type: int NID_secp224k1 = m2.NID_secp224k1 # type: int NID_secp224r1 = m2.NID_secp224r1 # type: int NID_secp256k1 = m2.NID_secp256k1 # type: int NID_secp384r1 = m2.NID_secp384r1 # type: int NID_secp521r1 = m2.NID_secp521r1 # type: int NID_sect113r1 = m2.NID_sect113r1 # type: int NID_sect113r2 = m2.NID_sect113r2 # type: int NID_sect131r1 = m2.NID_sect131r1 # type: int NID_sect131r2 = m2.NID_sect131r2 # type: int NID_sect163k1 = m2.NID_sect163k1 # type: int NID_sect163r1 = m2.NID_sect163r1 # type: int NID_sect163r2 = m2.NID_sect163r2 # type: int NID_sect193r1 = m2.NID_sect193r1 # type: int NID_sect193r2 = m2.NID_sect193r2 # type: int # default for secg.org TLS test server NID_sect233k1 = m2.NID_sect233k1 # type: int NID_sect233r1 = m2.NID_sect233r1 # type: int NID_sect239k1 = m2.NID_sect239k1 # type: int NID_sect283k1 = m2.NID_sect283k1 # type: int NID_sect283r1 = m2.NID_sect283r1 # type: int NID_sect409k1 = m2.NID_sect409k1 # type: int NID_sect409r1 = m2.NID_sect409r1 # type: int NID_sect571k1 = m2.NID_sect571k1 # type: int NID_sect571r1 = m2.NID_sect571r1 # type: int NID_prime192v1 = m2.NID_X9_62_prime192v1 # type: int NID_prime192v2 = m2.NID_X9_62_prime192v2 # type: int NID_prime192v3 = m2.NID_X9_62_prime192v3 # type: int NID_prime239v1 = m2.NID_X9_62_prime239v1 # type: int NID_prime239v2 = m2.NID_X9_62_prime239v2 # type: int NID_prime239v3 = m2.NID_X9_62_prime239v3 # type: int NID_prime256v1 = m2.NID_X9_62_prime256v1 # type: int NID_c2pnb163v1 = m2.NID_X9_62_c2pnb163v1 # type: int NID_c2pnb163v2 = m2.NID_X9_62_c2pnb163v2 # type: int NID_c2pnb163v3 = m2.NID_X9_62_c2pnb163v3 # type: int NID_c2pnb176v1 = m2.NID_X9_62_c2pnb176v1 # type: int NID_c2tnb191v1 = m2.NID_X9_62_c2tnb191v1 # type: int NID_c2tnb191v2 = m2.NID_X9_62_c2tnb191v2 # type: int NID_c2tnb191v3 = m2.NID_X9_62_c2tnb191v3 # type: int NID_c2pnb208w1 = m2.NID_X9_62_c2pnb208w1 # type: int NID_c2tnb239v1 = m2.NID_X9_62_c2tnb239v1 # type: int NID_c2tnb239v2 = m2.NID_X9_62_c2tnb239v2 # type: int NID_c2tnb239v3 = m2.NID_X9_62_c2tnb239v3 # type: int NID_c2pnb272w1 = m2.NID_X9_62_c2pnb272w1 # type: int NID_c2pnb304w1 = m2.NID_X9_62_c2pnb304w1 # type: int NID_c2tnb359v1 = m2.NID_X9_62_c2tnb359v1 # type: int NID_c2pnb368w1 = m2.NID_X9_62_c2pnb368w1 # type: int NID_c2tnb431r1 = m2.NID_X9_62_c2tnb431r1 # type: int # To preserve compatibility with older names NID_X9_62_prime192v1 = NID_prime192v1 # type: int NID_X9_62_prime192v2 = NID_prime192v2 # type: int NID_X9_62_prime192v3 = NID_prime192v3 # type: int NID_X9_62_prime239v1 = NID_prime239v1 # type: int NID_X9_62_prime239v2 = NID_prime239v2 # type: int NID_X9_62_prime239v3 = NID_prime239v3 # type: int NID_X9_62_prime256v1 = NID_prime256v1 # type: int NID_X9_62_c2pnb163v1 = NID_c2pnb163v1 # type: int NID_X9_62_c2pnb163v2 = NID_c2pnb163v2 # type: int NID_X9_62_c2pnb163v3 = NID_c2pnb163v3 # type: int NID_X9_62_c2pnb176v1 = NID_c2pnb176v1 # type: int NID_X9_62_c2tnb191v1 = NID_c2tnb191v1 # type: int NID_X9_62_c2tnb191v2 = NID_c2tnb191v2 # type: int NID_X9_62_c2tnb191v3 = NID_c2tnb191v3 # type: int NID_X9_62_c2pnb208w1 = NID_c2pnb208w1 # type: int NID_X9_62_c2tnb239v1 = NID_c2tnb239v1 # type: int NID_X9_62_c2tnb239v2 = NID_c2tnb239v2 # type: int NID_X9_62_c2tnb239v3 = NID_c2tnb239v3 # type: int NID_X9_62_c2pnb272w1 = NID_c2pnb272w1 # type: int NID_X9_62_c2pnb304w1 = NID_c2pnb304w1 # type: int NID_X9_62_c2tnb359v1 = NID_c2tnb359v1 # type: int NID_X9_62_c2pnb368w1 = NID_c2pnb368w1 # type: int NID_X9_62_c2tnb431r1 = NID_c2tnb431r1 # type: int NID_wap_wsg_idm_ecid_wtls1 = m2.NID_wap_wsg_idm_ecid_wtls1 # type: int NID_wap_wsg_idm_ecid_wtls3 = m2.NID_wap_wsg_idm_ecid_wtls3 # type: int NID_wap_wsg_idm_ecid_wtls4 = m2.NID_wap_wsg_idm_ecid_wtls4 # type: int NID_wap_wsg_idm_ecid_wtls5 = m2.NID_wap_wsg_idm_ecid_wtls5 # type: int NID_wap_wsg_idm_ecid_wtls6 = m2.NID_wap_wsg_idm_ecid_wtls6 # type: int NID_wap_wsg_idm_ecid_wtls7 = m2.NID_wap_wsg_idm_ecid_wtls7 # type: int NID_wap_wsg_idm_ecid_wtls8 = m2.NID_wap_wsg_idm_ecid_wtls8 # type: int NID_wap_wsg_idm_ecid_wtls9 = m2.NID_wap_wsg_idm_ecid_wtls9 # type: int NID_wap_wsg_idm_ecid_wtls10 = m2.NID_wap_wsg_idm_ecid_wtls10 # type: int NID_wap_wsg_idm_ecid_wtls11 = m2.NID_wap_wsg_idm_ecid_wtls11 # type: int NID_wap_wsg_idm_ecid_wtls12 = m2.NID_wap_wsg_idm_ecid_wtls12 # type: int # The following two curves, according to OpenSSL, have a # "Questionable extension field!" and are not supported by # the OpenSSL inverse function. ECError: no inverse. # As such they cannot be used for signing. They might, # however, be usable for encryption but that has not # been tested. Until thir usefulness can be established, # they are not supported at this time. # NID_ipsec3 = m2.NID_ipsec3 # NID_ipsec4 = m2.NID_ipsec4 class EC: """ Object interface to a EC key pair. """ m2_ec_key_free = m2.ec_key_free def __init__(self, ec, _pyfree=0): # type: (EC, int) -> None assert m2.ec_key_type_check(ec), "'ec' type error" self.ec = ec self._pyfree = _pyfree def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_ec_key_free(self.ec) def __len__(self): # type: () -> int assert m2.ec_key_type_check(self.ec), "'ec' type error" return m2.ec_key_keylen(self.ec) def gen_key(self): # type: () -> int """ Generates the key pair from its parameters. Use:: keypair = EC.gen_params(curve) keypair.gen_key() to create an EC key pair. """ assert m2.ec_key_type_check(self.ec), "'ec' type error" m2.ec_key_gen_key(self.ec) def pub(self): # type: () -> EC_pub # Don't let python free return EC_pub(self.ec, 0) def sign_dsa(self, digest): # type: (bytes) -> Tuple[bytes, bytes] """ Sign the given digest using ECDSA. Returns a tuple (r,s), the two ECDSA signature parameters. """ assert self._check_key_type(), "'ec' type error" return m2.ecdsa_sign(self.ec, digest) def verify_dsa(self, digest, r, s): # type: (bytes, bytes, bytes) -> int """ Verify the given digest using ECDSA. r and s are the ECDSA signature parameters. """ assert self._check_key_type(), "'ec' type error" return m2.ecdsa_verify(self.ec, digest, r, s) def sign_dsa_asn1(self, digest): # type: (bytes) -> bytes assert self._check_key_type(), "'ec' type error" return m2.ecdsa_sign_asn1(self.ec, digest) def verify_dsa_asn1(self, digest, blob): assert self._check_key_type(), "'ec' type error" return m2.ecdsa_verify_asn1(self.ec, digest, blob) def compute_dh_key(self, pub_key): # type: (EC) -> Optional[bytes] """ Compute the ECDH shared key of this key pair and the given public key object. They must both use the same curve. Returns the shared key in binary as a buffer object. No Key Derivation Function is applied. """ assert self.check_key(), 'key is not initialised' return m2.ecdh_compute_key(self.ec, pub_key.ec) def save_key_bio(self, bio, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (BIO.BIO, Optional[str], Callable) -> int """ Save the key pair to an M2Crypto.BIO.BIO object in PEM format. :param bio: M2Crypto.BIO.BIO object to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ if cipher is None: return m2.ec_key_write_bio_no_cipher(self.ec, bio._ptr(), callback) else: ciph = getattr(m2, cipher, None) if ciph is None: raise ValueError('not such cipher %s' % cipher) return m2.ec_key_write_bio(self.ec, bio._ptr(), ciph(), callback) def save_key(self, file, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (AnyStr, Optional[str], Callable) -> int """ Save the key pair to a file in PEM format. :param file: Name of filename to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ with BIO.openfile(file, 'wb') as bio: return self.save_key_bio(bio, cipher, callback) def save_pub_key_bio(self, bio): # type: (BIO.BIO) -> int """ Save the public key to an M2Crypto.BIO.BIO object in PEM format. :param bio: M2Crypto.BIO.BIO object to save key to. """ return m2.ec_key_write_pubkey(self.ec, bio._ptr()) def save_pub_key(self, file): # type: (AnyStr) -> int """ Save the public key to a filename in PEM format. :param file: Name of filename to save key to. """ with BIO.openfile(file, 'wb') as bio: return m2.ec_key_write_pubkey(self.ec, bio._ptr()) def as_pem(self, cipher='aes_128_cbc', callback=util.passphrase_callback): """ Returns the key(pair) as a string in PEM format. If no password is passed and the cipher is set it exits with error """ with BIO.MemoryBuffer() as bio: self.save_key_bio(bio, cipher, callback) return bio.read() def _check_key_type(self): # type: () -> int return m2.ec_key_type_check(self.ec) def check_key(self): # type: () -> int assert m2.ec_key_type_check(self.ec), "'ec' type error" return m2.ec_key_check_key(self.ec) class EC_pub(EC): # noqa """ Object interface to an EC public key. ((don't like this implementation inheritance)) """ def __init__(self, ec, _pyfree=0): # type: (EC, int) -> None EC.__init__(self, ec, _pyfree) self.der = None # type: Optional[bytes] def get_der(self): # type: () -> bytes """ Returns the public key in DER format as a buffer object. """ assert self.check_key(), 'key is not initialised' if self.der is None: self.der = m2.ec_key_get_public_der(self.ec) return self.der def get_key(self): # type: () -> bytes """ Returns the public key as a byte string. """ assert self.check_key(), 'key is not initialised' return m2.ec_key_get_public_key(self.ec) save_key = EC.save_pub_key save_key_bio = EC.save_pub_key_bio def gen_params(curve): # type: (int) -> EC """ Factory function that generates EC parameters and instantiates a EC object from the output. :param curve: This is the OpenSSL nid of the curve to use. """ assert curve in [x['NID'] for x in m2.ec_get_builtin_curves()], \ 'Elliptic curve %s is not available on this system.' % \ m2.obj_nid2sn(curve) return EC(m2.ec_key_new_by_curve_name(curve), 1) def load_key(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> EC """ Factory function that instantiates a EC object. :param file: Names the filename that contains the PEM representation of the EC key pair. :param callback: Python callback object that will be invoked if the EC key pair is passphrase-protected. """ with BIO.openfile(file) as bio: return load_key_bio(bio, callback) def load_key_string(string, callback=util.passphrase_callback): # type: (str, Callable) -> EC """ Load an EC key pair from a string. :param string: String containing EC key pair in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to unlock the key. The default is util.passphrase_callback. :return: M2Crypto.EC.EC object. """ with BIO.MemoryBuffer(string) as bio: return load_key_bio(bio, callback) def load_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> EC """ Factory function that instantiates a EC object. :param bio: M2Crypto.BIO object that contains the PEM representation of the EC key pair. :param callback: Python callback object that will be invoked if the EC key pair is passphrase-protected. """ return EC(m2.ec_key_read_bio(bio._ptr(), callback), 1) def load_pub_key(file): # type: (AnyStr) -> EC_pub """ Load an EC public key from filename. :param file: Name of filename containing EC public key in PEM format. :return: M2Crypto.EC.EC_pub object. """ with BIO.openfile(file) as bio: return load_pub_key_bio(bio) def load_key_string_pubkey(string, callback=util.passphrase_callback): # type: (str, Callable) -> PKey """ Load an M2Crypto.EC.PKey from a public key as a string. :param string: String containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EC.PKey object. """ with BIO.MemoryBuffer(string) as bio: return EVP.load_key_bio_pubkey(bio, callback) def load_pub_key_bio(bio): # type: (BIO.BIO) -> EC_pub """ Load an EC public key from an M2Crypto.BIO.BIO object. :param bio: M2Crypto.BIO.BIO object containing EC public key in PEM format. :return: M2Crypto.EC.EC_pub object. """ ec = m2.ec_key_read_pubkey(bio._ptr()) if ec is None: ec_error() return EC_pub(ec, 1) def ec_error(): # type: () -> ECError raise ECError(Err.get_error_message()) def pub_key_from_der(der): # type: (bytes) -> EC_pub """ Create EC_pub from DER. """ return EC_pub(m2.ec_key_from_pubkey_der(der), 1) def pub_key_from_params(curve, bytes): # type: (bytes, bytes) -> EC_pub """ Create EC_pub from curve name and octet string. """ return EC_pub(m2.ec_key_from_pubkey_params(curve, bytes), 1) def get_builtin_curves(): # type: () -> Tuple[Dict[str, Union[int, str]]] return m2.ec_get_builtin_curves() r}r(Xpub_key_from_paramsrXdefrMMXEC.compute_dh_keyXdefrKK҇XEC_pub.__init__XdefrM-M1Xload_keyrXdefrMWMdXec_errorrXdefrMMXEC_pub.get_derXdefrM2M;Xload_pub_key_biorXdefrMMX EC.__len__XdefrKKX gen_paramsrXdefrMIMUX EC.check_keyXdefrM!M%X EC.__del__XdefrKKXEC.sign_dsa_asn1XdefrKKÇXECErrorrXclassrKKXget_builtin_curvesrXdefrMMXEC.verify_dsa_asn1XdefrKKLJXEC._check_key_typeXdefrMM X load_key_biorXdefrMwMXload_key_string_pubkeyrXdefrMMX load_pub_keyrXdefrMMXEC_pubrXclassrM'MGXEC_pub.get_keyXdefrM<MCX EC.gen_keyXdefrKKXEC.save_pub_key_bioXdefrMMXECrXclassrKM%XEC.pubXdefrKKX EC.as_pemXdefrMMXload_key_stringrXdefrMfMuXpub_key_from_derrXdefrMMX EC.verify_dsaXdefrKKX EC.save_keyXdefrKKXEC.save_key_bioXdefrKKX EC.sign_dsaXdefrKKX EC.__init__XdefrKKXEC.save_pub_keyXdefrM Mu}r(Xpub_key_from_paramsh?XEC.compute_dh_keyh?Xload_keyh?Xload_pub_key_bioh?Xec_errorh?XEC_pub.get_derh?XEC.pubh?X gen_paramsh?X EC.check_keyh?XEC.sign_dsa_asn1h?XECErrorrh?XEC.verify_dsa_asn1h?Xload_key_stringh?Xload_key_string_pubkeyh?X load_pub_keyh?XEC_pubh?XEC_pub.get_keyh?X EC.gen_keyh?XEC.save_pub_key_bioh?XECh?Xget_builtin_curvesh?X EC.as_pemh?X load_key_bioh?Xpub_key_from_derh?X EC.verify_dsah?X EC.save_keyh?XEC.save_key_bioh?X EC.sign_dsah?XEC.save_pub_keyh?ujX M2Crypto.ECrr}rbtUM2Crypto.SSL.Checkerr(X"+""" SSL peer certificate checking routines Copyright (c) 2004-2007 Open Source Applications Foundation. All rights reserved. Copyright 2008 Heikki Toivonen. All rights reserved. """ __all__ = ['SSLVerificationError', 'NoCertificate', 'WrongCertificate', 'WrongHost', 'Checker'] import re import socket from M2Crypto import X509, m2, util # noqa if util.py27plus: from typing import AnyStr, Optional # noqa class SSLVerificationError(Exception): pass class NoCertificate(SSLVerificationError): pass class WrongCertificate(SSLVerificationError): pass class WrongHost(SSLVerificationError): def __init__(self, expectedHost, actualHost, fieldName='commonName'): # type: (str, AnyStr, str) -> None """ This exception will be raised if the certificate returned by the peer was issued for a different host than we tried to connect to. This could be due to a server misconfiguration or an active attack. :param expectedHost: The name of the host we expected to find in the certificate. :param actualHost: The name of the host we actually found in the certificate. :param fieldName: The field name where we noticed the error. This should be either 'commonName' or 'subjectAltName'. """ if fieldName not in ('commonName', 'subjectAltName'): raise ValueError( 'Unknown fieldName, should be either commonName ' + 'or subjectAltName') SSLVerificationError.__init__(self) self.expectedHost = expectedHost self.actualHost = actualHost self.fieldName = fieldName def __str__(self): # type: () -> str s = 'Peer certificate %s does not match host, expected %s, got %s' \ % (self.fieldName, self.expectedHost, self.actualHost) return util.py3str(s) class Checker: numericIpMatch = re.compile('^[0-9]+(\.[0-9]+)*$') def __init__(self, host=None, peerCertHash=None, peerCertDigest='sha1'): # type: (Optional[str], Optional[bytes], str) -> None self.host = host if peerCertHash is not None: peerCertHash = util.py3bytes(peerCertHash) self.fingerprint = peerCertHash self.digest = peerCertDigest # type: str def __call__(self, peerCert, host=None): # type: (X509.X509, Optional[str]) -> bool if peerCert is None: raise NoCertificate('peer did not return certificate') if host is not None: self.host = host # type: str if self.fingerprint: if self.digest not in ('sha1', 'md5'): raise ValueError('unsupported digest "%s"' % self.digest) if self.digest == 'sha1': expected_len = 40 elif self.digest == 'md5': expected_len = 32 else: raise ValueError('Unexpected digest {0}'.format(self.digest)) if len(self.fingerprint) != expected_len: raise WrongCertificate( ('peer certificate fingerprint length does not match\n' + 'fingerprint: {0}\nexpected = {1}\n' + 'observed = {2}').format(self.fingerprint, expected_len, len(self.fingerprint))) expected_fingerprint = util.py3str(self.fingerprint) observed_fingerprint = peerCert.get_fingerprint(md=self.digest) if observed_fingerprint != expected_fingerprint: raise WrongCertificate( ('peer certificate fingerprint does not match\n' + 'expected = {0},\n' + 'observed = {1}').format(expected_fingerprint, observed_fingerprint)) if self.host: hostValidationPassed = False self.useSubjectAltNameOnly = False # subjectAltName=DNS:somehost[, ...]* try: subjectAltName = peerCert.get_ext('subjectAltName').get_value() if self._splitSubjectAltName(self.host, subjectAltName): hostValidationPassed = True elif self.useSubjectAltNameOnly: raise WrongHost(expectedHost=self.host, actualHost=subjectAltName, fieldName='subjectAltName') except LookupError: pass # commonName=somehost[, ...]* if not hostValidationPassed: hasCommonName = False commonNames = '' for entry in peerCert.get_subject().get_entries_by_nid( m2.NID_commonName): hasCommonName = True commonName = entry.get_data().as_text() if not commonNames: commonNames = commonName else: commonNames += ',' + commonName if self._match(self.host, commonName): hostValidationPassed = True break if not hasCommonName: raise WrongCertificate('no commonName in peer certificate') if not hostValidationPassed: raise WrongHost(expectedHost=self.host, actualHost=commonNames, fieldName='commonName') return True def _splitSubjectAltName(self, host, subjectAltName): # type: (AnyStr, AnyStr) -> bool """ >>> check = Checker() >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:my.example.com') True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:*.example.com') True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:m*.example.com') True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:m*ample.com') False >>> check.useSubjectAltNameOnly True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:m*ample.com, othername:') False >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:m*ample.com, DNS:my.example.org') False >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:m*ample.com, DNS:my.example.com') True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='DNS:my.example.com, DNS:my.example.org') True >>> check.useSubjectAltNameOnly True >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='') False >>> check._splitSubjectAltName(host='my.example.com', ... subjectAltName='othername:') False >>> check.useSubjectAltNameOnly False """ self.useSubjectAltNameOnly = False for certHost in subjectAltName.split(','): certHost = certHost.lower().strip() if certHost[:4] == 'dns:': self.useSubjectAltNameOnly = True if self._match(host, certHost[4:]): return True elif certHost[:11] == 'ip address:': self.useSubjectAltNameOnly = True if self._matchIPAddress(host, certHost[11:]): return True return False def _match(self, host, certHost): # type: (str, str) -> bool """ >>> check = Checker() >>> check._match(host='my.example.com', certHost='my.example.com') True >>> check._match(host='my.example.com', certHost='*.example.com') True >>> check._match(host='my.example.com', certHost='m*.example.com') True >>> check._match(host='my.example.com', certHost='m*.EXAMPLE.com') True >>> check._match(host='my.example.com', certHost='m*ample.com') False >>> check._match(host='my.example.com', certHost='*.*.com') False >>> check._match(host='1.2.3.4', certHost='1.2.3.4') True >>> check._match(host='1.2.3.4', certHost='*.2.3.4') False >>> check._match(host='1234', certHost='1234') True """ # XXX See RFC 2818 and 3280 for matching rules, this is may not # XXX yet be complete. host = host.lower() certHost = certHost.lower() if host == certHost: return True if certHost.count('*') > 1: # Not sure about this, but being conservative return False if self.numericIpMatch.match(host) or \ self.numericIpMatch.match(certHost.replace('*', '')): # Not sure if * allowed in numeric IP, but think not. return False if certHost.find('\\') > -1: # Not sure about this, maybe some encoding might have these. # But being conservative for now, because regex below relies # on this. return False # Massage certHost so that it can be used in regex certHost = certHost.replace('.', '\.') certHost = certHost.replace('*', '[^\.]*') if re.compile('^%s$' % certHost).match(host): return True return False def _matchIPAddress(self, host, certHost): # type: (AnyStr, AnyStr) -> bool """ >>> check = Checker() >>> check._matchIPAddress(host='my.example.com', ... certHost='my.example.com') False >>> check._matchIPAddress(host='1.2.3.4', certHost='1.2.3.4') True >>> check._matchIPAddress(host='1.2.3.4', certHost='*.2.3.4') False >>> check._matchIPAddress(host='1.2.3.4', certHost='1.2.3.40') False >>> check._matchIPAddress(host='::1', certHost='::1') True >>> check._matchIPAddress(host='::1', certHost='0:0:0:0:0:0:0:1') True >>> check._matchIPAddress(host='::1', certHost='::2') False """ try: canonical = socket.getaddrinfo(host, 0, 0, socket.SOCK_STREAM, 0, socket.AI_NUMERICHOST) certCanonical = socket.getaddrinfo(certHost, 0, 0, socket.SOCK_STREAM, 0, socket.AI_NUMERICHOST) except: return False return canonical == certCanonical if __name__ == '__main__': import doctest doctest.testmod() r}r(XWrongCertificaterXclassrKKXChecker.__call__XdefrKMKXChecker._matchIPAddressXdefrMM%X NoCertificaterXclassrKKXChecker._matchXdefrKMXChecker._splitSubjectAltNameXdefrKKЇXCheckerrXclassrKAM%XWrongHost.__str__XdefrK:K?XSSLVerificationErrorrXclassrKKX WrongHostrXclassrK!K?XWrongHost.__init__XdefrK"K9XChecker.__init__XdefrKEKLu}r(XWrongCertificaterhUXCheckerrhUXSSLVerificationErrorrhUX WrongHostrhUX NoCertificaterhUujXM2Crypto.SSL.Checkerrr}rbtUM2Crypto.SSL.Connectionr(XKZfrom __future__ import absolute_import """SSL Connection aka socket Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004-2007 OSAF. All Rights Reserved. Copyright 2008 Heikki Toivonen. All rights reserved. """ import logging import socket from M2Crypto import BIO, Err, X509, m2, six, util # noqa from M2Crypto.SSL import Checker, Context, timeout # noqa from M2Crypto.SSL import SSLError from M2Crypto.SSL.Cipher import Cipher, Cipher_Stack from M2Crypto.SSL.Session import Session if util.py27plus: from typing import Any, AnyStr, Callable, Dict, List, Optional, Tuple, Union # noqa __all__ = ['Connection', 'timeout', # XXX Not really, but for documentation purposes ] log = logging.getLogger(__name__) def _serverPostConnectionCheck(*args, **kw): # type: (*Any, **Any) -> int return 1 class Connection: """An SSL connection.""" clientPostConnectionCheck = Checker.Checker() serverPostConnectionCheck = _serverPostConnectionCheck m2_bio_free = m2.bio_free m2_ssl_free = m2.ssl_free def __init__(self, ctx, sock=None, family=socket.AF_INET): # type: (Context, socket.socket, int) -> None """ :param ctx: SSL.Context :param sock: socket to be used :param family: socket family """ self.ctx = ctx self.ssl = m2.ssl_new(self.ctx.ctx) # type: bytes if sock is not None: self.socket = sock else: self.socket = socket.socket(family, socket.SOCK_STREAM) self.socket.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) self._fileno = self.socket.fileno() self._timeout = self.socket.gettimeout() if self._timeout is None: self._timeout = -1.0 self.ssl_close_flag = m2.bio_noclose if self.ctx.post_connection_check is not None: self.set_post_connection_check_callback( self.ctx.post_connection_check) def __del__(self): # type: () -> None if getattr(self, 'sslbio', None): self.m2_bio_free(self.sslbio) if getattr(self, 'sockbio', None): self.m2_bio_free(self.sockbio) # in __del__ method we have to check whether m2.bio_noclose # exists at all. if m2 is not None and m2.bio_noclose and \ self.ssl_close_flag == m2.bio_noclose and \ getattr(self, 'ssl', None): self.m2_ssl_free(self.ssl) self.socket.close() def close(self): # type: () -> None m2.ssl_shutdown(self.ssl) def clear(self): # type: () -> int """ If there were errors in this connection, call clear() rather than close() to end it, so that bad sessions will be cleared from cache. """ return m2.ssl_clear(self.ssl) def set_shutdown(self, mode): # type: (int) -> None """Sets the shutdown state of the Connection to mode. The shutdown state of an ssl connection is a bitmask of (use m2.SSL_* constants): 0 No shutdown setting, yet. SSL_SENT_SHUTDOWN A "close notify" shutdown alert was sent to the peer, the connection is being considered closed and the session is closed and correct. SSL_RECEIVED_SHUTDOWN A shutdown alert was received form the peer, either a normal "close notify" or a fatal error. SSL_SENT_SHUTDOWN and SSL_RECEIVED_SHUTDOWN can be set at the same time. :param mode: set the mode bitmask. """ m2.ssl_set_shutdown1(self.ssl, mode) def get_shutdown(self): # type: () -> None """Get the current shutdown mode of the Connection.""" return m2.ssl_get_shutdown(self.ssl) def bind(self, addr): # type: (util.AddrType) -> None self.socket.bind(addr) def listen(self, qlen=5): # type: (int) -> None self.socket.listen(qlen) def ssl_get_error(self, ret): # type: (int) -> int return m2.ssl_get_error(self.ssl, ret) def set_bio(self, readbio, writebio): # type: (BIO.BIO, BIO.BIO) -> None """Explicitly set read and write bios Connects the BIOs for the read and write operations of the TLS/SSL (encrypted) side of ssl. The SSL engine inherits the behaviour of both BIO objects, respectively. If a BIO is non-blocking, the Connection will also have non-blocking behaviour. If there was already a BIO connected to Connection, BIO_free() will be called (for both the reading and writing side, if different). :param readbio: BIO for reading :param writebio: BIO for writing. """ m2.ssl_set_bio(self.ssl, readbio._ptr(), writebio._ptr()) def set_client_CA_list_from_file(self, cafile): # type: (AnyStr) -> None """Set the acceptable client CA list. If the client returns a certificate, it must have been issued by one of the CAs listed in cafile. Makes sense only for servers. :param cafile: Filename from which to load the CA list. :return: 0 A failure while manipulating the STACK_OF(X509_NAME) object occurred or the X509_NAME could not be extracted from cacert. Check the error stack to find out the reason. 1 The operation succeeded. """ m2.ssl_set_client_CA_list_from_file(self.ssl, cafile) def set_client_CA_list_from_context(self): # type: () -> None """ Set the acceptable client CA list. If the client returns a certificate, it must have been issued by one of the CAs listed in context. Makes sense only for servers. """ m2.ssl_set_client_CA_list_from_context(self.ssl, self.ctx.ctx) def setup_addr(self, addr): # type: (util.AddrType) -> None self.addr = addr def set_ssl_close_flag(self, flag): # type: (int) -> None """ By default, SSL struct will be freed in __del__. Call with m2.bio_close to override this default. :param flag: either m2.bio_close or m2.bio_noclose """ if flag not in (m2.bio_close, m2.bio_noclose): raise ValueError("flag must be m2.bio_close or m2.bio_noclose") self.ssl_close_flag = flag def setup_ssl(self): # type: () -> None # Make a BIO_s_socket. self.sockbio = m2.bio_new_socket(self.socket.fileno(), 0) # Link SSL struct with the BIO_socket. m2.ssl_set_bio(self.ssl, self.sockbio, self.sockbio) # Make a BIO_f_ssl. self.sslbio = m2.bio_new(m2.bio_f_ssl()) # Link BIO_f_ssl with the SSL struct. m2.bio_set_ssl(self.sslbio, self.ssl, m2.bio_noclose) def _setup_ssl(self, addr): # type: (util.AddrType) -> None """Deprecated""" self.setup_addr(addr) self.setup_ssl() def set_accept_state(self): # type: () -> None """Sets Connection to work in the server mode.""" m2.ssl_set_accept_state(self.ssl) def accept_ssl(self): # type: () -> Optional[int] """Waits for a TLS/SSL client to initiate the TLS/SSL handshake. The communication channel must already have been set and assigned to the ssl by setting an underlying BIO. :return: 0 The TLS/SSL handshake was not successful but was shut down controlled and by the specifications of the TLS/SSL protocol. Call get_error() with the return value ret to find out the reason. 1 The TLS/SSL handshake was successfully completed, a TLS/SSL connection has been established. <0 The TLS/SSL handshake was not successful because a fatal error occurred either at the protocol level or a connection failure occurred. The shutdown was not clean. It can also occur of action is need to continue the operation for non-blocking BIOs. Call get_error() with the return value ret to find out the reason. """ return m2.ssl_accept(self.ssl, self._timeout) def accept(self): # type: () -> Tuple[Connection, util.AddrType] """Accept an SSL connection. The return value is a pair (ssl, addr) where ssl is a new SSL connection object and addr is the address bound to the other end of the SSL connection. :return: tuple of Connection and addr. Address can take very various forms (see socket documentation), for IPv4 it is tuple(str, int), for IPv6 a tuple of four (host, port, flowinfo, scopeid), where the last two are optional ints. """ sock, addr = self.socket.accept() ssl = Connection(self.ctx, sock) ssl.addr = addr ssl.setup_ssl() ssl.set_accept_state() ssl.accept_ssl() check = getattr(self, 'postConnectionCheck', self.serverPostConnectionCheck) if check is not None: if not check(ssl.get_peer_cert(), ssl.addr[0]): raise Checker.SSLVerificationError( 'post connection check failed') return ssl, addr def set_connect_state(self): # type: () -> None """Sets Connection to work in the client mode.""" m2.ssl_set_connect_state(self.ssl) def connect_ssl(self): # type: () -> Optional[int] return m2.ssl_connect(self.ssl, self._timeout) def connect(self, addr): # type: (util.AddrType) -> int """Overloading socket.connect() :param addr: addresses have various depending on their type :return:status of ssl_connect() """ self.socket.connect(addr) self.addr = addr self.setup_ssl() self.set_connect_state() ret = self.connect_ssl() check = getattr(self, 'postConnectionCheck', self.clientPostConnectionCheck) if check is not None: if not check(self.get_peer_cert(), self.addr[0]): raise Checker.SSLVerificationError( 'post connection check failed') return ret def shutdown(self, how): # type: (int) -> None m2.ssl_set_shutdown(self.ssl, how) def renegotiate(self): # type: () -> int """Renegotiate this connection's SSL parameters.""" return m2.ssl_renegotiate(self.ssl) def pending(self): # type: () -> int """Return the numbers of octets that can be read from the connection.""" return m2.ssl_pending(self.ssl) def _write_bio(self, data): # type: (bytes) -> int return m2.ssl_write(self.ssl, data, self._timeout) def _write_nbio(self, data): # type: (bytes) -> int return m2.ssl_write_nbio(self.ssl, data) def _read_bio(self, size=1024): # type: (int) -> bytes if size <= 0: raise ValueError('size <= 0') return m2.ssl_read(self.ssl, size, self._timeout) def _read_nbio(self, size=1024): # type: (int) -> bytes if size <= 0: raise ValueError('size <= 0') return m2.ssl_read_nbio(self.ssl, size) def write(self, data): # type: (bytes) -> int if self._timeout != 0.0: return self._write_bio(data) return self._write_nbio(data) sendall = send = write def _decref_socketios(self): pass def recv_into(self, buff, nbytes=0): # type: (bytearray, int) -> int """ A version of recv() that stores its data into a buffer rather than creating a new string. Receive up to buffersize bytes from the socket. If buffersize is not specified (or 0), receive up to the size available in the given buffer. @param buffer: a buffer for the received bytes @param nbytes: maximum number of bytes to read @return: number of bytes added See recv() for documentation about the flags. """ n = len(buff) if nbytes == 0 else nbytes if n <= 0: raise ValueError('size <= 0') buff_bytes = m2.ssl_read(self.ssl, n, self._timeout) buff[:] = b'' buff.extend(buff_bytes) return len(buff) def read(self, size=1024): # type: (int) -> bytes if self._timeout != 0.0: return self._read_bio(size) return self._read_nbio(size) recv = read def setblocking(self, mode): # type: (int) -> None """Set this connection's underlying socket to _mode_. Set blocking or non-blocking mode of the socket: if flag is 0, the socket is set to non-blocking, else to blocking mode. Initially all sockets are in blocking mode. In non-blocking mode, if a recv() call doesn't find any data, or if a send() call can't immediately dispose of the data, a error exception is raised; in blocking mode, the calls block until they can proceed. s.setblocking(0) is equivalent to s.settimeout(0.0); s.setblocking(1) is equivalent to s.settimeout(None). :param mode: new mode to be set """ self.socket.setblocking(mode) if mode: self._timeout = -1.0 else: self._timeout = 0.0 def settimeout(self, timeout): # type: (float) -> None """Set this connection's underlying socket's timeout to _timeout_.""" self.socket.settimeout(timeout) self._timeout = timeout if self._timeout is None: self._timeout = -1.0 def fileno(self): # type: () -> int return self.socket.fileno() def getsockopt(self, level, optname, buflen=None): # type: (int, int, Optional[int]) -> Union[int, bytes] """Get the value of the given socket option. :param level: level at which the option resides. To manipulate options at the sockets API level, level is specified as socket.SOL_SOCKET. To manipulate options at any other level the protocol number of the appropriate protocol controlling the option is supplied. For example, to indicate that an option is to be interpreted by the TCP protocol, level should be set to the protocol number of socket.SOL_TCP; see getprotoent(3). :param optname: The value of the given socket option is described in the Unix man page getsockopt(2)). The needed symbolic constants (SO_* etc.) are defined in the socket module. :param buflen: If it is absent, an integer option is assumed and its integer value is returned by the function. If buflen is present, it specifies the maximum length of the buffer used to receive the option in, and this buffer is returned as a bytes object. :return: Either integer or bytes value of the option. It is up to the caller to decode the contents of the buffer (see the optional built-in module struct for a way to decode C structures encoded as byte strings). """ return self.socket.getsockopt(level, optname, buflen) def setsockopt(self, level, optname, value=None): # type: (int, int, Union[int, bytes, None]) -> Optional[bytes] """Set the value of the given socket option. :param level: same as with getsockopt() above :param optname: same as with getsockopt() above :param value: an integer or a string representing a buffer. In the latter case it is up to the caller to ensure that the string contains the proper bits (see the optional built-in module struct for a way to encode C structures as strings). :return: None for success or the error handler for failure. """ return self.socket.setsockopt(level, optname, value) def get_context(self): # type: () -> Context """Return the Context object associated with this connection.""" return m2.ssl_get_ssl_ctx(self.ssl) def get_state(self): # type: () -> bytes """Return the SSL state of this connection. During its use, an SSL objects passes several states. The state is internally maintained. Querying the state information is not very informative before or when a connection has been established. It however can be of significant interest during the handshake. :return: 6 letter string indicating the current state of the SSL object ssl. """ return m2.ssl_get_state(self.ssl) def verify_ok(self): # type: () -> bool return (m2.ssl_get_verify_result(self.ssl) == m2.X509_V_OK) def get_verify_mode(self): # type: () -> int """Return the peer certificate verification mode.""" return m2.ssl_get_verify_mode(self.ssl) def get_verify_depth(self): # type: () -> int """Return the peer certificate verification depth.""" return m2.ssl_get_verify_depth(self.ssl) def get_verify_result(self): # type: () -> int """Return the peer certificate verification result.""" return m2.ssl_get_verify_result(self.ssl) def get_peer_cert(self): # type: () -> X509.X509 """Return the peer certificate. If the peer did not provide a certificate, return None. """ c = m2.ssl_get_peer_cert(self.ssl) if c is None: return None # Need to free the pointer coz OpenSSL doesn't. return X509.X509(c, 1) def get_peer_cert_chain(self): # type: () -> Optional[X509.X509_Stack] """Return the peer certificate chain; if the peer did not provide a certificate chain, return None. :warning: The returned chain will be valid only for as long as the connection object is alive. Once the connection object gets freed, the chain will be freed as well. """ c = m2.ssl_get_peer_cert_chain(self.ssl) if c is None: return None # No need to free the pointer coz OpenSSL does. return X509.X509_Stack(c) def get_cipher(self): # type: () -> Optional[Cipher] """Return an M2Crypto.SSL.Cipher object for this connection; if the connection has not been initialised with a cipher suite, return None. """ c = m2.ssl_get_current_cipher(self.ssl) if c is None: return None return Cipher(c) def get_ciphers(self): # type: () -> Optional[Cipher_Stack] """Return an M2Crypto.SSL.Cipher_Stack object for this connection; if the connection has not been initialised with cipher suites, return None. """ c = m2.ssl_get_ciphers(self.ssl) if c is None: return None return Cipher_Stack(c) def get_cipher_list(self, idx=0): # type: (int) -> str """Return the cipher suites for this connection as a string object.""" return util.py3str(m2.ssl_get_cipher_list(self.ssl, idx)) def set_cipher_list(self, cipher_list): # type: (str) -> int """Set the cipher suites for this connection.""" return m2.ssl_set_cipher_list(self.ssl, cipher_list) def makefile(self, mode='rb', bufsize=-1): # type: (AnyStr, int) -> socket._fileobject if six.PY3: return socket.SocketIO(self, mode) else: return socket._fileobject(self, mode, bufsize) def getsockname(self): # type: () -> util.AddrType """Return the socket's own address. This is useful to find out the port number of an IPv4/v6 socket, for instance. (The format of the address returned depends on the address family -- see above.) :return:socket's address as addr type """ return self.socket.getsockname() def getpeername(self): # type: () -> util.AddrType """Return the remote address to which the socket is connected. This is useful to find out the port number of a remote IPv4/v6 socket, for instance. On some systems this function is not supported. :return: """ return self.socket.getpeername() def set_session_id_ctx(self, id): # type: (bytes) -> int ret = m2.ssl_set_session_id_context(self.ssl, id) if not ret: raise SSLError(Err.get_error_message()) def get_session(self): # type: () -> Session sess = m2.ssl_get_session(self.ssl) return Session(sess) def set_session(self, session): # type: (Session) -> None m2.ssl_set_session(self.ssl, session._ptr()) def get_default_session_timeout(self): # type: () -> int return m2.ssl_get_default_session_timeout(self.ssl) def get_socket_read_timeout(self): # type: () -> timeout return timeout.struct_to_timeout( self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_RCVTIMEO, timeout.struct_size())) def get_socket_write_timeout(self): # type: () -> timeout return timeout.struct_to_timeout( self.socket.getsockopt(socket.SOL_SOCKET, socket.SO_SNDTIMEO, timeout.struct_size())) def set_socket_read_timeout(self, timeo): # type: (timeout) -> None assert isinstance(timeo, timeout.timeout) self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_RCVTIMEO, timeo.pack()) def set_socket_write_timeout(self, timeo): # type: (timeout) -> None assert isinstance(timeo, timeout.timeout) self.socket.setsockopt( socket.SOL_SOCKET, socket.SO_SNDTIMEO, timeo.pack()) def get_version(self): # type: () -> str "Return the TLS/SSL protocol version for this connection." return util.py3str(m2.ssl_get_version(self.ssl)) def set_post_connection_check_callback(self, postConnectionCheck): # noqa # type: (Callable) -> None self.postConnectionCheck = postConnectionCheck def set_tlsext_host_name(self, name): # type: (bytes) -> None """Set the requested hostname for the SNI (Server Name Indication) extension. """ m2.ssl_set_tlsext_host_name(self.ssl, name) r}r(XConnection._write_bioXdefrMGMJXConnection.connectXdefrM$M8XConnection.__init__XdefrK-KGXConnection.get_shutdownXdefrK|KXConnection.readXdefrM}MXConnection.getsocknameXdefrM>MIXConnection.setsockoptXdefrMMXConnection.settimeoutXdefrMMXConnection.ssl_get_errorXdefrKKXConnection.get_ciphersXdefrM"M,XConnection.filenoXdefrMMXConnection.get_stateXdefrMMXConnection._read_bioXdefrMOMTX'Connection.set_client_CA_list_from_fileXdefrKKXConnection.setup_sslXdefrKKڇXConnection.makefileXdefrM7M=XConnection.get_contextXdefrMMXConnection.setup_addrXdefrKKÇXConnection.set_session_id_ctxXdefrMVM[XConnection.set_ssl_close_flagXdefrKKχXConnection.connect_sslXdefrM M#XConnection.acceptXdefrKMXConnection.renegotiateXdefrM=MAX"Connection.get_socket_read_timeoutXdefrMiMnX"Connection.set_socket_read_timeoutXdefrMuMzXConnection.setblockingXdefrMMX-Connection.set_post_connection_check_callbackXdefrMMXConnection.shutdownXdefrM9M<XConnection.pendingXdefrMBMFX#Connection.get_socket_write_timeoutXdefrMoMtXConnection.clearXdefrKZKbX*Connection.set_client_CA_list_from_contextXdefrKKXConnection.recv_intoXdefrMeM|XConnection.accept_sslXdefrKKXConnection.get_verify_depthXdefrMMXConnection.set_accept_stateXdefrKKXConnection._decref_socketiosXdefrMbMdXConnection.get_verify_resultXdefr MMXConnection.get_versionXdefr MMXConnection.bindXdefr KKXConnection.verify_okXdefr MMXConnection.get_sessionXdefr M\M`XConnection.getsockoptXdefrMMXConnection.get_peer_certXdefrMMXConnection.listenXdefrKKXConnection.set_bioXdefrKKXConnection.get_peer_cert_chainXdefrM MX#Connection.set_socket_write_timeoutXdefrM{MX ConnectionrXclassrK$MX&Connection.get_default_session_timeoutXdefrMeMhXConnection.get_verify_modeXdefrMMXConnection.set_connect_stateXdefrMMXConnection.set_shutdownXdefrKcK{XConnection.getpeernameXdefrMJMUXConnection.closeXdefrKVKYXConnection.__del__XdefrKHKUXConnection.get_cipherXdefrMM!XConnection.get_cipher_listXdefrM-M1XConnection.set_cipher_listXdefrM2M6XConnection.set_sessionXdefr MaMdXConnection.set_tlsext_host_nameXdefr!MMX_serverPostConnectionCheckr"Xdefr#KK"XConnection._write_nbioXdefr$MKMNXConnection._setup_sslXdefr%KKXConnection.writeXdefr&M[M`XConnection._read_nbioXdefr'MUMZu}r((XConnection.connectr)hUXConnection.get_shutdownr*hUXConnection.getsocknamer+hUXConnection.set_bior,hUXConnection.setsockoptr-hUXConnection.get_cipherr.hUXConnection.ssl_get_errorr/hUXConnection.set_sessionr0hUXConnection.filenor1hUXConnection.get_contextr2hUX'Connection.set_client_CA_list_from_filer3hUXConnection.setup_sslr4hUXConnection.getpeernamer5hUXConnection.get_stater6hUXConnection.accept_sslr7hUXConnection.setblockingr8hUXConnection.set_session_id_ctxr9hUXConnection.set_ssl_close_flagr:hUXConnection.connect_sslr;hUXConnection.makefiler<hUXConnection.acceptr=hUXConnection.get_sessionr>hUX"Connection.set_socket_read_timeoutr?hUXConnection.get_ciphersr@hUX-Connection.set_post_connection_check_callbackrAhUXConnection.shutdownrBhUXConnection.getsockoptrChUXConnection.pendingrDhUXConnection.clearrEhUX*Connection.set_client_CA_list_from_contextrFhUXConnection.get_verify_depthrGhUXConnection.set_accept_staterHhUXConnection.readrIhUXConnection.get_verify_resultrJhUXConnection.bindrKhUXConnection.get_verify_moderLhUXConnection.get_peer_certrMhUXConnection.get_peer_cert_chainrNhUX"Connection.get_socket_read_timeoutrOhUX#Connection.set_socket_write_timeoutrPhUX ConnectionrQhUX&Connection.get_default_session_timeoutrRhUXConnection.settimeoutrShUX#Connection.get_socket_write_timeoutrThUXConnection.setup_addrrUhUXConnection.set_connect_staterVhUXConnection.set_shutdownrWhUXConnection.get_versionrXhUXConnection.closerYhUXConnection.recv_intorZhUXConnection.listenr[hUXConnection.get_cipher_listr\hUXConnection.set_cipher_listr]hUXConnection.set_tlsext_host_namer^hUXConnection.verify_okr_hUXConnection.renegotiater`hUXConnection.writerahUujXM2Crypto.SSL.Connectionrbrc}rdbtUM2Crypto.SSL.cbre(X from __future__ import absolute_import """SSL callbacks Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" import sys from M2Crypto import m2, util if util.py27plus: from typing import Any, List # noqa __all__ = ['unknown_issuer', 'ssl_verify_callback_stub', 'ssl_verify_callback', 'ssl_verify_callback_allow_unknown_ca', 'ssl_info_callback'] def ssl_verify_callback_stub(ssl_ctx_ptr, x509_ptr, errnum, errdepth, ok): # Deprecated return ok unknown_issuer = [ m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE, m2.X509_V_ERR_CERT_UNTRUSTED, ] def ssl_verify_callback(ssl_ctx_ptr, x509_ptr, errnum, errdepth, ok): # type: (bytes, bytes, int, int, int) -> int # Deprecated from M2Crypto.SSL.Context import Context ssl_ctx = Context.ctxmap()[int(ssl_ctx_ptr)] if errnum in unknown_issuer: if ssl_ctx.get_allow_unknown_ca(): sys.stderr.write("policy: %s: permitted...\n" % (m2.x509_get_verify_error(errnum))) sys.stderr.flush() ok = 1 # CRL checking goes here... if ok: if ssl_ctx.get_verify_depth() >= errdepth: ok = 1 else: ok = 0 return ok def ssl_verify_callback_allow_unknown_ca(ok, store): # type: (int, Any) -> int errnum = store.get_error() if errnum in unknown_issuer: ok = 1 return ok # Cribbed from OpenSSL's apps/s_cb.c. def ssl_info_callback(where, ret, ssl_ptr): # type: (int, int, bytes) -> None w = where & ~m2.SSL_ST_MASK if w & m2.SSL_ST_CONNECT: state = "SSL connect" elif w & m2.SSL_ST_ACCEPT: state = "SSL accept" else: state = "SSL state unknown" if where & m2.SSL_CB_LOOP: sys.stderr.write("LOOP: %s: %s\n" % (state, m2.ssl_get_state_v(ssl_ptr))) sys.stderr.flush() return if where & m2.SSL_CB_EXIT: if not ret: sys.stderr.write("FAILED: %s: %s\n" % (state, m2.ssl_get_state_v(ssl_ptr))) sys.stderr.flush() else: sys.stderr.write("INFO: %s: %s\n" % (state, m2.ssl_get_state_v(ssl_ptr))) sys.stderr.flush() return if where & m2.SSL_CB_ALERT: if where & m2.SSL_CB_READ: w = 'read' else: w = 'write' sys.stderr.write("ALERT: %s: %s: %s\n" % (w, m2.ssl_get_alert_type_v(ret), m2.ssl_get_alert_desc_v(ret))) sys.stderr.flush() return rf}rg(X$ssl_verify_callback_allow_unknown_carhXdefriK2K8Xssl_info_callbackrjXdefrkK;KaXssl_verify_callback_stubrlXdefrmKKXssl_verify_callbackrnXdefroKK0u}rp(X$ssl_verify_callback_allow_unknown_carqhUXssl_info_callbackrrhUXssl_verify_callback_stubrshUXssl_verify_callbackrthUujXM2Crypto.SSL.cbrurv}rwbtUM2Crypto.SSL.ssl_dispatcherrx(Xqfrom __future__ import absolute_import """SSL dispatcher Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" # Python import asyncore import socket # M2Crypto from M2Crypto import util # noqa from M2Crypto.SSL.Connection import Connection from M2Crypto.SSL.Context import Context # noqa __all__ = ['ssl_dispatcher'] class ssl_dispatcher(asyncore.dispatcher): # noqa def create_socket(self, ssl_context): # type: (Context) -> None self.family_and_type = socket.AF_INET, socket.SOCK_STREAM self.ssl_ctx = ssl_context self.socket = Connection(self.ssl_ctx) # self.socket.setblocking(0) self.add_channel() def connect(self, addr): # type: (util.AddrType) -> None self.socket.setblocking(1) self.socket.connect(addr) self.socket.setblocking(0) def recv(self, buffer_size=4096): # type: (int) -> bytes """Receive data over SSL.""" return self.socket.recv(buffer_size) def send(self, buffer): # type: (bytes) -> int """Send data over SSL.""" return self.socket.send(buffer) ry}rz(Xssl_dispatcher.create_socketXdefr{KKXssl_dispatcher.connectXdefr|KK"Xssl_dispatcher.sendXdefr}K(K,Xssl_dispatcherr~XclassrKK,Xssl_dispatcher.recvXdefrK#K'u}r(Xssl_dispatcherrhUXssl_dispatcher.connectrhUXssl_dispatcher.recvrhUXssl_dispatcher.sendrhUXssl_dispatcher.create_socketrhUujXM2Crypto.SSL.ssl_dispatcherrr}rbtUM2Crypto.SSL.timeoutr(X"""Support for SSL socket timeouts. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Copyright 2008 Heikki Toivonen. All rights reserved. """ __all__ = ['DEFAULT_TIMEOUT', 'timeout', 'struct_to_timeout', 'struct_size'] import struct DEFAULT_TIMEOUT = 600 # type: int class timeout: # noqa def __init__(self, sec=DEFAULT_TIMEOUT, microsec=0): # type: (int, int) -> None self.sec = sec self.microsec = microsec def pack(self): return struct.pack('ll', self.sec, self.microsec) def struct_to_timeout(binstr): # type: (bytes) -> timeout (s, ms) = struct.unpack('ll', binstr) return timeout(s, ms) def struct_size(): # type: () -> int return struct.calcsize('ll') r}r(Xstruct_to_timeoutrXdefrKKX timeout.packXdefrKKXtimeout.__init__XdefrKKX struct_sizerXdefrK K#XtimeoutrXclassrKKu}r(Xstruct_to_timeoutrhUX timeout.packrhUX struct_sizerhUXtimeoutrhUujXM2Crypto.SSL.timeoutrr}rbtU#M2Crypto.SSL.TwistedProtocolWrapperr(X8F""" Make Twisted use M2Crypto for SSL Copyright (c) 2004-2007 Open Source Applications Foundation. All rights reserved. FIXME THIS HAS NOT BEEN FINISHED. NEITHER PEP484 NOR PORT PYTHON3 HAS BEEN FINISHED. THE FURTHER WORK WILL BE DONE WHEN THE STATUS OF TWISTED IN THE PYTHON 3 (AND ASYNCIO) WORLD WILL BE CLEAR. """ __all__ = ['connectSSL', 'connectTCP', 'listenSSL', 'listenTCP', 'TLSProtocolWrapper'] import logging from functools import partial import twisted.internet.reactor import twisted.protocols.policies as policies from M2Crypto import BIO, X509, m2, util from M2Crypto.SSL.Checker import Checker, SSLVerificationError from twisted.internet.interfaces import ITLSTransport from twisted.protocols.policies import ProtocolWrapper if util.py27plus: from typing import AnyStr, Callable, Iterable, Optional # noqa from zope.interface import implementer log = logging.getLogger(__name__) def _alwaysSucceedsPostConnectionCheck(peerX509, expectedHost): return 1 def connectSSL(host, port, factory, contextFactory, timeout=30, bindAddress=None, reactor=twisted.internet.reactor, postConnectionCheck=Checker()): # type: (str, int, object, object, int, Optional[str], twisted.internet.reactor, Checker) -> reactor.connectTCP """ A convenience function to start an SSL/TLS connection using Twisted. See IReactorSSL interface in Twisted. """ wrappingFactory = policies.WrappingFactory(factory) wrappingFactory.protocol = lambda factory, wrappedProtocol: \ TLSProtocolWrapper(factory, wrappedProtocol, startPassThrough=0, client=1, contextFactory=contextFactory, postConnectionCheck=postConnectionCheck) return reactor.connectTCP(host, port, wrappingFactory, timeout, bindAddress) def connectTCP(host, port, factory, timeout=30, bindAddress=None, reactor=twisted.internet.reactor, postConnectionCheck=Checker()): # type: (str, int, object, int, Optional[util.AddrType], object, Callable) -> object """ 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. """ wrappingFactory = policies.WrappingFactory(factory) wrappingFactory.protocol = lambda factory, wrappedProtocol: \ TLSProtocolWrapper(factory, wrappedProtocol, startPassThrough=1, client=1, contextFactory=None, postConnectionCheck=postConnectionCheck) return reactor.connectTCP(host, port, wrappingFactory, timeout, bindAddress) def listenSSL(port, factory, contextFactory, backlog=5, interface='', reactor=twisted.internet.reactor, postConnectionCheck=_alwaysSucceedsPostConnectionCheck): """ A convenience function to listen for SSL/TLS connections using Twisted. See IReactorSSL interface in Twisted. """ wrappingFactory = policies.WrappingFactory(factory) wrappingFactory.protocol = lambda factory, wrappedProtocol: \ TLSProtocolWrapper(factory, wrappedProtocol, startPassThrough=0, client=0, contextFactory=contextFactory, postConnectionCheck=postConnectionCheck) return reactor.listenTCP(port, wrappingFactory, backlog, interface) def listenTCP(port, factory, backlog=5, interface='', reactor=twisted.internet.reactor, postConnectionCheck=None): """ 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. """ wrappingFactory = policies.WrappingFactory(factory) wrappingFactory.protocol = lambda factory, wrappedProtocol: \ TLSProtocolWrapper(factory, wrappedProtocol, startPassThrough=1, client=0, contextFactory=None, postConnectionCheck=postConnectionCheck) return reactor.listenTCP(port, wrappingFactory, backlog, interface) class _BioProxy: """ The purpose of this class is to eliminate the __del__ method from TLSProtocolWrapper, and thus letting it be garbage collected. """ m2_bio_free_all = m2.bio_free_all def __init__(self, bio): self.bio = bio def _ptr(self): return self.bio def __del__(self): if self.bio is not None: self.m2_bio_free_all(self.bio) class _SSLProxy: """ The purpose of this class is to eliminate the __del__ method from TLSProtocolWrapper, and thus letting it be garbage collected. """ m2_ssl_free = m2.ssl_free def __init__(self, ssl): self.ssl = ssl def _ptr(self): return self.ssl def __del__(self): if self.ssl is not None: self.m2_ssl_free(self.ssl) @implementer(ITLSTransport) class TLSProtocolWrapper(ProtocolWrapper): """ 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. """ def __init__(self, factory, wrappedProtocol, startPassThrough, client, contextFactory, postConnectionCheck): # type: policies.WrappingFactory, object, int, int, object, Checker """ :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. """ # ProtocolWrapper.__init__(self, factory, wrappedProtocol) # XXX: Twisted 2.0 has a new addition where the wrappingFactory is # set as the factory of the wrappedProtocol. This is an issue # as the wrap should be transparent. What we want is # the factory of the wrappedProtocol to be the wrappedFactory and # not the outer wrappingFactory. This is how it was implemented in # Twisted 1.3 self.factory = factory self.wrappedProtocol = wrappedProtocol # wrappedProtocol == client/server instance # factory.wrappedFactory == client/server factory self.data = b'' # Clear text to encrypt and send self.encrypted = b'' # Encrypted data we need to decrypt and pass on self.tlsStarted = 0 # SSL/TLS mode or pass through self.checked = 0 # Post connection check done or not self.isClient = client self.helloDone = 0 # True when hello has been sent if postConnectionCheck is None: self.postConnectionCheck = _alwaysSucceedsPostConnectionCheck else: self.postConnectionCheck = postConnectionCheck if not startPassThrough: self.startTLS(contextFactory.getContext()) def clear(self): """ Clear this instance, after which it is ready for reuse. """ if getattr(self, 'tlsStarted', 0): self.sslBio = None self.ssl = None self.internalBio = None self.networkBio = None self.data = b'' self.encrypted = b'' self.tlsStarted = 0 self.checked = 0 self.isClient = 1 self.helloDone = 0 # We can reuse self.ctx and it will be deleted automatically # when this instance dies def startTLS(self, ctx): """ Start SSL/TLS. If this is not called, this instance just passes data through untouched. """ # NOTE: This method signature must match the startTLS() method Twisted # expects transports to have. This will be called automatically # by Twisted in STARTTLS situations, for example with SMTP. if self.tlsStarted: raise Exception('TLS already started') self.ctx = ctx self.internalBio = m2.bio_new(m2.bio_s_bio()) m2.bio_set_write_buf_size(self.internalBio, 0) self.networkBio = _BioProxy(m2.bio_new(m2.bio_s_bio())) m2.bio_set_write_buf_size(self.networkBio._ptr(), 0) m2.bio_make_bio_pair(self.internalBio, self.networkBio._ptr()) self.sslBio = _BioProxy(m2.bio_new(m2.bio_f_ssl())) self.ssl = _SSLProxy(m2.ssl_new(self.ctx.ctx)) if self.isClient: m2.ssl_set_connect_state(self.ssl._ptr()) else: m2.ssl_set_accept_state(self.ssl._ptr()) m2.ssl_set_bio(self.ssl._ptr(), self.internalBio, self.internalBio) m2.bio_set_ssl(self.sslBio._ptr(), self.ssl._ptr(), m2.bio_noclose) # Need this for writes that are larger than BIO pair buffers mode = m2.ssl_get_mode(self.ssl._ptr()) m2.ssl_set_mode(self.ssl._ptr(), mode | m2.SSL_MODE_ENABLE_PARTIAL_WRITE | m2.SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER) self.tlsStarted = 1 def write(self, data): # type: (bytes) -> None if not self.tlsStarted: ProtocolWrapper.write(self, data) return try: encryptedData = self._encrypt(data) ProtocolWrapper.write(self, encryptedData) self.helloDone = 1 except BIO.BIOError as e: # See http://www.openssl.org/docs/apps/verify.html#DIAGNOSTICS # for the error codes returned by SSL_get_verify_result. e.args = (m2.ssl_get_verify_result(self.ssl._ptr()), e.args[0]) raise e def writeSequence(self, data): # type: (Iterable[bytes]) -> None if not self.tlsStarted: ProtocolWrapper.writeSequence(self, b''.join(data)) return self.write(b''.join(data)) def loseConnection(self): # XXX Do we need to do m2.ssl_shutdown(self.ssl._ptr())? ProtocolWrapper.loseConnection(self) def connectionMade(self): ProtocolWrapper.connectionMade(self) if self.tlsStarted and self.isClient and not self.helloDone: self._clientHello() def dataReceived(self, data): # type: (bytes) -> None if not self.tlsStarted: ProtocolWrapper.dataReceived(self, data) return self.encrypted += data try: while 1: decryptedData = self._decrypt() self._check() encryptedData = self._encrypt() ProtocolWrapper.write(self, encryptedData) ProtocolWrapper.dataReceived(self, decryptedData) if decryptedData == b'' and encryptedData == b'': break except BIO.BIOError as e: # See http://www.openssl.org/docs/apps/verify.html#DIAGNOSTICS # for the error codes returned by SSL_get_verify_result. e.args = (m2.ssl_get_verify_result(self.ssl._ptr()), e.args[0]) raise e def connectionLost(self, reason): # type: (AnyStr) -> None self.clear() ProtocolWrapper.connectionLost(self, reason) def _check(self): if not self.checked and m2.ssl_is_init_finished(self.ssl._ptr()): x509 = m2.ssl_get_peer_cert(self.ssl._ptr()) if x509 is not None: x509 = X509.X509(x509, 1) if self.isClient: host = self.transport.addr[0] else: host = self.transport.getPeer().host if not self.postConnectionCheck(x509, host): raise SSLVerificationError('post connection check') self.checked = 1 def _clientHello(self): try: # We rely on OpenSSL implicitly starting with client hello # when we haven't yet established an SSL connection encryptedData = self._encrypt(clientHello=1) ProtocolWrapper.write(self, encryptedData) self.helloDone = 1 except BIO.BIOError as e: # See http://www.openssl.org/docs/apps/verify.html#DIAGNOSTICS # for the error codes returned by SSL_get_verify_result. e.args = (m2.ssl_get_verify_result(self.ssl._ptr()), e.args[0]) raise e # Optimizations to reduce attribute accesses @property def _get_wr_guar_ssl(self): # type: () -> Callable[[], int] """Return max. length of data can be written to the BIO. Writes larger than this value will return a value from BIO_write() less than the amount requested or if the buffer is full request a retry. """ return partial(m2.bio_ctrl_get_write_guarantee, self.sslBio._ptr()) @property def _get_wr_guar_net(self): # type: () -> Callable[[], int] return partial(m2.bio_ctrl_get_write_guarantee, self.networkBio._ptr()) @property def _shoud_retry_ssl(self): # type: () -> Callable[[], int] # BIO_should_retry() is true if the call that produced this # condition should then be retried at a later time. return partial(m2.bio_should_retry, self.sslBio._ptr()) @property def _shoud_retry_net(self): # type: () -> Callable[[], int] return partial(m2.bio_should_retry, self.networkBio._ptr()) @property def _ctrl_pend_ssl(self): # type: () -> Callable[[], int] # size_t BIO_ctrl_pending(BIO *b); # BIO_ctrl_pending() return the number of pending characters in # the BIOs read and write buffers. return partial(m2.bio_ctrl_pending, self.sslBio._ptr()) @property def _ctrl_pend_net(self): # type: () -> Callable[[], int] return partial(m2.bio_ctrl_pending, self.networkBio._ptr()) @property def _write_ssl(self): # type: () -> Callable[[bytes], int] # All these functions return either the amount of data # successfully read or written (if the return value is # positive) or that no data was successfully read or written # if the result is 0 or -1. If the return value is -2 then # the operation is not implemented in the specific BIO type. return partial(m2.bio_write, self.sslBio._ptr()) @property def _write_net(self): # type: () -> Callable[[bytes], int] return partial(m2.bio_write, self.networkBio._ptr()) @property def _read_ssl(self): # type: () -> Callable[[int], Optional[bytes]] return partial(m2.bio_read, self.sslBio._ptr()) @property def _read_net(self): # type: () -> Callable[[int], Optional[bytes]] return partial(m2.bio_read, self.networkBio._ptr()) def _encrypt(self, data=b'', clientHello=0): # type: (bytes, int) -> bytes """ @param data: @param clientHello: @return: """ encryptedData = b'' self.data += data while 1: if (self._get_wr_guar_ssl() > 0 and self.data != b'') or clientHello: r = self._write_ssl(self.data) if r <= 0: if not self._shoud_retry_ssl(): raise IOError( ('Data left to be written to {}, ' + 'but cannot retry SSL connection!').format(self.sslBio)) else: assert self.checked self.data = self.data[r:] pending = self._ctrl_pend_net() if pending: d = self._read_net(pending) if d is not None: # This is strange, but d can be None encryptedData += d else: assert(self._shoud_retry_net()) else: break return encryptedData def _decrypt(self, data=b''): # type: (bytes) -> bytes self.encrypted += data decryptedData = b'' while 1: if self._get_wr_guar_ssl() > 0 and self.encrypted != b'': r = self._write_net(self.encrypted) if r <= 0: if not self._shoud_retry_net(): raise IOError( ('Data left to be written to {}, ' + 'but cannot retry SSL connection!').format(self.networkBio)) else: self.encrypted = self.encrypted[r:] pending = self._ctrl_pend_ssl() if pending: d = self._read_ssl(pending) if d is not None: # This is strange, but d can be None decryptedData += d else: assert(self._shoud_retry_ssl()) else: break return decryptedData r}r(X _SSLProxyrXclassrKKX_SSLProxy.__init__XdefrKKX!TLSProtocolWrapper.loseConnectionXdefrM'M*XTLSProtocolWrapperrXclassrKMXTLSProtocolWrapper._decryptXdefrMMXTLSProtocolWrapper._read_sslXdefrMMX!TLSProtocolWrapper._ctrl_pend_netXdefrMMX"_alwaysSucceedsPostConnectionCheckrXdefrK"K$XTLSProtocolWrapper.startTLSXdefrKMXTLSProtocolWrapper._write_netXdefrMMX_BioProxy.__init__XdefrKKXTLSProtocolWrapper._write_sslXdefrMMX connectTCPrXdefrK;KOXTLSProtocolWrapper.writeXdefrMMXTLSProtocolWrapper.__init__XdefrKKԇX!TLSProtocolWrapper._ctrl_pend_sslXdefrMMXTLSProtocolWrapper._encryptXdefrMMX_SSLProxy._ptrXdefrKKX#TLSProtocolWrapper._get_wr_guar_netXdefrMxM}XTLSProtocolWrapper.dataReceivedXdefrM0MJXTLSProtocolWrapper._read_netXdefrMMX listenTCPrXdefrKdKwX_BioProxy._ptrXdefrKKX_BioProxy.__del__XdefrKKX#TLSProtocolWrapper._shoud_retry_sslXdefrM~MX!TLSProtocolWrapper.connectionMadeXdefrM+M/X_SSLProxy.__del__XdefrKKX#TLSProtocolWrapper._shoud_retry_netXdefrMMXTLSProtocolWrapper._clientHelloXdefrM]MiX TLSProtocolWrapper.writeSequenceXdefrMM&XTLSProtocolWrapper.clearXdefrKKX connectSSLrXdefrK&K9X listenSSLrXdefrKQKbX!TLSProtocolWrapper.connectionLostXdefrMKMOXTLSProtocolWrapper._checkXdefrMPM\X _BioProxyrXclassrKyKX#TLSProtocolWrapper._get_wr_guar_sslXdefrMlMwu}r(X!TLSProtocolWrapper.loseConnectionrhUX listenTCPrhUX!TLSProtocolWrapper.connectionMaderhUXTLSProtocolWrapperrhUX TLSProtocolWrapper.writeSequencerhUXTLSProtocolWrapper.clearrhUX connectSSLrhUX listenSSLrhUX connectTCPrhUXTLSProtocolWrapper.writerhUXTLSProtocolWrapper.dataReceivedrhUXTLSProtocolWrapper.startTLSrhUX!TLSProtocolWrapper.connectionLostrhUujX#M2Crypto.SSL.TwistedProtocolWrapperrr}rbtUM2Crypto.httpslibr(X/(from __future__ import absolute_import import warnings """M2Crypto support for Python's httplib. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" import base64 import socket from M2Crypto import SSL, six, util from M2Crypto.six.moves.urllib_parse import urlsplit, urlunsplit from M2Crypto.six.moves.http_client import * # noqa # This is not imported with just '*' from M2Crypto.six.moves.http_client import HTTPS_PORT if util.py27plus: from typing import Any, AnyStr, Callable, Dict, List, Optional # noqa class HTTPSConnection(HTTPConnection): """ This class allows communication via SSL using M2Crypto. """ default_port = HTTPS_PORT def __init__(self, host, port=None, strict=None, **ssl): # type: (str, Optional[int], Optional[bool], **Any) -> None """ Represents one transaction with an HTTP server over the SSL connection. :param host: host name :param port: port number :param strict: if switched on, it raises BadStatusLine to be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1 status line. :param ssl: dict with all remaining named real parameters of the function. Specifically, ``ssl_context`` is expected to be included with SSL.Context; if it is not default ``'sslv23'`` is substituted). """ self.session = None # type: bytes self.host = host self.port = port keys = set(ssl.keys()) - set(('key_file', 'cert_file', 'ssl_context')) if keys: raise ValueError('unknown keyword argument: %s', keys) try: self.ssl_ctx = ssl['ssl_context'] assert isinstance(self.ssl_ctx, SSL.Context), self.ssl_ctx except KeyError: self.ssl_ctx = SSL.Context() HTTPConnection.__init__(self, host, port, strict) def connect(self): # type: () -> None error = None # We ignore the returned sockaddr because SSL.Connection.connect needs # a host name. for (family, _, _, _, _) in \ socket.getaddrinfo(self.host, self.port, 0, socket.SOCK_STREAM): sock = None try: sock = SSL.Connection(self.ssl_ctx, family=family) # set SNI server name since we know it at this point sock.set_tlsext_host_name(self.host) if self.session is not None: sock.set_session(self.session) sock.connect((self.host, self.port)) self.sock = sock sock = None return except socket.error as e: # Other exception are probably SSL-related, in that case we # abort and the exception is forwarded to the caller. error = e finally: if sock is not None: sock.close() if error is None: raise AssertionError("Empty list returned by getaddrinfo") raise error def close(self): # type: () -> None # This kludges around line 545 of httplib.py, # which closes the connection in this object; # the connection remains open in the response # object. # # M2Crypto doesn't close-here-keep-open-there, # so, in effect, we don't close until the whole # business is over and gc kicks in. # # XXX Long-running callers beware leakage. # # XXX 05-Jan-2002: This module works with Python 2.2, # XXX but I've not investigated if the above conditions # XXX remain. pass def get_session(self): # type: () -> SSL.Session.Session return self.sock.get_session() def set_session(self, session): # type: (SSL.Session.Session) -> None self.session = session class ProxyHTTPSConnection(HTTPSConnection): """ An HTTPS Connection that uses a proxy and the CONNECT request. When the connection is initiated, CONNECT is first sent to the proxy (along with authorization headers, if supplied). If successful, an SSL connection will be established over the socket through the proxy and to the target host. Finally, the actual request is sent over the SSL connection tunneling through the proxy. """ _ports = {'http': 80, 'https': 443} _AUTH_HEADER = "Proxy-Authorization" _UA_HEADER = "User-Agent" def __init__(self, host, port=None, strict=None, username=None, password=None, **ssl): # type: (str, Optional[int], Optional[bool], Optional[AnyStr], Optional[AnyStr], **Any) -> None """ Create the ProxyHTTPSConnection object. :param host: host name of the proxy server :param port: port number of the proxy server :param strict: if switched on, it raises BadStatusLine to be raised if the status line can't be parsed as a valid HTTP/1.0 or 1.1 status line. :param username: username on the proxy server, when required Username can be ``str``, but preferred type is ``bytes``. M2Crypto does some conversion to ``bytes`` when necessary, but it's better when the user of the library does it on its own. :param password: password on the proxy server, when required The same as with ``username``, ``str`` is accepted, but ``bytes`` are preferred. :param ssl: dict with all remaining named real parameters of the function. Specifically, ``ssl_context`` is expected to be included with SSL.Context; if it is not default ``'sslv23'`` is substituted). """ HTTPSConnection.__init__(self, host, port, strict, **ssl) self._username = username.encode('utf8') \ if isinstance(username, six.string_types) else username self._password = password.encode('utf8') \ if isinstance(password, six.string_types) else password self._proxy_auth = None # type: str self._proxy_UA = None # type: str def putrequest(self, method, url, skip_host=0, skip_accept_encoding=0): # type: (AnyStr, AnyStr, int, int) -> None """ putrequest is called before connect, so can interpret url and get real host/port to be used to make CONNECT request to proxy """ proto, netloc, path, query, fragment = urlsplit(url) if not proto: raise ValueError("unknown URL type: %s" % url) # get host & port try: username_password, host_port = netloc.split('@') except ValueError: host_port = netloc try: host, port_s = host_port.split(':') port = int(port_s) except ValueError: host = host_port # try to get port from proto try: port = self._ports[proto] except KeyError: raise ValueError("unknown protocol for: %s" % url) self._real_host = host # type: str self._real_port = port # type: int rest = urlunsplit((None, None, path, query, fragment)) HTTPSConnection.putrequest(self, method, rest, skip_host, skip_accept_encoding) def putheader(self, header, value): # type: (AnyStr, AnyStr) -> None # Store the auth header if passed in. if header.lower() == self._UA_HEADER.lower(): self._proxy_UA = value if header.lower() == self._AUTH_HEADER.lower(): self._proxy_auth = value else: HTTPSConnection.putheader(self, header, value) def endheaders(self, *args, **kwargs): # type: (*Any, **Any) -> None # We've recieved all of hte headers. Use the supplied username # and password for authorization, possibly overriding the authstring # supplied in the headers. if not self._proxy_auth: self._proxy_auth = self._encode_auth() HTTPSConnection.endheaders(self, *args, **kwargs) def connect(self): # type: () -> None HTTPConnection.connect(self) # send proxy CONNECT request self.sock.sendall(self._get_connect_msg()) response = HTTPResponse(self.sock) response.begin() code = response.status if code != 200: # proxy returned and error, abort connection, and raise exception self.close() raise socket.error("Proxy connection failed: %d" % code) self._start_ssl() def _get_connect_msg(self): # type: () -> bytes """ Return an HTTP CONNECT request to send to the proxy. """ msg = "CONNECT %s:%d HTTP/1.1\r\n" % (self._real_host, self._real_port) msg = msg + "Host: %s:%d\r\n" % (self._real_host, self._real_port) if self._proxy_UA: msg = msg + "%s: %s\r\n" % (self._UA_HEADER, self._proxy_UA) if self._proxy_auth: msg = msg + "%s: %s\r\n" % (self._AUTH_HEADER, self._proxy_auth) msg = msg + "\r\n" return util.py3bytes(msg) def _start_ssl(self): # type: () -> None """ Make this connection's socket SSL-aware. """ self.sock = SSL.Connection(self.ssl_ctx, self.sock) self.sock.setup_ssl() self.sock.set_connect_state() self.sock.connect_ssl() def _encode_auth(self): # type: () -> Optional[bytes] """ Encode the username and password for use in the auth header. """ if not (self._username and self._password): return None # Authenticated proxy userpass = "%s:%s" % (self._username, self._password) with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) enc_userpass = base64.encodestring(userpass).replace("\n", "") return util.py3bytes("Basic %s" % enc_userpass) r}r(XHTTPSConnection.connectXdefrK:K[XProxyHTTPSConnection.__init__XdefrKKXProxyHTTPSConnection.endheadersXdefrKK݇XHTTPSConnection.__init__XdefrKK9XProxyHTTPSConnection.putheaderXdefrKKӇXHTTPSConnection.get_sessionXdefrKnKqX!ProxyHTTPSConnection._encode_authXdefrMMXHTTPSConnection.closeXdefrK\KmXProxyHTTPSConnectionrXclassrKwMXProxyHTTPSConnection._start_sslXdefrKMXHTTPSConnection.set_sessionXdefrKrKuXHTTPSConnectionrXclassrKKuXProxyHTTPSConnection.putrequestXdefrKKɇXProxyHTTPSConnection.connectXdefrKKX%ProxyHTTPSConnection._get_connect_msgXdefrKKu}r(XHTTPSConnection.connecth?XProxyHTTPSConnection.endheadersh?XProxyHTTPSConnection.putheaderh?XHTTPSConnection.get_sessionh?XHTTPSConnection.closeh?XProxyHTTPSConnectionh?XHTTPSConnection.set_sessionh?XHTTPSConnectionh?XProxyHTTPSConnection.putrequesth?XProxyHTTPSConnection.connecth?ujXM2Crypto.httpslibrr}rbtUM2Crypto._m2cryptorUM2Crypto.SSL.SSLServerr(Xfrom __future__ import absolute_import, print_function """SSLServer Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" # M2Crypto from M2Crypto.SSL import SSLError from M2Crypto.SSL.Connection import Connection from M2Crypto.SSL.Context import Context # noqa from M2Crypto import six # noqa from M2Crypto import util # noqa from M2Crypto.six.moves.socketserver import (BaseServer, ForkingMixIn, TCPServer, ThreadingMixIn) from socket import socket # noqa if util.py27plus: from typing import Union # noqa __all__ = ['SSLServer', 'ForkingSSLServer', 'ThreadingSSLServer'] class SSLServer(TCPServer): def __init__(self, server_address, RequestHandlerClass, ssl_context, # noqa bind_and_activate=True): # type: (util.AddrType, socketserver.BaseRequestHandler, Context, bool) -> None """ Superclass says: Constructor. May be extended, do not override. This class says: Ho-hum. """ BaseServer.__init__(self, server_address, RequestHandlerClass) self.ssl_ctx = ssl_context self.socket = Connection(self.ssl_ctx) if bind_and_activate: self.server_bind() self.server_activate() def handle_request(self): # type: () -> None request = None client_address = None try: request, client_address = self.get_request() if self.verify_request(request, client_address): self.process_request(request, client_address) except SSLError: self.handle_error(request, client_address) def handle_error(self, request, client_address): # type: (Union[socket, Connection], util.AddrType) -> None print('-' * 40) import traceback traceback.print_exc() print('-' * 40) class ForkingSSLServer(ForkingMixIn, SSLServer): pass class ThreadingSSLServer(ThreadingMixIn, SSLServer): pass r}r(X SSLServerrXclassrKK7XSSLServer.__init__XdefrKK%XSSLServer.handle_errorXdefrK1K7XSSLServer.handle_requestXdefrK&K0XThreadingSSLServerrXclassr K=K?XForkingSSLServerr Xclassr K9K;u}r (XSSLServer.handle_errorr hUXThreadingSSLServerr hUX SSLServerr hUXForkingSSLServerr hUXSSLServer.handle_requestr hUujXM2Crypto.SSL.SSLServerr r }r btU M2Crypto.EVPr (X7from __future__ import absolute_import """M2Crypto wrapper for OpenSSL EVP API. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions Copyright (c) 2004-2007 Open Source Applications Foundation. Author: Heikki Toivonen """ from M2Crypto import BIO, Err, RSA, m2, util if util.py27plus: from typing import AnyStr, Optional, Callable # noqa class EVPError(Exception): pass m2.evp_init(EVPError) def pbkdf2(password, salt, iter, keylen): # type: (bytes, bytes, int, int) -> bytes """ Derive a key from password using PBKDF2 algorithm specified in RFC 2898. :param password: Derive the key from this password. :param salt: Salt. :param iter: Number of iterations to perform. :param keylen: Length of key to produce. :return: Key. """ return m2.pkcs5_pbkdf2_hmac_sha1(password, salt, iter, keylen) class MessageDigest: """ Message Digest """ m2_md_ctx_free = m2.md_ctx_free def __init__(self, algo): # type: (str) -> None md = getattr(m2, algo, None) # type: Optional[Callable] if md is None: # if the digest algorithm isn't found as an attribute of the m2 # module, try to look up the digest using get_digestbyname() self.md = m2.get_digestbyname(algo) if self.md is None: raise ValueError('unknown algorithm', algo) else: self.md = md() self.ctx = m2.md_ctx_new() m2.digest_init(self.ctx, self.md) def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_md_ctx_free(self.ctx) def update(self, data): # type: (bytes) -> int """ Add data to be digested. :return: -1 for Python error, 1 for success, 0 for OpenSSL failure. """ return m2.digest_update(self.ctx, data) def final(self): return m2.digest_final(self.ctx) # Deprecated. digest = final class HMAC: m2_hmac_ctx_free = m2.hmac_ctx_free def __init__(self, key, algo='sha1'): # type: (bytes, str) -> None md = getattr(m2, algo, None) if md is None: raise ValueError('unknown algorithm', algo) self.md = md() self.ctx = m2.hmac_ctx_new() m2.hmac_init(self.ctx, key, self.md) def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_hmac_ctx_free(self.ctx) def reset(self, key): # type: (bytes) -> None m2.hmac_init(self.ctx, key, self.md) def update(self, data): # type: (bytes) -> None m2.hmac_update(self.ctx, data) def final(self): # type: () -> bytes return m2.hmac_final(self.ctx) digest = final def hmac(key, data, algo='sha1'): # type: (bytes, bytes, str) -> bytes md = getattr(m2, algo, None) if md is None: raise ValueError('unknown algorithm', algo) return m2.hmac(key, data, md()) class Cipher: m2_cipher_ctx_free = m2.cipher_ctx_free def __init__(self, alg, key, iv, op, key_as_bytes=0, d='md5', salt=b'12345678', i=1, padding=1): # type: (str, bytes, bytes, object, int, str, bytes, int, int) -> None cipher = getattr(m2, alg, None) if cipher is None: raise ValueError('unknown cipher', alg) self.cipher = cipher() if key_as_bytes: kmd = getattr(m2, d, None) if kmd is None: raise ValueError('unknown message digest', d) key = m2.bytes_to_key(self.cipher, kmd(), key, salt, iv, i) self.ctx = m2.cipher_ctx_new() m2.cipher_init(self.ctx, self.cipher, key, iv, op) self.set_padding(padding) del key def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_cipher_ctx_free(self.ctx) def update(self, data): # type: (bytes) -> bytes return m2.cipher_update(self.ctx, data) def final(self): # type: () -> bytes return m2.cipher_final(self.ctx) def set_padding(self, padding=1): # type: (int) -> int """ Actually always return 1 """ return m2.cipher_set_padding(self.ctx, padding) class PKey: """ Public Key """ m2_pkey_free = m2.pkey_free m2_md_ctx_free = m2.md_ctx_free def __init__(self, pkey=None, _pyfree=0, md='sha1'): # type: (Optional[bytes], int, str) -> None if pkey is not None: self.pkey = pkey # type: bytes self._pyfree = _pyfree else: self.pkey = m2.pkey_new() self._pyfree = 1 self._set_context(md) def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_pkey_free(self.pkey) if getattr(self, 'ctx', None): self.m2_md_ctx_free(self.ctx) def _ptr(self): return self.pkey def _set_context(self, md): # type: (str) -> None mda = getattr(m2, md, None) # type: Optional[Callable] if mda is None: raise ValueError('unknown message digest', md) self.md = mda() self.ctx = m2.md_ctx_new() # type: Context def reset_context(self, md='sha1'): # type: (str) -> None """ Reset internal message digest context. :param md: The message digest algorithm. """ self._set_context(md) def sign_init(self): # type: () -> None """ Initialise signing operation with self. """ m2.sign_init(self.ctx, self.md) def sign_update(self, data): # type: (bytes) -> None """ Feed data to signing operation. :param data: Data to be signed. """ m2.sign_update(self.ctx, data) def sign_final(self): # type: () -> bytes """ Return signature. :return: The signature. """ return m2.sign_final(self.ctx, self.pkey) # Deprecated update = sign_update final = sign_final def verify_init(self): # type: () -> None """ Initialise signature verification operation with self. """ m2.verify_init(self.ctx, self.md) def verify_update(self, data): # type: (bytes) -> int """ Feed data to verification operation. :param data: Data to be verified. :return: -1 on Python error, 1 for success, 0 for OpenSSL error """ return m2.verify_update(self.ctx, data) def verify_final(self, sign): # type: (bytes) -> int """ Return result of verification. :param sign: Signature to use for verification :return: Result of verification: 1 for success, 0 for failure, -1 on other error. """ return m2.verify_final(self.ctx, sign, self.pkey) def assign_rsa(self, rsa, capture=1): # type: (RSA.RSA, int) -> int """ Assign the RSA key pair to self. :param rsa: M2Crypto.RSA.RSA object to be assigned to self. :param capture: If true (default), this PKey object will own the RSA object, meaning that once the PKey object gets deleted it is no longer safe to use the RSA object. :return: Return 1 for success and 0 for failure. """ if capture: ret = m2.pkey_assign_rsa(self.pkey, rsa.rsa) if ret: rsa._pyfree = 0 else: ret = m2.pkey_set1_rsa(self.pkey, rsa.rsa) return ret def get_rsa(self): # type: () -> RSA.RSA_pub """ Return the underlying RSA key if that is what the EVP instance is holding. """ rsa_ptr = m2.pkey_get1_rsa(self.pkey) if rsa_ptr is None: raise ValueError("PKey instance is not holding a RSA key") rsa = RSA.RSA_pub(rsa_ptr, 1) return rsa def save_key(self, file, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (AnyStr, Optional[str], Callable) -> int """ Save the key pair to a file in PEM format. :param file: Name of file to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ with BIO.openfile(file, 'wb') as bio: return self.save_key_bio(bio, cipher, callback) def save_key_bio(self, bio, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (BIO.BIO, Optional[str], Callable) -> int """ Save the key pair to the M2Crypto.BIO object 'bio' in PEM format. :param bio: M2Crypto.BIO object to save key to. :param cipher: Symmetric cipher to protect the key. The default cipher is 'aes_128_cbc'. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ if cipher is None: return m2.pkey_write_pem_no_cipher(self.pkey, bio._ptr(), callback) else: proto = getattr(m2, cipher, None) if proto is None: raise ValueError('no such cipher %s' % cipher) return m2.pkey_write_pem(self.pkey, bio._ptr(), proto(), callback) def as_pem(self, cipher='aes_128_cbc', callback=util.passphrase_callback): # type: (Optional[str], Callable) -> bytes """ Return key in PEM format in a string. :param cipher: Symmetric cipher to protect the key. The default cipher is ``'aes_128_cbc'``. If cipher is None, then the key is saved in the clear. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. The default is util.passphrase_callback. """ bio = BIO.MemoryBuffer() self.save_key_bio(bio, cipher, callback) return bio.read_all() def as_der(self): # type: () -> bytes """ Return key in DER format in a string """ buf = m2.pkey_as_der(self.pkey) bio = BIO.MemoryBuffer(buf) return bio.read_all() def size(self): # type: () -> int """ Return the size of the key in bytes. """ return m2.pkey_size(self.pkey) def get_modulus(self): # type: () -> Optional[bytes] """ Return the modulus in hex format. """ return m2.pkey_get_modulus(self.pkey) def load_key(file, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> PKey """ Load an M2Crypto.EVP.PKey from file. :param file: Name of file containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EVP.PKey object. """ bio = m2.bio_new_file(file, 'r') if bio is None: raise BIO.BIOError(Err.get_error()) cptr = m2.pkey_read_pem(bio, callback) m2.bio_free(bio) if cptr is None: raise EVPError(Err.get_error()) return PKey(cptr, 1) def load_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> PKey """ Load an M2Crypto.EVP.PKey from an M2Crypto.BIO object. :param bio: M2Crypto.BIO object containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EVP.PKey object. """ cptr = m2.pkey_read_pem(bio._ptr(), callback) if cptr is None: raise EVPError(Err.get_error()) return PKey(cptr, 1) def load_key_bio_pubkey(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> PKey """ Load an M2Crypto.EVP.PKey from a public key as a M2Crypto.BIO object. :param bio: M2Crypto.BIO object containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EVP.PKey object. """ cptr = m2.pkey_read_pem_pubkey(bio._ptr(), callback) if cptr is None: raise EVPError(Err.get_error()) return PKey(cptr, 1) def load_key_string(string, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> PKey """ Load an M2Crypto.EVP.PKey from a string. :param string: String containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EVP.PKey object. """ bio = BIO.MemoryBuffer(string) return load_key_bio(bio, callback) def load_key_string_pubkey(string, callback=util.passphrase_callback): # type: (AnyStr, Callable) -> PKey """ Load an M2Crypto.EVP.PKey from a public key as a string. :param string: String containing the key in PEM format. :param callback: A Python callable object that is invoked to acquire a passphrase with which to protect the key. :return: M2Crypto.EVP.PKey object. """ bio = BIO.MemoryBuffer(string) return load_key_bio_pubkey(bio, callback) r }r (X HMAC.updateXdefr KcKfX PKey.save_keyXdefr M(M;XPKey.verify_updateXdefr KKXPKey._set_contextXdefr KKÇXload_keyr Xdefr MMXMessageDigest.updateXdefr K=KEXCipher.__init__Xdefr KzKXEVPErrorr Xclassr KKX PKey._ptrXdefr KKX Cipher.finalXdefr KKXMessageDigest.__init__Xdefr K*K7XPKey.verify_finalXdefr KMXload_key_bio_pubkeyr Xdefr MMXPKey.get_modulusXdefr MwM}XPKey.reset_contextXdefr KK̇XCipherr! Xclassr" KvKXMessageDigest.__del__Xdefr# K8K Xdefr? KK"Xhmacr@ XdefrA KnKtX PKey.get_rsaXdefrB MM'XPKey.assign_rsaXdefrC MMXPKey.sign_finalXdefrD KKXHMACrE XclassrF KMKlX PKey.sizeXdefrG MpMvu}rH (X HMAC.updateh?X PKey.save_keyh?XPKey.verify_updateh?XPKey.get_modulush?Xload_keyh?XMessageDigest.updateh?Xhmach?XEVPErrorrI h?XPKey.verify_finalh?Xload_key_bio_pubkeyh?XCipherh?X PKey.as_pemh?Xload_key_stringh?Xload_key_string_pubkeyh?X HMAC.reseth?XPKeyh?XCipher.set_paddingh?XPKey.sign_updateh?XPKey.reset_contexth?X Cipher.updateh?XPKey.sign_inith?XPKey.verify_inith?X HMAC.finalh?X load_key_bioh?X MessageDigesth?X PKey.as_derh?XPKey.save_key_bioh?XMessageDigest.finalh?Xpbkdf2h?X Cipher.finalh?X PKey.get_rsah?XPKey.assign_rsah?XPKey.sign_finalh?XHMACh?X PKey.sizeh?ujX M2Crypto.EVPrJ rK }rL btU M2Crypto.utilrM (X from __future__ import absolute_import """ M2Crypto utility routines. Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004 OSAF. All Rights Reserved. """ import binascii import logging import sys # This means "Python 2.7 or higher" so it is True for py3k as well py27plus = sys.version_info[:2] > (2, 6) # type: bool from M2Crypto import m2, six if py27plus: from typing import AnyStr, Tuple, Union # noqa # see https://github.com/python/typeshed/issues/222 AddrType = Union[Tuple[str, int], str] log = logging.getLogger('util') class UtilError(Exception): pass m2.util_init(UtilError) def pkcs5_pad(data, blklen=8): # type: (str, int) -> str pad = (8 - (len(data) % 8)) return data + chr(pad) * pad def pkcs7_pad(data, blklen): # type: (str, int) -> str if blklen > 255: raise ValueError('illegal block size') pad = (blklen - (len(data) % blklen)) return data + chr(pad) * pad # before the introduction of py3{bytes,str}, python2 code # was just using args as-is if six.PY2: def py3bytes(x): # type: (AnyStr) -> Optional[bytes,bytearray] if isinstance(x, unicode): return x.encode('utf8') elif isinstance(x, (bytearray, str)): return x else: raise TypeError( 'No string argument provided (type of x is %s)' % type(x)) def py3str(x): # type: (Optional[str,bytearray]) -> str if isinstance(x, bytearray): return str(x) elif isinstance(x, (str, unicode)): return x else: raise TypeError( 'No string argument provided (type of x is %s)' % type(x)) else: def py3bytes(x): # type: (AnyStr) -> Optional[bytes,bytearray] if isinstance(x, str): return bytes(x, encoding='utf8') elif isinstance(x, (bytes, bytearray)): return x else: raise TypeError( 'No string argument provided (type of x is %s)' % type(x)) def py3str(x): # type: (Optional[AnyStr,bytearray]) -> str if isinstance(x, (bytes, bytearray)): return x.decode('utf8') elif isinstance(x, str): return x else: raise TypeError( 'No string argument provided (type of x is %s)' % type(x)) def bin_to_hex(b): # type: (bytes) -> str return py3str(binascii.b2a_base64(b)[:-1]) def octx_to_num(x): # type: (bytes) -> int return int(binascii.hexlify(x), 16) def genparam_callback(p, n, out=sys.stdout): # type: (int, Any, file) -> None ch = ['.', '+', '*', '\n'] out.write(ch[p]) out.flush() def quiet_genparam_callback(p, n, out): # type: (Any, Any, Any) -> None pass def passphrase_callback(v, prompt1='Enter passphrase:', prompt2='Verify passphrase:'): # type: (bool, str, str) -> Optional[str] from getpass import getpass while 1: try: p1 = getpass(prompt1) if v: p2 = getpass(prompt2) if p1 == p2: break else: break except KeyboardInterrupt: return None return p1 def no_passphrase_callback(*args): # type: (*Any) -> str return '' rN }rO (Xno_passphrase_callbackrP XdefrQ KKX UtilErrorrR XclassrS KKXquiet_genparam_callbackrT XdefrU KpKsXpy3strrV XdefrW KSK]Xgenparam_callbackrX XdefrY KiKnX pkcs5_padrZ Xdefr[ K!K%X pkcs7_padr\ Xdefr] K'K-X octx_to_numr^ Xdefr_ KdKgXpy3bytesr` Xdefra KHKRX bin_to_hexrb Xdefrc K_KbXpassphrase_callbackrd Xdefre KuKu}rf (Xno_passphrase_callbackh?Xpy3strh?Xquiet_genparam_callbackh?X pkcs7_padh?Xgenparam_callbackh?Xpassphrase_callbackh?X UtilErrorrg h?X octx_to_numh?Xpy3bytesh?X bin_to_hexh?X pkcs5_padh?ujX M2Crypto.utilrh ri }rj btUM2Crypto.SSL.Contextrk (XBfrom __future__ import absolute_import """SSL Context Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" from M2Crypto import BIO, Err, RSA, X509, m2, util # noqa from M2Crypto.SSL import cb # noqa from M2Crypto.SSL.Session import Session # noqa from weakref import WeakValueDictionary if util.py27plus: from typing import Any, AnyStr, Callable, Optional, Union # noqa __all__ = ['ctxmap', 'Context', 'map'] class _ctxmap: # noqa singleton = None # type: Optional[_ctxmap] def __init__(self): # type: () -> None """Simple WeakReffed list. """ self._ctxmap = WeakValueDictionary() def __getitem__(self, key): # type: (int) -> Any return self._ctxmap[key] def __setitem__(self, key, value): # type: (int, Any) -> None self._ctxmap[key] = value def __delitem__(self, key): # type: (int) -> None del self._ctxmap[key] def ctxmap(): # type: () -> _ctxmap if _ctxmap.singleton is None: _ctxmap.singleton = _ctxmap() return _ctxmap.singleton # deprecated!!! map = ctxmap class Context: """'Context' for SSL connections.""" m2_ssl_ctx_free = m2.ssl_ctx_free def __init__(self, protocol='tls', weak_crypto=None, post_connection_check=None): # type: (str, Optional[int], Optional[Callable]) -> None proto = getattr(m2, protocol + '_method', None) if proto is None: # default is 'sslv23' for older versions of OpenSSL if protocol == 'tls': proto = getattr(m2, 'sslv23_method') else: raise ValueError("no such protocol '%s'" % protocol) self.ctx = m2.ssl_ctx_new(proto()) self.allow_unknown_ca = 0 # type: Union[int, bool] self.post_connection_check = post_connection_check ctxmap()[int(self.ctx)] = self m2.ssl_ctx_set_cache_size(self.ctx, 128) if weak_crypto is None and protocol in ('sslv23', 'tls'): self.set_options(m2.SSL_OP_ALL | m2.SSL_OP_NO_SSLv2 | m2.SSL_OP_NO_SSLv3) def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_ssl_ctx_free(self.ctx) def close(self): # type: () -> None del ctxmap()[int(self.ctx)] def load_cert(self, certfile, keyfile=None, callback=util.passphrase_callback): # type: (AnyStr, Optional[AnyStr], Callable) -> None """Load certificate and private key into the context. :param certfile: File that contains the PEM-encoded certificate. :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'. :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. """ m2.ssl_ctx_passphrase_callback(self.ctx, callback) m2.ssl_ctx_use_cert(self.ctx, certfile) if not keyfile: keyfile = certfile m2.ssl_ctx_use_privkey(self.ctx, keyfile) if not m2.ssl_ctx_check_privkey(self.ctx): raise ValueError('public/private key mismatch') def load_cert_chain(self, certchainfile, keyfile=None, callback=util.passphrase_callback): # type: (AnyStr, Optional[AnyStr], Callable) -> None """Load certificate chain and private key into the context. :param certchainfile: File object containing the PEM-encoded certificate chain. :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'. :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. """ m2.ssl_ctx_passphrase_callback(self.ctx, callback) m2.ssl_ctx_use_cert_chain(self.ctx, certchainfile) if not keyfile: keyfile = certchainfile m2.ssl_ctx_use_privkey(self.ctx, keyfile) if not m2.ssl_ctx_check_privkey(self.ctx): raise ValueError('public/private key mismatch') def set_client_CA_list_from_file(self, cafile): # type: (AnyStr) -> None """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. """ m2.ssl_ctx_set_client_CA_list_from_file(self.ctx, cafile) # Deprecated. load_client_CA = load_client_ca = set_client_CA_list_from_file def load_verify_locations(self, cafile=None, capath=None): # type: (Optional[AnyStr], Optional[AnyStr]) -> int """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. :param capath: Directory containing PEM-encoded CA certificates (one certificate per file). :return: 0 if the operation failed because CAfile and CApath are NULL or the processing at one of the locations specified failed. Check the error stack to find out the reason. 1 The operation succeeded. """ if cafile is None and capath is None: raise ValueError("cafile and capath can not both be None.") return m2.ssl_ctx_load_verify_locations(self.ctx, cafile, capath) # Deprecated. load_verify_info = load_verify_locations def set_session_id_ctx(self, id): # type: (bytes) -> None """Sets the session id for the SSL.Context w/in a session can be reused. :param id: Sessions are generated within a certain context. When exporting/importing sessions with i2d_SSL_SESSION/d2i_SSL_SESSION it would be possible, to re-import a session generated from another context (e.g. another application), which might lead to malfunctions. Therefore each application must set its own session id context sid_ctx which is used to distinguish the contexts and is stored in exported sessions. The sid_ctx can be any kind of binary data with a given length, it is therefore possible to use e.g. the name of the application and/or the hostname and/or service name. """ ret = m2.ssl_ctx_set_session_id_context(self.ctx, id) if not ret: raise Err.SSLError(Err.get_error_code(), '') def set_default_verify_paths(self): # type: () -> int """ Specifies that the default locations from which CA certs are loaded should be used. There is one default directory and one default file. The default CA certificates directory is called "certs" in the default OpenSSL directory. Alternatively the SSL_CERT_DIR environment variable can be defined to override this location. The default CA certificates file is called "cert.pem" in the default OpenSSL directory. Alternatively the SSL_CERT_FILE environment variable can be defined to override this location. @return 0 if the operation failed. A missing default location is still treated as a success. No error code is set. 1 The operation succeeded. """ ret = m2.ssl_ctx_set_default_verify_paths(self.ctx) if not ret: raise ValueError('Cannot use default SSL certificate store!') def set_allow_unknown_ca(self, ok): # type: (Union[int, bool]) -> None """Set the context to accept/reject a peer certificate if the certificate's CA is unknown. :param ok: True to accept, False to reject. """ self.allow_unknown_ca = ok def get_allow_unknown_ca(self): # type: () -> Union[int, bool] """Get the context's setting that accepts/rejects a peer certificate if the certificate's CA is unknown. FIXME 2Bconverted to bool """ return self.allow_unknown_ca def set_verify(self, mode, depth, callback=None): # type: (int, int, Optional[Callable]) -> None """ 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 depth: The maximum allowed depth of the certificate chain returned by the peer. :param callback: Callable that can be used to specify custom verification checks. """ if callback is None: m2.ssl_ctx_set_verify_default(self.ctx, mode) else: m2.ssl_ctx_set_verify(self.ctx, mode, callback) m2.ssl_ctx_set_verify_depth(self.ctx, depth) def get_verify_mode(self): # type: () -> int return m2.ssl_ctx_get_verify_mode(self.ctx) def get_verify_depth(self): # type: () -> int """Returns the verification mode currently set in the SSL Context.""" return m2.ssl_ctx_get_verify_depth(self.ctx) def set_tmp_dh(self, dhpfile): # type: (AnyStr) -> int """Load ephemeral DH parameters into the context. :param dhpfile: Filename of the file containing the PEM-encoded DH parameters. """ f = BIO.openfile(dhpfile) dhp = m2.dh_read_parameters(f.bio_ptr()) return m2.ssl_ctx_set_tmp_dh(self.ctx, dhp) def set_tmp_dh_callback(self, callback=None): # type: (Optional[Callable]) -> None """Sets the callback function for SSL.Context. :param callback: Callable to be used when a DH parameters are required. """ if callback is not None: m2.ssl_ctx_set_tmp_dh_callback(self.ctx, callback) def set_tmp_rsa(self, rsa): # type: (RSA.RSA) -> int """Load ephemeral RSA key into the context. :param rsa: RSA.RSA instance. """ if isinstance(rsa, RSA.RSA): return m2.ssl_ctx_set_tmp_rsa(self.ctx, rsa.rsa) else: raise TypeError("Expected an instance of RSA.RSA, got %s." % rsa) def set_tmp_rsa_callback(self, callback=None): # type: (Optional[Callable]) -> None """Sets the callback function to be used when a temporary/ephemeral RSA key is required. """ if callback is not None: m2.ssl_ctx_set_tmp_rsa_callback(self.ctx, callback) def set_info_callback(self, callback=cb.ssl_info_callback): # type: (Callable) -> None """Set a callback function to get state information. It 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. """ m2.ssl_ctx_set_info_callback(self.ctx, callback) def set_cipher_list(self, cipher_list): # type: (str) -> int """Sets the list of available ciphers. :param cipher_list: The format of the string is described in ciphers(1). :return: 1 if any cipher could be selected and 0 on complete failure. """ return m2.ssl_ctx_set_cipher_list(self.ctx, cipher_list) def add_session(self, session): # type: (Session) -> int """Add the session to the context. :param session: the session to be added. :return: 0 The operation failed. It was tried to add the same (identical) session twice. 1 The operation succeeded. """ return m2.ssl_ctx_add_session(self.ctx, session._ptr()) def remove_session(self, session): # type: (Session) -> int """Remove the session from the context. :param session: the session to be removed. :return: 0 The operation failed. The session was not found in the cache. 1 The operation succeeded. """ return m2.ssl_ctx_remove_session(self.ctx, session._ptr()) def get_session_timeout(self): # type: () -> int """Get current session timeout. Whenever a new session is created, it is assigned a maximum lifetime. This lifetime is specified by storing the creation time of the session and the timeout value valid at this time. If the actual time is later than creation time plus timeout, the session is not reused. Due to this realization, all sessions behave according to the timeout value valid at the time of the session negotiation. Changes of the timeout value do not affect already established sessions. Expired sessions are removed from the internal session cache, whenever SSL_CTX_flush_sessions(3) is called, either directly by the application or automatically (see SSL_CTX_set_session_cache_mode(3)) The default value for session timeout is decided on a per protocol basis, see SSL_get_default_timeout(3). All currently supported protocols have the same default timeout value of 300 seconds. SSL_CTX_set_timeout() returns the previously set timeout value. :return: the currently set timeout value. """ return m2.ssl_ctx_get_session_timeout(self.ctx) def set_session_timeout(self, timeout): # type: (int) -> int """Set new session timeout. See self.get_session_timeout() for explanation of the session timeouts. :param timeout: new timeout value. :return: the previously set timeout value. """ return m2.ssl_ctx_set_session_timeout(self.ctx, timeout) def set_session_cache_mode(self, mode): # type: (int) -> int """Enables/disables session caching. The mode is set by using m2.SSL_SESS_CACHE_* constants. :param mode: new mode value. :return: the previously set cache mode value. """ return m2.ssl_ctx_set_session_cache_mode(self.ctx, mode) def get_session_cache_mode(self): # type: () -> int """Gets the current session caching. The mode is set to m2.SSL_SESS_CACHE_* constants. :return: the previously set cache mode value. """ return m2.ssl_ctx_get_session_cache_mode(self.ctx) def set_options(self, op): # type: (int) -> int """Adds the options set via bitmask in options to the Context. !!! Options already set before are not cleared! The behaviour of the SSL library can be changed by setting several options. The options are coded as bitmasks and can be combined by a logical or operation (|). SSL.Context.set_options() and SSL.set_options() affect the (external) protocol behaviour of the SSL library. The (internal) behaviour of the API can be changed by using the similar SSL.Context.set_mode() and SSL.set_mode() functions. During a handshake, the option settings of the SSL object are used. When a new SSL object is created from a context using SSL(), the current option setting is copied. Changes to ctx do not affect already created SSL objects. SSL.clear() does not affect the settings. :param op: bitmask of additional options specified in SSL_CTX_set_options(3) manpage. :return: the new options bitmask after adding options. """ return m2.ssl_ctx_set_options(self.ctx, op) def get_cert_store(self): # type: () -> X509.X509 """ 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. """ return X509.X509_Store(m2.ssl_ctx_get_cert_store(self.ctx)) rl }rm (X Context.closeXdefrn KNKQXContext.get_cert_storeXdefro MMXContext.set_optionsXdefrp MMXContext.remove_sessionXdefrq MKMWXContext.__del__Xdefrr KIKMXContext.get_session_timeoutXdefrs MXMvXContext.set_session_cache_modeXdefrt MMXContext.get_session_cache_modeXdefru MMXContext.set_tmp_dh_callbackXdefrv M MXContext.set_session_id_ctxXdefrw KKXContext.__init__Xdefrx K6KHXContext.set_allow_unknown_caXdefry KKهXContext.set_tmp_rsaXdefrz MMXContext.load_cert_chainXdefr{ KgK}XContext.set_info_callbackXdefr| M'M2XContext.set_cipher_listXdefr} M3M=XContext.set_session_timeoutXdefr~ MwMXContext.get_allow_unknown_caXdefr KKX_ctxmap.__delitem__Xdefr K"K%X_ctxmap.__init__Xdefr KKX Context.set_default_verify_pathsXdefr KKЇXContext.set_verifyXdefr KKXContext.set_tmp_rsa_callbackXdefr MM&XContext.load_verify_locationsXdefr KKXContext.load_certXdefr KRKfXContext.get_verify_modeXdefr KKX_ctxmap.__setitem__Xdefr KK!XContext.add_sessionXdefr M>MJXContextr Xclassr K0MXContext.get_verify_depthXdefr KKX_ctxmapr Xclassr KK%X_ctxmap.__getitem__Xdefr KKX$Context.set_client_CA_list_from_fileXdefr K~KXctxmapr Xdefr K'K,XContext.set_tmp_dhXdefr MM u}r (X Context.closer hUXContext.get_cert_storer hUXContext.set_optionsr hUXContext.remove_sessionr hUXContext.load_verify_locationsr hUXContext.get_session_cache_moder hUXContext.set_tmp_dh_callbackr hUXContext.set_session_id_ctxr hUXContext.set_allow_unknown_car hUXContext.get_session_timeoutr hUXContext.load_cert_chainr hUXContext.set_info_callbackr hUXContext.set_cipher_listr hUXContext.set_session_timeoutr hUXContext.get_allow_unknown_car hUXContext.add_sessionr hUXContext.get_verify_moder hUXContext.set_verifyr hUXContext.set_tmp_rsa_callbackr hUXContext.set_tmp_rsar hUXContext.set_session_cache_moder hUXContext.load_certr hUX Context.set_default_verify_pathsr hUXContextr hUXContext.get_verify_depthr hUX$Context.set_client_CA_list_from_filer hUXctxmapr hUXContext.set_tmp_dhr hUujXM2Crypto.SSL.Contextr r }r btuUtoc_num_entriesr }r (h Kh"Kh*K h?KhMKhUK h]KuUnumbered_toctreesr h]Rr U found_docsr h]r (X howto.sslr Xindexr XZServerSSL-HOWTOr h?Xhowto.car hUX howto.smimer eRr U longtitlesr }r (h hh"h#h*h+h?h@hMhNhUhVh]h^uU dependenciesr jhRr (j h]Rr j h]Rr j h]Rr h?h]r (X../M2Crypto/DH.pyr X../M2Crypto/DSA.pyr X../M2Crypto/__init__.pyr X../M2Crypto/Engine.pyr X../M2Crypto/util.pyr X../M2Crypto/EVP.pyr X../M2Crypto/m2urllib.pyr X../M2Crypto/X509.pyr X../M2Crypto/Rand.pyr X../M2Crypto/RSA.pyr X../M2Crypto/SMIME.pyr X../M2Crypto/threading.pyr X../M2Crypto/AuthCookie.pyr X../M2Crypto/callback.pyr X../M2Crypto/EC.pyr X../M2Crypto/BIO.pyr X../M2Crypto/ASN1.pyr X../M2Crypto/BN.pyr X../M2Crypto/httpslib.pyr X../M2Crypto/ftpslib.pyr X../M2Crypto/m2urllib2.pyr X../M2Crypto/Err.pyr X../M2Crypto/m2xmlrpclib.pyr X../M2Crypto/RC4.pyr X../M2Crypto/m2crypto.pyr X../M2Crypto/m2.pyr eRr j h]Rr hUh]r (X../M2Crypto/SSL/cb.pyr X../M2Crypto/SSL/Cipher.pyr X)../M2Crypto/SSL/TwistedProtocolWrapper.pyr X../M2Crypto/SSL/__init__.pyr X!../M2Crypto/SSL/ssl_dispatcher.pyr X../M2Crypto/SSL/SSLServer.pyr X../M2Crypto/SSL/Connection.pyr X../M2Crypto/SSL/timeout.pyr X../M2Crypto/SSL/Context.pyr X../M2Crypto/SSL/Session.pyr X../M2Crypto/SSL/Checker.pyr eRr j h]Rr uUtoctree_includesr }r (h"]r XM2Cryptor ah?]r X M2Crypto.SSLr auUincludedr h]Rr Utocsr }r (h cdocutils.nodes bullet_list r )r }r (hUh}r (h]h]h]h]h]uh]r (cdocutils.nodes list_item r )r }r (hUh}r (h]h]h]h]h]uhj h]r csphinx.addnodes compact_paragraph r )r }r (hUh}r (h]h]h]h]h]uhj h]r cdocutils.nodes reference r )r }r (hUh}r (U anchornameUh]h]h]Urefurih h]h]Uinternaluhj h]r hX.HOWTO: Programming SSL in Python with M2Cryptor r }r (hUhj ubah U referencer ubah Ucompact_paragraphr ubah U list_itemr ubj )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (U anchornameU #introductionh]h]h]Urefurih h]h]Uinternaluhj h]r! hX Introductionr" r# }r$ (hUhj ubah j ubah j ubah j ubj )r% }r& (hUh}r' (h]h]h]h]h]uhj h]r( j )r) }r* (hUh}r+ (h]h]h]h]h]uhj% h]r, j )r- }r. (hUh}r/ (U anchornameU#a-bit-of-historyh]h]h]Urefurih h]h]Uinternaluhj) h]r0 hXA bit of historyr1 r2 }r3 (hUhj- ubah j ubah j ubah j ubj )r4 }r5 (hUh}r6 (h]h]h]h]h]uhj h]r7 j )r8 }r9 (hUh}r: (h]h]h]h]h]uhj4 h]r; j )r< }r= (hUh}r> (U anchornameU #secure-sslh]h]h]Urefurih h]h]Uinternaluhj8 h]r? hX Secure SSLr@ rA }rB (hUhj< ubah j ubah j ubah j ubj )rC }rD (hUh}rE (h]h]h]h]h]uhj h]rF j )rG }rH (hUh}rI (h]h]h]h]h]uhjC h]rJ j )rK }rL (hUh}rM (U anchornameU #code-samplesh]h]h]Urefurih h]h]UinternaluhjG h]rN hX Code SamplesrO rP }rQ (hUhjK ubah j ubah j ubah j ubj )rR }rS (hUh}rT (h]h]h]h]h]uhj h]rU j )rV }rW (hUh}rX (h]h]h]h]h]uhjR h]rY j )rZ }r[ (hUh}r\ (U anchornameU#ssldumph]h]h]Urefurih h]h]UinternaluhjV h]r] hXssldumpr^ r_ }r` (hUhjZ ubah j ubah j ubah j ubeh U bullet_listra ubh"j )rb }rc (hUh}rd (h]h]h]h]h]uh]re (j )rf }rg (hUh}rh (h]h]h]h]h]uhjb h]ri (j )rj }rk (hUh}rl (h]h]h]h]h]uhjf h]rm j )rn }ro (hUh}rp (U anchornameUh]h]h]Urefurih"h]h]Uinternaluhjj h]rq hX&Welcome to M2Crypto’s documentation!rr rs }rt (hUhjn ubah j ubah j ubj )ru }rv (hUh}rw (h]h]h]h]h]uhjf h]rx csphinx.addnodes toctree ry )rz }r{ (hUhju h2X(/home/matej/Build/m2crypto/doc/index.rsth Utoctreeh}r| (UnumberedKU includehiddenUparenth"h]Uglobh]h]U titlesonlyh]UmaxdepthKUentries]r} Nj r~ aUhiddenUcaptionNU includefiles]r j ah]uh7Kh]ubah ja ubeh j ubj )r }r (hUh}r (h]h]h]h]h]uhjb h]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (U anchornameU#howtosh]h]h]Urefurih"h]h]Uinternaluhj h]r hXHOWTOsr r }r (hUhj ubah j ubah j ubah j ubj )r }r (hUh}r (h]h]h]h]h]uhjb h]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (U anchornameU#indices-and-tablesh]h]h]Urefurih"h]h]Uinternaluhj h]r hXIndices and tablesr r }r (hUhj ubah j ubah j ubah j ubeh ja ubh*j )r }r (hUh}r (h]h]h]h]h]uh]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r (j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (U anchornameUh]h]h]Urefurih*h]h]Uinternaluhj h]r (h/)r }r (hUhj h2Nh h3h}r (h]h]r h6ah]h]h]uh7Nh]r hX1.   r r }r (hUhj ubaubhXZServerSSL-HOWTOr r }r (hUhj ubeh j ubah j ubj )r }r (hUh}r (h]h]h]h]h]uhj h]r (j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (U anchornameU #introductionh]h]h]Urefurih*h]h]Uinternaluhj h]r (h/)r }r (hUhj h2Nh h3h}r (h]h]r h6ah]h]h]uh7Nh]r hX 1.1.   r r }r (hUhj ubaubhX Introductionr r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (U anchornameU #preparationh]h]h]Urefurih*h]h]Uinternaluhj h]r (h/)r }r (hUhj h2Nh h3h}r (h]h]r h6ah]h]h]uh7Nh]r hX 1.2.   r r }r (hUhj ubaubhX Preparationr r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (U anchornameU #installationh]h]h]Urefurih*h]h]Uinternaluhj h]r (h/)r }r (hUhj h2Nh h3h}r (h]h]r h6ah]h]h]uh7Nh]r hX 1.3.   r r }r (hUhj ubaubhX Installationr r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (U anchornameU#testingh]h]h]Urefurih*h]h]Uinternaluhj h]r (h/)r }r (hUhj h2Nh h3h}r (h]h]r h6ah]h]h]uh7Nh]r hX 1.4.   r r }r (hUhj ubaubhXTestingr r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r! }r" (hUh}r# (U anchornameU#httpsh]h]h]Urefurih*h]h]Uinternaluhj h]r$ (h/)r% }r& (hUhj! h2Nh h3h}r' (h]h]r( h6ah]h]h]uh7Nh]r) hX 1.5.   r* r+ }r, (hUhj% ubaubhXHTTPSr- r. }r/ (hUhj! ubeh j ubah j ubah j ubj )r0 }r1 (hUh}r2 (h]h]h]h]h]uhj h]r3 j )r4 }r5 (hUh}r6 (h]h]h]h]h]uhj0 h]r7 j )r8 }r9 (hUh}r: (U anchornameU#webdav-over-httpsh]h]h]Urefurih*h]h]Uinternaluhj4 h]r; (h/)r< }r= (hUhj8 h2Nh h3h}r> (h]h]r? h6ah]h]h]uh7Nh]r@ hX 1.6.   rA rB }rC (hUhj< ubaubhXWebDAV-over-HTTPSrD rE }rF (hUhj8 ubeh j ubah j ubah j ubj )rG }rH (hUh}rI (h]h]h]h]h]uhj h]rJ j )rK }rL (hUh}rM (h]h]h]h]h]uhjG h]rN j )rO }rP (hUh}rQ (U anchornameU#webdav-source-over-httpsh]h]h]Urefurih*h]h]UinternaluhjK h]rR (h/)rS }rT (hUhjO h2Nh h3h}rU (h]h]rV h6ah]h]h]uh7Nh]rW hX 1.7.   rX rY }rZ (hUhjS ubaubhXWebDAV-Source-over-HTTPSr[ r\ }r] (hUhjO ubeh j ubah j ubah j ubj )r^ }r_ (hUh}r` (h]h]h]h]h]uhj h]ra j )rb }rc (hUh}rd (h]h]h]h]h]uhj^ h]re j )rf }rg (hUh}rh (U anchornameU#python-with-m2cryptoh]h]h]Urefurih*h]h]Uinternaluhjb h]ri (h/)rj }rk (hUhjf h2Nh h3h}rl (h]h]rm h6ah]h]h]uh7Nh]rn hX 1.8.   ro rp }rq (hUhjj ubaubhXPython with M2Cryptorr rs }rt (hUhjf ubeh j ubah j ubah j ubj )ru }rv (hUh}rw (h]h]h]h]h]uhj h]rx j )ry }rz (hUh}r{ (h]h]h]h]h]uhju h]r| j )r} }r~ (hUh}r (U anchornameU#id2h]h]h]Urefurih*h]h]Uinternaluhjy h]r (h/)r }r (hUhj} h2Nh h3h}r (h]h]r h6ah]h]h]uh7Nh]r hX 1.9.   r r }r (hUhj ubaubhXHTTPSr r }r (hUhj} ubeh j ubah j ubah j ubj )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (U anchornameU#xmlrpc-over-httpsh]h]h]Urefurih*h]h]Uinternaluhj h]r (h/)r }r (hUhj h2Nh h3h}r (h]h]r h6ah]h]h]uh7Nh]r hX 1.10.   r r }r (hUhj ubaubhXXMLRPC-over-HTTPSr r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (h]h]h]h]h]uhj h]r j )r }r (hUh}r (U anchornameU #conclusionh]h]h]Urefurih*h]h]Uinternaluhj h]r (h/)r }r (hUhj h2Nh h3h}r (h]h]r h6ah]h]h]uh7Nh]r hX 1.11.   r r }r (hUhj ubaubhX Conclusionr r }r (hUhj ubeh j ubah j ubah j ubeh ja ubeh j ubah ja ubh?j )r }r (hUh}r (hC]hD]hE]hF]hG]uh]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r (j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameUUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r hXM2Crypto Packager r }r (hUhj ubah U referencer ubah Ucompact_paragraphr ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r (j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameU#id1Urefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (cdocutils.nodes literal r )r }r (hXM2Cryptoh}r (hC]hD]hE]hF]hG]uhj h]r hXM2Cryptor r }r (hUhj ubah Uliteralr ubhX Packager r }r (hUhj ubeh j ubah j ubah U list_itemr ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.ASN1Urefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hXASN1h}r (hC]hD]hE]hF]hG]uhj h]r hXASN1r r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.AuthCookieUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hX AuthCookieh}r (hC]hD]hE]hF]hG]uhj h]r hX AuthCookier r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r! (hUh}r" (U anchornameX#module-M2Crypto.BIOUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r# (j )r$ }r% (hXBIOh}r& (hC]hD]hE]hF]hG]uhj h]r' hXBIOr( r) }r* (hUhj$ ubah j ubhX Moduler+ r, }r- (hUhj ubeh j ubah j ubah j ubj )r. }r/ (hUh}r0 (hC]hD]hE]hF]hG]uhj h]r1 j )r2 }r3 (hUh}r4 (hC]hD]hE]hF]hG]uhj. h]r5 j )r6 }r7 (hUh}r8 (U anchornameX#module-M2Crypto.BNUrefurih?hF]hE]hC]hD]hG]Uinternaluhj2 h]r9 (j )r: }r; (hXBNh}r< (hC]hD]hE]hF]hG]uhj6 h]r= hXBNr> r? }r@ (hUhj: ubah j ubhX ModulerA rB }rC (hUhj6 ubeh j ubah j ubah j ubj )rD }rE (hUh}rF (hC]hD]hE]hF]hG]uhj h]rG j )rH }rI (hUh}rJ (hC]hD]hE]hF]hG]uhjD h]rK j )rL }rM (hUh}rN (U anchornameX#module-M2Crypto.DHUrefurih?hF]hE]hC]hD]hG]UinternaluhjH h]rO (j )rP }rQ (hXDHh}rR (hC]hD]hE]hF]hG]uhjL h]rS hXDHrT rU }rV (hUhjP ubah j ubhX ModulerW rX }rY (hUhjL ubeh j ubah j ubah j ubj )rZ }r[ (hUh}r\ (hC]hD]hE]hF]hG]uhj h]r] j )r^ }r_ (hUh}r` (hC]hD]hE]hF]hG]uhjZ h]ra j )rb }rc (hUh}rd (U anchornameX#module-M2Crypto.DSAUrefurih?hF]hE]hC]hD]hG]Uinternaluhj^ h]re (j )rf }rg (hXDSAh}rh (hC]hD]hE]hF]hG]uhjb h]ri hXDSArj rk }rl (hUhjf ubah j ubhX Modulerm rn }ro (hUhjb ubeh j ubah j ubah j ubj )rp }rq (hUh}rr (hC]hD]hE]hF]hG]uhj h]rs j )rt }ru (hUh}rv (hC]hD]hE]hF]hG]uhjp h]rw j )rx }ry (hUh}rz (U anchornameX#module-M2Crypto.ECUrefurih?hF]hE]hC]hD]hG]Uinternaluhjt h]r{ (j )r| }r} (hXECh}r~ (hC]hD]hE]hF]hG]uhjx h]r hXECr r }r (hUhj| ubah j ubhX Moduler r }r (hUhjx ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.EVPUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hXEVPh}r (hC]hD]hE]hF]hG]uhj h]r hXEVPr r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.EngineUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hXEngineh}r (hC]hD]hE]hF]hG]uhj h]r hXEnginer r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.ErrUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hXErrh}r (hC]hD]hE]hF]hG]uhj h]r hXErrr r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.RC4Urefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hXRC4h}r (hC]hD]hE]hF]hG]uhj h]r hXRC4r r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.RSAUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hXRSAh}r (hC]hD]hE]hF]hG]uhj h]r hXRSAr r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.RandUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hXRandh}r (hC]hD]hE]hF]hG]uhj h]r hXRandr r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.SMIMEUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hXSMIMEh}r (hC]hD]hE]hF]hG]uhj h]r hXSMIMEr r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r! (hUh}r" (hC]hD]hE]hF]hG]uhj h]r# j )r$ }r% (hUh}r& (hC]hD]hE]hF]hG]uhj h]r' j )r( }r) (hUh}r* (U anchornameX#module-M2Crypto.X509Urefurih?hF]hE]hC]hD]hG]Uinternaluhj$ h]r+ (j )r, }r- (hXX509h}r. (hC]hD]hE]hF]hG]uhj( h]r/ hXX509r0 r1 }r2 (hUhj, ubah j ubhX Moduler3 r4 }r5 (hUhj( ubeh j ubah j ubah j ubj )r6 }r7 (hUh}r8 (hC]hD]hE]hF]hG]uhj h]r9 j )r: }r; (hUh}r< (hC]hD]hE]hF]hG]uhj6 h]r= j )r> }r? (hUh}r@ (U anchornameX#module-M2Crypto.callbackUrefurih?hF]hE]hC]hD]hG]Uinternaluhj: h]rA (j )rB }rC (hXcallbackh}rD (hC]hD]hE]hF]hG]uhj> h]rE hXcallbackrF rG }rH (hUhjB ubah j ubhX ModulerI rJ }rK (hUhj> ubeh j ubah j ubah j ubj )rL }rM (hUh}rN (hC]hD]hE]hF]hG]uhj h]rO j )rP }rQ (hUh}rR (hC]hD]hE]hF]hG]uhjL h]rS j )rT }rU (hUh}rV (U anchornameX#module-M2Crypto.ftpslibUrefurih?hF]hE]hC]hD]hG]UinternaluhjP h]rW (j )rX }rY (hXftpslibh}rZ (hC]hD]hE]hF]hG]uhjT h]r[ hXftpslibr\ r] }r^ (hUhjX ubah j ubhX Moduler_ r` }ra (hUhjT ubeh j ubah j ubah j ubj )rb }rc (hUh}rd (hC]hD]hE]hF]hG]uhj h]re j )rf }rg (hUh}rh (hC]hD]hE]hF]hG]uhjb h]ri j )rj }rk (hUh}rl (U anchornameX#module-M2Crypto.httpslibUrefurih?hF]hE]hC]hD]hG]Uinternaluhjf h]rm (j )rn }ro (hXhttpslibh}rp (hC]hD]hE]hF]hG]uhjj h]rq hXhttpslibrr rs }rt (hUhjn ubah j ubhX Moduleru rv }rw (hUhjj ubeh j ubah j ubah j ubj )rx }ry (hUh}rz (hC]hD]hE]hF]hG]uhj h]r{ j )r| }r} (hUh}r~ (hC]hD]hE]hF]hG]uhjx h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.m2Urefurih?hF]hE]hC]hD]hG]Uinternaluhj| h]r (j )r }r (hXm2h}r (hC]hD]hE]hF]hG]uhj h]r hXm2r r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.m2cryptoUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hXm2cryptoh}r (hC]hD]hE]hF]hG]uhj h]r hXm2cryptor r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.m2urllibUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hXm2urllibh}r (hC]hD]hE]hF]hG]uhj h]r hXm2urllibr r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.m2urllib2Urefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hX m2urllib2h}r (hC]hD]hE]hF]hG]uhj h]r hX m2urllib2r r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.m2xmlrpclibUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hX m2xmlrpclibh}r (hC]hD]hE]hF]hG]uhj h]r hX m2xmlrpclibr r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r }r (hUh}r (U anchornameX#module-M2Crypto.threadingUrefurih?hF]hE]hC]hD]hG]Uinternaluhj h]r (j )r }r (hX threadingh}r (hC]hD]hE]hF]hG]uhj h]r hX threadingr r }r (hUhj ubah j ubhX Moduler r }r (hUhj ubeh j ubah j ubah j ubj )r }r (hUh}r (hC]hD]hE]hF]hG]uhj h]r j )r}r(hUh}r(hC]hD]hE]hF]hG]uhj h]rj )r}r(hUh}r(U anchornameX#module-M2Crypto.utilUrefurih?hF]hE]hC]hD]hG]Uinternaluhjh]r(j )r}r (hXutilh}r (hC]hD]hE]hF]hG]uhjh]r hXutilr r }r(hUhjubah j ubhX Modulerr}r(hUhjubeh j ubah j ubah j ubj )r}r(hUh}r(hC]hD]hE]hF]hG]uhj h]r(j )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(U anchornameU #subpackagesUrefurih?hF]hE]hC]hD]hG]Uinternaluhjh]rhX Subpackagesrr}r (hUhjubah j ubah j ubj )r!}r"(hUh}r#(hC]hD]hE]hF]hG]uhjh]r$jy )r%}r&(hUhj!h2X+/home/matej/Build/m2crypto/doc/M2Crypto.rsth Utoctreer'h}r((UnumberedKUparenth?U titlesonlyUmaxdepthJUglobhF]hE]hC]hD]hG]Uentries]r)Nj r*aUhiddenUcaptionNU includefiles]r+j aU includehiddenuh7Kh]ubah U bullet_listr,ubeh j ubeh j,ubeh j ubah j,ubhMj )r-}r.(hUh}r/(h]h]h]h]h]uh]r0j )r1}r2(hUh}r3(h]h]h]h]h]uhj-h]r4(j )r5}r6(hUh}r7(h]h]h]h]h]uhj1h]r8j )r9}r:(hUh}r;(U anchornameUh]h]h]UrefurihMh]h]Uinternaluhj5h]r<hX(HOWTO: Creating your own CA with OpenSSLr=r>}r?(hUhj9ubah j ubah j ubj )r@}rA(hUh}rB(h]h]h]h]h]uhj1h]rC(j )rD}rE(hUh}rF(h]h]h]h]h]uhj@h]rGj )rH}rI(hUh}rJ(h]h]h]h]h]uhjDh]rKj )rL}rM(hUh}rN(U anchornameU #introductionh]h]h]UrefurihMh]h]UinternaluhjHh]rOhX IntroductionrPrQ}rR(hUhjLubah j ubah j ubah j ubj )rS}rT(hUh}rU(h]h]h]h]h]uhj@h]rVj )rW}rX(hUh}rY(h]h]h]h]h]uhjSh]rZj )r[}r\(hUh}r](U anchornameU#the-procedureh]h]h]UrefurihMh]h]UinternaluhjWh]r^hX The Procedurer_r`}ra(hUhj[ubah j ubah j ubah j ubj )rb}rc(hUh}rd(h]h]h]h]h]uhj@h]rej )rf}rg(hUh}rh(h]h]h]h]h]uhjbh]rij )rj}rk(hUh}rl(U anchornameU #conclusionh]h]h]UrefurihMh]h]Uinternaluhjfh]rmhX Conclusionrnro}rp(hUhjjubah j ubah j ubah j ubeh ja ubeh j ubah ja ubhUj )rq}rr(hUh}rs(hC]hD]hE]hF]hG]uh]rtj )ru}rv(hUh}rw(hC]hD]hE]hF]hG]uhjqh]rx(j )ry}rz(hUh}r{(hC]hD]hE]hF]hG]uhjuh]r|j )r}}r~(hUh}r(U anchornameUUrefurihUhF]hE]hC]hD]hG]Uinternaluhjyh]rhX SSL Packagerr}r(hUhj}ubah j ubah j ubj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjuh]r(j )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(U anchornameU#id1UrefurihUhF]hE]hC]hD]hG]Uinternaluhjh]r(j )r}r(hXSSLh}r(hC]hD]hE]hF]hG]uhjh]rhXSSLrr}r(hUhjubah j ubhX Packagerr}r(hUhjubeh j ubah j ubah j ubj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(U anchornameX#module-M2Crypto.SSL.CheckerUrefurihUhF]hE]hC]hD]hG]Uinternaluhjh]r(j )r}r(hXCheckerh}r(hC]hD]hE]hF]hG]uhjh]rhXCheckerrr}r(hUhjubah j ubhX Modulerr}r(hUhjubeh j ubah j ubah j ubj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(U anchornameX#module-M2Crypto.SSL.CipherUrefurihUhF]hE]hC]hD]hG]Uinternaluhjh]r(j )r}r(hXCipherh}r(hC]hD]hE]hF]hG]uhjh]rhXCipherrr}r(hUhjubah j ubhX Modulerr}r(hUhjubeh j ubah j ubah j ubj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(U anchornameX#module-M2Crypto.SSL.ConnectionUrefurihUhF]hE]hC]hD]hG]Uinternaluhjh]r(j )r}r(hX Connectionh}r(hC]hD]hE]hF]hG]uhjh]rhX Connectionrr}r(hUhjubah j ubhX Modulerr}r(hUhjubeh j ubah j ubah j ubj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(U anchornameX#module-M2Crypto.SSL.ContextUrefurihUhF]hE]hC]hD]hG]Uinternaluhjh]r(j )r}r(hXContexth}r(hC]hD]hE]hF]hG]uhjh]rhXContextrr}r(hUhjubah j ubhX Modulerr}r(hUhjubeh j ubah j ubah j ubj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(U anchornameX#module-M2Crypto.SSL.SSLServerUrefurihUhF]hE]hC]hD]hG]Uinternaluhjh]r(j )r}r(hX SSLServerh}r(hC]hD]hE]hF]hG]uhjh]rhX SSLServerrr}r(hUhjubah j ubhX Moduler r }r (hUhjubeh j ubah j ubah j ubj )r }r (hUh}r(hC]hD]hE]hF]hG]uhjh]rj )r}r(hUh}r(hC]hD]hE]hF]hG]uhj h]rj )r}r(hUh}r(U anchornameX#module-M2Crypto.SSL.SessionUrefurihUhF]hE]hC]hD]hG]Uinternaluhjh]r(j )r}r(hXSessionh}r(hC]hD]hE]hF]hG]uhjh]rhXSessionrr}r(hUhjubah j ubhX Modulerr }r!(hUhjubeh j ubah j ubah j ubj )r"}r#(hUh}r$(hC]hD]hE]hF]hG]uhjh]r%j )r&}r'(hUh}r((hC]hD]hE]hF]hG]uhj"h]r)j )r*}r+(hUh}r,(U anchornameX+#module-M2Crypto.SSL.TwistedProtocolWrapperUrefurihUhF]hE]hC]hD]hG]Uinternaluhj&h]r-(j )r.}r/(hXTwistedProtocolWrapperh}r0(hC]hD]hE]hF]hG]uhj*h]r1hXTwistedProtocolWrapperr2r3}r4(hUhj.ubah j ubhX Moduler5r6}r7(hUhj*ubeh j ubah j ubah j ubj )r8}r9(hUh}r:(hC]hD]hE]hF]hG]uhjh]r;j )r<}r=(hUh}r>(hC]hD]hE]hF]hG]uhj8h]r?j )r@}rA(hUh}rB(U anchornameX#module-M2Crypto.SSL.cbUrefurihUhF]hE]hC]hD]hG]Uinternaluhj<h]rC(j )rD}rE(hXcbh}rF(hC]hD]hE]hF]hG]uhj@h]rGhXcbrHrI}rJ(hUhjDubah j ubhX ModulerKrL}rM(hUhj@ubeh j ubah j ubah j ubj )rN}rO(hUh}rP(hC]hD]hE]hF]hG]uhjh]rQj )rR}rS(hUh}rT(hC]hD]hE]hF]hG]uhjNh]rUj )rV}rW(hUh}rX(U anchornameX##module-M2Crypto.SSL.ssl_dispatcherUrefurihUhF]hE]hC]hD]hG]UinternaluhjRh]rY(j )rZ}r[(hXssl_dispatcherh}r\(hC]hD]hE]hF]hG]uhjVh]r]hXssl_dispatcherr^r_}r`(hUhjZubah j ubhX Modulerarb}rc(hUhjVubeh j ubah j ubah j ubj )rd}re(hUh}rf(hC]hD]hE]hF]hG]uhjh]rgj )rh}ri(hUh}rj(hC]hD]hE]hF]hG]uhjdh]rkj )rl}rm(hUh}rn(U anchornameX#module-M2Crypto.SSL.timeoutUrefurihUhF]hE]hC]hD]hG]Uinternaluhjhh]ro(j )rp}rq(hXtimeouth}rr(hC]hD]hE]hF]hG]uhjlh]rshXtimeoutrtru}rv(hUhjpubah j ubhX Modulerwrx}ry(hUhjlubeh j ubah j ubah j ubeh j,ubeh j ubah j,ubh]j )rz}r{(hUh}r|(h]h]h]h]h]uh]r}(j )r~}r(hUh}r(h]h]h]h]h]uhjzh]rj )r}r(hUh}r(h]h]h]h]h]uhj~h]rj )r}r(hUh}r(U anchornameUh]h]h]Urefurih]h]h]Uinternaluhjh]rhX1HOWTO: Programming S/MIME in Python with M2Cryptorr}r(hUhjubah j ubah j ubah j ubj )r}r(hUh}r(h]h]h]h]h]uhjzh]rj )r}r(hUh}r(h]h]h]h]h]uhjh]rj )r}r(hUh}r(U anchornameU #introductionh]h]h]Urefurih]h]h]Uinternaluhjh]rhX Introductionrr}r(hUhjubah j ubah j ubah j ubj )r}r(hUh}r(h]h]h]h]h]uhjzh]rj )r}r(hUh}r(h]h]h]h]h]uhjh]rj )r}r(hUh}r(U anchornameU#s-mimeh]h]h]Urefurih]h]h]Uinternaluhjh]rhXS/MIMErr}r(hUhjubah j ubah j ubah j ubj )r}r(hUh}r(h]h]h]h]h]uhjzh]rj )r}r(hUh}r(h]h]h]h]h]uhjh]rj )r}r(hUh}r(U anchornameU#keys-and-certificatesh]h]h]Urefurih]h]h]Uinternaluhjh]rhXKeys and Certificatesrr}r(hUhjubah j ubah j ubah j ubj )r}r(hUh}r(h]h]h]h]h]uhjzh]rj )r}r(hUh}r(h]h]h]h]h]uhjh]rj )r}r(hUh}r(U anchornameU#m2crypto-smimeh]h]h]Urefurih]h]h]Uinternaluhjh]rhXM2Crypto.SMIMErr}r(hUhjubah j ubah j ubah j ubj )r}r(hUh}r(h]h]h]h]h]uhjzh]rj )r}r(hUh}r(h]h]h]h]h]uhjh]rj )r}r(hUh}r(U anchornameU#signh]h]h]Urefurih]h]h]Uinternaluhjh]rhXSignrr}r(hUhjubah j ubah j ubah j ubj )r}r(hUh}r(h]h]h]h]h]uhjzh]rj )r}r(hUh}r(h]h]h]h]h]uhjh]rj )r}r(hUh}r(U anchornameU#verifyh]h]h]Urefurih]h]h]Uinternaluhjh]rhXVerifyrr}r(hUhjubah j ubah j ubah j ubj )r}r(hUh}r(h]h]h]h]h]uhjzh]rj )r}r(hUh}r(h]h]h]h]h]uhjh]rj )r}r(hUh}r(U anchornameU#encrypth]h]h]Urefurih]h]h]Uinternaluhjh]rhXEncryptrr}r(hUhjubah j ubah j ubah j ubj )r}r(hUh}r(h]h]h]h]h]uhjzh]rj )r}r(hUh}r(h]h]h]h]h]uhjh]rj )r}r(hUh}r(U anchornameU#decrypth]h]h]Urefurih]h]h]Uinternaluhjh]rhXDecryptrr}r(hUhjubah j ubah j ubah j ubj )r}r(hUh}r(h]h]h]h]h]uhjzh]rj )r }r (hUh}r (h]h]h]h]h]uhjh]r j )r }r(hUh}r(U anchornameU#sign-and-encrypth]h]h]Urefurih]h]h]Uinternaluhj h]rhXSign and Encryptrr}r(hUhj ubah j ubah j ubah j ubj )r}r(hUh}r(h]h]h]h]h]uhjzh]rj )r}r(hUh}r(h]h]h]h]h]uhjh]rj )r}r(hUh}r(U anchornameU#decrypt-and-verifyh]h]h]Urefurih]h]h]Uinternaluhjh]rhXDecrypt and Verifyr r!}r"(hUhjubah j ubah j ubah j ubj )r#}r$(hUh}r%(h]h]h]h]h]uhjzh]r&j )r'}r((hUh}r)(h]h]h]h]h]uhj#h]r*j )r+}r,(hUh}r-(U anchornameU!#sending-s-mime-messages-via-smtph]h]h]Urefurih]h]h]Uinternaluhj'h]r.hX Sending S/MIME messages via SMTPr/r0}r1(hUhj+ubah j ubah j ubah j ubj )r2}r3(hUh}r4(h]h]h]h]h]uhjzh]r5j )r6}r7(hUh}r8(h]h]h]h]h]uhj2h]r9j )r:}r;(hUh}r<(U anchornameU$#verifying-origin-of-s-mime-messagesh]h]h]Urefurih]h]h]Uinternaluhj6h]r=hX#Verifying origin of S/MIME messagesr>r?}r@(hUhj:ubah j ubah j ubah j ubj )rA}rB(hUh}rC(h]h]h]h]h]uhjzh]rDj )rE}rF(hUh}rG(h]h]h]h]h]uhjAh]rHj )rI}rJ(hUh}rK(U anchornameU'#interoperating-with-netscape-messengerh]h]h]Urefurih]h]h]UinternaluhjEh]rLhX&Interoperating with Netscape MessengerrMrN}rO(hUhjIubah j ubah j ubah j ubj )rP}rQ(hUh}rR(h]h]h]h]h]uhjzh]rSj )rT}rU(hUh}rV(h]h]h]h]h]uhjPh]rWj )rX}rY(hUh}rZ(U anchornameU&#interoperating-with-microsoft-outlookh]h]h]Urefurih]h]h]UinternaluhjTh]r[hX%Interoperating with Microsoft Outlookr\r]}r^(hUhjXubah j ubah j ubah j ubj )r_}r`(hUh}ra(h]h]h]h]h]uhjzh]rbj )rc}rd(hUh}re(h]h]h]h]h]uhj_h]rfj )rg}rh(hUh}ri(U anchornameU#zsmimeh]h]h]Urefurih]h]h]Uinternaluhjch]rjhXZSmimerkrl}rm(hUhjgubah j ubah j ubah j ubj )rn}ro(hUh}rp(h]h]h]h]h]uhjzh]rqj )rr}rs(hUh}rt(h]h]h]h]h]uhjnh]ruj )rv}rw(hUh}rx(U anchornameU #resourcesh]h]h]Urefurih]h]h]Uinternaluhjrh]ryhX Resourcesrzr{}r|(hUhjvubah j ubah j ubah j ubeh ja ubuU indexentriesr}}r~(h ]h"]h*]h?]r((UsinglerXM2Crypto.__init__ (module)Xmodule-M2Crypto.__init__UNtr(jXM2Crypto.ASN1 (module)Xmodule-M2Crypto.ASN1UNtr(jX%ASN1_Integer (class in M2Crypto.ASN1)jUNtr(jX:m2_asn1_integer_free() (M2Crypto.ASN1.ASN1_Integer method)j6UNtr(jX$ASN1_Object (class in M2Crypto.ASN1)jUNtr(jX8m2_asn1_object_free() (M2Crypto.ASN1.ASN1_Object method)jUNtr(jX$ASN1_String (class in M2Crypto.ASN1)jUNtr(jX,as_text() (M2Crypto.ASN1.ASN1_String method)j+UNtr(jX8m2_asn1_string_free() (M2Crypto.ASN1.ASN1_String method)jUNtr(jX"ASN1_TIME (class in M2Crypto.ASN1)jXUNtr(jX/get_datetime() (M2Crypto.ASN1.ASN1_TIME method)jUNtr(jX4m2_asn1_time_free() (M2Crypto.ASN1.ASN1_TIME method)jUNtr(jX/set_datetime() (M2Crypto.ASN1.ASN1_TIME method)j^UNtr(jX-set_string() (M2Crypto.ASN1.ASN1_TIME method)jfUNtr(jX+set_time() (M2Crypto.ASN1.ASN1_TIME method)jUNtr(jX&ASN1_UTCTIME (in module M2Crypto.ASN1)jUNtr(jX&LocalTimezone (class in M2Crypto.ASN1)jUNtr(jX*dst() (M2Crypto.ASN1.LocalTimezone method)jbUNtr(jX-tzname() (M2Crypto.ASN1.LocalTimezone method)hUNtr(jX0utcoffset() (M2Crypto.ASN1.LocalTimezone method)j.UNtr(jXM2Crypto.AuthCookie (module)Xmodule-M2Crypto.AuthCookieUNtr(jX)AuthCookie (class in M2Crypto.AuthCookie)hUNtr(jX.data() (M2Crypto.AuthCookie.AuthCookie method)jUNtr(jX0expiry() (M2Crypto.AuthCookie.AuthCookie method)j?UNtr(jX5headerValue() (M2Crypto.AuthCookie.AuthCookie method)jUNtr(jX3isExpired() (M2Crypto.AuthCookie.AuthCookie method)jUNtr(jX-mac() (M2Crypto.AuthCookie.AuthCookie method)jUNtr(jX.name() (M2Crypto.AuthCookie.AuthCookie method)jmUNtr(jX0output() (M2Crypto.AuthCookie.AuthCookie method)jUNtr(jX/value() (M2Crypto.AuthCookie.AuthCookie method)jUNtr(jX,AuthCookieJar (class in M2Crypto.AuthCookie)jUNtr(jX9isGoodCookie() (M2Crypto.AuthCookie.AuthCookieJar method)jUNtr(jX?isGoodCookieString() (M2Crypto.AuthCookie.AuthCookieJar method)jUUNtr(jX7makeCookie() (M2Crypto.AuthCookie.AuthCookieJar method)j}UNtr(jX%mix() (in module M2Crypto.AuthCookie)hUNtr(jX'unmix() (in module M2Crypto.AuthCookie)jUNtr(jX(unmix3() (in module M2Crypto.AuthCookie)j0UNtr(jXM2Crypto.BIO (module)Xmodule-M2Crypto.BIOUNtr(jXBIO (class in M2Crypto.BIO)jUNtr(jX#bio_ptr() (M2Crypto.BIO.BIO method)hUNtr(jX!close() (M2Crypto.BIO.BIO method)jpUNtr(jX"fileno() (M2Crypto.BIO.BIO method)jUNtr(jX!flush() (M2Crypto.BIO.BIO method)jUNtr(jX'm2_bio_free() (M2Crypto.BIO.BIO method)j#UNtr(jX read() (M2Crypto.BIO.BIO method)jUNtr(jX$readable() (M2Crypto.BIO.BIO method)j7UNtr(jX$readline() (M2Crypto.BIO.BIO method)jUNtr(jX%readlines() (M2Crypto.BIO.BIO method)j*UNtr(jX!reset() (M2Crypto.BIO.BIO method)jUNtr(jX seek() (M2Crypto.BIO.BIO method)jXUNtr(jX'should_read() (M2Crypto.BIO.BIO method)jeUNtr(jX(should_retry() (M2Crypto.BIO.BIO method)hUNtr(jX(should_write() (M2Crypto.BIO.BIO method)j\UNtr(jX tell() (M2Crypto.BIO.BIO method)jZUNtr(jX!write() (M2Crypto.BIO.BIO method)jUNtr(jX'write_close() (M2Crypto.BIO.BIO method)hUNtr(jX%writeable() (M2Crypto.BIO.BIO method)j>UNtr(jj!jUNtr(jX$CipherStream (class in M2Crypto.BIO)jUNtr(jX.SALT_LEN (M2Crypto.BIO.CipherStream attribute)j=UNtr(jX*close() (M2Crypto.BIO.CipherStream method)jUNtr(jX0m2_bio_free() (M2Crypto.BIO.CipherStream method)jUNtr(jX/m2_bio_pop() (M2Crypto.BIO.CipherStream method)jUNtr(jX/set_cipher() (M2Crypto.BIO.CipherStream method)jUNtr(jX0write_close() (M2Crypto.BIO.CipherStream method)jUNtr(jXFile (class in M2Crypto.BIO)jUNtr(jX"close() (M2Crypto.BIO.File method)jUNtr(jX"flush() (M2Crypto.BIO.File method)jUNtr(jX"reset() (M2Crypto.BIO.File method)jCUNtr(jX IOBuffer (class in M2Crypto.BIO)jUNtr(jX&close() (M2Crypto.BIO.IOBuffer method)jUNtr(jX,m2_bio_free() (M2Crypto.BIO.IOBuffer method)jUNtr(jX+m2_bio_pop() (M2Crypto.BIO.IOBuffer method)jUNtr(jX$MemoryBuffer (class in M2Crypto.BIO)jlUNtr(jX*close() (M2Crypto.BIO.MemoryBuffer method)jUNtr(jX-getvalue() (M2Crypto.BIO.MemoryBuffer method)j5UNtr(jX)read() (M2Crypto.BIO.MemoryBuffer method)jBUNtr(jX-read_all() (M2Crypto.BIO.MemoryBuffer method)jqUNtr(jX0write_close() (M2Crypto.BIO.MemoryBuffer method)jUNtr(jXSSLBio (class in M2Crypto.BIO)jUNtr(jX+do_handshake() (M2Crypto.BIO.SSLBio method)jUNtr(jX&set_ssl() (M2Crypto.BIO.SSLBio method)jwUNtr(jX#openfile() (in module M2Crypto.BIO)hUNtr(jXM2Crypto.BN (module)Xmodule-M2Crypto.BNUNtr(jXrand() (in module M2Crypto.BN)jUNtr(jX$rand_range() (in module M2Crypto.BN)jUNtr(jX#randfname() (in module M2Crypto.BN)j9UNtr(jXM2Crypto.DH (module)Xmodule-M2Crypto.DHUNtr(jXDH (class in M2Crypto.DH)jUNtr(jX&check_params() (M2Crypto.DH.DH method)jUNtr(jX%compute_key() (M2Crypto.DH.DH method)j7UNtr(jX!gen_key() (M2Crypto.DH.DH method)j`UNtr(jX$m2_dh_free() (M2Crypto.DH.DH method)j&UNtr(jX&print_params() (M2Crypto.DH.DH method)jiUNtr(jjjUNtr(jX$gen_params() (in module M2Crypto.DH)jUNtr(jX%load_params() (in module M2Crypto.DH)jkUNtr(jX)load_params_bio() (in module M2Crypto.DH)jUNtr(jX$set_params() (in module M2Crypto.DH)jUNtr(jXM2Crypto.DSA (module)Xmodule-M2Crypto.DSAUNtr(jXDSA (class in M2Crypto.DSA)jPUNtr(jX%check_key() (M2Crypto.DSA.DSA method)jUNtr(jX#gen_key() (M2Crypto.DSA.DSA method)j UNtr(jX'm2_dsa_free() (M2Crypto.DSA.DSA method)j&UNtr(jX$save_key() (M2Crypto.DSA.DSA method)jUNtr(jX(save_key_bio() (M2Crypto.DSA.DSA method)jKUNtr(jX'save_params() (M2Crypto.DSA.DSA method)jUNtr(jX+save_params_bio() (M2Crypto.DSA.DSA method)jUNtr(jX(save_pub_key() (M2Crypto.DSA.DSA method)jUNtr(jX,save_pub_key_bio() (M2Crypto.DSA.DSA method)jUNtr(jX&set_params() (M2Crypto.DSA.DSA method)jmUNtr(jX sign() (M2Crypto.DSA.DSA method)jGUNtr(jX%sign_asn1() (M2Crypto.DSA.DSA method)jUNtr(jX"verify() (M2Crypto.DSA.DSA method)jUNtr(jX'verify_asn1() (M2Crypto.DSA.DSA method)j(UNtr(jjjUNtr(jXDSA_pub (class in M2Crypto.DSA)j>UNtr(jX)check_key() (M2Crypto.DSA.DSA_pub method)j UNtr(jX(save_key() (M2Crypto.DSA.DSA_pub method)j UNtr(jX,save_key_bio() (M2Crypto.DSA.DSA_pub method)jUNtr(jX$sign() (M2Crypto.DSA.DSA_pub method)hUNtr(jX)sign_asn1() (M2Crypto.DSA.DSA_pub method)hUNtr(jX%gen_params() (in module M2Crypto.DSA)jUNtr(jX#load_key() (in module M2Crypto.DSA)jUNtr(jX'load_key_bio() (in module M2Crypto.DSA)jUNtr(jX&load_params() (in module M2Crypto.DSA)jUNtr(jX*load_params_bio() (in module M2Crypto.DSA)jUNtr(jX'load_pub_key() (in module M2Crypto.DSA)jUNtr(jX+load_pub_key_bio() (in module M2Crypto.DSA)jSUNtr(jX.pub_key_from_params() (in module M2Crypto.DSA)jDUNtr(jX%set_params() (in module M2Crypto.DSA)jUNtr(jXM2Crypto.EC (module)Xmodule-M2Crypto.ECUNtr(jXEC (class in M2Crypto.EC)hUNtr(jX as_pem() (M2Crypto.EC.EC method)jQUNtr(jX#check_key() (M2Crypto.EC.EC method)jBUNtr(jX(compute_dh_key() (M2Crypto.EC.EC method)jUNtr(jX!gen_key() (M2Crypto.EC.EC method)jUNtr (jX(m2_ec_key_free() (M2Crypto.EC.EC method)j/UNtr (jXpub() (M2Crypto.EC.EC method)hUNtr (jX"save_key() (M2Crypto.EC.EC method)jUNtr (jX&save_key_bio() (M2Crypto.EC.EC method)jUNtr (jX&save_pub_key() (M2Crypto.EC.EC method)jUNtr(jX*save_pub_key_bio() (M2Crypto.EC.EC method)hUNtr(jX"sign_dsa() (M2Crypto.EC.EC method)hUNtr(jX'sign_dsa_asn1() (M2Crypto.EC.EC method)j,UNtr(jX$verify_dsa() (M2Crypto.EC.EC method)jUNtr(jX)verify_dsa_asn1() (M2Crypto.EC.EC method)hUNtr(jjj+UNtr(jXEC_pub (class in M2Crypto.EC)jUNtr(jX%get_der() (M2Crypto.EC.EC_pub method)jUNtr(jX%get_key() (M2Crypto.EC.EC_pub method)jvUNtr(jX&save_key() (M2Crypto.EC.EC_pub method)jUNtr(jX*save_key_bio() (M2Crypto.EC.EC_pub method)jxUNtr(jX"ec_error() (in module M2Crypto.EC)jCUNtr(jX$gen_params() (in module M2Crypto.EC)jUNtr(jX,get_builtin_curves() (in module M2Crypto.EC)jUNtr(jX"load_key() (in module M2Crypto.EC)j~UNtr(jX&load_key_bio() (in module M2Crypto.EC)jUNtr(jX)load_key_string() (in module M2Crypto.EC)jDUNtr(jX0load_key_string_pubkey() (in module M2Crypto.EC)hUNtr (jX&load_pub_key() (in module M2Crypto.EC)hUNtr!(jX*load_pub_key_bio() (in module M2Crypto.EC)jUNtr"(jX*pub_key_from_der() (in module M2Crypto.EC)jUNtr#(jX-pub_key_from_params() (in module M2Crypto.EC)hUNtr$(jXM2Crypto.EVP (module)Xmodule-M2Crypto.EVPUNtr%(jXCipher (class in M2Crypto.EVP)jiUNtr&(jX$final() (M2Crypto.EVP.Cipher method)jUNtr'(jX1m2_cipher_ctx_free() (M2Crypto.EVP.Cipher method)hUNtr((jX*set_padding() (M2Crypto.EVP.Cipher method)j<UNtr)(jX%update() (M2Crypto.EVP.Cipher method)jlUNtr*(jjI jyUNtr+(jXHMAC (class in M2Crypto.EVP)j-UNtr,(jX#digest() (M2Crypto.EVP.HMAC method)jUNtr-(jX"final() (M2Crypto.EVP.HMAC method)jOUNtr.(jX-m2_hmac_ctx_free() (M2Crypto.EVP.HMAC method)jeUNtr/(jX"reset() (M2Crypto.EVP.HMAC method)jUNtr0(jX#update() (M2Crypto.EVP.HMAC method)jwUNtr1(jX%MessageDigest (class in M2Crypto.EVP)jKUNtr2(jX,digest() (M2Crypto.EVP.MessageDigest method)jUNtr3(jX+final() (M2Crypto.EVP.MessageDigest method)jUNtr4(jX4m2_md_ctx_free() (M2Crypto.EVP.MessageDigest method)jUNtr5(jX,update() (M2Crypto.EVP.MessageDigest method)hUNtr6(jXPKey (class in M2Crypto.EVP)jUNtr7(jX#as_der() (M2Crypto.EVP.PKey method)hUNtr8(jX#as_pem() (M2Crypto.EVP.PKey method)jHUNtr9(jX'assign_rsa() (M2Crypto.EVP.PKey method)hUNtr:(jX"final() (M2Crypto.EVP.PKey method)j'UNtr;(jX(get_modulus() (M2Crypto.EVP.PKey method)j<UNtr<(jX$get_rsa() (M2Crypto.EVP.PKey method)j]UNtr=(jX+m2_md_ctx_free() (M2Crypto.EVP.PKey method)j'UNtr>(jX)m2_pkey_free() (M2Crypto.EVP.PKey method)jUNtr?(jX*reset_context() (M2Crypto.EVP.PKey method)hUNtr@(jX%save_key() (M2Crypto.EVP.PKey method)hUNtrA(jX)save_key_bio() (M2Crypto.EVP.PKey method)jUNtrB(jX'sign_final() (M2Crypto.EVP.PKey method)jUNtrC(jX&sign_init() (M2Crypto.EVP.PKey method)jUNtrD(jX(sign_update() (M2Crypto.EVP.PKey method)j9UNtrE(jX!size() (M2Crypto.EVP.PKey method)jdUNtrF(jX#update() (M2Crypto.EVP.PKey method)jUNtrG(jX)verify_final() (M2Crypto.EVP.PKey method)jjUNtrH(jX(verify_init() (M2Crypto.EVP.PKey method)j UNtrI(jX*verify_update() (M2Crypto.EVP.PKey method)jKUNtrJ(jXhmac() (in module M2Crypto.EVP)jUNtrK(jX#load_key() (in module M2Crypto.EVP)jUNtrL(jX'load_key_bio() (in module M2Crypto.EVP)j_UNtrM(jX.load_key_bio_pubkey() (in module M2Crypto.EVP)jUNtrN(jX*load_key_string() (in module M2Crypto.EVP)jUNtrO(jX1load_key_string_pubkey() (in module M2Crypto.EVP)jUNtrP(jX!pbkdf2() (in module M2Crypto.EVP)jPUNtrQ(jXM2Crypto.Engine (module)Xmodule-M2Crypto.EngineUNtrR(jX!Engine (class in M2Crypto.Engine)jUNtrS(jX1ctrl_cmd_string() (M2Crypto.Engine.Engine method)jUNtrT(jX(finish() (M2Crypto.Engine.Engine method)jUNtrU(jX(get_id() (M2Crypto.Engine.Engine method)jvUNtrV(jX*get_name() (M2Crypto.Engine.Engine method)jUNtrW(jX&init() (M2Crypto.Engine.Engine method)jUNtrX(jX2load_certificate() (M2Crypto.Engine.Engine method)jUNtrY(jX2load_private_key() (M2Crypto.Engine.Engine method)jUNtrZ(jX1load_public_key() (M2Crypto.Engine.Engine method)jCUNtr[(jX0m2_engine_free() (M2Crypto.Engine.Engine method)j)UNtr\(jX-set_default() (M2Crypto.Engine.Engine method)jUNtr](jjj UNtr^(jX%cleanup() (in module M2Crypto.Engine)jUNtr_(jX*load_dynamic() (in module M2Crypto.Engine)jUNtr`(jX1load_dynamic_engine() (in module M2Crypto.Engine)jUNtra(jX*load_openssl() (in module M2Crypto.Engine)jUNtrb(jXM2Crypto.Err (module)Xmodule-M2Crypto.ErrUNtrc(jjkjUNtrd(jjljUNtre(jX$get_error() (in module M2Crypto.Err)jUNtrf(jX)get_error_code() (in module M2Crypto.Err)j UNtrg(jX)get_error_func() (in module M2Crypto.Err)j UNtrh(jX(get_error_lib() (in module M2Crypto.Err)jUNtri(jX,get_error_message() (in module M2Crypto.Err)jUNtrj(jX+get_error_reason() (in module M2Crypto.Err)jUNtrk(jX0get_x509_verify_error() (in module M2Crypto.Err)j"UNtrl(jX*peek_error_code() (in module M2Crypto.Err)jUNtrm(jXM2Crypto.RC4 (module)Xmodule-M2Crypto.RC4UNtrn(jXRC4 (class in M2Crypto.RC4)j1UNtro(jX!final() (M2Crypto.RC4.RC4 method)j/UNtrp(jX$rc4_free() (M2Crypto.RC4.RC4 method)j|UNtrq(jX#set_key() (M2Crypto.RC4.RC4 method)jfUNtrr(jX"update() (M2Crypto.RC4.RC4 method)jUNtrs(jXM2Crypto.RSA (module)Xmodule-M2Crypto.RSAUNtrt(jXRSA (class in M2Crypto.RSA)hUNtru(jX"as_pem() (M2Crypto.RSA.RSA method)jfUNtrv(jX%check_key() (M2Crypto.RSA.RSA method)jUNtrw(jX'm2_rsa_free() (M2Crypto.RSA.RSA method)jUNtrx(jX+private_decrypt() (M2Crypto.RSA.RSA method)jUNtry(jX+private_encrypt() (M2Crypto.RSA.RSA method)jUNtrz(jXpub() (M2Crypto.RSA.RSA method)jUNtr{(jX*public_decrypt() (M2Crypto.RSA.RSA method)jUNtr|(jX*public_encrypt() (M2Crypto.RSA.RSA method)jUNtr}(jX$save_key() (M2Crypto.RSA.RSA method)jUNtr~(jX(save_key_bio() (M2Crypto.RSA.RSA method)jUNtr(jX(save_key_der() (M2Crypto.RSA.RSA method)hUNtr(jX,save_key_der_bio() (M2Crypto.RSA.RSA method)jUNtr(jX$save_pem() (M2Crypto.RSA.RSA method)j[UNtr(jX(save_pub_key() (M2Crypto.RSA.RSA method)jUNtr(jX,save_pub_key_bio() (M2Crypto.RSA.RSA method)jjUNtr(jX sign() (M2Crypto.RSA.RSA method)jUNtr(jX+sign_rsassa_pss() (M2Crypto.RSA.RSA method)jUNtr(jX"verify() (M2Crypto.RSA.RSA method)jvUNtr(jX-verify_rsassa_pss() (M2Crypto.RSA.RSA method)jqUNtr(jjijUNtr(jXRSA_pub (class in M2Crypto.RSA)jUNtr(jX)check_key() (M2Crypto.RSA.RSA_pub method)jUNtr(jX/private_decrypt() (M2Crypto.RSA.RSA_pub method)jUNtr(jX/private_encrypt() (M2Crypto.RSA.RSA_pub method)hUNtr(jX(save_key() (M2Crypto.RSA.RSA_pub method)jUNtr(jX,save_key_bio() (M2Crypto.RSA.RSA_pub method)jTUNtr(jX"gen_key() (in module M2Crypto.RSA)j-UNtr(jX*keygen_callback() (in module M2Crypto.RSA)jgUNtr(jX#load_key() (in module M2Crypto.RSA)j6UNtr(jX'load_key_bio() (in module M2Crypto.RSA)j]UNtr(jX*load_key_string() (in module M2Crypto.RSA)jUNtr(jX'load_pub_key() (in module M2Crypto.RSA)jUNtr(jX+load_pub_key_bio() (in module M2Crypto.RSA)jUNtr(jX&new_pub_key() (in module M2Crypto.RSA)jyUNtr(jX$rsa_error() (in module M2Crypto.RSA)j)UNtr(jXM2Crypto.Rand (module)Xmodule-M2Crypto.RandUNtr(jX%rand_seed() (in module M2Crypto.Rand)jUNtr(jX$rand_add() (in module M2Crypto.Rand)jUNtr(jX%load_file() (in module M2Crypto.Rand)hUNtr(jX%save_file() (in module M2Crypto.Rand)j|UNtr(jX&rand_bytes() (in module M2Crypto.Rand)jUNtr(jX-rand_pseudo_bytes() (in module M2Crypto.Rand)jUNtr(jX*rand_file_name() (in module M2Crypto.Rand)j1UNtr(jX'rand_status() (in module M2Crypto.Rand)j$UNtr(jXM2Crypto.SMIME (module)Xmodule-M2Crypto.SMIMEUNtr(jX Cipher (class in M2Crypto.SMIME)hUNtr(jXPKCS7 (class in M2Crypto.SMIME)j.UNtr(jX,get0_signers() (M2Crypto.SMIME.PKCS7 method)hUNtr(jX-m2_pkcs7_free() (M2Crypto.SMIME.PKCS7 method)j@UNtr(jX$type() (M2Crypto.SMIME.PKCS7 method)jYUNtr(jX%write() (M2Crypto.SMIME.PKCS7 method)jUNtr(jX)write_der() (M2Crypto.SMIME.PKCS7 method)jUNtr(jj-jaUNtr(jXSMIME (class in M2Crypto.SMIME)j=UNtr(jX'decrypt() (M2Crypto.SMIME.SMIME method)hUNtr(jX'encrypt() (M2Crypto.SMIME.SMIME method)j\UNtr(jX(load_key() (M2Crypto.SMIME.SMIME method)jJUNtr(jX,load_key_bio() (M2Crypto.SMIME.SMIME method)hUNtr(jX*set_cipher() (M2Crypto.SMIME.SMIME method)jUNtr(jX.set_x509_stack() (M2Crypto.SMIME.SMIME method)hUNtr(jX.set_x509_store() (M2Crypto.SMIME.SMIME method)jUUNtr(jX$sign() (M2Crypto.SMIME.SMIME method)jUNtr(jX,unset_cipher() (M2Crypto.SMIME.SMIME method)jUNtr(jX)unset_key() (M2Crypto.SMIME.SMIME method)hUNtr(jX0unset_x509_stack() (M2Crypto.SMIME.SMIME method)jUNtr(jX0unset_x509_store() (M2Crypto.SMIME.SMIME method)hUNtr(jX&verify() (M2Crypto.SMIME.SMIME method)jUNtr(jX%write() (M2Crypto.SMIME.SMIME method)j8UNtr(jj.jcUNtr(jX'load_pkcs7() (in module M2Crypto.SMIME)jUNtr(jX+load_pkcs7_bio() (in module M2Crypto.SMIME)jUNtr(jX/load_pkcs7_bio_der() (in module M2Crypto.SMIME)jUNtr(jX+load_pkcs7_der() (in module M2Crypto.SMIME)jQUNtr(jX-smime_load_pkcs7() (in module M2Crypto.SMIME)hUNtr(jX1smime_load_pkcs7_bio() (in module M2Crypto.SMIME)jUNtr(jX&text_crlf() (in module M2Crypto.SMIME)jRUNtr(jX*text_crlf_bio() (in module M2Crypto.SMIME)jUNtr(jXM2Crypto.X509 (module)Xmodule-M2Crypto.X509UNtr(jXCRL (class in M2Crypto.X509)jUNtr(jX$as_text() (M2Crypto.X509.CRL method)jRUNtr(jX-m2_x509_crl_free() (M2Crypto.X509.CRL method)jUNtr(jX Request (class in M2Crypto.X509)j.UNtr(jX/add_extensions() (M2Crypto.X509.Request method)jIUNtr(jX'as_der() (M2Crypto.X509.Request method)jUNtr(jX'as_pem() (M2Crypto.X509.Request method)jUNtr(jX(as_text() (M2Crypto.X509.Request method)jUNtr(jX+get_pubkey() (M2Crypto.X509.Request method)jUNtr(jX,get_subject() (M2Crypto.X509.Request method)j UNtr(jX,get_version() (M2Crypto.X509.Request method)j*UNtr(jX1m2_x509_req_free() (M2Crypto.X509.Request method)hUNtr(jX%save() (M2Crypto.X509.Request method)jUNtr(jX)save_pem() (M2Crypto.X509.Request method)hUNtr(jX+set_pubkey() (M2Crypto.X509.Request method)jLUNtr(jX,set_subject() (M2Crypto.X509.Request method)hUNtr(jX1set_subject_name() (M2Crypto.X509.Request method)j*UNtr(jX,set_version() (M2Crypto.X509.Request method)jUNtr(jX%sign() (M2Crypto.X509.Request method)jUNtr(jX'verify() (M2Crypto.X509.Request method)j~UNtr(jXX509 (class in M2Crypto.X509)hUNtr(jX%add_ext() (M2Crypto.X509.X509 method)jUNtr(jX$as_der() (M2Crypto.X509.X509 method)jiUNtr(jX$as_pem() (M2Crypto.X509.X509 method)hUNtr(jX%as_text() (M2Crypto.X509.X509 method)hUNtr(jX&check_ca() (M2Crypto.X509.X509 method)j{UNtr(jX+check_purpose() (M2Crypto.X509.X509 method)jUNtr(jX%get_ext() (M2Crypto.X509.X509 method)j$UNtr(jX(get_ext_at() (M2Crypto.X509.X509 method)jNUNtr(jX+get_ext_count() (M2Crypto.X509.X509 method)jUNtr(jX-get_fingerprint() (M2Crypto.X509.X509 method)jzUNtr(jX(get_issuer() (M2Crypto.X509.X509 method)jUNtr(jX+get_not_after() (M2Crypto.X509.X509 method)j#UNtr(jX,get_not_before() (M2Crypto.X509.X509 method)j(UNtr(jX(get_pubkey() (M2Crypto.X509.X509 method)jUNtr(jX/get_serial_number() (M2Crypto.X509.X509 method)jFUNtr(jX)get_subject() (M2Crypto.X509.X509 method)jtUNtr(jX)get_version() (M2Crypto.X509.X509 method)j@UNtr(jX*m2_x509_free() (M2Crypto.X509.X509 method)hUNtr(jX"save() (M2Crypto.X509.X509 method)j4UNtr(jX&save_pem() (M2Crypto.X509.X509 method)j^UNtr(jX(set_issuer() (M2Crypto.X509.X509 method)jUNtr(jX-set_issuer_name() (M2Crypto.X509.X509 method)jUNtr(jX+set_not_after() (M2Crypto.X509.X509 method)jUNtr(jX,set_not_before() (M2Crypto.X509.X509 method)jMUNtr(jX(set_pubkey() (M2Crypto.X509.X509 method)j<UNtr(jX/set_serial_number() (M2Crypto.X509.X509 method)jUNtr(jX)set_subject() (M2Crypto.X509.X509 method)j?UNtr(jX.set_subject_name() (M2Crypto.X509.X509 method)jrUNtr(jX)set_version() (M2Crypto.X509.X509 method)jUNtr(jX"sign() (M2Crypto.X509.X509 method)jUNtr(jX$verify() (M2Crypto.X509.X509 method)j%UNtr(jjjMUNtr(jX'X509_Extension (class in M2Crypto.X509)hUNtr(jX4get_critical() (M2Crypto.X509.X509_Extension method)j5UNtr(jX0get_name() (M2Crypto.X509.X509_Extension method)juUNtr(jX1get_value() (M2Crypto.X509.X509_Extension method)j UNtr(jX>m2_x509_extension_free() (M2Crypto.X509.X509_Extension method)jUNtr(jX4set_critical() (M2Crypto.X509.X509_Extension method)j UNtr(jX-X509_Extension_Stack (class in M2Crypto.X509)jUNtr(jXGm2_sk_x509_extension_free() (M2Crypto.X509.X509_Extension_Stack method)j"UNtr(jX1pop() (M2Crypto.X509.X509_Extension_Stack method)hUNtr(jX2push() (M2Crypto.X509.X509_Extension_Stack method)jUNtr(jX"X509_Name (class in M2Crypto.X509)jUNtr(jX3add_entry_by_txt() (M2Crypto.X509.X509_Name method)jUNtr(jX)as_der() (M2Crypto.X509.X509_Name method)jJUNtr(jX*as_hash() (M2Crypto.X509.X509_Name method)jPUNtr(jX*as_text() (M2Crypto.X509.X509_Name method)jUNtr(jX.entry_count() (M2Crypto.X509.X509_Name method)jUNtr(jX5get_entries_by_nid() (M2Crypto.X509.X509_Name method)jUNtr (jX4m2_x509_name_free() (M2Crypto.X509.X509_Name method)jUNtr (jX'nid (M2Crypto.X509.X509_Name attribute)jUNtr (jX(X509_Name_Entry (class in M2Crypto.X509)jUNtr (jX6create_by_txt() (M2Crypto.X509.X509_Name_Entry method)jUNtr (jX1get_data() (M2Crypto.X509.X509_Name_Entry method)jUNtr(jX3get_object() (M2Crypto.X509.X509_Name_Entry method)jYUNtr(jX@m2_x509_name_entry_free() (M2Crypto.X509.X509_Name_Entry method)jAUNtr(jX1set_data() (M2Crypto.X509.X509_Name_Entry method)hUNtr(jX3set_object() (M2Crypto.X509.X509_Name_Entry method)hUNtr(jX#X509_Stack (class in M2Crypto.X509)j UNtr(jX*as_der() (M2Crypto.X509.X509_Stack method)jUNtr(jX3m2_sk_x509_free() (M2Crypto.X509.X509_Stack method)j=UNtr(jX'pop() (M2Crypto.X509.X509_Stack method)jLUNtr(jX(push() (M2Crypto.X509.X509_Stack method)hUNtr(jX#X509_Store (class in M2Crypto.X509)j}UNtr(jX,add_cert() (M2Crypto.X509.X509_Store method)jUNtr(jX,add_x509() (M2Crypto.X509.X509_Store method)jUNtr(jX-load_info() (M2Crypto.X509.X509_Store method)jUNtr(jX2load_locations() (M2Crypto.X509.X509_Store method)jUNtr(jX6m2_x509_store_free() (M2Crypto.X509.X509_Store method)jUNtr(jX1set_verify_cb() (M2Crypto.X509.X509_Store method)hUNtr(jX+X509_Store_Context (class in M2Crypto.X509)jUNtr(jX6get1_chain() (M2Crypto.X509.X509_Store_Context method)jUNtr (jX<get_current_cert() (M2Crypto.X509.X509_Store_Context method)jpUNtr!(jX5get_error() (M2Crypto.X509.X509_Store_Context method)jUNtr"(jX;get_error_depth() (M2Crypto.X509.X509_Store_Context method)jUNtr#(jXBm2_x509_store_ctx_free() (M2Crypto.X509.X509_Store_Context method)jUNtr$(jX%load_cert() (in module M2Crypto.X509)jxUNtr%(jX)load_cert_bio() (in module M2Crypto.X509)jUNtr&(jX0load_cert_der_string() (in module M2Crypto.X509)jUNtr'(jX,load_cert_string() (in module M2Crypto.X509)j|UNtr((jX$load_crl() (in module M2Crypto.X509)jYUNtr)(jX(load_request() (in module M2Crypto.X509)jUNtr*(jX,load_request_bio() (in module M2Crypto.X509)jUNtr+(jX3load_request_der_string() (in module M2Crypto.X509)jUNtr,(jX/load_request_string() (in module M2Crypto.X509)hUNtr-(jX)new_extension() (in module M2Crypto.X509)jUNtr.(jX.new_stack_from_der() (in module M2Crypto.X509)hUNtr/(jX1x509_store_default_cb() (in module M2Crypto.X509)j UNtr0(jXM2Crypto.callback (module)Xmodule-M2Crypto.callbackUNtr1(jXM2Crypto.ftpslib (module)Xmodule-M2Crypto.ftpslibUNtr2(jX#FTP_TLS (class in M2Crypto.ftpslib)jUNtr3(jX,auth_ssl() (M2Crypto.ftpslib.FTP_TLS method)hUNtr4(jX,auth_tls() (M2Crypto.ftpslib.FTP_TLS method)jUNtr5(jX0ntransfercmd() (M2Crypto.ftpslib.FTP_TLS method)jsUNtr6(jX*prot_c() (M2Crypto.ftpslib.FTP_TLS method)jUNtr7(jX*prot_p() (M2Crypto.ftpslib.FTP_TLS method)hUNtr8(jXM2Crypto.httpslib (module)Xmodule-M2Crypto.httpslibUNtr9(jX,HTTPSConnection (class in M2Crypto.httpslib)hUNtr:(jX2close() (M2Crypto.httpslib.HTTPSConnection method)j UNtr;(jX4connect() (M2Crypto.httpslib.HTTPSConnection method)jhUNtr<(jX:default_port (M2Crypto.httpslib.HTTPSConnection attribute)j@UNtr=(jX8get_session() (M2Crypto.httpslib.HTTPSConnection method)jsUNtr>(jX8set_session() (M2Crypto.httpslib.HTTPSConnection method)jUNtr?(jX1ProxyHTTPSConnection (class in M2Crypto.httpslib)jUNtr@(jX9connect() (M2Crypto.httpslib.ProxyHTTPSConnection method)j1UNtrA(jX<endheaders() (M2Crypto.httpslib.ProxyHTTPSConnection method)hUNtrB(jX;putheader() (M2Crypto.httpslib.ProxyHTTPSConnection method)jLUNtrC(jX<putrequest() (M2Crypto.httpslib.ProxyHTTPSConnection method)jUNtrD(jXM2Crypto.m2 (module)Xmodule-M2Crypto.m2UNtrE(jXM2Crypto.m2crypto (module)Xmodule-M2Crypto.m2cryptoUNtrF(jXM2Crypto.m2urllib (module)Xmodule-M2Crypto.m2urllibUNtrG(jX*open_https() (in module M2Crypto.m2urllib)jUNtrH(jXM2Crypto.m2urllib2 (module)Xmodule-M2Crypto.m2urllib2UNtrI(jX*HTTPSHandler (class in M2Crypto.m2urllib2)jmUNtrJ(jX5https_open() (M2Crypto.m2urllib2.HTTPSHandler method)jQUNtrK(jX8https_request() (M2Crypto.m2urllib2.HTTPSHandler method)j8UNtrL(jX-build_opener() (in module M2Crypto.m2urllib2)j!UNtrM(jXM2Crypto.m2xmlrpclib (module)Xmodule-M2Crypto.m2xmlrpclibUNtrN(jX-SSL_Transport (class in M2Crypto.m2xmlrpclib)hUNtrO(jX5request() (M2Crypto.m2xmlrpclib.SSL_Transport method)jUNtrP(jX9user_agent (M2Crypto.m2xmlrpclib.SSL_Transport attribute)jUNtrQ(jXM2Crypto.threading (module)Xmodule-M2Crypto.threadingUNtrR(jX(cleanup() (in module M2Crypto.threading)jUNtrS(jX%init() (in module M2Crypto.threading)jyUNtrT(jXM2Crypto.util (module)Xmodule-M2Crypto.utilUNtrU(jjg jUNtrV(jX&bin_to_hex() (in module M2Crypto.util)j%UNtrW(jX-genparam_callback() (in module M2Crypto.util)jXUNtrX(jX2no_passphrase_callback() (in module M2Crypto.util)j2UNtrY(jX'octx_to_num() (in module M2Crypto.util)jUNtrZ(jX/passphrase_callback() (in module M2Crypto.util)hUNtr[(jX%pkcs5_pad() (in module M2Crypto.util)jUNtr\(jX%pkcs7_pad() (in module M2Crypto.util)jEUNtr](jX$py3bytes() (in module M2Crypto.util)jUNtr^(jX"py3str() (in module M2Crypto.util)jUNtr_(jX3quiet_genparam_callback() (in module M2Crypto.util)jnUNtr`ehM]hU]ra((jXM2Crypto.SSL (module)Xmodule-M2Crypto.SSLUNtrb(jjjUNtrc(jjjUNtrd(jXM2Crypto.SSL.Checker (module)Xmodule-M2Crypto.SSL.CheckerUNtre(jjhUNtrf(jjjUNtrg(jjjAUNtrh(jjhUNtri(jX'Checker (class in M2Crypto.SSL.Checker)hUNtrj(jX7numericIpMatch (M2Crypto.SSL.Checker.Checker attribute)hUNtrk(jXM2Crypto.SSL.Cipher (module)Xmodule-M2Crypto.SSL.CipherUNtrl(jX%Cipher (class in M2Crypto.SSL.Cipher)jaUNtrm(jX*name() (M2Crypto.SSL.Cipher.Cipher method)j2UNtrn(jX-version() (M2Crypto.SSL.Cipher.Cipher method)jUNtro(jX+Cipher_Stack (class in M2Crypto.SSL.Cipher)j>UNtrp(jX M2Crypto.SSL.Connection (module)Xmodule-M2Crypto.SSL.ConnectionUNtrq(jX-Connection (class in M2Crypto.SSL.Connection)jNUNtrr(jX4accept() (M2Crypto.SSL.Connection.Connection method)hUNtrs(jX8accept_ssl() (M2Crypto.SSL.Connection.Connection method)jUNtrt(jX2bind() (M2Crypto.SSL.Connection.Connection method)hUNtru(jX3clear() (M2Crypto.SSL.Connection.Connection method)hUNtrv(jXHclientPostConnectionCheck (M2Crypto.SSL.Connection.Connection attribute)j}UNtrw(jX3close() (M2Crypto.SSL.Connection.Connection method)j[UNtrx(jX5connect() (M2Crypto.SSL.Connection.Connection method)jUNtry(jX9connect_ssl() (M2Crypto.SSL.Connection.Connection method)jUNtrz(jX4fileno() (M2Crypto.SSL.Connection.Connection method)jMUNtr{(jX8get_cipher() (M2Crypto.SSL.Connection.Connection method)jUNtr|(jX=get_cipher_list() (M2Crypto.SSL.Connection.Connection method)hUNtr}(jX9get_ciphers() (M2Crypto.SSL.Connection.Connection method)hUNtr~(jX9get_context() (M2Crypto.SSL.Connection.Connection method)jUNtr(jXIget_default_session_timeout() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX;get_peer_cert() (M2Crypto.SSL.Connection.Connection method)jUNtr(jXAget_peer_cert_chain() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX9get_session() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX:get_shutdown() (M2Crypto.SSL.Connection.Connection method)jUNtr(jXEget_socket_read_timeout() (M2Crypto.SSL.Connection.Connection method)jdUNtr(jXFget_socket_write_timeout() (M2Crypto.SSL.Connection.Connection method)j$UNtr(jX7get_state() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX>get_verify_depth() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX=get_verify_mode() (M2Crypto.SSL.Connection.Connection method)jVUNtr(jX?get_verify_result() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX9get_version() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX9getpeername() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX9getsockname() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX8getsockopt() (M2Crypto.SSL.Connection.Connection method)jqUNtr(jX4listen() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX9m2_bio_free() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX9m2_ssl_free() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX6makefile() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX5pending() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX2read() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX2recv() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX7recv_into() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX9renegotiate() (M2Crypto.SSL.Connection.Connection method)jDUNtr(jX2send() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX5sendall() (M2Crypto.SSL.Connection.Connection method)hUNtr(jXGserverPostConnectionCheck() (M2Crypto.SSL.Connection.Connection method)jFUNtr(jX>set_accept_state() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX5set_bio() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX=set_cipher_list() (M2Crypto.SSL.Connection.Connection method)hUNtr(jXMset_client_CA_list_from_context() (M2Crypto.SSL.Connection.Connection method)jUNtr(jXJset_client_CA_list_from_file() (M2Crypto.SSL.Connection.Connection method)hUNtr(jX?set_connect_state() (M2Crypto.SSL.Connection.Connection method)jVUNtr(jXPset_post_connection_check_callback() (M2Crypto.SSL.Connection.Connection method)hUNtr(jX9set_session() (M2Crypto.SSL.Connection.Connection method)hUNtr(jX@set_session_id_ctx() (M2Crypto.SSL.Connection.Connection method)jTUNtr(jX:set_shutdown() (M2Crypto.SSL.Connection.Connection method)jrUNtr(jXEset_socket_read_timeout() (M2Crypto.SSL.Connection.Connection method)jUNtr(jXFset_socket_write_timeout() (M2Crypto.SSL.Connection.Connection method)hUNtr(jX@set_ssl_close_flag() (M2Crypto.SSL.Connection.Connection method)jUNtr(jXBset_tlsext_host_name() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX9setblocking() (M2Crypto.SSL.Connection.Connection method)jbUNtr(jX8setsockopt() (M2Crypto.SSL.Connection.Connection method)hUNtr(jX8settimeout() (M2Crypto.SSL.Connection.Connection method)hUNtr(jX8setup_addr() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX7setup_ssl() (M2Crypto.SSL.Connection.Connection method)j]UNtr(jX6shutdown() (M2Crypto.SSL.Connection.Connection method)j(UNtr(jX;ssl_get_error() (M2Crypto.SSL.Connection.Connection method)jUNtr(jX7verify_ok() (M2Crypto.SSL.Connection.Connection method)j3UNtr(jX3write() (M2Crypto.SSL.Connection.Connection method)j4UNtr(jXM2Crypto.SSL.Context (module)Xmodule-M2Crypto.SSL.ContextUNtr(jX)ctxmap() (in module M2Crypto.SSL.Context)j UNtr(jX'Context (class in M2Crypto.SSL.Context)jUNtr(jX3add_session() (M2Crypto.SSL.Context.Context method)hUNtr(jX-close() (M2Crypto.SSL.Context.Context method)jUNtr(jX<get_allow_unknown_ca() (M2Crypto.SSL.Context.Context method)hUNtr(jX6get_cert_store() (M2Crypto.SSL.Context.Context method)jtUNtr(jX>get_session_cache_mode() (M2Crypto.SSL.Context.Context method)jnUNtr(jX;get_session_timeout() (M2Crypto.SSL.Context.Context method)j_UNtr(jX8get_verify_depth() (M2Crypto.SSL.Context.Context method)hUNtr(jX7get_verify_mode() (M2Crypto.SSL.Context.Context method)jUNtr(jX1load_cert() (M2Crypto.SSL.Context.Context method)jGUNtr(jX7load_cert_chain() (M2Crypto.SSL.Context.Context method)jUNtr(jX6load_client_CA() (M2Crypto.SSL.Context.Context method)jUNtr(jX6load_client_ca() (M2Crypto.SSL.Context.Context method)j/UNtr(jX8load_verify_info() (M2Crypto.SSL.Context.Context method)hUNtr(jX=load_verify_locations() (M2Crypto.SSL.Context.Context method)jUNtr(jX7m2_ssl_ctx_free() (M2Crypto.SSL.Context.Context method)j UNtr(jX6remove_session() (M2Crypto.SSL.Context.Context method)hUNtr(jX<set_allow_unknown_ca() (M2Crypto.SSL.Context.Context method)j!UNtr(jX7set_cipher_list() (M2Crypto.SSL.Context.Context method)jgUNtr(jXDset_client_CA_list_from_file() (M2Crypto.SSL.Context.Context method)j UNtr(jX@set_default_verify_paths() (M2Crypto.SSL.Context.Context method)jkUNtr(jX9set_info_callback() (M2Crypto.SSL.Context.Context method)jUNtr(jX3set_options() (M2Crypto.SSL.Context.Context method)jUNtr(jX>set_session_cache_mode() (M2Crypto.SSL.Context.Context method)jUNtr(jX:set_session_id_ctx() (M2Crypto.SSL.Context.Context method)jwUNtr(jX;set_session_timeout() (M2Crypto.SSL.Context.Context method)jtUNtr(jX2set_tmp_dh() (M2Crypto.SSL.Context.Context method)jUNtr(jX;set_tmp_dh_callback() (M2Crypto.SSL.Context.Context method)jzUNtr(jX3set_tmp_rsa() (M2Crypto.SSL.Context.Context method)hUNtr(jX<set_tmp_rsa_callback() (M2Crypto.SSL.Context.Context method)j,UNtr(jX2set_verify() (M2Crypto.SSL.Context.Context method)jRUNtr(jX&map() (in module M2Crypto.SSL.Context)hUNtr(jXM2Crypto.SSL.SSLServer (module)Xmodule-M2Crypto.SSL.SSLServerUNtr(jX+SSLServer (class in M2Crypto.SSL.SSLServer)jUNtr(jX8handle_error() (M2Crypto.SSL.SSLServer.SSLServer method)jUNtr(jX:handle_request() (M2Crypto.SSL.SSLServer.SSLServer method)jcUNtr(jX2ForkingSSLServer (class in M2Crypto.SSL.SSLServer)jUNtr(jX4ThreadingSSLServer (class in M2Crypto.SSL.SSLServer)jVUNtr(jXM2Crypto.SSL.Session (module)Xmodule-M2Crypto.SSL.SessionUNtr(jX'Session (class in M2Crypto.SSL.Session)hUNtr(jX.as_der() (M2Crypto.SSL.Session.Session method)jUNtr(jX/as_text() (M2Crypto.SSL.Session.Session method)jUNtr(jX0get_time() (M2Crypto.SSL.Session.Session method)hUNtr(jX3get_timeout() (M2Crypto.SSL.Session.Session method)jUNtr(jX;m2_ssl_session_free() (M2Crypto.SSL.Session.Session method)jEUNtr(jX0set_time() (M2Crypto.SSL.Session.Session method)j:UNtr(jX3set_timeout() (M2Crypto.SSL.Session.Session method)hUNtr(jX1write_bio() (M2Crypto.SSL.Session.Session method)jgUNtr(jX/load_session() (in module M2Crypto.SSL.Session)hUNtr(jX,M2Crypto.SSL.TwistedProtocolWrapper (module)X*module-M2Crypto.SSL.TwistedProtocolWrapperUNtr(jX<connectSSL() (in module M2Crypto.SSL.TwistedProtocolWrapper)jUNtr(jX<connectTCP() (in module M2Crypto.SSL.TwistedProtocolWrapper)j:UNtr(jX;listenSSL() (in module M2Crypto.SSL.TwistedProtocolWrapper)j:UNtr(jX;listenTCP() (in module M2Crypto.SSL.TwistedProtocolWrapper)jZUNtr(jXATLSProtocolWrapper (class in M2Crypto.SSL.TwistedProtocolWrapper)j2UNtr(jXGclear() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)jUNtr(jXPconnectionLost() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)jjUNtr(jXPconnectionMade() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)jUNtr(jXNdataReceived() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)jUNtr(jXPloseConnection() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)hUNtr(jXJstartTLS() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)jUNtr(jXGwrite() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)j&UNtr(jXOwriteSequence() (M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper method)jUNtr(jXM2Crypto.SSL.cb (module)Xmodule-M2Crypto.SSL.cbUNtr(jX6ssl_verify_callback_stub() (in module M2Crypto.SSL.cb)j6UNtr(jX1ssl_verify_callback() (in module M2Crypto.SSL.cb)jzUNtr(jXBssl_verify_callback_allow_unknown_ca() (in module M2Crypto.SSL.cb)jUNtr(jX/ssl_info_callback() (in module M2Crypto.SSL.cb)j_UNtr(jX$M2Crypto.SSL.ssl_dispatcher (module)X"module-M2Crypto.SSL.ssl_dispatcherUNtr(jX5ssl_dispatcher (class in M2Crypto.SSL.ssl_dispatcher)jUNtr(jX=connect() (M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher method)jUNtr(jXCcreate_socket() (M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher method)j+UNtr(jX:recv() (M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher method)jHUNtr(jX:send() (M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher method)jUNtr(jXM2Crypto.SSL.timeout (module)Xmodule-M2Crypto.SSL.timeoutUNtr(jX'timeout (class in M2Crypto.SSL.timeout)joUNtr(jX,pack() (M2Crypto.SSL.timeout.timeout method)j8UNtr(jX4struct_to_timeout() (in module M2Crypto.SSL.timeout)jIUNtr(jX.struct_size() (in module M2Crypto.SSL.timeout)jSUNtreh]]uUall_docsr}r(h GAwn/4h"GAwoh*GAwg!Gh?GAw𻹫ehMGAwhhUGAwoh]GAwlbuUsettingsr}r(U rfc_base_urlUhttps://tools.ietf.org/html/rUcloak_email_addressesU pep_base_urlU https://www.python.org/dev/peps/rU halt_levelKUsectsubtitle_xformU smart_quotesUembed_stylesheetUtrim_footnote_reference_spaceUdoctitle_xformUenvhU language_codeUenr Ufile_insertion_enabledUgettext_compactUinput_encodingU utf-8-sigr uU ref_contextr }Ufiles_to_rebuildr }r (j h]rh"aRrj h]rh?aRruUtoc_secnumbersr}Uversioning_comparerU_nitpick_ignorerh]RrU _warnfuncrNub.M2Crypto-0.31.0/doc/doctrees/howto.ca.doctree0000664000175000001440000014111313236336220021202 0ustar matejusers00000000000000cdocutils.nodes document q)q}q(U nametypesq}q(X introductionqNX(howto: creating your own ca with opensslqNXhowto-caqX the procedureq NX conclusionq NuUsubstitution_defsq }q Uparse_messagesq ]q(cdocutils.nodes system_message q)q}q(U rawsourceqUUparentqcdocutils.nodes section q)q}q(hUhh)q}q(hUhhUsourceqX+/home/matej/Build/m2crypto/doc/howto.ca.rstqUexpect_referenced_by_nameq}qhcdocutils.nodes target q)q}q(hX .. _howto-ca:hhhhUtagnameq Utargetq!U attributesq"}q#(Uidsq$]Ubackrefsq%]Udupnamesq&]Uclassesq']Unamesq(]Urefidq)Uhowto-caq*uUlineq+KUdocumentq,hUchildrenq-]ubsh Usectionq.h"}q/(h&]h']h%]h$]q0(U'howto-creating-your-own-ca-with-opensslq1h*eh(]q2(hheuh+Kh,hUexpect_referenced_by_idq3}q4h*hsh-]q5(cdocutils.nodes title q6)q7}q8(hX(HOWTO: Creating your own CA with OpenSSLq9hhhhh Utitleq:h"}q;(h&]h']h%]h$]h(]uh+Kh,hh-]qq?}q@(hUhNh+Nh,hhh7ubaubcdocutils.nodes field_list qA)qB}qC(hUhhhhh U field_listqDh"}qE(h&]h']h%]h$]h(]uh+Kh,hh-]qF(cdocutils.nodes field qG)qH}qI(hUhhBhhh UfieldqJh"}qK(h&]h']h%]h$]h(]uh+Kh,hh-]qL(cdocutils.nodes field_name qM)qN}qO(hXauthorhhHhhh U field_nameqPh"}qQ(h&]h']h%]h$]h(]uh+Kh-]qRh=XauthorqSqT}qU(hUhhNubaubcdocutils.nodes field_body qV)qW}qX(hXPheng Siong Ng qYh"}qZ(h&]h']h%]h$]h(]uhhHh-]q[cdocutils.nodes paragraph q\)q]}q^(hhYhhWhhh U paragraphq_h"}q`(h&]h']h%]h$]h(]uh+Kh-]qa(h=XPheng Siong Ng qn}qo(hUhh]ubeubah U field_bodyqpubeubhG)qq}qr(hUhhBhhh hJh"}qs(h&]h']h%]h$]h(]uh+K h,hh-]qt(hM)qu}qv(hX copyrighthhqhhh hPh"}qw(h&]h']h%]h$]h(]uh+Kh-]qxh=X copyrightqyqz}q{(hUhhuubaubhV)q|}q}(hX!© 2000, 2001 by Ng Pheng Siong. h"}q~(h&]h']h%]h$]h(]uhhqh-]qh\)q}q(hX © 2000, 2001 by Ng Pheng Siong.hh|hhh h_h"}q(h&]h']h%]h$]h(]uh+K h-]qh=X © 2000, 2001 by Ng Pheng Siong.qq}q(hUhhubaubah hpubeubeubh)q}q(hUhhhhh h.h"}q(h&]h']h%]h$]qU introductionqah(]qhauh+K h,hh-]q(h6)q}q(hX Introductionqhhhhh h:h"}q(h&]h']h%]h$]h(]uh+K h,hh-]qh=X Introductionqq}q(hUhNh+Nh,hhhubaubh\)q}q(hXSThis is a HOWTO on creating your own *certification authority* (*CA*) with OpenSSL.hhhhh h_h"}q(h&]h']h%]h$]h(]uh+Kh,hh-]q(h=X%This is a HOWTO on creating your own qq}q(hUhNh+Nh,hhhubcdocutils.nodes emphasis q)q}q(hX*certification authority*h"}q(h&]h']h%]h$]h(]uhhh-]qh=Xcertification authorityqq}q(hUhhubah Uemphasisqubh=X (qq}q(hUhNh+Nh,hhhubh)q}q(hX*CA*h"}q(h&]h']h%]h$]h(]uhhh-]qh=XCAqq}q(hUhhubah hubh=X) with OpenSSL.qq}q(hUhNh+Nh,hhhubeubh\)q}q(hX@I last created a CA about a year ago, when I began work on `M2Crypto `__ and needed certificates for the SSL bits. I accepted the tools' default settings then, e.g., certificate validity of 365 days; this meant that my certificates, including my CA's certificate, have now expired.hhhhh h_h"}q(h&]h']h%]h$]h(]uh+Kh,hh-]q(h=X;I last created a CA about a year ago, when I began work on qq}q(hUhNh+Nh,hhhubhe)q}q(hX4`M2Crypto `__h"}q(UnameXM2CryptoUrefuriqX%https://gitlab.com/m2crypto/m2crypto/h$]h%]h&]h']h(]uhhh-]qh=XM2Cryptoqq}q(hUhhubah hmubh=X and needed certificates for the SSL bits. I accepted the tools’ default settings then, e.g., certificate validity of 365 days; this meant that my certificates, including my CA’s certificate, have now expired.q…q}q(hUhNh+Nh,hhhubeubh\)q}q(hXSince I am using these certificates for M2Crypto's demonstration programs (and I have forgotten the passphrase to the CA's private key), I decided to discard the old CA and start afresh. I also decided to document the process, hence this HOWTO.hhhhh h_h"}q(h&]h']h%]h$]h(]uh+Kh,hh-]qh=XSince I am using these certificates for M2Crypto’s demonstration programs (and I have forgotten the passphrase to the CA’s private key), I decided to discard the old CA and start afresh. I also decided to document the process, hence this HOWTO.qɅq}q(hUhNh+Nh,hhhubaubeubhh)q}q(hUhhhhh h.h"}q(h&]h']h%]h$]qU conclusionqah(]qh auh+Mfh,hh-]q(h6)q}q(hX Conclusionqhhhhh h:h"}q(h&]h']h%]h$]h(]uh+Mfh,hh-]qh=X Conclusionq؅q}q(hUhNh+Nh,hhhubaubh\)q}q(hXWe've walked through the basic steps in the creation of a CA and certificates using the tools that come with OpenSSL. We did not cover more advanced topics such as constraining a certificate to be SSL-only or S/MIME-only.hhhhh h_h"}q(h&]h']h%]h$]h(]uh+Mhh,hh-]qh=XWe’ve walked through the basic steps in the creation of a CA and certificates using the tools that come with OpenSSL. We did not cover more advanced topics such as constraining a certificate to be SSL-only or S/MIME-only.q߅q}q(hUhNh+Nh,hhhubaubh\)q}q(hXThere exist several HOWTOs similar to this one on the net. This one is written specifically to facilitate discussions in my other HOWTOs on developing SSL and S/MIME applications in `Python `__ using `M2Crypto `__.hhhhh h_h"}q(h&]h']h%]h$]h(]uh+Mmh,hh-]q(h=XThere exist several HOWTOs similar to this one on the net. This one is written specifically to facilitate discussions in my other HOWTOs on developing SSL and S/MIME applications in q慁q}q(hUhNh+Nh,hhhubhe)q}q(hX"`Python `__h"}q(UnameXPythonhXhttp://www.python.orgh$]h%]h&]h']h(]uhhh-]qh=XPythonq텁q}q(hUhhubah hmubh=X using qq}q(hUhNh+Nh,hhhubhe)q}q(hX4`M2Crypto `__h"}q(UnameXM2CryptohX%https://gitlab.com/m2crypto/m2crypto/h$]h%]h&]h']h(]uhhh-]qh=XM2Cryptoqq}q(hUhhubah hmubh=X.q}q(hUhNh+Nh,hhhubeubeubeubhhh h.h"}q(h&]h']h%]h$]qU the-procedureqah(]qh auh+Kh,hh-]r(h6)r}r(hX The Procedurerhhhhh h:h"}r(h&]h']h%]h$]h(]uh+Kh,hh-]rh=X The Procedurerr}r(hUhNh+Nh,hhjubaubh\)r }r (hXQI use ``CA.pl``, a Perl program written by Steve Hanson and bundled with OpenSSL.hhhhh h_h"}r (h&]h']h%]h$]h(]uh+K h,hh-]r (h=XI use r r}r(hUhNh+Nh,hhj ubcdocutils.nodes literal r)r}r(hX ``CA.pl``h"}r(h&]h']h%]h$]h(]uhj h-]rh=XCA.plrr}r(hUhjubah Uliteralrubh=XB, a Perl program written by Steve Hanson and bundled with OpenSSL.rr}r(hUhNh+Nh,hhj ubeubh\)r}r(hX+The following are the steps to create a CA:rhhhhh h_h"}r(h&]h']h%]h$]h(]uh+K#h,hh-]r h=X+The following are the steps to create a CA:r!r"}r#(hUhNh+Nh,hhjubaubcdocutils.nodes enumerated_list r$)r%}r&(hUhhhhh Uenumerated_listr'h"}r((Usuffixr)U.h$]h%]h&]Uprefixr*Uh']h(]Uenumtyper+Uarabicr,uh+K%h,hh-]r-(cdocutils.nodes list_item r.)r/}r0(hX{Choose a directory to do your CA work. All commands are executed within this directory. Let's call the directory ``demo``. hj%hhh U list_itemr1h"}r2(h&]h']h%]h$]h(]uh+Nh,hh-]r3h\)r4}r5(hXzChoose a directory to do your CA work. All commands are executed within this directory. Let's call the directory ``demo``.hj/hhh h_h"}r6(h&]h']h%]h$]h(]uh+K%h-]r7(h=XsChoose a directory to do your CA work. All commands are executed within this directory. Let’s call the directory r8r9}r:(hUhj4ubj)r;}r<(hX``demo``h"}r=(h&]h']h%]h$]h(]uhj4h-]r>h=Xdemor?r@}rA(hUhj;ubah jubh=X.rB}rC(hUhj4ubeubaubj.)rD}rE(hX2Copy ``CA.pl`` and ``openssl.cnf`` into ``demo``. hj%hhh j1h"}rF(h&]h']h%]h$]h(]uh+Nh,hh-]rGh\)rH}rI(hX1Copy ``CA.pl`` and ``openssl.cnf`` into ``demo``.hjDhhh h_h"}rJ(h&]h']h%]h$]h(]uh+K(h-]rK(h=XCopy rLrM}rN(hUhjHubj)rO}rP(hX ``CA.pl``h"}rQ(h&]h']h%]h$]h(]uhjHh-]rRh=XCA.plrSrT}rU(hUhjOubah jubh=X and rVrW}rX(hUhjHubj)rY}rZ(hX``openssl.cnf``h"}r[(h&]h']h%]h$]h(]uhjHh-]r\h=X openssl.cnfr]r^}r_(hUhjYubah jubh=X into r`ra}rb(hUhjHubj)rc}rd(hX``demo``h"}re(h&]h']h%]h$]h(]uhjHh-]rfh=Xdemorgrh}ri(hUhjcubah jubh=X.rj}rk(hUhjHubeubaubj.)rl}rm(hXhApply the following patch to ``CA.pl``, which allows it to generate a CA certificate with a validity period of 1095 days, i.e., 3 years:: --- CA.pl.org Sat Mar 31 12:40:13 2001 +++ CA.pl Sat Mar 31 12:41:15 2001 @@ -97,7 +97,7 @@ } else { print "Making CA certificate ...\n"; system ("$REQ -new -x509 -keyout " . - "${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT $DAYS"); + "${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT -days 1095"); $RET=$?; } } hj%hhh j1h"}rn(h&]h']h%]h$]h(]uh+Nh,hh-]ro(h\)rp}rq(hXApply the following patch to ``CA.pl``, which allows it to generate a CA certificate with a validity period of 1095 days, i.e., 3 years::hjlhhh h_h"}rr(h&]h']h%]h$]h(]uh+K*h-]rs(h=XApply the following patch to rtru}rv(hUhjpubj)rw}rx(hX ``CA.pl``h"}ry(h&]h']h%]h$]h(]uhjph-]rzh=XCA.plr{r|}r}(hUhjwubah jubh=Xb, which allows it to generate a CA certificate with a validity period of 1095 days, i.e., 3 years:r~r}r(hUhjpubeubcdocutils.nodes literal_block r)r}r(hX--- CA.pl.org Sat Mar 31 12:40:13 2001 +++ CA.pl Sat Mar 31 12:41:15 2001 @@ -97,7 +97,7 @@ } else { print "Making CA certificate ...\n"; system ("$REQ -new -x509 -keyout " . - "${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT $DAYS"); + "${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT -days 1095"); $RET=$?; } }hjlh U literal_blockrh"}r(U xml:spacerUpreserverh$]h%]h&]h']h(]uh+K.h-]rh=X--- CA.pl.org Sat Mar 31 12:40:13 2001 +++ CA.pl Sat Mar 31 12:41:15 2001 @@ -97,7 +97,7 @@ } else { print "Making CA certificate ...\n"; system ("$REQ -new -x509 -keyout " . - "${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT $DAYS"); + "${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT -days 1095"); $RET=$?; } }rr}r(hUhjubaubeubj.)r}r(hX* Create a new CA like this:: ./CA.pl -newca A certificate filename (or enter to create) Making CA certificate ... Using configuration from openssl.cnf Generating a 1024 bit RSA private key ............++++++ ......................++++++ writing new private key to './demoCA/private/cakey.pem' Enter PEM pass phrase: Verifying password - Enter PEM pass phrase: ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:. Locality Name (eg, city) []:.. Organization Name (eg, company) [Internet Widgits Pty Ltd]:DemoCA Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:DemoCA Certificate Master Email Address []:certmaster@democa.dom This creates a new CA in the directory ``demoCA``. The CA's self-signed certificate is in ``demoCA/cacert.pem`` and its RSA key pair is in ``demoCA/private/cakey.pem``. ``demoCA/private/cakey.pem`` looks like this:: cat demoCA/private/cakey.pem -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,19973A9DBBB601BA eOq9WFScNiI4/UWEUaSnGTKpJv2JYuMD3HwQox2Q3Cd4zGqVjJ6gF3exa5126cKf X/bMVnwbPpuFZPiAIvaLyCjT6pYeXTBbSzs7/GQnvEOv+nYnDUFWi0Qm92qLk0uy pFi/M1aWheN3vir2ZlAw+DW0bOOZhj8tC7Co7lMYb0YE271b6/YRPZCwQ3GXAHUJ +aMYxlUDrK45aCUa/1CZDzTgk7h9cDgx2QJSIvYMYytCfI3zsuZMJS8/4OXLL0bI lKmAc1dwB3DqGJt5XK4WJesiNfdxeCNEgAcYtEAgYZTPIApU+kTgTCIxJl2nMW7j ax+Q1z7g+4MpgG20WD633D4z4dTlDdz+dnLi0rvuvxiwt+dUhrqiML1tyi+Z6EBH jU4/cLBWev3rYfrlp4x8J9mDte0YKOk3t0wQOHqRetTsIfdtjnFp/Hu3qDmTCWjD z/g7PPoO/bg/B877J9WBPbL/1hXXFYo88M+2aGlPOgDcFdiOqbLb2DCscohMbbVr A4mgiy2kwWfIE73qiyV7yyG8FlRvr1iib+jbT3LTGf743utYAAs7HNGuOUObhoyt jYvBD7ACn35P5YX7KTqvqErwdijxYCaNBCnvmRtmYSaNw9Kv1UJTxc5Vx7YLwIPk E9KyBgKI7vPOjWBZ27+zOvNycmv1ciNtpALAw4bWtXnhCDVTHaVDy34OkheMzNCg 2cjcBFzOkMIjcI03KbTQXOFIQGlsTWXGzkNf/zBQ+KksT1MCj+zBXSCvlDASMckg kef21pGgUqPF14gKGfWX3sV4bjc1vbrRwq6zlG3nMuYqR5MtJJY9eQ== -----END RSA PRIVATE KEY----- hj%hhh j1h"}r(h&]h']h%]h$]h(]uh+Nh,hh-]r(h\)r}r(hXCreate a new CA like this::hjhhh h_h"}r(h&]h']h%]h$]h(]uh+K;h-]rh=XCreate a new CA like this:rr}r(hUhjubaubj)r}r(hX$./CA.pl -newca A certificate filename (or enter to create) Making CA certificate ... Using configuration from openssl.cnf Generating a 1024 bit RSA private key ............++++++ ......................++++++ writing new private key to './demoCA/private/cakey.pem' Enter PEM pass phrase: Verifying password - Enter PEM pass phrase: ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:. Locality Name (eg, city) []:.. Organization Name (eg, company) [Internet Widgits Pty Ltd]:DemoCA Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:DemoCA Certificate Master Email Address []:certmaster@democa.domhjh jh"}r(jjh$]h%]h&]h']h(]uh+K=h-]rh=X$./CA.pl -newca A certificate filename (or enter to create) Making CA certificate ... Using configuration from openssl.cnf Generating a 1024 bit RSA private key ............++++++ ......................++++++ writing new private key to './demoCA/private/cakey.pem' Enter PEM pass phrase: Verifying password - Enter PEM pass phrase: ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:. Locality Name (eg, city) []:.. Organization Name (eg, company) [Internet Widgits Pty Ltd]:DemoCA Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:DemoCA Certificate Master Email Address []:certmaster@democa.domrr}r(hUhjubaubh\)r}r(hXThis creates a new CA in the directory ``demoCA``. The CA's self-signed certificate is in ``demoCA/cacert.pem`` and its RSA key pair is in ``demoCA/private/cakey.pem``.hjhhh h_h"}r(h&]h']h%]h$]h(]uh+KYh-]r(h=X'This creates a new CA in the directory rr}r(hUhjubj)r}r(hX ``demoCA``h"}r(h&]h']h%]h$]h(]uhjh-]rh=XdemoCArr}r(hUhjubah jubh=X+. The CA’s self-signed certificate is in rr}r(hUhjubj)r}r(hX``demoCA/cacert.pem``h"}r(h&]h']h%]h$]h(]uhjh-]rh=XdemoCA/cacert.pemrr}r(hUhjubah jubh=X and its RSA key pair is in rr}r(hUhjubj)r}r(hX``demoCA/private/cakey.pem``h"}r(h&]h']h%]h$]h(]uhjh-]rh=XdemoCA/private/cakey.pemrr}r(hUhjubah jubh=X.r}r(hUhjubeubh\)r}r(hX.``demoCA/private/cakey.pem`` looks like this::hjhhh h_h"}r(h&]h']h%]h$]h(]uh+K]h-]r(j)r}r(hX``demoCA/private/cakey.pem``h"}r(h&]h']h%]h$]h(]uhjh-]rh=XdemoCA/private/cakey.pemrr}r(hUhjubah jubh=X looks like this:rr}r(hUhjubeubj)r}r(hXcat demoCA/private/cakey.pem -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,19973A9DBBB601BA eOq9WFScNiI4/UWEUaSnGTKpJv2JYuMD3HwQox2Q3Cd4zGqVjJ6gF3exa5126cKf X/bMVnwbPpuFZPiAIvaLyCjT6pYeXTBbSzs7/GQnvEOv+nYnDUFWi0Qm92qLk0uy pFi/M1aWheN3vir2ZlAw+DW0bOOZhj8tC7Co7lMYb0YE271b6/YRPZCwQ3GXAHUJ +aMYxlUDrK45aCUa/1CZDzTgk7h9cDgx2QJSIvYMYytCfI3zsuZMJS8/4OXLL0bI lKmAc1dwB3DqGJt5XK4WJesiNfdxeCNEgAcYtEAgYZTPIApU+kTgTCIxJl2nMW7j ax+Q1z7g+4MpgG20WD633D4z4dTlDdz+dnLi0rvuvxiwt+dUhrqiML1tyi+Z6EBH jU4/cLBWev3rYfrlp4x8J9mDte0YKOk3t0wQOHqRetTsIfdtjnFp/Hu3qDmTCWjD z/g7PPoO/bg/B877J9WBPbL/1hXXFYo88M+2aGlPOgDcFdiOqbLb2DCscohMbbVr A4mgiy2kwWfIE73qiyV7yyG8FlRvr1iib+jbT3LTGf743utYAAs7HNGuOUObhoyt jYvBD7ACn35P5YX7KTqvqErwdijxYCaNBCnvmRtmYSaNw9Kv1UJTxc5Vx7YLwIPk E9KyBgKI7vPOjWBZ27+zOvNycmv1ciNtpALAw4bWtXnhCDVTHaVDy34OkheMzNCg 2cjcBFzOkMIjcI03KbTQXOFIQGlsTWXGzkNf/zBQ+KksT1MCj+zBXSCvlDASMckg kef21pGgUqPF14gKGfWX3sV4bjc1vbrRwq6zlG3nMuYqR5MtJJY9eQ== -----END RSA PRIVATE KEY-----hjh jh"}r(jjh$]h%]h&]h']h(]uh+K_h-]rh=Xcat demoCA/private/cakey.pem -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,19973A9DBBB601BA eOq9WFScNiI4/UWEUaSnGTKpJv2JYuMD3HwQox2Q3Cd4zGqVjJ6gF3exa5126cKf X/bMVnwbPpuFZPiAIvaLyCjT6pYeXTBbSzs7/GQnvEOv+nYnDUFWi0Qm92qLk0uy pFi/M1aWheN3vir2ZlAw+DW0bOOZhj8tC7Co7lMYb0YE271b6/YRPZCwQ3GXAHUJ +aMYxlUDrK45aCUa/1CZDzTgk7h9cDgx2QJSIvYMYytCfI3zsuZMJS8/4OXLL0bI lKmAc1dwB3DqGJt5XK4WJesiNfdxeCNEgAcYtEAgYZTPIApU+kTgTCIxJl2nMW7j ax+Q1z7g+4MpgG20WD633D4z4dTlDdz+dnLi0rvuvxiwt+dUhrqiML1tyi+Z6EBH jU4/cLBWev3rYfrlp4x8J9mDte0YKOk3t0wQOHqRetTsIfdtjnFp/Hu3qDmTCWjD z/g7PPoO/bg/B877J9WBPbL/1hXXFYo88M+2aGlPOgDcFdiOqbLb2DCscohMbbVr A4mgiy2kwWfIE73qiyV7yyG8FlRvr1iib+jbT3LTGf743utYAAs7HNGuOUObhoyt jYvBD7ACn35P5YX7KTqvqErwdijxYCaNBCnvmRtmYSaNw9Kv1UJTxc5Vx7YLwIPk E9KyBgKI7vPOjWBZ27+zOvNycmv1ciNtpALAw4bWtXnhCDVTHaVDy34OkheMzNCg 2cjcBFzOkMIjcI03KbTQXOFIQGlsTWXGzkNf/zBQ+KksT1MCj+zBXSCvlDASMckg kef21pGgUqPF14gKGfWX3sV4bjc1vbrRwq6zlG3nMuYqR5MtJJY9eQ== -----END RSA PRIVATE KEY-----rr}r(hUhjubaubeubj.)r}r(hXNext, generate a certificate request:: ./CA.pl -newreq Using configuration from openssl.cnf Generating a 1024 bit RSA private key ..........++++++ ..............++++++ writing new private key to 'newreq.pem' Enter PEM pass phrase: Verifying password - Enter PEM pass phrase: ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:.. Locality Name (eg, city) []:. Organization Name (eg, company) [Internet Widgits Pty Ltd]:M2Crypto Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:localhost Email Address []:admin@server.example.dom Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: Request (and private key) is in newreq.pem hj%hhh j1h"}r(h&]h']h%]h$]h(]uh+Nh,hh-]r(h\)r}r(hX&Next, generate a certificate request::hjhhh h_h"}r(h&]h']h%]h$]h(]uh+Kuh-]rh=X%Next, generate a certificate request:rr}r(hUhjubaubj)r}r(hX./CA.pl -newreq Using configuration from openssl.cnf Generating a 1024 bit RSA private key ..........++++++ ..............++++++ writing new private key to 'newreq.pem' Enter PEM pass phrase: Verifying password - Enter PEM pass phrase: ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:.. Locality Name (eg, city) []:. Organization Name (eg, company) [Internet Widgits Pty Ltd]:M2Crypto Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:localhost Email Address []:admin@server.example.dom Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: Request (and private key) is in newreq.pemhjh jh"}r(jjh$]h%]h&]h']h(]uh+Kwh-]rh=X./CA.pl -newreq Using configuration from openssl.cnf Generating a 1024 bit RSA private key ..........++++++ ..............++++++ writing new private key to 'newreq.pem' Enter PEM pass phrase: Verifying password - Enter PEM pass phrase: ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:.. Locality Name (eg, city) []:. Organization Name (eg, company) [Internet Widgits Pty Ltd]:M2Crypto Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:localhost Email Address []:admin@server.example.dom Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: Request (and private key) is in newreq.pemrr}r(hUhjubaubeubeubh\)r}r(hX\hhhhh h_h"}r(h&]h']h%]h$]h(]uh+Kh,hh-]rh=Xr}r(hUhNh+Nh,hhjubaubcdocutils.nodes block_quote r)r}r(hUhhhhh U block_quoterh"}r(h&]h']h%]h$]h(]uh+Nh,hh-]r(h\)r}r(hXKThe certificate request and private key in ``newreq.pem`` looks like this::hjhhh h_h"}r(h&]h']h%]h$]h(]uh+Kh-]r(h=X+The certificate request and private key in rr}r(hUhjubj)r}r(hX``newreq.pem``h"}r(h&]h']h%]h$]h(]uhjh-]rh=X newreq.pemrr}r(hUhjubah jubh=X looks like this:rr}r(hUhjubeubj)r}r(hXMcat newreq.pem -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,41B2874DF3D02DD4 mg611EoVkLEooSTv+qTM0Ddmm/M1jE/Jy5RD/sc3LSMhuGu9xc26OgsTJmkQuIAh J/B4lAw8G59VTG6DykeEtrG0rUBx4bggc7PKbFuiN423YjJODWcHvVgnPOzXMQt+ lY4tPl5+217MRHyx2NsWGrpkQNdu3GeSPOVMl3jeQiaXupONbwQ7rj42+X/VtAJP W4D1NNwu8aGCPyShsEXHc/fI1WDpphYWke97pOjIZVQESFZOPty5HjIYZux4U+td W81xODtq2ecJXc8fn2Wpa9y5VD1LT7oJksOuL1+Z04OVaeUe4x0swM17HlBm2kVt fe/C/L6kN27MwZhE331VjtTjSGl4/gknqQDbLOtqT06f3OISsDJETm2itllyhgzv C6Fi3N03rGFmKectijC+tws5k+P+HRG6sai33usk8xPokJqA+HYSWPz1XVlpRmv4 kdjQOdST7ovU62mOTgf3ARcduPPwuzTfxOlYONe5NioO1APVHBrInQwcpLkpOTQR vI4roIN+b75/nihUWGUJn/nbbBa2Yl0N5Gs1Tyiy9Z+CcRT2TfWKBBFlEUIFl7Mb J9fTV3DI+k+akbR4il1NkQ8EcSmCr3WpA0I9n0EHI7ZVpVaHxc0sqaPFl8YGdFHq 1Qk53C/w6+qPpDzT3yKFmG2LZytAAM1czvb6RbNRJJP2ZrpBwn/h99sUTo/yPfxY nueYmFJDm0uVNtG0icXGNUfSfnjKNTtHPAgyKGetRIC3kgJz/bo2w7EI6iEjBAzK l5TRm4x6ZJxwuXXMiJCehMMd8TC8ybwWO4AO19B3ebFFeTVsUgxSGA== -----END RSA PRIVATE KEY----- -----BEGIN CERTIFICATE REQUEST----- MIIBnTCCAQYCAQAwXTELMAkGA1UEBhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRIw EAYDVQQDEwlsb2NhbGhvc3QxJzAlBgkqhkiG9w0BCQEWGGFkbWluQHNlcnZlci5l eGFtcGxlLmRvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAr1nYY1Qrll1r uB/FqlCRrr5nvupdIN+3wF7q915tvEQoc74bnu6b8IbbGRMhzdzmvQ4SzFfVEAuM MuTHeybPq5th7YDrTNizKKxOBnqE2KYuX9X22A1Kh49soJJFg6kPb9MUgiZBiMlv tb7K3CHfgw5WagWnLl8Lb+ccvKZZl+8CAwEAAaAAMA0GCSqGSIb3DQEBBAUAA4GB AHpoRp5YS55CZpy+wdigQEwjL/wSluvo+WjtpvP0YoBMJu4VMKeZi405R7o8oEwi PdlrrliKNknFmHKIaCKTLRcU59ScA6ADEIWUzqmUzP5Cs6jrSRo3NKfg1bd09D1K 9rsQkRc9Urv9mRBIsredGnYECNeRaK5R1yzpOowninXC -----END CERTIFICATE REQUEST-----hjh jh"}r(jjh$]h%]h&]h']h(]uh+Kh-]r h=XMcat newreq.pem -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,41B2874DF3D02DD4 mg611EoVkLEooSTv+qTM0Ddmm/M1jE/Jy5RD/sc3LSMhuGu9xc26OgsTJmkQuIAh J/B4lAw8G59VTG6DykeEtrG0rUBx4bggc7PKbFuiN423YjJODWcHvVgnPOzXMQt+ lY4tPl5+217MRHyx2NsWGrpkQNdu3GeSPOVMl3jeQiaXupONbwQ7rj42+X/VtAJP W4D1NNwu8aGCPyShsEXHc/fI1WDpphYWke97pOjIZVQESFZOPty5HjIYZux4U+td W81xODtq2ecJXc8fn2Wpa9y5VD1LT7oJksOuL1+Z04OVaeUe4x0swM17HlBm2kVt fe/C/L6kN27MwZhE331VjtTjSGl4/gknqQDbLOtqT06f3OISsDJETm2itllyhgzv C6Fi3N03rGFmKectijC+tws5k+P+HRG6sai33usk8xPokJqA+HYSWPz1XVlpRmv4 kdjQOdST7ovU62mOTgf3ARcduPPwuzTfxOlYONe5NioO1APVHBrInQwcpLkpOTQR vI4roIN+b75/nihUWGUJn/nbbBa2Yl0N5Gs1Tyiy9Z+CcRT2TfWKBBFlEUIFl7Mb J9fTV3DI+k+akbR4il1NkQ8EcSmCr3WpA0I9n0EHI7ZVpVaHxc0sqaPFl8YGdFHq 1Qk53C/w6+qPpDzT3yKFmG2LZytAAM1czvb6RbNRJJP2ZrpBwn/h99sUTo/yPfxY nueYmFJDm0uVNtG0icXGNUfSfnjKNTtHPAgyKGetRIC3kgJz/bo2w7EI6iEjBAzK l5TRm4x6ZJxwuXXMiJCehMMd8TC8ybwWO4AO19B3ebFFeTVsUgxSGA== -----END RSA PRIVATE KEY----- -----BEGIN CERTIFICATE REQUEST----- MIIBnTCCAQYCAQAwXTELMAkGA1UEBhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRIw EAYDVQQDEwlsb2NhbGhvc3QxJzAlBgkqhkiG9w0BCQEWGGFkbWluQHNlcnZlci5l eGFtcGxlLmRvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAr1nYY1Qrll1r uB/FqlCRrr5nvupdIN+3wF7q915tvEQoc74bnu6b8IbbGRMhzdzmvQ4SzFfVEAuM MuTHeybPq5th7YDrTNizKKxOBnqE2KYuX9X22A1Kh49soJJFg6kPb9MUgiZBiMlv tb7K3CHfgw5WagWnLl8Lb+ccvKZZl+8CAwEAAaAAMA0GCSqGSIb3DQEBBAUAA4GB AHpoRp5YS55CZpy+wdigQEwjL/wSluvo+WjtpvP0YoBMJu4VMKeZi405R7o8oEwi PdlrrliKNknFmHKIaCKTLRcU59ScA6ADEIWUzqmUzP5Cs6jrSRo3NKfg1bd09D1K 9rsQkRc9Urv9mRBIsredGnYECNeRaK5R1yzpOowninXC -----END CERTIFICATE REQUEST-----r r }r (hUhjubaubeubh\)r }r(hX\hhhhh h_h"}r(h&]h']h%]h$]h(]uh+Kh,hh-]rh=Xr}r(hUhNh+Nh,hhj ubaubj)r}r(hUhhhhh jh"}r(h&]h']h%]h$]h(]uh+Nh,hh-]r(h\)r}r(hX6Decoding the certificate request gives the following::hjhhh h_h"}r(h&]h']h%]h$]h(]uh+Kh-]rh=X5Decoding the certificate request gives the following:rr}r(hUhjubaubj)r}r(hXopenssl req -text -noout < newreq.pem Using configuration from /usr/local/pkg/openssl/openssl.cnf Certificate Request: Data: Version: 0 (0x0) Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50: 91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e: 6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13: 21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4: c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac: 4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f: 6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9: 6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f: 0b:6f:e7:1c:bc:a6:59:97:ef Exponent: 65537 (0x10001) Attributes: a0:00 Signature Algorithm: md5WithRSAEncryption 7a:68:46:9e:58:4b:9e:42:66:9c:be:c1:d8:a0:40:4c:23:2f: fc:12:96:eb:e8:f9:68:ed:a6:f3:f4:62:80:4c:26:ee:15:30: a7:99:8b:8d:39:47:ba:3c:a0:4c:22:3d:d9:6b:ae:58:8a:36: 49:c5:98:72:88:68:22:93:2d:17:14:e7:d4:9c:03:a0:03:10: 85:94:ce:a9:94:cc:fe:42:b3:a8:eb:49:1a:37:34:a7:e0:d5: b7:74:f4:3d:4a:f6:bb:10:91:17:3d:52:bb:fd:99:10:48:b2: b7:9d:1a:76:04:08:d7:91:68:ae:51:d7:2c:e9:3a:8c:27:8a: 75:c2hjh jh"}r (jjh$]h%]h&]h']h(]uh+Kh-]r!h=Xopenssl req -text -noout < newreq.pem Using configuration from /usr/local/pkg/openssl/openssl.cnf Certificate Request: Data: Version: 0 (0x0) Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50: 91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e: 6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13: 21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4: c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac: 4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f: 6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9: 6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f: 0b:6f:e7:1c:bc:a6:59:97:ef Exponent: 65537 (0x10001) Attributes: a0:00 Signature Algorithm: md5WithRSAEncryption 7a:68:46:9e:58:4b:9e:42:66:9c:be:c1:d8:a0:40:4c:23:2f: fc:12:96:eb:e8:f9:68:ed:a6:f3:f4:62:80:4c:26:ee:15:30: a7:99:8b:8d:39:47:ba:3c:a0:4c:22:3d:d9:6b:ae:58:8a:36: 49:c5:98:72:88:68:22:93:2d:17:14:e7:d4:9c:03:a0:03:10: 85:94:ce:a9:94:cc:fe:42:b3:a8:eb:49:1a:37:34:a7:e0:d5: b7:74:f4:3d:4a:f6:bb:10:91:17:3d:52:bb:fd:99:10:48:b2: b7:9d:1a:76:04:08:d7:91:68:ae:51:d7:2c:e9:3a:8c:27:8a: 75:c2r"r#}r$(hUhjubaubeubj$)r%}r&(hUhhhhh j'h"}r'(j)U.Ustartr(Kh$]h%]h&]j*Uh']h(]j+j,uh+Kh,hh-]r)j.)r*}r+(hXNow, sign the certificate request:: ./CA.pl -sign Using configuration from openssl.cnf Enter PEM pass phrase: Check that the request matches the signature Signature ok The Subjects Distinguished Name is as follows countryName :PRINTABLE:'SG' organizationName :PRINTABLE:'M2Crypto' commonName :PRINTABLE:'localhost' emailAddress :IA5STRING:'admin@server.example.dom' Certificate is to be certified until Mar 31 02:57:30 2002 GMT (365 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated Signed certificate is in newcert.pem hj%hhh j1h"}r,(h&]h']h%]h$]h(]uh+Nh,hh-]r-(h\)r.}r/(hX#Now, sign the certificate request::hj*hhh h_h"}r0(h&]h']h%]h$]h(]uh+Kh-]r1h=X"Now, sign the certificate request:r2r3}r4(hUhj.ubaubj)r5}r6(hX./CA.pl -sign Using configuration from openssl.cnf Enter PEM pass phrase: Check that the request matches the signature Signature ok The Subjects Distinguished Name is as follows countryName :PRINTABLE:'SG' organizationName :PRINTABLE:'M2Crypto' commonName :PRINTABLE:'localhost' emailAddress :IA5STRING:'admin@server.example.dom' Certificate is to be certified until Mar 31 02:57:30 2002 GMT (365 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated Signed certificate is in newcert.pemhj*h jh"}r7(jjh$]h%]h&]h']h(]uh+Kh-]r8h=X./CA.pl -sign Using configuration from openssl.cnf Enter PEM pass phrase: Check that the request matches the signature Signature ok The Subjects Distinguished Name is as follows countryName :PRINTABLE:'SG' organizationName :PRINTABLE:'M2Crypto' commonName :PRINTABLE:'localhost' emailAddress :IA5STRING:'admin@server.example.dom' Certificate is to be certified until Mar 31 02:57:30 2002 GMT (365 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated Signed certificate is in newcert.pemr9r:}r;(hUhj5ubaubeubaubh\)r<}r=(hX\hhhhh h_h"}r>(h&]h']h%]h$]h(]uh+Kh,hh-]r?h=Xr@}rA(hUhNh+Nh,hhj<ubaubj)rB}rC(hUhhhhh jh"}rD(h&]h']h%]h$]h(]uh+Nh,hh-]rE(h\)rF}rG(hX!``newcert.pem`` looks like this::hjBhhh h_h"}rH(h&]h']h%]h$]h(]uh+Kh-]rI(j)rJ}rK(hX``newcert.pem``h"}rL(h&]h']h%]h$]h(]uhjFh-]rMh=X newcert.pemrNrO}rP(hUhjJubah jubh=X looks like this:rQrR}rS(hUhjFubeubj)rT}rU(hX cat newcert.pem Certificate: Data: Version: 3 (0x2) Serial Number: 1 (0x1) Signature Algorithm: md5WithRSAEncryption Issuer: C=SG, O=DemoCA, CN=DemoCA Certificate Master/Email=certmaster@democa.dom Validity Not Before: Mar 31 02:57:30 2001 GMT Not After : Mar 31 02:57:30 2002 GMT Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50: 91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e: 6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13: 21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4: c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac: 4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f: 6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9: 6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f: 0b:6f:e7:1c:bc:a6:59:97:ef Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: Certificate: Data: Version: 3 (0x2) Serial Number: 1 (0x1) Signature Algorithm: md5WithRSAEncryption Issuer: C=SG, O=DemoCA, CN=DemoCA Certificate Master/Email=certmaster@democa.dom Validity Not Before: Mar 31 02:57:30 2001 GMT Not After : Mar 31 02:57:30 2002 GMT Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50: 91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e: 6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13: 21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4: c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac: 4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f: 6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9: 6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f: 0b:6f:e7:1c:bc:a6:59:97:ef Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: B3:D6:89:88:2F:B1:15:40:EC:0A:C0:30:35:3A:B7:DA:72:73:1B:4D X509v3 Authority Key Identifier: keyid:F9:6A:A6:34:97:6B:BC:BB:5A:17:0D:19:FC:62:21:0B:00:B5:0E:29 DirName:/C=SG/O=DemoCA/CN=DemoCA Certificate Master/Email=certmaster@democa.dom serial:00 Signature Algorithm: md5WithRSAEncryptionhjBh jh"}rV(jjh$]h%]h&]h']h(]uh+Kh-]rWh=X cat newcert.pem Certificate: Data: Version: 3 (0x2) Serial Number: 1 (0x1) Signature Algorithm: md5WithRSAEncryption Issuer: C=SG, O=DemoCA, CN=DemoCA Certificate Master/Email=certmaster@democa.dom Validity Not Before: Mar 31 02:57:30 2001 GMT Not After : Mar 31 02:57:30 2002 GMT Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50: 91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e: 6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13: 21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4: c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac: 4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f: 6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9: 6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f: 0b:6f:e7:1c:bc:a6:59:97:ef Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: Certificate: Data: Version: 3 (0x2) Serial Number: 1 (0x1) Signature Algorithm: md5WithRSAEncryption Issuer: C=SG, O=DemoCA, CN=DemoCA Certificate Master/Email=certmaster@democa.dom Validity Not Before: Mar 31 02:57:30 2001 GMT Not After : Mar 31 02:57:30 2002 GMT Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50: 91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e: 6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13: 21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4: c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac: 4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f: 6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9: 6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f: 0b:6f:e7:1c:bc:a6:59:97:ef Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: B3:D6:89:88:2F:B1:15:40:EC:0A:C0:30:35:3A:B7:DA:72:73:1B:4D X509v3 Authority Key Identifier: keyid:F9:6A:A6:34:97:6B:BC:BB:5A:17:0D:19:FC:62:21:0B:00:B5:0E:29 DirName:/C=SG/O=DemoCA/CN=DemoCA Certificate Master/Email=certmaster@democa.dom serial:00 Signature Algorithm: md5WithRSAEncryptionrXrY}rZ(hUhjTubaubeubj$)r[}r\(hUhhhhh j'h"}r](j)U.j(Kh$]h%]h&]j*Uh']h(]j+j,uh+M<h,hh-]r^j.)r_}r`(hXIn certain situations, e.g., where your certificate and private key are to be used in an unattended SSL server, you may wish to not encrypt the private key, i.e., leave the key in the clear. This decision should be governed by your site's security policy and threat model, of course:: openssl rsa < newkey.pem > newkey2.pem read RSA key Enter PEM pass phrase: writing RSA key ``newkey2.pem`` looks like this:: cat newkey2.pem -----BEGIN RSA PRIVATE KEY----- MIICXgIBAAKBgQCvWdhjVCuWXWu4H8WqUJGuvme+6l0g37fAXur3Xm28RChzvhue 7pvwhtsZEyHN3Oa9DhLMV9UQC4wy5Md7Js+rm2HtgOtM2LMorE4GeoTYpi5f1fbY DUqHj2ygkkWDqQ9v0xSCJkGIyW+1vsrcId+DDlZqBacuXwtv5xy8plmX7wIDAQAB AoGAbAkU8w3W1Qu15Hle1bJSL7GMReoreqeblOBmMAZz4by0l6sXZXJpjWXo86f/ +dASMYTMPC4ZTYtv06N07AFbjL+kDfqDMTfzQkYMHp1LAq1Ihbq1rHWSBH5n3ekq KiY8JKpv8DR5Po1iKaXJFuDByGDENJwYbSRSpSK3P+vkWWECQQDkEUE/ZPqqqZkQ 2iWRPAsCbEID8SAraQl3DdCLYs/GgARfmmj4yUHEwkys9Jo1H8k4BdxugmaUwNi5 YQ/CVzrXAkEAxNO80ArbGxPUmr11GHG/bGBYj1DUBkHZSc7dgxZdtUCLGNxQnNsg Iwq3n6j1sUzS3UW6abQ8bivYNOUcMKJAqQJBANQxFaLU4b/NQaODQ3aoBZpAfP9L 5eFdvbet+7zjt2r5CpikgkwOfAmDuXEltx/8LevY0CllW+nErx9zJgVrwUsCQQCu 76H5JiznPBDSF2FjgHWqVVdgyW4owY3mU739LHvNBLicN/RN9VPy0Suy8/CqzKT9 lWPBXzf2k3FuUdNkRlFBAkEAmpXoybuiFR2S5Bma/ax96lVs0/VihhfC1zZP/X/F Br77+h9dIul+2DnyOl50zu0Sdzst1/7ay4JSDHyiBCMGSQ== -----END RSA PRIVATE KEY----- hj[hhh j1h"}ra(h&]h']h%]h$]h(]uh+Nh,hh-]rb(h\)rc}rd(hXIn certain situations, e.g., where your certificate and private key are to be used in an unattended SSL server, you may wish to not encrypt the private key, i.e., leave the key in the clear. This decision should be governed by your site's security policy and threat model, of course::hj_hhh h_h"}re(h&]h']h%]h$]h(]uh+M<h-]rfh=XIn certain situations, e.g., where your certificate and private key are to be used in an unattended SSL server, you may wish to not encrypt the private key, i.e., leave the key in the clear. This decision should be governed by your site’s security policy and threat model, of course:rgrh}ri(hUhjcubaubj)rj}rk(hXsopenssl rsa < newkey.pem > newkey2.pem read RSA key Enter PEM pass phrase: writing RSA keyhj_h jh"}rl(jjh$]h%]h&]h']h(]uh+MBh-]rmh=Xsopenssl rsa < newkey.pem > newkey2.pem read RSA key Enter PEM pass phrase: writing RSA keyrnro}rp(hUhjjubaubh\)rq}rr(hX!``newkey2.pem`` looks like this::rshj_hhh h_h"}rt(h&]h']h%]h$]h(]uh+MHh-]ru(j)rv}rw(hX``newkey2.pem``h"}rx(h&]h']h%]h$]h(]uhjqh-]ryh=X newkey2.pemrzr{}r|(hUhjvubah jubh=X looks like this:r}r~}r(hUhjqubeubj)r}r(hXcat newkey2.pem -----BEGIN RSA PRIVATE KEY----- MIICXgIBAAKBgQCvWdhjVCuWXWu4H8WqUJGuvme+6l0g37fAXur3Xm28RChzvhue 7pvwhtsZEyHN3Oa9DhLMV9UQC4wy5Md7Js+rm2HtgOtM2LMorE4GeoTYpi5f1fbY DUqHj2ygkkWDqQ9v0xSCJkGIyW+1vsrcId+DDlZqBacuXwtv5xy8plmX7wIDAQAB AoGAbAkU8w3W1Qu15Hle1bJSL7GMReoreqeblOBmMAZz4by0l6sXZXJpjWXo86f/ +dASMYTMPC4ZTYtv06N07AFbjL+kDfqDMTfzQkYMHp1LAq1Ihbq1rHWSBH5n3ekq KiY8JKpv8DR5Po1iKaXJFuDByGDENJwYbSRSpSK3P+vkWWECQQDkEUE/ZPqqqZkQ 2iWRPAsCbEID8SAraQl3DdCLYs/GgARfmmj4yUHEwkys9Jo1H8k4BdxugmaUwNi5 YQ/CVzrXAkEAxNO80ArbGxPUmr11GHG/bGBYj1DUBkHZSc7dgxZdtUCLGNxQnNsg Iwq3n6j1sUzS3UW6abQ8bivYNOUcMKJAqQJBANQxFaLU4b/NQaODQ3aoBZpAfP9L 5eFdvbet+7zjt2r5CpikgkwOfAmDuXEltx/8LevY0CllW+nErx9zJgVrwUsCQQCu 76H5JiznPBDSF2FjgHWqVVdgyW4owY3mU739LHvNBLicN/RN9VPy0Suy8/CqzKT9 lWPBXzf2k3FuUdNkRlFBAkEAmpXoybuiFR2S5Bma/ax96lVs0/VihhfC1zZP/X/F Br77+h9dIul+2DnyOl50zu0Sdzst1/7ay4JSDHyiBCMGSQ== -----END RSA PRIVATE KEY-----hj_h jh"}r(jjh$]h%]h&]h']h(]uh+MJh-]rh=Xcat newkey2.pem -----BEGIN RSA PRIVATE KEY----- MIICXgIBAAKBgQCvWdhjVCuWXWu4H8WqUJGuvme+6l0g37fAXur3Xm28RChzvhue 7pvwhtsZEyHN3Oa9DhLMV9UQC4wy5Md7Js+rm2HtgOtM2LMorE4GeoTYpi5f1fbY DUqHj2ygkkWDqQ9v0xSCJkGIyW+1vsrcId+DDlZqBacuXwtv5xy8plmX7wIDAQAB AoGAbAkU8w3W1Qu15Hle1bJSL7GMReoreqeblOBmMAZz4by0l6sXZXJpjWXo86f/ +dASMYTMPC4ZTYtv06N07AFbjL+kDfqDMTfzQkYMHp1LAq1Ihbq1rHWSBH5n3ekq KiY8JKpv8DR5Po1iKaXJFuDByGDENJwYbSRSpSK3P+vkWWECQQDkEUE/ZPqqqZkQ 2iWRPAsCbEID8SAraQl3DdCLYs/GgARfmmj4yUHEwkys9Jo1H8k4BdxugmaUwNi5 YQ/CVzrXAkEAxNO80ArbGxPUmr11GHG/bGBYj1DUBkHZSc7dgxZdtUCLGNxQnNsg Iwq3n6j1sUzS3UW6abQ8bivYNOUcMKJAqQJBANQxFaLU4b/NQaODQ3aoBZpAfP9L 5eFdvbet+7zjt2r5CpikgkwOfAmDuXEltx/8LevY0CllW+nErx9zJgVrwUsCQQCu 76H5JiznPBDSF2FjgHWqVVdgyW4owY3mU739LHvNBLicN/RN9VPy0Suy8/CqzKT9 lWPBXzf2k3FuUdNkRlFBAkEAmpXoybuiFR2S5Bma/ax96lVs0/VihhfC1zZP/X/F Br77+h9dIul+2DnyOl50zu0Sdzst1/7ay4JSDHyiBCMGSQ== -----END RSA PRIVATE KEY-----rr}r(hUhjubaubeubaubh\)r}r(hXThat's it! The certificate, ``newcert.pem``, and the private key - ``newkey.pem`` (encrypted) or ``newkey2.pem`` (unencrypted) - are now ready to be used. You may wish to rename the files to more intuitive names.hhhhh h_h"}r(h&]h']h%]h$]h(]uh+M]h,hh-]r(h=XThat’s it! The certificate, rr}r(hUhNh+Nh,hhjubj)r}r(hX``newcert.pem``h"}r(h&]h']h%]h$]h(]uhjh-]rh=X newcert.pemrr}r(hUhjubah jubh=X, and the private key - rr}r(hUhNh+Nh,hhjubj)r}r(hX``newkey.pem``h"}r(h&]h']h%]h$]h(]uhjh-]rh=X newkey.pemrr}r(hUhjubah jubh=X (encrypted) or rr}r(hUhNh+Nh,hhjubj)r}r(hX``newkey2.pem``h"}r(h&]h']h%]h$]h(]uhjh-]rh=X newkey2.pemrr}r(hUhjubah jubh=Xd (unencrypted) - are now ready to be used. You may wish to rename the files to more intuitive names.rr}r(hUhNh+Nh,hhjubeubh\)r}r(hXYou should also keep the CA's certificate ``demo/cacert.pem`` handy for use when developing and deploying SSL or S/MIME applications.hhhhh h_h"}r(h&]h']h%]h$]h(]uh+Mbh,hh-]r(h=X,You should also keep the CA’s certificate rr}r(hUhNh+Nh,hhjubj)r}r(hX``demo/cacert.pem``h"}r(h&]h']h%]h$]h(]uhjh-]rh=Xdemo/cacert.pemrr}r(hUhjubah jubh=XH handy for use when developing and deploying SSL or S/MIME applications.rr}r(hUhNh+Nh,hhjubeubeubhhh Usystem_messagerh"}r(h&]UlevelKh$]h%]Usourcehh']h(]UlineKUtypeUINFOruh+Kh,hh-]rh\)r}r(hX:Enumerated list start value not ordinal-1: "6" (ordinal 6)h"}r(h&]h']h%]h$]h(]uhhh-]rh=X>Enumerated list start value not ordinal-1: “6” (ordinal 6)rr}r(hUhjubah h_ubaubh)r}r(hUhhhhh jh"}r(h&]UlevelKh$]h%]Usourcehh']h(]UlineKUtypejuh+M<h,hh-]rh\)r}r(hX:Enumerated list start value not ordinal-1: "7" (ordinal 7)h"}r(h&]h']h%]h$]h(]uhjh-]rh=X>Enumerated list start value not ordinal-1: “7” (ordinal 7)rr}r(hUhjubah h_ubaubeUcurrent_sourcerNU decorationrNUautofootnote_startrKUnameidsr}r(hhhh1hh*h hh huh-]r(hhehUU transformerrNU footnote_refsr}rUrefnamesr}rUsymbol_footnotesr]rUautofootnote_refsr]rUsymbol_footnote_refsr]rU citationsr]rh,hU current_linerNUtransform_messagesr]rh)r}r(hUh"}r(h&]UlevelKh$]h%]Usourcehh']h(]UlineKUtypejuh-]rh\)r}r(hUh"}r(h&]h']h%]h$]h(]uhjh-]rh=X.Hyperlink target "howto-ca" is not referenced.rr}r(hUhjubah h_ubah jubaUreporterrNUid_startrKU autofootnotesr]rU citation_refsr}rUindirect_targetsr]rUsettingsr(cdocutils.frontend Values ror}r(Ufootnote_backlinksrKUrecord_dependenciesrNU rfc_base_urlrUhttps://tools.ietf.org/html/rU tracebackrUpep_referencesrNUstrip_commentsrNU toc_backlinksrUentryrU language_coder Uenr U datestampr NU report_levelr KU _destinationr NU halt_levelrKU strip_classesrNh:NUerror_encoding_error_handlerrUbackslashreplacerUdebugrNUembed_stylesheetrUoutput_encoding_error_handlerrUstrictrU sectnum_xformrKUdump_transformsrNU docinfo_xformrKUwarning_streamrNUpep_file_url_templaterUpep-%04drUexit_status_levelrKUconfigrNUstrict_visitorrNUcloak_email_addressesrUtrim_footnote_reference_spacer Uenvr!NUdump_pseudo_xmlr"NUexpose_internalsr#NUsectsubtitle_xformr$U source_linkr%NUrfc_referencesr&NUoutput_encodingr'Uutf-8r(U source_urlr)NUinput_encodingr*U utf-8-sigr+U_disable_configr,NU id_prefixr-UUcharacter_level_inline_markupr.U tab_widthr/KUerror_encodingr0UUTF-8r1U_sourcer2hUgettext_compactr3U generatorr4NUdump_internalsr5NU smart_quotesr6U pep_base_urlr7U https://www.python.org/dev/peps/r8Usyntax_highlightr9Ulongr:Uinput_encoding_error_handlerr;jUauto_id_prefixr<Uidr=Udoctitle_xformr>Ustrip_elements_with_classesr?NU _config_filesr@]Ufile_insertion_enabledrAU raw_enabledrBKU dump_settingsrCNubUsymbol_footnote_startrDKh$}rE(hhh*hhhh1hhhuUsubstitution_namesrF}rGh h,h"}rH(h&]h$]h%]Usourcehh']h(]uU footnotesrI]rJUrefidsrK}rLh*]rMhasub.M2Crypto-0.31.0/doc/doctrees/howto.smime.doctree0000664000175000001440000025604613236336220021745 0ustar matejusers00000000000000cdocutils.nodes document q)q}q(U nametypesq}q(Xs/mimeqNXencryptqNXsign and encryptqNX introductionq NXverifyq NXzsmimeq NXdecryptq NX%interoperating with microsoft outlookq NXsignqNXkeys and certificatesqNX#verifying origin of s/mime messagesqNX howto-smimeqX&interoperating with netscape messengerqNXdecrypt and verifyqNX1howto: programming s/mime in python with m2cryptoqNX sending s/mime messages via smtpqNXm2crypto.smimeqNX resourcesqNuUsubstitution_defsq}qUparse_messagesq]qUcurrent_sourceqNU decorationqNUautofootnote_startqKUnameidsq}q (hUs-mimeq!hUencryptq"hUsign-and-encryptq#h U introductionq$h Uverifyq%h Uzsmimeq&h Udecryptq'h U%interoperating-with-microsoft-outlookq(hUsignq)hUkeys-and-certificatesq*hU#verifying-origin-of-s-mime-messagesq+hU howto-smimeq,hU&interoperating-with-netscape-messengerq-hUdecrypt-and-verifyq.hU0howto-programming-s-mime-in-python-with-m2cryptoq/hU sending-s-mime-messages-via-smtpq0hUm2crypto-smimeq1hU resourcesq2uUchildrenq3]q4(cdocutils.nodes target q5)q6}q7(U rawsourceq8X.. _howto-smime:Uparentq9hUsourceq:X./home/matej/Build/m2crypto/doc/howto.smime.rstq;Utagnameq}q?(Uidsq@]UbackrefsqA]UdupnamesqB]UclassesqC]UnamesqD]UrefidqEh,uUlineqFKUdocumentqGhh3]ubcdocutils.nodes section qH)qI}qJ(h8Uh9hh:h;Uexpect_referenced_by_nameqK}qLhh6sh}qN(hB]hC]hA]h@]qO(h/h,ehD]qP(hheuhFKhGhUexpect_referenced_by_idqQ}qRh,h6sh3]qS(cdocutils.nodes title qT)qU}qV(h8X1HOWTO: Programming S/MIME in Python with M2CryptoqWh9hIh:h;h}qY(hB]hC]hA]h@]hD]uhFKhGhh3]qZcdocutils.nodes Text q[X1HOWTO: Programming S/MIME in Python with M2Cryptoq\q]}q^(h8Uh:NhFNhGhh9hUubaubcdocutils.nodes field_list q_)q`}qa(h8Uh9hIh:h;h}qc(hB]hC]hA]h@]hD]uhFKhGhh3]qd(cdocutils.nodes field qe)qf}qg(h8Uh9h`h:h;h}qi(hB]hC]hA]h@]hD]uhFKhGhh3]qj(cdocutils.nodes field_name qk)ql}qm(h8Xauthorh9hfh:h;h}qo(hB]hC]hA]h@]hD]uhFKh3]qph[Xauthorqqqr}qs(h8Uh9hlubaubcdocutils.nodes field_body qt)qu}qv(h8XPheng Siong Ng qwh>}qx(hB]hC]hA]h@]hD]uh9hfh3]qycdocutils.nodes paragraph qz)q{}q|(h8hwh9huh:h;h}q~(hB]hC]hA]h@]hD]uhFKh3]q(h[XPheng Siong Ng }q(UrefuriXmailto:ngps@post1.comh@]hA]hB]hC]hD]uh9h{h3]qh[Xngps@post1.comqq}q(h8Uh9hubahq}q(h8Uh9h{ubeubah}q(hB]hC]hA]h@]hD]uhFK hGhh3]q(hk)q}q(h8X copyrighth9hh:h;h}q(hB]hC]hA]h@]hD]uhFKh3]qh[X copyrightqq}q(h8Uh9hubaubht)q}q(h8X!© 2000, 2001 by Ng Pheng Siong. h>}q(hB]hC]hA]h@]hD]uh9hh3]qhz)q}q(h8X © 2000, 2001 by Ng Pheng Siong.h9hh:h;h}q(hB]hC]hA]h@]hD]uhFK h3]qh[X © 2000, 2001 by Ng Pheng Siong.qq}q(h8Uh9hubaubah}q(hB]hC]hA]h@]qh$ahD]qh auhFK hGhh3]q(hT)q}q(h8X Introductionqh9hh:h;h}q(hB]hC]hA]h@]hD]uhFK hGhh3]qh[X Introductionqq}q(h8Uh:NhFNhGhh9hubaubhz)q}q(h8X6`M2Crypto `__ is a `Python `__ interface to `OpenSSL `__. It makes available to the Python programmer SSL functionality to implement clients and servers, S/MIME v2, RSA, DSA, DH, symmetric ciphers, message digests and HMACs.h9hh:h;h}q(hB]hC]hA]h@]hD]uhFKhGhh3]q(h)q}q(h8X4`M2Crypto `__h>}q(UnameXM2CryptoUrefuriqX%https://gitlab.com/m2crypto/m2crypto/h@]hA]hB]hC]hD]uh9hh3]qh[XM2Cryptoqq}q(h8Uh9hubah`__h>}q(UnameXPythonhXhttp://www.python.orgh@]hA]hB]hC]hD]uh9hh3]qh[XPythonqƅq}q(h8Uh9hubah`__h>}q(UnameXOpenSSLhXhttp://www.openssl.orgh@]hA]hB]hC]hD]uh9hh3]qh[XOpenSSLqЅq}q(h8Uh9hubah}q(hB]hC]hA]h@]hD]uhFKhGhh3]qh[X<This document demonstrates programming S/MIME with M2Crypto.qۅq}q(h8Uh:NhFNhGhh9hubaubeubhH)q}q(h8Uh9hh:h;h}q(hB]hC]hA]h@]qh!ahD]qhauhFKhGhh3]q(hT)q}q(h8XS/MIMEqh9hh:h;h}q(hB]hC]hA]h@]hD]uhFKhGhh3]qh[XS/MIMEq酁q}q(h8Uh:NhFNhGhh9hubaubhz)q}q(h8XS/MIME - Secure Multipurpose Internet Mail Extensions [RFC 2311, RFC 2312] - provides a consistent way to send and receive secure MIME data. Based on the popular Internet MIME standard, S/MIME provides the following cryptographic security services for electronic messaging applications - *authentication*, *message integrity* and *non-repudiation of origin* (using *digital signatures*), and *privacy* and *data security* (using *encryption*).h9hh:h;h}q(hB]hC]hA]h@]hD]uhFKhGhh3]q(h[X S/MIME - Secure Multipurpose Internet Mail Extensions [RFC 2311, RFC 2312] - provides a consistent way to send and receive secure MIME data. Based on the popular Internet MIME standard, S/MIME provides the following cryptographic security services for electronic messaging applications - qq}q(h8Uh:NhFNhGhh9hubcdocutils.nodes emphasis q)q}q(h8X*authentication*h>}q(hB]hC]hA]h@]hD]uh9hh3]qh[Xauthenticationqq}q(h8Uh9hubah}r(hB]hC]hA]h@]hD]uh9hh3]rh[Xmessage integrityrr}r(h8Uh9hubah}r (hB]hC]hA]h@]hD]uh9hh3]r h[Xnon-repudiation of originr r}r(h8Uh9j ubah}r(hB]hC]hA]h@]hD]uh9hh3]rh[Xdigital signaturesrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9hh3]r h[Xprivacyr!r"}r#(h8Uh9jubah}r)(hB]hC]hA]h@]hD]uh9hh3]r*h[X data securityr+r,}r-(h8Uh9j'ubah}r3(hB]hC]hA]h@]hD]uh9hh3]r4h[X encryptionr5r6}r7(h8Uh9j1ubah}r=(hB]hC]hA]h@]r>h*ahD]r?hauhFK"hGhh3]r@(hT)rA}rB(h8XKeys and CertificatesrCh9j;h:h;h}rD(hB]hC]hA]h@]hD]uhFK"hGhh3]rEh[XKeys and CertificatesrFrG}rH(h8Uh:NhFNhGhh9jAubaubhz)rI}rJ(h8XTo create an S/MIME-signed message, you need an RSA key pair (this consists of a public key and a private key) and an X.509 certificate of said public key.h9j;h:h;h}rK(hB]hC]hA]h@]hD]uhFK$hGhh3]rLh[XTo create an S/MIME-signed message, you need an RSA key pair (this consists of a public key and a private key) and an X.509 certificate of said public key.rMrN}rO(h8Uh:NhFNhGhh9jIubaubhz)rP}rQ(h8XXTo create an S/MIME-encrypted message, you need an X.509 certificate for each recipient.h9j;h:h;h}rR(hB]hC]hA]h@]hD]uhFK(hGhh3]rSh[XXTo create an S/MIME-encrypted message, you need an X.509 certificate for each recipient.rTrU}rV(h8Uh:NhFNhGhh9jPubaubhz)rW}rX(h8XTo create an S/MIME-signed *and* -encrypted message, first create a signed message, then encrypt the signed message with the recipients' certificates.h9j;h:h;h}rY(hB]hC]hA]h@]hD]uhFK+hGhh3]rZ(h[XTo create an S/MIME-signed r[r\}r](h8Uh:NhFNhGhh9jWubh)r^}r_(h8X*and*h>}r`(hB]hC]hA]h@]hD]uh9jWh3]rah[Xandrbrc}rd(h8Uh9j^ubah}rj(hB]hC]hA]h@]hD]uhFK/hGhh3]rk(h[XIYou may generate key pairs and obtain certificates by using a commercial rlrm}rn(h8Uh:NhFNhGhh9jhubh)ro}rp(h8X*certification authority*h>}rq(hB]hC]hA]h@]hD]uh9jhh3]rrh[Xcertification authorityrsrt}ru(h8Uh9joubah}r{(hB]hC]hA]h@]hD]uhFK2hGhh3]r|h[XYou can also do so using freely-available software. For many purposes, e.g., automated S/MIME messaging by system administration processes, this approach is cheap and effective.r}r~}r(h8Uh:NhFNhGhh9jyubaubhz)r}r(h8XWe now work through using OpenSSL to generate key pairs and certificates. This assumes you have OpenSSL installed properly on your system.h9j;h:h;h}r(hB]hC]hA]h@]hD]uhFK6hGhh3]rh[XWe now work through using OpenSSL to generate key pairs and certificates. This assumes you have OpenSSL installed properly on your system.rr}r(h8Uh:NhFNhGhh9jubaubhz)r}r(h8X@First, we generate an X.509 certificate to be used for signing::rh9j;h:h;h}r(hB]hC]hA]h@]hD]uhFK:hGhh3]rh[X?First, we generate an X.509 certificate to be used for signing:rr}r(h8Uh:NhFNhGhh9jubaubcdocutils.nodes literal_block r)r}r(h8Xopenssl req -newkey rsa:1024 -nodes -x509 -days 365 -out signer.pem Using configuration from /usr/local/pkg/openssl/openssl.cnf Generating a 1024 bit RSA private key ..++++++ ....................++++++ writing new private key to 'privkey.pem' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:. Locality Name (eg, city) []:. Organization Name (eg, company) [Internet Widgits Pty Ltd]:M2Crypto Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:S/MIME Sender Email Address []:sender@example.domh9j;h:h;h}r(U xml:spacerUpreserverh@]hA]hB]hC]hD]uhFK}r(hB]hC]hA]h@]hD]uhFKThGhh3]r(h[X:This generates a 1024-bit RSA key pair, unencrypted, into rr}r(h8Uh:NhFNhGhh9jubcdocutils.nodes literal r)r}r(h8X``privkey.pem``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X privkey.pemrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[X signer.pemrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uhFKYhGhh3]r(h[XLet’s rename rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X``privkey.pem``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X privkey.pemrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[X signer.pemrr}r(h8Uh9jubah}r(jjh@]hA]hB]hC]hD]uhFK\hGhh3]rh[Xmv privkey.pem signer_key.pemrr}r(h8Uh9jubaubhz)r}r(h8X@To verify the content of ``signer.pem``, execute the following::rh9j;h:h;h}r(hB]hC]hA]h@]hD]uhFK^hGhh3]r(h[XTo verify the content of rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X``signer.pem``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X signer.pemrr}r(h8Uh9jubah}r(jjh@]hA]hB]hC]hD]uhFK`hGhh3]rh[Xmopenssl x509 -noout -text -in signer.pem Certificate: Data: Version: 3 (0x2) Serial Number: 0 (0x0) Signature Algorithm: md5WithRSAEncryption Issuer: C=SG, O=M2Crypto, CN=S/MIME Sender/Email=sender@example.dom Validity Not Before: Mar 24 12:56:16 2001 GMT Not After : Mar 24 12:56:16 2002 GMT Subject: C=SG, O=M2Crypto, CN=S/MIME Sender/Email=sender@example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:a9:d6:e2:b5:11:3b:ae:3c:e2:17:31:70:e1:6e: 01:f4:19:6d:bd:2a:42:36:2b:37:34:e2:83:1d:0d: 11:2e:b4:99:44:db:10:67:be:97:5f:5b:1a:26:33: 46:23:2f:95:04:7a:35:da:9d:f9:26:88:39:9e:17: cd:3e:eb:a8:19:8d:a8:2a:f1:43:da:55:a9:2e:2c: 65:ed:04:71:42:ce:73:53:b8:ea:7e:c7:f0:23:c6: 63:c5:5e:68:96:64:a7:b4:2a:94:26:76:eb:79:ea: e3:4e:aa:82:09:4f:44:87:4a:12:62:b5:d7:1f:ca: f2:ce:d5:ba:7e:1f:48:fd:b9 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: 29:FB:38:B6:BF:E2:40:BB:FF:D5:71:D7:D5:C4:F0:83:1A:2B:C7:99 X509v3 Authority Key Identifier: keyid:29:FB:38:B6:BF:E2:40:BB:FF:D5:71:D7:D5:C4:F0:83:1A:2B:C7:99 DirName:/C=SG/O=M2Crypto/CN=S/MIME Sender/Email=sender@example.dom serial:00 X509v3 Basic Constraints: CA:TRUE Signature Algorithm: md5WithRSAEncryption 68:c8:6b:1b:fa:7c:9a:39:35:76:18:15:c9:fd:89:97:62:db: 7a:b0:2d:13:dd:97:e8:1b:7a:9f:22:27:83:24:9d:2e:56:ec: 97:89:3c:ef:16:55:80:5a:18:7c:22:d0:f6:bb:e3:a4:e8:59: 30:ff:99:5a:93:3e:ea:bc:ee:7f:8d:d6:7d:37:8c:ac:3d:74: 80:ce:7a:99:ba:27:b9:2a:a3:71:fa:a5:25:ba:47:17:df:07: 56:96:36:fd:60:b9:6c:96:06:e8:e3:7b:9f:4b:6a:95:71:a8: 34:fc:fc:b5:88:8b:c4:3f:1e:24:f6:52:47:b2:7d:44:67:d9: 83:e8rr}r(h8Uh9jubaubhz)r}r(h8XrNext, we generate a self-signed X.509 certificate for the recipient. Note that ``privkey.pem`` will be recreated::h9j;h:h;h}r(hB]hC]hA]h@]hD]uhFKhGhh3]r(h[XONext, we generate a self-signed X.509 certificate for the recipient. Note that rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X``privkey.pem``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X privkey.pemrr}r(h8Uh9jubah}r(jjh@]hA]hB]hC]hD]uhFKhGhh3]rh[Xopenssl req -newkey rsa:1024 -nodes -x509 -days 365 -out recipient.pem Using configuration from /usr/local/pkg/openssl/openssl.cnf Generating a 1024 bit RSA private key .....................................++++++ .................++++++ writing new private key to 'privkey.pem' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:. Locality Name (eg, city) []:. Organization Name (eg, company) [Internet Widgits Pty Ltd]:M2Crypto Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:S/MIME Recipient Email Address []:recipient@example.domrr}r (h8Uh9jubaubhz)r }r (h8XAgain, rename ``privkey.pem``::r h9j;h:h;h}r (hB]hC]hA]h@]hD]uhFKhGhh3]r(h[XAgain, rename rr}r(h8Uh:NhFNhGhh9j ubj)r}r(h8X``privkey.pem``h>}r(hB]hC]hA]h@]hD]uh9j h3]rh[X privkey.pemrr}r(h8Uh9jubah}r(jjh@]hA]hB]hC]hD]uhFKhGhh3]rh[X mv privkey.pem recipient_key.pemrr }r!(h8Uh9jubaubhz)r"}r#(h8XIn the examples to follow, S/MIME Sender, ````, shall be the sender of S/MIME messages, while S/MIME Recipient, ````, shall be the recipient of S/MIME messages.h9j;h:h;h}r$(hB]hC]hA]h@]hD]uhFKhGhh3]r%(h[X*In the examples to follow, S/MIME Sender, r&r'}r((h8Uh:NhFNhGhh9j"ubj)r)}r*(h8X````h>}r+(hB]hC]hA]h@]hD]uh9j"h3]r,h[Xr-r.}r/(h8Uh9j)ubah``h>}r5(hB]hC]hA]h@]hD]uh9j"h3]r6h[Xr7r8}r9(h8Uh9j3ubah(h8XbArmed with the key pairs and certificates, we are now ready to begin programming S/MIME in Python.h9j;h:h;h}r?(hB]hC]hA]h@]hD]uhFKhGhh3]r@h[XbArmed with the key pairs and certificates, we are now ready to begin programming S/MIME in Python.rArB}rC(h8Uh:NhFNhGhh9j=ubaubcdocutils.nodes block_quote rD)rE}rF(h8Uh9j;h:h;h}rH(hB]hC]hA]h@]hD]uhFNhGhh3]rI(hz)rJ}rK(h8X**Note:** The private keys generated above are *not passphrase-protected*, i.e., they are *in the clear*. Anyone who has access to such a key can generate S/MIME-signed messages with it, and decrypt S/MIME messages encrypted to it's corresponding public key.h9jEh:h;h}rL(hB]hC]hA]h@]hD]uhFKh3]rM(cdocutils.nodes strong rN)rO}rP(h8X **Note:**h>}rQ(hB]hC]hA]h@]hD]uh9jJh3]rRh[XNote:rSrT}rU(h8Uh9jOubah}r\(hB]hC]hA]h@]hD]uh9jJh3]r]h[Xnot passphrase-protectedr^r_}r`(h8Uh9jZubah}rf(hB]hC]hA]h@]hD]uh9jJh3]rgh[X in the clearrhri}rj(h8Uh9jdubah}rp(hB]hC]hA]h@]hD]uhFKh3]rqh[XWe may passphrase-protect the keys, if we so choose. M2Crypto will prompt the user for the passphrase when such a key is being loaded.rrrs}rt(h8Uh9jnubaubeubeubhH)ru}rv(h8Uh9hh:h;h}rw(hB]hC]hA]h@]rxh1ahD]ryhauhFKhGhh3]rz(hT)r{}r|(h8XM2Crypto.SMIMEr}h9juh:h;h}r~(hB]hC]hA]h@]hD]uhFKhGhh3]rh[XM2Crypto.SMIMErr}r(h8Uh:NhFNhGhh9j{ubaubhz)r}r(h8X1The Python programmer accesses M2Crypto's S/MIME functionality through class ``SMIME`` in the module ``M2Crypto.SMIME``. Typically, an ``SMIME`` object is instantiated; the object is then set up for the intended operation: sign, encrypt, decrypt or verify; finally, the operation is invoked on the object.h9juh:h;h}r(hB]hC]hA]h@]hD]uhFKhGhh3]r(h[XOThe Python programmer accesses M2Crypto’s S/MIME functionality through class rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X ``SMIME``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[XSMIMErr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[XM2Crypto.SMIMErr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[XSMIMErr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uhFKhGhh3]r(j)r}r(h8X``M2Crypto.SMIME``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[XM2Crypto.SMIMErr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[X M2Crypto.BIOrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[X M2Crypto.BIOrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[XBIOrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[XBIOrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[XM2Crypto.BIO.MemoryBufferrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[XStringIOrr}r(h8Uh9jubah}r(hB]hC]hA]h@]rh)ahD]rhauhFKhGhh3]r(hT)r}r(h8XSignrh9jh:h;h}r(hB]hC]hA]h@]hD]uhFKhGhh3]rh[XSignrr}r(h8Uh:NhFNhGhh9jubaubhz)r}r(h8XThe following code demonstrates how to generate an S/MIME-signed message. ``randpool.dat`` contains random data which is used to seed OpenSSL's pseudo-random number generator via M2Crypto::h9jh:h;h}r(hB]hC]hA]h@]hD]uhFKhGhh3]r(h[XJThe following code demonstrates how to generate an S/MIME-signed message. rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X``randpool.dat``h>}r(hB]hC]hA]h@]hD]uh9jh3]r h[X randpool.datr r }r (h8Uh9jubah}r(jjh@]hA]hB]hC]hD]uhFKhGhh3]rh[X|from M2Crypto import BIO, Rand, SMIME def makebuf(text): return BIO.MemoryBuffer(text) # Make a MemoryBuffer of the message. buf = makebuf('a sign of our times') # Seed the PRNG. Rand.load_file('randpool.dat', -1) # Instantiate an SMIME object; set it up; sign the buffer. s = SMIME.SMIME() s.load_key('signer_key.pem', 'signer.pem') p7 = s.sign(buf, SMIME.PKCS7_DETACHED)rr}r(h8Uh9jubaubhz)r}r(h8X``p7`` now contains a *PKCS #7 signature blob* wrapped in an ``M2Crypto.SMIME.PKCS7`` object. Note that ``buf`` has been consumed by ``sign()`` and has to be recreated if it is to be used again.h9jh:h;h}r(hB]hC]hA]h@]hD]uhFKhGhh3]r(j)r}r(h8X``p7``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[Xp7rr }r!(h8Uh9jubah}r'(hB]hC]hA]h@]hD]uh9jh3]r(h[XPKCS #7 signature blobr)r*}r+(h8Uh9j%ubah}r1(hB]hC]hA]h@]hD]uh9jh3]r2h[XM2Crypto.SMIME.PKCS7r3r4}r5(h8Uh9j/ubah}r;(hB]hC]hA]h@]hD]uh9jh3]r<h[Xbufr=r>}r?(h8Uh9j9ubah}rE(hB]hC]hA]h@]hD]uh9jh3]rFh[Xsign()rGrH}rI(h8Uh9jCubah}rO(hB]hC]hA]h@]hD]uhFKhGhh3]rPh[XWe may now send the signed message via SMTP. In these examples, we shall not do so; instead, we’ll render the S/MIME output in mail-friendly format, and pretend that our messages are sent and received correctly:rQrR}rS(h8Uh:NhFNhGhh9jMubaubj)rT}rU(h8XV# Recreate buf. buf = makebuf('a sign of our times') # Output p7 in mail-friendly format. out = BIO.MemoryBuffer() out.write('From: sender@example.dom\n') out.write('To: recipient@example.dom\n') out.write('Subject: M2Crypto S/MIME testing\n') s.write(out, p7, buf) print(out.read()) # Save the PRNG's state. Rand.save_file('randpool.dat')h9jh:h;h}rV(jjh@]hA]hB]hC]hD]uhFKhGhh3]rWh[XV# Recreate buf. buf = makebuf('a sign of our times') # Output p7 in mail-friendly format. out = BIO.MemoryBuffer() out.write('From: sender@example.dom\n') out.write('To: recipient@example.dom\n') out.write('Subject: M2Crypto S/MIME testing\n') s.write(out, p7, buf) print(out.read()) # Save the PRNG's state. Rand.save_file('randpool.dat')rXrY}rZ(h8Uh9jTubaubhz)r[}r\(h8XHere's the output::r]h9jh:h;h}r^(hB]hC]hA]h@]hD]uhFKhGhh3]r_h[XHere’s the output:r`ra}rb(h8Uh:NhFNhGhh9j[ubaubj)rc}rd(h8XFrom: sender@example.dom To: recipient@example.dom Subject: M2Crypto S/MIME testing MIME-Version: 1.0 Content-Type: multipart/signed ; protocol="application/x-pkcs7-signature" ; micalg=sha1 ; boundary="----3C93156FC7B4EBF49FE9C7DB7F503087" This is an S/MIME signed message ------3C93156FC7B4EBF49FE9C7DB7F503087 a sign of our times ------3C93156FC7B4EBF49FE9C7DB7F503087 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" MIIE8AYJKoZIhvcNAQcCoIIE4TCCBN0CAQExCzAJBgUrDgMCGgUAMCIGCSqGSIb3 DQEHAaAVBBNhIHNpZ24gb2Ygb3VyIHRpbWVzoIIC5zCCAuMwggJMoAMCAQICAQAw DQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRv MRYwFAYDVQQDEw1TL01JTUUgU2VuZGVyMSEwHwYJKoZIhvcNAQkBFhJzZW5kZXJA ZXhhbXBsZS5kb20wHhcNMDEwMzMxMTE0MDMzWhcNMDIwMzMxMTE0MDMzWjBbMQsw CQYDVQQGEwJTRzERMA8GA1UEChMITTJDcnlwdG8xFjAUBgNVBAMTDVMvTUlNRSBT ZW5kZXIxITAfBgkqhkiG9w0BCQEWEnNlbmRlckBleGFtcGxlLmRvbTCBnzANBgkq hkiG9w0BAQEFAAOBjQAwgYkCgYEA5c5Tj1CHTSOxa1q2q0FYiwMWYHptJpJcvtZm UwrgU5sHrA8OnCM0cDXEj0KPf3cfNjHffB8HWMzI4UEgNmFXQNsxoGZ+iqwxLlNj y9Mh7eFW/Bjq5hNXbouSlQ0rWBRkoxV64y+t6lQehb32WfYXQbKFxFJSXzSxOx3R 8YhSPd0CAwEAAaOBtjCBszAdBgNVHQ4EFgQUXOyolL1t4jaBwZFRM7MS8nBLzUow gYMGA1UdIwR8MHqAFFzsqJS9beI2gcGRUTOzEvJwS81KoV+kXTBbMQswCQYDVQQG EwJTRzERMA8GA1UEChMITTJDcnlwdG8xFjAUBgNVBAMTDVMvTUlNRSBTZW5kZXIx ITAfBgkqhkiG9w0BCQEWEnNlbmRlckBleGFtcGxlLmRvbYIBADAMBgNVHRMEBTAD AQH/MA0GCSqGSIb3DQEBBAUAA4GBAHo3DrCHR86fSTVAvfiXdSswWqKtCEhUHRdC TLFGl4hDk2GyZxaFuqZwiURz/H7nMicymI2wkz8H/wyHFg8G3BIehURpj2v/ZWXY eovbgS7EZALVVkDj4hNl/IIHWd6Gtv1UODf7URbxtl3hQ9/eTWITrefT1heuPnar 8czydsOLMYIBujCCAbYCAQEwYDBbMQswCQYDVQQGEwJTRzERMA8GA1UEChMITTJD cnlwdG8xFjAUBgNVBAMTDVMvTUlNRSBTZW5kZXIxITAfBgkqhkiG9w0BCQEWEnNl bmRlckBleGFtcGxlLmRvbQIBADAJBgUrDgMCGgUAoIGxMBgGCSqGSIb3DQEJAzEL BgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTAxMDMzMTExNDUwMlowIwYJKoZI hvcNAQkEMRYEFOoeRUd8ExIYXfQq8BTFuKWrSP3iMFIGCSqGSIb3DQEJDzFFMEMw CgYIKoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsO AwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIGAQpU8hFUtLCF6hO2t ec9EYJ/Imqqiiw+BxWxkUUVT81Vbjwdn9JST6+sztM5JRP2ZW+b4txEjZriYC8f3 kv95YMTGbIsuWkJ93GrbvqoJ/CxO23r9WWRnZEm/1EZN9ZmlrYqzBTxnNRmP3Dhj cW8kzZwH+2/2zz2G7x1HxRWH95A= ------3C93156FC7B4EBF49FE9C7DB7F503087--h9jh:h;h}re(jjh@]hA]hB]hC]hD]uhFKhGhh3]rfh[XFrom: sender@example.dom To: recipient@example.dom Subject: M2Crypto S/MIME testing MIME-Version: 1.0 Content-Type: multipart/signed ; protocol="application/x-pkcs7-signature" ; micalg=sha1 ; boundary="----3C93156FC7B4EBF49FE9C7DB7F503087" This is an S/MIME signed message ------3C93156FC7B4EBF49FE9C7DB7F503087 a sign of our times ------3C93156FC7B4EBF49FE9C7DB7F503087 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" MIIE8AYJKoZIhvcNAQcCoIIE4TCCBN0CAQExCzAJBgUrDgMCGgUAMCIGCSqGSIb3 DQEHAaAVBBNhIHNpZ24gb2Ygb3VyIHRpbWVzoIIC5zCCAuMwggJMoAMCAQICAQAw DQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRv MRYwFAYDVQQDEw1TL01JTUUgU2VuZGVyMSEwHwYJKoZIhvcNAQkBFhJzZW5kZXJA ZXhhbXBsZS5kb20wHhcNMDEwMzMxMTE0MDMzWhcNMDIwMzMxMTE0MDMzWjBbMQsw CQYDVQQGEwJTRzERMA8GA1UEChMITTJDcnlwdG8xFjAUBgNVBAMTDVMvTUlNRSBT ZW5kZXIxITAfBgkqhkiG9w0BCQEWEnNlbmRlckBleGFtcGxlLmRvbTCBnzANBgkq hkiG9w0BAQEFAAOBjQAwgYkCgYEA5c5Tj1CHTSOxa1q2q0FYiwMWYHptJpJcvtZm UwrgU5sHrA8OnCM0cDXEj0KPf3cfNjHffB8HWMzI4UEgNmFXQNsxoGZ+iqwxLlNj y9Mh7eFW/Bjq5hNXbouSlQ0rWBRkoxV64y+t6lQehb32WfYXQbKFxFJSXzSxOx3R 8YhSPd0CAwEAAaOBtjCBszAdBgNVHQ4EFgQUXOyolL1t4jaBwZFRM7MS8nBLzUow gYMGA1UdIwR8MHqAFFzsqJS9beI2gcGRUTOzEvJwS81KoV+kXTBbMQswCQYDVQQG EwJTRzERMA8GA1UEChMITTJDcnlwdG8xFjAUBgNVBAMTDVMvTUlNRSBTZW5kZXIx ITAfBgkqhkiG9w0BCQEWEnNlbmRlckBleGFtcGxlLmRvbYIBADAMBgNVHRMEBTAD AQH/MA0GCSqGSIb3DQEBBAUAA4GBAHo3DrCHR86fSTVAvfiXdSswWqKtCEhUHRdC TLFGl4hDk2GyZxaFuqZwiURz/H7nMicymI2wkz8H/wyHFg8G3BIehURpj2v/ZWXY eovbgS7EZALVVkDj4hNl/IIHWd6Gtv1UODf7URbxtl3hQ9/eTWITrefT1heuPnar 8czydsOLMYIBujCCAbYCAQEwYDBbMQswCQYDVQQGEwJTRzERMA8GA1UEChMITTJD cnlwdG8xFjAUBgNVBAMTDVMvTUlNRSBTZW5kZXIxITAfBgkqhkiG9w0BCQEWEnNl bmRlckBleGFtcGxlLmRvbQIBADAJBgUrDgMCGgUAoIGxMBgGCSqGSIb3DQEJAzEL BgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTAxMDMzMTExNDUwMlowIwYJKoZI hvcNAQkEMRYEFOoeRUd8ExIYXfQq8BTFuKWrSP3iMFIGCSqGSIb3DQEJDzFFMEMw CgYIKoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsO AwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIGAQpU8hFUtLCF6hO2t ec9EYJ/Imqqiiw+BxWxkUUVT81Vbjwdn9JST6+sztM5JRP2ZW+b4txEjZriYC8f3 kv95YMTGbIsuWkJ93GrbvqoJ/CxO23r9WWRnZEm/1EZN9ZmlrYqzBTxnNRmP3Dhj cW8kzZwH+2/2zz2G7x1HxRWH95A= ------3C93156FC7B4EBF49FE9C7DB7F503087--rgrh}ri(h8Uh9jcubaubeubhH)rj}rk(h8Uh9hh:h;h}rl(hB]hC]hA]h@]rmh%ahD]rnh auhFM-hGhh3]ro(hT)rp}rq(h8XVerifyrrh9jjh:h;h}rs(hB]hC]hA]h@]hD]uhFM-hGhh3]rth[XVerifyrurv}rw(h8Uh:NhFNhGhh9jpubaubhz)rx}ry(h8XYAssume the above output has been saved into ``sign.p7``. Let's now verify the signature::h9jjh:h;h}rz(hB]hC]hA]h@]hD]uhFM/hGhh3]r{(h[X,Assume the above output has been saved into r|r}}r~(h8Uh:NhFNhGhh9jxubj)r}r(h8X ``sign.p7``h>}r(hB]hC]hA]h@]hD]uh9jxh3]rh[Xsign.p7rr}r(h8Uh9jubah}r(jjh@]hA]hB]hC]hD]uhFM2hGhh3]rh[Xfrom M2Crypto import SMIME, X509 # Instantiate an SMIME object. s = SMIME.SMIME() # Load the signer's cert. x509 = X509.load_cert('signer.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) # Load the signer's CA cert. In this case, because the signer's # cert is self-signed, it is the signer's cert itself. st = X509.X509_Store() st.load_info('signer.pem') s.set_x509_store(st) # Load the data, verify it. p7, data = SMIME.smime_load_pkcs7('sign.p7') v = s.verify(p7, data) print(v) print(data) print(data.read())rr}r(h8Uh9jubaubhz)r}r(h8X(Here's the output of the above program::rh9jjh:h;h}r(hB]hC]hA]h@]hD]uhFMJhGhh3]rh[X)Here’s the output of the above program:rr}r(h8Uh:NhFNhGhh9jubaubj)r}r(h8XPa sign of our times a sign of our timesh9jjh:h;h}r(jjh@]hA]hB]hC]hD]uhFMLhGhh3]rh[XPa sign of our times a sign of our timesrr}r(h8Uh9jubaubhz)r}r(h8XSuppose, instead of loading ``signer.pem`` above, we load ``recipient.pem``. That is, we do a global substitution of ``recipient.pem`` for ``signer.pem`` in the above program. Here's the modified program's output::h9jjh:h;h}r(hB]hC]hA]h@]hD]uhFMPhGhh3]r(h[XSuppose, instead of loading rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X``signer.pem``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X signer.pemrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[X recipient.pemrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[X recipient.pemrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[X signer.pemrr}r(h8Uh9jubah}r(jjh@]hA]hB]hC]hD]uhFMUhGhh3]rh[XhTraceback (most recent call last): File "./verify.py", line 22, in ? v = s.verify(p7) File "/usr/local/home/ngps/prog/m2/M2Crypto/SMIME.py", line 205, in verify raise SMIME_Error, Err.get_error() M2Crypto.SMIME.SMIME_Error: 312:error:21075075:PKCS7 routines:PKCS7_verify:certificate verify error:pk7_smime.c:213:Verify error:self signed certificaterr}r(h8Uh9jubaubhz)r}r(h8XAs displayed, the error is generated by line 213 of OpenSSL's ``pk7_smime.c`` (as of OpenSSL 0.9.6); if you are a C programmer, you may wish to look up the C source to explore OpenSSL's S/MIME implementation and understand why the error message is worded thus.h9jjh:h;h}r(hB]hC]hA]h@]hD]uhFM]hGhh3]r(h[X@As displayed, the error is generated by line 213 of OpenSSL’s rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X``pk7_smime.c``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X pk7_smime.crr}r(h8Uh9jubah}r(hB]hC]hA]h@]rh"ahD]rhauhFMchGhh3]r(hT)r}r(h8XEncryptrh9jh:h;h}r(hB]hC]hA]h@]hD]uhFMchGhh3]rh[XEncryptrr}r(h8Uh:NhFNhGhh9jubaubhz)r}r(h8X@We now demonstrate how to generate an S/MIME-encrypted message::rh9jh:h;h}r(hB]hC]hA]h@]hD]uhFMehGhh3]rh[X?We now demonstrate how to generate an S/MIME-encrypted message:rr}r(h8Uh:NhFNhGhh9jubaubj)r}r(h8X8from M2Crypto import BIO, Rand, SMIME, X509 def makebuf(text): return BIO.MemoryBuffer(text) # Make a MemoryBuffer of the message. buf = makebuf('a sign of our times') # Seed the PRNG. Rand.load_file('randpool.dat', -1) # Instantiate an SMIME object. s = SMIME.SMIME() # Load target cert to encrypt to. x509 = X509.load_cert('recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) # Set cipher: 3-key triple-DES in CBC mode. s.set_cipher(SMIME.Cipher('des_ede3_cbc')) # Encrypt the buffer. p7 = s.encrypt(buf) # Output p7 in mail-friendly format. out = BIO.MemoryBuffer() out.write('From: sender@example.dom\n') out.write('To: recipient@example.dom\n') out.write('Subject: M2Crypto S/MIME testing\n') s.write(out, p7) print(out.read()) # Save the PRNG's state. Rand.save_file('randpool.dat')h9jh:h;h}r(jjh@]hA]hB]hC]hD]uhFMghGhh3]rh[X8from M2Crypto import BIO, Rand, SMIME, X509 def makebuf(text): return BIO.MemoryBuffer(text) # Make a MemoryBuffer of the message. buf = makebuf('a sign of our times') # Seed the PRNG. Rand.load_file('randpool.dat', -1) # Instantiate an SMIME object. s = SMIME.SMIME() # Load target cert to encrypt to. x509 = X509.load_cert('recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) # Set cipher: 3-key triple-DES in CBC mode. s.set_cipher(SMIME.Cipher('des_ede3_cbc')) # Encrypt the buffer. p7 = s.encrypt(buf) # Output p7 in mail-friendly format. out = BIO.MemoryBuffer() out.write('From: sender@example.dom\n') out.write('To: recipient@example.dom\n') out.write('Subject: M2Crypto S/MIME testing\n') s.write(out, p7) print(out.read()) # Save the PRNG's state. Rand.save_file('randpool.dat')rr}r(h8Uh9jubaubhz)r}r(h8X(Here's the output of the above program::rh9jh:h;h}r(hB]hC]hA]h@]hD]uhFMhGhh3]rh[X)Here’s the output of the above program:rr }r (h8Uh:NhFNhGhh9jubaubj)r }r (h8XFrom: sender@example.dom To: recipient@example.dom Subject: M2Crypto S/MIME testing MIME-Version: 1.0 Content-Disposition: attachment; filename="smime.p7m" Content-Type: application/x-pkcs7-mime; name="smime.p7m" Content-Transfer-Encoding: base64 MIIBVwYJKoZIhvcNAQcDoIIBSDCCAUQCAQAxggEAMIH9AgEAMGYwYTELMAkGA1UE BhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRkwFwYDVQQDExBTL01JTUUgUmVjaXBp ZW50MSQwIgYJKoZIhvcNAQkBFhVyZWNpcGllbnRAZXhhbXBsZS5kb20CAQAwDQYJ KoZIhvcNAQEBBQAEgYCBaXZ+qjpBEZwdP7gjfzfAtQitESyMwo3i+LBOw6sSDir6 FlNDPCnkrTvqDX3Rt6X6vBtTCYOm+qiN7ujPkOU61cN7h8dvHR8YW9+0IPY80/W0 lZ/HihSRgwTNd7LnxUUcPx8YV1id0dlmP0Hz+Lg+mHf6rqaR//JcYhX9vW4XvjA7 BgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECMN+qya6ADywgBgHr9Jkhwn5Gsdu7BwX nIQfYTYcdL9I5Sk=h9jh:h;h}r (jjh@]hA]hB]hC]hD]uhFMhGhh3]rh[XFrom: sender@example.dom To: recipient@example.dom Subject: M2Crypto S/MIME testing MIME-Version: 1.0 Content-Disposition: attachment; filename="smime.p7m" Content-Type: application/x-pkcs7-mime; name="smime.p7m" Content-Transfer-Encoding: base64 MIIBVwYJKoZIhvcNAQcDoIIBSDCCAUQCAQAxggEAMIH9AgEAMGYwYTELMAkGA1UE BhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRkwFwYDVQQDExBTL01JTUUgUmVjaXBp ZW50MSQwIgYJKoZIhvcNAQkBFhVyZWNpcGllbnRAZXhhbXBsZS5kb20CAQAwDQYJ KoZIhvcNAQEBBQAEgYCBaXZ+qjpBEZwdP7gjfzfAtQitESyMwo3i+LBOw6sSDir6 FlNDPCnkrTvqDX3Rt6X6vBtTCYOm+qiN7ujPkOU61cN7h8dvHR8YW9+0IPY80/W0 lZ/HihSRgwTNd7LnxUUcPx8YV1id0dlmP0Hz+Lg+mHf6rqaR//JcYhX9vW4XvjA7 BgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECMN+qya6ADywgBgHr9Jkhwn5Gsdu7BwX nIQfYTYcdL9I5Sk=rr}r(h8Uh9j ubaubeubhH)r}r(h8Uh9hh:h;h}r(hB]hC]hA]h@]rh'ahD]rh auhFMhGhh3]r(hT)r}r(h8XDecryptrh9jh:h;h}r(hB]hC]hA]h@]hD]uhFMhGhh3]rh[XDecryptrr}r(h8Uh:NhFNhGhh9jubaubhz)r }r!(h8XXAssume the above output has been saved into ``encrypt.p7``. Decrypt the message thusly::h9jh:h;h}r"(hB]hC]hA]h@]hD]uhFMhGhh3]r#(h[X,Assume the above output has been saved into r$r%}r&(h8Uh:NhFNhGhh9j ubj)r'}r((h8X``encrypt.p7``h>}r)(hB]hC]hA]h@]hD]uh9j h3]r*h[X encrypt.p7r+r,}r-(h8Uh9j'ubah}r3(jjh@]hA]hB]hC]hD]uhFMhGhh3]r4h[X!from M2Crypto import BIO, SMIME, X509 # Instantiate an SMIME object. s = SMIME.SMIME() # Load private key and cert. s.load_key('recipient_key.pem', 'recipient.pem') # Load the encrypted data. p7, data = SMIME.smime_load_pkcs7('encrypt.p7') # Decrypt p7. out = s.decrypt(p7) print(out)r5r6}r7(h8Uh9j1ubaubhz)r8}r9(h8XHere's the output::r:h9jh:h;h}r;(hB]hC]hA]h@]hD]uhFMhGhh3]r<h[XHere’s the output:r=r>}r?(h8Uh:NhFNhGhh9j8ubaubj)r@}rA(h8Xa sign of our timesh9jh:h;h}rB(jjh@]hA]hB]hC]hD]uhFMhGhh3]rCh[Xa sign of our timesrDrE}rF(h8Uh9j@ubaubeubhH)rG}rH(h8Uh9hh:h;h}rI(hB]hC]hA]h@]rJh#ahD]rKhauhFMhGhh3]rL(hT)rM}rN(h8XSign and EncryptrOh9jGh:h;h}rP(hB]hC]hA]h@]hD]uhFMhGhh3]rQh[XSign and EncryptrRrS}rT(h8Uh:NhFNhGhh9jMubaubhz)rU}rV(h8X;Here's how to generate an S/MIME-signed/encrypted message::rWh9jGh:h;h}rX(hB]hC]hA]h@]hD]uhFMhGhh3]rYh[X<Here’s how to generate an S/MIME-signed/encrypted message:rZr[}r\(h8Uh:NhFNhGhh9jUubaubj)r]}r^(h8X@from M2Crypto import BIO, Rand, SMIME, X509 def makebuf(text): return BIO.MemoryBuffer(text) # Make a MemoryBuffer of the message. buf = makebuf('a sign of our times') # Seed the PRNG. Rand.load_file('randpool.dat', -1) # Instantiate an SMIME object. s = SMIME.SMIME() # Load signer's key and cert. Sign the buffer. s.load_key('signer_key.pem', 'signer.pem') p7 = s.sign(buf) # Load target cert to encrypt the signed message to. x509 = X509.load_cert('recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) # Set cipher: 3-key triple-DES in CBC mode. s.set_cipher(SMIME.Cipher('des_ede3_cbc')) # Create a temporary buffer. tmp = BIO.MemoryBuffer() # Write the signed message into the temporary buffer. s.write(tmp, p7) # Encrypt the temporary buffer. p7 = s.encrypt(tmp) # Output p7 in mail-friendly format. out = BIO.MemoryBuffer() out.write('From: sender@example.dom\n') out.write('To: recipient@example.dom\n') out.write('Subject: M2Crypto S/MIME testing\n') s.write(out, p7) print(out.read()) # Save the PRNG's state. Rand.save_file('randpool.dat')h9jGh:h;h}r_(jjh@]hA]hB]hC]hD]uhFMhGhh3]r`h[X@from M2Crypto import BIO, Rand, SMIME, X509 def makebuf(text): return BIO.MemoryBuffer(text) # Make a MemoryBuffer of the message. buf = makebuf('a sign of our times') # Seed the PRNG. Rand.load_file('randpool.dat', -1) # Instantiate an SMIME object. s = SMIME.SMIME() # Load signer's key and cert. Sign the buffer. s.load_key('signer_key.pem', 'signer.pem') p7 = s.sign(buf) # Load target cert to encrypt the signed message to. x509 = X509.load_cert('recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) # Set cipher: 3-key triple-DES in CBC mode. s.set_cipher(SMIME.Cipher('des_ede3_cbc')) # Create a temporary buffer. tmp = BIO.MemoryBuffer() # Write the signed message into the temporary buffer. s.write(tmp, p7) # Encrypt the temporary buffer. p7 = s.encrypt(tmp) # Output p7 in mail-friendly format. out = BIO.MemoryBuffer() out.write('From: sender@example.dom\n') out.write('To: recipient@example.dom\n') out.write('Subject: M2Crypto S/MIME testing\n') s.write(out, p7) print(out.read()) # Save the PRNG's state. Rand.save_file('randpool.dat')rarb}rc(h8Uh9j]ubaubhz)rd}re(h8X(Here's the output of the above program::rfh9jGh:h;h}rg(hB]hC]hA]h@]hD]uhFMhGhh3]rhh[X)Here’s the output of the above program:rirj}rk(h8Uh:NhFNhGhh9jdubaubj)rl}rm(h8X From: sender@example.dom To: recipient@example.dom Subject: M2Crypto S/MIME testing MIME-Version: 1.0 Content-Disposition: attachment; filename="smime.p7m" Content-Type: application/x-pkcs7-mime; name="smime.p7m" Content-Transfer-Encoding: base64 MIIIwwYJKoZIhvcNAQcDoIIItDCCCLACAQAxggEAMIH9AgEAMGYwYTELMAkGA1UE BhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRkwFwYDVQQDExBTL01JTUUgUmVjaXBp ZW50MSQwIgYJKoZIhvcNAQkBFhVyZWNpcGllbnRAZXhhbXBsZS5kb20CAQAwDQYJ KoZIhvcNAQEBBQAEgYBlZlGupFphwhsGtIAPvDExN61qisz3oem88xoXkUW0SzoR B9zJFFAuQTWzdNJgrKKYikhWjDojaAc/PFl1K5dYxRgtZLB36ULJD/v/yWmxnjz8 TvtK+Wbal2P/MH2pZ4LVERXa/snTElhCawUlwtiFz/JvY5CiF/dcwd+AwFQq4jCC B6UGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIRF525UfwszaAggeA85RmX6AXQMxb eBDz/LJeCgc3RqU1UwIsbKMquIs1S46Ebbm5nP75izPnujOkJ2hv+LNzqOWADmOl +CnGEq1qxTyduIgUDA2nBgCL/gVyVy+/XC9dtImUUTxtxLgYtB0ujkBNsOaENOlM fv4SGM3jkR+K/xlYG6HHzZGbfYyNGj2Y7yMZ1rL1m8SnRNmkCysKGTrudeNf6wT9 J6wO9DzLTioz3ZnVr3LjsSKIb4tIp4ugqNJaLuW7m3FtZ3MAgxN68hBbJs8TZ8tL V/0jwUqS+grcgZEb9ymfcedxahtDUfHjRkpDpsxZzVVGkSBNcbQu92oByQVnRQ8m wrYLp3/eawM5AvuV7HNpTT5ZR+1t8luishHN9899IMP2Vyg0Ub67FqFypYmM2cm2 sjAI4KpfvT00XFNvgLuYwYEKs9syGTO7hiHNQKcF44F5LYv6nTFwmFQB11dAtY9V ull4D2CLDx9OvyNyKwdEZB5dyV0r/uKIdkhST60V2Q9KegpzgFpoZtSKM/HPYSVH 1Bc9f3Q/GqZCvNZZCMx8UvRjQR8dRWDSmPJ0VXG1+wJ+fCmSPP3AuQ1/VsgPRqx2 56VrpGPpGut40hV8xQFbWIZ2whwWLKPFAHj8B79ZtFUzUrU6Z2rNpvv8inHc/+S/ b6GR5s8/gucRblvd7n3OFNX5UJmPmcw9zWbu/1Dr9DY8l0nAQh21y5FGSS8B1wdE oD2M3Lp7JbwjQbRtnDhImqul2S4yu+m+wDD1aR2K4k3GAI7KKgOBWT0+BDClcn8A 4Ju6/YUbj33YlMPJgnGijLnolFy0hNW7TmWqR+8tSI3wO5eNKg4qwBnarqc3vgCV quVxINAXyGQCO9lzdw6hudk8/+BlweGdqhONaIWbK5z1L/SfQo6LC9MTsj7FJydq bc+kEbfZS8aSq7uc9axW6Ti0eAPJ8EVHtwhSBgZQRweKFBXs6HbbhMIdc4N0M7Oq UiFXaF6s4n2uihVP6TqXtHEjTpZoC7pC+HCYiuKXUJtaqtXBOh+y3KLvHk09YL6D XmTDg+UTiFsh4jKKm/BhdelbR5JbpJcj5AId76Mfr8+F/1g9ePOvsWHpQr/oIQTo xEkaxCmzEgP0b6caMWfMUQrbVGxBBNcqKc/ir9fGGOPHATzzq/xLcQYvK1tZhd/D ah/gpMPndsyvVCEuFPluWyDiM0VkwHgC2/3pJIYFHaxK64IutmPsy393rHMEB4kN AHau6kWK+yL9qEVH1pP2zvswQ12P7gjt3T/G3bGsmvlXkEfztfjkXo6XnjcBNf5y G+974AKLcjnk1gzIgarz+lAMY57Gkw4oNDMrTqVQ2OJQlvOSbllPXzH+aAiavB8W ZPECLLwHxD4B1AuaiAArgKl935u/TOB+yQOR8JgGsUzROyJqHJ/SC51HkebgCkL1 aggtjgPlIBEXLZAlhpWLZ9lAQyrQpvCVJYwaOvfMmvRav4NAFNoZ2/Q7S4Tn1z+U XX+f+GD58P4MPMhU5IKnz4yH4nlHnAiTEvcs85TZUAXze9g/uBOwZITeGtyLi52S aETIr4v7SgXMepX7ThQ1Pv/jddsK/u4j2F34u0XktwCP+UrbfkE2mocdXvdzxbmd tZSznK2qwgVSsPOs9MhUaepbnjmNBFFBrULhrUtSglM/VX/rWNiyh0aw4XYyHhIt 9ZNlfEjKjJ67VEMBxBJ/ieUCouRGCxPYD1j65VT7oB3ZiyPu2F2nlUIcYNqPg1Sd QBCrdaOXdJ0uLwyTAUeVE+wMbgscLvWsfZcCCJHAvw9NHFMUcnrdWxAYMVETNUOn uryVAK7VfOldaz6z3NOSOi6nonNeHpR/sipBa4ik5xCRLT9e0S2QJgRvO9GyfAqz 3DIzHtxIGePFzTiUYUTxS3i2gnMX2PEe3ChTLlYWD3jNeAKz0iOzpDphIF2xHLLQ 1tCAqBmq/vUzALyDFFdFuTIqQZys4z/u4Dmyq9uXs421eN3v2hkVHvDy8uT2Ot29 lg4Q5YezR1EjaW//9guL1BXbcKrTEdtxeNqtem7SpZOMTSwD2lhB8z65GrX90Cyt EMmaRSGYEdf5h1afL1SmKOMskbqxe1D2jG/vsXC7XX7xO/ioy0BdiJcYN1JiMOHJ EOzFol5I20YkiV6j+cenfQFwc/NkaSxEkR8AUHJSbvUmRQRl6r0nnsFpZdR1w7pv wkaT+eOpZynO4mY/ZtF6MpXJsixi6L4ZYXEbS6yHf+XGFfB0okILylmwv2bf6+Mq nqXlmGj3Jwq7X9/+2BDqvfpFFX5lSmItKZAobLdssjFR6roJxOqRsGia2aZ+0+U5 VhgdITtnElgtHBaeZU5rHDswgdeLVBP+rGWnKxpJ+pLtNNi25sPYRcWFL6Erd25u eXiY8GEIr+u7rqBWpc9HR34sAPRs3ubbCUleT748keCbx247ImBtiDctZxcc1O86 +0QjHP6HUT7FSo/FmT7a120S3Gd2jixGh06l/9ij5Z6mJa7Rm7TTbSjup/XISnOT MKWcbI1nfVOhCv3xDq2eLae+s0oVoc041ceRazqFM2TL/Z6UXRMEh9jGh:h;h}rn(jjh@]hA]hB]hC]hD]uhFMhGhh3]roh[X From: sender@example.dom To: recipient@example.dom Subject: M2Crypto S/MIME testing MIME-Version: 1.0 Content-Disposition: attachment; filename="smime.p7m" Content-Type: application/x-pkcs7-mime; name="smime.p7m" Content-Transfer-Encoding: base64 MIIIwwYJKoZIhvcNAQcDoIIItDCCCLACAQAxggEAMIH9AgEAMGYwYTELMAkGA1UE BhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRkwFwYDVQQDExBTL01JTUUgUmVjaXBp ZW50MSQwIgYJKoZIhvcNAQkBFhVyZWNpcGllbnRAZXhhbXBsZS5kb20CAQAwDQYJ KoZIhvcNAQEBBQAEgYBlZlGupFphwhsGtIAPvDExN61qisz3oem88xoXkUW0SzoR B9zJFFAuQTWzdNJgrKKYikhWjDojaAc/PFl1K5dYxRgtZLB36ULJD/v/yWmxnjz8 TvtK+Wbal2P/MH2pZ4LVERXa/snTElhCawUlwtiFz/JvY5CiF/dcwd+AwFQq4jCC B6UGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIRF525UfwszaAggeA85RmX6AXQMxb eBDz/LJeCgc3RqU1UwIsbKMquIs1S46Ebbm5nP75izPnujOkJ2hv+LNzqOWADmOl +CnGEq1qxTyduIgUDA2nBgCL/gVyVy+/XC9dtImUUTxtxLgYtB0ujkBNsOaENOlM fv4SGM3jkR+K/xlYG6HHzZGbfYyNGj2Y7yMZ1rL1m8SnRNmkCysKGTrudeNf6wT9 J6wO9DzLTioz3ZnVr3LjsSKIb4tIp4ugqNJaLuW7m3FtZ3MAgxN68hBbJs8TZ8tL V/0jwUqS+grcgZEb9ymfcedxahtDUfHjRkpDpsxZzVVGkSBNcbQu92oByQVnRQ8m wrYLp3/eawM5AvuV7HNpTT5ZR+1t8luishHN9899IMP2Vyg0Ub67FqFypYmM2cm2 sjAI4KpfvT00XFNvgLuYwYEKs9syGTO7hiHNQKcF44F5LYv6nTFwmFQB11dAtY9V ull4D2CLDx9OvyNyKwdEZB5dyV0r/uKIdkhST60V2Q9KegpzgFpoZtSKM/HPYSVH 1Bc9f3Q/GqZCvNZZCMx8UvRjQR8dRWDSmPJ0VXG1+wJ+fCmSPP3AuQ1/VsgPRqx2 56VrpGPpGut40hV8xQFbWIZ2whwWLKPFAHj8B79ZtFUzUrU6Z2rNpvv8inHc/+S/ b6GR5s8/gucRblvd7n3OFNX5UJmPmcw9zWbu/1Dr9DY8l0nAQh21y5FGSS8B1wdE oD2M3Lp7JbwjQbRtnDhImqul2S4yu+m+wDD1aR2K4k3GAI7KKgOBWT0+BDClcn8A 4Ju6/YUbj33YlMPJgnGijLnolFy0hNW7TmWqR+8tSI3wO5eNKg4qwBnarqc3vgCV quVxINAXyGQCO9lzdw6hudk8/+BlweGdqhONaIWbK5z1L/SfQo6LC9MTsj7FJydq bc+kEbfZS8aSq7uc9axW6Ti0eAPJ8EVHtwhSBgZQRweKFBXs6HbbhMIdc4N0M7Oq UiFXaF6s4n2uihVP6TqXtHEjTpZoC7pC+HCYiuKXUJtaqtXBOh+y3KLvHk09YL6D XmTDg+UTiFsh4jKKm/BhdelbR5JbpJcj5AId76Mfr8+F/1g9ePOvsWHpQr/oIQTo xEkaxCmzEgP0b6caMWfMUQrbVGxBBNcqKc/ir9fGGOPHATzzq/xLcQYvK1tZhd/D ah/gpMPndsyvVCEuFPluWyDiM0VkwHgC2/3pJIYFHaxK64IutmPsy393rHMEB4kN AHau6kWK+yL9qEVH1pP2zvswQ12P7gjt3T/G3bGsmvlXkEfztfjkXo6XnjcBNf5y G+974AKLcjnk1gzIgarz+lAMY57Gkw4oNDMrTqVQ2OJQlvOSbllPXzH+aAiavB8W ZPECLLwHxD4B1AuaiAArgKl935u/TOB+yQOR8JgGsUzROyJqHJ/SC51HkebgCkL1 aggtjgPlIBEXLZAlhpWLZ9lAQyrQpvCVJYwaOvfMmvRav4NAFNoZ2/Q7S4Tn1z+U XX+f+GD58P4MPMhU5IKnz4yH4nlHnAiTEvcs85TZUAXze9g/uBOwZITeGtyLi52S aETIr4v7SgXMepX7ThQ1Pv/jddsK/u4j2F34u0XktwCP+UrbfkE2mocdXvdzxbmd tZSznK2qwgVSsPOs9MhUaepbnjmNBFFBrULhrUtSglM/VX/rWNiyh0aw4XYyHhIt 9ZNlfEjKjJ67VEMBxBJ/ieUCouRGCxPYD1j65VT7oB3ZiyPu2F2nlUIcYNqPg1Sd QBCrdaOXdJ0uLwyTAUeVE+wMbgscLvWsfZcCCJHAvw9NHFMUcnrdWxAYMVETNUOn uryVAK7VfOldaz6z3NOSOi6nonNeHpR/sipBa4ik5xCRLT9e0S2QJgRvO9GyfAqz 3DIzHtxIGePFzTiUYUTxS3i2gnMX2PEe3ChTLlYWD3jNeAKz0iOzpDphIF2xHLLQ 1tCAqBmq/vUzALyDFFdFuTIqQZys4z/u4Dmyq9uXs421eN3v2hkVHvDy8uT2Ot29 lg4Q5YezR1EjaW//9guL1BXbcKrTEdtxeNqtem7SpZOMTSwD2lhB8z65GrX90Cyt EMmaRSGYEdf5h1afL1SmKOMskbqxe1D2jG/vsXC7XX7xO/ioy0BdiJcYN1JiMOHJ EOzFol5I20YkiV6j+cenfQFwc/NkaSxEkR8AUHJSbvUmRQRl6r0nnsFpZdR1w7pv wkaT+eOpZynO4mY/ZtF6MpXJsixi6L4ZYXEbS6yHf+XGFfB0okILylmwv2bf6+Mq nqXlmGj3Jwq7X9/+2BDqvfpFFX5lSmItKZAobLdssjFR6roJxOqRsGia2aZ+0+U5 VhgdITtnElgtHBaeZU5rHDswgdeLVBP+rGWnKxpJ+pLtNNi25sPYRcWFL6Erd25u eXiY8GEIr+u7rqBWpc9HR34sAPRs3ubbCUleT748keCbx247ImBtiDctZxcc1O86 +0QjHP6HUT7FSo/FmT7a120S3Gd2jixGh06l/9ij5Z6mJa7Rm7TTbSjup/XISnOT MKWcbI1nfVOhCv3xDq2eLae+s0oVoc041ceRazqFM2TL/Z6UXRMErprq}rr(h8Uh9jlubaubeubhH)rs}rt(h8Uh9hh:h;h}ru(hB]hC]hA]h@]rvh.ahD]rwhauhFM-hGhh3]rx(hT)ry}rz(h8XDecrypt and Verifyr{h9jsh:h;h}r|(hB]hC]hA]h@]hD]uhFM-hGhh3]r}h[XDecrypt and Verifyr~r}r(h8Uh:NhFNhGhh9jyubaubhz)r}r(h8XqSuppose the above output has been saved into ``se.p7``. The following demonstrates how to decrypt and verify it::h9jsh:h;h}r(hB]hC]hA]h@]hD]uhFM/hGhh3]r(h[X-Suppose the above output has been saved into rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X ``se.p7``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[Xse.p7rr}r(h8Uh9jubah}r(jjh@]hA]hB]hC]hD]uhFM2hGhh3]rh[Xhfrom M2Crypto import BIO, SMIME, X509 # Instantiate an SMIME object. s = SMIME.SMIME() # Load private key and cert. s.load_key('recipient_key.pem', 'recipient.pem') # Load the signed/encrypted data. p7, data = SMIME.smime_load_pkcs7('se.p7') # After the above step, 'data' == None. # Decrypt p7. 'out' now contains a PKCS #7 signed blob. out = s.decrypt(p7) # Load the signer's cert. x509 = X509.load_cert('signer.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) # Load the signer's CA cert. In this case, because the signer's # cert is self-signed, it is the signer's cert itself. st = X509.X509_Store() st.load_info('signer.pem') s.set_x509_store(st) # Recall 'out' contains a PKCS #7 blob. # Transform 'out'; verify the resulting PKCS #7 blob. p7_bio = BIO.MemoryBuffer(out) p7, data = SMIME.smime_load_pkcs7_bio(p7_bio) v = s.verify(p7) print(v)rr}r(h8Uh9jubaubhz)r}r(h8XThe output is as follows::rh9jsh:h;h}r(hB]hC]hA]h@]hD]uhFMVhGhh3]rh[XThe output is as follows:rr}r(h8Uh:NhFNhGhh9jubaubj)r}r(h8Xa sign of our timesh9jsh:h;h}r(jjh@]hA]hB]hC]hD]uhFMXhGhh3]rh[Xa sign of our timesrr}r(h8Uh9jubaubeubhH)r}r(h8Uh9hh:h;h}r(hB]hC]hA]h@]rh0ahD]rhauhFM\hGhh3]r(hT)r}r(h8X Sending S/MIME messages via SMTPrh9jh:h;h}r(hB]hC]hA]h@]hD]uhFM\hGhh3]rh[X Sending S/MIME messages via SMTPrr}r(h8Uh:NhFNhGhh9jubaubhz)r}r(h8XIn the above examples, we've assumed that our S/MIME messages are sent and received automagically. The following is a Python function that generates S/MIME-signed/encrypted messages and sends them via SMTP::h9jh:h;h}r(hB]hC]hA]h@]hD]uhFM^hGhh3]rh[XIn the above examples, we’ve assumed that our S/MIME messages are sent and received automagically. The following is a Python function that generates S/MIME-signed/encrypted messages and sends them via SMTP:rr}r(h8Uh:NhFNhGhh9jubaubj)r}r(h8Xfrom M2Crypto import BIO, SMIME, X509 import smtplib, string, sys def sendsmime(from_addr, to_addrs, subject, msg, from_key, from_cert=None, to_certs=None, smtpd='localhost'): msg_bio = BIO.MemoryBuffer(msg) sign = from_key encrypt = to_certs s = SMIME.SMIME() if sign: s.load_key(from_key, from_cert) if encrypt: p7 = s.sign(msg_bio, flags=SMIME.PKCS7_TEXT) else: p7 = s.sign(msg_bio, flags=SMIME.PKCS7_TEXT|SMIME.PKCS7_DETACHED) msg_bio = BIO.MemoryBuffer(msg) # Recreate coz sign() has consumed it. if encrypt: sk = X509.X509_Stack() for x in to_certs: sk.push(X509.load_cert(x)) s.set_x509_stack(sk) s.set_cipher(SMIME.Cipher('des_ede3_cbc')) tmp_bio = BIO.MemoryBuffer() if sign: s.write(tmp_bio, p7) else: tmp_bio.write(msg) p7 = s.encrypt(tmp_bio) out = BIO.MemoryBuffer() out.write('From: %s\r\n' % from_addr) out.write('To: %s\r\n' % string.join(to_addrs, ", ")) out.write('Subject: %s\r\n' % subject) if encrypt: s.write(out, p7) else: if sign: s.write(out, p7, msg_bio, SMIME.PKCS7_TEXT) else: out.write('\r\n') out.write(msg) out.close() smtp = smtplib.SMTP() smtp.connect(smtpd) smtp.sendmail(from_addr, to_addrs, out.read()) smtp.quit()h9jh:h;h}r(jjh@]hA]hB]hC]hD]uhFMchGhh3]rh[Xfrom M2Crypto import BIO, SMIME, X509 import smtplib, string, sys def sendsmime(from_addr, to_addrs, subject, msg, from_key, from_cert=None, to_certs=None, smtpd='localhost'): msg_bio = BIO.MemoryBuffer(msg) sign = from_key encrypt = to_certs s = SMIME.SMIME() if sign: s.load_key(from_key, from_cert) if encrypt: p7 = s.sign(msg_bio, flags=SMIME.PKCS7_TEXT) else: p7 = s.sign(msg_bio, flags=SMIME.PKCS7_TEXT|SMIME.PKCS7_DETACHED) msg_bio = BIO.MemoryBuffer(msg) # Recreate coz sign() has consumed it. if encrypt: sk = X509.X509_Stack() for x in to_certs: sk.push(X509.load_cert(x)) s.set_x509_stack(sk) s.set_cipher(SMIME.Cipher('des_ede3_cbc')) tmp_bio = BIO.MemoryBuffer() if sign: s.write(tmp_bio, p7) else: tmp_bio.write(msg) p7 = s.encrypt(tmp_bio) out = BIO.MemoryBuffer() out.write('From: %s\r\n' % from_addr) out.write('To: %s\r\n' % string.join(to_addrs, ", ")) out.write('Subject: %s\r\n' % subject) if encrypt: s.write(out, p7) else: if sign: s.write(out, p7, msg_bio, SMIME.PKCS7_TEXT) else: out.write('\r\n') out.write(msg) out.close() smtp = smtplib.SMTP() smtp.connect(smtpd) smtp.sendmail(from_addr, to_addrs, out.read()) smtp.quit()rr}r(h8Uh9jubaubhz)r}r(h8XThis function sends plain, S/MIME-signed, S/MIME-encrypted, and S/MIME-signed/encrypted messages, depending on the parameters ``from_key`` and ``to_certs``. The function's output interoperates with Netscape Messenger.h9jh:h;h}r(hB]hC]hA]h@]hD]uhFMhGhh3]r(h[X~This function sends plain, S/MIME-signed, S/MIME-encrypted, and S/MIME-signed/encrypted messages, depending on the parameters rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X ``from_key``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[Xfrom_keyrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[Xto_certsrr}r(h8Uh9jubah}r(hB]hC]hA]h@]rh+ahD]rhauhFMhGhh3]r(hT)r}r(h8X#Verifying origin of S/MIME messagesrh9jh:h;h}r(hB]hC]hA]h@]hD]uhFMhGhh3]rh[X#Verifying origin of S/MIME messagesrr}r(h8Uh:NhFNhGhh9jubaubhz)r}r(h8XIn our examples above that decrypt or verify messages, we skipped a step: verifying that the ``from`` address of the message matches the ``email address`` attribute in the sender's certificate.h9jh:h;h}r(hB]hC]hA]h@]hD]uhFMhGhh3]r(h[X]In our examples above that decrypt or verify messages, we skipped a step: verifying that the rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X``from``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[Xfromrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[X email addressrr}r(h8Uh9jubah}r (hB]hC]hA]h@]hD]uhFMhGhh3]r (h[XThe premise of current X.509 certification practice is that the CA is supposed to verify your identity, and to issue a certificate with r r }r(h8Uh:NhFNhGhh9jubj)r}r(h8X``email address``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X email addressrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uhFMhGhh3]rh[XIf you run your own CA, your certification practice is up to you, of course, and it would probably be part of your security policy.rr}r(h8Uh:NhFNhGhh9jubaubhz)r }r!(h8XWhether your S/MIME messaging application needs to verify the ``from`` addresses of S/MIME messages depends on your security policy and your system's threat model, as always.h9jh:h;h}r"(hB]hC]hA]h@]hD]uhFMhGhh3]r#(h[X>Whether your S/MIME messaging application needs to verify the r$r%}r&(h8Uh:NhFNhGhh9j ubj)r'}r((h8X``from``h>}r)(hB]hC]hA]h@]hD]uh9j h3]r*h[Xfromr+r,}r-(h8Uh9j'ubah}r3(hB]hC]hA]h@]r4h-ahD]r5hauhFMhGhh3]r6(hT)r7}r8(h8X&Interoperating with Netscape Messengerr9h9j1h:h;h}r:(hB]hC]hA]h@]hD]uhFMhGhh3]r;h[X&Interoperating with Netscape Messengerr<r=}r>(h8Uh:NhFNhGhh9j7ubaubhz)r?}r@(h8XSuppose S/MIME Recipient uses Netscape Messenger. To enable Messenger to handle S/MIME messages from S/MIME Sender, S/MIME Recipient needs to configure Messenger with his private key and certificate, as well as S/MIME Sender's certificate.h9j1h:h;h}rA(hB]hC]hA]h@]hD]uhFMhGhh3]rBh[XSuppose S/MIME Recipient uses Netscape Messenger. To enable Messenger to handle S/MIME messages from S/MIME Sender, S/MIME Recipient needs to configure Messenger with his private key and certificate, as well as S/MIME Sender’s certificate.rCrD}rE(h8Uh:NhFNhGhh9j?ubaubjD)rF}rG(h8Uh9j1h:h;h}rH(hB]hC]hA]h@]hD]uhFNhGhh3]rIhz)rJ}rK(h8X}**Note:** Configuring Messenger's POP or IMAP settings so that it retrieves mail correctly is beyond the scope of this HOWTO.h9jFh:h;h}rL(hB]hC]hA]h@]hD]uhFMh3]rM(jN)rN}rO(h8X **Note:**h>}rP(hB]hC]hA]h@]hD]uh9jJh3]rQh[XNote:rRrS}rT(h8Uh9jNubah}rZ(hB]hC]hA]h@]hD]uhFMhGhh3]r[h[XmThe following steps demonstrate how to import S/MIME Recipient’s private key and certificate for Messenger:r\r]}r^(h8Uh:NhFNhGhh9jXubaubcdocutils.nodes enumerated_list r_)r`}ra(h8Uh9j1h:h;h}rc(UsuffixrdU.h@]hA]hB]UprefixreUhC]hD]UenumtyperfUarabicrguhFMhGhh3]rh(cdocutils.nodes list_item ri)rj}rk(h8XTransform S/MIME Recipient's private key and certificate into *PKCS #12* format:: openssl pkcs12 -export -in recipient.pem -inkey recipient_key.pem \ -name "S/MIME Recipient" -out recipient.p12 Enter Export Password: Verifying password - Enter Export Password: h9j`h:h;h}rm(hB]hC]hA]h@]hD]uhFNhGhh3]rn(hz)ro}rp(h8XQTransform S/MIME Recipient's private key and certificate into *PKCS #12* format::h9jjh:h;h}rq(hB]hC]hA]h@]hD]uhFMh3]rr(h[X@Transform S/MIME Recipient’s private key and certificate into rsrt}ru(h8Uh9joubh)rv}rw(h8X *PKCS #12*h>}rx(hB]hC]hA]h@]hD]uh9joh3]ryh[XPKCS #12rzr{}r|(h8Uh9jvubah Verifying password - Enter Export Password:h9jjh}r(jjh@]hA]hB]hC]hD]uhFMh3]rh[Xopenssl pkcs12 -export -in recipient.pem -inkey recipient_key.pem \ -name "S/MIME Recipient" -out recipient.p12 Enter Export Password: Verifying password - Enter Export Password:rr}r(h8Uh9jubaubeubji)r}r(h8XStart Messenger. h9j`h:h;h}r(hB]hC]hA]h@]hD]uhFNhGhh3]rhz)r}r(h8XStart Messenger.h9jh:h;h}r(hB]hC]hA]h@]hD]uhFMh3]rh[XStart Messenger.rr}r(h8Uh9jubaubaubji)r}r(h8XClick on the (open) "lock" icon at the bottom left corner of Messenger's window. This brings up the "Security Info" dialog box. h9j`h:h;h}r(hB]hC]hA]h@]hD]uhFNhGhh3]rhz)r}r(h8XClick on the (open) "lock" icon at the bottom left corner of Messenger's window. This brings up the "Security Info" dialog box.h9jh:h;h}r(hB]hC]hA]h@]hD]uhFMh3]rh[XClick on the (open) “lock” icon at the bottom left corner of Messenger’s window. This brings up the “Security Info” dialog box.rr}r(h8Uh9jubaubaubji)r}r(h8X'Click on "Yours" under "Certificates". h9j`h:h;h}r(hB]hC]hA]h@]hD]uhFNhGhh3]rhz)r}r(h8X&Click on "Yours" under "Certificates".h9jh:h;h}r(hB]hC]hA]h@]hD]uhFMh3]rh[X.Click on “Yours” under “Certificates”.rr}r(h8Uh9jubaubaubji)r}r(h8XgSelect "Import a certificate", then pick ``recipient.p12`` from the ensuing file selection dialog box. h9j`h:h;h}r(hB]hC]hA]h@]hD]uhFNhGhh3]rhz)r}r(h8XfSelect "Import a certificate", then pick ``recipient.p12`` from the ensuing file selection dialog box.h9jh:h;h}r(hB]hC]hA]h@]hD]uhFMh3]r(h[X-Select “Import a certificate”, then pick rr}r(h8Uh9jubj)r}r(h8X``recipient.p12``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X recipient.p12rr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uhFMhGhh3]r(h[XNext, you need to import rr}r(h8Uh:NhFNhGhh9jubj)r}r(h8X``signer.pem``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X signer.pemrr}r(h8Uh9jubah}r(jdU.h@]hA]hB]jeUhC]hD]jfjguhFMhGhh3]r(ji)r}r(h8XqCreate a DER encoding of ``signer.pem``:: openssl x509 -inform pem -outform der -in signer.pem -out signer.der h9jh:h;h}r(hB]hC]hA]h@]hD]uhFNhGhh3]r(hz)r}r(h8X)Create a DER encoding of ``signer.pem``::h9jh:h;h}r(hB]hC]hA]h@]hD]uhFMh3]r(h[XCreate a DER encoding of rr}r(h8Uh9jubj)r}r(h8X``signer.pem``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X signer.pemrr}r(h8Uh9jubah}r(jjh@]hA]hB]hC]hD]uhFMh3]rh[XDopenssl x509 -inform pem -outform der -in signer.pem -out signer.derrr}r(h8Uh9jubaubeubji)r}r(h8X}Install ``signer.der`` into Messenger as MIME type ``application/x-x509-ca-cert``. You do this by downloading ``signer.der`` via Navigator from a HTTP or HTTPS server, with the correct MIME type mapping. (You may use ``demo/ssl/https_srv.py``, bundled with M2Crypto, for this purpose.) Follow the series of dialog boxes to accept ``signer.der`` as a CA for certifying email users. h9jh:h;h}r(hB]hC]hA]h@]hD]uhFNhGhh3]rhz)r}r(h8X|Install ``signer.der`` into Messenger as MIME type ``application/x-x509-ca-cert``. You do this by downloading ``signer.der`` via Navigator from a HTTP or HTTPS server, with the correct MIME type mapping. (You may use ``demo/ssl/https_srv.py``, bundled with M2Crypto, for this purpose.) Follow the series of dialog boxes to accept ``signer.der`` as a CA for certifying email users.h9jh:h;h}r(hB]hC]hA]h@]hD]uhFMh3]r(h[XInstall rr}r(h8Uh9jubj)r}r(h8X``signer.der``h>}r(hB]hC]hA]h@]hD]uh9jh3]rh[X signer.derrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[Xapplication/x-x509-ca-certrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[X signer.derrr}r(h8Uh9j ubah}r(hB]hC]hA]h@]hD]uh9jh3]rh[Xdemo/ssl/https_srv.pyrr}r(h8Uh9jubah}r"(hB]hC]hA]h@]hD]uh9jh3]r#h[X signer.derr$r%}r&(h8Uh9j ubah}r,(hB]hC]hA]h@]hD]uhFMhGhh3]r-(h[XS/MIME Recipient is now able to decrypt and read S/MIME Sender’s messages with Messenger. Messenger will indicate that S/MIME Sender’s messages are signed, encrypted, or encrypted r.r/}r0(h8Uh:NhFNhGhh9j*ubh)r1}r2(h8X*and*h>}r3(hB]hC]hA]h@]hD]uh9j*h3]r4h[Xandr5r6}r7(h8Uh9j1ubah}r=(hB]hC]hA]h@]hD]uhFMhGhh3]r>(h[XClicking on the “stamp” icon brings you to the Security Info dialog box. Messenger informs you that the message is, say, encrypted with 168-bit DES-EDE3-CBC and that it is digitally signed by the private key corresponding to the public key contained in the certificate r?r@}rA(h8Uh:NhFNhGhh9j;ubj)rB}rC(h8X``signer.pem``h>}rD(hB]hC]hA]h@]hD]uh9j;h3]rEh[X signer.pemrFrG}rH(h8Uh9jBubah}rM(hB]hC]hA]h@]rNh(ahD]rOh auhFMhGhh3]rP(hT)rQ}rR(h8X%Interoperating with Microsoft OutlookrSh9jKh:h;h}rT(hB]hC]hA]h@]hD]uhFMhGhh3]rUh[X%Interoperating with Microsoft OutlookrVrW}rX(h8Uh:NhFNhGhh9jQubaubhz)rY}rZ(h8XI do not know how to do this, as I do not use Outlook. (Nor do I use Netscape Messenger, actually. I use Mutt, top dog of MUAs. ;-) Information on how to configure Outlook with keys and certificates so that it handles S/MIME mail is gratefully accepted.h9jKh:h;h}r[(hB]hC]hA]h@]hD]uhFMhGhh3]r\h[XI do not know how to do this, as I do not use Outlook. (Nor do I use Netscape Messenger, actually. I use Mutt, top dog of MUAs. ;-) Information on how to configure Outlook with keys and certificates so that it handles S/MIME mail is gratefully accepted.r]r^}r_(h8Uh:NhFNhGhh9jYubaubeubhH)r`}ra(h8Uh9hh:h;h}rb(hB]hC]hA]h@]rch&ahD]rdh auhFMhGhh3]re(hT)rf}rg(h8XZSmimerhh9j`h:h;h}ri(hB]hC]hA]h@]hD]uhFMhGhh3]rjh[XZSmimerkrl}rm(h8Uh:NhFNhGhh9jfubaubhz)rn}ro(h8XZSmime is a `Zope `__ *product* that enables Zope to generate S/MIME-signed/encrypted messages. ZSmime demonstrates how to invoke M2Crypto in a web application server extension.h9j`h:h;h}rp(hB]hC]hA]h@]hD]uhFMhGhh3]rq(h[X ZSmime is a rrrs}rt(h8Uh:NhFNhGhh9jnubh)ru}rv(h8X`Zope `__h>}rw(UnameXZopehXhttp://www.zope.orgh@]hA]hB]hC]hD]uh9jnh3]rxh[XZoperyrz}r{(h8Uh9juubah}r(hB]hC]hA]h@]hD]uh9jnh3]rh[Xproductrr}r(h8Uh9j~ubah`__ explaining its usage. (That HOWTO has some overlap in content with this document.)h9j`h:h;h}r(hB]hC]hA]h@]hD]uhFMhGhh3]r(h[XZSmime has its own rr}r(h8Uh:NhFNhGhh9jubh)r}r(h8XD`HOWTO `__h>}r(UnameXHOWTOhX8http://sandbox.rulemaker.net/ngps/zope/zsmime/howto.htmlh@]hA]hB]hC]hD]uh9jh3]rh[XHOWTOrr}r(h8Uh9jubah}r(hB]hC]hA]h@]rh2ahD]rhauhFMhGhh3]r(hT)r}r(h8X Resourcesrh9jh:h;h}r(hB]hC]hA]h@]hD]uhFMhGhh3]rh[X Resourcesrr}r(h8Uh:NhFNhGhh9jubaubcdocutils.nodes bullet_list r)r}r(h8Uh9jh:h;h}r(UbulletrX-h@]hA]hB]hC]hD]uhFMhGhh3]r(ji)r}r(h8X:IETF S/MIME Working Group - http://www.imc.org/ietf-smime h9jh:h;h}r(hB]hC]hA]h@]hD]uhFNhGhh3]rhz)r}r(h8X9IETF S/MIME Working Group - http://www.imc.org/ietf-smimeh9jh:h;h}r(hB]hC]hA]h@]hD]uhFMh3]r(h[XIETF S/MIME Working Group - rr}r(h8Uh9jubh)r}r(h8Xhttp://www.imc.org/ietf-smimerh>}r(Urefurijh@]hA]hB]hC]hD]uh9jh3]rh[Xhttp://www.imc.org/ietf-smimerr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uhFNhGhh3]rhz)r}r(h8X:S/MIME and OpenPGP - http://www.imc.org/smime-pgpmime.htmlh9jh:h;h}r(hB]hC]hA]h@]hD]uhFMh3]r(h[XS/MIME and OpenPGP - rr}r(h8Uh9jubh)r}r(h8X%http://www.imc.org/smime-pgpmime.htmlrh>}r(Urefurijh@]hA]hB]hC]hD]uh9jh3]rh[X%http://www.imc.org/smime-pgpmime.htmlrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uhFNhGhh3]rhz)r}r(h8XFS/MIME Freeware Library - http://www.getronicsgov.com/hot/sfl_home.htmh9jh:h;h}r(hB]hC]hA]h@]hD]uhFMh3]r(h[XS/MIME Freeware Library - rr}r(h8Uh9jubh)r}r(h8X,http://www.getronicsgov.com/hot/sfl_home.htmrh>}r(Urefurijh@]hA]hB]hC]hD]uh9jh3]rh[X,http://www.getronicsgov.com/hot/sfl_home.htmrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uhFNhGhh3]rhz)r}r(h8XTMozilla Network Security Services - http://www.mozilla.org/projects/security/pkg/nssh9jh:h;h}r(hB]hC]hA]h@]hD]uhFMh3]r(h[X$Mozilla Network Security Services - rr}r(h8Uh9jubh)r}r(h8X0http://www.mozilla.org/projects/security/pkg/nssrh>}r(Urefurijh@]hA]hB]hC]hD]uh9jh3]rh[X0http://www.mozilla.org/projects/security/pkg/nssrr}r(h8Uh9jubah}r(hB]hC]hA]h@]hD]uhFNhGhh3]rhz)r}r(h8jh9jh:h;h}r(hB]hC]hA]h@]hD]uhFM h3]r(h[XS/MIME Cracking Screen Saver - rr}r(h8Uh9jubh)r}r(h8X%http://www.counterpane.com/smime.htmlrh>}r (Urefurijh@]hA]hB]hC]hD]uh9jh3]r h[X%http://www.counterpane.com/smime.htmlr r }r (h8Uh9jubah}r!(hB]UlevelKh@]hA]Usourceh;hC]hD]UlineKUtypeUINFOr"uh3]r#hz)r$}r%(h8Uh>}r&(hB]hC]hA]h@]hD]uh9jh3]r'h[X1Hyperlink target "howto-smime" is not referenced.r(r)}r*(h8Uh9j$ubahNU toc_backlinksr?Uentryr@U language_coderAUenrBU datestamprCNU report_levelrDKU _destinationrENU halt_levelrFKU strip_classesrGNhXNUerror_encoding_error_handlerrHUbackslashreplacerIUdebugrJNUembed_stylesheetrKUoutput_encoding_error_handlerrLUstrictrMU sectnum_xformrNKUdump_transformsrONU docinfo_xformrPKUwarning_streamrQNUpep_file_url_templaterRUpep-%04drSUexit_status_levelrTKUconfigrUNUstrict_visitorrVNUcloak_email_addressesrWUtrim_footnote_reference_spacerXUenvrYNUdump_pseudo_xmlrZNUexpose_internalsr[NUsectsubtitle_xformr\U source_linkr]NUrfc_referencesr^NUoutput_encodingr_Uutf-8r`U source_urlraNUinput_encodingrbU utf-8-sigrcU_disable_configrdNU id_prefixreUUcharacter_level_inline_markuprfU tab_widthrgKUerror_encodingrhUUTF-8riU_sourcerjh;Ugettext_compactrkU generatorrlNUdump_internalsrmNU smart_quotesrnU pep_base_urlroU https://www.python.org/dev/peps/rpUsyntax_highlightrqUlongrrUinput_encoding_error_handlerrsjMUauto_id_prefixrtUidruUdoctitle_xformrvUstrip_elements_with_classesrwNU _config_filesrx]Ufile_insertion_enabledryU raw_enabledrzKU dump_settingsr{NubUsymbol_footnote_startr|Kh@}r}(h+jh*j;h$hh%jjh!hh&j`h1juh)jh-j1h'jh,hIh.jsh(jKh"jh#jGh0jh/hIh2juUsubstitution_namesr~}rh}r(hB]h@]hA]Usourceh;hC]hD]uU footnotesr]rUrefidsr}rh,]rh6asub.M2Crypto-0.31.0/doc/doctrees/howto.ssl.doctree0000664000175000001440000005146713236336220021434 0ustar matejusers00000000000000cdocutils.nodes document q)q}q(U nametypesq}q(Xa bit of historyqNX howto-sslqX secure sslqNX introductionq NX.howto: programming ssl in python with m2cryptoq NX code samplesq NXssldumpq NuUsubstitution_defsq }qUparse_messagesq]qUcurrent_sourceqNU decorationqNUautofootnote_startqKUnameidsq}q(hUa-bit-of-historyqhU howto-sslqhU secure-sslqh U introductionqh U-howto-programming-ssl-in-python-with-m2cryptoqh U code-samplesqh UssldumpquUchildrenq]q(cdocutils.nodes target q)q }q!(U rawsourceq"X.. _howto-ssl:Uparentq#hUsourceq$X,/home/matej/Build/m2crypto/doc/howto.ssl.rstq%Utagnameq&Utargetq'U attributesq(}q)(Uidsq*]Ubackrefsq+]Udupnamesq,]Uclassesq-]Unamesq.]Urefidq/huUlineq0KUdocumentq1hh]ubcdocutils.nodes section q2)q3}q4(h"Uh#hh$h%Uexpect_referenced_by_nameq5}q6hh sh&Usectionq7h(}q8(h,]h-]h+]h*]q9(hheh.]q:(h heuh0Kh1hUexpect_referenced_by_idq;}q)q?}q@(h"X.HOWTO: Programming SSL in Python with M2CryptoqAh#h3h$h%h&UtitleqBh(}qC(h,]h-]h+]h*]h.]uh0Kh1hh]qDcdocutils.nodes Text qEX.HOWTO: Programming SSL in Python with M2CryptoqFqG}qH(h"Uh$Nh0Nh1hh#h?ubaubcdocutils.nodes field_list qI)qJ}qK(h"Uh#h3h$h%h&U field_listqLh(}qM(h,]h-]h+]h*]h.]uh0Kh1hh]qN(cdocutils.nodes field qO)qP}qQ(h"Uh#hJh$h%h&UfieldqRh(}qS(h,]h-]h+]h*]h.]uh0Kh1hh]qT(cdocutils.nodes field_name qU)qV}qW(h"Xauthorh#hPh$h%h&U field_nameqXh(}qY(h,]h-]h+]h*]h.]uh0Kh]qZhEXauthorq[q\}q](h"Uh#hVubaubcdocutils.nodes field_body q^)q_}q`(h"XSPheng Siong Ng and Heikki Toivonen (heikki@osafoundation.org)qah(}qb(h,]h-]h+]h*]h.]uh#hPh]qccdocutils.nodes paragraph qd)qe}qf(h"hah#h_h$h%h&U paragraphqgh(}qh(h,]h-]h+]h*]h.]uh0Kh]qi(hEXPheng Siong Ng and Heikki Toivonen (qvqw}qx(h"Uh#heubhm)qy}qz(h"Xheikki@osafoundation.orgh(}q{(UrefuriXmailto:heikki@osafoundation.orgh*]h+]h,]h-]h.]uh#heh]q|hEXheikki@osafoundation.orgq}q~}q(h"Uh#hyubah&huubhEX)q}q(h"Uh#heubeubah&U field_bodyqubeubhO)q}q(h"Uh#hJh$h%h&hRh(}q(h,]h-]h+]h*]h.]uh0K h1hh]q(hU)q}q(h"X copyrighth#hh$h%h&hXh(}q(h,]h-]h+]h*]h.]uh0Kh]qhEX copyrightqq}q(h"Uh#hubaubh^)q}q(h"XY© 2000, 2001 by Ng Pheng Siong, portions © 2006 by Open Source Applications Foundation h(}q(h,]h-]h+]h*]h.]uh#hh]qhd)q}q(h"XX© 2000, 2001 by Ng Pheng Siong, portions © 2006 by Open Source Applications Foundationh#hh$h%h&hgh(}q(h,]h-]h+]h*]h.]uh0K h]qhEXX© 2000, 2001 by Ng Pheng Siong, portions © 2006 by Open Source Applications Foundationqq}q(h"Uh#hubaubah&hubeubeubeubh2)q}q(h"Uh#hh$h%h&h7h(}q(h,]h-]h+]h*]qhah.]qh auh0K h1hh]q(h>)q}q(h"X Introductionqh#hh$h%h&hBh(}q(h,]h-]h+]h*]h.]uh0K h1hh]qhEX Introductionqq}q(h"Uh$Nh0Nh1hh#hubaubhd)q}q(h"X6`M2Crypto `__ is a `Python `__ interface to `OpenSSL `__. It makes available to the Python programmer SSL functionality to implement clients and servers, S/MIME v2, RSA, DSA, DH, symmetric ciphers, message digests and HMACs.h#hh$h%h&hgh(}q(h,]h-]h+]h*]h.]uh0Kh1hh]q(hm)q}q(h"X4`M2Crypto `__h(}q(UnameXM2CryptoUrefuriqX%https://gitlab.com/m2crypto/m2crypto/h*]h+]h,]h-]h.]uh#hh]qhEXM2Cryptoqq}q(h"Uh#hubah&huubhEX is a qq}q(h"Uh$Nh0Nh1hh#hubhm)q}q(h"X"`Python `__h(}q(UnameXPythonhXhttp://www.python.orgh*]h+]h,]h-]h.]uh#hh]qhEXPythonqq}q(h"Uh#hubah&huubhEX interface to qq}q(h"Uh$Nh0Nh1hh#hubhm)q}q(h"X$`OpenSSL `__h(}q(UnameXOpenSSLhXhttp://www.openssl.orgh*]h+]h,]h-]h.]uh#hh]qhEXOpenSSLqąq}q(h"Uh#hubah&huubhEX. It makes available to the Python programmer SSL functionality to implement clients and servers, S/MIME v2, RSA, DSA, DH, symmetric ciphers, message digests and HMACs.qDžq}q(h"Uh$Nh0Nh1hh#hubeubhd)q}q(h"X;This document demonstrates programming HTTPS with M2Crypto.qh#hh$h%h&hgh(}q(h,]h-]h+]h*]h.]uh0Kh1hh]qhEX;This document demonstrates programming HTTPS with M2Crypto.qυq}q(h"Uh$Nh0Nh1hh#hubaubeubh2)q}q(h"Uh#hh$h%h&h7h(}q(h,]h-]h+]h*]qhah.]qhauh0Kh1hh]q(h>)q}q(h"XA bit of historyqh#hh$h%h&hBh(}q(h,]h-]h+]h*]h.]uh0Kh1hh]qhEXA bit of historyq݅q}q(h"Uh$Nh0Nh1hh#hubaubhd)q}q(h"XM2Crypto was created during the time of Python 1.5, which features a module httplib providing client-side HTTP functionality. M2Crypto sports a httpslib based on httplib.h#hh$h%h&hgh(}q(h,]h-]h+]h*]h.]uh0Kh1hh]qhEXM2Crypto was created during the time of Python 1.5, which features a module httplib providing client-side HTTP functionality. M2Crypto sports a httpslib based on httplib.q䅁q}q(h"Uh$Nh0Nh1hh#hubaubhd)q}q(h"XBeginning with version 2.0, Python's socket module provided (rudimentary) SSL support. Also in the same version, httplib was enhanced with class HTTPConnection, which is more sophisticated than the old class HTTP, and HTTPSConnection, which does HTTPS.h#hh$h%h&hgh(}q(h,]h-]h+]h*]h.]uh0Kh1hh]qhEXBeginning with version 2.0, Python’s socket module provided (rudimentary) SSL support. Also in the same version, httplib was enhanced with class HTTPConnection, which is more sophisticated than the old class HTTP, and HTTPSConnection, which does HTTPS.q녁q}q(h"Uh$Nh0Nh1hh#hubaubhd)q}q(h"X\Subsequently, M2Crypto.httpslib grew a compatible (but not identical) class HTTPSConnection.h#hh$h%h&hgh(}q(h,]h-]h+]h*]h.]uh0K#h1hh]qhEX\Subsequently, M2Crypto.httpslib grew a compatible (but not identical) class HTTPSConnection.qq}q(h"Uh$Nh0Nh1hh#hubaubhd)q}q(h"XThe primary interface difference between the two HTTPSConnection classes is that M2Crypto's version accepts an M2Crypto.SSL.Context instance as a parameter, whereas Python 2.x's SSL support does not permit Pythonic control of the SSL context.h#hh$h%h&hgh(}q(h,]h-]h+]h*]h.]uh0K&h1hh]qhEXThe primary interface difference between the two HTTPSConnection classes is that M2Crypto’s version accepts an M2Crypto.SSL.Context instance as a parameter, whereas Python 2.x’s SSL support does not permit Pythonic control of the SSL context.qq}q(h"Uh$Nh0Nh1hh#hubaubhd)q}q(h"XeWithin the implementations, Python's ``HTTPSConnection`` employs a ``FakeSocket`` object, which collects all input from the SSL connection before returning it to the application as a ``StringIO`` buffer, whereas M2Crypto's ``HTTPSConnection`` uses a buffering ``M2Crypto.BIO.IOBuffer`` object that works over the underlying M2Crypto.SSL.Connection directly.h#hh$h%h&hgh(}q(h,]h-]h+]h*]h.]uh0K+h1hh]q(hEX'Within the implementations, Python’s rr}r(h"Uh$Nh0Nh1hh#hubcdocutils.nodes literal r)r}r(h"X``HTTPSConnection``h(}r(h,]h-]h+]h*]h.]uh#hh]rhEXHTTPSConnectionrr }r (h"Uh#jubah&Uliteralr ubhEX employs a r r }r(h"Uh$Nh0Nh1hh#hubj)r}r(h"X``FakeSocket``h(}r(h,]h-]h+]h*]h.]uh#hh]rhEX FakeSocketrr}r(h"Uh#jubah&j ubhEXf object, which collects all input from the SSL connection before returning it to the application as a rr}r(h"Uh$Nh0Nh1hh#hubj)r}r(h"X ``StringIO``h(}r(h,]h-]h+]h*]h.]uh#hh]rhEXStringIOrr}r(h"Uh#jubah&j ubhEX buffer, whereas M2Crypto’s r r!}r"(h"Uh$Nh0Nh1hh#hubj)r#}r$(h"X``HTTPSConnection``h(}r%(h,]h-]h+]h*]h.]uh#hh]r&hEXHTTPSConnectionr'r(}r)(h"Uh#j#ubah&j ubhEX uses a buffering r*r+}r,(h"Uh$Nh0Nh1hh#hubj)r-}r.(h"X``M2Crypto.BIO.IOBuffer``h(}r/(h,]h-]h+]h*]h.]uh#hh]r0hEXM2Crypto.BIO.IOBufferr1r2}r3(h"Uh#j-ubah&j ubhEXH object that works over the underlying M2Crypto.SSL.Connection directly.r4r5}r6(h"Uh$Nh0Nh1hh#hubeubhd)r7}r8(h"XlSince then M2Crypto has gained a Twisted wrapper that allows securing Twisted SSL connections with M2Crypto.h#hh$h%h&hgh(}r9(h,]h-]h+]h*]h.]uh0K2h1hh]r:hEXlSince then M2Crypto has gained a Twisted wrapper that allows securing Twisted SSL connections with M2Crypto.r;r<}r=(h"Uh$Nh0Nh1hh#j7ubaubeubh2)r>}r?(h"Uh#hh$h%h&h7h(}r@(h,]h-]h+]h*]rAhah.]rBhauh0K6h1hh]rC(h>)rD}rE(h"X Secure SSLrFh#j>h$h%h&hBh(}rG(h,]h-]h+]h*]h.]uh0K6h1hh]rHhEX Secure SSLrIrJ}rK(h"Uh$Nh0Nh1hh#jDubaubhd)rL}rM(h"XIt is recommended that you read the book Network Security with OpenSSL by John Viega, Matt Messier and Pravir Chandra, ISBN 059600270X.h#j>h$h%h&hgh(}rN(h,]h-]h+]h*]h.]uh0K8h1hh]rOhEXIt is recommended that you read the book Network Security with OpenSSL by John Viega, Matt Messier and Pravir Chandra, ISBN 059600270X.rPrQ}rR(h"Uh$Nh0Nh1hh#jLubaubhd)rS}rT(h"XUsing M2Crypto does not automatically make an SSL connection secure. There are various steps that need to be made before we can make that claim. Let's see how a simple client can establish a secure connection::h#j>h$h%h&hgh(}rU(h,]h-]h+]h*]h.]uh0K;h1hh]rVhEXUsing M2Crypto does not automatically make an SSL connection secure. There are various steps that need to be made before we can make that claim. Let’s see how a simple client can establish a secure connection:rWrX}rY(h"Uh$Nh0Nh1hh#jSubaubcdocutils.nodes literal_block rZ)r[}r\(h"Xctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, depth=9) if ctx.load_verify_locations('ca.pem') != 1: raise Exception('No CA certs') s = SSL.Connection(ctx) s.connect(server_address) # Normal protocol (for example HTTP) commands followh#j>h$h%h&U literal_blockr]h(}r^(U xml:spacer_Upreserver`h*]h+]h,]h-]h.]uh0K@h1hh]rahEXctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, depth=9) if ctx.load_verify_locations('ca.pem') != 1: raise Exception('No CA certs') s = SSL.Connection(ctx) s.connect(server_address) # Normal protocol (for example HTTP) commands followrbrc}rd(h"Uh#j[ubaubhd)re}rf(h"XThe first line creates an SSL context. The defaults allow any SSL version (except SSL version 2 which has known weaknesses) and sets the allowed ciphers to secure ones.h#j>h$h%h&hgh(}rg(h,]h-]h+]h*]h.]uh0KGh1hh]rhhEXThe first line creates an SSL context. The defaults allow any SSL version (except SSL version 2 which has known weaknesses) and sets the allowed ciphers to secure ones.rirj}rk(h"Uh$Nh0Nh1hh#jeubaubhd)rl}rm(h"X'The second line tells M2Crypto to perform certificate validation. The flags shown above are typical for clients, and requires the server to send a certificate. The depth parameter tells how long certificate chains are allowed - 9 is pretty common default, although probably too long in practice.h#j>h$h%h&hgh(}rn(h,]h-]h+]h*]h.]uh0KKh1hh]rohEX'The second line tells M2Crypto to perform certificate validation. The flags shown above are typical for clients, and requires the server to send a certificate. The depth parameter tells how long certificate chains are allowed - 9 is pretty common default, although probably too long in practice.rprq}rr(h"Uh$Nh0Nh1hh#jlubaubhd)rs}rt(h"XThe third line loads the allowed root (certificate authority or CA) certificates. Most Linux distributions come with CA certificates in suitable format. You could also download the `certdata.txt `__ file from the `NSS `__ project and convert it with the little M2Crypto utility script `demo/x509/certdata2pem.py `__.h#j>h$h%h&hgh(}ru(h,]h-]h+]h*]h.]uh0KQh1hh]rv(hEXThe third line loads the allowed root (certificate authority or CA) certificates. Most Linux distributions come with CA certificates in suitable format. You could also download the rwrx}ry(h"Uh$Nh0Nh1hh#jsubhm)rz}r{(h"Xm`certdata.txt `__h(}r|(UnameX certdata.txthXZhttp://mxr.mozilla.org/seamonkey/source//security/nss/lib/ckfw/builtins/certdata.txt?raw=1h*]h+]h,]h-]h.]uh#jsh]r}hEX certdata.txtr~r}r(h"Uh#jzubah&huubhEX file from the rr}r(h"Uh$Nh0Nh1hh#jsubhm)r}r(h"X;`NSS `__h(}r(UnameXNSShX1http://www.mozilla.org/projects/security/pki/nss/h*]h+]h,]h-]h.]uh#jsh]rhEXNSSrr}r(h"Uh#jubah&huubhEX@ project and convert it with the little M2Crypto utility script rr}r(h"Uh$Nh0Nh1hh#jsubhm)r}r(h"Xe`demo/x509/certdata2pem.py `__h(}r(UnameXdemo/x509/certdata2pem.pyhXEhttp://svn.osafoundation.org/m2crypto/trunk/demo/x509/certdata2pem.pyh*]h+]h,]h-]h.]uh#jsh]rhEXdemo/x509/certdata2pem.pyrr}r(h"Uh#jubah&huubhEX.r}r(h"Uh$Nh0Nh1hh#jsubeubhd)r}r(h"XIThe fourth line creates an SSL connection object with the secure context.h#j>h$h%h&hgh(}r(h,]h-]h+]h*]h.]uh0KZh1hh]rhEXIThe fourth line creates an SSL connection object with the secure context.rr}r(h"Uh$Nh0Nh1hh#jubaubhd)r}r(h"XThe fifth line connects to the server. During this time we perform the last security step: just after connection, but before exchanging any data, we compare the commonName (or subjectAltName DNS field) field in the certificate the server returned to the server address we tried to connect to. This happens automatically with SSL.Connection and the Twisted wrapper class, and anything that uses those. In all other cases you must do the check manually. It is recommended you call the SSL.Checker to do the actual check.h#j>h$h%h&hgh(}r(h,]h-]h+]h*]h.]uh0K]h1hh]rhEXThe fifth line connects to the server. During this time we perform the last security step: just after connection, but before exchanging any data, we compare the commonName (or subjectAltName DNS field) field in the certificate the server returned to the server address we tried to connect to. This happens automatically with SSL.Connection and the Twisted wrapper class, and anything that uses those. In all other cases you must do the check manually. It is recommended you call the SSL.Checker to do the actual check.rr}r(h"Uh$Nh0Nh1hh#jubaubhd)r}r(h"XSSL servers are different in that they typically do not require the client to send a certificate, so there is usually no certificate checking. Also, it is typically useless to perform host name checking.h#j>h$h%h&hgh(}r(h,]h-]h+]h*]h.]uh0Kfh1hh]rhEXSSL servers are different in that they typically do not require the client to send a certificate, so there is usually no certificate checking. Also, it is typically useless to perform host name checking.rr}r(h"Uh$Nh0Nh1hh#jubaubeubh2)r}r(h"Uh#hh$h%h&h7h(}r(h,]h-]h+]h*]rhah.]rh auh0Kkh1hh]r(h>)r}r(h"X Code Samplesrh#jh$h%h&hBh(}r(h,]h-]h+]h*]h.]uh0Kkh1hh]rhEX Code Samplesrr}r(h"Uh$Nh0Nh1hh#jubaubhd)r}r(h"XThe best samples of how to use the various SSL objects are in the tests directory, and the test\_ssl.py file specifically. There are additional samples in the demo directory, but they are not quaranteed to be up to date.h#jh$h%h&hgh(}r(h,]h-]h+]h*]h.]uh0Kmh1hh]rhEXThe best samples of how to use the various SSL objects are in the tests directory, and the test_ssl.py file specifically. There are additional samples in the demo directory, but they are not quaranteed to be up to date.rr}r(h"Uh$Nh0Nh1hh#jubaubhd)r}r(h"XhNOTE: The tests and demos may not be secure as is. Use the information above on how to make them secure.h#jh$h%h&hgh(}r(h,]h-]h+]h*]h.]uh0Krh1hh]rhEXhNOTE: The tests and demos may not be secure as is. Use the information above on how to make them secure.rr}r(h"Uh$Nh0Nh1hh#jubaubeubh2)r}r(h"Uh#hh$h%h&h7h(}r(h,]h-]h+]h*]rhah.]rh auh0Kvh1hh]r(h>)r}r(h"Xssldumprh#jh$h%h&hBh(}r(h,]h-]h+]h*]h.]uh0Kvh1hh]rhEXssldumprr}r(h"Uh$Nh0Nh1hh#jubaubhd)r}r(h"Xssldump "is an SSLv3/TLS network protocol analyser. It identifies TCP connections on the chosen network interface and attempts to interpret them as SSLv3/TLS traffic. When it identifies SSLv3/TLS traffic, it decodes the records and displays them in a textual form to stdout. If provided with the appropriate keying material, it will also decrypt the connections and display the application data traffic.h#jh$h%h&hgh(}r(h,]h-]h+]h*]h.]uh0Kxh1hh]rhEXssldump “is an SSLv3/TLS network protocol analyser. It identifies TCP connections on the chosen network interface and attempts to interpret them as SSLv3/TLS traffic. When it identifies SSLv3/TLS traffic, it decodes the records and displays them in a textual form to stdout. If provided with the appropriate keying material, it will also decrypt the connections and display the application data traffic.rr}r(h"Uh$Nh0Nh1hh#jubaubhd)r}r(h"XIf linked with OpenSSL, ssldump can display certificates in decoded form and decrypt traffic (provided that it has the appropriate keying material)."h#jh$h%h&hgh(}r(h,]h-]h+]h*]h.]uh0Kh1hh]rhEXIf linked with OpenSSL, ssldump can display certificates in decoded form and decrypt traffic (provided that it has the appropriate keying material).”rr}r(h"Uh$Nh0Nh1hh#jubaubhd)r}r(h"X$ssldump is written by Eric Rescorla.rh#jh$h%h&hgh(}r(h,]h-]h+]h*]h.]uh0Kh1hh]rhEX$ssldump is written by Eric Rescorla.rr}r(h"Uh$Nh0Nh1hh#jubaubeubeh"UU transformerrNU footnote_refsr}rUrefnamesr}rUsymbol_footnotesr]rUautofootnote_refsr]rUsymbol_footnote_refsr]rU citationsr]rh1hU current_linerNUtransform_messagesr]rcdocutils.nodes system_message r)r}r(h"Uh(}r(h,]UlevelKh*]h+]Usourceh%h-]h.]UlineKUtypeUINFOruh]rhd)r}r(h"Uh(}r(h,]h-]h+]h*]h.]uh#jh]rhEX/Hyperlink target "howto-ssl" is not referenced.rr}r(h"Uh#jubah&hgubah&Usystem_messager ubaUreporterr NUid_startr KU autofootnotesr ]r U citation_refsr}rUindirect_targetsr]rUsettingsr(cdocutils.frontend Values ror}r(Ufootnote_backlinksrKUrecord_dependenciesrNU rfc_base_urlrUhttps://tools.ietf.org/html/rU tracebackrUpep_referencesrNUstrip_commentsrNU toc_backlinksrUentryrU language_coderUenr U datestampr!NU report_levelr"KU _destinationr#NU halt_levelr$KU strip_classesr%NhBNUerror_encoding_error_handlerr&Ubackslashreplacer'Udebugr(NUembed_stylesheetr)Uoutput_encoding_error_handlerr*Ustrictr+U sectnum_xformr,KUdump_transformsr-NU docinfo_xformr.KUwarning_streamr/NUpep_file_url_templater0Upep-%04dr1Uexit_status_levelr2KUconfigr3NUstrict_visitorr4NUcloak_email_addressesr5Utrim_footnote_reference_spacer6Uenvr7NUdump_pseudo_xmlr8NUexpose_internalsr9NUsectsubtitle_xformr:U source_linkr;NUrfc_referencesr<NUoutput_encodingr=Uutf-8r>U source_urlr?NUinput_encodingr@U utf-8-sigrAU_disable_configrBNU id_prefixrCUUcharacter_level_inline_markuprDU tab_widthrEKUerror_encodingrFUUTF-8rGU_sourcerHh%Ugettext_compactrIU generatorrJNUdump_internalsrKNU smart_quotesrLU pep_base_urlrMU https://www.python.org/dev/peps/rNUsyntax_highlightrOUlongrPUinput_encoding_error_handlerrQj+Uauto_id_prefixrRUidrSUdoctitle_xformrTUstrip_elements_with_classesrUNU _config_filesrV]Ufile_insertion_enabledrWU raw_enabledrXKU dump_settingsrYNubUsymbol_footnote_startrZKh*}r[(hhhh3hhhj>hjhjhh3uUsubstitution_namesr\}r]h&h1h(}r^(h,]h*]h+]Usourceh%h-]h.]uU footnotesr_]r`Urefidsra}rbh]rch asub.M2Crypto-0.31.0/doc/doctrees/index.doctree0000664000175000001440000001605713236336220020577 0ustar matejusers00000000000000cdocutils.nodes document q)q}q(U nametypesq}q(X$welcome to m2crypto's documentation!qNXindices and tablesqNXhowtosqNuUsubstitution_defsq }q Uparse_messagesq ]q Ucurrent_sourceq NU decorationqNUautofootnote_startqKUnameidsq}q(hU#welcome-to-m2crypto-s-documentationqhUindices-and-tablesqhUhowtosquUchildrenq]q(cdocutils.nodes section q)q}q(U rawsourceqUUparentqhUsourceqX(/home/matej/Build/m2crypto/doc/index.rstqUtagnameqUsectionqU attributesq }q!(Udupnamesq"]Uclassesq#]Ubackrefsq$]Uidsq%]q&haUnamesq']q(hauUlineq)KUdocumentq*hh]q+(cdocutils.nodes title q,)q-}q.(hX$Welcome to M2Crypto's documentation!q/hhhhhUtitleq0h }q1(h"]h#]h$]h%]h']uh)Kh*hh]q2cdocutils.nodes Text q3X&Welcome to M2Crypto’s documentation!q4q5}q6(hUhNh)Nh*hhh-ubaubcdocutils.nodes paragraph q7)q8}q9(hX Contents:q:hhhhhU paragraphq;h }q<(h"]h#]h$]h%]h']uh)Kh*hh]q=h3X Contents:q>q?}q@(hUhNh)Nh*hhh8ubaubcdocutils.nodes compound qA)qB}qC(hUhhhhhUcompoundqDh }qE(h"]h#]qFUtoctree-wrapperqGah$]h%]h']uh)Nh*hh]qHcsphinx.addnodes toctree qI)qJ}qK(hUhhBhhhUtoctreeqLh }qM(UnumberedqNKU includehiddenqOhXindexqPUcaptionqQNUglobqRh%]h$]U titlesonlyqSh"]h#]h']UentriesqT]qUNXM2CryptoqVqWaUhiddenqXU includefilesqY]qZhVaUmaxdepthq[Kuh)Kh]ubaubeubh)q\}q](hUhhhhhhh }q^(h"]h#]h$]h%]q_hah']q`hauh)K h*hh]qa(h,)qb}qc(hXHOWTOsqdhh\hhhh0h }qe(h"]h#]h$]h%]h']uh)K h*hh]qfh3XHOWTOsqgqh}qi(hUhNh)Nh*hhhbubaubcdocutils.nodes bullet_list qj)qk}ql(hUhh\hhhU bullet_listqmh }qn(UbulletqoX*h%]h$]h"]h#]h']uh)Kh*hh]qp(cdocutils.nodes list_item qq)qr}qs(hX:ref:`howto-ca` hhkhhhU list_itemqth }qu(h"]h#]h$]h%]h']uh)Nh*hh]qvh7)qw}qx(hX:ref:`howto-ca`qyhhrhhhh;h }qz(h"]h#]h$]h%]h']uh)Kh]q{csphinx.addnodes pending_xref q|)q}}q~(hhyhhwhhhU pending_xrefqh }q(UreftypeXrefUrefwarnqU reftargetqXhowto-caU refdomainXstdqh%]h$]U refexplicith"]h#]h']UrefdocqhPuh)Kh]qcdocutils.nodes inline q)q}q(hhyh }q(h"]h#]q(UxrefqhXstd-refqeh$]h%]h']uhh}h]qh3Xhowto-caqq}q(hUhhubahUinlinequbaubaubaubhq)q}q(hX:ref:`howto-ssl` hhkhhhhth }q(h"]h#]h$]h%]h']uh)Nh*hh]qh7)q}q(hX:ref:`howto-ssl`qhhhhhh;h }q(h"]h#]h$]h%]h']uh)Kh]qh|)q}q(hhhhhhhhh }q(UreftypeXrefhhX howto-sslU refdomainXstdqh%]h$]U refexplicith"]h#]h']hhPuh)Kh]qh)q}q(hhh }q(h"]h#]q(hhXstd-refqeh$]h%]h']uhhh]qh3X howto-sslqq}q(hUhhubahhubaubaubaubhq)q}q(hX:ref:`howto-smime` hhkhhhhth }q(h"]h#]h$]h%]h']uh)Nh*hh]qh7)q}q(hX:ref:`howto-smime`qhhhhhh;h }q(h"]h#]h$]h%]h']uh)Kh]qh|)q}q(hhhhhhhhh }q(UreftypeXrefhhX howto-smimeU refdomainXstdqh%]h$]U refexplicith"]h#]h']hhPuh)Kh]qh)q}q(hhh }q(h"]h#]q(hhXstd-refqeh$]h%]h']uhhh]qh3X howto-smimeqq}q(hUhhubahhubaubaubaubhq)q}q(hX:ref:`zserverssl-howto` hhkhhhhth }q(h"]h#]h$]h%]h']uh)Nh*hh]qh7)q}q(hX:ref:`zserverssl-howto`qhhhhhh;h }q(h"]h#]h$]h%]h']uh)Kh]qh|)q}q(hhhhhhhhh }q(UreftypeXrefhhXzserverssl-howtoU refdomainXstdqh%]h$]U refexplicith"]h#]h']hhPuh)Kh]qh)q}q(hhh }q(h"]h#]q(hhXstd-refqeh$]h%]h']uhhh]qh3Xzserverssl-howtoqԅq}q(hUhhubahhubaubaubaubeubeubh)q}q(hUhhhhhhh }q(h"]h#]h$]h%]qhah']qhauh)Kh*hh]q(h,)q}q(hXIndices and tablesqhhhhhh0h }q(h"]h#]h$]h%]h']uh)Kh*hh]qh3XIndices and tablesq⅁q}q(hUhNh)Nh*hhhubaubhj)q}q(hUhhhhhhmh }q(hoX*h%]h$]h"]h#]h']uh)Kh*hh]q(hq)q}q(hX:ref:`genindex`qhhhhhhth }q(h"]h#]h$]h%]h']uh)Nh*hh]qh7)q}q(hhhhhhhh;h }q(h"]h#]h$]h%]h']uh)Kh]qh|)q}q(hhhhhhhhh }q(UreftypeXrefhhXgenindexU refdomainXstdqh%]h$]U refexplicith"]h#]h']hhPuh)Kh]qh)q}q(hhh }q(h"]h#]q(hhXstd-refqeh$]h%]h']uhhh]qh3Xgenindexqq}q(hUhhubahhubaubaubaubhq)r}r(hX:ref:`modindex`rhhhhhhth }r(h"]h#]h$]h%]h']uh)Nh*hh]rh7)r}r(hjhjhhhh;h }r(h"]h#]h$]h%]h']uh)Kh]rh|)r }r (hjhjhhhhh }r (UreftypeXrefhhXmodindexU refdomainXstdr h%]h$]U refexplicith"]h#]h']hhPuh)Kh]r h)r}r(hjh }r(h"]h#]r(hj Xstd-refreh$]h%]h']uhj h]rh3Xmodindexrr}r(hUhjubahhubaubaubaubhq)r}r(hX:ref:`search` hhhhhhth }r(h"]h#]h$]h%]h']uh)Nh*hh]rh7)r}r(hX :ref:`search`rhjhhhh;h }r(h"]h#]h$]h%]h']uh)Kh]rh|)r }r!(hjhjhhhhh }r"(UreftypeXrefhhXsearchU refdomainXstdr#h%]h$]U refexplicith"]h#]h']hhPuh)Kh]r$h)r%}r&(hjh }r'(h"]h#]r((hj#Xstd-refr)eh$]h%]h']uhj h]r*h3Xsearchr+r,}r-(hUhj%ubahhubaubaubaubeubeubehUU transformerr.NU footnote_refsr/}r0Urefnamesr1}r2Usymbol_footnotesr3]r4Uautofootnote_refsr5]r6Usymbol_footnote_refsr7]r8U citationsr9]r:h*hU current_liner;NUtransform_messagesr<]r=Ureporterr>NUid_startr?KU autofootnotesr@]rAU citation_refsrB}rCUindirect_targetsrD]rEUsettingsrF(cdocutils.frontend Values rGorH}rI(Ufootnote_backlinksrJKUrecord_dependenciesrKNU rfc_base_urlrLUhttps://tools.ietf.org/html/rMU tracebackrNUpep_referencesrONUstrip_commentsrPNU toc_backlinksrQUentryrRU language_coderSUenrTU datestamprUNU report_levelrVKU _destinationrWNU halt_levelrXKU strip_classesrYNh0NUerror_encoding_error_handlerrZUbackslashreplacer[Udebugr\NUembed_stylesheetr]Uoutput_encoding_error_handlerr^Ustrictr_U sectnum_xformr`KUdump_transformsraNU docinfo_xformrbKUwarning_streamrcNUpep_file_url_templaterdUpep-%04dreUexit_status_levelrfKUconfigrgNUstrict_visitorrhNUcloak_email_addressesriUtrim_footnote_reference_spacerjUenvrkNUdump_pseudo_xmlrlNUexpose_internalsrmNUsectsubtitle_xformrnU source_linkroNUrfc_referencesrpNUoutput_encodingrqUutf-8rrU source_urlrsNUinput_encodingrtU utf-8-sigruU_disable_configrvNU id_prefixrwUUcharacter_level_inline_markuprxU tab_widthryKUerror_encodingrzUUTF-8r{U_sourcer|hUgettext_compactr}U generatorr~NUdump_internalsrNU smart_quotesrU pep_base_urlrU https://www.python.org/dev/peps/rUsyntax_highlightrUlongrUinput_encoding_error_handlerrj_Uauto_id_prefixrUidrUdoctitle_xformrUstrip_elements_with_classesrNU _config_filesr]Ufile_insertion_enabledrU raw_enabledrKU dump_settingsrNubUsymbol_footnote_startrKh%}r(hhhhhh\uUsubstitution_namesr}rhh*h }r(h"]h%]h$]Usourcehh#]h']uU footnotesr]rUrefidsr}rub.M2Crypto-0.31.0/doc/howto.ca.rst0000664000175000001440000003714113165756570016601 0ustar matejusers00000000000000:orphan: .. _howto-ca: HOWTO: Creating your own CA with OpenSSL ######################################## :author: Pheng Siong Ng :copyright: © 2000, 2001 by Ng Pheng Siong. Introduction ============ This is a HOWTO on creating your own *certification authority* (*CA*) with OpenSSL. I last created a CA about a year ago, when I began work on `M2Crypto `__ and needed certificates for the SSL bits. I accepted the tools' default settings then, e.g., certificate validity of 365 days; this meant that my certificates, including my CA's certificate, have now expired. Since I am using these certificates for M2Crypto's demonstration programs (and I have forgotten the passphrase to the CA's private key), I decided to discard the old CA and start afresh. I also decided to document the process, hence this HOWTO. The Procedure ============= I use ``CA.pl``, a Perl program written by Steve Hanson and bundled with OpenSSL. The following are the steps to create a CA: 1. Choose a directory to do your CA work. All commands are executed within this directory. Let's call the directory ``demo``. 2. Copy ``CA.pl`` and ``openssl.cnf`` into ``demo``. 3. Apply the following patch to ``CA.pl``, which allows it to generate a CA certificate with a validity period of 1095 days, i.e., 3 years:: --- CA.pl.org Sat Mar 31 12:40:13 2001 +++ CA.pl Sat Mar 31 12:41:15 2001 @@ -97,7 +97,7 @@ } else { print "Making CA certificate ...\n"; system ("$REQ -new -x509 -keyout " . - "${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT $DAYS"); + "${CATOP}/private/$CAKEY -out ${CATOP}/$CACERT -days 1095"); $RET=$?; } } 4. Create a new CA like this:: ./CA.pl -newca A certificate filename (or enter to create) Making CA certificate ... Using configuration from openssl.cnf Generating a 1024 bit RSA private key ............++++++ ......................++++++ writing new private key to './demoCA/private/cakey.pem' Enter PEM pass phrase: Verifying password - Enter PEM pass phrase: ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:. Locality Name (eg, city) []:.. Organization Name (eg, company) [Internet Widgits Pty Ltd]:DemoCA Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:DemoCA Certificate Master Email Address []:certmaster@democa.dom This creates a new CA in the directory ``demoCA``. The CA's self-signed certificate is in ``demoCA/cacert.pem`` and its RSA key pair is in ``demoCA/private/cakey.pem``. ``demoCA/private/cakey.pem`` looks like this:: cat demoCA/private/cakey.pem -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,19973A9DBBB601BA eOq9WFScNiI4/UWEUaSnGTKpJv2JYuMD3HwQox2Q3Cd4zGqVjJ6gF3exa5126cKf X/bMVnwbPpuFZPiAIvaLyCjT6pYeXTBbSzs7/GQnvEOv+nYnDUFWi0Qm92qLk0uy pFi/M1aWheN3vir2ZlAw+DW0bOOZhj8tC7Co7lMYb0YE271b6/YRPZCwQ3GXAHUJ +aMYxlUDrK45aCUa/1CZDzTgk7h9cDgx2QJSIvYMYytCfI3zsuZMJS8/4OXLL0bI lKmAc1dwB3DqGJt5XK4WJesiNfdxeCNEgAcYtEAgYZTPIApU+kTgTCIxJl2nMW7j ax+Q1z7g+4MpgG20WD633D4z4dTlDdz+dnLi0rvuvxiwt+dUhrqiML1tyi+Z6EBH jU4/cLBWev3rYfrlp4x8J9mDte0YKOk3t0wQOHqRetTsIfdtjnFp/Hu3qDmTCWjD z/g7PPoO/bg/B877J9WBPbL/1hXXFYo88M+2aGlPOgDcFdiOqbLb2DCscohMbbVr A4mgiy2kwWfIE73qiyV7yyG8FlRvr1iib+jbT3LTGf743utYAAs7HNGuOUObhoyt jYvBD7ACn35P5YX7KTqvqErwdijxYCaNBCnvmRtmYSaNw9Kv1UJTxc5Vx7YLwIPk E9KyBgKI7vPOjWBZ27+zOvNycmv1ciNtpALAw4bWtXnhCDVTHaVDy34OkheMzNCg 2cjcBFzOkMIjcI03KbTQXOFIQGlsTWXGzkNf/zBQ+KksT1MCj+zBXSCvlDASMckg kef21pGgUqPF14gKGfWX3sV4bjc1vbrRwq6zlG3nMuYqR5MtJJY9eQ== -----END RSA PRIVATE KEY----- 5. Next, generate a certificate request:: ./CA.pl -newreq Using configuration from openssl.cnf Generating a 1024 bit RSA private key ..........++++++ ..............++++++ writing new private key to 'newreq.pem' Enter PEM pass phrase: Verifying password - Enter PEM pass phrase: ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:.. Locality Name (eg, city) []:. Organization Name (eg, company) [Internet Widgits Pty Ltd]:M2Crypto Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:localhost Email Address []:admin@server.example.dom Please enter the following 'extra' attributes to be sent with your certificate request A challenge password []: An optional company name []: Request (and private key) is in newreq.pem \ The certificate request and private key in ``newreq.pem`` looks like this:: cat newreq.pem -----BEGIN RSA PRIVATE KEY----- Proc-Type: 4,ENCRYPTED DEK-Info: DES-EDE3-CBC,41B2874DF3D02DD4 mg611EoVkLEooSTv+qTM0Ddmm/M1jE/Jy5RD/sc3LSMhuGu9xc26OgsTJmkQuIAh J/B4lAw8G59VTG6DykeEtrG0rUBx4bggc7PKbFuiN423YjJODWcHvVgnPOzXMQt+ lY4tPl5+217MRHyx2NsWGrpkQNdu3GeSPOVMl3jeQiaXupONbwQ7rj42+X/VtAJP W4D1NNwu8aGCPyShsEXHc/fI1WDpphYWke97pOjIZVQESFZOPty5HjIYZux4U+td W81xODtq2ecJXc8fn2Wpa9y5VD1LT7oJksOuL1+Z04OVaeUe4x0swM17HlBm2kVt fe/C/L6kN27MwZhE331VjtTjSGl4/gknqQDbLOtqT06f3OISsDJETm2itllyhgzv C6Fi3N03rGFmKectijC+tws5k+P+HRG6sai33usk8xPokJqA+HYSWPz1XVlpRmv4 kdjQOdST7ovU62mOTgf3ARcduPPwuzTfxOlYONe5NioO1APVHBrInQwcpLkpOTQR vI4roIN+b75/nihUWGUJn/nbbBa2Yl0N5Gs1Tyiy9Z+CcRT2TfWKBBFlEUIFl7Mb J9fTV3DI+k+akbR4il1NkQ8EcSmCr3WpA0I9n0EHI7ZVpVaHxc0sqaPFl8YGdFHq 1Qk53C/w6+qPpDzT3yKFmG2LZytAAM1czvb6RbNRJJP2ZrpBwn/h99sUTo/yPfxY nueYmFJDm0uVNtG0icXGNUfSfnjKNTtHPAgyKGetRIC3kgJz/bo2w7EI6iEjBAzK l5TRm4x6ZJxwuXXMiJCehMMd8TC8ybwWO4AO19B3ebFFeTVsUgxSGA== -----END RSA PRIVATE KEY----- -----BEGIN CERTIFICATE REQUEST----- MIIBnTCCAQYCAQAwXTELMAkGA1UEBhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRIw EAYDVQQDEwlsb2NhbGhvc3QxJzAlBgkqhkiG9w0BCQEWGGFkbWluQHNlcnZlci5l eGFtcGxlLmRvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAr1nYY1Qrll1r uB/FqlCRrr5nvupdIN+3wF7q915tvEQoc74bnu6b8IbbGRMhzdzmvQ4SzFfVEAuM MuTHeybPq5th7YDrTNizKKxOBnqE2KYuX9X22A1Kh49soJJFg6kPb9MUgiZBiMlv tb7K3CHfgw5WagWnLl8Lb+ccvKZZl+8CAwEAAaAAMA0GCSqGSIb3DQEBBAUAA4GB AHpoRp5YS55CZpy+wdigQEwjL/wSluvo+WjtpvP0YoBMJu4VMKeZi405R7o8oEwi PdlrrliKNknFmHKIaCKTLRcU59ScA6ADEIWUzqmUzP5Cs6jrSRo3NKfg1bd09D1K 9rsQkRc9Urv9mRBIsredGnYECNeRaK5R1yzpOowninXC -----END CERTIFICATE REQUEST----- \ Decoding the certificate request gives the following:: openssl req -text -noout < newreq.pem Using configuration from /usr/local/pkg/openssl/openssl.cnf Certificate Request: Data: Version: 0 (0x0) Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50: 91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e: 6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13: 21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4: c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac: 4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f: 6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9: 6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f: 0b:6f:e7:1c:bc:a6:59:97:ef Exponent: 65537 (0x10001) Attributes: a0:00 Signature Algorithm: md5WithRSAEncryption 7a:68:46:9e:58:4b:9e:42:66:9c:be:c1:d8:a0:40:4c:23:2f: fc:12:96:eb:e8:f9:68:ed:a6:f3:f4:62:80:4c:26:ee:15:30: a7:99:8b:8d:39:47:ba:3c:a0:4c:22:3d:d9:6b:ae:58:8a:36: 49:c5:98:72:88:68:22:93:2d:17:14:e7:d4:9c:03:a0:03:10: 85:94:ce:a9:94:cc:fe:42:b3:a8:eb:49:1a:37:34:a7:e0:d5: b7:74:f4:3d:4a:f6:bb:10:91:17:3d:52:bb:fd:99:10:48:b2: b7:9d:1a:76:04:08:d7:91:68:ae:51:d7:2c:e9:3a:8c:27:8a: 75:c2 6. Now, sign the certificate request:: ./CA.pl -sign Using configuration from openssl.cnf Enter PEM pass phrase: Check that the request matches the signature Signature ok The Subjects Distinguished Name is as follows countryName :PRINTABLE:'SG' organizationName :PRINTABLE:'M2Crypto' commonName :PRINTABLE:'localhost' emailAddress :IA5STRING:'admin@server.example.dom' Certificate is to be certified until Mar 31 02:57:30 2002 GMT (365 days) Sign the certificate? [y/n]:y 1 out of 1 certificate requests certified, commit? [y/n]y Write out database with 1 new entries Data Base Updated Signed certificate is in newcert.pem \ ``newcert.pem`` looks like this:: cat newcert.pem Certificate: Data: Version: 3 (0x2) Serial Number: 1 (0x1) Signature Algorithm: md5WithRSAEncryption Issuer: C=SG, O=DemoCA, CN=DemoCA Certificate Master/Email=certmaster@democa.dom Validity Not Before: Mar 31 02:57:30 2001 GMT Not After : Mar 31 02:57:30 2002 GMT Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50: 91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e: 6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13: 21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4: c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac: 4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f: 6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9: 6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f: 0b:6f:e7:1c:bc:a6:59:97:ef Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: Certificate: Data: Version: 3 (0x2) Serial Number: 1 (0x1) Signature Algorithm: md5WithRSAEncryption Issuer: C=SG, O=DemoCA, CN=DemoCA Certificate Master/Email=certmaster@democa.dom Validity Not Before: Mar 31 02:57:30 2001 GMT Not After : Mar 31 02:57:30 2002 GMT Subject: C=SG, O=M2Crypto, CN=localhost/Email=admin@server.example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:af:59:d8:63:54:2b:96:5d:6b:b8:1f:c5:aa:50: 91:ae:be:67:be:ea:5d:20:df:b7:c0:5e:ea:f7:5e: 6d:bc:44:28:73:be:1b:9e:ee:9b:f0:86:db:19:13: 21:cd:dc:e6:bd:0e:12:cc:57:d5:10:0b:8c:32:e4: c7:7b:26:cf:ab:9b:61:ed:80:eb:4c:d8:b3:28:ac: 4e:06:7a:84:d8:a6:2e:5f:d5:f6:d8:0d:4a:87:8f: 6c:a0:92:45:83:a9:0f:6f:d3:14:82:26:41:88:c9: 6f:b5:be:ca:dc:21:df:83:0e:56:6a:05:a7:2e:5f: 0b:6f:e7:1c:bc:a6:59:97:ef Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Comment: OpenSSL Generated Certificate X509v3 Subject Key Identifier: B3:D6:89:88:2F:B1:15:40:EC:0A:C0:30:35:3A:B7:DA:72:73:1B:4D X509v3 Authority Key Identifier: keyid:F9:6A:A6:34:97:6B:BC:BB:5A:17:0D:19:FC:62:21:0B:00:B5:0E:29 DirName:/C=SG/O=DemoCA/CN=DemoCA Certificate Master/Email=certmaster@democa.dom serial:00 Signature Algorithm: md5WithRSAEncryption 7. In certain situations, e.g., where your certificate and private key are to be used in an unattended SSL server, you may wish to not encrypt the private key, i.e., leave the key in the clear. This decision should be governed by your site's security policy and threat model, of course:: openssl rsa < newkey.pem > newkey2.pem read RSA key Enter PEM pass phrase: writing RSA key ``newkey2.pem`` looks like this:: cat newkey2.pem -----BEGIN RSA PRIVATE KEY----- MIICXgIBAAKBgQCvWdhjVCuWXWu4H8WqUJGuvme+6l0g37fAXur3Xm28RChzvhue 7pvwhtsZEyHN3Oa9DhLMV9UQC4wy5Md7Js+rm2HtgOtM2LMorE4GeoTYpi5f1fbY DUqHj2ygkkWDqQ9v0xSCJkGIyW+1vsrcId+DDlZqBacuXwtv5xy8plmX7wIDAQAB AoGAbAkU8w3W1Qu15Hle1bJSL7GMReoreqeblOBmMAZz4by0l6sXZXJpjWXo86f/ +dASMYTMPC4ZTYtv06N07AFbjL+kDfqDMTfzQkYMHp1LAq1Ihbq1rHWSBH5n3ekq KiY8JKpv8DR5Po1iKaXJFuDByGDENJwYbSRSpSK3P+vkWWECQQDkEUE/ZPqqqZkQ 2iWRPAsCbEID8SAraQl3DdCLYs/GgARfmmj4yUHEwkys9Jo1H8k4BdxugmaUwNi5 YQ/CVzrXAkEAxNO80ArbGxPUmr11GHG/bGBYj1DUBkHZSc7dgxZdtUCLGNxQnNsg Iwq3n6j1sUzS3UW6abQ8bivYNOUcMKJAqQJBANQxFaLU4b/NQaODQ3aoBZpAfP9L 5eFdvbet+7zjt2r5CpikgkwOfAmDuXEltx/8LevY0CllW+nErx9zJgVrwUsCQQCu 76H5JiznPBDSF2FjgHWqVVdgyW4owY3mU739LHvNBLicN/RN9VPy0Suy8/CqzKT9 lWPBXzf2k3FuUdNkRlFBAkEAmpXoybuiFR2S5Bma/ax96lVs0/VihhfC1zZP/X/F Br77+h9dIul+2DnyOl50zu0Sdzst1/7ay4JSDHyiBCMGSQ== -----END RSA PRIVATE KEY----- That's it! The certificate, ``newcert.pem``, and the private key - ``newkey.pem`` (encrypted) or ``newkey2.pem`` (unencrypted) - are now ready to be used. You may wish to rename the files to more intuitive names. You should also keep the CA's certificate ``demo/cacert.pem`` handy for use when developing and deploying SSL or S/MIME applications. Conclusion ========== We've walked through the basic steps in the creation of a CA and certificates using the tools that come with OpenSSL. We did not cover more advanced topics such as constraining a certificate to be SSL-only or S/MIME-only. There exist several HOWTOs similar to this one on the net. This one is written specifically to facilitate discussions in my other HOWTOs on developing SSL and S/MIME applications in `Python `__ using `M2Crypto `__. M2Crypto-0.31.0/doc/howto.smime.rst0000664000175000001440000007025613165756570017334 0ustar matejusers00000000000000:orphan: .. _howto-smime: HOWTO: Programming S/MIME in Python with M2Crypto ================================================= :author: Pheng Siong Ng :copyright: © 2000, 2001 by Ng Pheng Siong. Introduction ============ `M2Crypto `__ is a `Python `__ interface to `OpenSSL `__. It makes available to the Python programmer SSL functionality to implement clients and servers, S/MIME v2, RSA, DSA, DH, symmetric ciphers, message digests and HMACs. This document demonstrates programming S/MIME with M2Crypto. S/MIME ====== S/MIME - Secure Multipurpose Internet Mail Extensions [RFC 2311, RFC 2312] - provides a consistent way to send and receive secure MIME data. Based on the popular Internet MIME standard, S/MIME provides the following cryptographic security services for electronic messaging applications - *authentication*, *message integrity* and *non-repudiation of origin* (using *digital signatures*), and *privacy* and *data security* (using *encryption*). Keys and Certificates ===================== To create an S/MIME-signed message, you need an RSA key pair (this consists of a public key and a private key) and an X.509 certificate of said public key. To create an S/MIME-encrypted message, you need an X.509 certificate for each recipient. To create an S/MIME-signed *and* -encrypted message, first create a signed message, then encrypt the signed message with the recipients' certificates. You may generate key pairs and obtain certificates by using a commercial *certification authority* service. You can also do so using freely-available software. For many purposes, e.g., automated S/MIME messaging by system administration processes, this approach is cheap and effective. We now work through using OpenSSL to generate key pairs and certificates. This assumes you have OpenSSL installed properly on your system. First, we generate an X.509 certificate to be used for signing:: openssl req -newkey rsa:1024 -nodes -x509 -days 365 -out signer.pem Using configuration from /usr/local/pkg/openssl/openssl.cnf Generating a 1024 bit RSA private key ..++++++ ....................++++++ writing new private key to 'privkey.pem' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:. Locality Name (eg, city) []:. Organization Name (eg, company) [Internet Widgits Pty Ltd]:M2Crypto Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:S/MIME Sender Email Address []:sender@example.dom This generates a 1024-bit RSA key pair, unencrypted, into ``privkey.pem``; it also generates a self-signed X.509 certificate for the public key into ``signer.pem``. The certificate is valid for 365 days, i.e., a year. Let's rename ``privkey.pem`` so that we know it is a companion of ``signer.pem``'s:: mv privkey.pem signer_key.pem To verify the content of ``signer.pem``, execute the following:: openssl x509 -noout -text -in signer.pem Certificate: Data: Version: 3 (0x2) Serial Number: 0 (0x0) Signature Algorithm: md5WithRSAEncryption Issuer: C=SG, O=M2Crypto, CN=S/MIME Sender/Email=sender@example.dom Validity Not Before: Mar 24 12:56:16 2001 GMT Not After : Mar 24 12:56:16 2002 GMT Subject: C=SG, O=M2Crypto, CN=S/MIME Sender/Email=sender@example.dom Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public Key: (1024 bit) Modulus (1024 bit): 00:a9:d6:e2:b5:11:3b:ae:3c:e2:17:31:70:e1:6e: 01:f4:19:6d:bd:2a:42:36:2b:37:34:e2:83:1d:0d: 11:2e:b4:99:44:db:10:67:be:97:5f:5b:1a:26:33: 46:23:2f:95:04:7a:35:da:9d:f9:26:88:39:9e:17: cd:3e:eb:a8:19:8d:a8:2a:f1:43:da:55:a9:2e:2c: 65:ed:04:71:42:ce:73:53:b8:ea:7e:c7:f0:23:c6: 63:c5:5e:68:96:64:a7:b4:2a:94:26:76:eb:79:ea: e3:4e:aa:82:09:4f:44:87:4a:12:62:b5:d7:1f:ca: f2:ce:d5:ba:7e:1f:48:fd:b9 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Subject Key Identifier: 29:FB:38:B6:BF:E2:40:BB:FF:D5:71:D7:D5:C4:F0:83:1A:2B:C7:99 X509v3 Authority Key Identifier: keyid:29:FB:38:B6:BF:E2:40:BB:FF:D5:71:D7:D5:C4:F0:83:1A:2B:C7:99 DirName:/C=SG/O=M2Crypto/CN=S/MIME Sender/Email=sender@example.dom serial:00 X509v3 Basic Constraints: CA:TRUE Signature Algorithm: md5WithRSAEncryption 68:c8:6b:1b:fa:7c:9a:39:35:76:18:15:c9:fd:89:97:62:db: 7a:b0:2d:13:dd:97:e8:1b:7a:9f:22:27:83:24:9d:2e:56:ec: 97:89:3c:ef:16:55:80:5a:18:7c:22:d0:f6:bb:e3:a4:e8:59: 30:ff:99:5a:93:3e:ea:bc:ee:7f:8d:d6:7d:37:8c:ac:3d:74: 80:ce:7a:99:ba:27:b9:2a:a3:71:fa:a5:25:ba:47:17:df:07: 56:96:36:fd:60:b9:6c:96:06:e8:e3:7b:9f:4b:6a:95:71:a8: 34:fc:fc:b5:88:8b:c4:3f:1e:24:f6:52:47:b2:7d:44:67:d9: 83:e8 Next, we generate a self-signed X.509 certificate for the recipient. Note that ``privkey.pem`` will be recreated:: openssl req -newkey rsa:1024 -nodes -x509 -days 365 -out recipient.pem Using configuration from /usr/local/pkg/openssl/openssl.cnf Generating a 1024 bit RSA private key .....................................++++++ .................++++++ writing new private key to 'privkey.pem' ----- You are about to be asked to enter information that will be incorporated into your certificate request. What you are about to enter is what is called a Distinguished Name or a DN. There are quite a few fields but you can leave some blank For some fields there will be a default value, If you enter '.', the field will be left blank. ----- Country Name (2 letter code) [AU]:SG State or Province Name (full name) [Some-State]:. Locality Name (eg, city) []:. Organization Name (eg, company) [Internet Widgits Pty Ltd]:M2Crypto Organizational Unit Name (eg, section) []:. Common Name (eg, YOUR name) []:S/MIME Recipient Email Address []:recipient@example.dom Again, rename ``privkey.pem``:: mv privkey.pem recipient_key.pem In the examples to follow, S/MIME Sender, ````, shall be the sender of S/MIME messages, while S/MIME Recipient, ````, shall be the recipient of S/MIME messages. Armed with the key pairs and certificates, we are now ready to begin programming S/MIME in Python. **Note:** The private keys generated above are *not passphrase-protected*, i.e., they are *in the clear*. Anyone who has access to such a key can generate S/MIME-signed messages with it, and decrypt S/MIME messages encrypted to it's corresponding public key. We may passphrase-protect the keys, if we so choose. M2Crypto will prompt the user for the passphrase when such a key is being loaded. M2Crypto.SMIME ============== The Python programmer accesses M2Crypto's S/MIME functionality through class ``SMIME`` in the module ``M2Crypto.SMIME``. Typically, an ``SMIME`` object is instantiated; the object is then set up for the intended operation: sign, encrypt, decrypt or verify; finally, the operation is invoked on the object. ``M2Crypto.SMIME`` makes extensive use of ``M2Crypto.BIO``: ``M2Crypto.BIO`` is a Python abstraction of the ``BIO`` abstraction in OpenSSL. A commonly used ``BIO`` abstraction in M2Crypto is ``M2Crypto.BIO.MemoryBuffer``, which implements a memory-based file-like object, similar to Python's own ``StringIO``. Sign ==== The following code demonstrates how to generate an S/MIME-signed message. ``randpool.dat`` contains random data which is used to seed OpenSSL's pseudo-random number generator via M2Crypto:: from M2Crypto import BIO, Rand, SMIME def makebuf(text): return BIO.MemoryBuffer(text) # Make a MemoryBuffer of the message. buf = makebuf('a sign of our times') # Seed the PRNG. Rand.load_file('randpool.dat', -1) # Instantiate an SMIME object; set it up; sign the buffer. s = SMIME.SMIME() s.load_key('signer_key.pem', 'signer.pem') p7 = s.sign(buf, SMIME.PKCS7_DETACHED) ``p7`` now contains a *PKCS #7 signature blob* wrapped in an ``M2Crypto.SMIME.PKCS7`` object. Note that ``buf`` has been consumed by ``sign()`` and has to be recreated if it is to be used again. We may now send the signed message via SMTP. In these examples, we shall not do so; instead, we'll render the S/MIME output in mail-friendly format, and pretend that our messages are sent and received correctly:: # Recreate buf. buf = makebuf('a sign of our times') # Output p7 in mail-friendly format. out = BIO.MemoryBuffer() out.write('From: sender@example.dom\n') out.write('To: recipient@example.dom\n') out.write('Subject: M2Crypto S/MIME testing\n') s.write(out, p7, buf) print(out.read()) # Save the PRNG's state. Rand.save_file('randpool.dat') Here's the output:: From: sender@example.dom To: recipient@example.dom Subject: M2Crypto S/MIME testing MIME-Version: 1.0 Content-Type: multipart/signed ; protocol="application/x-pkcs7-signature" ; micalg=sha1 ; boundary="----3C93156FC7B4EBF49FE9C7DB7F503087" This is an S/MIME signed message ------3C93156FC7B4EBF49FE9C7DB7F503087 a sign of our times ------3C93156FC7B4EBF49FE9C7DB7F503087 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" MIIE8AYJKoZIhvcNAQcCoIIE4TCCBN0CAQExCzAJBgUrDgMCGgUAMCIGCSqGSIb3 DQEHAaAVBBNhIHNpZ24gb2Ygb3VyIHRpbWVzoIIC5zCCAuMwggJMoAMCAQICAQAw DQYJKoZIhvcNAQEEBQAwWzELMAkGA1UEBhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRv MRYwFAYDVQQDEw1TL01JTUUgU2VuZGVyMSEwHwYJKoZIhvcNAQkBFhJzZW5kZXJA ZXhhbXBsZS5kb20wHhcNMDEwMzMxMTE0MDMzWhcNMDIwMzMxMTE0MDMzWjBbMQsw CQYDVQQGEwJTRzERMA8GA1UEChMITTJDcnlwdG8xFjAUBgNVBAMTDVMvTUlNRSBT ZW5kZXIxITAfBgkqhkiG9w0BCQEWEnNlbmRlckBleGFtcGxlLmRvbTCBnzANBgkq hkiG9w0BAQEFAAOBjQAwgYkCgYEA5c5Tj1CHTSOxa1q2q0FYiwMWYHptJpJcvtZm UwrgU5sHrA8OnCM0cDXEj0KPf3cfNjHffB8HWMzI4UEgNmFXQNsxoGZ+iqwxLlNj y9Mh7eFW/Bjq5hNXbouSlQ0rWBRkoxV64y+t6lQehb32WfYXQbKFxFJSXzSxOx3R 8YhSPd0CAwEAAaOBtjCBszAdBgNVHQ4EFgQUXOyolL1t4jaBwZFRM7MS8nBLzUow gYMGA1UdIwR8MHqAFFzsqJS9beI2gcGRUTOzEvJwS81KoV+kXTBbMQswCQYDVQQG EwJTRzERMA8GA1UEChMITTJDcnlwdG8xFjAUBgNVBAMTDVMvTUlNRSBTZW5kZXIx ITAfBgkqhkiG9w0BCQEWEnNlbmRlckBleGFtcGxlLmRvbYIBADAMBgNVHRMEBTAD AQH/MA0GCSqGSIb3DQEBBAUAA4GBAHo3DrCHR86fSTVAvfiXdSswWqKtCEhUHRdC TLFGl4hDk2GyZxaFuqZwiURz/H7nMicymI2wkz8H/wyHFg8G3BIehURpj2v/ZWXY eovbgS7EZALVVkDj4hNl/IIHWd6Gtv1UODf7URbxtl3hQ9/eTWITrefT1heuPnar 8czydsOLMYIBujCCAbYCAQEwYDBbMQswCQYDVQQGEwJTRzERMA8GA1UEChMITTJD cnlwdG8xFjAUBgNVBAMTDVMvTUlNRSBTZW5kZXIxITAfBgkqhkiG9w0BCQEWEnNl bmRlckBleGFtcGxlLmRvbQIBADAJBgUrDgMCGgUAoIGxMBgGCSqGSIb3DQEJAzEL BgkqhkiG9w0BBwEwHAYJKoZIhvcNAQkFMQ8XDTAxMDMzMTExNDUwMlowIwYJKoZI hvcNAQkEMRYEFOoeRUd8ExIYXfQq8BTFuKWrSP3iMFIGCSqGSIb3DQEJDzFFMEMw CgYIKoZIhvcNAwcwDgYIKoZIhvcNAwICAgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsO AwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqGSIb3DQEBAQUABIGAQpU8hFUtLCF6hO2t ec9EYJ/Imqqiiw+BxWxkUUVT81Vbjwdn9JST6+sztM5JRP2ZW+b4txEjZriYC8f3 kv95YMTGbIsuWkJ93GrbvqoJ/CxO23r9WWRnZEm/1EZN9ZmlrYqzBTxnNRmP3Dhj cW8kzZwH+2/2zz2G7x1HxRWH95A= ------3C93156FC7B4EBF49FE9C7DB7F503087-- Verify ====== Assume the above output has been saved into ``sign.p7``. Let's now verify the signature:: from M2Crypto import SMIME, X509 # Instantiate an SMIME object. s = SMIME.SMIME() # Load the signer's cert. x509 = X509.load_cert('signer.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) # Load the signer's CA cert. In this case, because the signer's # cert is self-signed, it is the signer's cert itself. st = X509.X509_Store() st.load_info('signer.pem') s.set_x509_store(st) # Load the data, verify it. p7, data = SMIME.smime_load_pkcs7('sign.p7') v = s.verify(p7, data) print(v) print(data) print(data.read()) Here's the output of the above program:: a sign of our times a sign of our times Suppose, instead of loading ``signer.pem`` above, we load ``recipient.pem``. That is, we do a global substitution of ``recipient.pem`` for ``signer.pem`` in the above program. Here's the modified program's output:: Traceback (most recent call last): File "./verify.py", line 22, in ? v = s.verify(p7) File "/usr/local/home/ngps/prog/m2/M2Crypto/SMIME.py", line 205, in verify raise SMIME_Error, Err.get_error() M2Crypto.SMIME.SMIME_Error: 312:error:21075075:PKCS7 routines:PKCS7_verify:certificate verify error:pk7_smime.c:213:Verify error:self signed certificate As displayed, the error is generated by line 213 of OpenSSL's ``pk7_smime.c`` (as of OpenSSL 0.9.6); if you are a C programmer, you may wish to look up the C source to explore OpenSSL's S/MIME implementation and understand why the error message is worded thus. Encrypt ======= We now demonstrate how to generate an S/MIME-encrypted message:: from M2Crypto import BIO, Rand, SMIME, X509 def makebuf(text): return BIO.MemoryBuffer(text) # Make a MemoryBuffer of the message. buf = makebuf('a sign of our times') # Seed the PRNG. Rand.load_file('randpool.dat', -1) # Instantiate an SMIME object. s = SMIME.SMIME() # Load target cert to encrypt to. x509 = X509.load_cert('recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) # Set cipher: 3-key triple-DES in CBC mode. s.set_cipher(SMIME.Cipher('des_ede3_cbc')) # Encrypt the buffer. p7 = s.encrypt(buf) # Output p7 in mail-friendly format. out = BIO.MemoryBuffer() out.write('From: sender@example.dom\n') out.write('To: recipient@example.dom\n') out.write('Subject: M2Crypto S/MIME testing\n') s.write(out, p7) print(out.read()) # Save the PRNG's state. Rand.save_file('randpool.dat') Here's the output of the above program:: From: sender@example.dom To: recipient@example.dom Subject: M2Crypto S/MIME testing MIME-Version: 1.0 Content-Disposition: attachment; filename="smime.p7m" Content-Type: application/x-pkcs7-mime; name="smime.p7m" Content-Transfer-Encoding: base64 MIIBVwYJKoZIhvcNAQcDoIIBSDCCAUQCAQAxggEAMIH9AgEAMGYwYTELMAkGA1UE BhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRkwFwYDVQQDExBTL01JTUUgUmVjaXBp ZW50MSQwIgYJKoZIhvcNAQkBFhVyZWNpcGllbnRAZXhhbXBsZS5kb20CAQAwDQYJ KoZIhvcNAQEBBQAEgYCBaXZ+qjpBEZwdP7gjfzfAtQitESyMwo3i+LBOw6sSDir6 FlNDPCnkrTvqDX3Rt6X6vBtTCYOm+qiN7ujPkOU61cN7h8dvHR8YW9+0IPY80/W0 lZ/HihSRgwTNd7LnxUUcPx8YV1id0dlmP0Hz+Lg+mHf6rqaR//JcYhX9vW4XvjA7 BgkqhkiG9w0BBwEwFAYIKoZIhvcNAwcECMN+qya6ADywgBgHr9Jkhwn5Gsdu7BwX nIQfYTYcdL9I5Sk= Decrypt ======= Assume the above output has been saved into ``encrypt.p7``. Decrypt the message thusly:: from M2Crypto import BIO, SMIME, X509 # Instantiate an SMIME object. s = SMIME.SMIME() # Load private key and cert. s.load_key('recipient_key.pem', 'recipient.pem') # Load the encrypted data. p7, data = SMIME.smime_load_pkcs7('encrypt.p7') # Decrypt p7. out = s.decrypt(p7) print(out) Here's the output:: a sign of our times Sign and Encrypt ================ Here's how to generate an S/MIME-signed/encrypted message:: from M2Crypto import BIO, Rand, SMIME, X509 def makebuf(text): return BIO.MemoryBuffer(text) # Make a MemoryBuffer of the message. buf = makebuf('a sign of our times') # Seed the PRNG. Rand.load_file('randpool.dat', -1) # Instantiate an SMIME object. s = SMIME.SMIME() # Load signer's key and cert. Sign the buffer. s.load_key('signer_key.pem', 'signer.pem') p7 = s.sign(buf) # Load target cert to encrypt the signed message to. x509 = X509.load_cert('recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) # Set cipher: 3-key triple-DES in CBC mode. s.set_cipher(SMIME.Cipher('des_ede3_cbc')) # Create a temporary buffer. tmp = BIO.MemoryBuffer() # Write the signed message into the temporary buffer. s.write(tmp, p7) # Encrypt the temporary buffer. p7 = s.encrypt(tmp) # Output p7 in mail-friendly format. out = BIO.MemoryBuffer() out.write('From: sender@example.dom\n') out.write('To: recipient@example.dom\n') out.write('Subject: M2Crypto S/MIME testing\n') s.write(out, p7) print(out.read()) # Save the PRNG's state. Rand.save_file('randpool.dat') Here's the output of the above program:: From: sender@example.dom To: recipient@example.dom Subject: M2Crypto S/MIME testing MIME-Version: 1.0 Content-Disposition: attachment; filename="smime.p7m" Content-Type: application/x-pkcs7-mime; name="smime.p7m" Content-Transfer-Encoding: base64 MIIIwwYJKoZIhvcNAQcDoIIItDCCCLACAQAxggEAMIH9AgEAMGYwYTELMAkGA1UE BhMCU0cxETAPBgNVBAoTCE0yQ3J5cHRvMRkwFwYDVQQDExBTL01JTUUgUmVjaXBp ZW50MSQwIgYJKoZIhvcNAQkBFhVyZWNpcGllbnRAZXhhbXBsZS5kb20CAQAwDQYJ KoZIhvcNAQEBBQAEgYBlZlGupFphwhsGtIAPvDExN61qisz3oem88xoXkUW0SzoR B9zJFFAuQTWzdNJgrKKYikhWjDojaAc/PFl1K5dYxRgtZLB36ULJD/v/yWmxnjz8 TvtK+Wbal2P/MH2pZ4LVERXa/snTElhCawUlwtiFz/JvY5CiF/dcwd+AwFQq4jCC B6UGCSqGSIb3DQEHATAUBggqhkiG9w0DBwQIRF525UfwszaAggeA85RmX6AXQMxb eBDz/LJeCgc3RqU1UwIsbKMquIs1S46Ebbm5nP75izPnujOkJ2hv+LNzqOWADmOl +CnGEq1qxTyduIgUDA2nBgCL/gVyVy+/XC9dtImUUTxtxLgYtB0ujkBNsOaENOlM fv4SGM3jkR+K/xlYG6HHzZGbfYyNGj2Y7yMZ1rL1m8SnRNmkCysKGTrudeNf6wT9 J6wO9DzLTioz3ZnVr3LjsSKIb4tIp4ugqNJaLuW7m3FtZ3MAgxN68hBbJs8TZ8tL V/0jwUqS+grcgZEb9ymfcedxahtDUfHjRkpDpsxZzVVGkSBNcbQu92oByQVnRQ8m wrYLp3/eawM5AvuV7HNpTT5ZR+1t8luishHN9899IMP2Vyg0Ub67FqFypYmM2cm2 sjAI4KpfvT00XFNvgLuYwYEKs9syGTO7hiHNQKcF44F5LYv6nTFwmFQB11dAtY9V ull4D2CLDx9OvyNyKwdEZB5dyV0r/uKIdkhST60V2Q9KegpzgFpoZtSKM/HPYSVH 1Bc9f3Q/GqZCvNZZCMx8UvRjQR8dRWDSmPJ0VXG1+wJ+fCmSPP3AuQ1/VsgPRqx2 56VrpGPpGut40hV8xQFbWIZ2whwWLKPFAHj8B79ZtFUzUrU6Z2rNpvv8inHc/+S/ b6GR5s8/gucRblvd7n3OFNX5UJmPmcw9zWbu/1Dr9DY8l0nAQh21y5FGSS8B1wdE oD2M3Lp7JbwjQbRtnDhImqul2S4yu+m+wDD1aR2K4k3GAI7KKgOBWT0+BDClcn8A 4Ju6/YUbj33YlMPJgnGijLnolFy0hNW7TmWqR+8tSI3wO5eNKg4qwBnarqc3vgCV quVxINAXyGQCO9lzdw6hudk8/+BlweGdqhONaIWbK5z1L/SfQo6LC9MTsj7FJydq bc+kEbfZS8aSq7uc9axW6Ti0eAPJ8EVHtwhSBgZQRweKFBXs6HbbhMIdc4N0M7Oq UiFXaF6s4n2uihVP6TqXtHEjTpZoC7pC+HCYiuKXUJtaqtXBOh+y3KLvHk09YL6D XmTDg+UTiFsh4jKKm/BhdelbR5JbpJcj5AId76Mfr8+F/1g9ePOvsWHpQr/oIQTo xEkaxCmzEgP0b6caMWfMUQrbVGxBBNcqKc/ir9fGGOPHATzzq/xLcQYvK1tZhd/D ah/gpMPndsyvVCEuFPluWyDiM0VkwHgC2/3pJIYFHaxK64IutmPsy393rHMEB4kN AHau6kWK+yL9qEVH1pP2zvswQ12P7gjt3T/G3bGsmvlXkEfztfjkXo6XnjcBNf5y G+974AKLcjnk1gzIgarz+lAMY57Gkw4oNDMrTqVQ2OJQlvOSbllPXzH+aAiavB8W ZPECLLwHxD4B1AuaiAArgKl935u/TOB+yQOR8JgGsUzROyJqHJ/SC51HkebgCkL1 aggtjgPlIBEXLZAlhpWLZ9lAQyrQpvCVJYwaOvfMmvRav4NAFNoZ2/Q7S4Tn1z+U XX+f+GD58P4MPMhU5IKnz4yH4nlHnAiTEvcs85TZUAXze9g/uBOwZITeGtyLi52S aETIr4v7SgXMepX7ThQ1Pv/jddsK/u4j2F34u0XktwCP+UrbfkE2mocdXvdzxbmd tZSznK2qwgVSsPOs9MhUaepbnjmNBFFBrULhrUtSglM/VX/rWNiyh0aw4XYyHhIt 9ZNlfEjKjJ67VEMBxBJ/ieUCouRGCxPYD1j65VT7oB3ZiyPu2F2nlUIcYNqPg1Sd QBCrdaOXdJ0uLwyTAUeVE+wMbgscLvWsfZcCCJHAvw9NHFMUcnrdWxAYMVETNUOn uryVAK7VfOldaz6z3NOSOi6nonNeHpR/sipBa4ik5xCRLT9e0S2QJgRvO9GyfAqz 3DIzHtxIGePFzTiUYUTxS3i2gnMX2PEe3ChTLlYWD3jNeAKz0iOzpDphIF2xHLLQ 1tCAqBmq/vUzALyDFFdFuTIqQZys4z/u4Dmyq9uXs421eN3v2hkVHvDy8uT2Ot29 lg4Q5YezR1EjaW//9guL1BXbcKrTEdtxeNqtem7SpZOMTSwD2lhB8z65GrX90Cyt EMmaRSGYEdf5h1afL1SmKOMskbqxe1D2jG/vsXC7XX7xO/ioy0BdiJcYN1JiMOHJ EOzFol5I20YkiV6j+cenfQFwc/NkaSxEkR8AUHJSbvUmRQRl6r0nnsFpZdR1w7pv wkaT+eOpZynO4mY/ZtF6MpXJsixi6L4ZYXEbS6yHf+XGFfB0okILylmwv2bf6+Mq nqXlmGj3Jwq7X9/+2BDqvfpFFX5lSmItKZAobLdssjFR6roJxOqRsGia2aZ+0+U5 VhgdITtnElgtHBaeZU5rHDswgdeLVBP+rGWnKxpJ+pLtNNi25sPYRcWFL6Erd25u eXiY8GEIr+u7rqBWpc9HR34sAPRs3ubbCUleT748keCbx247ImBtiDctZxcc1O86 +0QjHP6HUT7FSo/FmT7a120S3Gd2jixGh06l/9ij5Z6mJa7Rm7TTbSjup/XISnOT MKWcbI1nfVOhCv3xDq2eLae+s0oVoc041ceRazqFM2TL/Z6UXRME Decrypt and Verify ================== Suppose the above output has been saved into ``se.p7``. The following demonstrates how to decrypt and verify it:: from M2Crypto import BIO, SMIME, X509 # Instantiate an SMIME object. s = SMIME.SMIME() # Load private key and cert. s.load_key('recipient_key.pem', 'recipient.pem') # Load the signed/encrypted data. p7, data = SMIME.smime_load_pkcs7('se.p7') # After the above step, 'data' == None. # Decrypt p7. 'out' now contains a PKCS #7 signed blob. out = s.decrypt(p7) # Load the signer's cert. x509 = X509.load_cert('signer.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) # Load the signer's CA cert. In this case, because the signer's # cert is self-signed, it is the signer's cert itself. st = X509.X509_Store() st.load_info('signer.pem') s.set_x509_store(st) # Recall 'out' contains a PKCS #7 blob. # Transform 'out'; verify the resulting PKCS #7 blob. p7_bio = BIO.MemoryBuffer(out) p7, data = SMIME.smime_load_pkcs7_bio(p7_bio) v = s.verify(p7) print(v) The output is as follows:: a sign of our times Sending S/MIME messages via SMTP ================================ In the above examples, we've assumed that our S/MIME messages are sent and received automagically. The following is a Python function that generates S/MIME-signed/encrypted messages and sends them via SMTP:: from M2Crypto import BIO, SMIME, X509 import smtplib, string, sys def sendsmime(from_addr, to_addrs, subject, msg, from_key, from_cert=None, to_certs=None, smtpd='localhost'): msg_bio = BIO.MemoryBuffer(msg) sign = from_key encrypt = to_certs s = SMIME.SMIME() if sign: s.load_key(from_key, from_cert) if encrypt: p7 = s.sign(msg_bio, flags=SMIME.PKCS7_TEXT) else: p7 = s.sign(msg_bio, flags=SMIME.PKCS7_TEXT|SMIME.PKCS7_DETACHED) msg_bio = BIO.MemoryBuffer(msg) # Recreate coz sign() has consumed it. if encrypt: sk = X509.X509_Stack() for x in to_certs: sk.push(X509.load_cert(x)) s.set_x509_stack(sk) s.set_cipher(SMIME.Cipher('des_ede3_cbc')) tmp_bio = BIO.MemoryBuffer() if sign: s.write(tmp_bio, p7) else: tmp_bio.write(msg) p7 = s.encrypt(tmp_bio) out = BIO.MemoryBuffer() out.write('From: %s\r\n' % from_addr) out.write('To: %s\r\n' % string.join(to_addrs, ", ")) out.write('Subject: %s\r\n' % subject) if encrypt: s.write(out, p7) else: if sign: s.write(out, p7, msg_bio, SMIME.PKCS7_TEXT) else: out.write('\r\n') out.write(msg) out.close() smtp = smtplib.SMTP() smtp.connect(smtpd) smtp.sendmail(from_addr, to_addrs, out.read()) smtp.quit() This function sends plain, S/MIME-signed, S/MIME-encrypted, and S/MIME-signed/encrypted messages, depending on the parameters ``from_key`` and ``to_certs``. The function's output interoperates with Netscape Messenger. Verifying origin of S/MIME messages =================================== In our examples above that decrypt or verify messages, we skipped a step: verifying that the ``from`` address of the message matches the ``email address`` attribute in the sender's certificate. The premise of current X.509 certification practice is that the CA is supposed to verify your identity, and to issue a certificate with ``email address`` that matches your actual mail address. (Verisign's March 2001 failure in identity verification resulting in Microsoft certificates being issued to spoofers notwithstanding.) If you run your own CA, your certification practice is up to you, of course, and it would probably be part of your security policy. Whether your S/MIME messaging application needs to verify the ``from`` addresses of S/MIME messages depends on your security policy and your system's threat model, as always. Interoperating with Netscape Messenger ====================================== Suppose S/MIME Recipient uses Netscape Messenger. To enable Messenger to handle S/MIME messages from S/MIME Sender, S/MIME Recipient needs to configure Messenger with his private key and certificate, as well as S/MIME Sender's certificate. **Note:** Configuring Messenger's POP or IMAP settings so that it retrieves mail correctly is beyond the scope of this HOWTO. The following steps demonstrate how to import S/MIME Recipient's private key and certificate for Messenger: 1. Transform S/MIME Recipient's private key and certificate into *PKCS #12* format:: openssl pkcs12 -export -in recipient.pem -inkey recipient_key.pem \ -name "S/MIME Recipient" -out recipient.p12 Enter Export Password: Verifying password - Enter Export Password: 2. Start Messenger. 3. Click on the (open) "lock" icon at the bottom left corner of Messenger's window. This brings up the "Security Info" dialog box. 4. Click on "Yours" under "Certificates". 5. Select "Import a certificate", then pick ``recipient.p12`` from the ensuing file selection dialog box. Next, you need to import ``signer.pem`` as a CA certificate, so that Messenger will mark messages signed by S/MIME Sender as "trusted": 1. Create a DER encoding of ``signer.pem``:: openssl x509 -inform pem -outform der -in signer.pem -out signer.der 2. Install ``signer.der`` into Messenger as MIME type ``application/x-x509-ca-cert``. You do this by downloading ``signer.der`` via Navigator from a HTTP or HTTPS server, with the correct MIME type mapping. (You may use ``demo/ssl/https_srv.py``, bundled with M2Crypto, for this purpose.) Follow the series of dialog boxes to accept ``signer.der`` as a CA for certifying email users. S/MIME Recipient is now able to decrypt and read S/MIME Sender's messages with Messenger. Messenger will indicate that S/MIME Sender's messages are signed, encrypted, or encrypted *and* signed, as the case may be, via the "stamp" icon on the message window's top right corner. Clicking on the "stamp" icon brings you to the Security Info dialog box. Messenger informs you that the message is, say, encrypted with 168-bit DES-EDE3-CBC and that it is digitally signed by the private key corresponding to the public key contained in the certificate ``signer.pem``. Interoperating with Microsoft Outlook ===================================== I do not know how to do this, as I do not use Outlook. (Nor do I use Netscape Messenger, actually. I use Mutt, top dog of MUAs. ;-) Information on how to configure Outlook with keys and certificates so that it handles S/MIME mail is gratefully accepted. ZSmime ====== ZSmime is a `Zope `__ *product* that enables Zope to generate S/MIME-signed/encrypted messages. ZSmime demonstrates how to invoke M2Crypto in a web application server extension. ZSmime has its own `HOWTO `__ explaining its usage. (That HOWTO has some overlap in content with this document.) Resources ========= - IETF S/MIME Working Group - http://www.imc.org/ietf-smime - S/MIME and OpenPGP - http://www.imc.org/smime-pgpmime.html - S/MIME Freeware Library - http://www.getronicsgov.com/hot/sfl_home.htm - Mozilla Network Security Services - http://www.mozilla.org/projects/security/pkg/nss - S/MIME Cracking Screen Saver - http://www.counterpane.com/smime.html M2Crypto-0.31.0/doc/howto.ssl.rst0000664000175000001440000001246713165756570017023 0ustar matejusers00000000000000:orphan: .. _howto-ssl: HOWTO: Programming SSL in Python with M2Crypto ============================================== :author: Pheng Siong Ng and Heikki Toivonen (heikki@osafoundation.org) :copyright: © 2000, 2001 by Ng Pheng Siong, portions © 2006 by Open Source Applications Foundation Introduction ============ `M2Crypto `__ is a `Python `__ interface to `OpenSSL `__. It makes available to the Python programmer SSL functionality to implement clients and servers, S/MIME v2, RSA, DSA, DH, symmetric ciphers, message digests and HMACs. This document demonstrates programming HTTPS with M2Crypto. A bit of history ================ M2Crypto was created during the time of Python 1.5, which features a module httplib providing client-side HTTP functionality. M2Crypto sports a httpslib based on httplib. Beginning with version 2.0, Python's socket module provided (rudimentary) SSL support. Also in the same version, httplib was enhanced with class HTTPConnection, which is more sophisticated than the old class HTTP, and HTTPSConnection, which does HTTPS. Subsequently, M2Crypto.httpslib grew a compatible (but not identical) class HTTPSConnection. The primary interface difference between the two HTTPSConnection classes is that M2Crypto's version accepts an M2Crypto.SSL.Context instance as a parameter, whereas Python 2.x's SSL support does not permit Pythonic control of the SSL context. Within the implementations, Python's ``HTTPSConnection`` employs a ``FakeSocket`` object, which collects all input from the SSL connection before returning it to the application as a ``StringIO`` buffer, whereas M2Crypto's ``HTTPSConnection`` uses a buffering ``M2Crypto.BIO.IOBuffer`` object that works over the underlying M2Crypto.SSL.Connection directly. Since then M2Crypto has gained a Twisted wrapper that allows securing Twisted SSL connections with M2Crypto. Secure SSL ========== It is recommended that you read the book Network Security with OpenSSL by John Viega, Matt Messier and Pravir Chandra, ISBN 059600270X. Using M2Crypto does not automatically make an SSL connection secure. There are various steps that need to be made before we can make that claim. Let's see how a simple client can establish a secure connection:: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, depth=9) if ctx.load_verify_locations('ca.pem') != 1: raise Exception('No CA certs') s = SSL.Connection(ctx) s.connect(server_address) # Normal protocol (for example HTTP) commands follow The first line creates an SSL context. The defaults allow any SSL version (except SSL version 2 which has known weaknesses) and sets the allowed ciphers to secure ones. The second line tells M2Crypto to perform certificate validation. The flags shown above are typical for clients, and requires the server to send a certificate. The depth parameter tells how long certificate chains are allowed - 9 is pretty common default, although probably too long in practice. The third line loads the allowed root (certificate authority or CA) certificates. Most Linux distributions come with CA certificates in suitable format. You could also download the `certdata.txt `__ file from the `NSS `__ project and convert it with the little M2Crypto utility script `demo/x509/certdata2pem.py `__. The fourth line creates an SSL connection object with the secure context. The fifth line connects to the server. During this time we perform the last security step: just after connection, but before exchanging any data, we compare the commonName (or subjectAltName DNS field) field in the certificate the server returned to the server address we tried to connect to. This happens automatically with SSL.Connection and the Twisted wrapper class, and anything that uses those. In all other cases you must do the check manually. It is recommended you call the SSL.Checker to do the actual check. SSL servers are different in that they typically do not require the client to send a certificate, so there is usually no certificate checking. Also, it is typically useless to perform host name checking. Code Samples ============ The best samples of how to use the various SSL objects are in the tests directory, and the test\_ssl.py file specifically. There are additional samples in the demo directory, but they are not quaranteed to be up to date. NOTE: The tests and demos may not be secure as is. Use the information above on how to make them secure. ssldump ======= ssldump "is an SSLv3/TLS network protocol analyser. It identifies TCP connections on the chosen network interface and attempts to interpret them as SSLv3/TLS traffic. When it identifies SSLv3/TLS traffic, it decodes the records and displays them in a textual form to stdout. If provided with the appropriate keying material, it will also decrypt the connections and display the application data traffic. If linked with OpenSSL, ssldump can display certificates in decoded form and decrypt traffic (provided that it has the appropriate keying material)." ssldump is written by Eric Rescorla. M2Crypto-0.31.0/doc/index.rst0000664000175000001440000000050613165756570016161 0ustar matejusers00000000000000Welcome to M2Crypto's documentation! ==================================== Contents: .. toctree:: :maxdepth: 4 M2Crypto HOWTOs ====== * :ref:`howto-ca` * :ref:`howto-ssl` * :ref:`howto-smime` * :ref:`zserverssl-howto` Indices and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` M2Crypto-0.31.0/doc/make.bat0000664000175000001440000001175413165756570015734 0ustar matejusers00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set I18NSPHINXOPTS=%SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\M2Crypto.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\M2Crypto.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) :end M2Crypto-0.31.0/epydoc.conf0000664000175000001440000000123513174411415015667 0ustar matejusers00000000000000# Copyright 2009 Heikki Toivonen. All rights reserved. # epydoc --no-private -v --config=epydoc.conf [epydoc] name = M2Crypto url = http://chandlerproject.org/Projects/MeTooCrypto output = html target = doc/api graph = all sourcecode = no private = no modules = ./M2Crypto # Private exclude-introspect = M2Crypto.__m2crypto # Variable shadows module, which causes the module to double in the doc # with second instance showing '. Exclude so we only get one (with '). exclude = M2Crypto.SSL.Cipher exclude = M2Crypto.SSL.Connection exclude = M2Crypto.SSL.Context exclude = M2Crypto.SSL.SSLServer exclude = M2Crypto.SSL.ssl_dispatcher exclude = M2Crypto.SSL.timeout M2Crypto-0.31.0/pylintrc0000664000175000001440000002056413165756570015350 0ustar matejusers00000000000000# -*- coding: utf-8; mode: conf -*- # lint Python modules using external checkers. # # This is the main checker controlling the other ones and the reports # generation. It is itself both a raw checker and an astng checker in order # to: # * handle message activation / deactivation at the module level # * handle some basic but necessary stats'data (number of classes, methods...) # [MASTER] # Specify a configuration file. #rcfile= # Python code to execute, usually for sys.path manipulation such as # pygtk.require(). #init-hook= # Add to the black list. It should be a base name, not a # path. You may set this option multiple times. ignore=CVS, .git, .svn # Pickle collected data for later comparisons. persistent=yes # Set the cache size for astng objects. cache-size=500 # List of plugins (as comma separated values of python modules names) to load, # usually to register additional checkers. load-plugins= [MESSAGES CONTROL] # Enable the message, report, category or checker with the given id(s). You can # either give multiple identifier separated by comma (,) or put this option # multiple time. See also the "--disable" option for examples. #enable= # Disable the message, report, category or checker with the given id(s). You # can either give multiple identifiers separated by comma (,) or put this # option multiple times (only on the command line, not in the configuration # file where it should appear only once).You can also use "--disable=all" to # disable everything first and then reenable specific checks. For example, if # you want to run only the similarities checker, you can use "--disable=all # --enable=similarities". If you want to run only the classes checker, but have # no Warning level messages displayed, use"--disable=all --enable=classes # --disable=W" disable=C0330, C0103, C0111, C0326, R0901, R0903, R0201, I0011 [REPORTS] # Set the output format. Available formats are text, parseable, colorized, msvs # (visual studio) and html. You can also give a reporter class, eg # mypackage.mymodule.MyReporterClass. output-format=text # Put messages in a separate file for each module / package specified on the # command line instead of printing them on stdout. Reports (if any) will be # written in a file name "pylint_global.[txt|html]". files-output=no # Tells whether to display a full report or only the messages reports=yes # Python expression which should return a note less than 10 (10 is the highest # note). You have access to the variables errors warning, statement which # respectively contain the number of errors / warnings messages and the total # number of statements analyzed. This is used by the global evaluation report # (RP0004). evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) # Template used to display messages. This is a python new-style format string # used to format the message information. See doc for all details msg-template={path}:{line}:[{msg_id}({symbol}),{obj}] {msg} [TYPECHECK] # Tells whether missing members accessed in mixin class should be ignored. A # mixin class is detected if its name ends with "mixin" (case insensitive). ignore-mixin-members=yes # List of classes names for which member attributes should not be checked # (useful for classes with attributes dynamically set). ignored-classes=SQLObject # List of members which are set dynamically and missed by pylint inference # system, and so shouldn't trigger E0201 when accessed. Python regular # expressions are accepted. generated-members=REQUEST,acl_users,aq_parent [VARIABLES] # Tells whether we should check for unused import in __init__ files. init-import=no # A regular expression matching the beginning of the name of dummy variables # (i.e. not used). dummy-variables-rgx=_|dummy # List of additional names supposed to be defined in builtins. Remember that # you should avoid to define new builtins when possible. additional-builtins= [FORMAT] # Maximum number of characters on a single line. max-line-length=120 # Regexp for a line that is allowed to be longer than the limit. ignore-long-lines=^\s*(# )??$ # Allow the body of an if to be on the same line as the test if there is no # else. single-line-if-stmt=no # List of optional constructs for which whitespace checking is disabled no-space-check=trailing-comma,dict-separator # Maximum number of lines in a module max-module-lines=2000 # String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 # tab). indent-string=' ' [BASIC] # List of builtins function names that should not be used, separated by a comma bad-functions=map,filter,apply,input # Regular expression which should only match correct module names # module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ module-rgx=(([a-z_][a-z0-9_]*)|([a-zA-Z0-9]+))$ # Regular expression which should only match correct module level names const-rgx=[f]?[A-Z_][a-zA-Z0-9_]{2,30}$ # Regular expression which should only match correct class names class-rgx=[A-Z_]+[a-zA-Z0-9]+$ # Regular expression which should only match correct function names function-rgx=[a-z_][a-zA-Z0-9_]{2,30}$ # Regular expression which should only match correct method names method-rgx=[a-zA-Z0-9_]{2,30}$ # Regular expression which should only match correct instance attribute names attr-rgx=([a-z_][a-zA-Z0-9_]{2,30}|[A-Z0-9_]{2,30})$ # Regular expression which should only match correct argument names argument-rgx=[a-z_][a-zA-Z0-9_]{2,30}$ # Regular expression which should only match correct variable names variable-rgx=[a-z_][a-zA-Z0-9_]{0,30}$ # Regular expression which should only match correct attribute names in class # bodies class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ # Regular expression which should only match correct list comprehension / # generator expression variable names inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ # Good variable names which should always be accepted, separated by a comma good-names=i,j,k,ex,Run,_ # Bad variable names which should always be refused, separated by a comma bad-names=foo,bar,baz,toto,tutu,tata # Regular expression which should only match function or class names that do # not require a docstring. no-docstring-rgx=__.*__ # Minimum line length for functions/classes that require docstrings, shorter # ones are exempt. docstring-min-length=-1 [MISCELLANEOUS] # List of note tags to take in consideration, separated by a comma. notes=FIXME,XXX,TODO [SIMILARITIES] # Minimum lines number of a similarity. min-similarity-lines=4 # Ignore comments when computing similarities. ignore-comments=yes # Ignore docstrings when computing similarities. ignore-docstrings=yes # Ignore imports when computing similarities. ignore-imports=no [CLASSES] # List of method names used to declare (i.e. assign) instance attributes. defining-attr-methods=__init__,__new__,setUp # List of valid names for the first argument in a class method. valid-classmethod-first-arg=cls # List of valid names for the first argument in a metaclass class method. valid-metaclass-classmethod-first-arg=mcs [DESIGN] # Maximum number of arguments for function / method max-args=8 # Argument names that match this expression will be ignored. Default to name # with leading underscore ignored-argument-names=_.* # Maximum number of locals for function / method body max-locals=15 # Maximum number of return / yield for function / method body max-returns=6 # Maximum number of branch for function / method body max-branches=12 # Maximum number of statements in function / method body max-statements=50 # Maximum number of parents for a class (see R0901). max-parents=7 # Maximum number of attributes for a class (see R0902). max-attributes=50 # Minimum number of public methods for a class (see R0903). min-public-methods=2 # Maximum number of public methods for a class (see R0904). max-public-methods=100 [IMPORTS] # Deprecated modules which should not be used, separated by a comma deprecated-modules=regsub,string,TERMIOS,Bastion,rexec # Create a graph of every (i.e. internal and external) dependencies in the # given file (report RP0402 must not be disabled) import-graph= # Create a graph of external dependencies in the given file (report RP0402 must # not be disabled) ext-import-graph= # Create a graph of internal dependencies in the given file (report RP0402 must # not be disabled) int-import-graph= [EXCEPTIONS] # Exceptions that will emit a warning when being caught. Defaults to # "Exception" overgeneral-exceptions=Exception M2Crypto-0.31.0/setup.cfg0000664000175000001440000000021413371124434015353 0ustar matejusers00000000000000[egg_info] tag_build = tag_svn_revision = 0 tag_date = 0 [flake8] ignore = E402,N806,N803,N802,E501 [pydocstyle] ignore = D10,D203,D213 M2Crypto-0.31.0/setup.py0000644000175000001440000003436513360062060015252 0ustar matejusers00000000000000#!/usr/bin/env python """ setuptools based installer for M2Crypto. Copyright (c) 1999-2004, Ng Pheng Siong. All rights reserved. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004-2007 OSAF. All Rights Reserved. Copyright 2008-2011 Heikki Toivonen. All rights reserved. Copyright 2018 Daniel Wozniak. All rights reserved. """ import glob import logging import os import platform import re import string import subprocess import sys import shutil from distutils.command import build, sdist from distutils.command.clean import clean from distutils.dir_util import mkpath from distutils.version import StrictVersion import setuptools from setuptools.command import build_ext logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', stream=sys.stdout, level=logging.INFO) log = logging.getLogger('setup') REQUIRED_SWIG_VERSION = '2.0.4' if (2, 6) < sys.version_info[:2] < (3, 5): requires_list = ['typing'] else: requires_list = [] package_data = {} if sys.platform == 'win32': package_data.update(M2Crypto=["*.dll"]) def _get_additional_includes(): if os.name == 'nt': globmask = os.path.join('C:', os.sep, 'Program Files*', '*Visual*', 'VC', 'include') err = glob.glob(globmask) else: pid = subprocess.Popen(['cpp', '-Wp,-v', '-'], stdin=open(os.devnull, 'r'), stdout=subprocess.PIPE, stderr=subprocess.PIPE) _, err = pid.communicate() err = [line.lstrip() for line in err.decode('utf8').split('\n') if line and line.startswith(' /')] log.debug('additional includes:\n%s', err) return err def openssl_version(ossldir, req_ver, required=False): # type: (str, int, bool) -> bool """ Compare version of the installed OpenSSL with the maximum required version. :param ossldir: the directory where OpenSSL is installed :param req_ver: required version as integer (e.g. 0x10100000) :param required: whether we want bigger-or-equal or less-than :return: Boolean indicating whether the satisfying version of OpenSSL has been installed. """ ver = None file = os.path.join(ossldir, 'include', 'openssl', 'opensslv.h') with open(file) as origin_file: for line in origin_file: m = re.match(r'^# *define *OPENSSL_VERSION_NUMBER *(0x[0-9a-fA-F]*)', line) if m: log.debug('found version number: %s\n' % m.group(1)) ver = int(m.group(1), base=16) break if ver is None: raise OSError('Unknown format of file %s\n' % file) if required: return ver >= req_ver else: return ver < req_ver class _M2CryptoBuild(build.build): """Enable swig_opts to inherit any include_dirs settings made elsewhere.""" user_options = build.build.user_options + \ [('openssl=', 'o', 'Prefix for openssl installation location')] + \ [('bundledlls', 'b', 'Bundle DLLs (win32 only)')] def initialize_options(self): """Overload to enable custom openssl settings to be picked up.""" build.build.initialize_options(self) self.openssl = None self.bundledlls = None class _M2CryptoBuildExt(build_ext.build_ext): """Enable swig_opts to inherit any include_dirs settings made elsewhere.""" user_options = build_ext.build_ext.user_options + \ [('openssl=', 'o', 'Prefix for openssl installation location')] + \ [('bundledlls', 'b', 'Bundle DLLs (win32 only)')] def initialize_options(self): """Overload to enable custom openssl settings to be picked up.""" build_ext.build_ext.initialize_options(self) self.openssl = None self.bundledlls = None def finalize_options(self): """Append custom openssl include file and library linking options.""" build_ext.build_ext.finalize_options(self) self.openssl_default = None self.set_undefined_options('build', ('openssl', 'openssl')) if self.openssl is None: self.openssl = self.openssl_default self.set_undefined_options('build', ('bundledlls', 'bundledlls')) self.libraries = ['ssl', 'crypto'] if sys.platform == 'win32': self.libraries = ['ssleay32', 'libeay32'] if self.openssl and openssl_version(self.openssl, 0x10100000, True): self.libraries = ['libssl', 'libcrypto'] self.swig_opts.append('-D_WIN32') # Swig doesn't know the version of MSVC, which causes errors in e_os2.h # trying to import stdint.h. Since python 2.7 is intimately tied to # MSVC 2008, it's harmless for now to define this. Will come back to # this shortly to come up with a better fix. self.swig_opts.append('-D_MSC_VER=1500') if sys.version_info[:1] >= (3,): self.swig_opts.append('-py3') log.debug('self.include_dirs = %s', self.include_dirs) log.debug('self.library_dirs = %s', self.library_dirs) if self.openssl is not None: log.debug('self.openssl = %s', self.openssl) openssl_library_dir = os.path.join(self.openssl, 'lib') openssl_include_dir = os.path.join(self.openssl, 'include') self.library_dirs.append(openssl_library_dir) self.include_dirs.append(openssl_include_dir) log.debug('self.include_dirs = %s', self.include_dirs) log.debug('self.library_dirs = %s', self.library_dirs) if platform.system() == "Linux": # For RedHat-based distros, the '-D__{arch}__' option for # Swig needs to be normalized, particularly on i386. mach = platform.machine().lower() if mach in ('i386', 'i486', 'i586', 'i686'): arch = '__i386__' elif mach in ('ppc64', 'powerpc64', 'ppc64le', 'ppc64el'): arch = '__powerpc64__' elif mach in ('ppc', 'powerpc'): arch = '__powerpc__' else: arch = '__%s__' % mach self.swig_opts.append('-D%s' % arch) if mach in ('ppc64le', 'ppc64el'): self.swig_opts.append('-D_CALL_ELF=2') self.swig_opts.extend(['-I%s' % i for i in self.include_dirs]) # Some Linux distributor has added the following line in # /usr/include/openssl/opensslconf.h: # # #include "openssl-x85_64.h" # # This is fine with C compilers, because they are smart enough to # handle 'local inclusion' correctly. Swig, on the other hand, is # not as smart, and needs to be told where to find this file... # # Note that this is risky workaround, since it takes away the # namespace that OpenSSL uses. If someone else has similarly # named header files in /usr/include, there will be clashes. if self.openssl is None: self.swig_opts.append('-I/usr/include/openssl') else: self.swig_opts.append('-I' + os.path.join(openssl_include_dir, 'openssl')) # swig seems to need the default header file directories self.swig_opts.extend(['-I%s' % i for i in _get_additional_includes()]) self.swig_opts.append('-includeall') self.swig_opts.append('-modern') self.swig_opts.append('-builtin') # These two lines are a workaround for # http://bugs.python.org/issue2624 , hard-coding that we are only # building a single extension with a known path; a proper patch to # distutils would be in the run phase, when extension name and path are # known. self.swig_opts.extend(['-outdir', os.path.join(os.getcwd(), 'M2Crypto')]) self.include_dirs.append(os.path.join(os.getcwd(), 'SWIG')) if sys.platform == 'cygwin' and self.openssl is not None: # Cygwin SHOULD work (there's code in distutils), but # if one first starts a Windows command prompt, then bash, # the distutils code does not seem to work. If you start # Cygwin directly, then it would work even without this change. # Someday distutils will be fixed and this won't be needed. self.library_dirs += [os.path.join(self.openssl, 'bin')] mkpath(os.path.join(self.build_lib, 'M2Crypto')) def run(self): """ On Win32 platforms include the openssl dll's in the binary packages """ # Win32 bdist builds must use --openssl in the builds step. if not self.bundledlls: build_ext.build_ext.run(self) return if sys.platform == 'win32': ver_part = '' if self.openssl and openssl_version(self.openssl, 0x10100000, True): ver_part += '-1_1' if sys.maxsize > 2**32: ver_part += '-x64' search = list(self.library_dirs) if self.openssl: search = search + [self.openssl, os.path.join(self.openssl, 'bin')] libs = list(self.libraries) for libname in list(libs): for search_path in search: dll_name = '{0}{1}.dll'.format(libname, ver_part) dll_path = os.path.join(search_path, dll_name) if os.path.exists(dll_path): shutil.copy(dll_path, 'M2Crypto') libs.remove(libname) break if libs: raise Exception("Libs not found {}".format(','.join(libs))) build_ext.build_ext.run(self) def swig_version(req_ver): # type: (str) -> bool """ Compare version of the swig with the required version. :param req_ver: required version as a str (e.g., '2.0.4') :return: Boolean indicating whether the satisfying version of swig has been installed. """ ver_str = None IND_VER_LINE = 'SWIG Version ' try: pid = subprocess.Popen(['swig', '-version'], stdout=subprocess.PIPE) except OSError: return False out, _ = pid.communicate() if hasattr(out, 'decode'): out = out.decode('utf8') for line in out.split('\n'): line = line.strip() if line.startswith(IND_VER_LINE): ver_str = line.strip()[len(IND_VER_LINE):] break if not ver_str: raise OSError('Unknown format of swig -version output:\n%s' % out) return StrictVersion(ver_str) >= StrictVersion(req_ver) x_comp_args = set() # We take care of deprecated functions in OpenSSL with our code, no need # to spam compiler output with it. if sys.platform == 'win32': x_comp_args.update(['-DTHREADING', '-D_CRT_SECURE_NO_WARNINGS']) else: x_comp_args.update(['-DTHREADING', '-Wno-deprecated-declarations']) # Don't try to run swig on the ancient platforms if swig_version(REQUIRED_SWIG_VERSION): lib_sources = ['SWIG/_m2crypto.i'] else: lib_sources = ['SWIG/_m2crypto_wrap.c'] m2crypto = setuptools.Extension(name='M2Crypto._m2crypto', sources=lib_sources, extra_compile_args=list(x_comp_args), # Uncomment to build Universal Mac binaries # extra_link_args = # ['-Wl,-search_paths_first'], ) class Clean(clean): def __init__(self, dist): clean.__init__(self, dist) def initialize_options(self): clean.initialize_options(self) self.all = True def finalize_options(self): clean.finalize_options(self) def run(self): clean.run(self) garbage_list = [ os.path.join('M2Crypto', '*.so'), os.path.join('M2Crypto', '*.pyd'), os.path.join('M2Crypto', '*.dll') ] for p in garbage_list: for f in glob.glob(p): if os.path.exists(f): os.unlink(f) def __get_version(): # noqa with open('M2Crypto/__init__.py') as init_file: for line in init_file: if line.startswith('__version__ ='): return line.split('=')[1].strip(string.whitespace + "'") long_description_text = '''\ M2Crypto is the most complete Python wrapper for OpenSSL featuring RSA, DSA, DH, EC, HMACs, message digests, symmetric ciphers (including AES); SSL functionality to implement clients and servers; HTTPS extensions to Python's httplib, urllib, and xmlrpclib; unforgeable HMAC'ing AuthCookies for web session management; FTP/TLS client and server; S/MIME; M2Crypto can also be used to provide SSL for Twisted. Smartcards supported through the Engine interface.''' setuptools.setup( name='M2Crypto', version=__get_version(), description='M2Crypto: A Python crypto and SSL toolkit', long_description=long_description_text, license='MIT', platforms=['any'], author='Ng Pheng Siong', author_email='ngps@sandbox.rulemaker.net', maintainer='Matej Cepl', maintainer_email='mcepl@cepl.eu', url='https://gitlab.com/m2crypto/m2crypto', classifiers=[ 'Development Status :: 5 - Production/Stable', 'Intended Audience :: Developers', 'License :: OSI Approved :: MIT License', 'Operating System :: OS Independent', 'Programming Language :: C', 'Programming Language :: Python', 'Topic :: Security :: Cryptography', 'Topic :: Software Development :: Libraries :: Python Modules', 'Programming Language :: Python :: 2', 'Programming Language :: Python :: 2.6', 'Programming Language :: Python :: 2.7', 'Programming Language :: Python :: 3', 'Programming Language :: Python :: 3.4', 'Programming Language :: Python :: 3.5', 'Programming Language :: Python :: 3.6', 'Programming Language :: Python :: 3.7', ], keywords='cryptography openssl', packages=setuptools.find_packages(exclude=['contrib', 'docs', 'tests']), ext_modules=[m2crypto], test_suite='tests.alltests.suite', install_requires=requires_list, package_data=package_data, cmdclass={ 'build_ext': _M2CryptoBuildExt, 'build': _M2CryptoBuild, 'clean': Clean } ) M2Crypto-0.31.0/tests/0000755000175000001440000000000013371124434014675 5ustar matejusers00000000000000M2Crypto-0.31.0/tests/.ropeproject/0000755000175000001440000000000013371124434017307 5ustar matejusers00000000000000M2Crypto-0.31.0/tests/.ropeproject/config.py0000664000175000001440000001124613216451114021130 0ustar matejusers00000000000000# The default ``config.py`` # flake8: noqa def set_prefs(prefs): """This function is called before opening the project""" # Specify which files and folders to ignore in the project. # Changes to ignored resources are not added to the history and # VCSs. Also they are not returned in `Project.get_files()`. # Note that ``?`` and ``*`` match all characters but slashes. # '*.pyc': matches 'test.pyc' and 'pkg/test.pyc' # 'mod*.pyc': matches 'test/mod1.pyc' but not 'mod/1.pyc' # '.svn': matches 'pkg/.svn' and all of its children # 'build/*.o': matches 'build/lib.o' but not 'build/sub/lib.o' # 'build//*.o': matches 'build/lib.o' and 'build/sub/lib.o' prefs['ignored_resources'] = ['*.pyc', '*~', '.ropeproject', '.hg', '.svn', '_svn', '.git', '.tox'] # Specifies which files should be considered python files. It is # useful when you have scripts inside your project. Only files # ending with ``.py`` are considered to be python files by # default. #prefs['python_files'] = ['*.py'] # Custom source folders: By default rope searches the project # for finding source folders (folders that should be searched # for finding modules). You can add paths to that list. Note # that rope guesses project source folders correctly most of the # time; use this if you have any problems. # The folders should be relative to project root and use '/' for # separating folders regardless of the platform rope is running on. # 'src/my_source_folder' for instance. #prefs.add('source_folders', 'src') # You can extend python path for looking up modules #prefs.add('python_path', '~/python/') # Should rope save object information or not. prefs['save_objectdb'] = True prefs['compress_objectdb'] = False # If `True`, rope analyzes each module when it is being saved. prefs['automatic_soa'] = True # The depth of calls to follow in static object analysis prefs['soa_followed_calls'] = 0 # If `False` when running modules or unit tests "dynamic object # analysis" is turned off. This makes them much faster. prefs['perform_doa'] = True # Rope can check the validity of its object DB when running. prefs['validate_objectdb'] = True # How many undos to hold? prefs['max_history_items'] = 32 # Shows whether to save history across sessions. prefs['save_history'] = True prefs['compress_history'] = False # Set the number spaces used for indenting. According to # :PEP:`8`, it is best to use 4 spaces. Since most of rope's # unit-tests use 4 spaces it is more reliable, too. prefs['indent_size'] = 4 # Builtin and c-extension modules that are allowed to be imported # and inspected by rope. prefs['extension_modules'] = [] # Add all standard c-extensions to extension_modules list. prefs['import_dynload_stdmods'] = True # If `True` modules with syntax errors are considered to be empty. # The default value is `False`; When `False` syntax errors raise # `rope.base.exceptions.ModuleSyntaxError` exception. prefs['ignore_syntax_errors'] = False # If `True`, rope ignores unresolvable imports. Otherwise, they # appear in the importing namespace. prefs['ignore_bad_imports'] = False # If `True`, rope will insert new module imports as # `from import ` by default. prefs['prefer_module_from_imports'] = False # If `True`, rope will transform a comma list of imports into # multiple separate import statements when organizing # imports. prefs['split_imports'] = False # If `True`, rope will remove all top-level import statements and # reinsert them at the top of the module when making changes. prefs['pull_imports_to_top'] = True # If `True`, rope will sort imports alphabetically by module name instead of # alphabetically by import statement, with from imports after normal # imports. prefs['sort_imports_alphabetically'] = False # Location of implementation of rope.base.oi.type_hinting.interfaces.ITypeHintingFactory # In general case, you don't have to change this value, unless you're an rope expert. # Change this value to inject you own implementations of interfaces # listed in module rope.base.oi.type_hinting.providers.interfaces # For example, you can add you own providers for Django Models, or disable the search # type-hinting in a class hierarchy, etc. prefs['type_hinting_factory'] = 'rope.base.oi.type_hinting.factory.default_type_hinting_factory' def project_opened(project): """This function is called after opening the project""" # Do whatever you like here! M2Crypto-0.31.0/tests/README0000664000175000001440000000276513032674550015574 0ustar matejusers00000000000000This directory contains unit tests for M2Crypto. To run all tests, make sure you have installed setuptools and then issue the following command from the M2Crypto root directory: python setup.py test To run tests in a single file, for example test_ssl.py, do this: python setup.py test --test-suite=tests.test_ssl Look also in the demo directory for other samples. To create new test certificates: mkdir certs cd certs Making the CA. You may want to use a locally edited openssl.cnf to make sure that X509v3 Basic Constraints CA:TRUE gets set (by default it may be false). By default duration may only be just one year; should set this for at least 3 years. CA.sh -newca cp demoCA/cacert.pem ../ca.pem Making the server certificate and private key. make sure commonName field is localhost. CA.sh -newreq CA.sh -signreq cp newcert.pem ../server.pem openssl rsa >../server.pem Making the x509 certificate and key. CA.sh -newreq CA.sh -signreq cp newcert.pem ../x509.pem openssl rsa >../x509.pem openssl x509 -in ../x509.pem -out ../x509.der -outform DER Making the signer certificate. Make sure the email address is signer@example.com. CA.sh -newreq CA.sh -signreq cp newcert.pem ../signer.pem openssl rsa ../signer_key.pem Making the recipient certificate. Make sure the email address is recipient@example.com. CA.sh -newreq CA.sh -signreq cp newcert.pem ../recipient.pem openssl rsa ../recipient_key.pem Finally run the tests and edit for new values. M2Crypto-0.31.0/tests/__init__.py0000644000175000001440000000061313355123234017005 0ustar matejusers00000000000000import logging import os.path import sys if sys.version_info[:2] <= (2, 6): sys.path.insert(0, os.path.join(os.path.abspath(os.path.dirname(__file__)), 'vendor')) try: import unittest2 as unittest except ImportError: import unittest logging.basicConfig(format='%(levelname)s:%(funcName)s:%(message)s', level=logging.DEBUG) M2Crypto-0.31.0/tests/alltests.py0000644000175000001440000000562313355123234017107 0ustar matejusers00000000000000from __future__ import absolute_import, print_function def suite(): from M2Crypto import m2 # noqa import os import unittest def my_import(name): # See http://docs.python.org/lib/built-in-funcs.html#l2h-6 components = name.split('.') try: # python setup.py test mod = __import__(name) for comp in components[1:]: mod = getattr(mod, comp) except ImportError: # python tests/alltests.py mod = __import__(components[1]) return mod modules_to_test = [ 'tests.test_aes', 'tests.test_asn1', 'tests.test_bio', 'tests.test_bio_membuf', 'tests.test_bio_file', 'tests.test_bio_iobuf', 'tests.test_bio_ssl', 'tests.test_bn', 'tests.test_authcookie', 'tests.test_dh', 'tests.test_dsa', 'tests.test_engine', 'tests.test_evp', 'tests.test_obj', 'tests.test_rand', 'tests.test_rc4', 'tests.test_rsa', 'tests.test_smime', 'tests.test_ssl_offline', 'tests.test_threading', 'tests.test_util', 'tests.test_x509', 'tests.test_timeout'] if os.name == 'posix': modules_to_test.append('tests.test_ssl') elif os.name == 'nt': modules_to_test.append('tests.test_ssl_win') if m2.OPENSSL_VERSION_NUMBER >= 0x90800F and m2.OPENSSL_NO_EC == 0: modules_to_test.append('tests.test_ecdh') modules_to_test.append('tests.test_ecdsa') modules_to_test.append('tests.test_ec_curves') alltests = unittest.TestSuite() for module in map(my_import, modules_to_test): alltests.addTest(module.suite()) print('Version of OpenSSL is {0:x} ({1:s})'.format(m2.OPENSSL_VERSION_NUMBER, m2.OPENSSL_VERSION_TEXT)) return alltests def dump_garbage(): import gc print('\nGarbage:') gc.collect() if len(gc.garbage): print('\nLeaked objects:') for x in gc.garbage: s = str(x) if len(s) > 77: s = s[:73] + '...' print(type(x), '\n ', s) print('There were %d leaks.' % len(gc.garbage)) else: print('Python garbage collector did not detect any leaks.') print('However, it is still possible there are leaks in the C code.') def runall(report_leaks=0): report_leaks = report_leaks if report_leaks: import gc gc.enable() gc.set_debug(gc.DEBUG_LEAK & ~gc.DEBUG_SAVEALL) import os import unittest from M2Crypto import Rand try: Rand.load_file('tests/randpool.dat', -1) unittest.TextTestRunner(verbosity=2).run(suite()) Rand.save_file('tests/randpool.dat') finally: if os.name == 'posix': from .test_ssl import zap_servers zap_servers() if report_leaks: dump_garbage() M2Crypto-0.31.0/tests/bad_date_cert.crt0000664000175000001440000000211313165756570020163 0ustar matejusers00000000000000-----BEGIN CERTIFICATE----- MIIC/TCCAeWgAwIBAgIJAPd8QvAqguI9MA0GCSqGSIb3DQEBCwUAMBQxEjAQBgNV BAMMCWxvY2FsaG9zdDAgFw0xNjAzMDQxNDU3NDZaGA8yMTE2MDIwOTE0NTc0Nlow FDESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIB CgKCAQEAsyy/9CI++wVV22U3xor0Hi1nUUusa8Or/a/ppTpgAH0UREcvKrfSCQU0 cCPbYg2M3Jn+tQlcs3eAfUFnyz4XCDlMnns8iKse6kkzQQpx+budUwAamP21bHa6 8dMwDFT3+z9LxDstqdbsvW+KzQwyuYCsWnp6l2KRNy1P4wt7gVvnm5+GCGRMo89L yWJ6iz21XZt6wsafPArKclxVzkzW6Li7JvMaJWyJstSlDaGMlAORUbbO78/VYVYD idhqtgN+s1rnHZEMKU0io2pTkVTYVVU6hkGvx7OxChVd8ZYQdptYu1jqB4DS9Ima tNLZZMnBh9aAwZAEWLku8N1EV/pfyQIDAQABo1AwTjAdBgNVHQ4EFgQUWc4wUp+0 e1cC0gY3DCtCx1ECCgswHwYDVR0jBBgwFoAUWc4wUp+0e1cC0gY3DCtCx1ECCgsw DAYDVR0TBAUwAwEB/zANBgkqhkiG9w0BAQsFAAOCAQEABmFTO2Q+6VqzQ3Td4Xp4 TwJ25WJWf/n5E/sY96Z4iG5ABzPEo4jzsx6DQzcxQ445nu62/OHtmF8y8abZWk0/ KTmTMEl0+z9ab48zHIjp7WkXcUGxHfbIApI8tmYXn/y1+zEtG5+bRXcAODce0pRL CqWvlchiwLhlao0Pe8Gz1DV7feS/or9XojE8+sokSiuRFGIcwIzpYX/hja4Xtsmc Z/PUfodHmpKW+c559cn9pnVjJjhjXpKqDrgE2l9jtTwRVLQOGMxcISvfoNwu833z OJJ1gyor9okGBpmackBUpwpWD7s6tBwkcMo2sJZGD/Kfv1ncYuRXqa6+tQaHxJRS LA== -----END CERTIFICATE----- M2Crypto-0.31.0/tests/ca.pem0000644000175000001440000001322213356651321015766 0ustar matejusers00000000000000Certificate: Data: Version: 3 (0x2) Serial Number: 0 (0x0) Signature Algorithm: sha256WithRSAEncryption Issuer: C=US, ST=California, O=M2Crypto, CN=Heikki Toivonen Validity Not Before: Oct 7 15:12:02 2018 GMT Not After : Oct 4 15:12:02 2028 GMT Subject: C=US, ST=California, O=M2Crypto, CN=Heikki Toivonen Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public-Key: (2048 bit) Modulus: 00:b8:14:c3:7e:10:d4:0e:55:5e:8c:5c:14:07:14: da:a6:32:d4:35:37:23:7c:27:bd:29:69:4a:dd:ee: a7:9f:f3:7f:1b:f4:73:3d:0b:89:6a:a1:f7:35:ac: b0:20:42:b8:e6:f5:36:9f:83:d9:d6:d0:45:b9:60: 0c:a9:dd:f6:28:b9:c4:b7:02:ee:63:cc:ba:3a:70: 0c:34:75:46:9d:f1:7b:d5:5f:46:17:84:94:fc:00: f6:21:c3:e2:cd:6c:d1:33:bf:d9:c2:1c:5f:c8:af: 91:20:0b:ed:c9:68:44:00:45:ec:9e:82:5a:62:c2: a7:53:de:58:db:7d:d5:2c:9e:8f:7c:15:b4:34:30: ab:b7:3d:ed:72:a2:5c:4a:51:d1:85:33:ad:e0:23: e9:12:02:b9:64:0b:d8:de:61:f8:d9:18:4e:43:32: 73:d0:f2:df:c6:de:28:cf:f5:48:7e:46:7c:85:c6: 1e:96:a2:32:b8:16:ff:96:71:81:a7:d1:87:d2:d9: 0e:b8:9f:ad:45:14:a1:d3:b9:52:c8:59:63:77:17: fe:22:ac:f9:c1:97:12:97:98:99:ae:ac:48:1b:97: 83:fa:88:e0:63:9b:bc:55:ea:e0:c7:ec:55:28:e9: 28:2a:b4:be:08:e1:50:43:4e:41:df:10:b7:98:1e: dd:37 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:TRUE X509v3 Subject Key Identifier: 49:6E:7E:9B:16:48:9F:E9:B8:A7:DC:7C:0E:73:F6:26:2A:9C:9D:7C Signature Algorithm: sha256WithRSAEncryption a5:88:b0:1a:e3:fc:89:21:8f:d2:3f:39:5d:bd:84:1c:c9:1b: 58:16:8d:cc:f7:9d:6d:f1:19:29:05:51:c6:20:c5:cc:00:d5: 61:5f:8f:de:64:3a:43:81:eb:b2:21:7a:ec:19:6b:21:30:33: bc:a3:7b:f7:2a:49:f5:8b:d3:48:dc:65:f0:29:f2:fd:3c:f5: 03:37:19:a3:56:d5:3c:42:60:29:df:ab:aa:36:95:16:eb:6c: f2:2d:22:ca:5c:0d:e7:14:6e:f3:10:70:b9:d2:82:59:68:9e: 31:9d:39:f2:8a:6e:00:c3:2c:b5:ed:f9:fa:6f:f4:43:f1:98: 81:f3:89:ef:23:6d:fc:f1:33:2f:d7:fc:cc:28:2a:dd:3e:da: 27:8a:1f:5e:a9:7a:df:2e:c1:e5:c6:db:a9:74:c2:e2:9c:3e: 9b:2c:22:b1:2e:5d:90:09:c9:45:95:35:21:ca:08:12:19:4c: 8d:ca:a5:1d:2b:55:b3:44:d5:43:5d:86:bc:36:4c:e6:7a:29: b6:21:ab:e8:a2:23:ec:e4:00:a0:6b:0f:bd:d5:77:64:64:30: ed:d7:31:88:18:91:24:08:7b:9b:0f:62:8f:31:5c:11:f1:df: d3:2d:e6:52:27:11:a0:8a:f9:5e:a9:a3:ea:e3:0c:83:56:2b: 95:6b:b9:f6 -----BEGIN CERTIFICATE----- MIIDSDCCAjCgAwIBAgIBADANBgkqhkiG9w0BAQsFADBPMQswCQYDVQQGEwJVUzET MBEGA1UECAwKQ2FsaWZvcm5pYTERMA8GA1UECgwITTJDcnlwdG8xGDAWBgNVBAMM D0hlaWtraSBUb2l2b25lbjAeFw0xODEwMDcxNTEyMDJaFw0yODEwMDQxNTEyMDJa ME8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMREwDwYDVQQKDAhN MkNyeXB0bzEYMBYGA1UEAwwPSGVpa2tpIFRvaXZvbmVuMIIBIjANBgkqhkiG9w0B AQEFAAOCAQ8AMIIBCgKCAQEAuBTDfhDUDlVejFwUBxTapjLUNTcjfCe9KWlK3e6n n/N/G/RzPQuJaqH3NaywIEK45vU2n4PZ1tBFuWAMqd32KLnEtwLuY8y6OnAMNHVG nfF71V9GF4SU/AD2IcPizWzRM7/ZwhxfyK+RIAvtyWhEAEXsnoJaYsKnU95Y233V LJ6PfBW0NDCrtz3tcqJcSlHRhTOt4CPpEgK5ZAvY3mH42RhOQzJz0PLfxt4oz/VI fkZ8hcYelqIyuBb/lnGBp9GH0tkOuJ+tRRSh07lSyFljdxf+Iqz5wZcSl5iZrqxI G5eD+ojgY5u8Vergx+xVKOkoKrS+COFQQ05B3xC3mB7dNwIDAQABoy8wLTAMBgNV HRMEBTADAQH/MB0GA1UdDgQWBBRJbn6bFkif6bin3HwOc/YmKpydfDANBgkqhkiG 9w0BAQsFAAOCAQEApYiwGuP8iSGP0j85Xb2EHMkbWBaNzPedbfEZKQVRxiDFzADV YV+P3mQ6Q4HrsiF67BlrITAzvKN79ypJ9YvTSNxl8Cny/Tz1AzcZo1bVPEJgKd+r qjaVFuts8i0iylwN5xRu8xBwudKCWWieMZ058opuAMMste35+m/0Q/GYgfOJ7yNt /PEzL9f8zCgq3T7aJ4ofXql63y7B5cbbqXTC4pw+mywisS5dkAnJRZU1IcoIEhlM jcqlHStVs0TVQ12GvDZM5noptiGr6KIj7OQAoGsPvdV3ZGQw7dcxiBiRJAh7mw9i jzFcEfHf0y3mUicRoIr5Xqmj6uMMg1YrlWu59g== -----END CERTIFICATE----- -----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuBTDfhDUDlVejFwUBxTapjLUNTcjfCe9KWlK3e6nn/N/G/Rz PQuJaqH3NaywIEK45vU2n4PZ1tBFuWAMqd32KLnEtwLuY8y6OnAMNHVGnfF71V9G F4SU/AD2IcPizWzRM7/ZwhxfyK+RIAvtyWhEAEXsnoJaYsKnU95Y233VLJ6PfBW0 NDCrtz3tcqJcSlHRhTOt4CPpEgK5ZAvY3mH42RhOQzJz0PLfxt4oz/VIfkZ8hcYe lqIyuBb/lnGBp9GH0tkOuJ+tRRSh07lSyFljdxf+Iqz5wZcSl5iZrqxIG5eD+ojg Y5u8Vergx+xVKOkoKrS+COFQQ05B3xC3mB7dNwIDAQABAoIBAQCISU8nYbwuVIQo tO9bAtSS4eT89TK/dAh3xW3ZfBz8rmF4R/adxpHZscp+IblQWTXeQMRNO2gnw5Er mvIlPaFHK6p5uKDYoLVsGJLgr8c1npkJM32IYe+P2AJio02iu6LzhmHpdepwgZOX v10wlZJrBVoXTPkwT19lF6R/9NzEJ+qyceixwIUFlqKzFv+LavFL4elP03OVF5Wu TN2DTaVJzNdpBVGdYKkJX7GhX28/gaDRZw6B2wJoJhl56uhzibNe9Lc0S9nyt+0Y ARodv5KVTaM07z4LkFQxIliVFJmR8Bin3CHC36K9ike57srkR/BOR13Vxw9EtUHx tNe11jy5AoGBAOVo1NHwHT7EH06F3O2MvKYJAa5rm8EU9Eq6d70ylVDKHCu2NA9V KeeUbXxGK9Bk3RhLVevZv870AgZqtD4sUEg3qMrW3ZQHyyAlZq57AAw9GlL8REZv aWvDE4/fmpNYVyUrpQ9KIyaZa96VZtqUJbLgzcvQsRhiwo2zQAP9UqL9AoGBAM1q 7DJtTqU1Muk5UWc8XS6HxRf0D5c1240UXP1xkRDCfI2lI3AM3sCQ5iKQP/SsOrvK KgxQDVykdbTqD5F7QDX8BmYTdALzRm/XyqqY52WljDAwNEsdTLPewffDMRhjSBSw sjPiHMnmXJH+0uKKUrSdvDsElBQASKQ81Ojg+ZlDAoGAS2HiJMYQ5hIN84B7Mze+ uZRWEBleCdk32OJi/DGF7REsppRtkOg8J9OXEnIAba7nE9eVeTWJGJkHnVIsvg1T qBdaCKUIFF9nOL3xer4CKwNdBg3M5ZQwgO+OGwWvxmEN6bHowBhtan6Zen9/V628 oYXLOgDuYIP7SBKxo133bIUCgYEAj4hTrFSmbFfE0CQF1k3eimHB/R/DORQf6e89 nrYY+A39e/fU0Dmd+A4HUEVc+vjRPWBgiyPwgjhEKvqVkED/t/j2+6JCIMGeCQ5O hW+72FGZqB42m/nIG7Ld8+KGzpSozBQ/IHOxS/5T1oupDTQ74AqLeO2VDni4SVJc LrDslwMCgYEArxtk6NGesCUgdCTHEueubcY8VoXn/DOHi1QpqV/Fq93Fs5AkDwle yI11+KVvXad2UAZI2LcQsN3P12Wdco0ayfHOSpOf8zv1w+/DyDkrcT10ZxgL9EDJ eBEgQ+XmPoteMubMr6EQrzfXxzKqK/DN+2mq0s7PAFgHOr31g6feLYI= -----END RSA PRIVATE KEY----- M2Crypto-0.31.0/tests/ca_key.pem0000644000175000001440000000321713356651321016641 0ustar matejusers00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEpQIBAAKCAQEAuBTDfhDUDlVejFwUBxTapjLUNTcjfCe9KWlK3e6nn/N/G/Rz PQuJaqH3NaywIEK45vU2n4PZ1tBFuWAMqd32KLnEtwLuY8y6OnAMNHVGnfF71V9G F4SU/AD2IcPizWzRM7/ZwhxfyK+RIAvtyWhEAEXsnoJaYsKnU95Y233VLJ6PfBW0 NDCrtz3tcqJcSlHRhTOt4CPpEgK5ZAvY3mH42RhOQzJz0PLfxt4oz/VIfkZ8hcYe lqIyuBb/lnGBp9GH0tkOuJ+tRRSh07lSyFljdxf+Iqz5wZcSl5iZrqxIG5eD+ojg Y5u8Vergx+xVKOkoKrS+COFQQ05B3xC3mB7dNwIDAQABAoIBAQCISU8nYbwuVIQo tO9bAtSS4eT89TK/dAh3xW3ZfBz8rmF4R/adxpHZscp+IblQWTXeQMRNO2gnw5Er mvIlPaFHK6p5uKDYoLVsGJLgr8c1npkJM32IYe+P2AJio02iu6LzhmHpdepwgZOX v10wlZJrBVoXTPkwT19lF6R/9NzEJ+qyceixwIUFlqKzFv+LavFL4elP03OVF5Wu TN2DTaVJzNdpBVGdYKkJX7GhX28/gaDRZw6B2wJoJhl56uhzibNe9Lc0S9nyt+0Y ARodv5KVTaM07z4LkFQxIliVFJmR8Bin3CHC36K9ike57srkR/BOR13Vxw9EtUHx tNe11jy5AoGBAOVo1NHwHT7EH06F3O2MvKYJAa5rm8EU9Eq6d70ylVDKHCu2NA9V KeeUbXxGK9Bk3RhLVevZv870AgZqtD4sUEg3qMrW3ZQHyyAlZq57AAw9GlL8REZv aWvDE4/fmpNYVyUrpQ9KIyaZa96VZtqUJbLgzcvQsRhiwo2zQAP9UqL9AoGBAM1q 7DJtTqU1Muk5UWc8XS6HxRf0D5c1240UXP1xkRDCfI2lI3AM3sCQ5iKQP/SsOrvK KgxQDVykdbTqD5F7QDX8BmYTdALzRm/XyqqY52WljDAwNEsdTLPewffDMRhjSBSw sjPiHMnmXJH+0uKKUrSdvDsElBQASKQ81Ojg+ZlDAoGAS2HiJMYQ5hIN84B7Mze+ uZRWEBleCdk32OJi/DGF7REsppRtkOg8J9OXEnIAba7nE9eVeTWJGJkHnVIsvg1T qBdaCKUIFF9nOL3xer4CKwNdBg3M5ZQwgO+OGwWvxmEN6bHowBhtan6Zen9/V628 oYXLOgDuYIP7SBKxo133bIUCgYEAj4hTrFSmbFfE0CQF1k3eimHB/R/DORQf6e89 nrYY+A39e/fU0Dmd+A4HUEVc+vjRPWBgiyPwgjhEKvqVkED/t/j2+6JCIMGeCQ5O hW+72FGZqB42m/nIG7Ld8+KGzpSozBQ/IHOxS/5T1oupDTQ74AqLeO2VDni4SVJc LrDslwMCgYEArxtk6NGesCUgdCTHEueubcY8VoXn/DOHi1QpqV/Fq93Fs5AkDwle yI11+KVvXad2UAZI2LcQsN3P12Wdco0ayfHOSpOf8zv1w+/DyDkrcT10ZxgL9EDJ eBEgQ+XmPoteMubMr6EQrzfXxzKqK/DN+2mq0s7PAFgHOr31g6feLYI= -----END RSA PRIVATE KEY----- M2Crypto-0.31.0/tests/der_encoded_seq.b640000664000175000001440000000243013032674550020321 0ustar matejusers00000000000000MIIDwTCCA70wggKloAMCAQICAg5QMA0GCSqGSIb3DQEBBQUAMGkxEzARBgoJkiaJk/IsZAEZFgNv cmcxGDAWBgoJkiaJk/IsZAEZFghET0VHcmlkczEgMB4GA1UECxMXQ2VydGlmaWNhdGUgQXV0aG9y aXRpZXMxFjAUBgNVBAMTDURPRUdyaWRzIENBIDEwHhcNMDUwMTEyMDA1MTAyWhcNMDYwMTEyMDA1 MTAyWjBhMRMwEQYKCZImiZPyLGQBGRMDb3JnMRgwFgYKCZImiZPyLGQBGRMIZG9lZ3JpZHMxETAP BgNVBAsTCFNlcnZpY2VzMR0wGwYDVQQDExRob3N0L2Jvc3Nob2cubGJsLmdvdjCCASIwDQYJKoZI hvcNAQEBBQADggEPADCCAQoCggEBAJ+M2ICaiIkr1YcPzXlOSA/DTzduZPq+ALwbmU+nHatL8wXr 8SmwMq/aIG9egGnJzsTlofkSA5D7HAX3nLKkU0A+k0Eig2QzZ5iPjrtAr2m9/b/EsF2I58yOcEDT EZuHQWCg19YE29n3UwqXB6pgpuMcFfFqLz6NydN9i0T7Md8OGwYpNzK6TsOCtyF+nin5mZleDyXF BtkXeIDHmq8sYmsELv1fbAwYzpAZqvz3k0umXSMwnyq+z6WpawybNuLrhRzqMrMZYzq0Db/hS4xr TeXOFuRQ/IcgWt0rLmOIRYKrVfLujFcAQnaPDW8llK2kgi6OrPlTo8e8JVEcz5d7bKUCAwEAAaN3 MHUwEQYJYIZIAYb4QgEBBAQDAgbAMA4GA1UdDwEB/wQEAwIE8DAfBgNVHSMEGDAWgBTKGR0Sjm6k OF1C1DEOCNvZjRcNXTAvBgNVHREEKDAmgg9ib3NzaG9nLmxibC5nb3aBE01LUm9kcmlndWV6QGxi bC5nb3YwDQYJKoZIhvcNAQEFBQADggEBAKZkj+amwHCSdcMC05NBv1Vck46tGEsAEf9WiNvf3B1N O+B0d+egcbXME+LgrxWvOIf4k2DKvORt/oz5BavEbmD1+/NUseBEA01bzjXXgmWwW48CK5cb6Qam wq1uMa/asUgyLfpVkgA9ThwHIr2/g4HEIqUZLaqotLS5+EzZKhOuWh9OJh+AR6WCxOjTQw1xCJd0 T/sSlHdtlH47xBkDL5DKe0pn9CgGY+ihehcRpzXMB8tKgxzsE8NuB49IUrVC+wIgzEXEeaSPFenL XdWxAKaFWRXyPHrsrtsenxnRkM6y8qxWN6UV5UqpvdE/cy+5QORbzWtfVPYqtNVZoO+N3rc=M2Crypto-0.31.0/tests/dhparams.pem0000664000175000001440000000036513032674550017210 0ustar matejusers00000000000000-----BEGIN DH PARAMETERS----- MIGHAoGBAIgAcu3gpJeO8aS6N+sTMa655BMzBNlK66q62VH9RqmHwFJSjjCs3ZsF aVsTkO3Mt0gULn1drXsK6Lc6pA8s0eQN8ggyEPVr6ND0jN2jr2qc1XlqD7jxzdxe igB66pLvrWvAulrGxg4QMsQjqcpwZZ2ndRpYSmErIi4M1r19nTgjAgEC -----END DH PARAMETERS----- M2Crypto-0.31.0/tests/dsa.param.pem0000664000175000001440000000070713032674550017257 0ustar matejusers00000000000000-----BEGIN DSA PARAMETERS----- MIIBHgKBgQDqYu3smvs8KHBx4XX8otDHQUdtCyWKIRC52eQUSYeWejvdaqm11rIq QMFBJDnvicM4avyOIU2d/ZOfLzN7aXFw3Ep67amsLpj82N+n4lASUJwKdOJyzyLG 9IS41RRek8B3lRAs/zqk1U6P5EaE/uIG4+avYmkSDpB4kmnRGhTYeQIVALKQpdTy uat9aoq9mFm8dVA2VxAhAoGAausAkdN4Hj6S5nfPMjJTnwV4u7hVY6b6eAZTJmxs ykr3XlKqM3PS0hKhjatp7f+mRNFxYvGrWPLAwnPOIp/iNn7lM7U41ceUj1O3KrD/ Cg4LQ/bADvY48eytdjMLZDpL3Jwootfs4i8WIb0RnIxg8nClhkY2K2/+4voft+Xi DlA= -----END DSA PARAMETERS----- M2Crypto-0.31.0/tests/dsa.priv.pem0000664000175000001440000000077513032674550017144 0ustar matejusers00000000000000-----BEGIN PRIVATE KEY----- MIIBSgIBADCCASsGByqGSM44BAEwggEeAoGBAOpi7eya+zwocHHhdfyi0MdBR20L JYohELnZ5BRJh5Z6O91qqbXWsipAwUEkOe+Jwzhq/I4hTZ39k58vM3tpcXDcSnrt qawumPzY36fiUBJQnAp04nLPIsb0hLjVFF6TwHeVECz/OqTVTo/kRoT+4gbj5q9i aRIOkHiSadEaFNh5AhUAspCl1PK5q31qir2YWbx1UDZXECECgYBq6wCR03gePpLm d88yMlOfBXi7uFVjpvp4BlMmbGzKSvdeUqozc9LSEqGNq2nt/6ZE0XFi8atY8sDC c84in+I2fuUztTjVx5SPU7cqsP8KDgtD9sAO9jjx7K12MwtkOkvcnCii1+ziLxYh vRGcjGDycKWGRjYrb/7i+h+35eIOUAQWAhQ/vK8oLKHdEu7W77fbZ3+jQvvt6Q== -----END PRIVATE KEY----- M2Crypto-0.31.0/tests/dsa.pub.pem0000664000175000001440000000121613032674550016741 0ustar matejusers00000000000000-----BEGIN PUBLIC KEY----- MIIBtzCCASsGByqGSM44BAEwggEeAoGBAOpi7eya+zwocHHhdfyi0MdBR20LJYoh ELnZ5BRJh5Z6O91qqbXWsipAwUEkOe+Jwzhq/I4hTZ39k58vM3tpcXDcSnrtqawu mPzY36fiUBJQnAp04nLPIsb0hLjVFF6TwHeVECz/OqTVTo/kRoT+4gbj5q9iaRIO kHiSadEaFNh5AhUAspCl1PK5q31qir2YWbx1UDZXECECgYBq6wCR03gePpLmd88y MlOfBXi7uFVjpvp4BlMmbGzKSvdeUqozc9LSEqGNq2nt/6ZE0XFi8atY8sDCc84i n+I2fuUztTjVx5SPU7cqsP8KDgtD9sAO9jjx7K12MwtkOkvcnCii1+ziLxYhvRGc jGDycKWGRjYrb/7i+h+35eIOUAOBhQACgYEAmYO4Qss7pYq3vAEj5qj35A1gsOeC rGxvu8w9Dj8jACuz0IHOTq+vFbnB6p30rdloMU7Ci4NHPWqOVmWCFcXxkFgJMJld sBbkdbGnhPI80sWJGouUYofHFG4pK0QoMeDZKgg7OgwH8EnmQM+W9KDZYJRSuU4+ 6F6hQkmkwAKAXkU= -----END PUBLIC KEY----- M2Crypto-0.31.0/tests/easy_rsa.pem0000664000175000001440000001002313165756570017221 0ustar matejusers00000000000000Certificate: Data: Version: 3 (0x2) Serial Number: 3 (0x3) Signature Algorithm: sha1WithRSAEncryption Issuer: C=US, ST=NC, L=Raleigh, O=Fedora Project, OU=fedmsg, CN=fedmsg/name=fedmsg/emailAddress=admin@fedoraproject.org Validity Not Before: Jul 15 21:18:52 2012 GMT Not After : Jul 13 21:18:52 2022 GMT Subject: C=US, ST=NC, L=Raleigh, O=Fedora Project, OU=fedmsg, CN=shell-app01.phx2.fedoraproject.org/name=shell-app01.phx2.fedoraproject.org/emailAddress=admin@fedoraproject.org Subject Public Key Info: Public Key Algorithm: rsaEncryption Public-Key: (1024 bit) Modulus: 00:c9:5d:32:76:f9:e8:a4:84:e6:16:cd:24:7e:99: 68:2a:3e:a7:5b:4f:c2:3b:3a:74:ac:3c:30:be:e5: 99:17:62:83:76:5d:40:79:15:b3:7e:ca:4e:40:e5: 88:2b:95:7e:a3:6a:b1:60:0e:ad:6a:22:b8:6c:f7: f2:95:82:f5:20:62:30:95:53:fd:99:ae:73:c2:44: 6f:5a:47:ad:5a:31:8e:46:9e:41:ee:0e:e8:10:24: 0e:06:8d:e0:9d:0b:74:51:fe:53:58:04:35:e9:69: f4:6c:2a:c8:41:2a:8e:59:52:92:70:af:6f:52:4f: e8:a2:65:25:01:96:e4:b0:47 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE Netscape Comment: Easy-RSA Generated Certificate X509v3 Subject Key Identifier: 77:71:57:05:B0:F6:25:6D:EA:72:6A:BE:E5:53:FB:19:CB:B1:1C:5E X509v3 Authority Key Identifier: keyid:00:98:A5:D5:E7:C4:55:0E:84:A3:67:FE:66:4A:16:E0:04:15:DD:21 DirName:/C=US/ST=NC/L=Raleigh/O=Fedora Project/OU=fedmsg/CN=fedmsg/name=fedmsg/emailAddress=admin@fedoraproject.org serial:8E:EB:28:D8:A9:13:9D:7C X509v3 Extended Key Usage: TLS Web Client Authentication X509v3 Key Usage: Digital Signature Signature Algorithm: sha1WithRSAEncryption 11:b5:cc:6f:e5:cd:8c:b3:fe:98:61:44:ea:ba:9f:39:37:41: 45:5e:34:6c:b1:15:dc:71:a0:1e:7b:8f:8c:43:8b:ad:32:cf: 2d:b2:01:87:bd:b3:0a:a5:2f:51:a4:f6:38:c0:e3:f6:5f:fe: 52:cf:17:13:8c:f8:d8:a7:4c:e8:7f:a3:ac:f4:6c:40:41:0a: e7:f0:14:a8:92:fa:e8:3f:a6:3b:08:a3:af:6f:0b:4d:c5:db: 54:b4:a6:ab:8c:f1:b4:23:71:da:00:e6:ae:69:76:26:3f:06: ae:47:50:b9:a8:b3:20:3e:10:db:ba:f6:8b:d0:19:96:54:88: 96:ff -----BEGIN CERTIFICATE----- MIIESTCCA7KgAwIBAgIBAzANBgkqhkiG9w0BAQUFADCBoDELMAkGA1UEBhMCVVMx CzAJBgNVBAgTAk5DMRAwDgYDVQQHEwdSYWxlaWdoMRcwFQYDVQQKEw5GZWRvcmEg UHJvamVjdDEPMA0GA1UECxMGZmVkbXNnMQ8wDQYDVQQDEwZmZWRtc2cxDzANBgNV BCkTBmZlZG1zZzEmMCQGCSqGSIb3DQEJARYXYWRtaW5AZmVkb3JhcHJvamVjdC5v cmcwHhcNMTIwNzE1MjExODUyWhcNMjIwNzEzMjExODUyWjCB2DELMAkGA1UEBhMC VVMxCzAJBgNVBAgTAk5DMRAwDgYDVQQHEwdSYWxlaWdoMRcwFQYDVQQKEw5GZWRv cmEgUHJvamVjdDEPMA0GA1UECxMGZmVkbXNnMSswKQYDVQQDEyJzaGVsbC1hcHAw MS5waHgyLmZlZG9yYXByb2plY3Qub3JnMSswKQYDVQQpEyJzaGVsbC1hcHAwMS5w aHgyLmZlZG9yYXByb2plY3Qub3JnMSYwJAYJKoZIhvcNAQkBFhdhZG1pbkBmZWRv cmFwcm9qZWN0Lm9yZzCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEAyV0ydvno pITmFs0kfploKj6nW0/COzp0rDwwvuWZF2KDdl1AeRWzfspOQOWIK5V+o2qxYA6t aiK4bPfylYL1IGIwlVP9ma5zwkRvWketWjGORp5B7g7oECQOBo3gnQt0Uf5TWAQ1 6Wn0bCrIQSqOWVKScK9vUk/oomUlAZbksEcCAwEAAaOCAVcwggFTMAkGA1UdEwQC MAAwLQYJYIZIAYb4QgENBCAWHkVhc3ktUlNBIEdlbmVyYXRlZCBDZXJ0aWZpY2F0 ZTAdBgNVHQ4EFgQUd3FXBbD2JW3qcmq+5VP7GcuxHF4wgdUGA1UdIwSBzTCByoAU AJil1efEVQ6Eo2f+ZkoW4AQV3SGhgaakgaMwgaAxCzAJBgNVBAYTAlVTMQswCQYD VQQIEwJOQzEQMA4GA1UEBxMHUmFsZWlnaDEXMBUGA1UEChMORmVkb3JhIFByb2pl Y3QxDzANBgNVBAsTBmZlZG1zZzEPMA0GA1UEAxMGZmVkbXNnMQ8wDQYDVQQpEwZm ZWRtc2cxJjAkBgkqhkiG9w0BCQEWF2FkbWluQGZlZG9yYXByb2plY3Qub3JnggkA juso2KkTnXwwEwYDVR0lBAwwCgYIKwYBBQUHAwIwCwYDVR0PBAQDAgeAMA0GCSqG SIb3DQEBBQUAA4GBABG1zG/lzYyz/phhROq6nzk3QUVeNGyxFdxxoB57j4xDi60y zy2yAYe9swqlL1Gk9jjA4/Zf/lLPFxOM+NinTOh/o6z0bEBBCufwFKiS+ug/pjsI o69vC03F21S0pquM8bQjcdoA5q5pdiY/Bq5HULmosyA+ENu69ovQGZZUiJb/ -----END CERTIFICATE----- M2Crypto-0.31.0/tests/ec.priv.pem0000664000175000001440000000044013165756570016763 0ustar matejusers00000000000000-----BEGIN EC PRIVATE KEY----- MIGkAgEBBDDYZmLKVOPc34hDebkYt5vGMQBcX+WtHbXxnncL6ptQtzgkWN1ePGA6 x2HU8NFFpwigBwYFK4EEACKhZANiAASkekXfdAy+vfwcOvO0rwsVDWpil6EKYMlo kdhqz1/kp7hiv5ppw3/LCwsst9CJUUvfAIsRI4qFvTBE0JR8FxLHKFJgasPRHZo9 x5i2EG07MzSevyODOjtVBrklq6nQCao= -----END EC PRIVATE KEY----- M2Crypto-0.31.0/tests/ec.pub.pem0000664000175000001440000000032713165756570016575 0ustar matejusers00000000000000-----BEGIN PUBLIC KEY----- MHYwEAYHKoZIzj0CAQYFK4EEACIDYgAEpHpF33QMvr38HDrztK8LFQ1qYpehCmDJ aJHYas9f5Ke4Yr+aacN/ywsLLLfQiVFL3wCLESOKhb0wRNCUfBcSxyhSYGrD0R2a PceYthBtOzM0nr8jgzo7VQa5Jaup0Amq -----END PUBLIC KEY----- M2Crypto-0.31.0/tests/fips.py0000664000175000001440000000021113165756570016221 0ustar matejusers00000000000000try: with open('/proc/sys/crypto/fips_enabled') as f: fips_mode = int(f.read()) except (IOError, OSError): fips_mode = 0 M2Crypto-0.31.0/tests/long_serial_cert.pem0000664000175000001440000000174113032674550020723 0ustar matejusers00000000000000-----BEGIN CERTIFICATE----- MIICsDCCAhmgAwIBAgIJAPR7mEmILgX6MA0GCSqGSIb3DQEBBQUAMEUxCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpTb21lLVN0YXRlMSEwHwYDVQQKExhJbnRlcm5ldCBX aWRnaXRzIFB0eSBMdGQwHhcNMDkwNjE5MTkzNjIyWhcNMDkwNzE5MTkzNjIyWjBF MQswCQYDVQQGEwJVUzETMBEGA1UECBMKU29tZS1TdGF0ZTEhMB8GA1UEChMYSW50 ZXJuZXQgV2lkZ2l0cyBQdHkgTHRkMIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKB gQDRb/jlXLidgXQGsOLoFbh4JAvC+BgufR7jn93KPybI0oo8VXFUqr2eFuLDcPiE gpWIMrLwq9f0US/M/yXQdsH08L2xe+aaiNl+j+o4VsPhXfnvFvAtFRs+JqCR3VfI vVePwov31+/28PmF1kOxr9SmSzvSPnN3SqSC0GDAmhWNYwIDAQABo4GnMIGkMB0G A1UdDgQWBBR3SQBG5X/vH18obsb2aaBxhU/+HjB1BgNVHSMEbjBsgBR3SQBG5X/v H18obsb2aaBxhU/+HqFJpEcwRTELMAkGA1UEBhMCVVMxEzARBgNVBAgTClNvbWUt U3RhdGUxITAfBgNVBAoTGEludGVybmV0IFdpZGdpdHMgUHR5IEx0ZIIJAPR7mEmI LgX6MAwGA1UdEwQFMAMBAf8wDQYJKoZIhvcNAQEFBQADgYEAoyvUPgjkwPAgiqiU 4cD1tZdcxIzkk22U02cTjJtAPnIYwqwwDpFltApvRbp8MNiPqXbBt0tchj/Ovu4D JiDTMaizVOZ+XmiC68uNTZ4nvEwHvVdKmudNVTZDdFr/a6BErAeTknlMCihN3v6M POx8a1iz8Y/wJ8YA74vMPORKlKc= -----END CERTIFICATE----- M2Crypto-0.31.0/tests/makecerts.py0000755000175000001440000001142513356651321017236 0ustar matejusers00000000000000#!/usr/bin/env python # # Create test certificates: # # ca.pem # server.pem # recipient.pem # signer.pem # x509.pem # from __future__ import print_function import hashlib import os import os.path import sys import time from M2Crypto import ASN1, EC, EVP, RSA, X509, m2, util t = int(time.time() + time.timezone) before = ASN1.ASN1_TIME() before.set_time(t) after = ASN1.ASN1_TIME() after.set_time(t + 60 * 60 * 24 * 365 * 10) # 10 years serial = 1 def callback(self, *args): return ' ' def gen_identifier(cert, dig='sha256'): instr = cert.get_pubkey().get_rsa().as_pem() h = hashlib.new(dig) h.update(instr) digest = h.hexdigest().upper() return ":".join(digest[pos: pos + 2] for pos in range(0, 40, 2)) def make_subject(cn=None, email=None): sub = X509.X509_Name() sub.C = 'US' sub.ST = 'California' sub.O = 'M2Crypto' if cn is not None: sub.CN = cn else: sub.CN = 'Heikki Toivonen' if email is not None: sub.Email = email return sub def req(name): rsa = RSA.load_key(name + '_key.pem') pk = EVP.PKey() pk.assign_rsa(rsa) reqqed = X509.Request() reqqed.set_pubkey(pk) reqqed.set_subject(make_subject()) reqqed.sign(pk, 'sha256') return reqqed, pk def save_text_pem_key(cert, name, with_key=True): with open(name + '.pem', 'wb') as f: for line in cert.as_text(): f.write(line.encode("ascii")) f.write(cert.as_pem()) if with_key: with open(name + '_key.pem', 'rb') as key_f: for line in key_f: f.write(line) def issue(request, ca, capk): global serial pkey = request.get_pubkey() sub = request.get_subject() cert = X509.X509() cert.set_version(2) cert.set_subject(sub) cert.set_serial_number(serial) serial += 1 issuer = ca.get_subject() cert.set_issuer(issuer) cert.set_pubkey(pkey) cert.set_not_before(before) cert.set_not_after(after) ext = X509.new_extension('basicConstraints', 'CA:FALSE') cert.add_ext(ext) ext = X509.new_extension('subjectKeyIdentifier', gen_identifier(cert)) cert.add_ext(ext) # auth = X509.load_cert('ca.pem') # auth_id = auth.get_ext('subjectKeyIdentifier').get_value() # ext = X509.new_extension('authorityKeyIdentifier', 'keyid:%s' % auth_id) # # cert.add_ext(ext) cert.sign(capk, 'sha256') assert cert.verify(capk) return cert def mk_ca(): r, pk = req('ca') pkey = r.get_pubkey() sub = r.get_subject() cert = X509.X509() cert.set_version(2) cert.set_subject(sub) cert.set_serial_number(0) issuer = X509.X509_Name() issuer.C = sub.C issuer.ST = sub.ST issuer.O = sub.O issuer.CN = sub.CN cert.set_issuer(issuer) cert.set_pubkey(pkey) cert.set_not_before(before) cert.set_not_after(after) ext = X509.new_extension('basicConstraints', 'CA:TRUE') cert.add_ext(ext) ski = gen_identifier(cert) ext = X509.new_extension('subjectKeyIdentifier', ski) cert.add_ext(ext) # ext = X509.new_extension('authorityKeyIdentifier', 'keyid:%s' % ski) # cert.add_ext(ext) cert.sign(pk, 'sha256') save_text_pem_key(cert, 'ca') return cert, pk def mk_server(ca, capk): r, _ = req('server') r.set_subject(make_subject(cn='localhost')) cert = issue(r, ca, capk) save_text_pem_key(cert, 'server') def mk_x509(ca, capk): r, _ = req('x509') r.set_subject(make_subject(cn='X509')) cert = issue(r, ca, capk) save_text_pem_key(cert, 'x509') with open('x509.der', 'wb') as derf: derf.write(cert.as_der()) def mk_signer(ca, capk): r, _ = req('signer') r.set_subject(make_subject(cn='Signer', email='signer@example.com')) cert = issue(r, ca, capk) save_text_pem_key(cert, 'signer', with_key=False) def mk_recipient(ca, capk): r, _ = req('recipient') r.set_subject(make_subject(cn='Recipient', email='recipient@example.com')) cert = issue(r, ca, capk) save_text_pem_key(cert, 'recipient') def mk_ec_pair(): priv_key = EC.gen_params(EC.NID_secp384r1) priv_key.gen_key() priv_key.save_key('ec.priv.pem', callback=util.no_passphrase_callback) pub_key = priv_key.pub() pub_key.save_pub_key('ec.pub.pem') if __name__ == '__main__': names = ['ca', 'server', 'recipient', 'signer', 'x509'] os.chdir(os.path.dirname(sys.argv[0])) for key_name in names: genned_key = RSA.gen_key(2048, m2.RSA_F4) genned_key.save_key('%s_key.pem' % key_name, None) ca_bits, pk_bits = mk_ca() mk_server(ca_bits, pk_bits) mk_x509(ca_bits, pk_bits) mk_signer(ca_bits, pk_bits) mk_recipient(ca_bits, pk_bits) # FIXME This doesn't work well. # mk_ec_pair() M2Crypto-0.31.0/tests/pubring.pgp0000664000175000001440000000210013032674550017051 0ustar matejusers0000000000000028iPH6Nړ[21Ka=b)57X0f9QV!SuEůUN3S5GUv@#dF_H9D~[NY76hoCNV$XFdaft 223a5- d 7x yUTtԔ;JDAMN}> +7VGP=?2WM[) -h{ `5DʤDf:9 fa9>\@# Billy boyL2W salYcomCXyp$gKc,Mկ1v RtN%02zX(͂S٫usilly test this is=2NF0;1H*ۮ!e=zW6Uu+X*\h!Gary Howland L2 sRP M9'B{r<-NF 7Vs+j5S`|W[name=2xѡ^V?B|f_͂ `GOL2 ۽riR 3v# O6H 6[8f|2.'Qsilly test this isL2 _r_W,I$+bI\uCz~h5y&Qb !c8+silly test this is2t펝jwgkf7 4f-KvMķ$V37̝}RB*Fl`AV(`PMX?;I^+~?O &p}..eu}]"-R_:&M5NS֝YG;YQz5wa0MJVJkCr-Qf#a%U 2mIX7Wݻ\#Bl`cԆ;k|ۮ)RW:$<D--׶|쭇  uB4=r{ |uܑ~sw,)e[0;/_)v,~p,+V b䏉zEq~:{p>H%C-x0xc֛i b9R u}ubz/S`8l ^8'Xx([z(E`@gpq3a;Pq4ӸIs; #P]'M8̳]vfìقػo0Wz'+axal0/tI 4U숸dJLvDcBV_*-&֕I|yaYʶ6"czX-Ggx)cM<;ӈN-S$8DӾt6xpü !?.I\1YVO\2ߢ*$@B\ӊYIڱ8(pqng'I}3래`A!UG+h0;’_om&?82/oQlj2^ͨcoLi3>H~&5UhQSH@ >sGoZ rs7ݧ3 b%= hnqI[g}=#5HO҅HLk~`"_J0-rRs}3Br%3w;E>) >../server.pem Making the x509 certificate and key. CA.sh -newreq CA.sh -signreq cp newcert.pem ../x509.pem openssl rsa >../x509.pem openssl x509 -in ../x509.pem -out ../x509.der -outform DER Making the signer certificate. Make sure the email address is signer@example.com. CA.sh -newreq CA.sh -signreq cp newcert.pem ../signer.pem openssl rsa ../signer_key.pem Making the recipient certificate. Make sure the email address is recipient@example.com. CA.sh -newreq CA.sh -signreq cp newcert.pem ../recipient.pem openssl rsa ../recipient_key.pem Finally run the tests and edit for new values. ------38FBD2321B4A76C8BE88AFD029CDED23 Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" MIIEhQYJKoZIhvcNAQcCoIIEdjCCBHICAQExDzANBglghkgBZQMEAgEFADALBgkq hkiG9w0BBwGgggJkMIICYDCCAcmgAwIBAgIBBDANBgkqhkiG9w0BAQUFADBPMQsw CQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UEChMITTJDcnlw dG8xGDAWBgNVBAMTD0hlaWtraSBUb2l2b25lbjAeFw0xNTExMjYyMTMzMTJaFw0y NTExMjMyMTMzMTJaMG8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlh MREwDwYDVQQKEwhNMkNyeXB0bzESMBAGA1UEAxMJUmVjaXBpZW50MSQwIgYJKoZI hvcNAQkBFhVyZWNpcGllbnRAZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEBBQAD gY0AMIGJAoGBAJaMhIx8GBrTwmJdDwilmD2LkUw0b80Vr1Ycffk2pgE8nGPPIGT6 dySl4cv+j1rAqJAbmaMCakPv+TGseQH5zEYRfKrRh9+V1PGkesv8TC6LMyL1M/hT augiSBiW8kk5/zOZA+U9wiJS8TOWILzRyCG7S3U9Kz1RTqoP1XNdZkS/AgMBAAGj LDAqMAkGA1UdEwQCMAAwHQYDVR0OBBYEFFON3U+KXkkZq9wvnavqx8PK9vXUMA0G CSqGSIb3DQEBBQUAA4GBABCx3TS7lz4+2ODeapnJvoy3gMcdMNs6aNWk2QJ2K3Zi AIYwWgYDZZK5AKRClF90xpRELowHVfPBbnoKF2ZW71Cvo1/x95dmKdO0FBM0eZaY rVjbIOb8+nCsHCKQv3vD6uOKCr26SP/lyVCDGNkeYTDAx2zqM/7Q/Kga8Zuj3JEQ MYIB5TCCAeECAQEwVDBPMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5p YTERMA8GA1UEChMITTJDcnlwdG8xGDAWBgNVBAMTD0hlaWtraSBUb2l2b25lbgIB BDANBglghkgBZQMEAgEFAKCB5DAYBgkqhkiG9w0BCQMxCwYJKoZIhvcNAQcBMBwG CSqGSIb3DQEJBTEPFw0xODA3MjMxODExNTNaMC8GCSqGSIb3DQEJBDEiBCAFNpRM 82d8yvtEyK+nEYuCf5KuyfnooeJYkzIbqUb2yDB5BgkqhkiG9w0BCQ8xbDBqMAsG CWCGSAFlAwQBKjALBglghkgBZQMEARYwCwYJYIZIAWUDBAECMAoGCCqGSIb3DQMH MA4GCCqGSIb3DQMCAgIAgDANBggqhkiG9w0DAgIBQDAHBgUrDgMCBzANBggqhkiG 9w0DAgIBKDANBgkqhkiG9w0BAQEFAASBgEEVB6XZeD44cN+6qmj1LR5Jh6JLGnIQ eQPGrI8Ygymc1dVDWC72872Xp3UTidhMnCyN36QNBZ7GL63tc2mCZ9rgWE24mvqx cj5hCyXF240ty20igJe5BDaXHgzO0JGJPUtoOxNWrM40IhGxh9MSGlfioMOsuRD4 gDf9hUfjCkvG ------38FBD2321B4A76C8BE88AFD029CDED23-- M2Crypto-0.31.0/tests/server.pem0000644000175000001440000001320113356651321016706 0ustar matejusers00000000000000Certificate: Data: Version: 3 (0x2) Serial Number: 1 (0x1) Signature Algorithm: sha256WithRSAEncryption Issuer: C=US, ST=California, O=M2Crypto, CN=Heikki Toivonen Validity Not Before: Oct 7 15:12:02 2018 GMT Not After : Oct 4 15:12:02 2028 GMT Subject: C=US, ST=California, O=M2Crypto, CN=localhost Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public-Key: (2048 bit) Modulus: 00:f4:f3:38:31:09:92:0d:5d:8b:06:f0:43:e0:62: 62:e1:71:eb:30:ba:d7:b9:57:db:8c:10:9b:9e:1e: 76:45:ab:14:92:54:d4:47:34:ab:0f:95:f3:83:c5: f1:45:75:58:72:0a:e1:67:77:d0:d3:7e:6a:6f:5d: 1a:a4:df:aa:96:c0:0f:8d:0a:95:9e:aa:e5:bc:7a: 6f:ab:61:41:75:31:0c:da:a6:d5:0d:b3:42:f0:20: f6:2c:74:69:39:79:90:a0:c9:c2:23:ba:5a:c5:9c: 8f:fa:4f:06:bb:04:8e:2d:a1:36:82:c4:23:99:18: 1a:b7:56:0f:8a:ef:ff:57:22:51:96:ca:69:8f:a3: ae:91:b7:84:02:07:be:4d:55:f2:1c:f9:11:2a:ff: 20:ab:0f:27:fb:79:75:6c:b2:53:e3:04:ea:4f:e5: 51:3f:1e:b0:b5:7f:fa:de:0f:f6:e8:e6:85:a3:17: 8c:b1:a6:dd:fc:e9:b8:92:d5:1c:73:d7:82:6e:60: 6c:10:b3:22:ca:a5:d8:c5:d2:41:93:b3:57:3f:1b: cf:cf:78:4c:15:85:b1:ca:b6:84:13:1b:8f:42:ed: 21:bb:90:a2:b7:39:9d:68:bf:4d:da:31:06:53:98: e3:de:8f:f8:3e:7d:25:f2:75:7e:d3:09:e4:eb:4d: 59:c9 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE X509v3 Subject Key Identifier: 56:FF:B6:FD:ED:A3:76:04:AA:CB:1F:25:FB:A5:8D:9D:9A:D5:85:D3 Signature Algorithm: sha256WithRSAEncryption 53:99:54:2e:26:26:0c:81:b2:c6:5c:61:6f:1c:60:28:ed:f3: 1b:74:8e:e8:c1:3c:b5:35:e3:db:51:07:38:43:b0:57:0b:e5: 7e:fa:0a:9e:bd:bd:82:5a:ed:9b:67:0d:2b:61:4d:44:58:64: a2:fe:bc:fb:90:80:d2:6b:e4:25:09:ea:ca:a1:17:e6:33:31: 09:62:b6:db:4c:21:f3:52:02:7d:ca:9a:f9:42:04:50:b4:d8: a6:49:ea:bd:c0:13:05:c6:c4:d2:59:d6:30:87:80:c6:a3:92: 45:49:02:43:9c:4a:aa:c1:84:d0:ea:01:29:40:73:87:cd:8e: aa:93:d3:33:7e:01:cf:b5:c1:4b:35:e7:20:1f:6d:7a:c5:d4: a9:4a:c1:e2:26:f5:b7:a2:f5:04:31:45:74:30:9a:51:e7:19: 62:e4:d1:ab:f9:36:29:58:ec:90:f9:8c:3b:28:39:28:d7:8a: a0:c3:ae:aa:a9:c2:05:6e:a9:f4:b6:62:1b:01:db:f9:3e:b9: a4:d7:05:ac:76:b8:8a:12:57:b3:66:de:b0:d2:78:0d:07:9c: 15:1b:85:84:76:31:23:64:ce:1e:7f:be:1e:cc:d9:9f:c0:0c: 9c:20:b9:f0:2e:09:04:ca:d0:61:fc:ce:ba:df:28:c8:20:c8: fb:63:1d:52 -----BEGIN CERTIFICATE----- MIIDPzCCAiegAwIBAgIBATANBgkqhkiG9w0BAQsFADBPMQswCQYDVQQGEwJVUzET MBEGA1UECAwKQ2FsaWZvcm5pYTERMA8GA1UECgwITTJDcnlwdG8xGDAWBgNVBAMM D0hlaWtraSBUb2l2b25lbjAeFw0xODEwMDcxNTEyMDJaFw0yODEwMDQxNTEyMDJa MEkxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMREwDwYDVQQKDAhN MkNyeXB0bzESMBAGA1UEAwwJbG9jYWxob3N0MIIBIjANBgkqhkiG9w0BAQEFAAOC AQ8AMIIBCgKCAQEA9PM4MQmSDV2LBvBD4GJi4XHrMLrXuVfbjBCbnh52RasUklTU RzSrD5Xzg8XxRXVYcgrhZ3fQ035qb10apN+qlsAPjQqVnqrlvHpvq2FBdTEM2qbV DbNC8CD2LHRpOXmQoMnCI7paxZyP+k8GuwSOLaE2gsQjmRgat1YPiu//VyJRlspp j6OukbeEAge+TVXyHPkRKv8gqw8n+3l1bLJT4wTqT+VRPx6wtX/63g/26OaFoxeM sabd/Om4ktUcc9eCbmBsELMiyqXYxdJBk7NXPxvPz3hMFYWxyraEExuPQu0hu5Ci tzmdaL9N2jEGU5jj3o/4Pn0l8nV+0wnk601ZyQIDAQABoywwKjAJBgNVHRMEAjAA MB0GA1UdDgQWBBRW/7b97aN2BKrLHyX7pY2dmtWF0zANBgkqhkiG9w0BAQsFAAOC AQEAU5lULiYmDIGyxlxhbxxgKO3zG3SO6ME8tTXj21EHOEOwVwvlfvoKnr29glrt m2cNK2FNRFhkov68+5CA0mvkJQnqyqEX5jMxCWK220wh81ICfcqa+UIEULTYpknq vcATBcbE0lnWMIeAxqOSRUkCQ5xKqsGE0OoBKUBzh82OqpPTM34Bz7XBSzXnIB9t esXUqUrB4ib1t6L1BDFFdDCaUecZYuTRq/k2KVjskPmMOyg5KNeKoMOuqqnCBW6p 9LZiGwHb+T65pNcFrHa4ihJXs2besNJ4DQecFRuFhHYxI2TOHn++HszZn8AMnCC5 8C4JBMrQYfzOut8oyCDI+2MdUg== -----END CERTIFICATE----- -----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA9PM4MQmSDV2LBvBD4GJi4XHrMLrXuVfbjBCbnh52RasUklTU RzSrD5Xzg8XxRXVYcgrhZ3fQ035qb10apN+qlsAPjQqVnqrlvHpvq2FBdTEM2qbV DbNC8CD2LHRpOXmQoMnCI7paxZyP+k8GuwSOLaE2gsQjmRgat1YPiu//VyJRlspp j6OukbeEAge+TVXyHPkRKv8gqw8n+3l1bLJT4wTqT+VRPx6wtX/63g/26OaFoxeM sabd/Om4ktUcc9eCbmBsELMiyqXYxdJBk7NXPxvPz3hMFYWxyraEExuPQu0hu5Ci tzmdaL9N2jEGU5jj3o/4Pn0l8nV+0wnk601ZyQIDAQABAoIBAQCgFpWS9v5NXeWP E1hJPgQB88IShwqWR6VlVTVfkekaf0Vina5fGzzxYr9UT/nvu1Gitxm51cTVdLl7 Lw5K0yNagwum0lQW7vpWxG5XQ6jUPsp33LFB0vbcma5KP4rF1X2AmFwZnaHVpQ00 OpHbiI6jo8lMjYP2epp7V/OwikoHV0873HTmuq2Y+jUvRM3o01moDtuF5mKofNEd ft9lArRG8yjLgC5G1C9cmiATGoMGyHBRkEv+UrUWLHVxrpXviUd+/iJmhrwXcpvj rTrZWbUkSA3i4JMml/qYqNQYeVUFVgV/slD331iIwlWP8RipXF5YqN+YGjGeqL0+ yQ4KWtABAoGBAP7XvGBUWNBSBrqioTzqYMTbwz/YjXJkvlO09wwc/UkraYlSihi0 2J1dKBePIfOk6gFbuiJNYMJvAt1hBCsN0Z6o/bH7CiOh/55nkTaL0R4zB38uuDDx 4qf6+9HT1eC9yW3UJVPwBBwI4WZmmq4peQoipBtKwpY2Q+yoUU3gp4KhAoGBAPYP +6uv3gQYoIpkUD2ZdX8kFoaC6rJMP3Z/N75NfsOz1Tx3nNwexYM6EVVQrvTRWpLZ rJyCgCJi9HY4lPASKSKM1cLCT/M3SdR8OiqlEjziZtSH/di6wq8/Hfqhf75nC7sK wV7Ic0eQ3Bjg2hggPpjeBJTv8NIlCYbWbxHnsK4pAoGAY0I39vUjWpB4Wn05e/Z2 FnbaR6XbAfFHSGc1yhwIc1VbV8c0Tocxz6kXEoYHXVSgaEMH7pBg3ZpLbVp6OyK4 wKlllssGmfZhD5ubLbmri62of9r8luO/ulnBd2qg5VZGfGai21yi3SCAWlggazFw GYiAjrjBrawZLLYqZMDZvcECgYBoi6/taWKWMPR8+FQTaBFA/M9JRXR8XuMT8Md5 Zqm2csDl2Rhfef+HWvOkYQyE3jJydGPfd58DfTHKzQ2S1tR9ZoMoJbEccGBBFKsO FWajUbpJEKKtI+S12sZdB6Mj/dpBFTfFkrtQK98n/tkLKSAPiT0/HpceYjgi/xbf 76XkyQKBgQCkAuuTYi/9vlqYBcUH+23f0XmzQ6NNCqi0JxrnUmPv0Mc/ci7QfBZ6 BkjPxfllpAsDihfTFpfp6p1PCMpASq1J+w1yR+lnKgw9BlbBLT4SqSVVDiju0cfw njm6zQu7IR6Ts/vi+YbVqn3yeP8U5W9as7QL5y6KeYfAhwuPqWhvog== -----END RSA PRIVATE KEY----- M2Crypto-0.31.0/tests/server_key.pem0000644000175000001440000000321713356651321017564 0ustar matejusers00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEpAIBAAKCAQEA9PM4MQmSDV2LBvBD4GJi4XHrMLrXuVfbjBCbnh52RasUklTU RzSrD5Xzg8XxRXVYcgrhZ3fQ035qb10apN+qlsAPjQqVnqrlvHpvq2FBdTEM2qbV DbNC8CD2LHRpOXmQoMnCI7paxZyP+k8GuwSOLaE2gsQjmRgat1YPiu//VyJRlspp j6OukbeEAge+TVXyHPkRKv8gqw8n+3l1bLJT4wTqT+VRPx6wtX/63g/26OaFoxeM sabd/Om4ktUcc9eCbmBsELMiyqXYxdJBk7NXPxvPz3hMFYWxyraEExuPQu0hu5Ci tzmdaL9N2jEGU5jj3o/4Pn0l8nV+0wnk601ZyQIDAQABAoIBAQCgFpWS9v5NXeWP E1hJPgQB88IShwqWR6VlVTVfkekaf0Vina5fGzzxYr9UT/nvu1Gitxm51cTVdLl7 Lw5K0yNagwum0lQW7vpWxG5XQ6jUPsp33LFB0vbcma5KP4rF1X2AmFwZnaHVpQ00 OpHbiI6jo8lMjYP2epp7V/OwikoHV0873HTmuq2Y+jUvRM3o01moDtuF5mKofNEd ft9lArRG8yjLgC5G1C9cmiATGoMGyHBRkEv+UrUWLHVxrpXviUd+/iJmhrwXcpvj rTrZWbUkSA3i4JMml/qYqNQYeVUFVgV/slD331iIwlWP8RipXF5YqN+YGjGeqL0+ yQ4KWtABAoGBAP7XvGBUWNBSBrqioTzqYMTbwz/YjXJkvlO09wwc/UkraYlSihi0 2J1dKBePIfOk6gFbuiJNYMJvAt1hBCsN0Z6o/bH7CiOh/55nkTaL0R4zB38uuDDx 4qf6+9HT1eC9yW3UJVPwBBwI4WZmmq4peQoipBtKwpY2Q+yoUU3gp4KhAoGBAPYP +6uv3gQYoIpkUD2ZdX8kFoaC6rJMP3Z/N75NfsOz1Tx3nNwexYM6EVVQrvTRWpLZ rJyCgCJi9HY4lPASKSKM1cLCT/M3SdR8OiqlEjziZtSH/di6wq8/Hfqhf75nC7sK wV7Ic0eQ3Bjg2hggPpjeBJTv8NIlCYbWbxHnsK4pAoGAY0I39vUjWpB4Wn05e/Z2 FnbaR6XbAfFHSGc1yhwIc1VbV8c0Tocxz6kXEoYHXVSgaEMH7pBg3ZpLbVp6OyK4 wKlllssGmfZhD5ubLbmri62of9r8luO/ulnBd2qg5VZGfGai21yi3SCAWlggazFw GYiAjrjBrawZLLYqZMDZvcECgYBoi6/taWKWMPR8+FQTaBFA/M9JRXR8XuMT8Md5 Zqm2csDl2Rhfef+HWvOkYQyE3jJydGPfd58DfTHKzQ2S1tR9ZoMoJbEccGBBFKsO FWajUbpJEKKtI+S12sZdB6Mj/dpBFTfFkrtQK98n/tkLKSAPiT0/HpceYjgi/xbf 76XkyQKBgQCkAuuTYi/9vlqYBcUH+23f0XmzQ6NNCqi0JxrnUmPv0Mc/ci7QfBZ6 BkjPxfllpAsDihfTFpfp6p1PCMpASq1J+w1yR+lnKgw9BlbBLT4SqSVVDiju0cfw njm6zQu7IR6Ts/vi+YbVqn3yeP8U5W9as7QL5y6KeYfAhwuPqWhvog== -----END RSA PRIVATE KEY----- M2Crypto-0.31.0/tests/sig.p70000664000175000001440000000307613345233072015737 0ustar matejusers00000000000000-----BEGIN PKCS7----- MIIEeAYJKoZIhvcNAQcCoIIEaTCCBGUCAQExCzAJBgUrDgMCGgUAMBgGCSqGSIb3 DQEHAaALBAlzb21lIHRleHSgggJeMIICWjCCAcOgAwIBAgIBAzANBgkqhkiG9w0B AQUFADBPMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZvcm5pYTERMA8GA1UE ChMITTJDcnlwdG8xGDAWBgNVBAMTD0hlaWtraSBUb2l2b25lbjAeFw0xNTExMjYy MTMzMTJaFw0yNTExMjMyMTMzMTJaMGkxCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpD YWxpZm9ybmlhMREwDwYDVQQKEwhNMkNyeXB0bzEPMA0GA1UEAxMGU2lnbmVyMSEw HwYJKoZIhvcNAQkBFhJzaWduZXJAZXhhbXBsZS5jb20wgZ8wDQYJKoZIhvcNAQEB BQADgY0AMIGJAoGBAMwwnjSFOILEjfeDLouvPKSEZxiQgRz4WKvYk4ehpFFbbBUY EDUNKXwG2nKnp8QerlWCzqlpwSnNbjchppK6AcLaCXulnryBYG1Zr0DTkRHW6jEa uDWkXQ7yPwnR7X00mLxflPb97x5WM68S0Rr36uqlBs8xek8vHr1hJsyZQfeTAgMB AAGjLDAqMAkGA1UdEwQCMAAwHQYDVR0OBBYEFL2gaB862G4r2ttUCdLmOTubBGzE MA0GCSqGSIb3DQEBBQUAA4GBAJtLgDOX79a3CaX1f0MgcdWbg11SPYOO31HZ5bvj 1YqqnVz/LeW3TWcG7vj9Ypke5uomeiQJh1s8Wk9f41qnTZgQgrJ+OBMH8WIzCmfd YfK9nfuDD0XgsSJxnzzI9piglanM+lfqtyaGxCjAl+Sm4oaFOaqPQbpF2pJxBqo4 sCv9MYIB1TCCAdECAQEwVDBPMQswCQYDVQQGEwJVUzETMBEGA1UECBMKQ2FsaWZv cm5pYTERMA8GA1UEChMITTJDcnlwdG8xGDAWBgNVBAMTD0hlaWtraSBUb2l2b25l bgIBAzAJBgUrDgMCGgUAoIHYMBgGCSqGSIb3DQEJAzELBgkqhkiG9w0BBwEwHAYJ KoZIhvcNAQkFMQ8XDTE4MDkwOTE1MDMyMlowIwYJKoZIhvcNAQkEMRYEFDeqY8dz mNlURzJi4aAFfB5jLtp3MHkGCSqGSIb3DQEJDzFsMGowCwYJYIZIAWUDBAEqMAsG CWCGSAFlAwQBFjALBglghkgBZQMEAQIwCgYIKoZIhvcNAwcwDgYIKoZIhvcNAwIC AgCAMA0GCCqGSIb3DQMCAgFAMAcGBSsOAwIHMA0GCCqGSIb3DQMCAgEoMA0GCSqG SIb3DQEBAQUABIGAvUu/Oonnfcp6QmT1e/Xo0nak5ANvRq3ZRFb92HmXZqQZpICh 4pXqDGJVzX4AaSS0DjA7P6JCW7CuOihZIoHuhCPtabms/3h4Uk0+W0xJWiDP6Eex /Uld7ZSzB3iK9YN70QC0drAyJElP8qgmAV9XUwlx9tR3NszaDEG0CxGZ/FY= -----END PKCS7----- M2Crypto-0.31.0/tests/sig.p7s0000664000175000001440000000373413345233072016123 0ustar matejusers00000000000000MIME-Version: 1.0 Content-Type: multipart/signed; protocol="application/x-pkcs7-signature"; micalg="sha1"; boundary="----5091526DA45562EAF43348F05B8CD98A" This is an S/MIME signed message ------5091526DA45562EAF43348F05B8CD98A some text ------5091526DA45562EAF43348F05B8CD98A Content-Type: application/x-pkcs7-signature; name="smime.p7s" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="smime.p7s" MIIEawYJKoZIhvcNAQcCoIIEXDCCBFgCAQExCzAJBgUrDgMCGgUAMAsGCSqGSIb3 DQEHAaCCAl4wggJaMIIBw6ADAgECAgEDMA0GCSqGSIb3DQEBBQUAME8xCzAJBgNV BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQKEwhNMkNyeXB0bzEY MBYGA1UEAxMPSGVpa2tpIFRvaXZvbmVuMB4XDTE1MTEyNjIxMzMxMloXDTI1MTEy MzIxMzMxMlowaTELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNhbGlmb3JuaWExETAP BgNVBAoTCE0yQ3J5cHRvMQ8wDQYDVQQDEwZTaWduZXIxITAfBgkqhkiG9w0BCQEW EnNpZ25lckBleGFtcGxlLmNvbTCBnzANBgkqhkiG9w0BAQEFAAOBjQAwgYkCgYEA zDCeNIU4gsSN94Mui688pIRnGJCBHPhYq9iTh6GkUVtsFRgQNQ0pfAbacqenxB6u VYLOqWnBKc1uNyGmkroBwtoJe6WevIFgbVmvQNOREdbqMRq4NaRdDvI/CdHtfTSY vF+U9v3vHlYzrxLRGvfq6qUGzzF6Ty8evWEmzJlB95MCAwEAAaMsMCowCQYDVR0T BAIwADAdBgNVHQ4EFgQUvaBoHzrYbiva21QJ0uY5O5sEbMQwDQYJKoZIhvcNAQEF BQADgYEAm0uAM5fv1rcJpfV/QyBx1ZuDXVI9g47fUdnlu+PViqqdXP8t5bdNZwbu +P1imR7m6iZ6JAmHWzxaT1/jWqdNmBCCsn44EwfxYjMKZ91h8r2d+4MPReCxInGf PMj2mKCVqcz6V+q3JobEKMCX5KbihoU5qo9BukXaknEGqjiwK/0xggHVMIIB0QIB ATBUME8xCzAJBgNVBAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMREwDwYDVQQK EwhNMkNyeXB0bzEYMBYGA1UEAxMPSGVpa2tpIFRvaXZvbmVuAgEDMAkGBSsOAwIa BQCggdgwGAYJKoZIhvcNAQkDMQsGCSqGSIb3DQEHATAcBgkqhkiG9w0BCQUxDxcN MTgwOTA5MTUwMzIyWjAjBgkqhkiG9w0BCQQxFgQUN6pjx3OY2VRHMmLhoAV8HmMu 2ncweQYJKoZIhvcNAQkPMWwwajALBglghkgBZQMEASowCwYJYIZIAWUDBAEWMAsG CWCGSAFlAwQBAjAKBggqhkiG9w0DBzAOBggqhkiG9w0DAgICAIAwDQYIKoZIhvcN AwICAUAwBwYFKw4DAgcwDQYIKoZIhvcNAwICASgwDQYJKoZIhvcNAQEBBQAEgYC9 S786ied9ynpCZPV79ejSdqTkA29GrdlEVv3YeZdmpBmkgKHileoMYlXNfgBpJLQO MDs/okJbsK46KFkige6EI+1puaz/eHhSTT5bTElaIM/oR7H9SV3tlLMHeIr1g3vR ALR2sDIkSU/yqCYBX1dTCXH21Hc2zNoMQbQLEZn8Vg== ------5091526DA45562EAF43348F05B8CD98A-- M2Crypto-0.31.0/tests/signer.pem0000644000175000001440000001007013356651321016670 0ustar matejusers00000000000000Certificate: Data: Version: 3 (0x2) Serial Number: 3 (0x3) Signature Algorithm: sha256WithRSAEncryption Issuer: C=US, ST=California, O=M2Crypto, CN=Heikki Toivonen Validity Not Before: Oct 7 15:12:02 2018 GMT Not After : Oct 4 15:12:02 2028 GMT Subject: C=US, ST=California, O=M2Crypto, CN=Signer/emailAddress=signer@example.com Subject Public Key Info: Public Key Algorithm: rsaEncryption RSA Public-Key: (2048 bit) Modulus: 00:c8:85:86:3d:72:aa:91:d8:7b:11:02:05:92:b7: 1b:bf:9f:35:be:88:56:db:96:f2:70:3e:98:3c:c3: 62:42:ff:54:74:7a:63:e7:a9:4c:ae:52:48:a2:4f: ab:c5:6b:1d:de:39:b8:f0:89:36:15:f7:70:3d:a8: a6:c3:49:3e:10:d8:ae:ba:cf:1a:e6:dd:0b:d8:cd: d9:00:ea:57:f2:7c:2e:6d:89:80:95:68:b1:fd:06: bc:ea:ba:44:c1:fa:20:87:57:d3:ac:e5:b4:5d:ba: 4f:10:20:82:5b:1b:27:75:b3:0c:ce:4f:79:3f:49: 8e:e3:ba:14:30:cf:8a:82:11:65:59:78:7b:41:16: 43:e8:ea:7f:a4:60:52:46:93:53:4e:de:87:3f:50: 8a:56:c5:d3:04:5c:3c:a2:d3:b0:64:d8:ce:1e:75: ad:ce:cd:91:b1:58:cc:2d:a6:dc:da:b5:b2:c2:0e: 2f:68:74:a7:a5:6e:61:4c:01:f2:d0:7d:83:66:78: 66:9f:b9:87:33:cc:59:dc:03:82:6f:bb:98:0c:e9: 10:63:12:ee:e9:05:c1:5b:98:7e:94:65:98:df:31: bf:59:90:f0:1c:6c:ac:2c:1b:dd:90:71:ab:11:95: 8b:9c:f7:2a:2f:c0:0f:2d:b1:c8:5a:65:d6:a9:34: 44:81 Exponent: 65537 (0x10001) X509v3 extensions: X509v3 Basic Constraints: CA:FALSE X509v3 Subject Key Identifier: 68:03:33:27:D9:87:9A:EA:7D:41:D8:2D:EB:F9:EE:AB:C9:6A:C5:FA Signature Algorithm: sha256WithRSAEncryption 47:27:62:6d:43:f3:f6:87:0a:8f:1f:f1:4b:2b:67:05:11:85: b1:13:69:ca:de:1e:6f:8f:78:ae:b5:b7:75:ca:84:f3:58:26: 9d:c5:0b:0e:4c:e9:ce:1c:5d:69:03:6e:d7:2e:88:28:75:78: c5:54:37:e6:70:4f:8f:92:fb:5f:ce:c2:b3:a3:74:77:e6:c3: 94:ab:c6:d2:69:bb:dd:d8:16:9d:36:2a:d1:c1:e1:0d:81:da: 96:9f:f1:ae:a4:b9:73:16:b1:98:b5:f9:6a:4c:8b:08:30:c3: d6:31:3a:79:e2:ef:7f:db:4f:6f:13:f8:98:d6:b2:04:72:c3: 03:b2:ff:63:ad:ce:4e:8d:95:37:a6:dc:52:5e:5c:26:35:9f: 14:7e:9d:a0:04:46:00:ff:52:94:f1:2b:75:1c:52:f0:79:eb: 41:a8:39:a2:5a:63:cc:de:70:cd:82:72:77:1d:77:e1:3d:ff: 38:86:2d:12:4f:ab:4c:72:35:69:4f:ad:55:1d:da:ae:9d:0a: 23:4a:cc:2a:40:d8:4e:f5:bd:33:4c:eb:b7:47:41:82:2a:c9: fc:64:0d:33:76:00:61:ba:b6:40:ca:24:96:5e:84:d5:4f:d2: 4d:2e:7a:31:a5:50:53:ba:eb:31:7b:78:9f:f4:43:f1:e5:54: 4f:59:dc:ba -----BEGIN CERTIFICATE----- MIIDXzCCAkegAwIBAgIBAzANBgkqhkiG9w0BAQsFADBPMQswCQYDVQQGEwJVUzET MBEGA1UECAwKQ2FsaWZvcm5pYTERMA8GA1UECgwITTJDcnlwdG8xGDAWBgNVBAMM D0hlaWtraSBUb2l2b25lbjAeFw0xODEwMDcxNTEyMDJaFw0yODEwMDQxNTEyMDJa MGkxCzAJBgNVBAYTAlVTMRMwEQYDVQQIDApDYWxpZm9ybmlhMREwDwYDVQQKDAhN MkNyeXB0bzEPMA0GA1UEAwwGU2lnbmVyMSEwHwYJKoZIhvcNAQkBFhJzaWduZXJA ZXhhbXBsZS5jb20wggEiMA0GCSqGSIb3DQEBAQUAA4IBDwAwggEKAoIBAQDIhYY9 cqqR2HsRAgWStxu/nzW+iFbblvJwPpg8w2JC/1R0emPnqUyuUkiiT6vFax3eObjw iTYV93A9qKbDST4Q2K66zxrm3QvYzdkA6lfyfC5tiYCVaLH9BrzqukTB+iCHV9Os 5bRduk8QIIJbGyd1swzOT3k/SY7juhQwz4qCEWVZeHtBFkPo6n+kYFJGk1NO3oc/ UIpWxdMEXDyi07Bk2M4eda3OzZGxWMwtptzatbLCDi9odKelbmFMAfLQfYNmeGaf uYczzFncA4Jvu5gM6RBjEu7pBcFbmH6UZZjfMb9ZkPAcbKwsG92QcasRlYuc9yov wA8tschaZdapNESBAgMBAAGjLDAqMAkGA1UdEwQCMAAwHQYDVR0OBBYEFGgDMyfZ h5rqfUHYLev57qvJasX6MA0GCSqGSIb3DQEBCwUAA4IBAQBHJ2JtQ/P2hwqPH/FL K2cFEYWxE2nK3h5vj3iutbd1yoTzWCadxQsOTOnOHF1pA27XLogodXjFVDfmcE+P kvtfzsKzo3R35sOUq8bSabvd2BadNirRweENgdqWn/GupLlzFrGYtflqTIsIMMPW MTp54u9/209vE/iY1rIEcsMDsv9jrc5OjZU3ptxSXlwmNZ8Ufp2gBEYA/1KU8St1 HFLweetBqDmiWmPM3nDNgnJ3HXfhPf84hi0ST6tMcjVpT61VHdqunQojSswqQNhO 9b0zTOu3R0GCKsn8ZA0zdgBhurZAyiSWXoTVT9JNLnoxpVBTuusxe3if9EPx5VRP Wdy6 -----END CERTIFICATE----- M2Crypto-0.31.0/tests/signer_key.pem0000644000175000001440000000321313356651321017541 0ustar matejusers00000000000000-----BEGIN RSA PRIVATE KEY----- MIIEowIBAAKCAQEAyIWGPXKqkdh7EQIFkrcbv581vohW25bycD6YPMNiQv9UdHpj 56lMrlJIok+rxWsd3jm48Ik2FfdwPaimw0k+ENiuus8a5t0L2M3ZAOpX8nwubYmA lWix/Qa86rpEwfogh1fTrOW0XbpPECCCWxsndbMMzk95P0mO47oUMM+KghFlWXh7 QRZD6Op/pGBSRpNTTt6HP1CKVsXTBFw8otOwZNjOHnWtzs2RsVjMLabc2rWywg4v aHSnpW5hTAHy0H2DZnhmn7mHM8xZ3AOCb7uYDOkQYxLu6QXBW5h+lGWY3zG/WZDw HGysLBvdkHGrEZWLnPcqL8APLbHIWmXWqTREgQIDAQABAoIBAFniSI9I1B62PEwe bOMcQ0r9EflLYivimOApntI1/tjrXS8tIZVZdW76oWZociX3YxcXJshjqSPlm6F3 9PC65yBkEMbaSUPNOB9B/pEDetLOSX1+Um4m1QoHuC07u9B7z5L7kn4BJX2SIxim iehO3rxKu2XLiB0PWwbHhX9vuLWeTTnozC5BjCpLe1/bj7j9L8llbyO+XyAwthJ6 ZdfF/pv7ERT3JUfGqhIm9u4aXTWC/6brVlXSUvrJ+9gKJtxUyz5i5+BD/xPU9Lvb H8/3CqSpEmoCtCXxTfs7MD1b9UTzJhldJZmTu7KWTLd+sARNmkaA729tUB+N4usd tbQSlAUCgYEA7sgYTl14iAvEkPjsd3ytH7BkizZr0w7/RQMilR8afyQENoNjkPx6 kYrjgPuuM9oWeIRbn0FruCKrc3lTS+ilym8k+UxUo3m8Fb662Rw+R6Alrrh1E2Y5 Ugic9U6kFvZmlf8tsdjVKCM6EqO0jvPDIrTbMyOwNbQDvNESXFBXDv8CgYEA1vsm T8Wh8qknLDCSoOUP/1QCyR/OvVczisvYlT054/vXluHWbRtrlcAOXlBUUrtgV/vP DETVAkEXPjiNbNsANENf0QZKhGBd8L8Orer0O6Bc8bsGTkFVMp/XWbAIpUFe7fOy Ot4sA4WpfuK0fKdRyBwG9s8FOw8n+usRpJiQLH8CgYAZ8uDBU2MP1ceMwaBg88mU kgS7JDTfgNe41jhh4Dlu66kRi4G8ddOUEXXbxH4P4Hlkq22Rhvh/0DS1nc+xhhzO PPnVpbfk9Au+iTWg9nLGMd8md6ExdIByK8Fy3xLx8+D+F/cNRrUTYZCkCepLRq5E DUds7Unu7Bsj38yQ/6IWXQKBgDbVYHRAaIpIcuFmkj/PrUDm4L8ECetpbpAcZmXK dBWeiuLFP7gcolhT4FZWDuv7Nxu58pmihOJKT+9i5U+6nFa4SJw8Co2xNsTNNqVN pHYA9TQDDByxtVVwR7FsoQfloJz456D0Qi2zzgO7N2YEF2v/GhehvifOOdhaVOmy sDNpAoGBAM/b+jI8eQGtNGbdRWkuHH2gRgmm1n900brEYlTWCHBSGePyghWJj3Uu oiuxsHV22CAUuOlDpOWeZUsNlpa+8dOBYAxZUvkH99y4jukNCCAKvFwI0MS+FUoW DKida/MnaVqE6+1KDC/l6LjXDAP1JcwS0PimBXMqVNYScb2q7eAl -----END RSA PRIVATE KEY----- M2Crypto-0.31.0/tests/te_chunked_response.txt0000644000175000001440000000014113355123234021460 0ustar matejusers00000000000000HTTP/1.1 200 ok Content-Type: text/plain Transfer-Encoding: chunked 4 foo 7 foobar 0 M2Crypto-0.31.0/tests/test_aes.py0000644000175000001440000000447513355123234017067 0ustar matejusers00000000000000#!/usr/bin/env python from __future__ import absolute_import, print_function """Unit tests for _aes.i. Copyright (c) 2018 Matej Cepl. All rights reserved. """ import logging from M2Crypto import m2 from tests import unittest log = logging.getLogger('test_AES') KEY_TEXT = (b'blabulka' * 3)[:16] # 128/8 == 16 class AESTestCase(unittest.TestCase): """ Functions in AES module are very low level, and you are HIGHLY encouraged NOT to use them. Use functions from EVP module instead. These tests are here only for checking regressions, not as an illustration for the real world use. """ def test_existing_methods(self): missing = [] exp_mtds = ('aes_128_cbc', 'aes_128_cfb', 'aes_128_ctr', 'aes_128_ecb', 'aes_128_ofb', 'aes_192_cbc', 'aes_192_cfb', 'aes_192_ctr', 'aes_192_ecb', 'aes_192_ofb', 'aes_256_cbc', 'aes_256_cfb', 'aes_256_ctr', 'aes_256_ecb', 'aes_256_ofb') for name in exp_mtds: if not hasattr(m2, name): missing.append(name) self.assertEqual(missing, []) def test_set_key(self): key = m2.aes_new() m2.AES_set_key(key, KEY_TEXT, 128, 1) m2.AES_free(key) key2 = m2.aes_new() m2.AES_set_key(key2, KEY_TEXT, 128, 0) m2.AES_free(key2) # Just to make sure nothing crashed def test_type_check(self): key = m2.aes_new() m2.AES_set_key(key, KEY_TEXT, 128, 1) res = m2.AES_type_check(key) m2.AES_free(key) self.assertEqual(res, 1) # Just to make sure nothing crashed def test_crypt(self): padded = b'zezulicka ' # len(padded) % 16 == 0 key = m2.aes_new() # op == 0: encrypt # otherwise: decrypt (Python code will supply the value 1.) m2.AES_set_key(key, KEY_TEXT, 128, 0) enc = m2.AES_crypt(key, padded, len(padded), 0) m2.AES_free(key) key2 = m2.aes_new() m2.AES_set_key(key2, KEY_TEXT, 128, 1) observed = m2.AES_crypt(key2, enc, len(enc), 1) m2.AES_free(key2) self.assertEqual(padded, observed) def suite(): t_suite = unittest.TestSuite() t_suite.addTest(unittest.makeSuite(AESTestCase)) return t_suite if __name__ == '__main__': unittest.main() M2Crypto-0.31.0/tests/test_asn1.py0000644000175000001440000001125713355123234017155 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.ASN1. Copyright (c) 2005 Open Source Applications Foundation. All rights reserved.""" import datetime import time from M2Crypto import ASN1, m2 from tests import unittest class ASN1TestCase(unittest.TestCase): def test_Integer(self): pass # XXX Dunno how to test def test_BitSTring(self): pass # XXX Dunno how to test def test_String(self): asn1ptr = m2.asn1_string_new() # FIXME this is probably wrong ... asn1_string_set should have # Python string as its parameter. text = b'hello there' # In RFC2253 format: # #040B68656C6C6F207468657265 # h e l l o t h e r e m2.asn1_string_set(asn1ptr, text) a = ASN1.ASN1_String(asn1ptr, 1) self.assertEqual(a.as_text(), 'hello there', a.as_text()) self.assertEqual(a.as_text(flags=m2.ASN1_STRFLGS_RFC2253), '#040B68656C6C6F207468657265', a.as_text(flags=m2.ASN1_STRFLGS_RFC2253)) self.assertEqual(a.as_text(), str(a)) def test_Object(self): pass # XXX Dunno how to test def test_TIME(self): asn1 = ASN1.ASN1_TIME() self.assertEqual(str(asn1), 'Bad time value') format = '%b %d %H:%M:%S %Y GMT' utcformat = '%y%m%d%H%M%SZ' s = '990807053011Z' asn1.set_string(s) # assert str(asn1) == 'Aug 7 05:30:11 1999 GMT' t1 = time.strptime(str(asn1), format) t2 = time.strptime(s, utcformat) self.assertEqual(t1, t2) asn1.set_time(500) # assert str(asn1) == 'Jan 1 00:08:20 1970 GMT' t1 = time.strftime(format, time.strptime(str(asn1), format)) t2 = time.strftime(format, time.gmtime(500)) self.assertEqual(t1, t2) t = int(time.time()) + time.timezone asn1.set_time(t) t1 = time.strftime(format, time.strptime(str(asn1), format)) t2 = time.strftime(format, time.gmtime(t)) self.assertEqual(t1, t2) def test_UTCTIME(self): asn1 = ASN1.ASN1_UTCTIME() self.assertEqual(str(asn1), 'Bad time value') format = '%b %d %H:%M:%S %Y GMT' utcformat = '%y%m%d%H%M%SZ' s = '990807053011Z' asn1.set_string(s) # assert str(asn1) == 'Aug 7 05:30:11 1999 GMT' t1 = time.strptime(str(asn1), format) t2 = time.strptime(s, utcformat) self.assertEqual(t1, t2) asn1.set_time(500) # assert str(asn1) == 'Jan 1 00:08:20 1970 GMT' t1 = time.strftime(format, time.strptime(str(asn1), format)) t2 = time.strftime(format, time.gmtime(500)) self.assertEqual(t1, t2) t = int(time.time()) + time.timezone asn1.set_time(t) t1 = time.strftime(format, time.strptime(str(asn1), format)) t2 = time.strftime(format, time.gmtime(t)) self.assertEqual(t1, t2) def test_TIME_datetime(self): asn1 = ASN1.ASN1_TIME() # Test get_datetime and set_datetime t = time.time() dt = datetime.datetime.fromtimestamp(int(t)) udt = dt.replace(tzinfo=ASN1.LocalTimezone()).astimezone(ASN1.UTC) asn1.set_time(int(t)) t1 = str(asn1) asn1.set_datetime(dt) t2 = str(asn1) self.assertEqual(t1, t2) self.assertEqual(str(udt), str(asn1.get_datetime())) dt = dt.replace(tzinfo=ASN1.LocalTimezone()) asn1.set_datetime(dt) t2 = str(asn1) self.assertEqual(t1, t2) self.assertEqual(str(udt), str(asn1.get_datetime())) dt = dt.astimezone(ASN1.UTC) asn1.set_datetime(dt) t2 = str(asn1) self.assertEqual(t1, t2) self.assertEqual(str(udt), str(asn1.get_datetime())) def test_UTCTIME_datetime(self): asn1 = ASN1.ASN1_UTCTIME() # Test get_datetime and set_datetime t = time.time() dt = datetime.datetime.fromtimestamp(int(t)) udt = dt.replace(tzinfo=ASN1.LocalTimezone()).astimezone(ASN1.UTC) asn1.set_time(int(t)) t1 = str(asn1) asn1.set_datetime(dt) t2 = str(asn1) self.assertEqual(t1, t2) self.assertEqual(str(udt), str(asn1.get_datetime())) dt = dt.replace(tzinfo=ASN1.LocalTimezone()) asn1.set_datetime(dt) t2 = str(asn1) self.assertEqual(t1, t2) self.assertEqual(str(udt), str(asn1.get_datetime())) dt = dt.astimezone(ASN1.UTC) asn1.set_datetime(dt) t2 = str(asn1) self.assertEqual(t1, t2) self.assertEqual(str(udt), str(asn1.get_datetime())) def suite(): return unittest.makeSuite(ASN1TestCase) if __name__ == '__main__': unittest.TextTestRunner().run(suite()) M2Crypto-0.31.0/tests/test_authcookie.py0000755000175000001440000001372013355123234020446 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.AuthCookie. Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" import logging import time from M2Crypto import EVP, Rand, six, util from M2Crypto.AuthCookie import AuthCookie, AuthCookieJar, mix, unmix, unmix3 from M2Crypto.six.moves.http_cookies import SimpleCookie # pylint: disable=no-name-in-module,import-error from tests import unittest log = logging.getLogger(__name__) class AuthCookieTestCase(unittest.TestCase): _format = 'Set-Cookie: _M2AUTH_="exp=%f&data=%s&digest=%s"' _token = '_M2AUTH_' def setUp(self): self.data = 'cogitoergosum' self.exp = time.time() + 3600 self.jar = AuthCookieJar() def tearDown(self): pass def _corrupt_part_str(self, s, fr, to): # type: (str, int, int) -> str out = s[:fr] + ''.join([chr(ord(x) + 13) for x in s[fr:to]]) + s[to:] self.assertNotEqual(s, out) return out def test_encode_part_str(self): a_str = 'a1b2c3d4e5f6h7i8j9' self.assertEqual(self._corrupt_part_str(a_str, 3, 5), 'a1b?p3d4e5f6h7i8j9') def test_mix_unmix(self): dough = mix(self.exp, self.data) exp, data = unmix(dough) self.assertEqual(data, self.data) # we are comparing seconds here, ten-thousandth # second should be enough. self.assertAlmostEqual(exp, self.exp, places=4) def test_make_cookie(self): c = self.jar.makeCookie(self.exp, self.data) self.assertTrue(isinstance(c, AuthCookie)) self.assertEqual(c.expiry(), self.exp) self.assertEqual(c.data(), self.data) # Peek inside the cookie jar... key = self.jar._key # pylint: disable=protected-access mac = util.bin_to_hex( EVP.hmac(key, six.ensure_binary(mix(self.exp, self.data)), 'sha1')) self.assertEqual(c.mac(), mac) # Ok, stop peeking now. cookie_str = self._format % (self.exp, self.data, mac) self.assertEqual(c.output(), cookie_str) def test_make_cookie_invalid(self): with self.assertRaises(ValueError): self.jar.makeCookie("complete nonsense", self.data) def test_expired(self): t = self.exp - 7200 c = self.jar.makeCookie(t, self.data) self.assertTrue(c.isExpired()) def test_not_expired(self): c = self.jar.makeCookie(self.exp, self.data) self.assertFalse(c.isExpired()) def test_is_valid(self): c = self.jar.makeCookie(self.exp, self.data) self.assertTrue(self.jar.isGoodCookie(c)) def test_is_invalid_expired(self): t = self.exp - 7200 c = self.jar.makeCookie(t, self.data) self.assertFalse(self.jar.isGoodCookie(c)) def test_is_invalid_changed_exp(self): c = self.jar.makeCookie(self.exp, self.data) c._expiry = 0 # pylint: disable=protected-access self.assertFalse(self.jar.isGoodCookie(c)) def test_is_invalid_changed_data(self): c = self.jar.makeCookie(self.exp, self.data) c._data = 'this is bad' # pylint: disable=protected-access self.assertFalse(self.jar.isGoodCookie(c)) def test_is_invalid_changed_mac(self): c = self.jar.makeCookie(self.exp, self.data) c._mac = 'this is bad' # pylint: disable=protected-access self.assertFalse(self.jar.isGoodCookie(c)) def test_mix_unmix3(self): c = self.jar.makeCookie(self.exp, self.data) s = SimpleCookie() s.load(c.output(header="")) exp, data, digest = unmix3(s[self._token].value) self.assertEqual(data, self.data) # see comment in test_mix_unmix self.assertAlmostEqual(exp, self.exp, places=4) key = self.jar._key # pylint: disable=protected-access mac = util.bin_to_hex( EVP.hmac(key, six.ensure_binary(mix(self.exp, self.data)), 'sha1')) self.assertEqual(digest, mac) def test_cookie_str(self): c = self.jar.makeCookie(self.exp, self.data) self.assertTrue(self.jar.isGoodCookieString(c.output(header=""))) def test_cookie_str2(self): c = self.jar.makeCookie(self.exp, self.data) s = SimpleCookie() s.load(c.output(header="")) self.assertTrue(self.jar.isGoodCookieString(s.output(header=""))) def test_cookie_str_expired(self): t = self.exp - 7200 c = self.jar.makeCookie(t, self.data) s = SimpleCookie() s.load(c.output(header="")) self.assertFalse(self.jar.isGoodCookieString(s.output(header=""))) def test_cookie_str_arbitrary_change(self): c = self.jar.makeCookie(self.exp, self.data) cout = c.output(header="") cout_str = cout[:20] + 'this is bad' + cout[20:] s = SimpleCookie() s.load(cout_str) self.assertFalse(self.jar.isGoodCookieString(s.output(header=""))) def test_cookie_str_changed_exp(self): c = self.jar.makeCookie(self.exp, self.data) cout = c.output(header="") cout_str = self._corrupt_part_str(cout, 14, 16) s = SimpleCookie() s.load(cout_str) self.assertFalse(self.jar.isGoodCookieString(s.output(header=""))) def test_cookie_str_changed_data(self): c = self.jar.makeCookie(self.exp, self.data) cout = c.output(header="") cout_str = self._corrupt_part_str(cout, 24, 26) s = SimpleCookie() s.load(cout_str) self.assertFalse(self.jar.isGoodCookieString(s.output(header=""))) def test_cookie_str_changed_mac(self): c = self.jar.makeCookie(self.exp, self.data) cout = c.output(header="") cout_str = self._corrupt_part_str(cout, 64, 66) s = SimpleCookie() s.load(cout_str) self.assertFalse(self.jar.isGoodCookieString(s.output(header=""))) def suite(): return unittest.makeSuite(AuthCookieTestCase) if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_bio.py0000644000175000001440000000570113355123234017061 0ustar matejusers00000000000000#!/usr/bin/env python from __future__ import absolute_import """ Unit tests for M2Crypto.BIO. Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved. Copyright (c) 2006 Open Source Applications Foundation Author: Heikki Toivonen """ import logging from M2Crypto import BIO, Rand from tests import unittest from tests.fips import fips_mode log = logging.getLogger('test_bio') class CipherStreamTestCase(unittest.TestCase): def try_algo(self, algo): data = b'123456789012345678901234' my_key = 3 * 15 * b"key" my_IV = 3 * 16 * b'IV' # Encrypt. mem = BIO.MemoryBuffer() cf = BIO.CipherStream(mem) cf.set_cipher(algo, my_key, my_IV, 1) cf.write(data) cf.flush() cf.write_close() cf.close() ciphertext = mem.read() # Decrypt. mem = BIO.MemoryBuffer(ciphertext) cf = BIO.CipherStream(mem) cf.set_cipher(algo, my_key, my_IV, 0) cf.write_close() data2 = cf.read() cf.close() self.assertFalse(cf.readable()) with self.assertRaises(IOError): cf.read() with self.assertRaises(IOError): cf.readline() with self.assertRaises(IOError): cf.readlines() self.assertEqual(data, data2, '%s algorithm cipher test failed' % algo) def test_ciphers(self): ciphers = [ 'des_ede_ecb', 'des_ede_cbc', 'des_ede_cfb', 'des_ede_ofb', 'des_ede3_ecb', 'des_ede3_cbc', 'des_ede3_cfb', 'des_ede3_ofb', 'aes_128_ecb', 'aes_128_cbc', 'aes_128_cfb', 'aes_128_ofb', 'aes_192_ecb', 'aes_192_cbc', 'aes_192_cfb', 'aes_192_ofb', 'aes_256_ecb', 'aes_256_cbc', 'aes_256_cfb', 'aes_256_ofb'] nonfips_ciphers = ['bf_ecb', 'bf_cbc', 'bf_cfb', 'bf_ofb', # 'idea_ecb', 'idea_cbc', 'idea_cfb', 'idea_ofb', 'cast5_ecb', 'cast5_cbc', 'cast5_cfb', 'cast5_ofb', # 'rc5_ecb', 'rc5_cbc', 'rc5_cfb', 'rc5_ofb', 'des_ecb', 'des_cbc', 'des_cfb', 'des_ofb', 'rc4', 'rc2_40_cbc'] if not fips_mode: # Forbidden ciphers ciphers += nonfips_ciphers failed_ciphers = [] log.debug('ciphers:\n%s', ciphers) for i in ciphers: try: self.try_algo(i) except AssertionError: failed_ciphers.append(i) self.assertEqual(len(failed_ciphers), 0, "failed ciphers: %s" % ', '.join(failed_ciphers)) with self.assertRaises(ValueError): self.try_algo('nosuchalgo4567') def suite(): t_suite = unittest.TestSuite() t_suite.addTest(unittest.makeSuite(CipherStreamTestCase)) return t_suite if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_bio_file.py0000644000175000001440000001010113355123234020046 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.BIO.File. Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" import logging import os import platform import tempfile import ctypes if platform.system() == 'Windows': import ctypes.wintypes from M2Crypto.BIO import File, openfile from tests import unittest log = logging.getLogger(__name__) def getCountProcHandles(): PROCESS_QUERY_INFORMATION = 0x400 handle = ctypes.windll.kernel32.OpenProcess( PROCESS_QUERY_INFORMATION, 0, os.getpid()) hndcnt = ctypes.wintypes.DWORD() ctypes.windll.kernel32.GetProcessHandleCount( handle, ctypes.byref(hndcnt)) sys_value = hndcnt.value ctypes.windll.kernel32.CloseHandle(handle) return sys_value + 1 class FileTestCase(unittest.TestCase): def setUp(self): self.data = b'abcdef' * 64 self.fd, self.fname = tempfile.mkstemp() if platform.system() in ['Linux', 'Darwin', 'FreeBSD']: self.__dev_fd = "/dev/fd/" self.fd_count = self.__mfd() def __mfd(self): if hasattr(self, '__dev_fd'): return len(os.listdir(self.__dev_fd)) elif platform.system() == 'Windows': return getCountProcHandles() else: return None def tearDown(self): self.assertEqual(self.fd_count, self.__mfd(), "last test did not close all file descriptors properly") try: os.close(self.fd) except OSError: pass def test_openfile_rb(self): # First create the file using Python's open(). with open(self.fname, 'wb') as f: f.write(self.data) # Now open the file using M2Crypto.BIO.openfile(). with openfile(self.fname, 'rb') as f: data = f.read(len(self.data)) self.assertEqual(data, self.data) def test_openfile_wb(self): # First create the file using M2Crypto.BIO.openfile(). with openfile(self.fname, 'wb') as f: f.write(self.data) # Now open the file using Python's open(). with open(self.fname, 'rb') as f: data = f.read(len(self.data)) self.assertEqual(data, self.data) def test_closed(self): f = openfile(self.fname, 'wb') f.write(self.data) f.close() with self.assertRaises(IOError): f.write(self.data) def test_use_pyfile(self): # First create the file. with open(self.fname, 'wb') as f: f2 = File(f) f2.write(self.data) f2.close() # Now read the file. with open(self.fname, 'rb') as f: in_data = f.read(len(self.data)) self.assertEqual(len(in_data), len(self.data)) self.assertEqual(in_data, self.data) def test_readline_bin(self): with open(self.fname, 'wb') as f: f.write(b'hello\nworld\n') with openfile(self.fname, 'rb') as f: self.assertTrue(f.readable()) self.assertEqual(f.readline(), b'hello\n') self.assertEqual(f.readline(), b'world\n') with openfile(self.fname, 'rb') as f: self.assertEqual( f.readlines(), [b'hello\n', b'world\n']) def test_readline(self): sep = os.linesep.encode() with open(self.fname, 'w') as f: f.write('hello\nworld\n') with openfile(self.fname, 'rb') as f: self.assertTrue(f.readable()) self.assertEqual(f.readline(), b'hello' + sep) self.assertEqual(f.readline(), b'world' + sep) with openfile(self.fname, 'rb') as f: self.assertEqual( f.readlines(), [b'hello' + sep, b'world' + sep]) def test_tell_seek(self): with open(self.fname, 'w') as f: f.write('hello world') with openfile(self.fname, 'r') as f: # Seek absolute f.seek(6) self.assertEqual(f.tell(), 6) def suite(): return unittest.makeSuite(FileTestCase) if __name__ == '__main__': unittest.TextTestRunner().run(suite()) M2Crypto-0.31.0/tests/test_bio_iobuf.py0000644000175000001440000000447413355123234020253 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.BIO.IOBuffer. Copyright (c) 2000 Ng Pheng Siong. All rights reserved.""" from io import BytesIO from M2Crypto.BIO import IOBuffer, MemoryBuffer from tests import unittest class IOBufferTestCase(unittest.TestCase): def setUp(self): self._data = b'abcdef\n' self.data = self._data * 1024 def tearDown(self): pass def test_init_empty(self): mb = MemoryBuffer() io = IOBuffer(mb) out = io.read() self.assertEqual(out, b'') def test_init_something(self): mb = MemoryBuffer(self.data) io = IOBuffer(mb) out = io.read(len(self.data)) self.assertEqual(out, self.data) def test_read_less_than(self): chunk = len(self.data) - 7 mb = MemoryBuffer(self.data) io = IOBuffer(mb) out = io.read(chunk) self.assertEqual(out, self.data[:chunk]) def test_read_more_than(self): chunk = len(self.data) + 8 mb = MemoryBuffer(self.data) io = IOBuffer(mb) out = io.read(chunk) self.assertEqual(out, self.data) def test_readline(self): buf = BytesIO() mb = MemoryBuffer(self.data) io = IOBuffer(mb) while 1: out = io.readline() if not out: break buf.write(out) self.assertEqual(out, self._data) self.assertEqual(buf.getvalue(), self.data) def test_readlines(self): buf = BytesIO() mb = MemoryBuffer(self.data) io = IOBuffer(mb) lines = io.readlines() for line in lines: self.assertEqual(line, self._data) buf.write(line) self.assertEqual(buf.getvalue(), self.data) def test_closed(self): mb = MemoryBuffer(self.data) io = IOBuffer(mb) io.close() with self.assertRaises(IOError): io.write(self.data) assert not io.readable() and not io.writeable() def test_read_only(self): mb = MemoryBuffer(self.data) io = IOBuffer(mb, mode='r') with self.assertRaises(IOError): io.write(self.data) assert not io.writeable() def suite(): return unittest.makeSuite(IOBufferTestCase) if __name__ == '__main__': unittest.TextTestRunner().run(suite()) M2Crypto-0.31.0/tests/test_bio_membuf.py0000644000175000001440000000623513355123234020417 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.BIO.MemoryBuffer. Copyright (c) 2000 Ng Pheng Siong. All rights reserved.""" import os import multiprocessing from M2Crypto.BIO import MemoryBuffer from tests import unittest class TimeLimitExpired(Exception): pass def time_limit(timeout, func, exc_msg, *args, **kwargs): p = multiprocessing.Process(target=func) p.start() p.join(timeout) if p.is_alive(): p.terminate() raise TimeLimitExpired(exc_msg) class MemoryBufferTestCase(unittest.TestCase): def setUp(self): self.data = b'abcdef' * 64 def tearDown(self): pass def test_init_empty(self): mb = MemoryBuffer() self.assertEqual(len(mb), 0) out = mb.read() assert out is None def test_init_empty_cm(self): with MemoryBuffer() as mb: self.assertEqual(len(mb), 0) out = mb.read() assert out is None def test_init_something(self): mb = MemoryBuffer(self.data) self.assertEqual(len(mb), len(self.data)) out = mb.read() self.assertEqual(out, self.data) def test_init_something_result_bytes(self): mb = MemoryBuffer(self.data) self.assertEqual(len(mb), len(self.data)) out = mb.read() self.assertIsInstance(out, bytes) def test_init_something_cm(self): with MemoryBuffer(self.data) as mb: self.assertEqual(len(mb), len(self.data)) out = mb.read() self.assertEqual(out, self.data) def test_read_less_than(self): chunk = len(self.data) - 7 mb = MemoryBuffer(self.data) out = mb.read(chunk) self.assertEqual(out, self.data[:chunk]) self.assertEqual(len(mb), (len(self.data)) - chunk) def test_read_more_than(self): chunk = len(self.data) + 8 mb = MemoryBuffer(self.data) out = mb.read(chunk) self.assertEqual(out, self.data) self.assertEqual(len(mb), 0) def test_write_close(self): mb = MemoryBuffer(self.data) assert mb.writeable() mb.write_close() assert mb.readable() with self.assertRaises(IOError): mb.write(self.data) assert not mb.writeable() def test_closed(self): mb = MemoryBuffer(self.data) mb.close() with self.assertRaises(IOError): mb.write(self.data) assert mb.readable() and not mb.writeable() def test_readline(self): # test against possible endless loop # http://stackoverflow.com/questions/9280550/ timeout_secs = 10 time_limit(timeout_secs, run_test, 'The readline() should not timeout!') def run_test(*args, **kwargs): sep = os.linesep.encode() with MemoryBuffer(b'hello\nworld\n') as mb: assert mb.readable() assert mb.readline() == b'hello' + sep assert mb.readline() == b'world' + sep with MemoryBuffer(b'hello\nworld\n') as mb: assert mb.readlines() == [b'hello' + sep, b'world' + sep] def suite(): return unittest.makeSuite(MemoryBufferTestCase) if __name__ == '__main__': unittest.TextTestRunner().run(suite()) M2Crypto-0.31.0/tests/test_bio_ssl.py0000644000175000001440000001164113371123417017743 0ustar matejusers00000000000000#!/usr/bin/env python from __future__ import absolute_import, print_function """Unit tests for M2Crypto.BIO.File. Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" import socket import sys import threading from M2Crypto import BIO from M2Crypto import SSL from M2Crypto import Err from M2Crypto import Rand from M2Crypto import threading as m2threading from tests import unittest from tests.test_ssl import srv_host, allocate_srv_port class HandshakeClient(threading.Thread): def __init__(self, host, port): threading.Thread.__init__(self) self.host = host self.port = port def run(self): ctx = SSL.Context() ctx.load_cert_chain("tests/server.pem") conn = SSL.Connection(ctx) cipher_list = conn.get_cipher_list() sslbio = BIO.SSLBio() readbio = BIO.MemoryBuffer() writebio = BIO.MemoryBuffer() sslbio.set_ssl(conn) conn.set_bio(readbio, writebio) conn.set_connect_state() sock = socket.socket() sock.connect((self.host, self.port)) handshake_complete = False while not handshake_complete: ret = sslbio.do_handshake() if ret <= 0: if not sslbio.should_retry() or not sslbio.should_read(): err_string = Err.get_error() print(err_string) sys.exit("unrecoverable error in handshake - client") else: output_token = writebio.read() if output_token is not None: sock.sendall(output_token) else: input_token = sock.recv(1024) readbio.write(input_token) else: handshake_complete = True output_token = writebio.read() if output_token is not None: sock.sendall(output_token) sock.close() class SSLTestCase(unittest.TestCase): def setUp(self): self.sslbio = BIO.SSLBio() def test_pass(self): # XXX leaks 64/24 bytes pass def test_set_ssl(self): # XXX leaks 64/1312 bytes ctx = SSL.Context() conn = SSL.Connection(ctx) self.sslbio.set_ssl(conn) def test_do_handshake_fail(self): # XXX leaks 64/42066 bytes ctx = SSL.Context() conn = SSL.Connection(ctx) conn.set_connect_state() self.sslbio.set_ssl(conn) ret = self.sslbio.do_handshake() self.assertIn(ret, (-1, 0)) def test_should_retry_fail(self): # XXX leaks 64/1312 bytes ctx = SSL.Context() conn = SSL.Connection(ctx) self.sslbio.set_ssl(conn) ret = self.sslbio.do_handshake() self.assertIn(ret, (-1, 0)) ret = self.sslbio.should_retry() self.assertEqual(ret, 0) def test_should_write_fail(self): # XXX leaks 64/1312 bytes ctx = SSL.Context() conn = SSL.Connection(ctx) self.sslbio.set_ssl(conn) ret = self.sslbio.do_handshake() self.assertIn(ret, (-1, 0)) ret = self.sslbio.should_write() self.assertEqual(ret, 0) def test_should_read_fail(self): # XXX leaks 64/1312 bytes ctx = SSL.Context() conn = SSL.Connection(ctx) self.sslbio.set_ssl(conn) ret = self.sslbio.do_handshake() self.assertIn(ret, (-1, 0)) ret = self.sslbio.should_read() self.assertEqual(ret, 0) def test_do_handshake_succeed(self): # XXX leaks 196/26586 bytes ctx = SSL.Context() ctx.load_cert_chain("tests/server.pem") conn = SSL.Connection(ctx) self.sslbio.set_ssl(conn) readbio = BIO.MemoryBuffer() writebio = BIO.MemoryBuffer() conn.set_bio(readbio, writebio) conn.set_accept_state() handshake_complete = False srv_port = allocate_srv_port() sock = socket.socket() sock.bind((srv_host, srv_port)) sock.listen(5) handshake_client = HandshakeClient(srv_host, srv_port) handshake_client.start() new_sock, _ = sock.accept() while not handshake_complete: input_token = new_sock.recv(1024) readbio.write(input_token) ret = self.sslbio.do_handshake() if ret <= 0: if not self.sslbio.should_retry() or not self.sslbio.should_read(): sys.exit("unrecoverable error in handshake - server") else: handshake_complete = True output_token = writebio.read() if output_token is not None: new_sock.sendall(output_token) handshake_client.join() sock.close() new_sock.close() def suite(): return unittest.makeSuite(SSLTestCase) if __name__ == '__main__': Rand.load_file('randpool.dat', -1) m2threading.init() unittest.TextTestRunner().run(suite()) m2threading.cleanup() Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_bn.py0000644000175000001440000000374513355123234016715 0ustar matejusers00000000000000#!/usr/bin/env python """ Unit tests for M2Crypto.BN. Copyright (c) 2005 Open Source Applications Foundation. All rights reserved. """ import re import warnings from M2Crypto import BN, Rand from tests import unittest loops = 16 class BNTestCase(unittest.TestCase): def test_rand(self): # defaults for x in range(loops): r8 = BN.rand(8) # top for x in range(loops): r8 = BN.rand(8, top=0) assert r8 & 128 for x in range(loops): r8 = BN.rand(8, top=1) assert r8 & 192 # bottom for x in range(loops): r8 = BN.rand(8, bottom=1) assert r8 % 2 == 1 # make sure we can get big numbers and work with them for x in range(loops): r8 = BN.rand(8, top=0) r16 = BN.rand(16, top=0) r32 = BN.rand(32, top=0) r64 = BN.rand(64, top=0) r128 = BN.rand(128, top=0) r256 = BN.rand(256, top=0) r512 = BN.rand(512, top=0) assert r8 < r16 < r32 < r64 < r128 < r256 < r512 < (r512 + 1) def test_rand_range(self): # small range for x in range(loops): r = BN.rand_range(1) self.assertEqual(r, 0) for x in range(loops): r = BN.rand_range(4) assert 0 <= r < 4 # large range r512 = BN.rand(512, top=0) for x in range(loops): r = BN.rand_range(r512) assert 0 <= r < r512 def test_randfname(self): m = re.compile('^[a-zA-Z0-9]{8}$') for x in range(loops): with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) r = BN.randfname(8) assert m.match(r) def suite(): return unittest.makeSuite(BNTestCase) if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_dh.py0000644000175000001440000000342213355123234016701 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.DH. Copyright (c) 2000 Ng Pheng Siong. All rights reserved.""" from M2Crypto import DH, BIO, Rand from tests import unittest class DHTestCase(unittest.TestCase): params = 'tests/dhparam.pem' def genparam_callback(self, *args): pass def genparam_callback2(self): pass def test_init_junk(self): with self.assertRaises(TypeError): DH.DH('junk') def test_gen_params(self): a = DH.gen_params(1024, 2, self.genparam_callback) self.assertEqual(a.check_params(), 0) def test_gen_params_bad_cb(self): a = DH.gen_params(1024, 2, self.genparam_callback2) self.assertEqual(a.check_params(), 0) def test_print_params(self): a = DH.gen_params(1024, 2, self.genparam_callback) bio = BIO.MemoryBuffer() a.print_params(bio) params = bio.read() self.assertTrue(params.find(b'(1024 bit)')) self.assertTrue(params.find(b'generator: 2 (0x2)')) def test_load_params(self): a = DH.load_params('tests/dhparams.pem') self.assertEqual(a.check_params(), 0) def test_compute_key(self): a = DH.load_params('tests/dhparams.pem') b = DH.set_params(a.p, a.g) a.gen_key() b.gen_key() ak = a.compute_key(b.pub) bk = b.compute_key(a.pub) self.assertEqual(ak, bk) self.assertEqual(len(a), 128) with self.assertRaises(DH.DHError): setattr(a, 'p', 1) with self.assertRaises(DH.DHError): setattr(a, 'priv', 1) def suite(): return unittest.makeSuite(DHTestCase) if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_dsa.py0000644000175000001440000000701413355123234017056 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.DSA. Copyright (c) 2000 Ng Pheng Siong. All rights reserved.""" import hashlib from M2Crypto import DSA, Rand from tests import unittest class DSATestCase(unittest.TestCase): errkey = 'tests/rsa.priv.pem' privkey = 'tests/dsa.priv.pem' pubkey = 'tests/dsa.pub.pem' param = 'tests/dsa.param.pem' data = hashlib.sha1(b'Can you spell subliminal channel?').digest() different_data = hashlib.sha1(b'I can spell.').digest() def callback(self, *args): pass def test_loadkey_junk(self): with self.assertRaises(DSA.DSAError): DSA.load_key(self.errkey) def test_loadkey(self): dsa = DSA.load_key(self.privkey) self.assertEqual(len(dsa), 1024) with self.assertRaises(AttributeError): getattr(dsa, 'foobar') for k in ('p', 'q', 'g', 'priv', 'pub'): with self.assertRaises(DSA.DSAError): setattr(dsa, k, 1) def test_loadparam(self): with self.assertRaises(DSA.DSAError): DSA.load_key(self.param) dsa = DSA.load_params(self.param) assert not dsa.check_key() self.assertEqual(len(dsa), 1024) def test_sign(self): dsa = DSA.load_key(self.privkey) assert dsa.check_key() r, s = dsa.sign(self.data) assert dsa.verify(self.data, r, s) assert not dsa.verify(self.data, s, r) def test_sign_asn1(self): dsa = DSA.load_key(self.privkey) blob = dsa.sign_asn1(self.data) assert dsa.verify_asn1(self.data, blob) def test_sign_with_params_only(self): dsa = DSA.load_params(self.param) with self.assertRaises(AssertionError): dsa.sign(self.data) with self.assertRaises(AssertionError): dsa.sign_asn1(self.data) def test_pub_verify(self): dsa = DSA.load_key(self.privkey) r, s = dsa.sign(self.data) dsapub = DSA.load_pub_key(self.pubkey) assert dsapub.check_key() assert dsapub.verify(self.data, r, s) with self.assertRaises(DSA.DSAError): dsapub.sign() def test_verify_fail(self): dsa = DSA.load_key(self.privkey) r, s = dsa.sign(self.data) assert not dsa.verify(self.different_data, r, s) def test_verify_fail2(self): dsa = DSA.load_key(self.privkey) r, s = dsa.sign(self.data) dsa2 = DSA.load_params(self.param) assert not dsa2.check_key() with self.assertRaises(AssertionError): dsa2.verify(self.data, r, s) def test_genparam_setparam_genkey(self): dsa = DSA.gen_params(1024, self.callback) self.assertEqual(len(dsa), 1024) p = dsa.p q = dsa.q g = dsa.g dsa2 = DSA.set_params(p, q, g) assert not dsa2.check_key() dsa2.gen_key() assert dsa2.check_key() r, s = dsa2.sign(self.data) assert dsa2.verify(self.data, r, s) def test_pub_key_from_params(self): dsa = DSA.gen_params(1024, self.callback) dsa.gen_key() assert len(dsa) == 1024 p = dsa.p q = dsa.q g = dsa.g pub = dsa.pub dsa2 = DSA.pub_key_from_params(p, q, g, pub) assert dsa2.check_key() r, s = dsa.sign(self.data) assert dsa2.verify(self.data, r, s) def suite(): return unittest.makeSuite(DSATestCase) if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_ec_curves.py0000644000175000001440000001135713355123234020272 0ustar matejusers00000000000000#!/usr/bin/env python # XXX memory leaks from __future__ import absolute_import """ Unit tests for M2Crypto.EC, the curves There are several ways one could unittest elliptical curves but we are going to only validate that we are using the OpenSSL curve and that it works with ECDSA. We will assume OpenSSL has validated the curves themselves. Also, some curves are shorter than a SHA-1 digest of 160 bits. To keep the testing simple, we will take advantage of ECDSA's ability to sign any digest length and create a digset string of only 48 bits. Remember we are testing our ability to access the curve, not ECDSA itself. Copyright (c) 2006 Larry Bugbee. All rights reserved. """ import logging from M2Crypto import EC, Rand, m2 # noqa from tests import unittest log = logging.getLogger(__name__) curves = { 'secp112r1': 112, 'secp112r2': 112, 'secp128r1': 128, 'secp128r2': 128, 'secp160k1': 160, 'secp160r1': 160, 'secp160r2': 160, 'secp192k1': 192, 'secp224k1': 224, 'secp224r1': 224, 'secp256k1': 256, 'secp384r1': 384, 'secp521r1': 521, 'sect113r1': 113, 'sect113r2': 113, 'sect131r1': 131, 'sect131r2': 131, 'sect163k1': 163, 'sect163r1': 163, 'sect163r2': 163, 'sect193r1': 193, 'sect193r2': 193, 'sect233k1': 233, 'sect233r1': 233, 'sect239k1': 239, 'sect283k1': 283, 'sect283r1': 283, 'sect409k1': 409, 'sect409r1': 409, 'sect571k1': 571, 'sect571r1': 571, 'X9_62_prime192v1': 192, 'X9_62_prime192v2': 192, 'X9_62_prime192v3': 192, 'X9_62_prime239v1': 239, 'X9_62_prime239v2': 239, 'X9_62_prime239v3': 239, 'X9_62_prime256v1': 256, 'X9_62_c2pnb163v1': 163, 'X9_62_c2pnb163v2': 163, 'X9_62_c2pnb163v3': 163, 'X9_62_c2pnb176v1': 176, 'X9_62_c2tnb191v1': 191, 'X9_62_c2tnb191v2': 191, 'X9_62_c2tnb191v3': 191, 'X9_62_c2pnb208w1': 208, 'X9_62_c2tnb239v1': 239, 'X9_62_c2tnb239v2': 239, 'X9_62_c2tnb239v3': 239, 'X9_62_c2pnb272w1': 272, 'X9_62_c2pnb304w1': 304, 'X9_62_c2tnb359v1': 359, 'X9_62_c2pnb368w1': 368, 'X9_62_c2tnb431r1': 431, 'wap_wsg_idm_ecid_wtls1': 113, 'wap_wsg_idm_ecid_wtls3': 163, 'wap_wsg_idm_ecid_wtls4': 113, 'wap_wsg_idm_ecid_wtls5': 163, 'wap_wsg_idm_ecid_wtls6': 112, 'wap_wsg_idm_ecid_wtls7': 160, 'wap_wsg_idm_ecid_wtls8': 112, 'wap_wsg_idm_ecid_wtls9': 160, 'wap_wsg_idm_ecid_wtls10': 233, 'wap_wsg_idm_ecid_wtls11': 233, 'wap_wsg_idm_ecid_wtls12': 224 } # The following two curves, according to OpenSSL, have a # "Questionable extension field!" and are not supported by # the OpenSSL inverse function. ECError: no inverse. # As such they cannot be used for signing. They might, # however, be usable for encryption but that has not # been tested. Until thir usefulness can be established, # they are not supported at this time. # curves2 = [ # ('ipsec3', 155), # ('ipsec4', 185), # ] def available_curves(): bc_dict = EC.get_builtin_curves() bin_curves = set(x['sname'] for x in bc_dict) out_curves = tuple((m2.obj_sn2nid(x[0]), x[1]) for x in curves if x[0] in bin_curves) return out_curves # Seems like one of the most widely supported curves. tested_curve = EC.NID_secp384r1, curves['secp384r1'] class ECCurveTests(unittest.TestCase): data = "digest" def genkey(self, curve): try: curve_name = m2.obj_nid2sn(curve[0]) except TypeError: # we have to throw different exception for compatibility raise AttributeError('Unknown cipher %s', curve[0]) ec = EC.gen_params(curve[0]) self.assertEqual(len(ec), curve[1]) ec.gen_key() self.assertTrue(ec.check_key(), 'check_key() failure for "%s"' % curve_name) return ec def sign_verify_ecdsa(self, curve): ec = self.genkey(curve) r, s = ec.sign_dsa(self.data) self.assertTrue(ec.verify_dsa(self.data, r, s)) self.assertFalse(ec.verify_dsa(self.data, s, r)) def test_ec_curves_ECDSA(self): # noqa for curve in available_curves(): self.sign_verify_ecdsa(curve) with self.assertRaises(AttributeError): self.sign_verify_ecdsa(('nosuchcurve', 1)) def test_ec_get_builtin_curves(self): curves = EC.get_builtin_curves() self.assertNotEqual(curves, []) self.assertIsNotNone(curves) def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(ECCurveTests)) return suite if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_ecdh.py0000644000175000001440000000242213355123234017210 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.EC, ECDH part. Copyright (c) 2000 Ng Pheng Siong. All rights reserved. Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam. All rights reserved. """ from M2Crypto import EC, Rand from tests import unittest from tests.test_ec_curves import tested_curve class ECDHTestCase(unittest.TestCase): privkey = 'tests/ec.priv.pem' def test_init_junk(self): with self.assertRaises(TypeError): EC.EC('junk') def test_compute_key(self): a = EC.load_key(self.privkey) b = EC.gen_params(tested_curve[0]) b.gen_key() ak = a.compute_dh_key(b.pub()) bk = b.compute_dh_key(a.pub()) self.assertEqual(ak, bk) def test_pubkey_from_der(self): a = EC.gen_params(tested_curve[0]) a.gen_key() b = EC.gen_params(tested_curve[0]) b.gen_key() a_pub_der = a.pub().get_der() a_pub = EC.pub_key_from_der(a_pub_der) ak = a.compute_dh_key(b.pub()) bk = b.compute_dh_key(a_pub) self.assertEqual(ak, bk) def suite(): return unittest.makeSuite(ECDHTestCase) if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_ecdsa.py0000644000175000001440000000520613355123234017367 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.EC, ECDSA part. Copyright (c) 2000 Ng Pheng Siong. All rights reserved. Portions copyright (c) 2005-2006 Vrije Universiteit Amsterdam. All rights reserved. """ import hashlib import logging from M2Crypto import EC, Rand from tests import unittest from tests.test_ec_curves import tested_curve log = logging.getLogger(__name__) class ECDSATestCase(unittest.TestCase): errkey = 'tests/rsa.priv.pem' privkey = 'tests/ec.priv.pem' pubkey = 'tests/ec.pub.pem' data = hashlib.sha1(b'Can you spell subliminal channel?').digest() def callback(self, *args): pass def callback2(self): pass def test_loadkey_junk(self): with self.assertRaises(ValueError): EC.load_key(self.errkey) def test_loadkey(self): ec = EC.load_key(self.privkey) self.assertEqual(len(ec), tested_curve[1]) def test_loadpubkey(self): # XXX more work needed ec = EC.load_pub_key(self.pubkey) self.assertEqual(len(ec), tested_curve[1]) with self.assertRaises(EC.ECError): EC.load_pub_key(self.errkey) def _test_sign_dsa(self): ec = EC.gen_params(tested_curve[0]) # ec.gen_key() with self.assertRaises(EC.ECError): ec.sign_dsa(self.data) ec = EC.load_key(self.privkey) r, s = ec.sign_dsa(self.data) assert ec.verify_dsa(self.data, r, s) assert not ec.verify_dsa(self.data, s, r) def test_sign_dsa_asn1(self): ec = EC.load_key(self.privkey) blob = ec.sign_dsa_asn1(self.data) assert ec.verify_dsa_asn1(self.data, blob) with self.assertRaises(EC.ECError): ec.verify_dsa_asn1(blob, self.data) def test_verify_dsa(self): ec = EC.load_key(self.privkey) r, s = ec.sign_dsa(self.data) ec2 = EC.load_pub_key(self.pubkey) assert ec2.verify_dsa(self.data, r, s) assert not ec2.verify_dsa(self.data, s, r) def test_genparam(self): ec = EC.gen_params(tested_curve[0]) self.assertEqual(len(ec), tested_curve[1]) def test_pub_key_from_params(self): curve = EC.NID_prime256v1 ec = EC.gen_params(curve) ec.gen_key() ec_pub = ec.pub() k = ec_pub.get_key() ec2 = EC.pub_key_from_params(curve, k) assert ec2.check_key() r, s = ec.sign_dsa(self.data) assert ec2.verify_dsa(self.data, r, s) def suite(): return unittest.makeSuite(ECDSATestCase) if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_engine.py0000644000175000001440000000275613355123234017564 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.Engine.""" from M2Crypto import Engine from tests import unittest class EngineTestCase(unittest.TestCase): privkey = 'tests/rsa.priv.pem' bad_id = '1bea1edfeb97' def tearDown(self): Engine.cleanup() def test_by_id_junk(self): with self.assertRaises(ValueError): Engine.Engine(self.bad_id) with self.assertRaises(ValueError): Engine.Engine() def test_by_id_openssl(self): Engine.load_openssl() e = Engine.Engine('openssl') self.assertEqual(e.get_name(), 'Software engine support') self.assertEqual(e.get_id(), 'openssl') def test_by_id_dynamic(self): Engine.load_dynamic() Engine.Engine('dynamic') def test_engine_ctrl_cmd_string(self): Engine.load_dynamic() e = Engine.Engine('dynamic') e.ctrl_cmd_string('ID', 'TESTID') def test_load_private(self): Engine.load_openssl() e = Engine.Engine('openssl') e.set_default() e.load_private_key(self.privkey) def test_load_certificate(self): Engine.load_openssl() e = Engine.Engine('openssl') e.set_default() try: with self.assertRaises(Engine.EngineError): e.load_certificate('/dev/null') except SystemError: pass def suite(): return unittest.makeSuite(EngineTestCase) if __name__ == '__main__': unittest.TextTestRunner().run(suite()) M2Crypto-0.31.0/tests/test_evp.py0000644000175000001440000006040313371123417017103 0ustar matejusers00000000000000from __future__ import absolute_import, division """ Unit tests for M2Crypto.EVP. Copyright (c) 2004-2007 Open Source Applications Foundation Author: Heikki Toivonen """ import base64 import hashlib import io import logging from binascii import a2b_hex, hexlify, unhexlify from M2Crypto import BIO, EVP, RSA, Rand, m2, util from tests import unittest from tests.fips import fips_mode log = logging.getLogger('test_EVP') class EVPTestCase(unittest.TestCase): def _gen_callback(self, *args): pass def _pass_callback(self, *args): return b'foobar' def _assign_rsa(self): rsa = RSA.gen_key(1024, 3, callback=self._gen_callback) pkey = EVP.PKey() pkey.assign_rsa(rsa, capture=0) # capture=1 should cause crash return rsa def test_assign(self): rsa = self._assign_rsa() rsa.check_key() def test_pem(self): rsa = RSA.gen_key(1024, 3, callback=self._gen_callback) pkey = EVP.PKey() pkey.assign_rsa(rsa) result_w_callback = pkey.as_pem(callback=self._pass_callback) result_wo_callback = pkey.as_pem(cipher=None) self.assertNotEqual(result_w_callback, result_wo_callback) with self.assertRaises(ValueError): pkey.as_pem(cipher='noXX$$%%suchcipher', callback=self._pass_callback) def test_as_der(self): """ Test DER encoding the PKey instance after assigning a RSA key to it. """ rsa = RSA.gen_key(1024, 3, callback=self._gen_callback) pkey = EVP.PKey() pkey.assign_rsa(rsa) der_blob = pkey.as_der() # A quick but not thorough sanity check self.assertEqual(len(der_blob), 160) def test_get_digestbyname(self): with self.assertRaises(EVP.EVPError): m2.get_digestbyname('sha513') self.assertNotEqual(m2.get_digestbyname('sha1'), None) def test_MessageDigest(self): # noqa with self.assertRaises(ValueError): EVP.MessageDigest('sha513') md = EVP.MessageDigest('sha1') self.assertEqual(md.update(b'Hello'), 1) self.assertEqual(util.octx_to_num(md.final()), 1415821221623963719413415453263690387336440359920) # temporarily remove sha1 from m2 old_sha1 = m2.sha1 del m2.sha1 # now run the same test again, relying on EVP.MessageDigest() to call # get_digestbyname() under the hood md = EVP.MessageDigest('sha1') self.assertEqual(md.update(b'Hello'), 1) self.assertEqual(util.octx_to_num(md.final()), 1415821221623963719413415453263690387336440359920) # put sha1 back in place m2.sha1 = old_sha1 def test_as_der_capture_key(self): """ Test DER encoding the PKey instance after assigning a RSA key to it. Have the PKey instance capture the RSA key. """ rsa = RSA.gen_key(1024, 3, callback=self._gen_callback) pkey = EVP.PKey() pkey.assign_rsa(rsa, 1) der_blob = pkey.as_der() # A quick but not thorough sanity check self.assertEqual(len(der_blob), 160) def test_size(self): rsa = RSA.gen_key(1024, 3, callback=self._gen_callback) pkey = EVP.PKey() pkey.assign_rsa(rsa) size = pkey.size() self.assertEqual(size, 128) def test_hmac(self): self.assertEqual(util.octx_to_num(EVP.hmac(b'key', b'data')), 92800611269186718152770431077867383126636491933, util.octx_to_num(EVP.hmac(b'key', b'data'))) if not fips_mode: # Disabled algorithms self.assertEqual(util.octx_to_num(EVP.hmac(b'key', b'data', algo='md5')), 209168838103121722341657216703105225176, util.octx_to_num(EVP.hmac(b'key', b'data', algo='md5'))) self.assertEqual(util.octx_to_num(EVP.hmac(b'key', b'data', algo='ripemd160')), 1176807136224664126629105846386432860355826868536, util.octx_to_num(EVP.hmac(b'key', b'data', algo='ripemd160'))) if m2.OPENSSL_VERSION_NUMBER >= 0x90800F: self.assertEqual(util.octx_to_num(EVP.hmac(b'key', b'data', algo='sha224')), 2660082265842109788381286338540662430962855478412025487066970872635, util.octx_to_num(EVP.hmac(b'key', b'data', algo='sha224'))) self.assertEqual(util.octx_to_num(EVP.hmac(b'key', b'data', algo='sha256')), 36273358097036101702192658888336808701031275731906771612800928188662823394256, util.octx_to_num(EVP.hmac(b'key', b'data', algo='sha256'))) self.assertEqual(util.octx_to_num(EVP.hmac(b'key', b'data', algo='sha384')), 30471069101236165765942696708481556386452105164815350204559050657318908408184002707969468421951222432574647369766282, util.octx_to_num(EVP.hmac(b'key', b'data', algo='sha384'))) self.assertEqual(util.octx_to_num(EVP.hmac(b'key', b'data', algo='sha512')), 3160730054100700080556942280820129108466291087966635156623014063982211353635774277148932854680195471287740489442390820077884317620321797003323909388868696, util.octx_to_num(EVP.hmac(b'key', b'data', algo='sha512'))) with self.assertRaises(ValueError): EVP.hmac(b'key', b'data', algo='sha513') def test_get_rsa(self): """ Testing retrieving the RSA key from the PKey instance. """ rsa = RSA.gen_key(1024, 3, callback=self._gen_callback) self.assertIsInstance(rsa, RSA.RSA) pkey = EVP.PKey() pkey.assign_rsa(rsa) rsa2 = pkey.get_rsa() self.assertIsInstance(rsa2, RSA.RSA_pub) self.assertEqual(rsa.e, rsa2.e) self.assertEqual(rsa.n, rsa2.n) # FIXME # hanging call is # m2.rsa_write_key(self.rsa, bio._ptr(), ciph, callback)s # from RSA.py/save_key_bio pem = rsa.as_pem(callback=self._pass_callback) pem2 = rsa2.as_pem() assert pem assert pem2 self.assertNotEqual(pem, pem2) message = b'This is the message string' digest = hashlib.sha1(message).digest() self.assertEqual(rsa.sign(digest), rsa2.sign(digest)) rsa3 = RSA.gen_key(1024, 3, callback=self._gen_callback) self.assertNotEqual(rsa.sign(digest), rsa3.sign(digest)) def test_load_key_string_pubkey(self): """ Testing creating a PKey instance from PEM string. """ rsa = RSA.gen_key(1024, 3, callback=self._gen_callback) self.assertIsInstance(rsa, RSA.RSA) rsa_pem = BIO.MemoryBuffer() rsa.save_pub_key_bio(rsa_pem) pkey = EVP.load_key_string_pubkey(rsa_pem.read()) rsa2 = pkey.get_rsa() self.assertIsInstance(rsa2, RSA.RSA_pub) self.assertEqual(rsa.e, rsa2.e) self.assertEqual(rsa.n, rsa2.n) pem = rsa.as_pem(callback=self._pass_callback) pem2 = rsa2.as_pem() assert pem assert pem2 self.assertNotEqual(pem, pem2) def test_get_rsa_fail(self): """ Testing trying to retrieve the RSA key from the PKey instance when it is not holding a RSA Key. Should raise a ValueError. """ pkey = EVP.PKey() with self.assertRaises(ValueError): pkey.get_rsa() def test_get_modulus(self): pkey = EVP.PKey() with self.assertRaises(ValueError): pkey.get_modulus() rsa = RSA.gen_key(1024, 3, callback=self._gen_callback) pkey.assign_rsa(rsa) mod = pkey.get_modulus() self.assertGreater(len(mod), 0, mod) self.assertEqual(len(mod.strip(b'0123456789ABCDEF')), 0) def test_verify_final(self): from M2Crypto import X509 pkey = EVP.load_key('tests/signer_key.pem') pkey.sign_init() pkey.sign_update(b'test message') sig = pkey.sign_final() # OK x509 = X509.load_cert('tests/signer.pem') pubkey = x509.get_pubkey() pubkey.verify_init() pubkey.verify_update(b'test message') self.assertEqual(pubkey.verify_final(sig), 1) # wrong cert x509 = X509.load_cert('tests/x509.pem') pubkey = x509.get_pubkey() pubkey.verify_init() pubkey.verify_update(b'test message') self.assertEqual(pubkey.verify_final(sig), 0) # wrong message x509 = X509.load_cert('tests/signer.pem') pubkey = x509.get_pubkey() pubkey.verify_init() pubkey.verify_update(b'test message not') self.assertEqual(pubkey.verify_final(sig), 0) def test_load_bad(self): with self.assertRaises(BIO.BIOError): EVP.load_key('thisdoesnotexist-dfgh56789') with self.assertRaises(EVP.EVPError): EVP.load_key('tests/signer.pem') # not a key with self.assertRaises(EVP.EVPError): EVP.load_key_bio(BIO.MemoryBuffer(b'no a key')) def test_pad(self): self.assertEqual(util.pkcs5_pad('Hello World'), 'Hello World\x05\x05\x05\x05\x05') self.assertEqual(util.pkcs7_pad('Hello World', 15), 'Hello World\x04\x04\x04\x04') with self.assertRaises(ValueError): util.pkcs7_pad('Hello', 256) def test_pkey_verify_crash(self): SIGN_PRIVATE = EVP.load_key('tests/rsa.priv.pem') SIGN_PUBLIC = RSA.load_pub_key('tests/rsa.pub.pem') def sign(data): SIGN_PRIVATE.sign_init() SIGN_PRIVATE.sign_update(data) signed_data = SIGN_PRIVATE.sign_final() return base64.b64encode(signed_data) def verify(response): signature = base64.b64decode(response['sign']) data = response['data'] verify_evp = EVP.PKey() # capture parameter on the following line is required by # the documentation verify_evp.assign_rsa(SIGN_PUBLIC, capture=False) verify_evp.verify_init() verify_evp.verify_update(data) # m2.verify_final(self.ctx, sign, self.pkey) fin_res = verify_evp.verify_final(signature) return fin_res == 1 data = b"test message" signature = sign(data) res = {"data": data, "sign": signature} self.assertTrue(verify(res)) # works fine self.assertTrue(verify(res)) # segmentation fault in *verify_final* class CipherTestCase(unittest.TestCase): def cipher_filter(self, cipher, inf, outf): while 1: buf = inf.read() if not buf: break outf.write(cipher.update(buf)) outf.write(cipher.final()) return outf.getvalue() def try_algo(self, algo): enc = 1 dec = 0 otxt = b'against stupidity the gods themselves contend in vain' k = EVP.Cipher(algo, b'goethe', b'12345678', enc, 1, 'sha1', b'saltsalt', 5) pbuf = io.BytesIO(otxt) cbuf = io.BytesIO() ctxt = self.cipher_filter(k, pbuf, cbuf) pbuf.close() cbuf.close() j = EVP.Cipher(algo, b'goethe', b'12345678', dec, 1, 'sha1', b'saltsalt', 5) pbuf = io.BytesIO() cbuf = io.BytesIO(ctxt) ptxt = self.cipher_filter(j, cbuf, pbuf) pbuf.close() cbuf.close() self.assertEqual(otxt, ptxt, '%s algorithm cipher test failed' % algo) def test_ciphers(self): ciphers = [ 'des_ede_ecb', 'des_ede_cbc', 'des_ede_cfb', 'des_ede_ofb', 'des_ede3_ecb', 'des_ede3_cbc', 'des_ede3_cfb', 'des_ede3_ofb', 'aes_128_ecb', 'aes_128_cbc', 'aes_128_cfb', 'aes_128_ofb', 'aes_128_ctr', 'aes_192_ecb', 'aes_192_cbc', 'aes_192_cfb', 'aes_192_ofb', 'aes_192_ctr', 'aes_256_ecb', 'aes_256_cbc', 'aes_256_cfb', 'aes_256_ofb', 'aes_256_ctr'] nonfips_ciphers = ['bf_ecb', 'bf_cbc', 'bf_cfb', 'bf_ofb', # 'idea_ecb', 'idea_cbc', 'idea_cfb', 'idea_ofb', 'cast5_ecb', 'cast5_cbc', 'cast5_cfb', 'cast5_ofb', # 'rc5_ecb', 'rc5_cbc', 'rc5_cfb', 'rc5_ofb', 'des_ecb', 'des_cbc', 'des_cfb', 'des_ofb', 'rc4', 'rc2_40_cbc'] if not fips_mode: # Disabled algorithms ciphers += nonfips_ciphers for i in ciphers: self.try_algo(i) # idea might not be compiled in ciphers = ['idea_ecb', 'idea_cbc', 'idea_cfb', 'idea_ofb'] try: for i in ciphers: self.try_algo(i) except ValueError as e: if str(e) != "('unknown cipher', 'idea_ecb')": raise # rc5 might not be compiled in ciphers = ['rc5_ecb', 'rc5_cbc', 'rc5_cfb', 'rc5_ofb'] try: for i in ciphers: self.try_algo(i) except ValueError as e: if str(e) != "('unknown cipher', 'rc5_ecb')": raise with self.assertRaises(ValueError): self.try_algo('nosuchalgo4567') def test_AES(self): # noqa enc = 1 dec = 0 tests = [ # test vectors from rfc 3602 # Case #1: Encrypting 16 bytes (1 block) using AES-CBC with # 128-bit key { 'KEY': '06a9214036b8a15b512e03d534120006', 'IV': '3dafba429d9eb430b422da802c9fac41', 'PT': b'Single block msg', 'CT': b'e353779c1079aeb82708942dbe77181a', }, # Case #2: Encrypting 32 bytes (2 blocks) using AES-CBC with # 128-bit key { 'KEY': 'c286696d887c9aa0611bbb3e2025a45a', 'IV': '562e17996d093d28ddb3ba695a2e6f58', 'PT': unhexlify(b'000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f'), 'CT': b'd296cd94c2cccf8a3a863028b5e1dc0a7586602d253cfff91b8266bea6d61ab1', }, # Case #3: Encrypting 48 bytes (3 blocks) using AES-CBC with # 128-bit key { 'KEY': '6c3ea0477630ce21a2ce334aa746c2cd', 'IV': 'c782dc4c098c66cbd9cd27d825682c81', 'PT': b'This is a 48-byte message (exactly 3 AES blocks)', 'CT': b'd0a02b3836451753d493665d33f0e8862dea54cdb293abc7506939276772f8d5021c19216bad525c8579695d83ba2684', }, ] # Test with padding for test in tests: # encrypt k = EVP.Cipher(alg='aes_128_cbc', key=unhexlify(test['KEY']), iv=unhexlify(test['IV']), op=enc) pbuf = io.BytesIO(test['PT']) cbuf = io.BytesIO() ciphertext = hexlify(self.cipher_filter(k, pbuf, cbuf)) cipherpadding = ciphertext[len(test['PT']) * 2:] # Remove the padding from the end ciphertext = ciphertext[:len(test['PT']) * 2] pbuf.close() cbuf.close() self.assertEqual(ciphertext, test['CT']) # decrypt j = EVP.Cipher(alg='aes_128_cbc', key=unhexlify(test['KEY']), iv=unhexlify(test['IV']), op=dec) pbuf = io.BytesIO() cbuf = io.BytesIO(unhexlify(test['CT'] + cipherpadding)) plaintext = self.cipher_filter(j, cbuf, pbuf) pbuf.close() cbuf.close() self.assertEqual(plaintext, test['PT']) # Test without padding for test in tests: # encrypt k = EVP.Cipher(alg='aes_128_cbc', key=unhexlify(test['KEY']), iv=unhexlify(test['IV']), op=enc, padding=False) pbuf = io.BytesIO(test['PT']) cbuf = io.BytesIO() ciphertext = hexlify(self.cipher_filter(k, pbuf, cbuf)) pbuf.close() cbuf.close() self.assertEqual(ciphertext, test['CT']) # decrypt j = EVP.Cipher(alg='aes_128_cbc', key=unhexlify(test['KEY']), iv=unhexlify(test['IV']), op=dec, padding=False) pbuf = io.BytesIO() cbuf = io.BytesIO(unhexlify(test['CT'])) plaintext = self.cipher_filter(j, cbuf, pbuf) pbuf.close() cbuf.close() self.assertEqual(plaintext, test['PT']) def test_AES_ctr(self): # noqa # In CTR mode, encrypt and decrypt are actually the same # operation because you encrypt the nonce value, then use the # output of that to XOR the plaintext. So we set operation=0, # even though this setting is ignored by OpenSSL. op = 0 nonce = unhexlify('4a45a048a1e9f7c1bd17f2908222b964') # CTR nonce value, 16 bytes key = unhexlify('8410ad66fe53a09addc0d041ae00bc6d70e8038ec17019f27e52eecd3846757e') plaintext_value = b'This is three blocks of text with unicode char \x03' ciphertext_values = { '128': unhexlify('6098fb2e49b3f7ed34f841f43f825d84cf4834021511594b931c85f04662544bdb4f38232e9d87fda6280ab1ef450e27'), # noqa '192': unhexlify('2299b1c5363824cb92b5851dedc73f49f30b23fb23f288492e840c951ce703292a5c6de6fc7f0625c403648f8ca4a582'), # noqa '256': unhexlify('713e34bcd2c59affc9185a716c3c6aef5c9bf7b9914337dd96e9d7436344bcb9c35175afb54adb78aab322829ce9cb4a'), # noqa } for key_size in [128, 192, 256]: alg = 'aes_%s_ctr' % str(key_size) # Our key for this test is 256 bits in length (32 bytes). # We will trim it to the appopriate length for testing AES-128 # and AES-192 as well (so 16 and 24 bytes, respectively). key_truncated = key[0:(key_size // 8)] # Test encrypt operations cipher = EVP.Cipher(alg=alg, key=key_truncated, iv=nonce, op=op) ciphertext = cipher.update(plaintext_value) ciphertext = ciphertext + cipher.final() self.assertEqual(ciphertext, ciphertext_values[str(key_size)]) # Test decrypt operations cipher = EVP.Cipher(alg=alg, key=key_truncated, iv=nonce, op=op) plaintext = cipher.update(ciphertext_values[str(key_size)]) plaintext = plaintext + cipher.final() # XXX not quite sure this is the actual intention # but for now let's be happy to find the same content even if with # a different type - XXX self.assertEqual(plaintext, plaintext_value) def test_raises(self): def _cipherFilter(cipher, inf, outf): # noqa while 1: buf = inf.read() if not buf: break outf.write(cipher.update(buf)) outf.write(cipher.final()) return outf.getvalue() def decrypt(ciphertext, key, iv, alg='aes_256_cbc'): cipher = EVP.Cipher(alg=alg, key=key, iv=iv, op=0) pbuf = io.BytesIO() cbuf = io.BytesIO(ciphertext) plaintext = _cipherFilter(cipher, cbuf, pbuf) pbuf.close() cbuf.close() return plaintext with self.assertRaises(EVP.EVPError): decrypt( unhexlify('941d3647a642fab26d9f99a195098b91252c652d07235b9db35758c401627711724637648e45cad0f1121751a1240a4134998cfdf3c4a95c72de2a2444de3f9e40d881d7f205630b0d8ce142fdaebd8d7fbab2aea3dc47f5f29a0e9b55aae59222671d8e2877e1fb5cd8ef1c427027e0'), unhexlify('5f2cc54067f779f74d3cf1f78c735aec404c8c3a4aaaa02eb1946f595ea4cddb'), unhexlify('0001efa4bd154ee415b9413a421cedf04359fff945a30e7c115465b1c780a85b65c0e45c')) with self.assertRaises(EVP.EVPError): decrypt( unhexlify('a78a510416c1a6f1b48077cc9eeb4287dcf8c5d3179ef80136c18876d774570d'), unhexlify('5cd148eeaf680d4ff933aed83009cad4110162f53ef89fd44fad09611b0524d4'), unhexlify('')) class PBKDF2TestCase(unittest.TestCase): def test_rfc3211_test_vectors(self): password = b'password' salt = unhexlify('1234567878563412') iter = 5 keylen = 8 ret = EVP.pbkdf2(password, salt, iter, keylen) self.assertEqual(ret, unhexlify(b'd1daa78615f287e6')) password = b'All n-entities must communicate with other n-entities' + \ b' via n-1 entiteeheehees' salt = unhexlify('1234567878563412') iter = 500 keylen = 16 ret = EVP.pbkdf2(password, salt, iter, keylen) self.assertEqual(ret, unhexlify(b'6a8970bf68c92caea84a8df285108586')) class HMACTestCase(unittest.TestCase): data1 = [b'', b'More text test vectors to stuff up EBCDIC machines :-)', a2b_hex("b760e92d6662d351eb3801057695ac0346295356")] data2 = [a2b_hex(b'0b' * 16), b"Hi There", a2b_hex("675b0b3a1b4ddf4e124872da6c2f632bfed957e9")] data3 = [b'Jefe', b"what do ya want for nothing?", a2b_hex("effcdf6ae5eb2fa2d27416d5f184df9c259a7c79")] data4 = [a2b_hex(b'aa' * 16), a2b_hex(b'dd' * 50), a2b_hex("d730594d167e35d5956fd8003d0db3d3f46dc7bb")] data = [data1, data2, data3, data4] def test_simple(self): algo = 'sha1' for d in self.data: h = EVP.HMAC(d[0], algo) h.update(d[1]) ret = h.final() self.assertEqual(ret, d[2]) with self.assertRaises(ValueError): EVP.HMAC(d[0], algo='nosuchalgo') def make_chain_HMAC(self, key, start, input, algo='sha1'): # noqa chain = [] hmac = EVP.HMAC(key, algo) hmac.update(repr(start)) digest = hmac.final() chain.append((digest, start)) for i in input: hmac.reset(digest) hmac.update(repr(i)) digest = hmac.final() chain.append((digest, i)) return chain def make_chain_hmac(self, key, start, input, algo='sha1'): chain = [] digest = EVP.hmac(key, start, algo) chain.append((digest, start)) for i in input: digest = EVP.hmac(digest, i, algo) chain.append((digest, i)) return chain def verify_chain_hmac(self, key, start, chain, algo='sha1'): digest = EVP.hmac(key, start, algo) c = chain[0] if c[0] != digest or c[1] != start: return 0 for d, v in chain[1:]: digest = EVP.hmac(digest, v, algo) if digest != d: return 0 return 1 def verify_chain_HMAC(self, key, start, chain, algo='sha1'): # noqa hmac = EVP.HMAC(key, algo) hmac.update(start) digest = hmac.final() c = chain[0] if c[0] != digest or c[1] != start: return 0 for d, v in chain[1:]: hmac.reset(digest) hmac.update(v) digest = hmac.final() if digest != d: return 0 return 1 def test_complicated(self): make_chain = self.make_chain_hmac verify_chain = self.verify_chain_hmac key = b'numero uno' start = b'zeroth item' input = [b'first item', b'go go go', b'fly fly fly'] chain = make_chain(key, start, input) self.assertEqual(verify_chain(b'some key', start, chain), 0) self.assertEqual(verify_chain(key, start, chain), 1) def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(EVPTestCase)) suite.addTest(unittest.makeSuite(CipherTestCase)) suite.addTest(unittest.makeSuite(PBKDF2TestCase)) suite.addTest(unittest.makeSuite(HMACTestCase)) return suite if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_obj.py0000644000175000001440000001147313355123234017065 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.m2 obj_* functions. """ from M2Crypto import ASN1, BIO, Rand, X509, m2, six from tests import unittest """ These functions must be cleaned up and moved to some python module Taken from CA managment code """ def x509_name2list(name): for i in range(0, name.entry_count()): yield X509.X509_Name_Entry(m2.x509_name_get_entry(name._ptr(), i), _pyfree=0) def x509_name_entry2tuple(entry): bio = BIO.MemoryBuffer() m2.asn1_string_print(bio._ptr(), m2.x509_name_entry_get_data(entry._ptr())) return ( six.ensure_text(m2.obj_obj2txt( m2.x509_name_entry_get_object(entry._ptr()), 0)), six.ensure_text(bio.getvalue())) def tuple2x509_name_entry(tup): obj, data = tup # TODO This is evil, isn't it? Shouldn't we use only official API? # Something like X509.X509_Name.add_entry_by_txt() _x509_ne = m2.x509_name_entry_create_by_txt(None, six.ensure_str(obj), ASN1.MBSTRING_ASC, six.ensure_str(data), len(data)) if not _x509_ne: raise ValueError("Invalid object indentifier: %s" % obj) return X509.X509_Name_Entry(_x509_ne, _pyfree=1) # Prevent memory leaks class ObjectsTestCase(unittest.TestCase): def callback(self, *args): pass def test_obj2txt(self): self.assertEqual(m2.obj_obj2txt(m2.obj_txt2obj("commonName", 0), 1), b"2.5.4.3", b"2.5.4.3") self.assertEqual(m2.obj_obj2txt(m2.obj_txt2obj("commonName", 0), 0), b"commonName", b"commonName") def test_nid(self): self.assertEqual(m2.obj_ln2nid("commonName"), m2.obj_txt2nid("2.5.4.3"), "ln2nid and txt2nid mismatch") self.assertEqual(m2.obj_ln2nid("CN"), 0, "ln2nid on sn") self.assertEqual(m2.obj_sn2nid("CN"), m2.obj_ln2nid("commonName"), "ln2nid and sn2nid mismatch") self.assertEqual(m2.obj_sn2nid("CN"), m2.obj_obj2nid(m2.obj_txt2obj("CN", 0)), "obj2nid") self.assertEqual(m2.obj_txt2nid("__unknown"), 0, "__unknown") def test_tuple2tuple(self): tup = ("CN", "someCommonName") tup1 = x509_name_entry2tuple(tuple2x509_name_entry(tup)) # tup1[0] is 'commonName', not 'CN' self.assertEqual(tup1[1], tup[1], tup1) self.assertEqual(x509_name_entry2tuple(tuple2x509_name_entry(tup1)), tup1, tup1) def test_unknown(self): with self.assertRaises(ValueError): tuple2x509_name_entry(("__unknown", "_")) def test_x509_name(self): n = X509.X509_Name() # It seems this actually needs to be a real 2 letter country code n.C = b'US' n.SP = b'State or Province' n.L = b'locality name' n.O = b'orhanization name' n.OU = b'org unit' n.CN = b'common name' n.Email = b'bob@example.com' n.serialNumber = b'1234' n.SN = b'surname' n.GN = b'given name' n.givenName = b'name given' self.assertEqual(len(n), 11, len(n)) # Thierry: this call to list seems extraneous... tl = [x509_name_entry2tuple(x) for x in x509_name2list(n)] self.assertEqual(len(tl), len(n), len(tl)) x509_n = m2.x509_name_new() for o in [tuple2x509_name_entry(x) for x in tl]: m2.x509_name_add_entry(x509_n, o._ptr(), -1, 0) o._pyfree = 0 # Take care of underlying object n1 = X509.X509_Name(x509_n) self.assertEqual(n.as_text(), n1.as_text(), n1.as_text()) # Detailed OpenSSL error message is visible in Python error message: def test_detailed_error_message(self): from M2Crypto import SMIME, X509 s = SMIME.SMIME() x509 = X509.load_cert('tests/recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) st = X509.X509_Store() st.load_info('tests/recipient.pem') s.set_x509_store(st) p7, data = SMIME.smime_load_pkcs7('tests/sample-p7.pem') self.assertIsInstance(p7, SMIME.PKCS7, p7) try: s.verify(p7, data) except SMIME.PKCS7_Error as e: self.assertRegexpMatches(str(e), "unable to get local issuer certificate", "Not received expected error message") def suite(): t_suite = unittest.TestSuite() t_suite.addTest(unittest.makeSuite(ObjectsTestCase)) return t_suite if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_rand.py0000644000175000001440000000550513355123234017236 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.Rand. Copyright (C) 2006 Open Source Applications Foundation (OSAF). All Rights Reserved. """ import os import ctypes import warnings from M2Crypto import Rand, m2 from tests import unittest class RandTestCase(unittest.TestCase): def test_bytes(self): with self.assertRaises(MemoryError): Rand.rand_bytes(-1) self.assertEqual(Rand.rand_bytes(0), b'') self.assertEqual(len(Rand.rand_bytes(1)), 1) def test_pseudo_bytes(self): with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) with self.assertRaises(MemoryError): Rand.rand_pseudo_bytes(-1) self.assertEqual(Rand.rand_pseudo_bytes(0), (b'', 1)) a, b = Rand.rand_pseudo_bytes(1) self.assertEqual(len(a), 1) self.assertEqual(b, 1) def test_file_name(self): if os.name == 'nt': is_admin = ctypes.windll.shell32.IsUserAnAdmin() != 0 rand_env = ('RANDFILE', 'HOME', 'USERPROFILE', 'SYSTEMROOT') else: rand_env = ('RANDFILE', 'HOME') is_admin = False key = next((k for k in rand_env if os.environ.get(k)), None) if is_admin and m2.OPENSSL_VERSION_NUMBER < 0x1010000F: path = 'C:\\' else: path = os.path.join(os.environ[key]) self.assertIsNotNone(key, "Could not find required environment") rand_file = os.path.abspath(os.path.join(path, '.rnd')) self.assertEqual(os.path.abspath(Rand.rand_file_name()), rand_file) def test_load_save(self): try: os.remove('tests/randpool.dat') except OSError: pass self.assertIn(Rand.load_file('tests/randpool.dat', -1), [0, -1]) self.assertEqual(Rand.save_file('tests/randpool.dat'), 1024) self.assertEqual(Rand.load_file('tests/randpool.dat', -1), 1024) def test_seed_add(self): self.assertIsNone(Rand.rand_seed(os.urandom(1024))) # XXX Should there be limits on the entropy parameter? self.assertIsNone(Rand.rand_add(os.urandom(2), 0.5)) Rand.rand_add(os.urandom(2), -0.5) Rand.rand_add(os.urandom(2), 5000.0) def test_rand_status(self): # Although it is hard to believe we would ever get 0 (i.e., PRNG # hasn't enough entropy), it is a legitimate value. status = Rand.rand_status() self.assertIn(status, [0, 1], 'Illegal value of RAND.rand_status {0}!'.format(status)) if status == 0: warnings.warn('RAND_status reports insufficient seeding of PRNG!') def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(RandTestCase)) return suite if __name__ == '__main__': unittest.TextTestRunner().run(suite()) M2Crypto-0.31.0/tests/test_rc4.py0000644000175000001440000000267713355123234017011 0ustar matejusers00000000000000#!/usr/bin/env python from __future__ import absolute_import """Unit tests for M2Crypto.RC4. Copyright (c) 2009 Heikki Toivonen. All rights reserved.""" from M2Crypto import RC4, Rand from binascii import hexlify from tests import unittest from tests.fips import fips_mode class RC4TestCase(unittest.TestCase): @unittest.skipIf(fips_mode, "Can't be run in FIPS mode") def test_vectors(self): """ Test with test vectors from Wikipedia: http://en.wikipedia.org/wiki/Rc4 """ if fips_mode: return vectors = ((b'Key', b'Plaintext', b'BBF316E8D940AF0AD3'), (b'Wiki', b'pedia', b'1021BF0420'), (b'Secret', b'Attack at dawn', b'45A01F645FC35B383552544B9BF5')) rc4 = RC4.RC4() for key, plaintext, ciphertext in vectors: rc4.set_key(key) self.assertEqual(hexlify(rc4.update(plaintext)).upper(), ciphertext) self.assertEqual(rc4.final(), '') @unittest.skipIf(fips_mode, "Can't be run in FIPS mode") def test_bad(self): if fips_mode: return rc4 = RC4.RC4(b'foo') self.assertNotEqual(hexlify(rc4.update(b'bar')).upper(), b'45678') def suite(): return unittest.makeSuite(RC4TestCase) if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_rsa.py0000644000175000001440000003061413355123234017076 0ustar matejusers00000000000000#!/usr/bin/env python from __future__ import absolute_import """Unit tests for M2Crypto.RSA. Copyright (c) 2000 Ng Pheng Siong. All rights reserved.""" import hashlib import logging import os from M2Crypto import BIO, RSA, Rand, X509, m2, six from tests import unittest from tests.fips import fips_mode log = logging.getLogger('test_RSA') class RSATestCase(unittest.TestCase): errkey = 'tests/dsa.priv.pem' privkey = 'tests/rsa.priv.pem' privkey2 = 'tests/rsa.priv2.pem' pubkey = 'tests/rsa.pub.pem' data = hashlib.sha1(b'The magic words are squeamish ossifrage.').digest() e_padding_ok = ('pkcs1_padding', 'pkcs1_oaep_padding') s_padding_ok = ('pkcs1_padding',) s_padding_nok = ('no_padding', 'sslv23_padding', 'pkcs1_oaep_padding') def gen_callback(self, *args): pass def gen2_callback(self): pass def pp_callback(self, *args): # The passphrase for rsa.priv2.pem is 'qwerty'. return b'qwerty' def pp2_callback(self, *args): # Misbehaving passphrase callback. return b'blabla' def test_rsa_exceptions(self): with self.assertRaises(RSA.RSAError): RSA.rsa_error() def test_loadkey_junk(self): with self.assertRaises(RSA.RSAError): RSA.load_key(self.errkey) def test_loadkey_pp(self): rsa = RSA.load_key(self.privkey2, self.pp_callback) self.assertEqual(len(rsa), 1024) self.assertEqual(rsa.e, b'\000\000\000\003\001\000\001') # aka 65537 aka 0xf4 self.assertEqual(rsa.check_key(), 1) def test_loadkey_pp_bad_cb(self): with self.assertRaises(RSA.RSAError): RSA.load_key(self.privkey2, self.pp2_callback) def test_loadkey(self): rsa = RSA.load_key(self.privkey) self.assertEqual(len(rsa), 1024) self.assertEqual(rsa.e, b'\000\000\000\003\001\000\001') # aka 65537 aka 0xf4 self.assertEqual(rsa.n, b"\x00\x00\x00\x81\x00\xcde!\x15\xdah\xb5`\xce[\xd6\x17d\xba8\xc1I\xb1\xf1\xber\x86K\xc7\xda\xb3\x98\xd6\xf6\x80\xae\xaa\x8f!\x9a\xefQ\xdeh\xbb\xc5\x99\x01o\xebGO\x8e\x9b\x9a\x18\xfb6\xba\x12\xfc\xf2\x17\r$\x00\xa1\x1a \xfc/\x13iUm\x04\x13\x0f\x91D~\xbf\x08\x19C\x1a\xe2\xa3\x91&\x8f\xcf\xcc\xf3\xa4HRf\xaf\xf2\x19\xbd\x05\xe36\x9a\xbbQ\xc86|(\xad\x83\xf2Eu\xb2EL\xdf\xa4@\x7f\xeel|\xfcU\x03\xdb\x89'") with self.assertRaises(AttributeError): getattr(rsa, 'nosuchprop') self.assertEqual(rsa.check_key(), 1) def test_loadkey_bio(self): with open(self.privkey, "rb") as f: keybio = BIO.MemoryBuffer(f.read()) rsa = RSA.load_key_bio(keybio) self.assertEqual(len(rsa), 1024) self.assertEqual(rsa.e, b'\000\000\000\003\001\000\001') # aka 65537 aka 0xf4 self.assertEqual(rsa.check_key(), 1) def test_keygen(self): rsa = RSA.gen_key(1024, 65537, self.gen_callback) self.assertEqual(len(rsa), 1024) self.assertEqual(rsa.e, b'\000\000\000\003\001\000\001') # aka 65537 aka 0xf4 self.assertEqual(rsa.check_key(), 1) def test_keygen_bad_cb(self): rsa = RSA.gen_key(1024, 65537, self.gen2_callback) self.assertEqual(len(rsa), 1024) self.assertEqual(rsa.e, b'\000\000\000\003\001\000\001') # aka 65537 aka 0xf4 self.assertEqual(rsa.check_key(), 1) def test_private_encrypt(self): priv = RSA.load_key(self.privkey) # pkcs1_padding for padding in self.s_padding_ok: p = getattr(RSA, padding) ctxt = priv.private_encrypt(self.data, p) ptxt = priv.public_decrypt(ctxt, p) self.assertEqual(ptxt, self.data) # The other paddings. for padding in self.s_padding_nok: p = getattr(RSA, padding) with self.assertRaises(RSA.RSAError): priv.private_encrypt(self.data, p) # Type-check the data to be encrypted. with self.assertRaises(TypeError): priv.private_encrypt(self.gen_callback, RSA.pkcs1_padding) def test_public_encrypt(self): priv = RSA.load_key(self.privkey) # pkcs1_padding, pkcs1_oaep_padding for padding in self.e_padding_ok: p = getattr(RSA, padding) ctxt = priv.public_encrypt(self.data, p) ptxt = priv.private_decrypt(ctxt, p) self.assertEqual(ptxt, self.data) # sslv23_padding ctxt = priv.public_encrypt(self.data, RSA.sslv23_padding) with self.assertRaises(RSA.RSAError): priv.private_decrypt(ctxt, RSA.sslv23_padding) with self.assertRaises(RSA.RSAError): priv.private_decrypt(ctxt, RSA.sslv23_padding) # no_padding with self.assertRaises(RSA.RSAError): priv.public_encrypt(self.data, RSA.no_padding) # Type-check the data to be encrypted. with self.assertRaises(TypeError): priv.public_encrypt(self.gen_callback, RSA.pkcs1_padding) def test_x509_public_encrypt(self): x509 = X509.load_cert("tests/recipient.pem") rsa = x509.get_pubkey().get_rsa() rsa.public_encrypt(b"data", RSA.pkcs1_padding) def test_loadpub(self): rsa = RSA.load_pub_key(self.pubkey) self.assertEqual(len(rsa), 1024) self.assertEqual(rsa.e, b'\000\000\000\003\001\000\001') # aka 65537 aka 0xf4 with self.assertRaises(RSA.RSAError): setattr(rsa, 'e', '\000\000\000\003\001\000\001') with self.assertRaises(RSA.RSAError): rsa.private_encrypt(1) with self.assertRaises(RSA.RSAError): rsa.private_decrypt(1) assert rsa.check_key() def test_loadpub_bad(self): with self.assertRaises(RSA.RSAError): RSA.load_pub_key(self.errkey) def test_savepub(self): rsa = RSA.load_pub_key(self.pubkey) assert rsa.as_pem() # calls save_key_bio f = 'tests/rsa_test.pub' try: self.assertEqual(rsa.save_key(f), 1) finally: try: os.remove(f) except IOError: pass def test_set_bn(self): rsa = RSA.load_pub_key(self.pubkey) with self.assertRaises(RSA.RSAError): m2.rsa_set_en(rsa.rsa, b'\000\000\000\003\001\000\001', b'\000\000\000\003\001') def test_set_n(self): rsa = m2.rsa_new() m2.rsa_set_n(rsa, b'\000\000\000\003\001\000\001') n = m2.rsa_get_n(rsa) e = m2.rsa_get_e(rsa) self.assertEqual(n, b'\000\000\000\003\001\000\001') self.assertEqual(e, b'\x00\x00\x00\x00') def test_set_e(self): rsa = m2.rsa_new() m2.rsa_set_e(rsa, b'\000\000\000\003\001\000\001') n = m2.rsa_get_n(rsa) e = m2.rsa_get_e(rsa) self.assertEqual(e, b'\000\000\000\003\001\000\001') self.assertEqual(n, b'\x00\x00\x00\x00') def test_set_n_then_set_e(self): rsa = m2.rsa_new() m2.rsa_set_n(rsa, b'\000\000\000\004\020\011\006\006') m2.rsa_set_e(rsa, b'\000\000\000\003\001\000\001') n = m2.rsa_get_n(rsa) e = m2.rsa_get_e(rsa) self.assertEqual(e, b'\000\000\000\003\001\000\001') self.assertEqual(n, b'\000\000\000\004\020\011\006\006') def test_newpub(self): old = RSA.load_pub_key(self.pubkey) new = RSA.new_pub_key(old.pub()) self.assertTrue(new.check_key()) self.assertEqual(len(new), 1024) # aka 65537 aka 0xf4 self.assertEqual(new.e, b'\000\000\000\003\001\000\001') def test_sign_and_verify(self): """ Testing signing and verifying digests """ algos = {'sha1': '', 'ripemd160': '', 'md5': ''} if m2.OPENSSL_VERSION_NUMBER >= 0x90800F: algos['sha224'] = '' algos['sha256'] = '' algos['sha384'] = '' algos['sha512'] = '' message = b"This is the message string" digest = hashlib.sha1(message).digest() rsa = RSA.load_key(self.privkey) rsa2 = RSA.load_pub_key(self.pubkey) for algo in algos.keys(): signature = rsa.sign(digest, algo) # assert signature == algos[algo], # 'mismatched signature with algorithm %s: # signature=%s' % (algo, signature) verify = rsa2.verify(digest, signature, algo) self.assertEqual(verify, 1, 'verification failed with algorithm %s' % algo) if m2.OPENSSL_VERSION_NUMBER >= 0x90708F: def test_sign_and_verify_rsassa_pss(self): """ Testing signing and verifying using rsassa_pss The maximum size of the salt has to decrease as the size of the digest increases because of the size of our test key limits it. """ message = b"This is the message string" import hashlib algos = {'sha1': 43} if not fips_mode: algos['md5'] = 47 algos['ripemd160'] = 43 if m2.OPENSSL_VERSION_NUMBER >= 0x90800F: algos['sha224'] = 35 algos['sha256'] = 31 algos['sha384'] = 15 algos['sha512'] = 0 for algo, salt_max in algos.items(): h = hashlib.new(algo) h.update(message) digest = h.digest() algos[algo] = (salt_max, digest) rsa = RSA.load_key(self.privkey) rsa2 = RSA.load_pub_key(self.pubkey) for algo, (salt_max, digest) in algos.items(): for salt_length in range(0, salt_max): signature = rsa.sign_rsassa_pss(digest, algo, salt_length) verify = rsa2.verify_rsassa_pss(digest, signature, algo, salt_length) self.assertEqual(verify, 1, 'verification failed with algorithm ' '%s salt length %d' % (algo, salt_length)) def test_sign_bad_method(self): """ Testing calling sign with an unsupported message digest algorithm """ rsa = RSA.load_key(self.privkey) digest = 'a' * 16 with self.assertRaises(ValueError): rsa.sign(digest, 'bad_digest_method') def test_verify_bad_method(self): """ Testing calling verify with an unsupported message digest algorithm """ rsa = RSA.load_key(self.privkey) digest = b'a' * 16 signature = rsa.sign(digest, 'sha1') with self.assertRaises(ValueError): rsa.verify(digest, signature, 'bad_digest_method') def test_verify_mismatched_algo(self): """ Testing verify to make sure it fails when we use a different message digest algorithm """ rsa = RSA.load_key(self.privkey) message = b"This is the message string" digest = hashlib.sha1(message).digest() signature = rsa.sign(digest, 'sha1') with self.assertRaises(RSA.RSAError): rsa.verify(digest, signature, 'md5') def test_sign_fail(self): """ Testing sign to make sure it fails when I give it a bogus digest. Looking at the RSA sign method I discovered that with the digest methods we use it has to be longer than a certain length. """ rsa = RSA.load_key(self.privkey) digest = b"""This string should be long enough to warrant an error in RSA_sign""" * 2 with self.assertRaises(RSA.RSAError): rsa.sign(digest) def test_verify_bad_signature(self): """ Testing verify to make sure it fails when we use a bad signature """ rsa = RSA.load_key(self.privkey) message = b"This is the message string" digest = hashlib.sha1(message).digest() other_message = b"Abracadabra" other_digest = hashlib.sha1(other_message).digest() other_signature = rsa.sign(other_digest) with self.assertRaises(RSA.RSAError): rsa.verify(digest, other_signature) def suite(): return unittest.makeSuite(RSATestCase) if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_smime.py0000644000175000001440000003065213355123234017425 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.SMIME. Copyright (C) 2006 Open Source Applications Foundation. All Rights Reserved. """ import os.path from M2Crypto import BIO, EVP, Rand, SMIME, X509 from tests import unittest # Various callbacks to set by X509_Store.set_verify_cb() for # testing with SMIME.verify() afterwards. # NOTE: if the Python callback function contains compile-time or run-time # errors, then SMIME.verify() can fail with a mysterious error which can be # hard to trace back. # Python exceptions in callbacks do *not* propagate to verify() call. def verify_cb_dummy_function(ok, ctx): return ok def verify_cb_rejects_cert_from_heikki_toivonen(ok, ctx): cert = ctx.get_current_cert() return "Heikki Toivonen" not in cert.get_issuer().as_text() class SMIMETestCase(unittest.TestCase): cleartext = b'some text to manipulate' def setUp(self): # XXX Ugly, but not sure what would be better self.signed = self.test_sign() self.encrypted = self.test_encrypt() def test_load_bad(self): s = SMIME.SMIME() with self.assertRaises(EVP.EVPError): s.load_key('tests/signer.pem', 'tests/signer.pem') with self.assertRaises(BIO.BIOError): SMIME.load_pkcs7('nosuchfile-dfg456') with self.assertRaises(SMIME.PKCS7_Error): SMIME.load_pkcs7('tests/signer.pem') with self.assertRaises(SMIME.PKCS7_Error): SMIME.load_pkcs7_bio(BIO.MemoryBuffer(b'no pkcs7')) with self.assertRaises(BIO.BIOError): SMIME.load_pkcs7_der('nosuchfile-dfg456') with self.assertRaises(SMIME.PKCS7_Error): SMIME.load_pkcs7_der('tests/signer.pem') with self.assertRaises(SMIME.PKCS7_Error): SMIME.load_pkcs7_bio_der(BIO.MemoryBuffer(b'no pkcs7')) with self.assertRaises(SMIME.SMIME_Error): SMIME.smime_load_pkcs7('tests/signer.pem') with self.assertRaises(SMIME.SMIME_Error): SMIME.smime_load_pkcs7_bio(BIO.MemoryBuffer(b'no pkcs7')) def test_crlf(self): self.assertEqual(SMIME.text_crlf(b'foobar'), b'Content-Type: text/plain\r\n\r\nfoobar') self.assertEqual(SMIME.text_crlf_bio( BIO.MemoryBuffer(b'foobar')).read(), b'Content-Type: text/plain\r\n\r\nfoobar') def test_sign(self): buf = BIO.MemoryBuffer(self.cleartext) s = SMIME.SMIME() s.load_key('tests/signer_key.pem', 'tests/signer.pem') p7 = s.sign(buf, SMIME.PKCS7_DETACHED) self.assertEqual(len(buf), 0) self.assertEqual(p7.type(), SMIME.PKCS7_SIGNED, p7.type()) self.assertIsInstance(p7, SMIME.PKCS7, p7) out = BIO.MemoryBuffer() p7.write(out) buf = out.read() self.assertTrue(buf.startswith(b'-----BEGIN PKCS7-----'), b'-----BEGIN PKCS7-----') buf = buf.strip() self.assertTrue(buf.endswith(b'-----END PKCS7-----'), buf[-len(b'-----END PKCS7-----'):]) self.assertGreater(len(buf), len(b'-----END PKCS7-----') + len(b'-----BEGIN PKCS7-----')) s.write(out, p7, BIO.MemoryBuffer(self.cleartext)) return out def test_sign_unknown_digest(self): buf = BIO.MemoryBuffer(self.cleartext) s = SMIME.SMIME() s.load_key('tests/signer_key.pem', 'tests/signer.pem') self.assertRaises(SMIME.SMIME_Error, s.sign, buf, SMIME.PKCS7_DETACHED, 'invalid digest name') def test_sign_nondefault_digest(self): buf = BIO.MemoryBuffer(self.cleartext) s = SMIME.SMIME() s.load_key('tests/signer_key.pem', 'tests/signer.pem') p7 = s.sign(buf, flags=SMIME.PKCS7_DETACHED, algo='sha512') self.assertEqual(p7.type(), SMIME.PKCS7_SIGNED) def test_sign_with_stack(self): buf = BIO.MemoryBuffer(self.cleartext) s = SMIME.SMIME() s.load_key('tests/signer_key.pem', 'tests/signer.pem') cert = X509.load_cert('tests/server.pem') stack = X509.X509_Stack() stack.push(cert) s.set_x509_stack(stack) p7 = s.sign(buf, flags=SMIME.PKCS7_DETACHED, algo='sha512') self.assertEqual(p7.type(), SMIME.PKCS7_SIGNED) def test_store_load_info(self): st = X509.X509_Store() with self.assertRaises(X509.X509Error): st.load_info('tests/ca.pem-typoname') self.assertEqual(st.load_info('tests/ca.pem'), 1) def test_verify(self): s = SMIME.SMIME() x509 = X509.load_cert('tests/signer.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) st = X509.X509_Store() st.load_info('tests/ca.pem') s.set_x509_store(st) p7, data = SMIME.smime_load_pkcs7_bio(self.signed) self.assertIsInstance(p7, SMIME.PKCS7, p7) v = s.verify(p7, data) self.assertEqual(v, self.cleartext) t = p7.get0_signers(sk) self.assertEqual(len(t), 1) self.assertEqual(t[0].as_pem(), x509.as_pem(), t[0].as_text()) def test_verify_with_static_callback(self): s = SMIME.SMIME() x509 = X509.load_cert('tests/signer.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) st = X509.X509_Store() st.load_info('tests/ca.pem') st.set_verify_cb(verify_cb_rejects_cert_from_heikki_toivonen) s.set_x509_store(st) p7, data = SMIME.smime_load_pkcs7_bio(self.signed) self.assertIsInstance(p7, SMIME.PKCS7, p7) # Should reject certificate issued by Heikki Toivonen: with self.assertRaises(SMIME.PKCS7_Error): s.verify(p7, data) st.set_verify_cb(verify_cb_dummy_function) v = s.verify(p7, data) self.assertEqual(v, self.cleartext) st.set_verify_cb() v = s.verify(p7, data) self.assertEqual(v, self.cleartext) def verify_cb_dummy_method(self, ok, store): return verify_cb_dummy_function(ok, store) def test_verify_with_method_callback(self): s = SMIME.SMIME() x509 = X509.load_cert('tests/signer.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) st = X509.X509_Store() st.load_info('tests/ca.pem') st.set_verify_cb(self.verify_cb_dummy_method) s.set_x509_store(st) p7, data = SMIME.smime_load_pkcs7_bio(self.signed) self.assertIsInstance(p7, SMIME.PKCS7, p7) v = s.verify(p7, data) self.assertEqual(v, self.cleartext) def test_verifyBad(self): s = SMIME.SMIME() x509 = X509.load_cert('tests/recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) st = X509.X509_Store() st.load_info('tests/recipient.pem') s.set_x509_store(st) p7, data = SMIME.smime_load_pkcs7_bio(self.signed) self.assertIsInstance(p7, SMIME.PKCS7, p7) with self.assertRaises(SMIME.PKCS7_Error): s.verify(p7) # Bad signer def test_encrypt(self): buf = BIO.MemoryBuffer(self.cleartext) s = SMIME.SMIME() x509 = X509.load_cert('tests/recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) with self.assertRaises(ValueError): SMIME.Cipher('nosuchcipher') s.set_cipher(SMIME.Cipher('des_ede3_cbc')) p7 = s.encrypt(buf) self.assertEqual(len(buf), 0) self.assertEqual(p7.type(), SMIME.PKCS7_ENVELOPED, p7.type()) self.assertIsInstance(p7, SMIME.PKCS7, p7) out = BIO.MemoryBuffer() p7.write(out) buf = out.read() self.assertTrue(buf.startswith(b'-----BEGIN PKCS7-----')) buf = buf.strip() self.assertTrue(buf.endswith(b'-----END PKCS7-----')) self.assertGreater(len(buf), len(b'-----END PKCS7-----') + len(b'-----BEGIN PKCS7-----')) s.write(out, p7) return out def test_decrypt(self): s = SMIME.SMIME() s.load_key('tests/recipient_key.pem', 'tests/recipient.pem') p7, data = SMIME.smime_load_pkcs7_bio(self.encrypted) self.assertIsInstance(p7, SMIME.PKCS7, p7) with self.assertRaises(SMIME.SMIME_Error): s.verify(p7) # No signer out = s.decrypt(p7) self.assertEqual(out, self.cleartext) def test_decryptBad(self): s = SMIME.SMIME() s.load_key('tests/signer_key.pem', 'tests/signer.pem') p7, data = SMIME.smime_load_pkcs7_bio(self.encrypted) self.assertIsInstance(p7, SMIME.PKCS7, p7) with self.assertRaises(SMIME.SMIME_Error): s.verify(p7) # No signer # Cannot decrypt: no recipient matches certificate with self.assertRaises(SMIME.PKCS7_Error): s.decrypt(p7) def test_signEncryptDecryptVerify(self): # sign buf = BIO.MemoryBuffer(self.cleartext) s = SMIME.SMIME() s.load_key('tests/signer_key.pem', 'tests/signer.pem') p7 = s.sign(buf) # encrypt x509 = X509.load_cert('tests/recipient.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) s.set_cipher(SMIME.Cipher('des_ede3_cbc')) tmp = BIO.MemoryBuffer() s.write(tmp, p7) p7 = s.encrypt(tmp) signedEncrypted = BIO.MemoryBuffer() s.write(signedEncrypted, p7) # decrypt s = SMIME.SMIME() s.load_key('tests/recipient_key.pem', 'tests/recipient.pem') p7, data = SMIME.smime_load_pkcs7_bio(signedEncrypted) out = s.decrypt(p7) # verify x509 = X509.load_cert('tests/signer.pem') sk = X509.X509_Stack() sk.push(x509) s.set_x509_stack(sk) st = X509.X509_Store() st.load_info('tests/ca.pem') s.set_x509_store(st) p7_bio = BIO.MemoryBuffer(out) p7, data = SMIME.smime_load_pkcs7_bio(p7_bio) v = s.verify(p7) self.assertEqual(v, self.cleartext) class WriteLoadTestCase(unittest.TestCase): def setUp(self): s = SMIME.SMIME() s.load_key('tests/signer_key.pem', 'tests/signer.pem') p7 = s.sign(BIO.MemoryBuffer(b'some text')) self.filename = 'tests/sig.p7' with BIO.openfile(self.filename, 'wb') as f: self.assertEqual(p7.write(f), 1) self.filename_der = 'tests/sig.p7.der' with BIO.openfile(self.filename_der, 'wb') as f: self.assertEqual(p7.write_der(f), 1) p7 = s.sign(BIO.MemoryBuffer(b'some text'), SMIME.PKCS7_DETACHED) self.filenameSmime = 'tests/sig.p7s' with BIO.openfile(self.filenameSmime, 'wb') as f: self.assertEqual(s.write(f, p7, BIO.MemoryBuffer(b'some text')), 1) def tearDown(self): if os.path.exists(self.filename_der): os.unlink(self.filename_der) def test_load_pkcs7(self): self.assertEqual(SMIME.load_pkcs7(self.filename).type(), SMIME.PKCS7_SIGNED) def test_load_pkcs7_bio(self): with open(self.filename, 'rb') as f: buf = BIO.MemoryBuffer(f.read()) self.assertEqual(SMIME.load_pkcs7_bio(buf).type(), SMIME.PKCS7_SIGNED) def test_load_pkcs7_der(self): self.assertEqual(SMIME.load_pkcs7_der(self.filename_der).type(), SMIME.PKCS7_SIGNED) def test_load_pkcs7_bio_der(self): with open(self.filename_der, 'rb') as f: buf = BIO.MemoryBuffer(f.read()) self.assertEqual(SMIME.load_pkcs7_bio_der(buf).type(), SMIME.PKCS7_SIGNED) def test_load_smime(self): a, b = SMIME.smime_load_pkcs7(self.filenameSmime) self.assertIsInstance(a, SMIME.PKCS7, a) self.assertIsInstance(b, BIO.BIO, b) self.assertEqual(a.type(), SMIME.PKCS7_SIGNED) def test_load_smime_bio(self): with open(self.filenameSmime, 'rb') as f: buf = BIO.MemoryBuffer(f.read()) a, b = SMIME.smime_load_pkcs7_bio(buf) self.assertIsInstance(a, SMIME.PKCS7, a) self.assertIsInstance(b, BIO.BIO, b) self.assertEqual(a.type(), SMIME.PKCS7_SIGNED) def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(SMIMETestCase)) suite.addTest(unittest.makeSuite(WriteLoadTestCase)) return suite if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_ssl.py0000644000175000001440000012626113371123417017117 0ustar matejusers00000000000000#!/usr/bin/env python from __future__ import absolute_import, print_function """Unit tests for M2Crypto.SSL. Copyright (c) 2000-2004 Ng Pheng Siong. All rights reserved. Copyright (c) 2009-2010 Heikki Toivonen. All rights reserved. """ """ TODO Server tests: - ??? Others: - ssl_dispatcher - SSLServer - ForkingSSLServer - ThreadingSSLServer """ import gc import logging import os import os.path import signal import socket import subprocess import sys import tempfile import time import warnings from M2Crypto import (Err, Rand, SSL, X509, ftpslib, httpslib, m2, m2urllib, m2urllib2, m2xmlrpclib, py27plus, six) from M2Crypto.SSL.timeout import DEFAULT_TIMEOUT from tests import unittest from tests.fips import fips_mode log = logging.getLogger('test_SSL') OPENSSL111=m2.OPENSSL_VERSION_NUMBER > 0x10101000 # FIXME # It would be probably better if the port was randomly selected. # https://fedorahosted.org/libuser/browser/tests/alloc_port.c srv_host = 'localhost' def allocate_srv_port(): s = socket.socket() try: s.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1) s.bind((srv_host, 0)) (host, port) = s.getsockname() finally: s.close() return port def verify_cb_new_function(ok, store): assert not ok err = store.get_error() assert err in [m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, m2.X509_V_ERR_CERT_UNTRUSTED, m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE] assert store.get_error_depth() == 0 app_data = m2.x509_store_ctx_get_ex_data( store.ctx, m2.ssl_get_ex_data_x509_store_ctx_idx()) assert app_data x509 = store.get_current_cert() assert x509 stack = store.get1_chain() assert len(stack) == 1 assert stack[0].as_pem() == x509.as_pem() return 1 class VerifyCB(object): def __call__(self, ok, store): return verify_cb_new_function(ok, store) sleepTime = float(os.getenv('M2CRYPTO_TEST_SSL_SLEEP', '1.5')) class BaseSSLClientTestCase(unittest.TestCase): # I would like to make it into a staticmethod, but apparently it # doesn't mesh with @property. Oh well. @property def _is_openssl_in_path(self): if os.name == 'nt' or sys.platform == 'cygwin': openssl = 'openssl.exe' else: openssl = 'openssl' plist = os.environ['PATH'].split(os.pathsep) for p in plist: try: dir = os.listdir(p) if openssl in dir: return True except: pass return False def start_server(self, args): if not self._is_openssl_in_path: raise Exception('openssl command not in PATH') pid = subprocess.Popen(['openssl'] + args, cwd='tests', stdout=subprocess.PIPE, stderr=subprocess.PIPE) time.sleep(sleepTime) return pid def stop_server(self, pid): pid.terminate() out, err = pid.communicate() return six.ensure_text(out), six.ensure_text(err) def http_get(self, s): s.send(b'GET / HTTP/1.0\n\n') resp = b'' while 1: try: r = s.recv(4096) if not r: break except SSL.SSLError: # s_server throws an 'unexpected eof'... break resp = resp + r return six.ensure_text(resp) def setUp(self): self.srv_host = srv_host self.srv_port = allocate_srv_port() self.srv_addr = (srv_host, self.srv_port) self.srv_url = 'https://%s:%s/' % (srv_host, self.srv_port) self.args = ['s_server', '-quiet', '-www', # '-cert', 'server.pem', Implicitly using this '-accept', str(self.srv_port)] class PassSSLClientTestCase(BaseSSLClientTestCase): def test_pass(self): pass class HttpslibSSLClientTestCase(BaseSSLClientTestCase): def setUp(self): super(HttpslibSSLClientTestCase, self).setUp() self.ctx = SSL.Context() def tearDown(self): self.ctx.close() def test_HTTPSConnection(self): pid = self.start_server(self.args) try: c = httpslib.HTTPSConnection(srv_host, self.srv_port) c.request('GET', '/') data = c.getresponse().read() c.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', six.ensure_text(data)) @unittest.skipIf(OPENSSL111, "Doesn't work with OpenSSL 1.1.1") def test_HTTPSConnection_resume_session(self): pid = self.start_server(self.args) try: self.ctx.load_verify_locations(cafile='tests/ca.pem') self.ctx.load_cert('tests/x509.pem') self.ctx.set_verify( SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 1) self.ctx.set_session_cache_mode(m2.SSL_SESS_CACHE_CLIENT) c = httpslib.HTTPSConnection(srv_host, self.srv_port, ssl_context=self.ctx) c.request('GET', '/') ses = c.get_session() t = ses.as_text() data = c.getresponse().read() # Appearently closing connection here screws session; Ali Polatel? # c.close() ctx2 = SSL.Context() ctx2.load_verify_locations(cafile='tests/ca.pem') ctx2.load_cert('tests/x509.pem') ctx2.set_verify( SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 1) ctx2.set_session_cache_mode(m2.SSL_SESS_CACHE_CLIENT) c2 = httpslib.HTTPSConnection(srv_host, self.srv_port, ssl_context=ctx2) c2.set_session(ses) c2.request('GET', '/') ses2 = c2.get_session() t2 = ses2.as_text() data = six.ensure_text(c2.getresponse().read()) c.close() c2.close() self.assertEqual(t, t2, "Sessions did not match: t = %s, t2 = %s" % (t, t2,)) finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_HTTPSConnection_secure_context(self): pid = self.start_server(self.args) try: self.ctx.set_verify( SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) self.ctx.load_verify_locations('tests/ca.pem') c = httpslib.HTTPSConnection(srv_host, self.srv_port, ssl_context=self.ctx) c.request('GET', '/') data = six.ensure_text(c.getresponse().read()) c.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_HTTPSConnection_secure_context_fail(self): pid = self.start_server(self.args) try: self.ctx.set_verify( SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) self.ctx.load_verify_locations('tests/server.pem') c = httpslib.HTTPSConnection(srv_host, self.srv_port, ssl_context=self.ctx) with self.assertRaises(SSL.SSLError): c.request('GET', '/') c.close() finally: self.stop_server(pid) def test_HTTPSConnection_illegalkeywordarg(self): with self.assertRaises(ValueError): httpslib.HTTPSConnection('example.org', badKeyword=True) class HttpslibSSLSNIClientTestCase(BaseSSLClientTestCase): def setUp(self): super(HttpslibSSLSNIClientTestCase, self).setUp() self.args = ['s_server', '-servername', srv_host, '-debug', '-www', '-msg', '-cert', 'server.pem', '-key', 'server_key.pem', '-cert2', 'server.pem', '-key2', 'server_key.pem', '-accept', str(self.srv_port)] self.ctx = SSL.Context() def tearDown(self): self.ctx.close() def test_SNI_support(self): pid = self.start_server(self.args) try: c = httpslib.HTTPSConnection(self.srv_host, self.srv_port, ssl_context=self.ctx) c.request('GET', '/') c.close() finally: # (openssl s_server) buffers its log output, and ends the TLS session # with the client (allowing the client to terminate) before flushing # the log; so, the client may get here and terminate the server # before it manages to log the output. # So, give the server hopefully enough time to flush the logs. time.sleep(sleepTime) out, _ = self.stop_server(pid) self.assertIn('Hostname in TLS extension: "%s"' % srv_host, out) def test_IP_call(self): no_exception = True runs_counter = 0 pid = self.start_server(self.args) for entry in socket.getaddrinfo(self.srv_host, self.srv_port, socket.AF_INET, socket.SOCK_STREAM, socket.IPPROTO_TCP): ipfamily, socktype, _, _, sockaddr = entry ip = sockaddr[0] sock = socket.socket(ipfamily, socktype) conn = SSL.Connection(self.ctx, sock=sock) conn.set_tlsext_host_name(self.srv_host) conn.set1_host(self.srv_host) runs_counter += 1 try: conn.connect((ip, self.srv_port)) except (SSL.SSLError, socket.error): log.exception("Failed to connect to %s:%s", ip, self.srv_port) no_exception = False finally: conn.close() out, _ = self.stop_server(pid) self.assertEqual( out.count('Hostname in TLS extension: "%s"' % self.srv_host), runs_counter) self.assertTrue(no_exception) class MiscSSLClientTestCase(BaseSSLClientTestCase): def test_no_connection(self): ctx = SSL.Context() SSL.Connection(ctx) def test_server_simple(self): pid = self.start_server(self.args) try: with self.assertRaises(ValueError): SSL.Context('tlsv5') ctx = SSL.Context() s = SSL.Connection(ctx) s.connect(self.srv_addr) with self.assertRaises(ValueError): s.read(0) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_server_simple_secure_context(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/ca.pem') s = SSL.Connection(ctx) s.connect(self.srv_addr) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_server_simple_secure_context_fail(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/server.pem') s = SSL.Connection(ctx) with self.assertRaises(SSL.SSLError): s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def test_server_simple_timeouts(self): pid = self.start_server(self.args) # Arbitrary value: test_timeout_sec = 909 # Linux rounds microseconds in the timeouts up to the HZ kernel parameter. # Windows rounds down to milliseconds. # To avoid checking for rounded values, pick interval long enough # so that it is a whole number of ms and HZ for any reasonable HZ value. test_timeout_microsec = 500000 try: with self.assertRaises(ValueError): SSL.Context('tlsv5') ctx = SSL.Context() s = SSL.Connection(ctx) r = s.get_socket_read_timeout() w = s.get_socket_write_timeout() self.assertEqual(r.sec, 0, r.sec) self.assertEqual(r.microsec, 0, r.microsec) self.assertEqual(w.sec, 0, w.sec) self.assertEqual(w.microsec, 0, w.microsec) s.set_socket_read_timeout(SSL.timeout()) s.set_socket_write_timeout(SSL.timeout(test_timeout_sec, test_timeout_microsec)) r = s.get_socket_read_timeout() w = s.get_socket_write_timeout() self.assertEqual(r.sec, DEFAULT_TIMEOUT, r.sec) self.assertEqual(r.microsec, 0, r.microsec) self.assertEqual(w.sec, test_timeout_sec, w.sec) self.assertEqual(w.microsec, test_timeout_microsec, w.microsec) s.connect(self.srv_addr) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) # TLS is required in FIPS mode @unittest.skipIf(fips_mode, "Can't be run in FIPS mode") def test_tls1_nok(self): self.args.append('-no_tls1') pid = self.start_server(self.args) try: with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) ctx = SSL.Context('tlsv1') s = SSL.Connection(ctx) with six.assertRaisesRegex(self, SSL.SSLError, r'version|unexpected eof'): s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def test_tls1_ok(self): self.args.append('-tls1') pid = self.start_server(self.args) try: with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) ctx = SSL.Context('tlsv1') s = SSL.Connection(ctx) s.connect(self.srv_addr) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_cipher_mismatch(self): self.args = self.args + ['-cipher', 'AES256-SHA'] pid = self.start_server(self.args) try: ctx = SSL.Context() s = SSL.Connection(ctx) s.set_cipher_list('AES128-SHA') if not OPENSSL111: with six.assertRaisesRegex(self, SSL.SSLError, 'sslv3 alert handshake failure'): s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def test_no_such_cipher(self): self.args = self.args + ['-cipher', 'AES128-SHA'] pid = self.start_server(self.args) try: ctx = SSL.Context() s = SSL.Connection(ctx) s.set_cipher_list('EXP-RC2-MD5') if not OPENSSL111: with six.assertRaisesRegex(self, SSL.SSLError, 'no ciphers available'): s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def test_cipher_ok(self): if OPENSSL111: TCIPHER = 'TLS_AES_256_GCM_SHA384' else: TCIPHER = 'AES128-SHA' self.args = self.args + ['-cipher', TCIPHER] pid = self.start_server(self.args) try: ctx = SSL.Context() s = SSL.Connection(ctx) s.set_cipher_list(TCIPHER) s.connect(self.srv_addr) data = self.http_get(s) self.assertEqual(s.get_cipher().name(), TCIPHER, s.get_cipher().name()) cipher_stack = s.get_ciphers() self.assertEqual(cipher_stack[0].name(), TCIPHER, cipher_stack[0].name()) if not OPENSSL111: with self.assertRaises(IndexError): cipher_stack.__getitem__(2) # For some reason there are 2 entries in the stack # self.assertEqual(len(cipher_stack), 1, len(cipher_stack)) self.assertEqual(s.get_cipher_list(), TCIPHER, s.get_cipher_list()) # Test Cipher_Stack iterator i = 0 for cipher in cipher_stack: i += 1 if not OPENSSL111: cipname = cipher.name() self.assertEqual(cipname, 'AES128-SHA', '"%s" (%s)' % (cipname, type(cipname))) self.assertEqual('AES128-SHA-128', str(cipher)) # For some reason there are 2 entries in the stack # self.assertEqual(i, 1, i) self.assertEqual(i, len(cipher_stack)) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def verify_cb_new(self, ok, store): return verify_cb_new_function(ok, store) def test_verify_cb_new(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9, self.verify_cb_new) s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_verify_cb_new_class(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9, VerifyCB()) s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: log.exception(e) self.fail(e) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_verify_cb_new_function(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9, verify_cb_new_function) s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_verify_cb_lambda(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9, lambda ok, store: 1) s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def verify_cb_exception(self, ok, store): self.fail('We should fail verification') def test_verify_cb_exception(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9, self.verify_cb_exception) s = SSL.Connection(ctx) with self.assertRaises(SSL.SSLError): s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def test_verify_cb_not_callable(self): ctx = SSL.Context() with self.assertRaises(TypeError): ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9, 1) def test_verify_cb_wrong_callable(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9, lambda _: '') s = SSL.Connection(ctx) with self.assertRaises(SSL.SSLError): with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def verify_cb_old(self, ctx_ptr, x509_ptr, err, depth, ok): try: self.assertFalse(ok) self.assertIn(err, [m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, m2.X509_V_ERR_CERT_UNTRUSTED, m2.X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE]) self.assertTrue(m2.ssl_ctx_get_cert_store(ctx_ptr)) self.assertTrue(X509.X509(x509_ptr).as_pem()) except AssertionError: # If we let exceptions propagate from here the # caller may see strange errors. This is cleaner. return 0 return 1 def test_verify_cb_old(self): with warnings.catch_warnings(): warnings.simplefilter("ignore", DeprecationWarning) pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify( SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9, self.verify_cb_old) s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_verify_allow_unknown_old(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9, SSL.cb.ssl_verify_callback_allow_unknown_ca) ctx.set_allow_unknown_ca(1) s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError: log.error('Failed to connect to %s', self.srv_addr) raise data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_verify_allow_unknown_new(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9, SSL.cb.ssl_verify_callback_allow_unknown_ca) s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_verify_cert(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/ca.pem') s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_verify_cert_fail(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/server.pem') s = SSL.Connection(ctx) with self.assertRaises(SSL.SSLError): s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def test_verify_cert_mutual_auth(self): self.args.extend(['-Verify', '2', '-CAfile', 'ca.pem']) pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/ca.pem') ctx.load_cert('tests/x509.pem') s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_verify_cert_mutual_auth_servernbio(self): self.args.extend(['-Verify', '2', '-CAfile', 'ca.pem', '-nbio']) pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/ca.pem') ctx.load_cert('tests/x509.pem') s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_verify_cert_mutual_auth_fail(self): self.args.extend(['-Verify', '2', '-CAfile', 'ca.pem']) pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/ca.pem') s = SSL.Connection(ctx) if not OPENSSL111: with self.assertRaises(SSL.SSLError): s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def test_verify_nocert_fail(self): self.args.extend(['-nocert']) pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/ca.pem') s = SSL.Connection(ctx) with self.assertRaises(SSL.SSLError): s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def test_blocking0(self): pid = self.start_server(self.args) try: ctx = SSL.Context() s = SSL.Connection(ctx) s.setblocking(0) with self.assertRaises(Exception): s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def test_blocking1(self): pid = self.start_server(self.args) try: ctx = SSL.Context() s = SSL.Connection(ctx) s.setblocking(1) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_makefile(self): pid = self.start_server(self.args) try: ctx = SSL.Context() s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) bio = s.makefile('rwb') # s.close() # XXX bug 6628? bio.write(b'GET / HTTP/1.0\n\n') bio.flush() data = bio.read() bio.close() s.close() finally: self.stop_server(pid) self.assertIn(b's_server -quiet -www', data) def test_makefile_err(self): pid = self.start_server(self.args) try: ctx = SSL.Context() s = SSL.Connection(ctx) try: s.connect(self.srv_addr) except SSL.SSLError as e: self.fail(e) f = s.makefile() data = self.http_get(s) s.close() del f del s err_code = Err.peek_error_code() self.assertEqual(err_code, 0, 'Unexpected error: %s' % err_code) err = Err.get_error() self.assertIsNone(err, 'Unexpected error: %s' % err) finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_info_callback(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_info_callback() s = SSL.Connection(ctx) s.connect(self.srv_addr) data = self.http_get(s) s.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) def test_ssl_connection_free(self): pid = self.start_server(self.args) orig_m2_ssl_free = SSL.Connection.m2_ssl_free def _m2_ssl_free(ssl): orig_m2_ssl_free(ssl) _m2_ssl_free.called = True try: ctx = SSL.Context() s = SSL.Connection(ctx) s.m2_ssl_free = _m2_ssl_free s.connect(self.srv_addr) data = self.http_get(s) s.close() self.assertFalse(hasattr(_m2_ssl_free, 'called')) # keep fingers crossed that SSL.Connection.__del__ is called # by the python interpreter del s finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) self.assertTrue(getattr(_m2_ssl_free, 'called', False)) def test_ssl_connection_no_free(self): pid = self.start_server(self.args) orig_m2_ssl_free = SSL.Connection.m2_ssl_free def _m2_ssl_free(ssl): _m2_ssl_free.called = True orig_m2_ssl_free(ssl) try: ctx = SSL.Context() s = SSL.Connection(ctx) s.m2_ssl_free = _m2_ssl_free s.set_ssl_close_flag(m2.bio_close) s.connect(self.srv_addr) data = self.http_get(s) s.close() self.assertFalse(hasattr(_m2_ssl_free, 'called')) # keep fingers crossed that SSL.Connection.__del__ is called # by the python interpreter del s finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) self.assertFalse(hasattr(_m2_ssl_free, 'called')) class UrllibSSLClientTestCase(BaseSSLClientTestCase): @unittest.skipIf(six.PY3, "urllib.URLOpener is deprecated in py3k") def test_urllib(self): pid = self.start_server(self.args) try: url = m2urllib.FancyURLopener() url.addheader('Connection', 'close') u = url.open('https://%s:%s/' % (srv_host, self.srv_port)) data = u.read() u.close() finally: self.stop_server(pid) self.assertIn('s_server -quiet -www', data) # XXX Don't actually know how to use m2urllib safely! # def test_urllib_safe_context(self): # def test_urllib_safe_context_fail(self): class Urllib2SSLClientTestCase(BaseSSLClientTestCase): def test_urllib2(self): pid = self.start_server(self.args) try: opener = m2urllib2.build_opener() opener.addheaders = [('Connection', 'close')] u = opener.open('https://%s:%s/' % (srv_host, self.srv_port)) data = u.read() u.close() finally: self.stop_server(pid) self.assertIn(b's_server -quiet -www', data) def test_urllib2_secure_context(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify( SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/ca.pem') opener = m2urllib2.build_opener(ctx) opener.addheaders = [('Connection', 'close')] u = opener.open('https://%s:%s/' % (srv_host, self.srv_port)) data = u.read() u.close() finally: self.stop_server(pid) self.assertIn(b's_server -quiet -www', data) def test_urllib2_secure_context_fail(self): pid = self.start_server(self.args) try: ctx = SSL.Context() ctx.set_verify( SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/server.pem') opener = m2urllib2.build_opener(ctx) opener.addheaders = [('Connection', 'close')] with self.assertRaises(SSL.SSLError): opener.open('https://%s:%s/' % (srv_host, self.srv_port)) finally: self.stop_server(pid) def test_z_urllib2_opener(self): pid = self.start_server(self.args) try: ctx = SSL.Context() opener = m2urllib2.build_opener( ctx, m2urllib2.HTTPBasicAuthHandler()) m2urllib2.install_opener(opener) req = m2urllib2.Request('https://%s:%s/' % (srv_host, self.srv_port)) u = m2urllib2.urlopen(req) data = u.read() u.close() finally: self.stop_server(pid) self.assertIn(b's_server -quiet -www', data) def test_urllib2_opener_handlers(self): ctx = SSL.Context() m2urllib2.build_opener(ctx, m2urllib2.HTTPBasicAuthHandler()) def test_urllib2_leak(self): pid = self.start_server(self.args) try: o = m2urllib2.build_opener() r = o.open('https://%s:%s/' % (srv_host, self.srv_port)) s = [r.fp._sock.fp] r.close() # TODO This should be assertEqual 1, but we leak sock # somehwere. Not sure how to fix it. log.debug('get_referrers = %d', len(gc.get_referrers(s[0]))) self.assertLessEqual(len(gc.get_referrers(s[0])), 2) finally: self.stop_server(pid) class Urllib2TEChunkedSSLClientTestCase(BaseSSLClientTestCase): """Test a response with "Transfer-Encoding: chunked".""" def setUp(self): super(Urllib2TEChunkedSSLClientTestCase, self).setUp() self.args = ['s_server', '-quiet', '-HTTP', '-accept', str(self.srv_port)] def test_transfer_encoding_chunked(self): pid = self.start_server(self.args) try: url = 'https://%s:%s/te_chunked_response.txt' % (srv_host, self.srv_port) o = m2urllib2.build_opener() u = o.open(url) data = u.read() self.assertEqual(b'foo\nfoobar\n', data) finally: self.stop_server(pid) @unittest.skipUnless(py27plus, "Twisted doesn't test well with Python 2.6") class TwistedSSLClientTestCase(BaseSSLClientTestCase): def test_timeout(self): pid = self.start_server(self.args) try: ctx = SSL.Context() s = SSL.Connection(ctx) # Just a really small number so we can timeout s.settimeout(0.000000000000000000000000000001) # TODO: Figure out which exception should be raised for timeout. # The following assertion originally expected only a # SSL.SSLTimeoutError exception, but what is raised is actually a # socket.timeout exception. As a temporary circumvention to this # issue, both exceptions are now tolerated. A final fix would need # to figure out which of these two exceptions is supposed to be # raised by SSL.Connection.connect() and possibly other methods # to indicate a timeout. with self.assertRaises((SSL.SSLTimeoutError, socket.timeout)): s.connect(self.srv_addr) s.close() finally: self.stop_server(pid) def test_makefile_timeout(self): # httpslib uses makefile to read the response pid = self.start_server(self.args) try: c = httpslib.HTTPSConnection(srv_host, self.srv_port) c.putrequest('GET', '/') c.putheader('Accept', 'text/html') c.putheader('Accept', 'text/plain') c.endheaders() c.sock.settimeout(100) resp = c.getresponse() self.assertEqual(resp.status, 200, resp.reason) data = resp.read() c.close() finally: self.stop_server(pid) self.assertIn(b's_server -quiet -www', data) def test_makefile_timeout_fires(self): # This is convoluted because (openssl s_server -www) starts # writing the response as soon as it receives the first line of # the request, so it's possible for it to send the response # before the request is sent and there would be no timeout. So, # let the server spend time reading from an empty pipe FIFO_NAME = 'test_makefile_timeout_fires_fifo' # noqa os.mkfifo('tests/' + FIFO_NAME) pipe_pid = os.fork() try: if pipe_pid == 0: try: with open('tests/' + FIFO_NAME, 'w') as f: time.sleep(sleepTime + 1) f.write('Content\n') finally: os._exit(0) self.args[self.args.index('-www')] = '-WWW' pid = self.start_server(self.args) try: c = httpslib.HTTPSConnection(srv_host, self.srv_port) c.putrequest('GET', '/' + FIFO_NAME) c.putheader('Accept', 'text/html') c.putheader('Accept', 'text/plain') c.endheaders() c.sock.settimeout(0.0000000001) with self.assertRaises(socket.timeout): c.getresponse() c.close() finally: self.stop_server(pid) finally: os.kill(pipe_pid, signal.SIGTERM) os.waitpid(pipe_pid, 0) os.unlink('tests/' + FIFO_NAME) def test_twisted_wrapper(self): # Test only when twisted and ZopeInterfaces are present try: from twisted.internet.protocol import ClientFactory from twisted.protocols.basic import LineReceiver from twisted.internet import reactor import M2Crypto.SSL.TwistedProtocolWrapper as wrapper except ImportError: warnings.warn( 'Skipping twisted wrapper test because twisted not found') return # TODO Class must implement all abstract methods class EchoClient(LineReceiver): def connectionMade(self): self.sendLine(b'GET / HTTP/1.0\n\n') def lineReceived(self, line): global twisted_data twisted_data += line class EchoClientFactory(ClientFactory): protocol = EchoClient def clientConnectionFailed(self, connector, reason): reactor.stop() self.fail(reason) def clientConnectionLost(self, connector, reason): reactor.stop() pid = self.start_server(self.args) class ContextFactory(object): def getContext(self): return SSL.Context() try: global twisted_data twisted_data = b'' context_factory = ContextFactory() factory = EchoClientFactory() wrapper.connectSSL(srv_host, self.srv_port, factory, context_factory) # This will block until reactor.stop() is called reactor.run() finally: self.stop_server(pid) self.assertIn(b's_server -quiet -www', twisted_data) twisted_data = '' class XmlRpcLibTestCase(unittest.TestCase): def test_lib(self): m2xmlrpclib.SSL_Transport() # XXX need server to test against class FtpsLibTestCase(unittest.TestCase): def test_lib(self): ftpslib.FTP_TLS() # XXX need server to test against class SessionTestCase(unittest.TestCase): def test_session_load_bad(self): with self.assertRaises(SSL.SSLError): SSL.Session.load_session('tests/signer.pem') class FtpslibTestCase(unittest.TestCase): def test_26_compat(self): f = ftpslib.FTP_TLS() # 2.6 used to raise AttributeError: with self.assertRaises((socket.gaierror, socket.error,)): f.connect('no-such-host-dfgHJK56789', 990) def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(SessionTestCase)) suite.addTest(unittest.makeSuite(XmlRpcLibTestCase)) suite.addTest(unittest.makeSuite(FtpsLibTestCase)) suite.addTest(unittest.makeSuite(PassSSLClientTestCase)) suite.addTest(unittest.makeSuite(HttpslibSSLClientTestCase)) suite.addTest(unittest.makeSuite(HttpslibSSLSNIClientTestCase)) suite.addTest(unittest.makeSuite(UrllibSSLClientTestCase)) suite.addTest(unittest.makeSuite(Urllib2SSLClientTestCase)) suite.addTest(unittest.makeSuite(Urllib2TEChunkedSSLClientTestCase)) suite.addTest(unittest.makeSuite(MiscSSLClientTestCase)) suite.addTest(unittest.makeSuite(FtpslibTestCase)) try: if py27plus: import M2Crypto.SSL.TwistedProtocolWrapper as wrapper # noqa suite.addTest(unittest.makeSuite(TwistedSSLClientTestCase)) except ImportError: pass return suite def zap_servers(): s = 's_server' fn = tempfile.mktemp() cmd = 'ps | egrep %s > %s' % (s, fn) os.system(cmd) with open(fn) as f: while 1: ps = f.readline() if not ps: break chunk = ps.split() pid, cmd = chunk[0], chunk[4] if cmd == s: os.kill(int(pid), signal.SIGTERM) os.unlink(fn) if __name__ == '__main__': report_leaks = 0 if report_leaks: gc.enable() gc.set_debug(gc.DEBUG_LEAK & ~gc.DEBUG_SAVEALL) try: Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') finally: zap_servers() if report_leaks: from tests import alltests alltests.dump_garbage() M2Crypto-0.31.0/tests/test_ssl_offline.py0000644000175000001440000000403113356651321020612 0ustar matejusers00000000000000from __future__ import absolute_import """Unit tests for M2Crypto.SSL offline parts Copyright (C) 2006 Open Source Applications Foundation. All Rights Reserved. Copyright (C) 2009-2010 Heikki Toivonen. All Rights Reserved. """ import doctest from M2Crypto import Rand, SSL, X509 from tests import unittest from tests.test_ssl import srv_host class CheckerTestCase(unittest.TestCase): def test_checker(self): check = SSL.Checker.Checker( host=srv_host, peerCertHash='0305E329FF3C9F1931B8DD3F0CF9F8E350E29839') x509 = X509.load_cert('tests/server.pem') self.assertTrue(check(x509, srv_host)) with self.assertRaises(SSL.Checker.WrongHost): check(x509, 'example.com') doctest.testmod(SSL.Checker) class ContextTestCase(unittest.TestCase): def test_ctx_load_verify_locations(self): ctx = SSL.Context() with self.assertRaises(ValueError): ctx.load_verify_locations(None, None) def test_ctx_set_default_verify_paths(self): ctx = SSL.Context() ctx.set_default_verify_paths() # test will get here only if the previous won't fail def test_map(self): from M2Crypto.SSL.Context import ctxmap, _ctxmap self.assertIsInstance(ctxmap(), _ctxmap) ctx = SSL.Context() assert ctxmap() ctx.close() self.assertIs(ctxmap(), _ctxmap.singleton) def test_certstore(self): ctx = SSL.Context() ctx.set_verify(SSL.verify_peer | SSL.verify_fail_if_no_peer_cert, 9) ctx.load_verify_locations('tests/ca.pem') ctx.load_cert('tests/x509.pem') store = ctx.get_cert_store() self.assertIsInstance(store, X509.X509_Store) def suite(): t_suite = unittest.TestSuite() t_suite.addTest(unittest.makeSuite(CheckerTestCase)) t_suite.addTest(unittest.makeSuite(ContextTestCase)) return t_suite if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_ssl_win.py0000644000175000001440000000371313355123234017767 0ustar matejusers00000000000000#!/usr/bin/env python from __future__ import absolute_import """Unit tests for M2Crypto.SSL. Win32 version - requires Mark Hammond's Win32 extensions and openssl.exe on your PATH. Copyright (c) 2000-2001 Ng Pheng Siong. All rights reserved.""" import os import os.path import time try: import win32process except ImportError: win32process = None from tests import test_ssl, unittest if win32process: from M2Crypto import Rand def find_openssl(): plist = os.environ['PATH'].split(';') for p in plist: try: path_dir = os.listdir(p) if 'openssl.exe' in path_dir: return os.path.join(p, 'openssl.exe') except win32process.WindowsError: pass return None srv_host = 'localhost' srv_port = 64000 class SSLWinClientTestCase(test_ssl.BaseSSLClientTestCase): startupinfo = win32process.STARTUPINFO() openssl = find_openssl() def start_server(self, args): # openssl must be started in the tests directory for it # to find the .pem files os.chdir('tests') try: hproc, _, _, _ = win32process.CreateProcess( self.openssl, ' '.join(args), None, None, 0, win32process.DETACHED_PROCESS, None, None, self.startupinfo) finally: os.chdir('..') time.sleep(0.3) return hproc def stop_server(self, hproc): win32process.TerminateProcess(hproc, 0) def suite(): return unittest.makeSuite(SSLWinClientTestCase) def zap_servers(): pass if __name__ == '__main__': try: if find_openssl() is not None: Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') finally: zap_servers() M2Crypto-0.31.0/tests/test_threading.py0000644000175000001440000000157113355123234020256 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.threading. Copyright (C) 2007 Open Source Applications Foundation. All Rights Reserved. """ from M2Crypto import threading as m2threading, Rand from tests import unittest class ThreadingTestCase(unittest.TestCase): def setUp(self): m2threading.init() def tearDown(self): m2threading.cleanup() def test_pass(self): pass def test_multiInitCleanup(self): m2threading.init() m2threading.init() m2threading.cleanup() m2threading.cleanup() m2threading.init() m2threading.cleanup() def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(ThreadingTestCase)) return suite if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/test_timeout.py0000644000175000001440000001006513355123234017775 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.SSL.timeout. """ import sys from M2Crypto.SSL import timeout, struct_to_timeout, struct_size from tests import unittest # Max value for sec argument on Windows: # - needs to fit DWORD (signed 32-bit) when converted to millisec MAX_SEC_WIN32 = int((2**31 - 1) / 1000) # Max value for sec argument on other platforms: # Note: It may actually be 64-bit but we are happy with 32-bit. # We use the signed maximum, because the packing uses lower case "l". MAX_SEC_OTHER = 2**31 - 1 # Enable this to test the Windows logic on a non-Windows platform: # sys.platform = 'win32' class TimeoutTestCase(unittest.TestCase): def timeout_test(self, sec, microsec, exp_sec=None, exp_microsec=None): """ Test that the timeout values (sec, microsec) are the same after round tripping through a pack / unpack cycle. """ if exp_sec is None: exp_sec = sec if exp_microsec is None: exp_microsec = microsec to = timeout(sec, microsec) binstr = to.pack() act_to = struct_to_timeout(binstr) self.assertEqual( (act_to.sec, act_to.microsec), (exp_sec, exp_microsec), "Unexpected timeout(sec,microsec) after pack + unpack: " "Got (%r,%r), expected (%r,%r), input was (%r,%r)" % (act_to.sec, act_to.microsec, exp_sec, exp_microsec, sec, microsec)) def test_timeout_0_0(self): self.timeout_test(0, 0) def test_timeout_123_0(self): self.timeout_test(123, 0) def test_timeout_max_0(self): if sys.platform == 'win32': self.timeout_test(MAX_SEC_WIN32, 0) else: self.timeout_test(MAX_SEC_OTHER, 0) def test_timeout_0_456000(self): self.timeout_test(0, 456000) def test_timeout_123_456000(self): self.timeout_test(123, 456000) def test_timeout_2_3000000(self): if sys.platform == 'win32': self.timeout_test(2, 3000000, 5, 0) else: self.timeout_test(2, 3000000) def test_timeout_2_2499000(self): if sys.platform == 'win32': self.timeout_test(2, 2499000, 4, 499000) else: self.timeout_test(2, 2499000) def test_timeout_2_2999000(self): if sys.platform == 'win32': self.timeout_test(2, 2999000, 4, 999000) else: self.timeout_test(2, 2999000) def test_timeout_max_456000(self): if sys.platform == 'win32': self.timeout_test(MAX_SEC_WIN32, 456000) else: self.timeout_test(MAX_SEC_OTHER, 456000) def test_timeout_0_456(self): if sys.platform == 'win32': self.timeout_test(0, 456, None, 0) else: self.timeout_test(0, 456) def test_timeout_123_456(self): if sys.platform == 'win32': self.timeout_test(123, 456, None, 0) else: self.timeout_test(123, 456) def test_timeout_max_456(self): if sys.platform == 'win32': self.timeout_test(MAX_SEC_WIN32, 456, None, 0) else: self.timeout_test(MAX_SEC_OTHER, 456) def test_timeout_1_499(self): if sys.platform == 'win32': self.timeout_test(123, 499, None, 0) # 499 us rounds down to 0 else: self.timeout_test(123, 499) def test_timeout_1_501(self): # We use 501 for this test and not 500 because 0.5 is not exactly # represented in binary floating point numbers, and because 0.5 # rounds differently between py2 and py3. See Python round() docs. if sys.platform == 'win32': self.timeout_test(123, 501, None, 1000) # 501 us rounds up to 1000 else: self.timeout_test(123, 501) def test_timeout_size(self): exp_size = len(timeout(0, 0).pack()) self.assertEqual(struct_size(), exp_size) def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(TimeoutTestCase)) return suite if __name__ == '__main__': unittest.TextTestRunner().run(suite()) M2Crypto-0.31.0/tests/test_util.py0000644000175000001440000000240413355123234017262 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.Rand. Copyright (C) 2006 Open Source Applications Foundation (OSAF). All Rights Reserved. """ from M2Crypto import six from tests import unittest class UtilTestCase(unittest.TestCase): def test_py3bytes(self): self.assertIsInstance(six.ensure_binary('test'), six.binary_type) def test_py3str(self): self.assertIsInstance(six.ensure_text('test'), six.text_type) def test_py3bytes_str(self): self.assertIsInstance(six.ensure_binary(u'test'), six.binary_type) def test_py3str_str(self): self.assertIsInstance(six.ensure_text(u'test'), six.string_types) def test_py3bytes_bytes(self): self.assertIsInstance(six.ensure_binary(b'test'), six.binary_type) def test_py3str_bytes(self): self.assertIsInstance(six.ensure_text(b'test'), six.text_type) def test_py3bytes_None(self): with self.assertRaises(TypeError): six.ensure_binary(None) def test_py3str_None(self): with self.assertRaises(TypeError): six.ensure_text(None) def suite(): suite = unittest.TestSuite() suite.addTest(unittest.makeSuite(UtilTestCase)) return suite if __name__ == '__main__': unittest.TextTestRunner().run(suite()) M2Crypto-0.31.0/tests/test_x509.py0000644000175000001440000006524113356651321017026 0ustar matejusers00000000000000#!/usr/bin/env python """Unit tests for M2Crypto.X509. Contributed by Toby Allsopp under M2Crypto's license. Portions created by Open Source Applications Foundation (OSAF) are Copyright (C) 2004-2005 OSAF. All Rights Reserved. Author: Heikki Toivonen """ import base64 import logging import os import time import warnings from M2Crypto import ASN1, BIO, EVP, RSA, Rand, X509, m2 # noqa from tests import unittest log = logging.getLogger(__name__) class X509TestCase(unittest.TestCase): def callback(self, *args): pass def setUp(self): self.expected_hash = 'BA4212E8B55527570828E7F5A0005D17C64BDC4C' def mkreq(self, bits, ca=0): pk = EVP.PKey() x = X509.Request() rsa = RSA.gen_key(bits, 65537, self.callback) pk.assign_rsa(rsa) rsa = None # should not be freed here x.set_pubkey(pk) name = x.get_subject() name.C = "UK" name.CN = "OpenSSL Group" if not ca: ext1 = X509.new_extension('subjectAltName', 'DNS:foobar.example.com') ext2 = X509.new_extension('nsComment', 'Hello there') extstack = X509.X509_Extension_Stack() extstack.push(ext1) extstack.push(ext2) x.add_extensions(extstack) with self.assertRaises(ValueError): x.sign(pk, 'sha513') x.sign(pk, 'sha1') self.assertTrue(x.verify(pk)) pk2 = x.get_pubkey() self.assertTrue(x.verify(pk2)) return x, pk def test_ext(self): with self.assertRaises(ValueError): X509.new_extension('subjectKeyIdentifier', 'hash') ext = X509.new_extension('subjectAltName', 'DNS:foobar.example.com') self.assertEqual(ext.get_value(), 'DNS:foobar.example.com') self.assertEqual(ext.get_value(indent=2), ' DNS:foobar.example.com') self.assertEqual(ext.get_value(flag=m2.X509V3_EXT_PARSE_UNKNOWN), 'DNS:foobar.example.com') def test_ext_error(self): with self.assertRaises(X509.X509Error): X509.new_extension('nonsensicalName', 'blabla') def test_extstack(self): # new ext1 = X509.new_extension('subjectAltName', 'DNS:foobar.example.com') ext2 = X509.new_extension('nsComment', 'Hello there') extstack = X509.X509_Extension_Stack() # push extstack.push(ext1) extstack.push(ext2) self.assertEqual(extstack[1].get_name(), 'nsComment') self.assertEqual(len(extstack), 2) # iterator i = 0 for e in extstack: i += 1 self.assertGreater(len(e.get_name()), 0) self.assertEqual(i, 2) # pop ext3 = extstack.pop() self.assertEqual(len(extstack), 1) self.assertEqual(extstack[0].get_name(), 'subjectAltName') extstack.push(ext3) self.assertEqual(len(extstack), 2) self.assertEqual(extstack[1].get_name(), 'nsComment') self.assertIsNotNone(extstack.pop()) self.assertIsNotNone(extstack.pop()) self.assertIsNone(extstack.pop()) def test_x509_name(self): n = X509.X509_Name() # It seems this actually needs to be a real 2 letter country code n.C = 'US' self.assertEqual(n.C, 'US') n.SP = 'State or Province' self.assertEqual(n.SP, 'State or Province') n.L = 'locality name' self.assertEqual(n.L, 'locality name') # Yes, 'orhanization' is a typo, I know it and you're smart. # However, fixing this typo would break later hashes. # I don't think it is worthy of troubles. n.O = 'orhanization name' self.assertEqual(n.O, 'orhanization name') n.OU = 'org unit' self.assertEqual(n.OU, 'org unit') n.CN = 'common name' self.assertEqual(n.CN, 'common name') n.Email = 'bob@example.com' self.assertEqual(n.Email, 'bob@example.com') n.serialNumber = '1234' self.assertEqual(n.serialNumber, '1234') n.SN = 'surname' self.assertEqual(n.SN, 'surname') n.GN = 'given name' self.assertEqual(n.GN, 'given name') self.assertEqual(n.as_text(), 'C=US, ST=State or Province, ' + 'L=locality name, O=orhanization name, ' + 'OU=org unit, CN=common ' + 'name/emailAddress=bob@example.com' + '/serialNumber=1234, ' + 'SN=surname, GN=given name') self.assertEqual(len(n), 10, 'X509_Name has inappropriate length %d ' % len(n)) n.givenName = 'name given' self.assertEqual(n.GN, 'given name') # Just gets the first self.assertEqual(n.as_text(), 'C=US, ST=State or Province, ' + 'L=locality name, O=orhanization name, ' + 'OU=org unit, ' + 'CN=common name/emailAddress=bob@example.com' + '/serialNumber=1234, ' + 'SN=surname, GN=given name, GN=name given') self.assertEqual(len(n), 11, 'After adding one more attribute X509_Name should ' + 'have 11 and not %d attributes.' % len(n)) n.add_entry_by_txt(field="CN", type=ASN1.MBSTRING_ASC, entry="Proxy", len=-1, loc=-1, set=0) self.assertEqual(len(n), 12, 'After adding one more attribute X509_Name should ' + 'have 12 and not %d attributes.' % len(n)) self.assertEqual(n.entry_count(), 12, n.entry_count()) self.assertEqual(n.as_text(), 'C=US, ST=State or Province, ' + 'L=locality name, O=orhanization name, ' + 'OU=org unit, ' + 'CN=common name/emailAddress=bob@example.com' + '/serialNumber=1234, ' + 'SN=surname, GN=given name, GN=name given, ' + 'CN=Proxy') with self.assertRaises(AttributeError): n.__getattr__('foobar') n.foobar = 1 self.assertEqual(n.foobar, 1) # X509_Name_Entry tests l = 0 for entry in n: self.assertIsInstance(entry, X509.X509_Name_Entry) self.assertIsInstance(entry.get_object(), ASN1.ASN1_Object) self.assertIsInstance(entry.get_data(), ASN1.ASN1_String) l += 1 self.assertEqual(l, 12, l) l = 0 for cn in n.get_entries_by_nid(m2.NID_commonName): self.assertIsInstance(cn, X509.X509_Name_Entry) self.assertIsInstance(cn.get_object(), ASN1.ASN1_Object) data = cn.get_data() self.assertIsInstance(data, ASN1.ASN1_String) t = data.as_text() self.assertIn(t, ("common name", "Proxy",)) l += 1 self.assertEqual(l, 2, 'X509_Name has %d commonName entries instead ' 'of expected 2' % l) # The target list is not deleted when the loop is finished # https://docs.python.org/2.7/reference\ # /compound_stmts.html#the-for-statement # so this checks what are the attributes of the last value of # ``cn`` variable. cn.set_data(b"Hello There!") self.assertEqual(cn.get_data().as_text(), "Hello There!") # OpenSSL 1.0.1h switched from encoding strings as PRINTABLESTRING (the # first hash value) to UTF8STRING (the second one) self.assertIn(n.as_hash(), (1697185131, 1370641112), 'Unexpected value of the X509_Name hash %s' % n.as_hash()) self.assertRaises(IndexError, lambda: n[100]) self.assertIsNotNone(n[10]) def test_mkreq(self): (req, _) = self.mkreq(1024) req.save_pem('tests/tmp_request.pem') req2 = X509.load_request('tests/tmp_request.pem') os.remove('tests/tmp_request.pem') req.save('tests/tmp_request.pem') req3 = X509.load_request('tests/tmp_request.pem') os.remove('tests/tmp_request.pem') req.save('tests/tmp_request.der', format=X509.FORMAT_DER) req4 = X509.load_request('tests/tmp_request.der', format=X509.FORMAT_DER) os.remove('tests/tmp_request.der') self.assertEqual(req.as_pem(), req2.as_pem()) self.assertEqual(req.as_text(), req2.as_text()) self.assertEqual(req.as_der(), req2.as_der()) self.assertEqual(req.as_pem(), req3.as_pem()) self.assertEqual(req.as_text(), req3.as_text()) self.assertEqual(req.as_der(), req3.as_der()) self.assertEqual(req.as_pem(), req4.as_pem()) self.assertEqual(req.as_text(), req4.as_text()) self.assertEqual(req.as_der(), req4.as_der()) self.assertEqual(req.get_version(), 0) req.set_version(1) self.assertEqual(req.get_version(), 1) req.set_version(0) self.assertEqual(req.get_version(), 0) def test_mkcert(self): for utc in (True, False): req, pk = self.mkreq(1024) pkey = req.get_pubkey() self.assertTrue(req.verify(pkey)) sub = req.get_subject() self.assertEqual(len(sub), 2, 'Subject should be long 2 items not %d' % len(sub)) cert = X509.X509() cert.set_serial_number(1) cert.set_version(2) cert.set_subject(sub) t = int(time.time()) + time.timezone if utc: now = ASN1.ASN1_UTCTIME() else: now = ASN1.ASN1_TIME() now.set_time(t) now_plus_year = ASN1.ASN1_TIME() now_plus_year.set_time(t + 60 * 60 * 24 * 365) cert.set_not_before(now) cert.set_not_after(now_plus_year) self.assertEqual(str(cert.get_not_before()), str(now)) self.assertEqual(str(cert.get_not_after()), str(now_plus_year)) issuer = X509.X509_Name() issuer.CN = 'The Issuer Monkey' issuer.O = 'The Organization Otherwise Known as My CA, Inc.' cert.set_issuer(issuer) cert.set_pubkey(pkey) cert.set_pubkey(cert.get_pubkey()) # Make sure get/set work ext = X509.new_extension('subjectAltName', 'DNS:foobar.example.com') ext.set_critical(0) self.assertEqual(ext.get_critical(), 0) cert.add_ext(ext) cert.sign(pk, 'sha1') with self.assertRaises(ValueError): cert.sign(pk, 'nosuchalgo') self.assertTrue(cert.get_ext('subjectAltName').get_name(), 'subjectAltName') self.assertTrue(cert.get_ext_at(0).get_name(), 'subjectAltName') self.assertTrue(cert.get_ext_at(0).get_value(), 'DNS:foobar.example.com') self.assertEqual(cert.get_ext_count(), 1, 'Certificate should have now 1 extension not %d' % cert.get_ext_count()) with self.assertRaises(IndexError): cert.get_ext_at(1) self.assertTrue(cert.verify()) self.assertTrue(cert.verify(pkey)) self.assertTrue(cert.verify(cert.get_pubkey())) self.assertEqual(cert.get_version(), 2) self.assertEqual(cert.get_serial_number(), 1) self.assertEqual(cert.get_issuer().CN, 'The Issuer Monkey') if m2.OPENSSL_VERSION_NUMBER >= 0x90800f: self.assertFalse(cert.check_ca()) self.assertFalse(cert.check_purpose(m2.X509_PURPOSE_SSL_SERVER, 1)) self.assertFalse(cert.check_purpose(m2.X509_PURPOSE_NS_SSL_SERVER, 1)) self.assertTrue(cert.check_purpose(m2.X509_PURPOSE_SSL_SERVER, 0)) self.assertTrue(cert.check_purpose(m2.X509_PURPOSE_NS_SSL_SERVER, 0)) self.assertTrue(cert.check_purpose(m2.X509_PURPOSE_ANY, 0)) else: with self.assertRaises(AttributeError): cert.check_ca() def mkcacert(self, utc): req, pk = self.mkreq(1024, ca=1) pkey = req.get_pubkey() sub = req.get_subject() cert = X509.X509() cert.set_serial_number(1) cert.set_version(2) cert.set_subject(sub) t = int(time.time()) + time.timezone if utc: now = ASN1.ASN1_UTCTIME() else: now = ASN1.ASN1_TIME() now.set_time(t) now_plus_year = ASN1.ASN1_TIME() now_plus_year.set_time(t + 60 * 60 * 24 * 365) cert.set_not_before(now) cert.set_not_after(now_plus_year) issuer = X509.X509_Name() issuer.C = "UK" issuer.CN = "OpenSSL Group" cert.set_issuer(issuer) cert.set_pubkey(pkey) ext = X509.new_extension('basicConstraints', 'CA:TRUE') cert.add_ext(ext) cert.sign(pk, 'sha1') if m2.OPENSSL_VERSION_NUMBER >= 0x0090800f: self.assertTrue(cert.check_ca()) self.assertTrue(cert.check_purpose(m2.X509_PURPOSE_SSL_SERVER, 1)) self.assertTrue(cert.check_purpose(m2.X509_PURPOSE_NS_SSL_SERVER, 1)) self.assertTrue(cert.check_purpose(m2.X509_PURPOSE_ANY, 1)) self.assertTrue(cert.check_purpose(m2.X509_PURPOSE_SSL_SERVER, 0)) self.assertTrue(cert.check_purpose(m2.X509_PURPOSE_NS_SSL_SERVER, 0)) self.assertTrue(cert.check_purpose(m2.X509_PURPOSE_ANY, 0)) else: with self.assertRaises(AttributeError): cert.check_ca() return cert, pk, pkey def test_mkcacert(self): for utc in (True, False): cacert, _, pkey = self.mkcacert(utc) self.assertTrue(cacert.verify(pkey)) def test_mkproxycert(self): for utc in (True, False): cacert, pk1, _ = self.mkcacert(utc) end_entity_cert_req, pk2 = self.mkreq(1024) end_entity_cert = self.make_eecert(cacert, utc) end_entity_cert.set_subject(end_entity_cert_req.get_subject()) end_entity_cert.set_pubkey(end_entity_cert_req.get_pubkey()) end_entity_cert.sign(pk1, 'sha1') proxycert = self.make_proxycert(end_entity_cert, utc) proxycert.sign(pk2, 'sha1') self.assertTrue(proxycert.verify(pk2)) self.assertEqual(proxycert.get_ext_at(0).get_name(), 'proxyCertInfo') self.assertEqual(proxycert.get_ext_at(0).get_value(), 'Path Length Constraint: infinite\n' + 'Policy Language: Inherit all\n') self.assertEqual(proxycert.get_ext_count(), 1, proxycert.get_ext_count()) self.assertEqual(proxycert.get_subject().as_text(), 'C=UK, CN=OpenSSL Group, CN=Proxy') self.assertEqual( proxycert.get_subject().as_text(indent=2, flags=m2.XN_FLAG_RFC2253), ' CN=Proxy,CN=OpenSSL Group,C=UK') @staticmethod def make_eecert(cacert, utc): eecert = X509.X509() eecert.set_serial_number(2) eecert.set_version(2) t = int(time.time()) + time.timezone if utc: now = ASN1.ASN1_UTCTIME() else: now = ASN1.ASN1_TIME() now.set_time(t) now_plus_year = ASN1.ASN1_TIME() now_plus_year.set_time(t + 60 * 60 * 24 * 365) eecert.set_not_before(now) eecert.set_not_after(now_plus_year) eecert.set_issuer(cacert.get_subject()) return eecert def make_proxycert(self, eecert, utc): proxycert = X509.X509() pk2 = EVP.PKey() proxykey = RSA.gen_key(1024, 65537, self.callback) pk2.assign_rsa(proxykey) proxycert.set_pubkey(pk2) proxycert.set_version(2) if utc: not_before = ASN1.ASN1_UTCTIME() not_after = ASN1.ASN1_UTCTIME() else: not_before = ASN1.ASN1_TIME() not_after = ASN1.ASN1_TIME() not_before.set_time(int(time.time())) offset = 12 * 3600 not_after.set_time(int(time.time()) + offset) proxycert.set_not_before(not_before) proxycert.set_not_after(not_after) proxycert.set_issuer_name(eecert.get_subject()) proxycert.set_serial_number(12345678) issuer_name_string = eecert.get_subject().as_text() seq = issuer_name_string.split(",") subject_name = X509.X509_Name() for entry in seq: l = entry.split("=") subject_name.add_entry_by_txt(field=l[0].strip(), type=ASN1.MBSTRING_ASC, entry=l[1], len=-1, loc=-1, set=0) subject_name.add_entry_by_txt(field="CN", type=ASN1.MBSTRING_ASC, entry="Proxy", len=-1, loc=-1, set=0) proxycert.set_subject_name(subject_name) # XXX leaks 8 bytes pci_ext = X509.new_extension("proxyCertInfo", "critical,language:Inherit all", 1) proxycert.add_ext(pci_ext) return proxycert def test_fingerprint(self): x509 = X509.load_cert('tests/x509.pem') fp = x509.get_fingerprint('sha1') self.assertEqual(fp, self.expected_hash) def test_load_der_string(self): with open('tests/x509.der', 'rb') as f: x509 = X509.load_cert_der_string(f.read()) fp = x509.get_fingerprint('sha1') self.assertEqual(fp, self.expected_hash) def test_save_der_string(self): x509 = X509.load_cert('tests/x509.pem') s = x509.as_der() with open('tests/x509.der', 'rb') as f: s2 = f.read() self.assertEqual(s, s2) def test_load(self): x509 = X509.load_cert('tests/x509.pem') x5092 = X509.load_cert('tests/x509.der', format=X509.FORMAT_DER) self.assertEqual(x509.as_text(), x5092.as_text()) self.assertEqual(x509.as_pem(), x5092.as_pem()) self.assertEqual(x509.as_der(), x5092.as_der()) return def test_load_bio(self): with BIO.openfile('tests/x509.pem') as bio: with BIO.openfile('tests/x509.der') as bio2: x509 = X509.load_cert_bio(bio) x5092 = X509.load_cert_bio(bio2, format=X509.FORMAT_DER) with self.assertRaises(ValueError): X509.load_cert_bio(bio2, format=45678) self.assertEqual(x509.as_text(), x5092.as_text()) self.assertEqual(x509.as_pem(), x5092.as_pem()) self.assertEqual(x509.as_der(), x5092.as_der()) def test_load_string(self): with open('tests/x509.pem') as f: s = f.read() with open('tests/x509.der', 'rb') as f2: s2 = f2.read() x509 = X509.load_cert_string(s) x5092 = X509.load_cert_string(s2, X509.FORMAT_DER) self.assertEqual(x509.as_text(), x5092.as_text()) self.assertEqual(x509.as_pem(), x5092.as_pem()) self.assertEqual(x509.as_der(), x5092.as_der()) def test_load_request_bio(self): (req, _) = self.mkreq(1024) r1 = X509.load_request_der_string(req.as_der()) r2 = X509.load_request_string(req.as_der(), X509.FORMAT_DER) r3 = X509.load_request_string(req.as_pem(), X509.FORMAT_PEM) r4 = X509.load_request_bio(BIO.MemoryBuffer(req.as_der()), X509.FORMAT_DER) r5 = X509.load_request_bio(BIO.MemoryBuffer(req.as_pem()), X509.FORMAT_PEM) for r in [r1, r2, r3, r4, r5]: self.assertEqual(req.as_der(), r.as_der()) with self.assertRaises(ValueError): X509.load_request_bio(BIO.MemoryBuffer(req.as_pem()), 345678) def test_save(self): x509 = X509.load_cert('tests/x509.pem') with open('tests/x509.pem', 'r') as f: l_tmp = f.readlines() # -----BEGIN CERTIFICATE----- : -----END CERTIFICATE----- beg_idx = l_tmp.index('-----BEGIN CERTIFICATE-----\n') end_idx = l_tmp.index('-----END CERTIFICATE-----\n') x509_pem = ''.join(l_tmp[beg_idx:end_idx + 1]) with open('tests/x509.der', 'rb') as f: x509_der = f.read() x509.save('tests/tmpcert.pem') with open('tests/tmpcert.pem') as f: s = f.read() self.assertEqual(s, x509_pem) os.remove('tests/tmpcert.pem') x509.save('tests/tmpcert.der', format=X509.FORMAT_DER) with open('tests/tmpcert.der', 'rb') as f: s = f.read() self.assertEqual(s, x509_der) os.remove('tests/tmpcert.der') def test_malformed_data(self): try: with self.assertRaises(X509.X509Error): X509.load_cert_string('Hello') with self.assertRaises(X509.X509Error): X509.load_cert_der_string('Hello') with self.assertRaises(X509.X509Error): X509.new_stack_from_der(b'Hello') with self.assertRaises(X509.X509Error): X509.load_cert('tests/alltests.py') with self.assertRaises(X509.X509Error): X509.load_request('tests/alltests.py') with self.assertRaises(X509.X509Error): X509.load_request_string('Hello') with self.assertRaises(X509.X509Error): X509.load_request_der_string('Hello') with self.assertRaises(X509.X509Error): X509.load_crl('tests/alltests.py') except SystemError: pass def test_long_serial(self): cert = X509.load_cert('tests/long_serial_cert.pem') self.assertEqual(cert.get_serial_number(), 17616841808974579194) cert = X509.load_cert('tests/thawte.pem') self.assertEqual(cert.get_serial_number(), 127614157056681299805556476275995414779) def test_set_long_serial(self): cert = X509.X509() cert.set_serial_number(127614157056681299805556476275995414779) self.assertEqual(cert.get_serial_number(), 127614157056681299805556476275995414779) def test_date_after_2050_working(self): cert = X509.load_cert('tests/bad_date_cert.crt') self.assertEqual(str(cert.get_not_after()), 'Feb 9 14:57:46 2116 GMT') def test_easy_rsa_generated(self): """ Test loading a cert generated by easy RSA. https://github.com/fedora-infra/fedmsg/pull/389 """ # Does this raise an exception? X509.load_cert('tests/easy_rsa.pem') class X509StackTestCase(unittest.TestCase): def test_make_stack_from_der(self): with open("tests/der_encoded_seq.b64", 'rb') as f: b64 = f.read() with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) seq = base64.decodestring(b64) stack = X509.new_stack_from_der(seq) cert = stack.pop() self.assertIsNone(stack.pop()) cert.foobar = 1 self.assertEqual(cert.foobar, 1) subject = cert.get_subject() self.assertEqual( str(subject), "/DC=org/DC=doegrids/OU=Services/CN=host/bosshog.lbl.gov") def test_make_stack_check_num(self): with open("tests/der_encoded_seq.b64", 'rb') as f: b64 = f.read() with warnings.catch_warnings(): warnings.simplefilter('ignore', DeprecationWarning) seq = base64.decodestring(b64) stack = X509.new_stack_from_der(seq) num = len(stack) self.assertEqual(num, 1) cert = stack.pop() num = len(stack) self.assertEqual(num, 0) subject = cert.get_subject() self.assertEqual( str(subject), "/DC=org/DC=doegrids/OU=Services/CN=host/bosshog.lbl.gov") def test_make_stack(self): stack = X509.X509_Stack() cert = X509.load_cert("tests/x509.pem") issuer = X509.load_cert("tests/ca.pem") cert_subject1 = cert.get_subject() issuer_subject1 = issuer.get_subject() stack.push(cert) stack.push(issuer) # Test stack iterator i = 0 for c in stack: i += 1 self.assertGreater(len(c.get_subject().CN), 0) self.assertEqual(i, 2) stack.pop() cert_pop = stack.pop() cert_subject2 = cert_pop.get_subject() issuer_subject2 = issuer.get_subject() self.assertEqual(str(cert_subject1), str(cert_subject2)) self.assertEqual(str(issuer_subject1), str(issuer_subject2)) def test_as_der(self): stack = X509.X509_Stack() cert = X509.load_cert("tests/x509.pem") issuer = X509.load_cert("tests/ca.pem") cert_subject1 = cert.get_subject() issuer_subject1 = issuer.get_subject() stack.push(cert) stack.push(issuer) der_seq = stack.as_der() stack2 = X509.new_stack_from_der(der_seq) stack2.pop() cert_pop = stack2.pop() cert_subject2 = cert_pop.get_subject() issuer_subject2 = issuer.get_subject() self.assertEqual(str(cert_subject1), str(cert_subject2)) self.assertEqual(str(issuer_subject1), str(issuer_subject2)) class X509ExtTestCase(unittest.TestCase): def test_ext(self): if 0: # XXX # With this leaks 8 bytes: name = "proxyCertInfo" value = "critical,language:Inherit all" else: # With this there are no leaks: name = "nsComment" value = "Hello" ctx = m2.x509v3_set_nconf() x509_ext_ptr = m2.x509v3_ext_conf(None, ctx, name, value) X509.X509_Extension(x509_ext_ptr, 1) class CRLTestCase(unittest.TestCase): def test_new(self): crl = X509.CRL() self.assertEqual(crl.as_text()[:34], 'Certificate Revocation List (CRL):') def suite(): st = unittest.TestSuite() st.addTest(unittest.makeSuite(X509TestCase)) st.addTest(unittest.makeSuite(X509StackTestCase)) st.addTest(unittest.makeSuite(X509ExtTestCase)) st.addTest(unittest.makeSuite(CRLTestCase)) return st if __name__ == '__main__': Rand.load_file('randpool.dat', -1) unittest.TextTestRunner().run(suite()) Rand.save_file('randpool.dat') M2Crypto-0.31.0/tests/thawte.pem0000664000175000001440000000277213032674550016711 0ustar matejusers00000000000000-----BEGIN CERTIFICATE----- MIIEKjCCAxKgAwIBAgIQYAGXt0an6rS0mtZLL/eQ+zANBgkqhkiG9w0BAQsFADCB rjELMAkGA1UEBhMCVVMxFTATBgNVBAoTDHRoYXd0ZSwgSW5jLjEoMCYGA1UECxMf Q2VydGlmaWNhdGlvbiBTZXJ2aWNlcyBEaXZpc2lvbjE4MDYGA1UECxMvKGMpIDIw MDggdGhhd3RlLCBJbmMuIC0gRm9yIGF1dGhvcml6ZWQgdXNlIG9ubHkxJDAiBgNV BAMTG3RoYXd0ZSBQcmltYXJ5IFJvb3QgQ0EgLSBHMzAeFw0wODA0MDIwMDAwMDBa Fw0zNzEyMDEyMzU5NTlaMIGuMQswCQYDVQQGEwJVUzEVMBMGA1UEChMMdGhhd3Rl LCBJbmMuMSgwJgYDVQQLEx9DZXJ0aWZpY2F0aW9uIFNlcnZpY2VzIERpdmlzaW9u MTgwNgYDVQQLEy8oYykgMjAwOCB0aGF3dGUsIEluYy4gLSBGb3IgYXV0aG9yaXpl ZCB1c2Ugb25seTEkMCIGA1UEAxMbdGhhd3RlIFByaW1hcnkgUm9vdCBDQSAtIEcz MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsr8nLPvb2FvdeHsbnndm gcs+vHyu86YnmjSjaDFxODNi5PNxZnmxqWWjpYvVj2AtP0LMqmsywCPLLEHd5N/8 YZzic7IilRFDGF/Eth9XbAoFWCLINkw6fKXRz4aviKdEAhN0cXMKQlkC+BsUa0Lf b1+6a4KinVvnSr0eAXLbS3ToO39/fR8EtCab4LRarEc9VbjXsCZSKAExQGbY2SS9 9irY7CFJXJv2eul/VTV+lmuNk5Mny5K76qxAwJ/C+IDPXfRa3M50hqY+bAtTyr2S zhkGcuYMXDhpxwTWvGzOW/b3aJzcJRVIiKHpqfiYnODz1TEoYRFsZ5aNOZnLwkUk OQIDAQABo0IwQDAPBgNVHRMBAf8EBTADAQH/MA4GA1UdDwEB/wQEAwIBBjAdBgNV HQ4EFgQUrWyqlGCc7eT/+j4KdCtjA/e2Wb8wDQYJKoZIhvcNAQELBQADggEBABpA 2JVlrAmSicY59BDlqQ5mU1143vokkbvnRFHfxhY0Cu9qRFHqKweKA3rD6z8KLFIW oCtDuSWQP3CpMyVtRRooOyfPqsMpQhvfO0zAMzRbQYi/aytlryjvsvXDqmbOe1bu t8jLZ8HJnBoYuMTDSQPxYA5QzUbF83d597YV4Djbxy8ooAw/dyZ02SUS2jHaGh7c KUGRIjxpp7sC8rZcJwOJ9Abqm+RyguOhCcHpABnTPtRwa7pxpqpYrvS76Wy274fM m7v/OeZWYdMKp8RcTGB7BXcmer/YB1IsYvdwY9k5vG8cwnncdimvzsUsZAReiDZu MdRAGmI0Nj81Aa6sY6A= -----END CERTIFICATE----- M2Crypto-0.31.0/tests/vendor/0000755000175000001440000000000013371124434016172 5ustar matejusers00000000000000M2Crypto-0.31.0/tests/vendor/unittest2/0000755000175000001440000000000013371124434020133 5ustar matejusers00000000000000M2Crypto-0.31.0/tests/vendor/unittest2/__init__.py0000664000175000001440000000454613234434752022264 0ustar matejusers00000000000000""" unittest2 unittest2 is a backport of the new features added to the unittest testing framework in Python 2.7. It is tested to run on Python 2.4 - 2.6. To use unittest2 instead of unittest simply replace ``import unittest`` with ``import unittest2``. Copyright (c) 1999-2003 Steve Purcell Copyright (c) 2003-2010 Python Software Foundation This module is free software, and you may redistribute it and/or modify it under the same terms as Python itself, so long as this copyright message and disclaimer are retained in their original form. IN NO EVENT SHALL THE AUTHOR BE LIABLE TO ANY PARTY FOR DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OF THIS CODE, EVEN IF THE AUTHOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. THE AUTHOR SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE CODE PROVIDED HEREUNDER IS ON AN "AS IS" BASIS, AND THERE IS NO OBLIGATION WHATSOEVER TO PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS. """ __all__ = ['TestResult', 'TestCase', 'TestSuite', 'TextTestRunner', 'TestLoader', 'FunctionTestCase', 'main', 'defaultTestLoader', 'SkipTest', 'skip', 'skipIf', 'skipUnless', 'expectedFailure', 'TextTestResult', '__version__', 'collector'] __version__ = '0.5.1' # Expose obsolete functions for backwards compatibility __all__.extend(['getTestCaseNames', 'makeSuite', 'findTestCases']) from unittest2.collector import collector from unittest2.result import TestResult from unittest2.case import ( TestCase, FunctionTestCase, SkipTest, skip, skipIf, skipUnless, expectedFailure ) from unittest2.suite import BaseTestSuite, TestSuite from unittest2.loader import ( TestLoader, defaultTestLoader, makeSuite, getTestCaseNames, findTestCases ) from unittest2.main import TestProgram, main, main_ from unittest2.runner import TextTestRunner, TextTestResult try: from unittest2.signals import ( installHandler, registerResult, removeResult, removeHandler ) except ImportError: # Compatibility with platforms that don't have the signal module pass else: __all__.extend(['installHandler', 'registerResult', 'removeResult', 'removeHandler']) # deprecated _TextTestResult = TextTestResult __unittest = TrueM2Crypto-0.31.0/tests/vendor/unittest2/__main__.py0000664000175000001440000000024613234434752022236 0ustar matejusers00000000000000"""Main entry point""" import sys if sys.argv[0].endswith("__main__.py"): sys.argv[0] = "unittest2" __unittest = True from unittest2.main import main_ main_() M2Crypto-0.31.0/tests/vendor/unittest2/case.py0000664000175000001440000012343413234434752021436 0ustar matejusers00000000000000"""Test case implementation""" import sys import difflib import pprint import re import unittest import warnings from unittest2 import result from unittest2.util import ( safe_repr, safe_str, strclass, unorderable_list_difference ) from unittest2.compatibility import wraps __unittest = True DIFF_OMITTED = ('\nDiff is %s characters long. ' 'Set self.maxDiff to None to see it.') class SkipTest(Exception): """ Raise this exception in a test to skip it. Usually you can use TestResult.skip() or one of the skipping decorators instead of raising this directly. """ class _ExpectedFailure(Exception): """ Raise this when a test is expected to fail. This is an implementation detail. """ def __init__(self, exc_info): # can't use super because Python 2.4 exceptions are old style Exception.__init__(self) self.exc_info = exc_info class _UnexpectedSuccess(Exception): """ The test was supposed to fail, but it didn't! """ def _id(obj): return obj def skip(reason): """ Unconditionally skip a test. """ def decorator(test_item): if not (isinstance(test_item, type) and issubclass(test_item, TestCase)): @wraps(test_item) def skip_wrapper(*args, **kwargs): raise SkipTest(reason) test_item = skip_wrapper test_item.__unittest_skip__ = True test_item.__unittest_skip_why__ = reason return test_item return decorator def skipIf(condition, reason): """ Skip a test if the condition is true. """ if condition: return skip(reason) return _id def skipUnless(condition, reason): """ Skip a test unless the condition is true. """ if not condition: return skip(reason) return _id def expectedFailure(func): @wraps(func) def wrapper(*args, **kwargs): try: func(*args, **kwargs) except Exception: raise _ExpectedFailure(sys.exc_info()) raise _UnexpectedSuccess return wrapper class _AssertRaisesContext(object): """A context manager used to implement TestCase.assertRaises* methods.""" def __init__(self, expected, test_case, expected_regexp=None): self.expected = expected self.failureException = test_case.failureException self.expected_regexp = expected_regexp def __enter__(self): return self def __exit__(self, exc_type, exc_value, tb): if exc_type is None: try: exc_name = self.expected.__name__ except AttributeError: exc_name = str(self.expected) raise self.failureException( "%s not raised" % (exc_name,)) if not issubclass(exc_type, self.expected): # let unexpected exceptions pass through return False self.exception = exc_value # store for later retrieval if self.expected_regexp is None: return True expected_regexp = self.expected_regexp if isinstance(expected_regexp, basestring): expected_regexp = re.compile(expected_regexp) if not expected_regexp.search(str(exc_value)): raise self.failureException('"%s" does not match "%s"' % (expected_regexp.pattern, str(exc_value))) return True class _TypeEqualityDict(object): def __init__(self, testcase): self.testcase = testcase self._store = {} def __setitem__(self, key, value): self._store[key] = value def __getitem__(self, key): value = self._store[key] if isinstance(value, basestring): return getattr(self.testcase, value) return value def get(self, key, default=None): if key in self._store: return self[key] return default class TestCase(unittest.TestCase): """A class whose instances are single test cases. By default, the test code itself should be placed in a method named 'runTest'. If the fixture may be used for many test cases, create as many test methods as are needed. When instantiating such a TestCase subclass, specify in the constructor arguments the name of the test method that the instance is to execute. Test authors should subclass TestCase for their own tests. Construction and deconstruction of the test's environment ('fixture') can be implemented by overriding the 'setUp' and 'tearDown' methods respectively. If it is necessary to override the __init__ method, the base class __init__ method must always be called. It is important that subclasses should not change the signature of their __init__ method, since instances of the classes are instantiated automatically by parts of the framework in order to be run. """ # This attribute determines which exception will be raised when # the instance's assertion methods fail; test methods raising this # exception will be deemed to have 'failed' rather than 'errored' failureException = AssertionError # This attribute sets the maximum length of a diff in failure messages # by assert methods using difflib. It is looked up as an instance attribute # so can be configured by individual tests if required. maxDiff = 80*8 # This attribute determines whether long messages (including repr of # objects used in assert methods) will be printed on failure in *addition* # to any explicit message passed. longMessage = True # Attribute used by TestSuite for classSetUp _classSetupFailed = False def __init__(self, methodName='runTest'): """Create an instance of the class that will use the named test method when executed. Raises a ValueError if the instance does not have a method with the specified name. """ self._testMethodName = methodName self._resultForDoCleanups = None try: testMethod = getattr(self, methodName) except AttributeError: raise ValueError("no such test method in %s: %s" % \ (self.__class__, methodName)) self._testMethodDoc = testMethod.__doc__ self._cleanups = [] # Map types to custom assertEqual functions that will compare # instances of said type in more detail to generate a more useful # error message. self._type_equality_funcs = _TypeEqualityDict(self) self.addTypeEqualityFunc(dict, 'assertDictEqual') self.addTypeEqualityFunc(list, 'assertListEqual') self.addTypeEqualityFunc(tuple, 'assertTupleEqual') self.addTypeEqualityFunc(set, 'assertSetEqual') self.addTypeEqualityFunc(frozenset, 'assertSetEqual') self.addTypeEqualityFunc(unicode, 'assertMultiLineEqual') def addTypeEqualityFunc(self, typeobj, function): """Add a type specific assertEqual style function to compare a type. This method is for use by TestCase subclasses that need to register their own type equality functions to provide nicer error messages. Args: typeobj: The data type to call this function on when both values are of the same type in assertEqual(). function: The callable taking two arguments and an optional msg= argument that raises self.failureException with a useful error message when the two arguments are not equal. """ self._type_equality_funcs[typeobj] = function def addCleanup(self, function, *args, **kwargs): """Add a function, with arguments, to be called when the test is completed. Functions added are called on a LIFO basis and are called after tearDown on test failure or success. Cleanup items are called even if setUp fails (unlike tearDown).""" self._cleanups.append((function, args, kwargs)) def setUp(self): "Hook method for setting up the test fixture before exercising it." @classmethod def setUpClass(cls): "Hook method for setting up class fixture before running tests in the class." @classmethod def tearDownClass(cls): "Hook method for deconstructing the class fixture after running all tests in the class." def tearDown(self): "Hook method for deconstructing the test fixture after testing it." def countTestCases(self): return 1 def defaultTestResult(self): return result.TestResult() def shortDescription(self): """Returns a one-line description of the test, or None if no description has been provided. The default implementation of this method returns the first line of the specified test method's docstring. """ doc = self._testMethodDoc return doc and doc.split("\n")[0].strip() or None def id(self): return "%s.%s" % (strclass(self.__class__), self._testMethodName) def __eq__(self, other): if type(self) is not type(other): return NotImplemented return self._testMethodName == other._testMethodName def __ne__(self, other): return not self == other def __hash__(self): return hash((type(self), self._testMethodName)) def __str__(self): return "%s (%s)" % (self._testMethodName, strclass(self.__class__)) def __repr__(self): return "<%s testMethod=%s>" % \ (strclass(self.__class__), self._testMethodName) def _addSkip(self, result, reason): addSkip = getattr(result, 'addSkip', None) if addSkip is not None: addSkip(self, reason) else: warnings.warn("Use of a TestResult without an addSkip method is deprecated", DeprecationWarning, 2) result.addSuccess(self) def run(self, result=None): orig_result = result if result is None: result = self.defaultTestResult() startTestRun = getattr(result, 'startTestRun', None) if startTestRun is not None: startTestRun() self._resultForDoCleanups = result result.startTest(self) testMethod = getattr(self, self._testMethodName) if (getattr(self.__class__, "__unittest_skip__", False) or getattr(testMethod, "__unittest_skip__", False)): # If the class or method was skipped. try: skip_why = (getattr(self.__class__, '__unittest_skip_why__', '') or getattr(testMethod, '__unittest_skip_why__', '')) self._addSkip(result, skip_why) finally: result.stopTest(self) return try: success = False try: self.setUp() except SkipTest, e: self._addSkip(result, str(e)) except Exception: result.addError(self, sys.exc_info()) else: try: testMethod() except self.failureException: result.addFailure(self, sys.exc_info()) except _ExpectedFailure, e: addExpectedFailure = getattr(result, 'addExpectedFailure', None) if addExpectedFailure is not None: addExpectedFailure(self, e.exc_info) else: warnings.warn("Use of a TestResult without an addExpectedFailure method is deprecated", DeprecationWarning) result.addSuccess(self) except _UnexpectedSuccess: addUnexpectedSuccess = getattr(result, 'addUnexpectedSuccess', None) if addUnexpectedSuccess is not None: addUnexpectedSuccess(self) else: warnings.warn("Use of a TestResult without an addUnexpectedSuccess method is deprecated", DeprecationWarning) result.addFailure(self, sys.exc_info()) except SkipTest, e: self._addSkip(result, str(e)) except Exception: result.addError(self, sys.exc_info()) else: success = True try: self.tearDown() except Exception: result.addError(self, sys.exc_info()) success = False cleanUpSuccess = self.doCleanups() success = success and cleanUpSuccess if success: result.addSuccess(self) finally: result.stopTest(self) if orig_result is None: stopTestRun = getattr(result, 'stopTestRun', None) if stopTestRun is not None: stopTestRun() def doCleanups(self): """Execute all cleanup functions. Normally called for you after tearDown.""" result = self._resultForDoCleanups ok = True while self._cleanups: function, args, kwargs = self._cleanups.pop(-1) try: function(*args, **kwargs) except Exception: ok = False result.addError(self, sys.exc_info()) return ok def __call__(self, *args, **kwds): return self.run(*args, **kwds) def debug(self): """Run the test without collecting errors in a TestResult""" self.setUp() getattr(self, self._testMethodName)() self.tearDown() while self._cleanups: function, args, kwargs = self._cleanups.pop(-1) function(*args, **kwargs) def skipTest(self, reason): """Skip this test.""" raise SkipTest(reason) def fail(self, msg=None): """Fail immediately, with the given message.""" raise self.failureException(msg) def assertFalse(self, expr, msg=None): "Fail the test if the expression is true." if expr: msg = self._formatMessage(msg, "%s is not False" % safe_repr(expr)) raise self.failureException(msg) def assertTrue(self, expr, msg=None): """Fail the test unless the expression is true.""" if not expr: msg = self._formatMessage(msg, "%s is not True" % safe_repr(expr)) raise self.failureException(msg) def _formatMessage(self, msg, standardMsg): """Honour the longMessage attribute when generating failure messages. If longMessage is False this means: * Use only an explicit message if it is provided * Otherwise use the standard message for the assert If longMessage is True: * Use the standard message * If an explicit message is provided, plus ' : ' and the explicit message """ if not self.longMessage: return msg or standardMsg if msg is None: return standardMsg try: return '%s : %s' % (standardMsg, msg) except UnicodeDecodeError: return '%s : %s' % (safe_str(standardMsg), safe_str(msg)) def assertRaises(self, excClass, callableObj=None, *args, **kwargs): """Fail unless an exception of class excClass is thrown by callableObj when invoked with arguments args and keyword arguments kwargs. If a different type of exception is thrown, it will not be caught, and the test case will be deemed to have suffered an error, exactly as for an unexpected exception. If called with callableObj omitted or None, will return a context object used like this:: with self.assertRaises(SomeException): do_something() The context manager keeps a reference to the exception as the 'exception' attribute. This allows you to inspect the exception after the assertion:: with self.assertRaises(SomeException) as cm: do_something() the_exception = cm.exception self.assertEqual(the_exception.error_code, 3) """ if callableObj is None: return _AssertRaisesContext(excClass, self) try: callableObj(*args, **kwargs) except excClass: return if hasattr(excClass,'__name__'): excName = excClass.__name__ else: excName = str(excClass) raise self.failureException, "%s not raised" % excName def _getAssertEqualityFunc(self, first, second): """Get a detailed comparison function for the types of the two args. Returns: A callable accepting (first, second, msg=None) that will raise a failure exception if first != second with a useful human readable error message for those types. """ # # NOTE(gregory.p.smith): I considered isinstance(first, type(second)) # and vice versa. I opted for the conservative approach in case # subclasses are not intended to be compared in detail to their super # class instances using a type equality func. This means testing # subtypes won't automagically use the detailed comparison. Callers # should use their type specific assertSpamEqual method to compare # subclasses if the detailed comparison is desired and appropriate. # See the discussion in http://bugs.python.org/issue2578. # if type(first) is type(second): asserter = self._type_equality_funcs.get(type(first)) if asserter is not None: return asserter return self._baseAssertEqual def _baseAssertEqual(self, first, second, msg=None): """The default assertEqual implementation, not type specific.""" if not first == second: standardMsg = '%s != %s' % (safe_repr(first), safe_repr(second)) msg = self._formatMessage(msg, standardMsg) raise self.failureException(msg) def assertEqual(self, first, second, msg=None): """Fail if the two objects are unequal as determined by the '==' operator. """ assertion_func = self._getAssertEqualityFunc(first, second) assertion_func(first, second, msg=msg) def assertNotEqual(self, first, second, msg=None): """Fail if the two objects are equal as determined by the '==' operator. """ if not first != second: msg = self._formatMessage(msg, '%s == %s' % (safe_repr(first), safe_repr(second))) raise self.failureException(msg) def assertAlmostEqual(self, first, second, places=None, msg=None, delta=None): """Fail if the two objects are unequal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the between the two objects is more than the given delta. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit). If the two objects compare equal then they will automatically compare almost equal. """ if first == second: # shortcut return if delta is not None and places is not None: raise TypeError("specify delta or places not both") if delta is not None: if abs(first - second) <= delta: return standardMsg = '%s != %s within %s delta' % (safe_repr(first), safe_repr(second), safe_repr(delta)) else: if places is None: places = 7 if round(abs(second-first), places) == 0: return standardMsg = '%s != %s within %r places' % (safe_repr(first), safe_repr(second), places) msg = self._formatMessage(msg, standardMsg) raise self.failureException(msg) def assertNotAlmostEqual(self, first, second, places=None, msg=None, delta=None): """Fail if the two objects are equal as determined by their difference rounded to the given number of decimal places (default 7) and comparing to zero, or by comparing that the between the two objects is less than the given delta. Note that decimal places (from zero) are usually not the same as significant digits (measured from the most signficant digit). Objects that are equal automatically fail. """ if delta is not None and places is not None: raise TypeError("specify delta or places not both") if delta is not None: if not (first == second) and abs(first - second) > delta: return standardMsg = '%s == %s within %s delta' % (safe_repr(first), safe_repr(second), safe_repr(delta)) else: if places is None: places = 7 if not (first == second) and round(abs(second-first), places) != 0: return standardMsg = '%s == %s within %r places' % (safe_repr(first), safe_repr(second), places) msg = self._formatMessage(msg, standardMsg) raise self.failureException(msg) # Synonyms for assertion methods # The plurals are undocumented. Keep them that way to discourage use. # Do not add more. Do not remove. # Going through a deprecation cycle on these would annoy many people. assertEquals = assertEqual assertNotEquals = assertNotEqual assertAlmostEquals = assertAlmostEqual assertNotAlmostEquals = assertNotAlmostEqual assert_ = assertTrue # These fail* assertion method names are pending deprecation and will # be a DeprecationWarning in 3.2; http://bugs.python.org/issue2578 def _deprecate(original_func): def deprecated_func(*args, **kwargs): warnings.warn( ('Please use %s instead.' % original_func.__name__), PendingDeprecationWarning, 2) return original_func(*args, **kwargs) return deprecated_func failUnlessEqual = _deprecate(assertEqual) failIfEqual = _deprecate(assertNotEqual) failUnlessAlmostEqual = _deprecate(assertAlmostEqual) failIfAlmostEqual = _deprecate(assertNotAlmostEqual) failUnless = _deprecate(assertTrue) failUnlessRaises = _deprecate(assertRaises) failIf = _deprecate(assertFalse) def assertSequenceEqual(self, seq1, seq2, msg=None, seq_type=None, max_diff=80*8): """An equality assertion for ordered sequences (like lists and tuples). For the purposes of this function, a valid ordered sequence type is one which can be indexed, has a length, and has an equality operator. Args: seq1: The first sequence to compare. seq2: The second sequence to compare. seq_type: The expected datatype of the sequences, or None if no datatype should be enforced. msg: Optional message to use on failure instead of a list of differences. max_diff: Maximum size off the diff, larger diffs are not shown """ if seq_type is not None: seq_type_name = seq_type.__name__ if not isinstance(seq1, seq_type): raise self.failureException('First sequence is not a %s: %s' % (seq_type_name, safe_repr(seq1))) if not isinstance(seq2, seq_type): raise self.failureException('Second sequence is not a %s: %s' % (seq_type_name, safe_repr(seq2))) else: seq_type_name = "sequence" differing = None try: len1 = len(seq1) except (TypeError, NotImplementedError): differing = 'First %s has no length. Non-sequence?' % ( seq_type_name) if differing is None: try: len2 = len(seq2) except (TypeError, NotImplementedError): differing = 'Second %s has no length. Non-sequence?' % ( seq_type_name) if differing is None: if seq1 == seq2: return seq1_repr = repr(seq1) seq2_repr = repr(seq2) if len(seq1_repr) > 30: seq1_repr = seq1_repr[:30] + '...' if len(seq2_repr) > 30: seq2_repr = seq2_repr[:30] + '...' elements = (seq_type_name.capitalize(), seq1_repr, seq2_repr) differing = '%ss differ: %s != %s\n' % elements for i in xrange(min(len1, len2)): try: item1 = seq1[i] except (TypeError, IndexError, NotImplementedError): differing += ('\nUnable to index element %d of first %s\n' % (i, seq_type_name)) break try: item2 = seq2[i] except (TypeError, IndexError, NotImplementedError): differing += ('\nUnable to index element %d of second %s\n' % (i, seq_type_name)) break if item1 != item2: differing += ('\nFirst differing element %d:\n%s\n%s\n' % (i, item1, item2)) break else: if (len1 == len2 and seq_type is None and type(seq1) != type(seq2)): # The sequences are the same, but have differing types. return if len1 > len2: differing += ('\nFirst %s contains %d additional ' 'elements.\n' % (seq_type_name, len1 - len2)) try: differing += ('First extra element %d:\n%s\n' % (len2, seq1[len2])) except (TypeError, IndexError, NotImplementedError): differing += ('Unable to index element %d ' 'of first %s\n' % (len2, seq_type_name)) elif len1 < len2: differing += ('\nSecond %s contains %d additional ' 'elements.\n' % (seq_type_name, len2 - len1)) try: differing += ('First extra element %d:\n%s\n' % (len1, seq2[len1])) except (TypeError, IndexError, NotImplementedError): differing += ('Unable to index element %d ' 'of second %s\n' % (len1, seq_type_name)) standardMsg = differing diffMsg = '\n' + '\n'.join( difflib.ndiff(pprint.pformat(seq1).splitlines(), pprint.pformat(seq2).splitlines())) standardMsg = self._truncateMessage(standardMsg, diffMsg) msg = self._formatMessage(msg, standardMsg) self.fail(msg) def _truncateMessage(self, message, diff): max_diff = self.maxDiff if max_diff is None or len(diff) <= max_diff: return message + diff return message + (DIFF_OMITTED % len(diff)) def assertListEqual(self, list1, list2, msg=None): """A list-specific equality assertion. Args: list1: The first list to compare. list2: The second list to compare. msg: Optional message to use on failure instead of a list of differences. """ self.assertSequenceEqual(list1, list2, msg, seq_type=list) def assertTupleEqual(self, tuple1, tuple2, msg=None): """A tuple-specific equality assertion. Args: tuple1: The first tuple to compare. tuple2: The second tuple to compare. msg: Optional message to use on failure instead of a list of differences. """ self.assertSequenceEqual(tuple1, tuple2, msg, seq_type=tuple) def assertSetEqual(self, set1, set2, msg=None): """A set-specific equality assertion. Args: set1: The first set to compare. set2: The second set to compare. msg: Optional message to use on failure instead of a list of differences. assertSetEqual uses ducktyping to support different types of sets, and is optimized for sets specifically (parameters must support a difference method). """ try: difference1 = set1.difference(set2) except TypeError, e: self.fail('invalid type when attempting set difference: %s' % e) except AttributeError, e: self.fail('first argument does not support set difference: %s' % e) try: difference2 = set2.difference(set1) except TypeError, e: self.fail('invalid type when attempting set difference: %s' % e) except AttributeError, e: self.fail('second argument does not support set difference: %s' % e) if not (difference1 or difference2): return lines = [] if difference1: lines.append('Items in the first set but not the second:') for item in difference1: lines.append(repr(item)) if difference2: lines.append('Items in the second set but not the first:') for item in difference2: lines.append(repr(item)) standardMsg = '\n'.join(lines) self.fail(self._formatMessage(msg, standardMsg)) def assertIn(self, member, container, msg=None): """Just like self.assertTrue(a in b), but with a nicer default message.""" if member not in container: standardMsg = '%s not found in %s' % (safe_repr(member), safe_repr(container)) self.fail(self._formatMessage(msg, standardMsg)) def assertNotIn(self, member, container, msg=None): """Just like self.assertTrue(a not in b), but with a nicer default message.""" if member in container: standardMsg = '%s unexpectedly found in %s' % (safe_repr(member), safe_repr(container)) self.fail(self._formatMessage(msg, standardMsg)) def assertIs(self, expr1, expr2, msg=None): """Just like self.assertTrue(a is b), but with a nicer default message.""" if expr1 is not expr2: standardMsg = '%s is not %s' % (safe_repr(expr1), safe_repr(expr2)) self.fail(self._formatMessage(msg, standardMsg)) def assertIsNot(self, expr1, expr2, msg=None): """Just like self.assertTrue(a is not b), but with a nicer default message.""" if expr1 is expr2: standardMsg = 'unexpectedly identical: %s' % (safe_repr(expr1),) self.fail(self._formatMessage(msg, standardMsg)) def assertDictEqual(self, d1, d2, msg=None): self.assert_(isinstance(d1, dict), 'First argument is not a dictionary') self.assert_(isinstance(d2, dict), 'Second argument is not a dictionary') if d1 != d2: standardMsg = '%s != %s' % (safe_repr(d1, True), safe_repr(d2, True)) diff = ('\n' + '\n'.join(difflib.ndiff( pprint.pformat(d1).splitlines(), pprint.pformat(d2).splitlines()))) standardMsg = self._truncateMessage(standardMsg, diff) self.fail(self._formatMessage(msg, standardMsg)) def assertDictContainsSubset(self, expected, actual, msg=None): """Checks whether actual is a superset of expected.""" missing = [] mismatched = [] for key, value in expected.iteritems(): if key not in actual: missing.append(key) elif value != actual[key]: mismatched.append('%s, expected: %s, actual: %s' % (safe_repr(key), safe_repr(value), safe_repr(actual[key]))) if not (missing or mismatched): return standardMsg = '' if missing: standardMsg = 'Missing: %s' % ','.join(safe_repr(m) for m in missing) if mismatched: if standardMsg: standardMsg += '; ' standardMsg += 'Mismatched values: %s' % ','.join(mismatched) self.fail(self._formatMessage(msg, standardMsg)) def assertItemsEqual(self, expected_seq, actual_seq, msg=None): """An unordered sequence specific comparison. It asserts that expected_seq and actual_seq contain the same elements. It is the equivalent of:: self.assertEqual(sorted(expected_seq), sorted(actual_seq)) Raises with an error message listing which elements of expected_seq are missing from actual_seq and vice versa if any. Asserts that each element has the same count in both sequences. Example: - [0, 1, 1] and [1, 0, 1] compare equal. - [0, 0, 1] and [0, 1] compare unequal. """ try: expected = sorted(expected_seq) actual = sorted(actual_seq) except TypeError: # Unsortable items (example: set(), complex(), ...) expected = list(expected_seq) actual = list(actual_seq) missing, unexpected = unorderable_list_difference( expected, actual, ignore_duplicate=False ) else: return self.assertSequenceEqual(expected, actual, msg=msg) errors = [] if missing: errors.append('Expected, but missing:\n %s' % safe_repr(missing)) if unexpected: errors.append('Unexpected, but present:\n %s' % safe_repr(unexpected)) if errors: standardMsg = '\n'.join(errors) self.fail(self._formatMessage(msg, standardMsg)) def assertMultiLineEqual(self, first, second, msg=None): """Assert that two multi-line strings are equal.""" self.assert_(isinstance(first, basestring), ( 'First argument is not a string')) self.assert_(isinstance(second, basestring), ( 'Second argument is not a string')) if first != second: standardMsg = '%s != %s' % (safe_repr(first, True), safe_repr(second, True)) diff = '\n' + ''.join(difflib.ndiff(first.splitlines(True), second.splitlines(True))) standardMsg = self._truncateMessage(standardMsg, diff) self.fail(self._formatMessage(msg, standardMsg)) def assertLess(self, a, b, msg=None): """Just like self.assertTrue(a < b), but with a nicer default message.""" if not a < b: standardMsg = '%s not less than %s' % (safe_repr(a), safe_repr(b)) self.fail(self._formatMessage(msg, standardMsg)) def assertLessEqual(self, a, b, msg=None): """Just like self.assertTrue(a <= b), but with a nicer default message.""" if not a <= b: standardMsg = '%s not less than or equal to %s' % (safe_repr(a), safe_repr(b)) self.fail(self._formatMessage(msg, standardMsg)) def assertGreater(self, a, b, msg=None): """Just like self.assertTrue(a > b), but with a nicer default message.""" if not a > b: standardMsg = '%s not greater than %s' % (safe_repr(a), safe_repr(b)) self.fail(self._formatMessage(msg, standardMsg)) def assertGreaterEqual(self, a, b, msg=None): """Just like self.assertTrue(a >= b), but with a nicer default message.""" if not a >= b: standardMsg = '%s not greater than or equal to %s' % (safe_repr(a), safe_repr(b)) self.fail(self._formatMessage(msg, standardMsg)) def assertIsNone(self, obj, msg=None): """Same as self.assertTrue(obj is None), with a nicer default message.""" if obj is not None: standardMsg = '%s is not None' % (safe_repr(obj),) self.fail(self._formatMessage(msg, standardMsg)) def assertIsNotNone(self, obj, msg=None): """Included for symmetry with assertIsNone.""" if obj is None: standardMsg = 'unexpectedly None' self.fail(self._formatMessage(msg, standardMsg)) def assertIsInstance(self, obj, cls, msg=None): """Same as self.assertTrue(isinstance(obj, cls)), with a nicer default message.""" if not isinstance(obj, cls): standardMsg = '%s is not an instance of %r' % (safe_repr(obj), cls) self.fail(self._formatMessage(msg, standardMsg)) def assertNotIsInstance(self, obj, cls, msg=None): """Included for symmetry with assertIsInstance.""" if isinstance(obj, cls): standardMsg = '%s is an instance of %r' % (safe_repr(obj), cls) self.fail(self._formatMessage(msg, standardMsg)) def assertRaisesRegexp(self, expected_exception, expected_regexp, callable_obj=None, *args, **kwargs): """Asserts that the message in a raised exception matches a regexp. Args: expected_exception: Exception class expected to be raised. expected_regexp: Regexp (re pattern object or string) expected to be found in error message. callable_obj: Function to be called. args: Extra args. kwargs: Extra kwargs. """ if callable_obj is None: return _AssertRaisesContext(expected_exception, self, expected_regexp) try: callable_obj(*args, **kwargs) except expected_exception, exc_value: if isinstance(expected_regexp, basestring): expected_regexp = re.compile(expected_regexp) if not expected_regexp.search(str(exc_value)): raise self.failureException('"%s" does not match "%s"' % (expected_regexp.pattern, str(exc_value))) else: if hasattr(expected_exception, '__name__'): excName = expected_exception.__name__ else: excName = str(expected_exception) raise self.failureException, "%s not raised" % excName def assertRegexpMatches(self, text, expected_regexp, msg=None): """Fail the test unless the text matches the regular expression.""" if isinstance(expected_regexp, basestring): expected_regexp = re.compile(expected_regexp) if not expected_regexp.search(text): msg = msg or "Regexp didn't match" msg = '%s: %r not found in %r' % (msg, expected_regexp.pattern, text) raise self.failureException(msg) def assertNotRegexpMatches(self, text, unexpected_regexp, msg=None): """Fail the test if the text matches the regular expression.""" if isinstance(unexpected_regexp, basestring): unexpected_regexp = re.compile(unexpected_regexp) match = unexpected_regexp.search(text) if match: msg = msg or "Regexp matched" msg = '%s: %r matches %r in %r' % (msg, text[match.start():match.end()], unexpected_regexp.pattern, text) raise self.failureException(msg) class FunctionTestCase(TestCase): """A test case that wraps a test function. This is useful for slipping pre-existing test functions into the unittest framework. Optionally, set-up and tidy-up functions can be supplied. As with TestCase, the tidy-up ('tearDown') function will always be called if the set-up ('setUp') function ran successfully. """ def __init__(self, testFunc, setUp=None, tearDown=None, description=None): super(FunctionTestCase, self).__init__() self._setUpFunc = setUp self._tearDownFunc = tearDown self._testFunc = testFunc self._description = description def setUp(self): if self._setUpFunc is not None: self._setUpFunc() def tearDown(self): if self._tearDownFunc is not None: self._tearDownFunc() def runTest(self): self._testFunc() def id(self): return self._testFunc.__name__ def __eq__(self, other): if not isinstance(other, self.__class__): return NotImplemented return self._setUpFunc == other._setUpFunc and \ self._tearDownFunc == other._tearDownFunc and \ self._testFunc == other._testFunc and \ self._description == other._description def __ne__(self, other): return not self == other def __hash__(self): return hash((type(self), self._setUpFunc, self._tearDownFunc, self._testFunc, self._description)) def __str__(self): return "%s (%s)" % (strclass(self.__class__), self._testFunc.__name__) def __repr__(self): return "<%s testFunc=%s>" % (strclass(self.__class__), self._testFunc) def shortDescription(self): if self._description is not None: return self._description doc = self._testFunc.__doc__ return doc and doc.split("\n")[0].strip() or None M2Crypto-0.31.0/tests/vendor/unittest2/collector.py0000664000175000001440000000044113234434752022501 0ustar matejusers00000000000000import os import sys from unittest2.loader import defaultTestLoader def collector(): # import __main__ triggers code re-execution __main__ = sys.modules['__main__'] setupDir = os.path.abspath(os.path.dirname(__main__.__file__)) return defaultTestLoader.discover(setupDir) M2Crypto-0.31.0/tests/vendor/unittest2/compatibility.py0000664000175000001440000000406413234434752023371 0ustar matejusers00000000000000import os import sys try: from functools import wraps except ImportError: # only needed for Python 2.4 def wraps(_): def _wraps(func): return func return _wraps __unittest = True def _relpath_nt(path, start=os.path.curdir): """Return a relative version of a path""" if not path: raise ValueError("no path specified") start_list = os.path.abspath(start).split(os.path.sep) path_list = os.path.abspath(path).split(os.path.sep) if start_list[0].lower() != path_list[0].lower(): unc_path, rest = os.path.splitunc(path) unc_start, rest = os.path.splitunc(start) if bool(unc_path) ^ bool(unc_start): raise ValueError("Cannot mix UNC and non-UNC paths (%s and %s)" % (path, start)) else: raise ValueError("path is on drive %s, start on drive %s" % (path_list[0], start_list[0])) # Work out how much of the filepath is shared by start and path. for i in range(min(len(start_list), len(path_list))): if start_list[i].lower() != path_list[i].lower(): break else: i += 1 rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:] if not rel_list: return os.path.curdir return os.path.join(*rel_list) # default to posixpath definition def _relpath_posix(path, start=os.path.curdir): """Return a relative version of a path""" if not path: raise ValueError("no path specified") start_list = os.path.abspath(start).split(os.path.sep) path_list = os.path.abspath(path).split(os.path.sep) # Work out how much of the filepath is shared by start and path. i = len(os.path.commonprefix([start_list, path_list])) rel_list = [os.path.pardir] * (len(start_list)-i) + path_list[i:] if not rel_list: return os.path.curdir return os.path.join(*rel_list) if os.path is sys.modules.get('ntpath'): relpath = _relpath_nt else: relpath = _relpath_posix M2Crypto-0.31.0/tests/vendor/unittest2/loader.py0000664000175000001440000003215513234434752021770 0ustar matejusers00000000000000"""Loading unittests.""" import os import re import sys import traceback import types import unittest from fnmatch import fnmatch from unittest2 import case, suite try: from os.path import relpath except ImportError: from unittest2.compatibility import relpath __unittest = True def _CmpToKey(mycmp): 'Convert a cmp= function into a key= function' class K(object): def __init__(self, obj): self.obj = obj def __lt__(self, other): return mycmp(self.obj, other.obj) == -1 return K # what about .pyc or .pyo (etc) # we would need to avoid loading the same tests multiple times # from '.py', '.pyc' *and* '.pyo' VALID_MODULE_NAME = re.compile(r'[_a-z]\w*\.py$', re.IGNORECASE) def _make_failed_import_test(name, suiteClass): message = 'Failed to import test module: %s' % name if hasattr(traceback, 'format_exc'): # Python 2.3 compatibility # format_exc returns two frames of discover.py as well message += '\n%s' % traceback.format_exc() return _make_failed_test('ModuleImportFailure', name, ImportError(message), suiteClass) def _make_failed_load_tests(name, exception, suiteClass): return _make_failed_test('LoadTestsFailure', name, exception, suiteClass) def _make_failed_test(classname, methodname, exception, suiteClass): def testFailure(self): raise exception attrs = {methodname: testFailure} TestClass = type(classname, (case.TestCase,), attrs) return suiteClass((TestClass(methodname),)) class TestLoader(unittest.TestLoader): """ This class is responsible for loading tests according to various criteria and returning them wrapped in a TestSuite """ testMethodPrefix = 'test' sortTestMethodsUsing = cmp suiteClass = suite.TestSuite _top_level_dir = None def loadTestsFromTestCase(self, testCaseClass): """Return a suite of all tests cases contained in testCaseClass""" if issubclass(testCaseClass, suite.TestSuite): raise TypeError("Test cases should not be derived from TestSuite." " Maybe you meant to derive from TestCase?") testCaseNames = self.getTestCaseNames(testCaseClass) if not testCaseNames and hasattr(testCaseClass, 'runTest'): testCaseNames = ['runTest'] loaded_suite = self.suiteClass(map(testCaseClass, testCaseNames)) return loaded_suite def loadTestsFromModule(self, module, use_load_tests=True): """Return a suite of all tests cases contained in the given module""" tests = [] for name in dir(module): obj = getattr(module, name) if isinstance(obj, type) and issubclass(obj, unittest.TestCase): tests.append(self.loadTestsFromTestCase(obj)) load_tests = getattr(module, 'load_tests', None) tests = self.suiteClass(tests) if use_load_tests and load_tests is not None: try: return load_tests(self, tests, None) except Exception, e: return _make_failed_load_tests(module.__name__, e, self.suiteClass) return tests def loadTestsFromName(self, name, module=None): """Return a suite of all tests cases given a string specifier. The name may resolve either to a module, a test case class, a test method within a test case class, or a callable object which returns a TestCase or TestSuite instance. The method optionally resolves the names relative to a given module. """ parts = name.split('.') if module is None: parts_copy = parts[:] while parts_copy: try: module = __import__('.'.join(parts_copy)) break except ImportError: del parts_copy[-1] if not parts_copy: raise parts = parts[1:] obj = module for part in parts: parent, obj = obj, getattr(obj, part) if isinstance(obj, types.ModuleType): return self.loadTestsFromModule(obj) elif isinstance(obj, type) and issubclass(obj, unittest.TestCase): return self.loadTestsFromTestCase(obj) elif (isinstance(obj, types.UnboundMethodType) and isinstance(parent, type) and issubclass(parent, case.TestCase)): return self.suiteClass([parent(obj.__name__)]) elif isinstance(obj, unittest.TestSuite): return obj elif hasattr(obj, '__call__'): test = obj() if isinstance(test, unittest.TestSuite): return test elif isinstance(test, unittest.TestCase): return self.suiteClass([test]) else: raise TypeError("calling %s returned %s, not a test" % (obj, test)) else: raise TypeError("don't know how to make test from: %s" % obj) def loadTestsFromNames(self, names, module=None): """Return a suite of all tests cases found using the given sequence of string specifiers. See 'loadTestsFromName()'. """ suites = [self.loadTestsFromName(name, module) for name in names] return self.suiteClass(suites) def getTestCaseNames(self, testCaseClass): """Return a sorted sequence of method names found within testCaseClass """ def isTestMethod(attrname, testCaseClass=testCaseClass, prefix=self.testMethodPrefix): return attrname.startswith(prefix) and \ hasattr(getattr(testCaseClass, attrname), '__call__') testFnNames = filter(isTestMethod, dir(testCaseClass)) if self.sortTestMethodsUsing: testFnNames.sort(key=_CmpToKey(self.sortTestMethodsUsing)) return testFnNames def discover(self, start_dir, pattern='test*.py', top_level_dir=None): """Find and return all test modules from the specified start directory, recursing into subdirectories to find them. Only test files that match the pattern will be loaded. (Using shell style pattern matching.) All test modules must be importable from the top level of the project. If the start directory is not the top level directory then the top level directory must be specified separately. If a test package name (directory with '__init__.py') matches the pattern then the package will be checked for a 'load_tests' function. If this exists then it will be called with loader, tests, pattern. If load_tests exists then discovery does *not* recurse into the package, load_tests is responsible for loading all tests in the package. The pattern is deliberately not stored as a loader attribute so that packages can continue discovery themselves. top_level_dir is stored so load_tests does not need to pass this argument in to loader.discover(). """ set_implicit_top = False if top_level_dir is None and self._top_level_dir is not None: # make top_level_dir optional if called from load_tests in a package top_level_dir = self._top_level_dir elif top_level_dir is None: set_implicit_top = True top_level_dir = start_dir top_level_dir = os.path.abspath(top_level_dir) if not top_level_dir in sys.path: # all test modules must be importable from the top level directory # should we *unconditionally* put the start directory in first # in sys.path to minimise likelihood of conflicts between installed # modules and development versions? sys.path.insert(0, top_level_dir) self._top_level_dir = top_level_dir is_not_importable = False if os.path.isdir(os.path.abspath(start_dir)): start_dir = os.path.abspath(start_dir) if start_dir != top_level_dir: is_not_importable = not os.path.isfile(os.path.join(start_dir, '__init__.py')) else: # support for discovery from dotted module names try: __import__(start_dir) except ImportError: is_not_importable = True else: the_module = sys.modules[start_dir] top_part = start_dir.split('.')[0] start_dir = os.path.abspath(os.path.dirname((the_module.__file__))) if set_implicit_top: self._top_level_dir = os.path.abspath(os.path.dirname(os.path.dirname(sys.modules[top_part].__file__))) sys.path.remove(top_level_dir) if is_not_importable: raise ImportError('Start directory is not importable: %r' % start_dir) tests = list(self._find_tests(start_dir, pattern)) return self.suiteClass(tests) def _get_name_from_path(self, path): path = os.path.splitext(os.path.normpath(path))[0] _relpath = relpath(path, self._top_level_dir) assert not os.path.isabs(_relpath), "Path must be within the project" assert not _relpath.startswith('..'), "Path must be within the project" name = _relpath.replace(os.path.sep, '.') return name def _get_module_from_name(self, name): __import__(name) return sys.modules[name] def _match_path(self, path, full_path, pattern): # override this method to use alternative matching strategy return fnmatch(path, pattern) def _find_tests(self, start_dir, pattern): """Used by discovery. Yields test suites it loads.""" paths = os.listdir(start_dir) for path in paths: full_path = os.path.join(start_dir, path) if os.path.isfile(full_path): if not VALID_MODULE_NAME.match(path): # valid Python identifiers only continue if not self._match_path(path, full_path, pattern): continue # if the test file matches, load it name = self._get_name_from_path(full_path) try: module = self._get_module_from_name(name) except: yield _make_failed_import_test(name, self.suiteClass) else: mod_file = os.path.abspath(getattr(module, '__file__', full_path)) realpath = os.path.splitext(mod_file)[0] fullpath_noext = os.path.splitext(full_path)[0] if realpath.lower() != fullpath_noext.lower(): module_dir = os.path.dirname(realpath) mod_name = os.path.splitext(os.path.basename(full_path))[0] expected_dir = os.path.dirname(full_path) msg = ("%r module incorrectly imported from %r. Expected %r. " "Is this module globally installed?") raise ImportError(msg % (mod_name, module_dir, expected_dir)) yield self.loadTestsFromModule(module) elif os.path.isdir(full_path): if not os.path.isfile(os.path.join(full_path, '__init__.py')): continue load_tests = None tests = None if fnmatch(path, pattern): # only check load_tests if the package directory itself matches the filter name = self._get_name_from_path(full_path) package = self._get_module_from_name(name) load_tests = getattr(package, 'load_tests', None) tests = self.loadTestsFromModule(package, use_load_tests=False) if load_tests is None: if tests is not None: # tests loaded from package file yield tests # recurse into the package for test in self._find_tests(full_path, pattern): yield test else: try: yield load_tests(self, tests, pattern) except Exception, e: yield _make_failed_load_tests(package.__name__, e, self.suiteClass) defaultTestLoader = TestLoader() def _makeLoader(prefix, sortUsing, suiteClass=None): loader = TestLoader() loader.sortTestMethodsUsing = sortUsing loader.testMethodPrefix = prefix if suiteClass: loader.suiteClass = suiteClass return loader def getTestCaseNames(testCaseClass, prefix, sortUsing=cmp): return _makeLoader(prefix, sortUsing).getTestCaseNames(testCaseClass) def makeSuite(testCaseClass, prefix='test', sortUsing=cmp, suiteClass=suite.TestSuite): return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromTestCase(testCaseClass) def findTestCases(module, prefix='test', sortUsing=cmp, suiteClass=suite.TestSuite): return _makeLoader(prefix, sortUsing, suiteClass).loadTestsFromModule(module) M2Crypto-0.31.0/tests/vendor/unittest2/main.py0000664000175000001440000002225313234434752021444 0ustar matejusers00000000000000"""Unittest main program""" import sys import os import types from unittest2 import loader, runner try: from unittest2.signals import installHandler except ImportError: installHandler = None __unittest = True FAILFAST = " -f, --failfast Stop on first failure\n" CATCHBREAK = " -c, --catch Catch control-C and display results\n" BUFFEROUTPUT = " -b, --buffer Buffer stdout and stderr during test runs\n" USAGE_AS_MAIN = """\ Usage: %(progName)s [options] [tests] Options: -h, --help Show this message -v, --verbose Verbose output -q, --quiet Minimal output %(failfast)s%(catchbreak)s%(buffer)s Examples: %(progName)s test_module - run tests from test_module %(progName)s test_module.TestClass - run tests from test_module.TestClass %(progName)s test_module.TestClass.test_method - run specified test method [tests] can be a list of any number of test modules, classes and test methods. Alternative Usage: %(progName)s discover [options] Options: -v, --verbose Verbose output %(failfast)s%(catchbreak)s%(buffer)s -s directory Directory to start discovery ('.' default) -p pattern Pattern to match test files ('test*.py' default) -t directory Top level directory of project (default to start directory) For test discovery all test modules must be importable from the top level directory of the project. """ USAGE_FROM_MODULE = """\ Usage: %(progName)s [options] [test] [...] Options: -h, --help Show this message -v, --verbose Verbose output -q, --quiet Minimal output %(failfast)s%(catchbreak)s%(buffer)s Examples: %(progName)s - run default set of tests %(progName)s MyTestSuite - run suite 'MyTestSuite' %(progName)s MyTestCase.testSomething - run MyTestCase.testSomething %(progName)s MyTestCase - run all 'test*' test methods in MyTestCase """ class TestProgram(object): """A command-line program that runs a set of tests; this is primarily for making test modules conveniently executable. """ USAGE = USAGE_FROM_MODULE # defaults for testing failfast = catchbreak = buffer = progName = None def __init__(self, module='__main__', defaultTest=None, argv=None, testRunner=None, testLoader=loader.defaultTestLoader, exit=True, verbosity=1, failfast=None, catchbreak=None, buffer=None): if isinstance(module, basestring): self.module = __import__(module) for part in module.split('.')[1:]: self.module = getattr(self.module, part) else: self.module = module if argv is None: argv = sys.argv self.exit = exit self.verbosity = verbosity self.failfast = failfast self.catchbreak = catchbreak self.buffer = buffer self.defaultTest = defaultTest self.testRunner = testRunner self.testLoader = testLoader self.progName = os.path.basename(argv[0]) self.parseArgs(argv) self.runTests() def usageExit(self, msg=None): if msg: print msg usage = {'progName': self.progName, 'catchbreak': '', 'failfast': '', 'buffer': ''} if self.failfast != False: usage['failfast'] = FAILFAST if self.catchbreak != False and installHandler is not None: usage['catchbreak'] = CATCHBREAK if self.buffer != False: usage['buffer'] = BUFFEROUTPUT print self.USAGE % usage sys.exit(2) def parseArgs(self, argv): if len(argv) > 1 and argv[1].lower() == 'discover': self._do_discovery(argv[2:]) return import getopt long_opts = ['help', 'verbose', 'quiet', 'failfast', 'catch', 'buffer'] try: options, args = getopt.getopt(argv[1:], 'hHvqfcb', long_opts) for opt, value in options: if opt in ('-h','-H','--help'): self.usageExit() if opt in ('-q','--quiet'): self.verbosity = 0 if opt in ('-v','--verbose'): self.verbosity = 2 if opt in ('-f','--failfast'): if self.failfast is None: self.failfast = True # Should this raise an exception if -f is not valid? if opt in ('-c','--catch'): if self.catchbreak is None and installHandler is not None: self.catchbreak = True # Should this raise an exception if -c is not valid? if opt in ('-b','--buffer'): if self.buffer is None: self.buffer = True # Should this raise an exception if -b is not valid? if len(args) == 0 and self.defaultTest is None: # createTests will load tests from self.module self.testNames = None elif len(args) > 0: self.testNames = args if __name__ == '__main__': # to support python -m unittest ... self.module = None else: self.testNames = (self.defaultTest,) self.createTests() except getopt.error, msg: self.usageExit(msg) def createTests(self): if self.testNames is None: self.test = self.testLoader.loadTestsFromModule(self.module) else: self.test = self.testLoader.loadTestsFromNames(self.testNames, self.module) def _do_discovery(self, argv, Loader=loader.TestLoader): # handle command line args for test discovery self.progName = '%s discover' % self.progName import optparse parser = optparse.OptionParser() parser.prog = self.progName parser.add_option('-v', '--verbose', dest='verbose', default=False, help='Verbose output', action='store_true') if self.failfast != False: parser.add_option('-f', '--failfast', dest='failfast', default=False, help='Stop on first fail or error', action='store_true') if self.catchbreak != False and installHandler is not None: parser.add_option('-c', '--catch', dest='catchbreak', default=False, help='Catch ctrl-C and display results so far', action='store_true') if self.buffer != False: parser.add_option('-b', '--buffer', dest='buffer', default=False, help='Buffer stdout and stderr during tests', action='store_true') parser.add_option('-s', '--start-directory', dest='start', default='.', help="Directory to start discovery ('.' default)") parser.add_option('-p', '--pattern', dest='pattern', default='test*.py', help="Pattern to match tests ('test*.py' default)") parser.add_option('-t', '--top-level-directory', dest='top', default=None, help='Top level directory of project (defaults to start directory)') options, args = parser.parse_args(argv) if len(args) > 3: self.usageExit() for name, value in zip(('start', 'pattern', 'top'), args): setattr(options, name, value) # only set options from the parsing here # if they weren't set explicitly in the constructor if self.failfast is None: self.failfast = options.failfast if self.catchbreak is None and installHandler is not None: self.catchbreak = options.catchbreak if self.buffer is None: self.buffer = options.buffer if options.verbose: self.verbosity = 2 start_dir = options.start pattern = options.pattern top_level_dir = options.top loader = Loader() self.test = loader.discover(start_dir, pattern, top_level_dir) def runTests(self): if self.catchbreak: installHandler() if self.testRunner is None: self.testRunner = runner.TextTestRunner if isinstance(self.testRunner, (type, types.ClassType)): try: testRunner = self.testRunner(verbosity=self.verbosity, failfast=self.failfast, buffer=self.buffer) except TypeError: # didn't accept the verbosity, buffer or failfast arguments testRunner = self.testRunner() else: # it is assumed to be a TestRunner instance testRunner = self.testRunner self.result = testRunner.run(self.test) if self.exit: sys.exit(not self.result.wasSuccessful()) main = TestProgram def main_(): TestProgram.USAGE = USAGE_AS_MAIN main(module=None) M2Crypto-0.31.0/tests/vendor/unittest2/result.py0000664000175000001440000001376513234434752022046 0ustar matejusers00000000000000"""Test result object""" import sys import traceback import unittest from StringIO import StringIO from unittest2 import util from unittest2.compatibility import wraps __unittest = True def failfast(method): @wraps(method) def inner(self, *args, **kw): if getattr(self, 'failfast', False): self.stop() return method(self, *args, **kw) return inner STDOUT_LINE = '\nStdout:\n%s' STDERR_LINE = '\nStderr:\n%s' class TestResult(unittest.TestResult): """Holder for test result information. Test results are automatically managed by the TestCase and TestSuite classes, and do not need to be explicitly manipulated by writers of tests. Each instance holds the total number of tests run, and collections of failures and errors that occurred among those test runs. The collections contain tuples of (testcase, exceptioninfo), where exceptioninfo is the formatted traceback of the error that occurred. """ _previousTestClass = None _moduleSetUpFailed = False def __init__(self): self.failfast = False self.failures = [] self.errors = [] self.testsRun = 0 self.skipped = [] self.expectedFailures = [] self.unexpectedSuccesses = [] self.shouldStop = False self.buffer = False self._stdout_buffer = None self._stderr_buffer = None self._original_stdout = sys.stdout self._original_stderr = sys.stderr self._mirrorOutput = False def startTest(self, test): "Called when the given test is about to be run" self.testsRun += 1 self._mirrorOutput = False if self.buffer: if self._stderr_buffer is None: self._stderr_buffer = StringIO() self._stdout_buffer = StringIO() sys.stdout = self._stdout_buffer sys.stderr = self._stderr_buffer def startTestRun(self): """Called once before any tests are executed. See startTest for a method called before each test. """ def stopTest(self, test): """Called when the given test has been run""" if self.buffer: if self._mirrorOutput: output = sys.stdout.getvalue() error = sys.stderr.getvalue() if output: if not output.endswith('\n'): output += '\n' self._original_stdout.write(STDOUT_LINE % output) if error: if not error.endswith('\n'): error += '\n' self._original_stderr.write(STDERR_LINE % error) sys.stdout = self._original_stdout sys.stderr = self._original_stderr self._stdout_buffer.seek(0) self._stdout_buffer.truncate() self._stderr_buffer.seek(0) self._stderr_buffer.truncate() self._mirrorOutput = False def stopTestRun(self): """Called once after all tests are executed. See stopTest for a method called after each test. """ @failfast def addError(self, test, err): """Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info(). """ self.errors.append((test, self._exc_info_to_string(err, test))) self._mirrorOutput = True @failfast def addFailure(self, test, err): """Called when an error has occurred. 'err' is a tuple of values as returned by sys.exc_info().""" self.failures.append((test, self._exc_info_to_string(err, test))) self._mirrorOutput = True def addSuccess(self, test): "Called when a test has completed successfully" pass def addSkip(self, test, reason): """Called when a test is skipped.""" self.skipped.append((test, reason)) def addExpectedFailure(self, test, err): """Called when an expected failure/error occured.""" self.expectedFailures.append( (test, self._exc_info_to_string(err, test))) @failfast def addUnexpectedSuccess(self, test): """Called when a test was expected to fail, but succeed.""" self.unexpectedSuccesses.append(test) def wasSuccessful(self): "Tells whether or not this result was a success" return (len(self.failures) + len(self.errors) == 0) def stop(self): "Indicates that the tests should be aborted" self.shouldStop = True def _exc_info_to_string(self, err, test): """Converts a sys.exc_info()-style tuple of values into a string.""" exctype, value, tb = err # Skip test runner traceback levels while tb and self._is_relevant_tb_level(tb): tb = tb.tb_next if exctype is test.failureException: # Skip assert*() traceback levels length = self._count_relevant_tb_levels(tb) msgLines = traceback.format_exception(exctype, value, tb, length) else: msgLines = traceback.format_exception(exctype, value, tb) if self.buffer: output = sys.stdout.getvalue() error = sys.stderr.getvalue() if output: if not output.endswith('\n'): output += '\n' msgLines.append(STDOUT_LINE % output) if error: if not error.endswith('\n'): error += '\n' msgLines.append(STDERR_LINE % error) return ''.join(msgLines) def _is_relevant_tb_level(self, tb): return '__unittest' in tb.tb_frame.f_globals def _count_relevant_tb_levels(self, tb): length = 0 while tb and not self._is_relevant_tb_level(tb): length += 1 tb = tb.tb_next return length def __repr__(self): return "<%s run=%i errors=%i failures=%i>" % \ (util.strclass(self.__class__), self.testsRun, len(self.errors), len(self.failures)) M2Crypto-0.31.0/tests/vendor/unittest2/runner.py0000664000175000001440000001514513234434752022033 0ustar matejusers00000000000000"""Running tests""" import sys import time import unittest from unittest2 import result try: from unittest2.signals import registerResult except ImportError: def registerResult(_): pass __unittest = True class _WritelnDecorator(object): """Used to decorate file-like objects with a handy 'writeln' method""" def __init__(self,stream): self.stream = stream def __getattr__(self, attr): if attr in ('stream', '__getstate__'): raise AttributeError(attr) return getattr(self.stream,attr) def writeln(self, arg=None): if arg: self.write(arg) self.write('\n') # text-mode streams translate to \r\n if needed class TextTestResult(result.TestResult): """A test result class that can print formatted text results to a stream. Used by TextTestRunner. """ separator1 = '=' * 70 separator2 = '-' * 70 def __init__(self, stream, descriptions, verbosity): super(TextTestResult, self).__init__() self.stream = stream self.showAll = verbosity > 1 self.dots = verbosity == 1 self.descriptions = descriptions def getDescription(self, test): doc_first_line = test.shortDescription() if self.descriptions and doc_first_line: return '\n'.join((str(test), doc_first_line)) else: return str(test) def startTest(self, test): super(TextTestResult, self).startTest(test) if self.showAll: self.stream.write(self.getDescription(test)) self.stream.write(" ... ") self.stream.flush() def addSuccess(self, test): super(TextTestResult, self).addSuccess(test) if self.showAll: self.stream.writeln("ok") elif self.dots: self.stream.write('.') self.stream.flush() def addError(self, test, err): super(TextTestResult, self).addError(test, err) if self.showAll: self.stream.writeln("ERROR") elif self.dots: self.stream.write('E') self.stream.flush() def addFailure(self, test, err): super(TextTestResult, self).addFailure(test, err) if self.showAll: self.stream.writeln("FAIL") elif self.dots: self.stream.write('F') self.stream.flush() def addSkip(self, test, reason): super(TextTestResult, self).addSkip(test, reason) if self.showAll: self.stream.writeln("skipped %r" % (reason,)) elif self.dots: self.stream.write("s") self.stream.flush() def addExpectedFailure(self, test, err): super(TextTestResult, self).addExpectedFailure(test, err) if self.showAll: self.stream.writeln("expected failure") elif self.dots: self.stream.write("x") self.stream.flush() def addUnexpectedSuccess(self, test): super(TextTestResult, self).addUnexpectedSuccess(test) if self.showAll: self.stream.writeln("unexpected success") elif self.dots: self.stream.write("u") self.stream.flush() def printErrors(self): if self.dots or self.showAll: self.stream.writeln() self.printErrorList('ERROR', self.errors) self.printErrorList('FAIL', self.failures) def printErrorList(self, flavour, errors): for test, err in errors: self.stream.writeln(self.separator1) self.stream.writeln("%s: %s" % (flavour, self.getDescription(test))) self.stream.writeln(self.separator2) self.stream.writeln("%s" % err) def stopTestRun(self): super(TextTestResult, self).stopTestRun() self.printErrors() class TextTestRunner(unittest.TextTestRunner): """A test runner class that displays results in textual form. It prints out the names of tests as they are run, errors as they occur, and a summary of the results at the end of the test run. """ resultclass = TextTestResult def __init__(self, stream=sys.stderr, descriptions=True, verbosity=1, failfast=False, buffer=False, resultclass=None): self.stream = _WritelnDecorator(stream) self.descriptions = descriptions self.verbosity = verbosity self.failfast = failfast self.buffer = buffer if resultclass is not None: self.resultclass = resultclass def _makeResult(self): return self.resultclass(self.stream, self.descriptions, self.verbosity) def run(self, test): "Run the given test case or test suite." result = self._makeResult() result.failfast = self.failfast result.buffer = self.buffer registerResult(result) startTime = time.time() startTestRun = getattr(result, 'startTestRun', None) if startTestRun is not None: startTestRun() try: test(result) finally: stopTestRun = getattr(result, 'stopTestRun', None) if stopTestRun is not None: stopTestRun() else: result.printErrors() stopTime = time.time() timeTaken = stopTime - startTime if hasattr(result, 'separator2'): self.stream.writeln(result.separator2) run = result.testsRun self.stream.writeln("Ran %d test%s in %.3fs" % (run, run != 1 and "s" or "", timeTaken)) self.stream.writeln() expectedFails = unexpectedSuccesses = skipped = 0 try: results = map(len, (result.expectedFailures, result.unexpectedSuccesses, result.skipped)) expectedFails, unexpectedSuccesses, skipped = results except AttributeError: pass infos = [] if not result.wasSuccessful(): self.stream.write("FAILED") failed, errored = map(len, (result.failures, result.errors)) if failed: infos.append("failures=%d" % failed) if errored: infos.append("errors=%d" % errored) else: self.stream.write("OK") if skipped: infos.append("skipped=%d" % skipped) if expectedFails: infos.append("expected failures=%d" % expectedFails) if unexpectedSuccesses: infos.append("unexpected successes=%d" % unexpectedSuccesses) if infos: self.stream.writeln(" (%s)" % (", ".join(infos),)) else: self.stream.write("\n") return result M2Crypto-0.31.0/tests/vendor/unittest2/signals.py0000664000175000001440000000322413234434752022155 0ustar matejusers00000000000000import signal import weakref from unittest2.compatibility import wraps __unittest = True class _InterruptHandler(object): def __init__(self, default_handler): self.called = False self.default_handler = default_handler def __call__(self, signum, frame): installed_handler = signal.getsignal(signal.SIGINT) if installed_handler is not self: # if we aren't the installed handler, then delegate immediately # to the default handler self.default_handler(signum, frame) if self.called: self.default_handler(signum, frame) self.called = True for result in _results.keys(): result.stop() _results = weakref.WeakKeyDictionary() def registerResult(result): _results[result] = 1 def removeResult(result): return bool(_results.pop(result, None)) _interrupt_handler = None def installHandler(): global _interrupt_handler if _interrupt_handler is None: default_handler = signal.getsignal(signal.SIGINT) _interrupt_handler = _InterruptHandler(default_handler) signal.signal(signal.SIGINT, _interrupt_handler) def removeHandler(method=None): if method is not None: @wraps(method) def inner(*args, **kwargs): initial = signal.getsignal(signal.SIGINT) removeHandler() try: return method(*args, **kwargs) finally: signal.signal(signal.SIGINT, initial) return inner global _interrupt_handler if _interrupt_handler is not None: signal.signal(signal.SIGINT, _interrupt_handler.default_handler) M2Crypto-0.31.0/tests/vendor/unittest2/suite.py0000664000175000001440000002230613234434752021650 0ustar matejusers00000000000000"""TestSuite""" import sys import unittest from unittest2 import case, util __unittest = True class BaseTestSuite(unittest.TestSuite): """A simple test suite that doesn't provide class or module shared fixtures. """ def __init__(self, tests=()): self._tests = [] self.addTests(tests) def __repr__(self): return "<%s tests=%s>" % (util.strclass(self.__class__), list(self)) def __eq__(self, other): if not isinstance(other, self.__class__): return NotImplemented return list(self) == list(other) def __ne__(self, other): return not self == other # Can't guarantee hash invariant, so flag as unhashable __hash__ = None def __iter__(self): return iter(self._tests) def countTestCases(self): cases = 0 for test in self: cases += test.countTestCases() return cases def addTest(self, test): # sanity checks if not hasattr(test, '__call__'): raise TypeError("%r is not callable" % (repr(test),)) if isinstance(test, type) and issubclass(test, (case.TestCase, TestSuite)): raise TypeError("TestCases and TestSuites must be instantiated " "before passing them to addTest()") self._tests.append(test) def addTests(self, tests): if isinstance(tests, basestring): raise TypeError("tests must be an iterable of tests, not a string") for test in tests: self.addTest(test) def run(self, result): for test in self: if result.shouldStop: break test(result) return result def __call__(self, *args, **kwds): return self.run(*args, **kwds) def debug(self): """Run the tests without collecting errors in a TestResult""" for test in self: test.debug() class TestSuite(BaseTestSuite): """A test suite is a composite test consisting of a number of TestCases. For use, create an instance of TestSuite, then add test case instances. When all tests have been added, the suite can be passed to a test runner, such as TextTestRunner. It will run the individual test cases in the order in which they were added, aggregating the results. When subclassing, do not forget to call the base class constructor. """ def run(self, result): self._wrapped_run(result) self._tearDownPreviousClass(None, result) self._handleModuleTearDown(result) return result def debug(self): """Run the tests without collecting errors in a TestResult""" debug = _DebugResult() self._wrapped_run(debug, True) self._tearDownPreviousClass(None, debug) self._handleModuleTearDown(debug) ################################ # private methods def _wrapped_run(self, result, debug=False): for test in self: if result.shouldStop: break if _isnotsuite(test): self._tearDownPreviousClass(test, result) self._handleModuleFixture(test, result) self._handleClassSetUp(test, result) result._previousTestClass = test.__class__ if (getattr(test.__class__, '_classSetupFailed', False) or getattr(result, '_moduleSetUpFailed', False)): continue if hasattr(test, '_wrapped_run'): test._wrapped_run(result, debug) elif not debug: test(result) else: test.debug() def _handleClassSetUp(self, test, result): previousClass = getattr(result, '_previousTestClass', None) currentClass = test.__class__ if currentClass == previousClass: return if result._moduleSetUpFailed: return if getattr(currentClass, "__unittest_skip__", False): return try: currentClass._classSetupFailed = False except TypeError: # test may actually be a function # so its class will be a builtin-type pass setUpClass = getattr(currentClass, 'setUpClass', None) if setUpClass is not None: try: setUpClass() except Exception, e: if isinstance(result, _DebugResult): raise currentClass._classSetupFailed = True className = util.strclass(currentClass) errorName = 'setUpClass (%s)' % className self._addClassOrModuleLevelException(result, e, errorName) def _get_previous_module(self, result): previousModule = None previousClass = getattr(result, '_previousTestClass', None) if previousClass is not None: previousModule = previousClass.__module__ return previousModule def _handleModuleFixture(self, test, result): previousModule = self._get_previous_module(result) currentModule = test.__class__.__module__ if currentModule == previousModule: return self._handleModuleTearDown(result) result._moduleSetUpFailed = False try: module = sys.modules[currentModule] except KeyError: return setUpModule = getattr(module, 'setUpModule', None) if setUpModule is not None: try: setUpModule() except Exception, e: if isinstance(result, _DebugResult): raise result._moduleSetUpFailed = True errorName = 'setUpModule (%s)' % currentModule self._addClassOrModuleLevelException(result, e, errorName) def _addClassOrModuleLevelException(self, result, exception, errorName): error = _ErrorHolder(errorName) addSkip = getattr(result, 'addSkip', None) if addSkip is not None and isinstance(exception, case.SkipTest): addSkip(error, str(exception)) else: result.addError(error, sys.exc_info()) def _handleModuleTearDown(self, result): previousModule = self._get_previous_module(result) if previousModule is None: return if result._moduleSetUpFailed: return try: module = sys.modules[previousModule] except KeyError: return tearDownModule = getattr(module, 'tearDownModule', None) if tearDownModule is not None: try: tearDownModule() except Exception, e: if isinstance(result, _DebugResult): raise errorName = 'tearDownModule (%s)' % previousModule self._addClassOrModuleLevelException(result, e, errorName) def _tearDownPreviousClass(self, test, result): previousClass = getattr(result, '_previousTestClass', None) currentClass = test.__class__ if currentClass == previousClass: return if getattr(previousClass, '_classSetupFailed', False): return if getattr(result, '_moduleSetUpFailed', False): return if getattr(previousClass, "__unittest_skip__", False): return tearDownClass = getattr(previousClass, 'tearDownClass', None) if tearDownClass is not None: try: tearDownClass() except Exception, e: if isinstance(result, _DebugResult): raise className = util.strclass(previousClass) errorName = 'tearDownClass (%s)' % className self._addClassOrModuleLevelException(result, e, errorName) class _ErrorHolder(object): """ Placeholder for a TestCase inside a result. As far as a TestResult is concerned, this looks exactly like a unit test. Used to insert arbitrary errors into a test suite run. """ # Inspired by the ErrorHolder from Twisted: # http://twistedmatrix.com/trac/browser/trunk/twisted/trial/runner.py # attribute used by TestResult._exc_info_to_string failureException = None def __init__(self, description): self.description = description def id(self): return self.description def shortDescription(self): return None def __repr__(self): return "" % (self.description,) def __str__(self): return self.id() def run(self, result): # could call result.addError(...) - but this test-like object # shouldn't be run anyway pass def __call__(self, result): return self.run(result) def countTestCases(self): return 0 def _isnotsuite(test): "A crude way to tell apart testcases and suites with duck-typing" try: iter(test) except TypeError: return True return False class _DebugResult(object): "Used by the TestSuite to hold previous class when running in debug." _previousTestClass = None _moduleSetUpFailed = False shouldStop = False M2Crypto-0.31.0/tests/vendor/unittest2/util.py0000664000175000001440000000540513234434752021475 0ustar matejusers00000000000000"""Various utility functions.""" __unittest = True _MAX_LENGTH = 80 def safe_repr(obj, short=False): try: result = repr(obj) except Exception: result = object.__repr__(obj) if not short or len(result) < _MAX_LENGTH: return result return result[:_MAX_LENGTH] + ' [truncated]...' def safe_str(obj): try: return str(obj) except Exception: return object.__str__(obj) def strclass(cls): return "%s.%s" % (cls.__module__, cls.__name__) def sorted_list_difference(expected, actual): """Finds elements in only one or the other of two, sorted input lists. Returns a two-element tuple of lists. The first list contains those elements in the "expected" list but not in the "actual" list, and the second contains those elements in the "actual" list but not in the "expected" list. Duplicate elements in either input list are ignored. """ i = j = 0 missing = [] unexpected = [] while True: try: e = expected[i] a = actual[j] if e < a: missing.append(e) i += 1 while expected[i] == e: i += 1 elif e > a: unexpected.append(a) j += 1 while actual[j] == a: j += 1 else: i += 1 try: while expected[i] == e: i += 1 finally: j += 1 while actual[j] == a: j += 1 except IndexError: missing.extend(expected[i:]) unexpected.extend(actual[j:]) break return missing, unexpected def unorderable_list_difference(expected, actual, ignore_duplicate=False): """Same behavior as sorted_list_difference but for lists of unorderable items (like dicts). As it does a linear search per item (remove) it has O(n*n) performance. """ missing = [] unexpected = [] while expected: item = expected.pop() try: actual.remove(item) except ValueError: missing.append(item) if ignore_duplicate: for lst in expected, actual: try: while True: lst.remove(item) except ValueError: pass if ignore_duplicate: while actual: item = actual.pop() unexpected.append(item) try: while True: actual.remove(item) except ValueError: pass return missing, unexpected # anything left in actual is unexpected return missing, actual M2Crypto-0.31.0/tests/x509.der0000644000175000001440000000147613356651321016111 0ustar matejusers000000000000000:0"0  *H  0O1 0 UUS10U California10U M2Crypto10U Heikki Toivonen0 181007151202Z 281004151202Z0D1 0 UUS10U California10U M2Crypto1 0 U X5090"0  *H 0  d*!Һ9,+X].4z`Z*C^wLoJA)Z CHfTFVGk cDŽyV'r_zsЏ Qy 9*e}ӓ%Ξg{9J.]0Q4Kv8SnٛA[L8Ӯ$O%$1攗KHK[̕Mf\>$OCިq-i5AϞOz-aTt&"+ ,0*0 U00U)4Zv<,jЯ0  *H  5%1m8Y&OM|jMYU>!S=#Dq=C>Ebdhq&_f*Jb#D"8 `E)mDң/c?^~4