From 0ac96ae996d36ff452afe0fbb7a368fcd35b219b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mat=C4=9Bj=20Cepl?= Date: Fri, 20 Nov 2020 20:25:40 +0100 Subject: Remove support for CentOS 6 and Python 2.6 Support of CentOS 6 ends on 2020-11-30. Fixes #283 --- .gitlab-ci.yml | 16 - M2Crypto/ASN1.py | 5 +- M2Crypto/AuthCookie.py | 7 +- M2Crypto/BIO.py | 8 +- M2Crypto/BN.py | 5 +- M2Crypto/DH.py | 6 +- M2Crypto/DSA.py | 4 +- M2Crypto/EC.py | 5 +- M2Crypto/EVP.py | 7 +- M2Crypto/Engine.py | 6 +- M2Crypto/Err.py | 5 +- M2Crypto/RSA.py | 4 +- M2Crypto/Rand.py | 5 +- M2Crypto/SMIME.py | 4 +- M2Crypto/SSL/Checker.py | 5 +- M2Crypto/SSL/Cipher.py | 5 +- M2Crypto/SSL/Connection.py | 7 +- M2Crypto/SSL/Context.py | 3 +- M2Crypto/SSL/SSLServer.py | 13 +- M2Crypto/SSL/Session.py | 5 +- M2Crypto/SSL/TwistedProtocolWrapper.py | 5 +- M2Crypto/SSL/cb.py | 6 +- M2Crypto/X509.py | 6 +- M2Crypto/__init__.py | 4 - M2Crypto/httpslib.py | 5 +- M2Crypto/m2crypto.py | 110 +- M2Crypto/m2urllib.py | 5 +- M2Crypto/m2urllib2.py | 5 +- M2Crypto/m2xmlrpclib.py | 5 +- M2Crypto/util.py | 12 +- SWIG/_m2crypto_wrap.c | 28773 ++++++++++++++------------ doc/html/.buildinfo | 2 +- doc/html/M2Crypto.SSL.html | 1660 +- doc/html/M2Crypto.html | 5496 +---- doc/html/ZServerSSL-HOWTO.html | 203 +- doc/html/_modules/M2Crypto/EVP.html | 167 +- doc/html/_modules/M2Crypto/Err.html | 60 +- doc/html/_modules/M2Crypto/RSA.html | 47 +- doc/html/_modules/M2Crypto/SSL/Cipher.html | 52 +- doc/html/_modules/M2Crypto/SSL/Context.html | 56 +- doc/html/_modules/M2Crypto/SSL/Session.html | 42 +- doc/html/_modules/M2Crypto/SSL/cb.html | 41 +- doc/html/_modules/M2Crypto/util.html | 46 +- doc/html/_modules/index.html | 59 +- doc/html/_static/basic.css | 219 +- doc/html/_static/doctools.js | 12 +- doc/html/_static/documentation_options.js | 4 +- doc/html/_static/jquery-3.5.1.js | 10872 ++++++++++ doc/html/_static/jquery.js | 6 +- doc/html/_static/language_data.js | 2 +- doc/html/_static/searchtools.js | 83 +- doc/html/genindex.html | 1308 +- doc/html/howto.ca.html | 65 +- doc/html/howto.smime.html | 105 +- doc/html/howto.ssl.html | 49 +- doc/html/index.html | 117 +- doc/html/py-modindex.html | 164 +- doc/html/search.html | 39 +- doc/html/searchindex.js | 2 +- tests/__init__.py | 4 - tests/test_ssl.py | 9 +- 61 files changed, 28655 insertions(+), 21397 deletions(-) create mode 100644 doc/html/_static/jquery-3.5.1.js diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 995a721..f24fd31 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,19 +1,3 @@ -.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 diff --git a/M2Crypto/ASN1.py b/M2Crypto/ASN1.py index bcdb034..37fd7a0 100644 --- a/M2Crypto/ASN1.py +++ b/M2Crypto/ASN1.py @@ -12,9 +12,8 @@ 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 +from M2Crypto import BIO, m2, six +from typing import Optional # noqa MBSTRING_FLAG = 0x1000 MBSTRING_ASC = MBSTRING_FLAG | 1 diff --git a/M2Crypto/AuthCookie.py b/M2Crypto/AuthCookie.py index c843797..ff6df2b 100644 --- a/M2Crypto/AuthCookie.py +++ b/M2Crypto/AuthCookie.py @@ -8,11 +8,10 @@ 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 +from M2Crypto import Rand, m2, six, util +from M2Crypto.six.moves.http_cookies import SimpleCookie -if py27plus: - from typing import re as type_re, AnyStr, Dict, Optional, Union # noqa +from typing import re as type_re, AnyStr, Optional, Union # noqa _MIX_FORMAT = 'exp=%f&data=%s&digest=' _MIX_RE = re.compile(r'exp=(\d+\.\d+)&data=(.+)&digest=(\S*)') diff --git a/M2Crypto/BIO.py b/M2Crypto/BIO.py index 71a486a..090064b 100644 --- a/M2Crypto/BIO.py +++ b/M2Crypto/BIO.py @@ -4,11 +4,11 @@ from __future__ import absolute_import Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" +import io import logging +from typing import Any, AnyStr, Callable, Iterable, Optional, Union # noqa -from M2Crypto import m2, py27plus, six -if py27plus: - from typing import AnyStr, Callable, Iterable, Optional, Union # noqa +from M2Crypto import m2, six log = logging.getLogger('BIO') @@ -370,7 +370,7 @@ class SSLBio(BIO): self.closed = 0 def set_ssl(self, conn, close_flag=m2.bio_noclose): - # type: (Connection, int) -> None + ## type: (Connection, int) -> None """ Sets the bio to the SSL pointer which is contained in the connection object. diff --git a/M2Crypto/BN.py b/M2Crypto/BN.py index 57a13a6..0d8c3b2 100644 --- a/M2Crypto/BN.py +++ b/M2Crypto/BN.py @@ -6,9 +6,8 @@ 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 +from M2Crypto import m2 +from typing import Optional # noqa def rand(bits, top=-1, bottom=0): diff --git a/M2Crypto/DH.py b/M2Crypto/DH.py index b46a305..38ea0d5 100644 --- a/M2Crypto/DH.py +++ b/M2Crypto/DH.py @@ -4,15 +4,15 @@ from __future__ import absolute_import Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" -from M2Crypto import BIO, m2, util +from M2Crypto import BIO, m2 from M2Crypto.util import genparam_callback -if util.py27plus: - from typing import AnyStr, Callable # noqa +from typing import AnyStr, Callable, Optional # noqa class DHError(Exception): pass + m2.dh_init(DHError) diff --git a/M2Crypto/DSA.py b/M2Crypto/DSA.py index 224848d..d4f2073 100644 --- a/M2Crypto/DSA.py +++ b/M2Crypto/DSA.py @@ -10,13 +10,13 @@ from __future__ import absolute_import, print_function """ from M2Crypto import BIO, m2, util -if util.py27plus: - from typing import AnyStr, Callable, Tuple # noqa +from typing import Any, AnyStr, Callable, Tuple # noqa class DSAError(Exception): pass + m2.dsa_init(DSAError) diff --git a/M2Crypto/EC.py b/M2Crypto/EC.py index b730334..522092a 100644 --- a/M2Crypto/EC.py +++ b/M2Crypto/EC.py @@ -11,8 +11,8 @@ 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 +from typing import AnyStr, Callable, Dict, Optional, Tuple, Union # noqa +from M2Crypto.EVP import PKey EC_Key = bytes @@ -20,6 +20,7 @@ EC_Key = bytes class ECError(Exception): pass + m2.ec_init(ECError) # Curve identifier constants diff --git a/M2Crypto/EVP.py b/M2Crypto/EVP.py index 6e7d508..7b1efc6 100644 --- a/M2Crypto/EVP.py +++ b/M2Crypto/EVP.py @@ -10,14 +10,15 @@ Author: Heikki Toivonen import logging from M2Crypto import BIO, Err, RSA, m2, util -if util.py27plus: - from typing import AnyStr, Optional, Callable # noqa +from typing import AnyStr, Optional, Callable # noqa log = logging.getLogger('EVP') + class EVPError(ValueError): pass + m2.evp_init(EVPError) @@ -194,7 +195,7 @@ class PKey(object): if mda is None: raise ValueError('unknown message digest', md) self.md = mda() - self.ctx = m2.md_ctx_new() # type: Context + self.ctx = m2.md_ctx_new() ## type: Context def reset_context(self, md='sha1'): # type: (str) -> None diff --git a/M2Crypto/Engine.py b/M2Crypto/Engine.py index fa79e46..46b76a4 100644 --- a/M2Crypto/Engine.py +++ b/M2Crypto/Engine.py @@ -8,14 +8,14 @@ Pavel Shramov IMEC MSU """ -from M2Crypto import EVP, Err, X509, m2, six, util -if util.py27plus: - from typing import AnyStr, Callable, Optional # noqa +from M2Crypto import EVP, Err, X509, m2, six +from typing import AnyStr, Callable, Optional # noqa class EngineError(Exception): pass + m2.engine_init_error(EngineError) diff --git a/M2Crypto/Err.py b/M2Crypto/Err.py index 70974c9..dd55991 100644 --- a/M2Crypto/Err.py +++ b/M2Crypto/Err.py @@ -4,9 +4,8 @@ from __future__ import absolute_import 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 +from M2Crypto import BIO, m2, util, six # noqa +from typing import Optional # noqa def get_error(): diff --git a/M2Crypto/RSA.py b/M2Crypto/RSA.py index 1292e1d..d6e5c64 100644 --- a/M2Crypto/RSA.py +++ b/M2Crypto/RSA.py @@ -7,13 +7,13 @@ 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 +from typing import Any, AnyStr, Callable, IO, Optional, Tuple # noqa class RSAError(Exception): pass + m2.rsa_init(RSAError) no_padding = m2.no_padding diff --git a/M2Crypto/Rand.py b/M2Crypto/Rand.py index 86a6f16..a178b1b 100644 --- a/M2Crypto/Rand.py +++ b/M2Crypto/Rand.py @@ -7,9 +7,8 @@ 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 +from M2Crypto import m2, six +from typing import AnyStr, Tuple # noqa __all__ = ['rand_seed', 'rand_add', 'load_file', 'save_file', 'rand_bytes', diff --git a/M2Crypto/SMIME.py b/M2Crypto/SMIME.py index 7c78d19..1b7564a 100644 --- a/M2Crypto/SMIME.py +++ b/M2Crypto/SMIME.py @@ -5,8 +5,7 @@ from __future__ import absolute_import 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 +from typing import AnyStr, Callable, Optional # noqa PKCS7_TEXT = m2.PKCS7_TEXT # type: int PKCS7_NOCERTS = m2.PKCS7_NOCERTS # type: int @@ -27,6 +26,7 @@ PKCS7_DATA = m2.PKCS7_DATA # type: int class PKCS7_Error(Exception): pass + m2.pkcs7_init(PKCS7_Error) diff --git a/M2Crypto/SSL/Checker.py b/M2Crypto/SSL/Checker.py index 86ed8ba..46d397a 100644 --- a/M2Crypto/SSL/Checker.py +++ b/M2Crypto/SSL/Checker.py @@ -13,9 +13,8 @@ __all__ = ['SSLVerificationError', 'NoCertificate', 'WrongCertificate', import re import socket -from M2Crypto import X509, m2, six, util # noqa -if util.py27plus: - from typing import AnyStr, Optional # noqa +from M2Crypto import X509, m2, six # noqa +from typing import AnyStr, Optional # noqa class SSLVerificationError(Exception): diff --git a/M2Crypto/SSL/Cipher.py b/M2Crypto/SSL/Cipher.py index 4683377..06f2dbf 100644 --- a/M2Crypto/SSL/Cipher.py +++ b/M2Crypto/SSL/Cipher.py @@ -4,9 +4,8 @@ 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 +from M2Crypto import m2, six +from typing import Iterable # noqa class Cipher(object): diff --git a/M2Crypto/SSL/Connection.py b/M2Crypto/SSL/Connection.py index 601919c..c5693c9 100644 --- a/M2Crypto/SSL/Connection.py +++ b/M2Crypto/SSL/Connection.py @@ -14,13 +14,12 @@ import logging import socket import io -from M2Crypto import BIO, Err, X509, m2, py27plus, six, util # noqa +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 py27plus: - from typing import Any, AnyStr, Callable, Optional, Tuple, Union # noqa +from typing import Any, AnyStr, Callable, Optional, Tuple, Union # noqa __all__ = ['Connection', 'timeout', # XXX Not really, but for documentation purposes @@ -407,7 +406,7 @@ class Connection(object): buflen = len(buff_bytes) # memoryview type has been added in 2.7 - if py27plus and isinstance(buff, memoryview): + if isinstance(buff, memoryview): buff[:buflen] = buff_bytes buff[buflen:] = b'\x00' * (len(buff) - buflen) else: diff --git a/M2Crypto/SSL/Context.py b/M2Crypto/SSL/Context.py index 7faccf0..d7cb7bc 100644 --- a/M2Crypto/SSL/Context.py +++ b/M2Crypto/SSL/Context.py @@ -8,8 +8,7 @@ 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 +from typing import Any, AnyStr, Callable, Optional, Union # noqa __all__ = ['ctxmap', 'Context', 'map'] diff --git a/M2Crypto/SSL/SSLServer.py b/M2Crypto/SSL/SSLServer.py index 886019e..a44c9c7 100644 --- a/M2Crypto/SSL/SSLServer.py +++ b/M2Crypto/SSL/SSLServer.py @@ -9,16 +9,15 @@ Copyright (c) 1999-2002 Ng Pheng Siong. All rights reserved.""" 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 six # noqa from M2Crypto import util # noqa -from M2Crypto.six.moves.socketserver import (BaseServer, TCPServer, - ThreadingMixIn) +from M2Crypto.six.moves.socketserver import (BaseRequestHandler, BaseServer, + TCPServer, ThreadingMixIn) import os if os.name != 'nt': - from M2Crypto.six.moves.socketserver import ForkingMixIn + from M2Crypto.six.moves.socketserver import ForkingMixIn from socket import socket # noqa -if util.py27plus: - from typing import Union # noqa +from typing import Union # noqa __all__ = ['SSLServer', 'ForkingSSLServer', 'ThreadingSSLServer'] @@ -26,7 +25,7 @@ __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 + # type: (util.AddrType, BaseRequestHandler, Context, bool) -> None """ Superclass says: Constructor. May be extended, do not override. This class says: Ho-hum. diff --git a/M2Crypto/SSL/Session.py b/M2Crypto/SSL/Session.py index 8c4e8f4..c364d4e 100644 --- a/M2Crypto/SSL/Session.py +++ b/M2Crypto/SSL/Session.py @@ -4,10 +4,9 @@ Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" __all__ = ['Session', 'load_session'] -from M2Crypto import BIO, Err, m2, util +from M2Crypto import BIO, Err, m2 from M2Crypto.SSL import SSLError -if util.py27plus: - from typing import AnyStr # noqa +from typing import AnyStr # noqa class Session(object): diff --git a/M2Crypto/SSL/TwistedProtocolWrapper.py b/M2Crypto/SSL/TwistedProtocolWrapper.py index f9f7ccd..5e94503 100644 --- a/M2Crypto/SSL/TwistedProtocolWrapper.py +++ b/M2Crypto/SSL/TwistedProtocolWrapper.py @@ -24,9 +24,8 @@ 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 +from typing import AnyStr, Callable, Iterable, Optional # noqa +from zope.interface import implementer log = logging.getLogger(__name__) diff --git a/M2Crypto/SSL/cb.py b/M2Crypto/SSL/cb.py index d10735d..47f102e 100644 --- a/M2Crypto/SSL/cb.py +++ b/M2Crypto/SSL/cb.py @@ -6,9 +6,8 @@ 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 +from M2Crypto import m2 +from typing import Any # noqa __all__ = ['unknown_issuer', 'ssl_verify_callback_stub', 'ssl_verify_callback', 'ssl_verify_callback_allow_unknown_ca', 'ssl_info_callback'] @@ -18,6 +17,7 @@ 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, diff --git a/M2Crypto/X509.py b/M2Crypto/X509.py index c4848bb..6b0e963 100644 --- a/M2Crypto/X509.py +++ b/M2Crypto/X509.py @@ -12,9 +12,8 @@ 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 +from M2Crypto import ASN1, BIO, EVP, m2, six # noqa +from typing import AnyStr, List, Optional # noqa FORMAT_DER = 0 FORMAT_PEM = 1 @@ -25,6 +24,7 @@ log = logging.getLogger(__name__) class X509Error(ValueError): pass + m2.x509_init(X509Error) V_OK = m2.X509_V_OK # type: int diff --git a/M2Crypto/__init__.py b/M2Crypto/__init__.py index f4e00a4..06243c9 100644 --- a/M2Crypto/__init__.py +++ b/M2Crypto/__init__.py @@ -18,15 +18,11 @@ 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.36.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, diff --git a/M2Crypto/httpslib.py b/M2Crypto/httpslib.py index f624865..0deee64 100644 --- a/M2Crypto/httpslib.py +++ b/M2Crypto/httpslib.py @@ -9,13 +9,12 @@ Copyright (c) 1999-2004 Ng Pheng Siong. All rights reserved.""" import base64 import socket -from M2Crypto import SSL, py27plus, six +from M2Crypto import SSL, 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 +from typing import Any, AnyStr, Callable, Dict, Optional # noqa class HTTPSConnection(HTTPConnection): diff --git a/M2Crypto/m2crypto.py b/M2Crypto/m2crypto.py index 9cad6f4..1323547 100644 --- a/M2Crypto/m2crypto.py +++ b/M2Crypto/m2crypto.py @@ -1,84 +1,64 @@ # This file was automatically generated by SWIG (http://www.swig.org). -# Version 2.0.10 +# Version 4.0.2 # # 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 as _swig_python_version_info +if _swig_python_version_info < (2, 7, 0): + raise RuntimeError("Python 2.7 or later required") - -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 +# Pull in all the attributes from the low-level C/C++ module +if __package__ or "." in __name__: + from ._m2crypto import * else: - import _m2crypto -del version_info -from _m2crypto import * + 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) + import builtins as __builtin__ +except ImportError: + import __builtin__ def _swig_repr(self): - try: strthis = "proxy of " + self.this.__repr__() - except: strthis = "" + try: + strthis = "proxy of " + self.this.__repr__() + except __builtin__.Exception: + 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) + +def _swig_setattr_nondynamic_instance_variable(set): + def set_instance_attr(self, name, value): + if name == "thisown": + self.this.own(value) + elif name == "this": + set(self, name, value) + elif hasattr(self, name) and isinstance(getattr(type(self), name), property): + set(self, name, value) else: - raise AttributeError("You cannot add attributes to %s" % self) - return set_attr + raise AttributeError("You cannot add instance attributes to %s" % self) + return set_instance_attr + + +def _swig_setattr_nondynamic_class_variable(set): + def set_class_attr(cls, name, value): + if hasattr(cls, name) and not isinstance(getattr(cls, name), property): + set(cls, name, value) + else: + raise AttributeError("You cannot add class attributes to %s" % cls) + return set_class_attr + +def _swig_add_metaclass(metaclass): + """Class decorator for adding a metaclass to a SWIG wrapped class - a slimmed down version of six.add_metaclass""" + def wrapper(cls): + return metaclass(cls.__name__, cls.__bases__, cls.__dict__.copy()) + return wrapper +class _SwigNonDynamicMeta(type): + """Meta class to enforce nondynamic attributes (no new attributes) for a class""" + __setattr__ = _swig_setattr_nondynamic_class_variable(type.__setattr__) diff --git a/M2Crypto/m2urllib.py b/M2Crypto/m2urllib.py index 79791d4..06641b2 100644 --- a/M2Crypto/m2urllib.py +++ b/M2Crypto/m2urllib.py @@ -11,11 +11,10 @@ Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.""" import base64 import warnings -from M2Crypto import SSL, httpslib, six, util +from M2Crypto import SSL, httpslib, six from M2Crypto.six.moves.urllib_response import addinfourl -if util.py27plus: - from typing import AnyStr, Optional # noqa +from typing import AnyStr, Optional # noqa # six.moves doesn't support star imports if six.PY3: diff --git a/M2Crypto/m2urllib2.py b/M2Crypto/m2urllib2.py index acac92f..1849051 100644 --- a/M2Crypto/m2urllib2.py +++ b/M2Crypto/m2urllib2.py @@ -15,12 +15,11 @@ Summary of changes: import socket -from M2Crypto import SSL, httpslib, six, util +from M2Crypto import SSL, httpslib, six 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 +from typing import Optional # noqa # six.moves doesn't support star imports if six.PY3: diff --git a/M2Crypto/m2xmlrpclib.py b/M2Crypto/m2xmlrpclib.py index b1dff09..8d8aa3e 100644 --- a/M2Crypto/m2xmlrpclib.py +++ b/M2Crypto/m2xmlrpclib.py @@ -8,9 +8,8 @@ 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 import SSL, httpslib, m2urllib, six +from typing import Any, AnyStr, Callable, Optional # noqa from M2Crypto.six.moves.xmlrpc_client import ProtocolError, Transport # six.moves doesn't support star imports diff --git a/M2Crypto/util.py b/M2Crypto/util.py index 9abf141..97f5d29 100644 --- a/M2Crypto/util.py +++ b/M2Crypto/util.py @@ -15,11 +15,10 @@ 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] +from M2Crypto import m2, six +from typing import Any, Optional, TextIO, Tuple, Union # noqa +# see https://github.com/python/typeshed/issues/222 +AddrType = Union[Tuple[str, int], str] log = logging.getLogger('util') @@ -27,6 +26,7 @@ log = logging.getLogger('util') class UtilError(Exception): pass + m2.util_init(UtilError) @@ -55,7 +55,7 @@ def octx_to_num(x): def genparam_callback(p, n, out=sys.stdout): - # type: (int, Any, file) -> None + # type: (int, Any, TextIO) -> None ch = ['.', '+', '*', '\n'] out.write(ch[p]) out.flush() diff --git a/SWIG/_m2crypto_wrap.c b/SWIG/_m2crypto_wrap.c index ff75af5..9640085 100644 --- a/SWIG/_m2crypto_wrap.c +++ b/SWIG/_m2crypto_wrap.c @@ -1,14 +1,18 @@ /* ---------------------------------------------------------------------------- * 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 + * Version 4.0.2 + * + * 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. + * changes to this file unless you know what you are doing--modify the SWIG + * interface file instead. * ----------------------------------------------------------------------------- */ + +#ifndef SWIGPYTHON #define SWIGPYTHON +#endif + #define SWIG_PYTHON_THREADS #define SWIG_PYTHON_DIRECTOR_NO_VTABLE #define SWIGPYTHON_BUILTIN @@ -44,28 +48,28 @@ #ifndef SWIGUNUSED # if defined(__GNUC__) # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) -# define SWIGUNUSED __attribute__ ((__unused__)) +# define SWIGUNUSED __attribute__ ((__unused__)) # else # define SWIGUNUSED # endif # elif defined(__ICC) -# define SWIGUNUSED __attribute__ ((__unused__)) +# define SWIGUNUSED __attribute__ ((__unused__)) # else -# define SWIGUNUSED +# 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 #endif #ifndef SWIGUNUSEDPARM # ifdef __cplusplus # define SWIGUNUSEDPARM(p) # else -# define SWIGUNUSEDPARM(p) p SWIGUNUSED +# define SWIGUNUSEDPARM(p) p SWIGUNUSED # endif #endif @@ -80,9 +84,11 @@ #endif /* exporting methods */ -#if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) -# ifndef GCC_HASCLASSVISIBILITY -# define GCC_HASCLASSVISIBILITY +#if defined(__GNUC__) +# if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4) +# ifndef GCC_HASCLASSVISIBILITY +# define GCC_HASCLASSVISIBILITY +# endif # endif #endif @@ -108,7 +114,7 @@ # define SWIGSTDCALL __stdcall # else # define SWIGSTDCALL -# endif +# endif #endif /* Deal with Microsoft's attempt at deprecating C standard runtime functions */ @@ -121,10 +127,34 @@ # define _SCL_SECURE_NO_DEPRECATE #endif +/* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */ +#if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES) +# define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0 +#endif + +/* Intel's compiler complains if a variable which was never initialised is + * cast to void, which is a common idiom which we use to indicate that we + * are aware a variable isn't used. So we just silence that warning. + * See: https://github.com/swig/swig/issues/192 for more discussion. + */ +#ifdef __INTEL_COMPILER +# pragma warning disable 592 +#endif + +#if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND) +/* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */ +# include +#endif -/* Python.h has to appear first */ -#include +#if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG) +/* Use debug wrappers with the Python release dll */ +# undef _DEBUG +# include +# define _DEBUG 1 +#else +# include +#endif /* ----------------------------------------------------------------------------- * swigrun.swg @@ -150,7 +180,7 @@ 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. */ @@ -171,21 +201,22 @@ /* Flags for pointer conversions */ #define SWIG_POINTER_DISOWN 0x1 #define SWIG_CAST_NEW_MEMORY 0x2 +#define SWIG_POINTER_NO_NULL 0x4 /* Flags for new pointer objects */ #define SWIG_POINTER_OWN 0x1 -/* +/* Flags/methods for returning states. - - The SWIG conversion methods, as ConvertPtr, return an integer + + 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) { @@ -218,23 +249,23 @@ } 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; - } + 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 @@ -248,17 +279,17 @@ 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_OK (0) #define SWIG_ERROR (-1) #define SWIG_IsOK(r) (r >= 0) -#define SWIG_ArgError(r) ((r != SWIG_ERROR) ? r : SWIG_TypeError) +#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) @@ -289,11 +320,11 @@ # endif # define SWIG_CASTRANKMASK ((SWIG_CASTRANKLIMIT) -1) # define SWIG_CastRank(r) (r & SWIG_CASTRANKMASK) -SWIGINTERNINLINE int SWIG_AddCast(int r) { +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; +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) @@ -340,7 +371,7 @@ typedef struct swig_module_info { void *clientdata; /* Language specific module data */ } swig_module_info; -/* +/* Compare two type names skipping the space characters, therefore "char*" == "char *" and "Class" == "Class", etc. @@ -413,7 +444,7 @@ SWIG_TypeCheck(const char *c, swig_type_info *ty) { return 0; } -/* +/* Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison */ SWIGRUNTIME swig_cast_info * @@ -448,7 +479,7 @@ 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 * @@ -492,7 +523,7 @@ SWIG_TypePrettyName(const swig_type_info *type) { return type->name; } -/* +/* Set the clientdata field for a type */ SWIGRUNTIME void @@ -500,14 +531,14 @@ 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; } } @@ -516,31 +547,31 @@ 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. + + 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, +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; + size_t l = 0; + size_t r = iter->size - 1; do { /* since l+r >= 0, we can (>> 1) instead (/ 2) */ - register size_t i = (l + r) >> 1; + size_t i = (l + r) >> 1; const char *iname = iter->types[i]->name; if (iname) { - register int compare = strcmp(name, iname); - if (compare == 0) { + int compare = strcmp(name, iname); + if (compare == 0) { return iter->types[i]; } else if (compare < 0) { if (i) { @@ -565,14 +596,14 @@ SWIG_MangledTypeQueryModule(swig_module_info *start, 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. + + 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, +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); @@ -583,7 +614,7 @@ SWIG_TypeQueryModule(swig_module_info *start, of the str field (the human readable name) */ swig_module_info *iter = start; do { - register size_t i = 0; + 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]; @@ -591,56 +622,56 @@ SWIG_TypeQueryModule(swig_module_info *start, 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; + const unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; for (; u != eu; ++u) { - register unsigned char uu = *u; + 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; + unsigned char *u = (unsigned char *) ptr; + const unsigned char *eu = u + sz; for (; u != eu; ++u) { - register char d = *(c++); - register unsigned char uu; + char d = *(c++); + unsigned char uu; if ((d >= '0') && (d <= '9')) - uu = ((d - '0') << 4); + uu = (unsigned char)((d - '0') << 4); else if ((d >= 'a') && (d <= 'f')) - uu = ((d - ('a'-10)) << 4); - else + uu = (unsigned char)((d - ('a'-10)) << 4); + else return (char *) 0; d = *(c++); if ((d >= '0') && (d <= '9')) - uu |= (d - '0'); + uu |= (unsigned char)(d - '0'); else if ((d >= 'a') && (d <= 'f')) - uu |= (d - ('a'-10)); - else + uu |= (unsigned char)(d - ('a'-10)); + else return (char *) 0; *u = uu; } return c; } -/* +/* Pack 'void *' into a string buffer. */ SWIGRUNTIME char * @@ -700,18 +731,18 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { #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_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_MemoryError -12 #define SWIG_NullReferenceError -13 @@ -755,25 +786,31 @@ SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) { SWIGINTERN char* SWIG_Python_str_AsChar(PyObject *str) { -#if PY_VERSION_HEX >= 0x03000000 - char *cstr; - char *newstr; - Py_ssize_t len; +#if PY_VERSION_HEX >= 0x03030000 + return (char *)PyUnicode_AsUTF8(str); +#elif PY_VERSION_HEX >= 0x03000000 + char *newstr = 0; str = PyUnicode_AsUTF8String(str); - PyBytes_AsStringAndSize(str, &cstr, &len); - newstr = (char *) malloc(len+1); - memcpy(newstr, cstr, len+1); - Py_XDECREF(str); + if (str) { + char *cstr; + Py_ssize_t len; + if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) { + newstr = (char *) malloc(len+1); + if (newstr) + 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) ) +#if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000 +# define SWIG_Python_str_DelForPy3(x) #else -# define SWIG_Python_str_DelForPy3(x) +# define SWIG_Python_str_DelForPy3(x) free( (void*) (x) ) #endif @@ -787,152 +824,19 @@ SWIG_Python_str_FromChar(const char *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)) +// SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user +// interface files check for it. # define SWIGPY_USE_CAPSULE -# define SWIGPY_CAPSULE_NAME ((char*)"swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) -#endif +# define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME) #if PY_VERSION_HEX < 0x03020000 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type) #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name) +#define Py_hash_t long #endif /* ----------------------------------------------------------------------------- @@ -990,14 +894,17 @@ SWIG_Python_AddErrorMsg(const char* mesg) PyObject *value = 0; PyObject *traceback = 0; - if (PyErr_Occurred()) PyErr_Fetch(&type, &value, &traceback); + if (PyErr_Occurred()) + PyErr_Fetch(&type, &value, &traceback); if (value) { - char *tmp; PyObject *old_str = PyObject_Str(value); + const char *tmp = SWIG_Python_str_AsChar(old_str); PyErr_Clear(); Py_XINCREF(type); - - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + if (tmp) + PyErr_Format(type, "%s %s", tmp, mesg); + else + PyErr_Format(type, "%s", mesg); SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); Py_DECREF(value); @@ -1006,6 +913,37 @@ SWIG_Python_AddErrorMsg(const char* mesg) } } +SWIGRUNTIME int +SWIG_Python_TypeErrorOccurred(PyObject *obj) +{ + PyObject *error; + if (obj) + return 0; + error = PyErr_Occurred(); + return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError); +} + +SWIGRUNTIME void +SWIG_Python_RaiseOrModifyTypeError(const char *message) +{ + if (SWIG_Python_TypeErrorOccurred(NULL)) { + /* Use existing TypeError to preserve stacktrace and enhance with given message */ + PyObject *newvalue; + PyObject *type = NULL, *value = NULL, *traceback = NULL; + PyErr_Fetch(&type, &value, &traceback); +#if PY_VERSION_HEX >= 0x03000000 + newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message); +#else + newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message); +#endif + Py_XDECREF(value); + PyErr_Restore(type, newvalue, traceback); + } else { + /* Raise TypeError using given message */ + PyErr_SetString(PyExc_TypeError, message); + } +} + #if defined(SWIG_PYTHON_NO_THREADS) # if defined(SWIG_PYTHON_THREADS) # undef SWIG_PYTHON_THREADS @@ -1013,9 +951,7 @@ SWIG_Python_AddErrorMsg(const char* mesg) #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 +# define SWIG_PYTHON_USE_GIL # endif # if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */ # ifndef SWIG_PYTHON_INITIALIZE_THREADS @@ -1092,30 +1028,13 @@ extern "C" { /* Constant information structure */ typedef struct swig_const_info { int type; - char *name; + const 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 @@ -1130,6 +1049,14 @@ SWIGRUNTIME PyObject* SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), * * ----------------------------------------------------------------------------- */ +#if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */ +# error "This version of SWIG only supports Python >= 2.7" +#endif + +#if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000 +# error "This version of SWIG only supports Python 3 >= 3.2" +#endif + /* Common SWIG API */ /* for raw pointers */ @@ -1213,11 +1140,7 @@ SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) { 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); @@ -1227,11 +1150,7 @@ SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *nam 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); } @@ -1241,7 +1160,6 @@ SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *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) { @@ -1257,34 +1175,11 @@ SWIG_Python_AppendOutput(PyObject* result, PyObject* 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 +SWIGINTERN Py_ssize_t SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs) { if (!args) { @@ -1298,7 +1193,7 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi } if (!PyTuple_Check(args)) { if (min <= 1 && max >= 1) { - register int i; + Py_ssize_t i; objs[0] = args; for (i = 1; i < max; ++i) { objs[i] = 0; @@ -1308,7 +1203,7 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple"); return 0; } else { - register Py_ssize_t l = PyTuple_GET_SIZE(args); + 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); @@ -1318,7 +1213,7 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi name, (min == max ? "" : "at most "), (int)max, (int)l); return 0; } else { - register int i; + Py_ssize_t i; for (i = 0; i < l; ++i) { objs[i] = PyTuple_GET_ITEM(args, i); } @@ -1330,12 +1225,21 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi } } +SWIGINTERN int +SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) { + int no_kwargs = 1; + if (kwargs) { + assert(PyDict_Check(kwargs)); + if (PyDict_Size(kwargs) > 0) { + PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name); + no_kwargs = 0; + } + } + return no_kwargs; +} + /* 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 @@ -1364,35 +1268,6 @@ SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssi 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 * @@ -1419,7 +1294,10 @@ SWIGRUNTIMEINLINE int SWIG_Python_CheckImplicit(swig_type_info *ty) { SwigPyClientData *data = (SwigPyClientData *)ty->clientdata; - return data ? data->implicitconv : 0; + int fail = data ? data->implicitconv : 0; + if (fail) + PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors."); + return fail; } SWIGRUNTIMEINLINE PyObject * @@ -1446,11 +1324,7 @@ SwigPyClientData_New(PyObject* obj) 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 + data->newraw = PyObject_GetAttrString(data->klass, "__new__"); if (data->newraw) { Py_INCREF(data->newraw); data->newargs = PyTuple_New(1); @@ -1461,7 +1335,7 @@ SwigPyClientData_New(PyObject* obj) Py_INCREF(data->newargs); } /* the destroy method, aka as the C++ delete method */ - data->destroy = PyObject_GetAttrString(data->klass, (char *)"__swig_destroy__"); + data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__"); if (PyErr_Occurred()) { PyErr_Clear(); data->destroy = 0; @@ -1470,11 +1344,7 @@ SwigPyClientData_New(PyObject* obj) 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; } @@ -1504,6 +1374,23 @@ typedef struct { #endif } SwigPyObject; + +#ifdef SWIGPYTHON_BUILTIN + +SWIGRUNTIME PyObject * +SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) +{ + SwigPyObject *sobj = (SwigPyObject *)v; + + if (!sobj->dict) + sobj->dict = PyDict_New(); + + Py_INCREF(sobj->dict); + return sobj->dict; +} + +#endif + SWIGRUNTIME PyObject * SwigPyObject_long(SwigPyObject *v) { @@ -1545,20 +1432,12 @@ SwigPyObject_hex(SwigPyObject *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); @@ -1571,32 +1450,12 @@ SwigPyObject_repr(SwigPyObject *v, PyObject *args) 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; - } -} - +/* We need a version taking two PyObject* parameters so it's a valid + * PyCFunction to use in swigobject_methods[]. */ SWIGRUNTIME PyObject * -SwigPyObject_str(SwigPyObject *v) +SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args)) { - char result[SWIG_BUFFER_SIZE]; - return SWIG_PackVoidPtr(result, v->ptr, v->ty->name, sizeof(result)) ? - SWIG_Python_str_FromChar(result) : 0; + return SwigPyObject_repr((SwigPyObject*)v); } SWIGRUNTIME int @@ -1670,16 +1529,32 @@ SwigPyObject_dealloc(PyObject *v) if (destroy) { /* destroy is always a VARARGS method */ PyObject *res; + + /* PyObject_CallFunction() has the potential to silently drop + the active exception. In cases of unnamed temporary + variable or where we just finished iterating over a generator + StopIteration will be active right now, and this needs to + remain true upon return from SwigPyObject_dealloc. So save + and restore. */ + + PyObject *type = NULL, *value = NULL, *traceback = NULL; + PyErr_Fetch(&type, &value, &traceback); + 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); + /* 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)); + PyCFunction meth = PyCFunction_GET_FUNCTION(destroy); + PyObject *mself = PyCFunction_GET_SELF(destroy); + res = ((*meth)(mself, v)); } + if (!res) + PyErr_WriteUnraisable(destroy); + + PyErr_Restore(type, value, traceback); + Py_XDECREF(res); } #if !defined(SWIG_PYTHON_SILENT_MEMLEAK) @@ -1697,12 +1572,8 @@ 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)) { + PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject"); return NULL; } sobj->next = next; @@ -1711,11 +1582,7 @@ SwigPyObject_append(PyObject* v, PyObject* next) } 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) { @@ -1727,11 +1594,7 @@ SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) } 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; @@ -1739,11 +1602,7 @@ SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args)) } 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; @@ -1754,70 +1613,32 @@ 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; + if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) { + return NULL; + } else { + SwigPyObject *sobj = (SwigPyObject *)v; + PyObject *obj = PyBool_FromLong(sobj->own); + if (val) { + if (PyObject_IsTrue(val)) { + SwigPyObject_acquire(v,args); + } else { + SwigPyObject_disown(v,args); + } } - 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; - } + 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"}, + {"disown", SwigPyObject_disown, METH_NOARGS, "releases ownership of the pointer"}, + {"acquire", SwigPyObject_acquire, METH_NOARGS, "acquires ownership of the pointer"}, + {"own", SwigPyObject_own, METH_VARARGS, "returns/sets ownership of the pointer"}, + {"append", SwigPyObject_append, METH_O, "appends another 'this' object"}, + {"next", SwigPyObject_next, METH_NOARGS, "returns the next 'this' object"}, + {"__repr__",SwigPyObject_repr2, METH_NOARGS, "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) { @@ -1858,14 +1679,12 @@ SwigPyObject_TypeOnce(void) { (unaryfunc)SwigPyObject_oct, /*nb_oct*/ (unaryfunc)SwigPyObject_hex, /*nb_hex*/ #endif -#if PY_VERSION_HEX >= 0x03000000 /* 3.0 */ +#if PY_VERSION_HEX >= 0x03050000 /* 3.5 */ + 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */ +#elif 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 */ +#else 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 }; @@ -1873,26 +1692,21 @@ SwigPyObject_TypeOnce(void) { 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 */ + "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 + 0, /* tp_print */ (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 */ + 0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */ #else (cmpfunc)SwigPyObject_compare, /* tp_compare */ #endif @@ -1902,7 +1716,7 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_as_mapping */ (hashfunc)0, /* tp_hash */ (ternaryfunc)0, /* tp_call */ - (reprfunc)SwigPyObject_str, /* tp_str */ + 0, /* tp_str */ PyObject_GenericGetAttr, /* tp_getattro */ 0, /* tp_setattro */ 0, /* tp_as_buffer */ @@ -1912,7 +1726,6 @@ SwigPyObject_TypeOnce(void) { 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 */ @@ -1933,25 +1746,29 @@ SwigPyObject_TypeOnce(void) { 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ #endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version */ +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ #endif #ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* 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; } @@ -1980,20 +1797,6 @@ typedef struct { 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) { @@ -2022,7 +1825,7 @@ 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); + return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size); } SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void); @@ -2056,18 +1859,17 @@ SwigPyPacked_TypeOnce(void) { 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 */ + "SwigPyPacked", /* tp_name */ sizeof(SwigPyPacked), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor)SwigPyPacked_dealloc, /* tp_dealloc */ - (printfunc)SwigPyPacked_print, /* tp_print */ + 0, /* tp_print */ (getattrfunc)0, /* tp_getattr */ (setattrfunc)0, /* tp_setattr */ #if PY_VERSION_HEX>=0x03000000 @@ -2091,7 +1893,6 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_clear */ 0, /* tp_richcompare */ 0, /* tp_weaklistoffset */ -#if PY_VERSION_HEX >= 0x02020000 0, /* tp_iter */ 0, /* tp_iternext */ 0, /* tp_methods */ @@ -2112,25 +1913,29 @@ SwigPyPacked_TypeOnce(void) { 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ -#endif -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ #endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version */ +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ #endif #ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* 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; } @@ -2171,20 +1976,14 @@ SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size) * pointers/data manipulation * ----------------------------------------------------------------------------- */ -SWIGRUNTIMEINLINE PyObject * -_SWIG_This(void) -{ - return SWIG_Python_str_FromChar("this"); -} - -static PyObject *swig_this = NULL; +static PyObject *Swig_This_global = NULL; SWIGRUNTIME PyObject * SWIG_This(void) { - if (swig_this == NULL) - swig_this = _SWIG_This(); - return swig_this; + if (Swig_This_global == NULL) + Swig_This_global = SWIG_Python_str_FromChar("this"); + return Swig_This_global; } /* #define SWIG_PYTHON_SLOW_GETSET_THIS */ @@ -2216,7 +2015,7 @@ SWIG_Python_GetSwigThis(PyObject *pyobj) obj = 0; -#if (!defined(SWIG_PYTHON_SLOW_GETSET_THIS) && (PY_VERSION_HEX >= 0x02030000)) +#if !defined(SWIG_PYTHON_SLOW_GETSET_THIS) if (PyInstance_Check(pyobj)) { obj = _PyInstance_Lookup(pyobj, SWIG_This()); } else { @@ -2279,13 +2078,14 @@ SWIGRUNTIME int SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) { int res; SwigPyObject *sobj; + int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0; if (!obj) return SWIG_ERROR; - if (obj == Py_None) { + if (obj == Py_None && !implicit_conv) { if (ptr) *ptr = 0; - return SWIG_OK; + return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK; } res = SWIG_ERROR; @@ -2331,7 +2131,7 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } res = SWIG_OK; } else { - if (flags & SWIG_POINTER_IMPLICIT_CONV) { + if (implicit_conv) { SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0; if (data && !data->implicitconv) { PyObject *klass = data->klass; @@ -2365,6 +2165,13 @@ SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int } } } + if (!SWIG_IsOK(res) && obj == Py_None) { + if (ptr) + *ptr = 0; + if (PyErr_Occurred()) + PyErr_Clear(); + res = SWIG_OK; + } } } return res; @@ -2378,31 +2185,28 @@ SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) { return SWIG_ConvertPtr(obj, ptr, ty, 0); } else { void *vptr = 0; - + swig_cast_info *tc; + /* 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) + 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; - } + tc = SWIG_TypeCheck(desc,ty); + if (tc) { + int newmemory = 0; + *ptr = SWIG_TypeCast(tc,vptr,&newmemory); + assert(!newmemory); /* newmemory handling not yet implemented */ } else { - *ptr = vptr; + return SWIG_ERROR; } return SWIG_OK; } } -/* Convert a packed value value */ +/* Convert a packed pointer value */ SWIGRUNTIME int SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) { @@ -2430,7 +2234,6 @@ SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *t SWIGRUNTIME PyObject* SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) { -#if (PY_VERSION_HEX >= 0x02020000) PyObject *inst = 0; PyObject *newraw = data->newraw; if (newraw) { @@ -2447,16 +2250,30 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) } } #else - PyObject *key = SWIG_This(); - PyObject_SetAttr(inst, key, swig_this); + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } #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; + PyObject *empty_args = PyTuple_New(0); + if (empty_args) { + PyObject *empty_kwargs = PyDict_New(); + if (empty_kwargs) { + inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs); + Py_DECREF(empty_kwargs); + if (inst) { + if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) { + Py_DECREF(inst); + inst = 0; + } else { + Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG; + } + } + } + Py_DECREF(empty_args); } #else PyObject *dict = PyDict_New(); @@ -2468,59 +2285,23 @@ SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this) #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 +SWIGRUNTIME int 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; - } +#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; + } + return PyDict_SetItem(dict, SWIG_This(), swig_this); + } #endif - dict = PyObject_GetAttrString(inst, (char*)"__dict__"); - PyDict_SetItem(dict, SWIG_This(), swig_this); - Py_DECREF(dict); + return PyObject_SetAttr(inst, SWIG_This(), swig_this); } @@ -2534,7 +2315,8 @@ SWIG_Python_InitShadowInstance(PyObject *args) { if (sthis) { SwigPyObject_append((PyObject*) sthis, obj[1]); } else { - SWIG_Python_SetSwigThis(obj[0], obj[1]); + if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0) + return NULL; } return SWIG_Py_Void(); } @@ -2563,18 +2345,21 @@ SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int f newobj = (SwigPyObject *) newobj->next; newobj->next = next_self; newobj = (SwigPyObject *)next_self; +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif } } else { newobj = PyObject_New(SwigPyObject, clientdata->pytype); +#ifdef SWIGPYTHON_BUILTIN + newobj->dict = 0; +#endif } 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(); @@ -2614,12 +2399,7 @@ SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { #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; @@ -2629,50 +2409,10 @@ SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) { 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) { @@ -2683,33 +2423,24 @@ SWIG_Python_DestroyModule(void *vptr) } } Py_DECREF(SWIG_This()); - swig_this = NULL; + Swig_This_global = 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); + PyObject *module = PyImport_AddModule("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); + PyObject *module = Py_InitModule("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); + PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer); } else { Py_XDECREF(pointer); } -#endif } /* The python cached type query */ @@ -2727,20 +2458,12 @@ SWIG_Python_TypeQuery(const char *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); } @@ -2765,14 +2488,15 @@ SWIG_Python_AddErrMesg(const char* mesg, int infront) PyObject *traceback = 0; PyErr_Fetch(&type, &value, &traceback); if (value) { - char *tmp; PyObject *old_str = PyObject_Str(value); + const char *tmp = SWIG_Python_str_AsChar(old_str); + const char *errmesg = tmp ? tmp : "Invalid error message"; Py_XINCREF(type); PyErr_Clear(); if (infront) { - PyErr_Format(type, "%s %s", mesg, tmp = SWIG_Python_str_AsChar(old_str)); + PyErr_Format(type, "%s %s", mesg, errmesg); } else { - PyErr_Format(type, "%s %s", tmp = SWIG_Python_str_AsChar(old_str), mesg); + PyErr_Format(type, "%s %s", errmesg, mesg); } SWIG_Python_str_DelForPy3(tmp); Py_DECREF(old_str); @@ -2865,7 +2589,7 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { PyObject *descr; PyObject *encoded_name; descrsetfunc f; - int res; + int res = -1; # ifdef Py_USING_UNICODE if (PyString_Check(name)) { @@ -2888,7 +2612,6 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { goto done; } - res = -1; descr = _PyType_Lookup(tp, name); f = NULL; if (descr != NULL) @@ -2899,6 +2622,8 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { Py_INCREF(name); } else { encoded_name = PyUnicode_AsUTF8String(name); + if (!encoded_name) + return -1; } PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name)); Py_DECREF(encoded_name); @@ -2917,208 +2642,33 @@ SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) { } #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; \ -} +#ifdef __cplusplus +extern "C" { +#endif -#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; \ +SWIGINTERN Py_hash_t +SwigPyObject_hash(PyObject *obj) { + SwigPyObject *sobj = (SwigPyObject *)obj; + void *ptr = sobj->ptr; + return (Py_hash_t)ptr; } -#ifdef __cplusplus -extern "C" { +SWIGINTERN Py_hash_t +SWIG_PyNumber_AsPyHash(PyObject *obj) { + Py_hash_t result = -1; +#if PY_VERSION_HEX < 0x03020000 + if (PyInt_Check(obj)) + result = PyInt_AsLong(obj); + else if (PyLong_Check(obj)) + result = PyLong_AsLong(obj); +#else + if (PyNumber_Check(obj)) + result = PyNumber_AsSsize_t(obj, NULL); #endif + else + PyErr_Format(PyExc_TypeError, "Wrong type for hash function"); + return PyErr_Occurred() ? -1 : result; +} SWIGINTERN int SwigPyBuiltin_BadInit(PyObject *self, PyObject *SWIGUNUSEDPARM(args), PyObject *SWIGUNUSEDPARM(kwds)) { @@ -3127,11 +2677,10 @@ SwigPyBuiltin_BadInit(PyObject *self, PyObject *SWIGUNUSEDPARM(args), PyObject * } SWIGINTERN void -SwigPyBuiltin_BadDealloc(PyObject *pyobj) { - SwigPyObject *sobj; - sobj = (SwigPyObject *)pyobj; +SwigPyBuiltin_BadDealloc(PyObject *obj) { + SwigPyObject *sobj = (SwigPyObject *)obj; if (sobj->own) { - PyErr_Format(PyExc_TypeError, "Swig detected a memory leak in type '%.300s': no callable destructor found.", pyobj->ob_type->tp_name); + PyErr_Format(PyExc_TypeError, "Swig detected a memory leak in type '%.300s': no callable destructor found.", obj->ob_type->tp_name); } } @@ -3184,8 +2733,8 @@ SwigPyBuiltin_SetterClosure (PyObject *obj, PyObject *val, void *closure) { } tuple = PyTuple_New(1); assert(tuple); + Py_INCREF(val); PyTuple_SET_ITEM(tuple, 0, val); - Py_XINCREF(val); result = (*getset->set)(obj, tuple); Py_DECREF(tuple); Py_XDECREF(result); @@ -3212,7 +2761,7 @@ SwigPyBuiltin_FunpackSetterClosure (PyObject *obj, PyObject *val, void *closure) SWIGINTERN void SwigPyStaticVar_dealloc(PyDescrObject *descr) { - _PyObject_GC_UNTRACK(descr); + PyObject_GC_UnTrack(descr); Py_XDECREF(PyDescr_TYPE(descr)); Py_XDECREF(PyDescr_NAME(descr)); PyObject_GC_Del(descr); @@ -3261,9 +2810,13 @@ SwigPyStaticVar_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value) } SWIGINTERN int -SwigPyObjectType_setattro(PyTypeObject *type, PyObject *name, PyObject *value) { +SwigPyObjectType_setattro(PyObject *typeobject, PyObject *name, PyObject *value) { PyObject *attribute; + PyTypeObject *type; descrsetfunc local_set; + + assert(PyType_Check(typeobject)); + type = (PyTypeObject *)typeobject; attribute = _PyType_Lookup(type, name); if (attribute != NULL) { /* Implement descriptor functionality, if any */ @@ -3292,16 +2845,15 @@ SwigPyStaticVar_Type(void) { 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, + 0, /* ob_size */ #endif - "swig_static_var_getset_descriptor", - sizeof(PyGetSetDescrObject), - 0, + "swig_static_var_getset_descriptor", /* tp_name */ + sizeof(PyGetSetDescrObject), /* tp_basicsize */ + 0, /* tp_itemsize */ (destructor)SwigPyStaticVar_dealloc, /* tp_dealloc */ 0, /* tp_print */ 0, /* tp_getattr */ @@ -3343,28 +2895,118 @@ SwigPyStaticVar_Type(void) { 0, /* tp_cache */ 0, /* tp_subclasses */ 0, /* tp_weaklist */ -#if PY_VERSION_HEX >= 0x02030000 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ #endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version */ +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ #endif #ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* 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 PyTypeObject* +SwigPyObjectType(void) { + static char swigpyobjecttype_doc[] = "Metaclass for SWIG wrapped types"; + static PyTypeObject swigpyobjecttype_type; + static int type_init = 0; + if (!type_init) { + const PyTypeObject tmp = { +#if PY_VERSION_HEX >= 0x03000000 + PyVarObject_HEAD_INIT(&PyType_Type, 0) +#else + PyObject_HEAD_INIT(&PyType_Type) + 0, /* ob_size */ +#endif + "SwigPyObjectType", /* tp_name */ + PyType_Type.tp_basicsize, /* tp_basicsize */ + 0, /* tp_itemsize */ + 0, /* tp_dealloc */ + 0, /* tp_print */ + 0, /* tp_getattr */ + 0, /* tp_setattr */ + 0, /* tp_compare */ + 0, /* tp_repr */ + 0, /* tp_as_number */ + 0, /* tp_as_sequence */ + 0, /* tp_as_mapping */ + 0, /* tp_hash */ + 0, /* tp_call */ + 0, /* tp_str */ + 0, /* tp_getattro */ + SwigPyObjectType_setattro, /* tp_setattro */ + 0, /* tp_as_buffer */ + Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */ + swigpyobjecttype_doc, /* tp_doc */ + 0, /* 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 */ + 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 */ + 0, /* tp_del */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#ifdef COUNT_ALLOCS + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* tp_next */ +#endif + }; + swigpyobjecttype_type = tmp; + type_init = 1; + swigpyobjecttype_type.tp_base = &PyType_Type; + if (PyType_Ready(&swigpyobjecttype_type) < 0) + return NULL; + } + return &swigpyobjecttype_type; +} + SWIGINTERN PyGetSetDescrObject * SwigPyStaticVar_new_getset(PyTypeObject *type, PyGetSetDef *getset) { @@ -3384,10 +3026,10 @@ SwigPyStaticVar_new_getset(PyTypeObject *type, PyGetSetDef *getset) { SWIGINTERN void SwigPyBuiltin_InitBases (PyTypeObject *type, PyTypeObject **bases) { - int base_count = 0; + Py_ssize_t base_count = 0; PyTypeObject **b; PyObject *tuple; - int i; + Py_ssize_t i; if (!bases[0]) { bases[0] = SwigPyObject_type(); @@ -3399,8 +3041,8 @@ SwigPyBuiltin_InitBases (PyTypeObject *type, PyTypeObject **bases) { ++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]); + PyTuple_SET_ITEM(tuple, i, (PyObject *)bases[i]); } type->tp_bases = tuple; } @@ -3423,36 +3065,376 @@ SwigPyBuiltin_SetMetaType (PyTypeObject *type, PyTypeObject *metatype) #endif } -#ifdef __cplusplus -} -#endif +/* Start of callback function macros for use in PyTypeObject */ +typedef PyObject *(*SwigPyWrapperFunction)(PyObject *, PyObject *); +#define SWIGPY_UNARYFUNC_CLOSURE(wrapper) \ +SWIGINTERN PyObject * \ +wrapper##_unaryfunc_closure(PyObject *a) { \ + return SwigPyBuiltin_unaryfunc_closure(wrapper, a); \ +} +SWIGINTERN PyObject * +SwigPyBuiltin_unaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { + return wrapper(a, NULL); +} -#define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0) +#define SWIGPY_DESTRUCTOR_CLOSURE(wrapper) \ +SWIGINTERN void \ +wrapper##_destructor_closure(PyObject *a) { \ + SwigPyBuiltin_destructor_closure(wrapper, #wrapper, a); \ +} +SWIGINTERN void +SwigPyBuiltin_destructor_closure(SwigPyWrapperFunction wrapper, const char *wrappername, PyObject *a) { + SwigPyObject *sobj; + sobj = (SwigPyObject *)a; + Py_XDECREF(sobj->dict); + if (sobj->own) { + PyObject *o; + PyObject *type = 0, *value = 0, *traceback = 0; + PyErr_Fetch(&type, &value, &traceback); + o = wrapper(a, NULL); + if (!o) { + PyObject *deallocname = PyString_FromString(wrappername); + PyErr_WriteUnraisable(deallocname); + Py_DECREF(deallocname); + } + PyErr_Restore(type, value, traceback); + Py_XDECREF(o); + } + if (PyType_IS_GC(a->ob_type)) { + PyObject_GC_Del(a); + } else { + PyObject_Del(a); + } +} -#define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else +#define SWIGPY_INQUIRY_CLOSURE(wrapper) \ +SWIGINTERN int \ +wrapper##_inquiry_closure(PyObject *a) { \ + return SwigPyBuiltin_inquiry_closure(wrapper, a); \ +} +SWIGINTERN int +SwigPyBuiltin_inquiry_closure(SwigPyWrapperFunction wrapper, PyObject *a) { + PyObject *pyresult; + int result; + pyresult = wrapper(a, NULL); + result = pyresult && PyObject_IsTrue(pyresult) ? 1 : 0; + Py_XDECREF(pyresult); + return result; +} +#define SWIGPY_GETITERFUNC_CLOSURE(wrapper) \ +SWIGINTERN PyObject * \ +wrapper##_getiterfunc_closure(PyObject *a) { \ + return SwigPyBuiltin_getiterfunc_closure(wrapper, a); \ +} +SWIGINTERN PyObject * +SwigPyBuiltin_getiterfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { + return wrapper(a, NULL); +} +#define SWIGPY_BINARYFUNC_CLOSURE(wrapper) \ +SWIGINTERN PyObject * \ +wrapper##_binaryfunc_closure(PyObject *a, PyObject *b) { \ + return SwigPyBuiltin_binaryfunc_closure(wrapper, a, b); \ +} +SWIGINTERN PyObject * +SwigPyBuiltin_binaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { + PyObject *tuple, *result; + tuple = PyTuple_New(1); + assert(tuple); + Py_INCREF(b); + PyTuple_SET_ITEM(tuple, 0, b); + result = wrapper(a, tuple); + Py_DECREF(tuple); + return result; +} - #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0) +typedef ternaryfunc ternarycallfunc; +#define SWIGPY_TERNARYFUNC_CLOSURE(wrapper) \ +SWIGINTERN PyObject * \ +wrapper##_ternaryfunc_closure(PyObject *a, PyObject *b, PyObject *c) { \ + return SwigPyBuiltin_ternaryfunc_closure(wrapper, a, b, c); \ +} +SWIGINTERN PyObject * +SwigPyBuiltin_ternaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { + PyObject *tuple, *result; + tuple = PyTuple_New(2); + assert(tuple); + Py_INCREF(b); + PyTuple_SET_ITEM(tuple, 0, b); + Py_INCREF(c); + PyTuple_SET_ITEM(tuple, 1, c); + result = wrapper(a, tuple); + Py_DECREF(tuple); + return result; +} -/* -------- TYPES TABLE (BEGIN) -------- */ +#define SWIGPY_TERNARYCALLFUNC_CLOSURE(wrapper) \ +SWIGINTERN PyObject * \ +wrapper##_ternarycallfunc_closure(PyObject *a, PyObject *b, PyObject *c) { \ + return SwigPyBuiltin_ternarycallfunc_closure(wrapper, a, b, c); \ +} +SWIGINTERN PyObject * +SwigPyBuiltin_ternarycallfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { + (void) c; + return wrapper(a, b); +} -#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 SWIGPY_LENFUNC_CLOSURE(wrapper) \ +SWIGINTERN Py_ssize_t \ +wrapper##_lenfunc_closure(PyObject *a) { \ + return SwigPyBuiltin_lenfunc_closure(wrapper, a); \ +} +SWIGINTERN Py_ssize_t +SwigPyBuiltin_lenfunc_closure(SwigPyWrapperFunction wrapper, 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##_ssizessizeargfunc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c) { \ + return SwigPyBuiltin_ssizessizeargfunc_closure(wrapper, a, b, c); \ +} +SWIGINTERN PyObject * +SwigPyBuiltin_ssizessizeargfunc_closure(SwigPyWrapperFunction wrapper, 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##_ssizessizeobjargproc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) { \ + return SwigPyBuiltin_ssizessizeobjargproc_closure(wrapper, a, b, c, d); \ +} +SWIGINTERN int +SwigPyBuiltin_ssizessizeobjargproc_closure(SwigPyWrapperFunction wrapper, 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) { + Py_INCREF(d); + PyTuple_SET_ITEM(tuple, 2, 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##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) { \ + return SwigPyBuiltin_funpack_ssizeargfunc_closure(wrapper, a, b); \ +} +SWIGINTERN PyObject * +SwigPyBuiltin_funpack_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, 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##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) { \ + return SwigPyBuiltin_ssizeargfunc_closure(wrapper, a, b); \ +} +SWIGINTERN PyObject * +SwigPyBuiltin_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, 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##_ssizeobjargproc_closure(PyObject *a, Py_ssize_t b, PyObject *c) { \ + return SwigPyBuiltin_ssizeobjargproc_closure(wrapper, a, b, c); \ +} +SWIGINTERN int +SwigPyBuiltin_ssizeobjargproc_closure(SwigPyWrapperFunction wrapper, 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)); + Py_INCREF(c); + PyTuple_SET_ITEM(tuple, 1, c); + resultobj = wrapper(a, tuple); + result = resultobj ? 0 : -1; + Py_XDECREF(resultobj); + Py_DECREF(tuple); + return result; +} + +#define SWIGPY_OBJOBJPROC_CLOSURE(wrapper) \ +SWIGINTERN int \ +wrapper##_objobjproc_closure(PyObject *a, PyObject *b) { \ + return SwigPyBuiltin_objobjproc_closure(wrapper, a, b); \ +} +SWIGINTERN int +SwigPyBuiltin_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { + int result; + PyObject *pyresult; + PyObject *tuple; + tuple = PyTuple_New(1); + assert(tuple); + Py_INCREF(b); + PyTuple_SET_ITEM(tuple, 0, b); + pyresult = wrapper(a, tuple); + result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1; + Py_XDECREF(pyresult); + Py_DECREF(tuple); + return result; +} + +#define SWIGPY_FUNPACK_OBJOBJPROC_CLOSURE(wrapper) \ +SWIGINTERN int \ +wrapper##_objobjproc_closure(PyObject *a, PyObject *b) { \ + return SwigPyBuiltin_funpack_objobjproc_closure(wrapper, a, b); \ +} +SWIGINTERN int +SwigPyBuiltin_funpack_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) { + int result; + PyObject *pyresult; + pyresult = wrapper(a, b); + result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1; + Py_XDECREF(pyresult); + return result; +} + +#define SWIGPY_OBJOBJARGPROC_CLOSURE(wrapper) \ +SWIGINTERN int \ +wrapper##_objobjargproc_closure(PyObject *a, PyObject *b, PyObject *c) { \ + return SwigPyBuiltin_objobjargproc_closure(wrapper, a, b, c); \ +} +SWIGINTERN int +SwigPyBuiltin_objobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) { + PyObject *tuple, *resultobj; + int result; + tuple = PyTuple_New(c ? 2 : 1); + assert(tuple); + Py_INCREF(b); + PyTuple_SET_ITEM(tuple, 0, b); + if (c) { + Py_INCREF(c); + PyTuple_SET_ITEM(tuple, 1, 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##_reprfunc_closure(PyObject *a) { \ + return SwigPyBuiltin_reprfunc_closure(wrapper, a); \ +} +SWIGINTERN PyObject * +SwigPyBuiltin_reprfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { + return wrapper(a, NULL); +} + +#define SWIGPY_HASHFUNC_CLOSURE(wrapper) \ +SWIGINTERN Py_hash_t \ +wrapper##_hashfunc_closure(PyObject *a) { \ + return SwigPyBuiltin_hashfunc_closure(wrapper, a); \ +} +SWIGINTERN Py_hash_t +SwigPyBuiltin_hashfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { + PyObject *pyresult; + Py_hash_t result; + pyresult = wrapper(a, NULL); + if (!pyresult) + return -1; + result = SWIG_PyNumber_AsPyHash(pyresult); + Py_DECREF(pyresult); + return result; +} + +#define SWIGPY_ITERNEXTFUNC_CLOSURE(wrapper) \ +SWIGINTERN PyObject * \ +wrapper##_iternextfunc_closure(PyObject *a) { \ + return SwigPyBuiltin_iternextfunc_closure(wrapper, a);\ +} +SWIGINTERN PyObject * +SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) { + return wrapper(a, NULL); +} + +/* End of callback function macros for use in PyTypeObject */ + +#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 + + + +#ifdef __cplusplus +extern "C" { +#endif + +/* Method creation and docstring support functions */ + +SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name); +SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); +SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func); + +#ifdef __cplusplus +} +#endif + + + #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] @@ -3482,43 +3464,59 @@ SwigPyBuiltin_SetMetaType (PyTypeObject *type, PyTypeObject *metatype) #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 SWIGTYPE_p___INTMAX_TYPE__ swig_types[41] +#define SWIGTYPE_p___INT_FAST16_TYPE__ swig_types[42] +#define SWIGTYPE_p___INT_FAST32_TYPE__ swig_types[43] +#define SWIGTYPE_p___INT_FAST64_TYPE__ swig_types[44] +#define SWIGTYPE_p___INT_FAST8_TYPE__ swig_types[45] +#define SWIGTYPE_p___INT_LEAST16_TYPE__ swig_types[46] +#define SWIGTYPE_p___INT_LEAST32_TYPE__ swig_types[47] +#define SWIGTYPE_p___INT_LEAST64_TYPE__ swig_types[48] +#define SWIGTYPE_p___INT_LEAST8_TYPE__ swig_types[49] +#define SWIGTYPE_p___UINTMAX_TYPE__ swig_types[50] +#define SWIGTYPE_p___UINT_FAST16_TYPE__ swig_types[51] +#define SWIGTYPE_p___UINT_FAST32_TYPE__ swig_types[52] +#define SWIGTYPE_p___UINT_FAST64_TYPE__ swig_types[53] +#define SWIGTYPE_p___UINT_FAST8_TYPE__ swig_types[54] +#define SWIGTYPE_p___UINT_LEAST16_TYPE__ swig_types[55] +#define SWIGTYPE_p___UINT_LEAST32_TYPE__ swig_types[56] +#define SWIGTYPE_p___UINT_LEAST64_TYPE__ swig_types[57] +#define SWIGTYPE_p___UINT_LEAST8_TYPE__ swig_types[58] +#define SWIGTYPE_p__cbd_t swig_types[59] +#define SWIGTYPE_p_char swig_types[60] +#define SWIGTYPE_p_f_int_p_X509_STORE_CTX__int swig_types[61] +#define SWIGTYPE_p_f_p_char__void swig_types[62] +#define SWIGTYPE_p_f_p_q_const__char__p_char swig_types[63] +#define SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int swig_types[64] +#define SWIGTYPE_p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int swig_types[65] +#define SWIGTYPE_p_f_p_q_const__void__p_void swig_types[66] +#define SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int swig_types[67] +#define SWIGTYPE_p_f_p_void__void swig_types[68] +#define SWIGTYPE_p_p_ASN1_OBJECT swig_types[69] +#define SWIGTYPE_p_p_EVP_PKEY_CTX swig_types[70] +#define SWIGTYPE_p_p_X509_NAME_ENTRY swig_types[71] +#define SWIGTYPE_p_p_unsigned_char swig_types[72] +#define SWIGTYPE_p_pyfd_struct swig_types[73] +#define SWIGTYPE_p_stack_st swig_types[74] +#define SWIGTYPE_p_stack_st_OPENSSL_BLOCK swig_types[75] +#define SWIGTYPE_p_stack_st_OPENSSL_CSTRING swig_types[76] +#define SWIGTYPE_p_stack_st_OPENSSL_STRING swig_types[77] +#define SWIGTYPE_p_stack_st_SSL_CIPHER swig_types[78] +#define SWIGTYPE_p_stack_st_X509 swig_types[79] +#define SWIGTYPE_p_stack_st_X509_EXTENSION swig_types[80] +#define SWIGTYPE_p_unsigned_char swig_types[81] +#define SWIGTYPE_p_void swig_types[82] +static swig_type_info *swig_types[84]; +static swig_module_info swig_module = {swig_types, 83, 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" +#ifdef SWIG_TypeQuery +# undef SWIG_TypeQuery #endif +#define SWIG_TypeQuery SWIG_Python_TypeQuery /*----------------------------------------------- @(target):= _m2crypto.so @@ -3532,7 +3530,7 @@ static swig_module_info swig_module = {swig_types, 60, 0, 0, 0, 0}; #endif #define SWIG_name "_m2crypto" -#define SWIGVERSION 0x020010 +#define SWIGVERSION 0x040002 #define SWIG_VERSION SWIGVERSION @@ -3540,6 +3538,9 @@ static swig_module_info swig_module = {swig_types, 60, 0, 0, 0, 0}; #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a)) +#include + + int SWIG_AsVal_wchar_t(PyObject *p, wchar_t *c) { return SWIG_OK; } PyObject *SWIG_From_wchar_t(wchar_t c) { return SWIG_Py_Void(); } @@ -3573,7 +3574,7 @@ static PyObject *ssl_set_tmp_rsa_cb_func; static PyObject *x509_store_verify_cb_func; - #define SWIG_From_long PyLong_FromLong + #define SWIG_From_long PyInt_FromLong SWIGINTERN swig_type_info* @@ -3599,9 +3600,13 @@ SWIG_FromCharPtrAndSize(const char* carray, size_t size) SWIG_InternalNewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void(); } else { #if PY_VERSION_HEX >= 0x03000000 - return PyUnicode_FromStringAndSize(carray, (int)(size)); +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size)); +#else + return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape"); +#endif #else - return PyString_FromStringAndSize(carray, (int)(size)); + return PyString_FromStringAndSize(carray, (Py_ssize_t)(size)); #endif } } else { @@ -3617,6 +3622,13 @@ SWIG_FromCharPtr(const char *cptr) } +SWIGINTERNINLINE PyObject* + SWIG_From_int (int value) +{ + return PyInt_FromLong((long) value); +} + + #include #if !defined(SWIG_NO_LLONG_MAX) # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__) @@ -3634,9 +3646,11 @@ SWIG_AsVal_double (PyObject *obj, double *val) if (PyFloat_Check(obj)) { if (val) *val = PyFloat_AsDouble(obj); return SWIG_OK; +#if PY_VERSION_HEX < 0x03000000 } else if (PyInt_Check(obj)) { - if (val) *val = PyInt_AsLong(obj); + if (val) *val = (double) PyInt_AsLong(obj); return SWIG_OK; +#endif } else if (PyLong_Check(obj)) { double v = PyLong_AsDouble(obj); if (!PyErr_Occurred()) { @@ -3710,16 +3724,20 @@ SWIG_CanCastAsInteger(double *d, double min, double max) { SWIGINTERN int SWIG_AsVal_long (PyObject *obj, long* val) { +#if PY_VERSION_HEX < 0x03000000 if (PyInt_Check(obj)) { if (val) *val = PyInt_AsLong(obj); return SWIG_OK; - } else if (PyLong_Check(obj)) { + } else +#endif + if (PyLong_Check(obj)) { long v = PyLong_AsLong(obj); if (!PyErr_Occurred()) { if (val) *val = v; return SWIG_OK; } else { PyErr_Clear(); + return SWIG_OverflowError; } } #ifdef SWIG_PYTHON_CAST_MODE @@ -3762,13 +3780,118 @@ SWIG_AsVal_int (PyObject * obj, int *val) } -SWIGINTERNINLINE PyObject* - SWIG_From_int (int value) +SWIGINTERN int +SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc) { - return PyInt_FromLong((long) value); +#if PY_VERSION_HEX>=0x03000000 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + if (PyBytes_Check(obj)) +#else + if (PyUnicode_Check(obj)) +#endif +#else + if (PyString_Check(obj)) +#endif + { + char *cstr; Py_ssize_t len; + int ret = SWIG_OK; +#if PY_VERSION_HEX>=0x03000000 +#if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + 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); + if (!obj) + return SWIG_TypeError; + if (alloc) + *alloc = SWIG_NEWOBJ; +#endif + if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1) + return SWIG_TypeError; +#else + if (PyString_AsStringAndSize(obj, &cstr, &len) == -1) + return SWIG_TypeError; +#endif + if (cptr) { + if (alloc) { + if (*alloc == SWIG_NEWOBJ) { + *cptr = (char *)memcpy(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 +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + *cptr = PyBytes_AsString(obj); +#else + assert(0); /* Should never reach here with Unicode strings in Python 3 */ +#endif +#else + *cptr = SWIG_Python_str_AsChar(obj); + if (!*cptr) + ret = SWIG_TypeError; +#endif + } + } + if (psize) *psize = len + 1; +#if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR) + Py_XDECREF(obj); +#endif + return ret; + } else { +#if defined(SWIG_PYTHON_2_UNICODE) +#if defined(SWIG_PYTHON_STRICT_BYTE_CHAR) +#error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once" +#endif +#if PY_VERSION_HEX<0x03000000 + if (PyUnicode_Check(obj)) { + char *cstr; Py_ssize_t len; + if (!alloc && cptr) { + return SWIG_RuntimeError; + } + obj = PyUnicode_AsUTF8String(obj); + if (!obj) + return SWIG_TypeError; + if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) { + if (cptr) { + if (alloc) *alloc = SWIG_NEWOBJ; + *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1)); + } + if (psize) *psize = len + 1; + + Py_XDECREF(obj); + return SWIG_OK; + } else { + Py_XDECREF(obj); + } + } +#endif +#endif + + 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; } + + + #include #include @@ -4947,7 +5070,7 @@ SWIGINTERNINLINE PyObject* SWIG_From_unsigned_SS_long (unsigned long value) { return (value > LONG_MAX) ? - PyLong_FromUnsignedLong(value) : PyLong_FromLong((long)(value)); + PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value)); } @@ -4972,18 +5095,7 @@ SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val) 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 + return SWIG_OverflowError; } } #ifdef SWIG_PYTHON_CAST_MODE @@ -5169,85 +5281,6 @@ int bio_reset(BIO *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); } @@ -5571,12 +5604,69 @@ BIO* BIO_new_pyfd(int fd, int close_flag) { } +#if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE) +# define SWIG_LONG_LONG_AVAILABLE +#endif + + +#ifdef SWIG_LONG_LONG_AVAILABLE +SWIGINTERN int +SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val) +{ + int res = SWIG_TypeError; + if (PyLong_Check(obj)) { + unsigned long long v = PyLong_AsUnsignedLongLong(obj); + if (!PyErr_Occurred()) { + if (val) *val = v; + return SWIG_OK; + } else { + PyErr_Clear(); + res = SWIG_OverflowError; + } + } else { + unsigned long v; + res = SWIG_AsVal_unsigned_SS_long (obj,&v); + if (SWIG_IsOK(res)) { + if (val) *val = v; + return res; + } + } +#ifdef SWIG_PYTHON_CAST_MODE + { + const double mant_max = 1LL << DBL_MANT_DIG; + double d; + res = SWIG_AsVal_double (obj,&d); + if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max)) + return SWIG_OverflowError; + if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) { + if (val) *val = (unsigned long long)(d); + return SWIG_AddCast(res); + } + res = SWIG_TypeError; + } +#endif + return res; +} +#endif + + 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); + int res = SWIG_TypeError; +#ifdef SWIG_LONG_LONG_AVAILABLE + if (sizeof(size_t) <= sizeof(unsigned long)) { +#endif + unsigned long v; + res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = (size_t)(v); +#ifdef SWIG_LONG_LONG_AVAILABLE + } else if (sizeof(size_t) <= sizeof(unsigned long long)) { + unsigned long long v; + res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0); + if (SWIG_IsOK(res) && val) *val = (size_t)(v); + } +#endif return res; } @@ -6201,7 +6291,6 @@ int verify_update(EVP_MD_CTX *ctx, PyObject *blob) { return EVP_VerifyUpdate(ctx, buf, len); } - int verify_final(EVP_MD_CTX *ctx, PyObject *blob, EVP_PKEY *pkey) { unsigned char *kbuf; int len = 0; @@ -6212,6 +6301,129 @@ int verify_final(EVP_MD_CTX *ctx, PyObject *blob, EVP_PKEY *pkey) { return EVP_VerifyFinal(ctx, kbuf, len, pkey); } +int digest_sign_init(EVP_MD_CTX *ctx, EVP_PKEY *pkey) { + return EVP_DigestSignInit(ctx, NULL, NULL, NULL, pkey); +} + +PyObject *digest_sign_update(EVP_MD_CTX *ctx, PyObject *blob) { + const void *buf; + int len = 0; + + if (m2_PyObject_AsReadBufferInt(blob, (const void **)&buf, &len) == -1) + return NULL; + + if (!EVP_DigestSignUpdate(ctx, buf, len)) { + m2_PyErr_Msg(_evp_err); + return NULL; + } + Py_RETURN_NONE; +} + +PyObject *digest_sign_final(EVP_MD_CTX *ctx) { + PyObject *ret; + unsigned char *sigbuf; + size_t siglen; + + if (!EVP_DigestSignFinal(ctx, NULL, &siglen)) { + m2_PyErr_Msg(_evp_err); + return NULL; + } + + sigbuf = (unsigned char*)OPENSSL_malloc(siglen); + if (!sigbuf) { + PyErr_SetString(PyExc_MemoryError, "digest_sign_final"); + return NULL; + } + + if (!EVP_DigestSignFinal(ctx, sigbuf, &siglen)) { + 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; +} + +PyObject *digest_sign(EVP_MD_CTX *ctx, PyObject *msg) { + PyObject *ret; + const void *msgbuf; + unsigned char *sigbuf; + int msglen = 0; + size_t siglen = 0; + + if (m2_PyObject_AsReadBufferInt(msg, (const void **)&msgbuf, &msglen) == -1) + return NULL; + + if (!EVP_DigestSign(ctx, NULL, &siglen, msgbuf, msglen)) { + m2_PyErr_Msg(_evp_err); + return NULL; + } + + sigbuf = (unsigned char*)OPENSSL_malloc(siglen); + if (!sigbuf) { + PyErr_SetString(PyExc_MemoryError, "digest_sign"); + return NULL; + } + + if (!EVP_DigestSign(ctx, sigbuf, &siglen, msgbuf, msglen)) { + 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 digest_verify_init(EVP_MD_CTX *ctx, EVP_PKEY *pkey) { + return EVP_DigestVerifyInit(ctx, NULL, NULL, NULL, pkey); +} + +int digest_verify_update(EVP_MD_CTX *ctx, PyObject *blob) { + const void *buf; + int len = 0; + + if (m2_PyObject_AsReadBufferInt(blob, (const void **)&buf, &len) == -1) + return -1; + + return EVP_DigestVerifyUpdate(ctx, buf, len); +} + +int digest_verify_final(EVP_MD_CTX *ctx, PyObject *blob) { + unsigned char *sigbuf; + int len = 0; + + if (m2_PyObject_AsReadBufferInt(blob, (const void **)&sigbuf, &len) == -1) + return -1; + + return EVP_DigestVerifyFinal(ctx, sigbuf, len); +} + +int digest_verify(EVP_MD_CTX *ctx, PyObject *sig, PyObject *msg) { + unsigned char *sigbuf; + unsigned char *msgbuf; + int siglen = 0; + int msglen = 0; + + if (m2_PyObject_AsReadBufferInt(sig, (const void **)&sigbuf, &siglen) == -1) + return -1; + + if (m2_PyObject_AsReadBufferInt(msg, (const void **)&msgbuf, &msglen) == -1) + return -1; + + return EVP_DigestVerify(ctx, sigbuf, siglen, msgbuf, msglen); +} + const EVP_MD *get_digestbyname(const char* name) { const EVP_MD *ret = NULL; @@ -9496,146 +9708,182 @@ PyObject *obj_obj2txt(const ASN1_OBJECT *obj, int no_name) #ifdef __cplusplus extern "C" { #endif -SWIGINTERN PyObject *_wrap__STACK_num_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_num(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_num" "', argument " "1"" of type '" "OPENSSL_STACK const *""'"); + } + arg1 = (OPENSSL_STACK *)(argp1); + result = (int)OPENSSL_sk_num((struct stack_st const *)arg1); + resultobj = SWIG_From_int((int)(result)); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_OPENSSL_sk_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st *arg1 = (struct stack_st *) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; + void *result = 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_Python_UnpackTuple(args, "OPENSSL_sk_value", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_value" "', argument " "1"" of type '" "OPENSSL_STACK const *""'"); } - arg1 = (struct stack_st *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + arg1 = (OPENSSL_STACK *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_STACK_num_set" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPENSSL_sk_value" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - if (arg1) (arg1)->num = arg2; - resultobj = SWIG_Py_Void(); + result = (void *)OPENSSL_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__STACK_num_get(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st *arg1 = (struct stack_st *) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + int arg2 ; + void *arg3 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int result; + int val2 ; + int ecode2 = 0 ; + int res3 ; + PyObject *swig_obj[3] ; + void *result = 0 ; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_set", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_set" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - arg1 = (struct stack_st *)(argp1); - result = (int) ((arg1)->num); - resultobj = SWIG_From_int((int)(result)); + arg1 = (OPENSSL_STACK *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPENSSL_sk_set" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + res3 = SWIG_ConvertPtr(swig_obj[2],SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OPENSSL_sk_set" "', argument " "3"" of type '" "void const *""'"); + } + result = (void *)OPENSSL_sk_set(arg1,arg2,(void const *)arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap__STACK_data_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_new(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 ; + OPENSSL_sk_compfunc arg1 = (OPENSSL_sk_compfunc) 0 ; + PyObject *swig_obj[1] ; + OPENSSL_STACK *result = 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 **""'"); + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int res = SWIG_ConvertFunctionPtr(swig_obj[0], (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 '" "OPENSSL_sk_new" "', argument " "1"" of type '" "OPENSSL_sk_compfunc""'"); + } } - arg2 = (char **)(argp2); - if (arg1) (arg1)->data = arg2; - resultobj = SWIG_Py_Void(); + result = (OPENSSL_STACK *)OPENSSL_sk_new(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap__STACK_data_get(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_new_null(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st *arg1 = (struct stack_st *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - char **result = 0 ; + OPENSSL_STACK *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 ); + if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_new_null", 0, 0, 0)) SWIG_fail; + result = (OPENSSL_STACK *)OPENSSL_sk_new_null(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap__STACK_sorted_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_new_reserve(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st *arg1 = (struct stack_st *) 0 ; + OPENSSL_sk_compfunc arg1 = (OPENSSL_sk_compfunc) 0 ; int arg2 ; - void *argp1 = 0 ; - int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; + OPENSSL_STACK *result = 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 *""'"); + if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_new_reserve", 2, 2, swig_obj)) SWIG_fail; + { + int res = SWIG_ConvertFunctionPtr(swig_obj[0], (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 '" "OPENSSL_sk_new_reserve" "', argument " "1"" of type '" "OPENSSL_sk_compfunc""'"); + } } - arg1 = (struct stack_st *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_STACK_sorted_set" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPENSSL_sk_new_reserve" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - if (arg1) (arg1)->sorted = arg2; - resultobj = SWIG_Py_Void(); + result = (OPENSSL_STACK *)OPENSSL_sk_new_reserve(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap__STACK_sorted_get(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_reserve(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st *arg1 = (struct stack_st *) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; int result; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_reserve", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_reserve" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - arg1 = (struct stack_st *)(argp1); - result = (int) ((arg1)->sorted); + arg1 = (OPENSSL_STACK *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPENSSL_sk_reserve" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (int)OPENSSL_sk_reserve(arg1,arg2); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: @@ -9643,28 +9891,21 @@ fail: } -SWIGINTERN PyObject *_wrap__STACK_num_alloc_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st *arg1 = (struct stack_st *) 0 ; - int arg2 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_free" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - 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; + arg1 = (OPENSSL_STACK *)(argp1); + OPENSSL_sk_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -9672,120 +9913,185 @@ fail: } -SWIGINTERN PyObject *_wrap__STACK_num_alloc_get(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_pop_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st *arg1 = (struct stack_st *) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + void (*arg2)(void *) = (void (*)(void *)) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int result; + PyObject *swig_obj[2] ; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_pop_free", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_pop_free" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - arg1 = (struct stack_st *)(argp1); - result = (int) ((arg1)->num_alloc); - resultobj = SWIG_From_int((int)(result)); + arg1 = (OPENSSL_STACK *)(argp1); + { + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_void__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "OPENSSL_sk_pop_free" "', argument " "2"" of type '" "void (*)(void *)""'"); + } + } + OPENSSL_sk_pop_free(arg1,arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap__STACK_comp_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_deep_copy(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 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + OPENSSL_sk_copyfunc arg2 = (OPENSSL_sk_copyfunc) 0 ; + OPENSSL_sk_freefunc arg3 = (OPENSSL_sk_freefunc) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[3] ; + OPENSSL_STACK *result = 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_Python_UnpackTuple(args, "OPENSSL_sk_deep_copy", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_deep_copy" "', argument " "1"" of type '" "OPENSSL_STACK const *""'"); } - arg1 = (struct stack_st *)(argp1); + arg1 = (OPENSSL_STACK *)(argp1); { - int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int); + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__void__p_void); if (!SWIG_IsOK(res)) { - SWIG_exception_fail(SWIG_ArgError(res), "in method '" "_STACK_comp_set" "', argument " "2"" of type '" "int (*)(void const *,void const *)""'"); + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "OPENSSL_sk_deep_copy" "', argument " "2"" of type '" "OPENSSL_sk_copyfunc""'"); } } - if (arg1) (arg1)->comp = arg2; - resultobj = SWIG_Py_Void(); + { + int res = SWIG_ConvertFunctionPtr(swig_obj[2], (void**)(&arg3), SWIGTYPE_p_f_p_void__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "OPENSSL_sk_deep_copy" "', argument " "3"" of type '" "OPENSSL_sk_freefunc""'"); + } + } + result = (OPENSSL_STACK *)OPENSSL_sk_deep_copy((struct stack_st const *)arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap__STACK_comp_get(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_insert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st *arg1 = (struct stack_st *) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + void *arg2 = (void *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - int (*result)(void const *,void const *) = 0 ; + int res2 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + int result; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_insert", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_insert" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - 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); + arg1 = (OPENSSL_STACK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_insert" "', argument " "2"" of type '" "void const *""'"); + } + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OPENSSL_sk_insert" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + result = (int)OPENSSL_sk_insert(arg1,(void const *)arg2,arg3); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN int _wrap_new__STACK(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_delete(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st *result = 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + void *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; + if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_delete", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_delete" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); + } + arg1 = (OPENSSL_STACK *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPENSSL_sk_delete" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (void *)OPENSSL_sk_delete(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + return resultobj; fail: - return -1; + return NULL; } -SWIGINTERN PyObject *_wrap_delete__STACK(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_delete_ptr(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st *arg1 = (struct stack_st *) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + PyObject *swig_obj[2] ; + void *result = 0 ; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_delete_ptr", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__STACK" "', argument " "1"" of type '" "struct stack_st *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_delete_ptr" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - arg1 = (struct stack_st *)(argp1); - free((char *) arg1); - resultobj = SWIG_Py_Void(); + arg1 = (OPENSSL_STACK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_delete_ptr" "', argument " "2"" of type '" "void const *""'"); + } + result = (void *)OPENSSL_sk_delete_ptr(arg1,(void const *)arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_num(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_find(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + int res2 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "OPENSSL_sk_find", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_find" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - arg1 = (_STACK *)(argp1); - result = (int)sk_num((struct stack_st const *)arg1); + arg1 = (OPENSSL_STACK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_find" "', argument " "2"" of type '" "void const *""'"); + } + result = (int)OPENSSL_sk_find(arg1,(void const *)arg2); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: @@ -9793,151 +10099,151 @@ fail: } -SWIGINTERN PyObject *_wrap_sk_value(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_find_ex(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - int arg2 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - void *result = 0 ; + int res2 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "OPENSSL_sk_find_ex", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_find_ex" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - 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 ); + arg1 = (OPENSSL_STACK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_find_ex" "', argument " "2"" of type '" "void const *""'"); + } + result = (int)OPENSSL_sk_find_ex(arg1,(void const *)arg2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_push(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - int arg2 ; - void *arg3 = (void *) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + void *arg2 = (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 ; + int res2 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "OPENSSL_sk_push", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_push" "', argument " "1"" of type '" "OPENSSL_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 *""'"); + arg1 = (OPENSSL_STACK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_push" "', argument " "2"" of type '" "void const *""'"); } - result = (void *)sk_set(arg1,arg2,arg3); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + result = (int)OPENSSL_sk_push(arg1,(void const *)arg2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_unshift(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 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + void *arg2 = (void *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + PyObject *swig_obj[2] ; + int result; - 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 *)""'"); - } + if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_unshift", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_unshift" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - result = (_STACK *)sk_new(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); + arg1 = (OPENSSL_STACK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_unshift" "', argument " "2"" of type '" "void const *""'"); + } + result = (int)OPENSSL_sk_unshift(arg1,(void const *)arg2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_new_null(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_shift(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *result = 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + void *result = 0 ; - result = (_STACK *)sk_new_null(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_shift" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); + } + arg1 = (OPENSSL_STACK *)(argp1); + result = (void *)OPENSSL_sk_shift(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + void *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_pop" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - arg1 = (_STACK *)(argp1); - sk_free(arg1); - resultobj = SWIG_Py_Void(); + arg1 = (OPENSSL_STACK *)(argp1); + result = (void *)OPENSSL_sk_pop(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_pop_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_zero(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - void (*arg2)(void *) = (void (*)(void *)) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *)""'"); - } + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_zero" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - sk_pop_free(arg1,arg2); + arg1 = (OPENSSL_STACK *)(argp1); + OPENSSL_sk_zero(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -9945,164 +10251,119 @@ fail: } -SWIGINTERN PyObject *_wrap_sk_deep_copy(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_set_cmp_func(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - void *(*arg2)(void *) = (void *(*)(void *)) 0 ; - void (*arg3)(void *) = (void (*)(void *)) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; + OPENSSL_sk_compfunc arg2 = (OPENSSL_sk_compfunc) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - _STACK *result = 0 ; + PyObject *swig_obj[2] ; + OPENSSL_sk_compfunc result; - 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_Python_UnpackTuple(args, "OPENSSL_sk_set_cmp_func", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_set_cmp_func" "', argument " "1"" of type '" "OPENSSL_STACK *""'"); } - arg1 = (_STACK *)(argp1); + arg1 = (OPENSSL_STACK *)(argp1); { - int res = SWIG_ConvertFunctionPtr(obj1, (void**)(&arg2), SWIGTYPE_p_f_p_void__p_void); + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (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_deep_copy" "', argument " "2"" of type '" "void *(*)(void *)""'"); + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "OPENSSL_sk_set_cmp_func" "', argument " "2"" of type '" "OPENSSL_sk_compfunc""'"); } } - { - 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 ); + result = (OPENSSL_sk_compfunc)OPENSSL_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_insert(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_dup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - void *arg2 = (void *) 0 ; - int arg3 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; + PyObject *swig_obj[1] ; + OPENSSL_STACK *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_dup" "', argument " "1"" of type '" "OPENSSL_STACK const *""'"); } - 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)); + arg1 = (OPENSSL_STACK *)(argp1); + result = (OPENSSL_STACK *)OPENSSL_sk_dup((struct stack_st const *)arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_delete(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_sort(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - int arg2 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - void *result = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_sort" "', argument " "1"" of type '" "OPENSSL_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 ); + arg1 = (OPENSSL_STACK *)(argp1); + OPENSSL_sk_sort(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_delete_ptr(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_OPENSSL_sk_is_sorted(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - void *arg2 = (void *) 0 ; + OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - void *result = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_is_sorted" "', argument " "1"" of type '" "OPENSSL_STACK const *""'"); } - 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 ); + arg1 = (OPENSSL_STACK *)(argp1); + result = (int)OPENSSL_sk_is_sorted((struct stack_st const *)arg1); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_find(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_num(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - void *arg2 = (void *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_num" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING const *""'"); } - result = (int)sk_find(arg1,arg2); + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + result = (int)sk_OPENSSL_STRING_num((struct stack_st_OPENSSL_STRING const *)arg1); resultobj = SWIG_From_int((int)(result)); return resultobj; fail: @@ -10110,151 +10371,145 @@ fail: } -SWIGINTERN PyObject *_wrap_sk_find_ex(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - void *arg2 = (void *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + char *result = 0 ; - 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_Python_UnpackTuple(args, "sk_OPENSSL_STRING_value", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_value" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING const *""'"); } - result = (int)sk_find_ex(arg1,arg2); - resultobj = SWIG_From_int((int)(result)); + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_STRING_value" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (char *)sk_OPENSSL_STRING_value((struct stack_st_OPENSSL_STRING const *)arg1,arg2); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_push(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_new(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; + sk_OPENSSL_STRING_compfunc arg1 = (sk_OPENSSL_STRING_compfunc) 0 ; + PyObject *swig_obj[1] ; + struct stack_st_OPENSSL_STRING *result = 0 ; - 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 *""'"); + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int res = SWIG_ConvertFunctionPtr(swig_obj[0], (void**)(&arg1), SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_new" "', argument " "1"" of type '" "sk_OPENSSL_STRING_compfunc""'"); + } } - result = (int)sk_push(arg1,arg2); - resultobj = SWIG_From_int((int)(result)); + result = (struct stack_st_OPENSSL_STRING *)sk_OPENSSL_STRING_new(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_unshift(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_new_null(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; + struct stack_st_OPENSSL_STRING *result = 0 ; - 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)); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_new_null", 0, 0, 0)) SWIG_fail; + result = (struct stack_st_OPENSSL_STRING *)sk_OPENSSL_STRING_new_null(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_shift(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_new_reserve(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - void *result = 0 ; + sk_OPENSSL_STRING_compfunc arg1 = (sk_OPENSSL_STRING_compfunc) 0 ; + int arg2 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + struct stack_st_OPENSSL_STRING *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 *""'"); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_new_reserve", 2, 2, swig_obj)) SWIG_fail; + { + int res = SWIG_ConvertFunctionPtr(swig_obj[0], (void**)(&arg1), SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_new_reserve" "', argument " "1"" of type '" "sk_OPENSSL_STRING_compfunc""'"); + } } - arg1 = (_STACK *)(argp1); - result = (void *)sk_shift(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_STRING_new_reserve" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (struct stack_st_OPENSSL_STRING *)sk_OPENSSL_STRING_new_reserve(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_pop(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_reserve(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - void *result = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "sk_OPENSSL_STRING_reserve", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_pop" "', argument " "1"" of type '" "_STACK *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_reserve" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } - arg1 = (_STACK *)(argp1); - result = (void *)sk_pop(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_STRING_reserve" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (int)sk_OPENSSL_STRING_reserve(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_zero(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"sk_zero",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_stack_st, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_zero" "', argument " "1"" of type '" "_STACK *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } - arg1 = (_STACK *)(argp1); - sk_zero(arg1); + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + sk_OPENSSL_STRING_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -10262,174 +10517,224 @@ fail: } -SWIGINTERN PyObject *_wrap_sk_set_cmp_func(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_zero(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; - int (*arg2)(void const *,void const *) = (int (*)(void const *,void const *)) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int (*result)(void const *,void const *) = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_set_cmp_func" "', argument " "1"" of type '" "_STACK *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_zero" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } - 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); + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + sk_OPENSSL_STRING_zero(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_dup(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_delete(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - _STACK *result = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + char *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_Python_UnpackTuple(args, "sk_OPENSSL_STRING_delete", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_dup" "', argument " "1"" of type '" "_STACK *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_delete" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } - arg1 = (_STACK *)(argp1); - result = (_STACK *)sk_dup(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_STRING_delete" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (char *)sk_OPENSSL_STRING_delete(arg1,arg2); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_sort(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_delete_ptr(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + char *result = 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_Python_UnpackTuple(args, "sk_OPENSSL_STRING_delete_ptr", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_sort" "', argument " "1"" of type '" "_STACK *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_delete_ptr" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } - arg1 = (_STACK *)(argp1); - sk_sort(arg1); - resultobj = SWIG_Py_Void(); + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_delete_ptr" "', argument " "2"" of type '" "char *""'"); + } + arg2 = (char *)(buf2); + result = (char *)sk_OPENSSL_STRING_delete_ptr(arg1,arg2); + resultobj = SWIG_FromCharPtr((const char *)result); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_sk_is_sorted(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_push(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _STACK *arg1 = (_STACK *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "sk_OPENSSL_STRING_push", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_is_sorted" "', argument " "1"" of type '" "_STACK const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_push" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_push" "', argument " "2"" of type '" "char *""'"); } - arg1 = (_STACK *)(argp1); - result = (int)sk_is_sorted((struct stack_st const *)arg1); + arg2 = (char *)(buf2); + result = (int)sk_OPENSSL_STRING_push(arg1,arg2); resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_stack_st_OPENSSL_STRING_stack_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_unshift(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; - _STACK *arg2 = (_STACK *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "sk_OPENSSL_STRING_unshift", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_unshift" "', 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 ); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "stack_st_OPENSSL_STRING_stack_set" "', argument " "2"" of type '" "_STACK *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_unshift" "', argument " "2"" of type '" "char *""'"); } - arg2 = (_STACK *)(argp2); - if (arg1) (arg1)->stack = *arg2; - resultobj = SWIG_Py_Void(); + arg2 = (char *)(buf2); + result = (int)sk_OPENSSL_STRING_unshift(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_stack_st_OPENSSL_STRING_stack_get(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_pop(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 ; + PyObject *swig_obj[1] ; + char *result = 0 ; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_pop" "', 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 ); + result = (char *)sk_OPENSSL_STRING_pop(arg1); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN int _wrap_new_stack_st_OPENSSL_STRING(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_shift(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_OPENSSL_STRING *result = 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + char *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; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_shift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + result = (char *)sk_OPENSSL_STRING_shift(arg1); + resultobj = SWIG_FromCharPtr((const char *)result); + return resultobj; fail: - return -1; + return NULL; } -SWIGINTERN PyObject *_wrap_delete_stack_st_OPENSSL_STRING(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_pop_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + sk_OPENSSL_STRING_freefunc arg2 = (sk_OPENSSL_STRING_freefunc) 0 ; void *argp1 = 0 ; int res1 = 0 ; + PyObject *swig_obj[2] ; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_pop_free", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_pop_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); - free((char *) arg1); + { + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_char__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_pop_free" "', argument " "2"" of type '" "sk_OPENSSL_STRING_freefunc""'"); + } + } + sk_OPENSSL_STRING_pop_free(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -10437,90 +10742,169 @@ fail: } -SWIGINTERN PyObject *_wrap_stack_st_OPENSSL_BLOCK_stack_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_insert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; - _STACK *arg2 = (_STACK *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + char *arg2 = (char *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + int result; - 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_Python_UnpackTuple(args, "sk_OPENSSL_STRING_insert", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_insert" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } - arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_stack_st, 0 | 0 ); + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "stack_st_OPENSSL_BLOCK_stack_set" "', argument " "2"" of type '" "_STACK *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_insert" "', argument " "2"" of type '" "char *""'"); } - arg2 = (_STACK *)(argp2); - if (arg1) (arg1)->stack = *arg2; - resultobj = SWIG_Py_Void(); + arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "sk_OPENSSL_STRING_insert" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + result = (int)sk_OPENSSL_STRING_insert(arg1,arg2,arg3); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_stack_st_OPENSSL_BLOCK_stack_get(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + int arg2 ; + char *arg3 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - _STACK *result = 0 ; + int val2 ; + int ecode2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject *swig_obj[3] ; + char *result = 0 ; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_set", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_set" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } - arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); - result = (_STACK *)& ((arg1)->stack); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 | 0 ); + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_STRING_set" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "sk_OPENSSL_STRING_set" "', argument " "3"" of type '" "char *""'"); + } + arg3 = (char *)(buf3); + result = (char *)sk_OPENSSL_STRING_set(arg1,arg2,arg3); + resultobj = SWIG_FromCharPtr((const char *)result); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN int _wrap_new_stack_st_OPENSSL_BLOCK(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_find(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_OPENSSL_BLOCK *result = 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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; + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_find", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_find" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_find" "', argument " "2"" of type '" "char *""'"); + } + arg2 = (char *)(buf2); + result = (int)sk_OPENSSL_STRING_find(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return resultobj; fail: - return -1; + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + return NULL; } -SWIGINTERN PyObject *_wrap_delete_stack_st_OPENSSL_BLOCK(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_find_ex(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_find_ex", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_find_ex" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); } - arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); - free((char *) arg1); - resultobj = SWIG_Py_Void(); + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_find_ex" "', argument " "2"" of type '" "char *""'"); + } + arg2 = (char *)(buf2); + result = (int)sk_OPENSSL_STRING_find_ex(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_threading_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_sort(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 ; + PyObject *swig_obj[1] ; - threading_init(); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_sort" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + sk_OPENSSL_STRING_sort(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -10528,222 +10912,331 @@ fail: } -SWIGINTERN PyObject *_wrap_threading_cleanup(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_is_sorted(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 ; + PyObject *swig_obj[1] ; + int result; - threading_cleanup(); - resultobj = SWIG_Py_Void(); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_is_sorted" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING const *""'"); + } + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + result = (int)sk_OPENSSL_STRING_is_sorted((struct stack_st_OPENSSL_STRING const *)arg1); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_lib_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_dup(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 ; + PyObject *swig_obj[1] ; + struct stack_st_OPENSSL_STRING *result = 0 ; - lib_init(); - resultobj = SWIG_Py_Void(); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_dup" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING const *""'"); + } + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + result = (struct stack_st_OPENSSL_STRING *)sk_OPENSSL_STRING_dup((struct stack_st_OPENSSL_STRING const *)arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bn_to_mpi(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_deep_copy(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIGNUM *arg1 = (BIGNUM *) 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + sk_OPENSSL_STRING_copyfunc arg2 = (sk_OPENSSL_STRING_copyfunc) 0 ; + sk_OPENSSL_STRING_freefunc arg3 = (sk_OPENSSL_STRING_freefunc) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[3] ; + struct stack_st_OPENSSL_STRING *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_Python_UnpackTuple(args, "sk_OPENSSL_STRING_deep_copy", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bn_to_mpi" "', argument " "1"" of type '" "BIGNUM const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_deep_copy" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING const *""'"); } - arg1 = (BIGNUM *)(argp1); - result = (PyObject *)bn_to_mpi((BIGNUM const *)arg1); - resultobj = result; + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + { + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__char__p_char); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_deep_copy" "', argument " "2"" of type '" "sk_OPENSSL_STRING_copyfunc""'"); + } + } + { + int res = SWIG_ConvertFunctionPtr(swig_obj[2], (void**)(&arg3), SWIGTYPE_p_f_p_char__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_deep_copy" "', argument " "3"" of type '" "sk_OPENSSL_STRING_freefunc""'"); + } + } + result = (struct stack_st_OPENSSL_STRING *)sk_OPENSSL_STRING_deep_copy((struct stack_st_OPENSSL_STRING const *)arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_mpi_to_bn(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_set_cmp_func(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - BIGNUM *result = 0 ; + struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ; + sk_OPENSSL_STRING_compfunc arg2 = (sk_OPENSSL_STRING_compfunc) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[2] ; + sk_OPENSSL_STRING_compfunc result; - 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 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_set_cmp_func", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_set_cmp_func" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_STRING *)(argp1); + { + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_set_cmp_func" "', argument " "2"" of type '" "sk_OPENSSL_STRING_compfunc""'"); + } + } + result = (sk_OPENSSL_STRING_compfunc)sk_OPENSSL_STRING_set_cmp_func(arg1,arg2); + resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bn_to_bin(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_num(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIGNUM *arg1 = (BIGNUM *) 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"bn_to_bin",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIGNUM, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bn_to_bin" "', argument " "1"" of type '" "BIGNUM *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_num" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING const *""'"); } - arg1 = (BIGNUM *)(argp1); - result = (PyObject *)bn_to_bin(arg1); - resultobj = result; + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + result = (int)sk_OPENSSL_CSTRING_num((struct stack_st_OPENSSL_CSTRING const *)arg1); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bin_to_bn(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - BIGNUM *result = 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + char *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 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_value", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_value" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING const *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_CSTRING_value" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (char *)sk_OPENSSL_CSTRING_value((struct stack_st_OPENSSL_CSTRING const *)arg1,arg2); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bn_to_hex(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIGNUM *arg1 = (BIGNUM *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + sk_OPENSSL_CSTRING_compfunc arg1 = (sk_OPENSSL_CSTRING_compfunc) 0 ; + PyObject *swig_obj[1] ; + struct stack_st_OPENSSL_CSTRING *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 *""'"); + if (!args) SWIG_fail; + swig_obj[0] = args; + { + int res = SWIG_ConvertFunctionPtr(swig_obj[0], (void**)(&arg1), SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_new" "', argument " "1"" of type '" "sk_OPENSSL_CSTRING_compfunc""'"); + } } - arg1 = (BIGNUM *)(argp1); - result = (PyObject *)bn_to_hex(arg1); - resultobj = result; + result = (struct stack_st_OPENSSL_CSTRING *)sk_OPENSSL_CSTRING_new(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_hex_to_bn(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_new_null(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - BIGNUM *result = 0 ; + struct stack_st_OPENSSL_CSTRING *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 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_new_null", 0, 0, 0)) SWIG_fail; + result = (struct stack_st_OPENSSL_CSTRING *)sk_OPENSSL_CSTRING_new_null(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_dec_to_bn(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_new_reserve(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - BIGNUM *result = 0 ; + sk_OPENSSL_CSTRING_compfunc arg1 = (sk_OPENSSL_CSTRING_compfunc) 0 ; + int arg2 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + struct stack_st_OPENSSL_CSTRING *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 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_new_reserve", 2, 2, swig_obj)) SWIG_fail; + { + int res = SWIG_ConvertFunctionPtr(swig_obj[0], (void**)(&arg1), SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_new_reserve" "', argument " "1"" of type '" "sk_OPENSSL_CSTRING_compfunc""'"); + } + } + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_CSTRING_new_reserve" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (struct stack_st_OPENSSL_CSTRING *)sk_OPENSSL_CSTRING_new_reserve(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_err_print_errors(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_reserve(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_reserve", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_reserve" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); } - resultobj = SWIG_Py_Void(); + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_CSTRING_reserve" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (int)sk_OPENSSL_CSTRING_reserve(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_err_get_error(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - unsigned long result; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; - result = (unsigned long)ERR_get_error(); - resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + sk_OPENSSL_CSTRING_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_err_peek_error(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_zero(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - unsigned long result; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; - result = (unsigned long)ERR_peek_error(); - resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_zero" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + sk_OPENSSL_CSTRING_zero(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_err_lib_error_string(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_delete(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - unsigned long arg1 ; - unsigned long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; 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""'"); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_delete", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_delete" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_CSTRING_delete" "', argument " "2"" of type '" "int""'"); } - arg1 = (unsigned long)(val1); - result = (char *)ERR_lib_error_string(arg1); + arg2 = (int)(val2); + result = (char *)sk_OPENSSL_CSTRING_delete(arg1,arg2); resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: @@ -10751,203 +11244,342 @@ fail: } -SWIGINTERN PyObject *_wrap_err_func_error_string(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_delete_ptr(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - unsigned long arg1 ; - unsigned long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; 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); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_delete_ptr", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_delete_ptr" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_delete_ptr" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + result = (char *)sk_OPENSSL_CSTRING_delete_ptr(arg1,(char const *)arg2); resultobj = SWIG_FromCharPtr((const char *)result); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_err_reason_error_string(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_push(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - unsigned long arg1 ; - unsigned long val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_push", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_push" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_push" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + result = (int)sk_OPENSSL_CSTRING_push(arg1,(char const *)arg2); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_bio_s_bio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_unshift(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO_METHOD *result = 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - result = (BIO_METHOD *)BIO_s_bio(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_unshift", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_unshift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_unshift" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + result = (int)sk_OPENSSL_CSTRING_unshift(arg1,(char const *)arg2); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_bio_s_mem(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO_METHOD *result = 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + char *result = 0 ; - result = (BIO_METHOD *)BIO_s_mem(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_pop" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + result = (char *)sk_OPENSSL_CSTRING_pop(arg1); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_s_socket(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_shift(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO_METHOD *result = 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + char *result = 0 ; - result = (BIO_METHOD *)BIO_s_socket(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_shift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + result = (char *)sk_OPENSSL_CSTRING_shift(arg1); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_f_ssl(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_pop_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO_METHOD *result = 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + sk_OPENSSL_CSTRING_freefunc arg2 = (sk_OPENSSL_CSTRING_freefunc) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[2] ; - result = (BIO_METHOD *)BIO_f_ssl(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_pop_free", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_pop_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + { + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_char__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_pop_free" "', argument " "2"" of type '" "sk_OPENSSL_CSTRING_freefunc""'"); + } + } + sk_OPENSSL_CSTRING_pop_free(arg1,arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_f_buffer(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_insert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO_METHOD *result = 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 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 *swig_obj[3] ; + int result; - result = (BIO_METHOD *)BIO_f_buffer(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_insert", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_insert" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_insert" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "sk_OPENSSL_CSTRING_insert" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + result = (int)sk_OPENSSL_CSTRING_insert(arg1,(char const *)arg2,arg3); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_bio_f_cipher(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO_METHOD *result = 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 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 *swig_obj[3] ; + char *result = 0 ; - result = (BIO_METHOD *)BIO_f_cipher(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_set", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_set" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_CSTRING_set" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "sk_OPENSSL_CSTRING_set" "', argument " "3"" of type '" "char const *""'"); + } + arg3 = (char *)(buf3); + result = (char *)sk_OPENSSL_CSTRING_set(arg1,arg2,(char const *)arg3); + resultobj = SWIG_FromCharPtr((const char *)result); + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return resultobj; fail: + if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); return NULL; } -SWIGINTERN PyObject *_wrap_bio_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_find(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO_METHOD *arg1 = (BIO_METHOD *) 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - BIO *result = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_find", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_new" "', argument " "1"" of type '" "BIO_METHOD *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_find" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); } - arg1 = (BIO_METHOD *)(argp1); - { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_find" "', argument " "2"" of type '" "char const *""'"); } - result = (BIO *)BIO_new(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); + arg2 = (char *)(buf2); + result = (int)sk_OPENSSL_CSTRING_find(arg1,(char const *)arg2); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_bio_new_socket(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_find_ex(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 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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 ); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_find_ex", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_find_ex" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); + } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_find_ex" "', argument " "2"" of type '" "char const *""'"); + } + arg2 = (char *)(buf2); + result = (int)sk_OPENSSL_CSTRING_find_ex(arg1,(char const *)arg2); + resultobj = SWIG_From_int((int)(result)); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_bio_free_all(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_sort(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"bio_free_all",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_sort" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); } + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + sk_OPENSSL_CSTRING_sort(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -10955,1146 +11587,949 @@ fail: } -SWIGINTERN PyObject *_wrap_bio_dup_chain(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_is_sorted(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - BIO *result = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"bio_dup_chain",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 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."); - } + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_is_sorted" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING const *""'"); } - result = (BIO *)BIO_dup_chain(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + result = (int)sk_OPENSSL_CSTRING_is_sorted((struct stack_st_OPENSSL_CSTRING const *)arg1); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_push(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_dup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - BIO *arg2 = (BIO *) 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - BIO *result = 0 ; + PyObject *swig_obj[1] ; + struct stack_st_OPENSSL_CSTRING *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_dup" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING const *""'"); } - 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 ); + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); + result = (struct stack_st_OPENSSL_CSTRING *)sk_OPENSSL_CSTRING_dup((struct stack_st_OPENSSL_CSTRING const *)arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_pop(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_deep_copy(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + sk_OPENSSL_CSTRING_copyfunc arg2 = (sk_OPENSSL_CSTRING_copyfunc) 0 ; + sk_OPENSSL_CSTRING_freefunc arg3 = (sk_OPENSSL_CSTRING_freefunc) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - BIO *result = 0 ; + PyObject *swig_obj[3] ; + struct stack_st_OPENSSL_CSTRING *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_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_deep_copy", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_pop" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_deep_copy" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING const *""'"); } - arg1 = (BIO *)(argp1); + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__char__p_char); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_deep_copy" "', argument " "2"" of type '" "sk_OPENSSL_CSTRING_copyfunc""'"); } } - result = (BIO *)BIO_pop(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); + { + int res = SWIG_ConvertFunctionPtr(swig_obj[2], (void**)(&arg3), SWIGTYPE_p_f_p_char__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_deep_copy" "', argument " "3"" of type '" "sk_OPENSSL_CSTRING_freefunc""'"); + } + } + result = (struct stack_st_OPENSSL_CSTRING *)sk_OPENSSL_CSTRING_deep_copy((struct stack_st_OPENSSL_CSTRING const *)arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_eof(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_set_cmp_func(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ; + sk_OPENSSL_CSTRING_compfunc arg2 = (sk_OPENSSL_CSTRING_compfunc) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[2] ; + sk_OPENSSL_CSTRING_compfunc 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_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_set_cmp_func", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_eof" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_set_cmp_func" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'"); } - arg1 = (BIO *)(argp1); + arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_set_cmp_func" "', argument " "2"" of type '" "sk_OPENSSL_CSTRING_compfunc""'"); } } - result = (int)BIO_eof(arg1); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; - } + result = (sk_OPENSSL_CSTRING_compfunc)sk_OPENSSL_CSTRING_set_cmp_func(arg1,arg2); + resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int); 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) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_num(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 ; + PyObject *swig_obj[1] ; + int result; - pyfd_init(); - resultobj = SWIG_Py_Void(); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_num" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK const *""'"); + } + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + result = (int)sk_OPENSSL_BLOCK_num((struct stack_st_OPENSSL_BLOCK const *)arg1); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + void *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"bio_init",1,1,&obj0)) SWIG_fail; - { - arg1=obj0; + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_value", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_value" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK const *""'"); } - bio_init(arg1); - resultobj = SWIG_Py_Void(); + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_BLOCK_value" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (void *)sk_OPENSSL_BLOCK_value((struct stack_st_OPENSSL_BLOCK const *)arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + sk_OPENSSL_BLOCK_compfunc arg1 = (sk_OPENSSL_BLOCK_compfunc) 0 ; + PyObject *swig_obj[1] ; + struct stack_st_OPENSSL_BLOCK *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + int res = SWIG_ConvertFunctionPtr(swig_obj[0], (void**)(&arg1), SWIGTYPE_p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_new" "', argument " "1"" of type '" "sk_OPENSSL_BLOCK_compfunc""'"); } } - result = (int)bio_free(arg1); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; - } + result = (struct stack_st_OPENSSL_BLOCK *)sk_OPENSSL_BLOCK_new(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_new_file(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_new_null(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 ; + struct stack_st_OPENSSL_BLOCK *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); + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_new_null", 0, 0, 0)) SWIG_fail; + result = (struct stack_st_OPENSSL_BLOCK *)sk_OPENSSL_BLOCK_new_null(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); 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) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_new_reserve(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; + sk_OPENSSL_BLOCK_compfunc arg1 = (sk_OPENSSL_BLOCK_compfunc) 0 ; int arg2 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - BIO *result = 0 ; + PyObject *swig_obj[2] ; + struct stack_st_OPENSSL_BLOCK *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"bio_new_pyfile",2,2,&obj0,&obj1)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_new_reserve", 2, 2, swig_obj)) SWIG_fail; { - arg1=obj0; + int res = SWIG_ConvertFunctionPtr(swig_obj[0], (void**)(&arg1), SWIGTYPE_p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_new_reserve" "', argument " "1"" of type '" "sk_OPENSSL_BLOCK_compfunc""'"); + } } - ecode2 = SWIG_AsVal_int(obj1, &val2); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_pyfile" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_BLOCK_new_reserve" "', 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 ); + result = (struct stack_st_OPENSSL_BLOCK *)sk_OPENSSL_BLOCK_new_reserve(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_read(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_reserve(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_reserve", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_read" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_reserve" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - arg1 = (BIO *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_read" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_BLOCK_reserve" "', 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; - } + result = (int)sk_OPENSSL_BLOCK_reserve(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_gets(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - int arg2 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"bio_gets",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + sk_OPENSSL_BLOCK_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_write(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_zero(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"bio_write",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_zero" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + sk_OPENSSL_BLOCK_zero(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_ctrl_pending(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_delete(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + void *result = 0 ; - 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_delete", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_delete" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_BLOCK_delete" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); + result = (void *)sk_OPENSSL_BLOCK_delete(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_ctrl_wpending(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_delete_ptr(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + int res2 ; + PyObject *swig_obj[2] ; + void *result = 0 ; - 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_delete_ptr", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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."); - } + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_delete_ptr" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - result = (int)bio_ctrl_wpending(arg1); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_delete_ptr" "', argument " "2"" of type '" "void *""'"); } + result = (void *)sk_OPENSSL_BLOCK_delete_ptr(arg1,arg2); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_ctrl_get_write_guarantee(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_push(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + int res2 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_push", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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."); - } + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_push" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - result = (int)bio_ctrl_get_write_guarantee(arg1); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_push" "', argument " "2"" of type '" "void *""'"); } + result = (int)sk_OPENSSL_BLOCK_push(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_reset(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_unshift(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + int res2 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_unshift", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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."); - } + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_unshift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - result = (int)bio_reset(arg1); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_unshift" "', argument " "2"" of type '" "void *""'"); } + result = (int)sk_OPENSSL_BLOCK_unshift(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_flush(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + void *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"bio_flush",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_pop" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + result = (void *)sk_OPENSSL_BLOCK_pop(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_shift(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 ; + PyObject *swig_obj[1] ; + void *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_shift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + result = (void *)sk_OPENSSL_BLOCK_shift(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_seek(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_pop_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - int arg2 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + sk_OPENSSL_BLOCK_freefunc arg2 = (sk_OPENSSL_BLOCK_freefunc) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_pop_free", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_seek" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_pop_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - 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); + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_void__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_pop_free" "', argument " "2"" of type '" "sk_OPENSSL_BLOCK_freefunc""'"); } } - result = (int)bio_seek(arg1,arg2); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; - } + sk_OPENSSL_BLOCK_pop_free(arg1,arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_tell(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_insert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + void *arg2 = (void *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + int res2 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_insert", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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."); - } + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_insert" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - result = (int)bio_tell(arg1); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_insert" "', argument " "2"" of type '" "void *""'"); } + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "sk_OPENSSL_BLOCK_insert" "', argument " "3"" of type '" "int""'"); + } + arg3 = (int)(val3); + result = (int)sk_OPENSSL_BLOCK_insert(arg1,arg2,arg3); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_set_flags(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; int arg2 ; + void *arg3 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int res3 ; + PyObject *swig_obj[3] ; + void *result = 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_set", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_flags" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_set" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - arg1 = (BIO *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_set_flags" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_BLOCK_set" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + res3 = SWIG_ConvertPtr(swig_obj[2],SWIG_as_voidptrptr(&arg3), 0, 0); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "sk_OPENSSL_BLOCK_set" "', argument " "3"" of type '" "void *""'"); } - bio_set_flags(arg1,arg2); - resultobj = SWIG_Py_Void(); + result = (void *)sk_OPENSSL_BLOCK_set(arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_get_flags(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_find(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + void *arg2 = (void *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + int res2 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_find", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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."); - } + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_find" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - result = (int)bio_get_flags(arg1); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_find" "', argument " "2"" of type '" "void *""'"); } + result = (int)sk_OPENSSL_BLOCK_find(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_set_cipher(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_find_ex(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 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + void *arg2 = (void *) 0 ; 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 ; + int res2 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_find_ex", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_cipher" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_find_ex" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - arg1 = (BIO *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 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; + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_find_ex" "', argument " "2"" of type '" "void *""'"); } + result = (int)sk_OPENSSL_BLOCK_find_ex(arg1,arg2); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_set_mem_eof_return(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_sort(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - int arg2 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_sort" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + sk_OPENSSL_BLOCK_sort(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_get_fd(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_is_sorted(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_is_sorted" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK const *""'"); } + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + result = (int)sk_OPENSSL_BLOCK_is_sorted((struct stack_st_OPENSSL_BLOCK const *)arg1); + resultobj = SWIG_From_int((int)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_do_handshake(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_dup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + struct stack_st_OPENSSL_BLOCK *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"bio_do_handshake",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_dup" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK const *""'"); } + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); + result = (struct stack_st_OPENSSL_BLOCK *)sk_OPENSSL_BLOCK_dup((struct stack_st_OPENSSL_BLOCK const *)arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_make_bio_pair(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_deep_copy(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - BIO *arg2 = (BIO *) 0 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + sk_OPENSSL_BLOCK_copyfunc arg2 = (sk_OPENSSL_BLOCK_copyfunc) 0 ; + sk_OPENSSL_BLOCK_freefunc arg3 = (sk_OPENSSL_BLOCK_freefunc) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[3] ; + struct stack_st_OPENSSL_BLOCK *result = 0 ; - 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_deep_copy", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_deep_copy" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK const *""'"); } - arg2 = (BIO *)(argp2); + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__void__p_void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_deep_copy" "', argument " "2"" of type '" "sk_OPENSSL_BLOCK_copyfunc""'"); } } { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + int res = SWIG_ConvertFunctionPtr(swig_obj[2], (void**)(&arg3), SWIGTYPE_p_f_p_void__void); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_deep_copy" "', argument " "3"" of type '" "sk_OPENSSL_BLOCK_freefunc""'"); } } - result = (int)bio_make_bio_pair(arg1,arg2); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; - } + result = (struct stack_st_OPENSSL_BLOCK *)sk_OPENSSL_BLOCK_deep_copy((struct stack_st_OPENSSL_BLOCK const *)arg1,arg2,arg3); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_set_write_buf_size(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_set_cmp_func(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - size_t arg2 ; + struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ; + sk_OPENSSL_BLOCK_compfunc arg2 = (sk_OPENSSL_BLOCK_compfunc) 0 ; void *argp1 = 0 ; int res1 = 0 ; - size_t val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[2] ; + sk_OPENSSL_BLOCK_compfunc 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_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_set_cmp_func", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_write_buf_size" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_set_cmp_func" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'"); } - 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); + arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int); + if (!SWIG_IsOK(res)) { + SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_set_cmp_func" "', argument " "2"" of type '" "sk_OPENSSL_BLOCK_compfunc""'"); } } - result = (int)bio_set_write_buf_size(arg1,arg2); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; - } + result = (sk_OPENSSL_BLOCK_compfunc)sk_OPENSSL_BLOCK_set_cmp_func(arg1,arg2); + resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_should_retry(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_threading_init(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; - } + if (!SWIG_Python_UnpackTuple(args, "threading_init", 0, 0, 0)) SWIG_fail; + threading_init(); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_should_read(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_threading_cleanup(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; - } + if (!SWIG_Python_UnpackTuple(args, "threading_cleanup", 0, 0, 0)) SWIG_fail; + threading_cleanup(); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_should_write(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_lib_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + + if (!SWIG_Python_UnpackTuple(args, "lib_init", 0, 0, 0)) SWIG_fail; + 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 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"bio_should_write",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIGNUM, 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; + 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_BIO_meth_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_mpi_to_bn(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 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + BIGNUM *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); + if (!args) SWIG_fail; + swig_obj[0] = args; + arg1 = swig_obj[0]; + result = (BIGNUM *)mpi_to_bn(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 | 0 ); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_BIO_meth_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bn_to_bin(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO_METHOD *arg1 = (BIO_METHOD *) 0 ; + BIGNUM *arg1 = (BIGNUM *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIGNUM, 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."); - } + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bn_to_bin" "', argument " "1"" of type '" "BIGNUM *""'"); } - BIO_meth_free(arg1); - resultobj = SWIG_Py_Void(); + arg1 = (BIGNUM *)(argp1); + result = (PyObject *)bn_to_bin(arg1); + resultobj = result; return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_BIO_PYFD_CTX_fd_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bin_to_bn(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 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + BIGNUM *result = 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(); + if (!args) SWIG_fail; + swig_obj[0] = args; + arg1 = swig_obj[0]; + 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_BIO_PYFD_CTX_fd_get(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bn_to_hex(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ; + BIGNUM *arg1 = (BIGNUM *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pyfd_struct, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIGNUM, 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; + 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 int _wrap_new_BIO_PYFD_CTX(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_hex_to_bn(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct pyfd_struct *result = 0 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + BIGNUM *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; + if (!args) SWIG_fail; + swig_obj[0] = args; + arg1 = swig_obj[0]; + result = (BIGNUM *)hex_to_bn(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 | 0 ); + return resultobj; fail: - return -1; + return NULL; } -SWIGINTERN PyObject *_wrap_delete_BIO_PYFD_CTX(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dec_to_bn(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + BIGNUM *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + arg1 = swig_obj[0]; + 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 *swig_obj[1] ; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pyfd_struct, SWIG_POINTER_DISOWN | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BIO_PYFD_CTX" "', argument " "1"" of type '" "struct pyfd_struct *""'"); + 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; } - arg1 = (struct pyfd_struct *)(argp1); - free((char *) arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -12102,362 +12537,200 @@ fail: } -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; +SWIGINTERN PyObject *_wrap_err_get_error(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + unsigned long result; + + if (!SWIG_Python_UnpackTuple(args, "err_get_error", 0, 0, 0)) SWIG_fail; + result = (unsigned long)ERR_get_error(); + resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); + return resultobj; fail: - return 1; + return NULL; } -SWIGINTERN PyObject *Swig_var_methods_fdp_get(void) { - PyObject *pyobj = 0; - PyObject *self = 0; +SWIGINTERN PyObject *_wrap_err_peek_error(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + unsigned long result; - (void)self; - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(methods_fdp), SWIGTYPE_p_BIO_METHOD, 0 ); - return pyobj; + if (!SWIG_Python_UnpackTuple(args, "err_peek_error", 0, 0, 0)) SWIG_fail; + result = (unsigned long)ERR_peek_error(); + resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result)); + return resultobj; +fail: + return NULL; } -SWIGINTERN PyObject *_wrap_pyfd_write(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_err_lib_error_string(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; + unsigned long arg1 ; + unsigned long val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + char *result = 0 ; - 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""'"); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "err_lib_error_string" "', argument " "1"" of type '" "unsigned long""'"); } - 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); + arg1 = (unsigned long)(val1); + result = (char *)ERR_lib_error_string(arg1); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_pyfd_read(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_err_func_error_string(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; + unsigned long arg1 ; + unsigned long val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + char *result = 0 ; - 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""'"); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "err_func_error_string" "', argument " "1"" of type '" "unsigned long""'"); } - 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); + arg1 = (unsigned long)(val1); + result = (char *)ERR_func_error_string(arg1); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_pyfd_puts(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_err_reason_error_string(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; + unsigned long arg1 ; + unsigned long val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + char *result = 0 ; - 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); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_unsigned_SS_long(swig_obj[0], &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: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_pyfd_gets(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_s_bio(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; + BIO_METHOD *result = 0 ; - 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); + if (!SWIG_Python_UnpackTuple(args, "bio_s_bio", 0, 0, 0)) SWIG_fail; + result = (BIO_METHOD *)BIO_s_bio(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 | 0 ); return resultobj; fail: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_pyfd_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_s_mem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + BIO_METHOD *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "bio_s_mem", 0, 0, 0)) SWIG_fail; + 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_pyfd_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_s_socket(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + BIO_METHOD *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "bio_s_socket", 0, 0, 0)) SWIG_fail; + 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_pyfd_ctrl(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_f_ssl(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; + BIO_METHOD *result = 0 ; - 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)); + if (!SWIG_Python_UnpackTuple(args, "bio_f_ssl", 0, 0, 0)) SWIG_fail; + 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_new_pyfd(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_f_buffer(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_METHOD *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "bio_f_buffer", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "bio_f_cipher", 0, 0, 0)) SWIG_fail; + 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 *swig_obj[1] ; 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); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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: @@ -12465,172 +12738,184 @@ fail: } -SWIGINTERN PyObject *_wrap_bn_rand(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_new_socket(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 ; + PyObject *swig_obj[2] ; + BIO *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"bn_rand",3,3,&obj0,&obj1,&obj2)) SWIG_fail; - ecode1 = SWIG_AsVal_int(obj0, &val1); + if (!SWIG_Python_UnpackTuple(args, "bio_new_socket", 2, 2, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); if (!SWIG_IsOK(ecode1)) { - SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bn_rand" "', argument " "1"" of type '" "int""'"); + 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); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bn_rand" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_socket" "', 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; - } + 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_bn_rand_range(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_free_all(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"bn_rand_range",1,1,&obj0)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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); { - arg1=obj0; + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - result = (PyObject *)bn_rand_range(arg1); { - resultobj=result; + 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_rand_file_name__SWIG_0(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_dup_chain(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 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + BIO *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"rand_file_name",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_file_name" "', argument " "1"" of type '" "char *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_dup_chain" "', argument " "1"" of type '" "BIO *""'"); } - 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); + 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: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_rand_load_file(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_push(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; + BIO *arg1 = (BIO *) 0 ; + BIO *arg2 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + BIO *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"rand_load_file",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_Python_UnpackTuple(args, "bio_push", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_load_file" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_push" "', argument " "1"" of type '" "BIO *""'"); } - 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); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + { + 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: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_rand_save_file(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; - int result; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + BIO *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"rand_save_file",1,1,&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_save_file" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_pop" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (char *)(buf1); - result = (int)RAND_write_file((char const *)arg1); + arg1 = (BIO *)(argp1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + result = (BIO *)BIO_pop(arg1); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); return resultobj; fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_rand_poll(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_eof(PyObject *self, PyObject *args) { PyObject *resultobj = 0; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; int result; - result = (int)RAND_poll(); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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; @@ -12641,25 +12926,36 @@ fail: } -SWIGINTERN PyObject *_wrap_rand_status(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - int result; - - result = (int)RAND_status(); +SWIGINTERN int Swig_var__bio_err_set(PyObject *_val) { { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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 resultobj; + return 0; fail: - return NULL; + return 1; } -SWIGINTERN PyObject *_wrap_rand_cleanup(PyObject *self, PyObject *args) { +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; - RAND_cleanup(); + if (!SWIG_Python_UnpackTuple(args, "pyfd_init", 0, 0, 0)) SWIG_fail; + pyfd_init(); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -12667,41 +12963,17 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_bio_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"rand_init",1,1,&obj0)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; { - arg1=obj0; + arg1=swig_obj[0]; } - rand_init(arg1); + bio_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -12709,19 +12981,30 @@ fail: } -SWIGINTERN PyObject *_wrap_rand_seed(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"rand_seed",1,1,&obj0)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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); { - arg1=obj0; + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - result = (PyObject *)rand_seed(arg1); + result = (int)bio_free(arg1); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -12729,74 +13012,96 @@ fail: } -SWIGINTERN PyObject *_wrap_rand_add(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_new_file(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 ; + 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 *swig_obj[2] ; + BIO *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"rand_add",2,2,&obj0,&obj1)) SWIG_fail; - { - arg1=obj0; + if (!SWIG_Python_UnpackTuple(args, "bio_new_file", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_new_file" "', argument " "1"" of type '" "char const *""'"); } - 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; + arg1 = (char *)(buf1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &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_rand_bytes(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_new_pyfile(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + PyObject *arg1 = (PyObject *) 0 ; + int arg2 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + BIO *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); + if (!SWIG_Python_UnpackTuple(args, "bio_new_pyfile", 2, 2, swig_obj)) SWIG_fail; { - resultobj=result; + arg1=swig_obj[0]; } + ecode2 = SWIG_AsVal_int(swig_obj[1], &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_rand_pseudo_bytes(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_read(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; + BIO *arg1 = (BIO *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; 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""'"); + if (!SWIG_Python_UnpackTuple(args, "bio_read", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_read" "', argument " "2"" of type '" "int""'"); } - arg1 = (int)(val1); - result = (PyObject *)rand_pseudo_bytes(arg1); + arg2 = (int)(val2); + { + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + result = (PyObject *)bio_read(arg1,arg2); { resultobj=result; } @@ -12806,11 +13111,34 @@ fail: } -SWIGINTERN PyObject *_wrap_rand_file_name__SWIG_1(PyObject *self, PyObject *args) { +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 *swig_obj[2] ; PyObject *result = 0 ; - result = (PyObject *)rand_file_name(); + if (!SWIG_Python_UnpackTuple(args, "bio_gets", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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; } @@ -12820,87 +13148,61 @@ fail: } -SWIGINTERN PyObject *_wrap_rand_file_name(PyObject *self, PyObject *args) { - int argc; - PyObject *argv[3]; - int ii; +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 *swig_obj[2] ; + int result; - 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 (!SWIG_Python_UnpackTuple(args, "bio_write", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); } - if (argc == 0) { - return _wrap_rand_file_name__SWIG_1(self, args); + arg1 = (BIO *)(argp1); + { + arg2=swig_obj[1]; } - 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); - } + { + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - -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(); + result = (int)bio_write(arg1,arg2); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_rand_win32_event(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_ctrl_pending(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 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; 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); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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; @@ -12911,124 +13213,258 @@ fail: } -SWIGINTERN PyObject *_wrap_md5(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_ctrl_wpending(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_MD *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_MD *)EVP_md5(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_sha1(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_ctrl_get_write_guarantee(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_MD *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_MD *)EVP_sha1(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_ripemd160(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_reset(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_MD *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_MD *)EVP_ripemd160(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_sha224(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_flush(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_MD *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_MD *)EVP_sha224(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_sha256(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_seek(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_MD *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + int result; - result = (EVP_MD *)EVP_sha256(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "bio_seek", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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_sha384(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_tell(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_MD *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_MD *)EVP_sha384(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_sha512(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_set_flags(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_MD *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; - result = (EVP_MD *)EVP_sha512(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "bio_set_flags", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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_digest_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_get_flags(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; - EVP_MD *arg2 = (EVP_MD *) 0 ; + BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_get_flags" "', argument " "1"" of type '" "BIO *""'"); } - arg2 = (EVP_MD *)(argp2); + arg1 = (BIO *)(argp1); { 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); + result = (int)bio_get_flags(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -13039,482 +13475,1135 @@ fail: } -SWIGINTERN PyObject *_wrap_des_ecb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_set_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 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 *swig_obj[5] ; + PyObject *result = 0 ; - result = (EVP_CIPHER *)EVP_des_ecb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "bio_set_cipher", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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=swig_obj[2]; + } + { + arg4=swig_obj[3]; + } + ecode5 = SWIG_AsVal_int(swig_obj[4], &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_des_ede_ecb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_set_mem_eof_return(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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 ); + if (!SWIG_Python_UnpackTuple(args, "bio_set_mem_eof_return", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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_des_cbc(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_get_fd(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_CIPHER *)EVP_des_cbc(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_des_ede_cbc(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_do_handshake(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_CIPHER *)EVP_des_ede_cbc(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_des_ede3_cbc(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_make_bio_pair(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + BIO *arg2 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - result = (EVP_CIPHER *)EVP_des_ede3_cbc(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "bio_make_bio_pair", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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_des_cfb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_set_write_buf_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + size_t arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + int result; - result = (EVP_CIPHER *)EVP_des_cfb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "bio_set_write_buf_size", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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_des_ede_cfb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_should_retry(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_CIPHER *)EVP_des_ede_cfb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_des_ede3_cfb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_should_read(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_CIPHER *)EVP_des_ede3_cfb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_des_ofb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_should_write(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_CIPHER *)EVP_des_ofb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_des_ede_ofb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_BIO_PYFD_CTX_fd_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ; + int arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; - result = (EVP_CIPHER *)EVP_des_ede_ofb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + 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(swig_obj[0], &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_des_ede3_ofb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_BIO_PYFD_CTX_fd_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_CIPHER *)EVP_des_ede3_ofb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "BIO_PYFD_CTX_fd_get", 0, 0, 0)) 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_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 PyObject *_wrap_bf_ecb(PyObject *self, PyObject *args) { +SWIGINTERN int _wrap_new_BIO_PYFD_CTX(PyObject *self, PyObject *args, PyObject *kwargs) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + struct pyfd_struct *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; + if (!SWIG_Python_CheckNoKeywords(kwargs, "new_BIO_PYFD_CTX")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new_BIO_PYFD_CTX", 0, 0, 0)) SWIG_fail; + 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_bf_cbc(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_delete_BIO_PYFD_CTX(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; - result = (EVP_CIPHER *)EVP_bf_cbc(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "delete_BIO_PYFD_CTX", 0, 0, 0)) SWIG_fail; + 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 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; +SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_BIO_PYFD_CTX) /* defines _wrap_delete_BIO_PYFD_CTX_destructor_closure */ + +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 NULL; + return 1; } -SWIGINTERN PyObject *_wrap_bf_ofb(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; +SWIGINTERN PyObject *Swig_var_methods_fdp_get(void) { + PyObject *pyobj = 0; + PyObject *self = 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; + (void)self; + pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(methods_fdp), SWIGTYPE_p_BIO_METHOD, 0 ); + return pyobj; } -SWIGINTERN PyObject *_wrap_cast5_ecb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pyfd_write(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 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 *swig_obj[3] ; + int result; - result = (EVP_CIPHER *)EVP_cast5_ecb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "pyfd_write", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2], &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_cast5_cbc(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pyfd_read(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 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 *swig_obj[3] ; + int result; - result = (EVP_CIPHER *)EVP_cast5_cbc(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "pyfd_read", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2], &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_cast5_cfb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pyfd_puts(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + char *arg2 = (char *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - result = (EVP_CIPHER *)EVP_cast5_cfb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "pyfd_puts", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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_cast5_ofb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pyfd_gets(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 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 *swig_obj[3] ; + int result; - result = (EVP_CIPHER *)EVP_cast5_ofb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "pyfd_gets", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2], &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_rc4(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pyfd_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_CIPHER *)EVP_rc4(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_rc2_40_cbc(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pyfd_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_CIPHER *)EVP_rc2_40_cbc(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_aes_128_ecb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pyfd_ctrl(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 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 *swig_obj[4] ; + long result; - result = (EVP_CIPHER *)EVP_aes_128_ecb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "pyfd_ctrl", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3],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_aes_128_cbc(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_new_pyfd(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + int arg1 ; + int arg2 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + BIO *result = 0 ; - result = (EVP_CIPHER *)EVP_aes_128_cbc(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "bio_new_pyfd", 2, 2, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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(swig_obj[1], &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_aes_128_cfb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bn_rand(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + int arg1 ; + int arg2 ; + int arg3 ; + int val1 ; + int ecode1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + PyObject *result = 0 ; - result = (EVP_CIPHER *)EVP_aes_128_cfb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "bn_rand", 3, 3, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2], &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_aes_128_ofb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bn_rand_range(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - result = (EVP_CIPHER *)EVP_aes_128_ofb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + { + arg1=swig_obj[0]; + } + result = (PyObject *)bn_rand_range(arg1); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_aes_128_ctr(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_file_name__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + char *arg1 = (char *) 0 ; + size_t arg2 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + size_t val2 ; + int ecode2 = 0 ; + char *result = 0 ; - result = (EVP_CIPHER *)EVP_aes_128_ctr(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &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(swig_obj[1], &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_aes_192_ecb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_load_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + char *arg1 = (char *) 0 ; + long arg2 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + int result; - result = (EVP_CIPHER *)EVP_aes_192_ecb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "rand_load_file", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &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(swig_obj[1], &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_aes_192_cbc(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_save_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + char *arg1 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (EVP_CIPHER *)EVP_aes_192_cbc(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &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_aes_192_cfb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_poll(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + int result; - result = (EVP_CIPHER *)EVP_aes_192_cfb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "rand_poll", 0, 0, 0)) SWIG_fail; + result = (int)RAND_poll(); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_aes_192_ofb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_status(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + int result; - result = (EVP_CIPHER *)EVP_aes_192_ofb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "rand_status", 0, 0, 0)) SWIG_fail; + result = (int)RAND_status(); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_aes_192_ctr(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_cleanup(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 ); + if (!SWIG_Python_UnpackTuple(args, "rand_cleanup", 0, 0, 0)) SWIG_fail; + RAND_cleanup(); + resultobj = SWIG_Py_Void(); 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; +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 NULL; + return 1; } -SWIGINTERN PyObject *_wrap_aes_256_cbc(PyObject *self, PyObject *args) { +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; - EVP_CIPHER *result = 0 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; - result = (EVP_CIPHER *)EVP_aes_256_cbc(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + { + arg1=swig_obj[0]; + } + rand_init(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_aes_256_cfb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_seed(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - result = (EVP_CIPHER *)EVP_aes_256_cfb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + { + arg1=swig_obj[0]; + } + result = (PyObject *)rand_seed(arg1); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_aes_256_ofb(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_add(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + PyObject *arg1 = (PyObject *) 0 ; + double arg2 ; + double val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + PyObject *result = 0 ; - result = (EVP_CIPHER *)EVP_aes_256_ofb(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "rand_add", 2, 2, swig_obj)) SWIG_fail; + { + arg1=swig_obj[0]; + } + ecode2 = SWIG_AsVal_double(swig_obj[1], &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_aes_256_ctr(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_bytes(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER *result = 0 ; + int arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - result = (EVP_CIPHER *)EVP_aes_256_ctr(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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_cipher_set_padding(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_pseudo_bytes(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; + int arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - 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""'"); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rand_pseudo_bytes" "', argument " "1"" of type '" "int""'"); } - arg2 = (int)(val2); + arg1 = (int)(val1); + result = (PyObject *)rand_pseudo_bytes(arg1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + resultobj=result; } - result = (int)EVP_CIPHER_CTX_set_padding(arg1,arg2); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_rand_file_name__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) { + PyObject *resultobj = 0; + PyObject *result = 0 ; + + if ((nobjs < 0) || (nobjs > 0)) SWIG_fail; + result = (PyObject *)rand_file_name(); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -13522,25 +14611,46 @@ fail: } -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 ; +SWIGINTERN PyObject *_wrap_rand_file_name(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 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 *""'"); + if (!(argc = SWIG_Python_UnpackTuple(args, "rand_file_name", 0, 2, argv))) SWIG_fail; + --argc; + if (argc == 0) { + return _wrap_rand_file_name__SWIG_1(self, argc, argv); } - arg1 = (EVP_PKEY *)(argp1); - { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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, argc, argv); + } } } - EVP_PKEY_free(arg1); + +fail: + SWIG_Python_RaiseOrModifyTypeError("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; + + if (!SWIG_Python_UnpackTuple(args, "rand_screen", 0, 0, 0)) SWIG_fail; + rand_screen(); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -13548,185 +14658,139 @@ fail: } -SWIGINTERN PyObject *_wrap_pkey_assign(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rand_win32_event(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; + unsigned int arg1 ; int arg2 ; - char *arg3 = (char *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; + long arg3 ; + unsigned int val1 ; + int ecode1 = 0 ; int val2 ; int ecode2 = 0 ; - int res3 ; - char *buf3 = 0 ; - int alloc3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + long val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "rand_win32_event", 3, 3, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &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(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pkey_assign" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_win32_event" "', 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); + ecode3 = SWIG_AsVal_long(swig_obj[2], &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; } - 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) { +SWIGINTERN PyObject *_wrap_md5(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; + EVP_MD *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "md5", 0, 0, 0)) SWIG_fail; + 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_pkey_set1_rsa(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sha1(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; + EVP_MD *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "sha1", 0, 0, 0)) SWIG_fail; + 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_sign_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ripemd160(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; + EVP_MD *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "ripemd160", 0, 0, 0)) SWIG_fail; + 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_verify_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sha224(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + EVP_MD *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "sha224", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "sha256", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "sha384", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "sha512", 0, 0, 0)) SWIG_fail; + 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 ; @@ -13734,19 +14798,18 @@ SWIGINTERN PyObject *_wrap_verify_init(PyObject *self, PyObject *args) { int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "digest_init", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + 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 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_init" "', argument " "2"" of type '" "EVP_MD const *""'"); } arg2 = (EVP_MD *)(argp2); { @@ -13759,7 +14822,7 @@ SWIGINTERN PyObject *_wrap_verify_init(PyObject *self, PyObject *args) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)EVP_VerifyInit(arg1,(EVP_MD const *)arg2); + result = (int)EVP_DigestInit(arg1,(EVP_MD const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -13770,1047 +14833,518 @@ fail: } -SWIGINTERN PyObject *_wrap_pkey_size(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + EVP_CIPHER *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "des_ecb", 0, 0, 0)) SWIG_fail; + 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 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; +SWIGINTERN PyObject *_wrap_des_ede_ecb(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + EVP_CIPHER *result = 0 ; - (void)self; - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_evp_err), SWIGTYPE_p_PyObject, 0 ); - return pyobj; + if (!SWIG_Python_UnpackTuple(args, "des_ede_ecb", 0, 0, 0)) SWIG_fail; + 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_evp_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_ede3_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; + EVP_CIPHER *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"evp_init",1,1,&obj0)) SWIG_fail; - { - arg1=obj0; - } - evp_init(arg1); - resultobj = SWIG_Py_Void(); + if (!SWIG_Python_UnpackTuple(args, "des_ede3_ecb", 0, 0, 0)) SWIG_fail; + 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_pkey_get1_rsa(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_cbc(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 ; + EVP_CIPHER *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; - } - } + if (!SWIG_Python_UnpackTuple(args, "des_cbc", 0, 0, 0)) SWIG_fail; + 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_pkcs5_pbkdf2_hmac_sha1(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_ede_cbc(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "des_ede_cbc", 0, 0, 0)) SWIG_fail; + 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_md_ctx_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_ede3_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_MD_CTX *result = 0 ; + EVP_CIPHER *result = 0 ; - result = (EVP_MD_CTX *)md_ctx_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "des_ede3_cbc", 0, 0, 0)) SWIG_fail; + 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_md_ctx_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_cfb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; + EVP_CIPHER *result = 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(); + if (!SWIG_Python_UnpackTuple(args, "des_cfb", 0, 0, 0)) SWIG_fail; + 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_digest_update(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_ede_cfb(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; + EVP_CIPHER *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "des_ede_cfb", 0, 0, 0)) SWIG_fail; + 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_digest_final(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_ede3_cfb(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "des_ede3_cfb", 0, 0, 0)) SWIG_fail; + 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_hmac_ctx_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - HMAC_CTX *result = 0 ; + EVP_CIPHER *result = 0 ; - result = (HMAC_CTX *)hmac_ctx_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HMAC_CTX, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "des_ofb", 0, 0, 0)) SWIG_fail; + 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_hmac_ctx_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_ede_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - HMAC_CTX *arg1 = (HMAC_CTX *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; + EVP_CIPHER *result = 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(); + if (!SWIG_Python_UnpackTuple(args, "des_ede_ofb", 0, 0, 0)) SWIG_fail; + 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_hmac_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_des_ede3_ofb(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "des_ede3_ofb", 0, 0, 0)) SWIG_fail; + 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_hmac_update(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bf_ecb(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "bf_ecb", 0, 0, 0)) SWIG_fail; + 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_hmac_final(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bf_cbc(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "bf_cbc", 0, 0, 0)) SWIG_fail; + 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_hmac(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bf_cfb(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "bf_cfb", 0, 0, 0)) SWIG_fail; + 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_cipher_ctx_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bf_ofb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER_CTX *result = 0 ; + EVP_CIPHER *result = 0 ; - result = (EVP_CIPHER_CTX *)cipher_ctx_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "bf_ofb", 0, 0, 0)) SWIG_fail; + 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_cipher_ctx_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_cast5_ecb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; + EVP_CIPHER *result = 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(); + if (!SWIG_Python_UnpackTuple(args, "cast5_ecb", 0, 0, 0)) SWIG_fail; + 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_bytes_to_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_cast5_cbc(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "cast5_cbc", 0, 0, 0)) SWIG_fail; + 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_cipher_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_cast5_cfb(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "cast5_cfb", 0, 0, 0)) SWIG_fail; + 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_cipher_update(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_cast5_ofb(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "cast5_ofb", 0, 0, 0)) SWIG_fail; + 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_cipher_final(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rc4(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "rc4", 0, 0, 0)) SWIG_fail; + 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_sign_update(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rc2_40_cbc(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "rc2_40_cbc", 0, 0, 0)) SWIG_fail; + 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_sign_final(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_aes_128_ecb(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 ; + EVP_CIPHER *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; - } + if (!SWIG_Python_UnpackTuple(args, "aes_128_ecb", 0, 0, 0)) SWIG_fail; + 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_verify_update(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_aes_128_cbc(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; + EVP_CIPHER *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "aes_128_cbc", 0, 0, 0)) SWIG_fail; + 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_verify_final(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_aes_128_cfb(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; + EVP_CIPHER *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "aes_128_cfb", 0, 0, 0)) SWIG_fail; + 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_get_digestbyname(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_aes_128_ofb(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 ; + EVP_CIPHER *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); + if (!SWIG_Python_UnpackTuple(args, "aes_128_ofb", 0, 0, 0)) SWIG_fail; + result = (EVP_CIPHER *)EVP_aes_128_ofb(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); return resultobj; fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_pkey_write_pem_no_cipher(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_aes_128_ctr(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; + EVP_CIPHER *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "aes_128_ctr", 0, 0, 0)) SWIG_fail; + 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_pkey_write_pem(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_aes_192_ecb(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; + EVP_CIPHER *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "aes_192_ecb", 0, 0, 0)) SWIG_fail; + 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_pkey_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_aes_192_cbc(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EVP_PKEY *result = 0 ; + EVP_CIPHER *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; - } - } + if (!SWIG_Python_UnpackTuple(args, "aes_192_cbc", 0, 0, 0)) SWIG_fail; + 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_pkey_read_pem(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_aes_192_cfb(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + EVP_CIPHER *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "aes_192_cfb", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "aes_192_ofb", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "aes_192_ctr", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "aes_256_ecb", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "aes_256_cbc", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "aes_256_cfb", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "aes_256_ofb", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "aes_256_ctr", 0, 0, 0)) SWIG_fail; + 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 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - EVP_PKEY *result = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "cipher_set_padding", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 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; + 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(swig_obj[1], &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 = (EVP_PKEY *)pkey_read_pem(arg1,arg2); + result = (int)EVP_CIPHER_CTX_set_padding(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; - } + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -14818,116 +15352,113 @@ fail: } -SWIGINTERN PyObject *_wrap_pkey_read_pem_pubkey(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkey_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - EVP_PKEY *result = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 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; + 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."); } } - 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; - } - } + EVP_PKEY_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_pkey_assign_rsa(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkey_assign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; - RSA *arg2 = (RSA *) 0 ; + int arg2 ; + char *arg3 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int val2 ; + int ecode2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "pkey_assign", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_assign" "', 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 *""'"); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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(swig_obj[2], &buf3, NULL, &alloc3); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkey_assign" "', argument " "3"" of type '" "char *""'"); } - arg2 = (RSA *)(argp2); + arg3 = (char *)(buf3); { 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); + 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_as_der(PyObject *self, PyObject *args) { +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 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "pkey_assign_ec", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_assign_ec" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); - { + res2 = SWIG_ConvertPtr(swig_obj[1], &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 = (PyObject *)pkey_as_der(arg1); + result = (int)EVP_PKEY_assign_EC_KEY(arg1,arg2); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -14935,28 +15466,42 @@ fail: } -SWIGINTERN PyObject *_wrap_pkey_get_modulus(PyObject *self, PyObject *args) { +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 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "pkey_set1_rsa", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_set1_rsa" "', argument " "1"" of type '" "EVP_PKEY *""'"); } arg1 = (EVP_PKEY *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (PyObject *)pkey_get_modulus(arg1); { - resultobj=result; + 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: @@ -14964,89 +15509,42 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_sign_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - AES_KEY *arg1 = (AES_KEY *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; + EVP_MD *arg2 = (EVP_MD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "sign_init", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_free" "', argument " "1"" of type '" "AES_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sign_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (AES_KEY *)(argp1); + arg1 = (EVP_MD_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - 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) { + if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)AES_set_key(arg1,arg2,arg3,arg4); + result = (int)EVP_SignInit(arg1,(EVP_MD const *)arg2); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -15054,51 +15552,42 @@ fail: } -SWIGINTERN PyObject *_wrap_AES_crypt(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_verify_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - AES_KEY *arg1 = (AES_KEY *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - int arg3 ; - int arg4 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; + EVP_MD *arg2 = (EVP_MD *) 0 ; 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 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "verify_init", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_crypt" "', argument " "1"" of type '" "AES_KEY const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "verify_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (AES_KEY *)(argp1); - { - arg2=obj1; + arg1 = (EVP_MD_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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 *""'"); } - 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); + arg2 = (EVP_MD *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)AES_crypt((AES_KEY const *)arg1,arg2,arg3,arg4); { - resultobj=result; + 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: @@ -15106,26 +15595,67 @@ fail: } -SWIGINTERN PyObject *_wrap_AES_type_check(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_digest_sign_init__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; - AES_KEY *arg1 = (AES_KEY *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; + EVP_PKEY_CTX **arg2 = (EVP_PKEY_CTX **) 0 ; + EVP_MD *arg3 = (EVP_MD *) 0 ; + ENGINE *arg4 = (ENGINE *) 0 ; + EVP_PKEY *arg5 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 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 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 ((nobjs < 5) || (nobjs > 5)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_type_check" "', argument " "1"" of type '" "AES_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_sign_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (AES_KEY *)(argp1); + arg1 = (EVP_MD_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_EVP_PKEY_CTX, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_sign_init" "', argument " "2"" of type '" "EVP_PKEY_CTX **""'"); + } + arg2 = (EVP_PKEY_CTX **)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_MD, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "digest_sign_init" "', argument " "3"" of type '" "EVP_MD const *""'"); + } + arg3 = (EVP_MD *)(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_ENGINE, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "digest_sign_init" "', argument " "4"" of type '" "ENGINE *""'"); + } + arg4 = (ENGINE *)(argp4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "digest_sign_init" "', argument " "5"" of type '" "EVP_PKEY *""'"); + } + arg5 = (EVP_PKEY *)(argp5); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)AES_type_check(arg1); + { + if (!arg3) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + { + if (!arg5) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + result = (int)EVP_DigestSignInit(arg1,arg2,(EVP_MD const *)arg3,arg4,arg5); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -15136,71 +15666,101 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_digest_verify_init__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; - RC4_KEY *arg1 = (RC4_KEY *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; + EVP_PKEY_CTX **arg2 = (EVP_PKEY_CTX **) 0 ; + EVP_MD *arg3 = (EVP_MD *) 0 ; + ENGINE *arg4 = (ENGINE *) 0 ; + EVP_PKEY *arg5 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 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 result; - if(!PyArg_UnpackTuple(args,(char *)"rc4_free",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RC4_KEY, 0 | 0 ); + if ((nobjs < 5) || (nobjs > 5)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_free" "', argument " "1"" of type '" "RC4_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_verify_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (RC4_KEY *)(argp1); + arg1 = (EVP_MD_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_EVP_PKEY_CTX, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_verify_init" "', argument " "2"" of type '" "EVP_PKEY_CTX **""'"); + } + arg2 = (EVP_PKEY_CTX **)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_MD, 0 | 0 ); + if (!SWIG_IsOK(res3)) { + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "digest_verify_init" "', argument " "3"" of type '" "EVP_MD const *""'"); + } + arg3 = (EVP_MD *)(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_ENGINE, 0 | 0 ); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "digest_verify_init" "', argument " "4"" of type '" "ENGINE *""'"); + } + arg4 = (ENGINE *)(argp4); + res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); + if (!SWIG_IsOK(res5)) { + SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "digest_verify_init" "', argument " "5"" of type '" "EVP_PKEY *""'"); + } + arg5 = (EVP_PKEY *)(argp5); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - rc4_free(arg1); - resultobj = SWIG_Py_Void(); + { + if (!arg3) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + { + if (!arg5) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + result = (int)EVP_DigestVerifyInit(arg1,arg2,(EVP_MD const *)arg3,arg4,arg5); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_rc4_set_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkey_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RC4_KEY *arg1 = (RC4_KEY *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 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; + 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 = (PyObject *)rc4_set_key(arg1,arg2); + result = (int)EVP_PKEY_size(arg1); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -15208,63 +15768,78 @@ fail: } -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; - } +SWIGINTERN int Swig_var__evp_err_set(PyObject *_val) { { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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); } - result = (PyObject *)rc4_update(arg1,arg2); + 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 *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; { - resultobj=result; + arg1=swig_obj[0]; } + evp_init(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_rc4_type_check(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkey_get1_rsa(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RC4_KEY *arg1 = (RC4_KEY *) 0 ; + EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + RSA *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_type_check" "', argument " "1"" of type '" "RC4_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_get1_rsa" "', argument " "1"" of type '" "EVP_PKEY *""'"); } - arg1 = (RC4_KEY *)(argp1); + arg1 = (EVP_PKEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)rc4_type_check(arg1); + result = (RSA *)pkey_get1_rsa(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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: @@ -15272,94 +15847,110 @@ fail: } -SWIGINTERN PyObject *_wrap_dh_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs5_pbkdf2_hmac_sha1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *result = 0 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + int arg3 ; + int arg4 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; + PyObject *result = 0 ; - result = (DH *)DH_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DH, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "pkcs5_pbkdf2_hmac_sha1", 4, 4, swig_obj)) SWIG_fail; + { + arg1=swig_obj[0]; + } + { + arg2=swig_obj[1]; + } + ecode3 = SWIG_AsVal_int(swig_obj[2], &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(swig_obj[3], &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_dh_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_md_ctx_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *arg1 = (DH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; + EVP_MD_CTX *result = 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(); + if (!SWIG_Python_UnpackTuple(args, "md_ctx_new", 0, 0, 0)) SWIG_fail; + 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_dh_size(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_md_ctx_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *arg1 = (DH *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"dh_size",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_size" "', argument " "1"" of type '" "DH const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "md_ctx_free" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (DH *)(argp1); + arg1 = (EVP_MD_CTX *)(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; - } + md_ctx_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_dh_generate_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_digest_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *arg1 = (DH *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "digest_update", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_generate_key" "', argument " "1"" of type '" "DH *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); + } + arg1 = (EVP_MD_CTX *)(argp1); + { + arg2=swig_obj[1]; } - arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)DH_generate_key(arg1); + result = (int)digest_update(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -15370,47 +15961,29 @@ fail: } -SWIGINTERN PyObject *_wrap_dhparams_print(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_digest_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - DH *arg2 = (DH *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"dhparams_print",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg2 = (DH *)(argp2); + arg1 = (EVP_MD_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)digest_final(arg1); { - 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; + resultobj=result; } return resultobj; fail: @@ -15418,172 +15991,118 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_hmac_ctx_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; + HMAC_CTX *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"dh_init",1,1,&obj0)) SWIG_fail; - { - arg1=obj0; - } - dh_init(arg1); - resultobj = SWIG_Py_Void(); + if (!SWIG_Python_UnpackTuple(args, "hmac_ctx_new", 0, 0, 0)) SWIG_fail; + 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_dh_type_check(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_hmac_ctx_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *arg1 = (DH *) 0 ; + HMAC_CTX *arg1 = (HMAC_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"dh_type_check",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_HMAC_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_type_check" "', argument " "1"" of type '" "DH *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_ctx_free" "', argument " "1"" of type '" "HMAC_CTX *""'"); } - arg1 = (DH *)(argp1); + arg1 = (HMAC_CTX *)(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; - } + hmac_ctx_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_dh_read_parameters(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_hmac_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + HMAC_CTX *arg1 = (HMAC_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + EVP_MD *arg3 = (EVP_MD *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - DH *result = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[3] ; + PyObject *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_Python_UnpackTuple(args, "hmac_init", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_HMAC_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_read_parameters" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_init" "', argument " "1"" of type '" "HMAC_CTX *""'"); } - arg1 = (BIO *)(argp1); + arg1 = (HMAC_CTX *)(argp1); + { + arg2=swig_obj[1]; + } + res3 = SWIG_ConvertPtr(swig_obj[2], &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."); } } { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (DH *)dh_read_parameters(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; + if (!arg3) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + result = (PyObject *)hmac_init(arg1,arg2,(EVP_MD const *)arg3); + { + resultobj=result; } - 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) { +SWIGINTERN PyObject *_wrap_hmac_update(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 ; + HMAC_CTX *arg1 = (HMAC_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[2] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"dh_check",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "hmac_update", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_HMAC_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_check" "', argument " "1"" of type '" "DH *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_update" "', argument " "1"" of type '" "HMAC_CTX *""'"); + } + arg1 = (HMAC_CTX *)(argp1); + { + arg2=swig_obj[1]; } - arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)dh_check(arg1); + result = (PyObject *)hmac_update(arg1,arg2); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -15591,31 +16110,27 @@ fail: } -SWIGINTERN PyObject *_wrap_dh_compute_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_hmac_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *arg1 = (DH *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + HMAC_CTX *arg1 = (HMAC_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_HMAC_CTX, 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; + 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 *)dh_compute_key(arg1,arg2); + result = (PyObject *)hmac_final(arg1); { resultobj=result; } @@ -15625,26 +16140,34 @@ fail: } -SWIGINTERN PyObject *_wrap_dh_get_p(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_hmac(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *arg1 = (DH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + EVP_MD *arg3 = (EVP_MD *) 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[3] ; 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 *""'"); + if (!SWIG_Python_UnpackTuple(args, "hmac", 3, 3, swig_obj)) SWIG_fail; + { + arg1=swig_obj[0]; } - arg1 = (DH *)(argp1); { - if (!arg1) { + arg2=swig_obj[1]; + } + res3 = SWIG_ConvertPtr(swig_obj[2], &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 *)dh_get_p(arg1); + result = (PyObject *)hmac(arg1,arg2,(EVP_MD const *)arg3); { resultobj=result; } @@ -15654,84 +16177,99 @@ fail: } -SWIGINTERN PyObject *_wrap_dh_get_g(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_cipher_ctx_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *arg1 = (DH *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + EVP_CIPHER_CTX *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; - } + if (!SWIG_Python_UnpackTuple(args, "cipher_ctx_new", 0, 0, 0)) SWIG_fail; + 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_dh_get_pub(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_cipher_ctx_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *arg1 = (DH *) 0 ; + EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"dh_get_pub",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DH, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_pub" "', argument " "1"" of type '" "DH *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_ctx_free" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'"); } - arg1 = (DH *)(argp1); + arg1 = (EVP_CIPHER_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)dh_get_pub(arg1); - { - resultobj=result; - } + cipher_ctx_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_dh_get_priv(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bytes_to_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *arg1 = (DH *) 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 ; - PyObject * obj0 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val6 ; + int ecode6 = 0 ; + PyObject *swig_obj[6] ; 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_Python_UnpackTuple(args, "bytes_to_key", 6, 6, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_priv" "', argument " "1"" of type '" "DH *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bytes_to_key" "', argument " "1"" of type '" "EVP_CIPHER const *""'"); } - arg1 = (DH *)(argp1); + arg1 = (EVP_CIPHER *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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=swig_obj[2]; + } + { + arg4=swig_obj[3]; + } + { + arg5=swig_obj[4]; + } + ecode6 = SWIG_AsVal_int(swig_obj[5], &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."); } } - result = (PyObject *)dh_get_priv(arg1); + { + 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; } @@ -15741,36 +16279,55 @@ fail: } -SWIGINTERN PyObject *_wrap_dh_set_pg(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_cipher_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DH *arg1 = (DH *) 0 ; - PyObject *arg2 = (PyObject *) 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 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject *swig_obj[5] ; 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_Python_UnpackTuple(args, "cipher_init", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_set_pg" "', argument " "1"" of type '" "DH *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_init" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'"); } - arg1 = (DH *)(argp1); + arg1 = (EVP_CIPHER_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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); { - arg2=obj1; + arg3=swig_obj[2]; } { - arg3=obj2; + arg4=swig_obj[3]; } + ecode5 = SWIG_AsVal_int(swig_obj[4], &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."); } } - result = (PyObject *)dh_set_pg(arg1,arg2,arg3); + { + if (!arg2) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + result = (PyObject *)cipher_init(arg1,(EVP_CIPHER const *)arg2,arg3,arg4,arg5); { resultobj=result; } @@ -15780,29 +16337,32 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_size(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_cipher_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; + EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[2] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"rsa_size",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "cipher_update", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_size" "', argument " "1"" of type '" "RSA const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_update" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'"); + } + arg1 = (EVP_CIPHER_CTX *)(argp1); + { + arg2=swig_obj[1]; } - arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)RSA_size((RSA const *)arg1); + result = (PyObject *)cipher_update(arg1,arg2); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -15810,67 +16370,62 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_cipher_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; + EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"rsa_free",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_RSA, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_free" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_final" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'"); } - arg1 = (RSA *)(argp1); + arg1 = (EVP_CIPHER_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - RSA_free(arg1); - resultobj = SWIG_Py_Void(); + result = (PyObject *)cipher_final(arg1); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_rsa_check_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sign_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[2] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "sign_update", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_check_key" "', argument " "1"" of type '" "RSA const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sign_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); + } + arg1 = (EVP_MD_CTX *)(argp1); + { + arg2=swig_obj[1]; } - arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)RSA_check_key((RSA const *)arg1); + result = (PyObject *)sign_update(arg1,arg2); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -15878,151 +16433,119 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_sign_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 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 *swig_obj[2] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"rsa_init",1,1,&obj0)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "sign_final", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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); { - arg1=obj0; + 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; } - rsa_init(arg1); - resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_rsa_read_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_verify_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 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 ; - RSA *result = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "verify_update", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_read_key" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "verify_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (BIO *)(argp1); + arg1 = (EVP_MD_CTX *)(argp1); { - if (!PyCallable_Check(obj1)) { - PyErr_SetString(PyExc_TypeError, "expected PyCallable"); - return NULL; - } - arg2=obj1; + arg2=swig_obj[1]; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (int)verify_update(arg1,arg2); { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } - 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) { +SWIGINTERN PyObject *_wrap_verify_final(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 ; + 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 *argp2 = 0 ; - int res2 = 0 ; void *argp3 = 0 ; int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "verify_final", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "verify_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - 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 *""'"); + arg1 = (EVP_MD_CTX *)(argp1); + { + arg2=swig_obj[1]; } - arg2 = (BIO *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_EVP_CIPHER, 0 | 0 ); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_PKEY, 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; + 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 (!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); + result = (int)verify_final(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -16033,38 +16556,27 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_write_key_no_cipher(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_digest_sign_init__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; - BIO *arg2 = (BIO *) 0 ; - PyObject *arg3 = (PyObject *) 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 * 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 ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key_no_cipher" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_sign_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (RSA *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); + arg1 = (EVP_MD_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 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; + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_sign_init" "', argument " "2"" of type '" "EVP_PKEY *""'"); } + arg2 = (EVP_PKEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); @@ -16075,12 +16587,7 @@ SWIGINTERN PyObject *_wrap_rsa_write_key_no_cipher(PyObject *self, PyObject *arg 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); + result = (int)digest_sign_init(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -16091,78 +16598,93 @@ fail: } -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 ; +SWIGINTERN PyObject *_wrap_digest_sign_init(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[6] = { + 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."); + if (!(argc = SWIG_Python_UnpackTuple(args, "digest_sign_init", 0, 5, argv))) SWIG_fail; + --argc; + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EVP_MD_CTX, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_EVP_PKEY, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_digest_sign_init__SWIG_1(self, argc, argv); + } } } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (RSA *)rsa_read_pub_key(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; + if (argc == 5) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EVP_MD_CTX, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_p_EVP_PKEY_CTX, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_EVP_MD, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_ENGINE, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_EVP_PKEY, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_digest_sign_init__SWIG_0(self, argc, argv); + } + } + } + } + } } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RSA, 0 | 0 ); - return resultobj; + fail: - return NULL; + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'digest_sign_init'.\n" + " Possible C/C++ prototypes are:\n" + " EVP_DigestSignInit(EVP_MD_CTX *,EVP_PKEY_CTX **,EVP_MD const *,ENGINE *,EVP_PKEY *)\n" + " digest_sign_init(EVP_MD_CTX *,EVP_PKEY *)\n"); + return 0; } -SWIGINTERN PyObject *_wrap_rsa_write_pub_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_digest_sign_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; - BIO *arg2 = (BIO *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[2] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "digest_sign_update", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_sign_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg2 = (BIO *)(argp2); + arg1 = (EVP_MD_CTX *)(argp1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg2=swig_obj[1]; } { - if (!arg2) { + if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)digest_sign_update(arg1,arg2); { - 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; + resultobj=result; } return resultobj; fail: @@ -16170,26 +16692,27 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_get_e(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_digest_sign_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_get_e" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_sign_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (RSA *)(argp1); + arg1 = (EVP_MD_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)rsa_get_e(arg1); + result = (PyObject *)digest_sign_final(arg1); { resultobj=result; } @@ -16199,26 +16722,30 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_get_n(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_digest_sign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "digest_sign", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_get_n" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_sign" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); + } + arg1 = (EVP_MD_CTX *)(argp1); + { + arg2=swig_obj[1]; } - arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)rsa_get_n(arg1); + result = (PyObject *)digest_sign(arg1,arg2); { resultobj=result; } @@ -16228,33 +16755,41 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_set_e(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_digest_verify_init__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ; + EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int result; - 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 ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_e" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_verify_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (RSA *)(argp1); - { - arg2=obj1; + arg1 = (EVP_MD_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); + if (!SWIG_IsOK(res2)) { + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_verify_init" "', argument " "2"" of type '" "EVP_PKEY *""'"); } + arg2 = (EVP_PKEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)rsa_set_e(arg1,arg2); { - resultobj=result; + if (!arg2) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + result = (int)digest_verify_init(arg1,arg2); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -16262,33 +16797,94 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_set_n(PyObject *self, PyObject *args) { - PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; +SWIGINTERN PyObject *_wrap_digest_verify_init(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[6] = { + 0 + }; + + if (!(argc = SWIG_Python_UnpackTuple(args, "digest_verify_init", 0, 5, argv))) SWIG_fail; + --argc; + if (argc == 2) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EVP_MD_CTX, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_EVP_PKEY, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_digest_verify_init__SWIG_1(self, argc, argv); + } + } + } + if (argc == 5) { + int _v; + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EVP_MD_CTX, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_p_EVP_PKEY_CTX, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_EVP_MD, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_ENGINE, 0); + _v = SWIG_CheckState(res); + if (_v) { + void *vptr = 0; + int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_EVP_PKEY, 0); + _v = SWIG_CheckState(res); + if (_v) { + return _wrap_digest_verify_init__SWIG_0(self, argc, argv); + } + } + } + } + } + } + +fail: + SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'digest_verify_init'.\n" + " Possible C/C++ prototypes are:\n" + " EVP_DigestVerifyInit(EVP_MD_CTX *,EVP_PKEY_CTX **,EVP_MD const *,ENGINE *,EVP_PKEY *)\n" + " digest_verify_init(EVP_MD_CTX *,EVP_PKEY *)\n"); + return 0; +} + + +SWIGINTERN PyObject *_wrap_digest_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 ; - PyObject *result = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "digest_verify_update", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_n" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_verify_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (RSA *)(argp1); + arg1 = (EVP_MD_CTX *)(argp1); { - arg2=obj1; + arg2=swig_obj[1]; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)rsa_set_n(arg1,arg2); + result = (int)digest_verify_update(arg1,arg2); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -16296,95 +16892,71 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_set_en(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_digest_verify_final(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 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 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "digest_verify_final", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_verify_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } + arg1 = (EVP_MD_CTX *)(argp1); { - arg3=obj2; + arg2=swig_obj[1]; } { 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; + result = (int)digest_verify_final(arg1,arg2); { - arg1=obj0; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } - 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) { +SWIGINTERN PyObject *_wrap_digest_verify(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; + EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 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 ; + PyObject *swig_obj[3] ; + int result; - 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_Python_UnpackTuple(args, "digest_verify", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_en_bin" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_verify" "', argument " "1"" of type '" "EVP_MD_CTX *""'"); } - arg1 = (RSA *)(argp1); + arg1 = (EVP_MD_CTX *)(argp1); { - arg2=obj1; + arg2=swig_obj[1]; } { - arg3=obj2; + arg3=swig_obj[2]; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)rsa_set_en_bin(arg1,arg2,arg3); + result = (int)digest_verify(arg1,arg2,arg3); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -16392,85 +16964,84 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_private_encrypt(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_get_digestbyname(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 ; + char *arg1 = (char *) 0 ; + int res1 ; + char *buf1 = 0 ; + int alloc1 = 0 ; + PyObject *swig_obj[1] ; + EVP_MD *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1); 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_digestbyname" "', argument " "1"" of type '" "char const *""'"); } - 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); + arg1 = (char *)(buf1); + result = (EVP_MD *)get_digestbyname((char const *)arg1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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; } } - result = (PyObject *)rsa_private_encrypt(arg1,arg2,arg3); - { - resultobj=result; - } + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return resultobj; fail: + if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_rsa_public_decrypt(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkey_write_pem_no_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - int arg3 ; + EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; + BIO *arg2 = (BIO *) 0 ; + PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[3] ; + int result; - 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_Python_UnpackTuple(args, "pkey_write_pem_no_cipher", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_public_decrypt" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_write_pem_no_cipher" "', argument " "1"" of type '" "EVP_PKEY *""'"); } - arg1 = (RSA *)(argp1); + arg1 = (EVP_PKEY *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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); { - arg2=obj1; + if (!PyCallable_Check(swig_obj[2])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg3=swig_obj[2]; } - 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; + 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: @@ -16478,42 +17049,63 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_public_encrypt(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkey_write_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - int arg3 ; + 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 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[4] ; + int result; - 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_Python_UnpackTuple(args, "pkey_write_pem", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_public_encrypt" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_write_pem" "', argument " "1"" of type '" "EVP_PKEY *""'"); } - arg1 = (RSA *)(argp1); + arg1 = (EVP_PKEY *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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); { - arg2=obj1; + if (!PyCallable_Check(swig_obj[3])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg4=swig_obj[3]; } - 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; + 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: @@ -16521,205 +17113,149 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_private_decrypt(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkey_new(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 ; + EVP_PKEY *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 (!SWIG_Python_UnpackTuple(args, "pkey_new", 0, 0, 0)) SWIG_fail; + result = (EVP_PKEY *)pkey_new(); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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; } } - 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) { +SWIGINTERN PyObject *_wrap_pkey_read_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; + BIO *arg1 = (BIO *) 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 ; + PyObject *swig_obj[2] ; + EVP_PKEY *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_Python_UnpackTuple(args, "pkey_read_pem", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_padding_add_pkcs1_pss" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_read_pem" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (RSA *)(argp1); + arg1 = (BIO *)(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 *""'"); + if (!PyCallable_Check(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg2=swig_obj[1]; } - 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."); } } + result = (EVP_PKEY *)pkey_read_pem(arg1,arg2); { - if (!arg3) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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; } } - 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) { +SWIGINTERN PyObject *_wrap_pkey_read_pem_pubkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; + BIO *arg1 = (BIO *) 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; + PyObject *swig_obj[2] ; + EVP_PKEY *result = 0 ; - 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_Python_UnpackTuple(args, "pkey_read_pem_pubkey", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_read_pem_pubkey" "', argument " "1"" of type '" "BIO *""'"); } + arg1 = (BIO *)(argp1); { - 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 *""'"); + if (!PyCallable_Check(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg2=swig_obj[1]; } - 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."); } } + result = (EVP_PKEY *)pkey_read_pem_pubkey(arg1,arg2); { - if (!arg4) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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; } } - 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) { +SWIGINTERN PyObject *_wrap_pkey_assign_rsa(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - int arg3 ; + EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; + RSA *arg2 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "pkey_assign_rsa", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_sign" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_assign_rsa" "', argument " "1"" of type '" "EVP_PKEY *""'"); } - arg1 = (RSA *)(argp1); - { - arg2=obj1; + arg1 = (EVP_PKEY *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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 *""'"); } - 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); + arg2 = (RSA *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)rsa_sign(arg1,arg2,arg3); { - resultobj=result; + 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: @@ -16727,48 +17263,29 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_verify(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkey_as_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - PyObject *arg3 = (PyObject *) 0 ; - int arg4 ; + EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; 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; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_as_der" "', argument " "1"" of type '" "EVP_PKEY *""'"); } - 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); + arg1 = (EVP_PKEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)rsa_verify(arg1,arg2,arg3,arg4); + result = (PyObject *)pkey_as_der(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -16776,44 +17293,27 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_generate_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkey_get_modulus(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 ; + EVP_PKEY *arg1 = (EVP_PKEY *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 (!arg3) { + if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)rsa_generate_key(arg1,arg2,arg3); + result = (PyObject *)pkey_get_modulus(arg1); { resultobj=result; } @@ -16823,107 +17323,88 @@ fail: } -SWIGINTERN PyObject *_wrap_rsa_type_check(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_aes_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + AES_KEY *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "aes_new", 0, 0, 0)) SWIG_fail; + 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_rsa_check_pub_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_AES_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; + AES_KEY *arg1 = (AES_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AES_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_check_pub_key" "', argument " "1"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_free" "', argument " "1"" of type '" "AES_KEY *""'"); } - arg1 = (RSA *)(argp1); + arg1 = (AES_KEY *)(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; - } + AES_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_rsa_write_key_der(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_AES_set_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - RSA *arg1 = (RSA *) 0 ; - BIO *arg2 = (BIO *) 0 ; + AES_KEY *arg1 = (AES_KEY *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + int arg3 ; + int arg4 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "AES_set_key", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AES_KEY, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_set_key" "', argument " "1"" of type '" "AES_KEY *""'"); } - arg2 = (BIO *)(argp2); + arg1 = (AES_KEY *)(argp1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg2=swig_obj[1]; } + ecode3 = SWIG_AsVal_int(swig_obj[2], &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(swig_obj[3], &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 (!arg2) { + if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)AES_set_key(arg1,arg2,arg3,arg4); { - 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; + resultobj=result; } return resultobj; fail: @@ -16931,67 +17412,48 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_AES_crypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; + AES_KEY *arg1 = (AES_KEY *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + int arg3 ; + int arg4 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; + PyObject *result = 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_Python_UnpackTuple(args, "AES_crypt", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AES_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_free" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_crypt" "', argument " "1"" of type '" "AES_KEY const *""'"); } - arg1 = (DSA *)(argp1); + arg1 = (AES_KEY *)(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 *""'"); + arg2=swig_obj[1]; } - arg1 = (DSA *)(argp1); + ecode3 = SWIG_AsVal_int(swig_obj[2], &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(swig_obj[3], &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 = (int)DSA_size((DSA const *)arg1); + result = (PyObject *)AES_crypt((AES_KEY const *)arg1,arg2,arg3,arg4); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -16999,26 +17461,27 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_gen_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_AES_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; + AES_KEY *arg1 = (AES_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AES_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_gen_key" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_type_check" "', argument " "1"" of type '" "AES_KEY *""'"); } - arg1 = (DSA *)(argp1); + arg1 = (AES_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)DSA_generate_key(arg1); + result = (int)AES_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -17029,134 +17492,72 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_rc4_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; + RC4_KEY *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"dsa_init",1,1,&obj0)) SWIG_fail; - { - arg1=obj0; - } - dsa_init(arg1); - resultobj = SWIG_Py_Void(); + if (!SWIG_Python_UnpackTuple(args, "rc4_new", 0, 0, 0)) SWIG_fail; + 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_dsa_generate_parameters(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rc4_free(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 ; + RC4_KEY *arg1 = (RC4_KEY *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 (!arg2) { + if (!arg1) { 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; - } - } + rc4_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_dsa_read_params(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rc4_set_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + RC4_KEY *arg1 = (RC4_KEY *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - DSA *result = 0 ; + PyObject *swig_obj[2] ; + PyObject *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_Python_UnpackTuple(args, "rc4_set_key", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RC4_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_params" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_set_key" "', argument " "1"" of type '" "RC4_KEY *""'"); } - arg1 = (BIO *)(argp1); + arg1 = (RC4_KEY *)(argp1); { - if (!PyCallable_Check(obj1)) { - PyErr_SetString(PyExc_TypeError, "expected PyCallable"); - return NULL; - } - arg2=obj1; + arg2=swig_obj[1]; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)rc4_set_key(arg1,arg2); { - 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; - } + resultobj=result; } return resultobj; fail: @@ -17164,48 +17565,32 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_read_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rc4_update(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + RC4_KEY *arg1 = (RC4_KEY *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - DSA *result = 0 ; + PyObject *swig_obj[2] ; + PyObject *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_Python_UnpackTuple(args, "rc4_update", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RC4_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_key" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_update" "', argument " "1"" of type '" "RC4_KEY *""'"); } - arg1 = (BIO *)(argp1); + arg1 = (RC4_KEY *)(argp1); { - if (!PyCallable_Check(obj1)) { - PyErr_SetString(PyExc_TypeError, "expected PyCallable"); - return NULL; - } - arg2=obj1; + arg2=swig_obj[1]; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)rc4_update(arg1,arg2); { - 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; - } + resultobj=result; } return resultobj; fail: @@ -17213,48 +17598,30 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_read_pub_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rc4_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + RC4_KEY *arg1 = (RC4_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - DSA *result = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RC4_KEY, 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; + 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); { - 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; - } + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -17262,57 +17629,70 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_get_p(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dh_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; + DH *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "dh_new", 0, 0, 0)) SWIG_fail; + 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 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"dsa_get_p",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_p" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_free" "', argument " "1"" of type '" "DH *""'"); } - arg1 = (DSA *)(argp1); + arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)dsa_get_p(arg1); - { - resultobj=result; - } + DH_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_dsa_get_q(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dh_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; + DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"dsa_get_q",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_q" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_size" "', argument " "1"" of type '" "DH const *""'"); } - arg1 = (DSA *)(argp1); + arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)dsa_get_q(arg1); + result = (int)DH_size((DH const *)arg1); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -17320,28 +17700,30 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_get_g(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dh_generate_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; + DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"dsa_get_g",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_g" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_generate_key" "', argument " "1"" of type '" "DH *""'"); } - arg1 = (DSA *)(argp1); + arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)dsa_get_g(arg1); + result = (int)DH_generate_key(arg1); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -17349,28 +17731,46 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_get_pub(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dhparams_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; + BIO *arg1 = (BIO *) 0 ; + DH *arg2 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "dhparams_print", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_pub" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dhparams_print" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (DSA *)(argp1); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (PyObject *)dsa_get_pub(arg1); { - resultobj=result; + 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: @@ -17378,28 +17778,73 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_get_priv(PyObject *self, PyObject *args) { +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; - DSA *arg1 = (DSA *) 0 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + { + arg1=swig_obj[0]; + } + 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 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"dsa_get_priv",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_priv" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_type_check" "', argument " "1"" of type '" "DH *""'"); } - arg1 = (DSA *)(argp1); + arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)dsa_get_priv(arg1); + result = (int)dh_type_check(arg1); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -17407,43 +17852,100 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_set_pqg(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dh_read_parameters(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - PyObject *arg3 = (PyObject *) 0 ; - PyObject *arg4 = (PyObject *) 0 ; + BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; + DH *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_set_pqg" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_read_parameters" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (DSA *)(argp1); + arg1 = (BIO *)(argp1); { - arg2=obj1; + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } { - arg3=obj2; + 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 *swig_obj[3] ; + DH *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "dh_generate_parameters", 3, 3, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dh_generate_parameters" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { - arg4=obj3; + if (!PyCallable_Check(swig_obj[2])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg3=swig_obj[2]; + } + 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 *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 = (PyObject *)dsa_set_pqg(arg1,arg2,arg3,arg4); + result = (int)dh_check(arg1); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -17451,31 +17953,30 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_set_pub(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dh_compute_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; + DH *arg1 = (DH *) 0 ; PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "dh_compute_key", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_set_pub" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_compute_key" "', argument " "1"" of type '" "DH *""'"); } - arg1 = (DSA *)(argp1); + arg1 = (DH *)(argp1); { - arg2=obj1; + arg2=swig_obj[1]; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)dsa_set_pub(arg1,arg2); + result = (PyObject *)dh_compute_key(arg1,arg2); { resultobj=result; } @@ -17485,47 +17986,29 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_write_params_bio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dh_get_p(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; - BIO *arg2 = (BIO *) 0 ; + DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_p" "', argument " "1"" of type '" "DH *""'"); } - arg2 = (BIO *)(argp2); + arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)dh_get_p(arg1); { - 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; + resultobj=result; } return resultobj; fail: @@ -17533,71 +18016,29 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_write_key_bio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dh_get_g(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 ; + DH *arg1 = (DH *) 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; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 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; + 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); { - 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; + resultobj=result; } return resultobj; fail: @@ -17605,57 +18046,29 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_write_key_bio_no_cipher(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dh_get_pub(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; - BIO *arg2 = (BIO *) 0 ; - PyObject *arg3 = (PyObject *) 0 ; + DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 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; + 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); { - 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; + resultobj=result; } return resultobj; fail: @@ -17663,47 +18076,29 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_write_pub_key_bio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dh_get_priv(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; - BIO *arg2 = (BIO *) 0 ; + DH *arg1 = (DH *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_priv" "', argument " "1"" of type '" "DH *""'"); } - arg2 = (BIO *)(argp2); + arg1 = (DH *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)dh_get_priv(arg1); { - 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; + resultobj=result; } return resultobj; fail: @@ -17711,31 +18106,34 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_sign(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dh_set_pg(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 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 *swig_obj[3] ; 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_Python_UnpackTuple(args, "dh_set_pg", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_sign" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_set_pg" "', argument " "1"" of type '" "DH *""'"); + } + arg1 = (DH *)(argp1); + { + arg2=swig_obj[1]; } - arg1 = (DSA *)(argp1); { - arg2=obj1; + arg3=swig_obj[2]; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)dsa_sign(arg1,arg2); + result = (PyObject *)dh_set_pg(arg1,arg2,arg3); { resultobj=result; } @@ -17745,41 +18143,27 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_verify(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - PyObject *arg3 = (PyObject *) 0 ; - PyObject *arg4 = (PyObject *) 0 ; + RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 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; + 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)dsa_verify(arg1,arg2,arg3,arg4); + result = (int)RSA_size((RSA const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -17790,100 +18174,67 @@ fail: } -SWIGINTERN PyObject *_wrap_dsa_sign_asn1(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_new(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 ; + RSA *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; - } + if (!SWIG_Python_UnpackTuple(args, "rsa_new", 0, 0, 0)) SWIG_fail; + result = (RSA *)RSA_new(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RSA, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_dsa_verify_asn1(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - PyObject *arg3 = (PyObject *) 0 ; + RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 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; + 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."); } } - result = (int)dsa_verify_asn1(arg1,arg2,arg3); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; - } + RSA_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_dsa_check_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_check_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; + RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_check_key" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_check_key" "', argument " "1"" of type '" "RSA const *""'"); } - arg1 = (DSA *)(argp1); + arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)dsa_check_key(arg1); + result = (int)RSA_check_key((RSA const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -17894,86 +18245,148 @@ fail: } -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); +SWIGINTERN int Swig_var__rsa_err_set(PyObject *_val) { { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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); } - result = (int)dsa_check_pub_key(arg1); + 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 *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + arg1=swig_obj[0]; } + rsa_init(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_dsa_keylen(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_read_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; + BIO *arg1 = (BIO *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[2] ; + RSA *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"dsa_keylen",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_DSA, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "rsa_read_key", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_keylen" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_read_key" "', argument " "1"" of type '" "BIO *""'"); + } + arg1 = (BIO *)(argp1); + { + if (!PyCallable_Check(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg2=swig_obj[1]; } - 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; + 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_dsa_type_check(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_write_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - DSA *arg1 = (DSA *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + 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 *swig_obj[4] ; + 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_Python_UnpackTuple(args, "rsa_write_key", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_type_check" "', argument " "1"" of type '" "DSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key" "', argument " "1"" of type '" "RSA *""'"); + } + arg1 = (RSA *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg4=swig_obj[3]; } - arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)dsa_type_check(arg1); + { + 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; @@ -17984,89 +18397,131 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_get_ciphers(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_write_key_no_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + RSA *arg1 = (RSA *) 0 ; + BIO *arg2 = (BIO *) 0 ; + PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - struct stack_st_SSL_CIPHER *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[3] ; + int result; - 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_Python_UnpackTuple(args, "rsa_write_key_no_cipher", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_ciphers" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key_no_cipher" "', argument " "1"" of type '" "RSA *""'"); + } + arg1 = (RSA *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg3=swig_obj[2]; } - 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 ); + { + 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_ssl_get_version(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_read_pub_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject *swig_obj[1] ; + RSA *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_version" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_read_pub_key" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (BIO *)(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); + { + 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_ssl_get_error(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_write_pub_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; - int arg2 ; + RSA *arg1 = (RSA *) 0 ; + BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "rsa_write_pub_key", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_error" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_pub_key" "', argument " "1"" of type '" "RSA *""'"); } - 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); + arg1 = (RSA *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (int)SSL_get_error((SSL const *)arg1,arg2); + { + 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; @@ -18077,275 +18532,300 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_get_state(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_get_e(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject *swig_obj[1] ; + PyObject *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_state" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_get_e" "', argument " "1"" of type '" "RSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (RSA *)(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); + result = (PyObject *)rsa_get_e(arg1); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_get_state_v(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_get_n(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject *swig_obj[1] ; + PyObject *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_state_v" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_get_n" "', argument " "1"" of type '" "RSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (RSA *)(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); + result = (PyObject *)rsa_get_n(arg1); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_get_alert_type(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_set_e(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[2] ; + PyObject *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); + if (!SWIG_Python_UnpackTuple(args, "rsa_set_e", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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=swig_obj[1]; + } + { + 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_ssl_get_alert_type_v(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_set_n(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[2] ; + PyObject *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); + if (!SWIG_Python_UnpackTuple(args, "rsa_set_n", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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=swig_obj[1]; + } + { + 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_ssl_get_alert_desc(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_set_en(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + PyObject *arg3 = (PyObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[3] ; + PyObject *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); + if (!SWIG_Python_UnpackTuple(args, "rsa_set_en", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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=swig_obj[1]; + } + { + arg3=swig_obj[2]; + } + { + 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_sslv23_method(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_PyObject_Bin_AsBIGNUM(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_METHOD *result = 0 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + BIGNUM *result = 0 ; - result = (SSL_METHOD *)SSLv23_method(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_METHOD, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + { + arg1=swig_obj[0]; + } + 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_ssl_ctx_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_set_en_bin(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_METHOD *arg1 = (SSL_METHOD *) 0 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - SSL_CTX *result = 0 ; + PyObject *swig_obj[3] ; + PyObject *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_Python_UnpackTuple(args, "rsa_set_en_bin", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_new" "', argument " "1"" of type '" "SSL_METHOD *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_en_bin" "', argument " "1"" of type '" "RSA *""'"); } - arg1 = (SSL_METHOD *)(argp1); - result = (SSL_CTX *)SSL_CTX_new(arg1); + arg1 = (RSA *)(argp1); { - 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; - } + arg2=swig_obj[1]; } - 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 *""'"); + { + arg3=swig_obj[2]; } - arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - SSL_CTX_free(arg1); - resultobj = SWIG_Py_Void(); + result = (PyObject *)rsa_set_en_bin(arg1,arg2,arg3); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify_depth(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_private_encrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - int arg2 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + PyObject *result = 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_Python_UnpackTuple(args, "rsa_private_encrypt", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_private_encrypt" "', argument " "1"" of type '" "RSA *""'"); } - 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""'"); + arg1 = (RSA *)(argp1); + { + arg2=swig_obj[1]; + } + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_private_encrypt" "', argument " "3"" of type '" "int""'"); } - arg2 = (int)(val2); + arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - SSL_CTX_set_verify_depth(arg1,arg2); - resultobj = SWIG_Py_Void(); + result = (PyObject *)rsa_private_encrypt(arg1,arg2,arg3); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_ctx_get_verify_depth(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_public_decrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "rsa_public_decrypt", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_public_decrypt" "', argument " "1"" of type '" "RSA *""'"); } - arg1 = (SSL_CTX *)(argp1); + arg1 = (RSA *)(argp1); + { + arg2=swig_obj[1]; + } + ecode3 = SWIG_AsVal_int(swig_obj[2], &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 = (int)SSL_CTX_get_verify_depth((SSL_CTX const *)arg1); + result = (PyObject *)rsa_public_decrypt(arg1,arg2,arg3); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -18353,29 +18833,40 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_get_verify_mode(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_public_encrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "rsa_public_encrypt", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_public_encrypt" "', argument " "1"" of type '" "RSA *""'"); } - arg1 = (SSL_CTX *)(argp1); + arg1 = (RSA *)(argp1); + { + arg2=swig_obj[1]; + } + ecode3 = SWIG_AsVal_int(swig_obj[2], &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 = (int)SSL_CTX_get_verify_mode((SSL_CTX const *)arg1); + result = (PyObject *)rsa_public_encrypt(arg1,arg2,arg3); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -18383,80 +18874,94 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_set_cipher_list(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_private_decrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - char *arg2 = (char *) 0 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "rsa_private_decrypt", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_private_decrypt" "', argument " "1"" of type '" "RSA *""'"); } - 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 *""'"); + arg1 = (RSA *)(argp1); + { + arg2=swig_obj[1]; } - arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &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 = (int)SSL_CTX_set_cipher_list(arg1,(char const *)arg2); + result = (PyObject *)rsa_private_decrypt(arg1,arg2,arg3); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } - 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) { +SWIGINTERN PyObject *_wrap_rsa_padding_add_pkcs1_pss(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - SSL_SESSION *arg2 = (SSL_SESSION *) 0 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + EVP_MD *arg3 = (EVP_MD *) 0 ; + int arg4 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "rsa_padding_add_pkcs1_pss", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_add_session" "', argument " "1"" of type '" "SSL_CTX *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_padding_add_pkcs1_pss" "', argument " "1"" of type '" "RSA *""'"); } - 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 *""'"); + arg1 = (RSA *)(argp1); + { + arg2=swig_obj[1]; } - arg2 = (SSL_SESSION *)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &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(swig_obj[3], &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."); } } - result = (int)SSL_CTX_add_session(arg1,arg2); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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: @@ -18464,35 +18969,55 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_remove_session(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_verify_pkcs1_pss(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - SSL_SESSION *arg2 = (SSL_SESSION *) 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 *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject *swig_obj[5] ; 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_Python_UnpackTuple(args, "rsa_verify_pkcs1_pss", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_remove_session" "', argument " "1"" of type '" "SSL_CTX *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_verify_pkcs1_pss" "', argument " "1"" of type '" "RSA *""'"); } - 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 *""'"); + arg1 = (RSA *)(argp1); + { + arg2=swig_obj[1]; } - arg2 = (SSL_SESSION *)(argp2); + { + arg3=swig_obj[2]; + } + res4 = SWIG_ConvertPtr(swig_obj[3], &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(swig_obj[4], &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."); } } - result = (int)SSL_CTX_remove_session(arg1,arg2); + { + 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; @@ -18503,116 +19028,159 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_set_session_timeout(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_sign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - long arg2 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "rsa_sign", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_sign" "', argument " "1"" of type '" "RSA *""'"); } - 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""'"); + arg1 = (RSA *)(argp1); + { + arg2=swig_obj[1]; + } + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_sign" "', argument " "3"" of type '" "int""'"); } - arg2 = (long)(val2); + arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (long)SSL_CTX_set_timeout(arg1,arg2); - resultobj = SWIG_From_long((long)(result)); + result = (PyObject *)rsa_sign(arg1,arg2,arg3); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_ctx_get_session_timeout(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_verify(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; + RSA *arg1 = (RSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + PyObject *arg3 = (PyObject *) 0 ; + int arg4 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - long result; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; + int 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_Python_UnpackTuple(args, "rsa_verify", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_verify" "', argument " "1"" of type '" "RSA *""'"); } - arg1 = (SSL_CTX *)(argp1); + arg1 = (RSA *)(argp1); + { + arg2=swig_obj[1]; + } + { + arg3=swig_obj[2]; + } + ecode4 = SWIG_AsVal_int(swig_obj[3], &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 = (long)SSL_CTX_get_timeout((SSL_CTX const *)arg1); - resultobj = SWIG_From_long((long)(result)); + 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_ssl_ctx_get_cert_store(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_generate_key(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 ; + int arg1 ; + unsigned long arg2 ; + PyObject *arg3 = (PyObject *) 0 ; + int val1 ; + int ecode1 = 0 ; + unsigned long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[3] ; + PyObject *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 *""'"); + if (!SWIG_Python_UnpackTuple(args, "rsa_generate_key", 3, 3, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg3=swig_obj[2]; } - arg1 = (SSL_CTX *)(argp1); { - if (!arg1) { + if (!arg3) { 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 ); + result = (PyObject *)rsa_generate_key(arg1,arg2,arg3); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_ctx_set_default_verify_paths(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; + RSA *arg1 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_type_check" "', argument " "1"" of type '" "RSA *""'"); } - arg1 = (SSL_CTX *)(argp1); + arg1 = (RSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)SSL_CTX_set_default_verify_paths(arg1); + result = (int)rsa_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -18623,11 +19191,27 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_get_ex_data_x509_store_ctx_idx(PyObject *self, PyObject *args) { +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 *swig_obj[1] ; int result; - result = (int)SSL_get_ex_data_X509_STORE_CTX_idx(); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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; @@ -18638,255 +19222,378 @@ fail: } -SWIGINTERN PyObject *_wrap_bio_new_ssl(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_rsa_write_key_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - int arg2 ; + RSA *arg1 = (RSA *) 0 ; + BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - BIO *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "rsa_write_key_der", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_new_ssl" "', argument " "1"" of type '" "SSL_CTX *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key_der" "', argument " "1"" of type '" "RSA *""'"); } - 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); + arg1 = (RSA *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (BIO *)BIO_new_ssl(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 | 0 ); + { + 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_ssl_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; + DSA *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "dsa_new", 0, 0, 0)) SWIG_fail; + 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 ; - SSL *result = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"ssl_new",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_new" "', argument " "1"" of type '" "SSL_CTX *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_free" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL_CTX *)(argp1); + arg1 = (DSA *)(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 ); + DSA_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"ssl_free",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_free" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_size" "', argument " "1"" of type '" "DSA const *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (int)DSA_size((DSA const *)arg1); { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - SSL_free(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_dup(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_gen_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - SSL *result = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"ssl_dup",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_dup" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_gen_key" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (DSA *)(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 ); + result = (int)DSA_generate_key(arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } 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 *""'"); +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); } - 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 *""'"); + 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 *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + { + arg1=swig_obj[0]; } - arg3 = (BIO *)(argp3); + 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 *swig_obj[2] ; + DSA *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "dsa_generate_parameters", 2, 2, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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 (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + if (!PyCallable_Check(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; } + arg2=swig_obj[1]; } { if (!arg2) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (DSA *)dsa_generate_parameters(arg1,arg2); { - if (!arg3) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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; } } - 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) { +SWIGINTERN PyObject *_wrap_dsa_read_params(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + BIO *arg1 = (BIO *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[2] ; + DSA *result = 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_Python_UnpackTuple(args, "dsa_read_params", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_accept_state" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_params" "', argument " "1"" of type '" "BIO *""'"); + } + arg1 = (BIO *)(argp1); + { + if (!PyCallable_Check(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg2=swig_obj[1]; } - arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - SSL_set_accept_state(arg1); - resultobj = SWIG_Py_Void(); + { + 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_ssl_set_connect_state(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_read_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + BIO *arg1 = (BIO *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[2] ; + DSA *result = 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_Python_UnpackTuple(args, "dsa_read_key", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_connect_state" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_key" "', argument " "1"" of type '" "BIO *""'"); + } + arg1 = (BIO *)(argp1); + { + if (!PyCallable_Check(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg2=swig_obj[1]; } - arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - SSL_set_connect_state(arg1); - resultobj = SWIG_Py_Void(); + { + 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_ssl_get_shutdown(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_read_pub_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + BIO *arg1 = (BIO *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[2] ; + DSA *result = 0 ; - 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_Python_UnpackTuple(args, "dsa_read_pub_key", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_shutdown" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_pub_key" "', argument " "1"" of type '" "BIO *""'"); + } + arg1 = (BIO *)(argp1); + { + if (!PyCallable_Check(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg2=swig_obj[1]; } - 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; + 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: @@ -18894,68 +19601,59 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_set_shutdown(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_get_p(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; - int arg2 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_shutdown" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_p" "', argument " "1"" of type '" "DSA *""'"); } - 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); + arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - SSL_set_shutdown(arg1,arg2); - resultobj = SWIG_Py_Void(); + result = (PyObject *)dsa_get_p(arg1); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_shutdown(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_get_q(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"ssl_shutdown",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_shutdown" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_q" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)dsa_get_q(arg1); { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)SSL_shutdown(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -18963,29 +19661,29 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_clear(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_get_g(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"ssl_clear",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_clear" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_g" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)SSL_clear(arg1); + result = (PyObject *)dsa_get_g(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -18993,33 +19691,29 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_do_handshake(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_get_pub(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"ssl_do_handshake",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_do_handshake" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_pub" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)dsa_get_pub(arg1); { - 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; + resultobj=result; } return resultobj; fail: @@ -19027,33 +19721,29 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_renegotiate(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_get_priv(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"ssl_renegotiate",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_renegotiate" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_priv" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (DSA *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)dsa_get_priv(arg1); { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)SSL_renegotiate(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; - } - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -19061,29 +19751,40 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_pending(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_set_pqg(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 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 ; - int result; + PyObject *swig_obj[4] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"ssl_pending",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "dsa_set_pqg", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_pending" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_set_pqg" "', argument " "1"" of type '" "DSA *""'"); + } + arg1 = (DSA *)(argp1); + { + arg2=swig_obj[1]; + } + { + arg3=swig_obj[2]; + } + { + arg4=swig_obj[3]; } - arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)SSL_pending((SSL const *)arg1); + result = (PyObject *)dsa_set_pqg(arg1,arg2,arg3,arg4); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -19091,80 +19792,145 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_get_peer_cert(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_set_pub(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - X509 *result = 0 ; + PyObject *swig_obj[2] ; + PyObject *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_Python_UnpackTuple(args, "dsa_set_pub", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_peer_cert" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_set_pub" "', argument " "1"" of type '" "DSA *""'"); + } + arg1 = (DSA *)(argp1); + { + arg2=swig_obj[1]; } - 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 ); + result = (PyObject *)dsa_set_pub(arg1,arg2); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_get_current_cipher(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_write_params_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; + BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - SSL_CIPHER *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "dsa_write_params_bio", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_current_cipher" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_params_bio" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (DSA *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (SSL_CIPHER *)SSL_get_current_cipher((SSL const *)arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_CIPHER, 0 | 0 ); + { + 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_ssl_get_verify_mode(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_write_key_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 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 ; - PyObject * obj0 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[4] ; 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_Python_UnpackTuple(args, "dsa_write_key_bio", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_mode" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_key_bio" "', argument " "1"" of type '" "DSA *""'"); + } + arg1 = (DSA *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg4=swig_obj[3]; } - arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)SSL_get_verify_mode((SSL const *)arg1); + { + 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; @@ -19175,26 +19941,52 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_get_verify_depth(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_write_key_bio_no_cipher(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; + BIO *arg2 = (BIO *) 0 ; + PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "dsa_write_key_bio_no_cipher", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_depth" "', argument " "1"" of type '" "SSL const *""'"); + 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(swig_obj[1], &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(swig_obj[2])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg3=swig_obj[2]; } - arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)SSL_get_verify_depth((SSL const *)arg1); + { + 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; @@ -19205,366 +19997,407 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_get_verify_result(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_write_pub_key_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; + BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - long result; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int 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_Python_UnpackTuple(args, "dsa_write_pub_key_bio", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_result" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_pub_key_bio" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (DSA *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (long)SSL_get_verify_result((SSL const *)arg1); - resultobj = SWIG_From_long((long)(result)); + { + 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_ssl_get_ssl_ctx(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_sign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - SSL_CTX *result = 0 ; + PyObject *swig_obj[2] ; + PyObject *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_Python_UnpackTuple(args, "dsa_sign", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_ssl_ctx" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_sign" "', argument " "1"" of type '" "DSA *""'"); + } + arg1 = (DSA *)(argp1); + { + arg2=swig_obj[1]; } - 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 ); + result = (PyObject *)dsa_sign(arg1,arg2); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_get_default_session_timeout(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_verify(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 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 ; - long result; + PyObject *swig_obj[4] ; + int 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_Python_UnpackTuple(args, "dsa_verify", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_verify" "', argument " "1"" of type '" "DSA *""'"); + } + arg1 = (DSA *)(argp1); + { + arg2=swig_obj[1]; + } + { + arg3=swig_obj[2]; + } + { + arg4=swig_obj[3]; } - 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)); + 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_ssl_set_cipher_list(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_sign_asn1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; - char *arg2 = (char *) 0 ; + DSA *arg1 = (DSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[2] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "dsa_sign_asn1", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_cipher_list" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_sign_asn1" "', argument " "1"" of type '" "DSA *""'"); } - 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 *""'"); + arg1 = (DSA *)(argp1); + { + arg2=swig_obj[1]; } - arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)SSL_set_cipher_list(arg1,(char const *)arg2); + result = (PyObject *)dsa_sign_asn1(arg1,arg2); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } - 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) { +SWIGINTERN PyObject *_wrap_dsa_verify_asn1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; - int arg2 ; + DSA *arg1 = (DSA *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - char *result = 0 ; + PyObject *swig_obj[3] ; + int result; - 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_Python_UnpackTuple(args, "dsa_verify_asn1", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_cipher_list" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_verify_asn1" "', argument " "1"" of type '" "DSA *""'"); + } + arg1 = (DSA *)(argp1); + { + arg2=swig_obj[1]; + } + { + arg3=swig_obj[2]; } - 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); + 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_ssl_cipher_get_name(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_check_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_check_key" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL_CIPHER *)(argp1); + arg1 = (DSA *)(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); + result = (int)dsa_check_key(arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_cipher_get_version(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_check_pub_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_check_pub_key" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL_CIPHER *)(argp1); + arg1 = (DSA *)(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); + result = (int)dsa_check_pub_key(arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_get_session(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_keylen(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - SSL_SESSION *result = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"ssl_get_session",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_session" "', argument " "1"" of type '" "SSL const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_keylen" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (DSA *)(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 ); + result = (int)dsa_keylen(arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_get1_session(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_dsa_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + DSA *arg1 = (DSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - SSL_SESSION *result = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"ssl_get1_session",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_SSL, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get1_session" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_type_check" "', argument " "1"" of type '" "DSA *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (DSA *)(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 ); + result = (int)dsa_type_check(arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_set_session(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_ciphers(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; + PyObject *swig_obj[1] ; + struct stack_st_SSL_CIPHER *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_ciphers" "', argument " "1"" of type '" "SSL const *""'"); } 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; - } + 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_session_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_SESSION *arg1 = (SSL_SESSION *) 0 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + char *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_free" "', argument " "1"" of type '" "SSL_SESSION *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_version" "', argument " "1"" of type '" "SSL const *""'"); } - arg1 = (SSL_SESSION *)(argp1); - SSL_SESSION_free(arg1); - resultobj = SWIG_Py_Void(); + 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_session_print(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_error(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - SSL_SESSION *arg2 = (SSL_SESSION *) 0 ; + SSL *arg1 = (SSL *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_get_error", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_error" "', argument " "1"" of type '" "SSL const *""'"); } - arg2 = (SSL_SESSION *)(argp2); + arg1 = (SSL *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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."); } } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)SSL_SESSION_print(arg1,(SSL_SESSION const *)arg2); - SWIG_PYTHON_THREAD_END_ALLOW; - } + result = (int)SSL_get_error((SSL const *)arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -19575,351 +20408,253 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_session_set_timeout(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_state(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_SESSION *arg1 = (SSL_SESSION *) 0 ; - long arg2 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; + PyObject *swig_obj[1] ; + char *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_set_timeout" "', argument " "1"" of type '" "SSL_SESSION *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_state" "', argument " "1"" of type '" "SSL const *""'"); } - 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 *)(argp1); + { + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - arg1 = (SSL_SESSION *)(argp1); - result = (long)SSL_SESSION_get_timeout((SSL_SESSION const *)arg1); - resultobj = SWIG_From_long((long)(result)); + result = (char *)SSL_state_string((SSL const *)arg1); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_accept(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_state_v(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 ; + PyObject *swig_obj[1] ; + char *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_state_v" "', argument " "1"" of type '" "SSL const *""'"); } 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; - } + result = (char *)SSL_state_string_long((SSL const *)arg1); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_connect(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_alert_type(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 ; + int arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + char *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; - } + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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_read(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_alert_type_v(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 ; + int arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + char *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""'"); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ssl_get_alert_type_v" "', argument " "1"" 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; - } + 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_write(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_alert_desc(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; + int arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + char *result = 0 ; - 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; - } + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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 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; +SWIGINTERN PyObject *_wrap_ssl_get_alert_desc_v(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + int arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + char *result = 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; + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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 1; + return NULL; } -SWIGINTERN PyObject *Swig_var__ssl_timeout_err_get(void) { - PyObject *pyobj = 0; - PyObject *self = 0; +SWIGINTERN PyObject *_wrap_sslv23_method(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + SSL_METHOD *result = 0 ; - (void)self; - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_ssl_timeout_err), SWIGTYPE_p_PyObject, 0 ); - return pyobj; + if (!SWIG_Python_UnpackTuple(args, "sslv23_method", 0, 0, 0)) SWIG_fail; + 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_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + SSL_METHOD *arg1 = (SSL_METHOD *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + SSL_CTX *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"ssl_init",2,2,&obj0,&obj1)) SWIG_fail; - { - arg1=obj0; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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); { - arg2=obj1; + 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; + } } - ssl_init(arg1,arg2); - resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_tlsv1_method(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_METHOD *result = 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; - result = (SSL_METHOD *)tlsv1_method(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_METHOD, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_passphrase_callback(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify_depth(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "ssl_ctx_set_verify_depth", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_verify_depth" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); - { - if (!PyCallable_Check(obj1)) { - PyErr_SetString(PyExc_TypeError, "expected PyCallable"); - return NULL; - } - arg2=obj1; - } + ecode2 = SWIG_AsVal_int(swig_obj[1], &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."); } } - { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } - } - ssl_ctx_passphrase_callback(arg1,arg2); + SSL_CTX_set_verify_depth(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -19927,35 +20662,27 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_use_x509(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_get_verify_depth(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 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_verify_depth" "', argument " "1"" of type '" "SSL_CTX const *""'"); } 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); + result = (int)SSL_CTX_get_verify_depth((SSL_CTX const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -19966,49 +20693,38 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_use_cert(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_get_verify_mode(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 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_verify_mode" "', argument " "1"" of type '" "SSL_CTX const *""'"); } 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); + result = (int)SSL_CTX_get_verify_mode((SSL_CTX const *)arg1); { 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) { +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 ; @@ -20017,19 +20733,18 @@ SWIGINTERN PyObject *_wrap_ssl_ctx_use_cert_chain(PyObject *self, PyObject *args int res2 ; char *buf2 = 0 ; int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_ctx_set_cipher_list", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + 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); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_cipher_list" "', argument " "2"" of type '" "char const *""'"); } arg2 = (char *)(buf2); { @@ -20037,7 +20752,7 @@ SWIGINTERN PyObject *_wrap_ssl_ctx_use_cert_chain(PyObject *self, PyObject *args SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)ssl_ctx_use_cert_chain(arg1,arg2); + result = (int)SSL_CTX_set_cipher_list(arg1,(char const *)arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -20050,82 +20765,72 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_use_privkey(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_add_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; - char *arg2 = (char *) 0 ; + SSL_SESSION *arg2 = (SSL_SESSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_ctx_add_session", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_add_session" "', argument " "1"" of type '" "SSL_CTX *""'"); } arg1 = (SSL_CTX *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_privkey" "', argument " "2"" of type '" "char *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_add_session" "', argument " "2"" of type '" "SSL_SESSION *""'"); } - arg2 = (char *)(buf2); + arg2 = (SSL_SESSION *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)ssl_ctx_use_privkey(arg1,arg2); + result = (int)SSL_CTX_add_session(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) { +SWIGINTERN PyObject *_wrap_ssl_ctx_remove_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; - RSA *arg2 = (RSA *) 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_ctx_remove_session", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + 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_RSA, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_rsa_privkey" "', argument " "2"" of type '" "RSA *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_remove_session" "', argument " "2"" of type '" "SSL_SESSION *""'"); } - arg2 = (RSA *)(argp2); + arg2 = (SSL_SESSION *)(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); + result = (int)SSL_CTX_remove_session(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -20136,62 +20841,54 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_use_pkey_privkey(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_session_timeout(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_CTX *arg1 = (SSL_CTX *) 0 ; - EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; + long arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + long 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_Python_UnpackTuple(args, "ssl_ctx_set_session_timeout", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_session_timeout" "', 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); + ecode2 = SWIG_AsVal_long(swig_obj[1], &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."); } } - { - 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; - } + result = (long)SSL_CTX_set_timeout(arg1,arg2); + resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_ctx_check_privkey(PyObject *self, PyObject *args) { +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 ; - int result; + PyObject *swig_obj[1] ; + long 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_session_timeout" "', argument " "1"" of type '" "SSL_CTX const *""'"); } arg1 = (SSL_CTX *)(argp1); { @@ -20199,207 +20896,176 @@ SWIGINTERN PyObject *_wrap_ssl_ctx_check_privkey(PyObject *self, PyObject *args) SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)ssl_ctx_check_privkey(arg1); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; - } + 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_set_client_CA_list_from_file(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_get_cert_store(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 ; + PyObject *swig_obj[1] ; + X509_STORE *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_cert_store" "', argument " "1"" of type '" "SSL_CTX const *""'"); } 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); + 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: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify_default(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_default_verify_paths(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 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_default_verify_paths" "', 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(); + 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_ctx_set_verify(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_ex_data_x509_store_ctx_idx(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + int result; + + if (!SWIG_Python_UnpackTuple(args, "ssl_get_ex_data_x509_store_ctx_idx", 0, 0, 0)) SWIG_fail; + 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 ; - PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[2] ; + BIO *result = 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_Python_UnpackTuple(args, "bio_new_ssl", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + 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); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_verify" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_ssl" "', 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(); + 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_ctx_set_session_id_context(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_new(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; + PyObject *swig_obj[1] ; + SSL *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_new" "', 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; - } + 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_ctx_set_info_callback(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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; + 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."); } } { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + SSL_free(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; } - ssl_ctx_set_info_callback(arg1,arg2); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -20407,80 +21073,79 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_dh(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_dup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - DH *arg2 = (DH *) 0 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; + PyObject *swig_obj[1] ; + SSL *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_dup" "', argument " "1"" of type '" "SSL *""'"); } - arg2 = (DH *)(argp2); + arg1 = (SSL *)(argp1); { 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)); + 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_ctx_set_tmp_dh_callback(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + SSL *arg1 = (SSL *) 0 ; + BIO *arg2 = (BIO *) 0 ; + BIO *arg3 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[3] ; - 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_Python_UnpackTuple(args, "ssl_set_bio", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_bio" "', argument " "1"" of type '" "SSL *""'"); } - arg1 = (SSL_CTX *)(argp1); - { - if (!PyCallable_Check(obj1)) { - PyErr_SetString(PyExc_TypeError, "expected PyCallable"); - return NULL; - } - arg2=obj1; + arg1 = (SSL *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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 *""'"); } - { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg2 = (BIO *)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &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."); } } - ssl_ctx_set_tmp_dh_callback(arg1,arg2); + { + if (!arg3) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + SSL_set_bio(arg1,arg2,arg3); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -20488,80 +21153,53 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_rsa(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_accept_state(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - RSA *arg2 = (RSA *) 0 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_accept_state" "', argument " "1"" of type '" "SSL *""'"); } - arg2 = (RSA *)(argp2); + arg1 = (SSL *)(argp1); { 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)); + SSL_set_accept_state(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_rsa_callback(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_connect_state(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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; + 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."); } } - { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } - } - ssl_ctx_set_tmp_rsa_callback(arg1,arg2); + SSL_set_connect_state(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -20569,139 +21207,96 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_load_verify_locations(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_shutdown(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; + SSL *arg1 = (SSL *) 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 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_shutdown" "', argument " "1"" of type '" "SSL const *""'"); } - arg3 = (char *)(buf3); + arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)ssl_ctx_load_verify_locations(arg1,(char const *)arg2,(char const *)arg3); + result = (int)SSL_get_shutdown((SSL const *)arg1); { 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) { +SWIGINTERN PyObject *_wrap_ssl_set_shutdown(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - long arg2 ; + SSL *arg1 = (SSL *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - long val2 ; + int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "ssl_set_shutdown", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_options" "', argument " "1"" of type '" "SSL_CTX *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_shutdown" "', argument " "1"" of type '" "SSL *""'"); } - arg1 = (SSL_CTX *)(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); + arg1 = (SSL *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_options" "', argument " "2"" of type '" "long""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_shutdown" "', argument " "2"" of type '" "int""'"); } - arg2 = (long)(val2); + arg2 = (int)(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)); + SSL_set_shutdown(arg1,arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_bio_set_ssl(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_shutdown(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - SSL *arg2 = (SSL *) 0 ; - int arg3 ; + SSL *arg1 = (SSL *) 0 ; 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 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_shutdown" "', argument " "1"" 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); + arg1 = (SSL *)(argp1); { 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)SSL_shutdown(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; } - result = (int)bio_set_ssl(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -20712,54 +21307,50 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_set_mode(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_clear(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; + PyObject *swig_obj[1] ; + int 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_clear" "', 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)); + result = (int)SSL_clear(arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_get_mode(PyObject *self, PyObject *args) { +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 ; - long result; + PyObject *swig_obj[1] ; + int 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_do_handshake" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); { @@ -20767,198 +21358,164 @@ SWIGINTERN PyObject *_wrap_ssl_get_mode(PyObject *self, PyObject *args) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (long)ssl_get_mode(arg1); - resultobj = SWIG_From_long((long)(result)); + { + 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_set_tlsext_host_name(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_renegotiate(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 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_renegotiate" "', 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); + { + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)SSL_renegotiate(arg1); + SWIG_PYTHON_THREAD_END_ALLOW; + } { 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) { +SWIGINTERN PyObject *_wrap_ssl_pending(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 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_pending" "', argument " "1"" of type '" "SSL const *""'"); } 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); + result = (int)SSL_pending((SSL const *)arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } 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) { +SWIGINTERN PyObject *_wrap_ssl_get_peer_cert(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 ; + PyObject *swig_obj[1] ; + X509 *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_peer_cert" "', argument " "1"" of type '" "SSL const *""'"); } 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(); + 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_set_session_id_context(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_current_cipher(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; + PyObject *swig_obj[1] ; + SSL_CIPHER *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_current_cipher" "', argument " "1"" of type '" "SSL const *""'"); } 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; - } + 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_set_fd(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_verify_mode(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 *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_mode" "', 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_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); + result = (int)SSL_get_verify_mode((SSL const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -20969,195 +21526,182 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_set_shutdown1(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_verify_depth(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 *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_depth" "', 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_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(); + 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_read_nbio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_verify_result(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 ; + PyObject *swig_obj[1] ; + long result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_result" "', 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_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; - } + result = (long)SSL_get_verify_result((SSL const *)arg1); + resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_write_nbio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_ssl_ctx(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; + PyObject *swig_obj[1] ; + SSL_CTX *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_ssl_ctx" "', argument " "1"" of type '" "SSL const *""'"); } 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; - } + 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_cipher_get_bits(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_default_session_timeout(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + long 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_cipher_get_bits" "', argument " "1"" of type '" "SSL_CIPHER *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_default_session_timeout" "', argument " "1"" of type '" "SSL const *""'"); } - arg1 = (SSL_CIPHER *)(argp1); + arg1 = (SSL *)(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; - } + result = (long)SSL_get_default_timeout((SSL const *)arg1); + resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_ssl_cipher_num(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_cipher_list(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_SSL_CIPHER *arg1 = (struct stack_st_SSL_CIPHER *) 0 ; + SSL *arg1 = (SSL *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_set_cipher_list", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_cipher_list" "', argument " "1"" of type '" "SSL *""'"); } - arg1 = (struct stack_st_SSL_CIPHER *)(argp1); + arg1 = (SSL *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &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)sk_ssl_cipher_num(arg1); + 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_sk_ssl_cipher_value(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_cipher_list(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_SSL_CIPHER *arg1 = (struct stack_st_SSL_CIPHER *) 0 ; + SSL *arg1 = (SSL *) 0 ; int arg2 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - SSL_CIPHER *result = 0 ; + PyObject *swig_obj[2] ; + char *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_Python_UnpackTuple(args, "ssl_get_cipher_list", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_cipher_list" "', argument " "1"" of type '" "SSL const *""'"); } - arg1 = (struct stack_st_SSL_CIPHER *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + arg1 = (SSL *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_ssl_cipher_value" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_get_cipher_list" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); { @@ -21165,127 +21709,146 @@ SWIGINTERN PyObject *_wrap_sk_ssl_cipher_value(PyObject *self, PyObject *args) { 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 ); + 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_get_peer_cert_chain(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_cipher_get_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL *arg1 = (SSL *) 0 ; + SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - struct stack_st_X509 *result = 0 ; + PyObject *swig_obj[1] ; + char *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_peer_cert_chain" "', argument " "1"" of type '" "SSL *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_cipher_get_name" "', argument " "1"" of type '" "SSL_CIPHER const *""'"); } - arg1 = (SSL *)(argp1); + arg1 = (SSL_CIPHER *)(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 ); + result = (char *)SSL_CIPHER_get_name((SSL_CIPHER const *)arg1); + resultobj = SWIG_FromCharPtr((const char *)result); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_x509_num(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_cipher_get_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; + SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + char *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CIPHER, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_cipher_get_version" "', argument " "1"" of type '" "SSL_CIPHER const *""'"); } - arg1 = (struct stack_st_X509 *)(argp1); + arg1 = (SSL_CIPHER *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)sk_x509_num(arg1); + 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 *swig_obj[1] ; + SSL_SESSION *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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_sk_x509_value(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get1_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; - int arg2 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - X509 *result = 0 ; + PyObject *swig_obj[1] ; + SSL_SESSION *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get1_session" "', argument " "1"" of type '" "SSL *""'"); } - 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); + arg1 = (SSL *)(argp1); { 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 ); + 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_i2d_ssl_session(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 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 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "ssl_set_session", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_ssl_session" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_session" "', argument " "1"" of type '" "SSL *""'"); } - arg1 = (BIO *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_SSL_SESSION, 0 | 0 ); + arg1 = (SSL *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_session" "', argument " "2"" of type '" "SSL_SESSION *""'"); } arg2 = (SSL_SESSION *)(argp2); { @@ -21293,11 +21856,32 @@ SWIGINTERN PyObject *_wrap_i2d_ssl_session(PyObject *self, PyObject *args) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (int)SSL_set_session(arg1,arg2); { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - i2d_ssl_session(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_session_free(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + SSL_SESSION *arg1 = (SSL_SESSION *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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: @@ -21305,20 +21889,28 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_session_read_pem(PyObject *self, PyObject *args) { +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 ; - PyObject * obj0 = 0 ; - SSL_SESSION *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "ssl_session_print", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_print" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); @@ -21326,18 +21918,12 @@ SWIGINTERN PyObject *_wrap_ssl_session_read_pem(PyObject *self, PyObject *args) } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (SSL_SESSION *)ssl_session_read_pem(arg1); + result = (int)SSL_SESSION_print(arg1,(SSL_SESSION const *)arg2); 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; - } + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -21345,81 +21931,91 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_session_write_pem(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_session_set_timeout(PyObject *self, PyObject *args) { PyObject *resultobj = 0; SSL_SESSION *arg1 = (SSL_SESSION *) 0 ; - BIO *arg2 = (BIO *) 0 ; + long arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + long 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_Python_UnpackTuple(args, "ssl_session_set_timeout", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_set_timeout" "', 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; + ecode2 = SWIG_AsVal_long(swig_obj[1], &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 *swig_obj[1] ; + long result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_ctx_set_session_cache_mode(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_accept(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - int arg2 ; + SSL *arg1 = (SSL *) 0 ; + double arg2 = (double) -1 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; + double val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[2] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "ssl_accept", 1, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_accept" "', argument " "1"" of type '" "SSL *""'"); + } + arg1 = (SSL *)(argp1); + if (swig_obj[1]) { + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_accept" "', argument " "2"" of type '" "double""'"); + } + arg2 = (double)(val2); } - 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); + result = (PyObject *)ssl_accept(arg1,arg2); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -21427,29 +22023,38 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_get_session_cache_mode(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_connect(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; + SSL *arg1 = (SSL *) 0 ; + double arg2 = (double) -1 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + double val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "ssl_connect", 1, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_connect" "', argument " "1"" of type '" "SSL *""'"); + } + arg1 = (SSL *)(argp1); + if (swig_obj[1]) { + ecode2 = SWIG_AsVal_double(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_connect" "', argument " "2"" of type '" "double""'"); + } + arg2 = (double)(val2); } - arg1 = (SSL_CTX *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)ssl_ctx_get_session_cache_mode(arg1); + result = (PyObject *)ssl_connect(arg1,arg2); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -21457,62 +22062,87 @@ fail: } -SWIGINTERN PyObject *_wrap_ssl_ctx_set_cache_size(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_read(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - SSL_CTX *arg1 = (SSL_CTX *) 0 ; - long arg2 ; + SSL *arg1 = (SSL *) 0 ; + int arg2 ; + double arg3 = (double) -1 ; void *argp1 = 0 ; int res1 = 0 ; - long val2 ; + int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - long result; + double val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "ssl_read", 2, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_read" "', argument " "1"" of type '" "SSL *""'"); } - arg1 = (SSL_CTX *)(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); + arg1 = (SSL *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_cache_size" "', argument " "2"" of type '" "long""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_read" "', argument " "2"" of type '" "int""'"); } - arg2 = (long)(val2); + arg2 = (int)(val2); + if (swig_obj[2]) { + ecode3 = SWIG_AsVal_double(swig_obj[2], &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 = (long)ssl_ctx_set_cache_size(arg1,arg2); - resultobj = SWIG_From_long((long)(result)); + result = (PyObject *)ssl_read(arg1,arg2,arg3); + { + resultobj=result; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ssl_is_init_finished(PyObject *self, PyObject *args) { +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 ; - PyObject * obj0 = 0 ; + double val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "ssl_write", 2, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_write" "', argument " "1"" of type '" "SSL *""'"); } arg1 = (SSL *)(argp1); + { + arg2=swig_obj[1]; + } + if (swig_obj[2]) { + ecode3 = SWIG_AsVal_double(swig_obj[2], &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_is_init_finished(arg1); + result = (int)ssl_write(arg1,arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -21523,160 +22153,149 @@ fail: } -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 *""'"); +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); } - arg1 = (X509 *)(argp1); + 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) { { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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); } - result = (int)X509_check_ca(arg1); + 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 *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ssl_init", 2, 2, swig_obj)) SWIG_fail; { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + arg1=swig_obj[0]; } + { + arg2=swig_obj[1]; + } + ssl_init(arg1,arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_tlsv1_method(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *result = 0 ; + SSL_METHOD *result = 0 ; - result = (X509 *)X509_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "tlsv1_method", 0, 0, 0)) SWIG_fail; + 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_x509_dup(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_passphrase_callback(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - X509 *result = 0 ; + PyObject *swig_obj[2] ; - if(!PyArg_UnpackTuple(args,(char *)"x509_dup",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_passphrase_callback", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_dup" "', argument " "1"" of type '" "X509 *""'"); + 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(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg2=swig_obj[1]; } - 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 ); + { + 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_x509_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_use_x509(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 ; + 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_ctx_use_x509", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_print" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_x509" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (BIO *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); + arg1 = (SSL_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_x509" "', argument " "2"" of type '" "X509 *""'"); } arg2 = (X509 *)(argp2); { @@ -21684,16 +22303,7 @@ SWIGINTERN PyObject *_wrap_x509_print(PyObject *self, PyObject *args) { 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; - } + result = (int)ssl_ctx_use_x509(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -21704,168 +22314,192 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_crl_print(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_use_cert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - X509_CRL *arg2 = (X509_CRL *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_ctx_use_cert", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_crl_print" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_cert" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (BIO *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_CRL, 0 | 0 ); + arg1 = (SSL_CTX *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_crl_print" "', argument " "2"" of type '" "X509_CRL *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_cert" "', argument " "2"" of type '" "char *""'"); } - arg2 = (X509_CRL *)(argp2); + arg2 = (char *)(buf2); { 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; - } + 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_x509_get_serial_number(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_use_cert_chain(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - ASN1_INTEGER *result = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "ssl_ctx_use_cert_chain", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_serial_number" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_cert_chain" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509 *)(argp1); + arg1 = (SSL_CTX *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &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 = (ASN1_INTEGER *)X509_get_serialNumber(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); + 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_x509_set_serial_number(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_use_privkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - ASN1_INTEGER *arg2 = (ASN1_INTEGER *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_ctx_use_privkey", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_serial_number" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_privkey" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509 *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); + arg1 = (SSL_CTX *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_serial_number" "', argument " "2"" of type '" "ASN1_INTEGER *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_privkey" "', argument " "2"" of type '" "char *""'"); } - arg2 = (ASN1_INTEGER *)(argp2); + arg2 = (char *)(buf2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)X509_set_serialNumber(arg1,arg2); + 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_x509_get_pubkey(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_use_rsa_privkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + RSA *arg2 = (RSA *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - EVP_PKEY *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "ssl_ctx_use_rsa_privkey", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_pubkey" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_rsa_privkey" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509 *)(argp1); + arg1 = (SSL_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (EVP_PKEY *)X509_get_pubkey(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_PKEY, 0 | 0 ); + { + 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_x509_set_pubkey(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_use_pkey_privkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_ctx_use_pkey_privkey", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_pubkey" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_pkey_privkey" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509 *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); + arg1 = (SSL_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_pkey_privkey" "', argument " "2"" of type '" "EVP_PKEY *""'"); } arg2 = (EVP_PKEY *)(argp2); { @@ -21878,7 +22512,7 @@ SWIGINTERN PyObject *_wrap_x509_set_pubkey(PyObject *self, PyObject *args) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)X509_set_pubkey(arg1,arg2); + result = (int)ssl_ctx_use_pkey_privkey(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -21889,163 +22523,179 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_get_issuer_name(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_check_privkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - X509_NAME *result = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_issuer_name" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_check_privkey" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509 *)(argp1); + arg1 = (SSL_CTX *)(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 ); + result = (int)ssl_ctx_check_privkey(arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_set_issuer_name(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_client_CA_list_from_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - X509_NAME *arg2 = (X509_NAME *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "ssl_ctx_set_client_CA_list_from_file", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_issuer_name" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_client_CA_list_from_file" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509 *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_NAME, 0 | 0 ); + arg1 = (SSL_CTX *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_issuer_name" "', argument " "2"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_client_CA_list_from_file" "', argument " "2"" of type '" "char const *""'"); } - arg2 = (X509_NAME *)(argp2); + arg2 = (char *)(buf2); { 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; - } + 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_x509_get_subject_name(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify_default(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + int arg2 ; 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 ); + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + + if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_verify_default", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_subject_name" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_verify_default" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509 *)(argp1); + arg1 = (SSL_CTX *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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."); } } - result = (X509_NAME *)X509_get_subject_name(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 | 0 ); + ssl_ctx_set_verify_default(arg1,arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_set_subject_name(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - X509_NAME *arg2 = (X509_NAME *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + int arg2 ; + PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[3] ; - 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_Python_UnpackTuple(args, "ssl_ctx_set_verify", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_subject_name" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_verify" "', argument " "1"" of type '" "SSL_CTX *""'"); } - 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 *""'"); + arg1 = (SSL_CTX *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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(swig_obj[2])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg3=swig_obj[2]; } - arg2 = (X509_NAME *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } { - if (!arg2) { + if (!arg3) { 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; - } + ssl_ctx_set_verify(arg1,arg2,arg3); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_cmp_current_time(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_session_id_context(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_ctx_set_session_id_context", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_cmp_current_time" "', argument " "1"" of type '" "ASN1_TIME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_session_id_context" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (ASN1_TIME *)(argp1); - result = (int)X509_cmp_current_time(arg1); + arg1 = (SSL_CTX *)(argp1); + { + arg2=swig_obj[1]; + } + { + 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; @@ -22056,125 +22706,106 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_check_purpose(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_info_callback(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - int arg2 ; - int arg3 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; 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; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "ssl_ctx_set_info_callback", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_purpose" "', argument " "1"" of type '" "X509 *""'"); + 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(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg2=swig_obj[1]; } - 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; + 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_x509_check_trust(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_dh(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - int arg2 ; - int arg3 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + DH *arg2 = (DH *) 0 ; 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; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + long 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_Python_UnpackTuple(args, "ssl_ctx_set_tmp_dh", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_trust" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_dh" "', argument " "1"" of type '" "SSL_CTX *""'"); } - 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); + arg1 = (SSL_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (int)X509_check_trust(arg1,arg2,arg3); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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_x509_write_pem(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_dh_callback(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - X509 *arg2 = (X509 *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "ssl_ctx_set_tmp_dh_callback", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_write_pem" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_dh_callback" "', argument " "1"" of type '" "SSL_CTX *""'"); } - 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 *""'"); + arg1 = (SSL_CTX *)(argp1); + { + if (!PyCallable_Check(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg2=swig_obj[1]; } - arg2 = (X509 *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); @@ -22185,83 +22816,75 @@ SWIGINTERN PyObject *_wrap_x509_write_pem(PyObject *self, PyObject *args) { 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; - } + ssl_ctx_set_tmp_dh_callback(arg1,arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_write_pem_file(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_rsa(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - FILE *arg1 = (FILE *) 0 ; - X509 *arg2 = (X509 *) 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; + PyObject *swig_obj[2] ; + long 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_Python_UnpackTuple(args, "ssl_ctx_set_tmp_rsa", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_write_pem_file" "', argument " "1"" of type '" "FILE *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_rsa" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (FILE *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); + arg1 = (SSL_CTX *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_RSA, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_write_pem_file" "', argument " "2"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_tmp_rsa" "', argument " "2"" of type '" "RSA *""'"); } - arg2 = (X509 *)(argp2); + arg2 = (RSA *)(argp2); { - if (!arg2) { + if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)PEM_write_X509(arg1,arg2); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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_x509_verify(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_rsa_callback(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "ssl_ctx_set_tmp_rsa_callback", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_verify" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_rsa_callback" "', argument " "1"" of type '" "SSL_CTX *""'"); } - 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 *""'"); + arg1 = (SSL_CTX *)(argp1); + { + if (!PyCallable_Check(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg2=swig_obj[1]; } - arg2 = (EVP_PKEY *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); @@ -22272,204 +22895,142 @@ SWIGINTERN PyObject *_wrap_x509_verify(PyObject *self, PyObject *args) { 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); + ssl_ctx_set_tmp_rsa_callback(arg1,arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_add_ext(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_load_verify_locations(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - X509_EXTENSION *arg2 = (X509_EXTENSION *) 0 ; - int arg3 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + char *arg2 = (char *) 0 ; + char *arg3 = (char *) 0 ; 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 res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "ssl_ctx_load_verify_locations", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_add_ext" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_load_verify_locations" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509 *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); + arg1 = (SSL_CTX *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); 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; + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_load_verify_locations" "', argument " "2"" of type '" "char const *""'"); } - 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 *""'"); + arg2 = (char *)(buf2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &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 *""'"); } - arg1 = (X509 *)(argp1); + arg3 = (char *)(buf3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)X509_get_ext_count(arg1); + 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_x509_get_ext(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_options(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - int arg2 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + long arg2 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; + long val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - X509_EXTENSION *result = 0 ; + PyObject *swig_obj[2] ; + long result; - 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_Python_UnpackTuple(args, "ssl_ctx_set_options", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_ext" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_options" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509 *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + arg1 = (SSL_CTX *)(argp1); + ecode2 = SWIG_AsVal_long(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_get_ext" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_options" "', argument " "2"" of type '" "long""'"); } - arg2 = (int)(val2); + arg2 = (long)(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 ); + result = (long)ssl_ctx_set_options(arg1,arg2); + resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_ext_print(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_bio_set_ssl(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; - X509_EXTENSION *arg2 = (X509_EXTENSION *) 0 ; - unsigned long arg3 ; - int arg4 ; + SSL *arg2 = (SSL *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - unsigned long val3 ; + int val3 ; int ecode3 = 0 ; - int val4 ; - int ecode4 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - PyObject * obj3 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "bio_set_ssl", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + 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_X509_EXTENSION, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_ext_print" "', argument " "2"" of type '" "X509_EXTENSION *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_set_ssl" "', argument " "2"" of type '" "SSL *""'"); } - arg2 = (X509_EXTENSION *)(argp2); - ecode3 = SWIG_AsVal_unsigned_SS_long(obj2, &val3); + arg2 = (SSL *)(argp2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &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""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bio_set_ssl" "', argument " "3"" of type '" "int""'"); } - arg4 = (int)(val4); + arg3 = (int)(val3); { 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; + 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; @@ -22480,255 +23041,248 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_name_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_mode(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *result = 0 ; + SSL *arg1 = (SSL *) 0 ; + long arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + long result; - result = (X509_NAME *)X509_NAME_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "ssl_set_mode", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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_x509_name_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_mode(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *arg1 = (X509_NAME *) 0 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + long result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_free" "', argument " "1"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_mode" "', argument " "1"" of type '" "SSL *""'"); } - arg1 = (X509_NAME *)(argp1); + arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - X509_NAME_free(arg1); - resultobj = SWIG_Py_Void(); + result = (long)ssl_get_mode(arg1); + resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_name_print(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_tlsext_host_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - X509_NAME *arg2 = (X509_NAME *) 0 ; - int arg3 ; + SSL *arg1 = (SSL *) 0 ; + char *arg2 = (char *) 0 ; 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 res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_set_tlsext_host_name", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_print" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_tlsext_host_name" "', argument " "1"" of type '" "SSL *""'"); } - arg1 = (BIO *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_NAME, 0 | 0 ); + arg1 = (SSL *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_print" "', argument " "2"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_tlsext_host_name" "', argument " "2"" of type '" "char const *""'"); } - 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); + arg2 = (char *)(buf2); { 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; - } + 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_x509_name_get_entry(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_client_CA_list_from_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *arg1 = (X509_NAME *) 0 ; - int arg2 ; + SSL *arg1 = (SSL *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - X509_NAME_ENTRY *result = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "ssl_set_client_CA_list_from_file", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_entry" "', argument " "1"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_client_CA_list_from_file" "', argument " "1"" of type '" "SSL *""'"); } - 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); + arg1 = (SSL *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &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."); } } - result = (X509_NAME_ENTRY *)X509_NAME_get_entry(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); + 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_x509_name_entry_count(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_client_CA_list_from_context(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *arg1 = (X509_NAME *) 0 ; + SSL *arg1 = (SSL *) 0 ; + SSL_CTX *arg2 = (SSL_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "ssl_set_client_CA_list_from_context", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_count" "', argument " "1"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_client_CA_list_from_context" "', argument " "1"" of type '" "SSL *""'"); } - arg1 = (X509_NAME *)(argp1); + arg1 = (SSL *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (int)X509_NAME_entry_count(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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_x509_name_delete_entry(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_session_id_context(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *arg1 = (X509_NAME *) 0 ; - int arg2 ; + SSL *arg1 = (SSL *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - X509_NAME_ENTRY *result = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "ssl_set_session_id_context", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_delete_entry" "', argument " "1"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_session_id_context" "', argument " "1"" of type '" "SSL *""'"); + } + arg1 = (SSL *)(argp1); + { + arg2=swig_obj[1]; } - 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 ); + 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_x509_name_add_entry(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_fd(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 ; + SSL *arg1 = (SSL *) 0 ; + int arg2 ; 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 val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_set_fd", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_fd" "', argument " "1"" of type '" "SSL *""'"); } - 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""'"); + arg1 = (SSL *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_fd" "', argument " "2"" of type '" "int""'"); } - arg4 = (int)(val4); + arg2 = (int)(val2); { 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); + result = (int)ssl_set_fd(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -22739,167 +23293,70 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_obj(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_set_shutdown1(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 ; + SSL *arg1 = (SSL *) 0 ; + int arg2 ; 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; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "ssl_set_shutdown1", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_shutdown1" "', argument " "1"" of type '" "SSL *""'"); } - 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""'"); + arg1 = (SSL *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_shutdown1" "', argument " "2"" of type '" "int""'"); } - arg7 = (int)(val7); + arg2 = (int)(val2); { 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; - } + ssl_set_shutdown1(arg1,arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_nid(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_read_nbio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *arg1 = (X509_NAME *) 0 ; + SSL *arg1 = (SSL *) 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; + PyObject *swig_obj[2] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "ssl_read_nbio", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_read_nbio" "', argument " "1"" of type '" "SSL *""'"); } - arg1 = (X509_NAME *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + arg1 = (SSL *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_add_entry_by_nid" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_read_nbio" "', 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); + result = (PyObject *)ssl_read_nbio(arg1,arg2); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -22907,62 +23364,30 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_name_print_ex(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_write_nbio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - X509_NAME *arg2 = (X509_NAME *) 0 ; - int arg3 ; - unsigned long arg4 ; + SSL *arg1 = (SSL *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_write_nbio", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_write_nbio" "', argument " "1"" of type '" "SSL *""'"); } - 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); + arg1 = (SSL *)(argp1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg2=swig_obj[1]; } { - if (!arg2) { + if (!arg1) { 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; - } + result = (int)ssl_write_nbio(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -22973,71 +23398,58 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_name_hash(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_cipher_get_bits(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *arg1 = (X509_NAME *) 0 ; + SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - unsigned long result; + PyObject *swig_obj[1] ; + int 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CIPHER, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_hash" "', argument " "1"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_cipher_get_bits" "', argument " "1"" of type '" "SSL_CIPHER *""'"); } - arg1 = (X509_NAME *)(argp1); + arg1 = (SSL_CIPHER *)(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)); + result = (int)ssl_cipher_get_bits(arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_name_get_index_by_nid(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_ssl_cipher_num(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *arg1 = (X509_NAME *) 0 ; - int arg2 ; - int arg3 ; + struct stack_st_SSL_CIPHER *arg1 = (struct stack_st_SSL_CIPHER *) 0 ; 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 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_SSL_CIPHER, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_ssl_cipher_num" "', argument " "1"" of type '" "struct stack_st_SSL_CIPHER *""'"); } - 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); + arg1 = (struct stack_st_SSL_CIPHER *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)X509_NAME_get_index_by_NID(arg1,arg2,arg3); + result = (int)sk_ssl_cipher_num(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -23048,245 +23460,284 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_name_entry_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_ssl_cipher_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME_ENTRY *result = 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 *swig_obj[2] ; + SSL_CIPHER *result = 0 ; - result = (X509_NAME_ENTRY *)X509_NAME_ENTRY_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "sk_ssl_cipher_value", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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_x509_name_entry_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_get_peer_cert_chain(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + struct stack_st_X509 *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_peer_cert_chain" "', argument " "1"" of type '" "SSL *""'"); } - arg1 = (X509_NAME_ENTRY *)(argp1); + arg1 = (SSL *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - X509_NAME_ENTRY_free(arg1); - resultobj = SWIG_Py_Void(); + 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_x509_name_entry_create_by_nid(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_x509_num(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME_ENTRY **arg1 = (X509_NAME_ENTRY **) 0 ; + struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 ; - 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 ; + PyObject *swig_obj[2] ; + X509 *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_Python_UnpackTuple(args, "sk_x509_value", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 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 **""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_value" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } - arg1 = (X509_NAME_ENTRY **)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + arg1 = (struct stack_st_X509 *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_entry_create_by_nid" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_x509_value" "', 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 *""'"); + { + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - 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 ); + 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_x509_name_entry_set_object(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_i2d_ssl_session(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; - ASN1_OBJECT *arg2 = (ASN1_OBJECT *) 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; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "i2d_ssl_session", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_ssl_session" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (X509_NAME_ENTRY *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL_SESSION, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "i2d_ssl_session" "', argument " "2"" of type '" "SSL_SESSION *""'"); } - arg2 = (ASN1_OBJECT *)(argp2); + arg2 = (SSL_SESSION *)(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; + 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_x509_name_entry_get_object(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_session_read_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; + BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - ASN1_OBJECT *result = 0 ; + PyObject *swig_obj[1] ; + SSL_SESSION *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_read_pem" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (X509_NAME_ENTRY *)(argp1); + arg1 = (BIO *)(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 ); + { + 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_x509_name_entry_get_data(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_session_write_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; + SSL_SESSION *arg1 = (SSL_SESSION *) 0 ; + BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - ASN1_STRING *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "ssl_session_write_pem", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_SESSION, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_write_pem" "', argument " "1"" of type '" "SSL_SESSION *""'"); } - arg1 = (X509_NAME_ENTRY *)(argp1); + arg1 = (SSL_SESSION *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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 (!arg1) { + if (!arg2) { 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 ); + { + 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_x509_name_entry_set_data(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_session_cache_mode(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "ssl_ctx_set_session_cache_mode", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_session_cache_mode" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509_NAME_ENTRY *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + arg1 = (SSL_CTX *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_entry_set_data" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_session_cache_mode" "', 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); + result = (int)ssl_ctx_set_session_cache_mode(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -23297,82 +23748,93 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_req_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_get_session_cache_mode(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_REQ *result = 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; - result = (X509_REQ *)X509_REQ_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_REQ, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_x509_req_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_ctx_set_cache_size(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_REQ *arg1 = (X509_REQ *) 0 ; + SSL_CTX *arg1 = (SSL_CTX *) 0 ; + long arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + long result; - 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_Python_UnpackTuple(args, "ssl_ctx_set_cache_size", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_free" "', argument " "1"" of type '" "X509_REQ *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_cache_size" "', argument " "1"" of type '" "SSL_CTX *""'"); } - arg1 = (X509_REQ *)(argp1); + arg1 = (SSL_CTX *)(argp1); + ecode2 = SWIG_AsVal_long(swig_obj[1], &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."); } } - X509_REQ_free(arg1); - resultobj = SWIG_Py_Void(); + result = (long)ssl_ctx_set_cache_size(arg1,arg2); + resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_req_print(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ssl_is_init_finished(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - X509_REQ *arg2 = (X509_REQ *) 0 ; + SSL *arg1 = (SSL *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_is_init_finished" "', argument " "1"" of type '" "SSL *""'"); } - arg2 = (X509_REQ *)(argp2); + arg1 = (SSL *)(argp1); { 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; - } + result = (int)ssl_is_init_finished(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -23383,224 +23845,146 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_req_get_pubkey(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_check_ca(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_REQ *arg1 = (X509_REQ *) 0 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - EVP_PKEY *result = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_get_pubkey" "', argument " "1"" of type '" "X509_REQ *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_ca" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (X509_REQ *)(argp1); + arg1 = (X509 *)(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 ); + result = (int)X509_check_ca(arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_req_set_pubkey(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_new(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; + X509 *result = 0 ; - 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; - } + if (!SWIG_Python_UnpackTuple(args, "x509_new", 0, 0, 0)) SWIG_fail; + 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_req_set_subject_name(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_dup(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_REQ *arg1 = (X509_REQ *) 0 ; - X509_NAME *arg2 = (X509_NAME *) 0 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[1] ; + X509 *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_dup" "', argument " "1"" of type '" "X509 *""'"); } - arg2 = (X509_NAME *)(argp2); + arg1 = (X509 *)(argp1); { 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; - } + 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_req_verify(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_REQ *arg1 = (X509_REQ *) 0 ; - EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_free" "', argument " "1"" of type '" "X509 *""'"); } - arg2 = (EVP_PKEY *)(argp2); + arg1 = (X509 *)(argp1); { 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; - } + X509_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_req_sign(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_crl_free(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 ; + X509_CRL *arg1 = (X509_CRL *) 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; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_CRL, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_crl_free" "', argument " "1"" of type '" "X509_CRL *""'"); } - arg3 = (EVP_MD *)(argp3); + arg1 = (X509_CRL *)(argp1); { 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; - } + X509_CRL_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_i2d_x509_bio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_crl_new(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + X509_CRL *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "x509_crl_new", 0, 0, 0)) SWIG_fail; + 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 ; @@ -23608,19 +23992,18 @@ SWIGINTERN PyObject *_wrap_i2d_x509_bio(PyObject *self, PyObject *args) { int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "x509_print", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + 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 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_print" "', argument " "2"" of type '" "X509 *""'"); } arg2 = (X509 *)(argp2); { @@ -23635,7 +24018,7 @@ SWIGINTERN PyObject *_wrap_i2d_x509_bio(PyObject *self, PyObject *args) { } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)i2d_X509_bio(arg1,arg2); + result = (int)X509_print(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { @@ -23648,29 +24031,28 @@ fail: } -SWIGINTERN PyObject *_wrap_i2d_x509_req_bio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_crl_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; - X509_REQ *arg2 = (X509_REQ *) 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "x509_crl_print", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + 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_REQ, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_CRL, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "i2d_x509_req_bio" "', argument " "2"" of type '" "X509_REQ *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_crl_print" "', argument " "2"" of type '" "X509_CRL *""'"); } - arg2 = (X509_REQ *)(argp2); + arg2 = (X509_CRL *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); @@ -23683,7 +24065,7 @@ SWIGINTERN PyObject *_wrap_i2d_x509_req_bio(PyObject *self, PyObject *args) { } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)i2d_X509_REQ_bio(arg1,arg2); + result = (int)X509_CRL_print(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { @@ -23696,68 +24078,62 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_x509_get_serial_number(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_STORE *arg1 = (X509_STORE *) 0 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + ASN1_INTEGER *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_free" "', argument " "1"" of type '" "X509_STORE *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_serial_number" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (X509_STORE *)(argp1); - X509_STORE_free(arg1); - resultobj = SWIG_Py_Void(); + 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_store_add_cert(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_set_serial_number(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_STORE *arg1 = (X509_STORE *) 0 ; - X509 *arg2 = (X509 *) 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "x509_set_serial_number", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_add_cert" "', argument " "1"" of type '" "X509_STORE *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_serial_number" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (X509_STORE *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); + arg1 = (X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_store_add_cert" "', argument " "2"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_serial_number" "', argument " "2"" of type '" "ASN1_INTEGER *""'"); } - arg2 = (X509 *)(argp2); + arg2 = (ASN1_INTEGER *)(argp2); { - if (!arg2) { + if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)X509_STORE_add_cert(arg1,arg2); + result = (int)X509_set_serialNumber(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -23768,97 +24144,138 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_store_set_verify_cb__SWIG_0(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_get_pubkey(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 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; + EVP_PKEY *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_pubkey" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (X509_STORE *)(argp1); + arg1 = (X509 *)(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 *)""'"); + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - X509_STORE_set_verify_cb(arg1,arg2); - resultobj = SWIG_Py_Void(); + 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_store_ctx_get_current_cert(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_set_pubkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; + X509 *arg1 = (X509 *) 0 ; + EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - X509 *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "x509_set_pubkey", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_pubkey" "', argument " "1"" of type '" "X509 *""'"); + } + arg1 = (X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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; } - 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) { +SWIGINTERN PyObject *_wrap_x509_get_issuer_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + X509_NAME *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_issuer_name" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (X509_STORE_CTX *)(argp1); - result = (int)X509_STORE_CTX_get_error(arg1); + arg1 = (X509 *)(argp1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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_store_ctx_get_error_depth(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_set_issuer_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; + X509 *arg1 = (X509 *) 0 ; + X509_NAME *arg2 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "x509_set_issuer_name", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_issuer_name" "', argument " "1"" of type '" "X509 *""'"); + } + arg1 = (X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); + } } - arg1 = (X509_STORE_CTX *)(argp1); - result = (int)X509_STORE_CTX_get_error_depth(arg1); + { + 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; @@ -23869,64 +24286,93 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_store_ctx_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_get_subject_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + X509_NAME *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_subject_name" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (X509_STORE_CTX *)(argp1); - X509_STORE_CTX_free(arg1); - resultobj = SWIG_Py_Void(); + 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_store_ctx_get1_chain(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_set_subject_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; + X509 *arg1 = (X509 *) 0 ; + X509_NAME *arg2 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - struct stack_st_X509 *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "x509_set_subject_name", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_subject_name" "', argument " "1"" of type '" "X509 *""'"); + } + arg1 = (X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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; } - 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) { +SWIGINTERN PyObject *_wrap_x509_cmp_current_time(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; + ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_get_critical" "', argument " "1"" of type '" "X509_EXTENSION *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_cmp_current_time" "', argument " "1"" of type '" "ASN1_TIME *""'"); } - arg1 = (X509_EXTENSION *)(argp1); - result = (int)X509_EXTENSION_get_critical(arg1); + arg1 = (ASN1_TIME *)(argp1); + result = (int)X509_cmp_current_time(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -23937,30 +24383,42 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_extension_set_critical(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_check_purpose(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; + X509 *arg1 = (X509 *) 0 ; int arg2 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "x509_check_purpose", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_set_critical" "', argument " "1"" of type '" "X509_EXTENSION *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_purpose" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (X509_EXTENSION *)(argp1); - ecode2 = SWIG_AsVal_int(obj1, &val2); + arg1 = (X509 *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_extension_set_critical" "', argument " "2"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_check_purpose" "', argument " "2"" of type '" "int""'"); } arg2 = (int)(val2); - result = (int)X509_EXTENSION_set_critical(arg1,arg2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &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; @@ -23971,30 +24429,42 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_store_set_flags(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_check_trust(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_STORE *arg1 = (X509_STORE *) 0 ; - unsigned long arg2 ; + X509 *arg1 = (X509 *) 0 ; + int arg2 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - unsigned long val2 ; + int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; int result; - if(!PyArg_UnpackTuple(args,(char *)"x509_store_set_flags",2,2,&obj0,&obj1)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_X509_STORE, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "x509_check_trust", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_set_flags" "', argument " "1"" of type '" "X509_STORE *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_trust" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (X509_STORE *)(argp1); - ecode2 = SWIG_AsVal_unsigned_SS_long(obj1, &val2); + arg1 = (X509 *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_store_set_flags" "', argument " "2"" of type '" "unsigned long""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_check_trust" "', argument " "2"" of type '" "int""'"); } - arg2 = (unsigned long)(val2); - result = (int)X509_STORE_set_flags(arg1,arg2); + arg2 = (int)(val2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &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; @@ -24005,39 +24475,46 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_read_pem(PyObject *self, PyObject *args) { +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 ; - PyObject * obj0 = 0 ; - X509 *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "x509_write_pem", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_write_pem" "', argument " "1"" of type '" "BIO *""'"); } arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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 = (X509 *)x509_read_pem(arg1); + result = (int)PEM_write_bio_X509(arg1,arg2); 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; - } + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -24045,39 +24522,37 @@ fail: } -SWIGINTERN PyObject *_wrap_d2i_x509(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_write_pem_file(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + FILE *arg1 = (FILE *) 0 ; + X509 *arg2 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - X509 *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"d2i_x509",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "x509_write_pem_file", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_FILE, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "d2i_x509" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_write_pem_file" "', argument " "1"" of type '" "FILE *""'"); } - arg1 = (BIO *)(argp1); - { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg1 = (FILE *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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); { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (X509 *)d2i_x509(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; + if (!arg2) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } + result = (int)PEM_write_X509(arg1,arg2); { - 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; - } + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -24085,81 +24560,111 @@ fail: } -SWIGINTERN int Swig_var__x509_err_set(PyObject *_val) { +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 *swig_obj[2] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "x509_verify", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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); { - 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 *""'"); + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } - _x509_err = (PyObject *)(argp); } - return 0; + { + 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 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; + return NULL; } -SWIGINTERN PyObject *_wrap_x509_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_get_verify_error(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; + long arg1 ; + long val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + char *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"x509_init",1,1,&obj0)) SWIG_fail; - { - arg1=obj0; - } - x509_init(arg1); - resultobj = SWIG_Py_Void(); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_long(swig_obj[0], &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_d2i_x509_req(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_add_ext(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + X509 *arg1 = (X509 *) 0 ; + X509_EXTENSION *arg2 = (X509_EXTENSION *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - X509_REQ *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + int result; - 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_Python_UnpackTuple(args, "x509_add_ext", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "d2i_x509_req" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_add_ext" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (BIO *)(argp1); + arg1 = (X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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); { - 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; - } + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -24167,39 +24672,30 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_req_read_pem(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_get_ext_count(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - X509_REQ *result = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_read_pem" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_ext_count" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (BIO *)(argp1); + arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (int)X509_get_ext_count(arg1); { - 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; - } + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -24207,71 +24703,87 @@ fail: } -SWIGINTERN PyObject *_wrap_i2d_x509(PyObject *self, PyObject *args) { +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 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + X509_EXTENSION *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_Python_UnpackTuple(args, "x509_get_ext", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_ext" "', argument " "1"" of type '" "X509 *""'"); } arg1 = (X509 *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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 = (PyObject *)i2d_x509(arg1); - { - resultobj=result; - } + 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_req_write_pem(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_ext_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; BIO *arg1 = (BIO *) 0 ; - X509_REQ *arg2 = (X509_REQ *) 0 ; + X509_EXTENSION *arg2 = (X509_EXTENSION *) 0 ; + unsigned long arg3 ; + int arg4 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + unsigned long val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; 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_Python_UnpackTuple(args, "x509_ext_print", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + 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_REQ, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_write_pem" "', argument " "2"" of type '" "X509_REQ *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_ext_print" "', argument " "2"" of type '" "X509_EXTENSION *""'"); } - arg2 = (X509_REQ *)(argp2); + arg2 = (X509_EXTENSION *)(argp2); + ecode3 = SWIG_AsVal_unsigned_SS_long(swig_obj[2], &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(swig_obj[3], &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."); } } - { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } - } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)x509_req_write_pem(arg1,arg2); + result = (int)X509V3_EXT_print(arg1,arg2,arg3,arg4); SWIG_PYTHON_THREAD_END_ALLOW; } { @@ -24284,75 +24796,91 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_crl_read_pem(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + X509_NAME *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "x509_name_new", 0, 0, 0)) SWIG_fail; + 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 ; - X509_CRL *result = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_crl_read_pem" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_free" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg1 = (BIO *)(argp1); + arg1 = (X509_NAME *)(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; - } - } + X509_NAME_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_set_version(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - long arg2 ; + BIO *arg1 = (BIO *) 0 ; + X509_NAME *arg2 = (X509_NAME *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "x509_name_print", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_version" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_print" "', argument " "1"" of type '" "BIO *""'"); } - 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""'"); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_print" "', argument " "3"" of type '" "int""'"); } - arg2 = (long)(val2); + arg3 = (int)(val3); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)x509_set_version(arg1,arg2); + { + 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; @@ -24363,62 +24891,62 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_get_version(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_get_entry(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; + X509_NAME *arg1 = (X509_NAME *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - long result; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + X509_NAME_ENTRY *result = 0 ; - 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_Python_UnpackTuple(args, "x509_name_get_entry", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_version" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_entry" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg1 = (X509 *)(argp1); + arg1 = (X509_NAME *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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 = (long)x509_get_version(arg1); - resultobj = SWIG_From_long((long)(result)); + 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_set_not_before(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_entry_count(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - ASN1_TIME *arg2 = (ASN1_TIME *) 0 ; + X509_NAME *arg1 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_count" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg2 = (ASN1_TIME *)(argp2); + arg1 = (X509_NAME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)x509_set_not_before(arg1,arg2); + result = (int)X509_NAME_entry_count(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -24429,62 +24957,90 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_get_not_before(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_delete_entry(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; + X509_NAME *arg1 = (X509_NAME *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - ASN1_TIME *result = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + X509_NAME_ENTRY *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_Python_UnpackTuple(args, "x509_name_delete_entry", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_not_before" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_delete_entry" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg1 = (X509 *)(argp1); + arg1 = (X509_NAME *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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 = (ASN1_TIME *)x509_get_not_before(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 | 0 ); + 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_set_not_after(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_add_entry(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - ASN1_TIME *arg2 = (ASN1_TIME *) 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 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + int val3 ; + int ecode3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; 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_Python_UnpackTuple(args, "x509_name_add_entry", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_not_after" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg1 = (X509 *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); + arg1 = (X509_NAME *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_not_after" "', argument " "2"" of type '" "ASN1_TIME *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_add_entry" "', argument " "2"" of type '" "X509_NAME_ENTRY *""'"); } - arg2 = (ASN1_TIME *)(argp2); + arg2 = (X509_NAME_ENTRY *)(argp2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &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(swig_obj[3], &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."); } } - result = (int)x509_set_not_after(arg1,arg2); + { + 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; @@ -24495,81 +25051,152 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_get_not_after(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_obj(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 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 ; - PyObject * obj0 = 0 ; - ASN1_TIME *result = 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 *swig_obj[7] ; + int result; - 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_Python_UnpackTuple(args, "x509_name_add_entry_by_obj", 7, 7, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_not_after" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry_by_obj" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg1 = (X509 *)(argp1); + arg1 = (X509_NAME *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3], &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(swig_obj[4], &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(swig_obj[5], &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(swig_obj[6], &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 = (ASN1_TIME *)x509_get_not_after(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 | 0 ); + 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_sign(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 0 ; - EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; - EVP_MD *arg3 = (EVP_MD *) 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 ; - void *argp2 = 0 ; - int res2 = 0 ; - void *argp3 = 0 ; - int res3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 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 *swig_obj[7] ; 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_Python_UnpackTuple(args, "x509_name_add_entry_by_nid", 7, 7, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry_by_nid" "', argument " "1"" of type '" "X509_NAME *""'"); } - 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 *""'"); + arg1 = (X509_NAME *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3], &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 *""'"); } - arg3 = (EVP_MD *)(argp3); + arg4 = (unsigned char *)(argp4); + ecode5 = SWIG_AsVal_int(swig_obj[4], &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(swig_obj[5], &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(swig_obj[6], &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."); } } - { - 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); + result = (int)X509_NAME_add_entry_by_NID(arg1,arg2,arg3,arg4,arg5,arg6,arg7); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -24580,68 +25207,62 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_gmtime_adj(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_print_ex(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 ; + BIO *arg1 = (BIO *) 0 ; + X509_NAME *arg2 = (X509_NAME *) 0 ; + int arg3 ; + unsigned long arg4 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + unsigned long val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; + int result; - 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_Python_UnpackTuple(args, "x509_name_print_ex", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_by_nid" "', argument " "1"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_print_ex" "', argument " "1"" of type '" "BIO *""'"); } - 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""'"); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_print_ex" "', argument " "3"" of type '" "int""'"); } - arg2 = (int)(val2); + arg3 = (int)(val3); + ecode4 = SWIG_AsVal_unsigned_SS_long(swig_obj[3], &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."); } } - result = (PyObject *)x509_name_by_nid(arg1,arg2); { - resultobj=result; + 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: @@ -24649,229 +25270,202 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_name_set_by_nid(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_hash(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; + PyObject *swig_obj[1] ; + unsigned long 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_hash" "', 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; - } + 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_add_entry_by_txt(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_get_index_by_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_NAME *arg1 = (X509_NAME *) 0 ; - char *arg2 = (char *) 0 ; + int arg2 ; 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 val2 ; + int ecode2 = 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 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "x509_name_get_index_by_nid", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_index_by_nid" "', 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); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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(swig_obj[2], &val3); if (!SWIG_IsOK(ecode3)) { - SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_add_entry_by_txt" "', argument " "3"" of type '" "int""'"); + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_get_index_by_nid" "', 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); + result = (int)X509_NAME_get_index_by_NID(arg1,arg2,arg3); { 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) { +SWIGINTERN PyObject *_wrap_x509_name_entry_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *arg1 = (X509_NAME *) 0 ; + X509_NAME_ENTRY *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "x509_name_entry_new", 0, 0, 0)) SWIG_fail; + 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 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_der" "', argument " "1"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_free" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'"); } - arg1 = (X509_NAME *)(argp1); + arg1 = (X509_NAME_ENTRY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)x509_name_get_der(arg1); - { - resultobj=result; - } + X509_NAME_ENTRY_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_sk_x509_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_entry_create_by_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 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 ; - PyObject * obj0 = 0 ; + int val2 ; + int ecode2 = 0 ; + int val3 ; + int ecode3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject *swig_obj[5] ; + X509_NAME_ENTRY *result = 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_Python_UnpackTuple(args, "x509_name_entry_create_by_nid", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_X509_NAME_ENTRY, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_create_by_nid" "', argument " "1"" of type '" "X509_NAME_ENTRY **""'"); } - arg1 = (struct stack_st_X509 *)(argp1); - { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg1 = (X509_NAME_ENTRY **)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3], &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 *""'"); } - sk_x509_free(arg1); - resultobj = SWIG_Py_Void(); + arg4 = (unsigned char *)(argp4); + ecode5 = SWIG_AsVal_int(swig_obj[4], &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_sk_x509_push(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_entry_set_object(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; - X509 *arg2 = (X509 *) 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "x509_name_entry_set_object", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_set_object" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'"); } - arg1 = (struct stack_st_X509 *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509, 0 | 0 ); + arg1 = (X509_NAME_ENTRY *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_x509_push" "', argument " "2"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_entry_set_object" "', argument " "2"" of type '" "ASN1_OBJECT *""'"); } - arg2 = (X509 *)(argp2); + arg2 = (ASN1_OBJECT *)(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); + result = (int)X509_NAME_ENTRY_set_object(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -24882,90 +25476,110 @@ fail: } -SWIGINTERN PyObject *_wrap_sk_x509_pop(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_entry_get_object(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; + X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - X509 *result = 0 ; + PyObject *swig_obj[1] ; + ASN1_OBJECT *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_get_object" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'"); } - arg1 = (struct stack_st_X509 *)(argp1); + arg1 = (X509_NAME_ENTRY *)(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 ); + 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_store_load_locations(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_entry_get_data(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_STORE *arg1 = (X509_STORE *) 0 ; - char *arg2 = (char *) 0 ; + X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[1] ; + ASN1_STRING *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_get_data" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'"); } - arg2 = (char *)(buf2); - result = (int)x509_store_load_locations(arg1,(char const *)arg2); + arg1 = (X509_NAME_ENTRY *)(argp1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); + 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: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_x509_type_check(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_entry_set_data(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509 *arg1 = (X509 *) 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 ; - PyObject * obj0 = 0 ; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "x509_name_entry_set_data", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_type_check" "', argument " "1"" of type '" "X509 *""'"); + 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(swig_obj[1], &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(swig_obj[2])) { + Py_ssize_t len; + + arg3 = (unsigned char *)PyString_AsString(swig_obj[2]); + len = PyString_Size(swig_obj[2]); + + + if (len > INT_MAX) { + PyErr_SetString(_x509_err, "object too large"); + return NULL; + } + arg4 = len; + } else { + PyErr_SetString(PyExc_TypeError, "expected string"); + return NULL; + } } - arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)x509_type_check(arg1); + result = (int)X509_NAME_ENTRY_set_data(arg1,arg2,(unsigned char const *)arg3,arg4); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -24976,75 +25590,106 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_name_type_check(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *arg1 = (X509_NAME *) 0 ; + X509_REQ *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "x509_req_new", 0, 0, 0)) SWIG_fail; + 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 ; - int result; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_type_check" "', argument " "1"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_free" "', argument " "1"" of type '" "X509_REQ *""'"); } - arg1 = (X509_NAME *)(argp1); + arg1 = (X509_REQ *)(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; - } + X509_REQ_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_req_get_subject_name(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_REQ *arg1 = (X509_REQ *) 0 ; + BIO *arg1 = (BIO *) 0 ; + X509_REQ *arg2 = (X509_REQ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - X509_NAME *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "x509_req_print", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_print" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (X509_REQ *)(argp1); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (X509_NAME *)x509_req_get_subject_name(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 | 0 ); + { + 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_version(PyObject *self, PyObject *args) { +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 ; - long result; + PyObject *swig_obj[1] ; + EVP_PKEY *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_get_pubkey" "', argument " "1"" of type '" "X509_REQ *""'"); } arg1 = (X509_REQ *)(argp1); { @@ -25052,43 +25697,47 @@ SWIGINTERN PyObject *_wrap_x509_req_get_version(PyObject *self, PyObject *args) SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (long)x509_req_get_version(arg1); - resultobj = SWIG_From_long((long)(result)); + 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_version(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_set_pubkey(PyObject *self, PyObject *args) { PyObject *resultobj = 0; X509_REQ *arg1 = (X509_REQ *) 0 ; - long arg2 ; + EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - long val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "x509_req_set_pubkey", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_set_pubkey" "', 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); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (int)x509_req_set_version(arg1,arg2); + { + 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; @@ -25099,35 +25748,39 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_req_add_extensions(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_set_subject_name(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 ; + X509_NAME *arg2 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; void *argp2 = 0 ; int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "x509_req_set_subject_name", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + 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_stack_st_X509_EXTENSION, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_NAME, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_set_subject_name" "', argument " "2"" of type '" "X509_NAME *""'"); } - arg2 = (struct stack_st_X509_EXTENSION *)(argp2); + arg2 = (X509_NAME *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)x509_req_add_extensions(arg1,arg2); + { + 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; @@ -25138,190 +25791,192 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_name_entry_create_by_txt(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_verify(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 ; + X509_REQ *arg1 = (X509_REQ *) 0 ; + EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; 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 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "x509_req_verify", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 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 **""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_verify" "', argument " "1"" of type '" "X509_REQ *""'"); } - arg1 = (X509_NAME_ENTRY **)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = (X509_REQ *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_entry_create_by_txt" "', argument " "2"" of type '" "char *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_verify" "', argument " "2"" of type '" "EVP_PKEY *""'"); } - 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 *""'"); + arg2 = (EVP_PKEY *)(argp2); + { + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - 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; + 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_x509v3_ext_conf(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_sign(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 ; + 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 ; - 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 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[3] ; + int result; - 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_Python_UnpackTuple(args, "x509_req_sign", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509v3_ext_conf" "', argument " "1"" of type '" "void *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_sign" "', argument " "1"" of type '" "X509_REQ *""'"); } - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509V3_CTX, 0 | 0 ); + arg1 = (X509_REQ *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509v3_ext_conf" "', argument " "2"" of type '" "X509V3_CTX *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_sign" "', argument " "2"" of type '" "EVP_PKEY *""'"); } - arg2 = (X509V3_CTX *)(argp2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + arg2 = (EVP_PKEY *)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_MD, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "x509v3_ext_conf" "', argument " "3"" of type '" "char *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "x509_req_sign" "', argument " "3"" of type '" "EVP_MD const *""'"); } - 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 *""'"); + arg3 = (EVP_MD *)(argp3); + { + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - 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 (!arg2) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - if (alloc3 == SWIG_NEWOBJ) free((char*)buf3); - if (alloc4 == SWIG_NEWOBJ) free((char*)buf4); + { + 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: - 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) { +SWIGINTERN PyObject *_wrap_i2d_x509_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; + BIO *arg1 = (BIO *) 0 ; + X509 *arg2 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "i2d_x509_bio", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_free" "', argument " "1"" of type '" "X509_EXTENSION *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_x509_bio" "', argument " "1"" of type '" "BIO *""'"); + } + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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; } - 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) { +SWIGINTERN PyObject *_wrap_i2d_x509_req_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; + BIO *arg1 = (BIO *) 0 ; + X509_REQ *arg2 = (X509_REQ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "i2d_x509_req_bio", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_get_name" "', argument " "1"" of type '" "X509_EXTENSION *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_x509_req_bio" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (X509_EXTENSION *)(argp1); - result = (PyObject *)x509_extension_get_name(arg1); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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); { - resultobj=result; + 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: @@ -25329,32 +25984,34 @@ fail: } -SWIGINTERN PyObject *_wrap_sk_x509_extension_new_null(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_store_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_X509_EXTENSION *result = 0 ; + X509_STORE *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 ); + if (!SWIG_Python_UnpackTuple(args, "x509_store_new", 0, 0, 0)) SWIG_fail; + 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_sk_x509_extension_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_store_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ; + X509_STORE *arg1 = (X509_STORE *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_free" "', argument " "1"" of type '" "X509_STORE *""'"); } - arg1 = (struct stack_st_X509_EXTENSION *)(argp1); - sk_x509_extension_free(arg1); + arg1 = (X509_STORE *)(argp1); + X509_STORE_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -25362,30 +26019,34 @@ fail: } -SWIGINTERN PyObject *_wrap_sk_x509_extension_push(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_store_add_cert(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 ; + 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "x509_store_add_cert", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_add_cert" "', argument " "1"" of type '" "X509_STORE *""'"); } - arg1 = (struct stack_st_X509_EXTENSION *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_X509_EXTENSION, 0 | 0 ); + arg1 = (X509_STORE *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_x509_extension_push" "', argument " "2"" of type '" "X509_EXTENSION *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_store_add_cert" "', argument " "2"" of type '" "X509 *""'"); } - arg2 = (X509_EXTENSION *)(argp2); - result = (int)sk_x509_extension_push(arg1,arg2); + 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; @@ -25396,43 +26057,72 @@ fail: } -SWIGINTERN PyObject *_wrap_sk_x509_extension_pop(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_store_set_verify_cb__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) { PyObject *resultobj = 0; - struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 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 ; - 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 ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_set_verify_cb" "', argument " "1"" of type '" "X509_STORE *""'"); } - 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 ); + arg1 = (X509_STORE *)(argp1); + { + int res = SWIG_ConvertFunctionPtr(swig_obj[1], (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_sk_x509_extension_num(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_store_ctx_get_current_cert(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ; + X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + X509 *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_error" "', argument " "1"" of type '" "X509_STORE_CTX *""'"); } - arg1 = (struct stack_st_X509_EXTENSION *)(argp1); - result = (int)sk_x509_extension_num(arg1); + arg1 = (X509_STORE_CTX *)(argp1); + result = (int)X509_STORE_CTX_get_error(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -25443,188 +26133,201 @@ fail: } -SWIGINTERN PyObject *_wrap_sk_x509_extension_value(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_store_ctx_get_error_depth(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ; - int arg2 ; + X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - X509_EXTENSION *result = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 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 *""'"); + 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; } - 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) { +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 ; - void *result = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_free" "', 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 ); + X509_STORE_CTX_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_x509_store_ctx_get_ex_data(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_store_ctx_get1_chain(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 ; + PyObject *swig_obj[1] ; + struct stack_st_X509 *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + 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); - 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 ); + 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_store_set_verify_cb__SWIG_1(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_extension_get_critical(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_STORE *arg1 = (X509_STORE *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_EXTENSION, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_get_critical" "', argument " "1"" of type '" "X509_EXTENSION *""'"); } - arg1 = (X509_STORE *)(argp1); + arg1 = (X509_EXTENSION *)(argp1); + result = (int)X509_EXTENSION_get_critical(arg1); { - if (!PyCallable_Check(obj1)) { - PyErr_SetString(PyExc_TypeError, "expected PyCallable"); - return NULL; - } - arg2=obj1; + 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 *swig_obj[2] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "x509_extension_set_critical", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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); { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } - 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; +SWIGINTERN PyObject *_wrap_x509_store_set_flags(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + X509_STORE *arg1 = (X509_STORE *) 0 ; + unsigned long arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + unsigned long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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 (!SWIG_Python_UnpackTuple(args, "x509_store_set_flags", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 0 | 0 ); + if (!SWIG_IsOK(res1)) { + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_set_flags" "', argument " "1"" of type '" "X509_STORE *""'"); } - 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); - } - } + arg1 = (X509_STORE *)(argp1); + ecode2 = SWIG_AsVal_unsigned_SS_long(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_store_set_flags" "', argument " "2"" of type '" "unsigned long""'"); + } + arg2 = (unsigned long)(val2); + result = (int)X509_STORE_set_flags(arg1,arg2); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } - + return resultobj; 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; + return NULL; } -SWIGINTERN PyObject *_wrap_make_stack_from_der_sequence(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_read_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - struct stack_st_X509 *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + X509 *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"make_stack_from_der_sequence",1,1,&obj0)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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); { - arg1=obj0; + 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; } - 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); + resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509, 0); else { + m2_PyErr_Msg(_x509_err); resultobj = NULL; } } @@ -25634,17 +26337,38 @@ fail: } -SWIGINTERN PyObject *_wrap_sk_x509_new_null(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_d2i_x509(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - struct stack_st_X509 *result = 0 ; + BIO *arg1 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + X509 *result = 0 ; - result = (struct stack_st_X509 *)sk_x509_new_null(); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_stack_st_X509, 0); + resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509, 0); else { + m2_PyErr_Msg(_x509_err); resultobj = NULL; } } @@ -25654,28 +26378,83 @@ fail: } -SWIGINTERN PyObject *_wrap_get_der_encoding_stack(PyObject *self, PyObject *args) { +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; - struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + { + arg1=swig_obj[0]; + } + 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 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; + X509_REQ *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "d2i_x509_req" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (struct stack_st_X509 *)(argp1); + arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)get_der_encoding_stack(arg1); { - resultobj=result; + 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: @@ -25683,30 +26462,40 @@ fail: } -SWIGINTERN PyObject *_wrap_x509_name_oneline(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_read_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - X509_NAME *arg1 = (X509_NAME *) 0 ; + BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject *swig_obj[1] ; + X509_REQ *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_oneline" "', argument " "1"" of type '" "X509_NAME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_read_pem" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (X509_NAME *)(argp1); + arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (char *)x509_name_oneline(arg1); - resultobj = SWIG_FromCharPtr((const char *)result); { + 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) - OPENSSL_free(result); + resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509_REQ, 0); + else { + m2_PyErr_Msg(_x509_err); + resultobj = NULL; + } } return resultobj; fail: @@ -25714,137 +26503,152 @@ fail: } -SWIGINTERN PyObject *_wrap_asn1_object_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_i2d_x509(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_OBJECT *result = 0 ; + X509 *arg1 = (X509 *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - result = (ASN1_OBJECT *)ASN1_OBJECT_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_asn1_object_create(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_write_pem(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 ; + BIO *arg1 = (BIO *) 0 ; + X509_REQ *arg2 = (X509_REQ *) 0 ; + void *argp1 = 0 ; + int res1 = 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 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "x509_req_write_pem", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &argp2,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_object_create" "', argument " "2"" of type '" "unsigned char *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_write_pem" "', argument " "2"" of type '" "X509_REQ *""'"); } - 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 *""'"); + arg2 = (X509_REQ *)(argp2); + { + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - 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 *""'"); + { + 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; } - 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) { +SWIGINTERN PyObject *_wrap_x509_crl_read_pem(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ; + BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + X509_CRL *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_object_free" "', argument " "1"" of type '" "ASN1_OBJECT *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_crl_read_pem" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (ASN1_OBJECT *)(argp1); + arg1 = (BIO *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - ASN1_OBJECT_free(arg1); - resultobj = SWIG_Py_Void(); + { + 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_i2d_asn1_object(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_set_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ; - unsigned char **arg2 = (unsigned char **) 0 ; + X509 *arg1 = (X509 *) 0 ; + long arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "x509_set_version", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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 **""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_version" "', argument " "1"" of type '" "X509 *""'"); } - arg2 = (unsigned char **)(argp2); + arg1 = (X509 *)(argp1); + ecode2 = SWIG_AsVal_long(swig_obj[1], &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)i2d_ASN1_OBJECT(arg1,arg2); + result = (int)x509_set_version(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -25855,137 +26659,128 @@ fail: } -SWIGINTERN PyObject *_wrap_d2i_asn1_object(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_get_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_OBJECT **arg1 = (ASN1_OBJECT **) 0 ; - unsigned char **arg2 = (unsigned char **) 0 ; - long arg3 ; + X509 *arg1 = (X509 *) 0 ; 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 ; + PyObject *swig_obj[1] ; + long result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "d2i_asn1_object" "', argument " "1"" of type '" "ASN1_OBJECT **""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_version" "', argument " "1"" of type '" "X509 *""'"); } - 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 **""'"); + arg1 = (X509 *)(argp1); + { + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - 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 ); + result = (long)x509_get_version(arg1); + resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_asn1_string_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_set_not_before(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_STRING *result = 0 ; + X509 *arg1 = (X509 *) 0 ; + ASN1_TIME *arg2 = (ASN1_TIME *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - result = (ASN1_STRING *)ASN1_STRING_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_STRING, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "x509_set_not_before", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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_asn1_string_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_get_not_before(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_STRING *arg1 = (ASN1_STRING *) 0 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + ASN1_TIME *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_free" "', argument " "1"" of type '" "ASN1_STRING *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_not_before" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (ASN1_STRING *)(argp1); + arg1 = (X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - ASN1_STRING_free(arg1); - resultobj = SWIG_Py_Void(); + 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_asn1_string_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_set_not_after(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_STRING *arg1 = (ASN1_STRING *) 0 ; - void *arg2 = (void *) 0 ; - int arg3 ; + X509 *arg1 = (X509 *) 0 ; + ASN1_TIME *arg2 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "x509_set_not_after", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_set" "', argument " "1"" of type '" "ASN1_STRING *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_not_after" "', argument " "1"" of type '" "X509 *""'"); } - 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; - } + arg1 = (X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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)ASN1_STRING_set(arg1,(void const *)arg2,arg3); + result = (int)x509_set_not_after(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -25996,86 +26791,64 @@ fail: } -SWIGINTERN PyObject *_wrap_asn1_string_print(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_get_not_after(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - ASN1_STRING *arg2 = (ASN1_STRING *) 0 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[1] ; + ASN1_TIME *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_not_after" "', argument " "1"" of type '" "X509 *""'"); } - arg2 = (ASN1_STRING *)(argp2); + arg1 = (X509 *)(argp1); { 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; - } + 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_asn1_string_print_ex(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_sign(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - ASN1_STRING *arg2 = (ASN1_STRING *) 0 ; - unsigned long arg3 ; + 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 ; - unsigned long val3 ; - int ecode3 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + PyObject *swig_obj[3] ; 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_Python_UnpackTuple(args, "x509_sign", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_print_ex" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_sign" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (BIO *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_STRING, 0 | 0 ); + arg1 = (X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_string_print_ex" "', argument " "2"" of type '" "ASN1_STRING *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_sign" "', argument " "2"" of type '" "EVP_PKEY *""'"); } - 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); + arg2 = (EVP_PKEY *)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &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."); @@ -26087,10 +26860,11 @@ SWIGINTERN PyObject *_wrap_asn1_string_print_ex(PyObject *self, PyObject *args) } } { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)ASN1_STRING_print_ex(arg1,arg2,arg3); - SWIG_PYTHON_THREAD_END_ALLOW; + 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; @@ -26101,67 +26875,66 @@ fail: } -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) { +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 ; - PyObject * obj0 = 0 ; + long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + ASN1_TIME *result = 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_Python_UnpackTuple(args, "x509_gmtime_adj", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_gmtime_adj" "', 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(); + ecode2 = SWIG_AsVal_long(swig_obj[1], &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_asn1_time_check(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_by_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; + X509_NAME *arg1 = (X509_NAME *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "x509_name_by_nid", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_check" "', argument " "1"" of type '" "ASN1_TIME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_by_nid" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg1 = (ASN1_TIME *)(argp1); + arg1 = (X509_NAME *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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 = (int)ASN1_TIME_check(arg1); + result = (PyObject *)x509_name_by_nid(arg1,arg2); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -26169,125 +26942,155 @@ fail: } -SWIGINTERN PyObject *_wrap_asn1_time_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_set_by_nid(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; - long arg2 ; + X509_NAME *arg1 = (X509_NAME *) 0 ; + int arg2 ; + PyObject *arg3 = (PyObject *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - long val2 ; + int val2 ; int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - ASN1_TIME *result = 0 ; + PyObject *swig_obj[3] ; + int result; - 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_Python_UnpackTuple(args, "x509_name_set_by_nid", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_set" "', argument " "1"" of type '" "ASN1_TIME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_set_by_nid" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg1 = (ASN1_TIME *)(argp1); - ecode2 = SWIG_AsVal_long(obj1, &val2); + arg1 = (X509_NAME *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); if (!SWIG_IsOK(ecode2)) { - SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "asn1_time_set" "', argument " "2"" of type '" "long""'"); + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_set_by_nid" "', argument " "2"" of type '" "int""'"); } - arg2 = (long)(val2); + arg2 = (int)(val2); + { + arg3=swig_obj[2]; + } { 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 ); + 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_asn1_time_set_string(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_txt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_TIME *arg1 = (ASN1_TIME *) 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 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 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 *swig_obj[7] ; 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_Python_UnpackTuple(args, "x509_name_add_entry_by_txt", 7, 7, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_set_string" "', argument " "1"" of type '" "ASN1_TIME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry_by_txt" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg1 = (ASN1_TIME *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = (X509_NAME *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &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 *""'"); + 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(swig_obj[2], &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(swig_obj[3], &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(swig_obj[4], &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(swig_obj[5], &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(swig_obj[6], &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)ASN1_TIME_set_string(arg1,(char const *)arg2); + 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_asn1_time_print(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_get_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - ASN1_TIME *arg2 = (ASN1_TIME *) 0 ; + X509_NAME *arg1 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_der" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg2 = (ASN1_TIME *)(argp2); + arg1 = (X509_NAME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (PyObject *)x509_name_get_der(arg1); { - 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; + resultobj=result; } return resultobj; fail: @@ -26295,37 +27098,26 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_sk_x509_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ; + struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_free" "', argument " "1"" of type '" "ASN1_INTEGER *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_free" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } - arg1 = (ASN1_INTEGER *)(argp1); + arg1 = (struct stack_st_X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - ASN1_INTEGER_free(arg1); + sk_x509_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -26333,29 +27125,28 @@ fail: } -SWIGINTERN PyObject *_wrap_asn1_integer_cmp(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_x509_push(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ; - ASN1_INTEGER *arg2 = (ASN1_INTEGER *) 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "sk_x509_push", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_cmp" "', argument " "1"" of type '" "ASN1_INTEGER *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_push" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } - arg1 = (ASN1_INTEGER *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); + arg1 = (struct stack_st_X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_integer_cmp" "', argument " "2"" of type '" "ASN1_INTEGER *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_x509_push" "', argument " "2"" of type '" "X509 *""'"); } - arg2 = (ASN1_INTEGER *)(argp2); + arg2 = (X509 *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); @@ -26366,7 +27157,7 @@ SWIGINTERN PyObject *_wrap_asn1_integer_cmp(PyObject *self, PyObject *args) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)ASN1_INTEGER_cmp(arg1,arg2); + result = (int)sk_x509_push(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -26377,90 +27168,91 @@ fail: } -SWIGINTERN PyObject *_wrap_asn1_time_type_check(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_x509_pop(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; + struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + X509 *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_type_check" "', argument " "1"" of type '" "ASN1_TIME *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_pop" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } - arg1 = (ASN1_TIME *)(argp1); + arg1 = (struct stack_st_X509 *)(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; - } + 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_asn1_integer_get(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_store_load_locations(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ; + X509_STORE *arg1 = (X509_STORE *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "x509_store_load_locations", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_get" "', argument " "1"" of type '" "ASN1_INTEGER *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_load_locations" "', argument " "1"" of type '" "X509_STORE *""'"); } - arg1 = (ASN1_INTEGER *)(argp1); - { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg1 = (X509_STORE *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &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 *""'"); } - result = (PyObject *)asn1_integer_get(arg1); + arg2 = (char *)(buf2); + result = (int)x509_store_load_locations(arg1,(char const *)arg2); { - resultobj=result; + 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_integer_set(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + X509 *arg1 = (X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 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; + 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)asn1_integer_set(arg1,arg2); + result = (int)x509_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -26471,227 +27263,162 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_x509_name_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PKCS7 *arg1 = (PKCS7 *) 0 ; + X509_NAME *arg1 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"pkcs7_free",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_free" "', argument " "1"" of type '" "PKCS7 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_type_check" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg1 = (PKCS7 *)(argp1); + arg1 = (X509_NAME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - PKCS7_free(arg1); - resultobj = SWIG_Py_Void(); + result = (int)x509_name_type_check(arg1); + { + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_pkcs7_add_certificate(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_get_subject_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PKCS7 *arg1 = (PKCS7 *) 0 ; - X509 *arg2 = (X509 *) 0 ; + X509_REQ *arg1 = (X509_REQ *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; + X509_NAME *result = 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_get_subject_name" "', argument " "1"" of type '" "X509_REQ *""'"); } - arg2 = (X509 *)(argp2); + arg1 = (X509_REQ *)(argp1); { 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(); + 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 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) { +SWIGINTERN PyObject *_wrap_x509_req_get_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; + X509_REQ *arg1 = (X509_REQ *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + long result; - if(!PyArg_UnpackTuple(args,(char *)"pkcs7_init",1,1,&obj0)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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); { - arg1=obj0; + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - pkcs7_init(arg1); - resultobj = SWIG_Py_Void(); + result = (long)x509_req_get_version(arg1); + resultobj = SWIG_From_long((long)(result)); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_smime_init(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_set_version(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; + X509_REQ *arg1 = (X509_REQ *) 0 ; + long arg2 ; + void *argp1 = 0 ; + int res1 = 0 ; + long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"smime_init",1,1,&obj0)) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "x509_req_set_version", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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); { - arg1=obj0; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } - smime_init(arg1); - resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_pkcs7_decrypt(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_req_add_extensions(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PKCS7 *arg1 = (PKCS7 *) 0 ; - EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; - X509 *arg3 = (X509 *) 0 ; - int arg4 ; + 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 ; - 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 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "x509_req_add_extensions", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_decrypt" "', argument " "1"" of type '" "PKCS7 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_add_extensions" "', argument " "1"" of type '" "X509_REQ *""'"); } - arg1 = (PKCS7 *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); + arg1 = (X509_REQ *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_stack_st_X509_EXTENSION, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_add_extensions" "', argument " "2"" of type '" "struct stack_st_X509_EXTENSION *""'"); } - 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); + 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); { - 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; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -26699,179 +27426,78 @@ fail: } -SWIGINTERN PyObject *_wrap_pkcs7_encrypt(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_entry_create_by_txt(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 ; + 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 ; - 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 ; + 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 *swig_obj[5] ; + X509_NAME_ENTRY *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_Python_UnpackTuple(args, "x509_name_entry_create_by_txt", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_X509_NAME_ENTRY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_encrypt" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_create_by_txt" "', argument " "1"" of type '" "X509_NAME_ENTRY **""'"); } - arg1 = (struct stack_st_X509 *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); + arg1 = (X509_NAME_ENTRY **)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2); 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_entry_create_by_txt" "', argument " "2"" of type '" "char *""'"); } - 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""'"); + arg2 = (char *)(buf2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &val3); + if (!SWIG_IsOK(ecode3)) { + SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_entry_create_by_txt" "', argument " "3"" 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; - } + arg3 = (int)(val3); + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &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(swig_obj[4], &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_pkcs7_sign1(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509v3_set_nconf(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 ; + X509V3_CTX *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; - } + if (!SWIG_Python_UnpackTuple(args, "x509v3_set_nconf", 0, 0, 0)) SWIG_fail; + 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_PKCS7, 0); + resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509V3_CTX, 0); else { - m2_PyErr_Msg(_smime_err); resultobj = NULL; } } @@ -26881,170 +27507,105 @@ fail: } -SWIGINTERN PyObject *_wrap_pkcs7_sign0(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509v3_ext_conf(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 *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 ; - 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 ; + int res3 ; + char *buf3 = 0 ; + int alloc3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + PyObject *swig_obj[4] ; + X509_EXTENSION *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_Python_UnpackTuple(args, "x509v3_ext_conf", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0],SWIG_as_voidptrptr(&arg1), 0, 0); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_sign0" "', argument " "1"" of type '" "X509 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509v3_ext_conf" "', argument " "1"" of type '" "void *""'"); } - arg1 = (X509 *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EVP_PKEY, 0 | 0 ); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509V3_CTX, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_sign0" "', argument " "2"" of type '" "EVP_PKEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509v3_ext_conf" "', argument " "2"" of type '" "X509V3_CTX *""'"); } - arg2 = (EVP_PKEY *)(argp2); - res3 = SWIG_ConvertPtr(obj2, &argp3,SWIGTYPE_p_BIO, 0 | 0 ); + arg2 = (X509V3_CTX *)(argp2); + res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_sign0" "', argument " "3"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "x509v3_ext_conf" "', argument " "3"" of type '" "char *""'"); } - arg3 = (BIO *)(argp3); - res4 = SWIG_ConvertPtr(obj3, &argp4,SWIGTYPE_p_EVP_MD, 0 | 0 ); + arg3 = (char *)(buf3); + res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4); 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; + 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_PKCS7, 0); + resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509_EXTENSION, 0); else { - m2_PyErr_Msg(_smime_err); + 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_pkcs7_read_bio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_extension_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PKCS7 *result = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"pkcs7_read_bio",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_BIO, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_EXTENSION, 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; - } + 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_pkcs7_read_bio_der(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_extension_get_name(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PKCS7 *result = 0 ; + PyObject *swig_obj[1] ; + PyObject *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_EXTENSION, 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; + 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); { - 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; - } + resultobj=result; } return resultobj; fail: @@ -27052,203 +27613,113 @@ fail: } -SWIGINTERN PyObject *_wrap_pkcs7_verify1(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_x509_extension_new_null(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 ; + struct stack_st_X509_EXTENSION *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "sk_x509_extension_new_null", 0, 0, 0)) SWIG_fail; + 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 ; - 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 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 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; + 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_pkcs7_verify0(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_x509_extension_push(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 ; + 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 ; - 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 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "sk_x509_extension_push", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_verify0" "', argument " "1"" of type '" "PKCS7 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_push" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'"); } - arg1 = (PKCS7 *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_stack_st_X509, 0 | 0 ); + arg1 = (struct stack_st_X509_EXTENSION *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_EXTENSION, 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."); - } + 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); { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } - result = (PyObject *)pkcs7_verify0(arg1,arg2,arg3,arg4); - { - resultobj=result; + 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 *swig_obj[1] ; + X509_EXTENSION *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_smime_write_pkcs7_multi(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_x509_extension_num(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - PKCS7 *arg2 = (PKCS7 *) 0 ; - BIO *arg3 = (BIO *) 0 ; - int arg4 ; + struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ; 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 *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 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; + 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; @@ -27259,181 +27730,207 @@ fail: } -SWIGINTERN PyObject *_wrap_smime_write_pkcs7(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_sk_x509_extension_value(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - PKCS7 *arg2 = (PKCS7 *) 0 ; - int arg3 ; + struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ; + int arg2 ; 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; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + X509_EXTENSION *result = 0 ; - 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_Python_UnpackTuple(args, "sk_x509_extension_value", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_value" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'"); } - 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""'"); + arg1 = (struct stack_st_X509_EXTENSION *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_x509_extension_value" "', argument " "2"" 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; - } + 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_smime_read_pkcs7(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_store_ctx_get_app_data(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; + void *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 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; + 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_pkcs7_write_bio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_store_ctx_get_ex_data(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PKCS7 *arg1 = (PKCS7 *) 0 ; - BIO *arg2 = (BIO *) 0 ; + X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ; + int arg2 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + int val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + void *result = 0 ; - 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_Python_UnpackTuple(args, "x509_store_ctx_get_ex_data", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_write_bio" "', argument " "1"" of type '" "PKCS7 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_ex_data" "', argument " "1"" of type '" "X509_STORE_CTX *""'"); } - 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 *""'"); + arg1 = (X509_STORE_CTX *)(argp1); + ecode2 = SWIG_AsVal_int(swig_obj[1], &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, Py_ssize_t nobjs, PyObject **swig_obj) { + PyObject *resultobj = 0; + X509_STORE *arg1 = (X509_STORE *) 0 ; + PyObject *arg2 = (PyObject *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + + if ((nobjs < 2) || (nobjs > 2)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); } - arg2 = (BIO *)(argp2); + arg1 = (X509_STORE *)(argp1); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + if (!PyCallable_Check(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; } + arg2=swig_obj[1]; } { 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; - } + x509_store_set_verify_cb(arg1,arg2); + resultobj = SWIG_Py_Void(); 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; +SWIGINTERN PyObject *_wrap_x509_store_set_verify_cb(PyObject *self, PyObject *args) { + Py_ssize_t argc; + PyObject *argv[3] = { + 0 + }; - 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 *""'"); + if (!(argc = SWIG_Python_UnpackTuple(args, "x509_store_set_verify_cb", 0, 2, argv))) SWIG_fail; + --argc; + 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, argc, argv); + } + } } - arg2 = (BIO *)(argp2); - { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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, argc, argv); + } } } + +fail: + SWIG_Python_RaiseOrModifyTypeError("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 *swig_obj[1] ; + struct stack_st_X509 *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg1=swig_obj[0]; } + result = (struct stack_st_X509 *)make_stack_from_der_sequence(arg1); { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)pkcs7_write_bio_der(arg1,arg2); - 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_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 ; + + if (!SWIG_Python_UnpackTuple(args, "sk_x509_new_null", 0, 0, 0)) SWIG_fail; + result = (struct stack_st_X509 *)sk_x509_new_null(); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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: @@ -27441,29 +27938,29 @@ fail: } -SWIGINTERN PyObject *_wrap_pkcs7_type_nid(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_get_der_encoding_stack(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PKCS7 *arg1 = (PKCS7 *) 0 ; + struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"pkcs7_type_nid",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_type_nid" "', argument " "1"" of type '" "PKCS7 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_der_encoding_stack" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } - arg1 = (PKCS7 *)(argp1); + arg1 = (struct stack_st_X509 *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)pkcs7_type_nid(arg1); + result = (PyObject *)get_der_encoding_stack(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -27471,244 +27968,260 @@ fail: } -SWIGINTERN PyObject *_wrap_pkcs7_type_sn(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_x509_name_oneline(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PKCS7 *arg1 = (PKCS7 *) 0 ; + X509_NAME *arg1 = (X509_NAME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_type_sn" "', argument " "1"" of type '" "PKCS7 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_oneline" "', argument " "1"" of type '" "X509_NAME *""'"); } - arg1 = (PKCS7 *)(argp1); + arg1 = (X509_NAME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (char *)pkcs7_type_sn(arg1); + 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_smime_crlf_copy(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_object_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - BIO *arg2 = (BIO *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; + ASN1_OBJECT *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "asn1_object_new", 0, 0, 0)) SWIG_fail; + 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 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - int result; + int val3 ; + int ecode3 = 0 ; + int res4 ; + char *buf4 = 0 ; + int alloc4 = 0 ; + int res5 ; + char *buf5 = 0 ; + int alloc5 = 0 ; + PyObject *swig_obj[5] ; + ASN1_OBJECT *result = 0 ; - 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_Python_UnpackTuple(args, "asn1_object_create", 5, 5, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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(swig_obj[1], &argp2,SWIGTYPE_p_unsigned_char, 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_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_object_create" "', argument " "2"" of type '" "unsigned char *""'"); } - { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)smime_crlf_copy(arg1,arg2); - SWIG_PYTHON_THREAD_END_ALLOW; + arg2 = (unsigned char *)(argp2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &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(swig_obj[3], &buf4, NULL, &alloc4); + if (!SWIG_IsOK(res4)) { + SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "asn1_object_create" "', argument " "4"" of type '" "char const *""'"); } - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + arg4 = (char *)(buf4); + res5 = SWIG_AsCharPtrAndSize(swig_obj[4], &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_pkcs7_get0_signers(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_object_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PKCS7 *arg1 = (PKCS7 *) 0 ; - struct stack_st_X509 *arg2 = (struct stack_st_X509 *) 0 ; - int arg3 ; + ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ; 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 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_OBJECT, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_object_free" "', argument " "1"" of type '" "ASN1_OBJECT *""'"); } - 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); + arg1 = (ASN1_OBJECT *)(argp1); { 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 ); + ASN1_OBJECT_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN int Swig_var__util_err_set(PyObject *_val) { +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 *swig_obj[2] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "i2d_asn1_object", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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); { - 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 *""'"); + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } - _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; + result = (int)i2d_ASN1_OBJECT(arg1,arg2); { - arg1=obj0; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } - util_init(arg1); - resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_util_hex_to_string(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_d2i_asn1_object(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 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 *swig_obj[3] ; + ASN1_OBJECT *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"util_hex_to_string",1,1,&obj0)) SWIG_fail; - { - arg1=obj0; + if (!SWIG_Python_UnpackTuple(args, "d2i_asn1_object", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 **""'"); } - result = (PyObject *)util_hex_to_string(arg1); - { - resultobj=result; + arg1 = (ASN1_OBJECT **)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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_util_string_to_hex(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_bit_string_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + ASN1_BIT_STRING *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; - } + if (!SWIG_Python_UnpackTuple(args, "asn1_bit_string_new", 0, 0, 0)) SWIG_fail; + 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_ec_key_new(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_string_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *result = 0 ; + ASN1_STRING *result = 0 ; - result = (EC_KEY *)EC_KEY_new(); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "asn1_string_new", 0, 0, 0)) SWIG_fail; + 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_ec_key_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_string_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; + ASN1_STRING *arg1 = (ASN1_STRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_free" "', argument " "1"" of type '" "EC_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_free" "', argument " "1"" of type '" "ASN1_STRING *""'"); } - arg1 = (EC_KEY *)(argp1); + arg1 = (ASN1_STRING *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - EC_KEY_free(arg1); + ASN1_STRING_free(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -27716,26 +28229,46 @@ fail: } -SWIGINTERN PyObject *_wrap_ec_key_size(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_string_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; + ASN1_STRING *arg1 = (ASN1_STRING *) 0 ; + void *arg2 = (void *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "asn1_string_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_STRING, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_size" "', argument " "1"" of type '" "EC_KEY const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_set" "', argument " "1"" of type '" "ASN1_STRING *""'"); + } + arg1 = (ASN1_STRING *)(argp1); + { + if (PyBytes_Check(swig_obj[1])) { + Py_ssize_t len; + + arg2 = PyBytes_AsString(swig_obj[1]); + len = PyBytes_Size(swig_obj[1]); + + if (len > INT_MAX) { + PyErr_SetString(PyExc_ValueError, "object too large"); + return NULL; + } + arg3 = len; + } + else { + PyErr_SetString(PyExc_TypeError, "expected string"); + return NULL; + } } - arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)ECDSA_size((EC_KEY const *)arg1); + result = (int)ASN1_STRING_set(arg1,(void const *)arg2,arg3); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -27746,26 +28279,43 @@ fail: } -SWIGINTERN PyObject *_wrap_ec_key_gen_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_string_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; + BIO *arg1 = (BIO *) 0 ; + ASN1_STRING *arg2 = (ASN1_STRING *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "asn1_string_print", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_gen_key" "', argument " "1"" of type '" "EC_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_print" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (EC_KEY *)(argp1); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); } } - result = (int)EC_KEY_generate_key(arg1); + { + 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; @@ -27776,136 +28326,125 @@ fail: } -SWIGINTERN PyObject *_wrap_ec_key_check_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_string_print_ex(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; - void *argp1 = 0 ; - int res1 = 0 ; - PyObject * obj0 = 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 *swig_obj[3] ; 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_Python_UnpackTuple(args, "asn1_string_print_ex", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_print_ex" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (EC_KEY *)(argp1); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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."); } } - result = (int)EC_KEY_check_key((EC_KEY const *)arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + if (!arg2) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - 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); + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)ASN1_STRING_print_ex(arg1,arg2,arg3); + SWIG_PYTHON_THREAD_END_ALLOW; } - 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; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } - ec_init(arg1); - resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ec_get_builtin_curves(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_time_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - PyObject *result = 0 ; + ASN1_TIME *result = 0 ; - result = (PyObject *)ec_get_builtin_curves(); - { - resultobj=result; - } + if (!SWIG_Python_UnpackTuple(args, "asn1_time_new", 0, 0, 0)) SWIG_fail; + 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_ec_key_new_by_curve_name(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_time_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - EC_KEY *result = 0 ; + ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; - 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 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_ec_key_get_public_der(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_time_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; + ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + PyObject *swig_obj[1] ; + int result; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_check" "', argument " "1"" of type '" "ASN1_TIME *""'"); } - arg1 = (EC_KEY *)(argp1); + arg1 = (ASN1_TIME *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)ec_key_get_public_der(arg1); + result = (int)ASN1_TIME_check(arg1); { - resultobj=result; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -27913,89 +28452,104 @@ fail: } -SWIGINTERN PyObject *_wrap_ec_key_get_public_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_time_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; + ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; + long arg2 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject *result = 0 ; + long val2 ; + int ecode2 = 0 ; + PyObject *swig_obj[2] ; + ASN1_TIME *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_Python_UnpackTuple(args, "asn1_time_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 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 *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_set" "', argument " "1"" of type '" "ASN1_TIME *""'"); } - arg1 = (EC_KEY *)(argp1); + arg1 = (ASN1_TIME *)(argp1); + ecode2 = SWIG_AsVal_long(swig_obj[1], &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 = (PyObject *)ec_key_get_public_key(arg1); - { - resultobj=result; - } + 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_ec_key_read_pubkey(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_time_set_string(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; + ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; + char *arg2 = (char *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - EC_KEY *result = 0 ; + int res2 ; + char *buf2 = 0 ; + int alloc2 = 0 ; + PyObject *swig_obj[2] ; + int result; - 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_Python_UnpackTuple(args, "asn1_time_set_string", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_read_pubkey" "', argument " "1"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_set_string" "', argument " "1"" of type '" "ASN1_TIME *""'"); } - arg1 = (BIO *)(argp1); + arg1 = (ASN1_TIME *)(argp1); + res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &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); { - SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (EC_KEY *)ec_key_read_pubkey(arg1); - SWIG_PYTHON_THREAD_END_ALLOW; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 | 0 ); + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return resultobj; fail: + if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_ec_key_write_pubkey(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_time_print(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; - BIO *arg2 = (BIO *) 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "asn1_time_print", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_write_pubkey" "', argument " "1"" of type '" "EC_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_print" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (EC_KEY *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_TIME, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ec_key_write_pubkey" "', argument " "2"" of type '" "BIO *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_time_print" "', argument " "2"" of type '" "ASN1_TIME *""'"); } - arg2 = (BIO *)(argp2); + arg2 = (ASN1_TIME *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); @@ -28008,7 +28562,7 @@ SWIGINTERN PyObject *_wrap_ec_key_write_pubkey(PyObject *self, PyObject *args) { } { SWIG_PYTHON_THREAD_BEGIN_ALLOW; - result = (int)ec_key_write_pubkey(arg1,arg2); + result = (int)ASN1_TIME_print(arg1,arg2); SWIG_PYTHON_THREAD_END_ALLOW; } { @@ -28021,88 +28575,68 @@ fail: } -SWIGINTERN PyObject *_wrap_ec_key_read_bio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_integer_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - BIO *arg1 = (BIO *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + ASN1_INTEGER *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "asn1_integer_new", 0, 0, 0)) SWIG_fail; + 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 ; - PyObject * obj1 = 0 ; - EC_KEY *result = 0 ; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_INTEGER, 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; + 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."); } } - { - 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 ); + ASN1_INTEGER_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ec_key_write_bio(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_integer_cmp(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 ; + ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ; + ASN1_INTEGER *arg2 = (ASN1_INTEGER *) 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 ; + PyObject *swig_obj[2] ; 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_Python_UnpackTuple(args, "asn1_integer_cmp", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_INTEGER, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_write_bio" "', argument " "1"" of type '" "EC_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_cmp" "', argument " "1"" of type '" "ASN1_INTEGER *""'"); } - arg1 = (EC_KEY *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_BIO, 0 | 0 ); + arg1 = (ASN1_INTEGER *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_INTEGER, 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; + 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."); @@ -28113,20 +28647,10 @@ SWIGINTERN PyObject *_wrap_ec_key_write_bio(PyObject *self, PyObject *args) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } + result = (int)ASN1_INTEGER_cmp(arg1,arg2); { - 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; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; } return resultobj; fail: @@ -28134,54 +28658,27 @@ fail: } -SWIGINTERN PyObject *_wrap_ec_key_write_bio_no_cipher(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_time_type_check(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; - BIO *arg2 = (BIO *) 0 ; - PyObject *arg3 = (PyObject *) 0 ; + ASN1_TIME *arg1 = (ASN1_TIME *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - void *argp2 = 0 ; - int res2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 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; + 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."); } } - { - 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); + result = (int)asn1_time_type_check(arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -28192,79 +28689,27 @@ fail: } -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) { +SWIGINTERN PyObject *_wrap_asn1_integer_get(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; + ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_INTEGER, 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; + 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 *)ecdsa_sign(arg1,arg2); + result = (PyObject *)asn1_integer_get(arg1); { resultobj=result; } @@ -28274,41 +28719,30 @@ fail: } -SWIGINTERN PyObject *_wrap_ecdsa_verify(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_asn1_integer_set(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; + ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 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 *swig_obj[2] ; 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_Python_UnpackTuple(args, "asn1_integer_set", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_INTEGER, 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; + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_set" "', argument " "1"" of type '" "ASN1_INTEGER *""'"); } + arg1 = (ASN1_INTEGER *)(argp1); { - arg4=obj3; + arg2=swig_obj[1]; } { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)ecdsa_verify(arg1,arg2,arg3,arg4); + result = (int)asn1_integer_set(arg1,arg2); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -28319,103 +28753,67 @@ fail: } -SWIGINTERN PyObject *_wrap_ecdsa_sign_asn1(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_new(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 ; + PKCS7 *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; - } + if (!SWIG_Python_UnpackTuple(args, "pkcs7_new", 0, 0, 0)) SWIG_fail; + result = (PKCS7 *)PKCS7_new(); + resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PKCS7, 0 | 0 ); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ecdsa_verify_asn1(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; - PyObject *arg2 = (PyObject *) 0 ; - PyObject *arg3 = (PyObject *) 0 ; + PKCS7 *arg1 = (PKCS7 *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; - PyObject * obj2 = 0 ; - int result; + PyObject *swig_obj[1] ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 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; + 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."); } } - result = (int)ecdsa_verify_asn1(arg1,arg2,arg3); - { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; - } + PKCS7_free(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ecdh_compute_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_add_certificate(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; - EC_KEY *arg2 = (EC_KEY *) 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 ; - PyObject *result = 0 ; + PyObject *swig_obj[2] ; - 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_Python_UnpackTuple(args, "pkcs7_add_certificate", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdh_compute_key" "', argument " "1"" of type '" "EC_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_add_certificate" "', argument " "1"" of type '" "PKCS7 *""'"); } - arg1 = (EC_KEY *)(argp1); - res2 = SWIG_ConvertPtr(obj1, &argp2,SWIGTYPE_p_EC_KEY, 0 | 0 ); + arg1 = (PKCS7 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ecdh_compute_key" "', argument " "2"" of type '" "EC_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_add_certificate" "', argument " "2"" of type '" "X509 *""'"); } - arg2 = (EC_KEY *)(argp2); + arg2 = (X509 *)(argp2); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); @@ -28426,84 +28824,156 @@ SWIGINTERN PyObject *_wrap_ecdh_compute_key(PyObject *self, PyObject *args) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)ecdh_compute_key(arg1,arg2); - { - resultobj=result; - } + PKCS7_add_certificate(arg1,arg2); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ec_key_from_pubkey_der(PyObject *self, PyObject *args) { +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 ; - EC_KEY *result = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"ec_key_from_pubkey_der",1,1,&obj0)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; { - arg1=obj0; + arg1=swig_obj[0]; } - result = (EC_KEY *)ec_key_from_pubkey_der(arg1); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 | 0 ); + pkcs7_init(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ec_key_from_pubkey_params(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_smime_init(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 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; - 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); + if (!args) SWIG_fail; + swig_obj[0] = args; { - arg2=obj1; + arg1=swig_obj[0]; } - result = (EC_KEY *)ec_key_from_pubkey_params(arg1,arg2); - resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 | 0 ); + smime_init(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: return NULL; } -SWIGINTERN PyObject *_wrap_ec_key_keylen(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_decrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 0 ; - void *argp1 = 0 ; + PKCS7 *arg1 = (PKCS7 *) 0 ; + EVP_PKEY *arg2 = (EVP_PKEY *) 0 ; + X509 *arg3 = (X509 *) 0 ; + int arg4 ; + void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - int result; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "pkcs7_decrypt", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_keylen" "', argument " "1"" of type '" "EC_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_decrypt" "', argument " "1"" of type '" "PKCS7 *""'"); } - arg1 = (EC_KEY *)(argp1); + arg1 = (PKCS7 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3], &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."); } } - result = (int)ec_key_keylen(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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: @@ -28511,205 +28981,260 @@ fail: } -SWIGINTERN PyObject *_wrap_ec_key_type_check(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_encrypt(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - EC_KEY *arg1 = (EC_KEY *) 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 ; - PyObject * obj0 = 0 ; - int result; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; + PKCS7 *result = 0 ; - 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_Python_UnpackTuple(args, "pkcs7_encrypt", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_type_check" "', argument " "1"" of type '" "EC_KEY *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_encrypt" "', argument " "1"" of type '" "struct stack_st_X509 *""'"); } - arg1 = (EC_KEY *)(argp1); + arg1 = (struct stack_st_X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3], &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."); } } - 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 *""'"); + if (!arg2) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - arg1 = (char *)(buf1); { - if (!arg1) { + if (!arg3) { 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); + { + 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: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_engine_free(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_sign1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ENGINE *arg1 = (ENGINE *) 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 ; - PyObject * obj0 = 0 ; - int result; + 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 *swig_obj[6] ; + PKCS7 *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"engine_free",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "pkcs7_sign1", 6, 6, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_free" "', argument " "1"" of type '" "ENGINE *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_sign1" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (ENGINE *)(argp1); + arg1 = (X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3], &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(swig_obj[4], &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(swig_obj[5], &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."); } } - result = (int)ENGINE_free(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + if (!arg2) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - 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 *""'"); + { + if (!arg3) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - arg1 = (ENGINE *)(argp1); { - if (!arg1) { + if (!arg4) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)ENGINE_init(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + if (!arg5) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - return resultobj; + { + 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_engine_finish(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_sign0(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ENGINE *arg1 = (ENGINE *) 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 ; - PyObject * obj0 = 0 ; - int result; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject *swig_obj[5] ; + PKCS7 *result = 0 ; - if(!PyArg_UnpackTuple(args,(char *)"engine_finish",1,1,&obj0)) SWIG_fail; - res1 = SWIG_ConvertPtr(obj0, &argp1,SWIGTYPE_p_ENGINE, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "pkcs7_sign0", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_finish" "', argument " "1"" of type '" "ENGINE *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_sign0" "', argument " "1"" of type '" "X509 *""'"); } - arg1 = (ENGINE *)(argp1); + arg1 = (X509 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3], &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(swig_obj[4], &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."); } } - result = (int)ENGINE_finish(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + 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: @@ -28717,366 +29242,545 @@ fail: } -SWIGINTERN PyObject *_wrap_engine_get_id(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_read_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ENGINE *arg1 = (ENGINE *) 0 ; + BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject *swig_obj[1] ; + PKCS7 *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_get_id" "', argument " "1"" of type '" "ENGINE const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_read_bio" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (ENGINE *)(argp1); + arg1 = (BIO *)(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); + { + 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_engine_get_name(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_read_bio_der(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ENGINE *arg1 = (ENGINE *) 0 ; + BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + PyObject *swig_obj[1] ; + PKCS7 *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_get_name" "', argument " "1"" of type '" "ENGINE const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_read_bio_der" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (ENGINE *)(argp1); + arg1 = (BIO *)(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); + { + 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_engine_ctrl_cmd_string(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_verify1(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ENGINE *arg1 = (ENGINE *) 0 ; - char *arg2 = (char *) 0 ; - char *arg3 = (char *) 0 ; - int arg4 ; + 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 ; - 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; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + void *argp4 = 0 ; + int res4 = 0 ; + int val5 ; + int ecode5 = 0 ; + PyObject *swig_obj[5] ; + PyObject *result = 0 ; - 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_Python_UnpackTuple(args, "pkcs7_verify1", 5, 5, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_ctrl_cmd_string" "', argument " "1"" of type '" "ENGINE *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_verify1" "', argument " "1"" of type '" "PKCS7 *""'"); } - arg1 = (ENGINE *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = (PKCS7 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "engine_ctrl_cmd_string" "', argument " "2"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_verify1" "', argument " "2"" of type '" "struct stack_st_X509 *""'"); } - arg2 = (char *)(buf2); - res3 = SWIG_AsCharPtrAndSize(obj2, &buf3, NULL, &alloc3); + arg2 = (struct stack_st_X509 *)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_X509_STORE, 0 | 0 ); if (!SWIG_IsOK(res3)) { - SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "engine_ctrl_cmd_string" "', argument " "3"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_verify1" "', argument " "3"" of type '" "X509_STORE *""'"); } - 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""'"); + arg3 = (X509_STORE *)(argp3); + res4 = SWIG_ConvertPtr(swig_obj[3], &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(swig_obj[4], &val5); + if (!SWIG_IsOK(ecode5)) { + SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "pkcs7_verify1" "', argument " "5"" of type '" "int""'"); } - arg4 = (int)(val4); + arg5 = (int)(val5); { 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 (!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; } - 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) { +SWIGINTERN PyObject *_wrap_pkcs7_verify0(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _cbd_t *arg1 = (_cbd_t *) 0 ; - char *arg2 = (char *) 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 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; + PyObject *result = 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_Python_UnpackTuple(args, "pkcs7_verify0", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_password_set" "', argument " "1"" of type '" "_cbd_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_verify0" "', argument " "1"" of type '" "PKCS7 *""'"); } - arg1 = (_cbd_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = (PKCS7 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_stack_st_X509, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_cbd_t_password_set" "', argument " "2"" of type '" "char *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_verify0" "', argument " "2"" of type '" "struct stack_st_X509 *""'"); } - 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; + arg2 = (struct stack_st_X509 *)(argp2); + res3 = SWIG_ConvertPtr(swig_obj[2], &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(swig_obj[3], &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; } - 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) { +SWIGINTERN PyObject *_wrap_smime_write_pkcs7_multi(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _cbd_t *arg1 = (_cbd_t *) 0 ; + BIO *arg1 = (BIO *) 0 ; + PKCS7 *arg2 = (PKCS7 *) 0 ; + BIO *arg3 = (BIO *) 0 ; + int arg4 ; void *argp1 = 0 ; int res1 = 0 ; - char *result = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + void *argp3 = 0 ; + int res3 = 0 ; + int val4 ; + int ecode4 = 0 ; + PyObject *swig_obj[4] ; + int result; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, 0 | 0 ); + if (!SWIG_Python_UnpackTuple(args, "smime_write_pkcs7_multi", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_password_get" "', argument " "1"" of type '" "_cbd_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smime_write_pkcs7_multi" "', argument " "1"" of type '" "BIO *""'"); + } + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3], &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; } - 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) { +SWIGINTERN PyObject *_wrap_smime_write_pkcs7(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _cbd_t *arg1 = (_cbd_t *) 0 ; - char *arg2 = (char *) 0 ; + BIO *arg1 = (BIO *) 0 ; + PKCS7 *arg2 = (PKCS7 *) 0 ; + int arg3 ; void *argp1 = 0 ; int res1 = 0 ; - int res2 ; - char *buf2 = 0 ; - int alloc2 = 0 ; - PyObject * obj1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + int result; - 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_Python_UnpackTuple(args, "smime_write_pkcs7", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_prompt_set" "', argument " "1"" of type '" "_cbd_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smime_write_pkcs7" "', argument " "1"" of type '" "BIO *""'"); } - arg1 = (_cbd_t *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res2)) { - SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_cbd_t_prompt_set" "', argument " "2"" of type '" "char *""'"); + SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "smime_write_pkcs7" "', argument " "2"" of type '" "PKCS7 *""'"); } - 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; + arg2 = (PKCS7 *)(argp2); + ecode3 = SWIG_AsVal_int(swig_obj[2], &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; } - 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) { +SWIGINTERN PyObject *_wrap_smime_read_pkcs7(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _cbd_t *arg1 = (_cbd_t *) 0 ; + BIO *arg1 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - char *result = 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, 0 | 0 ); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_prompt_get" "', argument " "1"" of type '" "_cbd_t *""'"); + 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; } - 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) { +SWIGINTERN PyObject *_wrap_pkcs7_write_bio(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - _cbd_t *arg1 = (_cbd_t *) 0 ; + PKCS7 *arg1 = (PKCS7 *) 0 ; + BIO *arg2 = (BIO *) 0 ; void *argp1 = 0 ; int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, SWIG_POINTER_DISOWN | 0 ); + if (!SWIG_Python_UnpackTuple(args, "pkcs7_write_bio", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__cbd_t" "', argument " "1"" of type '" "_cbd_t *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_write_bio" "', argument " "1"" of type '" "PKCS7 *""'"); + } + arg1 = (PKCS7 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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; } - 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) { +SWIGINTERN PyObject *_wrap_pkcs7_write_bio_der(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 ; + PKCS7 *arg1 = (PKCS7 *) 0 ; + BIO *arg2 = (BIO *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + void *argp2 = 0 ; + int res2 = 0 ; + PyObject *swig_obj[2] ; + int result; - if(!PyArg_UnpackTuple(args,(char *)"engine_pkcs11_data_new",1,1,&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!SWIG_Python_UnpackTuple(args, "pkcs7_write_bio_der", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_pkcs11_data_new" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_write_bio_der" "', argument " "1"" of type '" "PKCS7 *""'"); + } + arg1 = (PKCS7 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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; } - 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) { +SWIGINTERN PyObject *_wrap_pkcs7_type_nid(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 *""'"); + PKCS7 *arg1 = (PKCS7 *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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; } - 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) { +SWIGINTERN PyObject *_wrap_pkcs7_type_sn(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 ; + PKCS7 *arg1 = (PKCS7 *) 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 ; + PyObject *swig_obj[1] ; + char *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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_load_private_key" "', argument " "1"" of type '" "ENGINE *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_type_sn" "', argument " "1"" of type '" "PKCS7 *""'"); } - 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 *""'"); + arg1 = (PKCS7 *)(argp1); + { + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } } - 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 *""'"); + 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 *swig_obj[2] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "smime_crlf_copy", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); } - 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 *""'"); + arg1 = (BIO *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &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."); @@ -29087,56 +29791,51 @@ SWIGINTERN PyObject *_wrap_engine_load_private_key(PyObject *self, PyObject *arg 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); + { + 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: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN PyObject *_wrap_engine_load_public_key(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_pkcs7_get0_signers(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 ; + PKCS7 *arg1 = (PKCS7 *) 0 ; + struct stack_st_X509 *arg2 = (struct stack_st_X509 *) 0 ; + int arg3 ; 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 ; + void *argp2 = 0 ; + int res2 = 0 ; + int val3 ; + int ecode3 = 0 ; + PyObject *swig_obj[3] ; + struct stack_st_X509 *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_Python_UnpackTuple(args, "pkcs7_get0_signers", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_load_public_key" "', argument " "1"" of type '" "ENGINE *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_get0_signers" "', argument " "1"" of type '" "PKCS7 *""'"); } - arg1 = (ENGINE *)(argp1); - res2 = SWIG_AsCharPtrAndSize(obj1, &buf2, NULL, &alloc2); + arg1 = (PKCS7 *)(argp1); + res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_stack_st_X509, 0 | 0 ); 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 *""'"); + 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(swig_obj[2], &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."); @@ -29147,24 +29846,22 @@ SWIGINTERN PyObject *_wrap_engine_load_public_key(PyObject *self, PyObject *args 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); + 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: - if (alloc2 == SWIG_NEWOBJ) free((char*)buf2); return NULL; } -SWIGINTERN int Swig_var__engine_err_set(PyObject *_val) { +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 '""_engine_err""' of type '""PyObject *""'"); + SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_util_err""' of type '""PyObject *""'"); } - _engine_err = (PyObject *)(argp); + _util_err = (PyObject *)(argp); } return 0; fail: @@ -29172,26 +29869,27 @@ fail: } -SWIGINTERN PyObject *Swig_var__engine_err_get(void) { +SWIGINTERN PyObject *Swig_var__util_err_get(void) { PyObject *pyobj = 0; PyObject *self = 0; (void)self; - pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_engine_err), SWIGTYPE_p_PyObject, 0 ); + pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_util_err), SWIGTYPE_p_PyObject, 0 ); return pyobj; } -SWIGINTERN PyObject *_wrap_engine_init_error(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_util_init(PyObject *self, PyObject *args) { PyObject *resultobj = 0; PyObject *arg1 = (PyObject *) 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; - if(!PyArg_UnpackTuple(args,(char *)"engine_init_error",1,1,&obj0)) SWIG_fail; + if (!args) SWIG_fail; + swig_obj[0] = args; { - arg1=obj0; + arg1=swig_obj[0]; } - engine_init_error(arg1); + util_init(arg1); resultobj = SWIG_Py_Void(); return resultobj; fail: @@ -29199,82 +29897,41 @@ fail: } -SWIGINTERN PyObject *_wrap_engine_load_certificate(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_util_hex_to_string(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 ; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + PyObject *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 (!args) SWIG_fail; + swig_obj[0] = args; { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg1=swig_obj[0]; } + result = (PyObject *)util_hex_to_string(arg1); { - if (!arg2) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + resultobj=result; } - 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) { +SWIGINTERN PyObject *_wrap_util_string_to_hex(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; + PyObject *arg1 = (PyObject *) 0 ; + PyObject *swig_obj[1] ; + PyObject *result = 0 ; - 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 (!args) SWIG_fail; + swig_obj[0] = args; { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + arg1=swig_obj[0]; } - result = (int)ENGINE_set_default(arg1,arg2); + result = (PyObject *)util_string_to_hex(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } return resultobj; fail: @@ -29282,92 +29939,67 @@ fail: } -SWIGINTERN PyObject *_wrap_obj_nid2obj(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ec_key_new(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - ASN1_OBJECT *result = 0 ; + EC_KEY *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 ); + if (!SWIG_Python_UnpackTuple(args, "ec_key_new", 0, 0, 0)) SWIG_fail; + 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_obj_nid2ln(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ec_key_free(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - int arg1 ; - int val1 ; - int ecode1 = 0 ; - PyObject * obj0 = 0 ; - char *result = 0 ; + EC_KEY *arg1 = (EC_KEY *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; - 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); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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_obj_nid2sn(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ec_key_size(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 ; + EC_KEY *arg1 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - PyObject * obj0 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_obj2nid" "', argument " "1"" of type '" "ASN1_OBJECT const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_size" "', argument " "1"" of type '" "EC_KEY const *""'"); } - arg1 = (ASN1_OBJECT *)(argp1); + arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)OBJ_obj2nid((ASN1_OBJECT const *)arg1); + result = (int)ECDSA_size((EC_KEY const *)arg1); { resultobj=PyLong_FromLong(result); if (PyErr_Occurred()) SWIG_fail; @@ -29378,233 +30010,200 @@ fail: } -SWIGINTERN PyObject *_wrap_obj_ln2nid(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ec_key_gen_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; + EC_KEY *arg1 = (EC_KEY *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; int result; - if(!PyArg_UnpackTuple(args,(char *)"obj_ln2nid",1,1,&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_ln2nid" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_gen_key" "', argument " "1"" of type '" "EC_KEY *""'"); } - arg1 = (char *)(buf1); + arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)OBJ_ln2nid((char const *)arg1); + result = (int)EC_KEY_generate_key(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) { +SWIGINTERN PyObject *_wrap_ec_key_check_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - char *arg1 = (char *) 0 ; - int res1 ; - char *buf1 = 0 ; - int alloc1 = 0 ; - PyObject * obj0 = 0 ; + EC_KEY *arg1 = (EC_KEY *) 0 ; + void *argp1 = 0 ; + int res1 = 0 ; + PyObject *swig_obj[1] ; int result; - if(!PyArg_UnpackTuple(args,(char *)"obj_sn2nid",1,1,&obj0)) SWIG_fail; - res1 = SWIG_AsCharPtrAndSize(obj0, &buf1, NULL, &alloc1); + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_sn2nid" "', argument " "1"" of type '" "char const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_check_key" "', argument " "1"" of type '" "EC_KEY const *""'"); } - arg1 = (char *)(buf1); + arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)OBJ_sn2nid((char const *)arg1); + result = (int)EC_KEY_check_key((EC_KEY 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); +SWIGINTERN int Swig_var__ec_err_set(PyObject *_val) { { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + 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); } - result = (int)OBJ_txt2nid((char const *)arg1); + 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 *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + arg1=swig_obj[0]; } - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); + ec_init(arg1); + resultobj = SWIG_Py_Void(); return resultobj; fail: - if (alloc1 == SWIG_NEWOBJ) free((char*)buf1); return NULL; } -SWIGINTERN PyObject *_wrap_obj_txt2obj(PyObject *self, PyObject *args) { +SWIGINTERN PyObject *_wrap_ec_get_builtin_curves(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 ; + PyObject *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 (!SWIG_Python_UnpackTuple(args, "ec_get_builtin_curves", 0, 0, 0)) SWIG_fail; + result = (PyObject *)ec_get_builtin_curves(); { - if (!arg1) { - SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); - } + resultobj=result; } - 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) { +SWIGINTERN PyObject *_wrap_ec_key_new_by_curve_name(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; + int arg1 ; + int val1 ; + int ecode1 = 0 ; + PyObject *swig_obj[1] ; + EC_KEY *result = 0 ; - 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""'"); + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &val1); + if (!SWIG_IsOK(ecode1)) { + SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ec_key_new_by_curve_name" "', argument " "1"" 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 *""'"); + 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 *swig_obj[1] ; + PyObject *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *""'"); } - 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); + arg1 = (EC_KEY *)(argp1); { - if (!arg3) { + if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (int)OBJ_obj2txt(arg1,arg2,(ASN1_OBJECT const *)arg3,arg4); + result = (PyObject *)ec_key_get_public_der(arg1); { - resultobj=PyLong_FromLong(result); - if (PyErr_Occurred()) SWIG_fail; + resultobj=result; } - 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) { +SWIGINTERN PyObject *_wrap_ec_key_get_public_key(PyObject *self, PyObject *args) { PyObject *resultobj = 0; - ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ; - int arg2 ; + EC_KEY *arg1 = (EC_KEY *) 0 ; void *argp1 = 0 ; int res1 = 0 ; - int val2 ; - int ecode2 = 0 ; - PyObject * obj0 = 0 ; - PyObject * obj1 = 0 ; + PyObject *swig_obj[1] ; 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 (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 | 0 ); if (!SWIG_IsOK(res1)) { - SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_obj2txt" "', argument " "1"" of type '" "ASN1_OBJECT const *""'"); + SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_get_public_key" "', argument " "1"" of type '" "EC_KEY *""'"); } - 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); + arg1 = (EC_KEY *)(argp1); { if (!arg1) { SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); } } - result = (PyObject *)obj_obj2txt((ASN1_OBJECT const *)arg1,arg2); + result = (PyObject *)ec_key_get_public_key(arg1); { resultobj=result; } @@ -29614,1213 +30213,2379 @@ fail: } -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_store_set_flags", _wrap_x509_store_set_flags, 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); +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 *swig_obj[1] ; + EC_KEY *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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."); } } - Py_DECREF(tuple); - return result; + { + 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 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 - }, +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 *swig_obj[2] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "ec_key_write_pubkey", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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); { - (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 - }, + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } { - (lenfunc) 0, /* mp_length */ - (binaryfunc) 0, /* mp_subscript */ - (objobjargproc) 0, /* mp_ass_subscript */ - }, + if (!arg2) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } { - (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 */ - }, + SWIG_PYTHON_THREAD_BEGIN_ALLOW; + result = (int)ec_key_write_pubkey(arg1,arg2); + SWIG_PYTHON_THREAD_END_ALLOW; + } { -#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}; + resultobj=PyLong_FromLong(result); + if (PyErr_Occurred()) SWIG_fail; + } + return resultobj; +fail: + return NULL; +} -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); +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 *swig_obj[2] ; + EC_KEY *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "ec_key_read_bio", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; } + arg2=swig_obj[1]; } - Py_DECREF(tuple); - return result; + { + 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 PyMethodDef SwigPyBuiltin__stack_st_OPENSSL_STRING_methods[] = { - { NULL, NULL, 0, NULL } /* Sentinel */ -}; -static PyHeapTypeObject SwigPyBuiltin__stack_st_OPENSSL_STRING_type = { +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 *swig_obj[4] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "ec_key_write_bio", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2], &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 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 - }, + if (!PyCallable_Check(swig_obj[3])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; + } + arg4=swig_obj[3]; + } { - (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 - }, + if (!arg1) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } { - (lenfunc) 0, /* mp_length */ - (binaryfunc) 0, /* mp_subscript */ - (objobjargproc) 0, /* mp_ass_subscript */ - }, + if (!arg2) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } { - (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 (!arg3) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } { -#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}; + 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; +} -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); +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 *swig_obj[3] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "ec_key_write_bio_no_cipher", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2])) { + PyErr_SetString(PyExc_TypeError, "expected PyCallable"); + return NULL; } + arg3=swig_obj[2]; } - Py_DECREF(tuple); - return result; + { + 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 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 - }, +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 *swig_obj[1] ; + PyObject *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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); { - (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 - }, + 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 *swig_obj[1] ; + PyObject *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *swig_obj[2] ; + PyObject *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "ecdsa_sign", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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=swig_obj[1]; + } + { + 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 *swig_obj[4] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "ecdsa_verify", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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=swig_obj[1]; + } + { + arg3=swig_obj[2]; + } + { + arg4=swig_obj[3]; + } + { + 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 *swig_obj[2] ; + PyObject *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "ecdsa_sign_asn1", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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=swig_obj[1]; + } + { + 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 *swig_obj[3] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "ecdsa_verify_asn1", 3, 3, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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=swig_obj[1]; + } + { + arg3=swig_obj[2]; + } + { + 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 *swig_obj[2] ; + PyObject *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "ecdh_compute_key", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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 *swig_obj[1] ; + EC_KEY *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + { + arg1=swig_obj[0]; + } + 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 *swig_obj[2] ; + EC_KEY *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "ec_key_from_pubkey_params", 2, 2, swig_obj)) SWIG_fail; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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=swig_obj[1]; + } + 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 *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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; + + if (!SWIG_Python_UnpackTuple(args, "engine_load_builtin_engines", 0, 0, 0)) SWIG_fail; + 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; + + if (!SWIG_Python_UnpackTuple(args, "engine_load_dynamic", 0, 0, 0)) SWIG_fail; + 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; + + if (!SWIG_Python_UnpackTuple(args, "engine_load_openssl", 0, 0, 0)) SWIG_fail; + ENGINE_load_openssl(); + resultobj = SWIG_Py_Void(); + return resultobj; +fail: + return NULL; +} + + +SWIGINTERN PyObject *_wrap_engine_cleanup(PyObject *self, PyObject *args) { + PyObject *resultobj = 0; + + if (!SWIG_Python_UnpackTuple(args, "engine_cleanup", 0, 0, 0)) SWIG_fail; + 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 ; + + if (!SWIG_Python_UnpackTuple(args, "engine_new", 0, 0, 0)) SWIG_fail; + 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 *swig_obj[1] ; + ENGINE *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &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 *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *swig_obj[1] ; + char *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *swig_obj[1] ; + char *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *swig_obj[4] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "engine_ctrl_cmd_string", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3], &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 ; + + if (!SWIG_Python_UnpackTuple(args, "ui_openssl", 0, 0, 0)) SWIG_fail; + 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 *swig_obj[2] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + 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(swig_obj[0], &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(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 ; + PyObject *swig_obj[1] ; + char *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "_cbd_t_password_get", 0, 0, 0)) 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_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 *swig_obj[2] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + 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(swig_obj[0], &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(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 ; + PyObject *swig_obj[1] ; + char *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "_cbd_t_prompt_get", 0, 0, 0)) 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_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 *kwargs) { + PyObject *resultobj = 0; + _cbd_t *result = 0 ; + + if (!SWIG_Python_CheckNoKeywords(kwargs, "new__cbd_t")) SWIG_fail; + if (!SWIG_Python_UnpackTuple(args, "new__cbd_t", 0, 0, 0)) SWIG_fail; + 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 ; + PyObject *swig_obj[1] ; + + if (!SWIG_Python_UnpackTuple(args, "delete__cbd_t", 0, 0, 0)) SWIG_fail; + 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; +} + + +SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete__cbd_t) /* defines _wrap_delete__cbd_t_destructor_closure */ + +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 *swig_obj[1] ; + void *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &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 *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0],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 *swig_obj[4] ; + EVP_PKEY *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "engine_load_private_key", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3],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 *swig_obj[4] ; + EVP_PKEY *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "engine_load_public_key", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3],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 *swig_obj[1] ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + { + arg1=swig_obj[0]; + } + 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 *swig_obj[2] ; + X509 *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "engine_load_certificate", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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 *swig_obj[2] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "engine_set_default", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &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 *swig_obj[1] ; + ASN1_OBJECT *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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 *swig_obj[1] ; + char *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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 *swig_obj[1] ; + char *result = 0 ; + + if (!args) SWIG_fail; + swig_obj[0] = args; + ecode1 = SWIG_AsVal_int(swig_obj[0], &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 *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_ConvertPtr(swig_obj[0], &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 *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &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 *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &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 *swig_obj[1] ; + int result; + + if (!args) SWIG_fail; + swig_obj[0] = args; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &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 *swig_obj[2] ; + ASN1_OBJECT *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "obj_txt2obj", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &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(swig_obj[1], &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 *swig_obj[4] ; + int result; + + if (!SWIG_Python_UnpackTuple(args, "_obj_obj2txt", 4, 4, swig_obj)) SWIG_fail; + res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &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(swig_obj[1], &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(swig_obj[2], &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(swig_obj[3], &val4); + if (!SWIG_IsOK(ecode4)) { + SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_obj_obj2txt" "', argument " "4"" of type '" "int""'"); + } + arg4 = (int)(val4); { - (lenfunc) 0, /* mp_length */ - (binaryfunc) 0, /* mp_subscript */ - (objobjargproc) 0, /* mp_ass_subscript */ - }, + if (!arg3) { + SWIG_exception(SWIG_ValueError,"Received a NULL pointer."); + } + } + result = (int)OBJ_obj2txt(arg1,arg2,(ASN1_OBJECT const *)arg3,arg4); { - (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 */ - }, + 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 *swig_obj[2] ; + PyObject *result = 0 ; + + if (!SWIG_Python_UnpackTuple(args, "obj_obj2txt", 2, 2, swig_obj)) SWIG_fail; + res1 = SWIG_ConvertPtr(swig_obj[0], &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(swig_obj[1], &val2); + if (!SWIG_IsOK(ecode2)) { + SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "obj_obj2txt" "', argument " "2"" of type '" "int""'"); + } + arg2 = (int)(val2); { -#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 */ + 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[] = { + { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL}, + { "OPENSSL_sk_num", _wrap_OPENSSL_sk_num, METH_O, NULL}, + { "OPENSSL_sk_value", _wrap_OPENSSL_sk_value, METH_VARARGS, NULL}, + { "OPENSSL_sk_set", _wrap_OPENSSL_sk_set, METH_VARARGS, NULL}, + { "OPENSSL_sk_new", _wrap_OPENSSL_sk_new, METH_O, NULL}, + { "OPENSSL_sk_new_null", _wrap_OPENSSL_sk_new_null, METH_NOARGS, NULL}, + { "OPENSSL_sk_new_reserve", _wrap_OPENSSL_sk_new_reserve, METH_VARARGS, NULL}, + { "OPENSSL_sk_reserve", _wrap_OPENSSL_sk_reserve, METH_VARARGS, NULL}, + { "OPENSSL_sk_free", _wrap_OPENSSL_sk_free, METH_O, NULL}, + { "OPENSSL_sk_pop_free", _wrap_OPENSSL_sk_pop_free, METH_VARARGS, NULL}, + { "OPENSSL_sk_deep_copy", _wrap_OPENSSL_sk_deep_copy, METH_VARARGS, NULL}, + { "OPENSSL_sk_insert", _wrap_OPENSSL_sk_insert, METH_VARARGS, NULL}, + { "OPENSSL_sk_delete", _wrap_OPENSSL_sk_delete, METH_VARARGS, NULL}, + { "OPENSSL_sk_delete_ptr", _wrap_OPENSSL_sk_delete_ptr, METH_VARARGS, NULL}, + { "OPENSSL_sk_find", _wrap_OPENSSL_sk_find, METH_VARARGS, NULL}, + { "OPENSSL_sk_find_ex", _wrap_OPENSSL_sk_find_ex, METH_VARARGS, NULL}, + { "OPENSSL_sk_push", _wrap_OPENSSL_sk_push, METH_VARARGS, NULL}, + { "OPENSSL_sk_unshift", _wrap_OPENSSL_sk_unshift, METH_VARARGS, NULL}, + { "OPENSSL_sk_shift", _wrap_OPENSSL_sk_shift, METH_O, NULL}, + { "OPENSSL_sk_pop", _wrap_OPENSSL_sk_pop, METH_O, NULL}, + { "OPENSSL_sk_zero", _wrap_OPENSSL_sk_zero, METH_O, NULL}, + { "OPENSSL_sk_set_cmp_func", _wrap_OPENSSL_sk_set_cmp_func, METH_VARARGS, NULL}, + { "OPENSSL_sk_dup", _wrap_OPENSSL_sk_dup, METH_O, NULL}, + { "OPENSSL_sk_sort", _wrap_OPENSSL_sk_sort, METH_O, NULL}, + { "OPENSSL_sk_is_sorted", _wrap_OPENSSL_sk_is_sorted, METH_O, NULL}, + { "sk_OPENSSL_STRING_num", _wrap_sk_OPENSSL_STRING_num, METH_O, NULL}, + { "sk_OPENSSL_STRING_value", _wrap_sk_OPENSSL_STRING_value, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_new", _wrap_sk_OPENSSL_STRING_new, METH_O, NULL}, + { "sk_OPENSSL_STRING_new_null", _wrap_sk_OPENSSL_STRING_new_null, METH_NOARGS, NULL}, + { "sk_OPENSSL_STRING_new_reserve", _wrap_sk_OPENSSL_STRING_new_reserve, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_reserve", _wrap_sk_OPENSSL_STRING_reserve, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_free", _wrap_sk_OPENSSL_STRING_free, METH_O, NULL}, + { "sk_OPENSSL_STRING_zero", _wrap_sk_OPENSSL_STRING_zero, METH_O, NULL}, + { "sk_OPENSSL_STRING_delete", _wrap_sk_OPENSSL_STRING_delete, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_delete_ptr", _wrap_sk_OPENSSL_STRING_delete_ptr, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_push", _wrap_sk_OPENSSL_STRING_push, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_unshift", _wrap_sk_OPENSSL_STRING_unshift, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_pop", _wrap_sk_OPENSSL_STRING_pop, METH_O, NULL}, + { "sk_OPENSSL_STRING_shift", _wrap_sk_OPENSSL_STRING_shift, METH_O, NULL}, + { "sk_OPENSSL_STRING_pop_free", _wrap_sk_OPENSSL_STRING_pop_free, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_insert", _wrap_sk_OPENSSL_STRING_insert, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_set", _wrap_sk_OPENSSL_STRING_set, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_find", _wrap_sk_OPENSSL_STRING_find, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_find_ex", _wrap_sk_OPENSSL_STRING_find_ex, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_sort", _wrap_sk_OPENSSL_STRING_sort, METH_O, NULL}, + { "sk_OPENSSL_STRING_is_sorted", _wrap_sk_OPENSSL_STRING_is_sorted, METH_O, NULL}, + { "sk_OPENSSL_STRING_dup", _wrap_sk_OPENSSL_STRING_dup, METH_O, NULL}, + { "sk_OPENSSL_STRING_deep_copy", _wrap_sk_OPENSSL_STRING_deep_copy, METH_VARARGS, NULL}, + { "sk_OPENSSL_STRING_set_cmp_func", _wrap_sk_OPENSSL_STRING_set_cmp_func, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_num", _wrap_sk_OPENSSL_CSTRING_num, METH_O, NULL}, + { "sk_OPENSSL_CSTRING_value", _wrap_sk_OPENSSL_CSTRING_value, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_new", _wrap_sk_OPENSSL_CSTRING_new, METH_O, NULL}, + { "sk_OPENSSL_CSTRING_new_null", _wrap_sk_OPENSSL_CSTRING_new_null, METH_NOARGS, NULL}, + { "sk_OPENSSL_CSTRING_new_reserve", _wrap_sk_OPENSSL_CSTRING_new_reserve, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_reserve", _wrap_sk_OPENSSL_CSTRING_reserve, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_free", _wrap_sk_OPENSSL_CSTRING_free, METH_O, NULL}, + { "sk_OPENSSL_CSTRING_zero", _wrap_sk_OPENSSL_CSTRING_zero, METH_O, NULL}, + { "sk_OPENSSL_CSTRING_delete", _wrap_sk_OPENSSL_CSTRING_delete, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_delete_ptr", _wrap_sk_OPENSSL_CSTRING_delete_ptr, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_push", _wrap_sk_OPENSSL_CSTRING_push, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_unshift", _wrap_sk_OPENSSL_CSTRING_unshift, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_pop", _wrap_sk_OPENSSL_CSTRING_pop, METH_O, NULL}, + { "sk_OPENSSL_CSTRING_shift", _wrap_sk_OPENSSL_CSTRING_shift, METH_O, NULL}, + { "sk_OPENSSL_CSTRING_pop_free", _wrap_sk_OPENSSL_CSTRING_pop_free, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_insert", _wrap_sk_OPENSSL_CSTRING_insert, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_set", _wrap_sk_OPENSSL_CSTRING_set, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_find", _wrap_sk_OPENSSL_CSTRING_find, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_find_ex", _wrap_sk_OPENSSL_CSTRING_find_ex, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_sort", _wrap_sk_OPENSSL_CSTRING_sort, METH_O, NULL}, + { "sk_OPENSSL_CSTRING_is_sorted", _wrap_sk_OPENSSL_CSTRING_is_sorted, METH_O, NULL}, + { "sk_OPENSSL_CSTRING_dup", _wrap_sk_OPENSSL_CSTRING_dup, METH_O, NULL}, + { "sk_OPENSSL_CSTRING_deep_copy", _wrap_sk_OPENSSL_CSTRING_deep_copy, METH_VARARGS, NULL}, + { "sk_OPENSSL_CSTRING_set_cmp_func", _wrap_sk_OPENSSL_CSTRING_set_cmp_func, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_num", _wrap_sk_OPENSSL_BLOCK_num, METH_O, NULL}, + { "sk_OPENSSL_BLOCK_value", _wrap_sk_OPENSSL_BLOCK_value, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_new", _wrap_sk_OPENSSL_BLOCK_new, METH_O, NULL}, + { "sk_OPENSSL_BLOCK_new_null", _wrap_sk_OPENSSL_BLOCK_new_null, METH_NOARGS, NULL}, + { "sk_OPENSSL_BLOCK_new_reserve", _wrap_sk_OPENSSL_BLOCK_new_reserve, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_reserve", _wrap_sk_OPENSSL_BLOCK_reserve, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_free", _wrap_sk_OPENSSL_BLOCK_free, METH_O, NULL}, + { "sk_OPENSSL_BLOCK_zero", _wrap_sk_OPENSSL_BLOCK_zero, METH_O, NULL}, + { "sk_OPENSSL_BLOCK_delete", _wrap_sk_OPENSSL_BLOCK_delete, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_delete_ptr", _wrap_sk_OPENSSL_BLOCK_delete_ptr, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_push", _wrap_sk_OPENSSL_BLOCK_push, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_unshift", _wrap_sk_OPENSSL_BLOCK_unshift, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_pop", _wrap_sk_OPENSSL_BLOCK_pop, METH_O, NULL}, + { "sk_OPENSSL_BLOCK_shift", _wrap_sk_OPENSSL_BLOCK_shift, METH_O, NULL}, + { "sk_OPENSSL_BLOCK_pop_free", _wrap_sk_OPENSSL_BLOCK_pop_free, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_insert", _wrap_sk_OPENSSL_BLOCK_insert, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_set", _wrap_sk_OPENSSL_BLOCK_set, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_find", _wrap_sk_OPENSSL_BLOCK_find, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_find_ex", _wrap_sk_OPENSSL_BLOCK_find_ex, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_sort", _wrap_sk_OPENSSL_BLOCK_sort, METH_O, NULL}, + { "sk_OPENSSL_BLOCK_is_sorted", _wrap_sk_OPENSSL_BLOCK_is_sorted, METH_O, NULL}, + { "sk_OPENSSL_BLOCK_dup", _wrap_sk_OPENSSL_BLOCK_dup, METH_O, NULL}, + { "sk_OPENSSL_BLOCK_deep_copy", _wrap_sk_OPENSSL_BLOCK_deep_copy, METH_VARARGS, NULL}, + { "sk_OPENSSL_BLOCK_set_cmp_func", _wrap_sk_OPENSSL_BLOCK_set_cmp_func, METH_VARARGS, NULL}, + { "threading_init", _wrap_threading_init, METH_NOARGS, NULL}, + { "threading_cleanup", _wrap_threading_cleanup, METH_NOARGS, NULL}, + { "lib_init", _wrap_lib_init, METH_NOARGS, NULL}, + { "bn_to_mpi", _wrap_bn_to_mpi, METH_O, NULL}, + { "mpi_to_bn", _wrap_mpi_to_bn, METH_O, NULL}, + { "bn_to_bin", _wrap_bn_to_bin, METH_O, NULL}, + { "bin_to_bn", _wrap_bin_to_bn, METH_O, NULL}, + { "bn_to_hex", _wrap_bn_to_hex, METH_O, NULL}, + { "hex_to_bn", _wrap_hex_to_bn, METH_O, NULL}, + { "dec_to_bn", _wrap_dec_to_bn, METH_O, NULL}, + { "err_print_errors", _wrap_err_print_errors, METH_O, NULL}, + { "err_get_error", _wrap_err_get_error, METH_NOARGS, NULL}, + { "err_peek_error", _wrap_err_peek_error, METH_NOARGS, NULL}, + { "err_lib_error_string", _wrap_err_lib_error_string, METH_O, NULL}, + { "err_func_error_string", _wrap_err_func_error_string, METH_O, NULL}, + { "err_reason_error_string", _wrap_err_reason_error_string, METH_O, NULL}, + { "bio_s_bio", _wrap_bio_s_bio, METH_NOARGS, NULL}, + { "bio_s_mem", _wrap_bio_s_mem, METH_NOARGS, NULL}, + { "bio_s_socket", _wrap_bio_s_socket, METH_NOARGS, NULL}, + { "bio_f_ssl", _wrap_bio_f_ssl, METH_NOARGS, NULL}, + { "bio_f_buffer", _wrap_bio_f_buffer, METH_NOARGS, NULL}, + { "bio_f_cipher", _wrap_bio_f_cipher, METH_NOARGS, NULL}, + { "bio_new", _wrap_bio_new, METH_O, NULL}, + { "bio_new_socket", _wrap_bio_new_socket, METH_VARARGS, NULL}, + { "bio_free_all", _wrap_bio_free_all, METH_O, NULL}, + { "bio_dup_chain", _wrap_bio_dup_chain, METH_O, NULL}, + { "bio_push", _wrap_bio_push, METH_VARARGS, NULL}, + { "bio_pop", _wrap_bio_pop, METH_O, NULL}, + { "bio_eof", _wrap_bio_eof, METH_O, NULL}, + { "pyfd_init", _wrap_pyfd_init, METH_NOARGS, NULL}, + { "bio_init", _wrap_bio_init, METH_O, NULL}, + { "bio_free", _wrap_bio_free, METH_O, NULL}, + { "bio_new_file", _wrap_bio_new_file, METH_VARARGS, NULL}, + { "bio_new_pyfile", _wrap_bio_new_pyfile, METH_VARARGS, NULL}, + { "bio_read", _wrap_bio_read, METH_VARARGS, NULL}, + { "bio_gets", _wrap_bio_gets, METH_VARARGS, NULL}, + { "bio_write", _wrap_bio_write, METH_VARARGS, NULL}, + { "bio_ctrl_pending", _wrap_bio_ctrl_pending, METH_O, NULL}, + { "bio_ctrl_wpending", _wrap_bio_ctrl_wpending, METH_O, NULL}, + { "bio_ctrl_get_write_guarantee", _wrap_bio_ctrl_get_write_guarantee, METH_O, NULL}, + { "bio_reset", _wrap_bio_reset, METH_O, NULL}, + { "bio_flush", _wrap_bio_flush, METH_O, NULL}, + { "bio_seek", _wrap_bio_seek, METH_VARARGS, NULL}, + { "bio_tell", _wrap_bio_tell, METH_O, NULL}, + { "bio_set_flags", _wrap_bio_set_flags, METH_VARARGS, NULL}, + { "bio_get_flags", _wrap_bio_get_flags, METH_O, NULL}, + { "bio_set_cipher", _wrap_bio_set_cipher, METH_VARARGS, NULL}, + { "bio_set_mem_eof_return", _wrap_bio_set_mem_eof_return, METH_VARARGS, NULL}, + { "bio_get_fd", _wrap_bio_get_fd, METH_O, NULL}, + { "bio_do_handshake", _wrap_bio_do_handshake, METH_O, NULL}, + { "bio_make_bio_pair", _wrap_bio_make_bio_pair, METH_VARARGS, NULL}, + { "bio_set_write_buf_size", _wrap_bio_set_write_buf_size, METH_VARARGS, NULL}, + { "bio_should_retry", _wrap_bio_should_retry, METH_O, NULL}, + { "bio_should_read", _wrap_bio_should_read, METH_O, NULL}, + { "bio_should_write", _wrap_bio_should_write, METH_O, NULL}, + { "pyfd_write", _wrap_pyfd_write, METH_VARARGS, NULL}, + { "pyfd_read", _wrap_pyfd_read, METH_VARARGS, NULL}, + { "pyfd_puts", _wrap_pyfd_puts, METH_VARARGS, NULL}, + { "pyfd_gets", _wrap_pyfd_gets, METH_VARARGS, NULL}, + { "pyfd_new", _wrap_pyfd_new, METH_O, NULL}, + { "pyfd_free", _wrap_pyfd_free, METH_O, NULL}, + { "pyfd_ctrl", _wrap_pyfd_ctrl, METH_VARARGS, NULL}, + { "bio_new_pyfd", _wrap_bio_new_pyfd, METH_VARARGS, NULL}, + { "bn_rand", _wrap_bn_rand, METH_VARARGS, NULL}, + { "bn_rand_range", _wrap_bn_rand_range, METH_O, NULL}, + { "rand_load_file", _wrap_rand_load_file, METH_VARARGS, NULL}, + { "rand_save_file", _wrap_rand_save_file, METH_O, NULL}, + { "rand_poll", _wrap_rand_poll, METH_NOARGS, NULL}, + { "rand_status", _wrap_rand_status, METH_NOARGS, NULL}, + { "rand_cleanup", _wrap_rand_cleanup, METH_NOARGS, NULL}, + { "rand_init", _wrap_rand_init, METH_O, NULL}, + { "rand_seed", _wrap_rand_seed, METH_O, NULL}, + { "rand_add", _wrap_rand_add, METH_VARARGS, NULL}, + { "rand_bytes", _wrap_rand_bytes, METH_O, NULL}, + { "rand_pseudo_bytes", _wrap_rand_pseudo_bytes, METH_O, NULL}, + { "rand_file_name", _wrap_rand_file_name, METH_VARARGS, NULL}, + { "rand_screen", _wrap_rand_screen, METH_NOARGS, NULL}, + { "rand_win32_event", _wrap_rand_win32_event, METH_VARARGS, NULL}, + { "md5", _wrap_md5, METH_NOARGS, NULL}, + { "sha1", _wrap_sha1, METH_NOARGS, NULL}, + { "ripemd160", _wrap_ripemd160, METH_NOARGS, NULL}, + { "sha224", _wrap_sha224, METH_NOARGS, NULL}, + { "sha256", _wrap_sha256, METH_NOARGS, NULL}, + { "sha384", _wrap_sha384, METH_NOARGS, NULL}, + { "sha512", _wrap_sha512, METH_NOARGS, NULL}, + { "digest_init", _wrap_digest_init, METH_VARARGS, NULL}, + { "des_ecb", _wrap_des_ecb, METH_NOARGS, NULL}, + { "des_ede_ecb", _wrap_des_ede_ecb, METH_NOARGS, NULL}, + { "des_ede3_ecb", _wrap_des_ede3_ecb, METH_NOARGS, NULL}, + { "des_cbc", _wrap_des_cbc, METH_NOARGS, NULL}, + { "des_ede_cbc", _wrap_des_ede_cbc, METH_NOARGS, NULL}, + { "des_ede3_cbc", _wrap_des_ede3_cbc, METH_NOARGS, NULL}, + { "des_cfb", _wrap_des_cfb, METH_NOARGS, NULL}, + { "des_ede_cfb", _wrap_des_ede_cfb, METH_NOARGS, NULL}, + { "des_ede3_cfb", _wrap_des_ede3_cfb, METH_NOARGS, NULL}, + { "des_ofb", _wrap_des_ofb, METH_NOARGS, NULL}, + { "des_ede_ofb", _wrap_des_ede_ofb, METH_NOARGS, NULL}, + { "des_ede3_ofb", _wrap_des_ede3_ofb, METH_NOARGS, NULL}, + { "bf_ecb", _wrap_bf_ecb, METH_NOARGS, NULL}, + { "bf_cbc", _wrap_bf_cbc, METH_NOARGS, NULL}, + { "bf_cfb", _wrap_bf_cfb, METH_NOARGS, NULL}, + { "bf_ofb", _wrap_bf_ofb, METH_NOARGS, NULL}, + { "cast5_ecb", _wrap_cast5_ecb, METH_NOARGS, NULL}, + { "cast5_cbc", _wrap_cast5_cbc, METH_NOARGS, NULL}, + { "cast5_cfb", _wrap_cast5_cfb, METH_NOARGS, NULL}, + { "cast5_ofb", _wrap_cast5_ofb, METH_NOARGS, NULL}, + { "rc4", _wrap_rc4, METH_NOARGS, NULL}, + { "rc2_40_cbc", _wrap_rc2_40_cbc, METH_NOARGS, NULL}, + { "aes_128_ecb", _wrap_aes_128_ecb, METH_NOARGS, NULL}, + { "aes_128_cbc", _wrap_aes_128_cbc, METH_NOARGS, NULL}, + { "aes_128_cfb", _wrap_aes_128_cfb, METH_NOARGS, NULL}, + { "aes_128_ofb", _wrap_aes_128_ofb, METH_NOARGS, NULL}, + { "aes_128_ctr", _wrap_aes_128_ctr, METH_NOARGS, NULL}, + { "aes_192_ecb", _wrap_aes_192_ecb, METH_NOARGS, NULL}, + { "aes_192_cbc", _wrap_aes_192_cbc, METH_NOARGS, NULL}, + { "aes_192_cfb", _wrap_aes_192_cfb, METH_NOARGS, NULL}, + { "aes_192_ofb", _wrap_aes_192_ofb, METH_NOARGS, NULL}, + { "aes_192_ctr", _wrap_aes_192_ctr, METH_NOARGS, NULL}, + { "aes_256_ecb", _wrap_aes_256_ecb, METH_NOARGS, NULL}, + { "aes_256_cbc", _wrap_aes_256_cbc, METH_NOARGS, NULL}, + { "aes_256_cfb", _wrap_aes_256_cfb, METH_NOARGS, NULL}, + { "aes_256_ofb", _wrap_aes_256_ofb, METH_NOARGS, NULL}, + { "aes_256_ctr", _wrap_aes_256_ctr, METH_NOARGS, NULL}, + { "cipher_set_padding", _wrap_cipher_set_padding, METH_VARARGS, NULL}, + { "pkey_free", _wrap_pkey_free, METH_O, NULL}, + { "pkey_assign", _wrap_pkey_assign, METH_VARARGS, NULL}, + { "pkey_assign_ec", _wrap_pkey_assign_ec, METH_VARARGS, NULL}, + { "pkey_set1_rsa", _wrap_pkey_set1_rsa, METH_VARARGS, NULL}, + { "sign_init", _wrap_sign_init, METH_VARARGS, NULL}, + { "verify_init", _wrap_verify_init, METH_VARARGS, NULL}, + { "pkey_size", _wrap_pkey_size, METH_O, NULL}, + { "evp_init", _wrap_evp_init, METH_O, NULL}, + { "pkey_get1_rsa", _wrap_pkey_get1_rsa, METH_O, NULL}, + { "pkcs5_pbkdf2_hmac_sha1", _wrap_pkcs5_pbkdf2_hmac_sha1, METH_VARARGS, NULL}, + { "md_ctx_new", _wrap_md_ctx_new, METH_NOARGS, NULL}, + { "md_ctx_free", _wrap_md_ctx_free, METH_O, NULL}, + { "digest_update", _wrap_digest_update, METH_VARARGS, NULL}, + { "digest_final", _wrap_digest_final, METH_O, NULL}, + { "hmac_ctx_new", _wrap_hmac_ctx_new, METH_NOARGS, NULL}, + { "hmac_ctx_free", _wrap_hmac_ctx_free, METH_O, NULL}, + { "hmac_init", _wrap_hmac_init, METH_VARARGS, NULL}, + { "hmac_update", _wrap_hmac_update, METH_VARARGS, NULL}, + { "hmac_final", _wrap_hmac_final, METH_O, NULL}, + { "hmac", _wrap_hmac, METH_VARARGS, NULL}, + { "cipher_ctx_new", _wrap_cipher_ctx_new, METH_NOARGS, NULL}, + { "cipher_ctx_free", _wrap_cipher_ctx_free, METH_O, NULL}, + { "bytes_to_key", _wrap_bytes_to_key, METH_VARARGS, NULL}, + { "cipher_init", _wrap_cipher_init, METH_VARARGS, NULL}, + { "cipher_update", _wrap_cipher_update, METH_VARARGS, NULL}, + { "cipher_final", _wrap_cipher_final, METH_O, NULL}, + { "sign_update", _wrap_sign_update, METH_VARARGS, NULL}, + { "sign_final", _wrap_sign_final, METH_VARARGS, NULL}, + { "verify_update", _wrap_verify_update, METH_VARARGS, NULL}, + { "verify_final", _wrap_verify_final, METH_VARARGS, NULL}, + { "digest_sign_init", _wrap_digest_sign_init, METH_VARARGS, NULL}, + { "digest_sign_update", _wrap_digest_sign_update, METH_VARARGS, NULL}, + { "digest_sign_final", _wrap_digest_sign_final, METH_O, NULL}, + { "digest_sign", _wrap_digest_sign, METH_VARARGS, NULL}, + { "digest_verify_init", _wrap_digest_verify_init, METH_VARARGS, NULL}, + { "digest_verify_update", _wrap_digest_verify_update, METH_VARARGS, NULL}, + { "digest_verify_final", _wrap_digest_verify_final, METH_VARARGS, NULL}, + { "digest_verify", _wrap_digest_verify, METH_VARARGS, NULL}, + { "get_digestbyname", _wrap_get_digestbyname, METH_O, NULL}, + { "pkey_write_pem_no_cipher", _wrap_pkey_write_pem_no_cipher, METH_VARARGS, NULL}, + { "pkey_write_pem", _wrap_pkey_write_pem, METH_VARARGS, NULL}, + { "pkey_new", _wrap_pkey_new, METH_NOARGS, NULL}, + { "pkey_read_pem", _wrap_pkey_read_pem, METH_VARARGS, NULL}, + { "pkey_read_pem_pubkey", _wrap_pkey_read_pem_pubkey, METH_VARARGS, NULL}, + { "pkey_assign_rsa", _wrap_pkey_assign_rsa, METH_VARARGS, NULL}, + { "pkey_as_der", _wrap_pkey_as_der, METH_O, NULL}, + { "pkey_get_modulus", _wrap_pkey_get_modulus, METH_O, NULL}, + { "aes_new", _wrap_aes_new, METH_NOARGS, NULL}, + { "AES_free", _wrap_AES_free, METH_O, NULL}, + { "AES_set_key", _wrap_AES_set_key, METH_VARARGS, NULL}, + { "AES_crypt", _wrap_AES_crypt, METH_VARARGS, NULL}, + { "AES_type_check", _wrap_AES_type_check, METH_O, NULL}, + { "rc4_new", _wrap_rc4_new, METH_NOARGS, NULL}, + { "rc4_free", _wrap_rc4_free, METH_O, NULL}, + { "rc4_set_key", _wrap_rc4_set_key, METH_VARARGS, NULL}, + { "rc4_update", _wrap_rc4_update, METH_VARARGS, NULL}, + { "rc4_type_check", _wrap_rc4_type_check, METH_O, NULL}, + { "dh_new", _wrap_dh_new, METH_NOARGS, NULL}, + { "dh_free", _wrap_dh_free, METH_O, NULL}, + { "dh_size", _wrap_dh_size, METH_O, NULL}, + { "dh_generate_key", _wrap_dh_generate_key, METH_O, NULL}, + { "dhparams_print", _wrap_dhparams_print, METH_VARARGS, NULL}, + { "dh_init", _wrap_dh_init, METH_O, NULL}, + { "dh_type_check", _wrap_dh_type_check, METH_O, NULL}, + { "dh_read_parameters", _wrap_dh_read_parameters, METH_O, NULL}, + { "dh_generate_parameters", _wrap_dh_generate_parameters, METH_VARARGS, NULL}, + { "dh_check", _wrap_dh_check, METH_O, NULL}, + { "dh_compute_key", _wrap_dh_compute_key, METH_VARARGS, NULL}, + { "dh_get_p", _wrap_dh_get_p, METH_O, NULL}, + { "dh_get_g", _wrap_dh_get_g, METH_O, NULL}, + { "dh_get_pub", _wrap_dh_get_pub, METH_O, NULL}, + { "dh_get_priv", _wrap_dh_get_priv, METH_O, NULL}, + { "dh_set_pg", _wrap_dh_set_pg, METH_VARARGS, NULL}, + { "rsa_size", _wrap_rsa_size, METH_O, NULL}, + { "rsa_new", _wrap_rsa_new, METH_NOARGS, NULL}, + { "rsa_free", _wrap_rsa_free, METH_O, NULL}, + { "rsa_check_key", _wrap_rsa_check_key, METH_O, NULL}, + { "rsa_init", _wrap_rsa_init, METH_O, NULL}, + { "rsa_read_key", _wrap_rsa_read_key, METH_VARARGS, NULL}, + { "rsa_write_key", _wrap_rsa_write_key, METH_VARARGS, NULL}, + { "rsa_write_key_no_cipher", _wrap_rsa_write_key_no_cipher, METH_VARARGS, NULL}, + { "rsa_read_pub_key", _wrap_rsa_read_pub_key, METH_O, NULL}, + { "rsa_write_pub_key", _wrap_rsa_write_pub_key, METH_VARARGS, NULL}, + { "rsa_get_e", _wrap_rsa_get_e, METH_O, NULL}, + { "rsa_get_n", _wrap_rsa_get_n, METH_O, NULL}, + { "rsa_set_e", _wrap_rsa_set_e, METH_VARARGS, NULL}, + { "rsa_set_n", _wrap_rsa_set_n, METH_VARARGS, NULL}, + { "rsa_set_en", _wrap_rsa_set_en, METH_VARARGS, NULL}, + { "PyObject_Bin_AsBIGNUM", _wrap_PyObject_Bin_AsBIGNUM, METH_O, NULL}, + { "rsa_set_en_bin", _wrap_rsa_set_en_bin, METH_VARARGS, NULL}, + { "rsa_private_encrypt", _wrap_rsa_private_encrypt, METH_VARARGS, NULL}, + { "rsa_public_decrypt", _wrap_rsa_public_decrypt, METH_VARARGS, NULL}, + { "rsa_public_encrypt", _wrap_rsa_public_encrypt, METH_VARARGS, NULL}, + { "rsa_private_decrypt", _wrap_rsa_private_decrypt, METH_VARARGS, NULL}, + { "rsa_padding_add_pkcs1_pss", _wrap_rsa_padding_add_pkcs1_pss, METH_VARARGS, NULL}, + { "rsa_verify_pkcs1_pss", _wrap_rsa_verify_pkcs1_pss, METH_VARARGS, NULL}, + { "rsa_sign", _wrap_rsa_sign, METH_VARARGS, NULL}, + { "rsa_verify", _wrap_rsa_verify, METH_VARARGS, NULL}, + { "rsa_generate_key", _wrap_rsa_generate_key, METH_VARARGS, NULL}, + { "rsa_type_check", _wrap_rsa_type_check, METH_O, NULL}, + { "rsa_check_pub_key", _wrap_rsa_check_pub_key, METH_O, NULL}, + { "rsa_write_key_der", _wrap_rsa_write_key_der, METH_VARARGS, NULL}, + { "dsa_new", _wrap_dsa_new, METH_NOARGS, NULL}, + { "dsa_free", _wrap_dsa_free, METH_O, NULL}, + { "dsa_size", _wrap_dsa_size, METH_O, NULL}, + { "dsa_gen_key", _wrap_dsa_gen_key, METH_O, NULL}, + { "dsa_init", _wrap_dsa_init, METH_O, NULL}, + { "dsa_generate_parameters", _wrap_dsa_generate_parameters, METH_VARARGS, NULL}, + { "dsa_read_params", _wrap_dsa_read_params, METH_VARARGS, NULL}, + { "dsa_read_key", _wrap_dsa_read_key, METH_VARARGS, NULL}, + { "dsa_read_pub_key", _wrap_dsa_read_pub_key, METH_VARARGS, NULL}, + { "dsa_get_p", _wrap_dsa_get_p, METH_O, NULL}, + { "dsa_get_q", _wrap_dsa_get_q, METH_O, NULL}, + { "dsa_get_g", _wrap_dsa_get_g, METH_O, NULL}, + { "dsa_get_pub", _wrap_dsa_get_pub, METH_O, NULL}, + { "dsa_get_priv", _wrap_dsa_get_priv, METH_O, NULL}, + { "dsa_set_pqg", _wrap_dsa_set_pqg, METH_VARARGS, NULL}, + { "dsa_set_pub", _wrap_dsa_set_pub, METH_VARARGS, NULL}, + { "dsa_write_params_bio", _wrap_dsa_write_params_bio, METH_VARARGS, NULL}, + { "dsa_write_key_bio", _wrap_dsa_write_key_bio, METH_VARARGS, NULL}, + { "dsa_write_key_bio_no_cipher", _wrap_dsa_write_key_bio_no_cipher, METH_VARARGS, NULL}, + { "dsa_write_pub_key_bio", _wrap_dsa_write_pub_key_bio, METH_VARARGS, NULL}, + { "dsa_sign", _wrap_dsa_sign, METH_VARARGS, NULL}, + { "dsa_verify", _wrap_dsa_verify, METH_VARARGS, NULL}, + { "dsa_sign_asn1", _wrap_dsa_sign_asn1, METH_VARARGS, NULL}, + { "dsa_verify_asn1", _wrap_dsa_verify_asn1, METH_VARARGS, NULL}, + { "dsa_check_key", _wrap_dsa_check_key, METH_O, NULL}, + { "dsa_check_pub_key", _wrap_dsa_check_pub_key, METH_O, NULL}, + { "dsa_keylen", _wrap_dsa_keylen, METH_O, NULL}, + { "dsa_type_check", _wrap_dsa_type_check, METH_O, NULL}, + { "ssl_get_ciphers", _wrap_ssl_get_ciphers, METH_O, NULL}, + { "ssl_get_version", _wrap_ssl_get_version, METH_O, NULL}, + { "ssl_get_error", _wrap_ssl_get_error, METH_VARARGS, NULL}, + { "ssl_get_state", _wrap_ssl_get_state, METH_O, NULL}, + { "ssl_get_state_v", _wrap_ssl_get_state_v, METH_O, NULL}, + { "ssl_get_alert_type", _wrap_ssl_get_alert_type, METH_O, NULL}, + { "ssl_get_alert_type_v", _wrap_ssl_get_alert_type_v, METH_O, NULL}, + { "ssl_get_alert_desc", _wrap_ssl_get_alert_desc, METH_O, NULL}, + { "ssl_get_alert_desc_v", _wrap_ssl_get_alert_desc_v, METH_O, NULL}, + { "sslv23_method", _wrap_sslv23_method, METH_NOARGS, NULL}, + { "ssl_ctx_new", _wrap_ssl_ctx_new, METH_O, NULL}, + { "ssl_ctx_free", _wrap_ssl_ctx_free, METH_O, NULL}, + { "ssl_ctx_set_verify_depth", _wrap_ssl_ctx_set_verify_depth, METH_VARARGS, NULL}, + { "ssl_ctx_get_verify_depth", _wrap_ssl_ctx_get_verify_depth, METH_O, NULL}, + { "ssl_ctx_get_verify_mode", _wrap_ssl_ctx_get_verify_mode, METH_O, NULL}, + { "ssl_ctx_set_cipher_list", _wrap_ssl_ctx_set_cipher_list, METH_VARARGS, NULL}, + { "ssl_ctx_add_session", _wrap_ssl_ctx_add_session, METH_VARARGS, NULL}, + { "ssl_ctx_remove_session", _wrap_ssl_ctx_remove_session, METH_VARARGS, NULL}, + { "ssl_ctx_set_session_timeout", _wrap_ssl_ctx_set_session_timeout, METH_VARARGS, NULL}, + { "ssl_ctx_get_session_timeout", _wrap_ssl_ctx_get_session_timeout, METH_O, NULL}, + { "ssl_ctx_get_cert_store", _wrap_ssl_ctx_get_cert_store, METH_O, NULL}, + { "ssl_ctx_set_default_verify_paths", _wrap_ssl_ctx_set_default_verify_paths, METH_O, NULL}, + { "ssl_get_ex_data_x509_store_ctx_idx", _wrap_ssl_get_ex_data_x509_store_ctx_idx, METH_NOARGS, NULL}, + { "bio_new_ssl", _wrap_bio_new_ssl, METH_VARARGS, NULL}, + { "ssl_new", _wrap_ssl_new, METH_O, NULL}, + { "ssl_free", _wrap_ssl_free, METH_O, NULL}, + { "ssl_dup", _wrap_ssl_dup, METH_O, NULL}, + { "ssl_set_bio", _wrap_ssl_set_bio, METH_VARARGS, NULL}, + { "ssl_set_accept_state", _wrap_ssl_set_accept_state, METH_O, NULL}, + { "ssl_set_connect_state", _wrap_ssl_set_connect_state, METH_O, NULL}, + { "ssl_get_shutdown", _wrap_ssl_get_shutdown, METH_O, NULL}, + { "ssl_set_shutdown", _wrap_ssl_set_shutdown, METH_VARARGS, NULL}, + { "ssl_shutdown", _wrap_ssl_shutdown, METH_O, NULL}, + { "ssl_clear", _wrap_ssl_clear, METH_O, NULL}, + { "ssl_do_handshake", _wrap_ssl_do_handshake, METH_O, NULL}, + { "ssl_renegotiate", _wrap_ssl_renegotiate, METH_O, NULL}, + { "ssl_pending", _wrap_ssl_pending, METH_O, NULL}, + { "ssl_get_peer_cert", _wrap_ssl_get_peer_cert, METH_O, NULL}, + { "ssl_get_current_cipher", _wrap_ssl_get_current_cipher, METH_O, NULL}, + { "ssl_get_verify_mode", _wrap_ssl_get_verify_mode, METH_O, NULL}, + { "ssl_get_verify_depth", _wrap_ssl_get_verify_depth, METH_O, NULL}, + { "ssl_get_verify_result", _wrap_ssl_get_verify_result, METH_O, NULL}, + { "ssl_get_ssl_ctx", _wrap_ssl_get_ssl_ctx, METH_O, NULL}, + { "ssl_get_default_session_timeout", _wrap_ssl_get_default_session_timeout, METH_O, NULL}, + { "ssl_set_cipher_list", _wrap_ssl_set_cipher_list, METH_VARARGS, NULL}, + { "ssl_get_cipher_list", _wrap_ssl_get_cipher_list, METH_VARARGS, NULL}, + { "ssl_cipher_get_name", _wrap_ssl_cipher_get_name, METH_O, NULL}, + { "ssl_cipher_get_version", _wrap_ssl_cipher_get_version, METH_O, NULL}, + { "ssl_get_session", _wrap_ssl_get_session, METH_O, NULL}, + { "ssl_get1_session", _wrap_ssl_get1_session, METH_O, NULL}, + { "ssl_set_session", _wrap_ssl_set_session, METH_VARARGS, NULL}, + { "ssl_session_free", _wrap_ssl_session_free, METH_O, NULL}, + { "ssl_session_print", _wrap_ssl_session_print, METH_VARARGS, NULL}, + { "ssl_session_set_timeout", _wrap_ssl_session_set_timeout, METH_VARARGS, NULL}, + { "ssl_session_get_timeout", _wrap_ssl_session_get_timeout, METH_O, NULL}, + { "ssl_accept", _wrap_ssl_accept, METH_VARARGS, NULL}, + { "ssl_connect", _wrap_ssl_connect, METH_VARARGS, NULL}, + { "ssl_read", _wrap_ssl_read, METH_VARARGS, NULL}, + { "ssl_write", _wrap_ssl_write, METH_VARARGS, NULL}, + { "ssl_init", _wrap_ssl_init, METH_VARARGS, NULL}, + { "tlsv1_method", _wrap_tlsv1_method, METH_NOARGS, NULL}, + { "ssl_ctx_passphrase_callback", _wrap_ssl_ctx_passphrase_callback, METH_VARARGS, NULL}, + { "ssl_ctx_use_x509", _wrap_ssl_ctx_use_x509, METH_VARARGS, NULL}, + { "ssl_ctx_use_cert", _wrap_ssl_ctx_use_cert, METH_VARARGS, NULL}, + { "ssl_ctx_use_cert_chain", _wrap_ssl_ctx_use_cert_chain, METH_VARARGS, NULL}, + { "ssl_ctx_use_privkey", _wrap_ssl_ctx_use_privkey, METH_VARARGS, NULL}, + { "ssl_ctx_use_rsa_privkey", _wrap_ssl_ctx_use_rsa_privkey, METH_VARARGS, NULL}, + { "ssl_ctx_use_pkey_privkey", _wrap_ssl_ctx_use_pkey_privkey, METH_VARARGS, NULL}, + { "ssl_ctx_check_privkey", _wrap_ssl_ctx_check_privkey, METH_O, NULL}, + { "ssl_ctx_set_client_CA_list_from_file", _wrap_ssl_ctx_set_client_CA_list_from_file, METH_VARARGS, NULL}, + { "ssl_ctx_set_verify_default", _wrap_ssl_ctx_set_verify_default, METH_VARARGS, NULL}, + { "ssl_ctx_set_verify", _wrap_ssl_ctx_set_verify, METH_VARARGS, NULL}, + { "ssl_ctx_set_session_id_context", _wrap_ssl_ctx_set_session_id_context, METH_VARARGS, NULL}, + { "ssl_ctx_set_info_callback", _wrap_ssl_ctx_set_info_callback, METH_VARARGS, NULL}, + { "ssl_ctx_set_tmp_dh", _wrap_ssl_ctx_set_tmp_dh, METH_VARARGS, NULL}, + { "ssl_ctx_set_tmp_dh_callback", _wrap_ssl_ctx_set_tmp_dh_callback, METH_VARARGS, NULL}, + { "ssl_ctx_set_tmp_rsa", _wrap_ssl_ctx_set_tmp_rsa, METH_VARARGS, NULL}, + { "ssl_ctx_set_tmp_rsa_callback", _wrap_ssl_ctx_set_tmp_rsa_callback, METH_VARARGS, NULL}, + { "ssl_ctx_load_verify_locations", _wrap_ssl_ctx_load_verify_locations, METH_VARARGS, NULL}, + { "ssl_ctx_set_options", _wrap_ssl_ctx_set_options, METH_VARARGS, NULL}, + { "bio_set_ssl", _wrap_bio_set_ssl, METH_VARARGS, NULL}, + { "ssl_set_mode", _wrap_ssl_set_mode, METH_VARARGS, NULL}, + { "ssl_get_mode", _wrap_ssl_get_mode, METH_O, NULL}, + { "ssl_set_tlsext_host_name", _wrap_ssl_set_tlsext_host_name, METH_VARARGS, NULL}, + { "ssl_set_client_CA_list_from_file", _wrap_ssl_set_client_CA_list_from_file, METH_VARARGS, NULL}, + { "ssl_set_client_CA_list_from_context", _wrap_ssl_set_client_CA_list_from_context, METH_VARARGS, NULL}, + { "ssl_set_session_id_context", _wrap_ssl_set_session_id_context, METH_VARARGS, NULL}, + { "ssl_set_fd", _wrap_ssl_set_fd, METH_VARARGS, NULL}, + { "ssl_set_shutdown1", _wrap_ssl_set_shutdown1, METH_VARARGS, NULL}, + { "ssl_read_nbio", _wrap_ssl_read_nbio, METH_VARARGS, NULL}, + { "ssl_write_nbio", _wrap_ssl_write_nbio, METH_VARARGS, NULL}, + { "ssl_cipher_get_bits", _wrap_ssl_cipher_get_bits, METH_O, NULL}, + { "sk_ssl_cipher_num", _wrap_sk_ssl_cipher_num, METH_O, NULL}, + { "sk_ssl_cipher_value", _wrap_sk_ssl_cipher_value, METH_VARARGS, NULL}, + { "ssl_get_peer_cert_chain", _wrap_ssl_get_peer_cert_chain, METH_O, NULL}, + { "sk_x509_num", _wrap_sk_x509_num, METH_O, NULL}, + { "sk_x509_value", _wrap_sk_x509_value, METH_VARARGS, NULL}, + { "i2d_ssl_session", _wrap_i2d_ssl_session, METH_VARARGS, NULL}, + { "ssl_session_read_pem", _wrap_ssl_session_read_pem, METH_O, NULL}, + { "ssl_session_write_pem", _wrap_ssl_session_write_pem, METH_VARARGS, NULL}, + { "ssl_ctx_set_session_cache_mode", _wrap_ssl_ctx_set_session_cache_mode, METH_VARARGS, NULL}, + { "ssl_ctx_get_session_cache_mode", _wrap_ssl_ctx_get_session_cache_mode, METH_O, NULL}, + { "ssl_ctx_set_cache_size", _wrap_ssl_ctx_set_cache_size, METH_VARARGS, NULL}, + { "ssl_is_init_finished", _wrap_ssl_is_init_finished, METH_O, NULL}, + { "x509_check_ca", _wrap_x509_check_ca, METH_O, NULL}, + { "x509_new", _wrap_x509_new, METH_NOARGS, NULL}, + { "x509_dup", _wrap_x509_dup, METH_O, NULL}, + { "x509_free", _wrap_x509_free, METH_O, NULL}, + { "x509_crl_free", _wrap_x509_crl_free, METH_O, NULL}, + { "x509_crl_new", _wrap_x509_crl_new, METH_NOARGS, NULL}, + { "x509_print", _wrap_x509_print, METH_VARARGS, NULL}, + { "x509_crl_print", _wrap_x509_crl_print, METH_VARARGS, NULL}, + { "x509_get_serial_number", _wrap_x509_get_serial_number, METH_O, NULL}, + { "x509_set_serial_number", _wrap_x509_set_serial_number, METH_VARARGS, NULL}, + { "x509_get_pubkey", _wrap_x509_get_pubkey, METH_O, NULL}, + { "x509_set_pubkey", _wrap_x509_set_pubkey, METH_VARARGS, NULL}, + { "x509_get_issuer_name", _wrap_x509_get_issuer_name, METH_O, NULL}, + { "x509_set_issuer_name", _wrap_x509_set_issuer_name, METH_VARARGS, NULL}, + { "x509_get_subject_name", _wrap_x509_get_subject_name, METH_O, NULL}, + { "x509_set_subject_name", _wrap_x509_set_subject_name, METH_VARARGS, NULL}, + { "x509_cmp_current_time", _wrap_x509_cmp_current_time, METH_O, NULL}, + { "x509_check_purpose", _wrap_x509_check_purpose, METH_VARARGS, NULL}, + { "x509_check_trust", _wrap_x509_check_trust, METH_VARARGS, NULL}, + { "x509_write_pem", _wrap_x509_write_pem, METH_VARARGS, NULL}, + { "x509_write_pem_file", _wrap_x509_write_pem_file, METH_VARARGS, NULL}, + { "x509_verify", _wrap_x509_verify, METH_VARARGS, NULL}, + { "x509_get_verify_error", _wrap_x509_get_verify_error, METH_O, NULL}, + { "x509_add_ext", _wrap_x509_add_ext, METH_VARARGS, NULL}, + { "x509_get_ext_count", _wrap_x509_get_ext_count, METH_O, NULL}, + { "x509_get_ext", _wrap_x509_get_ext, METH_VARARGS, NULL}, + { "x509_ext_print", _wrap_x509_ext_print, METH_VARARGS, NULL}, + { "x509_name_new", _wrap_x509_name_new, METH_NOARGS, NULL}, + { "x509_name_free", _wrap_x509_name_free, METH_O, NULL}, + { "x509_name_print", _wrap_x509_name_print, METH_VARARGS, NULL}, + { "x509_name_get_entry", _wrap_x509_name_get_entry, METH_VARARGS, NULL}, + { "x509_name_entry_count", _wrap_x509_name_entry_count, METH_O, NULL}, + { "x509_name_delete_entry", _wrap_x509_name_delete_entry, METH_VARARGS, NULL}, + { "x509_name_add_entry", _wrap_x509_name_add_entry, METH_VARARGS, NULL}, + { "x509_name_add_entry_by_obj", _wrap_x509_name_add_entry_by_obj, METH_VARARGS, NULL}, + { "x509_name_add_entry_by_nid", _wrap_x509_name_add_entry_by_nid, METH_VARARGS, NULL}, + { "x509_name_print_ex", _wrap_x509_name_print_ex, METH_VARARGS, NULL}, + { "x509_name_hash", _wrap_x509_name_hash, METH_O, NULL}, + { "x509_name_get_index_by_nid", _wrap_x509_name_get_index_by_nid, METH_VARARGS, NULL}, + { "x509_name_entry_new", _wrap_x509_name_entry_new, METH_NOARGS, NULL}, + { "x509_name_entry_free", _wrap_x509_name_entry_free, METH_O, NULL}, + { "x509_name_entry_create_by_nid", _wrap_x509_name_entry_create_by_nid, METH_VARARGS, NULL}, + { "x509_name_entry_set_object", _wrap_x509_name_entry_set_object, METH_VARARGS, NULL}, + { "x509_name_entry_get_object", _wrap_x509_name_entry_get_object, METH_O, NULL}, + { "x509_name_entry_get_data", _wrap_x509_name_entry_get_data, METH_O, NULL}, + { "x509_name_entry_set_data", _wrap_x509_name_entry_set_data, METH_VARARGS, NULL}, + { "x509_req_new", _wrap_x509_req_new, METH_NOARGS, NULL}, + { "x509_req_free", _wrap_x509_req_free, METH_O, NULL}, + { "x509_req_print", _wrap_x509_req_print, METH_VARARGS, NULL}, + { "x509_req_get_pubkey", _wrap_x509_req_get_pubkey, METH_O, NULL}, + { "x509_req_set_pubkey", _wrap_x509_req_set_pubkey, METH_VARARGS, NULL}, + { "x509_req_set_subject_name", _wrap_x509_req_set_subject_name, METH_VARARGS, NULL}, + { "x509_req_verify", _wrap_x509_req_verify, METH_VARARGS, NULL}, + { "x509_req_sign", _wrap_x509_req_sign, METH_VARARGS, NULL}, + { "i2d_x509_bio", _wrap_i2d_x509_bio, METH_VARARGS, NULL}, + { "i2d_x509_req_bio", _wrap_i2d_x509_req_bio, METH_VARARGS, NULL}, + { "x509_store_new", _wrap_x509_store_new, METH_NOARGS, NULL}, + { "x509_store_free", _wrap_x509_store_free, METH_O, NULL}, + { "x509_store_add_cert", _wrap_x509_store_add_cert, METH_VARARGS, NULL}, + { "x509_store_ctx_get_current_cert", _wrap_x509_store_ctx_get_current_cert, METH_O, NULL}, + { "x509_store_ctx_get_error", _wrap_x509_store_ctx_get_error, METH_O, NULL}, + { "x509_store_ctx_get_error_depth", _wrap_x509_store_ctx_get_error_depth, METH_O, NULL}, + { "x509_store_ctx_free", _wrap_x509_store_ctx_free, METH_O, NULL}, + { "x509_store_ctx_get1_chain", _wrap_x509_store_ctx_get1_chain, METH_O, NULL}, + { "x509_extension_get_critical", _wrap_x509_extension_get_critical, METH_O, NULL}, + { "x509_extension_set_critical", _wrap_x509_extension_set_critical, METH_VARARGS, NULL}, + { "x509_store_set_flags", _wrap_x509_store_set_flags, METH_VARARGS, NULL}, + { "x509_read_pem", _wrap_x509_read_pem, METH_O, NULL}, + { "d2i_x509", _wrap_d2i_x509, METH_O, NULL}, + { "x509_init", _wrap_x509_init, METH_O, NULL}, + { "d2i_x509_req", _wrap_d2i_x509_req, METH_O, NULL}, + { "x509_req_read_pem", _wrap_x509_req_read_pem, METH_O, NULL}, + { "i2d_x509", _wrap_i2d_x509, METH_O, NULL}, + { "x509_req_write_pem", _wrap_x509_req_write_pem, METH_VARARGS, NULL}, + { "x509_crl_read_pem", _wrap_x509_crl_read_pem, METH_O, NULL}, + { "x509_set_version", _wrap_x509_set_version, METH_VARARGS, NULL}, + { "x509_get_version", _wrap_x509_get_version, METH_O, NULL}, + { "x509_set_not_before", _wrap_x509_set_not_before, METH_VARARGS, NULL}, + { "x509_get_not_before", _wrap_x509_get_not_before, METH_O, NULL}, + { "x509_set_not_after", _wrap_x509_set_not_after, METH_VARARGS, NULL}, + { "x509_get_not_after", _wrap_x509_get_not_after, METH_O, NULL}, + { "x509_sign", _wrap_x509_sign, METH_VARARGS, NULL}, + { "x509_gmtime_adj", _wrap_x509_gmtime_adj, METH_VARARGS, NULL}, + { "x509_name_by_nid", _wrap_x509_name_by_nid, METH_VARARGS, NULL}, + { "x509_name_set_by_nid", _wrap_x509_name_set_by_nid, METH_VARARGS, NULL}, + { "x509_name_add_entry_by_txt", _wrap_x509_name_add_entry_by_txt, METH_VARARGS, NULL}, + { "x509_name_get_der", _wrap_x509_name_get_der, METH_O, NULL}, + { "sk_x509_free", _wrap_sk_x509_free, METH_O, NULL}, + { "sk_x509_push", _wrap_sk_x509_push, METH_VARARGS, NULL}, + { "sk_x509_pop", _wrap_sk_x509_pop, METH_O, NULL}, + { "x509_store_load_locations", _wrap_x509_store_load_locations, METH_VARARGS, NULL}, + { "x509_type_check", _wrap_x509_type_check, METH_O, NULL}, + { "x509_name_type_check", _wrap_x509_name_type_check, METH_O, NULL}, + { "x509_req_get_subject_name", _wrap_x509_req_get_subject_name, METH_O, NULL}, + { "x509_req_get_version", _wrap_x509_req_get_version, METH_O, NULL}, + { "x509_req_set_version", _wrap_x509_req_set_version, METH_VARARGS, NULL}, + { "x509_req_add_extensions", _wrap_x509_req_add_extensions, METH_VARARGS, NULL}, + { "x509_name_entry_create_by_txt", _wrap_x509_name_entry_create_by_txt, METH_VARARGS, NULL}, + { "x509v3_set_nconf", _wrap_x509v3_set_nconf, METH_NOARGS, NULL}, + { "x509v3_ext_conf", _wrap_x509v3_ext_conf, METH_VARARGS, NULL}, + { "x509_extension_free", _wrap_x509_extension_free, METH_O, NULL}, + { "x509_extension_get_name", _wrap_x509_extension_get_name, METH_O, NULL}, + { "sk_x509_extension_new_null", _wrap_sk_x509_extension_new_null, METH_NOARGS, NULL}, + { "sk_x509_extension_free", _wrap_sk_x509_extension_free, METH_O, NULL}, + { "sk_x509_extension_push", _wrap_sk_x509_extension_push, METH_VARARGS, NULL}, + { "sk_x509_extension_pop", _wrap_sk_x509_extension_pop, METH_O, NULL}, + { "sk_x509_extension_num", _wrap_sk_x509_extension_num, METH_O, NULL}, + { "sk_x509_extension_value", _wrap_sk_x509_extension_value, METH_VARARGS, NULL}, + { "x509_store_ctx_get_app_data", _wrap_x509_store_ctx_get_app_data, METH_O, NULL}, + { "x509_store_ctx_get_ex_data", _wrap_x509_store_ctx_get_ex_data, METH_VARARGS, NULL}, + { "x509_store_set_verify_cb", _wrap_x509_store_set_verify_cb, METH_VARARGS, NULL}, + { "make_stack_from_der_sequence", _wrap_make_stack_from_der_sequence, METH_O, NULL}, + { "sk_x509_new_null", _wrap_sk_x509_new_null, METH_NOARGS, NULL}, + { "get_der_encoding_stack", _wrap_get_der_encoding_stack, METH_O, NULL}, + { "x509_name_oneline", _wrap_x509_name_oneline, METH_O, NULL}, + { "asn1_object_new", _wrap_asn1_object_new, METH_NOARGS, NULL}, + { "asn1_object_create", _wrap_asn1_object_create, METH_VARARGS, NULL}, + { "asn1_object_free", _wrap_asn1_object_free, METH_O, NULL}, + { "i2d_asn1_object", _wrap_i2d_asn1_object, METH_VARARGS, NULL}, + { "d2i_asn1_object", _wrap_d2i_asn1_object, METH_VARARGS, NULL}, + { "asn1_bit_string_new", _wrap_asn1_bit_string_new, METH_NOARGS, NULL}, + { "asn1_string_new", _wrap_asn1_string_new, METH_NOARGS, NULL}, + { "asn1_string_free", _wrap_asn1_string_free, METH_O, NULL}, + { "asn1_string_set", _wrap_asn1_string_set, METH_VARARGS, NULL}, + { "asn1_string_print", _wrap_asn1_string_print, METH_VARARGS, NULL}, + { "asn1_string_print_ex", _wrap_asn1_string_print_ex, METH_VARARGS, NULL}, + { "asn1_time_new", _wrap_asn1_time_new, METH_NOARGS, NULL}, + { "asn1_time_free", _wrap_asn1_time_free, METH_O, NULL}, + { "asn1_time_check", _wrap_asn1_time_check, METH_O, NULL}, + { "asn1_time_set", _wrap_asn1_time_set, METH_VARARGS, NULL}, + { "asn1_time_set_string", _wrap_asn1_time_set_string, METH_VARARGS, NULL}, + { "asn1_time_print", _wrap_asn1_time_print, METH_VARARGS, NULL}, + { "asn1_integer_new", _wrap_asn1_integer_new, METH_NOARGS, NULL}, + { "asn1_integer_free", _wrap_asn1_integer_free, METH_O, NULL}, + { "asn1_integer_cmp", _wrap_asn1_integer_cmp, METH_VARARGS, NULL}, + { "asn1_time_type_check", _wrap_asn1_time_type_check, METH_O, NULL}, + { "asn1_integer_get", _wrap_asn1_integer_get, METH_O, NULL}, + { "asn1_integer_set", _wrap_asn1_integer_set, METH_VARARGS, NULL}, + { "pkcs7_new", _wrap_pkcs7_new, METH_NOARGS, NULL}, + { "pkcs7_free", _wrap_pkcs7_free, METH_O, NULL}, + { "pkcs7_add_certificate", _wrap_pkcs7_add_certificate, METH_VARARGS, NULL}, + { "pkcs7_init", _wrap_pkcs7_init, METH_O, NULL}, + { "smime_init", _wrap_smime_init, METH_O, NULL}, + { "pkcs7_decrypt", _wrap_pkcs7_decrypt, METH_VARARGS, NULL}, + { "pkcs7_encrypt", _wrap_pkcs7_encrypt, METH_VARARGS, NULL}, + { "pkcs7_sign1", _wrap_pkcs7_sign1, METH_VARARGS, NULL}, + { "pkcs7_sign0", _wrap_pkcs7_sign0, METH_VARARGS, NULL}, + { "pkcs7_read_bio", _wrap_pkcs7_read_bio, METH_O, NULL}, + { "pkcs7_read_bio_der", _wrap_pkcs7_read_bio_der, METH_O, NULL}, + { "pkcs7_verify1", _wrap_pkcs7_verify1, METH_VARARGS, NULL}, + { "pkcs7_verify0", _wrap_pkcs7_verify0, METH_VARARGS, NULL}, + { "smime_write_pkcs7_multi", _wrap_smime_write_pkcs7_multi, METH_VARARGS, NULL}, + { "smime_write_pkcs7", _wrap_smime_write_pkcs7, METH_VARARGS, NULL}, + { "smime_read_pkcs7", _wrap_smime_read_pkcs7, METH_O, NULL}, + { "pkcs7_write_bio", _wrap_pkcs7_write_bio, METH_VARARGS, NULL}, + { "pkcs7_write_bio_der", _wrap_pkcs7_write_bio_der, METH_VARARGS, NULL}, + { "pkcs7_type_nid", _wrap_pkcs7_type_nid, METH_O, NULL}, + { "pkcs7_type_sn", _wrap_pkcs7_type_sn, METH_O, NULL}, + { "smime_crlf_copy", _wrap_smime_crlf_copy, METH_VARARGS, NULL}, + { "pkcs7_get0_signers", _wrap_pkcs7_get0_signers, METH_VARARGS, NULL}, + { "util_init", _wrap_util_init, METH_O, NULL}, + { "util_hex_to_string", _wrap_util_hex_to_string, METH_O, NULL}, + { "util_string_to_hex", _wrap_util_string_to_hex, METH_O, NULL}, + { "ec_key_new", _wrap_ec_key_new, METH_NOARGS, NULL}, + { "ec_key_free", _wrap_ec_key_free, METH_O, NULL}, + { "ec_key_size", _wrap_ec_key_size, METH_O, NULL}, + { "ec_key_gen_key", _wrap_ec_key_gen_key, METH_O, NULL}, + { "ec_key_check_key", _wrap_ec_key_check_key, METH_O, NULL}, + { "ec_init", _wrap_ec_init, METH_O, NULL}, + { "ec_get_builtin_curves", _wrap_ec_get_builtin_curves, METH_NOARGS, NULL}, + { "ec_key_new_by_curve_name", _wrap_ec_key_new_by_curve_name, METH_O, NULL}, + { "ec_key_get_public_der", _wrap_ec_key_get_public_der, METH_O, NULL}, + { "ec_key_get_public_key", _wrap_ec_key_get_public_key, METH_O, NULL}, + { "ec_key_read_pubkey", _wrap_ec_key_read_pubkey, METH_O, NULL}, + { "ec_key_write_pubkey", _wrap_ec_key_write_pubkey, METH_VARARGS, NULL}, + { "ec_key_read_bio", _wrap_ec_key_read_bio, METH_VARARGS, NULL}, + { "ec_key_write_bio", _wrap_ec_key_write_bio, METH_VARARGS, NULL}, + { "ec_key_write_bio_no_cipher", _wrap_ec_key_write_bio_no_cipher, METH_VARARGS, NULL}, + { "ecdsa_sig_get_r", _wrap_ecdsa_sig_get_r, METH_O, NULL}, + { "ecdsa_sig_get_s", _wrap_ecdsa_sig_get_s, METH_O, NULL}, + { "ecdsa_sign", _wrap_ecdsa_sign, METH_VARARGS, NULL}, + { "ecdsa_verify", _wrap_ecdsa_verify, METH_VARARGS, NULL}, + { "ecdsa_sign_asn1", _wrap_ecdsa_sign_asn1, METH_VARARGS, NULL}, + { "ecdsa_verify_asn1", _wrap_ecdsa_verify_asn1, METH_VARARGS, NULL}, + { "ecdh_compute_key", _wrap_ecdh_compute_key, METH_VARARGS, NULL}, + { "ec_key_from_pubkey_der", _wrap_ec_key_from_pubkey_der, METH_O, NULL}, + { "ec_key_from_pubkey_params", _wrap_ec_key_from_pubkey_params, METH_VARARGS, NULL}, + { "ec_key_keylen", _wrap_ec_key_keylen, METH_O, NULL}, + { "ec_key_type_check", _wrap_ec_key_type_check, METH_O, NULL}, + { "engine_load_builtin_engines", _wrap_engine_load_builtin_engines, METH_NOARGS, NULL}, + { "engine_load_dynamic", _wrap_engine_load_dynamic, METH_NOARGS, NULL}, + { "engine_load_openssl", _wrap_engine_load_openssl, METH_NOARGS, NULL}, + { "engine_cleanup", _wrap_engine_cleanup, METH_NOARGS, NULL}, + { "engine_new", _wrap_engine_new, METH_NOARGS, NULL}, + { "engine_by_id", _wrap_engine_by_id, METH_O, NULL}, + { "engine_free", _wrap_engine_free, METH_O, NULL}, + { "engine_init", _wrap_engine_init, METH_O, NULL}, + { "engine_finish", _wrap_engine_finish, METH_O, NULL}, + { "engine_get_id", _wrap_engine_get_id, METH_O, NULL}, + { "engine_get_name", _wrap_engine_get_name, METH_O, NULL}, + { "engine_ctrl_cmd_string", _wrap_engine_ctrl_cmd_string, METH_VARARGS, NULL}, + { "ui_openssl", _wrap_ui_openssl, METH_NOARGS, NULL}, + { "engine_pkcs11_data_new", _wrap_engine_pkcs11_data_new, METH_O, NULL}, + { "engine_pkcs11_data_free", _wrap_engine_pkcs11_data_free, METH_O, NULL}, + { "engine_load_private_key", _wrap_engine_load_private_key, METH_VARARGS, NULL}, + { "engine_load_public_key", _wrap_engine_load_public_key, METH_VARARGS, NULL}, + { "engine_init_error", _wrap_engine_init_error, METH_O, NULL}, + { "engine_load_certificate", _wrap_engine_load_certificate, METH_VARARGS, NULL}, + { "engine_set_default", _wrap_engine_set_default, METH_VARARGS, NULL}, + { "obj_nid2obj", _wrap_obj_nid2obj, METH_O, NULL}, + { "obj_nid2ln", _wrap_obj_nid2ln, METH_O, NULL}, + { "obj_nid2sn", _wrap_obj_nid2sn, METH_O, NULL}, + { "obj_obj2nid", _wrap_obj_obj2nid, METH_O, NULL}, + { "obj_ln2nid", _wrap_obj_ln2nid, METH_O, NULL}, + { "obj_sn2nid", _wrap_obj_sn2nid, METH_O, NULL}, + { "obj_txt2nid", _wrap_obj_txt2nid, METH_O, NULL}, + { "obj_txt2obj", _wrap_obj_txt2obj, METH_VARARGS, NULL}, + { "_obj_obj2txt", _wrap__obj_obj2txt, METH_VARARGS, NULL}, + { "obj_obj2txt", _wrap_obj_obj2txt, METH_VARARGS, NULL}, + { NULL, NULL, 0, NULL } }; -SWIGINTERN SwigPyClientData SwigPyBuiltin__stack_st_OPENSSL_BLOCK_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__stack_st_OPENSSL_BLOCK_type}; +static PyMethodDef SwigMethods_proxydocs[] = { + { NULL, NULL, 0, NULL } +}; -SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_BIO_PYFD_CTX) +static SwigPyGetSet BIO_PYFD_CTX___dict___getset = { SwigPyObject_get___dict__, 0 }; 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 */ + { (char *)"__dict__", SwigPyBuiltin_FunpackGetterClosure, 0, (char *)"", &BIO_PYFD_CTX___dict___getset }, + { (char *)"fd", SwigPyBuiltin_FunpackGetterClosure, SwigPyBuiltin_FunpackSetterClosure, (char *)"", &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); @@ -30829,7 +32594,6 @@ SwigPyBuiltin__pyfd_struct_richcompare(PyObject *self, PyObject *other, int op) Py_INCREF(result); } } - Py_DECREF(tuple); return result; } @@ -30845,10 +32609,10 @@ static PyHeapTypeObject SwigPyBuiltin__pyfd_struct_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - "BIO_PYFD_CTX", /* tp_name */ + "m2crypto.BIO_PYFD_CTX", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor) _wrap_delete_BIO_PYFD_CTX_closure, /* tp_dealloc */ + _wrap_delete_BIO_PYFD_CTX_destructor_closure, /* tp_dealloc */ (printfunc) 0, /* tp_print */ (getattrfunc) 0, /* tp_getattr */ (setattrfunc) 0, /* tp_setattr */ @@ -30858,15 +32622,15 @@ static PyHeapTypeObject SwigPyBuiltin__pyfd_struct_type = { (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 */ + &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 */ + SwigPyObject_hash, /* 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 */ + &SwigPyBuiltin__pyfd_struct_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else @@ -30875,7 +32639,7 @@ static PyHeapTypeObject SwigPyBuiltin__pyfd_struct_type = { "::pyfd_struct", /* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ - (richcmpfunc) SwigPyBuiltin__pyfd_struct_richcompare, /* feature:python:tp_richcompare */ + SwigPyBuiltin__pyfd_struct_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ @@ -30886,22 +32650,43 @@ static PyHeapTypeObject SwigPyBuiltin__pyfd_struct_type = { 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 */ + offsetof(SwigPyObject, dict), /* tp_dictoffset */ + _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 */ + (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 */ +#if PY_VERSION_HEX >= 0x03040000 + (destructor) 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + (vectorcallfunc) 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ #endif +#ifdef COUNT_ALLOCS + (Py_ssize_t) 0, /* tp_allocs */ + (Py_ssize_t) 0, /* tp_frees */ + (Py_ssize_t) 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* tp_next */ +#endif + }, +#if PY_VERSION_HEX >= 0x03050000 + { + (unaryfunc) 0, /* am_await */ + (unaryfunc) 0, /* am_aiter */ + (unaryfunc) 0, /* am_anext */ }, +#endif { (binaryfunc) 0, /* nb_add */ (binaryfunc) 0, /* nb_subtract */ @@ -30927,7 +32712,7 @@ static PyHeapTypeObject SwigPyBuiltin__pyfd_struct_type = { #endif (unaryfunc) 0, /* nb_int */ #if PY_VERSION_HEX >= 0x03000000 - (void*) 0, /* nb_reserved */ + (void *) 0, /* nb_reserved */ #else (unaryfunc) 0, /* nb_long */ #endif @@ -30953,8 +32738,10 @@ static PyHeapTypeObject SwigPyBuiltin__pyfd_struct_type = { (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 */ +#if PY_VERSION_HEX >= 0x03050000 + (binaryfunc) 0, /* nb_matrix_multiply */ + (binaryfunc) 0, /* nb_inplace_matrix_multiply */ #endif }, { @@ -30968,13 +32755,13 @@ static PyHeapTypeObject SwigPyBuiltin__pyfd_struct_type = { (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ #if PY_VERSION_HEX >= 0x03000000 - (void*) 0, /* was_sq_slice */ + (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 */ + (void *) 0, /* was_sq_ass_slice */ #else (ssizessizeobjargproc) 0, /* sq_ass_slice */ #endif @@ -30989,35 +32776,32 @@ static PyHeapTypeObject SwigPyBuiltin__pyfd_struct_type = { (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 */ + (PyObject *) 0, /* ht_name */ + (PyObject *) 0, /* ht_slots */ +#if PY_VERSION_HEX >= 0x03030000 + (PyObject *) 0, /* ht_qualname */ + 0, /* ht_cached_keys */ +#endif }; 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___dict___getset = { SwigPyObject_get___dict__, 0 }; 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 */ + { (char *)"__dict__", SwigPyBuiltin_FunpackGetterClosure, 0, (char *)"", &_cbd_t___dict___getset }, + { (char *)"password", SwigPyBuiltin_FunpackGetterClosure, SwigPyBuiltin_FunpackSetterClosure, (char *)"", &_cbd_t_password_getset }, + { (char *)"prompt", SwigPyBuiltin_FunpackGetterClosure, SwigPyBuiltin_FunpackSetterClosure, (char *)"", &_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); @@ -31026,7 +32810,6 @@ SwigPyBuiltin___cbd_t_richcompare(PyObject *self, PyObject *other, int op) { Py_INCREF(result); } } - Py_DECREF(tuple); return result; } @@ -31042,10 +32825,10 @@ static PyHeapTypeObject SwigPyBuiltin___cbd_t_type = { PyObject_HEAD_INIT(NULL) 0, /* ob_size */ #endif - "_cbd_t", /* tp_name */ + "m2crypto._cbd_t", /* tp_name */ sizeof(SwigPyObject), /* tp_basicsize */ 0, /* tp_itemsize */ - (destructor) _wrap_delete__cbd_t_closure, /* tp_dealloc */ + _wrap_delete__cbd_t_destructor_closure, /* tp_dealloc */ (printfunc) 0, /* tp_print */ (getattrfunc) 0, /* tp_getattr */ (setattrfunc) 0, /* tp_setattr */ @@ -31055,15 +32838,15 @@ static PyHeapTypeObject SwigPyBuiltin___cbd_t_type = { (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 */ + &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 */ + SwigPyObject_hash, /* 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 */ + &SwigPyBuiltin___cbd_t_type.as_buffer, /* tp_as_buffer */ #if PY_VERSION_HEX >= 0x03000000 Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE, /* tp_flags */ #else @@ -31072,7 +32855,7 @@ static PyHeapTypeObject SwigPyBuiltin___cbd_t_type = { "::_cbd_t", /* tp_doc */ (traverseproc) 0, /* tp_traverse */ (inquiry) 0, /* tp_clear */ - (richcmpfunc) SwigPyBuiltin___cbd_t_richcompare, /* feature:python:tp_richcompare */ + SwigPyBuiltin___cbd_t_richcompare, /* tp_richcompare */ 0, /* tp_weaklistoffset */ (getiterfunc) 0, /* tp_iter */ (iternextfunc) 0, /* tp_iternext */ @@ -31083,22 +32866,43 @@ static PyHeapTypeObject SwigPyBuiltin___cbd_t_type = { 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 */ + offsetof(SwigPyObject, dict), /* tp_dictoffset */ + _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 */ + (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 */ +#if PY_VERSION_HEX >= 0x03040000 + (destructor) 0, /* tp_finalize */ +#endif +#if PY_VERSION_HEX >= 0x03080000 + (vectorcallfunc) 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ +#endif +#ifdef COUNT_ALLOCS + (Py_ssize_t) 0, /* tp_allocs */ + (Py_ssize_t) 0, /* tp_frees */ + (Py_ssize_t) 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0, /* tp_next */ #endif }, +#if PY_VERSION_HEX >= 0x03050000 + { + (unaryfunc) 0, /* am_await */ + (unaryfunc) 0, /* am_aiter */ + (unaryfunc) 0, /* am_anext */ + }, +#endif { (binaryfunc) 0, /* nb_add */ (binaryfunc) 0, /* nb_subtract */ @@ -31124,7 +32928,7 @@ static PyHeapTypeObject SwigPyBuiltin___cbd_t_type = { #endif (unaryfunc) 0, /* nb_int */ #if PY_VERSION_HEX >= 0x03000000 - (void*) 0, /* nb_reserved */ + (void *) 0, /* nb_reserved */ #else (unaryfunc) 0, /* nb_long */ #endif @@ -31150,8 +32954,10 @@ static PyHeapTypeObject SwigPyBuiltin___cbd_t_type = { (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 */ +#if PY_VERSION_HEX >= 0x03050000 + (binaryfunc) 0, /* nb_matrix_multiply */ + (binaryfunc) 0, /* nb_inplace_matrix_multiply */ #endif }, { @@ -31165,13 +32971,13 @@ static PyHeapTypeObject SwigPyBuiltin___cbd_t_type = { (ssizeargfunc) 0, /* sq_repeat */ (ssizeargfunc) 0, /* sq_item */ #if PY_VERSION_HEX >= 0x03000000 - (void*) 0, /* was_sq_slice */ + (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 */ + (void *) 0, /* was_sq_ass_slice */ #else (ssizessizeobjargproc) 0, /* sq_ass_slice */ #endif @@ -31186,13 +32992,15 @@ static PyHeapTypeObject SwigPyBuiltin___cbd_t_type = { (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 */ + (PyObject *) 0, /* ht_name */ + (PyObject *) 0, /* ht_slots */ +#if PY_VERSION_HEX >= 0x03030000 + (PyObject *) 0, /* ht_qualname */ + 0, /* ht_cached_keys */ +#endif }; SWIGINTERN SwigPyClientData SwigPyBuiltin___cbd_t_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin___cbd_t_type}; @@ -31241,20 +33049,43 @@ static swig_type_info _swigt__p_X509_NAME_ENTRY = {"_p_X509_NAME_ENTRY", "X509_N 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___INTMAX_TYPE__ = {"_p___INTMAX_TYPE__", "__INTMAX_TYPE__ *|intmax_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___INT_FAST16_TYPE__ = {"_p___INT_FAST16_TYPE__", "__INT_FAST16_TYPE__ *|int_fast16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___INT_FAST32_TYPE__ = {"_p___INT_FAST32_TYPE__", "__INT_FAST32_TYPE__ *|int_fast32_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___INT_FAST64_TYPE__ = {"_p___INT_FAST64_TYPE__", "__INT_FAST64_TYPE__ *|int_fast64_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___INT_FAST8_TYPE__ = {"_p___INT_FAST8_TYPE__", "__INT_FAST8_TYPE__ *|int_fast8_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___INT_LEAST16_TYPE__ = {"_p___INT_LEAST16_TYPE__", "__INT_LEAST16_TYPE__ *|int_least16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___INT_LEAST32_TYPE__ = {"_p___INT_LEAST32_TYPE__", "__INT_LEAST32_TYPE__ *|int_least32_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___INT_LEAST64_TYPE__ = {"_p___INT_LEAST64_TYPE__", "__INT_LEAST64_TYPE__ *|int_least64_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___INT_LEAST8_TYPE__ = {"_p___INT_LEAST8_TYPE__", "__INT_LEAST8_TYPE__ *|int_least8_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___UINTMAX_TYPE__ = {"_p___UINTMAX_TYPE__", "__UINTMAX_TYPE__ *|uintmax_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___UINT_FAST16_TYPE__ = {"_p___UINT_FAST16_TYPE__", "__UINT_FAST16_TYPE__ *|uint_fast16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___UINT_FAST32_TYPE__ = {"_p___UINT_FAST32_TYPE__", "__UINT_FAST32_TYPE__ *|uint_fast32_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___UINT_FAST64_TYPE__ = {"_p___UINT_FAST64_TYPE__", "__UINT_FAST64_TYPE__ *|uint_fast64_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___UINT_FAST8_TYPE__ = {"_p___UINT_FAST8_TYPE__", "__UINT_FAST8_TYPE__ *|uint_fast8_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___UINT_LEAST16_TYPE__ = {"_p___UINT_LEAST16_TYPE__", "__UINT_LEAST16_TYPE__ *|uint_least16_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___UINT_LEAST32_TYPE__ = {"_p___UINT_LEAST32_TYPE__", "__UINT_LEAST32_TYPE__ *|uint_least32_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___UINT_LEAST64_TYPE__ = {"_p___UINT_LEAST64_TYPE__", "__UINT_LEAST64_TYPE__ *|uint_least64_t *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p___UINT_LEAST8_TYPE__ = {"_p___UINT_LEAST8_TYPE__", "__UINT_LEAST8_TYPE__ *|uint_least8_t *", 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_f_p_char__void = {"_p_f_p_char__void", "void (*)(char *)|sk_OPENSSL_STRING_freefunc|sk_OPENSSL_CSTRING_freefunc", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_f_p_q_const__char__p_char = {"_p_f_p_q_const__char__p_char", "char *(*)(char const *)|sk_OPENSSL_STRING_copyfunc|sk_OPENSSL_CSTRING_copyfunc", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int = {"_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int", "int (*)(char const *const *,char const *const *)|sk_OPENSSL_STRING_compfunc|sk_OPENSSL_CSTRING_compfunc", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int = {"_p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int", "int (*)(void const *const *,void const *const *)|sk_OPENSSL_BLOCK_compfunc", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_f_p_q_const__void__p_void = {"_p_f_p_q_const__void__p_void", "void *(*)(void const *)|OPENSSL_sk_copyfunc|sk_OPENSSL_BLOCK_copyfunc", 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 *)|OPENSSL_sk_compfunc", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_f_p_void__void = {"_p_f_p_void__void", "OPENSSL_sk_freefunc|sk_OPENSSL_BLOCK_freefunc|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_EVP_PKEY_CTX = {"_p_p_EVP_PKEY_CTX", "EVP_PKEY_CTX **", 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 = {"_p_stack_st", "struct stack_st *|OPENSSL_STACK *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_stack_st_OPENSSL_BLOCK = {"_p_stack_st_OPENSSL_BLOCK", "struct stack_st_OPENSSL_BLOCK *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_stack_st_OPENSSL_CSTRING = {"_p_stack_st_OPENSSL_CSTRING", "struct stack_st_OPENSSL_CSTRING *", 0, 0, (void*)0, 0}; +static swig_type_info _swigt__p_stack_st_OPENSSL_STRING = {"_p_stack_st_OPENSSL_STRING", "struct stack_st_OPENSSL_STRING *", 0, 0, (void*)0, 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}; @@ -31303,19 +33134,42 @@ static swig_type_info *swig_type_initial[] = { &_swigt__p_X509_REQ, &_swigt__p_X509_STORE, &_swigt__p_X509_STORE_CTX, + &_swigt__p___INTMAX_TYPE__, + &_swigt__p___INT_FAST16_TYPE__, + &_swigt__p___INT_FAST32_TYPE__, + &_swigt__p___INT_FAST64_TYPE__, + &_swigt__p___INT_FAST8_TYPE__, + &_swigt__p___INT_LEAST16_TYPE__, + &_swigt__p___INT_LEAST32_TYPE__, + &_swigt__p___INT_LEAST64_TYPE__, + &_swigt__p___INT_LEAST8_TYPE__, + &_swigt__p___UINTMAX_TYPE__, + &_swigt__p___UINT_FAST16_TYPE__, + &_swigt__p___UINT_FAST32_TYPE__, + &_swigt__p___UINT_FAST64_TYPE__, + &_swigt__p___UINT_FAST8_TYPE__, + &_swigt__p___UINT_LEAST16_TYPE__, + &_swigt__p___UINT_LEAST32_TYPE__, + &_swigt__p___UINT_LEAST64_TYPE__, + &_swigt__p___UINT_LEAST8_TYPE__, &_swigt__p__cbd_t, &_swigt__p_char, &_swigt__p_f_int_p_X509_STORE_CTX__int, + &_swigt__p_f_p_char__void, + &_swigt__p_f_p_q_const__char__p_char, + &_swigt__p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int, + &_swigt__p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int, + &_swigt__p_f_p_q_const__void__p_void, &_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_EVP_PKEY_CTX, &_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_CSTRING, &_swigt__p_stack_st_OPENSSL_STRING, &_swigt__p_stack_st_SSL_CIPHER, &_swigt__p_stack_st_X509, @@ -31365,19 +33219,42 @@ static swig_cast_info _swigc__p_X509_NAME_ENTRY[] = { {&_swigt__p_X509_NAME_ENT 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___INTMAX_TYPE__[] = { {&_swigt__p___INTMAX_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___INT_FAST16_TYPE__[] = { {&_swigt__p___INT_FAST16_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___INT_FAST32_TYPE__[] = { {&_swigt__p___INT_FAST32_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___INT_FAST64_TYPE__[] = { {&_swigt__p___INT_FAST64_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___INT_FAST8_TYPE__[] = { {&_swigt__p___INT_FAST8_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___INT_LEAST16_TYPE__[] = { {&_swigt__p___INT_LEAST16_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___INT_LEAST32_TYPE__[] = { {&_swigt__p___INT_LEAST32_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___INT_LEAST64_TYPE__[] = { {&_swigt__p___INT_LEAST64_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___INT_LEAST8_TYPE__[] = { {&_swigt__p___INT_LEAST8_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___UINTMAX_TYPE__[] = { {&_swigt__p___UINTMAX_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___UINT_FAST16_TYPE__[] = { {&_swigt__p___UINT_FAST16_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___UINT_FAST32_TYPE__[] = { {&_swigt__p___UINT_FAST32_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___UINT_FAST64_TYPE__[] = { {&_swigt__p___UINT_FAST64_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___UINT_FAST8_TYPE__[] = { {&_swigt__p___UINT_FAST8_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___UINT_LEAST16_TYPE__[] = { {&_swigt__p___UINT_LEAST16_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___UINT_LEAST32_TYPE__[] = { {&_swigt__p___UINT_LEAST32_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___UINT_LEAST64_TYPE__[] = { {&_swigt__p___UINT_LEAST64_TYPE__, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p___UINT_LEAST8_TYPE__[] = { {&_swigt__p___UINT_LEAST8_TYPE__, 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_char__void[] = { {&_swigt__p_f_p_char__void, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_f_p_q_const__char__p_char[] = { {&_swigt__p_f_p_q_const__char__p_char, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int[] = { {&_swigt__p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int[] = { {&_swigt__p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int, 0, 0, 0},{0, 0, 0, 0}}; +static swig_cast_info _swigc__p_f_p_q_const__void__p_void[] = { {&_swigt__p_f_p_q_const__void__p_void, 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_EVP_PKEY_CTX[] = { {&_swigt__p_p_EVP_PKEY_CTX, 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_CSTRING[] = { {&_swigt__p_stack_st_OPENSSL_CSTRING, 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}}; @@ -31427,19 +33304,42 @@ static swig_cast_info *swig_cast_initial[] = { _swigc__p_X509_REQ, _swigc__p_X509_STORE, _swigc__p_X509_STORE_CTX, + _swigc__p___INTMAX_TYPE__, + _swigc__p___INT_FAST16_TYPE__, + _swigc__p___INT_FAST32_TYPE__, + _swigc__p___INT_FAST64_TYPE__, + _swigc__p___INT_FAST8_TYPE__, + _swigc__p___INT_LEAST16_TYPE__, + _swigc__p___INT_LEAST32_TYPE__, + _swigc__p___INT_LEAST64_TYPE__, + _swigc__p___INT_LEAST8_TYPE__, + _swigc__p___UINTMAX_TYPE__, + _swigc__p___UINT_FAST16_TYPE__, + _swigc__p___UINT_FAST32_TYPE__, + _swigc__p___UINT_FAST64_TYPE__, + _swigc__p___UINT_FAST8_TYPE__, + _swigc__p___UINT_LEAST16_TYPE__, + _swigc__p___UINT_LEAST32_TYPE__, + _swigc__p___UINT_LEAST64_TYPE__, + _swigc__p___UINT_LEAST8_TYPE__, _swigc__p__cbd_t, _swigc__p_char, _swigc__p_f_int_p_X509_STORE_CTX__int, + _swigc__p_f_p_char__void, + _swigc__p_f_p_q_const__char__p_char, + _swigc__p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int, + _swigc__p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int, + _swigc__p_f_p_q_const__void__p_void, _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_EVP_PKEY_CTX, _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_CSTRING, _swigc__p_stack_st_OPENSSL_STRING, _swigc__p_stack_st_SSL_CIPHER, _swigc__p_stack_st_X509, @@ -31461,18 +33361,18 @@ 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 + * 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 + * 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 + * The generated swig_type_info structures are assigned statically 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 @@ -31482,17 +33382,17 @@ static PyTypeObject *builtin_bases[2]; * 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 + * 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. + * 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 + * 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 @@ -31516,7 +33416,7 @@ SWIGRUNTIME void SWIG_InitializeModule(void *clientdata) { size_t i; swig_module_info *module_head, *iter; - int found, init; + int init; /* check to see if the circular list has been setup, if not, set it up */ if (swig_module.next==0) { @@ -31535,27 +33435,23 @@ SWIG_InitializeModule(void *clientdata) { /* 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; + /* Our module is already in the list, so there's nothing more to do. */ + return; } 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 */ + /* otherwise we must add our 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 + /* When multiple interpreters 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 */ @@ -31563,7 +33459,7 @@ SWIG_InitializeModule(void *clientdata) { /* Now work on filling in swig_module.types */ #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: size %d\n", swig_module.size); + printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size); #endif for (i = 0; i < swig_module.size; ++i) { swig_type_info *type = 0; @@ -31571,7 +33467,7 @@ SWIG_InitializeModule(void *clientdata) { swig_cast_info *cast; #ifdef SWIGRUNTIME_DEBUG - printf("SWIG_InitializeModule: type %d %s\n", i, swig_module.type_initial[i]->name); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); #endif /* if there is another module already loaded */ @@ -31646,7 +33542,7 @@ SWIG_InitializeModule(void *clientdata) { 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); + printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name); while (cast->type) { printf("SWIG_InitializeModule: cast type %s\n", cast->type->name); cast++; @@ -31768,17 +33664,6 @@ extern "C" { 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; @@ -31802,7 +33687,7 @@ extern "C" { var = var->next; } if (res == NULL && !PyErr_Occurred()) { - PyErr_SetString(PyExc_NameError,"Unknown C global variable"); + PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); } return res; } @@ -31819,7 +33704,7 @@ extern "C" { var = var->next; } if (res == 1 && !PyErr_Occurred()) { - PyErr_SetString(PyExc_NameError,"Unknown C global variable"); + PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n); } return res; } @@ -31831,18 +33716,17 @@ extern "C" { 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 */ + "swigvarlink", /* tp_name */ sizeof(swig_varlinkobject), /* tp_basicsize */ 0, /* tp_itemsize */ (destructor) swig_varlink_dealloc, /* tp_dealloc */ - (printfunc) swig_varlink_print, /* tp_print */ + 0, /* tp_print */ (getattrfunc) swig_varlink_getattr, /* tp_getattr */ (setattrfunc) swig_varlink_setattr, /* tp_setattr */ 0, /* tp_compare */ @@ -31862,27 +33746,30 @@ extern "C" { 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 */ + 0, /* tp_version_tag */ +#if PY_VERSION_HEX >= 0x03040000 + 0, /* tp_finalize */ #endif -#if PY_VERSION_HEX >= 0x02060000 - 0, /* tp_version */ +#if PY_VERSION_HEX >= 0x03080000 + 0, /* tp_vectorcall */ +#endif +#if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000) + 0, /* tp_print */ #endif #ifdef COUNT_ALLOCS - 0,0,0,0 /* tp_alloc -> tp_next */ + 0, /* tp_allocs */ + 0, /* tp_frees */ + 0, /* tp_maxalloc */ + 0, /* tp_prev */ + 0 /* 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; } @@ -31898,14 +33785,14 @@ extern "C" { } SWIGINTERN void - SWIG_Python_addvarlink(PyObject *p, char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) { + SWIG_Python_addvarlink(PyObject *p, const 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); + memcpy(gv->name, name, size); gv->get_attr = get_attr; gv->set_attr = set_attr; gv->next = v->vars; @@ -31916,9 +33803,11 @@ extern "C" { SWIGINTERN PyObject * SWIG_globals(void) { - static PyObject *_SWIG_globals = 0; - if (!_SWIG_globals) _SWIG_globals = SWIG_newvarlink(); - return _SWIG_globals; + static PyObject *globals = 0; + if (!globals) { + globals = SWIG_newvarlink(); + } + return globals; } /* ----------------------------------------------------------------------------- @@ -31961,7 +33850,9 @@ extern "C" { 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: "))) { + if (!c) continue; + c = strstr(c, "swig_ptr: "); + if (c) { int j; swig_const_info *ci = 0; const char *name = c + 10; @@ -31982,9 +33873,9 @@ extern "C" { char *ndoc = (char*)malloc(ldoc + lptr + 10); if (ndoc) { char *buff = ndoc; - strncpy(buff, methods[i].ml_doc, ldoc); + memcpy(buff, methods[i].ml_doc, ldoc); buff += ldoc; - strncpy(buff, "swig_ptr: ", 10); + memcpy(buff, "swig_ptr: ", 10); buff += 10; SWIG_PackVoidPtr(buff, ptr, ty->name, lptr); methods[i].ml_doc = ndoc; @@ -31995,6 +33886,64 @@ extern "C" { } } + /* ----------------------------------------------------------------------------- + * Method creation and docstring support functions + * ----------------------------------------------------------------------------- */ + + /* ----------------------------------------------------------------------------- + * Function to find the method definition with the correct docstring for the + * proxy module as opposed to the low-level API + * ----------------------------------------------------------------------------- */ + + SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) { + /* Find the function in the modified method table */ + size_t offset = 0; + int found = 0; + while (SwigMethods_proxydocs[offset].ml_meth != NULL) { + if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) { + found = 1; + break; + } + offset++; + } + /* Use the copy with the modified docstring if available */ + return found ? &SwigMethods_proxydocs[offset] : NULL; + } + + /* ----------------------------------------------------------------------------- + * Wrapper of PyInstanceMethod_New() used in Python 3 + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ + + SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { + if (PyCFunction_Check(func)) { + PyCFunctionObject *funcobj = (PyCFunctionObject *)func; + PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); + if (ml) + func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); + } +#if PY_VERSION_HEX >= 0x03000000 + return PyInstanceMethod_New(func); +#else + return PyMethod_New(func, NULL, NULL); +#endif + } + + /* ----------------------------------------------------------------------------- + * Wrapper of PyStaticMethod_New() + * It is exported to the generated module, used for -fastproxy + * ----------------------------------------------------------------------------- */ + + SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) { + if (PyCFunction_Check(func)) { + PyCFunctionObject *funcobj = (PyCFunctionObject *)func; + PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name); + if (ml) + func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module); + } + return PyStaticMethod_New(func); + } + #ifdef __cplusplus } #endif @@ -32014,20 +33963,12 @@ PyObject* void #endif SWIG_init(void) { - PyObject *m, *d, *md; + PyObject *m, *d, *md, *globals; + #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, + SWIG_name, NULL, -1, SwigMethods, @@ -32046,23 +33987,24 @@ SWIG_init(void) { (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL }; static SwigPyGetSet thisown_getset_closure = { - (PyCFunction) SwigPyObject_own, - (PyCFunction) SwigPyObject_own + SwigPyObject_own, + 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; + PyTypeObject *swigpyobject; SwigPyClientData *cd; PyObject *public_interface, *public_symbol; PyObject *this_descr; PyObject *thisown_descr; + PyObject *self = 0; int i; (void)builtin_pytype; @@ -32070,15 +34012,21 @@ SWIG_init(void) { (void)builtin_basetype; (void)tuple; (void)static_getset; + (void)self; - /* 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); + /* Metaclass is used to implement static member variables */ + metatype = SwigPyObjectType(); assert(metatype); - Py_DECREF(metatype_args); - metatype->tp_setattro = (setattrofunc) &SwigPyObjectType_setattro; - assert(PyType_Ready(metatype) >= 0); +#endif + + (void)globals; + + /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */ + SWIG_This(); + SWIG_Python_TypeCache(); + SwigPyPacked_type(); +#ifndef SWIGPYTHON_BUILTIN + SwigPyObject_type(); #endif /* Fix SwigMethods to carry the callback ptrs when needed */ @@ -32087,21 +34035,24 @@ SWIG_init(void) { #if PY_VERSION_HEX >= 0x03000000 m = PyModule_Create(&SWIG_module); #else - m = Py_InitModule((char *) SWIG_name, SwigMethods); + m = Py_InitModule(SWIG_name, SwigMethods); #endif + md = d = PyModule_GetDict(m); (void)md; SWIG_InitializeModule(0); #ifdef SWIGPYTHON_BUILTIN + swigpyobject = SwigPyObject_TypeOnce(); + 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) { + SwigPyObject_clientdata.pytype = swigpyobject; + } else if (swigpyobject->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; @@ -32132,80 +34083,14 @@ SWIG_init(void) { 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, "OPENSSL_VERSION_NUMBER",SWIG_From_long((long)(0x1010108fL))); + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_VERSION_TEXT",SWIG_FromCharPtr("OpenSSL 1.1.1h 22 Sep 2020")); 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, "SHLIB_VERSION_NUMBER",SWIG_FromCharPtr("1.1")); + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_FILE",SWIG_FromCharPtr("/usr/include/openssl/opensslconf.h")); + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_LINE",SWIG_From_int((int)(134))); + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_MIN_API",SWIG_From_int((int)(0))); + SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_API_COMPAT",SWIG_From_int((int)(0))); 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))); @@ -32214,9 +34099,19 @@ SWIG_init(void) { 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()); + globals = SWIG_globals(); + if (!globals) { + PyErr_SetString(PyExc_TypeError, "Failure to create SWIG globals."); +#if PY_VERSION_HEX >= 0x03000000 + return NULL; +#else + return; +#endif + } + PyDict_SetItemString(md, "cvar", globals); + Py_DECREF(globals); SwigPyBuiltin_AddPublicSymbol(public_interface, "cvar"); - SWIG_addvarlink(SWIG_globals(),(char*)"_bio_err",Swig_var__bio_err_get, Swig_var__bio_err_set); + SWIG_addvarlink(globals, "_bio_err", Swig_var__bio_err_get, Swig_var__bio_err_set); /* type '::pyfd_struct' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__pyfd_struct_type; @@ -32237,13 +34132,13 @@ SWIG_init(void) { #endif } Py_INCREF(builtin_pytype); - PyModule_AddObject(m, "BIO_PYFD_CTX", (PyObject*) 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_addvarlink(globals, "methods_fdp", Swig_var_methods_fdp_get, Swig_var_methods_fdp_set); + SWIG_addvarlink(globals, "_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_addvarlink(globals, "_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))); @@ -32253,7 +34148,7 @@ SWIG_init(void) { 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_addvarlink(globals, "_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))); @@ -32265,8 +34160,8 @@ SWIG_init(void) { 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_addvarlink(globals, "_rsa_err", Swig_var__rsa_err_get, Swig_var__rsa_err_set); + SWIG_addvarlink(globals, "_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))); @@ -32315,8 +34210,8 @@ SWIG_init(void) { 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_addvarlink(globals, "_ssl_err", Swig_var__ssl_err_get, Swig_var__ssl_err_set); + SWIG_addvarlink(globals, "_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))); @@ -32397,7 +34292,7 @@ SWIG_init(void) { 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_addvarlink(globals, "_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))); @@ -32422,9 +34317,9 @@ SWIG_init(void) { 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_addvarlink(globals, "_pkcs7_err", Swig_var__pkcs7_err_get, Swig_var__pkcs7_err_set); + SWIG_addvarlink(globals, "_smime_err", Swig_var__smime_err_get, Swig_var__smime_err_set); + SWIG_addvarlink(globals, "_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))); @@ -32493,7 +34388,7 @@ SWIG_init(void) { 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); + SWIG_addvarlink(globals, "_ec_err", Swig_var__ec_err_get, Swig_var__ec_err_set); /* type '::_cbd_t' */ builtin_pytype = (PyTypeObject *)&SwigPyBuiltin___cbd_t_type; @@ -32514,10 +34409,10 @@ SWIG_init(void) { #endif } Py_INCREF(builtin_pytype); - PyModule_AddObject(m, "_cbd_t", (PyObject*) 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_addvarlink(globals, "_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))); diff --git a/doc/html/.buildinfo b/doc/html/.buildinfo index 50b077b..ae86a0d 100644 --- a/doc/html/.buildinfo +++ b/doc/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: f47da9e27c47bb67c681b112c1dbec32 +config: 52499de5204afeda021fbfe2ec6f244e tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/doc/html/M2Crypto.SSL.html b/doc/html/M2Crypto.SSL.html index 4a81972..a6b1cb3 100644 --- a/doc/html/M2Crypto.SSL.html +++ b/doc/html/M2Crypto.SSL.html @@ -1,19 +1,18 @@ - + - + - - + + SSL Package — M2Crypto documentation - - - - - + + + + + @@ -37,799 +36,106 @@

SSL Package

SSL Package

-
-
-exception M2Crypto.SSL.SSLError[source]
-

Bases: Exception

-
- -
-
-exception M2Crypto.SSL.SSLTimeoutError[source]
-

Bases: M2Crypto.SSL.SSLError, socket.timeout

-
-
-
-

Checker Module

-

SSL peer certificate checking routines

-

Copyright (c) 2004-2007 Open Source Applications Foundation. -All rights reserved.

-

Copyright 2008 Heikki Toivonen. All rights reserved.

-
-
-exception M2Crypto.SSL.Checker.SSLVerificationError[source]
-

Bases: Exception

-
- -
-
-exception M2Crypto.SSL.Checker.NoCertificate[source]
-

Bases: M2Crypto.SSL.Checker.SSLVerificationError

-
- -
-
-exception M2Crypto.SSL.Checker.WrongCertificate[source]
-

Bases: M2Crypto.SSL.Checker.SSLVerificationError

-
- -
-
-exception M2Crypto.SSL.Checker.WrongHost(expectedHost, actualHost, fieldName='commonName')[source]
-

Bases: M2Crypto.SSL.Checker.SSLVerificationError

-
- -
-
-class M2Crypto.SSL.Checker.Checker(host=None, peerCertHash=None, peerCertDigest='sha1')[source]
-

Bases: object

-
-
-numericIpMatch = re.compile('^[0-9]+(\\.[0-9]+)*$')
-
- -
- +
+

Checker Module

Cipher Module

SSL Ciphers

Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.

-
+
-class M2Crypto.SSL.Cipher.Cipher(cipher)[source]
+class M2Crypto.SSL.Cipher.Cipher(cipher: str)[source]

Bases: object

-
+
-name()[source]
+name() → str[source]
-
+
-version()[source]
+version() → int[source]
-
+
-class M2Crypto.SSL.Cipher.Cipher_Stack(stack)[source]
+class M2Crypto.SSL.Cipher.Cipher_Stack(stack: bytes)[source]

Bases: object

-
-

Connection Module

-
-
-class M2Crypto.SSL.Connection.Connection(ctx, sock=None, family=<AddressFamily.AF_INET: 2>)[source]
-

Bases: object

-

An SSL connection.

-
-
-accept()[source]
-

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.

- --- - - - -
Returns: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.
-
- -
-
-accept_ssl()[source]
-

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.

- --- - - - -
Returns:
-
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.
-
-
-
- -
-
-bind(addr)[source]
-
- -
-
-clear()[source]
-

If there were errors in this connection, call clear() rather -than close() to end it, so that bad sessions will be cleared -from cache.

-
- -
-
-clientPostConnectionCheck = <M2Crypto.SSL.Checker.Checker object>
-
- -
-
-close()[source]
-
- -
-
-connect(addr)[source]
-

Overloading socket.connect()

- --- - - - -
Parameters:addr – addresses have various depending on their type
-

:return:status of ssl_connect()

-
- -
-
-connect_ssl()[source]
-
- -
-
-fileno()[source]
-
- -
-
-get_cipher()[source]
-

Return an M2Crypto.SSL.Cipher object for this connection; if the -connection has not been initialised with a cipher suite, return None.

-
- -
-
-get_cipher_list(idx=0)[source]
-

Return the cipher suites for this connection as a string object.

-
- -
-
-get_ciphers()[source]
-

Return an M2Crypto.SSL.Cipher_Stack object for this -connection; if the connection has not been initialised with -cipher suites, return None.

-
- -
-
-get_context()[source]
-

Return the Context object associated with this connection.

-
- -
-
-get_default_session_timeout()[source]
-
- -
-
-get_peer_cert()[source]
-

Return the peer certificate.

-

If the peer did not provide a certificate, return None.

-
- -
-
-get_peer_cert_chain()[source]
-

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.
-
- -
-
-get_session()[source]
-
- -
-
-get_shutdown()[source]
-

Get the current shutdown mode of the Connection.

-
- -
-
-get_socket_read_timeout()[source]
-
- -
-
-get_socket_write_timeout()[source]
-
- -
-
-get_state()[source]
-

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.

- --- - - - -
Returns:6 letter string indicating the current state of the SSL -object ssl.
-
- -
-
-get_verify_depth()[source]
-

Return the peer certificate verification depth.

-
- -
-
-get_verify_mode()[source]
-

Return the peer certificate verification mode.

-
- -
-
-get_verify_result()[source]
-

Return the peer certificate verification result.

-
- -
-
-get_version()[source]
-

Return the TLS/SSL protocol version for this connection.

-
- -
-
-getpeername()[source]
-

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.

- --- - - - -
Returns:
-
- -
-
-getsockname()[source]
-

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

-
- -
-
-getsockopt(level, optname, buflen=None)[source]
-

Get the value of the given socket option.

- --- - - - - - -
Parameters:
    -
  • 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).
  • -
  • 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.
  • -
  • 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.
  • -
-
Returns:

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).

-
-
- -
-
-listen(qlen=5)[source]
-
- -
-
-m2_bio_free()
-
- -
-
-m2_bio_noclose = 0
-
- -
-
-m2_ssl_free()
-
- -
-
-makefile(mode='rb', bufsize=-1)[source]
-
- -
-
-pending()[source]
-

Return the numbers of octets that can be read from the connection.

-
- -
-
-read(size=1024)[source]
-
- -
-
-recv(size=1024)
-
- -
-
-recv_into(buff, nbytes=0)[source]
-

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.

- --- - - - - - -
Parameters:
    -
  • buffer – a buffer for the received bytes
  • -
  • nbytes – maximum number of bytes to read
  • -
-
Returns:

number of bytes read

-
-

See recv() for documentation about the flags.

-
- -
-
-renegotiate()[source]
-

Renegotiate this connection’s SSL parameters.

-
- -
-
-send(data)
-
- -
-
-sendall(data)
-
- -
-
-serverPostConnectionCheck(**kw)
-
- -
-
-set1_host(name)[source]
-

Set the requested hostname to check in the server certificate.

-
- -
-
-set_accept_state()[source]
-

Sets Connection to work in the server mode.

-
- -
-
-set_bio(readbio, writebio)[source]
-

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).

- --- - - - -
Parameters:
    -
  • readbio – BIO for reading
  • -
  • writebio – BIO for writing.
  • -
-
-
- -
-
-set_cipher_list(cipher_list)[source]
-

Set the cipher suites for this connection.

-
- -
-
-set_client_CA_list_from_context()[source]
-

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.

-
- -
-
-set_client_CA_list_from_file(cafile)[source]
-

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.

- --- - - - - - -
Parameters:cafile – Filename from which to load the CA list.
Returns:
-
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.

-
-
- -
-
-set_connect_state()[source]
-

Sets Connection to work in the client mode.

-
- -
-
-set_post_connection_check_callback(postConnectionCheck)[source]
-
- -
-
-set_session(session)[source]
-
- -
-
-set_session_id_ctx(id)[source]
-
- -
-
-set_shutdown(mode)[source]
-

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.

- --- - - - -
Parameters:mode – set the mode bitmask.
-
- -
-
-set_socket_read_timeout(timeo)[source]
-
- -
-
-set_socket_write_timeout(timeo)[source]
-
- -
-
-set_ssl_close_flag(flag)[source]
-

By default, SSL struct will be freed in __del__. Call with -m2.bio_close to override this default.

- --- - - - -
Parameters:flag – either m2.bio_close or m2.bio_noclose
-
- -
-
-set_tlsext_host_name(name)[source]
-

Set the requested hostname for the SNI (Server Name Indication) -extension.

-
- -
-
-setblocking(mode)[source]
-

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).

- --- - - - -
Parameters:mode – new mode to be set
-
- -
-
-setsockopt(level, optname, value=None)[source]
-

Set the value of the given socket option.

- --- - - - - - -
Parameters:
    -
  • level – same as with getsockopt() above
  • -
  • optname – same as with getsockopt() above
  • -
  • 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).
  • -
-
Returns:

None for success or the error handler for failure.

-
-
- -
-
-settimeout(timeout)[source]
-

Set this connection’s underlying socket’s timeout to _timeout_.

-
- -
-
-setup_addr(addr)[source]
-
- -
-
-setup_ssl()[source]
-
- -
-
-shutdown(how)[source]
-
- -
-
-ssl_get_error(ret)[source]
-
- -
-
-verify_ok()[source]
-
- -
-
-write(data)[source]
-
- -
- +
+

Connection Module

Context Module

-
-
-M2Crypto.SSL.Context.ctxmap()[source]
-
- -
+
-class M2Crypto.SSL.Context.Context(protocol='tls', weak_crypto=None, post_connection_check=None)[source]
+class M2Crypto.SSL.Context.Context(protocol: str = 'tls', weak_crypto: Optional[int] = None, post_connection_check: Optional[Callable] = None)[source]

Bases: object

‘Context’ for SSL connections.

-
+
-add_session(session)[source]
+add_session(session: M2Crypto.SSL.Session.Session) → int[source]

Add the session to the context.

- --- - - - - - -
Parameters:session – the session to be added.
Returns:
-
0 The operation failed. It was tried to add the same
-
(identical) session twice.
+
+
Parameters
+

session – the session to be added.

+
+
Returns
+

+
0 The operation failed. It was tried to add the same

(identical) session twice.

+

1 The operation succeeded.

-
+

+
+
-
+
-close()[source]
+close() → None[source]
-
+
-get_allow_unknown_ca()[source]
+get_allow_unknown_ca() → Union[int, bool][source]

Get the context’s setting that accepts/rejects a peer certificate if the certificate’s CA is unknown.

FIXME 2Bconverted to bool

-
+
-get_cert_store()[source]
+get_cert_store() → X509.X509[source]

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.
+
+
Warning
+

The store is NOT refcounted, and as such can not be relied +to be valid once the context goes away or is changed.

+
+
-
+
-get_session_cache_mode()[source]
+get_session_cache_mode() → int[source]

Gets the current session caching.

The mode is set to m2.SSL_SESS_CACHE_* constants.

- --- - - - -
Returns:the previously set cache mode value.
+
+
Returns
+

the previously set cache mode value.

+
+
-
+
-get_session_timeout()[source]
+get_session_timeout() → int[source]

Get current session timeout.

Whenever a new session is created, it is assigned a maximum lifetime. This lifetime is specified by storing the creation @@ -849,249 +155,212 @@ 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.

- --- - - - -
Returns:the currently set timeout value.
+
+
Returns
+

the currently set timeout value.

+
+
-
+
-get_verify_depth()[source]
+get_verify_depth() → int[source]

Returns the verification mode currently set in the SSL Context.

-
+
-get_verify_mode()[source]
+get_verify_mode() → int[source]
-
+
-load_cert(certfile, keyfile=None, callback=<function passphrase_callback>)[source]
+load_cert(certfile: AnyStr, keyfile: Optional[AnyStr] = None, callback: Callable = <function passphrase_callback>) → None[source]

Load certificate and private key into the context.

- --- - - - -
Parameters:
    -
  • certfile – File that contains the PEM-encoded certificate.
  • -
  • keyfile – File that contains the PEM-encoded private key. +
    +
    Parameters
    +
      +
    • certfile – File that contains the PEM-encoded certificate.

    • +
    • keyfile – File that contains the PEM-encoded private key. Default value of None indicates that the private key -is to be found in ‘certfile’.

    • -
    • callback – Callable object to be invoked if the private key is +is to be found in ‘certfile’.

    • +
    • callback – Callable object to be invoked if the private key is passphrase-protected. Default callback provides a -simple terminal-style input for the passphrase.

    • +simple terminal-style input for the passphrase.

    -
+
+
-
+
-load_cert_chain(certchainfile, keyfile=None, callback=<function passphrase_callback>)[source]
+load_cert_chain(certchainfile: AnyStr, keyfile: Optional[AnyStr] = None, callback: Callable = <function passphrase_callback>) → None[source]

Load certificate chain and private key into the context.

- --- - - - -
Parameters:
    -
  • certchainfile – File object containing the PEM-encoded -certificate chain.
  • -
  • keyfile – File object containing the PEM-encoded private +
    +
    Parameters
    +
      +
    • certchainfile – File object containing the PEM-encoded +certificate chain.

    • +
    • keyfile – File object containing the PEM-encoded private key. Default value of None indicates that the -private key is to be found in ‘certchainfile’.

    • -
    • callback – Callable object to be invoked if the private key +private key is to be found in ‘certchainfile’.

    • +
    • callback – Callable object to be invoked if the private key is passphrase-protected. Default callback provides a simple terminal-style input for the -passphrase.

    • +passphrase.

    -
+
+
-
+
-load_client_CA(cafile)
+load_client_CA(cafile: AnyStr) → None

Load CA certs into the context. These CA certs are sent to the peer during SSLv3 certificate request.

- --- - - - -
Parameters:cafile – File object containing one or more PEM-encoded CA -certificates concatenated together.
+
+
Parameters
+

cafile – File object containing one or more PEM-encoded CA +certificates concatenated together.

+
+
-
+
-load_client_ca(cafile)
+load_client_ca(cafile: AnyStr) → None

Load CA certs into the context. These CA certs are sent to the peer during SSLv3 certificate request.

- --- - - - -
Parameters:cafile – File object containing one or more PEM-encoded CA -certificates concatenated together.
+
+
Parameters
+

cafile – File object containing one or more PEM-encoded CA +certificates concatenated together.

+
+
-
+
-load_verify_info(cafile=None, capath=None)
+load_verify_info(cafile: Optional[AnyStr] = None, capath: Optional[AnyStr] = None) → int

Load CA certs into the context.

These CA certs are used during verification of the peer’s certificate.

- --- - - - - - -
Parameters:
    -
  • cafile – File containing one or more PEM-encoded CA -certificates concatenated together.
  • -
  • capath – Directory containing PEM-encoded CA certificates -(one certificate per file).
  • +
    +
    Parameters
    +
      +
    • cafile – File containing one or more PEM-encoded CA +certificates concatenated together.

    • +
    • capath – Directory containing PEM-encoded CA certificates +(one certificate per file).

    -
Returns:

-
0 if the operation failed because CAfile and CApath are NULL
-

or the processing at one of the locations specified failed. +

+
Returns
+

+
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.

-
+
+
-
+
-load_verify_locations(cafile=None, capath=None)[source]
+load_verify_locations(cafile: Optional[AnyStr] = None, capath: Optional[AnyStr] = None) → int[source]

Load CA certs into the context.

These CA certs are used during verification of the peer’s certificate.

- --- - - - - - -
Parameters:
    -
  • cafile – File containing one or more PEM-encoded CA -certificates concatenated together.
  • -
  • capath – Directory containing PEM-encoded CA certificates -(one certificate per file).
  • +
    +
    Parameters
    +
      +
    • cafile – File containing one or more PEM-encoded CA +certificates concatenated together.

    • +
    • capath – Directory containing PEM-encoded CA certificates +(one certificate per file).

    -
Returns:

-
0 if the operation failed because CAfile and CApath are NULL
-

or the processing at one of the locations specified failed. +

+
Returns
+

+
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.

-
+
+
-
+
-m2_ssl_ctx_free()
+m2_ssl_ctx_free()
-
+
-remove_session(session)[source]
+remove_session(session: M2Crypto.SSL.Session.Session) → int[source]

Remove the session from the context.

- --- - - - - - -
Parameters:session – the session to be removed.
Returns:
-
0 The operation failed. The session was not found in
-
the cache.
+
+
Parameters
+

session – the session to be removed.

+
+
Returns
+

+
0 The operation failed. The session was not found in

the cache.

+

1 The operation succeeded.

-
+

+
+
-
+
-set_allow_unknown_ca(ok)[source]
+set_allow_unknown_ca(ok: Union[int, bool]) → None[source]

Set the context to accept/reject a peer certificate if the certificate’s CA is unknown.

- --- - - - -
Parameters:ok – True to accept, False to reject.
+
+
Parameters
+

ok – True to accept, False to reject.

+
+
-
+
-set_cipher_list(cipher_list)[source]
+set_cipher_list(cipher_list: str) → int[source]

Sets the list of available ciphers.

- --- - - - - - -
Parameters:cipher_list – The format of the string is described in -ciphers(1).
Returns:1 if any cipher could be selected and 0 on complete -failure.
+
+
Parameters
+

cipher_list – The format of the string is described in +ciphers(1).

+
+
Returns
+

1 if any cipher could be selected and 0 on complete +failure.

+
+
-
+
-set_client_CA_list_from_file(cafile)[source]
+set_client_CA_list_from_file(cafile: AnyStr) → None[source]

Load CA certs into the context. These CA certs are sent to the peer during SSLv3 certificate request.

- --- - - - -
Parameters:cafile – File object containing one or more PEM-encoded CA -certificates concatenated together.
+
+
Parameters
+

cafile – File object containing one or more PEM-encoded CA +certificates concatenated together.

+
+
-
+
-set_default_verify_paths()[source]
+set_default_verify_paths() → int[source]

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 @@ -1101,35 +370,32 @@ 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.

+
+
@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.

-
+
-set_info_callback(callback=<function ssl_info_callback>)[source]
+set_info_callback(callback: Callable = <function ssl_info_callback>) → None[source]

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.

- --- - - - -
Parameters:callback – Callback function. The default prints -information to stderr.
+
+
Parameters
+

callback – Callback function. The default prints +information to stderr.

+
+
-
+
-set_options(op)[source]
+set_options(op: int) → int[source]

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 @@ -1144,45 +410,39 @@ 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.

- --- - - - - - -
Parameters:op – bitmask of additional options specified in -SSL_CTX_set_options(3) manpage.
Returns:the new options bitmask after adding options.
+
+
Parameters
+

op – bitmask of additional options specified in +SSL_CTX_set_options(3) manpage.

+
+
Returns
+

the new options bitmask after adding options.

+
+
-
+
-set_session_cache_mode(mode)[source]
+set_session_cache_mode(mode: int) → int[source]

Enables/disables session caching.

The mode is set by using m2.SSL_SESS_CACHE_* constants.

- --- - - - - - -
Parameters:mode – new mode value.
Returns:the previously set cache mode value.
+
+
Parameters
+

mode – new mode value.

+
+
Returns
+

the previously set cache mode value.

+
+
-
+
-set_session_id_ctx(id)[source]
+set_session_id_ctx(id: bytes) → None[source]

Sets the session id for the SSL.Context w/in a session can be reused.

- --- - - - -
Parameters:id – Sessions are generated within a certain context. When +
+
Parameters
+

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 @@ -1193,397 +453,191 @@ 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.

+and/or service name.

+
+
-
+
-set_session_timeout(timeout)[source]
+set_session_timeout(timeout: int) → int[source]

Set new session timeout.

See self.get_session_timeout() for explanation of the session timeouts.

- --- - - - - - -
Parameters:timeout – new timeout value.
Returns:the previously set timeout value.
+
+
Parameters
+

timeout – new timeout value.

+
+
Returns
+

the previously set timeout value.

+
+
-
+
-set_tmp_dh(dhpfile)[source]
+set_tmp_dh(dhpfile: AnyStr) → int[source]

Load ephemeral DH parameters into the context.

- --- - - - -
Parameters:dhpfile – Filename of the file containing the PEM-encoded -DH parameters.
+
+
Parameters
+

dhpfile – Filename of the file containing the PEM-encoded +DH parameters.

+
+
-
+
-set_tmp_dh_callback(callback=None)[source]
+set_tmp_dh_callback(callback: Optional[Callable] = None) → None[source]

Sets the callback function for SSL.Context.

- --- - - - -
Parameters:callback – Callable to be used when a DH parameters are required.
+
+
Parameters
+

callback – Callable to be used when a DH parameters are required.

+
+
-
+
-set_tmp_rsa(rsa)[source]
+set_tmp_rsa(rsa: M2Crypto.RSA.RSA) → int[source]

Load ephemeral RSA key into the context.

- --- - - - -
Parameters:rsa – RSA.RSA instance.
+
+
Parameters
+

rsa – RSA.RSA instance.

+
+
-
+
-set_tmp_rsa_callback(callback=None)[source]
+set_tmp_rsa_callback(callback: Optional[Callable] = None) → None[source]

Sets the callback function to be used when a temporary/ephemeral RSA key is required.

-
+
-set_verify(mode, depth, callback=None)[source]
+set_verify(mode: int, depth: int, callback: Optional[Callable] = None) → None[source]

Set verify options. Most applications will need to call this method with the right options to make a secure SSL connection.

- --- - - - -
Parameters:
    -
  • mode – The verification mode to use. Typically at least +
    +
    Parameters
    +
      +
    • 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.

    • -
    • depth – The maximum allowed depth of the certificate chain -returned by the peer.
    • -
    • callback – Callable that can be used to specify custom -verification checks.
    • +add SSL.verify_fail_if_no_peer_cert.

      +
    • depth – The maximum allowed depth of the certificate chain +returned by the peer.

    • +
    • callback – Callable that can be used to specify custom +verification checks.

    -
+
+
-
+
+
+M2Crypto.SSL.Context.ctxmap() → M2Crypto.SSL.Context._ctxmap[source]
+
+ +
-M2Crypto.SSL.Context.map()
+M2Crypto.SSL.Context.map() → M2Crypto.SSL.Context._ctxmap
-
-

SSLServer Module

-
-
-class M2Crypto.SSL.SSLServer.SSLServer(server_address, RequestHandlerClass, ssl_context, bind_and_activate=True)[source]
-

Bases: socketserver.TCPServer

-
-
-handle_error(request, client_address)[source]
-

Handle an error gracefully. May be overridden.

-

The default is to print a traceback and continue.

-
- -
-
-handle_request()[source]
-

Handle one request, possibly blocking.

-

Respects self.timeout.

-
- -
- -
-
-class M2Crypto.SSL.SSLServer.ForkingSSLServer(server_address, RequestHandlerClass, ssl_context, bind_and_activate=True)[source]
-

Bases: socketserver.ForkingMixIn, M2Crypto.SSL.SSLServer.SSLServer

-
- -
-
-class M2Crypto.SSL.SSLServer.ThreadingSSLServer(server_address, RequestHandlerClass, ssl_context, bind_and_activate=True)[source]
-

Bases: socketserver.ThreadingMixIn, M2Crypto.SSL.SSLServer.SSLServer

-
- +
+

SSLServer Module

Session Module

SSL Session

Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.

-
+
-class M2Crypto.SSL.Session.Session(session, _pyfree=0)[source]
+class M2Crypto.SSL.Session.Session(session: bytes, _pyfree: int = 0)[source]

Bases: object

-
+
-as_der()[source]
+as_der() → bytes[source]
-
+
-as_text()[source]
+as_text() → bytes[source]
-
+
-get_time()[source]
+get_time() → int[source]
-
+
-get_timeout()[source]
+get_timeout() → int[source]
-
+
-m2_ssl_session_free()
+m2_ssl_session_free()
-
+
-set_time(t)[source]
+set_time(t: int) → int[source]
-
+
-set_timeout(t)[source]
+set_timeout(t: int) → int[source]
-
+
-write_bio(bio)[source]
+write_bio(bio: BIO.BIO) → int[source]
-
+
-M2Crypto.SSL.Session.load_session(pemfile)[source]
+M2Crypto.SSL.Session.load_session(pemfile: AnyStr)M2Crypto.SSL.Session.Session[source]
-
-

TwistedProtocolWrapper Module

-

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.

-
-
-M2Crypto.SSL.TwistedProtocolWrapper.connectSSL(host, port, factory, contextFactory, timeout=30, bindAddress=None, reactor=<twisted.internet.epollreactor.EPollReactor object>, postConnectionCheck=<M2Crypto.SSL.Checker.Checker object>)[source]
-

A convenience function to start an SSL/TLS connection using Twisted.

-

See IReactorSSL interface in Twisted.

-
- -
-
-M2Crypto.SSL.TwistedProtocolWrapper.connectTCP(host, port, factory, timeout=30, bindAddress=None, reactor=<twisted.internet.epollreactor.EPollReactor object>, postConnectionCheck=<M2Crypto.SSL.Checker.Checker object>)[source]
-

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.

-
- -
-
-M2Crypto.SSL.TwistedProtocolWrapper.listenSSL(port, factory, contextFactory, backlog=5, interface='', reactor=<twisted.internet.epollreactor.EPollReactor object>, postConnectionCheck=<function _alwaysSucceedsPostConnectionCheck>)[source]
-

A convenience function to listen for SSL/TLS connections using Twisted.

-

See IReactorSSL interface in Twisted.

-
- -
-
-M2Crypto.SSL.TwistedProtocolWrapper.listenTCP(port, factory, backlog=5, interface='', reactor=<twisted.internet.epollreactor.EPollReactor object>, postConnectionCheck=None)[source]
-

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.

-
- -
-
-class M2Crypto.SSL.TwistedProtocolWrapper.TLSProtocolWrapper(factory, wrappedProtocol, startPassThrough, client, contextFactory, postConnectionCheck)[source]
-

Bases: twisted.protocols.policies.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.

-
-
-clear()[source]
-

Clear this instance, after which it is ready for reuse.

-
- -
-
-connectionLost(reason)[source]
-

Called when the connection is shut down.

-

Clear any circular references here, and any external references -to this Protocol. The connection has been closed.

-

@type reason: L{twisted.python.failure.Failure}

-
- -
-
-connectionMade()[source]
-

Called when a connection is made.

-

This may be considered the initializer of the protocol, because -it is called when the connection is completed. For clients, -this is called once the connection to the server has been -established; for servers, this is called after an accept() call -stops blocking and a socket has been received. If you need to -send any greeting or initial message, do it here.

-
- -
-
-dataReceived(data)[source]
-

Called whenever data is received.

-

Use this method to translate to a higher-level message. Usually, some -callback will be made upon the receipt of each complete protocol -message.

-
-
@param data: a string of indeterminate length. Please keep in mind
-
that you will probably need to buffer some data, as partial -(or multiple) protocol messages may be received! I recommend -that unit tests for protocols call through to this method with -differing chunk sizes, down to one byte at a time.
-
-
- -
-
-loseConnection()[source]
-
- -
-
-startTLS(ctx)[source]
-

Start SSL/TLS. If this is not called, this instance just passes data -through untouched.

-
- -
-
-write(data)[source]
-
- -
-
-writeSequence(data)[source]
-
- -
- +
+

TwistedProtocolWrapper Module

cb Module

-
-
-M2Crypto.SSL.cb.ssl_verify_callback_stub(ssl_ctx_ptr, x509_ptr, errnum, errdepth, ok)[source]
+
+
+M2Crypto.SSL.cb.ssl_info_callback(where: int, ret: int, ssl_ptr: bytes) → None[source]
-
+
-M2Crypto.SSL.cb.ssl_verify_callback(ssl_ctx_ptr, x509_ptr, errnum, errdepth, ok)[source]
+M2Crypto.SSL.cb.ssl_verify_callback(ssl_ctx_ptr: bytes, x509_ptr: bytes, errnum: int, errdepth: int, ok: int) → int[source]
-
+
-M2Crypto.SSL.cb.ssl_verify_callback_allow_unknown_ca(ok, store)[source]
+M2Crypto.SSL.cb.ssl_verify_callback_allow_unknown_ca(ok: int, store: Any) → int[source]
-
-
-M2Crypto.SSL.cb.ssl_info_callback(where, ret, ssl_ptr)[source]
+
+
+M2Crypto.SSL.cb.ssl_verify_callback_stub(ssl_ctx_ptr, x509_ptr, errnum, errdepth, ok)[source]
-
-

ssl_dispatcher Module

-
-
-class M2Crypto.SSL.ssl_dispatcher.ssl_dispatcher(sock=None, map=None)[source]
-

Bases: asyncore.dispatcher

-
-
-connect(addr)[source]
-
- -
-
-create_socket(ssl_context)[source]
-
- -
-
-recv(buffer_size=4096)[source]
-

Receive data over SSL.

-
- -
-
-send(buffer)[source]
-

Send data over SSL.

-
- -
- +
+

ssl_dispatcher Module

-
-

timeout Module

-

Support for SSL socket timeouts.

-

Copyright (c) 1999-2003 Ng Pheng Siong. All rights reserved.

-

Copyright 2008 Heikki Toivonen. All rights reserved.

-
-
-class M2Crypto.SSL.timeout.timeout(sec=600, microsec=0)[source]
-

Bases: object

-
-
-pack()[source]
-
- -
- -
-
-M2Crypto.SSL.timeout.struct_to_timeout(binstr)[source]
-
- -
-
-M2Crypto.SSL.timeout.struct_size()[source]
-
- +
+

timeout Module

@@ -1606,45 +660,45 @@ through untouched.

Navigation

- + @@ -1691,7 +743,7 @@ through untouched.

©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12 | diff --git a/doc/html/M2Crypto.html b/doc/html/M2Crypto.html index b659a5e..ff8cc46 100644 --- a/doc/html/M2Crypto.html +++ b/doc/html/M2Crypto.html @@ -1,19 +1,18 @@ - + - + - - + + M2Crypto Package — M2Crypto documentation - - - - - + + + + + @@ -38,4559 +37,1089 @@

M2Crypto Package

M2Crypto Package

-
-
-

ASN1 Module

-
-
-class M2Crypto.ASN1.ASN1_Integer(asn1int, _pyfree=0)[source]
+
+
+

ASN1 Module

+
+
+

AuthCookie Module

+
+
+

BIO Module

+
+
+

BN Module

+
+
+

DH Module

+
+
+

DSA Module

+
+
+

EC Module

+
+
+

EVP Module

+
+
+class M2Crypto.EVP.Cipher(alg: str, key: bytes, iv: bytes, op: object, key_as_bytes: int = 0, d: str = 'md5', salt: bytes = b'12345678', i: int = 1, padding: int = 1)[source]

Bases: object

-
-
-m2_asn1_integer_free()
+
+
+final() → bytes[source]
+
+
+m2_cipher_ctx_free()
+
+ +
+
+set_padding(padding: int = 1) → int[source]
+

Actually always return 1

-
-
-class M2Crypto.ASN1.ASN1_Object(asn1obj, _pyfree=0)[source]
-

Bases: object

-
-
-m2_asn1_object_free()
+
+
+update(data: bytes) → bytes[source]
-
-
-class M2Crypto.ASN1.ASN1_String(asn1str, _pyfree=0)[source]
-

Bases: object

-
-
-as_text(flags=0)[source]
-

Output an ASN1_STRING structure according to the set flags.

- --- - - - - - -
Parameters:flags – determine the format of the output by using -predetermined constants, see ASN1_STRING_print_ex(3) -manpage for their meaning.
Returns:output an ASN1_STRING structure.
+
+
+exception M2Crypto.EVP.EVPError[source]
+

Bases: ValueError

-
-
-m2_asn1_string_free()
+
+
+class M2Crypto.EVP.HMAC(key: bytes, algo: str = 'sha1')[source]
+

Bases: object

+
+
+digest() → bytes
+
+ +
+
+final() → bytes[source]
+
+ +
+
+m2_hmac_ctx_free()
+
+ +
+
+reset(key: bytes) → None[source]
+
+ +
+
+update(data: bytes) → None[source]
-
-
-class M2Crypto.ASN1.ASN1_TIME(asn1_time=None, _pyfree=0, asn1_utctime=None)[source]
+
+
+class M2Crypto.EVP.MessageDigest(algo: str)[source]

Bases: object

-
-
-get_datetime()[source]
+

Message Digest

+
+
+digest()
-
-
-m2_asn1_time_free()
+
+
+final()[source]
-
-
-set_datetime(date)[source]
+
+
+m2_md_ctx_free()
-
-
-set_string(string)[source]
-

Set time from UTC string.

+
+
+update(data: bytes) → int[source]
+

Add data to be digested.

+
+
Returns
+

-1 for Python error, 1 for success, 0 for OpenSSL failure.

+
+
-
-
-set_time(time)[source]
-

Set time from seconds since epoch (int).

+
+
+class M2Crypto.EVP.PKey(pkey: Optional[bytes] = None, _pyfree: int = 0, md: str = 'sha1')[source]
+

Bases: object

+

Public Key

+
+
+as_der() → bytes[source]
+

Return key in DER format in a string

-
-
-M2Crypto.ASN1.ASN1_UTCTIME
-

alias of M2Crypto.ASN1.ASN1_TIME

+
+
+as_pem(cipher: Optional[str] = 'aes_128_cbc', callback: Callable = <function passphrase_callback>) → bytes[source]
+

Return key in PEM format in a string.

+
+
Parameters
+
    +
  • 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.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect +the key. The default is +util.passphrase_callback.

  • +
+
+
-
-
-class M2Crypto.ASN1.LocalTimezone[source]
-

Bases: datetime.tzinfo

-

Localtimezone from datetime manual.

-
-
-dst(dt)[source]
-

datetime -> DST offset as timedelta positive east of UTC.

+
+
+assign_rsa(rsa: M2Crypto.RSA.RSA, capture: int = 1) → int[source]
+

Assign the RSA key pair to self.

+
+
Parameters
+
    +
  • rsa – M2Crypto.RSA.RSA object to be assigned to self.

  • +
  • 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.

  • +
+
+
Returns
+

Return 1 for success and 0 for failure.

+
+
-
-
-tzname(dt)[source]
-

datetime -> string name of time zone.

+
+
+digest_sign(data) → bytes[source]
+

Return signature.

+
+
Returns
+

The signature.

+
+
-
-
-utcoffset(dt)[source]
-

datetime -> timedelta showing offset from UTC, negative values indicating West of UTC

+
+
+digest_sign_final() → bytes[source]
+

Return signature.

+
+
Returns
+

The signature.

+
+
+
+
+digest_sign_init() → None[source]
+

Initialise digest signing operation with self.

-
-
-

AuthCookie Module

-
-
-class M2Crypto.AuthCookie.AuthCookie(expiry, data, dough, mac)[source]
-

Bases: object

-
-
-data()[source]
-

Return the data portion of the cookie.

+
+
+digest_sign_update(data: bytes) → None[source]
+

Feed data to digest signing operation.

+
+
Parameters
+

data – Data to be signed.

+
+
-
-
-expiry()[source]
-

Return the cookie’s expiry time.

+
+
+digest_verify()[source]
+

Return result of verification.

+
+
Parameters
+
    +
  • sign – Signature to use for verification

  • +
  • data – Data to be verified.

  • +
+
+
Returns
+

Result of verification: 1 for success, 0 for failure, -1 on +other error.

+
+
-
-
-headerValue()[source]
-
- -
-
-isExpired()[source]
-

Return 1 if the cookie has expired, 0 otherwise.

+
+
+digest_verify_final(sign: bytes) → int[source]
+

Feed data to digest verification operation.

+
+
Parameters
+

sign – Signature to use for verification

+
+
Returns
+

Result of verification: 1 for success, 0 for failure, -1 on +other error.

+
+
-
-
-mac()[source]
-

Return the cookie’s MAC.

+
+
+digest_verify_init() → None[source]
+

Initialise verification operation with self.

-
-
-name()[source]
-
+
+
+digest_verify_update(data: bytes) → int[source]
+

Feed data to verification operation.

+
+
Parameters
+

data – Data to be verified.

+
+
Returns
+

-1 on Python error, 1 for success, 0 for OpenSSL error

+
+
+
-
-
-output(header='Set-Cookie:')[source]
-

Return the cookie’s output in “Set-Cookie” format.

+
+
+final() → bytes
+

Return signature.

+
+
Returns
+

The signature.

+
+
-
-
-value()[source]
-

Return the cookie’s output minus the “Set-Cookie: ” portion.

+
+
+get_modulus() → Optional[bytes][source]
+

Return the modulus in hex format.

+
+
+get_rsa()M2Crypto.RSA.RSA_pub[source]
+

Return the underlying RSA key if that is what the EVP +instance is holding.

-
-
-class M2Crypto.AuthCookie.AuthCookieJar[source]
-

Bases: object

-
-
-isGoodCookie(cookie)[source]
+
+
+m2_md_ctx_free()
-
-
-isGoodCookieString(cookie_str, _debug=False)[source]
+
+
+m2_pkey_free()
-
-
-makeCookie(expiry, data)[source]
-

Make a cookie

- --- - - - - - -
Parameters:
    -
  • expiry – expiration time (float in seconds)
  • -
  • data – cookie content
  • -
-
Returns:

AuthCookie object

-
+
+
+reset_context(md: str = 'sha1') → None[source]
+

Reset internal message digest context.

+
+
Parameters
+

md – The message digest algorithm.

+
+
+
+
+save_key(file: AnyStr, cipher: Optional[str] = 'aes_128_cbc', callback: Callable = <function passphrase_callback>) → int[source]
+

Save the key pair to a file in PEM format.

+
+
Parameters
+
    +
  • file – Name of file to save key to.

  • +
  • 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.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect +the key. The default is +util.passphrase_callback.

  • +
+
+
-
-
-M2Crypto.AuthCookie.mix(expiry, data, format='exp=%f&data=%s&digest=')[source]
-
- -
-
-M2Crypto.AuthCookie.unmix(dough, regex=re.compile('exp=(\\d+\\.\\d+)&data=(.+)&digest=(\\S*)'))[source]
-
+
+
+save_key_bio(bio: BIO.BIO, cipher: Optional[str] = 'aes_128_cbc', callback: Callable = <function passphrase_callback>) → int[source]
+

Save the key pair to the M2Crypto.BIO object ‘bio’ in PEM format.

+
+
Parameters
+
    +
  • bio – M2Crypto.BIO object to save key to.

  • +
  • 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.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect +the key. The default is +util.passphrase_callback.

  • +
+
+
+
-
-
-M2Crypto.AuthCookie.unmix3(dough, regex=re.compile('exp=(\\d+\\.\\d+)&data=(.+)&digest=(\\S*)'))[source]
-
+
+
+sign_final() → bytes[source]
+

Return signature.

+
+
Returns
+

The signature.

+
+
+
-
-
-

BIO Module

-
-
-class M2Crypto.BIO.BIO(bio=None, _pyfree=0, _close_cb=None)[source]
-

Bases: object

-

Abstract object interface to the BIO API.

-
-
-bio_ptr()
-
+
+
+sign_init() → None[source]
+

Initialise signing operation with self.

+
-
-
-close()[source]
-
+
+
+sign_update(data: bytes) → None[source]
+

Feed data to signing operation.

+
+
Parameters
+

data – Data to be signed.

+
+
+
-
-
-fileno()[source]
-
+
+
+size() → int[source]
+

Return the size of the key in bytes.

+
-
-
-flush()[source]
-

Flush the buffers.

- --- - - - -
Returns:1 for success, and 0 or -1 for failure
+
+
+update(data: bytes) → None
+

Feed data to signing operation.

+
+
Parameters
+

data – Data to be signed.

+
+
-
-
-m2_bio_free()
-
+
+
+verify_final(sign: bytes) → int[source]
+

Return result of verification.

+
+
Parameters
+

sign – Signature to use for verification

+
+
Returns
+

Result of verification: 1 for success, 0 for failure, -1 on +other error.

+
+
+
-
-
-read(size=None)[source]
-
+
+
+verify_init() → None[source]
+

Initialise signature verification operation with self.

+
-
-
-readable()[source]
-
+
+
+verify_update(data: bytes) → int[source]
+

Feed data to verification operation.

+
+
Parameters
+

data – Data to be verified.

+
+
Returns
+

-1 on Python error, 1 for success, 0 for OpenSSL error

+
+
+
-
-
-readline(size=4096)[source]
-
+
-
-
-readlines(sizehint='ignored')[source]
+
+
+M2Crypto.EVP.hmac(key: bytes, data: bytes, algo: str = 'sha1') → bytes[source]
-
-
-reset()[source]
-

Set the bio to its initial state.

- --- - - - -
Returns:1 for success, and 0 or -1 for failure
+
+
+M2Crypto.EVP.load_key(file: AnyStr, callback: Callable = <function passphrase_callback>)M2Crypto.EVP.PKey[source]
+

Load an M2Crypto.EVP.PKey from file.

+
+
Parameters
+
    +
  • file – Name of file containing the key in PEM format.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect the +key.

  • +
+
+
Returns
+

M2Crypto.EVP.PKey object.

+
+
-
-
-seek(off)[source]
-

Seek to the specified absolute offset.

+
+
+M2Crypto.EVP.load_key_bio(bio: BIO.BIO, callback: Callable = <function passphrase_callback>)PKey[source]
+

Load an M2Crypto.EVP.PKey from an M2Crypto.BIO object.

+
+
Parameters
+
    +
  • bio – M2Crypto.BIO object containing the key in PEM format.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect the +key.

  • +
+
+
Returns
+

M2Crypto.EVP.PKey object.

+
+
-
-
-should_read()[source]
-

Should we read more data?

+
+
+M2Crypto.EVP.load_key_bio_pubkey(bio: BIO.BIO, callback: Callable = <function passphrase_callback>)PKey[source]
+

Load an M2Crypto.EVP.PKey from a public key as a M2Crypto.BIO object.

+
+
Parameters
+
    +
  • bio – M2Crypto.BIO object containing the key in PEM format.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect the +key.

  • +
+
+
Returns
+

M2Crypto.EVP.PKey object.

+
+
-
-
-should_retry()[source]
-

Can the call be attempted again, or was there an error -ie do_handshake

+
+
+M2Crypto.EVP.load_key_pubkey(file: AnyStr, callback: Callable = <function passphrase_callback>)M2Crypto.EVP.PKey[source]
+

Load an M2Crypto.EVP.PKey from a public key as a file.

+
+
Parameters
+
    +
  • file – Name of file containing the key in PEM format.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect the +key.

  • +
+
+
Returns
+

M2Crypto.EVP.PKey object.

+
+
-
-
-should_write()[source]
-

Should we write more data?

+
+
+M2Crypto.EVP.load_key_string(string: AnyStr, callback: Callable = <function passphrase_callback>)M2Crypto.EVP.PKey[source]
+

Load an M2Crypto.EVP.PKey from a string.

+
+
Parameters
+
    +
  • string – String containing the key in PEM format.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect the +key.

  • +
+
+
Returns
+

M2Crypto.EVP.PKey object.

+
+
-
-
-tell()[source]
-

Return the current offset.

+
+
+M2Crypto.EVP.load_key_string_pubkey(string: AnyStr, callback: Callable = <function passphrase_callback>)M2Crypto.EVP.PKey[source]
+

Load an M2Crypto.EVP.PKey from a public key as a string.

+
+
Parameters
+
    +
  • string – String containing the key in PEM format.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect the +key.

  • +
+
+
Returns
+

M2Crypto.EVP.PKey object.

+
+
-
-
-write(data)[source]
-

Write data to BIO.

- --- - - - -
Returns:either data written, or [0, -1] for nothing written, --2 not implemented
+
+
+M2Crypto.EVP.pbkdf2(password: bytes, salt: bytes, iter: int, keylen: int) → bytes[source]
+

Derive a key from password using PBKDF2 algorithm specified in RFC 2898.

+
+
Parameters
+
    +
  • password – Derive the key from this password.

  • +
  • salt – Salt.

  • +
  • iter – Number of iterations to perform.

  • +
  • keylen – Length of key to produce.

  • +
+
+
Returns
+

Key.

+
+
-
-
-write_close()[source]
-
- -
-
-writeable()[source]
-
- +
+
+

Engine Module

+
+
+

Err Module

+
+
+exception M2Crypto.Err.M2CryptoError[source]
+

Bases: Exception

-
-
-exception M2Crypto.BIO.BIOError[source]
-

Bases: ValueError

+
+
+exception M2Crypto.Err.SSLError(err: int, client_addr: Union[Tuple[str, int], str])[source]
+

Bases: Exception

-
-
-class M2Crypto.BIO.CipherStream(obio)[source]
-

Bases: M2Crypto.BIO.BIO

-

Object interface to BIO_f_cipher.

-
-
-SALT_LEN = 8
+
+
+M2Crypto.Err.get_error() → Optional[str][source]
-
-
-close()[source]
+
+
+M2Crypto.Err.get_error_code() → int[source]
-
-
-m2_bio_free()
+
+
+M2Crypto.Err.get_error_func(err: Optional[int]) → str[source]
-
-
-m2_bio_pop()
+
+
+M2Crypto.Err.get_error_lib(err: Optional[int]) → str[source]
-
-
-set_cipher(algo, key, iv, op)[source]
+
+
+M2Crypto.Err.get_error_message() → str[source]
-
-
-write_close()[source]
+
+
+M2Crypto.Err.get_error_reason(err: Optional[int]) → str[source]
-
- -
-
-class M2Crypto.BIO.File(pyfile, close_pyfile=1, mode='rb')[source]
-

Bases: M2Crypto.BIO.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.

-
-
-close()[source]
+
+
+M2Crypto.Err.get_x509_verify_error(err: Optional[int]) → str[source]
-
-
-flush()[source]
-

Flush the buffers.

- --- - - - -
Returns:1 for success, and 0 or -1 for failure
-
+
+
+M2Crypto.Err.peek_error_code() → int[source]
+
-
-
-reset()[source]
-

Set the bio to its initial state.

- --- - - - -
Returns:0 for success, and -1 for failure
+
+
+

RC4 Module

+
+
+

RSA Module

+
+
+class M2Crypto.RSA.RSA(rsa: bytes, _pyfree: int = 0)[source]
+

Bases: object

+

RSA Key Pair.

+
+
+as_pem(cipher: Optional[str] = 'aes_128_cbc', callback: Callable = <function passphrase_callback>) → bytes[source]
+

Returns the key(pair) as a string in PEM format.

+
+
+check_key() → int[source]
+

Validate RSA keys.

+

It checks that p and q are in fact prime, and that n = p*q.

+
+
Returns
+

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).

+
+
-
-
-class M2Crypto.BIO.IOBuffer(under_bio, mode='rwb', _pyfree=1)[source]
-

Bases: M2Crypto.BIO.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.

-
-
-close()[source]
-
- -
-
-m2_bio_free()
-
- -
-
-m2_bio_pop()
+
+
+m2_rsa_free()
-
- -
-
-class M2Crypto.BIO.MemoryBuffer(data=None)[source]
-

Bases: M2Crypto.BIO.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.

-
-
-close()
+
+
+private_decrypt(data: bytes, padding: int) → bytes[source]
-
-
-getvalue(size=0)
+
+
+private_encrypt(data: bytes, padding: int) → bytes[source]
-
-
-read(size=0)[source]
+
+
+pub() → Tuple[bytes, bytes][source]
-
-
-read_all(size=0)
+
+
+public_decrypt(data: bytes, padding: int) → bytes[source]
-
-
-write_close()[source]
+
+
+public_encrypt(data: bytes, padding: int) → bytes[source]
+
+
+save_key(file: AnyStr, cipher: Optional[str] = 'aes_128_cbc', callback: Callable = <function passphrase_callback>) → int[source]
+

Save the key pair to a file in PEM format.

+
+
Parameters
+
    +
  • file – Name of file to save key to.

  • +
  • 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.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect +the key. The default is +util.passphrase_callback.

  • +
+
+
-
-
-class M2Crypto.BIO.SSLBio(_pyfree=1)[source]
-

Bases: M2Crypto.BIO.BIO

-

Object interface to BIO_f_ssl.

-
-
-do_handshake()[source]
-

Do the handshake.

-

Return 1 if the handshake completes -Return 0 or a negative number if there is a problem

+
+
+save_key_bio(bio: BIO.BIO, cipher: Optional[str] = 'aes_128_cbc', callback: Callable = <function passphrase_callback>) → int[source]
+

Save the key pair to an M2Crypto.BIO.BIO object in PEM format.

+
+
Parameters
+
    +
  • bio – M2Crypto.BIO.BIO object to save key to.

  • +
  • 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.

  • +
  • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect +the key. The default is +util.passphrase_callback.

  • +
+
+
-
-
-set_ssl(conn, close_flag=0)[source]
-

Sets the bio to the SSL pointer which is -contained in the connection object.

+
+
+save_key_der(file: AnyStr) → int[source]
+

Save the key pair to a file in DER format.

+
+
Parameters
+

file – Filename to save key to

+
+
+
+
+save_key_der_bio(bio: BIO.BIO) → int[source]
+

Save the key pair to an M2Crypto.BIO.BIO object in DER format.

+
+
Parameters
+

bio – M2Crypto.BIO.BIO object to save key to.

+
+
-
-
-M2Crypto.BIO.openfile(filename, mode='rb')[source]
-
- -
-
-

BN Module

-
-
-M2Crypto.BN.rand(bits, top=-1, bottom=0)[source]
-

Generate cryptographically strong random number.

- --- - - - -
Parameters:
    -
  • bits – Length of random number in bits.
  • -
  • 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.
  • -
  • bottom – If bottom is true, the number will be odd.
  • -
-
-
- -
-
-M2Crypto.BN.rand_range(range)[source]
-

Generate a random number in a range.

- --- - - - - - -
Parameters:range – Upper limit for range.
Returns:A random number in the range [0, range)
-
- -
-
-M2Crypto.BN.randfname(length)[source]
-

Return a random filename, which is simply a string where all -the characters are from the set [a-zA-Z0-9].

- --- - - - - - -
Parameters:length – Length of filename to return.
Returns:random filename string
-
- -
-
-

DH Module

-
-
-class M2Crypto.DH.DH(dh, _pyfree=0)[source]
-

Bases: object

-

Object interface to the Diffie-Hellman key exchange protocol.

-
-
-check_params()[source]
-
- -
-
-compute_key(pubkey)[source]
-
- -
-
-gen_key()[source]
-
- -
-
-m2_dh_free()
-
- -
-
-print_params(bio)[source]
-
- -
- -
-
-exception M2Crypto.DH.DHError[source]
-

Bases: Exception

-
- -
-
-M2Crypto.DH.gen_params(plen, g, callback=<function genparam_callback>)[source]
-
- -
-
-M2Crypto.DH.load_params(file)[source]
-
- -
-
-M2Crypto.DH.load_params_bio(bio)[source]
-
- -
-
-M2Crypto.DH.set_params(p, g)[source]
-
- -
-
-

DSA Module

-
-
-class M2Crypto.DSA.DSA(dsa, _pyfree=0)[source]
-

Bases: 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 **')
-
-
-
-
-check_key()[source]
-

Check to be sure the DSA object has a valid private key.

- --- - - - -
Returns:1 (true) if a valid private key
-
- -
-
-gen_key()[source]
-

Generate a key pair.

-
- -
-
-m2_dsa_free()
-
- -
-
-save_key(filename, cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Save the DSA key pair to a file.

- --- - - - - - -
Parameters:
    -
  • filename – Save the DSA key pair to this file.
  • -
  • cipher – name of symmetric key algorithm and mode -to encrypt the private key.
  • -
-
Returns:

1 (true) if successful

-
-
- -
-
-save_key_bio(bio, cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Save DSA key pair to a BIO object.

- --- - - - - - -
Parameters:
    -
  • bio – Save DSA parameters to this object.
  • -
  • cipher – name of symmetric key algorithm and mode -to encrypt the private key.
  • -
-
Returns:

1 (true) if successful

-
-
- -
-
-save_params(filename)[source]
-

Save the DSA parameters to a file.

- --- - - - - - -
Parameters:filename – Save the DSA parameters to this file.
Returns:1 (true) if successful
-
- -
-
-save_params_bio(bio)[source]
-

Save DSA parameters to a BIO object.

- --- - - - - - -
Parameters:bio – Save DSA parameters to this object.
Returns:1 (true) if successful
-
- -
-
-save_pub_key(filename)[source]
-

Save the DSA public key (with parameters) to a file.

- --- - - - - - -
Parameters:filename – Save DSA public key (with parameters) -to this file.
Returns:1 (true) if successful
-
- -
-
-save_pub_key_bio(bio)[source]
-

Save DSA public key (with parameters) to a BIO object.

- --- - - - - - -
Parameters:bio – Save DSA public key (with parameters) -to this object.
Returns:1 (true) if successful
-
- -
-
-set_params(p, q, g)[source]
-

Set new parameters.

- --- - - - -
Parameters:
    -
  • 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).
  • -
  • q – ditto
  • -
  • 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.
-
-
- -
-
-sign(digest)[source]
-

Sign the digest.

- --- - - - - - -
Parameters:digest – SHA-1 hash of message (same as output -from MessageDigest, a “byte string”)
Returns:DSA signature, a tuple of two values, r and s, -both “byte strings”.
-
- -
-
-sign_asn1(digest)[source]
-
- -
-
-verify(digest, r, s)[source]
-

Verify a newly calculated digest against the signature -values r and s.

- --- - - - - - -
Parameters:
    -
  • digest – SHA-1 hash of message (same as output -from MessageDigest, a “byte string”)
  • -
  • r – r value of the signature, a “byte string”
  • -
  • s – s value of the signature, a “byte string”
  • -
-
Returns:

1 (true) if verify succeeded, 0 if failed

-
-
- -
-
-verify_asn1(digest, blob)[source]
-
- -
- -
-
-exception M2Crypto.DSA.DSAError[source]
-

Bases: Exception

-
- -
-
-class M2Crypto.DSA.DSA_pub(dsa, _pyfree=0)[source]
-

Bases: M2Crypto.DSA.DSA

-

This class is a DSA context that only supports a public key -and verification. It does NOT support a private key or -signing.

-
-
-check_key()[source]
-
--- - - - -
Returns:does DSA_pub contain a pub key?
-
- -
-
-save_key(filename)
-

Save the DSA public key (with parameters) to a file.

- --- - - - - - -
Parameters:filename – Save DSA public key (with parameters) -to this file.
Returns:1 (true) if successful
-
- -
-
-save_key_bio(bio)
-

Save DSA public key (with parameters) to a BIO object.

- --- - - - - - -
Parameters:bio – Save DSA public key (with parameters) -to this object.
Returns:1 (true) if successful
-
- -
-
-sign(*argv)[source]
-

Sign the digest.

- --- - - - - - -
Parameters:digest – SHA-1 hash of message (same as output -from MessageDigest, a “byte string”)
Returns:DSA signature, a tuple of two values, r and s, -both “byte strings”.
-
- -
-
-sign_asn1(*argv)
-

Sign the digest.

- --- - - - - - -
Parameters:digest – SHA-1 hash of message (same as output -from MessageDigest, a “byte string”)
Returns:DSA signature, a tuple of two values, r and s, -both “byte strings”.
-
- -
- -
-
-M2Crypto.DSA.gen_params(bits, callback=<function genparam_callback>)[source]
-

Factory function that generates DSA parameters and -instantiates a DSA object from the output.

- --- - - - - - -
Parameters:
    -
  • bits – The length of the prime to be generated. If -‘bits’ < 512, it is set to 512.
  • -
  • callback – A Python callback object that will be -invoked during parameter generation; it usual -purpose is to provide visual feedback.
  • -
-
Returns:

instance of DSA.

-
-
- -
-
-M2Crypto.DSA.load_key(file, callback=<function passphrase_callback>)[source]
-

Factory function that instantiates a DSA object from a -PEM encoded DSA key pair.

- --- - - - - - -
Parameters:
    -
  • file – Names the file (a path) that contains the PEM -representation of the DSA key pair.
  • -
  • callback – A Python callback object that will be -invoked if the DSA key pair is -passphrase-protected.
  • -
-
Returns:

instance of DSA.

-
-
- -
-
-M2Crypto.DSA.load_key_bio(bio, callback=<function passphrase_callback>)[source]
-

Factory function that instantiates a DSA object from a -PEM encoded DSA key pair.

- --- - - - - - -
Parameters:
    -
  • bio – Contains the PEM representation of the DSA -key pair.
  • -
  • callback – A Python callback object that will be -invoked if the DSA key pair is -passphrase-protected.
  • -
-
Returns:

instance of DSA.

-
-
- -
-
-M2Crypto.DSA.load_params(file, callback=<function passphrase_callback>)[source]
-

Factory function that instantiates a DSA object with DSA -parameters from a file.

- --- - - - - - -
Parameters:
    -
  • file – Names the file (a path) that contains the PEM -representation of the DSA parameters.
  • -
  • callback – A Python callback object that will be -invoked if the DSA parameters file is -passphrase-protected.
  • -
-
Returns:

instance of DSA.

-
-
- -
-
-M2Crypto.DSA.load_params_bio(bio, callback=<function passphrase_callback>)[source]
-

Factory function that instantiates a DSA object with DSA -parameters from a M2Crypto.BIO object.

- --- - - - - - -
Parameters:
    -
  • bio – Contains the PEM representation of the DSA -parameters.
  • -
  • callback – A Python callback object that will be -invoked if the DSA parameters file is -passphrase-protected.
  • -
-
Returns:

instance of DSA.

-
-
- -
-
-M2Crypto.DSA.load_pub_key(file, callback=<function passphrase_callback>)[source]
-

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.

- --- - - - - - -
Parameters:
    -
  • file – Names the file (a path) that contains the PEM -representation of the DSA public key.
  • -
  • callback – A Python callback object that will be -invoked should the DSA public key be -passphrase-protected.
  • -
-
Returns:

instance of DSA_pub.

-
-
- -
-
-M2Crypto.DSA.load_pub_key_bio(bio, callback=<function passphrase_callback>)[source]
-

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.

- --- - - - - - -
Parameters:
    -
  • bio – Contains the PEM representation of the DSA -public key (with params).
  • -
  • callback – A Python callback object that will be -invoked should the DSA public key be -passphrase-protected.
  • -
-
Returns:

instance of DSA_pub.

-
-
- -
-
-M2Crypto.DSA.pub_key_from_params(p, q, g, pub)[source]
-

Factory function that instantiates a DSA_pub object using -the parameters and public key specified.

- --- - - - - - -
Parameters:
    -
  • p – value of p
  • -
  • q – value of q
  • -
  • g – value of g
  • -
  • pub – value of the public key
  • -
-
Returns:

instance of DSA_pub.

-
-
- -
-
-M2Crypto.DSA.set_params(p, q, g)[source]
-

Factory function that instantiates a DSA object with DSA -parameters.

- --- - - - - - -
Parameters:
    -
  • p – value of p, a “byte string”
  • -
  • q – value of q, a “byte string”
  • -
  • g – value of g, a “byte string”
  • -
-
Returns:

instance of DSA.

-
-
- -
-
-

EC Module

-
-
-class M2Crypto.EC.EC(ec, _pyfree=0)[source]
-

Bases: object

-

Object interface to a EC key pair.

-
-
-as_pem(cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Returns the key(pair) as a string in PEM format. -If no password is passed and the cipher is set -it exits with error

-
- -
-
-check_key()[source]
-
- -
-
-compute_dh_key(pub_key)[source]
-

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.

-
- -
-
-gen_key()[source]
-

Generates the key pair from its parameters. Use:

-
keypair = EC.gen_params(curve)
-keypair.gen_key()
-
-
-

to create an EC key pair.

-
- -
-
-m2_ec_key_free()
-
- -
-
-pub()[source]
-
- -
-
-save_key(file, cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Save the key pair to a file in PEM format.

- --- - - - -
Parameters:
    -
  • file – Name of filename to save key to.
  • -
  • 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.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect -the key. The default is -util.passphrase_callback.
  • -
-
-
- -
-
-save_key_bio(bio, cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Save the key pair to an M2Crypto.BIO.BIO object in PEM format.

- --- - - - -
Parameters:
    -
  • bio – M2Crypto.BIO.BIO object to save key to.
  • -
  • 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.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect -the key. The default is -util.passphrase_callback.
  • -
-
-
- -
-
-save_pub_key(file)[source]
-

Save the public key to a filename in PEM format.

- --- - - - -
Parameters:file – Name of filename to save key to.
-
- -
-
-save_pub_key_bio(bio)[source]
-

Save the public key to an M2Crypto.BIO.BIO object in PEM format.

- --- - - - -
Parameters:bio – M2Crypto.BIO.BIO object to save key to.
-
- -
-
-sign_dsa(digest)[source]
-

Sign the given digest using ECDSA. Returns a tuple (r,s), the two -ECDSA signature parameters.

-
- -
-
-sign_dsa_asn1(digest)[source]
-
- -
-
-verify_dsa(digest, r, s)[source]
-

Verify the given digest using ECDSA. r and s are the ECDSA -signature parameters.

-
- -
-
-verify_dsa_asn1(digest, blob)[source]
-
- -
- -
-
-exception M2Crypto.EC.ECError[source]
-

Bases: Exception

-
- -
-
-class M2Crypto.EC.EC_pub(ec, _pyfree=0)[source]
-

Bases: M2Crypto.EC.EC

-

Object interface to an EC public key. -((don’t like this implementation inheritance))

-
-
-get_der()[source]
-

Returns the public key in DER format as a buffer object.

-
- -
-
-get_key()[source]
-

Returns the public key as a byte string.

-
- -
-
-save_key(file)
-

Save the public key to a filename in PEM format.

- --- - - - -
Parameters:file – Name of filename to save key to.
-
- -
-
-save_key_bio(bio)
-

Save the public key to an M2Crypto.BIO.BIO object in PEM format.

- --- - - - -
Parameters:bio – M2Crypto.BIO.BIO object to save key to.
-
- -
- -
-
-M2Crypto.EC.ec_error()[source]
-
- -
-
-M2Crypto.EC.gen_params(curve)[source]
-

Factory function that generates EC parameters and -instantiates a EC object from the output.

- --- - - - -
Parameters:curve – This is the OpenSSL nid of the curve to use.
-
- -
-
-M2Crypto.EC.get_builtin_curves()[source]
-
- -
-
-M2Crypto.EC.load_key(file, callback=<function passphrase_callback>)[source]
-

Factory function that instantiates a EC object.

- --- - - - -
Parameters:
    -
  • file – Names the filename that contains the PEM representation -of the EC key pair.
  • -
  • callback – Python callback object that will be invoked -if the EC key pair is passphrase-protected.
  • -
-
-
- -
-
-M2Crypto.EC.load_key_bio(bio, callback=<function passphrase_callback>)[source]
-

Factory function that instantiates a EC object.

- --- - - - -
Parameters:
    -
  • bio – M2Crypto.BIO object that contains the PEM -representation of the EC key pair.
  • -
  • callback – Python callback object that will be invoked -if the EC key pair is passphrase-protected.
  • -
-
-
- -
-
-M2Crypto.EC.load_key_string(string, callback=<function passphrase_callback>)[source]
-

Load an EC key pair from a string.

- --- - - - - - -
Parameters:
    -
  • string – String containing EC key pair in PEM format.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to unlock the -key. The default is util.passphrase_callback.
  • -
-
Returns:

M2Crypto.EC.EC object.

-
-
- -
-
-M2Crypto.EC.load_key_string_pubkey(string, callback=<function passphrase_callback>)[source]
-

Load an M2Crypto.EC.PKey from a public key as a string.

- --- - - - - - -
Parameters:
    -
  • string – String containing the key in PEM format.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect the -key.
  • -
-
Returns:

M2Crypto.EC.PKey object.

-
-
- -
-
-M2Crypto.EC.load_pub_key(file)[source]
-

Load an EC public key from filename.

- --- - - - - - -
Parameters:file – Name of filename containing EC public key in PEM -format.
Returns:M2Crypto.EC.EC_pub object.
-
- -
-
-M2Crypto.EC.load_pub_key_bio(bio)[source]
-

Load an EC public key from an M2Crypto.BIO.BIO object.

- --- - - - - - -
Parameters:bio – M2Crypto.BIO.BIO object containing EC public key in PEM -format.
Returns:M2Crypto.EC.EC_pub object.
-
- -
-
-M2Crypto.EC.pub_key_from_der(der)[source]
-

Create EC_pub from DER.

-
- -
-
-M2Crypto.EC.pub_key_from_params(curve, bytes)[source]
-

Create EC_pub from curve name and octet string.

-
- -
-
-

EVP Module

-
-
-class M2Crypto.EVP.Cipher(alg, key, iv, op, key_as_bytes=0, d='md5', salt=b'12345678', i=1, padding=1)[source]
-

Bases: object

-
-
-final()[source]
-
- -
-
-m2_cipher_ctx_free()
-
- -
-
-set_padding(padding=1)[source]
-

Actually always return 1

-
- -
-
-update(data)[source]
-
- -
- -
-
-exception M2Crypto.EVP.EVPError[source]
-

Bases: ValueError

-
- -
-
-class M2Crypto.EVP.HMAC(key, algo='sha1')[source]
-

Bases: object

-
-
-digest()
-
- -
-
-final()[source]
-
- -
-
-m2_hmac_ctx_free()
-
- -
-
-reset(key)[source]
-
- -
-
-update(data)[source]
-
- -
- -
-
-class M2Crypto.EVP.MessageDigest(algo)[source]
-

Bases: object

-

Message Digest

-
-
-digest()
-
- -
-
-final()[source]
-
- -
-
-m2_md_ctx_free()
-
- -
-
-update(data)[source]
-

Add data to be digested.

- --- - - - -
Returns:-1 for Python error, 1 for success, 0 for OpenSSL failure.
-
- -
- -
-
-class M2Crypto.EVP.PKey(pkey=None, _pyfree=0, md='sha1')[source]
-

Bases: object

-

Public Key

-
-
-as_der()[source]
-

Return key in DER format in a string

-
- -
-
-as_pem(cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Return key in PEM format in a string.

- --- - - - -
Parameters:
    -
  • 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.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect -the key. The default is -util.passphrase_callback.
  • -
-
-
- -
-
-assign_rsa(rsa, capture=1)[source]
-

Assign the RSA key pair to self.

- --- - - - - - -
Parameters:
    -
  • rsa – M2Crypto.RSA.RSA object to be assigned to self.
  • -
  • 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.
  • -
-
Returns:

Return 1 for success and 0 for failure.

-
-
- -
-
-final()
-

Return signature.

- --- - - - -
Returns:The signature.
-
- -
-
-get_modulus()[source]
-

Return the modulus in hex format.

-
- -
-
-get_rsa()[source]
-

Return the underlying RSA key if that is what the EVP -instance is holding.

-
- -
-
-m2_md_ctx_free()
-
- -
-
-m2_pkey_free()
-
- -
-
-reset_context(md='sha1')[source]
-

Reset internal message digest context.

- --- - - - -
Parameters:md – The message digest algorithm.
-
- -
-
-save_key(file, cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Save the key pair to a file in PEM format.

- --- - - - -
Parameters:
    -
  • file – Name of file to save key to.
  • -
  • 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.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect -the key. The default is -util.passphrase_callback.
  • -
-
-
- -
-
-save_key_bio(bio, cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Save the key pair to the M2Crypto.BIO object ‘bio’ in PEM format.

- --- - - - -
Parameters:
    -
  • bio – M2Crypto.BIO object to save key to.
  • -
  • 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.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect -the key. The default is -util.passphrase_callback.
  • -
-
-
- -
-
-sign_final()[source]
-

Return signature.

- --- - - - -
Returns:The signature.
-
- -
-
-sign_init()[source]
-

Initialise signing operation with self.

-
- -
-
-sign_update(data)[source]
-

Feed data to signing operation.

- --- - - - -
Parameters:data – Data to be signed.
-
- -
-
-size()[source]
-

Return the size of the key in bytes.

-
- -
-
-update(data)
-

Feed data to signing operation.

- --- - - - -
Parameters:data – Data to be signed.
-
- -
-
-verify_final(sign)[source]
-

Return result of verification.

- --- - - - - - -
Parameters:sign – Signature to use for verification
Returns:Result of verification: 1 for success, 0 for failure, -1 on -other error.
-
- -
-
-verify_init()[source]
-

Initialise signature verification operation with self.

-
- -
-
-verify_update(data)[source]
-

Feed data to verification operation.

- --- - - - - - -
Parameters:data – Data to be verified.
Returns:-1 on Python error, 1 for success, 0 for OpenSSL error
-
- -
- -
-
-M2Crypto.EVP.hmac(key, data, algo='sha1')[source]
-
- -
-
-M2Crypto.EVP.load_key(file, callback=<function passphrase_callback>)[source]
-

Load an M2Crypto.EVP.PKey from file.

- --- - - - - - -
Parameters:
    -
  • file – Name of file containing the key in PEM format.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect the -key.
  • -
-
Returns:

M2Crypto.EVP.PKey object.

-
-
- -
-
-M2Crypto.EVP.load_key_bio(bio, callback=<function passphrase_callback>)[source]
-

Load an M2Crypto.EVP.PKey from an M2Crypto.BIO object.

- --- - - - - - -
Parameters:
    -
  • bio – M2Crypto.BIO object containing the key in PEM format.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect the -key.
  • -
-
Returns:

M2Crypto.EVP.PKey object.

-
-
- -
-
-M2Crypto.EVP.load_key_bio_pubkey(bio, callback=<function passphrase_callback>)[source]
-

Load an M2Crypto.EVP.PKey from a public key as a M2Crypto.BIO object.

- --- - - - - - -
Parameters:
    -
  • bio – M2Crypto.BIO object containing the key in PEM format.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect the -key.
  • -
-
Returns:

M2Crypto.EVP.PKey object.

-
-
- -
-
-M2Crypto.EVP.load_key_string(string, callback=<function passphrase_callback>)[source]
-

Load an M2Crypto.EVP.PKey from a string.

- --- - - - - - -
Parameters:
    -
  • string – String containing the key in PEM format.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect the -key.
  • -
-
Returns:

M2Crypto.EVP.PKey object.

-
-
- -
-
-M2Crypto.EVP.load_key_string_pubkey(string, callback=<function passphrase_callback>)[source]
-

Load an M2Crypto.EVP.PKey from a public key as a string.

- --- - - - - - -
Parameters:
    -
  • string – String containing the key in PEM format.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect the -key.
  • -
-
Returns:

M2Crypto.EVP.PKey object.

-
-
- -
-
-M2Crypto.EVP.pbkdf2(password, salt, iter, keylen)[source]
-

Derive a key from password using PBKDF2 algorithm specified in RFC 2898.

- --- - - - - - -
Parameters:
    -
  • password – Derive the key from this password.
  • -
  • salt – Salt.
  • -
  • iter – Number of iterations to perform.
  • -
  • keylen – Length of key to produce.
  • -
-
Returns:

Key.

-
-
- -
-
-

Engine Module

-
-
-class M2Crypto.Engine.Engine(id=None, _ptr=None, _pyfree=1)[source]
-

Bases: object

-

Wrapper for ENGINE object.

-
-
-ctrl_cmd_string(cmd, arg, optional=0)[source]
-

Call ENGINE_ctrl_cmd_string

-
- -
-
-finish()[source]
-

Release a functional and structural reference to the engine.

-
- -
-
-get_id()[source]
-

Return engine id

-
- -
-
-get_name()[source]
-

Return engine name

-
- -
-
-init()[source]
-

Obtain a functional reference to the engine.

- --- - - - -
Returns:0 on error, non-zero on success.
-
- -
-
-load_certificate(name)[source]
-

Load certificate from engine (e.g from smartcard). -NOTE: This function may be not implemented by engine!

-
- -
-
-load_private_key(name, pin=None)[source]
-

Load private key with engine methods (e.g from smartcard). -If pin is not set it will be asked

-
- -
-
-load_public_key(name, pin=None)[source]
-

Load public key with engine methods (e.g from smartcard).

-
- -
-
-m2_engine_free()
-
- -
-
-set_default(methods=65535)[source]
-

Use this engine as default for methods specified in argument

- --- - - - -
Parameters:methods – Possible values are bitwise OR of m2.ENGINE_METHOD_*
-
- -
- -
-
-exception M2Crypto.Engine.EngineError[source]
-

Bases: Exception

-
- -
-
-M2Crypto.Engine.cleanup()[source]
-

If you load any engines, you need to clean up after your application -is finished with the engines.

-
- -
-
-M2Crypto.Engine.load_dynamic()[source]
-

Load dynamic engine

-
- -
-
-M2Crypto.Engine.load_dynamic_engine(id, sopath)[source]
-

Load and return dymanic engine from sopath and assign id to it

-
- -
-
-M2Crypto.Engine.load_openssl()[source]
-

Load openssl engine

-
- -
-
-

Err Module

-
-
-exception M2Crypto.Err.M2CryptoError[source]
-

Bases: Exception

-
- -
-
-exception M2Crypto.Err.SSLError(err, client_addr)[source]
-

Bases: Exception

-
- -
-
-M2Crypto.Err.get_error()[source]
-
- -
-
-M2Crypto.Err.get_error_code()[source]
-
- -
-
-M2Crypto.Err.get_error_func(err)[source]
-
- -
-
-M2Crypto.Err.get_error_lib(err)[source]
-
- -
-
-M2Crypto.Err.get_error_message()[source]
-
- -
-
-M2Crypto.Err.get_error_reason(err)[source]
-
- -
-
-M2Crypto.Err.get_x509_verify_error(err)[source]
-
- -
-
-M2Crypto.Err.peek_error_code()[source]
-
- -
-
-

RC4 Module

-
-
-class M2Crypto.RC4.RC4(key=None)[source]
-

Bases: object

-

Object interface to the stream cipher RC4.

-
-
-final()[source]
-
- -
-
-rc4_free()
-
- -
-
-set_key(key)[source]
-
- -
-
-update(data)[source]
-
- -
- -
-
-

RSA Module

-
-
-class M2Crypto.RSA.RSA(rsa, _pyfree=0)[source]
-

Bases: object

-

RSA Key Pair.

-
-
-as_pem(cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Returns the key(pair) as a string in PEM format.

-
- -
-
-check_key()[source]
-

Validate RSA keys.

-

It checks that p and q are in fact prime, and that n = p*q.

- --- - - - -
Returns: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).
-
- -
-
-m2_rsa_free()
-
- -
-
-private_decrypt(data, padding)[source]
-
- -
-
-private_encrypt(data, padding)[source]
-
- -
-
-pub()[source]
-
- -
-
-public_decrypt(data, padding)[source]
-
- -
-
-public_encrypt(data, padding)[source]
-
- -
-
-save_key(file, cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Save the key pair to a file in PEM format.

- --- - - - -
Parameters:
    -
  • file – Name of file to save key to.
  • -
  • 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.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect -the key. The default is -util.passphrase_callback.
  • -
-
-
- -
-
-save_key_bio(bio, cipher='aes_128_cbc', callback=<function passphrase_callback>)[source]
-

Save the key pair to an M2Crypto.BIO.BIO object in PEM format.

- --- - - - -
Parameters:
    -
  • bio – M2Crypto.BIO.BIO object to save key to.
  • -
  • 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.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect -the key. The default is -util.passphrase_callback.
  • -
-
-
- -
-
-save_key_der(file)[source]
-

Save the key pair to a file in DER format.

- --- - - - -
Parameters:file – Filename to save key to
-
- -
-
-save_key_der_bio(bio)[source]
-

Save the key pair to an M2Crypto.BIO.BIO object in DER format.

- --- - - - -
Parameters:bio – M2Crypto.BIO.BIO object to save key to.
-
- -
-
-save_pem(file, cipher='aes_128_cbc', callback=<function passphrase_callback>)
-

Save the key pair to a file in PEM format.

- --- - - - -
Parameters:
    -
  • file – Name of file to save key to.
  • -
  • 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.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to protect -the key. The default is -util.passphrase_callback.
  • -
-
-
- -
-
-save_pub_key(file)[source]
-

Save the public key to a file in PEM format.

- --- - - - -
Parameters:file – Name of file to save key to.
-
- -
-
-save_pub_key_bio(bio)[source]
-

Save the public key to an M2Crypto.BIO.BIO object in PEM format.

- --- - - - -
Parameters:bio – M2Crypto.BIO.BIO object to save key to.
-
- -
-
-sign(digest, algo='sha1')[source]
-

Signs a digest with the private key

- --- - - - - - -
Parameters:
    -
  • digest – A digest created by using the digest method
  • -
  • algo – The method that created the digest. -Legal values like ‘sha1’,’sha224’, ‘sha256’, -‘ripemd160’, and ‘md5’.
  • -
-
Returns:

a string which is the signature

-
-
- -
-
-sign_rsassa_pss(digest, algo='sha1', salt_length=20)[source]
-

Signs a digest with the private key using RSASSA-PSS

- --- - - - - - -
Parameters:
    -
  • digest – A digest created by using the digest method
  • -
  • salt_length – The length of the salt to use
  • -
  • algo – The hash algorithm to use -Legal values like ‘sha1’,’sha224’, ‘sha256’, -‘ripemd160’, and ‘md5’.
  • -
-
Returns:

a string which is the signature

-
-
- -
-
-verify(data, signature, algo='sha1')[source]
-

Verifies the signature with the public key

- --- - - - - - -
Parameters:
    -
  • data – Data that has been signed
  • -
  • signature – The signature signed with the private key
  • -
  • algo – The method use to create digest from the data -before it was signed. Legal values like -‘sha1’,’sha224’, ‘sha256’, ‘ripemd160’, and ‘md5’.
  • -
-
Returns:

1 or 0, depending on whether the signature was -verified or not.

-
-
- -
-
-verify_rsassa_pss(data, signature, algo='sha1', salt_length=20)[source]
-

Verifies the signature RSASSA-PSS

- --- - - - - - -
Parameters:
    -
  • data – Data that has been signed
  • -
  • signature – The signature signed with RSASSA-PSS
  • -
  • salt_length – The length of the salt that was used
  • -
  • algo – The hash algorithm to use -Legal values are for example ‘sha1’,’sha224’, -‘sha256’, ‘ripemd160’, and ‘md5’.
  • -
-
Returns:

1 or 0, depending on whether the signature was -verified or not.

-
-
- -
- -
-
-exception M2Crypto.RSA.RSAError[source]
-

Bases: Exception

-
- -
-
-class M2Crypto.RSA.RSA_pub(rsa, _pyfree=0)[source]
-

Bases: M2Crypto.RSA.RSA

-

Object interface to an RSA public key.

-
-
-check_key()[source]
-

Validate RSA keys.

-

It checks that p and q are in fact prime, and that n = p*q.

- --- - - - -
Returns: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).
-
- -
-
-private_decrypt(*argv)[source]
-
- -
-
-private_encrypt(*argv)[source]
-
- -
-
-save_key(file, *args, **kw)[source]
-

Save public key to file.

-
- -
-
-save_key_bio(bio, *args, **kw)[source]
-

Save public key to BIO.

-
- -
- -
-
-M2Crypto.RSA.gen_key(bits, e, callback=<function keygen_callback>)[source]
-

Generate an RSA key pair.

- --- - - - - - -
Parameters:
    -
  • bits – Key length, in bits.
  • -
  • e – The RSA public exponent.
  • -
  • 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.
  • -
-
Returns:

M2Crypto.RSA.RSA object.

-
-
- -
-
-M2Crypto.RSA.keygen_callback(p, n, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
-

Default callback for gen_key().

-
- -
-
-M2Crypto.RSA.load_key(file, callback=<function passphrase_callback>)[source]
-

Load an RSA key pair from file.

- --- - - - - - -
Parameters:
    -
  • file – Name of file containing RSA public key in PEM format.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to unlock the -key. The default is util.passphrase_callback.
  • -
-
Returns:

M2Crypto.RSA.RSA object.

-
-
- -
-
-M2Crypto.RSA.load_key_bio(bio, callback=<function passphrase_callback>)[source]
-

Load an RSA key pair from an M2Crypto.BIO.BIO object.

- --- - - - - - -
Parameters:
    -
  • bio – M2Crypto.BIO.BIO object containing RSA key pair in PEM -format.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to unlock the -key. The default is util.passphrase_callback.
  • -
-
Returns:

M2Crypto.RSA.RSA object.

-
-
- -
-
-M2Crypto.RSA.load_key_string(string, callback=<function passphrase_callback>)[source]
-

Load an RSA key pair from a string.

- --- - - - - - -
Parameters:
    -
  • string – String containing RSA key pair in PEM format.
  • -
  • callback – A Python callable object that is invoked -to acquire a passphrase with which to unlock the -key. The default is util.passphrase_callback.
  • -
-
Returns:

M2Crypto.RSA.RSA object.

-
-
- -
-
-M2Crypto.RSA.load_pub_key(file)[source]
-

Load an RSA public key from file.

- --- - - - - - -
Parameters:file – Name of file containing RSA public key in PEM format.
Returns:M2Crypto.RSA.RSA_pub object.
-
- -
-
-M2Crypto.RSA.load_pub_key_bio(bio)[source]
-

Load an RSA public key from an M2Crypto.BIO.BIO object.

- --- - - - - - -
Parameters:bio – M2Crypto.BIO.BIO object containing RSA public key in PEM -format.
Returns:M2Crypto.RSA.RSA_pub object.
-
- -
-
-M2Crypto.RSA.new_pub_key(e_n)[source]
-

Instantiate an RSA_pub object from an (e, n) tuple.

- --- - - - - - -
Parameters:
    -
  • 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.
  • -
  • 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.
  • -
-
Returns:

M2Crypto.RSA.RSA_pub object.

-
-
- -
-
-M2Crypto.RSA.rsa_error()[source]
-
- -
-
-

Rand Module

-

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.

-
-
-M2Crypto.Rand.rand_seed(seed)[source]
-

Equivalent to rand_add() when len(seed) == entropy.

- --- - - - -
Parameters:seed – added data (see description at rand_add)
-
- -
-
-M2Crypto.Rand.rand_add(blob, entropy)[source]
-

Mixes blob into the PRNG state.

- --- - - - -
Parameters:
    -
  • blob – added data
  • -
  • 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.

-
- -
-
-M2Crypto.Rand.load_file(filename, max_bytes)[source]
-

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.

- --- - - - - - -
Parameters:
    -
  • filename
  • -
  • max_bytes
  • -
-
Returns:

the number of bytes read.

-
-
- -
-
-M2Crypto.Rand.save_file(filename)[source]
-

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.

- --- - - - - - -
Parameters:filename
Returns:returns the number of bytes written, and -1 if the bytes -written were generated without appropriate seed.
-
- -
-
-M2Crypto.Rand.rand_bytes(num)[source]
-

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.

- --- - - - - - -
Parameters:num – number of bytes to be returned
Returns:random bytes
-
- -
-
-M2Crypto.Rand.rand_pseudo_bytes(num)[source]
-

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).

- --- - - - - - -
Parameters:num – number of bytes to be returned
Returns:random bytes
-
- -
-
-M2Crypto.Rand.rand_file_name()[source]
-

Generate a default path for the random seed file.

- --- - - - -
Returns: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.
-
- -
-
-M2Crypto.Rand.rand_status()[source]
-

Check whether there is enough entropy in PRNG.

- --- - - - -
Returns:1 if the PRNG has been seeded with enough -data, 0 otherwise.
-
- -
-
-

SMIME Module

-
-
-class M2Crypto.SMIME.Cipher(algo)[source]
-

Bases: object

-

Object interface to EVP_CIPHER without all the frills of -M2Crypto.EVP.Cipher.

-
- -
-
-class M2Crypto.SMIME.PKCS7(pkcs7=None, _pyfree=0)[source]
-

Bases: object

-
-
-get0_signers(certs, flags=0)[source]
-
- -
-
-m2_pkcs7_free()
-
- -
-
-type(text_name=0)[source]
-
- -
-
-write(bio)[source]
-
- -
-
-write_der(bio)[source]
-
- -
- -
-
-exception M2Crypto.SMIME.PKCS7_Error[source]
-

Bases: Exception

-
- -
-
-class M2Crypto.SMIME.SMIME[source]
-

Bases: object

-
-
-decrypt(pkcs7, flags=0)[source]
-
- -
-
-encrypt(data_bio, flags=0)[source]
-
- -
-
-load_key(keyfile, certfile=None, callback=<function passphrase_callback>)[source]
-
- -
-
-load_key_bio(keybio, certbio=None, callback=<function passphrase_callback>)[source]
-
- -
-
-set_cipher(cipher)[source]
-
- -
-
-set_x509_stack(stack)[source]
-
- -
-
-set_x509_store(store)[source]
-
- -
-
-sign(data_bio, flags=0, algo='sha1')[source]
-
- -
-
-unset_cipher()[source]
-
- -
-
-unset_key()[source]
-
- -
-
-unset_x509_stack()[source]
-
- -
-
-unset_x509_store()[source]
-
- -
-
-verify(pkcs7, data_bio=None, flags=0)[source]
-
- -
-
-write(out_bio, pkcs7, data_bio=None, flags=0)[source]
-
- -
- -
-
-exception M2Crypto.SMIME.SMIME_Error[source]
-

Bases: Exception

-
- -
-
-M2Crypto.SMIME.load_pkcs7(p7file)[source]
-
- -
-
-M2Crypto.SMIME.load_pkcs7_bio(p7_bio)[source]
-
- -
-
-M2Crypto.SMIME.load_pkcs7_bio_der(p7_bio)[source]
-
- -
-
-M2Crypto.SMIME.load_pkcs7_der(p7file)[source]
-
- -
-
-M2Crypto.SMIME.smime_load_pkcs7(p7file)[source]
-
- -
-
-M2Crypto.SMIME.smime_load_pkcs7_bio(p7_bio)[source]
-
- -
-
-M2Crypto.SMIME.text_crlf(text)[source]
-
- -
-
-M2Crypto.SMIME.text_crlf_bio(bio_in)[source]
-
- -
-
-

X509 Module

-
-
-class M2Crypto.X509.CRL(crl=None, _pyfree=0)[source]
-

Bases: object

-

X509 Certificate Revocation List

-
-
-as_text()[source]
-

Return CRL in PEM format in a string.

- --- - - - -
Returns:String containing the CRL in PEM format.
-
- -
-
-m2_x509_crl_free()
-
- -
- -
-
-class M2Crypto.X509.Request(req=None, _pyfree=0)[source]
-

Bases: object

-

X509 Certificate Request.

-
-
-add_extensions(ext_stack)[source]
-

Add X509 extensions to this request.

- --- - - - - - -
Parameters:ext_stack – Stack of extensions to add.
Returns:1 for success and 0 for failure
-
- -
-
-as_der()[source]
-
- -
-
-as_pem()[source]
-
- -
-
-as_text()[source]
-
- -
-
-get_pubkey()[source]
-

Get the public key for the request.

- --- - - - -
Returns:Public key from the request.
-
- -
-
-get_subject()[source]
-
- -
-
-get_version()[source]
-

Get version.

- --- - - - -
Returns:Returns version.
-
- -
-
-m2_x509_req_free()
-
- -
-
-save(filename, format=1)[source]
-

Saves X.509 certificate request to a file. Default output -format is PEM.

- --- - - - - - -
Parameters:
    -
  • filename – Name of the file the request will be saved to.
  • -
  • 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.
  • -
-
Returns:

1 for success, 0 for failure. -The error code can be obtained by ERR_get_error.

-
-
- -
-
-save_pem(filename)[source]
-
- -
-
-set_pubkey(pkey)[source]
-

Set the public key for the request.

- --- - - - - - -
Parameters:pkey – Public key
Returns:Return 1 for success and 0 for failure.
-
- -
-
-set_subject(name)
-

Set subject name.

- --- - - - - - -
Parameters:name – subjectName field.
Returns:1 for success and 0 for failure
-
- -
-
-set_subject_name(name)[source]
-

Set subject name.

- --- - - - - - -
Parameters:name – subjectName field.
Returns:1 for success and 0 for failure
-
- -
-
-set_version(version)[source]
-

Set version.

- --- - - - - - -
Parameters:version – Version number.
Returns:Returns 0 on failure.
-
- -
-
-sign(pkey, md)[source]
-
--- - - - - - -
Parameters:
    -
  • pkey – PKey to be signed
  • -
  • md – used algorigthm
  • -
-
Returns:

1 for success and 0 for failure

-
-
- -
-
-verify(pkey)[source]
-
--- - - - - - -
Parameters:pkey – PKey to be verified
Returns:1 for success and 0 for failure
-
- -
- -
-
-class M2Crypto.X509.X509(x509=None, _pyfree=0)[source]
-

Bases: object

-

X.509 Certificate

-
-
-add_ext(ext)[source]
-

Add X509 extension to this certificate.

- --- - - - -
Parameters:ext – Extension
-

:return 1 for success and 0 for failure

-
- -
-
-as_der()[source]
-
- -
-
-as_pem()[source]
-
- -
-
-as_text()[source]
-
- -
-
-check_ca()[source]
-

Check if the certificate is a Certificate Authority (CA) certificate.

- --- - - - - - -
Returns:0 if the certificate is not CA, nonzero otherwise.
Requires:OpenSSL 0.9.8 or newer
-
- -
-
-check_purpose(id, ca)[source]
-

Check if the certificate’s purpose matches the asked purpose.

- --- - - - - - -
Parameters:
    -
  • id – Purpose id. See X509_PURPOSE_* constants.
  • -
  • ca – 1 if the certificate should be CA, 0 otherwise.
  • -
-
Returns:

0 if the certificate purpose does not match, nonzero -otherwise.

-
-
- -
-
-get_ext(name)[source]
-

Get X509 extension by name.

- --- - - - - - -
Parameters:name – Name of the extension
Returns:X509_Extension
-
- -
-
-get_ext_at(index)[source]
-

Get X509 extension by index.

- --- - - - - - -
Parameters:index – Name of the extension
Returns:X509_Extension
-
- -
-
-get_ext_count()[source]
-

Get X509 extension count.

-
- -
-
-get_fingerprint(md='md5')[source]
-

Get the fingerprint of the certificate.

- --- - - - - - -
Parameters:md – Message digest algorithm to use.
Returns:String containing the fingerprint in hex format.
-
- -
-
-get_issuer()[source]
-
- -
-
-get_not_after()[source]
-
- -
-
-get_not_before()[source]
-
- -
-
-get_pubkey()[source]
-
- -
-
-get_serial_number()[source]
-
- -
-
-get_subject()[source]
-
- -
-
-get_version()[source]
-
- -
-
-m2_x509_free()
-
- -
-
-save(filename, format=1)[source]
-

Saves X.509 certificate to a file. Default output -format is PEM.

- --- - - - - - -
Parameters:
    -
  • filename – Name of the file the cert will be saved to.
  • -
  • 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.
  • +
    +
    +save_pem(file: AnyStr, cipher: Optional[str] = 'aes_128_cbc', callback: Callable = <function passphrase_callback>) → int
    +

    Save the key pair to a file in PEM format.

    +
    +
    Parameters
    +
      +
    • file – Name of file to save key to.

    • +
    • 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.

    • +
    • callback – A Python callable object that is invoked +to acquire a passphrase with which to protect +the key. The default is +util.passphrase_callback.

    -
Returns:

1 for success or 0 for failure

-
-
- -
-
-save_pem(filename)[source]
-
--- - - - - - -
Parameters:filename – name of the file to be loaded
Returns:1 for success or 0 for failure
-
- -
-
-set_issuer(name)[source]
-

Set issuer name.

- --- - - - -
Parameters:name – subjectName field.
-

:return 1 for success and 0 for failure

-
- -
-
-set_issuer_name(name)[source]
-
--- - - - -
Returns:1 on success, 0 on failure
-
- -
-
-set_not_after(asn1_time)[source]
-
--- - - - -
Returns:1 on success, 0 on failure
-
- -
-
-set_not_before(asn1_time)[source]
-
--- - - - -
Returns:1 on success, 0 on failure
-
- -
-
-set_pubkey(pkey)[source]
-

Set the public key for the certificate

- --- - - - -
Parameters:pkey – Public key
-

:return 1 for success and 0 for failure

-
- -
-
-set_serial_number(serial)[source]
-

Set serial number.

- --- - - - -
Parameters:serial – Serial number.
-

:return 1 for success and 0 for failure.

-
- -
-
-set_subject(name)[source]
-

Set subject name.

- --- - - - -
Parameters:name – subjectName field.
-

:return 1 for success and 0 for failure

+
+
-
-
-set_subject_name(name)[source]
-
--- - - - -
Returns:1 on success, 0 on failure
+
+
+save_pub_key(file: AnyStr) → int[source]
+

Save the public key to a file in PEM format.

+
+
Parameters
+

file – Name of file to save key to.

+
+
-
-
-set_version(version)[source]
-

Set version of the certificate.

- --- - - - - - -
Parameters:version – Version number.
Returns:Returns 0 on failure.
+
+
+save_pub_key_bio(bio: BIO.BIO) → int[source]
+

Save the public key to an M2Crypto.BIO.BIO object in PEM format.

+
+
Parameters
+

bio – M2Crypto.BIO.BIO object to save key to.

+
+
-
-
-sign(pkey, md)[source]
-

Sign the certificate.

- --- - - - -
Parameters:
    -
  • pkey – Public key
  • -
  • md – Message digest algorithm to use for signing, -for example ‘sha1’.
  • +
    +
    +sign(digest: bytes, algo: str = 'sha1') → bytes[source]
    +

    Signs a digest with the private key

    +
    +
    Parameters
    +
      +
    • digest – A digest created by using the digest method

    • +
    • algo – The method that created the digest. +Legal values like ‘sha1’,’sha224’, ‘sha256’, +‘ripemd160’, and ‘md5’.

    -
-

:return int

-
- -
-
-verify(pkey=None)[source]
-
- -
- -
-
-exception M2Crypto.X509.X509Error[source]
-

Bases: ValueError

-
- -
-
-class M2Crypto.X509.X509_Extension(x509_ext_ptr=None, _pyfree=1)[source]
-

Bases: object

-

X509 Extension

-
-
-get_critical()[source]
-

Return whether or not this is a critical extension.

- --- - - - -
Returns:Nonzero if this is a critical extension.
-
- -
-
-get_name()[source]
-

Get the extension name, for example ‘subjectAltName’.

+
+
Returns
+

a string which is the signature

+
+
-
-
-get_value(flag=0, indent=0)[source]
-

Get the extension value, for example ‘DNS:www.example.com’.

- --- - - - -
Parameters:
    -
  • flag – Flag to control what and how to print.
  • -
  • indent – How many spaces to print before actual value.
  • +
    +
    +sign_rsassa_pss(digest: bytes, algo: str = 'sha1', salt_length: int = 20) → bytes[source]
    +

    Signs a digest with the private key using RSASSA-PSS

    +
    +
    Parameters
    +
      +
    • digest – A digest created by using the digest method

    • +
    • salt_length – The length of the salt to use

    • +
    • algo – The hash algorithm to use +Legal values like ‘sha1’,’sha224’, ‘sha256’, +‘ripemd160’, and ‘md5’.

    -
-
- -
-
-m2_x509_extension_free()
-
- -
-
-set_critical(critical=1)[source]
-

Mark this extension critical or noncritical. By default an -extension is not critical.

- --- - - - - - -
Parameters:critical – Nonzero sets this extension as critical. -Calling this method without arguments will -set this extension to critical.
Returns:1 for success, 0 for failure
-
- -
- -
-
-class M2Crypto.X509.X509_Extension_Stack(stack=None, _pyfree=0)[source]
-

Bases: 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()
-
- -
-
-pop()[source]
-

Pop X509_Extension object from the stack.

- --- - - - -
Returns:X509_Extension popped
-
- -
-
-push(x509_ext)[source]
-

Push X509_Extension object onto the stack.

- --- - - - - - -
Parameters:x509_ext – X509_Extension object to be pushed onto the stack.
Returns:The number of extensions on the stack.
-
- +
+
Returns
+

a string which is the signature

+
+
-
-
-class M2Crypto.X509.X509_Name(x509_name=None, _pyfree=0)[source]
-

Bases: object

-

X509 Name

-
-
-add_entry_by_txt(field, type, entry, len, loc, set)[source]
-

Add X509_Name field whose name is identified by its name.

- --- - - - -
Parameters:
    -
  • field – name of the entry
  • -
  • type – use MBSTRING_ASC or MBSTRING_UTF8 -(or standard ASN1 type like V_ASN1_IA5STRING)
  • -
  • entry – value
  • -
  • 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).

- --- - - - - - -
Parameters:
    -
  • loc – determines the index where the new entry is -inserted: if it is -1 it is appended.
  • -
  • 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.
  • +
    +
    +verify(data: bytes, signature: bytes, algo: str = 'sha1') → int[source]
    +

    Verifies the signature with the public key

    +
    +
    Parameters
    +
      +
    • data – Data that has been signed

    • +
    • signature – The signature signed with the private key

    • +
    • algo – The method use to create digest from the data +before it was signed. Legal values like +‘sha1’,’sha224’, ‘sha256’, ‘ripemd160’, and ‘md5’.

    -
Returns:

1 for success of 0 if an error occurred.

-
+
+
Returns
+

1 or 0, depending on whether the signature was +verified or not.

+
+
-
-
-as_der()[source]
-
- -
-
-as_hash()[source]
-
- -
-
-as_text(indent=0, flags=0)[source]
-

as_text returns the name as a string.

- --- - - - -
Parameters:
    -
  • indent – Each line in multiline format is indented -by this many spaces.
  • -
  • flags – Flags that control how the output should be formatted.
  • +
    +
    +verify_rsassa_pss(data: bytes, signature: bytes, algo: str = 'sha1', salt_length: int = 20) → int[source]
    +

    Verifies the signature RSASSA-PSS

    +
    +
    Parameters
    +
      +
    • data – Data that has been signed

    • +
    • signature – The signature signed with RSASSA-PSS

    • +
    • salt_length – The length of the salt that was used

    • +
    • algo – The hash algorithm to use +Legal values are for example ‘sha1’,’sha224’, +‘sha256’, ‘ripemd160’, and ‘md5’.

    -
-
- -
-
-entry_count()[source]
-
- -
-
-get_entries_by_nid(nid)[source]
-

Retrieve the next index matching nid.

- --- - - - - - -
Parameters:nid – name of the entry (as m2.NID* constants)
Returns:list of X509_Name_Entry items
-
- -
-
-m2_x509_name_free()
-
- -
-
-nid = {'C': 14, 'CN': 13, 'Email': 48, 'GN': 99, 'L': 15, 'O': 17, 'OU': 18, 'SN': 100, 'SP': 16, 'ST': 16, 'commonName': 13, 'emailAddress': 48, 'givenName': 99, 'localityName': 15, 'organizationName': 17, 'organizationUnitName': 18, 'serialNumber': 105, 'stateOrProvinceName': 16, 'surname': 100}
-
- - - -
-
-class M2Crypto.X509.X509_Name_Entry(x509_name_entry, _pyfree=0)[source]
-

Bases: object

-

X509 Name Entry

-
-
-create_by_txt(field, type, entry, len)[source]
-
- -
-
-get_data()[source]
-
- -
-
-get_object()[source]
-
- -
-
-m2_x509_name_entry_free()
-
- -
-
-set_data(data, type=4097)[source]
-

Sets the field name to asn1obj

- --- - - - - - -
Parameters:data – data in a binary form to be set
Returns:0 on failure, 1 on success
-
- -
-
-set_object(asn1obj)[source]
-

Sets the field name to asn1obj

- --- - - - - - -
Parameters:asn1obj
Returns:0 on failure, 1 on success
-
- -
- -
-
-class M2Crypto.X509.X509_Stack(stack=None, _pyfree=0, _pyfree_x509=0)[source]
-

Bases: 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!
-
-
-as_der()[source]
-

Return the stack as a DER encoded string

+
+
Returns
+

1 or 0, depending on whether the signature was +verified or not.

+
+
-
-
-m2_sk_x509_free()
-
- -
-
-pop()[source]
-

pop a certificate from the stack.

- --- - - - -
Returns:X509 object that was popped, or None if there is -nothing to pop.
-
-
-push(x509)[source]
-

push an X509 certificate onto the stack.

- --- - - - - - -
Parameters:x509 – X509 object.
Returns:The number of X509 objects currently on the stack.
+
+
+exception M2Crypto.RSA.RSAError[source]
+

Bases: Exception

+
+
+class M2Crypto.RSA.RSA_pub(rsa: bytes, _pyfree: int = 0)[source]
+

Bases: M2Crypto.RSA.RSA

+

Object interface to an RSA public key.

+
+
+check_key() → int[source]
+

Validate RSA keys.

+

It checks that p and q are in fact prime, and that n = p*q.

+
+
Returns
+

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).

+
+
-
-
-class M2Crypto.X509.X509_Store(store=None, _pyfree=0)[source]
-

Bases: object

-

X509 Store

-
-
-add_cert(x509)
-
- -
-
-add_x509(x509)[source]
+
+
+private_decrypt(*argv: Any) → None[source]
-
-
-load_info(file)[source]
-
--- - - - - - -
Parameters:file – filename
Returns:1 on success, 0 on failure
-
- -
-
-load_locations(file)
-
--- - - - - - -
Parameters:file – filename
Returns:1 on success, 0 on failure
-
- -
-
-m2_x509_store_free()
+
+
+private_encrypt(*argv: Any) → None[source]
-
-
-set_verify_cb(callback=None)[source]
-

Set callback which will be called when the store is verified. -Wrapper over OpenSSL X509_STORE_set_verify_cb().

- --- - - - - - - - - - -
Parameters: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.
Returns:None
-
- -
- -
-
-class M2Crypto.X509.X509_Store_Context(x509_store_ctx, _pyfree=0)[source]
-

Bases: object

-

X509 Store Context

-
-
-get1_chain()[source]
-

Get certificate chain.

- --- - - - -
Returns:Reference counted (i.e. safe to use even after the store -context goes away) stack of certificates in the chain.
-
- -
-
-get_current_cert()[source]
-

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.
-
- -
-
-get_error()[source]
-

Get error code.

-
- -
-
-get_error_depth()[source]
-

Get error depth.

+
+
+save_key(file: AnyStr, *args: Any, **kw: Any) → int[source]
+

Save public key to file.

-
-
-m2_x509_store_ctx_free()
-
- +
+
+save_key_bio(bio: BIO.BIO, *args: Any, **kw: Any) → int[source]
+

Save public key to BIO.

-
-
-M2Crypto.X509.load_cert(file, format=1)[source]
-

Load certificate from file.

- --- - - - - - -
Parameters:
    -
  • file – Name of file containing certificate in either DER or -PEM format.
  • -
  • format – Describes the format of the file to be loaded, -either PEM or DER.
  • -
-
Returns:

M2Crypto.X509.X509 object.

-
-
-
-M2Crypto.X509.load_cert_bio(bio, format=1)[source]
-

Load certificate from a bio.

- --- - - - - - -
Parameters:
    -
  • bio – BIO pointing at a certificate in either DER or PEM format.
  • -
  • format – Describes the format of the cert to be loaded, -either PEM or DER (via constants FORMAT_PEM -and FORMAT_FORMAT_DER)
  • +
    +
    +M2Crypto.RSA.gen_key(bits: int, e: int, callback: Callable = <function keygen_callback>)M2Crypto.RSA.RSA[source]
    +

    Generate an RSA key pair.

    +
    +
    Parameters
    +
      +
    • bits – Key length, in bits.

    • +
    • e – The RSA public exponent.

    • +
    • 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.

    -
Returns:

M2Crypto.X509.X509 object.

-
+
+
Returns
+

M2Crypto.RSA.RSA object.

+
+
-
-
-M2Crypto.X509.load_cert_der_string(string)[source]
-

Load certificate from a string.

- --- - - - - - -
Parameters:string – String containing a certificate in DER format.
Returns:M2Crypto.X509.X509 object.
+
+
+M2Crypto.RSA.keygen_callback(p: int, n: Any, out: IO[str] = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) → None[source]
+

Default callback for gen_key().

-
-
-M2Crypto.X509.load_cert_string(string, format=1)[source]
-

Load certificate from a string.

- --- - - - - - -
Parameters:
    -
  • string – String containing a certificate in either DER or PEM format.
  • -
  • format – Describes the format of the cert to be loaded, -either PEM or DER (via constants FORMAT_PEM -and FORMAT_FORMAT_DER)
  • +
    +
    +M2Crypto.RSA.load_key(file: AnyStr, callback: Callable = <function passphrase_callback>)M2Crypto.RSA.RSA[source]
    +

    Load an RSA key pair from file.

    +
    +
    Parameters
    +
      +
    • file – Name of file containing RSA public key in PEM format.

    • +
    • callback – A Python callable object that is invoked +to acquire a passphrase with which to unlock the +key. The default is util.passphrase_callback.

    -
Returns:

M2Crypto.X509.X509 object.

-
-
- -
-
-M2Crypto.X509.load_crl(file)[source]
-

Load CRL from file.

- --- - - - - - -
Parameters:file – Name of file containing CRL in PEM format.
Returns:M2Crypto.X509.CRL object.
+
+
Returns
+

M2Crypto.RSA.RSA object.

+
+
-
-
-M2Crypto.X509.load_request(file, format=1)[source]
-

Load certificate request from file.

- --- - - - - - -
Parameters:
    -
  • file – Name of file containing certificate request in -either PEM or DER format.
  • -
  • format – Describes the format of the file to be loaded, -either PEM or DER. (using constants FORMAT_PEM -and FORMAT_DER)
  • +
    +
    +M2Crypto.RSA.load_key_bio(bio: BIO.BIO, callback: Callable = <function passphrase_callback>)RSA[source]
    +

    Load an RSA key pair from an M2Crypto.BIO.BIO object.

    +
    +
    Parameters
    +
      +
    • bio – M2Crypto.BIO.BIO object containing RSA key pair in PEM +format.

    • +
    • callback – A Python callable object that is invoked +to acquire a passphrase with which to unlock the +key. The default is util.passphrase_callback.

    -
Returns:

Request object.

-
+
+
Returns
+

M2Crypto.RSA.RSA object.

+
+
-
-
-M2Crypto.X509.load_request_bio(bio, format=1)[source]
-

Load certificate request from a bio.

- --- - - - - - -
Parameters:
    -
  • bio – BIO pointing at a certificate request in -either DER or PEM format.
  • -
  • format – Describes the format of the request to be loaded, -either PEM or DER. (using constants FORMAT_PEM -and FORMAT_DER)
  • +
    +
    +M2Crypto.RSA.load_key_string(string: AnyStr, callback: Callable = <function passphrase_callback>)M2Crypto.RSA.RSA[source]
    +

    Load an RSA key pair from a string.

    +
    +
    Parameters
    +
      +
    • string – String containing RSA key pair in PEM format.

    • +
    • callback – A Python callable object that is invoked +to acquire a passphrase with which to unlock the +key. The default is util.passphrase_callback.

    -
Returns:

M2Crypto.X509.Request object.

-
-
- -
-
-M2Crypto.X509.load_request_der_string(string)[source]
-

Load certificate request from a string.

- --- - - - - - -
Parameters:string – String containing a certificate request in DER format.
Returns:M2Crypto.X509.Request object.
+
+
Returns
+

M2Crypto.RSA.RSA object.

+
+
-
-
-M2Crypto.X509.load_request_string(string, format=1)[source]
-

Load certificate request from a string.

- --- - - - - - -
Parameters:
    -
  • string – String containing a certificate request in -either DER or PEM format.
  • -
  • format – Describes the format of the request to be loaded, -either PEM or DER. (using constants FORMAT_PEM -and FORMAT_DER)
  • -
-
Returns:

M2Crypto.X509.Request object.

-
+
+
+M2Crypto.RSA.load_pub_key(file: AnyStr)M2Crypto.RSA.RSA_pub[source]
+

Load an RSA public key from file.

+
+
Parameters
+

file – Name of file containing RSA public key in PEM format.

+
+
Returns
+

M2Crypto.RSA.RSA_pub object.

+
+
-
-
-M2Crypto.X509.new_extension(name, value, critical=0, _pyfree=1)[source]
-

Create new X509_Extension instance.

+
+
+M2Crypto.RSA.load_pub_key_bio(bio: BIO.BIO)RSA_pub[source]
+

Load an RSA public key from an M2Crypto.BIO.BIO object.

+
+
Parameters
+

bio – M2Crypto.BIO.BIO object containing RSA public key in PEM +format.

+
+
Returns
+

M2Crypto.RSA.RSA_pub object.

+
+
-
-
-M2Crypto.X509.new_stack_from_der(der_string)[source]
-

Create a new X509_Stack from DER string.

- --- - - - -
Returns:X509_Stack
+
+
+M2Crypto.RSA.new_pub_key(e_n: Tuple[bytes, bytes])M2Crypto.RSA.RSA_pub[source]
+

Instantiate an RSA_pub object from an (e, n) tuple.

+
+
Parameters
+
    +
  • 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.

  • +
  • 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.

  • +
+
+
Returns
+

M2Crypto.RSA.RSA_pub object.

+
+
-
-
-M2Crypto.X509.x509_store_default_cb(ok, ctx)[source]
+
+
+M2Crypto.RSA.rsa_error() → None[source]
-
-

callback Module

+
+

Rand Module

-
-

ftpslib Module

-
-
-class M2Crypto.ftpslib.FTP_TLS(host=None, ssl_ctx=None)[source]
-

Bases: ftplib.FTP

-

Python OO interface to client-side FTP/TLS.

-
-
-auth_ssl()[source]
-

Secure the control connection per AUTH SSL, aka AUTH TLS-P.

-
- -
-
-auth_tls()[source]
-

Secure the control connection per AUTH TLS, aka AUTH TLS-C.

-
- -
-
-ntransfercmd(cmd, rest=None)[source]
-

Initiate a data transfer.

-
- -
-
-prot_c()[source]
-

Set up data connection in the clear.

-
- -
-
-prot_p()[source]
-

Set up secure data connection.

-
- -
- +
+

SMIME Module

-
-

httpslib Module

-
-
-class M2Crypto.httpslib.HTTPSConnection(host, port=None, strict=None, **ssl)[source]
-

Bases: http.client.HTTPConnection

-

This class allows communication via SSL using M2Crypto.

-
-
-close()[source]
-

Close the connection to the HTTP server.

-
- -
-
-connect()[source]
-

Connect to the host and port specified in __init__.

-
- -
-
-default_port = 443
-
- -
-
-get_session()[source]
-
- -
-
-set_session(session)[source]
-
- -
- -
-
-class M2Crypto.httpslib.ProxyHTTPSConnection(host, port=None, strict=None, username=None, password=None, **ssl)[source]
-

Bases: M2Crypto.httpslib.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.

-
-
-connect()[source]
-

Connect to the host and port specified in __init__.

-
- -
-
-endheaders(*args, **kwargs)[source]
-

Indicate that the last header line has been sent to the server.

-

This method sends the request to the server. The optional message_body -argument can be used to pass a message body associated with the -request.

-
- -
-
-putheader(header, value)[source]
-

Send a request header line to the server.

-

For example: h.putheader(‘Accept’, ‘text/html’)

-
- -
-
-putrequest(method, url, skip_host=0, skip_accept_encoding=0)[source]
-

putrequest is called before connect, so can interpret url and get -real host/port to be used to make CONNECT request to proxy

-
- -
- +
+

X509 Module

+
+
+

callback Module

+
+
+

ftpslib Module

+
+
+

httpslib Module

m2 Module

@@ -4598,151 +1127,64 @@ real host/port to be used to make CONNECT request to proxy

m2crypto Module

-
-

m2urllib Module

-
-
-M2Crypto.m2urllib.open_https(self, url, data=None, ssl_context=None)[source]
-

Open URL over the SSL connection.

- --- - - - - - -
Parameters:
    -
  • url – URL to be opened
  • -
  • data – data for the POST request
  • -
  • ssl_context – SSL.Context to be used
  • -
-
Returns:

-
-
- +
+

m2urllib Module

-
-

m2urllib2 Module

-
-
-class M2Crypto.m2urllib2.HTTPSHandler(ssl_context=None)[source]
-

Bases: urllib.request.AbstractHTTPHandler

-
-
-https_open(req)[source]
-

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_request(request)
-
- -
- -
-
-M2Crypto.m2urllib2.build_opener(ssl_context=None, *handlers)[source]
-

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.

-
- +
+

m2urllib2 Module

-
-

m2xmlrpclib Module

-
-
-class M2Crypto.m2xmlrpclib.SSL_Transport(ssl_context=None, *args, **kw)[source]
-

Bases: xmlrpc.client.Transport

-
-
-request(host, handler, request_body, verbose=0)[source]
-
- -
-
-user_agent = 'M2Crypto_XMLRPC/0.33.0 - Python-xmlrpc/3.7'
-
- -
- +
+

m2xmlrpclib Module

-
-

threading Module

-
-
-M2Crypto.threading.cleanup()[source]
-

End and cleanup threading support.

-
- -
-
-M2Crypto.threading.init()[source]
-

Initialize threading support.

-
- +
+

threading Module

util Module

-
+
-exception M2Crypto.util.UtilError[source]
+exception M2Crypto.util.UtilError[source]

Bases: Exception

-
+
-M2Crypto.util.bin_to_hex(b)[source]
+M2Crypto.util.bin_to_hex(b: bytes) → str[source]
-
+
-M2Crypto.util.genparam_callback(p, n, out=<_io.TextIOWrapper name='<stdout>' mode='w' encoding='UTF-8'>)[source]
+M2Crypto.util.genparam_callback(p: int, n: Any, out: io.IOBase = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>) → None[source]
-
+
-M2Crypto.util.no_passphrase_callback(*args)[source]
+M2Crypto.util.no_passphrase_callback(*args: Any) → str[source]
-
+
-M2Crypto.util.octx_to_num(x)[source]
+M2Crypto.util.octx_to_num(x: bytes) → int[source]
-
+
-M2Crypto.util.passphrase_callback(v, prompt1='Enter passphrase:', prompt2='Verify passphrase:')[source]
+M2Crypto.util.passphrase_callback(v: bool, prompt1: str = 'Enter passphrase:', prompt2: str = 'Verify passphrase:') → Optional[str][source]
-
+
-M2Crypto.util.pkcs5_pad(data, blklen=8)[source]
+M2Crypto.util.pkcs5_pad(data: str, blklen: int = 8) → str[source]
-
+
-M2Crypto.util.pkcs7_pad(data, blklen)[source]
+M2Crypto.util.pkcs7_pad(data: str, blklen: int) → str[source]
-
+
-M2Crypto.util.quiet_genparam_callback(p, n, out)[source]
+M2Crypto.util.quiet_genparam_callback(p: Any, n: Any, out: Any) → None[source]
@@ -4751,17 +1193,17 @@ default handlers, the default handlers will not be used.

- + @@ -4859,7 +1299,7 @@ default handlers, the default handlers will not be used.

©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12 | diff --git a/doc/html/ZServerSSL-HOWTO.html b/doc/html/ZServerSSL-HOWTO.html index 67023d0..41238ea 100644 --- a/doc/html/ZServerSSL-HOWTO.html +++ b/doc/html/ZServerSSL-HOWTO.html @@ -1,19 +1,18 @@ - + - + - - - 1.   ZServerSSL-HOWTO — M2Crypto documentation + + + 1. ZServerSSL-HOWTO — M2Crypto documentation - - - - - + + + + + @@ -33,44 +32,44 @@
-

1.   ZServerSSL-HOWTO

- --- - - - - - - - -
author:Pheng Siong Ng <ngps@post1.com>
copyright:© 2000, 2001 by Ng Pheng Siong.
date:2003-06-22
+

1. ZServerSSL-HOWTO

+
+
author
+

Pheng Siong Ng <ngps@post1.com>

+
+
copyright
+

© 2000, 2001 by Ng Pheng Siong.

+
+
date
+

2003-06-22

+
+
-

1.1.   Introduction

+

1.1. Introduction

ZServerSSL adds to Zope’s ZServer the following:

    -
  • HTTPS server
  • -
  • WebDAV-source-over-HTTPS server
  • +
  • HTTPS server

  • +
  • WebDAV-source-over-HTTPS server

With the HTTPS server, ZServerSSL also provides WebDAV-over-HTTPS and XMLRPC-over-HTTPS access to Zope.

@@ -79,100 +78,92 @@ XMLRPC-over-HTTPS access to Zope.

in Un*x fashion.

-

1.2.   Preparation

+

1.2. Preparation

    -
  1. Download M2Crypto 0.11, contained in the file m2crypto-0.11.zip.
  2. -
  3. Unpack m2crypto-0.11.zip. This will create a directory -m2crypto-0.11. Henceforth, we refer to this directory as $M2.
  4. -
  5. Install M2Crypto per the instructions in $M2/INSTALL.
  6. +
  7. Download M2Crypto 0.11, contained in the file m2crypto-0.11.zip.

  8. +
  9. Unpack m2crypto-0.11.zip. This will create a directory +m2crypto-0.11. Henceforth, we refer to this directory as $M2.

  10. +
  11. Install M2Crypto per the instructions in $M2/INSTALL.

The ZServerSSL distribution is in $M2/demo/Zope. We shall refer to this directory as $ZSSL.

-

1.3.   Installation

+

1.3. Installation

Below, we refer to your Zope top-level directory as $ZOPE.

    -
  1. Copy $ZSSL/z2s.py into $ZOPE.

    -
  2. -
  3. Depending on your operating system, modify $ZOPE/start or +

  4. Copy $ZSSL/z2s.py into $ZOPE.

  5. +
  6. 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.

    -
  7. -
  8. Copy $ZSSL/dh1024.pem into $ZOPE. This file contains -Diffie-Hellman parameters for use by the SSL protocol.

    -
  9. -
  10. Copy $ZSSL/randpool.dat into $ZOPE. This file contains seed +serve as examples.

  11. +
  12. Copy $ZSSL/dh1024.pem into $ZOPE. This file contains +Diffie-Hellman parameters for use by the SSL protocol.

  13. +
  14. 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
     
  15. -
  16. Copy $ZSSL/ca.pem to $ZOPE. This file contains an +

  17. Copy $ZSSL/ca.pem to $ZOPE. This file contains an example Certification Authority (CA) certificate. For information on operating your own CA, see HOWTO: Creating your own CA with OpenSSL or -one of numerous similar documents available on the web.

    -
  18. -
  19. Copy $ZSSL/server.pem to $ZOPE. This file contains an RSA key +one of numerous similar documents available on the web.

  20. +
  21. 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.

    -
  22. -
  23. Copy $ZSSL/ZServer/HTTPS_Server.py to $ZOPE/ZServer.

    -
  24. -
  25. Copy $ZSSL/ZServer/__init__.py to $ZOPE/ZServer. This +create your own key/certificate bundle.

  26. +
  27. Copy $ZSSL/ZServer/HTTPS_Server.py to $ZOPE/ZServer.

  28. +
  29. 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
    + 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
     
  30. -
  31. Copy $ZSSL/ZServer/medusa/https_server.py to -$ZOPE/ZServer/medusa.

    -
  32. -
  33. Stop Zope, if it is running.

    -
  34. -
  35. Start Zope with ZServerSSL thusly:

    +
  36. Copy $ZSSL/ZServer/medusa/https_server.py to +$ZOPE/ZServer/medusa.

  37. +
  38. Stop Zope, if it is running.

  39. +
  40. 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
    • +
    • 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

-

1.4.   Testing

+

1.4. Testing

Below, we assume your Zope server is running on localhost.

-

1.5.   HTTPS

+

1.5. HTTPS

This testing is done with Mozilla 1.1 on FreeBSD.

    -
  1. With a browser, connect to https://localhost:9443/. Browse around. -Check out your browser’s HTTPS informational screens.
  2. -
  3. Connect to https://localhost:9443/manage. Verify that you can access -Zope’s management functionality.
  4. +
  5. With a browser, connect to https://localhost:9443/. Browse around. +Check out your browser’s HTTPS informational screens.

  6. +
  7. Connect to https://localhost:9443/manage. Verify that you can access +Zope’s management functionality.

-

1.6.   WebDAV-over-HTTPS

+

1.6. WebDAV-over-HTTPS

This testing is done with Cadaver 0.21.0 on FreeBSD.:

$ cadaver https://localhost:9443/
 WARNING: Untrusted server certificate presented:
@@ -209,24 +200,24 @@ $
 
-

1.7.   WebDAV-Source-over-HTTPS

+

1.7. WebDAV-Source-over-HTTPS

This testing is done with Mozilla 1.1 on FreeBSD.

    -
  1. Open the Mozilla Composer window.
  2. -
  3. Click “File”, “Open Web Location”. A dialog box appears.
  4. -
  5. Enter https://localhost:9444/index_html for the URL.
  6. -
  7. Select “Open in new Composer window.”
  8. -
  9. Click “Open”. A new Composer window will open with index_html -loaded.
  10. +
  11. Open the Mozilla Composer window.

  12. +
  13. Click “File”, “Open Web Location”. A dialog box appears.

  14. +
  15. Enter https://localhost:9444/index_html for the URL.

  16. +
  17. Select “Open in new Composer window.”

  18. +
  19. Click “Open”. A new Composer window will open with index_html +loaded.

-

1.8.   Python with M2Crypto

+

1.8. Python with M2Crypto

This testing is done with M2Crypto 0.11 and Python 2.2.2 on FreeBSD.

-

1.9.   HTTPS

-
>>> from M2Crypto import Rand, SSL, m2urllib
+

1.9. HTTPS

+
>>> from M2Crypto import Rand, SSL, m2urllib
 >>> url = m2urllib.FancyURLopener()
 >>> url.addheader('Connection', 'close')
 >>> u = url.open('https://127.0.0.1:9443/')
@@ -269,8 +260,8 @@ loaded.
 
-

1.10.   XMLRPC-over-HTTPS

-
>>> from M2Crypto.m2xmlrpclib import Server, SSL_Transport
+

1.10. 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'}]
@@ -279,7 +270,7 @@ loaded.
 
@@ -313,17 +304,15 @@ loaded.
- + @@ -340,7 +329,7 @@ loaded. ©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12 | diff --git a/doc/html/_modules/M2Crypto/EVP.html b/doc/html/_modules/M2Crypto/EVP.html index 4aebc66..861dd5f 100644 --- a/doc/html/_modules/M2Crypto/EVP.html +++ b/doc/html/_modules/M2Crypto/EVP.html @@ -1,19 +1,18 @@ - + - + - - + + M2Crypto.EVP — M2Crypto documentation - - - - - + + + + + @@ -33,7 +32,7 @@

Source code for M2Crypto.EVP

-from __future__ import absolute_import
+from __future__ import absolute_import
 
 """M2Crypto wrapper for OpenSSL EVP API.
 
@@ -44,15 +43,17 @@
 """
 
 import logging
-from M2Crypto import BIO, Err, RSA, m2, util
-if util.py27plus:
-    from typing import AnyStr, Optional, Callable  # noqa
+from M2Crypto import BIO, Err, RSA, m2, util
+from typing import AnyStr, Optional, Callable  # noqa
+from M2Crypto.SSL.Context import Context
 
 log = logging.getLogger('EVP')
 
+
 
[docs]class EVPError(ValueError): pass
+ m2.evp_init(EVPError) @@ -76,7 +77,7 @@ """ m2_md_ctx_free = m2.md_ctx_free - def __init__(self, algo): + def __init__(self, algo): # type: (str) -> None md = getattr(m2, algo, None) # type: Optional[Callable] if md is None: @@ -88,7 +89,7 @@ self.ctx = m2.md_ctx_new() m2.digest_init(self.ctx, self.md) - def __del__(self): + def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_md_ctx_free(self.ctx) @@ -113,7 +114,7 @@ m2_hmac_ctx_free = m2.hmac_ctx_free - def __init__(self, key, algo='sha1'): + def __init__(self, key, algo='sha1'): # type: (bytes, str) -> None md = getattr(m2, algo, None) if md is None: @@ -122,7 +123,7 @@ self.ctx = m2.hmac_ctx_new() m2.hmac_init(self.ctx, key, self.md) - def __del__(self): + def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_hmac_ctx_free(self.ctx) @@ -154,7 +155,7 @@ m2_cipher_ctx_free = m2.cipher_ctx_free - def __init__(self, alg, key, iv, op, key_as_bytes=0, d='md5', + 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) @@ -171,7 +172,7 @@ self.set_padding(padding) del key - def __del__(self): + def __del__(self): # type: () -> None if getattr(self, 'ctx', None): self.m2_cipher_ctx_free(self.ctx) @@ -200,7 +201,7 @@ m2_pkey_free = m2.pkey_free m2_md_ctx_free = m2.md_ctx_free - def __init__(self, pkey=None, _pyfree=0, md='sha1'): + 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 @@ -210,7 +211,7 @@ self._pyfree = 1 self._set_context(md) - def __del__(self): + def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_pkey_free(self.pkey) @@ -222,10 +223,13 @@ 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() + if not md: + self.md = None + else: + 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
[docs] def reset_context(self, md='sha1'): @@ -294,6 +298,86 @@ """ return m2.verify_final(self.ctx, sign, self.pkey)
+
[docs] def digest_sign_init(self): + # type: () -> None + """ + Initialise digest signing operation with self. + """ + if self.md is None: + m2.digest_sign_init(self.ctx, self.pkey) + else: + m2.digest_sign_init(self.ctx, None, self.md, None, self.pkey)
+ +
[docs] def digest_sign_update(self, data): + # type: (bytes) -> None + """ + Feed data to digest signing operation. + + :param data: Data to be signed. + """ + m2.digest_sign_update(self.ctx, data)
+ +
[docs] def digest_sign_final(self): + # type: () -> bytes + """ + Return signature. + + :return: The signature. + """ + return m2.digest_sign_final(self.ctx)
+ +
[docs] def digest_sign(self, data): + # type: () -> bytes + """ + Return signature. + + :return: The signature. + """ + return m2.digest_sign(self.ctx, data)
+ +
[docs] def digest_verify_init(self): + # type: () -> None + """ + Initialise verification operation with self. + """ + if self.md is None: + m2.digest_verify_init(self.ctx, self.pkey) + else: + m2.digest_verify_init(self.ctx, None, self.md, None, self.pkey)
+ +
[docs] def digest_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.digest_verify_update(self.ctx, data)
+ +
[docs] def digest_verify_final(self, sign): + # type: (bytes) -> int + """ + Feed data to digest verification operation. + + :param sign: Signature to use for verification + :return: Result of verification: 1 for success, 0 for failure, -1 on + other error. + """ + return m2.digest_verify_final(self.ctx, sign)
+ +
[docs] def digest_verify(self, sign, data): + # type: (bytes) -> int + """ + Return result of verification. + + :param sign: Signature to use for verification + :param data: Data to be verified. + :return: Result of verification: 1 for success, 0 for failure, -1 on + other error. + """ + return m2.digest_verify(self.ctx, sign, data)
+
[docs] def assign_rsa(self, rsa, capture=1): # type: (RSA.RSA, int) -> int """ @@ -432,6 +516,27 @@ return PKey(cptr, 1)
+
[docs]def load_key_pubkey(file, callback=util.passphrase_callback): + # type: (AnyStr, Callable) -> PKey + """ + Load an M2Crypto.EVP.PKey from a public key as a 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_pubkey(bio._ptr(), callback) + if cptr is None: + raise EVPError(Err.get_error()) + return PKey(cptr, 1)
+ +
[docs]def load_key_bio(bio, callback=util.passphrase_callback): # type: (BIO.BIO, Callable) -> PKey """ @@ -532,17 +637,15 @@
- + @@ -559,7 +662,7 @@ ©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12
diff --git a/doc/html/_modules/M2Crypto/Err.html b/doc/html/_modules/M2Crypto/Err.html index 1688939..a41e354 100644 --- a/doc/html/_modules/M2Crypto/Err.html +++ b/doc/html/_modules/M2Crypto/Err.html @@ -1,19 +1,18 @@ - + - + - - + + M2Crypto.Err — M2Crypto documentation - - - - - + + + + + @@ -33,15 +32,14 @@

Source code for M2Crypto.Err

-from __future__ import absolute_import
+from __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
+from M2Crypto import BIO, m2, util, six  # noqa
+from typing import Optional  # noqa
 
 
 
[docs]def get_error(): @@ -64,18 +62,21 @@
[docs]def get_error_lib(err): - # type: (int) -> str - return six.ensure_text(m2.err_lib_error_string(err))
+ # type: (Optional[int]) -> str + err_str = m2.err_lib_error_string(err) + return six.ensure_text(err_str) if err_str else ''
[docs]def get_error_func(err): - # type: (int) -> str - return six.ensure_text(m2.err_func_error_string(err))
+ # type: (Optional[int]) -> str + err_str = m2.err_func_error_string(err) + return six.ensure_text(err_str) if err_str else ''
[docs]def get_error_reason(err): - # type: (int) -> str - return six.ensure_text(m2.err_reason_error_string(err))
+ # type: (Optional[int]) -> str + err_str = m2.err_reason_error_string(err) + return six.ensure_text(err_str) if err_str else ''
[docs]def get_error_message(): @@ -84,17 +85,18 @@
[docs]def get_x509_verify_error(err): - # type: (int) -> str - return six.ensure_text(m2.x509_get_verify_error(err))
+ # type: (Optional[int]) -> str + err_str = m2.x509_get_verify_error(err) + return six.ensure_text(err_str) if err_str else ''
[docs]class SSLError(Exception): - def __init__(self, err, client_addr): + def __init__(self, err, client_addr): # type: (int, util.AddrType) -> None self.err = err self.client_addr = client_addr - def __str__(self): + def __str__(self): # type: () -> str if not isinstance(self.client_addr, six.text_type): s = self.client_addr.decode('utf8') @@ -138,17 +140,15 @@
- + @@ -165,7 +165,7 @@ ©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12
diff --git a/doc/html/_modules/M2Crypto/RSA.html b/doc/html/_modules/M2Crypto/RSA.html index 172316b..49efdfc 100644 --- a/doc/html/_modules/M2Crypto/RSA.html +++ b/doc/html/_modules/M2Crypto/RSA.html @@ -1,19 +1,18 @@ - + - + - - + + M2Crypto.RSA — M2Crypto documentation - - - - - + + + + + @@ -33,7 +32,7 @@

Source code for M2Crypto.RSA

-from __future__ import absolute_import
+from __future__ import absolute_import
 
 """M2Crypto wrapper for OpenSSL RSA API.
 
@@ -41,14 +40,14 @@
 
 import sys
 
-from M2Crypto import BIO, Err, m2, util
-if util.py27plus:
-    from typing import Any, AnyStr, Callable, Dict, List, IO, Optional, Tuple  # noqa
+from M2Crypto import BIO, Err, m2, util
+from typing import Any, AnyStr, Callable, IO, Optional, Tuple  # noqa
 
 
 
[docs]class RSAError(Exception): pass
+ m2.rsa_init(RSAError) no_padding = m2.no_padding @@ -64,7 +63,7 @@ m2_rsa_free = m2.rsa_free - def __init__(self, rsa, _pyfree=0): + def __init__(self, rsa, _pyfree=0): # type: (bytes, int) -> None """ :param rsa: binary representation of OpenSSL RSA type @@ -73,16 +72,16 @@ self.rsa = rsa self._pyfree = _pyfree - def __del__(self): + def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_rsa_free(self.rsa) - def __len__(self): + def __len__(self): # type: () -> int return int(m2.rsa_size(self.rsa) << 3) - def __getattr__(self, name): + def __getattr__(self, name): # type: (str) -> bytes if name == 'e': return m2.rsa_get_e(self.rsa) @@ -325,7 +324,7 @@ Object interface to an RSA public key. """ - def __setattr__(self, name, value): + 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)') @@ -531,17 +530,15 @@
- + @@ -558,7 +555,7 @@ ©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12
diff --git a/doc/html/_modules/M2Crypto/SSL/Cipher.html b/doc/html/_modules/M2Crypto/SSL/Cipher.html index d9a39b4..5206169 100644 --- a/doc/html/_modules/M2Crypto/SSL/Cipher.html +++ b/doc/html/_modules/M2Crypto/SSL/Cipher.html @@ -1,19 +1,18 @@ - + - + - - + + M2Crypto.SSL.Cipher — M2Crypto documentation - - - - - + + + + + @@ -39,25 +38,24 @@ __all__ = ['Cipher', 'Cipher_Stack'] -from M2Crypto import m2, py27plus, six -if py27plus: - from typing import Iterable # noqa +from M2Crypto import m2, six +from typing import Iterable # noqa
[docs]class Cipher(object): - def __init__(self, cipher): + def __init__(self, cipher): # type: (str) -> None self.cipher = cipher - def __len__(self): + def __len__(self): # type: () -> int return m2.ssl_cipher_get_bits(self.cipher) - def __repr__(self): + def __repr__(self): # type: () -> str return "%s-%s" % (self.name(), len(self)) - def __str__(self): + def __str__(self): # type: () -> str return "%s-%s" % (self.name(), len(self)) @@ -71,25 +69,25 @@
[docs]class Cipher_Stack(object): - def __init__(self, stack): + def __init__(self, stack): # type: (bytes) -> None """ :param stack: binary of the C-type STACK_OF(SSL_CIPHER) """ self.stack = stack - def __len__(self): + def __len__(self): # type: () -> int return m2.sk_ssl_cipher_num(self.stack) - def __getitem__(self, idx): + 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): + def __iter__(self): # type: () -> Iterable for i in six.moves.range(m2.sk_ssl_cipher_num(self.stack)): yield self[i]
@@ -120,24 +118,20 @@
- + @@ -154,7 +148,7 @@ ©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12
diff --git a/doc/html/_modules/M2Crypto/SSL/Context.html b/doc/html/_modules/M2Crypto/SSL/Context.html index f61a146..21ccdc7 100644 --- a/doc/html/_modules/M2Crypto/SSL/Context.html +++ b/doc/html/_modules/M2Crypto/SSL/Context.html @@ -1,19 +1,18 @@ - + - + - - + + M2Crypto.SSL.Context — M2Crypto documentation - - - - - + + + + + @@ -33,18 +32,17 @@

Source code for M2Crypto.SSL.Context

-from __future__ import absolute_import
+from __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
+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
+from typing import Any, AnyStr, Callable, Optional, Union  # noqa
 
 __all__ = ['ctxmap', 'Context', 'map']
 
@@ -52,21 +50,21 @@
 class _ctxmap(object):
     singleton = None  # type: Optional[_ctxmap]
 
-    def __init__(self):
+    def __init__(self):
         # type: () -> None
         """Simple WeakReffed list.
         """
         self._ctxmap = WeakValueDictionary()
 
-    def __getitem__(self, key):
+    def __getitem__(self, key):
         # type: (int) -> Any
         return self._ctxmap[key]
 
-    def __setitem__(self, key, value):
+    def __setitem__(self, key, value):
         # type: (int, Any) -> None
         self._ctxmap[key] = value
 
-    def __delitem__(self, key):
+    def __delitem__(self, key):
         # type: (int) -> None
         del self._ctxmap[key]
 
@@ -86,7 +84,7 @@
 
     m2_ssl_ctx_free = m2.ssl_ctx_free
 
-    def __init__(self, protocol='tls', weak_crypto=None,
+    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)
@@ -105,7 +103,7 @@
             self.set_options(m2.SSL_OP_ALL | m2.SSL_OP_NO_SSLv2 |
                              m2.SSL_OP_NO_SSLv3)
 
-    def __del__(self):
+    def __del__(self):
         # type: () -> None
         if getattr(self, 'ctx', None):
             self.m2_ssl_ctx_free(self.ctx)
@@ -506,24 +504,20 @@
 
 
- + @@ -540,7 +534,7 @@ ©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12
diff --git a/doc/html/_modules/M2Crypto/SSL/Session.html b/doc/html/_modules/M2Crypto/SSL/Session.html index d22a29c..d0c4435 100644 --- a/doc/html/_modules/M2Crypto/SSL/Session.html +++ b/doc/html/_modules/M2Crypto/SSL/Session.html @@ -1,19 +1,18 @@ - + - + - - + + M2Crypto.SSL.Session — M2Crypto documentation - - - - - + + + + + @@ -39,23 +38,22 @@ __all__ = ['Session', 'load_session'] -from M2Crypto import BIO, Err, m2, util -from M2Crypto.SSL import SSLError -if util.py27plus: - from typing import AnyStr # noqa +from M2Crypto import BIO, Err, m2 +from M2Crypto.SSL import SSLError +from typing import AnyStr # noqa
[docs]class Session(object): m2_ssl_session_free = m2.ssl_session_free - def __init__(self, session, _pyfree=0): + def __init__(self, session, _pyfree=0): # type: (bytes, int) -> None assert session is not None self.session = session self._pyfree = _pyfree - def __del__(self): + def __del__(self): # type: () -> None if getattr(self, '_pyfree', 0): self.m2_ssl_session_free(self.session) @@ -130,24 +128,20 @@
- + @@ -164,7 +158,7 @@ ©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12
diff --git a/doc/html/_modules/M2Crypto/SSL/cb.html b/doc/html/_modules/M2Crypto/SSL/cb.html index 0e7c20f..1eaa457 100644 --- a/doc/html/_modules/M2Crypto/SSL/cb.html +++ b/doc/html/_modules/M2Crypto/SSL/cb.html @@ -1,19 +1,18 @@ - + - + - - + + M2Crypto.SSL.cb — M2Crypto documentation - - - - - + + + + + @@ -33,7 +32,7 @@

Source code for M2Crypto.SSL.cb

-from __future__ import absolute_import
+from __future__ import absolute_import
 
 """SSL callbacks
 
@@ -41,9 +40,8 @@
 
 import sys
 
-from M2Crypto import m2, util
-if util.py27plus:
-    from typing import Any, List  # noqa
+from M2Crypto import m2
+from typing import Any  # noqa
 
 __all__ = ['unknown_issuer', 'ssl_verify_callback_stub', 'ssl_verify_callback',
            'ssl_verify_callback_allow_unknown_ca', 'ssl_info_callback']
@@ -53,6 +51,7 @@
     # Deprecated
     return ok
+ unknown_issuer = [ m2.X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT, m2.X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY, @@ -65,7 +64,7 @@ # type: (bytes, bytes, int, int, int) -> int # Deprecated - from M2Crypto.SSL.Context import Context + 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(): @@ -156,24 +155,20 @@
- + @@ -190,7 +185,7 @@ ©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12
diff --git a/doc/html/_modules/M2Crypto/util.html b/doc/html/_modules/M2Crypto/util.html index 3cd7461..c92cf20 100644 --- a/doc/html/_modules/M2Crypto/util.html +++ b/doc/html/_modules/M2Crypto/util.html @@ -1,19 +1,18 @@ - + - + - - + + M2Crypto.util — M2Crypto documentation - - - - - + + + + + @@ -33,7 +32,7 @@

Source code for M2Crypto.util

-from __future__ import absolute_import
+from __future__ import absolute_import
 """
     M2Crypto utility routines.
 
@@ -47,14 +46,14 @@
 """
 
 import binascii
+import io
 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]
+from M2Crypto import m2, six
+from typing import Any, Optional, Tuple, Union  # noqa
+# see https://github.com/python/typeshed/issues/222
+AddrType = Union[Tuple[str, int], str]
 
 log = logging.getLogger('util')
 
@@ -62,6 +61,7 @@
 
[docs]class UtilError(Exception): pass
+ m2.util_init(UtilError) @@ -90,7 +90,7 @@
[docs]def genparam_callback(p, n, out=sys.stdout): - # type: (int, Any, file) -> None + # type: (int, Any, io.IOBase) -> None ch = ['.', '+', '*', '\n'] out.write(ch[p]) out.flush()
@@ -104,7 +104,7 @@
[docs]def passphrase_callback(v, prompt1='Enter passphrase:', prompt2='Verify passphrase:'): # type: (bool, str, str) -> Optional[str] - from getpass import getpass + from getpass import getpass while 1: try: p1 = getpass(prompt1) @@ -154,17 +154,15 @@
- + @@ -181,7 +179,7 @@ ©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12
diff --git a/doc/html/_modules/index.html b/doc/html/_modules/index.html index 56bc7ef..f6b2fe8 100644 --- a/doc/html/_modules/index.html +++ b/doc/html/_modules/index.html @@ -1,19 +1,18 @@ - + - + - - + + Overview: module code — M2Crypto documentation - - - - - + + + + + @@ -33,41 +32,15 @@ @@ -98,17 +71,15 @@
- + @@ -125,7 +96,7 @@ ©2017, Matej Cepl . | - Powered by Sphinx 1.8.5 + Powered by Sphinx 3.2.1 & Alabaster 0.7.12
diff --git a/doc/html/_static/basic.css b/doc/html/_static/basic.css index 0807176..24bc73e 100644 --- a/doc/html/_static/basic.css +++ b/doc/html/_static/basic.css @@ -4,7 +4,7 @@ * * Sphinx stylesheet -- basic theme. * - * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -15,6 +15,12 @@ div.clearer { clear: both; } +div.section::after { + display: block; + content: ''; + clear: left; +} + /* -- relbar ---------------------------------------------------------------- */ div.related { @@ -231,6 +237,16 @@ a.headerlink { visibility: hidden; } +a.brackets:before, +span.brackets > a:before{ + content: "["; +} + +a.brackets:after, +span.brackets > a:after { + content: "]"; +} + h1:hover > a.headerlink, h2:hover > a.headerlink, h3:hover > a.headerlink, @@ -279,6 +295,12 @@ img.align-center, .figure.align-center, object.align-center { margin-right: auto; } +img.align-default, .figure.align-default { + display: block; + margin-left: auto; + margin-right: auto; +} + .align-left { text-align: left; } @@ -287,6 +309,10 @@ img.align-center, .figure.align-center, object.align-center { text-align: center; } +.align-default { + text-align: center; +} + .align-right { text-align: right; } @@ -296,21 +322,27 @@ img.align-center, .figure.align-center, object.align-center { div.sidebar { margin: 0 0 0.5em 1em; border: 1px solid #ddb; - padding: 7px 7px 0 7px; + padding: 7px; background-color: #ffe; width: 40%; float: right; + clear: right; + overflow-x: auto; } p.sidebar-title { font-weight: bold; } +div.admonition, div.topic, blockquote { + clear: left; +} + /* -- topics ---------------------------------------------------------------- */ div.topic { border: 1px solid #ccc; - padding: 7px 7px 0 7px; + padding: 7px; margin: 10px 0 10px 0; } @@ -332,10 +364,6 @@ div.admonition dt { font-weight: bold; } -div.admonition dl { - margin-bottom: 0; -} - p.admonition-title { margin: 0px 10px 5px 0px; font-weight: bold; @@ -346,9 +374,28 @@ div.body p.centered { margin-top: 25px; } +/* -- content of sidebars/topics/admonitions -------------------------------- */ + +div.sidebar > :last-child, +div.topic > :last-child, +div.admonition > :last-child { + margin-bottom: 0; +} + +div.sidebar::after, +div.topic::after, +div.admonition::after, +blockquote::after { + display: block; + content: ''; + clear: both; +} + /* -- tables ---------------------------------------------------------------- */ table.docutils { + margin-top: 10px; + margin-bottom: 10px; border: 0; border-collapse: collapse; } @@ -358,6 +405,11 @@ table.align-center { margin-right: auto; } +table.align-default { + margin-left: auto; + margin-right: auto; +} + table caption span.caption-number { font-style: italic; } @@ -391,6 +443,16 @@ table.citation td { border-bottom: none; } +th > :first-child, +td > :first-child { + margin-top: 0px; +} + +th > :last-child, +td > :last-child { + margin-bottom: 0px; +} + /* -- figures --------------------------------------------------------------- */ div.figure { @@ -433,6 +495,10 @@ table.field-list td, table.field-list th { /* -- hlist styles ---------------------------------------------------------- */ +table.hlist { + margin: 1em 0; +} + table.hlist td { vertical-align: top; } @@ -460,11 +526,78 @@ ol.upperroman { list-style: upper-roman; } +:not(li) > ol > li:first-child > :first-child, +:not(li) > ul > li:first-child > :first-child { + margin-top: 0px; +} + +:not(li) > ol > li:last-child > :last-child, +:not(li) > ul > li:last-child > :last-child { + margin-bottom: 0px; +} + +ol.simple ol p, +ol.simple ul p, +ul.simple ol p, +ul.simple ul p { + margin-top: 0; +} + +ol.simple > li:not(:first-child) > p, +ul.simple > li:not(:first-child) > p { + margin-top: 0; +} + +ol.simple p, +ul.simple p { + margin-bottom: 0; +} + +dl.footnote > dt, +dl.citation > dt { + float: left; + margin-right: 0.5em; +} + +dl.footnote > dd, +dl.citation > dd { + margin-bottom: 0em; +} + +dl.footnote > dd:after, +dl.citation > dd:after { + content: ""; + clear: both; +} + +dl.field-list { + display: grid; + grid-template-columns: fit-content(30%) auto; +} + +dl.field-list > dt { + font-weight: bold; + word-break: break-word; + padding-left: 0.5em; + padding-right: 5px; +} + +dl.field-list > dt:after { + content: ":"; +} + +dl.field-list > dd { + padding-left: 0.5em; + margin-top: 0em; + margin-left: 0em; + margin-bottom: 0em; +} + dl { margin-bottom: 15px; } -dd p { +dd > :first-child { margin-top: 0px; } @@ -478,6 +611,11 @@ dd { margin-left: 30px; } +dl > dd:last-child, +dl > dd:last-child > :last-child { + margin-bottom: 0; +} + dt:target, span.highlighted { background-color: #fbe54e; } @@ -537,6 +675,12 @@ dl.glossary dt { font-style: oblique; } +.classifier:before { + font-style: normal; + margin: 0.5em; + content: ":"; +} + abbr, acronym { border-bottom: dotted 1px; cursor: help; @@ -549,6 +693,10 @@ pre { overflow-y: hidden; /* fixes display issues on Chrome browsers */ } +pre, div[class*="highlight-"] { + clear: both; +} + span.pre { -moz-hyphens: none; -ms-hyphens: none; @@ -556,22 +704,57 @@ span.pre { hyphens: none; } +div[class*="highlight-"] { + margin: 1em 0; +} + td.linenos pre { - padding: 5px 0px; border: 0; background-color: transparent; color: #aaa; } table.highlighttable { - margin-left: 0.5em; + display: block; +} + +table.highlighttable tbody { + display: block; +} + +table.highlighttable tr { + display: flex; } table.highlighttable td { - padding: 0 0.5em 0 0.5em; + margin: 0; + padding: 0; +} + +table.highlighttable td.linenos { + padding-right: 0.5em; +} + +table.highlighttable td.code { + flex: 1; + overflow: hidden; +} + +.highlight .hll { + display: block; +} + +div.highlight pre, +table.highlighttable pre { + margin: 0; +} + +div.code-block-caption + div { + margin-top: 0; } div.code-block-caption { + margin-top: 1em; padding: 2px 5px; font-size: small; } @@ -580,8 +763,9 @@ div.code-block-caption code { background-color: transparent; } -div.code-block-caption + div > div.highlight > pre { - margin-top: 0; +table.highlighttable td.linenos, +div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */ + user-select: none; } div.code-block-caption span.caption-number { @@ -593,11 +777,7 @@ div.code-block-caption span.caption-text { } div.literal-block-wrapper { - padding: 1em 1em 0; -} - -div.literal-block-wrapper div.highlight { - margin: 0; + margin: 1em 0; } code.descname { @@ -648,8 +828,7 @@ span.eqno { } span.eqno a.headerlink { - position: relative; - left: 0px; + position: absolute; z-index: 1; } diff --git a/doc/html/_static/doctools.js b/doc/html/_static/doctools.js index 344db17..daccd20 100644 --- a/doc/html/_static/doctools.js +++ b/doc/html/_static/doctools.js @@ -4,7 +4,7 @@ * * Sphinx JavaScript utilities for all documentation. * - * :copyright: Copyright 2007-2019 by the Sphinx team, see AUTHORS. + * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS. * :license: BSD, see LICENSE for details. * */ @@ -87,14 +87,13 @@ jQuery.fn.highlightText = function(text, className) { node.nextSibling)); node.nodeValue = val.substr(0, pos); if (isInSVG) { - var bbox = span.getBBox(); var rect = document.createElementNS("http://www.w3.org/2000/svg", "rect"); - rect.x.baseVal.value = bbox.x; + var bbox = node.parentElement.getBBox(); + rect.x.baseVal.value = bbox.x; rect.y.baseVal.value = bbox.y; rect.width.baseVal.value = bbox.width; rect.height.baseVal.value = bbox.height; rect.setAttribute('class', className); - var parentOfText = node.parentNode.parentNode; addItems.push({ "parent": node.parentNode, "target": rect}); @@ -284,10 +283,11 @@ var Documentation = { }, initOnKeyListeners: function() { - $(document).keyup(function(event) { + $(document).keydown(function(event) { var activeElementType = document.activeElement.tagName; // don't navigate when in search box or textarea - if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT') { + if (activeElementType !== 'TEXTAREA' && activeElementType !== 'INPUT' && activeElementType !== 'SELECT' + && !event.altKey && !event.ctrlKey && !event.metaKey && !event.shiftKey) { switch (event.keyCode) { case 37: // left var prevHref = $('link[rel="prev"]').prop('href'); diff --git a/doc/html/_static/documentation_options.js b/doc/html/_static/documentation_options.js index d28647e..2fa8c97 100644 --- a/doc/html/_static/documentation_options.js +++ b/doc/html/_static/documentation_options.js @@ -3,8 +3,10 @@ var DOCUMENTATION_OPTIONS = { VERSION: '', LANGUAGE: 'None', COLLAPSE_INDEX: false, + BUILDER: 'html', FILE_SUFFIX: '.html', + LINK_SUFFIX: '.html', HAS_SOURCE: true, SOURCELINK_SUFFIX: '.txt', - NAVIGATION_WITH_KEYS: false, + NAVIGATION_WITH_KEYS: false }; \ No newline at end of file diff --git a/doc/html/_static/jquery-3.5.1.js b/doc/html/_static/jquery-3.5.1.js new file mode 100644 index 0000000..5093733 --- /dev/null +++ b/doc/html/_static/jquery-3.5.1.js @@ -0,0 +1,10872 @@ +/*! + * jQuery JavaScript Library v3.5.1 + * https://jquery.com/ + * + * Includes Sizzle.js + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://jquery.org/license + * + * Date: 2020-05-04T22:49Z + */ +( function( global, factory ) { + + "use strict"; + + if ( typeof module === "object" && typeof module.exports === "object" ) { + + // For CommonJS and CommonJS-like environments where a proper `window` + // is present, execute the factory and get jQuery. + // For environments that do not have a `window` with a `document` + // (such as Node.js), expose a factory as module.exports. + // This accentuates the need for the creation of a real `window`. + // e.g. var jQuery = require("jquery")(window); + // See ticket #14549 for more info. + module.exports = global.document ? + factory( global, true ) : + function( w ) { + if ( !w.document ) { + throw new Error( "jQuery requires a window with a document" ); + } + return factory( w ); + }; + } else { + factory( global ); + } + +// Pass this if window is not defined yet +} )( typeof window !== "undefined" ? window : this, function( window, noGlobal ) { + +// Edge <= 12 - 13+, Firefox <=18 - 45+, IE 10 - 11, Safari 5.1 - 9+, iOS 6 - 9.1 +// throw exceptions when non-strict code (e.g., ASP.NET 4.5) accesses strict mode +// arguments.callee.caller (trac-13335). But as of jQuery 3.0 (2016), strict mode should be common +// enough that all such attempts are guarded in a try block. +"use strict"; + +var arr = []; + +var getProto = Object.getPrototypeOf; + +var slice = arr.slice; + +var flat = arr.flat ? function( array ) { + return arr.flat.call( array ); +} : function( array ) { + return arr.concat.apply( [], array ); +}; + + +var push = arr.push; + +var indexOf = arr.indexOf; + +var class2type = {}; + +var toString = class2type.toString; + +var hasOwn = class2type.hasOwnProperty; + +var fnToString = hasOwn.toString; + +var ObjectFunctionString = fnToString.call( Object ); + +var support = {}; + +var isFunction = function isFunction( obj ) { + + // Support: Chrome <=57, Firefox <=52 + // In some browsers, typeof returns "function" for HTML elements + // (i.e., `typeof document.createElement( "object" ) === "function"`). + // We don't want to classify *any* DOM node as a function. + return typeof obj === "function" && typeof obj.nodeType !== "number"; + }; + + +var isWindow = function isWindow( obj ) { + return obj != null && obj === obj.window; + }; + + +var document = window.document; + + + + var preservedScriptAttributes = { + type: true, + src: true, + nonce: true, + noModule: true + }; + + function DOMEval( code, node, doc ) { + doc = doc || document; + + var i, val, + script = doc.createElement( "script" ); + + script.text = code; + if ( node ) { + for ( i in preservedScriptAttributes ) { + + // Support: Firefox 64+, Edge 18+ + // Some browsers don't support the "nonce" property on scripts. + // On the other hand, just using `getAttribute` is not enough as + // the `nonce` attribute is reset to an empty string whenever it + // becomes browsing-context connected. + // See https://github.com/whatwg/html/issues/2369 + // See https://html.spec.whatwg.org/#nonce-attributes + // The `node.getAttribute` check was added for the sake of + // `jQuery.globalEval` so that it can fake a nonce-containing node + // via an object. + val = node[ i ] || node.getAttribute && node.getAttribute( i ); + if ( val ) { + script.setAttribute( i, val ); + } + } + } + doc.head.appendChild( script ).parentNode.removeChild( script ); + } + + +function toType( obj ) { + if ( obj == null ) { + return obj + ""; + } + + // Support: Android <=2.3 only (functionish RegExp) + return typeof obj === "object" || typeof obj === "function" ? + class2type[ toString.call( obj ) ] || "object" : + typeof obj; +} +/* global Symbol */ +// Defining this global in .eslintrc.json would create a danger of using the global +// unguarded in another place, it seems safer to define global only for this module + + + +var + version = "3.5.1", + + // Define a local copy of jQuery + jQuery = function( selector, context ) { + + // The jQuery object is actually just the init constructor 'enhanced' + // Need init if jQuery is called (just allow error to be thrown if not included) + return new jQuery.fn.init( selector, context ); + }; + +jQuery.fn = jQuery.prototype = { + + // The current version of jQuery being used + jquery: version, + + constructor: jQuery, + + // The default length of a jQuery object is 0 + length: 0, + + toArray: function() { + return slice.call( this ); + }, + + // Get the Nth element in the matched element set OR + // Get the whole matched element set as a clean array + get: function( num ) { + + // Return all the elements in a clean array + if ( num == null ) { + return slice.call( this ); + } + + // Return just the one element from the set + return num < 0 ? this[ num + this.length ] : this[ num ]; + }, + + // Take an array of elements and push it onto the stack + // (returning the new matched element set) + pushStack: function( elems ) { + + // Build a new jQuery matched element set + var ret = jQuery.merge( this.constructor(), elems ); + + // Add the old object onto the stack (as a reference) + ret.prevObject = this; + + // Return the newly-formed element set + return ret; + }, + + // Execute a callback for every element in the matched set. + each: function( callback ) { + return jQuery.each( this, callback ); + }, + + map: function( callback ) { + return this.pushStack( jQuery.map( this, function( elem, i ) { + return callback.call( elem, i, elem ); + } ) ); + }, + + slice: function() { + return this.pushStack( slice.apply( this, arguments ) ); + }, + + first: function() { + return this.eq( 0 ); + }, + + last: function() { + return this.eq( -1 ); + }, + + even: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return ( i + 1 ) % 2; + } ) ); + }, + + odd: function() { + return this.pushStack( jQuery.grep( this, function( _elem, i ) { + return i % 2; + } ) ); + }, + + eq: function( i ) { + var len = this.length, + j = +i + ( i < 0 ? len : 0 ); + return this.pushStack( j >= 0 && j < len ? [ this[ j ] ] : [] ); + }, + + end: function() { + return this.prevObject || this.constructor(); + }, + + // For internal use only. + // Behaves like an Array's method, not like a jQuery method. + push: push, + sort: arr.sort, + splice: arr.splice +}; + +jQuery.extend = jQuery.fn.extend = function() { + var options, name, src, copy, copyIsArray, clone, + target = arguments[ 0 ] || {}, + i = 1, + length = arguments.length, + deep = false; + + // Handle a deep copy situation + if ( typeof target === "boolean" ) { + deep = target; + + // Skip the boolean and the target + target = arguments[ i ] || {}; + i++; + } + + // Handle case when target is a string or something (possible in deep copy) + if ( typeof target !== "object" && !isFunction( target ) ) { + target = {}; + } + + // Extend jQuery itself if only one argument is passed + if ( i === length ) { + target = this; + i--; + } + + for ( ; i < length; i++ ) { + + // Only deal with non-null/undefined values + if ( ( options = arguments[ i ] ) != null ) { + + // Extend the base object + for ( name in options ) { + copy = options[ name ]; + + // Prevent Object.prototype pollution + // Prevent never-ending loop + if ( name === "__proto__" || target === copy ) { + continue; + } + + // Recurse if we're merging plain objects or arrays + if ( deep && copy && ( jQuery.isPlainObject( copy ) || + ( copyIsArray = Array.isArray( copy ) ) ) ) { + src = target[ name ]; + + // Ensure proper type for the source value + if ( copyIsArray && !Array.isArray( src ) ) { + clone = []; + } else if ( !copyIsArray && !jQuery.isPlainObject( src ) ) { + clone = {}; + } else { + clone = src; + } + copyIsArray = false; + + // Never move original objects, clone them + target[ name ] = jQuery.extend( deep, clone, copy ); + + // Don't bring in undefined values + } else if ( copy !== undefined ) { + target[ name ] = copy; + } + } + } + } + + // Return the modified object + return target; +}; + +jQuery.extend( { + + // Unique for each copy of jQuery on the page + expando: "jQuery" + ( version + Math.random() ).replace( /\D/g, "" ), + + // Assume jQuery is ready without the ready module + isReady: true, + + error: function( msg ) { + throw new Error( msg ); + }, + + noop: function() {}, + + isPlainObject: function( obj ) { + var proto, Ctor; + + // Detect obvious negatives + // Use toString instead of jQuery.type to catch host objects + if ( !obj || toString.call( obj ) !== "[object Object]" ) { + return false; + } + + proto = getProto( obj ); + + // Objects with no prototype (e.g., `Object.create( null )`) are plain + if ( !proto ) { + return true; + } + + // Objects with prototype are plain iff they were constructed by a global Object function + Ctor = hasOwn.call( proto, "constructor" ) && proto.constructor; + return typeof Ctor === "function" && fnToString.call( Ctor ) === ObjectFunctionString; + }, + + isEmptyObject: function( obj ) { + var name; + + for ( name in obj ) { + return false; + } + return true; + }, + + // Evaluates a script in a provided context; falls back to the global one + // if not specified. + globalEval: function( code, options, doc ) { + DOMEval( code, { nonce: options && options.nonce }, doc ); + }, + + each: function( obj, callback ) { + var length, i = 0; + + if ( isArrayLike( obj ) ) { + length = obj.length; + for ( ; i < length; i++ ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } else { + for ( i in obj ) { + if ( callback.call( obj[ i ], i, obj[ i ] ) === false ) { + break; + } + } + } + + return obj; + }, + + // results is for internal usage only + makeArray: function( arr, results ) { + var ret = results || []; + + if ( arr != null ) { + if ( isArrayLike( Object( arr ) ) ) { + jQuery.merge( ret, + typeof arr === "string" ? + [ arr ] : arr + ); + } else { + push.call( ret, arr ); + } + } + + return ret; + }, + + inArray: function( elem, arr, i ) { + return arr == null ? -1 : indexOf.call( arr, elem, i ); + }, + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + merge: function( first, second ) { + var len = +second.length, + j = 0, + i = first.length; + + for ( ; j < len; j++ ) { + first[ i++ ] = second[ j ]; + } + + first.length = i; + + return first; + }, + + grep: function( elems, callback, invert ) { + var callbackInverse, + matches = [], + i = 0, + length = elems.length, + callbackExpect = !invert; + + // Go through the array, only saving the items + // that pass the validator function + for ( ; i < length; i++ ) { + callbackInverse = !callback( elems[ i ], i ); + if ( callbackInverse !== callbackExpect ) { + matches.push( elems[ i ] ); + } + } + + return matches; + }, + + // arg is for internal usage only + map: function( elems, callback, arg ) { + var length, value, + i = 0, + ret = []; + + // Go through the array, translating each of the items to their new values + if ( isArrayLike( elems ) ) { + length = elems.length; + for ( ; i < length; i++ ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + + // Go through every key on the object, + } else { + for ( i in elems ) { + value = callback( elems[ i ], i, arg ); + + if ( value != null ) { + ret.push( value ); + } + } + } + + // Flatten any nested arrays + return flat( ret ); + }, + + // A global GUID counter for objects + guid: 1, + + // jQuery.support is not used in Core but other projects attach their + // properties to it so it needs to exist. + support: support +} ); + +if ( typeof Symbol === "function" ) { + jQuery.fn[ Symbol.iterator ] = arr[ Symbol.iterator ]; +} + +// Populate the class2type map +jQuery.each( "Boolean Number String Function Array Date RegExp Object Error Symbol".split( " " ), +function( _i, name ) { + class2type[ "[object " + name + "]" ] = name.toLowerCase(); +} ); + +function isArrayLike( obj ) { + + // Support: real iOS 8.2 only (not reproducible in simulator) + // `in` check used to prevent JIT error (gh-2145) + // hasOwn isn't used here due to false negatives + // regarding Nodelist length in IE + var length = !!obj && "length" in obj && obj.length, + type = toType( obj ); + + if ( isFunction( obj ) || isWindow( obj ) ) { + return false; + } + + return type === "array" || length === 0 || + typeof length === "number" && length > 0 && ( length - 1 ) in obj; +} +var Sizzle = +/*! + * Sizzle CSS Selector Engine v2.3.5 + * https://sizzlejs.com/ + * + * Copyright JS Foundation and other contributors + * Released under the MIT license + * https://js.foundation/ + * + * Date: 2020-03-14 + */ +( function( window ) { +var i, + support, + Expr, + getText, + isXML, + tokenize, + compile, + select, + outermostContext, + sortInput, + hasDuplicate, + + // Local document vars + setDocument, + document, + docElem, + documentIsHTML, + rbuggyQSA, + rbuggyMatches, + matches, + contains, + + // Instance-specific data + expando = "sizzle" + 1 * new Date(), + preferredDoc = window.document, + dirruns = 0, + done = 0, + classCache = createCache(), + tokenCache = createCache(), + compilerCache = createCache(), + nonnativeSelectorCache = createCache(), + sortOrder = function( a, b ) { + if ( a === b ) { + hasDuplicate = true; + } + return 0; + }, + + // Instance methods + hasOwn = ( {} ).hasOwnProperty, + arr = [], + pop = arr.pop, + pushNative = arr.push, + push = arr.push, + slice = arr.slice, + + // Use a stripped-down indexOf as it's faster than native + // https://jsperf.com/thor-indexof-vs-for/5 + indexOf = function( list, elem ) { + var i = 0, + len = list.length; + for ( ; i < len; i++ ) { + if ( list[ i ] === elem ) { + return i; + } + } + return -1; + }, + + booleans = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|" + + "ismap|loop|multiple|open|readonly|required|scoped", + + // Regular expressions + + // http://www.w3.org/TR/css3-selectors/#whitespace + whitespace = "[\\x20\\t\\r\\n\\f]", + + // https://www.w3.org/TR/css-syntax-3/#ident-token-diagram + identifier = "(?:\\\\[\\da-fA-F]{1,6}" + whitespace + + "?|\\\\[^\\r\\n\\f]|[\\w-]|[^\0-\\x7f])+", + + // Attribute selectors: http://www.w3.org/TR/selectors/#attribute-selectors + attributes = "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace + + + // Operator (capture 2) + "*([*^$|!~]?=)" + whitespace + + + // "Attribute values must be CSS identifiers [capture 5] + // or strings [capture 3 or capture 4]" + "*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" + + whitespace + "*\\]", + + pseudos = ":(" + identifier + ")(?:\\((" + + + // To reduce the number of selectors needing tokenize in the preFilter, prefer arguments: + // 1. quoted (capture 3; capture 4 or capture 5) + "('((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\")|" + + + // 2. simple (capture 6) + "((?:\\\\.|[^\\\\()[\\]]|" + attributes + ")*)|" + + + // 3. anything else (capture 2) + ".*" + + ")\\)|)", + + // Leading and non-escaped trailing whitespace, capturing some non-whitespace characters preceding the latter + rwhitespace = new RegExp( whitespace + "+", "g" ), + rtrim = new RegExp( "^" + whitespace + "+|((?:^|[^\\\\])(?:\\\\.)*)" + + whitespace + "+$", "g" ), + + rcomma = new RegExp( "^" + whitespace + "*," + whitespace + "*" ), + rcombinators = new RegExp( "^" + whitespace + "*([>+~]|" + whitespace + ")" + whitespace + + "*" ), + rdescend = new RegExp( whitespace + "|>" ), + + rpseudo = new RegExp( pseudos ), + ridentifier = new RegExp( "^" + identifier + "$" ), + + matchExpr = { + "ID": new RegExp( "^#(" + identifier + ")" ), + "CLASS": new RegExp( "^\\.(" + identifier + ")" ), + "TAG": new RegExp( "^(" + identifier + "|[*])" ), + "ATTR": new RegExp( "^" + attributes ), + "PSEUDO": new RegExp( "^" + pseudos ), + "CHILD": new RegExp( "^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + + whitespace + "*(even|odd|(([+-]|)(\\d*)n|)" + whitespace + "*(?:([+-]|)" + + whitespace + "*(\\d+)|))" + whitespace + "*\\)|)", "i" ), + "bool": new RegExp( "^(?:" + booleans + ")$", "i" ), + + // For use in libraries implementing .is() + // We use this for POS matching in `select` + "needsContext": new RegExp( "^" + whitespace + + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + whitespace + + "*((?:-\\d)?\\d*)" + whitespace + "*\\)|)(?=[^-]|$)", "i" ) + }, + + rhtml = /HTML$/i, + rinputs = /^(?:input|select|textarea|button)$/i, + rheader = /^h\d$/i, + + rnative = /^[^{]+\{\s*\[native \w/, + + // Easily-parseable/retrievable ID or TAG or CLASS selectors + rquickExpr = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, + + rsibling = /[+~]/, + + // CSS escapes + // http://www.w3.org/TR/CSS21/syndata.html#escaped-characters + runescape = new RegExp( "\\\\[\\da-fA-F]{1,6}" + whitespace + "?|\\\\([^\\r\\n\\f])", "g" ), + funescape = function( escape, nonHex ) { + var high = "0x" + escape.slice( 1 ) - 0x10000; + + return nonHex ? + + // Strip the backslash prefix from a non-hex escape sequence + nonHex : + + // Replace a hexadecimal escape sequence with the encoded Unicode code point + // Support: IE <=11+ + // For values outside the Basic Multilingual Plane (BMP), manually construct a + // surrogate pair + high < 0 ? + String.fromCharCode( high + 0x10000 ) : + String.fromCharCode( high >> 10 | 0xD800, high & 0x3FF | 0xDC00 ); + }, + + // CSS string/identifier serialization + // https://drafts.csswg.org/cssom/#common-serializing-idioms + rcssescape = /([\0-\x1f\x7f]|^-?\d)|^-$|[^\0-\x1f\x7f-\uFFFF\w-]/g, + fcssescape = function( ch, asCodePoint ) { + if ( asCodePoint ) { + + // U+0000 NULL becomes U+FFFD REPLACEMENT CHARACTER + if ( ch === "\0" ) { + return "\uFFFD"; + } + + // Control characters and (dependent upon position) numbers get escaped as code points + return ch.slice( 0, -1 ) + "\\" + + ch.charCodeAt( ch.length - 1 ).toString( 16 ) + " "; + } + + // Other potentially-special ASCII characters get backslash-escaped + return "\\" + ch; + }, + + // Used for iframes + // See setDocument() + // Removing the function wrapper causes a "Permission Denied" + // error in IE + unloadHandler = function() { + setDocument(); + }, + + inDisabledFieldset = addCombinator( + function( elem ) { + return elem.disabled === true && elem.nodeName.toLowerCase() === "fieldset"; + }, + { dir: "parentNode", next: "legend" } + ); + +// Optimize for push.apply( _, NodeList ) +try { + push.apply( + ( arr = slice.call( preferredDoc.childNodes ) ), + preferredDoc.childNodes + ); + + // Support: Android<4.0 + // Detect silently failing push.apply + // eslint-disable-next-line no-unused-expressions + arr[ preferredDoc.childNodes.length ].nodeType; +} catch ( e ) { + push = { apply: arr.length ? + + // Leverage slice if possible + function( target, els ) { + pushNative.apply( target, slice.call( els ) ); + } : + + // Support: IE<9 + // Otherwise append directly + function( target, els ) { + var j = target.length, + i = 0; + + // Can't trust NodeList.length + while ( ( target[ j++ ] = els[ i++ ] ) ) {} + target.length = j - 1; + } + }; +} + +function Sizzle( selector, context, results, seed ) { + var m, i, elem, nid, match, groups, newSelector, + newContext = context && context.ownerDocument, + + // nodeType defaults to 9, since context defaults to document + nodeType = context ? context.nodeType : 9; + + results = results || []; + + // Return early from calls with invalid selector or context + if ( typeof selector !== "string" || !selector || + nodeType !== 1 && nodeType !== 9 && nodeType !== 11 ) { + + return results; + } + + // Try to shortcut find operations (as opposed to filters) in HTML documents + if ( !seed ) { + setDocument( context ); + context = context || document; + + if ( documentIsHTML ) { + + // If the selector is sufficiently simple, try using a "get*By*" DOM method + // (excepting DocumentFragment context, where the methods don't exist) + if ( nodeType !== 11 && ( match = rquickExpr.exec( selector ) ) ) { + + // ID selector + if ( ( m = match[ 1 ] ) ) { + + // Document context + if ( nodeType === 9 ) { + if ( ( elem = context.getElementById( m ) ) ) { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( elem.id === m ) { + results.push( elem ); + return results; + } + } else { + return results; + } + + // Element context + } else { + + // Support: IE, Opera, Webkit + // TODO: identify versions + // getElementById can match elements by name instead of ID + if ( newContext && ( elem = newContext.getElementById( m ) ) && + contains( context, elem ) && + elem.id === m ) { + + results.push( elem ); + return results; + } + } + + // Type selector + } else if ( match[ 2 ] ) { + push.apply( results, context.getElementsByTagName( selector ) ); + return results; + + // Class selector + } else if ( ( m = match[ 3 ] ) && support.getElementsByClassName && + context.getElementsByClassName ) { + + push.apply( results, context.getElementsByClassName( m ) ); + return results; + } + } + + // Take advantage of querySelectorAll + if ( support.qsa && + !nonnativeSelectorCache[ selector + " " ] && + ( !rbuggyQSA || !rbuggyQSA.test( selector ) ) && + + // Support: IE 8 only + // Exclude object elements + ( nodeType !== 1 || context.nodeName.toLowerCase() !== "object" ) ) { + + newSelector = selector; + newContext = context; + + // qSA considers elements outside a scoping root when evaluating child or + // descendant combinators, which is not what we want. + // In such cases, we work around the behavior by prefixing every selector in the + // list with an ID selector referencing the scope context. + // The technique has to be used as well when a leading combinator is used + // as such selectors are not recognized by querySelectorAll. + // Thanks to Andrew Dupont for this technique. + if ( nodeType === 1 && + ( rdescend.test( selector ) || rcombinators.test( selector ) ) ) { + + // Expand context for sibling selectors + newContext = rsibling.test( selector ) && testContext( context.parentNode ) || + context; + + // We can use :scope instead of the ID hack if the browser + // supports it & if we're not changing the context. + if ( newContext !== context || !support.scope ) { + + // Capture the context ID, setting it first if necessary + if ( ( nid = context.getAttribute( "id" ) ) ) { + nid = nid.replace( rcssescape, fcssescape ); + } else { + context.setAttribute( "id", ( nid = expando ) ); + } + } + + // Prefix every selector in the list + groups = tokenize( selector ); + i = groups.length; + while ( i-- ) { + groups[ i ] = ( nid ? "#" + nid : ":scope" ) + " " + + toSelector( groups[ i ] ); + } + newSelector = groups.join( "," ); + } + + try { + push.apply( results, + newContext.querySelectorAll( newSelector ) + ); + return results; + } catch ( qsaError ) { + nonnativeSelectorCache( selector, true ); + } finally { + if ( nid === expando ) { + context.removeAttribute( "id" ); + } + } + } + } + } + + // All others + return select( selector.replace( rtrim, "$1" ), context, results, seed ); +} + +/** + * Create key-value caches of limited size + * @returns {function(string, object)} Returns the Object data after storing it on itself with + * property name the (space-suffixed) string and (if the cache is larger than Expr.cacheLength) + * deleting the oldest entry + */ +function createCache() { + var keys = []; + + function cache( key, value ) { + + // Use (key + " ") to avoid collision with native prototype properties (see Issue #157) + if ( keys.push( key + " " ) > Expr.cacheLength ) { + + // Only keep the most recent entries + delete cache[ keys.shift() ]; + } + return ( cache[ key + " " ] = value ); + } + return cache; +} + +/** + * Mark a function for special use by Sizzle + * @param {Function} fn The function to mark + */ +function markFunction( fn ) { + fn[ expando ] = true; + return fn; +} + +/** + * Support testing using an element + * @param {Function} fn Passed the created element and returns a boolean result + */ +function assert( fn ) { + var el = document.createElement( "fieldset" ); + + try { + return !!fn( el ); + } catch ( e ) { + return false; + } finally { + + // Remove from its parent by default + if ( el.parentNode ) { + el.parentNode.removeChild( el ); + } + + // release memory in IE + el = null; + } +} + +/** + * Adds the same handler for all of the specified attrs + * @param {String} attrs Pipe-separated list of attributes + * @param {Function} handler The method that will be applied + */ +function addHandle( attrs, handler ) { + var arr = attrs.split( "|" ), + i = arr.length; + + while ( i-- ) { + Expr.attrHandle[ arr[ i ] ] = handler; + } +} + +/** + * Checks document order of two siblings + * @param {Element} a + * @param {Element} b + * @returns {Number} Returns less than 0 if a precedes b, greater than 0 if a follows b + */ +function siblingCheck( a, b ) { + var cur = b && a, + diff = cur && a.nodeType === 1 && b.nodeType === 1 && + a.sourceIndex - b.sourceIndex; + + // Use IE sourceIndex if available on both nodes + if ( diff ) { + return diff; + } + + // Check if b follows a + if ( cur ) { + while ( ( cur = cur.nextSibling ) ) { + if ( cur === b ) { + return -1; + } + } + } + + return a ? 1 : -1; +} + +/** + * Returns a function to use in pseudos for input types + * @param {String} type + */ +function createInputPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for buttons + * @param {String} type + */ +function createButtonPseudo( type ) { + return function( elem ) { + var name = elem.nodeName.toLowerCase(); + return ( name === "input" || name === "button" ) && elem.type === type; + }; +} + +/** + * Returns a function to use in pseudos for :enabled/:disabled + * @param {Boolean} disabled true for :disabled; false for :enabled + */ +function createDisabledPseudo( disabled ) { + + // Known :disabled false positives: fieldset[disabled] > legend:nth-of-type(n+2) :can-disable + return function( elem ) { + + // Only certain elements can match :enabled or :disabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-enabled + // https://html.spec.whatwg.org/multipage/scripting.html#selector-disabled + if ( "form" in elem ) { + + // Check for inherited disabledness on relevant non-disabled elements: + // * listed form-associated elements in a disabled fieldset + // https://html.spec.whatwg.org/multipage/forms.html#category-listed + // https://html.spec.whatwg.org/multipage/forms.html#concept-fe-disabled + // * option elements in a disabled optgroup + // https://html.spec.whatwg.org/multipage/forms.html#concept-option-disabled + // All such elements have a "form" property. + if ( elem.parentNode && elem.disabled === false ) { + + // Option elements defer to a parent optgroup if present + if ( "label" in elem ) { + if ( "label" in elem.parentNode ) { + return elem.parentNode.disabled === disabled; + } else { + return elem.disabled === disabled; + } + } + + // Support: IE 6 - 11 + // Use the isDisabled shortcut property to check for disabled fieldset ancestors + return elem.isDisabled === disabled || + + // Where there is no isDisabled, check manually + /* jshint -W018 */ + elem.isDisabled !== !disabled && + inDisabledFieldset( elem ) === disabled; + } + + return elem.disabled === disabled; + + // Try to winnow out elements that can't be disabled before trusting the disabled property. + // Some victims get caught in our net (label, legend, menu, track), but it shouldn't + // even exist on them, let alone have a boolean value. + } else if ( "label" in elem ) { + return elem.disabled === disabled; + } + + // Remaining elements are neither :enabled nor :disabled + return false; + }; +} + +/** + * Returns a function to use in pseudos for positionals + * @param {Function} fn + */ +function createPositionalPseudo( fn ) { + return markFunction( function( argument ) { + argument = +argument; + return markFunction( function( seed, matches ) { + var j, + matchIndexes = fn( [], seed.length, argument ), + i = matchIndexes.length; + + // Match elements found at the specified indexes + while ( i-- ) { + if ( seed[ ( j = matchIndexes[ i ] ) ] ) { + seed[ j ] = !( matches[ j ] = seed[ j ] ); + } + } + } ); + } ); +} + +/** + * Checks a node for validity as a Sizzle context + * @param {Element|Object=} context + * @returns {Element|Object|Boolean} The input node if acceptable, otherwise a falsy value + */ +function testContext( context ) { + return context && typeof context.getElementsByTagName !== "undefined" && context; +} + +// Expose support vars for convenience +support = Sizzle.support = {}; + +/** + * Detects XML nodes + * @param {Element|Object} elem An element or a document + * @returns {Boolean} True iff elem is a non-HTML XML node + */ +isXML = Sizzle.isXML = function( elem ) { + var namespace = elem.namespaceURI, + docElem = ( elem.ownerDocument || elem ).documentElement; + + // Support: IE <=8 + // Assume HTML when documentElement doesn't yet exist, such as inside loading iframes + // https://bugs.jquery.com/ticket/4833 + return !rhtml.test( namespace || docElem && docElem.nodeName || "HTML" ); +}; + +/** + * Sets document-related variables once based on the current document + * @param {Element|Object} [doc] An element or document object to use to set the document + * @returns {Object} Returns the current document + */ +setDocument = Sizzle.setDocument = function( node ) { + var hasCompare, subWindow, + doc = node ? node.ownerDocument || node : preferredDoc; + + // Return early if doc is invalid or already selected + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( doc == document || doc.nodeType !== 9 || !doc.documentElement ) { + return document; + } + + // Update global variables + document = doc; + docElem = document.documentElement; + documentIsHTML = !isXML( document ); + + // Support: IE 9 - 11+, Edge 12 - 18+ + // Accessing iframe documents after unload throws "permission denied" errors (jQuery #13936) + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( preferredDoc != document && + ( subWindow = document.defaultView ) && subWindow.top !== subWindow ) { + + // Support: IE 11, Edge + if ( subWindow.addEventListener ) { + subWindow.addEventListener( "unload", unloadHandler, false ); + + // Support: IE 9 - 10 only + } else if ( subWindow.attachEvent ) { + subWindow.attachEvent( "onunload", unloadHandler ); + } + } + + // Support: IE 8 - 11+, Edge 12 - 18+, Chrome <=16 - 25 only, Firefox <=3.6 - 31 only, + // Safari 4 - 5 only, Opera <=11.6 - 12.x only + // IE/Edge & older browsers don't support the :scope pseudo-class. + // Support: Safari 6.0 only + // Safari 6.0 supports :scope but it's an alias of :root there. + support.scope = assert( function( el ) { + docElem.appendChild( el ).appendChild( document.createElement( "div" ) ); + return typeof el.querySelectorAll !== "undefined" && + !el.querySelectorAll( ":scope fieldset div" ).length; + } ); + + /* Attributes + ---------------------------------------------------------------------- */ + + // Support: IE<8 + // Verify that getAttribute really returns attributes and not properties + // (excepting IE8 booleans) + support.attributes = assert( function( el ) { + el.className = "i"; + return !el.getAttribute( "className" ); + } ); + + /* getElement(s)By* + ---------------------------------------------------------------------- */ + + // Check if getElementsByTagName("*") returns only elements + support.getElementsByTagName = assert( function( el ) { + el.appendChild( document.createComment( "" ) ); + return !el.getElementsByTagName( "*" ).length; + } ); + + // Support: IE<9 + support.getElementsByClassName = rnative.test( document.getElementsByClassName ); + + // Support: IE<10 + // Check if getElementById returns elements by name + // The broken getElementById methods don't pick up programmatically-set names, + // so use a roundabout getElementsByName test + support.getById = assert( function( el ) { + docElem.appendChild( el ).id = expando; + return !document.getElementsByName || !document.getElementsByName( expando ).length; + } ); + + // ID filter and find + if ( support.getById ) { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + return elem.getAttribute( "id" ) === attrId; + }; + }; + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var elem = context.getElementById( id ); + return elem ? [ elem ] : []; + } + }; + } else { + Expr.filter[ "ID" ] = function( id ) { + var attrId = id.replace( runescape, funescape ); + return function( elem ) { + var node = typeof elem.getAttributeNode !== "undefined" && + elem.getAttributeNode( "id" ); + return node && node.value === attrId; + }; + }; + + // Support: IE 6 - 7 only + // getElementById is not reliable as a find shortcut + Expr.find[ "ID" ] = function( id, context ) { + if ( typeof context.getElementById !== "undefined" && documentIsHTML ) { + var node, i, elems, + elem = context.getElementById( id ); + + if ( elem ) { + + // Verify the id attribute + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + + // Fall back on getElementsByName + elems = context.getElementsByName( id ); + i = 0; + while ( ( elem = elems[ i++ ] ) ) { + node = elem.getAttributeNode( "id" ); + if ( node && node.value === id ) { + return [ elem ]; + } + } + } + + return []; + } + }; + } + + // Tag + Expr.find[ "TAG" ] = support.getElementsByTagName ? + function( tag, context ) { + if ( typeof context.getElementsByTagName !== "undefined" ) { + return context.getElementsByTagName( tag ); + + // DocumentFragment nodes don't have gEBTN + } else if ( support.qsa ) { + return context.querySelectorAll( tag ); + } + } : + + function( tag, context ) { + var elem, + tmp = [], + i = 0, + + // By happy coincidence, a (broken) gEBTN appears on DocumentFragment nodes too + results = context.getElementsByTagName( tag ); + + // Filter out possible comments + if ( tag === "*" ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem.nodeType === 1 ) { + tmp.push( elem ); + } + } + + return tmp; + } + return results; + }; + + // Class + Expr.find[ "CLASS" ] = support.getElementsByClassName && function( className, context ) { + if ( typeof context.getElementsByClassName !== "undefined" && documentIsHTML ) { + return context.getElementsByClassName( className ); + } + }; + + /* QSA/matchesSelector + ---------------------------------------------------------------------- */ + + // QSA and matchesSelector support + + // matchesSelector(:active) reports false when true (IE9/Opera 11.5) + rbuggyMatches = []; + + // qSa(:focus) reports false when true (Chrome 21) + // We allow this because of a bug in IE8/9 that throws an error + // whenever `document.activeElement` is accessed on an iframe + // So, we allow :focus to pass through QSA all the time to avoid the IE error + // See https://bugs.jquery.com/ticket/13378 + rbuggyQSA = []; + + if ( ( support.qsa = rnative.test( document.querySelectorAll ) ) ) { + + // Build QSA regex + // Regex strategy adopted from Diego Perini + assert( function( el ) { + + var input; + + // Select is set to empty string on purpose + // This is to test IE's treatment of not explicitly + // setting a boolean content attribute, + // since its presence should be enough + // https://bugs.jquery.com/ticket/12359 + docElem.appendChild( el ).innerHTML = "" + + ""; + + // Support: IE8, Opera 11-12.16 + // Nothing should be selected when empty strings follow ^= or $= or *= + // The test attribute must be unknown in Opera but "safe" for WinRT + // https://msdn.microsoft.com/en-us/library/ie/hh465388.aspx#attribute_section + if ( el.querySelectorAll( "[msallowcapture^='']" ).length ) { + rbuggyQSA.push( "[*^$]=" + whitespace + "*(?:''|\"\")" ); + } + + // Support: IE8 + // Boolean attributes and "value" are not treated correctly + if ( !el.querySelectorAll( "[selected]" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*(?:value|" + booleans + ")" ); + } + + // Support: Chrome<29, Android<4.4, Safari<7.0+, iOS<7.0+, PhantomJS<1.9.8+ + if ( !el.querySelectorAll( "[id~=" + expando + "-]" ).length ) { + rbuggyQSA.push( "~=" ); + } + + // Support: IE 11+, Edge 15 - 18+ + // IE 11/Edge don't find elements on a `[name='']` query in some cases. + // Adding a temporary attribute to the document before the selection works + // around the issue. + // Interestingly, IE 10 & older don't seem to have the issue. + input = document.createElement( "input" ); + input.setAttribute( "name", "" ); + el.appendChild( input ); + if ( !el.querySelectorAll( "[name='']" ).length ) { + rbuggyQSA.push( "\\[" + whitespace + "*name" + whitespace + "*=" + + whitespace + "*(?:''|\"\")" ); + } + + // Webkit/Opera - :checked should return selected option elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + // IE8 throws error here and will not see later tests + if ( !el.querySelectorAll( ":checked" ).length ) { + rbuggyQSA.push( ":checked" ); + } + + // Support: Safari 8+, iOS 8+ + // https://bugs.webkit.org/show_bug.cgi?id=136851 + // In-page `selector#id sibling-combinator selector` fails + if ( !el.querySelectorAll( "a#" + expando + "+*" ).length ) { + rbuggyQSA.push( ".#.+[+~]" ); + } + + // Support: Firefox <=3.6 - 5 only + // Old Firefox doesn't throw on a badly-escaped identifier. + el.querySelectorAll( "\\\f" ); + rbuggyQSA.push( "[\\r\\n\\f]" ); + } ); + + assert( function( el ) { + el.innerHTML = "" + + ""; + + // Support: Windows 8 Native Apps + // The type and name attributes are restricted during .innerHTML assignment + var input = document.createElement( "input" ); + input.setAttribute( "type", "hidden" ); + el.appendChild( input ).setAttribute( "name", "D" ); + + // Support: IE8 + // Enforce case-sensitivity of name attribute + if ( el.querySelectorAll( "[name=d]" ).length ) { + rbuggyQSA.push( "name" + whitespace + "*[*^$|!~]?=" ); + } + + // FF 3.5 - :enabled/:disabled and hidden elements (hidden elements are still enabled) + // IE8 throws error here and will not see later tests + if ( el.querySelectorAll( ":enabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: IE9-11+ + // IE's :disabled selector does not pick up the children of disabled fieldsets + docElem.appendChild( el ).disabled = true; + if ( el.querySelectorAll( ":disabled" ).length !== 2 ) { + rbuggyQSA.push( ":enabled", ":disabled" ); + } + + // Support: Opera 10 - 11 only + // Opera 10-11 does not throw on post-comma invalid pseudos + el.querySelectorAll( "*,:x" ); + rbuggyQSA.push( ",.*:" ); + } ); + } + + if ( ( support.matchesSelector = rnative.test( ( matches = docElem.matches || + docElem.webkitMatchesSelector || + docElem.mozMatchesSelector || + docElem.oMatchesSelector || + docElem.msMatchesSelector ) ) ) ) { + + assert( function( el ) { + + // Check to see if it's possible to do matchesSelector + // on a disconnected node (IE 9) + support.disconnectedMatch = matches.call( el, "*" ); + + // This should fail with an exception + // Gecko does not error, returns false instead + matches.call( el, "[s!='']:x" ); + rbuggyMatches.push( "!=", pseudos ); + } ); + } + + rbuggyQSA = rbuggyQSA.length && new RegExp( rbuggyQSA.join( "|" ) ); + rbuggyMatches = rbuggyMatches.length && new RegExp( rbuggyMatches.join( "|" ) ); + + /* Contains + ---------------------------------------------------------------------- */ + hasCompare = rnative.test( docElem.compareDocumentPosition ); + + // Element contains another + // Purposefully self-exclusive + // As in, an element does not contain itself + contains = hasCompare || rnative.test( docElem.contains ) ? + function( a, b ) { + var adown = a.nodeType === 9 ? a.documentElement : a, + bup = b && b.parentNode; + return a === bup || !!( bup && bup.nodeType === 1 && ( + adown.contains ? + adown.contains( bup ) : + a.compareDocumentPosition && a.compareDocumentPosition( bup ) & 16 + ) ); + } : + function( a, b ) { + if ( b ) { + while ( ( b = b.parentNode ) ) { + if ( b === a ) { + return true; + } + } + } + return false; + }; + + /* Sorting + ---------------------------------------------------------------------- */ + + // Document order sorting + sortOrder = hasCompare ? + function( a, b ) { + + // Flag for duplicate removal + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + // Sort on method existence if only one input has compareDocumentPosition + var compare = !a.compareDocumentPosition - !b.compareDocumentPosition; + if ( compare ) { + return compare; + } + + // Calculate position if both inputs belong to the same document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + compare = ( a.ownerDocument || a ) == ( b.ownerDocument || b ) ? + a.compareDocumentPosition( b ) : + + // Otherwise we know they are disconnected + 1; + + // Disconnected nodes + if ( compare & 1 || + ( !support.sortDetached && b.compareDocumentPosition( a ) === compare ) ) { + + // Choose the first element that is related to our preferred document + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( a == document || a.ownerDocument == preferredDoc && + contains( preferredDoc, a ) ) { + return -1; + } + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( b == document || b.ownerDocument == preferredDoc && + contains( preferredDoc, b ) ) { + return 1; + } + + // Maintain original order + return sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + } + + return compare & 4 ? -1 : 1; + } : + function( a, b ) { + + // Exit early if the nodes are identical + if ( a === b ) { + hasDuplicate = true; + return 0; + } + + var cur, + i = 0, + aup = a.parentNode, + bup = b.parentNode, + ap = [ a ], + bp = [ b ]; + + // Parentless nodes are either documents or disconnected + if ( !aup || !bup ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + return a == document ? -1 : + b == document ? 1 : + /* eslint-enable eqeqeq */ + aup ? -1 : + bup ? 1 : + sortInput ? + ( indexOf( sortInput, a ) - indexOf( sortInput, b ) ) : + 0; + + // If the nodes are siblings, we can do a quick check + } else if ( aup === bup ) { + return siblingCheck( a, b ); + } + + // Otherwise we need full lists of their ancestors for comparison + cur = a; + while ( ( cur = cur.parentNode ) ) { + ap.unshift( cur ); + } + cur = b; + while ( ( cur = cur.parentNode ) ) { + bp.unshift( cur ); + } + + // Walk down the tree looking for a discrepancy + while ( ap[ i ] === bp[ i ] ) { + i++; + } + + return i ? + + // Do a sibling check if the nodes have a common ancestor + siblingCheck( ap[ i ], bp[ i ] ) : + + // Otherwise nodes in our document sort first + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + /* eslint-disable eqeqeq */ + ap[ i ] == preferredDoc ? -1 : + bp[ i ] == preferredDoc ? 1 : + /* eslint-enable eqeqeq */ + 0; + }; + + return document; +}; + +Sizzle.matches = function( expr, elements ) { + return Sizzle( expr, null, null, elements ); +}; + +Sizzle.matchesSelector = function( elem, expr ) { + setDocument( elem ); + + if ( support.matchesSelector && documentIsHTML && + !nonnativeSelectorCache[ expr + " " ] && + ( !rbuggyMatches || !rbuggyMatches.test( expr ) ) && + ( !rbuggyQSA || !rbuggyQSA.test( expr ) ) ) { + + try { + var ret = matches.call( elem, expr ); + + // IE 9's matchesSelector returns false on disconnected nodes + if ( ret || support.disconnectedMatch || + + // As well, disconnected nodes are said to be in a document + // fragment in IE 9 + elem.document && elem.document.nodeType !== 11 ) { + return ret; + } + } catch ( e ) { + nonnativeSelectorCache( expr, true ); + } + } + + return Sizzle( expr, document, null, [ elem ] ).length > 0; +}; + +Sizzle.contains = function( context, elem ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( context.ownerDocument || context ) != document ) { + setDocument( context ); + } + return contains( context, elem ); +}; + +Sizzle.attr = function( elem, name ) { + + // Set document vars if needed + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( ( elem.ownerDocument || elem ) != document ) { + setDocument( elem ); + } + + var fn = Expr.attrHandle[ name.toLowerCase() ], + + // Don't get fooled by Object.prototype properties (jQuery #13807) + val = fn && hasOwn.call( Expr.attrHandle, name.toLowerCase() ) ? + fn( elem, name, !documentIsHTML ) : + undefined; + + return val !== undefined ? + val : + support.attributes || !documentIsHTML ? + elem.getAttribute( name ) : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; +}; + +Sizzle.escape = function( sel ) { + return ( sel + "" ).replace( rcssescape, fcssescape ); +}; + +Sizzle.error = function( msg ) { + throw new Error( "Syntax error, unrecognized expression: " + msg ); +}; + +/** + * Document sorting and removing duplicates + * @param {ArrayLike} results + */ +Sizzle.uniqueSort = function( results ) { + var elem, + duplicates = [], + j = 0, + i = 0; + + // Unless we *know* we can detect duplicates, assume their presence + hasDuplicate = !support.detectDuplicates; + sortInput = !support.sortStable && results.slice( 0 ); + results.sort( sortOrder ); + + if ( hasDuplicate ) { + while ( ( elem = results[ i++ ] ) ) { + if ( elem === results[ i ] ) { + j = duplicates.push( i ); + } + } + while ( j-- ) { + results.splice( duplicates[ j ], 1 ); + } + } + + // Clear input after sorting to release objects + // See https://github.com/jquery/sizzle/pull/225 + sortInput = null; + + return results; +}; + +/** + * Utility function for retrieving the text value of an array of DOM nodes + * @param {Array|Element} elem + */ +getText = Sizzle.getText = function( elem ) { + var node, + ret = "", + i = 0, + nodeType = elem.nodeType; + + if ( !nodeType ) { + + // If no nodeType, this is expected to be an array + while ( ( node = elem[ i++ ] ) ) { + + // Do not traverse comment nodes + ret += getText( node ); + } + } else if ( nodeType === 1 || nodeType === 9 || nodeType === 11 ) { + + // Use textContent for elements + // innerText usage removed for consistency of new lines (jQuery #11153) + if ( typeof elem.textContent === "string" ) { + return elem.textContent; + } else { + + // Traverse its children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + ret += getText( elem ); + } + } + } else if ( nodeType === 3 || nodeType === 4 ) { + return elem.nodeValue; + } + + // Do not include comment or processing instruction nodes + + return ret; +}; + +Expr = Sizzle.selectors = { + + // Can be adjusted by the user + cacheLength: 50, + + createPseudo: markFunction, + + match: matchExpr, + + attrHandle: {}, + + find: {}, + + relative: { + ">": { dir: "parentNode", first: true }, + " ": { dir: "parentNode" }, + "+": { dir: "previousSibling", first: true }, + "~": { dir: "previousSibling" } + }, + + preFilter: { + "ATTR": function( match ) { + match[ 1 ] = match[ 1 ].replace( runescape, funescape ); + + // Move the given value to match[3] whether quoted or unquoted + match[ 3 ] = ( match[ 3 ] || match[ 4 ] || + match[ 5 ] || "" ).replace( runescape, funescape ); + + if ( match[ 2 ] === "~=" ) { + match[ 3 ] = " " + match[ 3 ] + " "; + } + + return match.slice( 0, 4 ); + }, + + "CHILD": function( match ) { + + /* matches from matchExpr["CHILD"] + 1 type (only|nth|...) + 2 what (child|of-type) + 3 argument (even|odd|\d*|\d*n([+-]\d+)?|...) + 4 xn-component of xn+y argument ([+-]?\d*n|) + 5 sign of xn-component + 6 x of xn-component + 7 sign of y-component + 8 y of y-component + */ + match[ 1 ] = match[ 1 ].toLowerCase(); + + if ( match[ 1 ].slice( 0, 3 ) === "nth" ) { + + // nth-* requires argument + if ( !match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + // numeric x and y parameters for Expr.filter.CHILD + // remember that false/true cast respectively to 0/1 + match[ 4 ] = +( match[ 4 ] ? + match[ 5 ] + ( match[ 6 ] || 1 ) : + 2 * ( match[ 3 ] === "even" || match[ 3 ] === "odd" ) ); + match[ 5 ] = +( ( match[ 7 ] + match[ 8 ] ) || match[ 3 ] === "odd" ); + + // other types prohibit arguments + } else if ( match[ 3 ] ) { + Sizzle.error( match[ 0 ] ); + } + + return match; + }, + + "PSEUDO": function( match ) { + var excess, + unquoted = !match[ 6 ] && match[ 2 ]; + + if ( matchExpr[ "CHILD" ].test( match[ 0 ] ) ) { + return null; + } + + // Accept quoted arguments as-is + if ( match[ 3 ] ) { + match[ 2 ] = match[ 4 ] || match[ 5 ] || ""; + + // Strip excess characters from unquoted arguments + } else if ( unquoted && rpseudo.test( unquoted ) && + + // Get excess from tokenize (recursively) + ( excess = tokenize( unquoted, true ) ) && + + // advance to the next closing parenthesis + ( excess = unquoted.indexOf( ")", unquoted.length - excess ) - unquoted.length ) ) { + + // excess is a negative index + match[ 0 ] = match[ 0 ].slice( 0, excess ); + match[ 2 ] = unquoted.slice( 0, excess ); + } + + // Return only captures needed by the pseudo filter method (type and argument) + return match.slice( 0, 3 ); + } + }, + + filter: { + + "TAG": function( nodeNameSelector ) { + var nodeName = nodeNameSelector.replace( runescape, funescape ).toLowerCase(); + return nodeNameSelector === "*" ? + function() { + return true; + } : + function( elem ) { + return elem.nodeName && elem.nodeName.toLowerCase() === nodeName; + }; + }, + + "CLASS": function( className ) { + var pattern = classCache[ className + " " ]; + + return pattern || + ( pattern = new RegExp( "(^|" + whitespace + + ")" + className + "(" + whitespace + "|$)" ) ) && classCache( + className, function( elem ) { + return pattern.test( + typeof elem.className === "string" && elem.className || + typeof elem.getAttribute !== "undefined" && + elem.getAttribute( "class" ) || + "" + ); + } ); + }, + + "ATTR": function( name, operator, check ) { + return function( elem ) { + var result = Sizzle.attr( elem, name ); + + if ( result == null ) { + return operator === "!="; + } + if ( !operator ) { + return true; + } + + result += ""; + + /* eslint-disable max-len */ + + return operator === "=" ? result === check : + operator === "!=" ? result !== check : + operator === "^=" ? check && result.indexOf( check ) === 0 : + operator === "*=" ? check && result.indexOf( check ) > -1 : + operator === "$=" ? check && result.slice( -check.length ) === check : + operator === "~=" ? ( " " + result.replace( rwhitespace, " " ) + " " ).indexOf( check ) > -1 : + operator === "|=" ? result === check || result.slice( 0, check.length + 1 ) === check + "-" : + false; + /* eslint-enable max-len */ + + }; + }, + + "CHILD": function( type, what, _argument, first, last ) { + var simple = type.slice( 0, 3 ) !== "nth", + forward = type.slice( -4 ) !== "last", + ofType = what === "of-type"; + + return first === 1 && last === 0 ? + + // Shortcut for :nth-*(n) + function( elem ) { + return !!elem.parentNode; + } : + + function( elem, _context, xml ) { + var cache, uniqueCache, outerCache, node, nodeIndex, start, + dir = simple !== forward ? "nextSibling" : "previousSibling", + parent = elem.parentNode, + name = ofType && elem.nodeName.toLowerCase(), + useCache = !xml && !ofType, + diff = false; + + if ( parent ) { + + // :(first|last|only)-(child|of-type) + if ( simple ) { + while ( dir ) { + node = elem; + while ( ( node = node[ dir ] ) ) { + if ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) { + + return false; + } + } + + // Reverse direction for :only-* (if we haven't yet done so) + start = dir = type === "only" && !start && "nextSibling"; + } + return true; + } + + start = [ forward ? parent.firstChild : parent.lastChild ]; + + // non-xml :nth-child(...) stores cache data on `parent` + if ( forward && useCache ) { + + // Seek `elem` from a previously-cached index + + // ...in a gzip-friendly way + node = parent; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex && cache[ 2 ]; + node = nodeIndex && parent.childNodes[ nodeIndex ]; + + while ( ( node = ++nodeIndex && node && node[ dir ] || + + // Fallback to seeking `elem` from the start + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + // When found, cache indexes on `parent` and break + if ( node.nodeType === 1 && ++diff && node === elem ) { + uniqueCache[ type ] = [ dirruns, nodeIndex, diff ]; + break; + } + } + + } else { + + // Use previously-cached element index if available + if ( useCache ) { + + // ...in a gzip-friendly way + node = elem; + outerCache = node[ expando ] || ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + cache = uniqueCache[ type ] || []; + nodeIndex = cache[ 0 ] === dirruns && cache[ 1 ]; + diff = nodeIndex; + } + + // xml :nth-child(...) + // or :nth-last-child(...) or :nth(-last)?-of-type(...) + if ( diff === false ) { + + // Use the same loop as above to seek `elem` from the start + while ( ( node = ++nodeIndex && node && node[ dir ] || + ( diff = nodeIndex = 0 ) || start.pop() ) ) { + + if ( ( ofType ? + node.nodeName.toLowerCase() === name : + node.nodeType === 1 ) && + ++diff ) { + + // Cache the index of each encountered element + if ( useCache ) { + outerCache = node[ expando ] || + ( node[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ node.uniqueID ] || + ( outerCache[ node.uniqueID ] = {} ); + + uniqueCache[ type ] = [ dirruns, diff ]; + } + + if ( node === elem ) { + break; + } + } + } + } + } + + // Incorporate the offset, then check against cycle size + diff -= last; + return diff === first || ( diff % first === 0 && diff / first >= 0 ); + } + }; + }, + + "PSEUDO": function( pseudo, argument ) { + + // pseudo-class names are case-insensitive + // http://www.w3.org/TR/selectors/#pseudo-classes + // Prioritize by case sensitivity in case custom pseudos are added with uppercase letters + // Remember that setFilters inherits from pseudos + var args, + fn = Expr.pseudos[ pseudo ] || Expr.setFilters[ pseudo.toLowerCase() ] || + Sizzle.error( "unsupported pseudo: " + pseudo ); + + // The user may use createPseudo to indicate that + // arguments are needed to create the filter function + // just as Sizzle does + if ( fn[ expando ] ) { + return fn( argument ); + } + + // But maintain support for old signatures + if ( fn.length > 1 ) { + args = [ pseudo, pseudo, "", argument ]; + return Expr.setFilters.hasOwnProperty( pseudo.toLowerCase() ) ? + markFunction( function( seed, matches ) { + var idx, + matched = fn( seed, argument ), + i = matched.length; + while ( i-- ) { + idx = indexOf( seed, matched[ i ] ); + seed[ idx ] = !( matches[ idx ] = matched[ i ] ); + } + } ) : + function( elem ) { + return fn( elem, 0, args ); + }; + } + + return fn; + } + }, + + pseudos: { + + // Potentially complex pseudos + "not": markFunction( function( selector ) { + + // Trim the selector passed to compile + // to avoid treating leading and trailing + // spaces as combinators + var input = [], + results = [], + matcher = compile( selector.replace( rtrim, "$1" ) ); + + return matcher[ expando ] ? + markFunction( function( seed, matches, _context, xml ) { + var elem, + unmatched = matcher( seed, null, xml, [] ), + i = seed.length; + + // Match elements unmatched by `matcher` + while ( i-- ) { + if ( ( elem = unmatched[ i ] ) ) { + seed[ i ] = !( matches[ i ] = elem ); + } + } + } ) : + function( elem, _context, xml ) { + input[ 0 ] = elem; + matcher( input, null, xml, results ); + + // Don't keep the element (issue #299) + input[ 0 ] = null; + return !results.pop(); + }; + } ), + + "has": markFunction( function( selector ) { + return function( elem ) { + return Sizzle( selector, elem ).length > 0; + }; + } ), + + "contains": markFunction( function( text ) { + text = text.replace( runescape, funescape ); + return function( elem ) { + return ( elem.textContent || getText( elem ) ).indexOf( text ) > -1; + }; + } ), + + // "Whether an element is represented by a :lang() selector + // is based solely on the element's language value + // being equal to the identifier C, + // or beginning with the identifier C immediately followed by "-". + // The matching of C against the element's language value is performed case-insensitively. + // The identifier C does not have to be a valid language name." + // http://www.w3.org/TR/selectors/#lang-pseudo + "lang": markFunction( function( lang ) { + + // lang value must be a valid identifier + if ( !ridentifier.test( lang || "" ) ) { + Sizzle.error( "unsupported lang: " + lang ); + } + lang = lang.replace( runescape, funescape ).toLowerCase(); + return function( elem ) { + var elemLang; + do { + if ( ( elemLang = documentIsHTML ? + elem.lang : + elem.getAttribute( "xml:lang" ) || elem.getAttribute( "lang" ) ) ) { + + elemLang = elemLang.toLowerCase(); + return elemLang === lang || elemLang.indexOf( lang + "-" ) === 0; + } + } while ( ( elem = elem.parentNode ) && elem.nodeType === 1 ); + return false; + }; + } ), + + // Miscellaneous + "target": function( elem ) { + var hash = window.location && window.location.hash; + return hash && hash.slice( 1 ) === elem.id; + }, + + "root": function( elem ) { + return elem === docElem; + }, + + "focus": function( elem ) { + return elem === document.activeElement && + ( !document.hasFocus || document.hasFocus() ) && + !!( elem.type || elem.href || ~elem.tabIndex ); + }, + + // Boolean properties + "enabled": createDisabledPseudo( false ), + "disabled": createDisabledPseudo( true ), + + "checked": function( elem ) { + + // In CSS3, :checked should return both checked and selected elements + // http://www.w3.org/TR/2011/REC-css3-selectors-20110929/#checked + var nodeName = elem.nodeName.toLowerCase(); + return ( nodeName === "input" && !!elem.checked ) || + ( nodeName === "option" && !!elem.selected ); + }, + + "selected": function( elem ) { + + // Accessing this property makes selected-by-default + // options in Safari work properly + if ( elem.parentNode ) { + // eslint-disable-next-line no-unused-expressions + elem.parentNode.selectedIndex; + } + + return elem.selected === true; + }, + + // Contents + "empty": function( elem ) { + + // http://www.w3.org/TR/selectors/#empty-pseudo + // :empty is negated by element (1) or content nodes (text: 3; cdata: 4; entity ref: 5), + // but not by others (comment: 8; processing instruction: 7; etc.) + // nodeType < 6 works because attributes (2) do not appear as children + for ( elem = elem.firstChild; elem; elem = elem.nextSibling ) { + if ( elem.nodeType < 6 ) { + return false; + } + } + return true; + }, + + "parent": function( elem ) { + return !Expr.pseudos[ "empty" ]( elem ); + }, + + // Element/input types + "header": function( elem ) { + return rheader.test( elem.nodeName ); + }, + + "input": function( elem ) { + return rinputs.test( elem.nodeName ); + }, + + "button": function( elem ) { + var name = elem.nodeName.toLowerCase(); + return name === "input" && elem.type === "button" || name === "button"; + }, + + "text": function( elem ) { + var attr; + return elem.nodeName.toLowerCase() === "input" && + elem.type === "text" && + + // Support: IE<8 + // New HTML5 attribute values (e.g., "search") appear with elem.type === "text" + ( ( attr = elem.getAttribute( "type" ) ) == null || + attr.toLowerCase() === "text" ); + }, + + // Position-in-collection + "first": createPositionalPseudo( function() { + return [ 0 ]; + } ), + + "last": createPositionalPseudo( function( _matchIndexes, length ) { + return [ length - 1 ]; + } ), + + "eq": createPositionalPseudo( function( _matchIndexes, length, argument ) { + return [ argument < 0 ? argument + length : argument ]; + } ), + + "even": createPositionalPseudo( function( matchIndexes, length ) { + var i = 0; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "odd": createPositionalPseudo( function( matchIndexes, length ) { + var i = 1; + for ( ; i < length; i += 2 ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "lt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? + argument + length : + argument > length ? + length : + argument; + for ( ; --i >= 0; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ), + + "gt": createPositionalPseudo( function( matchIndexes, length, argument ) { + var i = argument < 0 ? argument + length : argument; + for ( ; ++i < length; ) { + matchIndexes.push( i ); + } + return matchIndexes; + } ) + } +}; + +Expr.pseudos[ "nth" ] = Expr.pseudos[ "eq" ]; + +// Add button/input type pseudos +for ( i in { radio: true, checkbox: true, file: true, password: true, image: true } ) { + Expr.pseudos[ i ] = createInputPseudo( i ); +} +for ( i in { submit: true, reset: true } ) { + Expr.pseudos[ i ] = createButtonPseudo( i ); +} + +// Easy API for creating new setFilters +function setFilters() {} +setFilters.prototype = Expr.filters = Expr.pseudos; +Expr.setFilters = new setFilters(); + +tokenize = Sizzle.tokenize = function( selector, parseOnly ) { + var matched, match, tokens, type, + soFar, groups, preFilters, + cached = tokenCache[ selector + " " ]; + + if ( cached ) { + return parseOnly ? 0 : cached.slice( 0 ); + } + + soFar = selector; + groups = []; + preFilters = Expr.preFilter; + + while ( soFar ) { + + // Comma and first run + if ( !matched || ( match = rcomma.exec( soFar ) ) ) { + if ( match ) { + + // Don't consume trailing commas as valid + soFar = soFar.slice( match[ 0 ].length ) || soFar; + } + groups.push( ( tokens = [] ) ); + } + + matched = false; + + // Combinators + if ( ( match = rcombinators.exec( soFar ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + + // Cast descendant combinators to space + type: match[ 0 ].replace( rtrim, " " ) + } ); + soFar = soFar.slice( matched.length ); + } + + // Filters + for ( type in Expr.filter ) { + if ( ( match = matchExpr[ type ].exec( soFar ) ) && ( !preFilters[ type ] || + ( match = preFilters[ type ]( match ) ) ) ) { + matched = match.shift(); + tokens.push( { + value: matched, + type: type, + matches: match + } ); + soFar = soFar.slice( matched.length ); + } + } + + if ( !matched ) { + break; + } + } + + // Return the length of the invalid excess + // if we're just parsing + // Otherwise, throw an error or return tokens + return parseOnly ? + soFar.length : + soFar ? + Sizzle.error( selector ) : + + // Cache the tokens + tokenCache( selector, groups ).slice( 0 ); +}; + +function toSelector( tokens ) { + var i = 0, + len = tokens.length, + selector = ""; + for ( ; i < len; i++ ) { + selector += tokens[ i ].value; + } + return selector; +} + +function addCombinator( matcher, combinator, base ) { + var dir = combinator.dir, + skip = combinator.next, + key = skip || dir, + checkNonElements = base && key === "parentNode", + doneName = done++; + + return combinator.first ? + + // Check against closest ancestor/preceding element + function( elem, context, xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + return matcher( elem, context, xml ); + } + } + return false; + } : + + // Check against all ancestor/preceding elements + function( elem, context, xml ) { + var oldCache, uniqueCache, outerCache, + newCache = [ dirruns, doneName ]; + + // We can't set arbitrary data on XML nodes, so they don't benefit from combinator caching + if ( xml ) { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + if ( matcher( elem, context, xml ) ) { + return true; + } + } + } + } else { + while ( ( elem = elem[ dir ] ) ) { + if ( elem.nodeType === 1 || checkNonElements ) { + outerCache = elem[ expando ] || ( elem[ expando ] = {} ); + + // Support: IE <9 only + // Defend against cloned attroperties (jQuery gh-1709) + uniqueCache = outerCache[ elem.uniqueID ] || + ( outerCache[ elem.uniqueID ] = {} ); + + if ( skip && skip === elem.nodeName.toLowerCase() ) { + elem = elem[ dir ] || elem; + } else if ( ( oldCache = uniqueCache[ key ] ) && + oldCache[ 0 ] === dirruns && oldCache[ 1 ] === doneName ) { + + // Assign to newCache so results back-propagate to previous elements + return ( newCache[ 2 ] = oldCache[ 2 ] ); + } else { + + // Reuse newcache so results back-propagate to previous elements + uniqueCache[ key ] = newCache; + + // A match means we're done; a fail means we have to keep checking + if ( ( newCache[ 2 ] = matcher( elem, context, xml ) ) ) { + return true; + } + } + } + } + } + return false; + }; +} + +function elementMatcher( matchers ) { + return matchers.length > 1 ? + function( elem, context, xml ) { + var i = matchers.length; + while ( i-- ) { + if ( !matchers[ i ]( elem, context, xml ) ) { + return false; + } + } + return true; + } : + matchers[ 0 ]; +} + +function multipleContexts( selector, contexts, results ) { + var i = 0, + len = contexts.length; + for ( ; i < len; i++ ) { + Sizzle( selector, contexts[ i ], results ); + } + return results; +} + +function condense( unmatched, map, filter, context, xml ) { + var elem, + newUnmatched = [], + i = 0, + len = unmatched.length, + mapped = map != null; + + for ( ; i < len; i++ ) { + if ( ( elem = unmatched[ i ] ) ) { + if ( !filter || filter( elem, context, xml ) ) { + newUnmatched.push( elem ); + if ( mapped ) { + map.push( i ); + } + } + } + } + + return newUnmatched; +} + +function setMatcher( preFilter, selector, matcher, postFilter, postFinder, postSelector ) { + if ( postFilter && !postFilter[ expando ] ) { + postFilter = setMatcher( postFilter ); + } + if ( postFinder && !postFinder[ expando ] ) { + postFinder = setMatcher( postFinder, postSelector ); + } + return markFunction( function( seed, results, context, xml ) { + var temp, i, elem, + preMap = [], + postMap = [], + preexisting = results.length, + + // Get initial elements from seed or context + elems = seed || multipleContexts( + selector || "*", + context.nodeType ? [ context ] : context, + [] + ), + + // Prefilter to get matcher input, preserving a map for seed-results synchronization + matcherIn = preFilter && ( seed || !selector ) ? + condense( elems, preMap, preFilter, context, xml ) : + elems, + + matcherOut = matcher ? + + // If we have a postFinder, or filtered seed, or non-seed postFilter or preexisting results, + postFinder || ( seed ? preFilter : preexisting || postFilter ) ? + + // ...intermediate processing is necessary + [] : + + // ...otherwise use results directly + results : + matcherIn; + + // Find primary matches + if ( matcher ) { + matcher( matcherIn, matcherOut, context, xml ); + } + + // Apply postFilter + if ( postFilter ) { + temp = condense( matcherOut, postMap ); + postFilter( temp, [], context, xml ); + + // Un-match failing elements by moving them back to matcherIn + i = temp.length; + while ( i-- ) { + if ( ( elem = temp[ i ] ) ) { + matcherOut[ postMap[ i ] ] = !( matcherIn[ postMap[ i ] ] = elem ); + } + } + } + + if ( seed ) { + if ( postFinder || preFilter ) { + if ( postFinder ) { + + // Get the final matcherOut by condensing this intermediate into postFinder contexts + temp = []; + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) ) { + + // Restore matcherIn since elem is not yet a final match + temp.push( ( matcherIn[ i ] = elem ) ); + } + } + postFinder( null, ( matcherOut = [] ), temp, xml ); + } + + // Move matched elements from seed to results to keep them synchronized + i = matcherOut.length; + while ( i-- ) { + if ( ( elem = matcherOut[ i ] ) && + ( temp = postFinder ? indexOf( seed, elem ) : preMap[ i ] ) > -1 ) { + + seed[ temp ] = !( results[ temp ] = elem ); + } + } + } + + // Add elements to results, through postFinder if defined + } else { + matcherOut = condense( + matcherOut === results ? + matcherOut.splice( preexisting, matcherOut.length ) : + matcherOut + ); + if ( postFinder ) { + postFinder( null, results, matcherOut, xml ); + } else { + push.apply( results, matcherOut ); + } + } + } ); +} + +function matcherFromTokens( tokens ) { + var checkContext, matcher, j, + len = tokens.length, + leadingRelative = Expr.relative[ tokens[ 0 ].type ], + implicitRelative = leadingRelative || Expr.relative[ " " ], + i = leadingRelative ? 1 : 0, + + // The foundational matcher ensures that elements are reachable from top-level context(s) + matchContext = addCombinator( function( elem ) { + return elem === checkContext; + }, implicitRelative, true ), + matchAnyContext = addCombinator( function( elem ) { + return indexOf( checkContext, elem ) > -1; + }, implicitRelative, true ), + matchers = [ function( elem, context, xml ) { + var ret = ( !leadingRelative && ( xml || context !== outermostContext ) ) || ( + ( checkContext = context ).nodeType ? + matchContext( elem, context, xml ) : + matchAnyContext( elem, context, xml ) ); + + // Avoid hanging onto element (issue #299) + checkContext = null; + return ret; + } ]; + + for ( ; i < len; i++ ) { + if ( ( matcher = Expr.relative[ tokens[ i ].type ] ) ) { + matchers = [ addCombinator( elementMatcher( matchers ), matcher ) ]; + } else { + matcher = Expr.filter[ tokens[ i ].type ].apply( null, tokens[ i ].matches ); + + // Return special upon seeing a positional matcher + if ( matcher[ expando ] ) { + + // Find the next relative operator (if any) for proper handling + j = ++i; + for ( ; j < len; j++ ) { + if ( Expr.relative[ tokens[ j ].type ] ) { + break; + } + } + return setMatcher( + i > 1 && elementMatcher( matchers ), + i > 1 && toSelector( + + // If the preceding token was a descendant combinator, insert an implicit any-element `*` + tokens + .slice( 0, i - 1 ) + .concat( { value: tokens[ i - 2 ].type === " " ? "*" : "" } ) + ).replace( rtrim, "$1" ), + matcher, + i < j && matcherFromTokens( tokens.slice( i, j ) ), + j < len && matcherFromTokens( ( tokens = tokens.slice( j ) ) ), + j < len && toSelector( tokens ) + ); + } + matchers.push( matcher ); + } + } + + return elementMatcher( matchers ); +} + +function matcherFromGroupMatchers( elementMatchers, setMatchers ) { + var bySet = setMatchers.length > 0, + byElement = elementMatchers.length > 0, + superMatcher = function( seed, context, xml, results, outermost ) { + var elem, j, matcher, + matchedCount = 0, + i = "0", + unmatched = seed && [], + setMatched = [], + contextBackup = outermostContext, + + // We must always have either seed elements or outermost context + elems = seed || byElement && Expr.find[ "TAG" ]( "*", outermost ), + + // Use integer dirruns iff this is the outermost matcher + dirrunsUnique = ( dirruns += contextBackup == null ? 1 : Math.random() || 0.1 ), + len = elems.length; + + if ( outermost ) { + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + outermostContext = context == document || context || outermost; + } + + // Add elements passing elementMatchers directly to results + // Support: IE<9, Safari + // Tolerate NodeList properties (IE: "length"; Safari: ) matching elements by id + for ( ; i !== len && ( elem = elems[ i ] ) != null; i++ ) { + if ( byElement && elem ) { + j = 0; + + // Support: IE 11+, Edge 17 - 18+ + // IE/Edge sometimes throw a "Permission denied" error when strict-comparing + // two documents; shallow comparisons work. + // eslint-disable-next-line eqeqeq + if ( !context && elem.ownerDocument != document ) { + setDocument( elem ); + xml = !documentIsHTML; + } + while ( ( matcher = elementMatchers[ j++ ] ) ) { + if ( matcher( elem, context || document, xml ) ) { + results.push( elem ); + break; + } + } + if ( outermost ) { + dirruns = dirrunsUnique; + } + } + + // Track unmatched elements for set filters + if ( bySet ) { + + // They will have gone through all possible matchers + if ( ( elem = !matcher && elem ) ) { + matchedCount--; + } + + // Lengthen the array for every element, matched or not + if ( seed ) { + unmatched.push( elem ); + } + } + } + + // `i` is now the count of elements visited above, and adding it to `matchedCount` + // makes the latter nonnegative. + matchedCount += i; + + // Apply set filters to unmatched elements + // NOTE: This can be skipped if there are no unmatched elements (i.e., `matchedCount` + // equals `i`), unless we didn't visit _any_ elements in the above loop because we have + // no element matchers and no seed. + // Incrementing an initially-string "0" `i` allows `i` to remain a string only in that + // case, which will result in a "00" `matchedCount` that differs from `i` but is also + // numerically zero. + if ( bySet && i !== matchedCount ) { + j = 0; + while ( ( matcher = setMatchers[ j++ ] ) ) { + matcher( unmatched, setMatched, context, xml ); + } + + if ( seed ) { + + // Reintegrate element matches to eliminate the need for sorting + if ( matchedCount > 0 ) { + while ( i-- ) { + if ( !( unmatched[ i ] || setMatched[ i ] ) ) { + setMatched[ i ] = pop.call( results ); + } + } + } + + // Discard index placeholder values to get only actual matches + setMatched = condense( setMatched ); + } + + // Add matches to results + push.apply( results, setMatched ); + + // Seedless set matches succeeding multiple successful matchers stipulate sorting + if ( outermost && !seed && setMatched.length > 0 && + ( matchedCount + setMatchers.length ) > 1 ) { + + Sizzle.uniqueSort( results ); + } + } + + // Override manipulation of globals by nested matchers + if ( outermost ) { + dirruns = dirrunsUnique; + outermostContext = contextBackup; + } + + return unmatched; + }; + + return bySet ? + markFunction( superMatcher ) : + superMatcher; +} + +compile = Sizzle.compile = function( selector, match /* Internal Use Only */ ) { + var i, + setMatchers = [], + elementMatchers = [], + cached = compilerCache[ selector + " " ]; + + if ( !cached ) { + + // Generate a function of recursive functions that can be used to check each element + if ( !match ) { + match = tokenize( selector ); + } + i = match.length; + while ( i-- ) { + cached = matcherFromTokens( match[ i ] ); + if ( cached[ expando ] ) { + setMatchers.push( cached ); + } else { + elementMatchers.push( cached ); + } + } + + // Cache the compiled function + cached = compilerCache( + selector, + matcherFromGroupMatchers( elementMatchers, setMatchers ) + ); + + // Save selector and tokenization + cached.selector = selector; + } + return cached; +}; + +/** + * A low-level selection function that works with Sizzle's compiled + * selector functions + * @param {String|Function} selector A selector or a pre-compiled + * selector function built with Sizzle.compile + * @param {Element} context + * @param {Array} [results] + * @param {Array} [seed] A set of elements to match against + */ +select = Sizzle.select = function( selector, context, results, seed ) { + var i, tokens, token, type, find, + compiled = typeof selector === "function" && selector, + match = !seed && tokenize( ( selector = compiled.selector || selector ) ); + + results = results || []; + + // Try to minimize operations if there is only one selector in the list and no seed + // (the latter of which guarantees us context) + if ( match.length === 1 ) { + + // Reduce context if the leading compound selector is an ID + tokens = match[ 0 ] = match[ 0 ].slice( 0 ); + if ( tokens.length > 2 && ( token = tokens[ 0 ] ).type === "ID" && + context.nodeType === 9 && documentIsHTML && Expr.relative[ tokens[ 1 ].type ] ) { + + context = ( Expr.find[ "ID" ]( token.matches[ 0 ] + .replace( runescape, funescape ), context ) || [] )[ 0 ]; + if ( !context ) { + return results; + + // Precompiled matchers will still verify ancestry, so step up a level + } else if ( compiled ) { + context = context.parentNode; + } + + selector = selector.slice( tokens.shift().value.length ); + } + + // Fetch a seed set for right-to-left matching + i = matchExpr[ "needsContext" ].test( selector ) ? 0 : tokens.length; + while ( i-- ) { + token = tokens[ i ]; + + // Abort if we hit a combinator + if ( Expr.relative[ ( type = token.type ) ] ) { + break; + } + if ( ( find = Expr.find[ type ] ) ) { + + // Search, expanding context for leading sibling combinators + if ( ( seed = find( + token.matches[ 0 ].replace( runescape, funescape ), + rsibling.test( tokens[ 0 ].type ) && testContext( context.parentNode ) || + context + ) ) ) { + + // If seed is empty or no tokens remain, we can return early + tokens.splice( i, 1 ); + selector = seed.length && toSelector( tokens ); + if ( !selector ) { + push.apply( results, seed ); + return results; + } + + break; + } + } + } + } + + // Compile and execute a filtering function if one is not provided + // Provide `match` to avoid retokenization if we modified the selector above + ( compiled || compile( selector, match ) )( + seed, + context, + !documentIsHTML, + results, + !context || rsibling.test( selector ) && testContext( context.parentNode ) || context + ); + return results; +}; + +// One-time assignments + +// Sort stability +support.sortStable = expando.split( "" ).sort( sortOrder ).join( "" ) === expando; + +// Support: Chrome 14-35+ +// Always assume duplicates if they aren't passed to the comparison function +support.detectDuplicates = !!hasDuplicate; + +// Initialize against the default document +setDocument(); + +// Support: Webkit<537.32 - Safari 6.0.3/Chrome 25 (fixed in Chrome 27) +// Detached nodes confoundingly follow *each other* +support.sortDetached = assert( function( el ) { + + // Should return 1, but returns 4 (following) + return el.compareDocumentPosition( document.createElement( "fieldset" ) ) & 1; +} ); + +// Support: IE<8 +// Prevent attribute/property "interpolation" +// https://msdn.microsoft.com/en-us/library/ms536429%28VS.85%29.aspx +if ( !assert( function( el ) { + el.innerHTML = ""; + return el.firstChild.getAttribute( "href" ) === "#"; +} ) ) { + addHandle( "type|href|height|width", function( elem, name, isXML ) { + if ( !isXML ) { + return elem.getAttribute( name, name.toLowerCase() === "type" ? 1 : 2 ); + } + } ); +} + +// Support: IE<9 +// Use defaultValue in place of getAttribute("value") +if ( !support.attributes || !assert( function( el ) { + el.innerHTML = ""; + el.firstChild.setAttribute( "value", "" ); + return el.firstChild.getAttribute( "value" ) === ""; +} ) ) { + addHandle( "value", function( elem, _name, isXML ) { + if ( !isXML && elem.nodeName.toLowerCase() === "input" ) { + return elem.defaultValue; + } + } ); +} + +// Support: IE<9 +// Use getAttributeNode to fetch booleans when getAttribute lies +if ( !assert( function( el ) { + return el.getAttribute( "disabled" ) == null; +} ) ) { + addHandle( booleans, function( elem, name, isXML ) { + var val; + if ( !isXML ) { + return elem[ name ] === true ? name.toLowerCase() : + ( val = elem.getAttributeNode( name ) ) && val.specified ? + val.value : + null; + } + } ); +} + +return Sizzle; + +} )( window ); + + + +jQuery.find = Sizzle; +jQuery.expr = Sizzle.selectors; + +// Deprecated +jQuery.expr[ ":" ] = jQuery.expr.pseudos; +jQuery.uniqueSort = jQuery.unique = Sizzle.uniqueSort; +jQuery.text = Sizzle.getText; +jQuery.isXMLDoc = Sizzle.isXML; +jQuery.contains = Sizzle.contains; +jQuery.escapeSelector = Sizzle.escape; + + + + +var dir = function( elem, dir, until ) { + var matched = [], + truncate = until !== undefined; + + while ( ( elem = elem[ dir ] ) && elem.nodeType !== 9 ) { + if ( elem.nodeType === 1 ) { + if ( truncate && jQuery( elem ).is( until ) ) { + break; + } + matched.push( elem ); + } + } + return matched; +}; + + +var siblings = function( n, elem ) { + var matched = []; + + for ( ; n; n = n.nextSibling ) { + if ( n.nodeType === 1 && n !== elem ) { + matched.push( n ); + } + } + + return matched; +}; + + +var rneedsContext = jQuery.expr.match.needsContext; + + + +function nodeName( elem, name ) { + + return elem.nodeName && elem.nodeName.toLowerCase() === name.toLowerCase(); + +}; +var rsingleTag = ( /^<([a-z][^\/\0>:\x20\t\r\n\f]*)[\x20\t\r\n\f]*\/?>(?:<\/\1>|)$/i ); + + + +// Implement the identical functionality for filter and not +function winnow( elements, qualifier, not ) { + if ( isFunction( qualifier ) ) { + return jQuery.grep( elements, function( elem, i ) { + return !!qualifier.call( elem, i, elem ) !== not; + } ); + } + + // Single element + if ( qualifier.nodeType ) { + return jQuery.grep( elements, function( elem ) { + return ( elem === qualifier ) !== not; + } ); + } + + // Arraylike of elements (jQuery, arguments, Array) + if ( typeof qualifier !== "string" ) { + return jQuery.grep( elements, function( elem ) { + return ( indexOf.call( qualifier, elem ) > -1 ) !== not; + } ); + } + + // Filtered directly for both simple and complex selectors + return jQuery.filter( qualifier, elements, not ); +} + +jQuery.filter = function( expr, elems, not ) { + var elem = elems[ 0 ]; + + if ( not ) { + expr = ":not(" + expr + ")"; + } + + if ( elems.length === 1 && elem.nodeType === 1 ) { + return jQuery.find.matchesSelector( elem, expr ) ? [ elem ] : []; + } + + return jQuery.find.matches( expr, jQuery.grep( elems, function( elem ) { + return elem.nodeType === 1; + } ) ); +}; + +jQuery.fn.extend( { + find: function( selector ) { + var i, ret, + len = this.length, + self = this; + + if ( typeof selector !== "string" ) { + return this.pushStack( jQuery( selector ).filter( function() { + for ( i = 0; i < len; i++ ) { + if ( jQuery.contains( self[ i ], this ) ) { + return true; + } + } + } ) ); + } + + ret = this.pushStack( [] ); + + for ( i = 0; i < len; i++ ) { + jQuery.find( selector, self[ i ], ret ); + } + + return len > 1 ? jQuery.uniqueSort( ret ) : ret; + }, + filter: function( selector ) { + return this.pushStack( winnow( this, selector || [], false ) ); + }, + not: function( selector ) { + return this.pushStack( winnow( this, selector || [], true ) ); + }, + is: function( selector ) { + return !!winnow( + this, + + // If this is a positional/relative selector, check membership in the returned set + // so $("p:first").is("p:last") won't return true for a doc with two "p". + typeof selector === "string" && rneedsContext.test( selector ) ? + jQuery( selector ) : + selector || [], + false + ).length; + } +} ); + + +// Initialize a jQuery object + + +// A central reference to the root jQuery(document) +var rootjQuery, + + // A simple way to check for HTML strings + // Prioritize #id over to avoid XSS via location.hash (#9521) + // Strict HTML recognition (#11290: must start with <) + // Shortcut simple #id case for speed + rquickExpr = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]+))$/, + + init = jQuery.fn.init = function( selector, context, root ) { + var match, elem; + + // HANDLE: $(""), $(null), $(undefined), $(false) + if ( !selector ) { + return this; + } + + // Method init() accepts an alternate rootjQuery + // so migrate can support jQuery.sub (gh-2101) + root = root || rootjQuery; + + // Handle HTML strings + if ( typeof selector === "string" ) { + if ( selector[ 0 ] === "<" && + selector[ selector.length - 1 ] === ">" && + selector.length >= 3 ) { + + // Assume that strings that start and end with <> are HTML and skip the regex check + match = [ null, selector, null ]; + + } else { + match = rquickExpr.exec( selector ); + } + + // Match html or make sure no context is specified for #id + if ( match && ( match[ 1 ] || !context ) ) { + + // HANDLE: $(html) -> $(array) + if ( match[ 1 ] ) { + context = context instanceof jQuery ? context[ 0 ] : context; + + // Option to run scripts is true for back-compat + // Intentionally let the error be thrown if parseHTML is not present + jQuery.merge( this, jQuery.parseHTML( + match[ 1 ], + context && context.nodeType ? context.ownerDocument || context : document, + true + ) ); + + // HANDLE: $(html, props) + if ( rsingleTag.test( match[ 1 ] ) && jQuery.isPlainObject( context ) ) { + for ( match in context ) { + + // Properties of context are called as methods if possible + if ( isFunction( this[ match ] ) ) { + this[ match ]( context[ match ] ); + + // ...and otherwise set as attributes + } else { + this.attr( match, context[ match ] ); + } + } + } + + return this; + + // HANDLE: $(#id) + } else { + elem = document.getElementById( match[ 2 ] ); + + if ( elem ) { + + // Inject the element directly into the jQuery object + this[ 0 ] = elem; + this.length = 1; + } + return this; + } + + // HANDLE: $(expr, $(...)) + } else if ( !context || context.jquery ) { + return ( context || root ).find( selector ); + + // HANDLE: $(expr, context) + // (which is just equivalent to: $(context).find(expr) + } else { + return this.constructor( context ).find( selector ); + } + + // HANDLE: $(DOMElement) + } else if ( selector.nodeType ) { + this[ 0 ] = selector; + this.length = 1; + return this; + + // HANDLE: $(function) + // Shortcut for document ready + } else if ( isFunction( selector ) ) { + return root.ready !== undefined ? + root.ready( selector ) : + + // Execute immediately if ready is not present + selector( jQuery ); + } + + return jQuery.makeArray( selector, this ); + }; + +// Give the init function the jQuery prototype for later instantiation +init.prototype = jQuery.fn; + +// Initialize central reference +rootjQuery = jQuery( document ); + + +var rparentsprev = /^(?:parents|prev(?:Until|All))/, + + // Methods guaranteed to produce a unique set when starting from a unique set + guaranteedUnique = { + children: true, + contents: true, + next: true, + prev: true + }; + +jQuery.fn.extend( { + has: function( target ) { + var targets = jQuery( target, this ), + l = targets.length; + + return this.filter( function() { + var i = 0; + for ( ; i < l; i++ ) { + if ( jQuery.contains( this, targets[ i ] ) ) { + return true; + } + } + } ); + }, + + closest: function( selectors, context ) { + var cur, + i = 0, + l = this.length, + matched = [], + targets = typeof selectors !== "string" && jQuery( selectors ); + + // Positional selectors never match, since there's no _selection_ context + if ( !rneedsContext.test( selectors ) ) { + for ( ; i < l; i++ ) { + for ( cur = this[ i ]; cur && cur !== context; cur = cur.parentNode ) { + + // Always skip document fragments + if ( cur.nodeType < 11 && ( targets ? + targets.index( cur ) > -1 : + + // Don't pass non-elements to Sizzle + cur.nodeType === 1 && + jQuery.find.matchesSelector( cur, selectors ) ) ) { + + matched.push( cur ); + break; + } + } + } + } + + return this.pushStack( matched.length > 1 ? jQuery.uniqueSort( matched ) : matched ); + }, + + // Determine the position of an element within the set + index: function( elem ) { + + // No argument, return index in parent + if ( !elem ) { + return ( this[ 0 ] && this[ 0 ].parentNode ) ? this.first().prevAll().length : -1; + } + + // Index in selector + if ( typeof elem === "string" ) { + return indexOf.call( jQuery( elem ), this[ 0 ] ); + } + + // Locate the position of the desired element + return indexOf.call( this, + + // If it receives a jQuery object, the first element is used + elem.jquery ? elem[ 0 ] : elem + ); + }, + + add: function( selector, context ) { + return this.pushStack( + jQuery.uniqueSort( + jQuery.merge( this.get(), jQuery( selector, context ) ) + ) + ); + }, + + addBack: function( selector ) { + return this.add( selector == null ? + this.prevObject : this.prevObject.filter( selector ) + ); + } +} ); + +function sibling( cur, dir ) { + while ( ( cur = cur[ dir ] ) && cur.nodeType !== 1 ) {} + return cur; +} + +jQuery.each( { + parent: function( elem ) { + var parent = elem.parentNode; + return parent && parent.nodeType !== 11 ? parent : null; + }, + parents: function( elem ) { + return dir( elem, "parentNode" ); + }, + parentsUntil: function( elem, _i, until ) { + return dir( elem, "parentNode", until ); + }, + next: function( elem ) { + return sibling( elem, "nextSibling" ); + }, + prev: function( elem ) { + return sibling( elem, "previousSibling" ); + }, + nextAll: function( elem ) { + return dir( elem, "nextSibling" ); + }, + prevAll: function( elem ) { + return dir( elem, "previousSibling" ); + }, + nextUntil: function( elem, _i, until ) { + return dir( elem, "nextSibling", until ); + }, + prevUntil: function( elem, _i, until ) { + return dir( elem, "previousSibling", until ); + }, + siblings: function( elem ) { + return siblings( ( elem.parentNode || {} ).firstChild, elem ); + }, + children: function( elem ) { + return siblings( elem.firstChild ); + }, + contents: function( elem ) { + if ( elem.contentDocument != null && + + // Support: IE 11+ + // elements with no `data` attribute has an object + // `contentDocument` with a `null` prototype. + getProto( elem.contentDocument ) ) { + + return elem.contentDocument; + } + + // Support: IE 9 - 11 only, iOS 7 only, Android Browser <=4.3 only + // Treat the template element as a regular one in browsers that + // don't support it. + if ( nodeName( elem, "template" ) ) { + elem = elem.content || elem; + } + + return jQuery.merge( [], elem.childNodes ); + } +}, function( name, fn ) { + jQuery.fn[ name ] = function( until, selector ) { + var matched = jQuery.map( this, fn, until ); + + if ( name.slice( -5 ) !== "Until" ) { + selector = until; + } + + if ( selector && typeof selector === "string" ) { + matched = jQuery.filter( selector, matched ); + } + + if ( this.length > 1 ) { + + // Remove duplicates + if ( !guaranteedUnique[ name ] ) { + jQuery.uniqueSort( matched ); + } + + // Reverse order for parents* and prev-derivatives + if ( rparentsprev.test( name ) ) { + matched.reverse(); + } + } + + return this.pushStack( matched ); + }; +} ); +var rnothtmlwhite = ( /[^\x20\t\r\n\f]+/g ); + + + +// Convert String-formatted options into Object-formatted ones +function createOptions( options ) { + var object = {}; + jQuery.each( options.match( rnothtmlwhite ) || [], function( _, flag ) { + object[ flag ] = true; + } ); + return object; +} + +/* + * Create a callback list using the following parameters: + * + * options: an optional list of space-separated options that will change how + * the callback list behaves or a more traditional option object + * + * By default a callback list will act like an event callback list and can be + * "fired" multiple times. + * + * Possible options: + * + * once: will ensure the callback list can only be fired once (like a Deferred) + * + * memory: will keep track of previous values and will call any callback added + * after the list has been fired right away with the latest "memorized" + * values (like a Deferred) + * + * unique: will ensure a callback can only be added once (no duplicate in the list) + * + * stopOnFalse: interrupt callings when a callback returns false + * + */ +jQuery.Callbacks = function( options ) { + + // Convert options from String-formatted to Object-formatted if needed + // (we check in cache first) + options = typeof options === "string" ? + createOptions( options ) : + jQuery.extend( {}, options ); + + var // Flag to know if list is currently firing + firing, + + // Last fire value for non-forgettable lists + memory, + + // Flag to know if list was already fired + fired, + + // Flag to prevent firing + locked, + + // Actual callback list + list = [], + + // Queue of execution data for repeatable lists + queue = [], + + // Index of currently firing callback (modified by add/remove as needed) + firingIndex = -1, + + // Fire callbacks + fire = function() { + + // Enforce single-firing + locked = locked || options.once; + + // Execute callbacks for all pending executions, + // respecting firingIndex overrides and runtime changes + fired = firing = true; + for ( ; queue.length; firingIndex = -1 ) { + memory = queue.shift(); + while ( ++firingIndex < list.length ) { + + // Run callback and check for early termination + if ( list[ firingIndex ].apply( memory[ 0 ], memory[ 1 ] ) === false && + options.stopOnFalse ) { + + // Jump to end and forget the data so .add doesn't re-fire + firingIndex = list.length; + memory = false; + } + } + } + + // Forget the data if we're done with it + if ( !options.memory ) { + memory = false; + } + + firing = false; + + // Clean up if we're done firing for good + if ( locked ) { + + // Keep an empty list if we have data for future add calls + if ( memory ) { + list = []; + + // Otherwise, this object is spent + } else { + list = ""; + } + } + }, + + // Actual Callbacks object + self = { + + // Add a callback or a collection of callbacks to the list + add: function() { + if ( list ) { + + // If we have memory from a past run, we should fire after adding + if ( memory && !firing ) { + firingIndex = list.length - 1; + queue.push( memory ); + } + + ( function add( args ) { + jQuery.each( args, function( _, arg ) { + if ( isFunction( arg ) ) { + if ( !options.unique || !self.has( arg ) ) { + list.push( arg ); + } + } else if ( arg && arg.length && toType( arg ) !== "string" ) { + + // Inspect recursively + add( arg ); + } + } ); + } )( arguments ); + + if ( memory && !firing ) { + fire(); + } + } + return this; + }, + + // Remove a callback from the list + remove: function() { + jQuery.each( arguments, function( _, arg ) { + var index; + while ( ( index = jQuery.inArray( arg, list, index ) ) > -1 ) { + list.splice( index, 1 ); + + // Handle firing indexes + if ( index <= firingIndex ) { + firingIndex--; + } + } + } ); + return this; + }, + + // Check if a given callback is in the list. + // If no argument is given, return whether or not list has callbacks attached. + has: function( fn ) { + return fn ? + jQuery.inArray( fn, list ) > -1 : + list.length > 0; + }, + + // Remove all callbacks from the list + empty: function() { + if ( list ) { + list = []; + } + return this; + }, + + // Disable .fire and .add + // Abort any current/pending executions + // Clear all callbacks and values + disable: function() { + locked = queue = []; + list = memory = ""; + return this; + }, + disabled: function() { + return !list; + }, + + // Disable .fire + // Also disable .add unless we have memory (since it would have no effect) + // Abort any pending executions + lock: function() { + locked = queue = []; + if ( !memory && !firing ) { + list = memory = ""; + } + return this; + }, + locked: function() { + return !!locked; + }, + + // Call all callbacks with the given context and arguments + fireWith: function( context, args ) { + if ( !locked ) { + args = args || []; + args = [ context, args.slice ? args.slice() : args ]; + queue.push( args ); + if ( !firing ) { + fire(); + } + } + return this; + }, + + // Call all the callbacks with the given arguments + fire: function() { + self.fireWith( this, arguments ); + return this; + }, + + // To know if the callbacks have already been called at least once + fired: function() { + return !!fired; + } + }; + + return self; +}; + + +function Identity( v ) { + return v; +} +function Thrower( ex ) { + throw ex; +} + +function adoptValue( value, resolve, reject, noValue ) { + var method; + + try { + + // Check for promise aspect first to privilege synchronous behavior + if ( value && isFunction( ( method = value.promise ) ) ) { + method.call( value ).done( resolve ).fail( reject ); + + // Other thenables + } else if ( value && isFunction( ( method = value.then ) ) ) { + method.call( value, resolve, reject ); + + // Other non-thenables + } else { + + // Control `resolve` arguments by letting Array#slice cast boolean `noValue` to integer: + // * false: [ value ].slice( 0 ) => resolve( value ) + // * true: [ value ].slice( 1 ) => resolve() + resolve.apply( undefined, [ value ].slice( noValue ) ); + } + + // For Promises/A+, convert exceptions into rejections + // Since jQuery.when doesn't unwrap thenables, we can skip the extra checks appearing in + // Deferred#then to conditionally suppress rejection. + } catch ( value ) { + + // Support: Android 4.0 only + // Strict mode functions invoked without .call/.apply get global-object context + reject.apply( undefined, [ value ] ); + } +} + +jQuery.extend( { + + Deferred: function( func ) { + var tuples = [ + + // action, add listener, callbacks, + // ... .then handlers, argument index, [final state] + [ "notify", "progress", jQuery.Callbacks( "memory" ), + jQuery.Callbacks( "memory" ), 2 ], + [ "resolve", "done", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 0, "resolved" ], + [ "reject", "fail", jQuery.Callbacks( "once memory" ), + jQuery.Callbacks( "once memory" ), 1, "rejected" ] + ], + state = "pending", + promise = { + state: function() { + return state; + }, + always: function() { + deferred.done( arguments ).fail( arguments ); + return this; + }, + "catch": function( fn ) { + return promise.then( null, fn ); + }, + + // Keep pipe for back-compat + pipe: function( /* fnDone, fnFail, fnProgress */ ) { + var fns = arguments; + + return jQuery.Deferred( function( newDefer ) { + jQuery.each( tuples, function( _i, tuple ) { + + // Map tuples (progress, done, fail) to arguments (done, fail, progress) + var fn = isFunction( fns[ tuple[ 4 ] ] ) && fns[ tuple[ 4 ] ]; + + // deferred.progress(function() { bind to newDefer or newDefer.notify }) + // deferred.done(function() { bind to newDefer or newDefer.resolve }) + // deferred.fail(function() { bind to newDefer or newDefer.reject }) + deferred[ tuple[ 1 ] ]( function() { + var returned = fn && fn.apply( this, arguments ); + if ( returned && isFunction( returned.promise ) ) { + returned.promise() + .progress( newDefer.notify ) + .done( newDefer.resolve ) + .fail( newDefer.reject ); + } else { + newDefer[ tuple[ 0 ] + "With" ]( + this, + fn ? [ returned ] : arguments + ); + } + } ); + } ); + fns = null; + } ).promise(); + }, + then: function( onFulfilled, onRejected, onProgress ) { + var maxDepth = 0; + function resolve( depth, deferred, handler, special ) { + return function() { + var that = this, + args = arguments, + mightThrow = function() { + var returned, then; + + // Support: Promises/A+ section 2.3.3.3.3 + // https://promisesaplus.com/#point-59 + // Ignore double-resolution attempts + if ( depth < maxDepth ) { + return; + } + + returned = handler.apply( that, args ); + + // Support: Promises/A+ section 2.3.1 + // https://promisesaplus.com/#point-48 + if ( returned === deferred.promise() ) { + throw new TypeError( "Thenable self-resolution" ); + } + + // Support: Promises/A+ sections 2.3.3.1, 3.5 + // https://promisesaplus.com/#point-54 + // https://promisesaplus.com/#point-75 + // Retrieve `then` only once + then = returned && + + // Support: Promises/A+ section 2.3.4 + // https://promisesaplus.com/#point-64 + // Only check objects and functions for thenability + ( typeof returned === "object" || + typeof returned === "function" ) && + returned.then; + + // Handle a returned thenable + if ( isFunction( then ) ) { + + // Special processors (notify) just wait for resolution + if ( special ) { + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ) + ); + + // Normal processors (resolve) also hook into progress + } else { + + // ...and disregard older resolution values + maxDepth++; + + then.call( + returned, + resolve( maxDepth, deferred, Identity, special ), + resolve( maxDepth, deferred, Thrower, special ), + resolve( maxDepth, deferred, Identity, + deferred.notifyWith ) + ); + } + + // Handle all other returned values + } else { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Identity ) { + that = undefined; + args = [ returned ]; + } + + // Process the value(s) + // Default process is resolve + ( special || deferred.resolveWith )( that, args ); + } + }, + + // Only normal processors (resolve) catch and reject exceptions + process = special ? + mightThrow : + function() { + try { + mightThrow(); + } catch ( e ) { + + if ( jQuery.Deferred.exceptionHook ) { + jQuery.Deferred.exceptionHook( e, + process.stackTrace ); + } + + // Support: Promises/A+ section 2.3.3.3.4.1 + // https://promisesaplus.com/#point-61 + // Ignore post-resolution exceptions + if ( depth + 1 >= maxDepth ) { + + // Only substitute handlers pass on context + // and multiple values (non-spec behavior) + if ( handler !== Thrower ) { + that = undefined; + args = [ e ]; + } + + deferred.rejectWith( that, args ); + } + } + }; + + // Support: Promises/A+ section 2.3.3.3.1 + // https://promisesaplus.com/#point-57 + // Re-resolve promises immediately to dodge false rejection from + // subsequent errors + if ( depth ) { + process(); + } else { + + // Call an optional hook to record the stack, in case of exception + // since it's otherwise lost when execution goes async + if ( jQuery.Deferred.getStackHook ) { + process.stackTrace = jQuery.Deferred.getStackHook(); + } + window.setTimeout( process ); + } + }; + } + + return jQuery.Deferred( function( newDefer ) { + + // progress_handlers.add( ... ) + tuples[ 0 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onProgress ) ? + onProgress : + Identity, + newDefer.notifyWith + ) + ); + + // fulfilled_handlers.add( ... ) + tuples[ 1 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onFulfilled ) ? + onFulfilled : + Identity + ) + ); + + // rejected_handlers.add( ... ) + tuples[ 2 ][ 3 ].add( + resolve( + 0, + newDefer, + isFunction( onRejected ) ? + onRejected : + Thrower + ) + ); + } ).promise(); + }, + + // Get a promise for this deferred + // If obj is provided, the promise aspect is added to the object + promise: function( obj ) { + return obj != null ? jQuery.extend( obj, promise ) : promise; + } + }, + deferred = {}; + + // Add list-specific methods + jQuery.each( tuples, function( i, tuple ) { + var list = tuple[ 2 ], + stateString = tuple[ 5 ]; + + // promise.progress = list.add + // promise.done = list.add + // promise.fail = list.add + promise[ tuple[ 1 ] ] = list.add; + + // Handle state + if ( stateString ) { + list.add( + function() { + + // state = "resolved" (i.e., fulfilled) + // state = "rejected" + state = stateString; + }, + + // rejected_callbacks.disable + // fulfilled_callbacks.disable + tuples[ 3 - i ][ 2 ].disable, + + // rejected_handlers.disable + // fulfilled_handlers.disable + tuples[ 3 - i ][ 3 ].disable, + + // progress_callbacks.lock + tuples[ 0 ][ 2 ].lock, + + // progress_handlers.lock + tuples[ 0 ][ 3 ].lock + ); + } + + // progress_handlers.fire + // fulfilled_handlers.fire + // rejected_handlers.fire + list.add( tuple[ 3 ].fire ); + + // deferred.notify = function() { deferred.notifyWith(...) } + // deferred.resolve = function() { deferred.resolveWith(...) } + // deferred.reject = function() { deferred.rejectWith(...) } + deferred[ tuple[ 0 ] ] = function() { + deferred[ tuple[ 0 ] + "With" ]( this === deferred ? undefined : this, arguments ); + return this; + }; + + // deferred.notifyWith = list.fireWith + // deferred.resolveWith = list.fireWith + // deferred.rejectWith = list.fireWith + deferred[ tuple[ 0 ] + "With" ] = list.fireWith; + } ); + + // Make the deferred a promise + promise.promise( deferred ); + + // Call given func if any + if ( func ) { + func.call( deferred, deferred ); + } + + // All done! + return deferred; + }, + + // Deferred helper + when: function( singleValue ) { + var + + // count of uncompleted subordinates + remaining = arguments.length, + + // count of unprocessed arguments + i = remaining, + + // subordinate fulfillment data + resolveContexts = Array( i ), + resolveValues = slice.call( arguments ), + + // the master Deferred + master = jQuery.Deferred(), + + // subordinate callback factory + updateFunc = function( i ) { + return function( value ) { + resolveContexts[ i ] = this; + resolveValues[ i ] = arguments.length > 1 ? slice.call( arguments ) : value; + if ( !( --remaining ) ) { + master.resolveWith( resolveContexts, resolveValues ); + } + }; + }; + + // Single- and empty arguments are adopted like Promise.resolve + if ( remaining <= 1 ) { + adoptValue( singleValue, master.done( updateFunc( i ) ).resolve, master.reject, + !remaining ); + + // Use .then() to unwrap secondary thenables (cf. gh-3000) + if ( master.state() === "pending" || + isFunction( resolveValues[ i ] && resolveValues[ i ].then ) ) { + + return master.then(); + } + } + + // Multiple arguments are aggregated like Promise.all array elements + while ( i-- ) { + adoptValue( resolveValues[ i ], updateFunc( i ), master.reject ); + } + + return master.promise(); + } +} ); + + +// These usually indicate a programmer mistake during development, +// warn about them ASAP rather than swallowing them by default. +var rerrorNames = /^(Eval|Internal|Range|Reference|Syntax|Type|URI)Error$/; + +jQuery.Deferred.exceptionHook = function( error, stack ) { + + // Support: IE 8 - 9 only + // Console exists when dev tools are open, which can happen at any time + if ( window.console && window.console.warn && error && rerrorNames.test( error.name ) ) { + window.console.warn( "jQuery.Deferred exception: " + error.message, error.stack, stack ); + } +}; + + + + +jQuery.readyException = function( error ) { + window.setTimeout( function() { + throw error; + } ); +}; + + + + +// The deferred used on DOM ready +var readyList = jQuery.Deferred(); + +jQuery.fn.ready = function( fn ) { + + readyList + .then( fn ) + + // Wrap jQuery.readyException in a function so that the lookup + // happens at the time of error handling instead of callback + // registration. + .catch( function( error ) { + jQuery.readyException( error ); + } ); + + return this; +}; + +jQuery.extend( { + + // Is the DOM ready to be used? Set to true once it occurs. + isReady: false, + + // A counter to track how many items to wait for before + // the ready event fires. See #6781 + readyWait: 1, + + // Handle when the DOM is ready + ready: function( wait ) { + + // Abort if there are pending holds or we're already ready + if ( wait === true ? --jQuery.readyWait : jQuery.isReady ) { + return; + } + + // Remember that the DOM is ready + jQuery.isReady = true; + + // If a normal DOM Ready event fired, decrement, and wait if need be + if ( wait !== true && --jQuery.readyWait > 0 ) { + return; + } + + // If there are functions bound, to execute + readyList.resolveWith( document, [ jQuery ] ); + } +} ); + +jQuery.ready.then = readyList.then; + +// The ready event handler and self cleanup method +function completed() { + document.removeEventListener( "DOMContentLoaded", completed ); + window.removeEventListener( "load", completed ); + jQuery.ready(); +} + +// Catch cases where $(document).ready() is called +// after the browser event has already occurred. +// Support: IE <=9 - 10 only +// Older IE sometimes signals "interactive" too soon +if ( document.readyState === "complete" || + ( document.readyState !== "loading" && !document.documentElement.doScroll ) ) { + + // Handle it asynchronously to allow scripts the opportunity to delay ready + window.setTimeout( jQuery.ready ); + +} else { + + // Use the handy event callback + document.addEventListener( "DOMContentLoaded", completed ); + + // A fallback to window.onload, that will always work + window.addEventListener( "load", completed ); +} + + + + +// Multifunctional method to get and set values of a collection +// The value/s can optionally be executed if it's a function +var access = function( elems, fn, key, value, chainable, emptyGet, raw ) { + var i = 0, + len = elems.length, + bulk = key == null; + + // Sets many values + if ( toType( key ) === "object" ) { + chainable = true; + for ( i in key ) { + access( elems, fn, i, key[ i ], true, emptyGet, raw ); + } + + // Sets one value + } else if ( value !== undefined ) { + chainable = true; + + if ( !isFunction( value ) ) { + raw = true; + } + + if ( bulk ) { + + // Bulk operations run against the entire set + if ( raw ) { + fn.call( elems, value ); + fn = null; + + // ...except when executing function values + } else { + bulk = fn; + fn = function( elem, _key, value ) { + return bulk.call( jQuery( elem ), value ); + }; + } + } + + if ( fn ) { + for ( ; i < len; i++ ) { + fn( + elems[ i ], key, raw ? + value : + value.call( elems[ i ], i, fn( elems[ i ], key ) ) + ); + } + } + } + + if ( chainable ) { + return elems; + } + + // Gets + if ( bulk ) { + return fn.call( elems ); + } + + return len ? fn( elems[ 0 ], key ) : emptyGet; +}; + + +// Matches dashed string for camelizing +var rmsPrefix = /^-ms-/, + rdashAlpha = /-([a-z])/g; + +// Used by camelCase as callback to replace() +function fcamelCase( _all, letter ) { + return letter.toUpperCase(); +} + +// Convert dashed to camelCase; used by the css and data modules +// Support: IE <=9 - 11, Edge 12 - 15 +// Microsoft forgot to hump their vendor prefix (#9572) +function camelCase( string ) { + return string.replace( rmsPrefix, "ms-" ).replace( rdashAlpha, fcamelCase ); +} +var acceptData = function( owner ) { + + // Accepts only: + // - Node + // - Node.ELEMENT_NODE + // - Node.DOCUMENT_NODE + // - Object + // - Any + return owner.nodeType === 1 || owner.nodeType === 9 || !( +owner.nodeType ); +}; + + + + +function Data() { + this.expando = jQuery.expando + Data.uid++; +} + +Data.uid = 1; + +Data.prototype = { + + cache: function( owner ) { + + // Check if the owner object already has a cache + var value = owner[ this.expando ]; + + // If not, create one + if ( !value ) { + value = {}; + + // We can accept data for non-element nodes in modern browsers, + // but we should not, see #8335. + // Always return an empty object. + if ( acceptData( owner ) ) { + + // If it is a node unlikely to be stringify-ed or looped over + // use plain assignment + if ( owner.nodeType ) { + owner[ this.expando ] = value; + + // Otherwise secure it in a non-enumerable property + // configurable must be true to allow the property to be + // deleted when data is removed + } else { + Object.defineProperty( owner, this.expando, { + value: value, + configurable: true + } ); + } + } + } + + return value; + }, + set: function( owner, data, value ) { + var prop, + cache = this.cache( owner ); + + // Handle: [ owner, key, value ] args + // Always use camelCase key (gh-2257) + if ( typeof data === "string" ) { + cache[ camelCase( data ) ] = value; + + // Handle: [ owner, { properties } ] args + } else { + + // Copy the properties one-by-one to the cache object + for ( prop in data ) { + cache[ camelCase( prop ) ] = data[ prop ]; + } + } + return cache; + }, + get: function( owner, key ) { + return key === undefined ? + this.cache( owner ) : + + // Always use camelCase key (gh-2257) + owner[ this.expando ] && owner[ this.expando ][ camelCase( key ) ]; + }, + access: function( owner, key, value ) { + + // In cases where either: + // + // 1. No key was specified + // 2. A string key was specified, but no value provided + // + // Take the "read" path and allow the get method to determine + // which value to return, respectively either: + // + // 1. The entire cache object + // 2. The data stored at the key + // + if ( key === undefined || + ( ( key && typeof key === "string" ) && value === undefined ) ) { + + return this.get( owner, key ); + } + + // When the key is not a string, or both a key and value + // are specified, set or extend (existing objects) with either: + // + // 1. An object of properties + // 2. A key and value + // + this.set( owner, key, value ); + + // Since the "set" path can have two possible entry points + // return the expected data based on which path was taken[*] + return value !== undefined ? value : key; + }, + remove: function( owner, key ) { + var i, + cache = owner[ this.expando ]; + + if ( cache === undefined ) { + return; + } + + if ( key !== undefined ) { + + // Support array or space separated string of keys + if ( Array.isArray( key ) ) { + + // If key is an array of keys... + // We always set camelCase keys, so remove that. + key = key.map( camelCase ); + } else { + key = camelCase( key ); + + // If a key with the spaces exists, use it. + // Otherwise, create an array by matching non-whitespace + key = key in cache ? + [ key ] : + ( key.match( rnothtmlwhite ) || [] ); + } + + i = key.length; + + while ( i-- ) { + delete cache[ key[ i ] ]; + } + } + + // Remove the expando if there's no more data + if ( key === undefined || jQuery.isEmptyObject( cache ) ) { + + // Support: Chrome <=35 - 45 + // Webkit & Blink performance suffers when deleting properties + // from DOM nodes, so set to undefined instead + // https://bugs.chromium.org/p/chromium/issues/detail?id=378607 (bug restricted) + if ( owner.nodeType ) { + owner[ this.expando ] = undefined; + } else { + delete owner[ this.expando ]; + } + } + }, + hasData: function( owner ) { + var cache = owner[ this.expando ]; + return cache !== undefined && !jQuery.isEmptyObject( cache ); + } +}; +var dataPriv = new Data(); + +var dataUser = new Data(); + + + +// Implementation Summary +// +// 1. Enforce API surface and semantic compatibility with 1.9.x branch +// 2. Improve the module's maintainability by reducing the storage +// paths to a single mechanism. +// 3. Use the same single mechanism to support "private" and "user" data. +// 4. _Never_ expose "private" data to user code (TODO: Drop _data, _removeData) +// 5. Avoid exposing implementation details on user objects (eg. expando properties) +// 6. Provide a clear path for implementation upgrade to WeakMap in 2014 + +var rbrace = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, + rmultiDash = /[A-Z]/g; + +function getData( data ) { + if ( data === "true" ) { + return true; + } + + if ( data === "false" ) { + return false; + } + + if ( data === "null" ) { + return null; + } + + // Only convert to a number if it doesn't change the string + if ( data === +data + "" ) { + return +data; + } + + if ( rbrace.test( data ) ) { + return JSON.parse( data ); + } + + return data; +} + +function dataAttr( elem, key, data ) { + var name; + + // If nothing was found internally, try to fetch any + // data from the HTML5 data-* attribute + if ( data === undefined && elem.nodeType === 1 ) { + name = "data-" + key.replace( rmultiDash, "-$&" ).toLowerCase(); + data = elem.getAttribute( name ); + + if ( typeof data === "string" ) { + try { + data = getData( data ); + } catch ( e ) {} + + // Make sure we set the data so it isn't changed later + dataUser.set( elem, key, data ); + } else { + data = undefined; + } + } + return data; +} + +jQuery.extend( { + hasData: function( elem ) { + return dataUser.hasData( elem ) || dataPriv.hasData( elem ); + }, + + data: function( elem, name, data ) { + return dataUser.access( elem, name, data ); + }, + + removeData: function( elem, name ) { + dataUser.remove( elem, name ); + }, + + // TODO: Now that all calls to _data and _removeData have been replaced + // with direct calls to dataPriv methods, these can be deprecated. + _data: function( elem, name, data ) { + return dataPriv.access( elem, name, data ); + }, + + _removeData: function( elem, name ) { + dataPriv.remove( elem, name ); + } +} ); + +jQuery.fn.extend( { + data: function( key, value ) { + var i, name, data, + elem = this[ 0 ], + attrs = elem && elem.attributes; + + // Gets all values + if ( key === undefined ) { + if ( this.length ) { + data = dataUser.get( elem ); + + if ( elem.nodeType === 1 && !dataPriv.get( elem, "hasDataAttrs" ) ) { + i = attrs.length; + while ( i-- ) { + + // Support: IE 11 only + // The attrs elements can be null (#14894) + if ( attrs[ i ] ) { + name = attrs[ i ].name; + if ( name.indexOf( "data-" ) === 0 ) { + name = camelCase( name.slice( 5 ) ); + dataAttr( elem, name, data[ name ] ); + } + } + } + dataPriv.set( elem, "hasDataAttrs", true ); + } + } + + return data; + } + + // Sets multiple values + if ( typeof key === "object" ) { + return this.each( function() { + dataUser.set( this, key ); + } ); + } + + return access( this, function( value ) { + var data; + + // The calling jQuery object (element matches) is not empty + // (and therefore has an element appears at this[ 0 ]) and the + // `value` parameter was not undefined. An empty jQuery object + // will result in `undefined` for elem = this[ 0 ] which will + // throw an exception if an attempt to read a data cache is made. + if ( elem && value === undefined ) { + + // Attempt to get data from the cache + // The key will always be camelCased in Data + data = dataUser.get( elem, key ); + if ( data !== undefined ) { + return data; + } + + // Attempt to "discover" the data in + // HTML5 custom data-* attrs + data = dataAttr( elem, key ); + if ( data !== undefined ) { + return data; + } + + // We tried really hard, but the data doesn't exist. + return; + } + + // Set the data... + this.each( function() { + + // We always store the camelCased key + dataUser.set( this, key, value ); + } ); + }, null, value, arguments.length > 1, null, true ); + }, + + removeData: function( key ) { + return this.each( function() { + dataUser.remove( this, key ); + } ); + } +} ); + + +jQuery.extend( { + queue: function( elem, type, data ) { + var queue; + + if ( elem ) { + type = ( type || "fx" ) + "queue"; + queue = dataPriv.get( elem, type ); + + // Speed up dequeue by getting out quickly if this is just a lookup + if ( data ) { + if ( !queue || Array.isArray( data ) ) { + queue = dataPriv.access( elem, type, jQuery.makeArray( data ) ); + } else { + queue.push( data ); + } + } + return queue || []; + } + }, + + dequeue: function( elem, type ) { + type = type || "fx"; + + var queue = jQuery.queue( elem, type ), + startLength = queue.length, + fn = queue.shift(), + hooks = jQuery._queueHooks( elem, type ), + next = function() { + jQuery.dequeue( elem, type ); + }; + + // If the fx queue is dequeued, always remove the progress sentinel + if ( fn === "inprogress" ) { + fn = queue.shift(); + startLength--; + } + + if ( fn ) { + + // Add a progress sentinel to prevent the fx queue from being + // automatically dequeued + if ( type === "fx" ) { + queue.unshift( "inprogress" ); + } + + // Clear up the last queue stop function + delete hooks.stop; + fn.call( elem, next, hooks ); + } + + if ( !startLength && hooks ) { + hooks.empty.fire(); + } + }, + + // Not public - generate a queueHooks object, or return the current one + _queueHooks: function( elem, type ) { + var key = type + "queueHooks"; + return dataPriv.get( elem, key ) || dataPriv.access( elem, key, { + empty: jQuery.Callbacks( "once memory" ).add( function() { + dataPriv.remove( elem, [ type + "queue", key ] ); + } ) + } ); + } +} ); + +jQuery.fn.extend( { + queue: function( type, data ) { + var setter = 2; + + if ( typeof type !== "string" ) { + data = type; + type = "fx"; + setter--; + } + + if ( arguments.length < setter ) { + return jQuery.queue( this[ 0 ], type ); + } + + return data === undefined ? + this : + this.each( function() { + var queue = jQuery.queue( this, type, data ); + + // Ensure a hooks for this queue + jQuery._queueHooks( this, type ); + + if ( type === "fx" && queue[ 0 ] !== "inprogress" ) { + jQuery.dequeue( this, type ); + } + } ); + }, + dequeue: function( type ) { + return this.each( function() { + jQuery.dequeue( this, type ); + } ); + }, + clearQueue: function( type ) { + return this.queue( type || "fx", [] ); + }, + + // Get a promise resolved when queues of a certain type + // are emptied (fx is the type by default) + promise: function( type, obj ) { + var tmp, + count = 1, + defer = jQuery.Deferred(), + elements = this, + i = this.length, + resolve = function() { + if ( !( --count ) ) { + defer.resolveWith( elements, [ elements ] ); + } + }; + + if ( typeof type !== "string" ) { + obj = type; + type = undefined; + } + type = type || "fx"; + + while ( i-- ) { + tmp = dataPriv.get( elements[ i ], type + "queueHooks" ); + if ( tmp && tmp.empty ) { + count++; + tmp.empty.add( resolve ); + } + } + resolve(); + return defer.promise( obj ); + } +} ); +var pnum = ( /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/ ).source; + +var rcssNum = new RegExp( "^(?:([+-])=|)(" + pnum + ")([a-z%]*)$", "i" ); + + +var cssExpand = [ "Top", "Right", "Bottom", "Left" ]; + +var documentElement = document.documentElement; + + + + var isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ); + }, + composed = { composed: true }; + + // Support: IE 9 - 11+, Edge 12 - 18+, iOS 10.0 - 10.2 only + // Check attachment across shadow DOM boundaries when possible (gh-3504) + // Support: iOS 10.0-10.2 only + // Early iOS 10 versions support `attachShadow` but not `getRootNode`, + // leading to errors. We need to check for `getRootNode`. + if ( documentElement.getRootNode ) { + isAttached = function( elem ) { + return jQuery.contains( elem.ownerDocument, elem ) || + elem.getRootNode( composed ) === elem.ownerDocument; + }; + } +var isHiddenWithinTree = function( elem, el ) { + + // isHiddenWithinTree might be called from jQuery#filter function; + // in that case, element will be second argument + elem = el || elem; + + // Inline style trumps all + return elem.style.display === "none" || + elem.style.display === "" && + + // Otherwise, check computed style + // Support: Firefox <=43 - 45 + // Disconnected elements can have computed display: none, so first confirm that elem is + // in the document. + isAttached( elem ) && + + jQuery.css( elem, "display" ) === "none"; + }; + + + +function adjustCSS( elem, prop, valueParts, tween ) { + var adjusted, scale, + maxIterations = 20, + currentValue = tween ? + function() { + return tween.cur(); + } : + function() { + return jQuery.css( elem, prop, "" ); + }, + initial = currentValue(), + unit = valueParts && valueParts[ 3 ] || ( jQuery.cssNumber[ prop ] ? "" : "px" ), + + // Starting value computation is required for potential unit mismatches + initialInUnit = elem.nodeType && + ( jQuery.cssNumber[ prop ] || unit !== "px" && +initial ) && + rcssNum.exec( jQuery.css( elem, prop ) ); + + if ( initialInUnit && initialInUnit[ 3 ] !== unit ) { + + // Support: Firefox <=54 + // Halve the iteration target value to prevent interference from CSS upper bounds (gh-2144) + initial = initial / 2; + + // Trust units reported by jQuery.css + unit = unit || initialInUnit[ 3 ]; + + // Iteratively approximate from a nonzero starting point + initialInUnit = +initial || 1; + + while ( maxIterations-- ) { + + // Evaluate and update our best guess (doubling guesses that zero out). + // Finish if the scale equals or crosses 1 (making the old*new product non-positive). + jQuery.style( elem, prop, initialInUnit + unit ); + if ( ( 1 - scale ) * ( 1 - ( scale = currentValue() / initial || 0.5 ) ) <= 0 ) { + maxIterations = 0; + } + initialInUnit = initialInUnit / scale; + + } + + initialInUnit = initialInUnit * 2; + jQuery.style( elem, prop, initialInUnit + unit ); + + // Make sure we update the tween properties later on + valueParts = valueParts || []; + } + + if ( valueParts ) { + initialInUnit = +initialInUnit || +initial || 0; + + // Apply relative offset (+=/-=) if specified + adjusted = valueParts[ 1 ] ? + initialInUnit + ( valueParts[ 1 ] + 1 ) * valueParts[ 2 ] : + +valueParts[ 2 ]; + if ( tween ) { + tween.unit = unit; + tween.start = initialInUnit; + tween.end = adjusted; + } + } + return adjusted; +} + + +var defaultDisplayMap = {}; + +function getDefaultDisplay( elem ) { + var temp, + doc = elem.ownerDocument, + nodeName = elem.nodeName, + display = defaultDisplayMap[ nodeName ]; + + if ( display ) { + return display; + } + + temp = doc.body.appendChild( doc.createElement( nodeName ) ); + display = jQuery.css( temp, "display" ); + + temp.parentNode.removeChild( temp ); + + if ( display === "none" ) { + display = "block"; + } + defaultDisplayMap[ nodeName ] = display; + + return display; +} + +function showHide( elements, show ) { + var display, elem, + values = [], + index = 0, + length = elements.length; + + // Determine new display value for elements that need to change + for ( ; index < length; index++ ) { + elem = elements[ index ]; + if ( !elem.style ) { + continue; + } + + display = elem.style.display; + if ( show ) { + + // Since we force visibility upon cascade-hidden elements, an immediate (and slow) + // check is required in this first loop unless we have a nonempty display value (either + // inline or about-to-be-restored) + if ( display === "none" ) { + values[ index ] = dataPriv.get( elem, "display" ) || null; + if ( !values[ index ] ) { + elem.style.display = ""; + } + } + if ( elem.style.display === "" && isHiddenWithinTree( elem ) ) { + values[ index ] = getDefaultDisplay( elem ); + } + } else { + if ( display !== "none" ) { + values[ index ] = "none"; + + // Remember what we're overwriting + dataPriv.set( elem, "display", display ); + } + } + } + + // Set the display of the elements in a second loop to avoid constant reflow + for ( index = 0; index < length; index++ ) { + if ( values[ index ] != null ) { + elements[ index ].style.display = values[ index ]; + } + } + + return elements; +} + +jQuery.fn.extend( { + show: function() { + return showHide( this, true ); + }, + hide: function() { + return showHide( this ); + }, + toggle: function( state ) { + if ( typeof state === "boolean" ) { + return state ? this.show() : this.hide(); + } + + return this.each( function() { + if ( isHiddenWithinTree( this ) ) { + jQuery( this ).show(); + } else { + jQuery( this ).hide(); + } + } ); + } +} ); +var rcheckableType = ( /^(?:checkbox|radio)$/i ); + +var rtagName = ( /<([a-z][^\/\0>\x20\t\r\n\f]*)/i ); + +var rscriptType = ( /^$|^module$|\/(?:java|ecma)script/i ); + + + +( function() { + var fragment = document.createDocumentFragment(), + div = fragment.appendChild( document.createElement( "div" ) ), + input = document.createElement( "input" ); + + // Support: Android 4.0 - 4.3 only + // Check state lost if the name is set (#11217) + // Support: Windows Web Apps (WWA) + // `name` and `type` must use .setAttribute for WWA (#14901) + input.setAttribute( "type", "radio" ); + input.setAttribute( "checked", "checked" ); + input.setAttribute( "name", "t" ); + + div.appendChild( input ); + + // Support: Android <=4.1 only + // Older WebKit doesn't clone checked state correctly in fragments + support.checkClone = div.cloneNode( true ).cloneNode( true ).lastChild.checked; + + // Support: IE <=11 only + // Make sure textarea (and checkbox) defaultValue is properly cloned + div.innerHTML = ""; + support.noCloneChecked = !!div.cloneNode( true ).lastChild.defaultValue; + + // Support: IE <=9 only + // IE <=9 replaces "; + support.option = !!div.lastChild; +} )(); + + +// We have to close these tags to support XHTML (#13200) +var wrapMap = { + + // XHTML parsers do not magically insert elements in the + // same way that tag soup parsers do. So we cannot shorten + // this by omitting or other required elements. + thead: [ 1, "", "
" ], + col: [ 2, "", "
" ], + tr: [ 2, "", "
" ], + td: [ 3, "", "
" ], + + _default: [ 0, "", "" ] +}; + +wrapMap.tbody = wrapMap.tfoot = wrapMap.colgroup = wrapMap.caption = wrapMap.thead; +wrapMap.th = wrapMap.td; + +// Support: IE <=9 only +if ( !support.option ) { + wrapMap.optgroup = wrapMap.option = [ 1, "" ]; +} + + +function getAll( context, tag ) { + + // Support: IE <=9 - 11 only + // Use typeof to avoid zero-argument method invocation on host objects (#15151) + var ret; + + if ( typeof context.getElementsByTagName !== "undefined" ) { + ret = context.getElementsByTagName( tag || "*" ); + + } else if ( typeof context.querySelectorAll !== "undefined" ) { + ret = context.querySelectorAll( tag || "*" ); + + } else { + ret = []; + } + + if ( tag === undefined || tag && nodeName( context, tag ) ) { + return jQuery.merge( [ context ], ret ); + } + + return ret; +} + + +// Mark scripts as having already been evaluated +function setGlobalEval( elems, refElements ) { + var i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + dataPriv.set( + elems[ i ], + "globalEval", + !refElements || dataPriv.get( refElements[ i ], "globalEval" ) + ); + } +} + + +var rhtml = /<|&#?\w+;/; + +function buildFragment( elems, context, scripts, selection, ignored ) { + var elem, tmp, tag, wrap, attached, j, + fragment = context.createDocumentFragment(), + nodes = [], + i = 0, + l = elems.length; + + for ( ; i < l; i++ ) { + elem = elems[ i ]; + + if ( elem || elem === 0 ) { + + // Add nodes directly + if ( toType( elem ) === "object" ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, elem.nodeType ? [ elem ] : elem ); + + // Convert non-html into a text node + } else if ( !rhtml.test( elem ) ) { + nodes.push( context.createTextNode( elem ) ); + + // Convert html into DOM nodes + } else { + tmp = tmp || fragment.appendChild( context.createElement( "div" ) ); + + // Deserialize a standard representation + tag = ( rtagName.exec( elem ) || [ "", "" ] )[ 1 ].toLowerCase(); + wrap = wrapMap[ tag ] || wrapMap._default; + tmp.innerHTML = wrap[ 1 ] + jQuery.htmlPrefilter( elem ) + wrap[ 2 ]; + + // Descend through wrappers to the right content + j = wrap[ 0 ]; + while ( j-- ) { + tmp = tmp.lastChild; + } + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( nodes, tmp.childNodes ); + + // Remember the top-level container + tmp = fragment.firstChild; + + // Ensure the created nodes are orphaned (#12392) + tmp.textContent = ""; + } + } + } + + // Remove wrapper from fragment + fragment.textContent = ""; + + i = 0; + while ( ( elem = nodes[ i++ ] ) ) { + + // Skip elements already in the context collection (trac-4087) + if ( selection && jQuery.inArray( elem, selection ) > -1 ) { + if ( ignored ) { + ignored.push( elem ); + } + continue; + } + + attached = isAttached( elem ); + + // Append to fragment + tmp = getAll( fragment.appendChild( elem ), "script" ); + + // Preserve script evaluation history + if ( attached ) { + setGlobalEval( tmp ); + } + + // Capture executables + if ( scripts ) { + j = 0; + while ( ( elem = tmp[ j++ ] ) ) { + if ( rscriptType.test( elem.type || "" ) ) { + scripts.push( elem ); + } + } + } + } + + return fragment; +} + + +var + rkeyEvent = /^key/, + rmouseEvent = /^(?:mouse|pointer|contextmenu|drag|drop)|click/, + rtypenamespace = /^([^.]*)(?:\.(.+)|)/; + +function returnTrue() { + return true; +} + +function returnFalse() { + return false; +} + +// Support: IE <=9 - 11+ +// focus() and blur() are asynchronous, except when they are no-op. +// So expect focus to be synchronous when the element is already active, +// and blur to be synchronous when the element is not already active. +// (focus and blur are always synchronous in other supported browsers, +// this just defines when we can count on it). +function expectSync( elem, type ) { + return ( elem === safeActiveElement() ) === ( type === "focus" ); +} + +// Support: IE <=9 only +// Accessing document.activeElement can throw unexpectedly +// https://bugs.jquery.com/ticket/13393 +function safeActiveElement() { + try { + return document.activeElement; + } catch ( err ) { } +} + +function on( elem, types, selector, data, fn, one ) { + var origFn, type; + + // Types can be a map of types/handlers + if ( typeof types === "object" ) { + + // ( types-Object, selector, data ) + if ( typeof selector !== "string" ) { + + // ( types-Object, data ) + data = data || selector; + selector = undefined; + } + for ( type in types ) { + on( elem, type, selector, data, types[ type ], one ); + } + return elem; + } + + if ( data == null && fn == null ) { + + // ( types, fn ) + fn = selector; + data = selector = undefined; + } else if ( fn == null ) { + if ( typeof selector === "string" ) { + + // ( types, selector, fn ) + fn = data; + data = undefined; + } else { + + // ( types, data, fn ) + fn = data; + data = selector; + selector = undefined; + } + } + if ( fn === false ) { + fn = returnFalse; + } else if ( !fn ) { + return elem; + } + + if ( one === 1 ) { + origFn = fn; + fn = function( event ) { + + // Can use an empty set, since event contains the info + jQuery().off( event ); + return origFn.apply( this, arguments ); + }; + + // Use same guid so caller can remove using origFn + fn.guid = origFn.guid || ( origFn.guid = jQuery.guid++ ); + } + return elem.each( function() { + jQuery.event.add( this, types, fn, data, selector ); + } ); +} + +/* + * Helper functions for managing events -- not part of the public interface. + * Props to Dean Edwards' addEvent library for many of the ideas. + */ +jQuery.event = { + + global: {}, + + add: function( elem, types, handler, data, selector ) { + + var handleObjIn, eventHandle, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.get( elem ); + + // Only attach events to objects that accept data + if ( !acceptData( elem ) ) { + return; + } + + // Caller can pass in an object of custom data in lieu of the handler + if ( handler.handler ) { + handleObjIn = handler; + handler = handleObjIn.handler; + selector = handleObjIn.selector; + } + + // Ensure that invalid selectors throw exceptions at attach time + // Evaluate against documentElement in case elem is a non-element node (e.g., document) + if ( selector ) { + jQuery.find.matchesSelector( documentElement, selector ); + } + + // Make sure that the handler has a unique ID, used to find/remove it later + if ( !handler.guid ) { + handler.guid = jQuery.guid++; + } + + // Init the element's event structure and main handler, if this is the first + if ( !( events = elemData.events ) ) { + events = elemData.events = Object.create( null ); + } + if ( !( eventHandle = elemData.handle ) ) { + eventHandle = elemData.handle = function( e ) { + + // Discard the second event of a jQuery.event.trigger() and + // when an event is called after a page has unloaded + return typeof jQuery !== "undefined" && jQuery.event.triggered !== e.type ? + jQuery.event.dispatch.apply( elem, arguments ) : undefined; + }; + } + + // Handle multiple events separated by a space + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // There *must* be a type, no attaching namespace-only handlers + if ( !type ) { + continue; + } + + // If event changes its type, use the special event handlers for the changed type + special = jQuery.event.special[ type ] || {}; + + // If selector defined, determine special event api type, otherwise given type + type = ( selector ? special.delegateType : special.bindType ) || type; + + // Update special based on newly reset type + special = jQuery.event.special[ type ] || {}; + + // handleObj is passed to all event handlers + handleObj = jQuery.extend( { + type: type, + origType: origType, + data: data, + handler: handler, + guid: handler.guid, + selector: selector, + needsContext: selector && jQuery.expr.match.needsContext.test( selector ), + namespace: namespaces.join( "." ) + }, handleObjIn ); + + // Init the event handler queue if we're the first + if ( !( handlers = events[ type ] ) ) { + handlers = events[ type ] = []; + handlers.delegateCount = 0; + + // Only use addEventListener if the special events handler returns false + if ( !special.setup || + special.setup.call( elem, data, namespaces, eventHandle ) === false ) { + + if ( elem.addEventListener ) { + elem.addEventListener( type, eventHandle ); + } + } + } + + if ( special.add ) { + special.add.call( elem, handleObj ); + + if ( !handleObj.handler.guid ) { + handleObj.handler.guid = handler.guid; + } + } + + // Add to the element's handler list, delegates in front + if ( selector ) { + handlers.splice( handlers.delegateCount++, 0, handleObj ); + } else { + handlers.push( handleObj ); + } + + // Keep track of which events have ever been used, for event optimization + jQuery.event.global[ type ] = true; + } + + }, + + // Detach an event or set of events from an element + remove: function( elem, types, handler, selector, mappedTypes ) { + + var j, origCount, tmp, + events, t, handleObj, + special, handlers, type, namespaces, origType, + elemData = dataPriv.hasData( elem ) && dataPriv.get( elem ); + + if ( !elemData || !( events = elemData.events ) ) { + return; + } + + // Once for each type.namespace in types; type may be omitted + types = ( types || "" ).match( rnothtmlwhite ) || [ "" ]; + t = types.length; + while ( t-- ) { + tmp = rtypenamespace.exec( types[ t ] ) || []; + type = origType = tmp[ 1 ]; + namespaces = ( tmp[ 2 ] || "" ).split( "." ).sort(); + + // Unbind all events (on this namespace, if provided) for the element + if ( !type ) { + for ( type in events ) { + jQuery.event.remove( elem, type + types[ t ], handler, selector, true ); + } + continue; + } + + special = jQuery.event.special[ type ] || {}; + type = ( selector ? special.delegateType : special.bindType ) || type; + handlers = events[ type ] || []; + tmp = tmp[ 2 ] && + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ); + + // Remove matching events + origCount = j = handlers.length; + while ( j-- ) { + handleObj = handlers[ j ]; + + if ( ( mappedTypes || origType === handleObj.origType ) && + ( !handler || handler.guid === handleObj.guid ) && + ( !tmp || tmp.test( handleObj.namespace ) ) && + ( !selector || selector === handleObj.selector || + selector === "**" && handleObj.selector ) ) { + handlers.splice( j, 1 ); + + if ( handleObj.selector ) { + handlers.delegateCount--; + } + if ( special.remove ) { + special.remove.call( elem, handleObj ); + } + } + } + + // Remove generic event handler if we removed something and no more handlers exist + // (avoids potential for endless recursion during removal of special event handlers) + if ( origCount && !handlers.length ) { + if ( !special.teardown || + special.teardown.call( elem, namespaces, elemData.handle ) === false ) { + + jQuery.removeEvent( elem, type, elemData.handle ); + } + + delete events[ type ]; + } + } + + // Remove data and the expando if it's no longer used + if ( jQuery.isEmptyObject( events ) ) { + dataPriv.remove( elem, "handle events" ); + } + }, + + dispatch: function( nativeEvent ) { + + var i, j, ret, matched, handleObj, handlerQueue, + args = new Array( arguments.length ), + + // Make a writable jQuery.Event from the native event object + event = jQuery.event.fix( nativeEvent ), + + handlers = ( + dataPriv.get( this, "events" ) || Object.create( null ) + )[ event.type ] || [], + special = jQuery.event.special[ event.type ] || {}; + + // Use the fix-ed jQuery.Event rather than the (read-only) native event + args[ 0 ] = event; + + for ( i = 1; i < arguments.length; i++ ) { + args[ i ] = arguments[ i ]; + } + + event.delegateTarget = this; + + // Call the preDispatch hook for the mapped type, and let it bail if desired + if ( special.preDispatch && special.preDispatch.call( this, event ) === false ) { + return; + } + + // Determine handlers + handlerQueue = jQuery.event.handlers.call( this, event, handlers ); + + // Run delegates first; they may want to stop propagation beneath us + i = 0; + while ( ( matched = handlerQueue[ i++ ] ) && !event.isPropagationStopped() ) { + event.currentTarget = matched.elem; + + j = 0; + while ( ( handleObj = matched.handlers[ j++ ] ) && + !event.isImmediatePropagationStopped() ) { + + // If the event is namespaced, then each handler is only invoked if it is + // specially universal or its namespaces are a superset of the event's. + if ( !event.rnamespace || handleObj.namespace === false || + event.rnamespace.test( handleObj.namespace ) ) { + + event.handleObj = handleObj; + event.data = handleObj.data; + + ret = ( ( jQuery.event.special[ handleObj.origType ] || {} ).handle || + handleObj.handler ).apply( matched.elem, args ); + + if ( ret !== undefined ) { + if ( ( event.result = ret ) === false ) { + event.preventDefault(); + event.stopPropagation(); + } + } + } + } + } + + // Call the postDispatch hook for the mapped type + if ( special.postDispatch ) { + special.postDispatch.call( this, event ); + } + + return event.result; + }, + + handlers: function( event, handlers ) { + var i, handleObj, sel, matchedHandlers, matchedSelectors, + handlerQueue = [], + delegateCount = handlers.delegateCount, + cur = event.target; + + // Find delegate handlers + if ( delegateCount && + + // Support: IE <=9 + // Black-hole SVG instance trees (trac-13180) + cur.nodeType && + + // Support: Firefox <=42 + // Suppress spec-violating clicks indicating a non-primary pointer button (trac-3861) + // https://www.w3.org/TR/DOM-Level-3-Events/#event-type-click + // Support: IE 11 only + // ...but not arrow key "clicks" of radio inputs, which can have `button` -1 (gh-2343) + !( event.type === "click" && event.button >= 1 ) ) { + + for ( ; cur !== this; cur = cur.parentNode || this ) { + + // Don't check non-elements (#13208) + // Don't process clicks on disabled elements (#6911, #8165, #11382, #11764) + if ( cur.nodeType === 1 && !( event.type === "click" && cur.disabled === true ) ) { + matchedHandlers = []; + matchedSelectors = {}; + for ( i = 0; i < delegateCount; i++ ) { + handleObj = handlers[ i ]; + + // Don't conflict with Object.prototype properties (#13203) + sel = handleObj.selector + " "; + + if ( matchedSelectors[ sel ] === undefined ) { + matchedSelectors[ sel ] = handleObj.needsContext ? + jQuery( sel, this ).index( cur ) > -1 : + jQuery.find( sel, this, null, [ cur ] ).length; + } + if ( matchedSelectors[ sel ] ) { + matchedHandlers.push( handleObj ); + } + } + if ( matchedHandlers.length ) { + handlerQueue.push( { elem: cur, handlers: matchedHandlers } ); + } + } + } + } + + // Add the remaining (directly-bound) handlers + cur = this; + if ( delegateCount < handlers.length ) { + handlerQueue.push( { elem: cur, handlers: handlers.slice( delegateCount ) } ); + } + + return handlerQueue; + }, + + addProp: function( name, hook ) { + Object.defineProperty( jQuery.Event.prototype, name, { + enumerable: true, + configurable: true, + + get: isFunction( hook ) ? + function() { + if ( this.originalEvent ) { + return hook( this.originalEvent ); + } + } : + function() { + if ( this.originalEvent ) { + return this.originalEvent[ name ]; + } + }, + + set: function( value ) { + Object.defineProperty( this, name, { + enumerable: true, + configurable: true, + writable: true, + value: value + } ); + } + } ); + }, + + fix: function( originalEvent ) { + return originalEvent[ jQuery.expando ] ? + originalEvent : + new jQuery.Event( originalEvent ); + }, + + special: { + load: { + + // Prevent triggered image.load events from bubbling to window.load + noBubble: true + }, + click: { + + // Utilize native event to ensure correct state for checkable inputs + setup: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Claim the first handler + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + // dataPriv.set( el, "click", ... ) + leverageNative( el, "click", returnTrue ); + } + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function( data ) { + + // For mutual compressibility with _default, replace `this` access with a local var. + // `|| data` is dead code meant only to preserve the variable through minification. + var el = this || data; + + // Force setup before triggering a click + if ( rcheckableType.test( el.type ) && + el.click && nodeName( el, "input" ) ) { + + leverageNative( el, "click" ); + } + + // Return non-false to allow normal event-path propagation + return true; + }, + + // For cross-browser consistency, suppress native .click() on links + // Also prevent it if we're currently inside a leveraged native-event stack + _default: function( event ) { + var target = event.target; + return rcheckableType.test( target.type ) && + target.click && nodeName( target, "input" ) && + dataPriv.get( target, "click" ) || + nodeName( target, "a" ); + } + }, + + beforeunload: { + postDispatch: function( event ) { + + // Support: Firefox 20+ + // Firefox doesn't alert if the returnValue field is not set. + if ( event.result !== undefined && event.originalEvent ) { + event.originalEvent.returnValue = event.result; + } + } + } + } +}; + +// Ensure the presence of an event listener that handles manually-triggered +// synthetic events by interrupting progress until reinvoked in response to +// *native* events that it fires directly, ensuring that state changes have +// already occurred before other listeners are invoked. +function leverageNative( el, type, expectSync ) { + + // Missing expectSync indicates a trigger call, which must force setup through jQuery.event.add + if ( !expectSync ) { + if ( dataPriv.get( el, type ) === undefined ) { + jQuery.event.add( el, type, returnTrue ); + } + return; + } + + // Register the controller as a special universal handler for all event namespaces + dataPriv.set( el, type, false ); + jQuery.event.add( el, type, { + namespace: false, + handler: function( event ) { + var notAsync, result, + saved = dataPriv.get( this, type ); + + if ( ( event.isTrigger & 1 ) && this[ type ] ) { + + // Interrupt processing of the outer synthetic .trigger()ed event + // Saved data should be false in such cases, but might be a leftover capture object + // from an async native handler (gh-4350) + if ( !saved.length ) { + + // Store arguments for use when handling the inner native event + // There will always be at least one argument (an event object), so this array + // will not be confused with a leftover capture object. + saved = slice.call( arguments ); + dataPriv.set( this, type, saved ); + + // Trigger the native event and capture its result + // Support: IE <=9 - 11+ + // focus() and blur() are asynchronous + notAsync = expectSync( this, type ); + this[ type ](); + result = dataPriv.get( this, type ); + if ( saved !== result || notAsync ) { + dataPriv.set( this, type, false ); + } else { + result = {}; + } + if ( saved !== result ) { + + // Cancel the outer synthetic event + event.stopImmediatePropagation(); + event.preventDefault(); + return result.value; + } + + // If this is an inner synthetic event for an event with a bubbling surrogate + // (focus or blur), assume that the surrogate already propagated from triggering the + // native event and prevent that from happening again here. + // This technically gets the ordering wrong w.r.t. to `.trigger()` (in which the + // bubbling surrogate propagates *after* the non-bubbling base), but that seems + // less bad than duplication. + } else if ( ( jQuery.event.special[ type ] || {} ).delegateType ) { + event.stopPropagation(); + } + + // If this is a native event triggered above, everything is now in order + // Fire an inner synthetic event with the original arguments + } else if ( saved.length ) { + + // ...and capture the result + dataPriv.set( this, type, { + value: jQuery.event.trigger( + + // Support: IE <=9 - 11+ + // Extend with the prototype to reset the above stopImmediatePropagation() + jQuery.extend( saved[ 0 ], jQuery.Event.prototype ), + saved.slice( 1 ), + this + ) + } ); + + // Abort handling of the native event + event.stopImmediatePropagation(); + } + } + } ); +} + +jQuery.removeEvent = function( elem, type, handle ) { + + // This "if" is needed for plain objects + if ( elem.removeEventListener ) { + elem.removeEventListener( type, handle ); + } +}; + +jQuery.Event = function( src, props ) { + + // Allow instantiation without the 'new' keyword + if ( !( this instanceof jQuery.Event ) ) { + return new jQuery.Event( src, props ); + } + + // Event object + if ( src && src.type ) { + this.originalEvent = src; + this.type = src.type; + + // Events bubbling up the document may have been marked as prevented + // by a handler lower down the tree; reflect the correct value. + this.isDefaultPrevented = src.defaultPrevented || + src.defaultPrevented === undefined && + + // Support: Android <=2.3 only + src.returnValue === false ? + returnTrue : + returnFalse; + + // Create target properties + // Support: Safari <=6 - 7 only + // Target should not be a text node (#504, #13143) + this.target = ( src.target && src.target.nodeType === 3 ) ? + src.target.parentNode : + src.target; + + this.currentTarget = src.currentTarget; + this.relatedTarget = src.relatedTarget; + + // Event type + } else { + this.type = src; + } + + // Put explicitly provided properties onto the event object + if ( props ) { + jQuery.extend( this, props ); + } + + // Create a timestamp if incoming event doesn't have one + this.timeStamp = src && src.timeStamp || Date.now(); + + // Mark it as fixed + this[ jQuery.expando ] = true; +}; + +// jQuery.Event is based on DOM3 Events as specified by the ECMAScript Language Binding +// https://www.w3.org/TR/2003/WD-DOM-Level-3-Events-20030331/ecma-script-binding.html +jQuery.Event.prototype = { + constructor: jQuery.Event, + isDefaultPrevented: returnFalse, + isPropagationStopped: returnFalse, + isImmediatePropagationStopped: returnFalse, + isSimulated: false, + + preventDefault: function() { + var e = this.originalEvent; + + this.isDefaultPrevented = returnTrue; + + if ( e && !this.isSimulated ) { + e.preventDefault(); + } + }, + stopPropagation: function() { + var e = this.originalEvent; + + this.isPropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopPropagation(); + } + }, + stopImmediatePropagation: function() { + var e = this.originalEvent; + + this.isImmediatePropagationStopped = returnTrue; + + if ( e && !this.isSimulated ) { + e.stopImmediatePropagation(); + } + + this.stopPropagation(); + } +}; + +// Includes all common event props including KeyEvent and MouseEvent specific props +jQuery.each( { + altKey: true, + bubbles: true, + cancelable: true, + changedTouches: true, + ctrlKey: true, + detail: true, + eventPhase: true, + metaKey: true, + pageX: true, + pageY: true, + shiftKey: true, + view: true, + "char": true, + code: true, + charCode: true, + key: true, + keyCode: true, + button: true, + buttons: true, + clientX: true, + clientY: true, + offsetX: true, + offsetY: true, + pointerId: true, + pointerType: true, + screenX: true, + screenY: true, + targetTouches: true, + toElement: true, + touches: true, + + which: function( event ) { + var button = event.button; + + // Add which for key events + if ( event.which == null && rkeyEvent.test( event.type ) ) { + return event.charCode != null ? event.charCode : event.keyCode; + } + + // Add which for click: 1 === left; 2 === middle; 3 === right + if ( !event.which && button !== undefined && rmouseEvent.test( event.type ) ) { + if ( button & 1 ) { + return 1; + } + + if ( button & 2 ) { + return 3; + } + + if ( button & 4 ) { + return 2; + } + + return 0; + } + + return event.which; + } +}, jQuery.event.addProp ); + +jQuery.each( { focus: "focusin", blur: "focusout" }, function( type, delegateType ) { + jQuery.event.special[ type ] = { + + // Utilize native event if possible so blur/focus sequence is correct + setup: function() { + + // Claim the first handler + // dataPriv.set( this, "focus", ... ) + // dataPriv.set( this, "blur", ... ) + leverageNative( this, type, expectSync ); + + // Return false to allow normal processing in the caller + return false; + }, + trigger: function() { + + // Force setup before trigger + leverageNative( this, type ); + + // Return non-false to allow normal event-path propagation + return true; + }, + + delegateType: delegateType + }; +} ); + +// Create mouseenter/leave events using mouseover/out and event-time checks +// so that event delegation works in jQuery. +// Do the same for pointerenter/pointerleave and pointerover/pointerout +// +// Support: Safari 7 only +// Safari sends mouseenter too often; see: +// https://bugs.chromium.org/p/chromium/issues/detail?id=470258 +// for the description of the bug (it existed in older Chrome versions as well). +jQuery.each( { + mouseenter: "mouseover", + mouseleave: "mouseout", + pointerenter: "pointerover", + pointerleave: "pointerout" +}, function( orig, fix ) { + jQuery.event.special[ orig ] = { + delegateType: fix, + bindType: fix, + + handle: function( event ) { + var ret, + target = this, + related = event.relatedTarget, + handleObj = event.handleObj; + + // For mouseenter/leave call the handler if related is outside the target. + // NB: No relatedTarget if the mouse left/entered the browser window + if ( !related || ( related !== target && !jQuery.contains( target, related ) ) ) { + event.type = handleObj.origType; + ret = handleObj.handler.apply( this, arguments ); + event.type = fix; + } + return ret; + } + }; +} ); + +jQuery.fn.extend( { + + on: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn ); + }, + one: function( types, selector, data, fn ) { + return on( this, types, selector, data, fn, 1 ); + }, + off: function( types, selector, fn ) { + var handleObj, type; + if ( types && types.preventDefault && types.handleObj ) { + + // ( event ) dispatched jQuery.Event + handleObj = types.handleObj; + jQuery( types.delegateTarget ).off( + handleObj.namespace ? + handleObj.origType + "." + handleObj.namespace : + handleObj.origType, + handleObj.selector, + handleObj.handler + ); + return this; + } + if ( typeof types === "object" ) { + + // ( types-object [, selector] ) + for ( type in types ) { + this.off( type, selector, types[ type ] ); + } + return this; + } + if ( selector === false || typeof selector === "function" ) { + + // ( types [, fn] ) + fn = selector; + selector = undefined; + } + if ( fn === false ) { + fn = returnFalse; + } + return this.each( function() { + jQuery.event.remove( this, types, fn, selector ); + } ); + } +} ); + + +var + + // Support: IE <=10 - 11, Edge 12 - 13 only + // In IE/Edge using regex groups here causes severe slowdowns. + // See https://connect.microsoft.com/IE/feedback/details/1736512/ + rnoInnerhtml = /\s*$/g; + +// Prefer a tbody over its parent table for containing new rows +function manipulationTarget( elem, content ) { + if ( nodeName( elem, "table" ) && + nodeName( content.nodeType !== 11 ? content : content.firstChild, "tr" ) ) { + + return jQuery( elem ).children( "tbody" )[ 0 ] || elem; + } + + return elem; +} + +// Replace/restore the type attribute of script elements for safe DOM manipulation +function disableScript( elem ) { + elem.type = ( elem.getAttribute( "type" ) !== null ) + "/" + elem.type; + return elem; +} +function restoreScript( elem ) { + if ( ( elem.type || "" ).slice( 0, 5 ) === "true/" ) { + elem.type = elem.type.slice( 5 ); + } else { + elem.removeAttribute( "type" ); + } + + return elem; +} + +function cloneCopyEvent( src, dest ) { + var i, l, type, pdataOld, udataOld, udataCur, events; + + if ( dest.nodeType !== 1 ) { + return; + } + + // 1. Copy private data: events, handlers, etc. + if ( dataPriv.hasData( src ) ) { + pdataOld = dataPriv.get( src ); + events = pdataOld.events; + + if ( events ) { + dataPriv.remove( dest, "handle events" ); + + for ( type in events ) { + for ( i = 0, l = events[ type ].length; i < l; i++ ) { + jQuery.event.add( dest, type, events[ type ][ i ] ); + } + } + } + } + + // 2. Copy user data + if ( dataUser.hasData( src ) ) { + udataOld = dataUser.access( src ); + udataCur = jQuery.extend( {}, udataOld ); + + dataUser.set( dest, udataCur ); + } +} + +// Fix IE bugs, see support tests +function fixInput( src, dest ) { + var nodeName = dest.nodeName.toLowerCase(); + + // Fails to persist the checked state of a cloned checkbox or radio button. + if ( nodeName === "input" && rcheckableType.test( src.type ) ) { + dest.checked = src.checked; + + // Fails to return the selected option to the default selected state when cloning options + } else if ( nodeName === "input" || nodeName === "textarea" ) { + dest.defaultValue = src.defaultValue; + } +} + +function domManip( collection, args, callback, ignored ) { + + // Flatten any nested arrays + args = flat( args ); + + var fragment, first, scripts, hasScripts, node, doc, + i = 0, + l = collection.length, + iNoClone = l - 1, + value = args[ 0 ], + valueIsFunction = isFunction( value ); + + // We can't cloneNode fragments that contain checked, in WebKit + if ( valueIsFunction || + ( l > 1 && typeof value === "string" && + !support.checkClone && rchecked.test( value ) ) ) { + return collection.each( function( index ) { + var self = collection.eq( index ); + if ( valueIsFunction ) { + args[ 0 ] = value.call( this, index, self.html() ); + } + domManip( self, args, callback, ignored ); + } ); + } + + if ( l ) { + fragment = buildFragment( args, collection[ 0 ].ownerDocument, false, collection, ignored ); + first = fragment.firstChild; + + if ( fragment.childNodes.length === 1 ) { + fragment = first; + } + + // Require either new content or an interest in ignored elements to invoke the callback + if ( first || ignored ) { + scripts = jQuery.map( getAll( fragment, "script" ), disableScript ); + hasScripts = scripts.length; + + // Use the original fragment for the last item + // instead of the first because it can end up + // being emptied incorrectly in certain situations (#8070). + for ( ; i < l; i++ ) { + node = fragment; + + if ( i !== iNoClone ) { + node = jQuery.clone( node, true, true ); + + // Keep references to cloned scripts for later restoration + if ( hasScripts ) { + + // Support: Android <=4.0 only, PhantomJS 1 only + // push.apply(_, arraylike) throws on ancient WebKit + jQuery.merge( scripts, getAll( node, "script" ) ); + } + } + + callback.call( collection[ i ], node, i ); + } + + if ( hasScripts ) { + doc = scripts[ scripts.length - 1 ].ownerDocument; + + // Reenable scripts + jQuery.map( scripts, restoreScript ); + + // Evaluate executable scripts on first document insertion + for ( i = 0; i < hasScripts; i++ ) { + node = scripts[ i ]; + if ( rscriptType.test( node.type || "" ) && + !dataPriv.access( node, "globalEval" ) && + jQuery.contains( doc, node ) ) { + + if ( node.src && ( node.type || "" ).toLowerCase() !== "module" ) { + + // Optional AJAX dependency, but won't run scripts if not present + if ( jQuery._evalUrl && !node.noModule ) { + jQuery._evalUrl( node.src, { + nonce: node.nonce || node.getAttribute( "nonce" ) + }, doc ); + } + } else { + DOMEval( node.textContent.replace( rcleanScript, "" ), node, doc ); + } + } + } + } + } + } + + return collection; +} + +function remove( elem, selector, keepData ) { + var node, + nodes = selector ? jQuery.filter( selector, elem ) : elem, + i = 0; + + for ( ; ( node = nodes[ i ] ) != null; i++ ) { + if ( !keepData && node.nodeType === 1 ) { + jQuery.cleanData( getAll( node ) ); + } + + if ( node.parentNode ) { + if ( keepData && isAttached( node ) ) { + setGlobalEval( getAll( node, "script" ) ); + } + node.parentNode.removeChild( node ); + } + } + + return elem; +} + +jQuery.extend( { + htmlPrefilter: function( html ) { + return html; + }, + + clone: function( elem, dataAndEvents, deepDataAndEvents ) { + var i, l, srcElements, destElements, + clone = elem.cloneNode( true ), + inPage = isAttached( elem ); + + // Fix IE cloning issues + if ( !support.noCloneChecked && ( elem.nodeType === 1 || elem.nodeType === 11 ) && + !jQuery.isXMLDoc( elem ) ) { + + // We eschew Sizzle here for performance reasons: https://jsperf.com/getall-vs-sizzle/2 + destElements = getAll( clone ); + srcElements = getAll( elem ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + fixInput( srcElements[ i ], destElements[ i ] ); + } + } + + // Copy the events from the original to the clone + if ( dataAndEvents ) { + if ( deepDataAndEvents ) { + srcElements = srcElements || getAll( elem ); + destElements = destElements || getAll( clone ); + + for ( i = 0, l = srcElements.length; i < l; i++ ) { + cloneCopyEvent( srcElements[ i ], destElements[ i ] ); + } + } else { + cloneCopyEvent( elem, clone ); + } + } + + // Preserve script evaluation history + destElements = getAll( clone, "script" ); + if ( destElements.length > 0 ) { + setGlobalEval( destElements, !inPage && getAll( elem, "script" ) ); + } + + // Return the cloned set + return clone; + }, + + cleanData: function( elems ) { + var data, elem, type, + special = jQuery.event.special, + i = 0; + + for ( ; ( elem = elems[ i ] ) !== undefined; i++ ) { + if ( acceptData( elem ) ) { + if ( ( data = elem[ dataPriv.expando ] ) ) { + if ( data.events ) { + for ( type in data.events ) { + if ( special[ type ] ) { + jQuery.event.remove( elem, type ); + + // This is a shortcut to avoid jQuery.event.remove's overhead + } else { + jQuery.removeEvent( elem, type, data.handle ); + } + } + } + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataPriv.expando ] = undefined; + } + if ( elem[ dataUser.expando ] ) { + + // Support: Chrome <=35 - 45+ + // Assign undefined instead of using delete, see Data#remove + elem[ dataUser.expando ] = undefined; + } + } + } + } +} ); + +jQuery.fn.extend( { + detach: function( selector ) { + return remove( this, selector, true ); + }, + + remove: function( selector ) { + return remove( this, selector ); + }, + + text: function( value ) { + return access( this, function( value ) { + return value === undefined ? + jQuery.text( this ) : + this.empty().each( function() { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + this.textContent = value; + } + } ); + }, null, value, arguments.length ); + }, + + append: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.appendChild( elem ); + } + } ); + }, + + prepend: function() { + return domManip( this, arguments, function( elem ) { + if ( this.nodeType === 1 || this.nodeType === 11 || this.nodeType === 9 ) { + var target = manipulationTarget( this, elem ); + target.insertBefore( elem, target.firstChild ); + } + } ); + }, + + before: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this ); + } + } ); + }, + + after: function() { + return domManip( this, arguments, function( elem ) { + if ( this.parentNode ) { + this.parentNode.insertBefore( elem, this.nextSibling ); + } + } ); + }, + + empty: function() { + var elem, + i = 0; + + for ( ; ( elem = this[ i ] ) != null; i++ ) { + if ( elem.nodeType === 1 ) { + + // Prevent memory leaks + jQuery.cleanData( getAll( elem, false ) ); + + // Remove any remaining nodes + elem.textContent = ""; + } + } + + return this; + }, + + clone: function( dataAndEvents, deepDataAndEvents ) { + dataAndEvents = dataAndEvents == null ? false : dataAndEvents; + deepDataAndEvents = deepDataAndEvents == null ? dataAndEvents : deepDataAndEvents; + + return this.map( function() { + return jQuery.clone( this, dataAndEvents, deepDataAndEvents ); + } ); + }, + + html: function( value ) { + return access( this, function( value ) { + var elem = this[ 0 ] || {}, + i = 0, + l = this.length; + + if ( value === undefined && elem.nodeType === 1 ) { + return elem.innerHTML; + } + + // See if we can take a shortcut and just use innerHTML + if ( typeof value === "string" && !rnoInnerhtml.test( value ) && + !wrapMap[ ( rtagName.exec( value ) || [ "", "" ] )[ 1 ].toLowerCase() ] ) { + + value = jQuery.htmlPrefilter( value ); + + try { + for ( ; i < l; i++ ) { + elem = this[ i ] || {}; + + // Remove element nodes and prevent memory leaks + if ( elem.nodeType === 1 ) { + jQuery.cleanData( getAll( elem, false ) ); + elem.innerHTML = value; + } + } + + elem = 0; + + // If using innerHTML throws an exception, use the fallback method + } catch ( e ) {} + } + + if ( elem ) { + this.empty().append( value ); + } + }, null, value, arguments.length ); + }, + + replaceWith: function() { + var ignored = []; + + // Make the changes, replacing each non-ignored context element with the new content + return domManip( this, arguments, function( elem ) { + var parent = this.parentNode; + + if ( jQuery.inArray( this, ignored ) < 0 ) { + jQuery.cleanData( getAll( this ) ); + if ( parent ) { + parent.replaceChild( elem, this ); + } + } + + // Force callback invocation + }, ignored ); + } +} ); + +jQuery.each( { + appendTo: "append", + prependTo: "prepend", + insertBefore: "before", + insertAfter: "after", + replaceAll: "replaceWith" +}, function( name, original ) { + jQuery.fn[ name ] = function( selector ) { + var elems, + ret = [], + insert = jQuery( selector ), + last = insert.length - 1, + i = 0; + + for ( ; i <= last; i++ ) { + elems = i === last ? this : this.clone( true ); + jQuery( insert[ i ] )[ original ]( elems ); + + // Support: Android <=4.0 only, PhantomJS 1 only + // .get() because push.apply(_, arraylike) throws on ancient WebKit + push.apply( ret, elems.get() ); + } + + return this.pushStack( ret ); + }; +} ); +var rnumnonpx = new RegExp( "^(" + pnum + ")(?!px)[a-z%]+$", "i" ); + +var getStyles = function( elem ) { + + // Support: IE <=11 only, Firefox <=30 (#15098, #14150) + // IE throws on elements created in popups + // FF meanwhile throws on frame elements through "defaultView.getComputedStyle" + var view = elem.ownerDocument.defaultView; + + if ( !view || !view.opener ) { + view = window; + } + + return view.getComputedStyle( elem ); + }; + +var swap = function( elem, options, callback ) { + var ret, name, + old = {}; + + // Remember the old values, and insert the new ones + for ( name in options ) { + old[ name ] = elem.style[ name ]; + elem.style[ name ] = options[ name ]; + } + + ret = callback.call( elem ); + + // Revert the old values + for ( name in options ) { + elem.style[ name ] = old[ name ]; + } + + return ret; +}; + + +var rboxStyle = new RegExp( cssExpand.join( "|" ), "i" ); + + + +( function() { + + // Executing both pixelPosition & boxSizingReliable tests require only one layout + // so they're executed at the same time to save the second computation. + function computeStyleTests() { + + // This is a singleton, we need to execute it only once + if ( !div ) { + return; + } + + container.style.cssText = "position:absolute;left:-11111px;width:60px;" + + "margin-top:1px;padding:0;border:0"; + div.style.cssText = + "position:relative;display:block;box-sizing:border-box;overflow:scroll;" + + "margin:auto;border:1px;padding:1px;" + + "width:60%;top:1%"; + documentElement.appendChild( container ).appendChild( div ); + + var divStyle = window.getComputedStyle( div ); + pixelPositionVal = divStyle.top !== "1%"; + + // Support: Android 4.0 - 4.3 only, Firefox <=3 - 44 + reliableMarginLeftVal = roundPixelMeasures( divStyle.marginLeft ) === 12; + + // Support: Android 4.0 - 4.3 only, Safari <=9.1 - 10.1, iOS <=7.0 - 9.3 + // Some styles come back with percentage values, even though they shouldn't + div.style.right = "60%"; + pixelBoxStylesVal = roundPixelMeasures( divStyle.right ) === 36; + + // Support: IE 9 - 11 only + // Detect misreporting of content dimensions for box-sizing:border-box elements + boxSizingReliableVal = roundPixelMeasures( divStyle.width ) === 36; + + // Support: IE 9 only + // Detect overflow:scroll screwiness (gh-3699) + // Support: Chrome <=64 + // Don't get tricked when zoom affects offsetWidth (gh-4029) + div.style.position = "absolute"; + scrollboxSizeVal = roundPixelMeasures( div.offsetWidth / 3 ) === 12; + + documentElement.removeChild( container ); + + // Nullify the div so it wouldn't be stored in the memory and + // it will also be a sign that checks already performed + div = null; + } + + function roundPixelMeasures( measure ) { + return Math.round( parseFloat( measure ) ); + } + + var pixelPositionVal, boxSizingReliableVal, scrollboxSizeVal, pixelBoxStylesVal, + reliableTrDimensionsVal, reliableMarginLeftVal, + container = document.createElement( "div" ), + div = document.createElement( "div" ); + + // Finish early in limited (non-browser) environments + if ( !div.style ) { + return; + } + + // Support: IE <=9 - 11 only + // Style of cloned element affects source element cloned (#8908) + div.style.backgroundClip = "content-box"; + div.cloneNode( true ).style.backgroundClip = ""; + support.clearCloneStyle = div.style.backgroundClip === "content-box"; + + jQuery.extend( support, { + boxSizingReliable: function() { + computeStyleTests(); + return boxSizingReliableVal; + }, + pixelBoxStyles: function() { + computeStyleTests(); + return pixelBoxStylesVal; + }, + pixelPosition: function() { + computeStyleTests(); + return pixelPositionVal; + }, + reliableMarginLeft: function() { + computeStyleTests(); + return reliableMarginLeftVal; + }, + scrollboxSize: function() { + computeStyleTests(); + return scrollboxSizeVal; + }, + + // Support: IE 9 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Behavior in IE 9 is more subtle than in newer versions & it passes + // some versions of this test; make sure not to make it pass there! + reliableTrDimensions: function() { + var table, tr, trChild, trStyle; + if ( reliableTrDimensionsVal == null ) { + table = document.createElement( "table" ); + tr = document.createElement( "tr" ); + trChild = document.createElement( "div" ); + + table.style.cssText = "position:absolute;left:-11111px"; + tr.style.height = "1px"; + trChild.style.height = "9px"; + + documentElement + .appendChild( table ) + .appendChild( tr ) + .appendChild( trChild ); + + trStyle = window.getComputedStyle( tr ); + reliableTrDimensionsVal = parseInt( trStyle.height ) > 3; + + documentElement.removeChild( table ); + } + return reliableTrDimensionsVal; + } + } ); +} )(); + + +function curCSS( elem, name, computed ) { + var width, minWidth, maxWidth, ret, + + // Support: Firefox 51+ + // Retrieving style before computed somehow + // fixes an issue with getting wrong values + // on detached elements + style = elem.style; + + computed = computed || getStyles( elem ); + + // getPropertyValue is needed for: + // .css('filter') (IE 9 only, #12537) + // .css('--customProperty) (#3144) + if ( computed ) { + ret = computed.getPropertyValue( name ) || computed[ name ]; + + if ( ret === "" && !isAttached( elem ) ) { + ret = jQuery.style( elem, name ); + } + + // A tribute to the "awesome hack by Dean Edwards" + // Android Browser returns percentage for some values, + // but width seems to be reliably pixels. + // This is against the CSSOM draft spec: + // https://drafts.csswg.org/cssom/#resolved-values + if ( !support.pixelBoxStyles() && rnumnonpx.test( ret ) && rboxStyle.test( name ) ) { + + // Remember the original values + width = style.width; + minWidth = style.minWidth; + maxWidth = style.maxWidth; + + // Put in the new values to get a computed value out + style.minWidth = style.maxWidth = style.width = ret; + ret = computed.width; + + // Revert the changed values + style.width = width; + style.minWidth = minWidth; + style.maxWidth = maxWidth; + } + } + + return ret !== undefined ? + + // Support: IE <=9 - 11 only + // IE returns zIndex value as an integer. + ret + "" : + ret; +} + + +function addGetHookIf( conditionFn, hookFn ) { + + // Define the hook, we'll check on the first run if it's really needed. + return { + get: function() { + if ( conditionFn() ) { + + // Hook not needed (or it's not possible to use it due + // to missing dependency), remove it. + delete this.get; + return; + } + + // Hook needed; redefine it so that the support test is not executed again. + return ( this.get = hookFn ).apply( this, arguments ); + } + }; +} + + +var cssPrefixes = [ "Webkit", "Moz", "ms" ], + emptyStyle = document.createElement( "div" ).style, + vendorProps = {}; + +// Return a vendor-prefixed property or undefined +function vendorPropName( name ) { + + // Check for vendor prefixed names + var capName = name[ 0 ].toUpperCase() + name.slice( 1 ), + i = cssPrefixes.length; + + while ( i-- ) { + name = cssPrefixes[ i ] + capName; + if ( name in emptyStyle ) { + return name; + } + } +} + +// Return a potentially-mapped jQuery.cssProps or vendor prefixed property +function finalPropName( name ) { + var final = jQuery.cssProps[ name ] || vendorProps[ name ]; + + if ( final ) { + return final; + } + if ( name in emptyStyle ) { + return name; + } + return vendorProps[ name ] = vendorPropName( name ) || name; +} + + +var + + // Swappable if display is none or starts with table + // except "table", "table-cell", or "table-caption" + // See here for display values: https://developer.mozilla.org/en-US/docs/CSS/display + rdisplayswap = /^(none|table(?!-c[ea]).+)/, + rcustomProp = /^--/, + cssShow = { position: "absolute", visibility: "hidden", display: "block" }, + cssNormalTransform = { + letterSpacing: "0", + fontWeight: "400" + }; + +function setPositiveNumber( _elem, value, subtract ) { + + // Any relative (+/-) values have already been + // normalized at this point + var matches = rcssNum.exec( value ); + return matches ? + + // Guard against undefined "subtract", e.g., when used as in cssHooks + Math.max( 0, matches[ 2 ] - ( subtract || 0 ) ) + ( matches[ 3 ] || "px" ) : + value; +} + +function boxModelAdjustment( elem, dimension, box, isBorderBox, styles, computedVal ) { + var i = dimension === "width" ? 1 : 0, + extra = 0, + delta = 0; + + // Adjustment may not be necessary + if ( box === ( isBorderBox ? "border" : "content" ) ) { + return 0; + } + + for ( ; i < 4; i += 2 ) { + + // Both box models exclude margin + if ( box === "margin" ) { + delta += jQuery.css( elem, box + cssExpand[ i ], true, styles ); + } + + // If we get here with a content-box, we're seeking "padding" or "border" or "margin" + if ( !isBorderBox ) { + + // Add padding + delta += jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + + // For "border" or "margin", add border + if ( box !== "padding" ) { + delta += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + + // But still keep track of it otherwise + } else { + extra += jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + + // If we get here with a border-box (content + padding + border), we're seeking "content" or + // "padding" or "margin" + } else { + + // For "content", subtract padding + if ( box === "content" ) { + delta -= jQuery.css( elem, "padding" + cssExpand[ i ], true, styles ); + } + + // For "content" or "padding", subtract border + if ( box !== "margin" ) { + delta -= jQuery.css( elem, "border" + cssExpand[ i ] + "Width", true, styles ); + } + } + } + + // Account for positive content-box scroll gutter when requested by providing computedVal + if ( !isBorderBox && computedVal >= 0 ) { + + // offsetWidth/offsetHeight is a rounded sum of content, padding, scroll gutter, and border + // Assuming integer scroll gutter, subtract the rest and round down + delta += Math.max( 0, Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + computedVal - + delta - + extra - + 0.5 + + // If offsetWidth/offsetHeight is unknown, then we can't determine content-box scroll gutter + // Use an explicit zero to avoid NaN (gh-3964) + ) ) || 0; + } + + return delta; +} + +function getWidthOrHeight( elem, dimension, extra ) { + + // Start with computed style + var styles = getStyles( elem ), + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-4322). + // Fake content-box until we know it's needed to know the true value. + boxSizingNeeded = !support.boxSizingReliable() || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + valueIsBorderBox = isBorderBox, + + val = curCSS( elem, dimension, styles ), + offsetProp = "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ); + + // Support: Firefox <=54 + // Return a confounding non-pixel value or feign ignorance, as appropriate. + if ( rnumnonpx.test( val ) ) { + if ( !extra ) { + return val; + } + val = "auto"; + } + + + // Support: IE 9 - 11 only + // Use offsetWidth/offsetHeight for when box sizing is unreliable. + // In those cases, the computed value can be trusted to be border-box. + if ( ( !support.boxSizingReliable() && isBorderBox || + + // Support: IE 10 - 11+, Edge 15 - 18+ + // IE/Edge misreport `getComputedStyle` of table rows with width/height + // set in CSS while `offset*` properties report correct values. + // Interestingly, in some cases IE 9 doesn't suffer from this issue. + !support.reliableTrDimensions() && nodeName( elem, "tr" ) || + + // Fall back to offsetWidth/offsetHeight when value is "auto" + // This happens for inline elements with no explicit setting (gh-3571) + val === "auto" || + + // Support: Android <=4.1 - 4.3 only + // Also use offsetWidth/offsetHeight for misreported inline dimensions (gh-3602) + !parseFloat( val ) && jQuery.css( elem, "display", false, styles ) === "inline" ) && + + // Make sure the element is visible & connected + elem.getClientRects().length ) { + + isBorderBox = jQuery.css( elem, "boxSizing", false, styles ) === "border-box"; + + // Where available, offsetWidth/offsetHeight approximate border box dimensions. + // Where not available (e.g., SVG), assume unreliable box-sizing and interpret the + // retrieved value as a content box dimension. + valueIsBorderBox = offsetProp in elem; + if ( valueIsBorderBox ) { + val = elem[ offsetProp ]; + } + } + + // Normalize "" and auto + val = parseFloat( val ) || 0; + + // Adjust for the element's box model + return ( val + + boxModelAdjustment( + elem, + dimension, + extra || ( isBorderBox ? "border" : "content" ), + valueIsBorderBox, + styles, + + // Provide the current computed size to request scroll gutter calculation (gh-3589) + val + ) + ) + "px"; +} + +jQuery.extend( { + + // Add in style property hooks for overriding the default + // behavior of getting and setting a style property + cssHooks: { + opacity: { + get: function( elem, computed ) { + if ( computed ) { + + // We should always get a number back from opacity + var ret = curCSS( elem, "opacity" ); + return ret === "" ? "1" : ret; + } + } + } + }, + + // Don't automatically add "px" to these possibly-unitless properties + cssNumber: { + "animationIterationCount": true, + "columnCount": true, + "fillOpacity": true, + "flexGrow": true, + "flexShrink": true, + "fontWeight": true, + "gridArea": true, + "gridColumn": true, + "gridColumnEnd": true, + "gridColumnStart": true, + "gridRow": true, + "gridRowEnd": true, + "gridRowStart": true, + "lineHeight": true, + "opacity": true, + "order": true, + "orphans": true, + "widows": true, + "zIndex": true, + "zoom": true + }, + + // Add in properties whose names you wish to fix before + // setting or getting the value + cssProps: {}, + + // Get and set the style property on a DOM Node + style: function( elem, name, value, extra ) { + + // Don't set styles on text and comment nodes + if ( !elem || elem.nodeType === 3 || elem.nodeType === 8 || !elem.style ) { + return; + } + + // Make sure that we're working with the right name + var ret, type, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ), + style = elem.style; + + // Make sure that we're working with the right name. We don't + // want to query the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Gets hook for the prefixed version, then unprefixed version + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // Check if we're setting a value + if ( value !== undefined ) { + type = typeof value; + + // Convert "+=" or "-=" to relative numbers (#7345) + if ( type === "string" && ( ret = rcssNum.exec( value ) ) && ret[ 1 ] ) { + value = adjustCSS( elem, name, ret ); + + // Fixes bug #9237 + type = "number"; + } + + // Make sure that null and NaN values aren't set (#7116) + if ( value == null || value !== value ) { + return; + } + + // If a number was passed in, add the unit (except for certain CSS properties) + // The isCustomProp check can be removed in jQuery 4.0 when we only auto-append + // "px" to a few hardcoded values. + if ( type === "number" && !isCustomProp ) { + value += ret && ret[ 3 ] || ( jQuery.cssNumber[ origName ] ? "" : "px" ); + } + + // background-* props affect original clone's values + if ( !support.clearCloneStyle && value === "" && name.indexOf( "background" ) === 0 ) { + style[ name ] = "inherit"; + } + + // If a hook was provided, use that value, otherwise just set the specified value + if ( !hooks || !( "set" in hooks ) || + ( value = hooks.set( elem, value, extra ) ) !== undefined ) { + + if ( isCustomProp ) { + style.setProperty( name, value ); + } else { + style[ name ] = value; + } + } + + } else { + + // If a hook was provided get the non-computed value from there + if ( hooks && "get" in hooks && + ( ret = hooks.get( elem, false, extra ) ) !== undefined ) { + + return ret; + } + + // Otherwise just get the value from the style object + return style[ name ]; + } + }, + + css: function( elem, name, extra, styles ) { + var val, num, hooks, + origName = camelCase( name ), + isCustomProp = rcustomProp.test( name ); + + // Make sure that we're working with the right name. We don't + // want to modify the value if it is a CSS custom property + // since they are user-defined. + if ( !isCustomProp ) { + name = finalPropName( origName ); + } + + // Try prefixed name followed by the unprefixed name + hooks = jQuery.cssHooks[ name ] || jQuery.cssHooks[ origName ]; + + // If a hook was provided get the computed value from there + if ( hooks && "get" in hooks ) { + val = hooks.get( elem, true, extra ); + } + + // Otherwise, if a way to get the computed value exists, use that + if ( val === undefined ) { + val = curCSS( elem, name, styles ); + } + + // Convert "normal" to computed value + if ( val === "normal" && name in cssNormalTransform ) { + val = cssNormalTransform[ name ]; + } + + // Make numeric if forced or a qualifier was provided and val looks numeric + if ( extra === "" || extra ) { + num = parseFloat( val ); + return extra === true || isFinite( num ) ? num || 0 : val; + } + + return val; + } +} ); + +jQuery.each( [ "height", "width" ], function( _i, dimension ) { + jQuery.cssHooks[ dimension ] = { + get: function( elem, computed, extra ) { + if ( computed ) { + + // Certain elements can have dimension info if we invisibly show them + // but it must have a current display style that would benefit + return rdisplayswap.test( jQuery.css( elem, "display" ) ) && + + // Support: Safari 8+ + // Table columns in Safari have non-zero offsetWidth & zero + // getBoundingClientRect().width unless display is changed. + // Support: IE <=11 only + // Running getBoundingClientRect on a disconnected node + // in IE throws an error. + ( !elem.getClientRects().length || !elem.getBoundingClientRect().width ) ? + swap( elem, cssShow, function() { + return getWidthOrHeight( elem, dimension, extra ); + } ) : + getWidthOrHeight( elem, dimension, extra ); + } + }, + + set: function( elem, value, extra ) { + var matches, + styles = getStyles( elem ), + + // Only read styles.position if the test has a chance to fail + // to avoid forcing a reflow. + scrollboxSizeBuggy = !support.scrollboxSize() && + styles.position === "absolute", + + // To avoid forcing a reflow, only fetch boxSizing if we need it (gh-3991) + boxSizingNeeded = scrollboxSizeBuggy || extra, + isBorderBox = boxSizingNeeded && + jQuery.css( elem, "boxSizing", false, styles ) === "border-box", + subtract = extra ? + boxModelAdjustment( + elem, + dimension, + extra, + isBorderBox, + styles + ) : + 0; + + // Account for unreliable border-box dimensions by comparing offset* to computed and + // faking a content-box to get border and padding (gh-3699) + if ( isBorderBox && scrollboxSizeBuggy ) { + subtract -= Math.ceil( + elem[ "offset" + dimension[ 0 ].toUpperCase() + dimension.slice( 1 ) ] - + parseFloat( styles[ dimension ] ) - + boxModelAdjustment( elem, dimension, "border", false, styles ) - + 0.5 + ); + } + + // Convert to pixels if value adjustment is needed + if ( subtract && ( matches = rcssNum.exec( value ) ) && + ( matches[ 3 ] || "px" ) !== "px" ) { + + elem.style[ dimension ] = value; + value = jQuery.css( elem, dimension ); + } + + return setPositiveNumber( elem, value, subtract ); + } + }; +} ); + +jQuery.cssHooks.marginLeft = addGetHookIf( support.reliableMarginLeft, + function( elem, computed ) { + if ( computed ) { + return ( parseFloat( curCSS( elem, "marginLeft" ) ) || + elem.getBoundingClientRect().left - + swap( elem, { marginLeft: 0 }, function() { + return elem.getBoundingClientRect().left; + } ) + ) + "px"; + } + } +); + +// These hooks are used by animate to expand properties +jQuery.each( { + margin: "", + padding: "", + border: "Width" +}, function( prefix, suffix ) { + jQuery.cssHooks[ prefix + suffix ] = { + expand: function( value ) { + var i = 0, + expanded = {}, + + // Assumes a single number if not a string + parts = typeof value === "string" ? value.split( " " ) : [ value ]; + + for ( ; i < 4; i++ ) { + expanded[ prefix + cssExpand[ i ] + suffix ] = + parts[ i ] || parts[ i - 2 ] || parts[ 0 ]; + } + + return expanded; + } + }; + + if ( prefix !== "margin" ) { + jQuery.cssHooks[ prefix + suffix ].set = setPositiveNumber; + } +} ); + +jQuery.fn.extend( { + css: function( name, value ) { + return access( this, function( elem, name, value ) { + var styles, len, + map = {}, + i = 0; + + if ( Array.isArray( name ) ) { + styles = getStyles( elem ); + len = name.length; + + for ( ; i < len; i++ ) { + map[ name[ i ] ] = jQuery.css( elem, name[ i ], false, styles ); + } + + return map; + } + + return value !== undefined ? + jQuery.style( elem, name, value ) : + jQuery.css( elem, name ); + }, name, value, arguments.length > 1 ); + } +} ); + + +function Tween( elem, options, prop, end, easing ) { + return new Tween.prototype.init( elem, options, prop, end, easing ); +} +jQuery.Tween = Tween; + +Tween.prototype = { + constructor: Tween, + init: function( elem, options, prop, end, easing, unit ) { + this.elem = elem; + this.prop = prop; + this.easing = easing || jQuery.easing._default; + this.options = options; + this.start = this.now = this.cur(); + this.end = end; + this.unit = unit || ( jQuery.cssNumber[ prop ] ? "" : "px" ); + }, + cur: function() { + var hooks = Tween.propHooks[ this.prop ]; + + return hooks && hooks.get ? + hooks.get( this ) : + Tween.propHooks._default.get( this ); + }, + run: function( percent ) { + var eased, + hooks = Tween.propHooks[ this.prop ]; + + if ( this.options.duration ) { + this.pos = eased = jQuery.easing[ this.easing ]( + percent, this.options.duration * percent, 0, 1, this.options.duration + ); + } else { + this.pos = eased = percent; + } + this.now = ( this.end - this.start ) * eased + this.start; + + if ( this.options.step ) { + this.options.step.call( this.elem, this.now, this ); + } + + if ( hooks && hooks.set ) { + hooks.set( this ); + } else { + Tween.propHooks._default.set( this ); + } + return this; + } +}; + +Tween.prototype.init.prototype = Tween.prototype; + +Tween.propHooks = { + _default: { + get: function( tween ) { + var result; + + // Use a property on the element directly when it is not a DOM element, + // or when there is no matching style property that exists. + if ( tween.elem.nodeType !== 1 || + tween.elem[ tween.prop ] != null && tween.elem.style[ tween.prop ] == null ) { + return tween.elem[ tween.prop ]; + } + + // Passing an empty string as a 3rd parameter to .css will automatically + // attempt a parseFloat and fallback to a string if the parse fails. + // Simple values such as "10px" are parsed to Float; + // complex values such as "rotate(1rad)" are returned as-is. + result = jQuery.css( tween.elem, tween.prop, "" ); + + // Empty strings, null, undefined and "auto" are converted to 0. + return !result || result === "auto" ? 0 : result; + }, + set: function( tween ) { + + // Use step hook for back compat. + // Use cssHook if its there. + // Use .style if available and use plain properties where available. + if ( jQuery.fx.step[ tween.prop ] ) { + jQuery.fx.step[ tween.prop ]( tween ); + } else if ( tween.elem.nodeType === 1 && ( + jQuery.cssHooks[ tween.prop ] || + tween.elem.style[ finalPropName( tween.prop ) ] != null ) ) { + jQuery.style( tween.elem, tween.prop, tween.now + tween.unit ); + } else { + tween.elem[ tween.prop ] = tween.now; + } + } + } +}; + +// Support: IE <=9 only +// Panic based approach to setting things on disconnected nodes +Tween.propHooks.scrollTop = Tween.propHooks.scrollLeft = { + set: function( tween ) { + if ( tween.elem.nodeType && tween.elem.parentNode ) { + tween.elem[ tween.prop ] = tween.now; + } + } +}; + +jQuery.easing = { + linear: function( p ) { + return p; + }, + swing: function( p ) { + return 0.5 - Math.cos( p * Math.PI ) / 2; + }, + _default: "swing" +}; + +jQuery.fx = Tween.prototype.init; + +// Back compat <1.8 extension point +jQuery.fx.step = {}; + + + + +var + fxNow, inProgress, + rfxtypes = /^(?:toggle|show|hide)$/, + rrun = /queueHooks$/; + +function schedule() { + if ( inProgress ) { + if ( document.hidden === false && window.requestAnimationFrame ) { + window.requestAnimationFrame( schedule ); + } else { + window.setTimeout( schedule, jQuery.fx.interval ); + } + + jQuery.fx.tick(); + } +} + +// Animations created synchronously will run synchronously +function createFxNow() { + window.setTimeout( function() { + fxNow = undefined; + } ); + return ( fxNow = Date.now() ); +} + +// Generate parameters to create a standard animation +function genFx( type, includeWidth ) { + var which, + i = 0, + attrs = { height: type }; + + // If we include width, step value is 1 to do all cssExpand values, + // otherwise step value is 2 to skip over Left and Right + includeWidth = includeWidth ? 1 : 0; + for ( ; i < 4; i += 2 - includeWidth ) { + which = cssExpand[ i ]; + attrs[ "margin" + which ] = attrs[ "padding" + which ] = type; + } + + if ( includeWidth ) { + attrs.opacity = attrs.width = type; + } + + return attrs; +} + +function createTween( value, prop, animation ) { + var tween, + collection = ( Animation.tweeners[ prop ] || [] ).concat( Animation.tweeners[ "*" ] ), + index = 0, + length = collection.length; + for ( ; index < length; index++ ) { + if ( ( tween = collection[ index ].call( animation, prop, value ) ) ) { + + // We're done with this property + return tween; + } + } +} + +function defaultPrefilter( elem, props, opts ) { + var prop, value, toggle, hooks, oldfire, propTween, restoreDisplay, display, + isBox = "width" in props || "height" in props, + anim = this, + orig = {}, + style = elem.style, + hidden = elem.nodeType && isHiddenWithinTree( elem ), + dataShow = dataPriv.get( elem, "fxshow" ); + + // Queue-skipping animations hijack the fx hooks + if ( !opts.queue ) { + hooks = jQuery._queueHooks( elem, "fx" ); + if ( hooks.unqueued == null ) { + hooks.unqueued = 0; + oldfire = hooks.empty.fire; + hooks.empty.fire = function() { + if ( !hooks.unqueued ) { + oldfire(); + } + }; + } + hooks.unqueued++; + + anim.always( function() { + + // Ensure the complete handler is called before this completes + anim.always( function() { + hooks.unqueued--; + if ( !jQuery.queue( elem, "fx" ).length ) { + hooks.empty.fire(); + } + } ); + } ); + } + + // Detect show/hide animations + for ( prop in props ) { + value = props[ prop ]; + if ( rfxtypes.test( value ) ) { + delete props[ prop ]; + toggle = toggle || value === "toggle"; + if ( value === ( hidden ? "hide" : "show" ) ) { + + // Pretend to be hidden if this is a "show" and + // there is still data from a stopped show/hide + if ( value === "show" && dataShow && dataShow[ prop ] !== undefined ) { + hidden = true; + + // Ignore all other no-op show/hide data + } else { + continue; + } + } + orig[ prop ] = dataShow && dataShow[ prop ] || jQuery.style( elem, prop ); + } + } + + // Bail out if this is a no-op like .hide().hide() + propTween = !jQuery.isEmptyObject( props ); + if ( !propTween && jQuery.isEmptyObject( orig ) ) { + return; + } + + // Restrict "overflow" and "display" styles during box animations + if ( isBox && elem.nodeType === 1 ) { + + // Support: IE <=9 - 11, Edge 12 - 15 + // Record all 3 overflow attributes because IE does not infer the shorthand + // from identically-valued overflowX and overflowY and Edge just mirrors + // the overflowX value there. + opts.overflow = [ style.overflow, style.overflowX, style.overflowY ]; + + // Identify a display type, preferring old show/hide data over the CSS cascade + restoreDisplay = dataShow && dataShow.display; + if ( restoreDisplay == null ) { + restoreDisplay = dataPriv.get( elem, "display" ); + } + display = jQuery.css( elem, "display" ); + if ( display === "none" ) { + if ( restoreDisplay ) { + display = restoreDisplay; + } else { + + // Get nonempty value(s) by temporarily forcing visibility + showHide( [ elem ], true ); + restoreDisplay = elem.style.display || restoreDisplay; + display = jQuery.css( elem, "display" ); + showHide( [ elem ] ); + } + } + + // Animate inline elements as inline-block + if ( display === "inline" || display === "inline-block" && restoreDisplay != null ) { + if ( jQuery.css( elem, "float" ) === "none" ) { + + // Restore the original display value at the end of pure show/hide animations + if ( !propTween ) { + anim.done( function() { + style.display = restoreDisplay; + } ); + if ( restoreDisplay == null ) { + display = style.display; + restoreDisplay = display === "none" ? "" : display; + } + } + style.display = "inline-block"; + } + } + } + + if ( opts.overflow ) { + style.overflow = "hidden"; + anim.always( function() { + style.overflow = opts.overflow[ 0 ]; + style.overflowX = opts.overflow[ 1 ]; + style.overflowY = opts.overflow[ 2 ]; + } ); + } + + // Implement show/hide animations + propTween = false; + for ( prop in orig ) { + + // General show/hide setup for this element animation + if ( !propTween ) { + if ( dataShow ) { + if ( "hidden" in dataShow ) { + hidden = dataShow.hidden; + } + } else { + dataShow = dataPriv.access( elem, "fxshow", { display: restoreDisplay } ); + } + + // Store hidden/visible for toggle so `.stop().toggle()` "reverses" + if ( toggle ) { + dataShow.hidden = !hidden; + } + + // Show elements before animating them + if ( hidden ) { + showHide( [ elem ], true ); + } + + /* eslint-disable no-loop-func */ + + anim.done( function() { + + /* eslint-enable no-loop-func */ + + // The final step of a "hide" animation is actually hiding the element + if ( !hidden ) { + showHide( [ elem ] ); + } + dataPriv.remove( elem, "fxshow" ); + for ( prop in orig ) { + jQuery.style( elem, prop, orig[ prop ] ); + } + } ); + } + + // Per-property setup + propTween = createTween( hidden ? dataShow[ prop ] : 0, prop, anim ); + if ( !( prop in dataShow ) ) { + dataShow[ prop ] = propTween.start; + if ( hidden ) { + propTween.end = propTween.start; + propTween.start = 0; + } + } + } +} + +function propFilter( props, specialEasing ) { + var index, name, easing, value, hooks; + + // camelCase, specialEasing and expand cssHook pass + for ( index in props ) { + name = camelCase( index ); + easing = specialEasing[ name ]; + value = props[ index ]; + if ( Array.isArray( value ) ) { + easing = value[ 1 ]; + value = props[ index ] = value[ 0 ]; + } + + if ( index !== name ) { + props[ name ] = value; + delete props[ index ]; + } + + hooks = jQuery.cssHooks[ name ]; + if ( hooks && "expand" in hooks ) { + value = hooks.expand( value ); + delete props[ name ]; + + // Not quite $.extend, this won't overwrite existing keys. + // Reusing 'index' because we have the correct "name" + for ( index in value ) { + if ( !( index in props ) ) { + props[ index ] = value[ index ]; + specialEasing[ index ] = easing; + } + } + } else { + specialEasing[ name ] = easing; + } + } +} + +function Animation( elem, properties, options ) { + var result, + stopped, + index = 0, + length = Animation.prefilters.length, + deferred = jQuery.Deferred().always( function() { + + // Don't match elem in the :animated selector + delete tick.elem; + } ), + tick = function() { + if ( stopped ) { + return false; + } + var currentTime = fxNow || createFxNow(), + remaining = Math.max( 0, animation.startTime + animation.duration - currentTime ), + + // Support: Android 2.3 only + // Archaic crash bug won't allow us to use `1 - ( 0.5 || 0 )` (#12497) + temp = remaining / animation.duration || 0, + percent = 1 - temp, + index = 0, + length = animation.tweens.length; + + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( percent ); + } + + deferred.notifyWith( elem, [ animation, percent, remaining ] ); + + // If there's more to do, yield + if ( percent < 1 && length ) { + return remaining; + } + + // If this was an empty animation, synthesize a final progress notification + if ( !length ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + } + + // Resolve the animation and report its conclusion + deferred.resolveWith( elem, [ animation ] ); + return false; + }, + animation = deferred.promise( { + elem: elem, + props: jQuery.extend( {}, properties ), + opts: jQuery.extend( true, { + specialEasing: {}, + easing: jQuery.easing._default + }, options ), + originalProperties: properties, + originalOptions: options, + startTime: fxNow || createFxNow(), + duration: options.duration, + tweens: [], + createTween: function( prop, end ) { + var tween = jQuery.Tween( elem, animation.opts, prop, end, + animation.opts.specialEasing[ prop ] || animation.opts.easing ); + animation.tweens.push( tween ); + return tween; + }, + stop: function( gotoEnd ) { + var index = 0, + + // If we are going to the end, we want to run all the tweens + // otherwise we skip this part + length = gotoEnd ? animation.tweens.length : 0; + if ( stopped ) { + return this; + } + stopped = true; + for ( ; index < length; index++ ) { + animation.tweens[ index ].run( 1 ); + } + + // Resolve when we played the last frame; otherwise, reject + if ( gotoEnd ) { + deferred.notifyWith( elem, [ animation, 1, 0 ] ); + deferred.resolveWith( elem, [ animation, gotoEnd ] ); + } else { + deferred.rejectWith( elem, [ animation, gotoEnd ] ); + } + return this; + } + } ), + props = animation.props; + + propFilter( props, animation.opts.specialEasing ); + + for ( ; index < length; index++ ) { + result = Animation.prefilters[ index ].call( animation, elem, props, animation.opts ); + if ( result ) { + if ( isFunction( result.stop ) ) { + jQuery._queueHooks( animation.elem, animation.opts.queue ).stop = + result.stop.bind( result ); + } + return result; + } + } + + jQuery.map( props, createTween, animation ); + + if ( isFunction( animation.opts.start ) ) { + animation.opts.start.call( elem, animation ); + } + + // Attach callbacks from options + animation + .progress( animation.opts.progress ) + .done( animation.opts.done, animation.opts.complete ) + .fail( animation.opts.fail ) + .always( animation.opts.always ); + + jQuery.fx.timer( + jQuery.extend( tick, { + elem: elem, + anim: animation, + queue: animation.opts.queue + } ) + ); + + return animation; +} + +jQuery.Animation = jQuery.extend( Animation, { + + tweeners: { + "*": [ function( prop, value ) { + var tween = this.createTween( prop, value ); + adjustCSS( tween.elem, prop, rcssNum.exec( value ), tween ); + return tween; + } ] + }, + + tweener: function( props, callback ) { + if ( isFunction( props ) ) { + callback = props; + props = [ "*" ]; + } else { + props = props.match( rnothtmlwhite ); + } + + var prop, + index = 0, + length = props.length; + + for ( ; index < length; index++ ) { + prop = props[ index ]; + Animation.tweeners[ prop ] = Animation.tweeners[ prop ] || []; + Animation.tweeners[ prop ].unshift( callback ); + } + }, + + prefilters: [ defaultPrefilter ], + + prefilter: function( callback, prepend ) { + if ( prepend ) { + Animation.prefilters.unshift( callback ); + } else { + Animation.prefilters.push( callback ); + } + } +} ); + +jQuery.speed = function( speed, easing, fn ) { + var opt = speed && typeof speed === "object" ? jQuery.extend( {}, speed ) : { + complete: fn || !fn && easing || + isFunction( speed ) && speed, + duration: speed, + easing: fn && easing || easing && !isFunction( easing ) && easing + }; + + // Go to the end state if fx are off + if ( jQuery.fx.off ) { + opt.duration = 0; + + } else { + if ( typeof opt.duration !== "number" ) { + if ( opt.duration in jQuery.fx.speeds ) { + opt.duration = jQuery.fx.speeds[ opt.duration ]; + + } else { + opt.duration = jQuery.fx.speeds._default; + } + } + } + + // Normalize opt.queue - true/undefined/null -> "fx" + if ( opt.queue == null || opt.queue === true ) { + opt.queue = "fx"; + } + + // Queueing + opt.old = opt.complete; + + opt.complete = function() { + if ( isFunction( opt.old ) ) { + opt.old.call( this ); + } + + if ( opt.queue ) { + jQuery.dequeue( this, opt.queue ); + } + }; + + return opt; +}; + +jQuery.fn.extend( { + fadeTo: function( speed, to, easing, callback ) { + + // Show any hidden elements after setting opacity to 0 + return this.filter( isHiddenWithinTree ).css( "opacity", 0 ).show() + + // Animate to the value specified + .end().animate( { opacity: to }, speed, easing, callback ); + }, + animate: function( prop, speed, easing, callback ) { + var empty = jQuery.isEmptyObject( prop ), + optall = jQuery.speed( speed, easing, callback ), + doAnimation = function() { + + // Operate on a copy of prop so per-property easing won't be lost + var anim = Animation( this, jQuery.extend( {}, prop ), optall ); + + // Empty animations, or finishing resolves immediately + if ( empty || dataPriv.get( this, "finish" ) ) { + anim.stop( true ); + } + }; + doAnimation.finish = doAnimation; + + return empty || optall.queue === false ? + this.each( doAnimation ) : + this.queue( optall.queue, doAnimation ); + }, + stop: function( type, clearQueue, gotoEnd ) { + var stopQueue = function( hooks ) { + var stop = hooks.stop; + delete hooks.stop; + stop( gotoEnd ); + }; + + if ( typeof type !== "string" ) { + gotoEnd = clearQueue; + clearQueue = type; + type = undefined; + } + if ( clearQueue ) { + this.queue( type || "fx", [] ); + } + + return this.each( function() { + var dequeue = true, + index = type != null && type + "queueHooks", + timers = jQuery.timers, + data = dataPriv.get( this ); + + if ( index ) { + if ( data[ index ] && data[ index ].stop ) { + stopQueue( data[ index ] ); + } + } else { + for ( index in data ) { + if ( data[ index ] && data[ index ].stop && rrun.test( index ) ) { + stopQueue( data[ index ] ); + } + } + } + + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && + ( type == null || timers[ index ].queue === type ) ) { + + timers[ index ].anim.stop( gotoEnd ); + dequeue = false; + timers.splice( index, 1 ); + } + } + + // Start the next in the queue if the last step wasn't forced. + // Timers currently will call their complete callbacks, which + // will dequeue but only if they were gotoEnd. + if ( dequeue || !gotoEnd ) { + jQuery.dequeue( this, type ); + } + } ); + }, + finish: function( type ) { + if ( type !== false ) { + type = type || "fx"; + } + return this.each( function() { + var index, + data = dataPriv.get( this ), + queue = data[ type + "queue" ], + hooks = data[ type + "queueHooks" ], + timers = jQuery.timers, + length = queue ? queue.length : 0; + + // Enable finishing flag on private data + data.finish = true; + + // Empty the queue first + jQuery.queue( this, type, [] ); + + if ( hooks && hooks.stop ) { + hooks.stop.call( this, true ); + } + + // Look for any active animations, and finish them + for ( index = timers.length; index--; ) { + if ( timers[ index ].elem === this && timers[ index ].queue === type ) { + timers[ index ].anim.stop( true ); + timers.splice( index, 1 ); + } + } + + // Look for any animations in the old queue and finish them + for ( index = 0; index < length; index++ ) { + if ( queue[ index ] && queue[ index ].finish ) { + queue[ index ].finish.call( this ); + } + } + + // Turn off finishing flag + delete data.finish; + } ); + } +} ); + +jQuery.each( [ "toggle", "show", "hide" ], function( _i, name ) { + var cssFn = jQuery.fn[ name ]; + jQuery.fn[ name ] = function( speed, easing, callback ) { + return speed == null || typeof speed === "boolean" ? + cssFn.apply( this, arguments ) : + this.animate( genFx( name, true ), speed, easing, callback ); + }; +} ); + +// Generate shortcuts for custom animations +jQuery.each( { + slideDown: genFx( "show" ), + slideUp: genFx( "hide" ), + slideToggle: genFx( "toggle" ), + fadeIn: { opacity: "show" }, + fadeOut: { opacity: "hide" }, + fadeToggle: { opacity: "toggle" } +}, function( name, props ) { + jQuery.fn[ name ] = function( speed, easing, callback ) { + return this.animate( props, speed, easing, callback ); + }; +} ); + +jQuery.timers = []; +jQuery.fx.tick = function() { + var timer, + i = 0, + timers = jQuery.timers; + + fxNow = Date.now(); + + for ( ; i < timers.length; i++ ) { + timer = timers[ i ]; + + // Run the timer and safely remove it when done (allowing for external removal) + if ( !timer() && timers[ i ] === timer ) { + timers.splice( i--, 1 ); + } + } + + if ( !timers.length ) { + jQuery.fx.stop(); + } + fxNow = undefined; +}; + +jQuery.fx.timer = function( timer ) { + jQuery.timers.push( timer ); + jQuery.fx.start(); +}; + +jQuery.fx.interval = 13; +jQuery.fx.start = function() { + if ( inProgress ) { + return; + } + + inProgress = true; + schedule(); +}; + +jQuery.fx.stop = function() { + inProgress = null; +}; + +jQuery.fx.speeds = { + slow: 600, + fast: 200, + + // Default speed + _default: 400 +}; + + +// Based off of the plugin by Clint Helfers, with permission. +// https://web.archive.org/web/20100324014747/http://blindsignals.com/index.php/2009/07/jquery-delay/ +jQuery.fn.delay = function( time, type ) { + time = jQuery.fx ? jQuery.fx.speeds[ time ] || time : time; + type = type || "fx"; + + return this.queue( type, function( next, hooks ) { + var timeout = window.setTimeout( next, time ); + hooks.stop = function() { + window.clearTimeout( timeout ); + }; + } ); +}; + + +( function() { + var input = document.createElement( "input" ), + select = document.createElement( "select" ), + opt = select.appendChild( document.createElement( "option" ) ); + + input.type = "checkbox"; + + // Support: Android <=4.3 only + // Default value for a checkbox should be "on" + support.checkOn = input.value !== ""; + + // Support: IE <=11 only + // Must access selectedIndex to make default options select + support.optSelected = opt.selected; + + // Support: IE <=11 only + // An input loses its value after becoming a radio + input = document.createElement( "input" ); + input.value = "t"; + input.type = "radio"; + support.radioValue = input.value === "t"; +} )(); + + +var boolHook, + attrHandle = jQuery.expr.attrHandle; + +jQuery.fn.extend( { + attr: function( name, value ) { + return access( this, jQuery.attr, name, value, arguments.length > 1 ); + }, + + removeAttr: function( name ) { + return this.each( function() { + jQuery.removeAttr( this, name ); + } ); + } +} ); + +jQuery.extend( { + attr: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set attributes on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + // Fallback to prop when attributes are not supported + if ( typeof elem.getAttribute === "undefined" ) { + return jQuery.prop( elem, name, value ); + } + + // Attribute hooks are determined by the lowercase version + // Grab necessary hook if one is defined + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + hooks = jQuery.attrHooks[ name.toLowerCase() ] || + ( jQuery.expr.match.bool.test( name ) ? boolHook : undefined ); + } + + if ( value !== undefined ) { + if ( value === null ) { + jQuery.removeAttr( elem, name ); + return; + } + + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + elem.setAttribute( name, value + "" ); + return value; + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + ret = jQuery.find.attr( elem, name ); + + // Non-existent attributes return null, we normalize to undefined + return ret == null ? undefined : ret; + }, + + attrHooks: { + type: { + set: function( elem, value ) { + if ( !support.radioValue && value === "radio" && + nodeName( elem, "input" ) ) { + var val = elem.value; + elem.setAttribute( "type", value ); + if ( val ) { + elem.value = val; + } + return value; + } + } + } + }, + + removeAttr: function( elem, value ) { + var name, + i = 0, + + // Attribute names can contain non-HTML whitespace characters + // https://html.spec.whatwg.org/multipage/syntax.html#attributes-2 + attrNames = value && value.match( rnothtmlwhite ); + + if ( attrNames && elem.nodeType === 1 ) { + while ( ( name = attrNames[ i++ ] ) ) { + elem.removeAttribute( name ); + } + } + } +} ); + +// Hooks for boolean attributes +boolHook = { + set: function( elem, value, name ) { + if ( value === false ) { + + // Remove boolean attributes when set to false + jQuery.removeAttr( elem, name ); + } else { + elem.setAttribute( name, name ); + } + return name; + } +}; + +jQuery.each( jQuery.expr.match.bool.source.match( /\w+/g ), function( _i, name ) { + var getter = attrHandle[ name ] || jQuery.find.attr; + + attrHandle[ name ] = function( elem, name, isXML ) { + var ret, handle, + lowercaseName = name.toLowerCase(); + + if ( !isXML ) { + + // Avoid an infinite loop by temporarily removing this function from the getter + handle = attrHandle[ lowercaseName ]; + attrHandle[ lowercaseName ] = ret; + ret = getter( elem, name, isXML ) != null ? + lowercaseName : + null; + attrHandle[ lowercaseName ] = handle; + } + return ret; + }; +} ); + + + + +var rfocusable = /^(?:input|select|textarea|button)$/i, + rclickable = /^(?:a|area)$/i; + +jQuery.fn.extend( { + prop: function( name, value ) { + return access( this, jQuery.prop, name, value, arguments.length > 1 ); + }, + + removeProp: function( name ) { + return this.each( function() { + delete this[ jQuery.propFix[ name ] || name ]; + } ); + } +} ); + +jQuery.extend( { + prop: function( elem, name, value ) { + var ret, hooks, + nType = elem.nodeType; + + // Don't get/set properties on text, comment and attribute nodes + if ( nType === 3 || nType === 8 || nType === 2 ) { + return; + } + + if ( nType !== 1 || !jQuery.isXMLDoc( elem ) ) { + + // Fix name and attach hooks + name = jQuery.propFix[ name ] || name; + hooks = jQuery.propHooks[ name ]; + } + + if ( value !== undefined ) { + if ( hooks && "set" in hooks && + ( ret = hooks.set( elem, value, name ) ) !== undefined ) { + return ret; + } + + return ( elem[ name ] = value ); + } + + if ( hooks && "get" in hooks && ( ret = hooks.get( elem, name ) ) !== null ) { + return ret; + } + + return elem[ name ]; + }, + + propHooks: { + tabIndex: { + get: function( elem ) { + + // Support: IE <=9 - 11 only + // elem.tabIndex doesn't always return the + // correct value when it hasn't been explicitly set + // https://web.archive.org/web/20141116233347/http://fluidproject.org/blog/2008/01/09/getting-setting-and-removing-tabindex-values-with-javascript/ + // Use proper attribute retrieval(#12072) + var tabindex = jQuery.find.attr( elem, "tabindex" ); + + if ( tabindex ) { + return parseInt( tabindex, 10 ); + } + + if ( + rfocusable.test( elem.nodeName ) || + rclickable.test( elem.nodeName ) && + elem.href + ) { + return 0; + } + + return -1; + } + } + }, + + propFix: { + "for": "htmlFor", + "class": "className" + } +} ); + +// Support: IE <=11 only +// Accessing the selectedIndex property +// forces the browser to respect setting selected +// on the option +// The getter ensures a default option is selected +// when in an optgroup +// eslint rule "no-unused-expressions" is disabled for this code +// since it considers such accessions noop +if ( !support.optSelected ) { + jQuery.propHooks.selected = { + get: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent && parent.parentNode ) { + parent.parentNode.selectedIndex; + } + return null; + }, + set: function( elem ) { + + /* eslint no-unused-expressions: "off" */ + + var parent = elem.parentNode; + if ( parent ) { + parent.selectedIndex; + + if ( parent.parentNode ) { + parent.parentNode.selectedIndex; + } + } + } + }; +} + +jQuery.each( [ + "tabIndex", + "readOnly", + "maxLength", + "cellSpacing", + "cellPadding", + "rowSpan", + "colSpan", + "useMap", + "frameBorder", + "contentEditable" +], function() { + jQuery.propFix[ this.toLowerCase() ] = this; +} ); + + + + + // Strip and collapse whitespace according to HTML spec + // https://infra.spec.whatwg.org/#strip-and-collapse-ascii-whitespace + function stripAndCollapse( value ) { + var tokens = value.match( rnothtmlwhite ) || []; + return tokens.join( " " ); + } + + +function getClass( elem ) { + return elem.getAttribute && elem.getAttribute( "class" ) || ""; +} + +function classesToArray( value ) { + if ( Array.isArray( value ) ) { + return value; + } + if ( typeof value === "string" ) { + return value.match( rnothtmlwhite ) || []; + } + return []; +} + +jQuery.fn.extend( { + addClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).addClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + if ( cur.indexOf( " " + clazz + " " ) < 0 ) { + cur += clazz + " "; + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + removeClass: function( value ) { + var classes, elem, cur, curValue, clazz, j, finalValue, + i = 0; + + if ( isFunction( value ) ) { + return this.each( function( j ) { + jQuery( this ).removeClass( value.call( this, j, getClass( this ) ) ); + } ); + } + + if ( !arguments.length ) { + return this.attr( "class", "" ); + } + + classes = classesToArray( value ); + + if ( classes.length ) { + while ( ( elem = this[ i++ ] ) ) { + curValue = getClass( elem ); + + // This expression is here for better compressibility (see addClass) + cur = elem.nodeType === 1 && ( " " + stripAndCollapse( curValue ) + " " ); + + if ( cur ) { + j = 0; + while ( ( clazz = classes[ j++ ] ) ) { + + // Remove *all* instances + while ( cur.indexOf( " " + clazz + " " ) > -1 ) { + cur = cur.replace( " " + clazz + " ", " " ); + } + } + + // Only assign if different to avoid unneeded rendering. + finalValue = stripAndCollapse( cur ); + if ( curValue !== finalValue ) { + elem.setAttribute( "class", finalValue ); + } + } + } + } + + return this; + }, + + toggleClass: function( value, stateVal ) { + var type = typeof value, + isValidValue = type === "string" || Array.isArray( value ); + + if ( typeof stateVal === "boolean" && isValidValue ) { + return stateVal ? this.addClass( value ) : this.removeClass( value ); + } + + if ( isFunction( value ) ) { + return this.each( function( i ) { + jQuery( this ).toggleClass( + value.call( this, i, getClass( this ), stateVal ), + stateVal + ); + } ); + } + + return this.each( function() { + var className, i, self, classNames; + + if ( isValidValue ) { + + // Toggle individual class names + i = 0; + self = jQuery( this ); + classNames = classesToArray( value ); + + while ( ( className = classNames[ i++ ] ) ) { + + // Check each className given, space separated list + if ( self.hasClass( className ) ) { + self.removeClass( className ); + } else { + self.addClass( className ); + } + } + + // Toggle whole class name + } else if ( value === undefined || type === "boolean" ) { + className = getClass( this ); + if ( className ) { + + // Store className if set + dataPriv.set( this, "__className__", className ); + } + + // If the element has a class name or if we're passed `false`, + // then remove the whole classname (if there was one, the above saved it). + // Otherwise bring back whatever was previously saved (if anything), + // falling back to the empty string if nothing was stored. + if ( this.setAttribute ) { + this.setAttribute( "class", + className || value === false ? + "" : + dataPriv.get( this, "__className__" ) || "" + ); + } + } + } ); + }, + + hasClass: function( selector ) { + var className, elem, + i = 0; + + className = " " + selector + " "; + while ( ( elem = this[ i++ ] ) ) { + if ( elem.nodeType === 1 && + ( " " + stripAndCollapse( getClass( elem ) ) + " " ).indexOf( className ) > -1 ) { + return true; + } + } + + return false; + } +} ); + + + + +var rreturn = /\r/g; + +jQuery.fn.extend( { + val: function( value ) { + var hooks, ret, valueIsFunction, + elem = this[ 0 ]; + + if ( !arguments.length ) { + if ( elem ) { + hooks = jQuery.valHooks[ elem.type ] || + jQuery.valHooks[ elem.nodeName.toLowerCase() ]; + + if ( hooks && + "get" in hooks && + ( ret = hooks.get( elem, "value" ) ) !== undefined + ) { + return ret; + } + + ret = elem.value; + + // Handle most common string cases + if ( typeof ret === "string" ) { + return ret.replace( rreturn, "" ); + } + + // Handle cases where value is null/undef or number + return ret == null ? "" : ret; + } + + return; + } + + valueIsFunction = isFunction( value ); + + return this.each( function( i ) { + var val; + + if ( this.nodeType !== 1 ) { + return; + } + + if ( valueIsFunction ) { + val = value.call( this, i, jQuery( this ).val() ); + } else { + val = value; + } + + // Treat null/undefined as ""; convert numbers to string + if ( val == null ) { + val = ""; + + } else if ( typeof val === "number" ) { + val += ""; + + } else if ( Array.isArray( val ) ) { + val = jQuery.map( val, function( value ) { + return value == null ? "" : value + ""; + } ); + } + + hooks = jQuery.valHooks[ this.type ] || jQuery.valHooks[ this.nodeName.toLowerCase() ]; + + // If set returns undefined, fall back to normal setting + if ( !hooks || !( "set" in hooks ) || hooks.set( this, val, "value" ) === undefined ) { + this.value = val; + } + } ); + } +} ); + +jQuery.extend( { + valHooks: { + option: { + get: function( elem ) { + + var val = jQuery.find.attr( elem, "value" ); + return val != null ? + val : + + // Support: IE <=10 - 11 only + // option.text throws exceptions (#14686, #14858) + // Strip and collapse whitespace + // https://html.spec.whatwg.org/#strip-and-collapse-whitespace + stripAndCollapse( jQuery.text( elem ) ); + } + }, + select: { + get: function( elem ) { + var value, option, i, + options = elem.options, + index = elem.selectedIndex, + one = elem.type === "select-one", + values = one ? null : [], + max = one ? index + 1 : options.length; + + if ( index < 0 ) { + i = max; + + } else { + i = one ? index : 0; + } + + // Loop through all the selected options + for ( ; i < max; i++ ) { + option = options[ i ]; + + // Support: IE <=9 only + // IE8-9 doesn't update selected after form reset (#2551) + if ( ( option.selected || i === index ) && + + // Don't return options that are disabled or in a disabled optgroup + !option.disabled && + ( !option.parentNode.disabled || + !nodeName( option.parentNode, "optgroup" ) ) ) { + + // Get the specific value for the option + value = jQuery( option ).val(); + + // We don't need an array for one selects + if ( one ) { + return value; + } + + // Multi-Selects return an array + values.push( value ); + } + } + + return values; + }, + + set: function( elem, value ) { + var optionSet, option, + options = elem.options, + values = jQuery.makeArray( value ), + i = options.length; + + while ( i-- ) { + option = options[ i ]; + + /* eslint-disable no-cond-assign */ + + if ( option.selected = + jQuery.inArray( jQuery.valHooks.option.get( option ), values ) > -1 + ) { + optionSet = true; + } + + /* eslint-enable no-cond-assign */ + } + + // Force browsers to behave consistently when non-matching value is set + if ( !optionSet ) { + elem.selectedIndex = -1; + } + return values; + } + } + } +} ); + +// Radios and checkboxes getter/setter +jQuery.each( [ "radio", "checkbox" ], function() { + jQuery.valHooks[ this ] = { + set: function( elem, value ) { + if ( Array.isArray( value ) ) { + return ( elem.checked = jQuery.inArray( jQuery( elem ).val(), value ) > -1 ); + } + } + }; + if ( !support.checkOn ) { + jQuery.valHooks[ this ].get = function( elem ) { + return elem.getAttribute( "value" ) === null ? "on" : elem.value; + }; + } +} ); + + + + +// Return jQuery for attributes-only inclusion + + +support.focusin = "onfocusin" in window; + + +var rfocusMorph = /^(?:focusinfocus|focusoutblur)$/, + stopPropagationCallback = function( e ) { + e.stopPropagation(); + }; + +jQuery.extend( jQuery.event, { + + trigger: function( event, data, elem, onlyHandlers ) { + + var i, cur, tmp, bubbleType, ontype, handle, special, lastElement, + eventPath = [ elem || document ], + type = hasOwn.call( event, "type" ) ? event.type : event, + namespaces = hasOwn.call( event, "namespace" ) ? event.namespace.split( "." ) : []; + + cur = lastElement = tmp = elem = elem || document; + + // Don't do events on text and comment nodes + if ( elem.nodeType === 3 || elem.nodeType === 8 ) { + return; + } + + // focus/blur morphs to focusin/out; ensure we're not firing them right now + if ( rfocusMorph.test( type + jQuery.event.triggered ) ) { + return; + } + + if ( type.indexOf( "." ) > -1 ) { + + // Namespaced trigger; create a regexp to match event type in handle() + namespaces = type.split( "." ); + type = namespaces.shift(); + namespaces.sort(); + } + ontype = type.indexOf( ":" ) < 0 && "on" + type; + + // Caller can pass in a jQuery.Event object, Object, or just an event type string + event = event[ jQuery.expando ] ? + event : + new jQuery.Event( type, typeof event === "object" && event ); + + // Trigger bitmask: & 1 for native handlers; & 2 for jQuery (always true) + event.isTrigger = onlyHandlers ? 2 : 3; + event.namespace = namespaces.join( "." ); + event.rnamespace = event.namespace ? + new RegExp( "(^|\\.)" + namespaces.join( "\\.(?:.*\\.|)" ) + "(\\.|$)" ) : + null; + + // Clean up the event in case it is being reused + event.result = undefined; + if ( !event.target ) { + event.target = elem; + } + + // Clone any incoming data and prepend the event, creating the handler arg list + data = data == null ? + [ event ] : + jQuery.makeArray( data, [ event ] ); + + // Allow special events to draw outside the lines + special = jQuery.event.special[ type ] || {}; + if ( !onlyHandlers && special.trigger && special.trigger.apply( elem, data ) === false ) { + return; + } + + // Determine event propagation path in advance, per W3C events spec (#9951) + // Bubble up to document, then to window; watch for a global ownerDocument var (#9724) + if ( !onlyHandlers && !special.noBubble && !isWindow( elem ) ) { + + bubbleType = special.delegateType || type; + if ( !rfocusMorph.test( bubbleType + type ) ) { + cur = cur.parentNode; + } + for ( ; cur; cur = cur.parentNode ) { + eventPath.push( cur ); + tmp = cur; + } + + // Only add window if we got to document (e.g., not plain obj or detached DOM) + if ( tmp === ( elem.ownerDocument || document ) ) { + eventPath.push( tmp.defaultView || tmp.parentWindow || window ); + } + } + + // Fire handlers on the event path + i = 0; + while ( ( cur = eventPath[ i++ ] ) && !event.isPropagationStopped() ) { + lastElement = cur; + event.type = i > 1 ? + bubbleType : + special.bindType || type; + + // jQuery handler + handle = ( + dataPriv.get( cur, "events" ) || Object.create( null ) + )[ event.type ] && + dataPriv.get( cur, "handle" ); + if ( handle ) { + handle.apply( cur, data ); + } + + // Native handler + handle = ontype && cur[ ontype ]; + if ( handle && handle.apply && acceptData( cur ) ) { + event.result = handle.apply( cur, data ); + if ( event.result === false ) { + event.preventDefault(); + } + } + } + event.type = type; + + // If nobody prevented the default action, do it now + if ( !onlyHandlers && !event.isDefaultPrevented() ) { + + if ( ( !special._default || + special._default.apply( eventPath.pop(), data ) === false ) && + acceptData( elem ) ) { + + // Call a native DOM method on the target with the same name as the event. + // Don't do default actions on window, that's where global variables be (#6170) + if ( ontype && isFunction( elem[ type ] ) && !isWindow( elem ) ) { + + // Don't re-trigger an onFOO event when we call its FOO() method + tmp = elem[ ontype ]; + + if ( tmp ) { + elem[ ontype ] = null; + } + + // Prevent re-triggering of the same event, since we already bubbled it above + jQuery.event.triggered = type; + + if ( event.isPropagationStopped() ) { + lastElement.addEventListener( type, stopPropagationCallback ); + } + + elem[ type ](); + + if ( event.isPropagationStopped() ) { + lastElement.removeEventListener( type, stopPropagationCallback ); + } + + jQuery.event.triggered = undefined; + + if ( tmp ) { + elem[ ontype ] = tmp; + } + } + } + } + + return event.result; + }, + + // Piggyback on a donor event to simulate a different one + // Used only for `focus(in | out)` events + simulate: function( type, elem, event ) { + var e = jQuery.extend( + new jQuery.Event(), + event, + { + type: type, + isSimulated: true + } + ); + + jQuery.event.trigger( e, null, elem ); + } + +} ); + +jQuery.fn.extend( { + + trigger: function( type, data ) { + return this.each( function() { + jQuery.event.trigger( type, data, this ); + } ); + }, + triggerHandler: function( type, data ) { + var elem = this[ 0 ]; + if ( elem ) { + return jQuery.event.trigger( type, data, elem, true ); + } + } +} ); + + +// Support: Firefox <=44 +// Firefox doesn't have focus(in | out) events +// Related ticket - https://bugzilla.mozilla.org/show_bug.cgi?id=687787 +// +// Support: Chrome <=48 - 49, Safari <=9.0 - 9.1 +// focus(in | out) events fire after focus & blur events, +// which is spec violation - http://www.w3.org/TR/DOM-Level-3-Events/#events-focusevent-event-order +// Related ticket - https://bugs.chromium.org/p/chromium/issues/detail?id=449857 +if ( !support.focusin ) { + jQuery.each( { focus: "focusin", blur: "focusout" }, function( orig, fix ) { + + // Attach a single capturing handler on the document while someone wants focusin/focusout + var handler = function( event ) { + jQuery.event.simulate( fix, event.target, jQuery.event.fix( event ) ); + }; + + jQuery.event.special[ fix ] = { + setup: function() { + + // Handle: regular nodes (via `this.ownerDocument`), window + // (via `this.document`) & document (via `this`). + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ); + + if ( !attaches ) { + doc.addEventListener( orig, handler, true ); + } + dataPriv.access( doc, fix, ( attaches || 0 ) + 1 ); + }, + teardown: function() { + var doc = this.ownerDocument || this.document || this, + attaches = dataPriv.access( doc, fix ) - 1; + + if ( !attaches ) { + doc.removeEventListener( orig, handler, true ); + dataPriv.remove( doc, fix ); + + } else { + dataPriv.access( doc, fix, attaches ); + } + } + }; + } ); +} +var location = window.location; + +var nonce = { guid: Date.now() }; + +var rquery = ( /\?/ ); + + + +// Cross-browser xml parsing +jQuery.parseXML = function( data ) { + var xml; + if ( !data || typeof data !== "string" ) { + return null; + } + + // Support: IE 9 - 11 only + // IE throws on parseFromString with invalid input. + try { + xml = ( new window.DOMParser() ).parseFromString( data, "text/xml" ); + } catch ( e ) { + xml = undefined; + } + + if ( !xml || xml.getElementsByTagName( "parsererror" ).length ) { + jQuery.error( "Invalid XML: " + data ); + } + return xml; +}; + + +var + rbracket = /\[\]$/, + rCRLF = /\r?\n/g, + rsubmitterTypes = /^(?:submit|button|image|reset|file)$/i, + rsubmittable = /^(?:input|select|textarea|keygen)/i; + +function buildParams( prefix, obj, traditional, add ) { + var name; + + if ( Array.isArray( obj ) ) { + + // Serialize array item. + jQuery.each( obj, function( i, v ) { + if ( traditional || rbracket.test( prefix ) ) { + + // Treat each array item as a scalar. + add( prefix, v ); + + } else { + + // Item is non-scalar (array or object), encode its numeric index. + buildParams( + prefix + "[" + ( typeof v === "object" && v != null ? i : "" ) + "]", + v, + traditional, + add + ); + } + } ); + + } else if ( !traditional && toType( obj ) === "object" ) { + + // Serialize object item. + for ( name in obj ) { + buildParams( prefix + "[" + name + "]", obj[ name ], traditional, add ); + } + + } else { + + // Serialize scalar item. + add( prefix, obj ); + } +} + +// Serialize an array of form elements or a set of +// key/values into a query string +jQuery.param = function( a, traditional ) { + var prefix, + s = [], + add = function( key, valueOrFunction ) { + + // If value is a function, invoke it and use its return value + var value = isFunction( valueOrFunction ) ? + valueOrFunction() : + valueOrFunction; + + s[ s.length ] = encodeURIComponent( key ) + "=" + + encodeURIComponent( value == null ? "" : value ); + }; + + if ( a == null ) { + return ""; + } + + // If an array was passed in, assume that it is an array of form elements. + if ( Array.isArray( a ) || ( a.jquery && !jQuery.isPlainObject( a ) ) ) { + + // Serialize the form elements + jQuery.each( a, function() { + add( this.name, this.value ); + } ); + + } else { + + // If traditional, encode the "old" way (the way 1.3.2 or older + // did it), otherwise encode params recursively. + for ( prefix in a ) { + buildParams( prefix, a[ prefix ], traditional, add ); + } + } + + // Return the resulting serialization + return s.join( "&" ); +}; + +jQuery.fn.extend( { + serialize: function() { + return jQuery.param( this.serializeArray() ); + }, + serializeArray: function() { + return this.map( function() { + + // Can add propHook for "elements" to filter or add form elements + var elements = jQuery.prop( this, "elements" ); + return elements ? jQuery.makeArray( elements ) : this; + } ) + .filter( function() { + var type = this.type; + + // Use .is( ":disabled" ) so that fieldset[disabled] works + return this.name && !jQuery( this ).is( ":disabled" ) && + rsubmittable.test( this.nodeName ) && !rsubmitterTypes.test( type ) && + ( this.checked || !rcheckableType.test( type ) ); + } ) + .map( function( _i, elem ) { + var val = jQuery( this ).val(); + + if ( val == null ) { + return null; + } + + if ( Array.isArray( val ) ) { + return jQuery.map( val, function( val ) { + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ); + } + + return { name: elem.name, value: val.replace( rCRLF, "\r\n" ) }; + } ).get(); + } +} ); + + +var + r20 = /%20/g, + rhash = /#.*$/, + rantiCache = /([?&])_=[^&]*/, + rheaders = /^(.*?):[ \t]*([^\r\n]*)$/mg, + + // #7653, #8125, #8152: local protocol detection + rlocalProtocol = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, + rnoContent = /^(?:GET|HEAD)$/, + rprotocol = /^\/\//, + + /* Prefilters + * 1) They are useful to introduce custom dataTypes (see ajax/jsonp.js for an example) + * 2) These are called: + * - BEFORE asking for a transport + * - AFTER param serialization (s.data is a string if s.processData is true) + * 3) key is the dataType + * 4) the catchall symbol "*" can be used + * 5) execution will start with transport dataType and THEN continue down to "*" if needed + */ + prefilters = {}, + + /* Transports bindings + * 1) key is the dataType + * 2) the catchall symbol "*" can be used + * 3) selection will start with transport dataType and THEN go to "*" if needed + */ + transports = {}, + + // Avoid comment-prolog char sequence (#10098); must appease lint and evade compression + allTypes = "*/".concat( "*" ), + + // Anchor tag for parsing the document origin + originAnchor = document.createElement( "a" ); + originAnchor.href = location.href; + +// Base "constructor" for jQuery.ajaxPrefilter and jQuery.ajaxTransport +function addToPrefiltersOrTransports( structure ) { + + // dataTypeExpression is optional and defaults to "*" + return function( dataTypeExpression, func ) { + + if ( typeof dataTypeExpression !== "string" ) { + func = dataTypeExpression; + dataTypeExpression = "*"; + } + + var dataType, + i = 0, + dataTypes = dataTypeExpression.toLowerCase().match( rnothtmlwhite ) || []; + + if ( isFunction( func ) ) { + + // For each dataType in the dataTypeExpression + while ( ( dataType = dataTypes[ i++ ] ) ) { + + // Prepend if requested + if ( dataType[ 0 ] === "+" ) { + dataType = dataType.slice( 1 ) || "*"; + ( structure[ dataType ] = structure[ dataType ] || [] ).unshift( func ); + + // Otherwise append + } else { + ( structure[ dataType ] = structure[ dataType ] || [] ).push( func ); + } + } + } + }; +} + +// Base inspection function for prefilters and transports +function inspectPrefiltersOrTransports( structure, options, originalOptions, jqXHR ) { + + var inspected = {}, + seekingTransport = ( structure === transports ); + + function inspect( dataType ) { + var selected; + inspected[ dataType ] = true; + jQuery.each( structure[ dataType ] || [], function( _, prefilterOrFactory ) { + var dataTypeOrTransport = prefilterOrFactory( options, originalOptions, jqXHR ); + if ( typeof dataTypeOrTransport === "string" && + !seekingTransport && !inspected[ dataTypeOrTransport ] ) { + + options.dataTypes.unshift( dataTypeOrTransport ); + inspect( dataTypeOrTransport ); + return false; + } else if ( seekingTransport ) { + return !( selected = dataTypeOrTransport ); + } + } ); + return selected; + } + + return inspect( options.dataTypes[ 0 ] ) || !inspected[ "*" ] && inspect( "*" ); +} + +// A special extend for ajax options +// that takes "flat" options (not to be deep extended) +// Fixes #9887 +function ajaxExtend( target, src ) { + var key, deep, + flatOptions = jQuery.ajaxSettings.flatOptions || {}; + + for ( key in src ) { + if ( src[ key ] !== undefined ) { + ( flatOptions[ key ] ? target : ( deep || ( deep = {} ) ) )[ key ] = src[ key ]; + } + } + if ( deep ) { + jQuery.extend( true, target, deep ); + } + + return target; +} + +/* Handles responses to an ajax request: + * - finds the right dataType (mediates between content-type and expected dataType) + * - returns the corresponding response + */ +function ajaxHandleResponses( s, jqXHR, responses ) { + + var ct, type, finalDataType, firstDataType, + contents = s.contents, + dataTypes = s.dataTypes; + + // Remove auto dataType and get content-type in the process + while ( dataTypes[ 0 ] === "*" ) { + dataTypes.shift(); + if ( ct === undefined ) { + ct = s.mimeType || jqXHR.getResponseHeader( "Content-Type" ); + } + } + + // Check if we're dealing with a known content-type + if ( ct ) { + for ( type in contents ) { + if ( contents[ type ] && contents[ type ].test( ct ) ) { + dataTypes.unshift( type ); + break; + } + } + } + + // Check to see if we have a response for the expected dataType + if ( dataTypes[ 0 ] in responses ) { + finalDataType = dataTypes[ 0 ]; + } else { + + // Try convertible dataTypes + for ( type in responses ) { + if ( !dataTypes[ 0 ] || s.converters[ type + " " + dataTypes[ 0 ] ] ) { + finalDataType = type; + break; + } + if ( !firstDataType ) { + firstDataType = type; + } + } + + // Or just use first one + finalDataType = finalDataType || firstDataType; + } + + // If we found a dataType + // We add the dataType to the list if needed + // and return the corresponding response + if ( finalDataType ) { + if ( finalDataType !== dataTypes[ 0 ] ) { + dataTypes.unshift( finalDataType ); + } + return responses[ finalDataType ]; + } +} + +/* Chain conversions given the request and the original response + * Also sets the responseXXX fields on the jqXHR instance + */ +function ajaxConvert( s, response, jqXHR, isSuccess ) { + var conv2, current, conv, tmp, prev, + converters = {}, + + // Work with a copy of dataTypes in case we need to modify it for conversion + dataTypes = s.dataTypes.slice(); + + // Create converters map with lowercased keys + if ( dataTypes[ 1 ] ) { + for ( conv in s.converters ) { + converters[ conv.toLowerCase() ] = s.converters[ conv ]; + } + } + + current = dataTypes.shift(); + + // Convert to each sequential dataType + while ( current ) { + + if ( s.responseFields[ current ] ) { + jqXHR[ s.responseFields[ current ] ] = response; + } + + // Apply the dataFilter if provided + if ( !prev && isSuccess && s.dataFilter ) { + response = s.dataFilter( response, s.dataType ); + } + + prev = current; + current = dataTypes.shift(); + + if ( current ) { + + // There's only work to do if current dataType is non-auto + if ( current === "*" ) { + + current = prev; + + // Convert response if prev dataType is non-auto and differs from current + } else if ( prev !== "*" && prev !== current ) { + + // Seek a direct converter + conv = converters[ prev + " " + current ] || converters[ "* " + current ]; + + // If none found, seek a pair + if ( !conv ) { + for ( conv2 in converters ) { + + // If conv2 outputs current + tmp = conv2.split( " " ); + if ( tmp[ 1 ] === current ) { + + // If prev can be converted to accepted input + conv = converters[ prev + " " + tmp[ 0 ] ] || + converters[ "* " + tmp[ 0 ] ]; + if ( conv ) { + + // Condense equivalence converters + if ( conv === true ) { + conv = converters[ conv2 ]; + + // Otherwise, insert the intermediate dataType + } else if ( converters[ conv2 ] !== true ) { + current = tmp[ 0 ]; + dataTypes.unshift( tmp[ 1 ] ); + } + break; + } + } + } + } + + // Apply converter (if not an equivalence) + if ( conv !== true ) { + + // Unless errors are allowed to bubble, catch and return them + if ( conv && s.throws ) { + response = conv( response ); + } else { + try { + response = conv( response ); + } catch ( e ) { + return { + state: "parsererror", + error: conv ? e : "No conversion from " + prev + " to " + current + }; + } + } + } + } + } + } + + return { state: "success", data: response }; +} + +jQuery.extend( { + + // Counter for holding the number of active queries + active: 0, + + // Last-Modified header cache for next request + lastModified: {}, + etag: {}, + + ajaxSettings: { + url: location.href, + type: "GET", + isLocal: rlocalProtocol.test( location.protocol ), + global: true, + processData: true, + async: true, + contentType: "application/x-www-form-urlencoded; charset=UTF-8", + + /* + timeout: 0, + data: null, + dataType: null, + username: null, + password: null, + cache: null, + throws: false, + traditional: false, + headers: {}, + */ + + accepts: { + "*": allTypes, + text: "text/plain", + html: "text/html", + xml: "application/xml, text/xml", + json: "application/json, text/javascript" + }, + + contents: { + xml: /\bxml\b/, + html: /\bhtml/, + json: /\bjson\b/ + }, + + responseFields: { + xml: "responseXML", + text: "responseText", + json: "responseJSON" + }, + + // Data converters + // Keys separate source (or catchall "*") and destination types with a single space + converters: { + + // Convert anything to text + "* text": String, + + // Text to html (true = no transformation) + "text html": true, + + // Evaluate text as a json expression + "text json": JSON.parse, + + // Parse text as xml + "text xml": jQuery.parseXML + }, + + // For options that shouldn't be deep extended: + // you can add your own custom options here if + // and when you create one that shouldn't be + // deep extended (see ajaxExtend) + flatOptions: { + url: true, + context: true + } + }, + + // Creates a full fledged settings object into target + // with both ajaxSettings and settings fields. + // If target is omitted, writes into ajaxSettings. + ajaxSetup: function( target, settings ) { + return settings ? + + // Building a settings object + ajaxExtend( ajaxExtend( target, jQuery.ajaxSettings ), settings ) : + + // Extending ajaxSettings + ajaxExtend( jQuery.ajaxSettings, target ); + }, + + ajaxPrefilter: addToPrefiltersOrTransports( prefilters ), + ajaxTransport: addToPrefiltersOrTransports( transports ), + + // Main method + ajax: function( url, options ) { + + // If url is an object, simulate pre-1.5 signature + if ( typeof url === "object" ) { + options = url; + url = undefined; + } + + // Force options to be an object + options = options || {}; + + var transport, + + // URL without anti-cache param + cacheURL, + + // Response headers + responseHeadersString, + responseHeaders, + + // timeout handle + timeoutTimer, + + // Url cleanup var + urlAnchor, + + // Request state (becomes false upon send and true upon completion) + completed, + + // To know if global events are to be dispatched + fireGlobals, + + // Loop variable + i, + + // uncached part of the url + uncached, + + // Create the final options object + s = jQuery.ajaxSetup( {}, options ), + + // Callbacks context + callbackContext = s.context || s, + + // Context for global events is callbackContext if it is a DOM node or jQuery collection + globalEventContext = s.context && + ( callbackContext.nodeType || callbackContext.jquery ) ? + jQuery( callbackContext ) : + jQuery.event, + + // Deferreds + deferred = jQuery.Deferred(), + completeDeferred = jQuery.Callbacks( "once memory" ), + + // Status-dependent callbacks + statusCode = s.statusCode || {}, + + // Headers (they are sent all at once) + requestHeaders = {}, + requestHeadersNames = {}, + + // Default abort message + strAbort = "canceled", + + // Fake xhr + jqXHR = { + readyState: 0, + + // Builds headers hashtable if needed + getResponseHeader: function( key ) { + var match; + if ( completed ) { + if ( !responseHeaders ) { + responseHeaders = {}; + while ( ( match = rheaders.exec( responseHeadersString ) ) ) { + responseHeaders[ match[ 1 ].toLowerCase() + " " ] = + ( responseHeaders[ match[ 1 ].toLowerCase() + " " ] || [] ) + .concat( match[ 2 ] ); + } + } + match = responseHeaders[ key.toLowerCase() + " " ]; + } + return match == null ? null : match.join( ", " ); + }, + + // Raw string + getAllResponseHeaders: function() { + return completed ? responseHeadersString : null; + }, + + // Caches the header + setRequestHeader: function( name, value ) { + if ( completed == null ) { + name = requestHeadersNames[ name.toLowerCase() ] = + requestHeadersNames[ name.toLowerCase() ] || name; + requestHeaders[ name ] = value; + } + return this; + }, + + // Overrides response content-type header + overrideMimeType: function( type ) { + if ( completed == null ) { + s.mimeType = type; + } + return this; + }, + + // Status-dependent callbacks + statusCode: function( map ) { + var code; + if ( map ) { + if ( completed ) { + + // Execute the appropriate callbacks + jqXHR.always( map[ jqXHR.status ] ); + } else { + + // Lazy-add the new callbacks in a way that preserves old ones + for ( code in map ) { + statusCode[ code ] = [ statusCode[ code ], map[ code ] ]; + } + } + } + return this; + }, + + // Cancel the request + abort: function( statusText ) { + var finalText = statusText || strAbort; + if ( transport ) { + transport.abort( finalText ); + } + done( 0, finalText ); + return this; + } + }; + + // Attach deferreds + deferred.promise( jqXHR ); + + // Add protocol if not provided (prefilters might expect it) + // Handle falsy url in the settings object (#10093: consistency with old signature) + // We also use the url parameter if available + s.url = ( ( url || s.url || location.href ) + "" ) + .replace( rprotocol, location.protocol + "//" ); + + // Alias method option to type as per ticket #12004 + s.type = options.method || options.type || s.method || s.type; + + // Extract dataTypes list + s.dataTypes = ( s.dataType || "*" ).toLowerCase().match( rnothtmlwhite ) || [ "" ]; + + // A cross-domain request is in order when the origin doesn't match the current origin. + if ( s.crossDomain == null ) { + urlAnchor = document.createElement( "a" ); + + // Support: IE <=8 - 11, Edge 12 - 15 + // IE throws exception on accessing the href property if url is malformed, + // e.g. http://example.com:80x/ + try { + urlAnchor.href = s.url; + + // Support: IE <=8 - 11 only + // Anchor's host property isn't correctly set when s.url is relative + urlAnchor.href = urlAnchor.href; + s.crossDomain = originAnchor.protocol + "//" + originAnchor.host !== + urlAnchor.protocol + "//" + urlAnchor.host; + } catch ( e ) { + + // If there is an error parsing the URL, assume it is crossDomain, + // it can be rejected by the transport if it is invalid + s.crossDomain = true; + } + } + + // Convert data if not already a string + if ( s.data && s.processData && typeof s.data !== "string" ) { + s.data = jQuery.param( s.data, s.traditional ); + } + + // Apply prefilters + inspectPrefiltersOrTransports( prefilters, s, options, jqXHR ); + + // If request was aborted inside a prefilter, stop there + if ( completed ) { + return jqXHR; + } + + // We can fire global events as of now if asked to + // Don't fire events if jQuery.event is undefined in an AMD-usage scenario (#15118) + fireGlobals = jQuery.event && s.global; + + // Watch for a new set of requests + if ( fireGlobals && jQuery.active++ === 0 ) { + jQuery.event.trigger( "ajaxStart" ); + } + + // Uppercase the type + s.type = s.type.toUpperCase(); + + // Determine if request has content + s.hasContent = !rnoContent.test( s.type ); + + // Save the URL in case we're toying with the If-Modified-Since + // and/or If-None-Match header later on + // Remove hash to simplify url manipulation + cacheURL = s.url.replace( rhash, "" ); + + // More options handling for requests with no content + if ( !s.hasContent ) { + + // Remember the hash so we can put it back + uncached = s.url.slice( cacheURL.length ); + + // If data is available and should be processed, append data to url + if ( s.data && ( s.processData || typeof s.data === "string" ) ) { + cacheURL += ( rquery.test( cacheURL ) ? "&" : "?" ) + s.data; + + // #9682: remove data so that it's not used in an eventual retry + delete s.data; + } + + // Add or update anti-cache param if needed + if ( s.cache === false ) { + cacheURL = cacheURL.replace( rantiCache, "$1" ); + uncached = ( rquery.test( cacheURL ) ? "&" : "?" ) + "_=" + ( nonce.guid++ ) + + uncached; + } + + // Put hash and anti-cache on the URL that will be requested (gh-1732) + s.url = cacheURL + uncached; + + // Change '%20' to '+' if this is encoded form body content (gh-2658) + } else if ( s.data && s.processData && + ( s.contentType || "" ).indexOf( "application/x-www-form-urlencoded" ) === 0 ) { + s.data = s.data.replace( r20, "+" ); + } + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + if ( jQuery.lastModified[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-Modified-Since", jQuery.lastModified[ cacheURL ] ); + } + if ( jQuery.etag[ cacheURL ] ) { + jqXHR.setRequestHeader( "If-None-Match", jQuery.etag[ cacheURL ] ); + } + } + + // Set the correct header, if data is being sent + if ( s.data && s.hasContent && s.contentType !== false || options.contentType ) { + jqXHR.setRequestHeader( "Content-Type", s.contentType ); + } + + // Set the Accepts header for the server, depending on the dataType + jqXHR.setRequestHeader( + "Accept", + s.dataTypes[ 0 ] && s.accepts[ s.dataTypes[ 0 ] ] ? + s.accepts[ s.dataTypes[ 0 ] ] + + ( s.dataTypes[ 0 ] !== "*" ? ", " + allTypes + "; q=0.01" : "" ) : + s.accepts[ "*" ] + ); + + // Check for headers option + for ( i in s.headers ) { + jqXHR.setRequestHeader( i, s.headers[ i ] ); + } + + // Allow custom headers/mimetypes and early abort + if ( s.beforeSend && + ( s.beforeSend.call( callbackContext, jqXHR, s ) === false || completed ) ) { + + // Abort if not done already and return + return jqXHR.abort(); + } + + // Aborting is no longer a cancellation + strAbort = "abort"; + + // Install callbacks on deferreds + completeDeferred.add( s.complete ); + jqXHR.done( s.success ); + jqXHR.fail( s.error ); + + // Get transport + transport = inspectPrefiltersOrTransports( transports, s, options, jqXHR ); + + // If no transport, we auto-abort + if ( !transport ) { + done( -1, "No Transport" ); + } else { + jqXHR.readyState = 1; + + // Send global event + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxSend", [ jqXHR, s ] ); + } + + // If request was aborted inside ajaxSend, stop there + if ( completed ) { + return jqXHR; + } + + // Timeout + if ( s.async && s.timeout > 0 ) { + timeoutTimer = window.setTimeout( function() { + jqXHR.abort( "timeout" ); + }, s.timeout ); + } + + try { + completed = false; + transport.send( requestHeaders, done ); + } catch ( e ) { + + // Rethrow post-completion exceptions + if ( completed ) { + throw e; + } + + // Propagate others as results + done( -1, e ); + } + } + + // Callback for when everything is done + function done( status, nativeStatusText, responses, headers ) { + var isSuccess, success, error, response, modified, + statusText = nativeStatusText; + + // Ignore repeat invocations + if ( completed ) { + return; + } + + completed = true; + + // Clear timeout if it exists + if ( timeoutTimer ) { + window.clearTimeout( timeoutTimer ); + } + + // Dereference transport for early garbage collection + // (no matter how long the jqXHR object will be used) + transport = undefined; + + // Cache response headers + responseHeadersString = headers || ""; + + // Set readyState + jqXHR.readyState = status > 0 ? 4 : 0; + + // Determine if successful + isSuccess = status >= 200 && status < 300 || status === 304; + + // Get response data + if ( responses ) { + response = ajaxHandleResponses( s, jqXHR, responses ); + } + + // Use a noop converter for missing script + if ( !isSuccess && jQuery.inArray( "script", s.dataTypes ) > -1 ) { + s.converters[ "text script" ] = function() {}; + } + + // Convert no matter what (that way responseXXX fields are always set) + response = ajaxConvert( s, response, jqXHR, isSuccess ); + + // If successful, handle type chaining + if ( isSuccess ) { + + // Set the If-Modified-Since and/or If-None-Match header, if in ifModified mode. + if ( s.ifModified ) { + modified = jqXHR.getResponseHeader( "Last-Modified" ); + if ( modified ) { + jQuery.lastModified[ cacheURL ] = modified; + } + modified = jqXHR.getResponseHeader( "etag" ); + if ( modified ) { + jQuery.etag[ cacheURL ] = modified; + } + } + + // if no content + if ( status === 204 || s.type === "HEAD" ) { + statusText = "nocontent"; + + // if not modified + } else if ( status === 304 ) { + statusText = "notmodified"; + + // If we have data, let's convert it + } else { + statusText = response.state; + success = response.data; + error = response.error; + isSuccess = !error; + } + } else { + + // Extract error from statusText and normalize for non-aborts + error = statusText; + if ( status || !statusText ) { + statusText = "error"; + if ( status < 0 ) { + status = 0; + } + } + } + + // Set data for the fake xhr object + jqXHR.status = status; + jqXHR.statusText = ( nativeStatusText || statusText ) + ""; + + // Success/Error + if ( isSuccess ) { + deferred.resolveWith( callbackContext, [ success, statusText, jqXHR ] ); + } else { + deferred.rejectWith( callbackContext, [ jqXHR, statusText, error ] ); + } + + // Status-dependent callbacks + jqXHR.statusCode( statusCode ); + statusCode = undefined; + + if ( fireGlobals ) { + globalEventContext.trigger( isSuccess ? "ajaxSuccess" : "ajaxError", + [ jqXHR, s, isSuccess ? success : error ] ); + } + + // Complete + completeDeferred.fireWith( callbackContext, [ jqXHR, statusText ] ); + + if ( fireGlobals ) { + globalEventContext.trigger( "ajaxComplete", [ jqXHR, s ] ); + + // Handle the global AJAX counter + if ( !( --jQuery.active ) ) { + jQuery.event.trigger( "ajaxStop" ); + } + } + } + + return jqXHR; + }, + + getJSON: function( url, data, callback ) { + return jQuery.get( url, data, callback, "json" ); + }, + + getScript: function( url, callback ) { + return jQuery.get( url, undefined, callback, "script" ); + } +} ); + +jQuery.each( [ "get", "post" ], function( _i, method ) { + jQuery[ method ] = function( url, data, callback, type ) { + + // Shift arguments if data argument was omitted + if ( isFunction( data ) ) { + type = type || callback; + callback = data; + data = undefined; + } + + // The url can be an options object (which then must have .url) + return jQuery.ajax( jQuery.extend( { + url: url, + type: method, + dataType: type, + data: data, + success: callback + }, jQuery.isPlainObject( url ) && url ) ); + }; +} ); + +jQuery.ajaxPrefilter( function( s ) { + var i; + for ( i in s.headers ) { + if ( i.toLowerCase() === "content-type" ) { + s.contentType = s.headers[ i ] || ""; + } + } +} ); + + +jQuery._evalUrl = function( url, options, doc ) { + return jQuery.ajax( { + url: url, + + // Make this explicit, since user can override this through ajaxSetup (#11264) + type: "GET", + dataType: "script", + cache: true, + async: false, + global: false, + + // Only evaluate the response if it is successful (gh-4126) + // dataFilter is not invoked for failure responses, so using it instead + // of the default converter is kludgy but it works. + converters: { + "text script": function() {} + }, + dataFilter: function( response ) { + jQuery.globalEval( response, options, doc ); + } + } ); +}; + + +jQuery.fn.extend( { + wrapAll: function( html ) { + var wrap; + + if ( this[ 0 ] ) { + if ( isFunction( html ) ) { + html = html.call( this[ 0 ] ); + } + + // The elements to wrap the target around + wrap = jQuery( html, this[ 0 ].ownerDocument ).eq( 0 ).clone( true ); + + if ( this[ 0 ].parentNode ) { + wrap.insertBefore( this[ 0 ] ); + } + + wrap.map( function() { + var elem = this; + + while ( elem.firstElementChild ) { + elem = elem.firstElementChild; + } + + return elem; + } ).append( this ); + } + + return this; + }, + + wrapInner: function( html ) { + if ( isFunction( html ) ) { + return this.each( function( i ) { + jQuery( this ).wrapInner( html.call( this, i ) ); + } ); + } + + return this.each( function() { + var self = jQuery( this ), + contents = self.contents(); + + if ( contents.length ) { + contents.wrapAll( html ); + + } else { + self.append( html ); + } + } ); + }, + + wrap: function( html ) { + var htmlIsFunction = isFunction( html ); + + return this.each( function( i ) { + jQuery( this ).wrapAll( htmlIsFunction ? html.call( this, i ) : html ); + } ); + }, + + unwrap: function( selector ) { + this.parent( selector ).not( "body" ).each( function() { + jQuery( this ).replaceWith( this.childNodes ); + } ); + return this; + } +} ); + + +jQuery.expr.pseudos.hidden = function( elem ) { + return !jQuery.expr.pseudos.visible( elem ); +}; +jQuery.expr.pseudos.visible = function( elem ) { + return !!( elem.offsetWidth || elem.offsetHeight || elem.getClientRects().length ); +}; + + + + +jQuery.ajaxSettings.xhr = function() { + try { + return new window.XMLHttpRequest(); + } catch ( e ) {} +}; + +var xhrSuccessStatus = { + + // File protocol always yields status code 0, assume 200 + 0: 200, + + // Support: IE <=9 only + // #1450: sometimes IE returns 1223 when it should be 204 + 1223: 204 + }, + xhrSupported = jQuery.ajaxSettings.xhr(); + +support.cors = !!xhrSupported && ( "withCredentials" in xhrSupported ); +support.ajax = xhrSupported = !!xhrSupported; + +jQuery.ajaxTransport( function( options ) { + var callback, errorCallback; + + // Cross domain only allowed if supported through XMLHttpRequest + if ( support.cors || xhrSupported && !options.crossDomain ) { + return { + send: function( headers, complete ) { + var i, + xhr = options.xhr(); + + xhr.open( + options.type, + options.url, + options.async, + options.username, + options.password + ); + + // Apply custom fields if provided + if ( options.xhrFields ) { + for ( i in options.xhrFields ) { + xhr[ i ] = options.xhrFields[ i ]; + } + } + + // Override mime type if needed + if ( options.mimeType && xhr.overrideMimeType ) { + xhr.overrideMimeType( options.mimeType ); + } + + // X-Requested-With header + // For cross-domain requests, seeing as conditions for a preflight are + // akin to a jigsaw puzzle, we simply never set it to be sure. + // (it can always be set on a per-request basis or even using ajaxSetup) + // For same-domain requests, won't change header if already provided. + if ( !options.crossDomain && !headers[ "X-Requested-With" ] ) { + headers[ "X-Requested-With" ] = "XMLHttpRequest"; + } + + // Set headers + for ( i in headers ) { + xhr.setRequestHeader( i, headers[ i ] ); + } + + // Callback + callback = function( type ) { + return function() { + if ( callback ) { + callback = errorCallback = xhr.onload = + xhr.onerror = xhr.onabort = xhr.ontimeout = + xhr.onreadystatechange = null; + + if ( type === "abort" ) { + xhr.abort(); + } else if ( type === "error" ) { + + // Support: IE <=9 only + // On a manual native abort, IE9 throws + // errors on any property access that is not readyState + if ( typeof xhr.status !== "number" ) { + complete( 0, "error" ); + } else { + complete( + + // File: protocol always yields status 0; see #8605, #14207 + xhr.status, + xhr.statusText + ); + } + } else { + complete( + xhrSuccessStatus[ xhr.status ] || xhr.status, + xhr.statusText, + + // Support: IE <=9 only + // IE9 has no XHR2 but throws on binary (trac-11426) + // For XHR2 non-text, let the caller handle it (gh-2498) + ( xhr.responseType || "text" ) !== "text" || + typeof xhr.responseText !== "string" ? + { binary: xhr.response } : + { text: xhr.responseText }, + xhr.getAllResponseHeaders() + ); + } + } + }; + }; + + // Listen to events + xhr.onload = callback(); + errorCallback = xhr.onerror = xhr.ontimeout = callback( "error" ); + + // Support: IE 9 only + // Use onreadystatechange to replace onabort + // to handle uncaught aborts + if ( xhr.onabort !== undefined ) { + xhr.onabort = errorCallback; + } else { + xhr.onreadystatechange = function() { + + // Check readyState before timeout as it changes + if ( xhr.readyState === 4 ) { + + // Allow onerror to be called first, + // but that will not handle a native abort + // Also, save errorCallback to a variable + // as xhr.onerror cannot be accessed + window.setTimeout( function() { + if ( callback ) { + errorCallback(); + } + } ); + } + }; + } + + // Create the abort callback + callback = callback( "abort" ); + + try { + + // Do send the request (this may raise an exception) + xhr.send( options.hasContent && options.data || null ); + } catch ( e ) { + + // #14683: Only rethrow if this hasn't been notified as an error yet + if ( callback ) { + throw e; + } + } + }, + + abort: function() { + if ( callback ) { + callback(); + } + } + }; + } +} ); + + + + +// Prevent auto-execution of scripts when no explicit dataType was provided (See gh-2432) +jQuery.ajaxPrefilter( function( s ) { + if ( s.crossDomain ) { + s.contents.script = false; + } +} ); + +// Install script dataType +jQuery.ajaxSetup( { + accepts: { + script: "text/javascript, application/javascript, " + + "application/ecmascript, application/x-ecmascript" + }, + contents: { + script: /\b(?:java|ecma)script\b/ + }, + converters: { + "text script": function( text ) { + jQuery.globalEval( text ); + return text; + } + } +} ); + +// Handle cache's special case and crossDomain +jQuery.ajaxPrefilter( "script", function( s ) { + if ( s.cache === undefined ) { + s.cache = false; + } + if ( s.crossDomain ) { + s.type = "GET"; + } +} ); + +// Bind script tag hack transport +jQuery.ajaxTransport( "script", function( s ) { + + // This transport only deals with cross domain or forced-by-attrs requests + if ( s.crossDomain || s.scriptAttrs ) { + var script, callback; + return { + send: function( _, complete ) { + script = jQuery( " - - - - + + + + + @@ -45,7 +43,6 @@ | F | G | H - | I | K | L | M @@ -55,95 +52,33 @@ | Q | R | S - | T | U | V | W - | X

A

@@ -152,18 +87,6 @@ -
@@ -171,107 +94,25 @@

C