1 /* ----------------------------------------------------------------------------
2  * This file was automatically generated by SWIG (http://www.swig.org).
3  * Version 4.0.2
4  *
5  * This file is not intended to be easily readable and contains a number of
6  * coding conventions designed to improve portability and efficiency. Do not make
7  * changes to this file unless you know what you are doing--modify the SWIG
8  * interface file instead.
9  * ----------------------------------------------------------------------------- */
10 
11 
12 #ifndef SWIGPYTHON
13 #define SWIGPYTHON
14 #endif
15 
16 #define SWIG_PYTHON_THREADS
17 #define SWIG_PYTHON_DIRECTOR_NO_VTABLE
18 #define SWIGPYTHON_BUILTIN
19 
20 /* -----------------------------------------------------------------------------
21  *  This section contains generic SWIG labels for method/variable
22  *  declarations/attributes, and other compiler dependent labels.
23  * ----------------------------------------------------------------------------- */
24 
25 /* template workaround for compilers that cannot correctly implement the C++ standard */
26 #ifndef SWIGTEMPLATEDISAMBIGUATOR
27 # if defined(__SUNPRO_CC) && (__SUNPRO_CC <= 0x560)
28 #  define SWIGTEMPLATEDISAMBIGUATOR template
29 # elif defined(__HP_aCC)
30 /* Needed even with `aCC -AA' when `aCC -V' reports HP ANSI C++ B3910B A.03.55 */
31 /* If we find a maximum version that requires this, the test would be __HP_aCC <= 35500 for A.03.55 */
32 #  define SWIGTEMPLATEDISAMBIGUATOR template
33 # else
34 #  define SWIGTEMPLATEDISAMBIGUATOR
35 # endif
36 #endif
37 
38 /* inline attribute */
39 #ifndef SWIGINLINE
40 # if defined(__cplusplus) || (defined(__GNUC__) && !defined(__STRICT_ANSI__))
41 #   define SWIGINLINE inline
42 # else
43 #   define SWIGINLINE
44 # endif
45 #endif
46 
47 /* attribute recognised by some compilers to avoid 'unused' warnings */
48 #ifndef SWIGUNUSED
49 # if defined(__GNUC__)
50 #   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
51 #     define SWIGUNUSED __attribute__ ((__unused__))
52 #   else
53 #     define SWIGUNUSED
54 #   endif
55 # elif defined(__ICC)
56 #   define SWIGUNUSED __attribute__ ((__unused__))
57 # else
58 #   define SWIGUNUSED
59 # endif
60 #endif
61 
62 #ifndef SWIG_MSC_UNSUPPRESS_4505
63 # if defined(_MSC_VER)
64 #   pragma warning(disable : 4505) /* unreferenced local function has been removed */
65 # endif
66 #endif
67 
68 #ifndef SWIGUNUSEDPARM
69 # ifdef __cplusplus
70 #   define SWIGUNUSEDPARM(p)
71 # else
72 #   define SWIGUNUSEDPARM(p) p SWIGUNUSED
73 # endif
74 #endif
75 
76 /* internal SWIG method */
77 #ifndef SWIGINTERN
78 # define SWIGINTERN static SWIGUNUSED
79 #endif
80 
81 /* internal inline SWIG method */
82 #ifndef SWIGINTERNINLINE
83 # define SWIGINTERNINLINE SWIGINTERN SWIGINLINE
84 #endif
85 
86 /* exporting methods */
87 #if defined(__GNUC__)
88 #  if (__GNUC__ >= 4) || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)
89 #    ifndef GCC_HASCLASSVISIBILITY
90 #      define GCC_HASCLASSVISIBILITY
91 #    endif
92 #  endif
93 #endif
94 
95 #ifndef SWIGEXPORT
96 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
97 #   if defined(STATIC_LINKED)
98 #     define SWIGEXPORT
99 #   else
100 #     define SWIGEXPORT __declspec(dllexport)
101 #   endif
102 # else
103 #   if defined(__GNUC__) && defined(GCC_HASCLASSVISIBILITY)
104 #     define SWIGEXPORT __attribute__ ((visibility("default")))
105 #   else
106 #     define SWIGEXPORT
107 #   endif
108 # endif
109 #endif
110 
111 /* calling conventions for Windows */
112 #ifndef SWIGSTDCALL
113 # if defined(_WIN32) || defined(__WIN32__) || defined(__CYGWIN__)
114 #   define SWIGSTDCALL __stdcall
115 # else
116 #   define SWIGSTDCALL
117 # endif
118 #endif
119 
120 /* Deal with Microsoft's attempt at deprecating C standard runtime functions */
121 #if !defined(SWIG_NO_CRT_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
122 # define _CRT_SECURE_NO_DEPRECATE
123 #endif
124 
125 /* Deal with Microsoft's attempt at deprecating methods in the standard C++ library */
126 #if !defined(SWIG_NO_SCL_SECURE_NO_DEPRECATE) && defined(_MSC_VER) && !defined(_SCL_SECURE_NO_DEPRECATE)
127 # define _SCL_SECURE_NO_DEPRECATE
128 #endif
129 
130 /* Deal with Apple's deprecated 'AssertMacros.h' from Carbon-framework */
131 #if defined(__APPLE__) && !defined(__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES)
132 # define __ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORES 0
133 #endif
134 
135 /* Intel's compiler complains if a variable which was never initialised is
136  * cast to void, which is a common idiom which we use to indicate that we
137  * are aware a variable isn't used.  So we just silence that warning.
138  * See: https://github.com/swig/swig/issues/192 for more discussion.
139  */
140 #ifdef __INTEL_COMPILER
141 # pragma warning disable 592
142 #endif
143 
144 
145 #if defined(__GNUC__) && defined(_WIN32) && !defined(SWIG_PYTHON_NO_HYPOT_WORKAROUND)
146 /* Workaround for '::hypot' has not been declared', see https://bugs.python.org/issue11566 */
147 # include <math.h>
148 #endif
149 
150 #if defined(_DEBUG) && defined(SWIG_PYTHON_INTERPRETER_NO_DEBUG)
151 /* Use debug wrappers with the Python release dll */
152 # undef _DEBUG
153 # include <Python.h>
154 # define _DEBUG 1
155 #else
156 # include <Python.h>
157 #endif
158 
159 /* -----------------------------------------------------------------------------
160  * swigrun.swg
161  *
162  * This file contains generic C API SWIG runtime support for pointer
163  * type checking.
164  * ----------------------------------------------------------------------------- */
165 
166 /* This should only be incremented when either the layout of swig_type_info changes,
167    or for whatever reason, the runtime changes incompatibly */
168 #define SWIG_RUNTIME_VERSION "4"
169 
170 /* define SWIG_TYPE_TABLE_NAME as "SWIG_TYPE_TABLE" */
171 #ifdef SWIG_TYPE_TABLE
172 # define SWIG_QUOTE_STRING(x) #x
173 # define SWIG_EXPAND_AND_QUOTE_STRING(x) SWIG_QUOTE_STRING(x)
174 # define SWIG_TYPE_TABLE_NAME SWIG_EXPAND_AND_QUOTE_STRING(SWIG_TYPE_TABLE)
175 #else
176 # define SWIG_TYPE_TABLE_NAME
177 #endif
178 
179 /*
180   You can use the SWIGRUNTIME and SWIGRUNTIMEINLINE macros for
181   creating a static or dynamic library from the SWIG runtime code.
182   In 99.9% of the cases, SWIG just needs to declare them as 'static'.
183 
184   But only do this if strictly necessary, ie, if you have problems
185   with your compiler or suchlike.
186 */
187 
188 #ifndef SWIGRUNTIME
189 # define SWIGRUNTIME SWIGINTERN
190 #endif
191 
192 #ifndef SWIGRUNTIMEINLINE
193 # define SWIGRUNTIMEINLINE SWIGRUNTIME SWIGINLINE
194 #endif
195 
196 /*  Generic buffer size */
197 #ifndef SWIG_BUFFER_SIZE
198 # define SWIG_BUFFER_SIZE 1024
199 #endif
200 
201 /* Flags for pointer conversions */
202 #define SWIG_POINTER_DISOWN        0x1
203 #define SWIG_CAST_NEW_MEMORY       0x2
204 #define SWIG_POINTER_NO_NULL       0x4
205 
206 /* Flags for new pointer objects */
207 #define SWIG_POINTER_OWN           0x1
208 
209 
210 /*
211    Flags/methods for returning states.
212 
213    The SWIG conversion methods, as ConvertPtr, return an integer
214    that tells if the conversion was successful or not. And if not,
215    an error code can be returned (see swigerrors.swg for the codes).
216 
217    Use the following macros/flags to set or process the returning
218    states.
219 
220    In old versions of SWIG, code such as the following was usually written:
221 
222      if (SWIG_ConvertPtr(obj,vptr,ty.flags) != -1) {
223        // success code
224      } else {
225        //fail code
226      }
227 
228    Now you can be more explicit:
229 
230     int res = SWIG_ConvertPtr(obj,vptr,ty.flags);
231     if (SWIG_IsOK(res)) {
232       // success code
233     } else {
234       // fail code
235     }
236 
237    which is the same really, but now you can also do
238 
239     Type *ptr;
240     int res = SWIG_ConvertPtr(obj,(void **)(&ptr),ty.flags);
241     if (SWIG_IsOK(res)) {
242       // success code
243       if (SWIG_IsNewObj(res) {
244         ...
245 	delete *ptr;
246       } else {
247         ...
248       }
249     } else {
250       // fail code
251     }
252 
253    I.e., now SWIG_ConvertPtr can return new objects and you can
254    identify the case and take care of the deallocation. Of course that
255    also requires SWIG_ConvertPtr to return new result values, such as
256 
257       int SWIG_ConvertPtr(obj, ptr,...) {
258         if (<obj is ok>) {
259           if (<need new object>) {
260             *ptr = <ptr to new allocated object>;
261             return SWIG_NEWOBJ;
262           } else {
263             *ptr = <ptr to old object>;
264             return SWIG_OLDOBJ;
265           }
266         } else {
267           return SWIG_BADOBJ;
268         }
269       }
270 
271    Of course, returning the plain '0(success)/-1(fail)' still works, but you can be
272    more explicit by returning SWIG_BADOBJ, SWIG_ERROR or any of the
273    SWIG errors code.
274 
275    Finally, if the SWIG_CASTRANK_MODE is enabled, the result code
276    allows to return the 'cast rank', for example, if you have this
277 
278        int food(double)
279        int fooi(int);
280 
281    and you call
282 
283       food(1)   // cast rank '1'  (1 -> 1.0)
284       fooi(1)   // cast rank '0'
285 
286    just use the SWIG_AddCast()/SWIG_CheckState()
287 */
288 
289 #define SWIG_OK                    (0)
290 #define SWIG_ERROR                 (-1)
291 #define SWIG_IsOK(r)               (r >= 0)
292 #define SWIG_ArgError(r)           ((r != SWIG_ERROR) ? r : SWIG_TypeError)
293 
294 /* The CastRankLimit says how many bits are used for the cast rank */
295 #define SWIG_CASTRANKLIMIT         (1 << 8)
296 /* The NewMask denotes the object was created (using new/malloc) */
297 #define SWIG_NEWOBJMASK            (SWIG_CASTRANKLIMIT  << 1)
298 /* The TmpMask is for in/out typemaps that use temporal objects */
299 #define SWIG_TMPOBJMASK            (SWIG_NEWOBJMASK << 1)
300 /* Simple returning values */
301 #define SWIG_BADOBJ                (SWIG_ERROR)
302 #define SWIG_OLDOBJ                (SWIG_OK)
303 #define SWIG_NEWOBJ                (SWIG_OK | SWIG_NEWOBJMASK)
304 #define SWIG_TMPOBJ                (SWIG_OK | SWIG_TMPOBJMASK)
305 /* Check, add and del mask methods */
306 #define SWIG_AddNewMask(r)         (SWIG_IsOK(r) ? (r | SWIG_NEWOBJMASK) : r)
307 #define SWIG_DelNewMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_NEWOBJMASK) : r)
308 #define SWIG_IsNewObj(r)           (SWIG_IsOK(r) && (r & SWIG_NEWOBJMASK))
309 #define SWIG_AddTmpMask(r)         (SWIG_IsOK(r) ? (r | SWIG_TMPOBJMASK) : r)
310 #define SWIG_DelTmpMask(r)         (SWIG_IsOK(r) ? (r & ~SWIG_TMPOBJMASK) : r)
311 #define SWIG_IsTmpObj(r)           (SWIG_IsOK(r) && (r & SWIG_TMPOBJMASK))
312 
313 /* Cast-Rank Mode */
314 #if defined(SWIG_CASTRANK_MODE)
315 #  ifndef SWIG_TypeRank
316 #    define SWIG_TypeRank             unsigned long
317 #  endif
318 #  ifndef SWIG_MAXCASTRANK            /* Default cast allowed */
319 #    define SWIG_MAXCASTRANK          (2)
320 #  endif
321 #  define SWIG_CASTRANKMASK          ((SWIG_CASTRANKLIMIT) -1)
322 #  define SWIG_CastRank(r)           (r & SWIG_CASTRANKMASK)
SWIG_AddCast(int r)323 SWIGINTERNINLINE int SWIG_AddCast(int r) {
324   return SWIG_IsOK(r) ? ((SWIG_CastRank(r) < SWIG_MAXCASTRANK) ? (r + 1) : SWIG_ERROR) : r;
325 }
SWIG_CheckState(int r)326 SWIGINTERNINLINE int SWIG_CheckState(int r) {
327   return SWIG_IsOK(r) ? SWIG_CastRank(r) + 1 : 0;
328 }
329 #else /* no cast-rank mode */
330 #  define SWIG_AddCast(r) (r)
331 #  define SWIG_CheckState(r) (SWIG_IsOK(r) ? 1 : 0)
332 #endif
333 
334 
335 #include <string.h>
336 
337 #ifdef __cplusplus
338 extern "C" {
339 #endif
340 
341 typedef void *(*swig_converter_func)(void *, int *);
342 typedef struct swig_type_info *(*swig_dycast_func)(void **);
343 
344 /* Structure to store information on one type */
345 typedef struct swig_type_info {
346   const char             *name;			/* mangled name of this type */
347   const char             *str;			/* human readable name of this type */
348   swig_dycast_func        dcast;		/* dynamic cast function down a hierarchy */
349   struct swig_cast_info  *cast;			/* linked list of types that can cast into this type */
350   void                   *clientdata;		/* language specific type data */
351   int                    owndata;		/* flag if the structure owns the clientdata */
352 } swig_type_info;
353 
354 /* Structure to store a type and conversion function used for casting */
355 typedef struct swig_cast_info {
356   swig_type_info         *type;			/* pointer to type that is equivalent to this type */
357   swig_converter_func     converter;		/* function to cast the void pointers */
358   struct swig_cast_info  *next;			/* pointer to next cast in linked list */
359   struct swig_cast_info  *prev;			/* pointer to the previous cast */
360 } swig_cast_info;
361 
362 /* Structure used to store module information
363  * Each module generates one structure like this, and the runtime collects
364  * all of these structures and stores them in a circularly linked list.*/
365 typedef struct swig_module_info {
366   swig_type_info         **types;		/* Array of pointers to swig_type_info structures that are in this module */
367   size_t                 size;		        /* Number of types in this module */
368   struct swig_module_info *next;		/* Pointer to next element in circularly linked list */
369   swig_type_info         **type_initial;	/* Array of initially generated type structures */
370   swig_cast_info         **cast_initial;	/* Array of initially generated casting structures */
371   void                    *clientdata;		/* Language specific module data */
372 } swig_module_info;
373 
374 /*
375   Compare two type names skipping the space characters, therefore
376   "char*" == "char *" and "Class<int>" == "Class<int >", etc.
377 
378   Return 0 when the two name types are equivalent, as in
379   strncmp, but skipping ' '.
380 */
381 SWIGRUNTIME int
SWIG_TypeNameComp(const char * f1,const char * l1,const char * f2,const char * l2)382 SWIG_TypeNameComp(const char *f1, const char *l1,
383 		  const char *f2, const char *l2) {
384   for (;(f1 != l1) && (f2 != l2); ++f1, ++f2) {
385     while ((*f1 == ' ') && (f1 != l1)) ++f1;
386     while ((*f2 == ' ') && (f2 != l2)) ++f2;
387     if (*f1 != *f2) return (*f1 > *f2) ? 1 : -1;
388   }
389   return (int)((l1 - f1) - (l2 - f2));
390 }
391 
392 /*
393   Check type equivalence in a name list like <name1>|<name2>|...
394   Return 0 if equal, -1 if nb < tb, 1 if nb > tb
395 */
396 SWIGRUNTIME int
SWIG_TypeCmp(const char * nb,const char * tb)397 SWIG_TypeCmp(const char *nb, const char *tb) {
398   int equiv = 1;
399   const char* te = tb + strlen(tb);
400   const char* ne = nb;
401   while (equiv != 0 && *ne) {
402     for (nb = ne; *ne; ++ne) {
403       if (*ne == '|') break;
404     }
405     equiv = SWIG_TypeNameComp(nb, ne, tb, te);
406     if (*ne) ++ne;
407   }
408   return equiv;
409 }
410 
411 /*
412   Check type equivalence in a name list like <name1>|<name2>|...
413   Return 0 if not equal, 1 if equal
414 */
415 SWIGRUNTIME int
SWIG_TypeEquiv(const char * nb,const char * tb)416 SWIG_TypeEquiv(const char *nb, const char *tb) {
417   return SWIG_TypeCmp(nb, tb) == 0 ? 1 : 0;
418 }
419 
420 /*
421   Check the typename
422 */
423 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheck(const char * c,swig_type_info * ty)424 SWIG_TypeCheck(const char *c, swig_type_info *ty) {
425   if (ty) {
426     swig_cast_info *iter = ty->cast;
427     while (iter) {
428       if (strcmp(iter->type->name, c) == 0) {
429         if (iter == ty->cast)
430           return iter;
431         /* Move iter to the top of the linked list */
432         iter->prev->next = iter->next;
433         if (iter->next)
434           iter->next->prev = iter->prev;
435         iter->next = ty->cast;
436         iter->prev = 0;
437         if (ty->cast) ty->cast->prev = iter;
438         ty->cast = iter;
439         return iter;
440       }
441       iter = iter->next;
442     }
443   }
444   return 0;
445 }
446 
447 /*
448   Identical to SWIG_TypeCheck, except strcmp is replaced with a pointer comparison
449 */
450 SWIGRUNTIME swig_cast_info *
SWIG_TypeCheckStruct(swig_type_info * from,swig_type_info * ty)451 SWIG_TypeCheckStruct(swig_type_info *from, swig_type_info *ty) {
452   if (ty) {
453     swig_cast_info *iter = ty->cast;
454     while (iter) {
455       if (iter->type == from) {
456         if (iter == ty->cast)
457           return iter;
458         /* Move iter to the top of the linked list */
459         iter->prev->next = iter->next;
460         if (iter->next)
461           iter->next->prev = iter->prev;
462         iter->next = ty->cast;
463         iter->prev = 0;
464         if (ty->cast) ty->cast->prev = iter;
465         ty->cast = iter;
466         return iter;
467       }
468       iter = iter->next;
469     }
470   }
471   return 0;
472 }
473 
474 /*
475   Cast a pointer up an inheritance hierarchy
476 */
477 SWIGRUNTIMEINLINE void *
SWIG_TypeCast(swig_cast_info * ty,void * ptr,int * newmemory)478 SWIG_TypeCast(swig_cast_info *ty, void *ptr, int *newmemory) {
479   return ((!ty) || (!ty->converter)) ? ptr : (*ty->converter)(ptr, newmemory);
480 }
481 
482 /*
483    Dynamic pointer casting. Down an inheritance hierarchy
484 */
485 SWIGRUNTIME swig_type_info *
SWIG_TypeDynamicCast(swig_type_info * ty,void ** ptr)486 SWIG_TypeDynamicCast(swig_type_info *ty, void **ptr) {
487   swig_type_info *lastty = ty;
488   if (!ty || !ty->dcast) return ty;
489   while (ty && (ty->dcast)) {
490     ty = (*ty->dcast)(ptr);
491     if (ty) lastty = ty;
492   }
493   return lastty;
494 }
495 
496 /*
497   Return the name associated with this type
498 */
499 SWIGRUNTIMEINLINE const char *
SWIG_TypeName(const swig_type_info * ty)500 SWIG_TypeName(const swig_type_info *ty) {
501   return ty->name;
502 }
503 
504 /*
505   Return the pretty name associated with this type,
506   that is an unmangled type name in a form presentable to the user.
507 */
508 SWIGRUNTIME const char *
SWIG_TypePrettyName(const swig_type_info * type)509 SWIG_TypePrettyName(const swig_type_info *type) {
510   /* The "str" field contains the equivalent pretty names of the
511      type, separated by vertical-bar characters.  We choose
512      to print the last name, as it is often (?) the most
513      specific. */
514   if (!type) return NULL;
515   if (type->str != NULL) {
516     const char *last_name = type->str;
517     const char *s;
518     for (s = type->str; *s; s++)
519       if (*s == '|') last_name = s+1;
520     return last_name;
521   }
522   else
523     return type->name;
524 }
525 
526 /*
527    Set the clientdata field for a type
528 */
529 SWIGRUNTIME void
SWIG_TypeClientData(swig_type_info * ti,void * clientdata)530 SWIG_TypeClientData(swig_type_info *ti, void *clientdata) {
531   swig_cast_info *cast = ti->cast;
532   /* if (ti->clientdata == clientdata) return; */
533   ti->clientdata = clientdata;
534 
535   while (cast) {
536     if (!cast->converter) {
537       swig_type_info *tc = cast->type;
538       if (!tc->clientdata) {
539 	SWIG_TypeClientData(tc, clientdata);
540       }
541     }
542     cast = cast->next;
543   }
544 }
545 SWIGRUNTIME void
SWIG_TypeNewClientData(swig_type_info * ti,void * clientdata)546 SWIG_TypeNewClientData(swig_type_info *ti, void *clientdata) {
547   SWIG_TypeClientData(ti, clientdata);
548   ti->owndata = 1;
549 }
550 
551 /*
552   Search for a swig_type_info structure only by mangled name
553   Search is a O(log #types)
554 
555   We start searching at module start, and finish searching when start == end.
556   Note: if start == end at the beginning of the function, we go all the way around
557   the circular list.
558 */
559 SWIGRUNTIME swig_type_info *
SWIG_MangledTypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)560 SWIG_MangledTypeQueryModule(swig_module_info *start,
561                             swig_module_info *end,
562 		            const char *name) {
563   swig_module_info *iter = start;
564   do {
565     if (iter->size) {
566       size_t l = 0;
567       size_t r = iter->size - 1;
568       do {
569 	/* since l+r >= 0, we can (>> 1) instead (/ 2) */
570 	size_t i = (l + r) >> 1;
571 	const char *iname = iter->types[i]->name;
572 	if (iname) {
573 	  int compare = strcmp(name, iname);
574 	  if (compare == 0) {
575 	    return iter->types[i];
576 	  } else if (compare < 0) {
577 	    if (i) {
578 	      r = i - 1;
579 	    } else {
580 	      break;
581 	    }
582 	  } else if (compare > 0) {
583 	    l = i + 1;
584 	  }
585 	} else {
586 	  break; /* should never happen */
587 	}
588       } while (l <= r);
589     }
590     iter = iter->next;
591   } while (iter != end);
592   return 0;
593 }
594 
595 /*
596   Search for a swig_type_info structure for either a mangled name or a human readable name.
597   It first searches the mangled names of the types, which is a O(log #types)
598   If a type is not found it then searches the human readable names, which is O(#types).
599 
600   We start searching at module start, and finish searching when start == end.
601   Note: if start == end at the beginning of the function, we go all the way around
602   the circular list.
603 */
604 SWIGRUNTIME swig_type_info *
SWIG_TypeQueryModule(swig_module_info * start,swig_module_info * end,const char * name)605 SWIG_TypeQueryModule(swig_module_info *start,
606                      swig_module_info *end,
607 		     const char *name) {
608   /* STEP 1: Search the name field using binary search */
609   swig_type_info *ret = SWIG_MangledTypeQueryModule(start, end, name);
610   if (ret) {
611     return ret;
612   } else {
613     /* STEP 2: If the type hasn't been found, do a complete search
614        of the str field (the human readable name) */
615     swig_module_info *iter = start;
616     do {
617       size_t i = 0;
618       for (; i < iter->size; ++i) {
619 	if (iter->types[i]->str && (SWIG_TypeEquiv(iter->types[i]->str, name)))
620 	  return iter->types[i];
621       }
622       iter = iter->next;
623     } while (iter != end);
624   }
625 
626   /* neither found a match */
627   return 0;
628 }
629 
630 /*
631    Pack binary data into a string
632 */
633 SWIGRUNTIME char *
SWIG_PackData(char * c,void * ptr,size_t sz)634 SWIG_PackData(char *c, void *ptr, size_t sz) {
635   static const char hex[17] = "0123456789abcdef";
636   const unsigned char *u = (unsigned char *) ptr;
637   const unsigned char *eu =  u + sz;
638   for (; u != eu; ++u) {
639     unsigned char uu = *u;
640     *(c++) = hex[(uu & 0xf0) >> 4];
641     *(c++) = hex[uu & 0xf];
642   }
643   return c;
644 }
645 
646 /*
647    Unpack binary data from a string
648 */
649 SWIGRUNTIME const char *
SWIG_UnpackData(const char * c,void * ptr,size_t sz)650 SWIG_UnpackData(const char *c, void *ptr, size_t sz) {
651   unsigned char *u = (unsigned char *) ptr;
652   const unsigned char *eu = u + sz;
653   for (; u != eu; ++u) {
654     char d = *(c++);
655     unsigned char uu;
656     if ((d >= '0') && (d <= '9'))
657       uu = (unsigned char)((d - '0') << 4);
658     else if ((d >= 'a') && (d <= 'f'))
659       uu = (unsigned char)((d - ('a'-10)) << 4);
660     else
661       return (char *) 0;
662     d = *(c++);
663     if ((d >= '0') && (d <= '9'))
664       uu |= (unsigned char)(d - '0');
665     else if ((d >= 'a') && (d <= 'f'))
666       uu |= (unsigned char)(d - ('a'-10));
667     else
668       return (char *) 0;
669     *u = uu;
670   }
671   return c;
672 }
673 
674 /*
675    Pack 'void *' into a string buffer.
676 */
677 SWIGRUNTIME char *
SWIG_PackVoidPtr(char * buff,void * ptr,const char * name,size_t bsz)678 SWIG_PackVoidPtr(char *buff, void *ptr, const char *name, size_t bsz) {
679   char *r = buff;
680   if ((2*sizeof(void *) + 2) > bsz) return 0;
681   *(r++) = '_';
682   r = SWIG_PackData(r,&ptr,sizeof(void *));
683   if (strlen(name) + 1 > (bsz - (r - buff))) return 0;
684   strcpy(r,name);
685   return buff;
686 }
687 
688 SWIGRUNTIME const char *
SWIG_UnpackVoidPtr(const char * c,void ** ptr,const char * name)689 SWIG_UnpackVoidPtr(const char *c, void **ptr, const char *name) {
690   if (*c != '_') {
691     if (strcmp(c,"NULL") == 0) {
692       *ptr = (void *) 0;
693       return name;
694     } else {
695       return 0;
696     }
697   }
698   return SWIG_UnpackData(++c,ptr,sizeof(void *));
699 }
700 
701 SWIGRUNTIME char *
SWIG_PackDataName(char * buff,void * ptr,size_t sz,const char * name,size_t bsz)702 SWIG_PackDataName(char *buff, void *ptr, size_t sz, const char *name, size_t bsz) {
703   char *r = buff;
704   size_t lname = (name ? strlen(name) : 0);
705   if ((2*sz + 2 + lname) > bsz) return 0;
706   *(r++) = '_';
707   r = SWIG_PackData(r,ptr,sz);
708   if (lname) {
709     strncpy(r,name,lname+1);
710   } else {
711     *r = 0;
712   }
713   return buff;
714 }
715 
716 SWIGRUNTIME const char *
SWIG_UnpackDataName(const char * c,void * ptr,size_t sz,const char * name)717 SWIG_UnpackDataName(const char *c, void *ptr, size_t sz, const char *name) {
718   if (*c != '_') {
719     if (strcmp(c,"NULL") == 0) {
720       memset(ptr,0,sz);
721       return name;
722     } else {
723       return 0;
724     }
725   }
726   return SWIG_UnpackData(++c,ptr,sz);
727 }
728 
729 #ifdef __cplusplus
730 }
731 #endif
732 
733 /*  Errors in SWIG */
734 #define  SWIG_UnknownError    	   -1
735 #define  SWIG_IOError        	   -2
736 #define  SWIG_RuntimeError   	   -3
737 #define  SWIG_IndexError     	   -4
738 #define  SWIG_TypeError      	   -5
739 #define  SWIG_DivisionByZero 	   -6
740 #define  SWIG_OverflowError  	   -7
741 #define  SWIG_SyntaxError    	   -8
742 #define  SWIG_ValueError     	   -9
743 #define  SWIG_SystemError    	   -10
744 #define  SWIG_AttributeError 	   -11
745 #define  SWIG_MemoryError    	   -12
746 #define  SWIG_NullReferenceError   -13
747 
748 
749 
750 /* Compatibility macros for Python 3 */
751 #if PY_VERSION_HEX >= 0x03000000
752 
753 #define PyClass_Check(obj) PyObject_IsInstance(obj, (PyObject *)&PyType_Type)
754 #define PyInt_Check(x) PyLong_Check(x)
755 #define PyInt_AsLong(x) PyLong_AsLong(x)
756 #define PyInt_FromLong(x) PyLong_FromLong(x)
757 #define PyInt_FromSize_t(x) PyLong_FromSize_t(x)
758 #define PyString_Check(name) PyBytes_Check(name)
759 #define PyString_FromString(x) PyUnicode_FromString(x)
760 #define PyString_Format(fmt, args)  PyUnicode_Format(fmt, args)
761 #define PyString_AsString(str) PyBytes_AsString(str)
762 #define PyString_Size(str) PyBytes_Size(str)
763 #define PyString_InternFromString(key) PyUnicode_InternFromString(key)
764 #define Py_TPFLAGS_HAVE_CLASS Py_TPFLAGS_BASETYPE
765 #define PyString_AS_STRING(x) PyUnicode_AS_STRING(x)
766 #define _PyLong_FromSsize_t(x) PyLong_FromSsize_t(x)
767 
768 #endif
769 
770 #ifndef Py_TYPE
771 #  define Py_TYPE(op) ((op)->ob_type)
772 #endif
773 
774 /* SWIG APIs for compatibility of both Python 2 & 3 */
775 
776 #if PY_VERSION_HEX >= 0x03000000
777 #  define SWIG_Python_str_FromFormat PyUnicode_FromFormat
778 #else
779 #  define SWIG_Python_str_FromFormat PyString_FromFormat
780 #endif
781 
782 
783 /* Warning: This function will allocate a new string in Python 3,
784  * so please call SWIG_Python_str_DelForPy3(x) to free the space.
785  */
786 SWIGINTERN char*
SWIG_Python_str_AsChar(PyObject * str)787 SWIG_Python_str_AsChar(PyObject *str)
788 {
789 #if PY_VERSION_HEX >= 0x03030000
790   return (char *)PyUnicode_AsUTF8(str);
791 #elif PY_VERSION_HEX >= 0x03000000
792   char *newstr = 0;
793   str = PyUnicode_AsUTF8String(str);
794   if (str) {
795     char *cstr;
796     Py_ssize_t len;
797     if (PyBytes_AsStringAndSize(str, &cstr, &len) != -1) {
798       newstr = (char *) malloc(len+1);
799       if (newstr)
800         memcpy(newstr, cstr, len+1);
801     }
802     Py_XDECREF(str);
803   }
804   return newstr;
805 #else
806   return PyString_AsString(str);
807 #endif
808 }
809 
810 #if PY_VERSION_HEX >= 0x03030000 || PY_VERSION_HEX < 0x03000000
811 #  define SWIG_Python_str_DelForPy3(x)
812 #else
813 #  define SWIG_Python_str_DelForPy3(x) free( (void*) (x) )
814 #endif
815 
816 
817 SWIGINTERN PyObject*
SWIG_Python_str_FromChar(const char * c)818 SWIG_Python_str_FromChar(const char *c)
819 {
820 #if PY_VERSION_HEX >= 0x03000000
821   return PyUnicode_FromString(c);
822 #else
823   return PyString_FromString(c);
824 #endif
825 }
826 
827 #ifndef PyObject_DEL
828 # define PyObject_DEL PyObject_Del
829 #endif
830 
831 // SWIGPY_USE_CAPSULE is no longer used within SWIG itself, but some user
832 // interface files check for it.
833 # define SWIGPY_USE_CAPSULE
834 # define SWIGPY_CAPSULE_NAME ("swig_runtime_data" SWIG_RUNTIME_VERSION ".type_pointer_capsule" SWIG_TYPE_TABLE_NAME)
835 
836 #if PY_VERSION_HEX < 0x03020000
837 #define PyDescr_TYPE(x) (((PyDescrObject *)(x))->d_type)
838 #define PyDescr_NAME(x) (((PyDescrObject *)(x))->d_name)
839 #define Py_hash_t long
840 #endif
841 
842 /* -----------------------------------------------------------------------------
843  * error manipulation
844  * ----------------------------------------------------------------------------- */
845 
846 SWIGRUNTIME PyObject*
SWIG_Python_ErrorType(int code)847 SWIG_Python_ErrorType(int code) {
848   PyObject* type = 0;
849   switch(code) {
850   case SWIG_MemoryError:
851     type = PyExc_MemoryError;
852     break;
853   case SWIG_IOError:
854     type = PyExc_IOError;
855     break;
856   case SWIG_RuntimeError:
857     type = PyExc_RuntimeError;
858     break;
859   case SWIG_IndexError:
860     type = PyExc_IndexError;
861     break;
862   case SWIG_TypeError:
863     type = PyExc_TypeError;
864     break;
865   case SWIG_DivisionByZero:
866     type = PyExc_ZeroDivisionError;
867     break;
868   case SWIG_OverflowError:
869     type = PyExc_OverflowError;
870     break;
871   case SWIG_SyntaxError:
872     type = PyExc_SyntaxError;
873     break;
874   case SWIG_ValueError:
875     type = PyExc_ValueError;
876     break;
877   case SWIG_SystemError:
878     type = PyExc_SystemError;
879     break;
880   case SWIG_AttributeError:
881     type = PyExc_AttributeError;
882     break;
883   default:
884     type = PyExc_RuntimeError;
885   }
886   return type;
887 }
888 
889 
890 SWIGRUNTIME void
SWIG_Python_AddErrorMsg(const char * mesg)891 SWIG_Python_AddErrorMsg(const char* mesg)
892 {
893   PyObject *type = 0;
894   PyObject *value = 0;
895   PyObject *traceback = 0;
896 
897   if (PyErr_Occurred())
898     PyErr_Fetch(&type, &value, &traceback);
899   if (value) {
900     PyObject *old_str = PyObject_Str(value);
901     const char *tmp = SWIG_Python_str_AsChar(old_str);
902     PyErr_Clear();
903     Py_XINCREF(type);
904     if (tmp)
905       PyErr_Format(type, "%s %s", tmp, mesg);
906     else
907       PyErr_Format(type, "%s", mesg);
908     SWIG_Python_str_DelForPy3(tmp);
909     Py_DECREF(old_str);
910     Py_DECREF(value);
911   } else {
912     PyErr_SetString(PyExc_RuntimeError, mesg);
913   }
914 }
915 
916 SWIGRUNTIME int
SWIG_Python_TypeErrorOccurred(PyObject * obj)917 SWIG_Python_TypeErrorOccurred(PyObject *obj)
918 {
919   PyObject *error;
920   if (obj)
921     return 0;
922   error = PyErr_Occurred();
923   return error && PyErr_GivenExceptionMatches(error, PyExc_TypeError);
924 }
925 
926 SWIGRUNTIME void
SWIG_Python_RaiseOrModifyTypeError(const char * message)927 SWIG_Python_RaiseOrModifyTypeError(const char *message)
928 {
929   if (SWIG_Python_TypeErrorOccurred(NULL)) {
930     /* Use existing TypeError to preserve stacktrace and enhance with given message */
931     PyObject *newvalue;
932     PyObject *type = NULL, *value = NULL, *traceback = NULL;
933     PyErr_Fetch(&type, &value, &traceback);
934 #if PY_VERSION_HEX >= 0x03000000
935     newvalue = PyUnicode_FromFormat("%S\nAdditional information:\n%s", value, message);
936 #else
937     newvalue = PyString_FromFormat("%s\nAdditional information:\n%s", PyString_AsString(value), message);
938 #endif
939     Py_XDECREF(value);
940     PyErr_Restore(type, newvalue, traceback);
941   } else {
942     /* Raise TypeError using given message */
943     PyErr_SetString(PyExc_TypeError, message);
944   }
945 }
946 
947 #if defined(SWIG_PYTHON_NO_THREADS)
948 #  if defined(SWIG_PYTHON_THREADS)
949 #    undef SWIG_PYTHON_THREADS
950 #  endif
951 #endif
952 #if defined(SWIG_PYTHON_THREADS) /* Threading support is enabled */
953 #  if !defined(SWIG_PYTHON_USE_GIL) && !defined(SWIG_PYTHON_NO_USE_GIL)
954 #    define SWIG_PYTHON_USE_GIL
955 #  endif
956 #  if defined(SWIG_PYTHON_USE_GIL) /* Use PyGILState threads calls */
957 #    ifndef SWIG_PYTHON_INITIALIZE_THREADS
958 #     define SWIG_PYTHON_INITIALIZE_THREADS  PyEval_InitThreads()
959 #    endif
960 #    ifdef __cplusplus /* C++ code */
961        class SWIG_Python_Thread_Block {
962          bool status;
963          PyGILState_STATE state;
964        public:
end()965          void end() { if (status) { PyGILState_Release(state); status = false;} }
SWIG_Python_Thread_Block()966          SWIG_Python_Thread_Block() : status(true), state(PyGILState_Ensure()) {}
~SWIG_Python_Thread_Block()967          ~SWIG_Python_Thread_Block() { end(); }
968        };
969        class SWIG_Python_Thread_Allow {
970          bool status;
971          PyThreadState *save;
972        public:
end()973          void end() { if (status) { PyEval_RestoreThread(save); status = false; }}
SWIG_Python_Thread_Allow()974          SWIG_Python_Thread_Allow() : status(true), save(PyEval_SaveThread()) {}
~SWIG_Python_Thread_Allow()975          ~SWIG_Python_Thread_Allow() { end(); }
976        };
977 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   SWIG_Python_Thread_Block _swig_thread_block
978 #      define SWIG_PYTHON_THREAD_END_BLOCK     _swig_thread_block.end()
979 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   SWIG_Python_Thread_Allow _swig_thread_allow
980 #      define SWIG_PYTHON_THREAD_END_ALLOW     _swig_thread_allow.end()
981 #    else /* C code */
982 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK   PyGILState_STATE _swig_thread_block = PyGILState_Ensure()
983 #      define SWIG_PYTHON_THREAD_END_BLOCK     PyGILState_Release(_swig_thread_block)
984 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW   PyThreadState *_swig_thread_allow = PyEval_SaveThread()
985 #      define SWIG_PYTHON_THREAD_END_ALLOW     PyEval_RestoreThread(_swig_thread_allow)
986 #    endif
987 #  else /* Old thread way, not implemented, user must provide it */
988 #    if !defined(SWIG_PYTHON_INITIALIZE_THREADS)
989 #      define SWIG_PYTHON_INITIALIZE_THREADS
990 #    endif
991 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_BLOCK)
992 #      define SWIG_PYTHON_THREAD_BEGIN_BLOCK
993 #    endif
994 #    if !defined(SWIG_PYTHON_THREAD_END_BLOCK)
995 #      define SWIG_PYTHON_THREAD_END_BLOCK
996 #    endif
997 #    if !defined(SWIG_PYTHON_THREAD_BEGIN_ALLOW)
998 #      define SWIG_PYTHON_THREAD_BEGIN_ALLOW
999 #    endif
1000 #    if !defined(SWIG_PYTHON_THREAD_END_ALLOW)
1001 #      define SWIG_PYTHON_THREAD_END_ALLOW
1002 #    endif
1003 #  endif
1004 #else /* No thread support */
1005 #  define SWIG_PYTHON_INITIALIZE_THREADS
1006 #  define SWIG_PYTHON_THREAD_BEGIN_BLOCK
1007 #  define SWIG_PYTHON_THREAD_END_BLOCK
1008 #  define SWIG_PYTHON_THREAD_BEGIN_ALLOW
1009 #  define SWIG_PYTHON_THREAD_END_ALLOW
1010 #endif
1011 
1012 /* -----------------------------------------------------------------------------
1013  * Python API portion that goes into the runtime
1014  * ----------------------------------------------------------------------------- */
1015 
1016 #ifdef __cplusplus
1017 extern "C" {
1018 #endif
1019 
1020 /* -----------------------------------------------------------------------------
1021  * Constant declarations
1022  * ----------------------------------------------------------------------------- */
1023 
1024 /* Constant Types */
1025 #define SWIG_PY_POINTER 4
1026 #define SWIG_PY_BINARY  5
1027 
1028 /* Constant information structure */
1029 typedef struct swig_const_info {
1030   int type;
1031   const char *name;
1032   long lvalue;
1033   double dvalue;
1034   void   *pvalue;
1035   swig_type_info **ptype;
1036 } swig_const_info;
1037 
1038 #ifdef __cplusplus
1039 }
1040 #endif
1041 
1042 
1043 /* -----------------------------------------------------------------------------
1044  * pyrun.swg
1045  *
1046  * This file contains the runtime support for Python modules
1047  * and includes code for managing global variables and pointer
1048  * type checking.
1049  *
1050  * ----------------------------------------------------------------------------- */
1051 
1052 #if PY_VERSION_HEX < 0x02070000 /* 2.7.0 */
1053 # error "This version of SWIG only supports Python >= 2.7"
1054 #endif
1055 
1056 #if PY_VERSION_HEX >= 0x03000000 && PY_VERSION_HEX < 0x03020000
1057 # error "This version of SWIG only supports Python 3 >= 3.2"
1058 #endif
1059 
1060 /* Common SWIG API */
1061 
1062 /* for raw pointers */
1063 #define SWIG_Python_ConvertPtr(obj, pptr, type, flags)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, 0)
1064 #define SWIG_ConvertPtr(obj, pptr, type, flags)         SWIG_Python_ConvertPtr(obj, pptr, type, flags)
1065 #define SWIG_ConvertPtrAndOwn(obj,pptr,type,flags,own)  SWIG_Python_ConvertPtrAndOwn(obj, pptr, type, flags, own)
1066 
1067 #ifdef SWIGPYTHON_BUILTIN
1068 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(self, ptr, type, flags)
1069 #else
1070 #define SWIG_NewPointerObj(ptr, type, flags)            SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1071 #endif
1072 
1073 #define SWIG_InternalNewPointerObj(ptr, type, flags)	SWIG_Python_NewPointerObj(NULL, ptr, type, flags)
1074 
1075 #define SWIG_CheckImplicit(ty)                          SWIG_Python_CheckImplicit(ty)
1076 #define SWIG_AcquirePtr(ptr, src)                       SWIG_Python_AcquirePtr(ptr, src)
1077 #define swig_owntype                                    int
1078 
1079 /* for raw packed data */
1080 #define SWIG_ConvertPacked(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1081 #define SWIG_NewPackedObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1082 
1083 /* for class or struct pointers */
1084 #define SWIG_ConvertInstance(obj, pptr, type, flags)    SWIG_ConvertPtr(obj, pptr, type, flags)
1085 #define SWIG_NewInstanceObj(ptr, type, flags)           SWIG_NewPointerObj(ptr, type, flags)
1086 
1087 /* for C or C++ function pointers */
1088 #define SWIG_ConvertFunctionPtr(obj, pptr, type)        SWIG_Python_ConvertFunctionPtr(obj, pptr, type)
1089 #define SWIG_NewFunctionPtrObj(ptr, type)               SWIG_Python_NewPointerObj(NULL, ptr, type, 0)
1090 
1091 /* for C++ member pointers, ie, member methods */
1092 #define SWIG_ConvertMember(obj, ptr, sz, ty)            SWIG_Python_ConvertPacked(obj, ptr, sz, ty)
1093 #define SWIG_NewMemberObj(ptr, sz, type)                SWIG_Python_NewPackedObj(ptr, sz, type)
1094 
1095 
1096 /* Runtime API */
1097 
1098 #define SWIG_GetModule(clientdata)                      SWIG_Python_GetModule(clientdata)
1099 #define SWIG_SetModule(clientdata, pointer)             SWIG_Python_SetModule(pointer)
1100 #define SWIG_NewClientData(obj)                         SwigPyClientData_New(obj)
1101 
1102 #define SWIG_SetErrorObj                                SWIG_Python_SetErrorObj
1103 #define SWIG_SetErrorMsg                        	SWIG_Python_SetErrorMsg
1104 #define SWIG_ErrorType(code)                    	SWIG_Python_ErrorType(code)
1105 #define SWIG_Error(code, msg)            		SWIG_Python_SetErrorMsg(SWIG_ErrorType(code), msg)
1106 #define SWIG_fail                        		goto fail
1107 
1108 
1109 /* Runtime API implementation */
1110 
1111 /* Error manipulation */
1112 
1113 SWIGINTERN void
SWIG_Python_SetErrorObj(PyObject * errtype,PyObject * obj)1114 SWIG_Python_SetErrorObj(PyObject *errtype, PyObject *obj) {
1115   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1116   PyErr_SetObject(errtype, obj);
1117   Py_DECREF(obj);
1118   SWIG_PYTHON_THREAD_END_BLOCK;
1119 }
1120 
1121 SWIGINTERN void
SWIG_Python_SetErrorMsg(PyObject * errtype,const char * msg)1122 SWIG_Python_SetErrorMsg(PyObject *errtype, const char *msg) {
1123   SWIG_PYTHON_THREAD_BEGIN_BLOCK;
1124   PyErr_SetString(errtype, msg);
1125   SWIG_PYTHON_THREAD_END_BLOCK;
1126 }
1127 
1128 #define SWIG_Python_Raise(obj, type, desc)  SWIG_Python_SetErrorObj(SWIG_Python_ExceptionType(desc), obj)
1129 
1130 /* Set a constant value */
1131 
1132 #if defined(SWIGPYTHON_BUILTIN)
1133 
1134 SWIGINTERN void
SwigPyBuiltin_AddPublicSymbol(PyObject * seq,const char * key)1135 SwigPyBuiltin_AddPublicSymbol(PyObject *seq, const char *key) {
1136   PyObject *s = PyString_InternFromString(key);
1137   PyList_Append(seq, s);
1138   Py_DECREF(s);
1139 }
1140 
1141 SWIGINTERN void
SWIG_Python_SetConstant(PyObject * d,PyObject * public_interface,const char * name,PyObject * obj)1142 SWIG_Python_SetConstant(PyObject *d, PyObject *public_interface, const char *name, PyObject *obj) {
1143   PyDict_SetItemString(d, name, obj);
1144   Py_DECREF(obj);
1145   if (public_interface)
1146     SwigPyBuiltin_AddPublicSymbol(public_interface, name);
1147 }
1148 
1149 #else
1150 
1151 SWIGINTERN void
SWIG_Python_SetConstant(PyObject * d,const char * name,PyObject * obj)1152 SWIG_Python_SetConstant(PyObject *d, const char *name, PyObject *obj) {
1153   PyDict_SetItemString(d, name, obj);
1154   Py_DECREF(obj);
1155 }
1156 
1157 #endif
1158 
1159 /* Append a value to the result obj */
1160 
1161 SWIGINTERN PyObject*
SWIG_Python_AppendOutput(PyObject * result,PyObject * obj)1162 SWIG_Python_AppendOutput(PyObject* result, PyObject* obj) {
1163   if (!result) {
1164     result = obj;
1165   } else if (result == Py_None) {
1166     Py_DECREF(result);
1167     result = obj;
1168   } else {
1169     if (!PyList_Check(result)) {
1170       PyObject *o2 = result;
1171       result = PyList_New(1);
1172       PyList_SetItem(result, 0, o2);
1173     }
1174     PyList_Append(result,obj);
1175     Py_DECREF(obj);
1176   }
1177   return result;
1178 }
1179 
1180 /* Unpack the argument tuple */
1181 
1182 SWIGINTERN Py_ssize_t
SWIG_Python_UnpackTuple(PyObject * args,const char * name,Py_ssize_t min,Py_ssize_t max,PyObject ** objs)1183 SWIG_Python_UnpackTuple(PyObject *args, const char *name, Py_ssize_t min, Py_ssize_t max, PyObject **objs)
1184 {
1185   if (!args) {
1186     if (!min && !max) {
1187       return 1;
1188     } else {
1189       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got none",
1190 		   name, (min == max ? "" : "at least "), (int)min);
1191       return 0;
1192     }
1193   }
1194   if (!PyTuple_Check(args)) {
1195     if (min <= 1 && max >= 1) {
1196       Py_ssize_t i;
1197       objs[0] = args;
1198       for (i = 1; i < max; ++i) {
1199 	objs[i] = 0;
1200       }
1201       return 2;
1202     }
1203     PyErr_SetString(PyExc_SystemError, "UnpackTuple() argument list is not a tuple");
1204     return 0;
1205   } else {
1206     Py_ssize_t l = PyTuple_GET_SIZE(args);
1207     if (l < min) {
1208       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1209 		   name, (min == max ? "" : "at least "), (int)min, (int)l);
1210       return 0;
1211     } else if (l > max) {
1212       PyErr_Format(PyExc_TypeError, "%s expected %s%d arguments, got %d",
1213 		   name, (min == max ? "" : "at most "), (int)max, (int)l);
1214       return 0;
1215     } else {
1216       Py_ssize_t i;
1217       for (i = 0; i < l; ++i) {
1218 	objs[i] = PyTuple_GET_ITEM(args, i);
1219       }
1220       for (; l < max; ++l) {
1221 	objs[l] = 0;
1222       }
1223       return i + 1;
1224     }
1225   }
1226 }
1227 
1228 SWIGINTERN int
SWIG_Python_CheckNoKeywords(PyObject * kwargs,const char * name)1229 SWIG_Python_CheckNoKeywords(PyObject *kwargs, const char *name) {
1230   int no_kwargs = 1;
1231   if (kwargs) {
1232     assert(PyDict_Check(kwargs));
1233     if (PyDict_Size(kwargs) > 0) {
1234       PyErr_Format(PyExc_TypeError, "%s() does not take keyword arguments", name);
1235       no_kwargs = 0;
1236     }
1237   }
1238   return no_kwargs;
1239 }
1240 
1241 /* A functor is a function object with one single object argument */
1242 #define SWIG_Python_CallFunctor(functor, obj)	        PyObject_CallFunctionObjArgs(functor, obj, NULL);
1243 
1244 /*
1245   Helper for static pointer initialization for both C and C++ code, for example
1246   static PyObject *SWIG_STATIC_POINTER(MyVar) = NewSomething(...);
1247 */
1248 #ifdef __cplusplus
1249 #define SWIG_STATIC_POINTER(var)  var
1250 #else
1251 #define SWIG_STATIC_POINTER(var)  var = 0; if (!var) var
1252 #endif
1253 
1254 /* -----------------------------------------------------------------------------
1255  * Pointer declarations
1256  * ----------------------------------------------------------------------------- */
1257 
1258 /* Flags for new pointer objects */
1259 #define SWIG_POINTER_NOSHADOW       (SWIG_POINTER_OWN      << 1)
1260 #define SWIG_POINTER_NEW            (SWIG_POINTER_NOSHADOW | SWIG_POINTER_OWN)
1261 
1262 #define SWIG_POINTER_IMPLICIT_CONV  (SWIG_POINTER_DISOWN   << 1)
1263 
1264 #define SWIG_BUILTIN_TP_INIT	    (SWIG_POINTER_OWN << 2)
1265 #define SWIG_BUILTIN_INIT	    (SWIG_BUILTIN_TP_INIT | SWIG_POINTER_OWN)
1266 
1267 #ifdef __cplusplus
1268 extern "C" {
1269 #endif
1270 
1271 /* The python void return value */
1272 
1273 SWIGRUNTIMEINLINE PyObject *
SWIG_Py_Void(void)1274 SWIG_Py_Void(void)
1275 {
1276   PyObject *none = Py_None;
1277   Py_INCREF(none);
1278   return none;
1279 }
1280 
1281 /* SwigPyClientData */
1282 
1283 typedef struct {
1284   PyObject *klass;
1285   PyObject *newraw;
1286   PyObject *newargs;
1287   PyObject *destroy;
1288   int delargs;
1289   int implicitconv;
1290   PyTypeObject *pytype;
1291 } SwigPyClientData;
1292 
1293 SWIGRUNTIMEINLINE int
SWIG_Python_CheckImplicit(swig_type_info * ty)1294 SWIG_Python_CheckImplicit(swig_type_info *ty)
1295 {
1296   SwigPyClientData *data = (SwigPyClientData *)ty->clientdata;
1297   int fail = data ? data->implicitconv : 0;
1298   if (fail)
1299     PyErr_SetString(PyExc_TypeError, "Implicit conversion is prohibited for explicit constructors.");
1300   return fail;
1301 }
1302 
1303 SWIGRUNTIMEINLINE PyObject *
SWIG_Python_ExceptionType(swig_type_info * desc)1304 SWIG_Python_ExceptionType(swig_type_info *desc) {
1305   SwigPyClientData *data = desc ? (SwigPyClientData *) desc->clientdata : 0;
1306   PyObject *klass = data ? data->klass : 0;
1307   return (klass ? klass : PyExc_RuntimeError);
1308 }
1309 
1310 
1311 SWIGRUNTIME SwigPyClientData *
SwigPyClientData_New(PyObject * obj)1312 SwigPyClientData_New(PyObject* obj)
1313 {
1314   if (!obj) {
1315     return 0;
1316   } else {
1317     SwigPyClientData *data = (SwigPyClientData *)malloc(sizeof(SwigPyClientData));
1318     /* the klass element */
1319     data->klass = obj;
1320     Py_INCREF(data->klass);
1321     /* the newraw method and newargs arguments used to create a new raw instance */
1322     if (PyClass_Check(obj)) {
1323       data->newraw = 0;
1324       data->newargs = obj;
1325       Py_INCREF(obj);
1326     } else {
1327       data->newraw = PyObject_GetAttrString(data->klass, "__new__");
1328       if (data->newraw) {
1329 	Py_INCREF(data->newraw);
1330 	data->newargs = PyTuple_New(1);
1331 	PyTuple_SetItem(data->newargs, 0, obj);
1332       } else {
1333 	data->newargs = obj;
1334       }
1335       Py_INCREF(data->newargs);
1336     }
1337     /* the destroy method, aka as the C++ delete method */
1338     data->destroy = PyObject_GetAttrString(data->klass, "__swig_destroy__");
1339     if (PyErr_Occurred()) {
1340       PyErr_Clear();
1341       data->destroy = 0;
1342     }
1343     if (data->destroy) {
1344       int flags;
1345       Py_INCREF(data->destroy);
1346       flags = PyCFunction_GET_FLAGS(data->destroy);
1347       data->delargs = !(flags & (METH_O));
1348     } else {
1349       data->delargs = 0;
1350     }
1351     data->implicitconv = 0;
1352     data->pytype = 0;
1353     return data;
1354   }
1355 }
1356 
1357 SWIGRUNTIME void
SwigPyClientData_Del(SwigPyClientData * data)1358 SwigPyClientData_Del(SwigPyClientData *data) {
1359   Py_XDECREF(data->newraw);
1360   Py_XDECREF(data->newargs);
1361   Py_XDECREF(data->destroy);
1362 }
1363 
1364 /* =============== SwigPyObject =====================*/
1365 
1366 typedef struct {
1367   PyObject_HEAD
1368   void *ptr;
1369   swig_type_info *ty;
1370   int own;
1371   PyObject *next;
1372 #ifdef SWIGPYTHON_BUILTIN
1373   PyObject *dict;
1374 #endif
1375 } SwigPyObject;
1376 
1377 
1378 #ifdef SWIGPYTHON_BUILTIN
1379 
1380 SWIGRUNTIME PyObject *
SwigPyObject_get___dict__(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1381 SwigPyObject_get___dict__(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1382 {
1383   SwigPyObject *sobj = (SwigPyObject *)v;
1384 
1385   if (!sobj->dict)
1386     sobj->dict = PyDict_New();
1387 
1388   Py_INCREF(sobj->dict);
1389   return sobj->dict;
1390 }
1391 
1392 #endif
1393 
1394 SWIGRUNTIME PyObject *
SwigPyObject_long(SwigPyObject * v)1395 SwigPyObject_long(SwigPyObject *v)
1396 {
1397   return PyLong_FromVoidPtr(v->ptr);
1398 }
1399 
1400 SWIGRUNTIME PyObject *
SwigPyObject_format(const char * fmt,SwigPyObject * v)1401 SwigPyObject_format(const char* fmt, SwigPyObject *v)
1402 {
1403   PyObject *res = NULL;
1404   PyObject *args = PyTuple_New(1);
1405   if (args) {
1406     if (PyTuple_SetItem(args, 0, SwigPyObject_long(v)) == 0) {
1407       PyObject *ofmt = SWIG_Python_str_FromChar(fmt);
1408       if (ofmt) {
1409 #if PY_VERSION_HEX >= 0x03000000
1410 	res = PyUnicode_Format(ofmt,args);
1411 #else
1412 	res = PyString_Format(ofmt,args);
1413 #endif
1414 	Py_DECREF(ofmt);
1415       }
1416       Py_DECREF(args);
1417     }
1418   }
1419   return res;
1420 }
1421 
1422 SWIGRUNTIME PyObject *
SwigPyObject_oct(SwigPyObject * v)1423 SwigPyObject_oct(SwigPyObject *v)
1424 {
1425   return SwigPyObject_format("%o",v);
1426 }
1427 
1428 SWIGRUNTIME PyObject *
SwigPyObject_hex(SwigPyObject * v)1429 SwigPyObject_hex(SwigPyObject *v)
1430 {
1431   return SwigPyObject_format("%x",v);
1432 }
1433 
1434 SWIGRUNTIME PyObject *
SwigPyObject_repr(SwigPyObject * v)1435 SwigPyObject_repr(SwigPyObject *v)
1436 {
1437   const char *name = SWIG_TypePrettyName(v->ty);
1438   PyObject *repr = SWIG_Python_str_FromFormat("<Swig Object of type '%s' at %p>", (name ? name : "unknown"), (void *)v);
1439   if (v->next) {
1440     PyObject *nrep = SwigPyObject_repr((SwigPyObject *)v->next);
1441 # if PY_VERSION_HEX >= 0x03000000
1442     PyObject *joined = PyUnicode_Concat(repr, nrep);
1443     Py_DecRef(repr);
1444     Py_DecRef(nrep);
1445     repr = joined;
1446 # else
1447     PyString_ConcatAndDel(&repr,nrep);
1448 # endif
1449   }
1450   return repr;
1451 }
1452 
1453 /* We need a version taking two PyObject* parameters so it's a valid
1454  * PyCFunction to use in swigobject_methods[]. */
1455 SWIGRUNTIME PyObject *
SwigPyObject_repr2(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1456 SwigPyObject_repr2(PyObject *v, PyObject *SWIGUNUSEDPARM(args))
1457 {
1458   return SwigPyObject_repr((SwigPyObject*)v);
1459 }
1460 
1461 SWIGRUNTIME int
SwigPyObject_compare(SwigPyObject * v,SwigPyObject * w)1462 SwigPyObject_compare(SwigPyObject *v, SwigPyObject *w)
1463 {
1464   void *i = v->ptr;
1465   void *j = w->ptr;
1466   return (i < j) ? -1 : ((i > j) ? 1 : 0);
1467 }
1468 
1469 /* Added for Python 3.x, would it also be useful for Python 2.x? */
1470 SWIGRUNTIME PyObject*
SwigPyObject_richcompare(SwigPyObject * v,SwigPyObject * w,int op)1471 SwigPyObject_richcompare(SwigPyObject *v, SwigPyObject *w, int op)
1472 {
1473   PyObject* res;
1474   if( op != Py_EQ && op != Py_NE ) {
1475     Py_INCREF(Py_NotImplemented);
1476     return Py_NotImplemented;
1477   }
1478   res = PyBool_FromLong( (SwigPyObject_compare(v, w)==0) == (op == Py_EQ) ? 1 : 0);
1479   return res;
1480 }
1481 
1482 
1483 SWIGRUNTIME PyTypeObject* SwigPyObject_TypeOnce(void);
1484 
1485 #ifdef SWIGPYTHON_BUILTIN
1486 static swig_type_info *SwigPyObject_stype = 0;
1487 SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void)1488 SwigPyObject_type(void) {
1489     SwigPyClientData *cd;
1490     assert(SwigPyObject_stype);
1491     cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
1492     assert(cd);
1493     assert(cd->pytype);
1494     return cd->pytype;
1495 }
1496 #else
1497 SWIGRUNTIME PyTypeObject*
SwigPyObject_type(void)1498 SwigPyObject_type(void) {
1499   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyObject_TypeOnce();
1500   return type;
1501 }
1502 #endif
1503 
1504 SWIGRUNTIMEINLINE int
SwigPyObject_Check(PyObject * op)1505 SwigPyObject_Check(PyObject *op) {
1506 #ifdef SWIGPYTHON_BUILTIN
1507   PyTypeObject *target_tp = SwigPyObject_type();
1508   if (PyType_IsSubtype(op->ob_type, target_tp))
1509     return 1;
1510   return (strcmp(op->ob_type->tp_name, "SwigPyObject") == 0);
1511 #else
1512   return (Py_TYPE(op) == SwigPyObject_type())
1513     || (strcmp(Py_TYPE(op)->tp_name,"SwigPyObject") == 0);
1514 #endif
1515 }
1516 
1517 SWIGRUNTIME PyObject *
1518 SwigPyObject_New(void *ptr, swig_type_info *ty, int own);
1519 
1520 SWIGRUNTIME void
SwigPyObject_dealloc(PyObject * v)1521 SwigPyObject_dealloc(PyObject *v)
1522 {
1523   SwigPyObject *sobj = (SwigPyObject *) v;
1524   PyObject *next = sobj->next;
1525   if (sobj->own == SWIG_POINTER_OWN) {
1526     swig_type_info *ty = sobj->ty;
1527     SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
1528     PyObject *destroy = data ? data->destroy : 0;
1529     if (destroy) {
1530       /* destroy is always a VARARGS method */
1531       PyObject *res;
1532 
1533       /* PyObject_CallFunction() has the potential to silently drop
1534          the active exception.  In cases of unnamed temporary
1535          variable or where we just finished iterating over a generator
1536          StopIteration will be active right now, and this needs to
1537          remain true upon return from SwigPyObject_dealloc.  So save
1538          and restore. */
1539 
1540       PyObject *type = NULL, *value = NULL, *traceback = NULL;
1541       PyErr_Fetch(&type, &value, &traceback);
1542 
1543       if (data->delargs) {
1544         /* we need to create a temporary object to carry the destroy operation */
1545         PyObject *tmp = SwigPyObject_New(sobj->ptr, ty, 0);
1546         res = SWIG_Python_CallFunctor(destroy, tmp);
1547         Py_DECREF(tmp);
1548       } else {
1549         PyCFunction meth = PyCFunction_GET_FUNCTION(destroy);
1550         PyObject *mself = PyCFunction_GET_SELF(destroy);
1551         res = ((*meth)(mself, v));
1552       }
1553       if (!res)
1554         PyErr_WriteUnraisable(destroy);
1555 
1556       PyErr_Restore(type, value, traceback);
1557 
1558       Py_XDECREF(res);
1559     }
1560 #if !defined(SWIG_PYTHON_SILENT_MEMLEAK)
1561     else {
1562       const char *name = SWIG_TypePrettyName(ty);
1563       printf("swig/python detected a memory leak of type '%s', no destructor found.\n", (name ? name : "unknown"));
1564     }
1565 #endif
1566   }
1567   Py_XDECREF(next);
1568   PyObject_DEL(v);
1569 }
1570 
1571 SWIGRUNTIME PyObject*
SwigPyObject_append(PyObject * v,PyObject * next)1572 SwigPyObject_append(PyObject* v, PyObject* next)
1573 {
1574   SwigPyObject *sobj = (SwigPyObject *) v;
1575   if (!SwigPyObject_Check(next)) {
1576     PyErr_SetString(PyExc_TypeError, "Attempt to append a non SwigPyObject");
1577     return NULL;
1578   }
1579   sobj->next = next;
1580   Py_INCREF(next);
1581   return SWIG_Py_Void();
1582 }
1583 
1584 SWIGRUNTIME PyObject*
SwigPyObject_next(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1585 SwigPyObject_next(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1586 {
1587   SwigPyObject *sobj = (SwigPyObject *) v;
1588   if (sobj->next) {
1589     Py_INCREF(sobj->next);
1590     return sobj->next;
1591   } else {
1592     return SWIG_Py_Void();
1593   }
1594 }
1595 
1596 SWIGINTERN PyObject*
SwigPyObject_disown(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1597 SwigPyObject_disown(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1598 {
1599   SwigPyObject *sobj = (SwigPyObject *)v;
1600   sobj->own = 0;
1601   return SWIG_Py_Void();
1602 }
1603 
1604 SWIGINTERN PyObject*
SwigPyObject_acquire(PyObject * v,PyObject * SWIGUNUSEDPARM (args))1605 SwigPyObject_acquire(PyObject* v, PyObject *SWIGUNUSEDPARM(args))
1606 {
1607   SwigPyObject *sobj = (SwigPyObject *)v;
1608   sobj->own = SWIG_POINTER_OWN;
1609   return SWIG_Py_Void();
1610 }
1611 
1612 SWIGINTERN PyObject*
SwigPyObject_own(PyObject * v,PyObject * args)1613 SwigPyObject_own(PyObject *v, PyObject *args)
1614 {
1615   PyObject *val = 0;
1616   if (!PyArg_UnpackTuple(args, "own", 0, 1, &val)) {
1617     return NULL;
1618   } else {
1619     SwigPyObject *sobj = (SwigPyObject *)v;
1620     PyObject *obj = PyBool_FromLong(sobj->own);
1621     if (val) {
1622       if (PyObject_IsTrue(val)) {
1623         SwigPyObject_acquire(v,args);
1624       } else {
1625         SwigPyObject_disown(v,args);
1626       }
1627     }
1628     return obj;
1629   }
1630 }
1631 
1632 static PyMethodDef
1633 swigobject_methods[] = {
1634   {"disown",  SwigPyObject_disown,  METH_NOARGS,  "releases ownership of the pointer"},
1635   {"acquire", SwigPyObject_acquire, METH_NOARGS,  "acquires ownership of the pointer"},
1636   {"own",     SwigPyObject_own,     METH_VARARGS, "returns/sets ownership of the pointer"},
1637   {"append",  SwigPyObject_append,  METH_O,       "appends another 'this' object"},
1638   {"next",    SwigPyObject_next,    METH_NOARGS,  "returns the next 'this' object"},
1639   {"__repr__",SwigPyObject_repr2,   METH_NOARGS,  "returns object representation"},
1640   {0, 0, 0, 0}
1641 };
1642 
1643 SWIGRUNTIME PyTypeObject*
SwigPyObject_TypeOnce(void)1644 SwigPyObject_TypeOnce(void) {
1645   static char swigobject_doc[] = "Swig object carries a C/C++ instance pointer";
1646 
1647   static PyNumberMethods SwigPyObject_as_number = {
1648     (binaryfunc)0, /*nb_add*/
1649     (binaryfunc)0, /*nb_subtract*/
1650     (binaryfunc)0, /*nb_multiply*/
1651     /* nb_divide removed in Python 3 */
1652 #if PY_VERSION_HEX < 0x03000000
1653     (binaryfunc)0, /*nb_divide*/
1654 #endif
1655     (binaryfunc)0, /*nb_remainder*/
1656     (binaryfunc)0, /*nb_divmod*/
1657     (ternaryfunc)0,/*nb_power*/
1658     (unaryfunc)0,  /*nb_negative*/
1659     (unaryfunc)0,  /*nb_positive*/
1660     (unaryfunc)0,  /*nb_absolute*/
1661     (inquiry)0,    /*nb_nonzero*/
1662     0,		   /*nb_invert*/
1663     0,		   /*nb_lshift*/
1664     0,		   /*nb_rshift*/
1665     0,		   /*nb_and*/
1666     0,		   /*nb_xor*/
1667     0,		   /*nb_or*/
1668 #if PY_VERSION_HEX < 0x03000000
1669     0,   /*nb_coerce*/
1670 #endif
1671     (unaryfunc)SwigPyObject_long, /*nb_int*/
1672 #if PY_VERSION_HEX < 0x03000000
1673     (unaryfunc)SwigPyObject_long, /*nb_long*/
1674 #else
1675     0, /*nb_reserved*/
1676 #endif
1677     (unaryfunc)0,                 /*nb_float*/
1678 #if PY_VERSION_HEX < 0x03000000
1679     (unaryfunc)SwigPyObject_oct,  /*nb_oct*/
1680     (unaryfunc)SwigPyObject_hex,  /*nb_hex*/
1681 #endif
1682 #if PY_VERSION_HEX >= 0x03050000 /* 3.5 */
1683     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_inplace_matrix_multiply */
1684 #elif PY_VERSION_HEX >= 0x03000000 /* 3.0 */
1685     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index, nb_inplace_divide removed */
1686 #else
1687     0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 /* nb_inplace_add -> nb_index */
1688 #endif
1689   };
1690 
1691   static PyTypeObject swigpyobject_type;
1692   static int type_init = 0;
1693   if (!type_init) {
1694     const PyTypeObject tmp = {
1695 #if PY_VERSION_HEX >= 0x03000000
1696       PyVarObject_HEAD_INIT(NULL, 0)
1697 #else
1698       PyObject_HEAD_INIT(NULL)
1699       0,                                    /* ob_size */
1700 #endif
1701       "SwigPyObject",                       /* tp_name */
1702       sizeof(SwigPyObject),                 /* tp_basicsize */
1703       0,                                    /* tp_itemsize */
1704       (destructor)SwigPyObject_dealloc,     /* tp_dealloc */
1705       0,                                    /* tp_print */
1706       (getattrfunc)0,                       /* tp_getattr */
1707       (setattrfunc)0,                       /* tp_setattr */
1708 #if PY_VERSION_HEX >= 0x03000000
1709       0, /* tp_reserved in 3.0.1, tp_compare in 3.0.0 but not used */
1710 #else
1711       (cmpfunc)SwigPyObject_compare,        /* tp_compare */
1712 #endif
1713       (reprfunc)SwigPyObject_repr,          /* tp_repr */
1714       &SwigPyObject_as_number,              /* tp_as_number */
1715       0,                                    /* tp_as_sequence */
1716       0,                                    /* tp_as_mapping */
1717       (hashfunc)0,                          /* tp_hash */
1718       (ternaryfunc)0,                       /* tp_call */
1719       0,                                    /* tp_str */
1720       PyObject_GenericGetAttr,              /* tp_getattro */
1721       0,                                    /* tp_setattro */
1722       0,                                    /* tp_as_buffer */
1723       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
1724       swigobject_doc,                       /* tp_doc */
1725       0,                                    /* tp_traverse */
1726       0,                                    /* tp_clear */
1727       (richcmpfunc)SwigPyObject_richcompare,/* tp_richcompare */
1728       0,                                    /* tp_weaklistoffset */
1729       0,                                    /* tp_iter */
1730       0,                                    /* tp_iternext */
1731       swigobject_methods,                   /* tp_methods */
1732       0,                                    /* tp_members */
1733       0,                                    /* tp_getset */
1734       0,                                    /* tp_base */
1735       0,                                    /* tp_dict */
1736       0,                                    /* tp_descr_get */
1737       0,                                    /* tp_descr_set */
1738       0,                                    /* tp_dictoffset */
1739       0,                                    /* tp_init */
1740       0,                                    /* tp_alloc */
1741       0,                                    /* tp_new */
1742       0,                                    /* tp_free */
1743       0,                                    /* tp_is_gc */
1744       0,                                    /* tp_bases */
1745       0,                                    /* tp_mro */
1746       0,                                    /* tp_cache */
1747       0,                                    /* tp_subclasses */
1748       0,                                    /* tp_weaklist */
1749       0,                                    /* tp_del */
1750       0,                                    /* tp_version_tag */
1751 #if PY_VERSION_HEX >= 0x03040000
1752       0,                                    /* tp_finalize */
1753 #endif
1754 #if PY_VERSION_HEX >= 0x03080000
1755       0,                                    /* tp_vectorcall */
1756 #endif
1757 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1758       0,                                    /* tp_print */
1759 #endif
1760 #ifdef COUNT_ALLOCS
1761       0,                                    /* tp_allocs */
1762       0,                                    /* tp_frees */
1763       0,                                    /* tp_maxalloc */
1764       0,                                    /* tp_prev */
1765       0                                     /* tp_next */
1766 #endif
1767     };
1768     swigpyobject_type = tmp;
1769     type_init = 1;
1770     if (PyType_Ready(&swigpyobject_type) < 0)
1771       return NULL;
1772   }
1773   return &swigpyobject_type;
1774 }
1775 
1776 SWIGRUNTIME PyObject *
SwigPyObject_New(void * ptr,swig_type_info * ty,int own)1777 SwigPyObject_New(void *ptr, swig_type_info *ty, int own)
1778 {
1779   SwigPyObject *sobj = PyObject_NEW(SwigPyObject, SwigPyObject_type());
1780   if (sobj) {
1781     sobj->ptr  = ptr;
1782     sobj->ty   = ty;
1783     sobj->own  = own;
1784     sobj->next = 0;
1785   }
1786   return (PyObject *)sobj;
1787 }
1788 
1789 /* -----------------------------------------------------------------------------
1790  * Implements a simple Swig Packed type, and use it instead of string
1791  * ----------------------------------------------------------------------------- */
1792 
1793 typedef struct {
1794   PyObject_HEAD
1795   void *pack;
1796   swig_type_info *ty;
1797   size_t size;
1798 } SwigPyPacked;
1799 
1800 SWIGRUNTIME PyObject *
SwigPyPacked_repr(SwigPyPacked * v)1801 SwigPyPacked_repr(SwigPyPacked *v)
1802 {
1803   char result[SWIG_BUFFER_SIZE];
1804   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))) {
1805     return SWIG_Python_str_FromFormat("<Swig Packed at %s%s>", result, v->ty->name);
1806   } else {
1807     return SWIG_Python_str_FromFormat("<Swig Packed %s>", v->ty->name);
1808   }
1809 }
1810 
1811 SWIGRUNTIME PyObject *
SwigPyPacked_str(SwigPyPacked * v)1812 SwigPyPacked_str(SwigPyPacked *v)
1813 {
1814   char result[SWIG_BUFFER_SIZE];
1815   if (SWIG_PackDataName(result, v->pack, v->size, 0, sizeof(result))){
1816     return SWIG_Python_str_FromFormat("%s%s", result, v->ty->name);
1817   } else {
1818     return SWIG_Python_str_FromChar(v->ty->name);
1819   }
1820 }
1821 
1822 SWIGRUNTIME int
SwigPyPacked_compare(SwigPyPacked * v,SwigPyPacked * w)1823 SwigPyPacked_compare(SwigPyPacked *v, SwigPyPacked *w)
1824 {
1825   size_t i = v->size;
1826   size_t j = w->size;
1827   int s = (i < j) ? -1 : ((i > j) ? 1 : 0);
1828   return s ? s : strncmp((const char *)v->pack, (const char *)w->pack, 2*v->size);
1829 }
1830 
1831 SWIGRUNTIME PyTypeObject* SwigPyPacked_TypeOnce(void);
1832 
1833 SWIGRUNTIME PyTypeObject*
SwigPyPacked_type(void)1834 SwigPyPacked_type(void) {
1835   static PyTypeObject *SWIG_STATIC_POINTER(type) = SwigPyPacked_TypeOnce();
1836   return type;
1837 }
1838 
1839 SWIGRUNTIMEINLINE int
SwigPyPacked_Check(PyObject * op)1840 SwigPyPacked_Check(PyObject *op) {
1841   return ((op)->ob_type == SwigPyPacked_TypeOnce())
1842     || (strcmp((op)->ob_type->tp_name,"SwigPyPacked") == 0);
1843 }
1844 
1845 SWIGRUNTIME void
SwigPyPacked_dealloc(PyObject * v)1846 SwigPyPacked_dealloc(PyObject *v)
1847 {
1848   if (SwigPyPacked_Check(v)) {
1849     SwigPyPacked *sobj = (SwigPyPacked *) v;
1850     free(sobj->pack);
1851   }
1852   PyObject_DEL(v);
1853 }
1854 
1855 SWIGRUNTIME PyTypeObject*
SwigPyPacked_TypeOnce(void)1856 SwigPyPacked_TypeOnce(void) {
1857   static char swigpacked_doc[] = "Swig object carries a C/C++ instance pointer";
1858   static PyTypeObject swigpypacked_type;
1859   static int type_init = 0;
1860   if (!type_init) {
1861     const PyTypeObject tmp = {
1862 #if PY_VERSION_HEX>=0x03000000
1863       PyVarObject_HEAD_INIT(NULL, 0)
1864 #else
1865       PyObject_HEAD_INIT(NULL)
1866       0,                                    /* ob_size */
1867 #endif
1868       "SwigPyPacked",                       /* tp_name */
1869       sizeof(SwigPyPacked),                 /* tp_basicsize */
1870       0,                                    /* tp_itemsize */
1871       (destructor)SwigPyPacked_dealloc,     /* tp_dealloc */
1872       0,                                    /* tp_print */
1873       (getattrfunc)0,                       /* tp_getattr */
1874       (setattrfunc)0,                       /* tp_setattr */
1875 #if PY_VERSION_HEX>=0x03000000
1876       0, /* tp_reserved in 3.0.1 */
1877 #else
1878       (cmpfunc)SwigPyPacked_compare,        /* tp_compare */
1879 #endif
1880       (reprfunc)SwigPyPacked_repr,          /* tp_repr */
1881       0,                                    /* tp_as_number */
1882       0,                                    /* tp_as_sequence */
1883       0,                                    /* tp_as_mapping */
1884       (hashfunc)0,                          /* tp_hash */
1885       (ternaryfunc)0,                       /* tp_call */
1886       (reprfunc)SwigPyPacked_str,           /* tp_str */
1887       PyObject_GenericGetAttr,              /* tp_getattro */
1888       0,                                    /* tp_setattro */
1889       0,                                    /* tp_as_buffer */
1890       Py_TPFLAGS_DEFAULT,                   /* tp_flags */
1891       swigpacked_doc,                       /* tp_doc */
1892       0,                                    /* tp_traverse */
1893       0,                                    /* tp_clear */
1894       0,                                    /* tp_richcompare */
1895       0,                                    /* tp_weaklistoffset */
1896       0,                                    /* tp_iter */
1897       0,                                    /* tp_iternext */
1898       0,                                    /* tp_methods */
1899       0,                                    /* tp_members */
1900       0,                                    /* tp_getset */
1901       0,                                    /* tp_base */
1902       0,                                    /* tp_dict */
1903       0,                                    /* tp_descr_get */
1904       0,                                    /* tp_descr_set */
1905       0,                                    /* tp_dictoffset */
1906       0,                                    /* tp_init */
1907       0,                                    /* tp_alloc */
1908       0,                                    /* tp_new */
1909       0,                                    /* tp_free */
1910       0,                                    /* tp_is_gc */
1911       0,                                    /* tp_bases */
1912       0,                                    /* tp_mro */
1913       0,                                    /* tp_cache */
1914       0,                                    /* tp_subclasses */
1915       0,                                    /* tp_weaklist */
1916       0,                                    /* tp_del */
1917       0,                                    /* tp_version_tag */
1918 #if PY_VERSION_HEX >= 0x03040000
1919       0,                                    /* tp_finalize */
1920 #endif
1921 #if PY_VERSION_HEX >= 0x03080000
1922       0,                                    /* tp_vectorcall */
1923 #endif
1924 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
1925       0,                                    /* tp_print */
1926 #endif
1927 #ifdef COUNT_ALLOCS
1928       0,                                    /* tp_allocs */
1929       0,                                    /* tp_frees */
1930       0,                                    /* tp_maxalloc */
1931       0,                                    /* tp_prev */
1932       0                                     /* tp_next */
1933 #endif
1934     };
1935     swigpypacked_type = tmp;
1936     type_init = 1;
1937     if (PyType_Ready(&swigpypacked_type) < 0)
1938       return NULL;
1939   }
1940   return &swigpypacked_type;
1941 }
1942 
1943 SWIGRUNTIME PyObject *
SwigPyPacked_New(void * ptr,size_t size,swig_type_info * ty)1944 SwigPyPacked_New(void *ptr, size_t size, swig_type_info *ty)
1945 {
1946   SwigPyPacked *sobj = PyObject_NEW(SwigPyPacked, SwigPyPacked_type());
1947   if (sobj) {
1948     void *pack = malloc(size);
1949     if (pack) {
1950       memcpy(pack, ptr, size);
1951       sobj->pack = pack;
1952       sobj->ty   = ty;
1953       sobj->size = size;
1954     } else {
1955       PyObject_DEL((PyObject *) sobj);
1956       sobj = 0;
1957     }
1958   }
1959   return (PyObject *) sobj;
1960 }
1961 
1962 SWIGRUNTIME swig_type_info *
SwigPyPacked_UnpackData(PyObject * obj,void * ptr,size_t size)1963 SwigPyPacked_UnpackData(PyObject *obj, void *ptr, size_t size)
1964 {
1965   if (SwigPyPacked_Check(obj)) {
1966     SwigPyPacked *sobj = (SwigPyPacked *)obj;
1967     if (sobj->size != size) return 0;
1968     memcpy(ptr, sobj->pack, size);
1969     return sobj->ty;
1970   } else {
1971     return 0;
1972   }
1973 }
1974 
1975 /* -----------------------------------------------------------------------------
1976  * pointers/data manipulation
1977  * ----------------------------------------------------------------------------- */
1978 
1979 static PyObject *Swig_This_global = NULL;
1980 
1981 SWIGRUNTIME PyObject *
SWIG_This(void)1982 SWIG_This(void)
1983 {
1984   if (Swig_This_global == NULL)
1985     Swig_This_global = SWIG_Python_str_FromChar("this");
1986   return Swig_This_global;
1987 }
1988 
1989 /* #define SWIG_PYTHON_SLOW_GETSET_THIS */
1990 
1991 /* TODO: I don't know how to implement the fast getset in Python 3 right now */
1992 #if PY_VERSION_HEX>=0x03000000
1993 #define SWIG_PYTHON_SLOW_GETSET_THIS
1994 #endif
1995 
1996 SWIGRUNTIME SwigPyObject *
SWIG_Python_GetSwigThis(PyObject * pyobj)1997 SWIG_Python_GetSwigThis(PyObject *pyobj)
1998 {
1999   PyObject *obj;
2000 
2001   if (SwigPyObject_Check(pyobj))
2002     return (SwigPyObject *) pyobj;
2003 
2004 #ifdef SWIGPYTHON_BUILTIN
2005   (void)obj;
2006 # ifdef PyWeakref_CheckProxy
2007   if (PyWeakref_CheckProxy(pyobj)) {
2008     pyobj = PyWeakref_GET_OBJECT(pyobj);
2009     if (pyobj && SwigPyObject_Check(pyobj))
2010       return (SwigPyObject*) pyobj;
2011   }
2012 # endif
2013   return NULL;
2014 #else
2015 
2016   obj = 0;
2017 
2018 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2019   if (PyInstance_Check(pyobj)) {
2020     obj = _PyInstance_Lookup(pyobj, SWIG_This());
2021   } else {
2022     PyObject **dictptr = _PyObject_GetDictPtr(pyobj);
2023     if (dictptr != NULL) {
2024       PyObject *dict = *dictptr;
2025       obj = dict ? PyDict_GetItem(dict, SWIG_This()) : 0;
2026     } else {
2027 #ifdef PyWeakref_CheckProxy
2028       if (PyWeakref_CheckProxy(pyobj)) {
2029 	PyObject *wobj = PyWeakref_GET_OBJECT(pyobj);
2030 	return wobj ? SWIG_Python_GetSwigThis(wobj) : 0;
2031       }
2032 #endif
2033       obj = PyObject_GetAttr(pyobj,SWIG_This());
2034       if (obj) {
2035 	Py_DECREF(obj);
2036       } else {
2037 	if (PyErr_Occurred()) PyErr_Clear();
2038 	return 0;
2039       }
2040     }
2041   }
2042 #else
2043   obj = PyObject_GetAttr(pyobj,SWIG_This());
2044   if (obj) {
2045     Py_DECREF(obj);
2046   } else {
2047     if (PyErr_Occurred()) PyErr_Clear();
2048     return 0;
2049   }
2050 #endif
2051   if (obj && !SwigPyObject_Check(obj)) {
2052     /* a PyObject is called 'this', try to get the 'real this'
2053        SwigPyObject from it */
2054     return SWIG_Python_GetSwigThis(obj);
2055   }
2056   return (SwigPyObject *)obj;
2057 #endif
2058 }
2059 
2060 /* Acquire a pointer value */
2061 
2062 SWIGRUNTIME int
SWIG_Python_AcquirePtr(PyObject * obj,int own)2063 SWIG_Python_AcquirePtr(PyObject *obj, int own) {
2064   if (own == SWIG_POINTER_OWN) {
2065     SwigPyObject *sobj = SWIG_Python_GetSwigThis(obj);
2066     if (sobj) {
2067       int oldown = sobj->own;
2068       sobj->own = own;
2069       return oldown;
2070     }
2071   }
2072   return 0;
2073 }
2074 
2075 /* Convert a pointer value */
2076 
2077 SWIGRUNTIME int
SWIG_Python_ConvertPtrAndOwn(PyObject * obj,void ** ptr,swig_type_info * ty,int flags,int * own)2078 SWIG_Python_ConvertPtrAndOwn(PyObject *obj, void **ptr, swig_type_info *ty, int flags, int *own) {
2079   int res;
2080   SwigPyObject *sobj;
2081   int implicit_conv = (flags & SWIG_POINTER_IMPLICIT_CONV) != 0;
2082 
2083   if (!obj)
2084     return SWIG_ERROR;
2085   if (obj == Py_None && !implicit_conv) {
2086     if (ptr)
2087       *ptr = 0;
2088     return (flags & SWIG_POINTER_NO_NULL) ? SWIG_NullReferenceError : SWIG_OK;
2089   }
2090 
2091   res = SWIG_ERROR;
2092 
2093   sobj = SWIG_Python_GetSwigThis(obj);
2094   if (own)
2095     *own = 0;
2096   while (sobj) {
2097     void *vptr = sobj->ptr;
2098     if (ty) {
2099       swig_type_info *to = sobj->ty;
2100       if (to == ty) {
2101         /* no type cast needed */
2102         if (ptr) *ptr = vptr;
2103         break;
2104       } else {
2105         swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2106         if (!tc) {
2107           sobj = (SwigPyObject *)sobj->next;
2108         } else {
2109           if (ptr) {
2110             int newmemory = 0;
2111             *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2112             if (newmemory == SWIG_CAST_NEW_MEMORY) {
2113               assert(own); /* badly formed typemap which will lead to a memory leak - it must set and use own to delete *ptr */
2114               if (own)
2115                 *own = *own | SWIG_CAST_NEW_MEMORY;
2116             }
2117           }
2118           break;
2119         }
2120       }
2121     } else {
2122       if (ptr) *ptr = vptr;
2123       break;
2124     }
2125   }
2126   if (sobj) {
2127     if (own)
2128       *own = *own | sobj->own;
2129     if (flags & SWIG_POINTER_DISOWN) {
2130       sobj->own = 0;
2131     }
2132     res = SWIG_OK;
2133   } else {
2134     if (implicit_conv) {
2135       SwigPyClientData *data = ty ? (SwigPyClientData *) ty->clientdata : 0;
2136       if (data && !data->implicitconv) {
2137         PyObject *klass = data->klass;
2138         if (klass) {
2139           PyObject *impconv;
2140           data->implicitconv = 1; /* avoid recursion and call 'explicit' constructors*/
2141           impconv = SWIG_Python_CallFunctor(klass, obj);
2142           data->implicitconv = 0;
2143           if (PyErr_Occurred()) {
2144             PyErr_Clear();
2145             impconv = 0;
2146           }
2147           if (impconv) {
2148             SwigPyObject *iobj = SWIG_Python_GetSwigThis(impconv);
2149             if (iobj) {
2150               void *vptr;
2151               res = SWIG_Python_ConvertPtrAndOwn((PyObject*)iobj, &vptr, ty, 0, 0);
2152               if (SWIG_IsOK(res)) {
2153                 if (ptr) {
2154                   *ptr = vptr;
2155                   /* transfer the ownership to 'ptr' */
2156                   iobj->own = 0;
2157                   res = SWIG_AddCast(res);
2158                   res = SWIG_AddNewMask(res);
2159                 } else {
2160                   res = SWIG_AddCast(res);
2161                 }
2162               }
2163             }
2164             Py_DECREF(impconv);
2165           }
2166         }
2167       }
2168       if (!SWIG_IsOK(res) && obj == Py_None) {
2169         if (ptr)
2170           *ptr = 0;
2171         if (PyErr_Occurred())
2172           PyErr_Clear();
2173         res = SWIG_OK;
2174       }
2175     }
2176   }
2177   return res;
2178 }
2179 
2180 /* Convert a function ptr value */
2181 
2182 SWIGRUNTIME int
SWIG_Python_ConvertFunctionPtr(PyObject * obj,void ** ptr,swig_type_info * ty)2183 SWIG_Python_ConvertFunctionPtr(PyObject *obj, void **ptr, swig_type_info *ty) {
2184   if (!PyCFunction_Check(obj)) {
2185     return SWIG_ConvertPtr(obj, ptr, ty, 0);
2186   } else {
2187     void *vptr = 0;
2188     swig_cast_info *tc;
2189 
2190     /* here we get the method pointer for callbacks */
2191     const char *doc = (((PyCFunctionObject *)obj) -> m_ml -> ml_doc);
2192     const char *desc = doc ? strstr(doc, "swig_ptr: ") : 0;
2193     if (desc)
2194       desc = ty ? SWIG_UnpackVoidPtr(desc + 10, &vptr, ty->name) : 0;
2195     if (!desc)
2196       return SWIG_ERROR;
2197     tc = SWIG_TypeCheck(desc,ty);
2198     if (tc) {
2199       int newmemory = 0;
2200       *ptr = SWIG_TypeCast(tc,vptr,&newmemory);
2201       assert(!newmemory); /* newmemory handling not yet implemented */
2202     } else {
2203       return SWIG_ERROR;
2204     }
2205     return SWIG_OK;
2206   }
2207 }
2208 
2209 /* Convert a packed pointer value */
2210 
2211 SWIGRUNTIME int
SWIG_Python_ConvertPacked(PyObject * obj,void * ptr,size_t sz,swig_type_info * ty)2212 SWIG_Python_ConvertPacked(PyObject *obj, void *ptr, size_t sz, swig_type_info *ty) {
2213   swig_type_info *to = SwigPyPacked_UnpackData(obj, ptr, sz);
2214   if (!to) return SWIG_ERROR;
2215   if (ty) {
2216     if (to != ty) {
2217       /* check type cast? */
2218       swig_cast_info *tc = SWIG_TypeCheck(to->name,ty);
2219       if (!tc) return SWIG_ERROR;
2220     }
2221   }
2222   return SWIG_OK;
2223 }
2224 
2225 /* -----------------------------------------------------------------------------
2226  * Create a new pointer object
2227  * ----------------------------------------------------------------------------- */
2228 
2229 /*
2230   Create a new instance object, without calling __init__, and set the
2231   'this' attribute.
2232 */
2233 
2234 SWIGRUNTIME PyObject*
SWIG_Python_NewShadowInstance(SwigPyClientData * data,PyObject * swig_this)2235 SWIG_Python_NewShadowInstance(SwigPyClientData *data, PyObject *swig_this)
2236 {
2237   PyObject *inst = 0;
2238   PyObject *newraw = data->newraw;
2239   if (newraw) {
2240     inst = PyObject_Call(newraw, data->newargs, NULL);
2241     if (inst) {
2242 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2243       PyObject **dictptr = _PyObject_GetDictPtr(inst);
2244       if (dictptr != NULL) {
2245 	PyObject *dict = *dictptr;
2246 	if (dict == NULL) {
2247 	  dict = PyDict_New();
2248 	  *dictptr = dict;
2249 	  PyDict_SetItem(dict, SWIG_This(), swig_this);
2250 	}
2251       }
2252 #else
2253       if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2254         Py_DECREF(inst);
2255         inst = 0;
2256       }
2257 #endif
2258     }
2259   } else {
2260 #if PY_VERSION_HEX >= 0x03000000
2261     PyObject *empty_args = PyTuple_New(0);
2262     if (empty_args) {
2263       PyObject *empty_kwargs = PyDict_New();
2264       if (empty_kwargs) {
2265         inst = ((PyTypeObject *)data->newargs)->tp_new((PyTypeObject *)data->newargs, empty_args, empty_kwargs);
2266         Py_DECREF(empty_kwargs);
2267         if (inst) {
2268           if (PyObject_SetAttr(inst, SWIG_This(), swig_this) == -1) {
2269             Py_DECREF(inst);
2270             inst = 0;
2271           } else {
2272             Py_TYPE(inst)->tp_flags &= ~Py_TPFLAGS_VALID_VERSION_TAG;
2273           }
2274         }
2275       }
2276       Py_DECREF(empty_args);
2277     }
2278 #else
2279     PyObject *dict = PyDict_New();
2280     if (dict) {
2281       PyDict_SetItem(dict, SWIG_This(), swig_this);
2282       inst = PyInstance_NewRaw(data->newargs, dict);
2283       Py_DECREF(dict);
2284     }
2285 #endif
2286   }
2287   return inst;
2288 }
2289 
2290 SWIGRUNTIME int
SWIG_Python_SetSwigThis(PyObject * inst,PyObject * swig_this)2291 SWIG_Python_SetSwigThis(PyObject *inst, PyObject *swig_this)
2292 {
2293 #if !defined(SWIG_PYTHON_SLOW_GETSET_THIS)
2294   PyObject **dictptr = _PyObject_GetDictPtr(inst);
2295   if (dictptr != NULL) {
2296     PyObject *dict = *dictptr;
2297     if (dict == NULL) {
2298       dict = PyDict_New();
2299       *dictptr = dict;
2300     }
2301     return PyDict_SetItem(dict, SWIG_This(), swig_this);
2302   }
2303 #endif
2304   return PyObject_SetAttr(inst, SWIG_This(), swig_this);
2305 }
2306 
2307 
2308 SWIGINTERN PyObject *
SWIG_Python_InitShadowInstance(PyObject * args)2309 SWIG_Python_InitShadowInstance(PyObject *args) {
2310   PyObject *obj[2];
2311   if (!SWIG_Python_UnpackTuple(args, "swiginit", 2, 2, obj)) {
2312     return NULL;
2313   } else {
2314     SwigPyObject *sthis = SWIG_Python_GetSwigThis(obj[0]);
2315     if (sthis) {
2316       SwigPyObject_append((PyObject*) sthis, obj[1]);
2317     } else {
2318       if (SWIG_Python_SetSwigThis(obj[0], obj[1]) != 0)
2319         return NULL;
2320     }
2321     return SWIG_Py_Void();
2322   }
2323 }
2324 
2325 /* Create a new pointer object */
2326 
2327 SWIGRUNTIME PyObject *
SWIG_Python_NewPointerObj(PyObject * self,void * ptr,swig_type_info * type,int flags)2328 SWIG_Python_NewPointerObj(PyObject *self, void *ptr, swig_type_info *type, int flags) {
2329   SwigPyClientData *clientdata;
2330   PyObject * robj;
2331   int own;
2332 
2333   if (!ptr)
2334     return SWIG_Py_Void();
2335 
2336   clientdata = type ? (SwigPyClientData *)(type->clientdata) : 0;
2337   own = (flags & SWIG_POINTER_OWN) ? SWIG_POINTER_OWN : 0;
2338   if (clientdata && clientdata->pytype) {
2339     SwigPyObject *newobj;
2340     if (flags & SWIG_BUILTIN_TP_INIT) {
2341       newobj = (SwigPyObject*) self;
2342       if (newobj->ptr) {
2343         PyObject *next_self = clientdata->pytype->tp_alloc(clientdata->pytype, 0);
2344         while (newobj->next)
2345 	  newobj = (SwigPyObject *) newobj->next;
2346         newobj->next = next_self;
2347         newobj = (SwigPyObject *)next_self;
2348 #ifdef SWIGPYTHON_BUILTIN
2349         newobj->dict = 0;
2350 #endif
2351       }
2352     } else {
2353       newobj = PyObject_New(SwigPyObject, clientdata->pytype);
2354 #ifdef SWIGPYTHON_BUILTIN
2355       newobj->dict = 0;
2356 #endif
2357     }
2358     if (newobj) {
2359       newobj->ptr = ptr;
2360       newobj->ty = type;
2361       newobj->own = own;
2362       newobj->next = 0;
2363       return (PyObject*) newobj;
2364     }
2365     return SWIG_Py_Void();
2366   }
2367 
2368   assert(!(flags & SWIG_BUILTIN_TP_INIT));
2369 
2370   robj = SwigPyObject_New(ptr, type, own);
2371   if (robj && clientdata && !(flags & SWIG_POINTER_NOSHADOW)) {
2372     PyObject *inst = SWIG_Python_NewShadowInstance(clientdata, robj);
2373     Py_DECREF(robj);
2374     robj = inst;
2375   }
2376   return robj;
2377 }
2378 
2379 /* Create a new packed object */
2380 
2381 SWIGRUNTIMEINLINE PyObject *
SWIG_Python_NewPackedObj(void * ptr,size_t sz,swig_type_info * type)2382 SWIG_Python_NewPackedObj(void *ptr, size_t sz, swig_type_info *type) {
2383   return ptr ? SwigPyPacked_New((void *) ptr, sz, type) : SWIG_Py_Void();
2384 }
2385 
2386 /* -----------------------------------------------------------------------------*
2387  *  Get type list
2388  * -----------------------------------------------------------------------------*/
2389 
2390 #ifdef SWIG_LINK_RUNTIME
2391 void *SWIG_ReturnGlobalTypeList(void *);
2392 #endif
2393 
2394 SWIGRUNTIME swig_module_info *
SWIG_Python_GetModule(void * SWIGUNUSEDPARM (clientdata))2395 SWIG_Python_GetModule(void *SWIGUNUSEDPARM(clientdata)) {
2396   static void *type_pointer = (void *)0;
2397   /* first check if module already created */
2398   if (!type_pointer) {
2399 #ifdef SWIG_LINK_RUNTIME
2400     type_pointer = SWIG_ReturnGlobalTypeList((void *)0);
2401 #else
2402     type_pointer = PyCapsule_Import(SWIGPY_CAPSULE_NAME, 0);
2403     if (PyErr_Occurred()) {
2404       PyErr_Clear();
2405       type_pointer = (void *)0;
2406     }
2407 #endif
2408   }
2409   return (swig_module_info *) type_pointer;
2410 }
2411 
2412 SWIGRUNTIME void
SWIG_Python_DestroyModule(PyObject * obj)2413 SWIG_Python_DestroyModule(PyObject *obj)
2414 {
2415   swig_module_info *swig_module = (swig_module_info *) PyCapsule_GetPointer(obj, SWIGPY_CAPSULE_NAME);
2416   swig_type_info **types = swig_module->types;
2417   size_t i;
2418   for (i =0; i < swig_module->size; ++i) {
2419     swig_type_info *ty = types[i];
2420     if (ty->owndata) {
2421       SwigPyClientData *data = (SwigPyClientData *) ty->clientdata;
2422       if (data) SwigPyClientData_Del(data);
2423     }
2424   }
2425   Py_DECREF(SWIG_This());
2426   Swig_This_global = NULL;
2427 }
2428 
2429 SWIGRUNTIME void
SWIG_Python_SetModule(swig_module_info * swig_module)2430 SWIG_Python_SetModule(swig_module_info *swig_module) {
2431 #if PY_VERSION_HEX >= 0x03000000
2432  /* Add a dummy module object into sys.modules */
2433   PyObject *module = PyImport_AddModule("swig_runtime_data" SWIG_RUNTIME_VERSION);
2434 #else
2435   static PyMethodDef swig_empty_runtime_method_table[] = { {NULL, NULL, 0, NULL} }; /* Sentinel */
2436   PyObject *module = Py_InitModule("swig_runtime_data" SWIG_RUNTIME_VERSION, swig_empty_runtime_method_table);
2437 #endif
2438   PyObject *pointer = PyCapsule_New((void *) swig_module, SWIGPY_CAPSULE_NAME, SWIG_Python_DestroyModule);
2439   if (pointer && module) {
2440     PyModule_AddObject(module, "type_pointer_capsule" SWIG_TYPE_TABLE_NAME, pointer);
2441   } else {
2442     Py_XDECREF(pointer);
2443   }
2444 }
2445 
2446 /* The python cached type query */
2447 SWIGRUNTIME PyObject *
SWIG_Python_TypeCache(void)2448 SWIG_Python_TypeCache(void) {
2449   static PyObject *SWIG_STATIC_POINTER(cache) = PyDict_New();
2450   return cache;
2451 }
2452 
2453 SWIGRUNTIME swig_type_info *
SWIG_Python_TypeQuery(const char * type)2454 SWIG_Python_TypeQuery(const char *type)
2455 {
2456   PyObject *cache = SWIG_Python_TypeCache();
2457   PyObject *key = SWIG_Python_str_FromChar(type);
2458   PyObject *obj = PyDict_GetItem(cache, key);
2459   swig_type_info *descriptor;
2460   if (obj) {
2461     descriptor = (swig_type_info *) PyCapsule_GetPointer(obj, NULL);
2462   } else {
2463     swig_module_info *swig_module = SWIG_GetModule(0);
2464     descriptor = SWIG_TypeQueryModule(swig_module, swig_module, type);
2465     if (descriptor) {
2466       obj = PyCapsule_New((void*) descriptor, NULL, NULL);
2467       PyDict_SetItem(cache, key, obj);
2468       Py_DECREF(obj);
2469     }
2470   }
2471   Py_DECREF(key);
2472   return descriptor;
2473 }
2474 
2475 /*
2476    For backward compatibility only
2477 */
2478 #define SWIG_POINTER_EXCEPTION  0
2479 #define SWIG_arg_fail(arg)      SWIG_Python_ArgFail(arg)
2480 #define SWIG_MustGetPtr(p, type, argnum, flags)  SWIG_Python_MustGetPtr(p, type, argnum, flags)
2481 
2482 SWIGRUNTIME int
SWIG_Python_AddErrMesg(const char * mesg,int infront)2483 SWIG_Python_AddErrMesg(const char* mesg, int infront)
2484 {
2485   if (PyErr_Occurred()) {
2486     PyObject *type = 0;
2487     PyObject *value = 0;
2488     PyObject *traceback = 0;
2489     PyErr_Fetch(&type, &value, &traceback);
2490     if (value) {
2491       PyObject *old_str = PyObject_Str(value);
2492       const char *tmp = SWIG_Python_str_AsChar(old_str);
2493       const char *errmesg = tmp ? tmp : "Invalid error message";
2494       Py_XINCREF(type);
2495       PyErr_Clear();
2496       if (infront) {
2497 	PyErr_Format(type, "%s %s", mesg, errmesg);
2498       } else {
2499 	PyErr_Format(type, "%s %s", errmesg, mesg);
2500       }
2501       SWIG_Python_str_DelForPy3(tmp);
2502       Py_DECREF(old_str);
2503     }
2504     return 1;
2505   } else {
2506     return 0;
2507   }
2508 }
2509 
2510 SWIGRUNTIME int
SWIG_Python_ArgFail(int argnum)2511 SWIG_Python_ArgFail(int argnum)
2512 {
2513   if (PyErr_Occurred()) {
2514     /* add information about failing argument */
2515     char mesg[256];
2516     PyOS_snprintf(mesg, sizeof(mesg), "argument number %d:", argnum);
2517     return SWIG_Python_AddErrMesg(mesg, 1);
2518   } else {
2519     return 0;
2520   }
2521 }
2522 
2523 SWIGRUNTIMEINLINE const char *
SwigPyObject_GetDesc(PyObject * self)2524 SwigPyObject_GetDesc(PyObject *self)
2525 {
2526   SwigPyObject *v = (SwigPyObject *)self;
2527   swig_type_info *ty = v ? v->ty : 0;
2528   return ty ? ty->str : "";
2529 }
2530 
2531 SWIGRUNTIME void
SWIG_Python_TypeError(const char * type,PyObject * obj)2532 SWIG_Python_TypeError(const char *type, PyObject *obj)
2533 {
2534   if (type) {
2535 #if defined(SWIG_COBJECT_TYPES)
2536     if (obj && SwigPyObject_Check(obj)) {
2537       const char *otype = (const char *) SwigPyObject_GetDesc(obj);
2538       if (otype) {
2539 	PyErr_Format(PyExc_TypeError, "a '%s' is expected, 'SwigPyObject(%s)' is received",
2540 		     type, otype);
2541 	return;
2542       }
2543     } else
2544 #endif
2545     {
2546       const char *otype = (obj ? obj->ob_type->tp_name : 0);
2547       if (otype) {
2548 	PyObject *str = PyObject_Str(obj);
2549 	const char *cstr = str ? SWIG_Python_str_AsChar(str) : 0;
2550 	if (cstr) {
2551 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s(%s)' is received",
2552 		       type, otype, cstr);
2553           SWIG_Python_str_DelForPy3(cstr);
2554 	} else {
2555 	  PyErr_Format(PyExc_TypeError, "a '%s' is expected, '%s' is received",
2556 		       type, otype);
2557 	}
2558 	Py_XDECREF(str);
2559 	return;
2560       }
2561     }
2562     PyErr_Format(PyExc_TypeError, "a '%s' is expected", type);
2563   } else {
2564     PyErr_Format(PyExc_TypeError, "unexpected type is received");
2565   }
2566 }
2567 
2568 
2569 /* Convert a pointer value, signal an exception on a type mismatch */
2570 SWIGRUNTIME void *
SWIG_Python_MustGetPtr(PyObject * obj,swig_type_info * ty,int SWIGUNUSEDPARM (argnum),int flags)2571 SWIG_Python_MustGetPtr(PyObject *obj, swig_type_info *ty, int SWIGUNUSEDPARM(argnum), int flags) {
2572   void *result;
2573   if (SWIG_Python_ConvertPtr(obj, &result, ty, flags) == -1) {
2574     PyErr_Clear();
2575 #if SWIG_POINTER_EXCEPTION
2576     if (flags) {
2577       SWIG_Python_TypeError(SWIG_TypePrettyName(ty), obj);
2578       SWIG_Python_ArgFail(argnum);
2579     }
2580 #endif
2581   }
2582   return result;
2583 }
2584 
2585 #ifdef SWIGPYTHON_BUILTIN
2586 SWIGRUNTIME int
SWIG_Python_NonDynamicSetAttr(PyObject * obj,PyObject * name,PyObject * value)2587 SWIG_Python_NonDynamicSetAttr(PyObject *obj, PyObject *name, PyObject *value) {
2588   PyTypeObject *tp = obj->ob_type;
2589   PyObject *descr;
2590   PyObject *encoded_name;
2591   descrsetfunc f;
2592   int res = -1;
2593 
2594 # ifdef Py_USING_UNICODE
2595   if (PyString_Check(name)) {
2596     name = PyUnicode_Decode(PyString_AsString(name), PyString_Size(name), NULL, NULL);
2597     if (!name)
2598       return -1;
2599   } else if (!PyUnicode_Check(name))
2600 # else
2601   if (!PyString_Check(name))
2602 # endif
2603   {
2604     PyErr_Format(PyExc_TypeError, "attribute name must be string, not '%.200s'", name->ob_type->tp_name);
2605     return -1;
2606   } else {
2607     Py_INCREF(name);
2608   }
2609 
2610   if (!tp->tp_dict) {
2611     if (PyType_Ready(tp) < 0)
2612       goto done;
2613   }
2614 
2615   descr = _PyType_Lookup(tp, name);
2616   f = NULL;
2617   if (descr != NULL)
2618     f = descr->ob_type->tp_descr_set;
2619   if (!f) {
2620     if (PyString_Check(name)) {
2621       encoded_name = name;
2622       Py_INCREF(name);
2623     } else {
2624       encoded_name = PyUnicode_AsUTF8String(name);
2625       if (!encoded_name)
2626         return -1;
2627     }
2628     PyErr_Format(PyExc_AttributeError, "'%.100s' object has no attribute '%.200s'", tp->tp_name, PyString_AsString(encoded_name));
2629     Py_DECREF(encoded_name);
2630   } else {
2631     res = f(descr, obj, value);
2632   }
2633 
2634   done:
2635   Py_DECREF(name);
2636   return res;
2637 }
2638 #endif
2639 
2640 
2641 #ifdef __cplusplus
2642 }
2643 #endif
2644 
2645 #ifdef __cplusplus
2646 extern "C" {
2647 #endif
2648 
2649 SWIGINTERN Py_hash_t
SwigPyObject_hash(PyObject * obj)2650 SwigPyObject_hash(PyObject *obj) {
2651   SwigPyObject *sobj = (SwigPyObject *)obj;
2652   void *ptr = sobj->ptr;
2653   return (Py_hash_t)ptr;
2654 }
2655 
2656 SWIGINTERN Py_hash_t
SWIG_PyNumber_AsPyHash(PyObject * obj)2657 SWIG_PyNumber_AsPyHash(PyObject *obj) {
2658   Py_hash_t result = -1;
2659 #if PY_VERSION_HEX < 0x03020000
2660   if (PyInt_Check(obj))
2661     result = PyInt_AsLong(obj);
2662   else if (PyLong_Check(obj))
2663     result = PyLong_AsLong(obj);
2664 #else
2665   if (PyNumber_Check(obj))
2666     result = PyNumber_AsSsize_t(obj, NULL);
2667 #endif
2668   else
2669     PyErr_Format(PyExc_TypeError, "Wrong type for hash function");
2670   return PyErr_Occurred() ? -1 : result;
2671 }
2672 
2673 SWIGINTERN int
SwigPyBuiltin_BadInit(PyObject * self,PyObject * SWIGUNUSEDPARM (args),PyObject * SWIGUNUSEDPARM (kwds))2674 SwigPyBuiltin_BadInit(PyObject *self, PyObject *SWIGUNUSEDPARM(args), PyObject *SWIGUNUSEDPARM(kwds)) {
2675   PyErr_Format(PyExc_TypeError, "Cannot create new instances of type '%.300s'", self->ob_type->tp_name);
2676   return -1;
2677 }
2678 
2679 SWIGINTERN void
SwigPyBuiltin_BadDealloc(PyObject * obj)2680 SwigPyBuiltin_BadDealloc(PyObject *obj) {
2681   SwigPyObject *sobj = (SwigPyObject *)obj;
2682   if (sobj->own) {
2683     PyErr_Format(PyExc_TypeError, "Swig detected a memory leak in type '%.300s': no callable destructor found.", obj->ob_type->tp_name);
2684   }
2685 }
2686 
2687 typedef struct {
2688   PyCFunction get;
2689   PyCFunction set;
2690 } SwigPyGetSet;
2691 
2692 SWIGINTERN PyObject *
SwigPyBuiltin_GetterClosure(PyObject * obj,void * closure)2693 SwigPyBuiltin_GetterClosure (PyObject *obj, void *closure) {
2694   SwigPyGetSet *getset;
2695   PyObject *tuple, *result;
2696   if (!closure)
2697     return SWIG_Py_Void();
2698   getset = (SwigPyGetSet *)closure;
2699   if (!getset->get)
2700     return SWIG_Py_Void();
2701   tuple = PyTuple_New(0);
2702   assert(tuple);
2703   result = (*getset->get)(obj, tuple);
2704   Py_DECREF(tuple);
2705   return result;
2706 }
2707 
2708 SWIGINTERN PyObject *
SwigPyBuiltin_FunpackGetterClosure(PyObject * obj,void * closure)2709 SwigPyBuiltin_FunpackGetterClosure (PyObject *obj, void *closure) {
2710   SwigPyGetSet *getset;
2711   PyObject *result;
2712   if (!closure)
2713     return SWIG_Py_Void();
2714   getset = (SwigPyGetSet *)closure;
2715   if (!getset->get)
2716     return SWIG_Py_Void();
2717   result = (*getset->get)(obj, NULL);
2718   return result;
2719 }
2720 
2721 SWIGINTERN int
SwigPyBuiltin_SetterClosure(PyObject * obj,PyObject * val,void * closure)2722 SwigPyBuiltin_SetterClosure (PyObject *obj, PyObject *val, void *closure) {
2723   SwigPyGetSet *getset;
2724   PyObject *tuple, *result;
2725   if (!closure) {
2726     PyErr_Format(PyExc_TypeError, "Missing getset closure");
2727     return -1;
2728   }
2729   getset = (SwigPyGetSet *)closure;
2730   if (!getset->set) {
2731     PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name);
2732     return -1;
2733   }
2734   tuple = PyTuple_New(1);
2735   assert(tuple);
2736   Py_INCREF(val);
2737   PyTuple_SET_ITEM(tuple, 0, val);
2738   result = (*getset->set)(obj, tuple);
2739   Py_DECREF(tuple);
2740   Py_XDECREF(result);
2741   return result ? 0 : -1;
2742 }
2743 
2744 SWIGINTERN int
SwigPyBuiltin_FunpackSetterClosure(PyObject * obj,PyObject * val,void * closure)2745 SwigPyBuiltin_FunpackSetterClosure (PyObject *obj, PyObject *val, void *closure) {
2746   SwigPyGetSet *getset;
2747   PyObject *result;
2748   if (!closure) {
2749     PyErr_Format(PyExc_TypeError, "Missing getset closure");
2750     return -1;
2751   }
2752   getset = (SwigPyGetSet *)closure;
2753   if (!getset->set) {
2754     PyErr_Format(PyExc_TypeError, "Illegal member variable assignment in type '%.300s'", obj->ob_type->tp_name);
2755     return -1;
2756   }
2757   result = (*getset->set)(obj, val);
2758   Py_XDECREF(result);
2759   return result ? 0 : -1;
2760 }
2761 
2762 SWIGINTERN void
SwigPyStaticVar_dealloc(PyDescrObject * descr)2763 SwigPyStaticVar_dealloc(PyDescrObject *descr) {
2764   PyObject_GC_UnTrack(descr);
2765   Py_XDECREF(PyDescr_TYPE(descr));
2766   Py_XDECREF(PyDescr_NAME(descr));
2767   PyObject_GC_Del(descr);
2768 }
2769 
2770 SWIGINTERN PyObject *
SwigPyStaticVar_repr(PyGetSetDescrObject * descr)2771 SwigPyStaticVar_repr(PyGetSetDescrObject *descr) {
2772 #if PY_VERSION_HEX >= 0x03000000
2773 
2774   return PyUnicode_FromFormat("<class attribute '%S' of type '%s'>", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name);
2775 #else
2776   return PyString_FromFormat("<class attribute '%s' of type '%s'>", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name);
2777 #endif
2778 }
2779 
2780 SWIGINTERN int
SwigPyStaticVar_traverse(PyObject * self,visitproc visit,void * arg)2781 SwigPyStaticVar_traverse(PyObject *self, visitproc visit, void *arg) {
2782   PyDescrObject *descr;
2783   descr = (PyDescrObject *)self;
2784   Py_VISIT((PyObject*) PyDescr_TYPE(descr));
2785   return 0;
2786 }
2787 
2788 SWIGINTERN PyObject *
SwigPyStaticVar_get(PyGetSetDescrObject * descr,PyObject * obj,PyObject * SWIGUNUSEDPARM (type))2789 SwigPyStaticVar_get(PyGetSetDescrObject *descr, PyObject *obj, PyObject *SWIGUNUSEDPARM(type)) {
2790   if (descr->d_getset->get != NULL)
2791     return descr->d_getset->get(obj, descr->d_getset->closure);
2792 #if PY_VERSION_HEX >= 0x03000000
2793   PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not readable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name);
2794 #else
2795   PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not readable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name);
2796 #endif
2797   return NULL;
2798 }
2799 
2800 SWIGINTERN int
SwigPyStaticVar_set(PyGetSetDescrObject * descr,PyObject * obj,PyObject * value)2801 SwigPyStaticVar_set(PyGetSetDescrObject *descr, PyObject *obj, PyObject *value) {
2802   if (descr->d_getset->set != NULL)
2803     return descr->d_getset->set(obj, value, descr->d_getset->closure);
2804 #if PY_VERSION_HEX >= 0x03000000
2805   PyErr_Format(PyExc_AttributeError, "attribute '%.300S' of '%.100s' objects is not writable", PyDescr_NAME(descr), PyDescr_TYPE(descr)->tp_name);
2806 #else
2807   PyErr_Format(PyExc_AttributeError, "attribute '%.300s' of '%.100s' objects is not writable", PyString_AsString(PyDescr_NAME(descr)), PyDescr_TYPE(descr)->tp_name);
2808 #endif
2809   return -1;
2810 }
2811 
2812 SWIGINTERN int
SwigPyObjectType_setattro(PyObject * typeobject,PyObject * name,PyObject * value)2813 SwigPyObjectType_setattro(PyObject *typeobject, PyObject *name, PyObject *value) {
2814   PyObject *attribute;
2815   PyTypeObject *type;
2816   descrsetfunc local_set;
2817 
2818   assert(PyType_Check(typeobject));
2819   type = (PyTypeObject *)typeobject;
2820   attribute = _PyType_Lookup(type, name);
2821   if (attribute != NULL) {
2822     /* Implement descriptor functionality, if any */
2823     local_set = attribute->ob_type->tp_descr_set;
2824     if (local_set != NULL)
2825       return local_set(attribute, (PyObject *)type, value);
2826 #if PY_VERSION_HEX >= 0x03000000
2827     PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400S'", type->tp_name, name);
2828 #else
2829     PyErr_Format(PyExc_AttributeError, "cannot modify read-only attribute '%.50s.%.400s'", type->tp_name, PyString_AS_STRING(name));
2830 #endif
2831   } else {
2832 #if PY_VERSION_HEX >= 0x03000000
2833     PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400S'", type->tp_name, name);
2834 #else
2835     PyErr_Format(PyExc_AttributeError, "type '%.50s' has no attribute '%.400s'", type->tp_name, PyString_AS_STRING(name));
2836 #endif
2837   }
2838 
2839   return -1;
2840 }
2841 
2842 SWIGINTERN PyTypeObject*
SwigPyStaticVar_Type(void)2843 SwigPyStaticVar_Type(void) {
2844   static PyTypeObject staticvar_type;
2845   static int type_init = 0;
2846   if (!type_init) {
2847     const PyTypeObject tmp = {
2848 #if PY_VERSION_HEX >= 0x03000000
2849       PyVarObject_HEAD_INIT(&PyType_Type, 0)
2850 #else
2851       PyObject_HEAD_INIT(&PyType_Type)
2852       0,                                        /* ob_size */
2853 #endif
2854       "swig_static_var_getset_descriptor",      /* tp_name */
2855       sizeof(PyGetSetDescrObject),              /* tp_basicsize */
2856       0,                                        /* tp_itemsize */
2857       (destructor)SwigPyStaticVar_dealloc,      /* tp_dealloc */
2858       0,                                        /* tp_print */
2859       0,                                        /* tp_getattr */
2860       0,                                        /* tp_setattr */
2861       0,                                        /* tp_compare */
2862       (reprfunc)SwigPyStaticVar_repr,           /* tp_repr */
2863       0,                                        /* tp_as_number */
2864       0,                                        /* tp_as_sequence */
2865       0,                                        /* tp_as_mapping */
2866       0,                                        /* tp_hash */
2867       0,                                        /* tp_call */
2868       0,                                        /* tp_str */
2869       PyObject_GenericGetAttr,                  /* tp_getattro */
2870       0,                                        /* tp_setattro */
2871       0,                                        /* tp_as_buffer */
2872       Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_GC|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */
2873       0,                                        /* tp_doc */
2874       SwigPyStaticVar_traverse,                 /* tp_traverse */
2875       0,                                        /* tp_clear */
2876       0,                                        /* tp_richcompare */
2877       0,                                        /* tp_weaklistoffset */
2878       0,                                        /* tp_iter */
2879       0,                                        /* tp_iternext */
2880       0,                                        /* tp_methods */
2881       0,                                        /* tp_members */
2882       0,                                        /* tp_getset */
2883       0,                                        /* tp_base */
2884       0,                                        /* tp_dict */
2885       (descrgetfunc)SwigPyStaticVar_get,        /* tp_descr_get */
2886       (descrsetfunc)SwigPyStaticVar_set,        /* tp_descr_set */
2887       0,                                        /* tp_dictoffset */
2888       0,                                        /* tp_init */
2889       0,                                        /* tp_alloc */
2890       0,                                        /* tp_new */
2891       0,                                        /* tp_free */
2892       0,                                        /* tp_is_gc */
2893       0,                                        /* tp_bases */
2894       0,                                        /* tp_mro */
2895       0,                                        /* tp_cache */
2896       0,                                        /* tp_subclasses */
2897       0,                                        /* tp_weaklist */
2898       0,                                        /* tp_del */
2899       0,                                        /* tp_version_tag */
2900 #if PY_VERSION_HEX >= 0x03040000
2901       0,                                        /* tp_finalize */
2902 #endif
2903 #if PY_VERSION_HEX >= 0x03080000
2904       0,                                        /* tp_vectorcall */
2905 #endif
2906 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
2907       0,                                        /* tp_print */
2908 #endif
2909 #ifdef COUNT_ALLOCS
2910       0,                                        /* tp_allocs */
2911       0,                                        /* tp_frees */
2912       0,                                        /* tp_maxalloc */
2913       0,                                        /* tp_prev */
2914       0                                         /* tp_next */
2915 #endif
2916     };
2917     staticvar_type = tmp;
2918     type_init = 1;
2919     if (PyType_Ready(&staticvar_type) < 0)
2920       return NULL;
2921   }
2922   return &staticvar_type;
2923 }
2924 
2925 SWIGINTERN PyTypeObject*
SwigPyObjectType(void)2926 SwigPyObjectType(void) {
2927   static char swigpyobjecttype_doc[] = "Metaclass for SWIG wrapped types";
2928   static PyTypeObject swigpyobjecttype_type;
2929   static int type_init = 0;
2930   if (!type_init) {
2931     const PyTypeObject tmp = {
2932 #if PY_VERSION_HEX >= 0x03000000
2933       PyVarObject_HEAD_INIT(&PyType_Type, 0)
2934 #else
2935       PyObject_HEAD_INIT(&PyType_Type)
2936       0,                                        /* ob_size */
2937 #endif
2938       "SwigPyObjectType",                       /* tp_name */
2939       PyType_Type.tp_basicsize,                 /* tp_basicsize */
2940       0,                                        /* tp_itemsize */
2941       0,                                        /* tp_dealloc */
2942       0,                                        /* tp_print */
2943       0,                                        /* tp_getattr */
2944       0,                                        /* tp_setattr */
2945       0,                                        /* tp_compare */
2946       0,                                        /* tp_repr */
2947       0,                                        /* tp_as_number */
2948       0,                                        /* tp_as_sequence */
2949       0,                                        /* tp_as_mapping */
2950       0,                                        /* tp_hash */
2951       0,                                        /* tp_call */
2952       0,                                        /* tp_str */
2953       0,                                        /* tp_getattro */
2954       SwigPyObjectType_setattro,                /* tp_setattro */
2955       0,                                        /* tp_as_buffer */
2956       Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_CLASS, /* tp_flags */
2957       swigpyobjecttype_doc,                     /* tp_doc */
2958       0,                                        /* tp_traverse */
2959       0,                                        /* tp_clear */
2960       0,                                        /* tp_richcompare */
2961       0,                                        /* tp_weaklistoffset */
2962       0,                                        /* tp_iter */
2963       0,                                        /* tp_iternext */
2964       0,                                        /* tp_methods */
2965       0,                                        /* tp_members */
2966       0,                                        /* tp_getset */
2967       0,                                        /* tp_base */
2968       0,                                        /* tp_dict */
2969       0,                                        /* tp_descr_get */
2970       0,                                        /* tp_descr_set */
2971       0,                                        /* tp_dictoffset */
2972       0,                                        /* tp_init */
2973       0,                                        /* tp_alloc */
2974       0,                                        /* tp_new */
2975       0,                                        /* tp_free */
2976       0,                                        /* tp_is_gc */
2977       0,                                        /* tp_bases */
2978       0,                                        /* tp_mro */
2979       0,                                        /* tp_cache */
2980       0,                                        /* tp_subclasses */
2981       0,                                        /* tp_weaklist */
2982       0,                                        /* tp_del */
2983       0,                                        /* tp_version_tag */
2984 #if PY_VERSION_HEX >= 0x03040000
2985       0,                                        /* tp_finalize */
2986 #endif
2987 #if PY_VERSION_HEX >= 0x03080000
2988       0,                                        /* tp_vectorcall */
2989 #endif
2990 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
2991       0,                                        /* tp_print */
2992 #endif
2993 #ifdef COUNT_ALLOCS
2994       0,                                        /* tp_allocs */
2995       0,                                        /* tp_frees */
2996       0,                                        /* tp_maxalloc */
2997       0,                                        /* tp_prev */
2998       0                                         /* tp_next */
2999 #endif
3000     };
3001     swigpyobjecttype_type = tmp;
3002     type_init = 1;
3003     swigpyobjecttype_type.tp_base = &PyType_Type;
3004     if (PyType_Ready(&swigpyobjecttype_type) < 0)
3005       return NULL;
3006   }
3007   return &swigpyobjecttype_type;
3008 }
3009 
3010 SWIGINTERN PyGetSetDescrObject *
SwigPyStaticVar_new_getset(PyTypeObject * type,PyGetSetDef * getset)3011 SwigPyStaticVar_new_getset(PyTypeObject *type, PyGetSetDef *getset) {
3012 
3013   PyGetSetDescrObject *descr;
3014   descr = (PyGetSetDescrObject *)PyType_GenericAlloc(SwigPyStaticVar_Type(), 0);
3015   assert(descr);
3016   Py_XINCREF(type);
3017   PyDescr_TYPE(descr) = type;
3018   PyDescr_NAME(descr) = PyString_InternFromString(getset->name);
3019   descr->d_getset = getset;
3020   if (PyDescr_NAME(descr) == NULL) {
3021     Py_DECREF(descr);
3022     descr = NULL;
3023   }
3024   return descr;
3025 }
3026 
3027 SWIGINTERN void
SwigPyBuiltin_InitBases(PyTypeObject * type,PyTypeObject ** bases)3028 SwigPyBuiltin_InitBases (PyTypeObject *type, PyTypeObject **bases) {
3029   Py_ssize_t base_count = 0;
3030   PyTypeObject **b;
3031   PyObject *tuple;
3032   Py_ssize_t i;
3033 
3034   if (!bases[0]) {
3035     bases[0] = SwigPyObject_type();
3036     bases[1] = NULL;
3037   }
3038   type->tp_base = bases[0];
3039   Py_INCREF((PyObject *)bases[0]);
3040   for (b = bases; *b != NULL; ++b)
3041     ++base_count;
3042   tuple = PyTuple_New(base_count);
3043   for (i = 0; i < base_count; ++i) {
3044     Py_INCREF((PyObject *)bases[i]);
3045     PyTuple_SET_ITEM(tuple, i, (PyObject *)bases[i]);
3046   }
3047   type->tp_bases = tuple;
3048 }
3049 
3050 SWIGINTERN PyObject *
SwigPyBuiltin_ThisClosure(PyObject * self,void * SWIGUNUSEDPARM (closure))3051 SwigPyBuiltin_ThisClosure (PyObject *self, void *SWIGUNUSEDPARM(closure)) {
3052   PyObject *result;
3053   result = (PyObject *)SWIG_Python_GetSwigThis(self);
3054   Py_XINCREF(result);
3055   return result;
3056 }
3057 
3058 SWIGINTERN void
SwigPyBuiltin_SetMetaType(PyTypeObject * type,PyTypeObject * metatype)3059 SwigPyBuiltin_SetMetaType (PyTypeObject *type, PyTypeObject *metatype)
3060 {
3061 #if PY_VERSION_HEX >= 0x03000000
3062     type->ob_base.ob_base.ob_type = metatype;
3063 #else
3064     type->ob_type = metatype;
3065 #endif
3066 }
3067 
3068 
3069 /* Start of callback function macros for use in PyTypeObject */
3070 
3071 typedef PyObject *(*SwigPyWrapperFunction)(PyObject *, PyObject *);
3072 
3073 #define SWIGPY_UNARYFUNC_CLOSURE(wrapper)		\
3074 SWIGINTERN PyObject *					\
3075 wrapper##_unaryfunc_closure(PyObject *a) {		\
3076   return SwigPyBuiltin_unaryfunc_closure(wrapper, a);	\
3077 }
3078 SWIGINTERN PyObject *
SwigPyBuiltin_unaryfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3079 SwigPyBuiltin_unaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3080   return wrapper(a, NULL);
3081 }
3082 
3083 #define SWIGPY_DESTRUCTOR_CLOSURE(wrapper)			\
3084 SWIGINTERN void							\
3085 wrapper##_destructor_closure(PyObject *a) {			\
3086     SwigPyBuiltin_destructor_closure(wrapper, #wrapper, a);	\
3087 }
3088 SWIGINTERN void
SwigPyBuiltin_destructor_closure(SwigPyWrapperFunction wrapper,const char * wrappername,PyObject * a)3089 SwigPyBuiltin_destructor_closure(SwigPyWrapperFunction wrapper, const char *wrappername, PyObject *a) {
3090   SwigPyObject *sobj;
3091   sobj = (SwigPyObject *)a;
3092   Py_XDECREF(sobj->dict);
3093   if (sobj->own) {
3094     PyObject *o;
3095     PyObject *type = 0, *value = 0, *traceback = 0;
3096     PyErr_Fetch(&type, &value, &traceback);
3097     o = wrapper(a, NULL);
3098     if (!o) {
3099       PyObject *deallocname = PyString_FromString(wrappername);
3100       PyErr_WriteUnraisable(deallocname);
3101       Py_DECREF(deallocname);
3102     }
3103     PyErr_Restore(type, value, traceback);
3104     Py_XDECREF(o);
3105   }
3106   if (PyType_IS_GC(a->ob_type)) {
3107     PyObject_GC_Del(a);
3108   } else {
3109     PyObject_Del(a);
3110   }
3111 }
3112 
3113 #define SWIGPY_INQUIRY_CLOSURE(wrapper)			\
3114 SWIGINTERN int						\
3115 wrapper##_inquiry_closure(PyObject *a) {		\
3116   return SwigPyBuiltin_inquiry_closure(wrapper, a);	\
3117 }
3118 SWIGINTERN int
SwigPyBuiltin_inquiry_closure(SwigPyWrapperFunction wrapper,PyObject * a)3119 SwigPyBuiltin_inquiry_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3120   PyObject *pyresult;
3121   int result;
3122   pyresult = wrapper(a, NULL);
3123   result = pyresult && PyObject_IsTrue(pyresult) ? 1 : 0;
3124   Py_XDECREF(pyresult);
3125   return result;
3126 }
3127 
3128 #define SWIGPY_GETITERFUNC_CLOSURE(wrapper)		\
3129 SWIGINTERN PyObject *					\
3130 wrapper##_getiterfunc_closure(PyObject *a) {		\
3131   return SwigPyBuiltin_getiterfunc_closure(wrapper, a);	\
3132 }
3133 SWIGINTERN PyObject *
SwigPyBuiltin_getiterfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3134 SwigPyBuiltin_getiterfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3135   return wrapper(a, NULL);
3136 }
3137 
3138 #define SWIGPY_BINARYFUNC_CLOSURE(wrapper)			\
3139 SWIGINTERN PyObject *						\
3140 wrapper##_binaryfunc_closure(PyObject *a, PyObject *b) {	\
3141   return SwigPyBuiltin_binaryfunc_closure(wrapper, a, b);	\
3142 }
3143 SWIGINTERN PyObject *
SwigPyBuiltin_binaryfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b)3144 SwigPyBuiltin_binaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) {
3145   PyObject *tuple, *result;
3146   tuple = PyTuple_New(1);
3147   assert(tuple);
3148   Py_INCREF(b);
3149   PyTuple_SET_ITEM(tuple, 0, b);
3150   result = wrapper(a, tuple);
3151   Py_DECREF(tuple);
3152   return result;
3153 }
3154 
3155 typedef ternaryfunc ternarycallfunc;
3156 
3157 #define SWIGPY_TERNARYFUNC_CLOSURE(wrapper)				\
3158 SWIGINTERN PyObject *							\
3159 wrapper##_ternaryfunc_closure(PyObject *a, PyObject *b, PyObject *c) {	\
3160   return SwigPyBuiltin_ternaryfunc_closure(wrapper, a, b, c);		\
3161 }
3162 SWIGINTERN PyObject *
SwigPyBuiltin_ternaryfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b,PyObject * c)3163 SwigPyBuiltin_ternaryfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) {
3164   PyObject *tuple, *result;
3165   tuple = PyTuple_New(2);
3166   assert(tuple);
3167   Py_INCREF(b);
3168   PyTuple_SET_ITEM(tuple, 0, b);
3169   Py_INCREF(c);
3170   PyTuple_SET_ITEM(tuple, 1, c);
3171   result = wrapper(a, tuple);
3172   Py_DECREF(tuple);
3173   return result;
3174 }
3175 
3176 #define SWIGPY_TERNARYCALLFUNC_CLOSURE(wrapper)					\
3177 SWIGINTERN PyObject *								\
3178 wrapper##_ternarycallfunc_closure(PyObject *a, PyObject *b, PyObject *c) {	\
3179   return SwigPyBuiltin_ternarycallfunc_closure(wrapper, a, b, c);		\
3180 }
3181 SWIGINTERN PyObject *
SwigPyBuiltin_ternarycallfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b,PyObject * c)3182 SwigPyBuiltin_ternarycallfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) {
3183   (void) c;
3184   return wrapper(a, b);
3185 }
3186 
3187 #define SWIGPY_LENFUNC_CLOSURE(wrapper)			\
3188 SWIGINTERN Py_ssize_t					\
3189 wrapper##_lenfunc_closure(PyObject *a) {		\
3190   return SwigPyBuiltin_lenfunc_closure(wrapper, a);	\
3191 }
3192 SWIGINTERN Py_ssize_t
SwigPyBuiltin_lenfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3193 SwigPyBuiltin_lenfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3194   PyObject *resultobj;
3195   Py_ssize_t result;
3196   resultobj = wrapper(a, NULL);
3197   result = PyNumber_AsSsize_t(resultobj, NULL);
3198   Py_DECREF(resultobj);
3199   return result;
3200 }
3201 
3202 #define SWIGPY_SSIZESSIZEARGFUNC_CLOSURE(wrapper)				\
3203 SWIGINTERN PyObject *								\
3204 wrapper##_ssizessizeargfunc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c) {	\
3205   return SwigPyBuiltin_ssizessizeargfunc_closure(wrapper, a, b, c);		\
3206 }
3207 SWIGINTERN PyObject *
SwigPyBuiltin_ssizessizeargfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,Py_ssize_t b,Py_ssize_t c)3208 SwigPyBuiltin_ssizessizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, Py_ssize_t c) {
3209   PyObject *tuple, *result;
3210   tuple = PyTuple_New(2);
3211   assert(tuple);
3212   PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b));
3213   PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c));
3214   result = wrapper(a, tuple);
3215   Py_DECREF(tuple);
3216   return result;
3217 }
3218 
3219 #define SWIGPY_SSIZESSIZEOBJARGPROC_CLOSURE(wrapper)						\
3220 SWIGINTERN int											\
3221 wrapper##_ssizessizeobjargproc_closure(PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) {	\
3222   return SwigPyBuiltin_ssizessizeobjargproc_closure(wrapper, a, b, c, d);			\
3223 }
3224 SWIGINTERN int
SwigPyBuiltin_ssizessizeobjargproc_closure(SwigPyWrapperFunction wrapper,PyObject * a,Py_ssize_t b,Py_ssize_t c,PyObject * d)3225 SwigPyBuiltin_ssizessizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, Py_ssize_t c, PyObject *d) {
3226   PyObject *tuple, *resultobj;
3227   int result;
3228   tuple = PyTuple_New(d ? 3 : 2);
3229   assert(tuple);
3230   PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b));
3231   PyTuple_SET_ITEM(tuple, 1, _PyLong_FromSsize_t(c));
3232   if (d) {
3233     Py_INCREF(d);
3234     PyTuple_SET_ITEM(tuple, 2, d);
3235   }
3236   resultobj = wrapper(a, tuple);
3237   result = resultobj ? 0 : -1;
3238   Py_DECREF(tuple);
3239   Py_XDECREF(resultobj);
3240   return result;
3241 }
3242 
3243 #define SWIGPY_SSIZEARGFUNC_CLOSURE(wrapper)				\
3244 SWIGINTERN PyObject *							\
3245 wrapper##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) {		\
3246   return SwigPyBuiltin_funpack_ssizeargfunc_closure(wrapper, a, b);	\
3247 }
3248 SWIGINTERN PyObject *
SwigPyBuiltin_funpack_ssizeargfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,Py_ssize_t b)3249 SwigPyBuiltin_funpack_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b) {
3250   PyObject *tuple, *result;
3251   tuple = PyTuple_New(1);
3252   assert(tuple);
3253   PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b));
3254   result = wrapper(a, tuple);
3255   Py_DECREF(tuple);
3256   return result;
3257 }
3258 
3259 #define SWIGPY_FUNPACK_SSIZEARGFUNC_CLOSURE(wrapper)			\
3260 SWIGINTERN PyObject *							\
3261 wrapper##_ssizeargfunc_closure(PyObject *a, Py_ssize_t b) {		\
3262   return SwigPyBuiltin_ssizeargfunc_closure(wrapper, a, b);		\
3263 }
3264 SWIGINTERN PyObject *
SwigPyBuiltin_ssizeargfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a,Py_ssize_t b)3265 SwigPyBuiltin_ssizeargfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b) {
3266   PyObject *arg, *result;
3267   arg = _PyLong_FromSsize_t(b);
3268   result = wrapper(a, arg);
3269   Py_DECREF(arg);
3270   return result;
3271 }
3272 
3273 #define SWIGPY_SSIZEOBJARGPROC_CLOSURE(wrapper)					\
3274 SWIGINTERN int									\
3275 wrapper##_ssizeobjargproc_closure(PyObject *a, Py_ssize_t b, PyObject *c) {	\
3276   return SwigPyBuiltin_ssizeobjargproc_closure(wrapper, a, b, c);		\
3277 }
3278 SWIGINTERN int
SwigPyBuiltin_ssizeobjargproc_closure(SwigPyWrapperFunction wrapper,PyObject * a,Py_ssize_t b,PyObject * c)3279 SwigPyBuiltin_ssizeobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, Py_ssize_t b, PyObject *c) {
3280   PyObject *tuple, *resultobj;
3281   int result;
3282   tuple = PyTuple_New(2);
3283   assert(tuple);
3284   PyTuple_SET_ITEM(tuple, 0, _PyLong_FromSsize_t(b));
3285   Py_INCREF(c);
3286   PyTuple_SET_ITEM(tuple, 1, c);
3287   resultobj = wrapper(a, tuple);
3288   result = resultobj ? 0 : -1;
3289   Py_XDECREF(resultobj);
3290   Py_DECREF(tuple);
3291   return result;
3292 }
3293 
3294 #define SWIGPY_OBJOBJPROC_CLOSURE(wrapper)			\
3295 SWIGINTERN int							\
3296 wrapper##_objobjproc_closure(PyObject *a, PyObject *b) {	\
3297   return SwigPyBuiltin_objobjproc_closure(wrapper, a, b);	\
3298 }
3299 SWIGINTERN int
SwigPyBuiltin_objobjproc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b)3300 SwigPyBuiltin_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) {
3301   int result;
3302   PyObject *pyresult;
3303   PyObject *tuple;
3304   tuple = PyTuple_New(1);
3305   assert(tuple);
3306   Py_INCREF(b);
3307   PyTuple_SET_ITEM(tuple, 0, b);
3308   pyresult = wrapper(a, tuple);
3309   result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1;
3310   Py_XDECREF(pyresult);
3311   Py_DECREF(tuple);
3312   return result;
3313 }
3314 
3315 #define SWIGPY_FUNPACK_OBJOBJPROC_CLOSURE(wrapper)			\
3316 SWIGINTERN int								\
3317 wrapper##_objobjproc_closure(PyObject *a, PyObject *b) {		\
3318   return SwigPyBuiltin_funpack_objobjproc_closure(wrapper, a, b);	\
3319 }
3320 SWIGINTERN int
SwigPyBuiltin_funpack_objobjproc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b)3321 SwigPyBuiltin_funpack_objobjproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b) {
3322   int result;
3323   PyObject *pyresult;
3324   pyresult = wrapper(a, b);
3325   result = pyresult ? (PyObject_IsTrue(pyresult) ? 1 : 0) : -1;
3326   Py_XDECREF(pyresult);
3327   return result;
3328 }
3329 
3330 #define SWIGPY_OBJOBJARGPROC_CLOSURE(wrapper)					\
3331 SWIGINTERN int									\
3332 wrapper##_objobjargproc_closure(PyObject *a, PyObject *b, PyObject *c) {	\
3333   return SwigPyBuiltin_objobjargproc_closure(wrapper, a, b, c);			\
3334 }
3335 SWIGINTERN int
SwigPyBuiltin_objobjargproc_closure(SwigPyWrapperFunction wrapper,PyObject * a,PyObject * b,PyObject * c)3336 SwigPyBuiltin_objobjargproc_closure(SwigPyWrapperFunction wrapper, PyObject *a, PyObject *b, PyObject *c) {
3337   PyObject *tuple, *resultobj;
3338   int result;
3339   tuple = PyTuple_New(c ? 2 : 1);
3340   assert(tuple);
3341   Py_INCREF(b);
3342   PyTuple_SET_ITEM(tuple, 0, b);
3343   if (c) {
3344     Py_INCREF(c);
3345     PyTuple_SET_ITEM(tuple, 1, c);
3346   }
3347   resultobj = wrapper(a, tuple);
3348   result = resultobj ? 0 : -1;
3349   Py_XDECREF(resultobj);
3350   Py_DECREF(tuple);
3351   return result;
3352 }
3353 
3354 #define SWIGPY_REPRFUNC_CLOSURE(wrapper)		\
3355 SWIGINTERN PyObject *					\
3356 wrapper##_reprfunc_closure(PyObject *a) {		\
3357   return SwigPyBuiltin_reprfunc_closure(wrapper, a);	\
3358 }
3359 SWIGINTERN PyObject *
SwigPyBuiltin_reprfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3360 SwigPyBuiltin_reprfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3361   return wrapper(a, NULL);
3362 }
3363 
3364 #define SWIGPY_HASHFUNC_CLOSURE(wrapper)		\
3365 SWIGINTERN Py_hash_t					\
3366 wrapper##_hashfunc_closure(PyObject *a) {		\
3367   return SwigPyBuiltin_hashfunc_closure(wrapper, a);	\
3368 }
3369 SWIGINTERN Py_hash_t
SwigPyBuiltin_hashfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3370 SwigPyBuiltin_hashfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3371   PyObject *pyresult;
3372   Py_hash_t result;
3373   pyresult = wrapper(a, NULL);
3374   if (!pyresult)
3375     return -1;
3376   result = SWIG_PyNumber_AsPyHash(pyresult);
3377   Py_DECREF(pyresult);
3378   return result;
3379 }
3380 
3381 #define SWIGPY_ITERNEXTFUNC_CLOSURE(wrapper)		\
3382 SWIGINTERN PyObject *					\
3383 wrapper##_iternextfunc_closure(PyObject *a) {		\
3384   return SwigPyBuiltin_iternextfunc_closure(wrapper, a);\
3385 }
3386 SWIGINTERN PyObject *
SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper,PyObject * a)3387 SwigPyBuiltin_iternextfunc_closure(SwigPyWrapperFunction wrapper, PyObject *a) {
3388   return wrapper(a, NULL);
3389 }
3390 
3391 /* End of callback function macros for use in PyTypeObject */
3392 
3393 #ifdef __cplusplus
3394 }
3395 #endif
3396 
3397 
3398 
3399 
3400 #define SWIG_exception_fail(code, msg) do { SWIG_Error(code, msg); SWIG_fail; } while(0)
3401 
3402 #define SWIG_contract_assert(expr, msg) if (!(expr)) { SWIG_Error(SWIG_RuntimeError, msg); SWIG_fail; } else
3403 
3404 
3405 
3406 #ifdef __cplusplus
3407 extern "C" {
3408 #endif
3409 
3410 /* Method creation and docstring support functions */
3411 
3412 SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name);
3413 SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
3414 SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func);
3415 
3416 #ifdef __cplusplus
3417 }
3418 #endif
3419 
3420 
3421   #define SWIG_exception(code, msg) do { SWIG_Error(code, msg); SWIG_fail;; } while(0)
3422 
3423 
3424 /* -------- TYPES TABLE (BEGIN) -------- */
3425 
3426 #define SWIGTYPE_p_AES_KEY swig_types[0]
3427 #define SWIGTYPE_p_ASN1_BIT_STRING swig_types[1]
3428 #define SWIGTYPE_p_ASN1_INTEGER swig_types[2]
3429 #define SWIGTYPE_p_ASN1_OBJECT swig_types[3]
3430 #define SWIGTYPE_p_ASN1_STRING swig_types[4]
3431 #define SWIGTYPE_p_ASN1_TIME swig_types[5]
3432 #define SWIGTYPE_p_BIGNUM swig_types[6]
3433 #define SWIGTYPE_p_BIO swig_types[7]
3434 #define SWIGTYPE_p_BIO_METHOD swig_types[8]
3435 #define SWIGTYPE_p_DH swig_types[9]
3436 #define SWIGTYPE_p_DSA swig_types[10]
3437 #define SWIGTYPE_p_ECDSA_SIG swig_types[11]
3438 #define SWIGTYPE_p_EC_KEY swig_types[12]
3439 #define SWIGTYPE_p_ENGINE swig_types[13]
3440 #define SWIGTYPE_p_EVP_CIPHER swig_types[14]
3441 #define SWIGTYPE_p_EVP_CIPHER_CTX swig_types[15]
3442 #define SWIGTYPE_p_EVP_MD swig_types[16]
3443 #define SWIGTYPE_p_EVP_MD_CTX swig_types[17]
3444 #define SWIGTYPE_p_EVP_PKEY swig_types[18]
3445 #define SWIGTYPE_p_FILE swig_types[19]
3446 #define SWIGTYPE_p_HMAC_CTX swig_types[20]
3447 #define SWIGTYPE_p_PKCS7 swig_types[21]
3448 #define SWIGTYPE_p_PyObject swig_types[22]
3449 #define SWIGTYPE_p_RC4_KEY swig_types[23]
3450 #define SWIGTYPE_p_RSA swig_types[24]
3451 #define SWIGTYPE_p_SSL swig_types[25]
3452 #define SWIGTYPE_p_SSL_CIPHER swig_types[26]
3453 #define SWIGTYPE_p_SSL_CTX swig_types[27]
3454 #define SWIGTYPE_p_SSL_METHOD swig_types[28]
3455 #define SWIGTYPE_p_SSL_SESSION swig_types[29]
3456 #define SWIGTYPE_p_SwigPyObject swig_types[30]
3457 #define SWIGTYPE_p_UI_METHOD swig_types[31]
3458 #define SWIGTYPE_p_X509 swig_types[32]
3459 #define SWIGTYPE_p_X509V3_CTX swig_types[33]
3460 #define SWIGTYPE_p_X509_CRL swig_types[34]
3461 #define SWIGTYPE_p_X509_EXTENSION swig_types[35]
3462 #define SWIGTYPE_p_X509_NAME swig_types[36]
3463 #define SWIGTYPE_p_X509_NAME_ENTRY swig_types[37]
3464 #define SWIGTYPE_p_X509_REQ swig_types[38]
3465 #define SWIGTYPE_p_X509_STORE swig_types[39]
3466 #define SWIGTYPE_p_X509_STORE_CTX swig_types[40]
3467 #define SWIGTYPE_p___INTMAX_TYPE__ swig_types[41]
3468 #define SWIGTYPE_p___INT_FAST16_TYPE__ swig_types[42]
3469 #define SWIGTYPE_p___INT_FAST32_TYPE__ swig_types[43]
3470 #define SWIGTYPE_p___INT_FAST64_TYPE__ swig_types[44]
3471 #define SWIGTYPE_p___INT_FAST8_TYPE__ swig_types[45]
3472 #define SWIGTYPE_p___INT_LEAST16_TYPE__ swig_types[46]
3473 #define SWIGTYPE_p___INT_LEAST32_TYPE__ swig_types[47]
3474 #define SWIGTYPE_p___INT_LEAST64_TYPE__ swig_types[48]
3475 #define SWIGTYPE_p___INT_LEAST8_TYPE__ swig_types[49]
3476 #define SWIGTYPE_p___UINTMAX_TYPE__ swig_types[50]
3477 #define SWIGTYPE_p___UINT_FAST16_TYPE__ swig_types[51]
3478 #define SWIGTYPE_p___UINT_FAST32_TYPE__ swig_types[52]
3479 #define SWIGTYPE_p___UINT_FAST64_TYPE__ swig_types[53]
3480 #define SWIGTYPE_p___UINT_FAST8_TYPE__ swig_types[54]
3481 #define SWIGTYPE_p___UINT_LEAST16_TYPE__ swig_types[55]
3482 #define SWIGTYPE_p___UINT_LEAST32_TYPE__ swig_types[56]
3483 #define SWIGTYPE_p___UINT_LEAST64_TYPE__ swig_types[57]
3484 #define SWIGTYPE_p___UINT_LEAST8_TYPE__ swig_types[58]
3485 #define SWIGTYPE_p__cbd_t swig_types[59]
3486 #define SWIGTYPE_p_char swig_types[60]
3487 #define SWIGTYPE_p_f_int_p_X509_STORE_CTX__int swig_types[61]
3488 #define SWIGTYPE_p_f_p_char__void swig_types[62]
3489 #define SWIGTYPE_p_f_p_q_const__char__p_char swig_types[63]
3490 #define SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int swig_types[64]
3491 #define SWIGTYPE_p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int swig_types[65]
3492 #define SWIGTYPE_p_f_p_q_const__void__p_void swig_types[66]
3493 #define SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int swig_types[67]
3494 #define SWIGTYPE_p_f_p_void__void swig_types[68]
3495 #define SWIGTYPE_p_p_ASN1_OBJECT swig_types[69]
3496 #define SWIGTYPE_p_p_EVP_PKEY_CTX swig_types[70]
3497 #define SWIGTYPE_p_p_X509_NAME_ENTRY swig_types[71]
3498 #define SWIGTYPE_p_p_unsigned_char swig_types[72]
3499 #define SWIGTYPE_p_pyfd_struct swig_types[73]
3500 #define SWIGTYPE_p_stack_st swig_types[74]
3501 #define SWIGTYPE_p_stack_st_OPENSSL_BLOCK swig_types[75]
3502 #define SWIGTYPE_p_stack_st_OPENSSL_CSTRING swig_types[76]
3503 #define SWIGTYPE_p_stack_st_OPENSSL_STRING swig_types[77]
3504 #define SWIGTYPE_p_stack_st_SSL_CIPHER swig_types[78]
3505 #define SWIGTYPE_p_stack_st_X509 swig_types[79]
3506 #define SWIGTYPE_p_stack_st_X509_EXTENSION swig_types[80]
3507 #define SWIGTYPE_p_unsigned_char swig_types[81]
3508 #define SWIGTYPE_p_void swig_types[82]
3509 static swig_type_info *swig_types[84];
3510 static swig_module_info swig_module = {swig_types, 83, 0, 0, 0, 0};
3511 #define SWIG_TypeQuery(name) SWIG_TypeQueryModule(&swig_module, &swig_module, name)
3512 #define SWIG_MangledTypeQuery(name) SWIG_MangledTypeQueryModule(&swig_module, &swig_module, name)
3513 
3514 /* -------- TYPES TABLE (END) -------- */
3515 
3516 #ifdef SWIG_TypeQuery
3517 # undef SWIG_TypeQuery
3518 #endif
3519 #define SWIG_TypeQuery SWIG_Python_TypeQuery
3520 
3521 /*-----------------------------------------------
3522               @(target):= _m2crypto.so
3523   ------------------------------------------------*/
3524 #if PY_VERSION_HEX >= 0x03000000
3525 #  define SWIG_init    PyInit__m2crypto
3526 
3527 #else
3528 #  define SWIG_init    init_m2crypto
3529 
3530 #endif
3531 #define SWIG_name    "_m2crypto"
3532 
3533 #define SWIGVERSION 0x040002
3534 #define SWIG_VERSION SWIGVERSION
3535 
3536 
3537 #define SWIG_as_voidptr(a) (void *)((const void *)(a))
3538 #define SWIG_as_voidptrptr(a) ((void)SWIG_as_voidptr(*a),(void**)(a))
3539 
3540 
3541 #include <stddef.h>
3542 
3543 
SWIG_AsVal_wchar_t(PyObject * p,wchar_t * c)3544 int SWIG_AsVal_wchar_t(PyObject *p, wchar_t *c) { return SWIG_OK; }
SWIG_From_wchar_t(wchar_t c)3545 PyObject *SWIG_From_wchar_t(wchar_t c) { return SWIG_Py_Void(); }
3546 
3547 
3548 #ifdef _WIN32
3549 #define _WINSOCKAPI_
3550 #include <WinSock2.h>
3551 #include <Windows.h>
3552 #pragma comment(lib, "Ws2_32")
3553 typedef unsigned __int64 uint64_t;
3554 #endif
3555 
3556 
3557 #if defined __GNUC__ && __GNUC__ < 5
3558 #pragma GCC diagnostic ignored "-Wunused-label"
3559 #pragma GCC diagnostic warning "-Wstrict-prototypes"
3560 #endif
3561 
3562 #include <openssl/err.h>
3563 #include <openssl/rand.h>
3564 #include <_lib.h>
3565 #include <libcrypto-compat.h>
3566 #include <py3k_compat.h>
3567 
3568 #include "compile.h"
3569 
3570 static PyObject *ssl_verify_cb_func;
3571 static PyObject *ssl_info_cb_func;
3572 static PyObject *ssl_set_tmp_dh_cb_func;
3573 static PyObject *ssl_set_tmp_rsa_cb_func;
3574 static PyObject *x509_store_verify_cb_func;
3575 
3576 
3577   #define SWIG_From_long   PyInt_FromLong
3578 
3579 
3580 SWIGINTERN swig_type_info*
SWIG_pchar_descriptor(void)3581 SWIG_pchar_descriptor(void)
3582 {
3583   static int init = 0;
3584   static swig_type_info* info = 0;
3585   if (!init) {
3586     info = SWIG_TypeQuery("_p_char");
3587     init = 1;
3588   }
3589   return info;
3590 }
3591 
3592 
3593 SWIGINTERNINLINE PyObject *
SWIG_FromCharPtrAndSize(const char * carray,size_t size)3594 SWIG_FromCharPtrAndSize(const char* carray, size_t size)
3595 {
3596   if (carray) {
3597     if (size > INT_MAX) {
3598       swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3599       return pchar_descriptor ?
3600 	SWIG_InternalNewPointerObj((char *)(carray), pchar_descriptor, 0) : SWIG_Py_Void();
3601     } else {
3602 #if PY_VERSION_HEX >= 0x03000000
3603 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3604       return PyBytes_FromStringAndSize(carray, (Py_ssize_t)(size));
3605 #else
3606       return PyUnicode_DecodeUTF8(carray, (Py_ssize_t)(size), "surrogateescape");
3607 #endif
3608 #else
3609       return PyString_FromStringAndSize(carray, (Py_ssize_t)(size));
3610 #endif
3611     }
3612   } else {
3613     return SWIG_Py_Void();
3614   }
3615 }
3616 
3617 
3618 SWIGINTERNINLINE PyObject *
SWIG_FromCharPtr(const char * cptr)3619 SWIG_FromCharPtr(const char *cptr)
3620 {
3621   return SWIG_FromCharPtrAndSize(cptr, (cptr ? strlen(cptr) : 0));
3622 }
3623 
3624 
3625 SWIGINTERNINLINE PyObject*
SWIG_From_int(int value)3626   SWIG_From_int  (int value)
3627 {
3628   return PyInt_FromLong((long) value);
3629 }
3630 
3631 
3632 #include <limits.h>
3633 #if !defined(SWIG_NO_LLONG_MAX)
3634 # if !defined(LLONG_MAX) && defined(__GNUC__) && defined (__LONG_LONG_MAX__)
3635 #   define LLONG_MAX __LONG_LONG_MAX__
3636 #   define LLONG_MIN (-LLONG_MAX - 1LL)
3637 #   define ULLONG_MAX (LLONG_MAX * 2ULL + 1ULL)
3638 # endif
3639 #endif
3640 
3641 
3642 SWIGINTERN int
SWIG_AsVal_double(PyObject * obj,double * val)3643 SWIG_AsVal_double (PyObject *obj, double *val)
3644 {
3645   int res = SWIG_TypeError;
3646   if (PyFloat_Check(obj)) {
3647     if (val) *val = PyFloat_AsDouble(obj);
3648     return SWIG_OK;
3649 #if PY_VERSION_HEX < 0x03000000
3650   } else if (PyInt_Check(obj)) {
3651     if (val) *val = (double) PyInt_AsLong(obj);
3652     return SWIG_OK;
3653 #endif
3654   } else if (PyLong_Check(obj)) {
3655     double v = PyLong_AsDouble(obj);
3656     if (!PyErr_Occurred()) {
3657       if (val) *val = v;
3658       return SWIG_OK;
3659     } else {
3660       PyErr_Clear();
3661     }
3662   }
3663 #ifdef SWIG_PYTHON_CAST_MODE
3664   {
3665     int dispatch = 0;
3666     double d = PyFloat_AsDouble(obj);
3667     if (!PyErr_Occurred()) {
3668       if (val) *val = d;
3669       return SWIG_AddCast(SWIG_OK);
3670     } else {
3671       PyErr_Clear();
3672     }
3673     if (!dispatch) {
3674       long v = PyLong_AsLong(obj);
3675       if (!PyErr_Occurred()) {
3676 	if (val) *val = v;
3677 	return SWIG_AddCast(SWIG_AddCast(SWIG_OK));
3678       } else {
3679 	PyErr_Clear();
3680       }
3681     }
3682   }
3683 #endif
3684   return res;
3685 }
3686 
3687 
3688 #include <float.h>
3689 
3690 
3691 #include <math.h>
3692 
3693 
3694 SWIGINTERNINLINE int
SWIG_CanCastAsInteger(double * d,double min,double max)3695 SWIG_CanCastAsInteger(double *d, double min, double max) {
3696   double x = *d;
3697   if ((min <= x && x <= max)) {
3698    double fx = floor(x);
3699    double cx = ceil(x);
3700    double rd =  ((x - fx) < 0.5) ? fx : cx; /* simple rint */
3701    if ((errno == EDOM) || (errno == ERANGE)) {
3702      errno = 0;
3703    } else {
3704      double summ, reps, diff;
3705      if (rd < x) {
3706        diff = x - rd;
3707      } else if (rd > x) {
3708        diff = rd - x;
3709      } else {
3710        return 1;
3711      }
3712      summ = rd + x;
3713      reps = diff/summ;
3714      if (reps < 8*DBL_EPSILON) {
3715        *d = rd;
3716        return 1;
3717      }
3718    }
3719   }
3720   return 0;
3721 }
3722 
3723 
3724 SWIGINTERN int
SWIG_AsVal_long(PyObject * obj,long * val)3725 SWIG_AsVal_long (PyObject *obj, long* val)
3726 {
3727 #if PY_VERSION_HEX < 0x03000000
3728   if (PyInt_Check(obj)) {
3729     if (val) *val = PyInt_AsLong(obj);
3730     return SWIG_OK;
3731   } else
3732 #endif
3733   if (PyLong_Check(obj)) {
3734     long v = PyLong_AsLong(obj);
3735     if (!PyErr_Occurred()) {
3736       if (val) *val = v;
3737       return SWIG_OK;
3738     } else {
3739       PyErr_Clear();
3740       return SWIG_OverflowError;
3741     }
3742   }
3743 #ifdef SWIG_PYTHON_CAST_MODE
3744   {
3745     int dispatch = 0;
3746     long v = PyInt_AsLong(obj);
3747     if (!PyErr_Occurred()) {
3748       if (val) *val = v;
3749       return SWIG_AddCast(SWIG_OK);
3750     } else {
3751       PyErr_Clear();
3752     }
3753     if (!dispatch) {
3754       double d;
3755       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
3756       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, LONG_MIN, LONG_MAX)) {
3757 	if (val) *val = (long)(d);
3758 	return res;
3759       }
3760     }
3761   }
3762 #endif
3763   return SWIG_TypeError;
3764 }
3765 
3766 
3767 SWIGINTERN int
SWIG_AsVal_int(PyObject * obj,int * val)3768 SWIG_AsVal_int (PyObject * obj, int *val)
3769 {
3770   long v;
3771   int res = SWIG_AsVal_long (obj, &v);
3772   if (SWIG_IsOK(res)) {
3773     if ((v < INT_MIN || v > INT_MAX)) {
3774       return SWIG_OverflowError;
3775     } else {
3776       if (val) *val = (int)(v);
3777     }
3778   }
3779   return res;
3780 }
3781 
3782 
3783 SWIGINTERN int
SWIG_AsCharPtrAndSize(PyObject * obj,char ** cptr,size_t * psize,int * alloc)3784 SWIG_AsCharPtrAndSize(PyObject *obj, char** cptr, size_t* psize, int *alloc)
3785 {
3786 #if PY_VERSION_HEX>=0x03000000
3787 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3788   if (PyBytes_Check(obj))
3789 #else
3790   if (PyUnicode_Check(obj))
3791 #endif
3792 #else
3793   if (PyString_Check(obj))
3794 #endif
3795   {
3796     char *cstr; Py_ssize_t len;
3797     int ret = SWIG_OK;
3798 #if PY_VERSION_HEX>=0x03000000
3799 #if !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3800     if (!alloc && cptr) {
3801         /* We can't allow converting without allocation, since the internal
3802            representation of string in Python 3 is UCS-2/UCS-4 but we require
3803            a UTF-8 representation.
3804            TODO(bhy) More detailed explanation */
3805         return SWIG_RuntimeError;
3806     }
3807     obj = PyUnicode_AsUTF8String(obj);
3808     if (!obj)
3809       return SWIG_TypeError;
3810     if (alloc)
3811       *alloc = SWIG_NEWOBJ;
3812 #endif
3813     if (PyBytes_AsStringAndSize(obj, &cstr, &len) == -1)
3814       return SWIG_TypeError;
3815 #else
3816     if (PyString_AsStringAndSize(obj, &cstr, &len) == -1)
3817       return SWIG_TypeError;
3818 #endif
3819     if (cptr) {
3820       if (alloc) {
3821 	if (*alloc == SWIG_NEWOBJ) {
3822 	  *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
3823 	  *alloc = SWIG_NEWOBJ;
3824 	} else {
3825 	  *cptr = cstr;
3826 	  *alloc = SWIG_OLDOBJ;
3827 	}
3828       } else {
3829 #if PY_VERSION_HEX>=0x03000000
3830 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3831 	*cptr = PyBytes_AsString(obj);
3832 #else
3833 	assert(0); /* Should never reach here with Unicode strings in Python 3 */
3834 #endif
3835 #else
3836 	*cptr = SWIG_Python_str_AsChar(obj);
3837         if (!*cptr)
3838           ret = SWIG_TypeError;
3839 #endif
3840       }
3841     }
3842     if (psize) *psize = len + 1;
3843 #if PY_VERSION_HEX>=0x03000000 && !defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3844     Py_XDECREF(obj);
3845 #endif
3846     return ret;
3847   } else {
3848 #if defined(SWIG_PYTHON_2_UNICODE)
3849 #if defined(SWIG_PYTHON_STRICT_BYTE_CHAR)
3850 #error "Cannot use both SWIG_PYTHON_2_UNICODE and SWIG_PYTHON_STRICT_BYTE_CHAR at once"
3851 #endif
3852 #if PY_VERSION_HEX<0x03000000
3853     if (PyUnicode_Check(obj)) {
3854       char *cstr; Py_ssize_t len;
3855       if (!alloc && cptr) {
3856         return SWIG_RuntimeError;
3857       }
3858       obj = PyUnicode_AsUTF8String(obj);
3859       if (!obj)
3860         return SWIG_TypeError;
3861       if (PyString_AsStringAndSize(obj, &cstr, &len) != -1) {
3862         if (cptr) {
3863           if (alloc) *alloc = SWIG_NEWOBJ;
3864           *cptr = (char *)memcpy(malloc((len + 1)*sizeof(char)), cstr, sizeof(char)*(len + 1));
3865         }
3866         if (psize) *psize = len + 1;
3867 
3868         Py_XDECREF(obj);
3869         return SWIG_OK;
3870       } else {
3871         Py_XDECREF(obj);
3872       }
3873     }
3874 #endif
3875 #endif
3876 
3877     swig_type_info* pchar_descriptor = SWIG_pchar_descriptor();
3878     if (pchar_descriptor) {
3879       void* vptr = 0;
3880       if (SWIG_ConvertPtr(obj, &vptr, pchar_descriptor, 0) == SWIG_OK) {
3881 	if (cptr) *cptr = (char *) vptr;
3882 	if (psize) *psize = vptr ? (strlen((char *)vptr) + 1) : 0;
3883 	if (alloc) *alloc = SWIG_OLDOBJ;
3884 	return SWIG_OK;
3885       }
3886     }
3887   }
3888   return SWIG_TypeError;
3889 }
3890 
3891 
3892 
3893 
3894 
3895 #include <pythread.h>
3896 #include <openssl/crypto.h>
3897 
3898 #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
3899 #define CRYPTO_num_locks()      (CRYPTO_NUM_LOCKS)
3900 static PyThread_type_lock lock_cs[CRYPTO_num_locks()];
3901 static long lock_count[CRYPTO_num_locks()];
3902 static int thread_mode = 0;
3903 #endif
3904 
threading_locking_callback(int mode,int type,const char * file,int line)3905 void threading_locking_callback(int mode, int type, const char *file, int line) {
3906 #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
3907         if (mode & CRYPTO_LOCK) {
3908                 PyThread_acquire_lock(lock_cs[type], WAIT_LOCK);
3909                 lock_count[type]++;
3910         } else {
3911                 PyThread_release_lock(lock_cs[type]);
3912                 lock_count[type]--;
3913         }
3914 #endif
3915 }
3916 
threading_id_callback(void)3917 unsigned long threading_id_callback(void) {
3918 #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
3919     return (unsigned long)PyThread_get_thread_ident();
3920 #else
3921     return (unsigned long)0;
3922 #endif
3923 }
3924 
3925 
threading_init(void)3926 void threading_init(void) {
3927 #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
3928     int i;
3929     if (!thread_mode) {
3930         for (i=0; i<CRYPTO_num_locks(); i++) {
3931             lock_count[i]=0;
3932             lock_cs[i]=PyThread_allocate_lock();
3933         }
3934         CRYPTO_set_id_callback(threading_id_callback);
3935         CRYPTO_set_locking_callback(threading_locking_callback);
3936     }
3937     thread_mode = 1;
3938 #endif
3939 }
3940 
threading_cleanup(void)3941 void threading_cleanup(void) {
3942 #if defined(THREADING) && OPENSSL_VERSION_NUMBER < 0x10100000L
3943     int i;
3944     if (thread_mode) {
3945         CRYPTO_set_locking_callback(NULL);
3946         for (i=0; i<CRYPTO_num_locks(); i++) {
3947             lock_count[i]=0;
3948             PyThread_release_lock(lock_cs[i]);
3949             PyThread_free_lock(lock_cs[i]);
3950         }
3951     }
3952     thread_mode = 0;
3953 #endif
3954 }
3955 
3956 
3957 #include <openssl/bn.h>
3958 #include <openssl/dh.h>
3959 #include <openssl/err.h>
3960 #include <openssl/evp.h>
3961 #include <openssl/rsa.h>
3962 #include <openssl/ssl.h>
3963 #include <openssl/x509.h>
3964 #include <openssl/x509_vfy.h>
3965 #include <ceval.h>
3966 
3967 
3968 #if OPENSSL_VERSION_NUMBER < 0x10100000L
3969 
3970 #include <string.h>
3971 #include <openssl/engine.h>
3972 
3973 # define OPENSSL_zalloc(num) \
3974         CRYPTO_zalloc(num, __FILE__, __LINE__)
3975 
CRYPTO_zalloc(size_t num,const char * file,int line)3976 static void *CRYPTO_zalloc(size_t num, const char *file, int line)
3977 {
3978       void *ret = CRYPTO_malloc(num, file, line);
3979       if (ret != NULL)
3980               memset(ret, 0, num);
3981       return ret;
3982 }
3983 
3984 #include <openssl/bn.h>
3985 
3986 #ifndef BN_F_BN_GENCB_NEW
3987 # define BN_F_BN_GENCB_NEW       143
3988 #endif
3989 
3990 # define BN_GENCB_get_arg(gencb) ((gencb)->arg)
3991 
BN_GENCB_new(void)3992 BN_GENCB *BN_GENCB_new(void)
3993 {
3994     BN_GENCB *ret;
3995 
3996     if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL) {
3997         BNerr(BN_F_BN_GENCB_NEW, ERR_R_MALLOC_FAILURE);
3998         return (NULL);
3999     }
4000 
4001     return ret;
4002 }
4003 
BN_GENCB_free(BN_GENCB * cb)4004 void BN_GENCB_free(BN_GENCB *cb)
4005 {
4006     if (cb == NULL)
4007         return;
4008     OPENSSL_free(cb);
4009 }
4010 
4011 
RSA_set0_key(RSA * r,BIGNUM * n,BIGNUM * e,BIGNUM * d)4012 int RSA_set0_key(RSA *r, BIGNUM *n, BIGNUM *e, BIGNUM *d)
4013 {
4014     /* If the fields n and e in r are NULL, the corresponding input
4015      * parameters MUST be non-NULL for n and e.  d may be
4016      * left NULL (in case only the public key is used).
4017      */
4018     if ((r->n == NULL && n == NULL)
4019         || (r->e == NULL && e == NULL))
4020         return 0;
4021 
4022     if (n != NULL) {
4023         BN_free(r->n);
4024         r->n = n;
4025     }
4026     if (e != NULL) {
4027         BN_free(r->e);
4028         r->e = e;
4029     }
4030     if (d != NULL) {
4031         BN_free(r->d);
4032         r->d = d;
4033     }
4034 
4035     return 1;
4036 }
4037 
RSA_set0_factors(RSA * r,BIGNUM * p,BIGNUM * q)4038 int RSA_set0_factors(RSA *r, BIGNUM *p, BIGNUM *q)
4039 {
4040     /* If the fields p and q in r are NULL, the corresponding input
4041      * parameters MUST be non-NULL.
4042      */
4043     if ((r->p == NULL && p == NULL)
4044         || (r->q == NULL && q == NULL))
4045         return 0;
4046 
4047     if (p != NULL) {
4048         BN_free(r->p);
4049         r->p = p;
4050     }
4051     if (q != NULL) {
4052         BN_free(r->q);
4053         r->q = q;
4054     }
4055 
4056     return 1;
4057 }
4058 
RSA_set0_crt_params(RSA * r,BIGNUM * dmp1,BIGNUM * dmq1,BIGNUM * iqmp)4059 int RSA_set0_crt_params(RSA *r, BIGNUM *dmp1, BIGNUM *dmq1, BIGNUM *iqmp)
4060 {
4061     /* If the fields dmp1, dmq1 and iqmp in r are NULL, the corresponding input
4062      * parameters MUST be non-NULL.
4063      */
4064     if ((r->dmp1 == NULL && dmp1 == NULL)
4065         || (r->dmq1 == NULL && dmq1 == NULL)
4066         || (r->iqmp == NULL && iqmp == NULL))
4067         return 0;
4068 
4069     if (dmp1 != NULL) {
4070         BN_free(r->dmp1);
4071         r->dmp1 = dmp1;
4072     }
4073     if (dmq1 != NULL) {
4074         BN_free(r->dmq1);
4075         r->dmq1 = dmq1;
4076     }
4077     if (iqmp != NULL) {
4078         BN_free(r->iqmp);
4079         r->iqmp = iqmp;
4080     }
4081 
4082     return 1;
4083 }
4084 
RSA_get0_key(const RSA * r,const BIGNUM ** n,const BIGNUM ** e,const BIGNUM ** d)4085 void RSA_get0_key(const RSA *r,
4086                   const BIGNUM **n, const BIGNUM **e, const BIGNUM **d)
4087 {
4088     if (n != NULL)
4089         *n = r->n;
4090     if (e != NULL)
4091         *e = r->e;
4092     if (d != NULL)
4093         *d = r->d;
4094 }
4095 
RSA_get0_factors(const RSA * r,const BIGNUM ** p,const BIGNUM ** q)4096 void RSA_get0_factors(const RSA *r, const BIGNUM **p, const BIGNUM **q)
4097 {
4098     if (p != NULL)
4099         *p = r->p;
4100     if (q != NULL)
4101         *q = r->q;
4102 }
4103 
RSA_get0_crt_params(const RSA * r,const BIGNUM ** dmp1,const BIGNUM ** dmq1,const BIGNUM ** iqmp)4104 void RSA_get0_crt_params(const RSA *r,
4105                          const BIGNUM **dmp1, const BIGNUM **dmq1,
4106                          const BIGNUM **iqmp)
4107 {
4108     if (dmp1 != NULL)
4109         *dmp1 = r->dmp1;
4110     if (dmq1 != NULL)
4111         *dmq1 = r->dmq1;
4112     if (iqmp != NULL)
4113         *iqmp = r->iqmp;
4114 }
4115 
DSA_get0_pqg(const DSA * d,const BIGNUM ** p,const BIGNUM ** q,const BIGNUM ** g)4116 void DSA_get0_pqg(const DSA *d,
4117                   const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
4118 {
4119     if (p != NULL)
4120         *p = d->p;
4121     if (q != NULL)
4122         *q = d->q;
4123     if (g != NULL)
4124         *g = d->g;
4125 }
4126 
DSA_set0_pqg(DSA * d,BIGNUM * p,BIGNUM * q,BIGNUM * g)4127 int DSA_set0_pqg(DSA *d, BIGNUM *p, BIGNUM *q, BIGNUM *g)
4128 {
4129     /* If the fields p, q and g in d are NULL, the corresponding input
4130      * parameters MUST be non-NULL.
4131      */
4132     if ((d->p == NULL && p == NULL)
4133         || (d->q == NULL && q == NULL)
4134         || (d->g == NULL && g == NULL))
4135         return 0;
4136 
4137     if (p != NULL) {
4138         BN_free(d->p);
4139         d->p = p;
4140     }
4141     if (q != NULL) {
4142         BN_free(d->q);
4143         d->q = q;
4144     }
4145     if (g != NULL) {
4146         BN_free(d->g);
4147         d->g = g;
4148     }
4149 
4150     return 1;
4151 }
4152 
DSA_get0_key(const DSA * d,const BIGNUM ** pub_key,const BIGNUM ** priv_key)4153 void DSA_get0_key(const DSA *d,
4154                   const BIGNUM **pub_key, const BIGNUM **priv_key)
4155 {
4156     if (pub_key != NULL)
4157         *pub_key = d->pub_key;
4158     if (priv_key != NULL)
4159         *priv_key = d->priv_key;
4160 }
4161 
DSA_set0_key(DSA * d,BIGNUM * pub_key,BIGNUM * priv_key)4162 int DSA_set0_key(DSA *d, BIGNUM *pub_key, BIGNUM *priv_key)
4163 {
4164     /* If the field pub_key in d is NULL, the corresponding input
4165      * parameters MUST be non-NULL.  The priv_key field may
4166      * be left NULL.
4167      */
4168     if (d->pub_key == NULL && pub_key == NULL)
4169         return 0;
4170 
4171     if (pub_key != NULL) {
4172         BN_free(d->pub_key);
4173         d->pub_key = pub_key;
4174     }
4175     if (priv_key != NULL) {
4176         BN_free(d->priv_key);
4177         d->priv_key = priv_key;
4178     }
4179 
4180     return 1;
4181 }
4182 
DSA_SIG_get0(const DSA_SIG * sig,const BIGNUM ** pr,const BIGNUM ** ps)4183 void DSA_SIG_get0(const DSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
4184 {
4185     if (pr != NULL)
4186         *pr = sig->r;
4187     if (ps != NULL)
4188         *ps = sig->s;
4189 }
4190 
DSA_SIG_set0(DSA_SIG * sig,BIGNUM * r,BIGNUM * s)4191 int DSA_SIG_set0(DSA_SIG *sig, BIGNUM *r, BIGNUM *s)
4192 {
4193     if (r == NULL || s == NULL)
4194         return 0;
4195     BN_clear_free(sig->r);
4196     BN_clear_free(sig->s);
4197     sig->r = r;
4198     sig->s = s;
4199     return 1;
4200 }
4201 
ECDSA_SIG_get0(const ECDSA_SIG * sig,const BIGNUM ** pr,const BIGNUM ** ps)4202 void ECDSA_SIG_get0(const ECDSA_SIG *sig, const BIGNUM **pr, const BIGNUM **ps)
4203 {
4204     if (pr != NULL)
4205         *pr = sig->r;
4206     if (ps != NULL)
4207         *ps = sig->s;
4208 }
4209 
ECDSA_SIG_set0(ECDSA_SIG * sig,BIGNUM * r,BIGNUM * s)4210 int ECDSA_SIG_set0(ECDSA_SIG *sig, BIGNUM *r, BIGNUM *s)
4211 {
4212     if (r == NULL || s == NULL)
4213         return 0;
4214     BN_clear_free(sig->r);
4215     BN_clear_free(sig->s);
4216     sig->r = r;
4217     sig->s = s;
4218     return 1;
4219 }
4220 
DH_get0_pqg(const DH * dh,const BIGNUM ** p,const BIGNUM ** q,const BIGNUM ** g)4221 void DH_get0_pqg(const DH *dh,
4222                  const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
4223 {
4224     if (p != NULL)
4225         *p = dh->p;
4226     if (q != NULL)
4227         *q = dh->q;
4228     if (g != NULL)
4229         *g = dh->g;
4230 }
4231 
DH_set0_pqg(DH * dh,BIGNUM * p,BIGNUM * q,BIGNUM * g)4232 int DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g)
4233 {
4234     /* If the fields p and g in d are NULL, the corresponding input
4235      * parameters MUST be non-NULL.  q may remain NULL.
4236      */
4237     if ((dh->p == NULL && p == NULL)
4238         || (dh->g == NULL && g == NULL))
4239         return 0;
4240 
4241     if (p != NULL) {
4242         BN_free(dh->p);
4243         dh->p = p;
4244     }
4245     if (q != NULL) {
4246         BN_free(dh->q);
4247         dh->q = q;
4248     }
4249     if (g != NULL) {
4250         BN_free(dh->g);
4251         dh->g = g;
4252     }
4253 
4254     if (q != NULL) {
4255         dh->length = BN_num_bits(q);
4256     }
4257 
4258     return 1;
4259 }
4260 
DH_get0_key(const DH * dh,const BIGNUM ** pub_key,const BIGNUM ** priv_key)4261 void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)
4262 {
4263     if (pub_key != NULL)
4264         *pub_key = dh->pub_key;
4265     if (priv_key != NULL)
4266         *priv_key = dh->priv_key;
4267 }
4268 
DH_set0_key(DH * dh,BIGNUM * pub_key,BIGNUM * priv_key)4269 int DH_set0_key(DH *dh, BIGNUM *pub_key, BIGNUM *priv_key)
4270 {
4271     /* If the field pub_key in dh is NULL, the corresponding input
4272      * parameters MUST be non-NULL.  The priv_key field may
4273      * be left NULL.
4274      */
4275     if (dh->pub_key == NULL && pub_key == NULL)
4276         return 0;
4277 
4278     if (pub_key != NULL) {
4279         BN_free(dh->pub_key);
4280         dh->pub_key = pub_key;
4281     }
4282     if (priv_key != NULL) {
4283         BN_free(dh->priv_key);
4284         dh->priv_key = priv_key;
4285     }
4286 
4287     return 1;
4288 }
4289 
DH_set_length(DH * dh,long length)4290 int DH_set_length(DH *dh, long length)
4291 {
4292     dh->length = length;
4293     return 1;
4294 }
4295 
EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX * ctx)4296 const unsigned char *EVP_CIPHER_CTX_iv(const EVP_CIPHER_CTX *ctx)
4297 {
4298     return ctx->iv;
4299 }
4300 
EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX * ctx)4301 unsigned char *EVP_CIPHER_CTX_iv_noconst(EVP_CIPHER_CTX *ctx)
4302 {
4303     return ctx->iv;
4304 }
4305 
EVP_MD_CTX_new(void)4306 EVP_MD_CTX *EVP_MD_CTX_new(void)
4307 {
4308     return OPENSSL_zalloc(sizeof(EVP_MD_CTX));
4309 }
4310 
EVP_MD_CTX_free(EVP_MD_CTX * ctx)4311 void EVP_MD_CTX_free(EVP_MD_CTX *ctx)
4312 {
4313     EVP_MD_CTX_cleanup(ctx);
4314     OPENSSL_free(ctx);
4315 }
4316 
RSA_size(const RSA * rsa)4317 int RSA_size(const RSA* rsa) {
4318     /* BIGNUM* n = NULL;
4319     RSA_get0_key(rsa, n, NULL, NULL); */
4320     return BN_num_bytes(rsa->n);
4321 }
4322 
RSA_meth_dup(const RSA_METHOD * meth)4323 RSA_METHOD *RSA_meth_dup(const RSA_METHOD *meth)
4324 {
4325     RSA_METHOD *ret;
4326 
4327     ret = OPENSSL_malloc(sizeof(RSA_METHOD));
4328 
4329     if (ret != NULL) {
4330         memcpy(ret, meth, sizeof(*meth));
4331         ret->name = OPENSSL_strdup(meth->name);
4332         if (ret->name == NULL) {
4333             OPENSSL_free(ret);
4334             return NULL;
4335         }
4336     }
4337 
4338     return ret;
4339 }
4340 
RSA_meth_set1_name(RSA_METHOD * meth,const char * name)4341 int RSA_meth_set1_name(RSA_METHOD *meth, const char *name)
4342 {
4343     char *tmpname;
4344 
4345     tmpname = OPENSSL_strdup(name);
4346     if (tmpname == NULL) {
4347         return 0;
4348     }
4349 
4350     OPENSSL_free((char *)meth->name);
4351     meth->name = tmpname;
4352 
4353     return 1;
4354 }
4355 
RSA_meth_set_priv_enc(RSA_METHOD * meth,int (* priv_enc)(int flen,const unsigned char * from,unsigned char * to,RSA * rsa,int padding))4356 int RSA_meth_set_priv_enc(RSA_METHOD *meth,
4357                           int (*priv_enc) (int flen, const unsigned char *from,
4358                                            unsigned char *to, RSA *rsa,
4359                                            int padding))
4360 {
4361     meth->rsa_priv_enc = priv_enc;
4362     return 1;
4363 }
4364 
RSA_meth_set_priv_dec(RSA_METHOD * meth,int (* priv_dec)(int flen,const unsigned char * from,unsigned char * to,RSA * rsa,int padding))4365 int RSA_meth_set_priv_dec(RSA_METHOD *meth,
4366                           int (*priv_dec) (int flen, const unsigned char *from,
4367                                            unsigned char *to, RSA *rsa,
4368                                            int padding))
4369 {
4370     meth->rsa_priv_dec = priv_dec;
4371     return 1;
4372 }
4373 
RSA_meth_set_finish(RSA_METHOD * meth,int (* finish)(RSA * rsa))4374 int RSA_meth_set_finish(RSA_METHOD *meth, int (*finish) (RSA *rsa))
4375 {
4376     meth->finish = finish;
4377     return 1;
4378 }
4379 
RSA_meth_free(RSA_METHOD * meth)4380 void RSA_meth_free(RSA_METHOD *meth)
4381 {
4382     if (meth != NULL) {
4383         OPENSSL_free((char *)meth->name);
4384         OPENSSL_free(meth);
4385     }
4386 }
4387 
RSA_bits(const RSA * r)4388 int RSA_bits(const RSA *r)
4389 {
4390     return (BN_num_bits(r->n));
4391 }
4392 
EVP_PKEY_get0_RSA(EVP_PKEY * pkey)4393 RSA *EVP_PKEY_get0_RSA(EVP_PKEY *pkey)
4394 {
4395     if (pkey->type != EVP_PKEY_RSA) {
4396         return NULL;
4397     }
4398     return pkey->pkey.rsa;
4399 }
4400 
X509_NAME_get0_der(X509_NAME * nm,const unsigned char ** pder,size_t * pderlen)4401 int X509_NAME_get0_der(X509_NAME *nm, const unsigned char **pder,
4402                        size_t *pderlen)
4403 {
4404     /* Make sure encoding is valid */
4405     if (i2d_X509_NAME(nm, NULL) <= 0)
4406         return 0;
4407     if (pder != NULL)
4408         *pder = (unsigned char *)nm->bytes->data;
4409     if (pderlen != NULL)
4410         *pderlen = nm->bytes->length;
4411     return 1;
4412 }
4413 
4414 #endif /* OPENSSL_VERSION_NUMBER */
4415 
4416 
4417 #if PY_MAJOR_VERSION >= 3
4418 
PyFile_AsFile(PyObject * pyfile)4419 FILE* PyFile_AsFile(PyObject *pyfile) {
4420     FILE* fp;
4421     int fd;
4422     const char *mode_str = NULL;
4423     PyObject *mode_obj;
4424 
4425     if ((fd = PyObject_AsFileDescriptor(pyfile)) == -1) {
4426         PyErr_SetString(PyExc_BlockingIOError,
4427                         "Cannot find file handler for the Python file!");
4428         return NULL;
4429     }
4430 
4431     if ((mode_obj = PyObject_GetAttrString(pyfile, "mode")) == NULL) {
4432         mode_str = "rb";
4433         PyErr_Clear();
4434     }
4435     else {
4436         /* convert to plain string
4437          * note that error checking is embedded in the function
4438          */
4439         mode_str = PyUnicode_AsUTF8AndSize(mode_obj, NULL);
4440     }
4441 
4442     if((fp = fdopen(fd, mode_str)) == NULL) {
4443          PyErr_SetFromErrno(PyExc_IOError);
4444     }
4445 
4446     Py_XDECREF(mode_obj);
4447     return fp;
4448 }
4449 
4450 #else /* PY2K */
4451 
4452 #define PyLong_FromLong(x) PyInt_FromLong(x)
4453 #define PyUnicode_AsUTF8(x) PyString_AsString(x)
4454 #define PyUnicode_FromString(x) PyString_FromString(x)
4455 #define PyUnicode_Format(x, y) PyString_Format(x, y)
4456 
4457 #endif /* PY_MAJOR_VERSION */
4458 
4459 
4460 /* OpenSSL 1.0.2 copmatbility shim */
4461 #if OPENSSL_VERSION_NUMBER < 0x10002000L
4462 typedef void (*OPENSSL_sk_freefunc)(void *);
4463 typedef void *(*OPENSSL_sk_copyfunc)(const void *);
4464 typedef struct stack_st OPENSSL_STACK;
4465 
4466 # define MIN_NODES       4
4467 # define sk_deep_copy OPENSSL_sk_deep_copy
4468 
OPENSSL_sk_free(OPENSSL_STACK * st)4469 void OPENSSL_sk_free(OPENSSL_STACK *st)
4470 {
4471     if (st == NULL)
4472         return;
4473     OPENSSL_free(st->data);
4474     OPENSSL_free(st);
4475 }
4476 
OPENSSL_sk_deep_copy(const OPENSSL_STACK * sk,OPENSSL_sk_copyfunc copy_func,OPENSSL_sk_freefunc free_func)4477 OPENSSL_STACK *OPENSSL_sk_deep_copy(const OPENSSL_STACK *sk,
4478                              OPENSSL_sk_copyfunc copy_func,
4479                              OPENSSL_sk_freefunc free_func)
4480 {
4481     OPENSSL_STACK *ret;
4482     int i;
4483 
4484     if (sk->num < 0)
4485         return NULL;
4486 
4487     if ((ret = OPENSSL_malloc(sizeof(*ret))) == NULL)
4488         return NULL;
4489 
4490     /* direct structure assignment */
4491     *ret = *sk;
4492 
4493     ret->num_alloc = sk->num > MIN_NODES ? (size_t)sk->num : MIN_NODES;
4494     ret->data = OPENSSL_zalloc(sizeof(*ret->data) * ret->num_alloc);
4495     if (ret->data == NULL) {
4496         OPENSSL_free(ret);
4497         return NULL;
4498     }
4499 
4500     for (i = 0; i < ret->num; ++i) {
4501         if (sk->data[i] == NULL)
4502             continue;
4503         if ((ret->data[i] = copy_func(sk->data[i])) == NULL) {
4504             while (--i >= 0)
4505                 if (ret->data[i] != NULL)
4506                     free_func((void *)ret->data[i]);
4507             OPENSSL_sk_free(ret);
4508             return NULL;
4509         }
4510     }
4511     return ret;
4512 }
4513 #endif /* OpenSSL 1.0.2 copmatbility shim */
4514 
4515 
4516 /* Blob interface. Deprecated. */
4517 
blob_new(int len,const char * errmsg)4518 Blob *blob_new(int len, const char *errmsg) {
4519 
4520     Blob *blob;
4521     if (!(blob=(Blob *)PyMem_Malloc(sizeof(Blob)))){
4522         PyErr_SetString(PyExc_MemoryError, errmsg);
4523         return NULL;
4524     }
4525     if (!(blob->data=(unsigned char *)PyMem_Malloc(len))) {
4526         PyMem_Free(blob);
4527         PyErr_SetString(PyExc_MemoryError, errmsg);
4528         return NULL;
4529     }
4530     blob->len=len;
4531     return blob;
4532 }
4533 
blob_copy(Blob * from,const char * errmsg)4534 Blob *blob_copy(Blob *from, const char *errmsg) {
4535     Blob *blob=blob_new(from->len, errmsg);
4536     if (!blob) {
4537         PyErr_SetString(PyExc_MemoryError, errmsg);
4538         return NULL;
4539     }
4540     memcpy(blob->data, from->data, from->len);
4541     return blob;
4542 }
4543 
blob_free(Blob * blob)4544 void blob_free(Blob *blob) {
4545     PyMem_Free(blob->data);
4546     PyMem_Free(blob);
4547 }
4548 
4549 
4550 /* Python helpers. */
4551 
4552 
4553 
4554 
4555 static int
m2_PyObject_AsReadBuffer(PyObject * obj,const void ** buffer,Py_ssize_t * buffer_len)4556 m2_PyObject_AsReadBuffer(PyObject * obj, const void **buffer,
4557 			 Py_ssize_t * buffer_len)
4558 {
4559     Py_ssize_t len = 0;
4560     Py_buffer view;
4561 
4562     if (PyObject_CheckBuffer(obj)) {
4563 	if (PyObject_GetBuffer(obj, &view, PyBUF_SIMPLE) == 0) {
4564 	    *buffer = view.buf;
4565 	    len = view.len;
4566 	}
4567     } else {
4568     PyErr_SetString(PyExc_TypeError, "expected a readable buffer object");
4569 	return -1;
4570     }
4571     if (len > INT_MAX) {
4572 	m2_PyBuffer_Release(obj, &view);
4573 	PyErr_SetString(PyExc_ValueError, "object too large");
4574 	return -1;
4575     }
4576     *buffer_len = len;
4577     m2_PyBuffer_Release(obj, &view);
4578     return 0;
4579 }
4580 
4581 static int
m2_PyObject_AsReadBufferInt(PyObject * obj,const void ** buffer,int * buffer_len)4582 m2_PyObject_AsReadBufferInt(PyObject * obj, const void **buffer,
4583 			    int *buffer_len)
4584 {
4585     int ret = 0;
4586     Py_ssize_t len = 0;
4587 
4588     ret = m2_PyObject_AsReadBuffer(obj, buffer, &len);
4589     *buffer_len = len;
4590     return ret;
4591 }
4592 
4593 
4594 
m2_PyObject_GetBufferInt(PyObject * obj,Py_buffer * view,int flags)4595 static int m2_PyObject_GetBufferInt(PyObject *obj, Py_buffer *view, int flags)
4596 {
4597     int ret;
4598 
4599     if (PyObject_CheckBuffer(obj))
4600         ret = PyObject_GetBuffer(obj, view, flags);
4601     else {
4602         PyErr_SetString(PyExc_TypeError, "expected a readable buffer object");
4603         return -1;
4604     }
4605     if (ret)
4606         return ret;
4607     if (view->len > INT_MAX) {
4608         PyErr_SetString(PyExc_ValueError, "object too large");
4609         m2_PyBuffer_Release(obj, view);
4610         return -1;
4611     }
4612 
4613     return 0;
4614 }
4615 
4616 static BIGNUM*
m2_PyObject_AsBIGNUM(PyObject * value,PyObject * _py_exc)4617 m2_PyObject_AsBIGNUM(PyObject* value, PyObject* _py_exc)
4618 {
4619     BIGNUM* bn;
4620     const void* vbuf;
4621     int vlen = 0;
4622 
4623     if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
4624         return NULL;
4625 
4626     if (!(bn = BN_mpi2bn((unsigned char *)vbuf, vlen, NULL))) {
4627         PyErr_SetString(_py_exc, ERR_reason_error_string(ERR_get_error()));
4628         return NULL;
4629         }
4630 
4631     return bn;
4632 }
4633 
m2_PyBuffer_Release(PyObject * obj,Py_buffer * view)4634 static void m2_PyBuffer_Release(PyObject *obj, Py_buffer *view)
4635 {
4636     if (PyObject_CheckBuffer(obj))
4637         PyBuffer_Release(view);
4638     /* else do nothing, view->buf comes from PyObject_AsReadBuffer */
4639 }
4640 
4641 static int
m2_PyString_AsStringAndSizeInt(PyObject * obj,char ** s,int * len)4642 m2_PyString_AsStringAndSizeInt(PyObject *obj, char **s, int *len)
4643 {
4644     int ret;
4645     Py_ssize_t len2;
4646 
4647     ret = PyBytes_AsStringAndSize(obj, s, &len2);
4648 
4649     if (ret)
4650        return ret;
4651     if (len2 > INT_MAX) {
4652        PyErr_SetString(PyExc_ValueError, "string too large");
4653        return -1;
4654     }
4655     *len = len2;
4656     return 0;
4657 }
4658 
4659 /* Works as PyFile_Name, but always returns a new object. */
m2_PyFile_Name(PyObject * pyfile)4660 PyObject *m2_PyFile_Name(PyObject *pyfile) {
4661     PyObject *out = NULL;
4662 #if PY_MAJOR_VERSION >= 3
4663    out = PyObject_GetAttrString(pyfile, "name");
4664 #else
4665    out = PyFile_Name(pyfile);
4666    Py_XINCREF(out);
4667 #endif
4668     return out;
4669 }
4670 
4671 /* Yes, __FUNCTION__ is a non-standard symbol, but it is supported by
4672  * both gcc and MSVC. */
4673 #define m2_PyErr_Msg(type) m2_PyErr_Msg_Caller(type, (const char*) __FUNCTION__)
4674 
m2_PyErr_Msg_Caller(PyObject * err_type,const char * caller)4675 static void m2_PyErr_Msg_Caller(PyObject *err_type, const char* caller) {
4676     const char *err_reason;
4677     const char *data;
4678     int flags;
4679     /* This max size of a (longer than ours) OpenSSL error string is hardcoded
4680      * in OpenSSL's crypto/err/err_prn.c:ERR_print_errors_cb() */
4681     char err_msg[4096];
4682     unsigned long err_code = ERR_get_error_line_data(NULL, NULL, &data, &flags);
4683 
4684     if (err_code != 0) {
4685         err_reason = ERR_reason_error_string(err_code);
4686         if (data && (flags & ERR_TXT_STRING))
4687             snprintf(err_msg, sizeof(err_msg), "%s (%s)", err_reason, data);
4688         else
4689             snprintf(err_msg, sizeof(err_msg), "%s", err_reason);
4690 
4691         PyErr_SetString(err_type, err_msg);
4692     } else {
4693         PyErr_Format(err_type, "Unknown error in function %s.", caller);
4694     }
4695 }
4696 
4697 
4698 /* C callbacks invoked by OpenSSL; these in turn call back into
4699 Python. */
4700 
ssl_verify_callback(int ok,X509_STORE_CTX * ctx)4701 int ssl_verify_callback(int ok, X509_STORE_CTX *ctx) {
4702     PyObject *argv, *ret;
4703     PyObject *_x509_store_ctx_swigptr=0, *_x509_store_ctx_obj=0, *_x509_store_ctx_inst=0, *_klass=0;
4704     PyObject *_x509=0, *_ssl_ctx=0;
4705     SSL *ssl;
4706     SSL_CTX *ssl_ctx;
4707     X509 *x509;
4708     int errnum, errdepth;
4709     int cret;
4710     int new_style_callback = 0, warning_raised_exception=0;
4711     PyGILState_STATE gilstate;
4712     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
4713 
4714     ssl = (SSL *)X509_STORE_CTX_get_app_data(ctx);
4715 
4716     gilstate = PyGILState_Ensure();
4717 
4718     if (PyMethod_Check(ssl_verify_cb_func)) {
4719         PyObject *func;
4720         PyCodeObject *code;
4721         func = PyMethod_Function(ssl_verify_cb_func);
4722         code = (PyCodeObject *) PyFunction_GetCode(func);
4723         if (code && code->co_argcount == 3) { /* XXX Python internals */
4724             new_style_callback = 1;
4725         }
4726     } else if (PyFunction_Check(ssl_verify_cb_func)) {
4727         PyCodeObject *code = (PyCodeObject *) PyFunction_GetCode(ssl_verify_cb_func);
4728         if (code && code->co_argcount == 2) { /* XXX Python internals */
4729             new_style_callback = 1;
4730         }
4731     } else {
4732         /* XXX There are lots of other callable types, but we will assume
4733          * XXX that any other type of callable uses the new style callback,
4734          * XXX although this is not entirely safe assumption.
4735          */
4736         new_style_callback = 1;
4737     }
4738 
4739     if (new_style_callback) {
4740         PyObject *x509mod;
4741 
4742         x509mod = PyDict_GetItemString(PyImport_GetModuleDict(), "M2Crypto.X509");
4743         _klass = PyObject_GetAttrString(x509mod, "X509_Store_Context");
4744 
4745         _x509_store_ctx_swigptr = SWIG_NewPointerObj((void *)ctx, SWIGTYPE_p_X509_STORE_CTX, 0);
4746         _x509_store_ctx_obj = Py_BuildValue("(Oi)", _x509_store_ctx_swigptr, 0);
4747 
4748         _x509_store_ctx_inst = PyObject_CallObject(_klass, _x509_store_ctx_obj);
4749 
4750         argv = Py_BuildValue("(iO)", ok, _x509_store_ctx_inst);
4751     } else {
4752         if (PyErr_Warn(PyExc_DeprecationWarning, "Old style callback, use cb_func(ok, store) instead")) {
4753             warning_raised_exception = 1;
4754         }
4755 
4756         x509 = X509_STORE_CTX_get_current_cert(ctx);
4757         errnum = X509_STORE_CTX_get_error(ctx);
4758         errdepth = X509_STORE_CTX_get_error_depth(ctx);
4759 
4760         ssl = (SSL *)X509_STORE_CTX_get_ex_data(ctx, SSL_get_ex_data_X509_STORE_CTX_idx());
4761         ssl_ctx = SSL_get_SSL_CTX(ssl);
4762 
4763         _x509 = SWIG_NewPointerObj((void *)x509, SWIGTYPE_p_X509, 0);
4764         _ssl_ctx = SWIG_NewPointerObj((void *)ssl_ctx, SWIGTYPE_p_SSL_CTX, 0);
4765         argv = Py_BuildValue("(OOiii)", _ssl_ctx, _x509, errnum, errdepth, ok);
4766     }
4767 
4768     if (!warning_raised_exception) {
4769         ret = PyEval_CallObject(ssl_verify_cb_func, argv);
4770     } else {
4771         ret = 0;
4772     }
4773 
4774     if (!ret) {
4775         /* Got an exception in PyEval_CallObject(), let's fail verification
4776          * to be safe.
4777          */
4778         cret = 0;
4779     } else {
4780         /* FIXME This is possibly problematic if ret > MAXINT */
4781         cret = (int)PyLong_AsLong(ret);
4782     }
4783     Py_XDECREF(ret);
4784     Py_XDECREF(argv);
4785     if (new_style_callback) {
4786         Py_XDECREF(_x509_store_ctx_inst);
4787         Py_XDECREF(_x509_store_ctx_obj);
4788         Py_XDECREF(_x509_store_ctx_swigptr);
4789         Py_XDECREF(_klass);
4790     } else {
4791         Py_XDECREF(_x509);
4792         Py_XDECREF(_ssl_ctx);
4793     }
4794 
4795     PyGILState_Release(gilstate);
4796 
4797     return cret;
4798 }
4799 
x509_store_verify_callback(int ok,X509_STORE_CTX * ctx)4800 int x509_store_verify_callback(int ok, X509_STORE_CTX *ctx) {
4801     PyGILState_STATE gilstate;
4802     PyObject *argv, *ret;
4803     PyObject *_x509_store_ctx_swigptr=0, *_x509_store_ctx_obj=0, *_x509_store_ctx_inst=0, *_klass=0;
4804     int cret;
4805     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
4806     PyObject *x509mod;
4807 
4808 
4809     gilstate = PyGILState_Ensure();
4810 
4811     /* Below, handle only what is called 'new style callback' in ssl_verify_callback().
4812        TODO: does 'old style callback' exist any more? */
4813     x509mod = PyDict_GetItemString(PyImport_GetModuleDict(), "M2Crypto.X509");
4814     _klass = PyObject_GetAttrString(x509mod, "X509_Store_Context");
4815     _x509_store_ctx_swigptr = SWIG_NewPointerObj((void *)ctx, SWIGTYPE_p_X509_STORE_CTX, 0);
4816     _x509_store_ctx_obj = Py_BuildValue("(Oi)", _x509_store_ctx_swigptr, 0);
4817 
4818     _x509_store_ctx_inst = PyObject_CallObject(_klass, _x509_store_ctx_obj);
4819 
4820     argv = Py_BuildValue("(iO)", ok, _x509_store_ctx_inst);
4821 
4822     ret = PyEval_CallObject(x509_store_verify_cb_func, argv);
4823     if (!ret) {
4824         /* Got an exception in PyEval_CallObject(), let's fail verification
4825          * to be safe.
4826          */
4827         cret = 0;
4828     } else {
4829         cret = (int)PyInt_AsLong(ret);
4830     }
4831 
4832     Py_XDECREF(ret);
4833     Py_XDECREF(argv);
4834     Py_XDECREF(_x509_store_ctx_inst);
4835     Py_XDECREF(_x509_store_ctx_obj);
4836     Py_XDECREF(_x509_store_ctx_swigptr);
4837     Py_XDECREF(_klass);
4838 
4839     PyGILState_Release(gilstate);
4840     return cret;
4841 }
4842 
ssl_info_callback(const SSL * s,int where,int ret)4843 void ssl_info_callback(const SSL *s, int where, int ret) {
4844     PyObject *argv, *retval, *_SSL;
4845     PyGILState_STATE gilstate;
4846     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
4847 
4848     gilstate = PyGILState_Ensure();
4849 
4850     _SSL = SWIG_NewPointerObj((void *)s, SWIGTYPE_p_SSL, 0);
4851     argv = Py_BuildValue("(iiO)", where, ret, _SSL);
4852 
4853     retval = PyEval_CallObject(ssl_info_cb_func, argv);
4854 
4855     Py_XDECREF(retval);
4856     Py_XDECREF(argv);
4857     Py_XDECREF(_SSL);
4858 
4859     PyGILState_Release(gilstate);
4860 }
4861 
ssl_set_tmp_dh_callback(SSL * ssl,int is_export,int keylength)4862 DH *ssl_set_tmp_dh_callback(SSL *ssl, int is_export, int keylength) {
4863     PyObject *argv, *ret, *_ssl;
4864     DH *dh;
4865     PyGILState_STATE gilstate;
4866     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
4867 
4868     gilstate = PyGILState_Ensure();
4869 
4870     _ssl = SWIG_NewPointerObj((void *)ssl, SWIGTYPE_p_SSL, 0);
4871     argv = Py_BuildValue("(Oii)", _ssl, is_export, keylength);
4872 
4873     ret = PyEval_CallObject(ssl_set_tmp_dh_cb_func, argv);
4874 
4875     if ((SWIG_ConvertPtr(ret, (void **)&dh, SWIGTYPE_p_DH, SWIG_POINTER_EXCEPTION | 0)) == -1)
4876       dh = NULL;
4877     Py_XDECREF(ret);
4878     Py_XDECREF(argv);
4879     Py_XDECREF(_ssl);
4880 
4881     PyGILState_Release(gilstate);
4882 
4883     return dh;
4884 }
4885 
ssl_set_tmp_rsa_callback(SSL * ssl,int is_export,int keylength)4886 RSA *ssl_set_tmp_rsa_callback(SSL *ssl, int is_export, int keylength) {
4887     PyObject *argv, *ret, *_ssl;
4888     RSA *rsa;
4889     PyGILState_STATE gilstate;
4890     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
4891 
4892     gilstate = PyGILState_Ensure();
4893 
4894     _ssl = SWIG_NewPointerObj((void *)ssl, SWIGTYPE_p_SSL, 0);
4895     argv = Py_BuildValue("(Oii)", _ssl, is_export, keylength);
4896 
4897     ret = PyEval_CallObject(ssl_set_tmp_rsa_cb_func, argv);
4898 
4899     if ((SWIG_ConvertPtr(ret, (void **)&rsa, SWIGTYPE_p_RSA, SWIG_POINTER_EXCEPTION | 0)) == -1)
4900       rsa = NULL;
4901     Py_XDECREF(ret);
4902     Py_XDECREF(argv);
4903     Py_XDECREF(_ssl);
4904 
4905     PyGILState_Release(gilstate);
4906 
4907     return rsa;
4908 }
4909 
4910 /* Universal callback for dh_generate_parameters,
4911  * dsa_generate_parametersm, and rsa_generate_key */
bn_gencb_callback(int p,int n,BN_GENCB * gencb)4912 int bn_gencb_callback(int p, int n, BN_GENCB *gencb) {
4913     PyObject *argv, *ret, *cbfunc;
4914 
4915     cbfunc = (PyObject *)BN_GENCB_get_arg(gencb);
4916     argv = Py_BuildValue("(ii)", p, n);
4917     ret = PyEval_CallObject(cbfunc, argv);
4918     PyErr_Clear();
4919     Py_DECREF(argv);
4920     Py_XDECREF(ret);
4921     return 1;
4922 }
4923 
passphrase_callback(char * buf,int num,int v,void * arg)4924 int passphrase_callback(char *buf, int num, int v, void *arg) {
4925     int i;
4926     Py_ssize_t len;
4927     char *str;
4928     PyObject *argv, *ret, *cbfunc;
4929     PyGILState_STATE gilstate;
4930 
4931     gilstate = PyGILState_Ensure();
4932     cbfunc = (PyObject *)arg;
4933     argv = Py_BuildValue("(i)", v);
4934     /* PyEval_CallObject sets exception, if needed. */
4935     ret = PyEval_CallObject(cbfunc, argv);
4936     Py_DECREF(argv);
4937     if (ret == NULL) {
4938         PyGILState_Release(gilstate);
4939         return -1;
4940     }
4941 
4942     if (!PyBytes_Check(ret)) {
4943         PyErr_SetString(PyExc_RuntimeError,
4944                         "Result of callback is not bytes().");
4945         Py_DECREF(ret);
4946         PyGILState_Release(gilstate);
4947         return -1;
4948     }
4949     if ((len = PyBytes_Size(ret)) > num)
4950         len = num;
4951     str = PyBytes_AsString(ret);
4952 
4953     for (i = 0; i < len; i++)
4954         buf[i] = str[i];
4955     Py_DECREF(ret);
4956     PyGILState_Release(gilstate);
4957     return len;
4958 }
4959 
4960 
4961 
lib_init()4962 void lib_init() {
4963 #if OPENSSL_VERSION_NUMBER < 0x10100000L
4964     SSLeay_add_all_algorithms();
4965     ERR_load_ERR_strings();
4966 #endif
4967 }
4968 
4969 /* Bignum routines that aren't not numerous enough to
4970 warrant a separate file. */
4971 
bn_to_mpi(const BIGNUM * bn)4972 PyObject *bn_to_mpi(const BIGNUM *bn) {
4973     int len = 0;
4974     unsigned char *mpi;
4975     PyObject *pyo;
4976 
4977     len = BN_bn2mpi(bn, NULL);
4978     if (!(mpi=(unsigned char *)PyMem_Malloc(len))) {
4979         m2_PyErr_Msg(PyExc_MemoryError);
4980         return NULL;
4981     }
4982     len=BN_bn2mpi(bn, mpi);
4983 
4984     pyo=PyBytes_FromStringAndSize((const char *)mpi, len);
4985 
4986     PyMem_Free(mpi);
4987     return pyo;
4988 }
4989 
mpi_to_bn(PyObject * value)4990 const BIGNUM *mpi_to_bn(PyObject *value) {
4991     const void *vbuf;
4992     int vlen = 0;
4993 
4994     if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
4995         return NULL;
4996 
4997     return BN_mpi2bn(vbuf, vlen, NULL);
4998 }
4999 
bn_to_bin(BIGNUM * bn)5000 PyObject *bn_to_bin(BIGNUM *bn) {
5001     int len = 0;
5002     unsigned char *bin;
5003     PyObject *pyo;
5004 
5005     len = BN_num_bytes(bn);
5006     if (!(bin=(unsigned char *)PyMem_Malloc(len))) {
5007       PyErr_SetString(PyExc_MemoryError, "bn_to_bin");
5008       return NULL;
5009     }
5010     BN_bn2bin(bn, bin);
5011 
5012     pyo=PyBytes_FromStringAndSize((const char *)bin, len);
5013 
5014     PyMem_Free(bin);
5015     return pyo;
5016 }
5017 
bin_to_bn(PyObject * value)5018 const BIGNUM *bin_to_bn(PyObject *value) {
5019     const void *vbuf;
5020     int vlen = 0;
5021 
5022     if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
5023         return NULL;
5024 
5025     return BN_bin2bn(vbuf, vlen, NULL);
5026 }
5027 
bn_to_hex(BIGNUM * bn)5028 PyObject *bn_to_hex(BIGNUM *bn) {
5029     char *hex;
5030     PyObject *pyo;
5031     Py_ssize_t len = 0;
5032 
5033     hex = BN_bn2hex(bn);
5034     if (!hex) {
5035         m2_PyErr_Msg(PyExc_RuntimeError);
5036         OPENSSL_free(hex);
5037         return NULL;
5038     }
5039     len = strlen(hex);
5040 
5041     pyo=PyBytes_FromStringAndSize(hex, len);
5042 
5043     OPENSSL_free(hex);
5044     return pyo;
5045 }
5046 
hex_to_bn(PyObject * value)5047 BIGNUM *hex_to_bn(PyObject *value) {
5048     const void *vbuf;
5049     Py_ssize_t vlen = 0;
5050     BIGNUM *bn;
5051     Py_buffer view;
5052 
5053     if (PyObject_CheckBuffer(value)) {
5054         if (PyObject_GetBuffer(value, &view, PyBUF_SIMPLE) == 0) {
5055             vbuf = view.buf;
5056             vlen = view.len;
5057         }
5058     }
5059     else {
5060         if (m2_PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
5061             return NULL;
5062     }
5063 
5064     if ((bn=BN_new())==NULL) {
5065         m2_PyBuffer_Release(value, &view);
5066         PyErr_SetString(PyExc_MemoryError, "hex_to_bn");
5067         return NULL;
5068     }
5069     if (BN_hex2bn(&bn, (const char *)vbuf) <= 0) {
5070         m2_PyBuffer_Release(value, &view);
5071         m2_PyErr_Msg(PyExc_RuntimeError);
5072         BN_free(bn);
5073         return NULL;
5074     }
5075     m2_PyBuffer_Release(value, &view);
5076     return bn;
5077 }
5078 
dec_to_bn(PyObject * value)5079 BIGNUM *dec_to_bn(PyObject *value) {
5080     const void *vbuf;
5081     Py_ssize_t vlen = 0;
5082     BIGNUM *bn;
5083     Py_buffer view;
5084 
5085     if (PyObject_CheckBuffer(value)) {
5086         if (PyObject_GetBuffer(value, &view, PyBUF_SIMPLE) == 0) {
5087             vbuf = view.buf;
5088             vlen = view.len;
5089         }
5090     }
5091     else {
5092         if (m2_PyObject_AsReadBuffer(value, &vbuf, &vlen) == -1)
5093             return NULL;
5094     }
5095 
5096     if ((bn=BN_new())==NULL) {
5097       m2_PyBuffer_Release(value, &view);
5098       PyErr_SetString(PyExc_MemoryError, "dec_to_bn");
5099       return NULL;
5100     }
5101     if ((BN_dec2bn(&bn, (const char *)vbuf) <= 0)) {
5102       m2_PyBuffer_Release(value, &view);
5103       m2_PyErr_Msg(PyExc_RuntimeError);
5104       BN_free(bn);
5105       return NULL;
5106     }
5107     m2_PyBuffer_Release(value, &view);
5108     return bn;
5109 }
5110 
5111 
5112 SWIGINTERNINLINE PyObject*
SWIG_From_unsigned_SS_long(unsigned long value)5113 SWIG_From_unsigned_SS_long  (unsigned long value)
5114 {
5115   return (value > LONG_MAX) ?
5116     PyLong_FromUnsignedLong(value) : PyInt_FromLong((long)(value));
5117 }
5118 
5119 
5120 SWIGINTERN int
SWIG_AsVal_unsigned_SS_long(PyObject * obj,unsigned long * val)5121 SWIG_AsVal_unsigned_SS_long (PyObject *obj, unsigned long *val)
5122 {
5123 #if PY_VERSION_HEX < 0x03000000
5124   if (PyInt_Check(obj)) {
5125     long v = PyInt_AsLong(obj);
5126     if (v >= 0) {
5127       if (val) *val = v;
5128       return SWIG_OK;
5129     } else {
5130       return SWIG_OverflowError;
5131     }
5132   } else
5133 #endif
5134   if (PyLong_Check(obj)) {
5135     unsigned long v = PyLong_AsUnsignedLong(obj);
5136     if (!PyErr_Occurred()) {
5137       if (val) *val = v;
5138       return SWIG_OK;
5139     } else {
5140       PyErr_Clear();
5141       return SWIG_OverflowError;
5142     }
5143   }
5144 #ifdef SWIG_PYTHON_CAST_MODE
5145   {
5146     int dispatch = 0;
5147     unsigned long v = PyLong_AsUnsignedLong(obj);
5148     if (!PyErr_Occurred()) {
5149       if (val) *val = v;
5150       return SWIG_AddCast(SWIG_OK);
5151     } else {
5152       PyErr_Clear();
5153     }
5154     if (!dispatch) {
5155       double d;
5156       int res = SWIG_AddCast(SWIG_AsVal_double (obj,&d));
5157       if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, ULONG_MAX)) {
5158 	if (val) *val = (unsigned long)(d);
5159 	return res;
5160       }
5161     }
5162   }
5163 #endif
5164   return SWIG_TypeError;
5165 }
5166 
5167 
5168 #include <openssl/bio.h>
5169 
5170 
5171 static PyObject *_bio_err;
5172 
5173 
5174 void pyfd_init(void);
5175 
bio_init(PyObject * bio_err)5176 void bio_init(PyObject *bio_err) {
5177     Py_INCREF(bio_err);
5178     _bio_err = bio_err;
5179     pyfd_init();
5180 }
5181 
bio_free(BIO * bio)5182 int bio_free(BIO *bio) {
5183     int ret;
5184 
5185     Py_BEGIN_ALLOW_THREADS
5186     ret = BIO_free(bio);
5187     Py_END_ALLOW_THREADS
5188     if (ret == 0) {
5189         m2_PyErr_Msg(_bio_err);
5190     }
5191     return ret;
5192 }
5193 
bio_new_file(const char * filename,const char * mode)5194 BIO * bio_new_file(const char *filename, const char *mode) {
5195     BIO *ret;
5196 
5197     Py_BEGIN_ALLOW_THREADS
5198     ret = BIO_new_file(filename, mode);
5199     Py_END_ALLOW_THREADS
5200 
5201     if (ret == NULL) {
5202         m2_PyErr_Msg(_bio_err);
5203     }
5204 
5205     return ret;
5206 }
5207 
bio_new_pyfile(PyObject * pyfile,int bio_close)5208 BIO *bio_new_pyfile(PyObject *pyfile, int bio_close) {
5209     FILE *fp = NULL;
5210     BIO *bio = NULL;
5211 
5212     fp = PyFile_AsFile(pyfile);
5213 
5214     bio = BIO_new_fp(fp, bio_close);
5215 
5216     /* returns NULL if error occurred */
5217     if (bio == NULL) {
5218         /* Find out the name of the file so we can have good error
5219          * message. */
5220         PyObject *pyname = m2_PyFile_Name(pyfile);
5221         char *name = PyBytes_AsString(pyname);
5222 
5223         if (name == NULL) {
5224             PyErr_Format(_bio_err,
5225                          "Opening of the new BIO on file failed!");
5226         }
5227         else {
5228             PyErr_Format(_bio_err,
5229                          "Opening of the new BIO on file %s failed!", name);
5230         }
5231         Py_DECREF(pyname);
5232     }
5233     return bio;
5234 }
5235 
bio_read(BIO * bio,int num)5236 PyObject *bio_read(BIO *bio, int num) {
5237     PyObject *blob;
5238     void *buf;
5239     int r;
5240 
5241     if (!(buf = PyMem_Malloc(num))) {
5242         PyErr_SetString(PyExc_MemoryError, "bio_read");
5243         return NULL;
5244     }
5245     Py_BEGIN_ALLOW_THREADS
5246     r = BIO_read(bio, buf, num);
5247     Py_END_ALLOW_THREADS
5248     if (r < 0) {
5249         PyMem_Free(buf);
5250         if (ERR_peek_error()) {
5251             m2_PyErr_Msg(_bio_err);
5252             return NULL;
5253         }
5254         Py_RETURN_NONE;
5255     }
5256 
5257     blob = PyBytes_FromStringAndSize(buf, r);
5258 
5259     PyMem_Free(buf);
5260     return blob;
5261 }
5262 
bio_gets(BIO * bio,int num)5263 PyObject *bio_gets(BIO *bio, int num) {
5264     PyObject *blob;
5265     void *buf;
5266     int r;
5267 
5268     if (!(buf = PyMem_Malloc(num))) {
5269         PyErr_SetString(PyExc_MemoryError, "bio_gets");
5270         return NULL;
5271     }
5272     Py_BEGIN_ALLOW_THREADS
5273     r = BIO_gets(bio, buf, num);
5274     Py_END_ALLOW_THREADS
5275     if (r < 1) {
5276         PyMem_Free(buf);
5277         if (ERR_peek_error()) {
5278             m2_PyErr_Msg(_bio_err);
5279             return NULL;
5280         }
5281         Py_RETURN_NONE;
5282     }
5283 
5284     blob = PyBytes_FromStringAndSize(buf, r);
5285 
5286     PyMem_Free(buf);
5287     return blob;
5288 }
5289 
bio_write(BIO * bio,PyObject * from)5290 int bio_write(BIO *bio, PyObject *from) {
5291     const void *fbuf;
5292     int flen = 0, ret;
5293 
5294     if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1)
5295         return -1;
5296 
5297     Py_BEGIN_ALLOW_THREADS
5298     ret = BIO_write(bio, fbuf, flen);
5299     Py_END_ALLOW_THREADS
5300     if (ret < 0) {
5301         if (ERR_peek_error()) {
5302             m2_PyErr_Msg(_bio_err);
5303             return -1;
5304         }
5305     }
5306     return ret;
5307 }
5308 
5309 /* XXX Casting size_t to int. */
bio_ctrl_pending(BIO * bio)5310 int bio_ctrl_pending(BIO *bio) {
5311     return (int)BIO_ctrl_pending(bio);
5312 }
5313 
bio_ctrl_wpending(BIO * bio)5314 int bio_ctrl_wpending(BIO *bio) {
5315     return (int)BIO_ctrl_wpending(bio);
5316 }
5317 
bio_ctrl_get_write_guarantee(BIO * a)5318 int bio_ctrl_get_write_guarantee(BIO *a) {
5319     return BIO_ctrl_get_write_guarantee(a);
5320 }
5321 
bio_reset(BIO * bio)5322 int bio_reset(BIO *bio) {
5323     return (int)BIO_reset(bio);
5324 }
5325 
5326 
bio_flush(BIO * bio)5327 int bio_flush(BIO *bio) {
5328     return (int)BIO_flush(bio);
5329 }
5330 
bio_seek(BIO * bio,int offset)5331 int bio_seek(BIO *bio, int offset) {
5332     return (int)BIO_seek(bio, offset);
5333 }
5334 
bio_tell(BIO * bio)5335 int bio_tell(BIO* bio) {
5336     return BIO_tell(bio);
5337 }
5338 
bio_set_flags(BIO * bio,int flags)5339 void bio_set_flags(BIO *bio, int flags) {
5340     BIO_set_flags(bio, flags);
5341 }
5342 
bio_get_flags(BIO * bio)5343 int bio_get_flags(BIO *bio) {
5344     return BIO_get_flags(bio);
5345 }
5346 
5347 /*
5348  * sets the cipher of BIO @param b to c using key @param key and IV @iv.
5349  * @param enc should be set to 1 for encryption and zero to decryption.
5350  *
5351  */
bio_set_cipher(BIO * b,EVP_CIPHER * c,PyObject * key,PyObject * iv,int op)5352 PyObject *bio_set_cipher(BIO *b, EVP_CIPHER *c, PyObject *key, PyObject *iv, int op) {
5353     const void *kbuf, *ibuf;
5354     Py_ssize_t klen, ilen;
5355 
5356     if ((m2_PyObject_AsReadBuffer(key, &kbuf, &klen) == -1)
5357         || (m2_PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1))
5358         return NULL;
5359 
5360     BIO_set_cipher(b, (const EVP_CIPHER *)c,
5361         (unsigned char *)kbuf, (unsigned char *)ibuf, op);
5362     Py_RETURN_NONE;
5363 }
5364 
bio_set_mem_eof_return(BIO * b,int v)5365 int bio_set_mem_eof_return(BIO *b, int v) {
5366     return (int)BIO_set_mem_eof_return(b, v);
5367 }
5368 
bio_get_fd(BIO * bio)5369 int bio_get_fd(BIO *bio) {
5370     return BIO_get_fd(bio, NULL);
5371 }
5372 
5373 
bio_do_handshake(BIO * bio)5374 int bio_do_handshake(BIO *bio) {
5375     return BIO_do_handshake(bio);
5376 }
5377 
5378 /* macro */
bio_make_bio_pair(BIO * b1,BIO * b2)5379 int bio_make_bio_pair(BIO* b1, BIO* b2) {
5380     return BIO_make_bio_pair(b1, b2);
5381 }
5382 
bio_set_write_buf_size(BIO * b,size_t size)5383 int bio_set_write_buf_size(BIO* b, size_t size) {
5384     return BIO_set_write_buf_size(b, size);
5385 }
5386 
bio_should_retry(BIO * a)5387 int bio_should_retry(BIO* a) {
5388     return BIO_should_retry(a);
5389 }
5390 
bio_should_read(BIO * a)5391 int bio_should_read(BIO* a) {
5392     return BIO_should_read(a);
5393 }
5394 
bio_should_write(BIO * a)5395 int bio_should_write(BIO* a) {
5396     return BIO_should_write(a);
5397 }
5398 
5399 /* Macros for things not defined before 1.1.0 */
5400 #if OPENSSL_VERSION_NUMBER < 0x10100000L
5401 static BIO_METHOD *
BIO_meth_new(int type,const char * name)5402 BIO_meth_new( int type, const char *name )
5403 {
5404     BIO_METHOD *method = malloc( sizeof(BIO_METHOD) );
5405     memset( method, 0, sizeof(BIO_METHOD) );
5406 
5407     method->type = type;
5408     method->name = name;
5409 
5410     return method;
5411 }
5412 
5413 static void
BIO_meth_free(BIO_METHOD * meth)5414 BIO_meth_free( BIO_METHOD *meth )
5415 {
5416     if ( meth == NULL ) {
5417         return;
5418     }
5419 
5420     free(meth);
5421 }
5422 #define BIO_meth_set_write(m, f) (m)->bwrite = (f)
5423 #define BIO_meth_set_read(m, f) (m)->bread = (f)
5424 #define BIO_meth_set_puts(m, f) (m)->bputs = (f)
5425 #define BIO_meth_set_gets(m, f) (m)->bgets = (f)
5426 #define BIO_meth_set_ctrl(m, f) (m)->ctrl = (f)
5427 #define BIO_meth_set_create(m, f) (m)->create = (f)
5428 #define BIO_meth_set_destroy(m, f) (m)->destroy = (f)
5429 #define BIO_set_shutdown(b, x) (b)->shutdown = x
5430 #define BIO_get_shutdown(b) (b)->shutdown
5431 #define BIO_set_init(b, x)    b->init = x
5432 #define BIO_get_init(b) (b)->init
5433 #define BIO_set_data(b, x)    b->ptr = x
5434 #define BIO_clear_flags(b, x)    b->flags &= ~(x)
5435 #define BIO_get_data(b)    b->ptr
5436 #endif
5437 
5438 /* implment custom BIO_s_pyfd */
5439 
5440 #ifdef _WIN32
5441 #  define clear_sys_error()       SetLastError(0)
5442 /* Linux doesn't use underscored calls yet */
5443 #  define open(p, f, m) _open(p, f, m)
5444 #  define read(f, b, n) _read(f, b, n)
5445 #  define write(f, b, n) _write(f, b, n)
5446 #  define close(f) _close(f)
5447 #  define lseek(fd, o, w) _lseek(fd, o, w)
5448 #else
5449 # define clear_sys_error()       errno=0
5450 #endif
5451 
5452 typedef struct pyfd_struct {
5453     int fd;
5454 } BIO_PYFD_CTX;
5455 
5456 /* Setting up methods_fdp */
5457 static BIO_METHOD *methods_fdp;
5458 
pyfd_write(BIO * b,const char * in,int inl)5459 static int pyfd_write(BIO *b, const char *in, int inl) {
5460     int ret, fd;
5461 
5462     if (BIO_get_fd(b, &fd) == -1) {
5463         PyErr_SetString(_bio_err, "BIO has not been initialized.");
5464         return -1;
5465     }
5466     clear_sys_error();
5467     ret = write(fd, in, inl);
5468     BIO_clear_retry_flags(b);
5469     if (ret <= 0) {
5470         if (BIO_fd_should_retry(ret))
5471             BIO_set_retry_write(b);
5472     }
5473     return ret;
5474 }
5475 
pyfd_read(BIO * b,char * out,int outl)5476 static int pyfd_read(BIO *b, char *out, int outl) {
5477     int ret = 0, fd;
5478 
5479     if (BIO_get_fd(b, &fd) == -1) {
5480         PyErr_SetString(_bio_err, "BIO has not been initialized.");
5481         return -1;
5482     }
5483     if (out != NULL) {
5484         clear_sys_error();
5485         ret = read(fd, out, outl);
5486         BIO_clear_retry_flags(b);
5487         if (ret <= 0) {
5488             if (BIO_fd_should_retry(ret))
5489                 BIO_set_retry_read(b);
5490         }
5491     }
5492     return ret;
5493 }
5494 
pyfd_puts(BIO * bp,const char * str)5495 static int pyfd_puts(BIO *bp, const char *str) {
5496     int n, ret;
5497 
5498     n = strlen(str);
5499     ret = pyfd_write(bp, str, n);
5500     return ret;
5501 }
5502 
pyfd_gets(BIO * bp,char * buf,int size)5503 static int pyfd_gets(BIO *bp, char *buf, int size) {
5504     int ret = 0;
5505     char *ptr = buf;
5506     char *end = buf + size - 1;
5507 
5508     /* See
5509     https://github.com/openssl/openssl/pull/3442
5510     We were here just repeating a bug from OpenSSL
5511     */
5512     while (ptr < end && pyfd_read(bp, ptr, 1) > 0) {
5513         if (*ptr++ == '\n')
5514            break;
5515     }
5516 
5517     ptr[0] = '\0';
5518 
5519     if (buf[0] != '\0')
5520         ret = strlen(buf);
5521     return ret;
5522 }
5523 
pyfd_new(BIO * b)5524 static int pyfd_new(BIO* b) {
5525     BIO_PYFD_CTX* ctx;
5526 
5527     ctx = OPENSSL_zalloc(sizeof(*ctx));
5528     if (ctx == NULL)
5529         return 0;
5530 
5531     ctx->fd = -1;
5532 
5533     BIO_set_data(b, ctx);
5534     BIO_set_shutdown(b, 0);
5535     BIO_set_init(b, 1);
5536 
5537     return 1;
5538     }
5539 
pyfd_free(BIO * b)5540 static int pyfd_free(BIO* b) {
5541     BIO_PYFD_CTX* ctx;
5542 
5543     if (b == 0)
5544         return 0;
5545 
5546     ctx = BIO_get_data(b);
5547     if (ctx == NULL)
5548         return 0;
5549 
5550     if (BIO_get_shutdown(b) && BIO_get_init(b))
5551         close(ctx->fd);
5552 
5553     BIO_set_data(b, NULL);
5554     BIO_set_shutdown(b, 0);
5555     BIO_set_init(b, 0);
5556 
5557     OPENSSL_free(ctx);
5558 
5559     return 1;
5560 }
5561 
pyfd_ctrl(BIO * b,int cmd,long num,void * ptr)5562 static long pyfd_ctrl(BIO *b, int cmd, long num, void *ptr) {
5563     BIO_PYFD_CTX* ctx;
5564     int *ip;
5565     long ret = 1;
5566 
5567     ctx = BIO_get_data(b);
5568     if (ctx == NULL)
5569         return 0;
5570 
5571     switch (cmd) {
5572     case BIO_CTRL_RESET:
5573         num = 0;
5574     case BIO_C_FILE_SEEK:
5575         ret = (long)lseek(ctx->fd, num, 0);
5576         break;
5577     case BIO_C_FILE_TELL:
5578     case BIO_CTRL_INFO:
5579         ret = (long)lseek(ctx->fd, 0, 1);
5580         break;
5581     case BIO_C_SET_FD:
5582         pyfd_free(b);
5583         if (*((int *)ptr) > -1) {
5584             if (!pyfd_new(b) || !(ctx = BIO_get_data(b)))
5585                 return 0;
5586             ctx->fd = *((int *)ptr);
5587             BIO_set_shutdown(b, (int)num);
5588             BIO_set_init(b, 1);
5589             }
5590         break;
5591     case BIO_C_GET_FD:
5592         if (BIO_get_init(b)) {
5593             ip = (int *)ptr;
5594             if (ip != NULL)
5595                 *ip = ctx->fd;
5596             ret = ctx->fd;
5597         } else
5598             ret = -1;
5599         break;
5600     case BIO_CTRL_GET_CLOSE:
5601         ret = BIO_get_shutdown(b);
5602         break;
5603     case BIO_CTRL_SET_CLOSE:
5604         BIO_set_shutdown(b, (int)num);
5605         break;
5606     case BIO_CTRL_PENDING:
5607     case BIO_CTRL_WPENDING:
5608         ret = 0;
5609         break;
5610     case BIO_CTRL_DUP:
5611     case BIO_CTRL_FLUSH:
5612         ret = 1;
5613         break;
5614     default:
5615         ret = 0;
5616         break;
5617     }
5618     return ret;
5619 }
5620 
pyfd_init(void)5621 void pyfd_init(void) {
5622 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
5623     methods_fdp = BIO_meth_new(
5624         BIO_get_new_index()|BIO_TYPE_DESCRIPTOR|BIO_TYPE_SOURCE_SINK,
5625         "python file descriptor");
5626 #else
5627     methods_fdp = BIO_meth_new(
5628         100 |BIO_TYPE_DESCRIPTOR|BIO_TYPE_SOURCE_SINK,
5629         "python file descriptor");
5630 #endif
5631 
5632     BIO_meth_set_write(methods_fdp, pyfd_write);
5633     BIO_meth_set_read(methods_fdp, pyfd_read);
5634     BIO_meth_set_puts(methods_fdp, pyfd_puts);
5635     BIO_meth_set_gets(methods_fdp, pyfd_gets);
5636     BIO_meth_set_ctrl(methods_fdp, pyfd_ctrl);
5637     BIO_meth_set_create(methods_fdp, pyfd_new);
5638     BIO_meth_set_destroy(methods_fdp, pyfd_free);
5639 }
5640 
BIO_new_pyfd(int fd,int close_flag)5641 BIO* BIO_new_pyfd(int fd, int close_flag) {
5642     BIO *ret;
5643 
5644     ret = BIO_new(methods_fdp);
5645     BIO_set_fd(ret, fd, close_flag);
5646     return ret;
5647     }
5648 
5649 
5650 #if defined(LLONG_MAX) && !defined(SWIG_LONG_LONG_AVAILABLE)
5651 #  define SWIG_LONG_LONG_AVAILABLE
5652 #endif
5653 
5654 
5655 #ifdef SWIG_LONG_LONG_AVAILABLE
5656 SWIGINTERN int
SWIG_AsVal_unsigned_SS_long_SS_long(PyObject * obj,unsigned long long * val)5657 SWIG_AsVal_unsigned_SS_long_SS_long (PyObject *obj, unsigned long long *val)
5658 {
5659   int res = SWIG_TypeError;
5660   if (PyLong_Check(obj)) {
5661     unsigned long long v = PyLong_AsUnsignedLongLong(obj);
5662     if (!PyErr_Occurred()) {
5663       if (val) *val = v;
5664       return SWIG_OK;
5665     } else {
5666       PyErr_Clear();
5667       res = SWIG_OverflowError;
5668     }
5669   } else {
5670     unsigned long v;
5671     res = SWIG_AsVal_unsigned_SS_long (obj,&v);
5672     if (SWIG_IsOK(res)) {
5673       if (val) *val = v;
5674       return res;
5675     }
5676   }
5677 #ifdef SWIG_PYTHON_CAST_MODE
5678   {
5679     const double mant_max = 1LL << DBL_MANT_DIG;
5680     double d;
5681     res = SWIG_AsVal_double (obj,&d);
5682     if (SWIG_IsOK(res) && !SWIG_CanCastAsInteger(&d, 0, mant_max))
5683       return SWIG_OverflowError;
5684     if (SWIG_IsOK(res) && SWIG_CanCastAsInteger(&d, 0, mant_max)) {
5685       if (val) *val = (unsigned long long)(d);
5686       return SWIG_AddCast(res);
5687     }
5688     res = SWIG_TypeError;
5689   }
5690 #endif
5691   return res;
5692 }
5693 #endif
5694 
5695 
5696 SWIGINTERNINLINE int
SWIG_AsVal_size_t(PyObject * obj,size_t * val)5697 SWIG_AsVal_size_t (PyObject * obj, size_t *val)
5698 {
5699   int res = SWIG_TypeError;
5700 #ifdef SWIG_LONG_LONG_AVAILABLE
5701   if (sizeof(size_t) <= sizeof(unsigned long)) {
5702 #endif
5703     unsigned long v;
5704     res = SWIG_AsVal_unsigned_SS_long (obj, val ? &v : 0);
5705     if (SWIG_IsOK(res) && val) *val = (size_t)(v);
5706 #ifdef SWIG_LONG_LONG_AVAILABLE
5707   } else if (sizeof(size_t) <= sizeof(unsigned long long)) {
5708     unsigned long long v;
5709     res = SWIG_AsVal_unsigned_SS_long_SS_long (obj, val ? &v : 0);
5710     if (SWIG_IsOK(res) && val) *val = (size_t)(v);
5711   }
5712 #endif
5713   return res;
5714 }
5715 
5716 
5717 #include <openssl/bn.h>
5718 
5719 
bn_rand(int bits,int top,int bottom)5720 PyObject *bn_rand(int bits, int top, int bottom)
5721 {
5722     BIGNUM* rnd;
5723     PyObject *ret;
5724     char *randhex;
5725 
5726     rnd = BN_new();
5727     if (rnd == NULL) {
5728         m2_PyErr_Msg(PyExc_Exception);
5729         return NULL;
5730     }
5731 
5732     if (!BN_rand(rnd, bits, top, bottom)) {
5733         /*Custom errors?*/
5734         m2_PyErr_Msg(PyExc_Exception);
5735         BN_free(rnd);
5736         return NULL;
5737     }
5738 
5739     randhex = BN_bn2hex(rnd);
5740     if (!randhex) {
5741         /*Custom errors?*/
5742         m2_PyErr_Msg(PyExc_Exception);
5743         BN_free(rnd);
5744         return NULL;
5745     }
5746     BN_free(rnd);
5747 
5748     ret = PyLong_FromString(randhex, NULL, 16);
5749     OPENSSL_free(randhex);
5750     return ret;
5751 }
5752 
5753 
bn_rand_range(PyObject * range)5754 PyObject *bn_rand_range(PyObject *range)
5755 {
5756     BIGNUM* rnd;
5757     BIGNUM *rng = NULL;
5758     PyObject *ret, *tuple;
5759     PyObject *format, *rangePyString;
5760     char *randhex; /* PyLong_FromString is unhappy with const */
5761     const char *rangehex;
5762 
5763     /* Wow, it's a lot of work to convert into a hex string in C! */
5764     format = PyUnicode_FromString("%x");
5765 
5766     if (!format) {
5767         PyErr_SetString(PyExc_RuntimeError, "Cannot create Python string '%x'");
5768         return NULL;
5769     }
5770     tuple = PyTuple_New(1);
5771     if (!tuple) {
5772         Py_DECREF(format);
5773         PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails");
5774         return NULL;
5775     }
5776     Py_INCREF(range);
5777     PyTuple_SET_ITEM(tuple, 0, range);
5778 
5779     rangePyString = PyUnicode_Format(format, tuple);
5780 
5781     if (!rangePyString) {
5782         PyErr_SetString(PyExc_Exception, "String Format failed");
5783         Py_DECREF(format);
5784         Py_DECREF(tuple);
5785         return NULL;
5786     }
5787     Py_DECREF(format);
5788     Py_DECREF(tuple);
5789 
5790     rangehex = (const char*)PyUnicode_AsUTF8(rangePyString);
5791 
5792     if (!BN_hex2bn(&rng, rangehex)) {
5793         /*Custom errors?*/
5794         m2_PyErr_Msg(PyExc_Exception);
5795         Py_DECREF(rangePyString);
5796         return NULL;
5797     }
5798 
5799     Py_DECREF(rangePyString);
5800 
5801     if (!(rnd = BN_new())) {
5802         PyErr_SetString(PyExc_MemoryError, "bn_rand_range");
5803         return NULL;
5804     }
5805 
5806     if (!BN_rand_range(rnd, rng)) {
5807         /*Custom errors?*/
5808         m2_PyErr_Msg(PyExc_Exception);
5809         BN_free(rnd);
5810         BN_free(rng);
5811         return NULL;
5812     }
5813 
5814     BN_free(rng);
5815 
5816     randhex = BN_bn2hex(rnd);
5817     if (!randhex) {
5818         /*Custom errors?*/
5819         m2_PyErr_Msg(PyExc_Exception);
5820         BN_free(rnd);
5821         return NULL;
5822     }
5823     BN_free(rnd);
5824 
5825     ret = PyLong_FromString(randhex, NULL, 16);
5826     OPENSSL_free(randhex);
5827     return ret;
5828 }
5829 
5830 
5831 
5832 static PyObject *_rand_err;
5833 
rand_init(PyObject * rand_err)5834 void rand_init(PyObject *rand_err) {
5835     Py_INCREF(rand_err);
5836     _rand_err = rand_err;
5837 }
5838 
rand_seed(PyObject * seed)5839 PyObject *rand_seed(PyObject *seed) {
5840     const void *buf;
5841     int len = 0;
5842 
5843     m2_PyObject_AsReadBufferInt(seed, &buf, &len);
5844 
5845     RAND_seed(buf, len);
5846     Py_RETURN_NONE;
5847 }
5848 
rand_add(PyObject * blob,double entropy)5849 PyObject *rand_add(PyObject *blob, double entropy) {
5850     const void *buf;
5851     int len = 0;
5852 
5853     m2_PyObject_AsReadBufferInt(blob, &buf, &len);
5854 
5855     RAND_add(buf, len, entropy);
5856     Py_RETURN_NONE;
5857 }
5858 
rand_bytes(int n)5859 PyObject *rand_bytes(int n) {
5860     void *blob;
5861     int ret;
5862     PyObject *obj;
5863 
5864     if (!(blob = PyMem_Malloc(n))) {
5865         PyErr_SetString(PyExc_MemoryError,
5866         "Insufficient memory for rand_bytes.");
5867         return NULL;
5868     }
5869     if ((ret = RAND_bytes(blob, n)) == 1) {
5870         obj = PyBytes_FromStringAndSize(blob, n);
5871         PyMem_Free(blob);
5872         return obj;
5873     } else if (ret == 0) {
5874         PyErr_SetString(_rand_err, "Not enough randomness.");
5875         PyMem_Free(blob);
5876         return NULL;
5877     } else if (ret == -1) {
5878         PyErr_SetString(_rand_err,
5879                         "Not supported by the current RAND method.");
5880         PyMem_Free(blob);
5881         return NULL;
5882     } else {
5883         PyMem_Free(blob);
5884         m2_PyErr_Msg(_rand_err);
5885         return NULL;
5886     }
5887 }
5888 
rand_pseudo_bytes(int n)5889 PyObject *rand_pseudo_bytes(int n) {
5890     int ret;
5891     unsigned char *blob;
5892     PyObject *tuple;
5893 
5894     if (!(blob=(unsigned char *)PyMem_Malloc(n))) {
5895         PyErr_SetString(PyExc_MemoryError, "Insufficient memory for rand_pseudo_bytes.");
5896         return NULL;
5897     }
5898     if (!(tuple=PyTuple_New(2))) {
5899         PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails");
5900         PyMem_Free(blob);
5901         return NULL;
5902     }
5903     ret = RAND_pseudo_bytes(blob, n);
5904     if (ret == -1) {
5905         PyMem_Free(blob);
5906         Py_DECREF(tuple);
5907         PyErr_SetString(_rand_err,
5908             "Function RAND_pseudo_bytes not supported by the current RAND method.");
5909         return NULL;
5910     } else {
5911         PyTuple_SET_ITEM(tuple, 0, PyBytes_FromStringAndSize((char*)blob, n));
5912 
5913         PyMem_Free(blob);
5914         PyTuple_SET_ITEM(tuple, 1, PyLong_FromLong((long)ret));
5915         return tuple;
5916     }
5917 }
5918 
rand_file_name(void)5919 PyObject *rand_file_name(void) {
5920     PyObject *obj;
5921     char *str;
5922     if ((obj = PyBytes_FromStringAndSize(NULL, BUFSIZ))==NULL) {
5923         PyErr_SetString(PyExc_MemoryError, "rand_file_name");
5924         return NULL;
5925     }
5926     str=PyBytes_AS_STRING(obj);
5927     if (RAND_file_name(str, BUFSIZ)==NULL) {
5928         PyErr_SetString(PyExc_RuntimeError, "rand_file_name");
5929         return NULL;
5930     }
5931     if (_PyBytes_Resize(&obj, (Py_ssize_t)strlen(str))!=0)
5932         return NULL; /* mem exception set by _PyBytes_Resize */
5933     return obj;
5934 }
5935 
rand_screen(void)5936 void rand_screen(void) {
5937 #ifdef _WIN32
5938     RAND_screen();
5939 #endif
5940 }
5941 
rand_win32_event(unsigned int imsg,int wparam,long lparam)5942 int rand_win32_event(unsigned int imsg, int wparam, long lparam) {
5943 #ifdef _WIN32
5944     return RAND_event(imsg, wparam, lparam);
5945 #else
5946     return 0;
5947 #endif
5948 }
5949 
5950 
5951 SWIGINTERN int
SWIG_AsVal_unsigned_SS_int(PyObject * obj,unsigned int * val)5952 SWIG_AsVal_unsigned_SS_int (PyObject * obj, unsigned int *val)
5953 {
5954   unsigned long v;
5955   int res = SWIG_AsVal_unsigned_SS_long (obj, &v);
5956   if (SWIG_IsOK(res)) {
5957     if ((v > UINT_MAX)) {
5958       return SWIG_OverflowError;
5959     } else {
5960       if (val) *val = (unsigned int)(v);
5961     }
5962   }
5963   return res;
5964 }
5965 
5966 
5967 #include <assert.h>
5968 #include <openssl/err.h>
5969 #include <openssl/evp.h>
5970 #include <openssl/hmac.h>
5971 #include <openssl/rsa.h>
5972 #include <openssl/opensslv.h>
5973 
5974 #if OPENSSL_VERSION_NUMBER < 0x10100000L
5975 
HMAC_CTX_new(void)5976 HMAC_CTX *HMAC_CTX_new(void) {
5977     HMAC_CTX *ret = PyMem_Malloc(sizeof(HMAC_CTX));
5978     HMAC_CTX_init(ret);
5979     return ret;
5980 }
5981 #define HMAC_CTX_reset(ctx) HMAC_CTX_init(ctx)
5982 #define HMAC_CTX_free(ctx)          \
5983     do  {                           \
5984         HMAC_CTX_cleanup(ctx);      \
5985         PyMem_Free((void *)ctx);    \
5986     } while(0)
5987 
5988 #define EVP_CIPHER_CTX_reset(ctx) EVP_CIPHER_CTX_init(ctx)
5989 #endif
5990 
5991 
5992 #define PKCS5_SALT_LEN  8
5993 
5994 static PyObject *_evp_err;
5995 
evp_init(PyObject * evp_err)5996 void evp_init(PyObject *evp_err) {
5997     Py_INCREF(evp_err);
5998     _evp_err = evp_err;
5999 }
6000 
6001 
pkey_get1_rsa(EVP_PKEY * pkey)6002 RSA *pkey_get1_rsa(EVP_PKEY *pkey) {
6003     RSA *ret = NULL;
6004 
6005     if ((ret = EVP_PKEY_get1_RSA(pkey)) == NULL) {
6006         /* _evp_err now inherits from PyExc_ValueError, so we should
6007          * keep API intact.
6008          */
6009         PyErr_Format(_evp_err, "Invalid key in function %s.", __FUNCTION__);
6010     }
6011 
6012     return ret;
6013 }
6014 
6015 
pkcs5_pbkdf2_hmac_sha1(PyObject * pass,PyObject * salt,int iter,int keylen)6016 PyObject *pkcs5_pbkdf2_hmac_sha1(PyObject *pass,
6017                                  PyObject *salt,
6018                                  int iter,
6019                                  int keylen) {
6020     unsigned char *key;
6021     const void *saltbuf;
6022     const void *passbuf;
6023     PyObject *ret;
6024     int passlen = 0, saltlen = 0;
6025 
6026     if (m2_PyObject_AsReadBufferInt(pass, &passbuf, &passlen) == -1)
6027         return NULL;
6028     if (m2_PyObject_AsReadBufferInt(salt, &saltbuf, &saltlen) == -1)
6029         return NULL;
6030 
6031     key = PyMem_Malloc(keylen);
6032     if (key == NULL)
6033 	return PyErr_NoMemory();
6034     PKCS5_PBKDF2_HMAC_SHA1((const char *)passbuf, passlen, (const unsigned char *)saltbuf, saltlen, iter,
6035                            keylen, key);
6036     ret = PyBytes_FromStringAndSize((char*)key, keylen);
6037     OPENSSL_cleanse(key, keylen);
6038     PyMem_Free(key);
6039     return ret;
6040 }
6041 
md_ctx_new(void)6042 EVP_MD_CTX *md_ctx_new(void) {
6043     EVP_MD_CTX *ctx;
6044 
6045     if (!(ctx = EVP_MD_CTX_create())) {
6046         PyErr_SetString(PyExc_MemoryError, "md_ctx_new");
6047         return NULL;
6048     }
6049     return ctx;
6050 }
6051 
md_ctx_free(EVP_MD_CTX * ctx)6052 void md_ctx_free(EVP_MD_CTX *ctx) {
6053     EVP_MD_CTX_destroy(ctx);
6054 }
6055 
digest_update(EVP_MD_CTX * ctx,PyObject * blob)6056 int digest_update(EVP_MD_CTX *ctx, PyObject *blob) {
6057     const void *buf;
6058     Py_ssize_t len;
6059 
6060     if (m2_PyObject_AsReadBuffer(blob, &buf, &len) == -1)
6061         return -1;
6062 
6063     return EVP_DigestUpdate(ctx, buf, (size_t)len);
6064 }
6065 
digest_final(EVP_MD_CTX * ctx)6066 PyObject *digest_final(EVP_MD_CTX *ctx) {
6067     void *blob;
6068     int blen;
6069     PyObject *ret;
6070 
6071     if (!(blob = PyMem_Malloc(EVP_MD_CTX_size(ctx)))) {
6072         PyErr_SetString(PyExc_MemoryError, "digest_final");
6073         return NULL;
6074     }
6075     if (!EVP_DigestFinal(ctx, blob, (unsigned int *)&blen)) {
6076         PyMem_Free(blob);
6077         m2_PyErr_Msg(_evp_err);
6078         return NULL;
6079     }
6080 
6081     ret = PyBytes_FromStringAndSize(blob, blen);
6082 
6083     PyMem_Free(blob);
6084     return ret;
6085 }
6086 
hmac_ctx_new(void)6087 HMAC_CTX *hmac_ctx_new(void) {
6088     HMAC_CTX *ctx;
6089 
6090     if (!(ctx = HMAC_CTX_new())) {
6091         PyErr_SetString(PyExc_MemoryError, "hmac_ctx_new");
6092         return NULL;
6093     }
6094     return ctx;
6095 }
6096 
hmac_ctx_free(HMAC_CTX * ctx)6097 void hmac_ctx_free(HMAC_CTX *ctx) {
6098     HMAC_CTX_free(ctx);
6099 }
6100 
hmac_init(HMAC_CTX * ctx,PyObject * key,const EVP_MD * md)6101 PyObject *hmac_init(HMAC_CTX *ctx, PyObject *key, const EVP_MD *md) {
6102     const void *kbuf;
6103     int klen = 0;
6104 
6105     if (m2_PyObject_AsReadBufferInt(key, &kbuf, &klen) == -1)
6106         return NULL;
6107 
6108     if (!HMAC_Init_ex(ctx, kbuf, klen, md, NULL)) {
6109         PyErr_SetString(_evp_err, "HMAC_Init failed");
6110         return NULL;
6111     }
6112     Py_RETURN_NONE;
6113 }
6114 
hmac_update(HMAC_CTX * ctx,PyObject * blob)6115 PyObject *hmac_update(HMAC_CTX *ctx, PyObject *blob) {
6116     const void *buf;
6117     Py_ssize_t len;
6118 
6119     if (m2_PyObject_AsReadBuffer(blob, &buf, &len) == -1)
6120         return NULL;
6121 
6122     if (!HMAC_Update(ctx, (const unsigned char *)buf, (size_t)len)) {
6123         PyErr_SetString(_evp_err, "HMAC_Update failed");
6124         return NULL;
6125     }
6126     Py_RETURN_NONE;
6127 }
6128 
hmac_final(HMAC_CTX * ctx)6129 PyObject *hmac_final(HMAC_CTX *ctx) {
6130     void *blob;
6131     int blen;
6132     PyObject *ret;
6133 
6134     if (!(blob = PyMem_Malloc(HMAC_size(ctx)))) {
6135         PyErr_SetString(PyExc_MemoryError, "hmac_final");
6136         return NULL;
6137     }
6138 
6139     if (!HMAC_Final(ctx, blob, (unsigned int *)&blen)) {
6140         PyErr_SetString(_evp_err, "HMAC_Final failed");
6141         return NULL;
6142     }
6143 
6144     ret = PyBytes_FromStringAndSize(blob, blen);
6145 
6146     PyMem_Free(blob);
6147     return ret;
6148 }
6149 
hmac(PyObject * key,PyObject * data,const EVP_MD * md)6150 PyObject *hmac(PyObject *key, PyObject *data, const EVP_MD *md) {
6151     const void *kbuf, *dbuf;
6152     void *blob;
6153     int klen = 0;
6154     unsigned int blen;
6155     Py_ssize_t dlen;
6156     PyObject *ret;
6157 
6158     if ((m2_PyObject_AsReadBufferInt(key, &kbuf, &klen) == -1)
6159         || (m2_PyObject_AsReadBuffer(data, &dbuf, &dlen) == -1))
6160         return NULL;
6161 
6162     if (!(blob = PyMem_Malloc(EVP_MAX_MD_SIZE))) {
6163         PyErr_SetString(PyExc_MemoryError, "hmac");
6164         return NULL;
6165     }
6166     HMAC(md, kbuf, klen, (const unsigned char *)dbuf, (size_t)dlen, (unsigned char *)blob, &blen);
6167     blob = PyMem_Realloc(blob, blen);
6168 
6169     ret = PyBytes_FromStringAndSize(blob, blen);
6170 
6171     PyMem_Free(blob);
6172     return ret;
6173 }
6174 
cipher_ctx_new(void)6175 EVP_CIPHER_CTX *cipher_ctx_new(void) {
6176     EVP_CIPHER_CTX *ctx;
6177 
6178     if (!(ctx = EVP_CIPHER_CTX_new())) {
6179         PyErr_SetString(PyExc_MemoryError, "cipher_ctx_new");
6180         return NULL;
6181     }
6182     EVP_CIPHER_CTX_reset(ctx);
6183     return ctx;
6184 }
6185 
cipher_ctx_free(EVP_CIPHER_CTX * ctx)6186 void cipher_ctx_free(EVP_CIPHER_CTX *ctx) {
6187     EVP_CIPHER_CTX_free(ctx);
6188 }
6189 
bytes_to_key(const EVP_CIPHER * cipher,EVP_MD * md,PyObject * data,PyObject * salt,PyObject * iv,int iter)6190 PyObject *bytes_to_key(const EVP_CIPHER *cipher, EVP_MD *md,
6191                         PyObject *data, PyObject *salt,
6192                         PyObject *iv, /* Not used */
6193                         int iter) {
6194     unsigned char key[EVP_MAX_KEY_LENGTH];
6195     const void *dbuf, *sbuf;
6196     int dlen = 0, klen;
6197     Py_ssize_t slen;
6198     PyObject *ret;
6199 
6200     if ((m2_PyObject_AsReadBufferInt(data, &dbuf, &dlen) == -1)
6201         || (m2_PyObject_AsReadBuffer(salt, &sbuf, &slen) == -1))
6202         return NULL;
6203 
6204     assert((slen == 8) || (slen == 0));
6205     klen = EVP_BytesToKey(cipher, md, (unsigned char *)sbuf,
6206         (unsigned char *)dbuf, dlen, iter,
6207         key, NULL); /* Since we are not returning IV no need to derive it */
6208 
6209     ret = PyBytes_FromStringAndSize((char*)key, klen);
6210 
6211     return ret;
6212 }
6213 
cipher_init(EVP_CIPHER_CTX * ctx,const EVP_CIPHER * cipher,PyObject * key,PyObject * iv,int mode)6214 PyObject *cipher_init(EVP_CIPHER_CTX *ctx, const EVP_CIPHER *cipher,
6215                         PyObject *key, PyObject *iv, int mode) {
6216     const void *kbuf, *ibuf;
6217     Py_ssize_t klen, ilen;
6218 
6219     if (key == Py_None)
6220         kbuf = NULL;
6221     else if (m2_PyObject_AsReadBuffer(key, &kbuf, &klen) == -1)
6222         return NULL;
6223 
6224     if (iv == Py_None)
6225         ibuf = NULL;
6226     else if (m2_PyObject_AsReadBuffer(iv, &ibuf, &ilen) == -1)
6227         return NULL;
6228 
6229     if (!EVP_CipherInit(ctx, cipher, (unsigned char *)kbuf,
6230                         (unsigned char *)ibuf, mode)) {
6231         m2_PyErr_Msg(_evp_err);
6232         return NULL;
6233     }
6234     Py_RETURN_NONE;
6235 }
6236 
cipher_update(EVP_CIPHER_CTX * ctx,PyObject * blob)6237 PyObject *cipher_update(EVP_CIPHER_CTX *ctx, PyObject *blob) {
6238     const void *buf;
6239     int len = 0, olen;
6240     void *obuf;
6241     PyObject *ret;
6242 
6243     if (m2_PyObject_AsReadBufferInt(blob, &buf, &len) == -1)
6244         return NULL;
6245 
6246     if (!(obuf = PyMem_Malloc(len + EVP_CIPHER_CTX_block_size(ctx) - 1))) {
6247         PyErr_SetString(PyExc_MemoryError, "cipher_update");
6248         return NULL;
6249     }
6250     if (!EVP_CipherUpdate(ctx, obuf, &olen, (unsigned char *)buf, len)) {
6251         PyMem_Free(obuf);
6252         m2_PyErr_Msg(_evp_err);
6253         return NULL;
6254     }
6255 
6256     ret = PyBytes_FromStringAndSize(obuf, olen);
6257 
6258     PyMem_Free(obuf);
6259     return ret;
6260 }
6261 
cipher_final(EVP_CIPHER_CTX * ctx)6262 PyObject *cipher_final(EVP_CIPHER_CTX *ctx) {
6263     void *obuf;
6264     int olen;
6265     PyObject *ret;
6266 
6267     if (!(obuf = PyMem_Malloc(EVP_CIPHER_CTX_block_size(ctx)))) {
6268         PyErr_SetString(PyExc_MemoryError, "cipher_final");
6269         return NULL;
6270     }
6271     if (!EVP_CipherFinal(ctx, (unsigned char *)obuf, &olen)) {
6272         PyMem_Free(obuf);
6273         m2_PyErr_Msg(_evp_err);
6274         return NULL;
6275     }
6276 
6277     ret = PyBytes_FromStringAndSize(obuf, olen);
6278 
6279     PyMem_Free(obuf);
6280     return ret;
6281 }
6282 
sign_update(EVP_MD_CTX * ctx,PyObject * blob)6283 PyObject *sign_update(EVP_MD_CTX *ctx, PyObject *blob) {
6284     const void *buf;
6285     int len;
6286 
6287     if (m2_PyObject_AsReadBufferInt(blob, &buf, &len) == -1)
6288         return NULL;
6289 
6290     if (!EVP_SignUpdate(ctx, buf, (Py_ssize_t)len)) {
6291         m2_PyErr_Msg(_evp_err);
6292         return NULL;
6293     }
6294     Py_RETURN_NONE;
6295 }
6296 
sign_final(EVP_MD_CTX * ctx,EVP_PKEY * pkey)6297 PyObject *sign_final(EVP_MD_CTX *ctx, EVP_PKEY *pkey) {
6298     PyObject *ret;
6299     unsigned char *sigbuf;
6300     unsigned int siglen = EVP_PKEY_size(pkey);
6301 
6302     sigbuf = (unsigned char*)OPENSSL_malloc(siglen);
6303     if (!sigbuf) {
6304         PyErr_SetString(PyExc_MemoryError, "sign_final");
6305         return NULL;
6306     }
6307 
6308     if (!EVP_SignFinal(ctx, sigbuf, &siglen, pkey)) {
6309         m2_PyErr_Msg(_evp_err);
6310         OPENSSL_cleanse(sigbuf, siglen);
6311         OPENSSL_free(sigbuf);
6312         return NULL;
6313     }
6314 
6315     ret = PyBytes_FromStringAndSize((char*)sigbuf, siglen);
6316 
6317     OPENSSL_cleanse(sigbuf, siglen);
6318     OPENSSL_free(sigbuf);
6319     return ret;
6320 }
6321 
verify_update(EVP_MD_CTX * ctx,PyObject * blob)6322 int verify_update(EVP_MD_CTX *ctx, PyObject *blob) {
6323     const void *buf;
6324     int len;
6325 
6326     if (m2_PyObject_AsReadBufferInt(blob, &buf, &len) == -1)
6327         return -1;
6328 
6329     return EVP_VerifyUpdate(ctx, buf, (Py_ssize_t)len);
6330 }
6331 
verify_final(EVP_MD_CTX * ctx,PyObject * blob,EVP_PKEY * pkey)6332 int verify_final(EVP_MD_CTX *ctx, PyObject *blob, EVP_PKEY *pkey) {
6333     const void *kbuf;
6334     int len = 0;
6335 
6336     if (m2_PyObject_AsReadBufferInt(blob, &kbuf, &len) == -1)
6337         return -1;
6338 
6339     return EVP_VerifyFinal(ctx, (const unsigned char *)kbuf, len, pkey);
6340 }
6341 
digest_sign_init(EVP_MD_CTX * ctx,EVP_PKEY * pkey)6342 int digest_sign_init(EVP_MD_CTX *ctx, EVP_PKEY *pkey) {
6343     return EVP_DigestSignInit(ctx, NULL, NULL, NULL, pkey);
6344 }
6345 
digest_sign_update(EVP_MD_CTX * ctx,PyObject * blob)6346 PyObject *digest_sign_update(EVP_MD_CTX *ctx, PyObject *blob) {
6347     const void *buf;
6348     int len = 0;
6349 
6350     if (m2_PyObject_AsReadBufferInt(blob, (const void **)&buf, &len) == -1)
6351         return NULL;
6352 
6353     if (!EVP_DigestSignUpdate(ctx, buf, len)) {
6354         m2_PyErr_Msg(_evp_err);
6355         return NULL;
6356     }
6357     Py_RETURN_NONE;
6358 }
6359 
digest_sign_final(EVP_MD_CTX * ctx)6360 PyObject *digest_sign_final(EVP_MD_CTX *ctx) {
6361     PyObject *ret;
6362     unsigned char *sigbuf;
6363     size_t siglen;
6364 
6365     if (!EVP_DigestSignFinal(ctx, NULL, &siglen)) {
6366         m2_PyErr_Msg(_evp_err);
6367         return NULL;
6368     }
6369 
6370     sigbuf = (unsigned char*)OPENSSL_malloc(siglen);
6371     if (!sigbuf) {
6372         PyErr_SetString(PyExc_MemoryError, "digest_sign_final");
6373         return NULL;
6374     }
6375 
6376     if (!EVP_DigestSignFinal(ctx, sigbuf, &siglen)) {
6377         m2_PyErr_Msg(_evp_err);
6378         OPENSSL_cleanse(sigbuf, siglen);
6379         OPENSSL_free(sigbuf);
6380         return NULL;
6381     }
6382 
6383     ret = PyBytes_FromStringAndSize((char*)sigbuf, siglen);
6384 
6385     OPENSSL_cleanse(sigbuf, siglen);
6386     OPENSSL_free(sigbuf);
6387     return ret;
6388 }
6389 
6390 #if OPENSSL_VERSION_NUMBER >= 0x10101000L
digest_sign(EVP_MD_CTX * ctx,PyObject * msg)6391 PyObject *digest_sign(EVP_MD_CTX *ctx, PyObject *msg) {
6392     PyObject *ret;
6393     const void *msgbuf;
6394     unsigned char *sigbuf;
6395     int msglen = 0;
6396     size_t siglen = 0;
6397 
6398     if (m2_PyObject_AsReadBufferInt(msg, (const void **)&msgbuf, &msglen) == -1)
6399         return NULL;
6400 
6401     if (!EVP_DigestSign(ctx, NULL, &siglen, msgbuf, msglen)) {
6402         m2_PyErr_Msg(_evp_err);
6403         return NULL;
6404     }
6405 
6406     sigbuf = (unsigned char*)OPENSSL_malloc(siglen);
6407     if (!sigbuf) {
6408         PyErr_SetString(PyExc_MemoryError, "digest_sign");
6409         return NULL;
6410     }
6411 
6412     if (!EVP_DigestSign(ctx, sigbuf, &siglen, msgbuf, msglen)) {
6413         m2_PyErr_Msg(_evp_err);
6414         OPENSSL_cleanse(sigbuf, siglen);
6415         OPENSSL_free(sigbuf);
6416         return NULL;
6417     }
6418 
6419     ret = PyBytes_FromStringAndSize((char*)sigbuf, siglen);
6420 
6421     OPENSSL_cleanse(sigbuf, siglen);
6422     OPENSSL_free(sigbuf);
6423     return ret;
6424 
6425 }
6426 #endif
6427 
digest_verify_init(EVP_MD_CTX * ctx,EVP_PKEY * pkey)6428 int digest_verify_init(EVP_MD_CTX *ctx, EVP_PKEY *pkey) {
6429     return EVP_DigestVerifyInit(ctx, NULL, NULL, NULL, pkey);
6430 }
6431 
digest_verify_update(EVP_MD_CTX * ctx,PyObject * blob)6432 int digest_verify_update(EVP_MD_CTX *ctx, PyObject *blob) {
6433     const void *buf;
6434     int len = 0;
6435 
6436     if (m2_PyObject_AsReadBufferInt(blob, (const void **)&buf, &len) == -1)
6437         return -1;
6438 
6439     return EVP_DigestVerifyUpdate(ctx, buf, len);
6440 }
6441 
digest_verify_final(EVP_MD_CTX * ctx,PyObject * blob)6442 int digest_verify_final(EVP_MD_CTX *ctx, PyObject *blob) {
6443     unsigned char *sigbuf;
6444     int len = 0;
6445 
6446     if (m2_PyObject_AsReadBufferInt(blob, (const void **)&sigbuf, &len) == -1)
6447         return -1;
6448 
6449     return EVP_DigestVerifyFinal(ctx, sigbuf, len);
6450 }
6451 
6452 #if OPENSSL_VERSION_NUMBER >= 0x10101000L
digest_verify(EVP_MD_CTX * ctx,PyObject * sig,PyObject * msg)6453 int digest_verify(EVP_MD_CTX *ctx, PyObject *sig, PyObject *msg) {
6454     unsigned char *sigbuf;
6455     unsigned char *msgbuf;
6456     int siglen = 0;
6457     int msglen = 0;
6458 
6459     if (m2_PyObject_AsReadBufferInt(sig, (const void **)&sigbuf, &siglen) == -1)
6460         return -1;
6461 
6462     if (m2_PyObject_AsReadBufferInt(msg, (const void **)&msgbuf, &msglen) == -1)
6463         return -1;
6464 
6465     return EVP_DigestVerify(ctx, sigbuf, siglen, msgbuf, msglen);
6466 }
6467 #endif
6468 
6469 
get_digestbyname(const char * name)6470 const EVP_MD *get_digestbyname(const char* name) {
6471     const EVP_MD *ret = NULL;
6472 
6473     if ((ret = EVP_get_digestbyname(name)) == NULL) {
6474         m2_PyErr_Msg(_evp_err);
6475     }
6476 
6477     return ret;
6478 }
6479 
6480 
pkey_write_pem_no_cipher(EVP_PKEY * pkey,BIO * f,PyObject * pyfunc)6481 int pkey_write_pem_no_cipher(EVP_PKEY *pkey, BIO *f, PyObject *pyfunc) {
6482     int ret;
6483 
6484     Py_INCREF(pyfunc);
6485     Py_BEGIN_ALLOW_THREADS
6486     ret = PEM_write_bio_PKCS8PrivateKey(f, pkey, NULL, NULL, 0,
6487             passphrase_callback, (void *)pyfunc);
6488     Py_END_ALLOW_THREADS
6489     Py_DECREF(pyfunc);
6490     return ret;
6491 }
6492 
6493 
pkey_write_pem(EVP_PKEY * pkey,BIO * f,EVP_CIPHER * cipher,PyObject * pyfunc)6494 int pkey_write_pem(EVP_PKEY *pkey, BIO *f, EVP_CIPHER *cipher, PyObject *pyfunc) {
6495     int ret;
6496 
6497     Py_INCREF(pyfunc);
6498     Py_BEGIN_ALLOW_THREADS
6499     ret = PEM_write_bio_PKCS8PrivateKey(f, pkey, cipher, NULL, 0,
6500             passphrase_callback, (void *)pyfunc);
6501     Py_END_ALLOW_THREADS
6502     Py_DECREF(pyfunc);
6503     return ret;
6504 }
6505 
6506 
pkey_new(void)6507 EVP_PKEY *pkey_new(void) {
6508     EVP_PKEY *ret;
6509 
6510     if ((ret = EVP_PKEY_new()) == NULL) {
6511         PyErr_Format(PyExc_MemoryError,
6512                      "Insufficient memory for new key in function %s.", __FUNCTION__);
6513     }
6514 
6515     return ret;
6516 }
6517 
pkey_read_pem(BIO * f,PyObject * pyfunc)6518 EVP_PKEY *pkey_read_pem(BIO *f, PyObject *pyfunc) {
6519     EVP_PKEY *pk;
6520 
6521     Py_INCREF(pyfunc);
6522     Py_BEGIN_ALLOW_THREADS
6523     pk = PEM_read_bio_PrivateKey(f, NULL, passphrase_callback, (void *)pyfunc);
6524     Py_END_ALLOW_THREADS
6525     Py_DECREF(pyfunc);
6526 
6527     if (pk == NULL) {
6528         PyErr_Format(_evp_err,
6529                      "Unable to read private key in function %s.", __FUNCTION__);
6530     }
6531 
6532     return pk;
6533 }
6534 
pkey_read_pem_pubkey(BIO * f,PyObject * pyfunc)6535 EVP_PKEY *pkey_read_pem_pubkey(BIO *f, PyObject *pyfunc) {
6536     EVP_PKEY *pk;
6537 
6538     Py_INCREF(pyfunc);
6539     Py_BEGIN_ALLOW_THREADS
6540     pk = PEM_read_bio_PUBKEY(f, NULL, passphrase_callback, (void *)pyfunc);
6541     Py_END_ALLOW_THREADS
6542     Py_DECREF(pyfunc);
6543 
6544     if (pk == NULL) {
6545         PyErr_Format(_evp_err,
6546                      "Unable to read public key in function %s.", __FUNCTION__);
6547     }
6548 
6549     return pk;
6550 }
6551 
6552 
pkey_assign_rsa(EVP_PKEY * pkey,RSA * rsa)6553 int pkey_assign_rsa(EVP_PKEY *pkey, RSA *rsa) {
6554     return EVP_PKEY_assign_RSA(pkey, rsa);
6555 }
6556 
pkey_as_der(EVP_PKEY * pkey)6557 PyObject *pkey_as_der(EVP_PKEY *pkey) {
6558     unsigned char * pp = NULL;
6559     int len;
6560     PyObject * der;
6561     len = i2d_PUBKEY(pkey, &pp);
6562     if (len < 0){
6563         PyErr_SetString(_evp_err, "EVP_PKEY as DER failed");
6564         return NULL;
6565     }
6566 
6567     der = PyBytes_FromStringAndSize((char*)pp, len);
6568 
6569     OPENSSL_free(pp);
6570     return der;
6571 }
6572 
pkey_get_modulus(EVP_PKEY * pkey)6573 PyObject *pkey_get_modulus(EVP_PKEY *pkey)
6574 {
6575     RSA *rsa;
6576     DSA *dsa;
6577     BIO *bio;
6578     BUF_MEM *bptr;
6579     PyObject *ret;
6580     const BIGNUM* bn;
6581 
6582     switch (EVP_PKEY_base_id(pkey)) {
6583         case EVP_PKEY_RSA:
6584             rsa = EVP_PKEY_get1_RSA(pkey);
6585 
6586             bio = BIO_new(BIO_s_mem());
6587             if (!bio) {
6588                 RSA_free(rsa);
6589                 PyErr_SetString(PyExc_MemoryError, "pkey_get_modulus");
6590                 return NULL;
6591             }
6592 
6593             RSA_get0_key(rsa, &bn, NULL, NULL);
6594             if (!BN_print(bio, bn)) {
6595                 m2_PyErr_Msg(PyExc_RuntimeError);
6596                 BIO_free(bio);
6597                 RSA_free(rsa);
6598                 return NULL;
6599             }
6600             BIO_get_mem_ptr(bio, &bptr);
6601 
6602             ret = PyBytes_FromStringAndSize(bptr->data, bptr->length);
6603 
6604             (void)BIO_set_close(bio, BIO_CLOSE);
6605             BIO_free(bio);
6606             RSA_free(rsa);
6607 
6608             return ret;
6609             break;
6610 
6611         case EVP_PKEY_DSA:
6612             dsa = EVP_PKEY_get1_DSA(pkey);
6613 
6614             bio = BIO_new(BIO_s_mem());
6615             if (!bio) {
6616                 DSA_free(dsa);
6617                 PyErr_SetString(PyExc_MemoryError, "pkey_get_modulus");
6618                 return NULL;
6619             }
6620 
6621             DSA_get0_key(dsa, &bn, NULL);
6622             if (!BN_print(bio, bn)) {
6623                 m2_PyErr_Msg(PyExc_RuntimeError);
6624                 BIO_free(bio);
6625                 DSA_free(dsa);
6626                 return NULL;
6627             }
6628             BIO_get_mem_ptr(bio, &bptr);
6629 
6630             ret = PyBytes_FromStringAndSize(bptr->data, bptr->length);
6631 
6632             (void)BIO_set_close(bio, BIO_CLOSE);
6633             BIO_free(bio);
6634             DSA_free(dsa);
6635 
6636             return ret;
6637             break;
6638 
6639         default:
6640             PyErr_SetString(_evp_err, "unsupported key type");
6641             return NULL;
6642     }
6643 }
6644 
6645 
6646 
6647 #include <openssl/evp.h>
6648 
6649 #if OPENSSL_VERSION_NUMBER >= 0x0090800fL
6650 #include <openssl/aes.h>
6651 #endif
6652 
6653 /*
6654 // 2004-10-10, ngps:
6655 // CTR mode is not included in the default OpenSSL build.
6656 // To use the AES CTR ciphers, link with your own copy of OpenSSL.
6657 */
6658 #ifdef HAVE_AES_CTR
6659 extern EVP_CIPHER const *EVP_aes_128_ctr(void);
6660 extern EVP_CIPHER const *EVP_aes_192_ctr(void);
6661 extern EVP_CIPHER const *EVP_aes_256_ctr(void);
6662 #endif
6663 
6664 
aes_new(void)6665 AES_KEY *aes_new(void) {
6666     AES_KEY *key;
6667 
6668     if (!(key = (AES_KEY *)PyMem_Malloc(sizeof(AES_KEY)))) {
6669         PyErr_SetString(PyExc_MemoryError,
6670                         "Insufficient memory for AES key.");
6671         return NULL;
6672     }
6673     return key;
6674 }
6675 
AES_free(AES_KEY * key)6676 void AES_free(AES_KEY *key) {
6677     PyMem_Free((void *)key);
6678 }
6679 
6680 /*
6681 // op == 0: encrypt
6682 // otherwise: decrypt (Python code will supply the value 1.)
6683 */
AES_set_key(AES_KEY * key,PyObject * value,int bits,int op)6684 PyObject *AES_set_key(AES_KEY *key, PyObject *value, int bits, int op) {
6685     char *vbuf;
6686     Py_ssize_t vlen;
6687 
6688     if (PyBytes_AsStringAndSize(value, &vbuf, &vlen) == -1)
6689         return NULL;
6690 
6691     if (op == 0)
6692         AES_set_encrypt_key((const unsigned char *)vbuf, bits, key);
6693     else
6694         AES_set_decrypt_key((const unsigned char *)vbuf, bits, key);
6695     Py_RETURN_NONE;
6696 }
6697 
6698 /*
6699 // op == 0: encrypt
6700 // otherwise: decrypt (Python code will supply the value 1.)
6701 */
AES_crypt(const AES_KEY * key,PyObject * in,int outlen,int op)6702 PyObject *AES_crypt(const AES_KEY *key, PyObject *in, int outlen, int op) {
6703     char *buf;
6704     Py_ssize_t len;
6705     unsigned char *out;
6706     PyObject *res;
6707 
6708     if (PyBytes_AsStringAndSize(in, &buf, &len) == -1)
6709         return NULL;
6710 
6711     if (!(out=(unsigned char *)PyMem_Malloc(outlen))) {
6712         PyErr_SetString(PyExc_MemoryError, "AES_crypt");
6713         return NULL;
6714     }
6715     if (op == 0)
6716         AES_encrypt((const unsigned char *)buf, out, key);
6717     else
6718         AES_decrypt((const unsigned char *)buf, out, key);
6719     res = PyBytes_FromStringAndSize((char*)out, outlen);
6720     PyMem_Free(out);
6721     return res;
6722 }
6723 
AES_type_check(AES_KEY * key)6724 int AES_type_check(AES_KEY *key) {
6725     return 1;
6726 }
6727 
6728 
6729 #include <openssl/rc4.h>
6730 
6731 
rc4_new(void)6732 RC4_KEY *rc4_new(void) {
6733     RC4_KEY *key;
6734 
6735     if (!(key = (RC4_KEY *)PyMem_Malloc(sizeof(RC4_KEY))))
6736         PyErr_SetString(PyExc_MemoryError, "rc4_new");
6737     return key;
6738 }
6739 
rc4_free(RC4_KEY * key)6740 void rc4_free(RC4_KEY *key) {
6741     PyMem_Free((void *)key);
6742 }
6743 
rc4_set_key(RC4_KEY * key,PyObject * value)6744 PyObject *rc4_set_key(RC4_KEY *key, PyObject *value) {
6745     const void *vbuf;
6746     int vlen = 0;
6747 
6748     if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
6749         return NULL;
6750 
6751     RC4_set_key(key, vlen, vbuf);
6752     Py_RETURN_NONE;
6753 }
6754 
rc4_update(RC4_KEY * key,PyObject * in)6755 PyObject *rc4_update(RC4_KEY *key, PyObject *in) {
6756     PyObject *ret;
6757     const void *buf;
6758     Py_ssize_t len;
6759     void *out;
6760 
6761     if (m2_PyObject_AsReadBuffer(in, &buf, &len) == -1)
6762         return NULL;
6763 
6764     if (!(out = PyMem_Malloc(len))) {
6765         PyErr_SetString(PyExc_MemoryError, "expected a string object");
6766         return NULL;
6767     }
6768     RC4(key, len, buf, out);
6769 
6770     ret = PyBytes_FromStringAndSize(out, len);
6771 
6772     PyMem_Free(out);
6773     return ret;
6774 }
6775 
rc4_type_check(RC4_KEY * key)6776 int rc4_type_check(RC4_KEY *key) {
6777     return 1;
6778 }
6779 
6780 
6781 #include <openssl/bn.h>
6782 #include <openssl/bio.h>
6783 #include <openssl/err.h>
6784 #include <openssl/pem.h>
6785 #include <openssl/dh.h>
6786 
6787 
6788 static PyObject *_dh_err;
6789 
dh_init(PyObject * dh_err)6790 void dh_init(PyObject *dh_err) {
6791     Py_INCREF(dh_err);
6792     _dh_err = dh_err;
6793 }
6794 
dh_type_check(DH * dh)6795 int dh_type_check(DH *dh) {
6796     /* Our getting here means we passed Swig's type checking,
6797     XXX Still need to check the pointer for sanity? */
6798     return 1;
6799 }
6800 
6801 
dh_read_parameters(BIO * bio)6802 DH *dh_read_parameters(BIO *bio) {
6803     return PEM_read_bio_DHparams(bio, NULL, NULL, NULL);
6804 }
6805 
dh_generate_parameters(int plen,int g,PyObject * pyfunc)6806 DH *dh_generate_parameters(int plen, int g, PyObject *pyfunc) {
6807     DH *dh;
6808     BN_GENCB *gencb;
6809     int ret;
6810 
6811     if ((gencb=BN_GENCB_new()) == NULL) {
6812         m2_PyErr_Msg(_dh_err);
6813         return NULL;
6814     }
6815 
6816     if ((dh=DH_new()) == NULL) {
6817         m2_PyErr_Msg(_dh_err);
6818         BN_GENCB_free(gencb);
6819         return NULL;
6820     }
6821 
6822     BN_GENCB_set(gencb, bn_gencb_callback, (void *)pyfunc);
6823 
6824     Py_INCREF(pyfunc);
6825     ret = DH_generate_parameters_ex(dh, plen, g, gencb);
6826     Py_DECREF(pyfunc);
6827     BN_GENCB_free(gencb);
6828 
6829     if (ret)
6830         return dh;
6831 
6832     m2_PyErr_Msg(_dh_err);
6833     DH_free(dh);
6834     return NULL;
6835 }
6836 
6837 /* Note return value shenanigan. */
dh_check(DH * dh)6838 int dh_check(DH *dh) {
6839     int err;
6840 
6841     return (DH_check(dh, &err)) ? 0 : err;
6842 }
6843 
dh_compute_key(DH * dh,PyObject * pubkey)6844 PyObject *dh_compute_key(DH *dh, PyObject *pubkey) {
6845     const void *pkbuf;
6846     int pklen = 0, klen;
6847     void *key;
6848     BIGNUM *pk;
6849     PyObject *ret;
6850 
6851     if (m2_PyObject_AsReadBufferInt(pubkey, &pkbuf, &pklen) == -1)
6852         return NULL;
6853 
6854     if (!(pk = BN_mpi2bn((unsigned char *)pkbuf, pklen, NULL))) {
6855         m2_PyErr_Msg(_dh_err);
6856         return NULL;
6857     }
6858     if (!(key = PyMem_Malloc(DH_size(dh)))) {
6859         BN_free(pk);
6860         PyErr_SetString(PyExc_MemoryError, "dh_compute_key");
6861         return NULL;
6862     }
6863     if ((klen = DH_compute_key((unsigned char *)key, pk, dh)) == -1) {
6864         BN_free(pk);
6865         PyMem_Free(key);
6866         m2_PyErr_Msg(_dh_err);
6867         return NULL;
6868     }
6869 
6870     ret = PyBytes_FromStringAndSize((const char *)key, klen);
6871 
6872     BN_free(pk);
6873     PyMem_Free(key);
6874     return ret;
6875 }
6876 
dh_get_p(DH * dh)6877 PyObject *dh_get_p(DH *dh) {
6878     const BIGNUM* p = NULL;
6879     DH_get0_pqg(dh, &p, NULL, NULL);
6880     if (!p) {
6881         PyErr_SetString(_dh_err, "'p' is unset");
6882         return NULL;
6883     }
6884     return bn_to_mpi(p);
6885 }
6886 
dh_get_g(DH * dh)6887 PyObject *dh_get_g(DH *dh) {
6888     const BIGNUM* g = NULL;
6889     DH_get0_pqg(dh, NULL, NULL, &g);
6890     if (!g) {
6891         PyErr_SetString(_dh_err, "'g' is unset");
6892         return NULL;
6893     }
6894     return bn_to_mpi(g);
6895 }
6896 
dh_get_pub(DH * dh)6897 PyObject *dh_get_pub(DH *dh) {
6898     const BIGNUM* pub_key = NULL;
6899     DH_get0_key(dh, &pub_key, NULL);
6900     if (!pub_key) {
6901         PyErr_SetString(_dh_err, "'pub' is unset");
6902         return NULL;
6903     }
6904     return bn_to_mpi(pub_key);
6905 }
6906 
dh_get_priv(DH * dh)6907 PyObject *dh_get_priv(DH *dh) {
6908     const BIGNUM* priv_key = NULL;
6909     DH_get0_key(dh, NULL, &priv_key);
6910     if (!priv_key) {
6911         PyErr_SetString(_dh_err, "'priv' is unset");
6912         return NULL;
6913     }
6914     return bn_to_mpi(priv_key);
6915 }
6916 
dh_set_pg(DH * dh,PyObject * pval,PyObject * gval)6917 PyObject *dh_set_pg(DH *dh, PyObject *pval, PyObject* gval) {
6918     BIGNUM* p, *g;
6919 
6920     if (!(p = m2_PyObject_AsBIGNUM(pval, _dh_err))
6921         || !(g = m2_PyObject_AsBIGNUM(gval, _dh_err)))
6922         return NULL;
6923 
6924     if (!DH_set0_pqg(dh, p, NULL, g)) {
6925         PyErr_SetString(_dh_err,
6926             "Cannot set prime number or generator of Z_p for DH.");
6927         BN_free(p);
6928         BN_free(g);
6929         return NULL;
6930         }
6931 
6932     Py_RETURN_NONE;
6933 }
6934 
6935 
6936 #include <openssl/bn.h>
6937 #include <openssl/err.h>
6938 #include <openssl/pem.h>
6939 #include <openssl/rsa.h>
6940 #include <openssl/opensslv.h>
6941 
6942 
6943 static PyObject *_rsa_err;
6944 
rsa_init(PyObject * rsa_err)6945 void rsa_init(PyObject *rsa_err) {
6946     Py_INCREF(rsa_err);
6947     _rsa_err = rsa_err;
6948 }
6949 
6950 
rsa_read_key(BIO * f,PyObject * pyfunc)6951 RSA *rsa_read_key(BIO *f, PyObject *pyfunc) {
6952     RSA *rsa;
6953 
6954     Py_INCREF(pyfunc);
6955     Py_BEGIN_ALLOW_THREADS
6956     rsa = PEM_read_bio_RSAPrivateKey(f, NULL, passphrase_callback, (void *)pyfunc);
6957     Py_END_ALLOW_THREADS
6958     Py_DECREF(pyfunc);
6959     return rsa;
6960 }
6961 
6962 
rsa_write_key(RSA * rsa,BIO * f,EVP_CIPHER * cipher,PyObject * pyfunc)6963 int rsa_write_key(RSA *rsa, BIO *f, EVP_CIPHER *cipher, PyObject *pyfunc) {
6964     int ret;
6965 
6966     Py_INCREF(pyfunc);
6967     Py_BEGIN_ALLOW_THREADS
6968     ret = PEM_write_bio_RSAPrivateKey(f, rsa, cipher, NULL, 0,
6969         passphrase_callback, (void *)pyfunc);
6970     Py_END_ALLOW_THREADS
6971     Py_DECREF(pyfunc);
6972     return ret;
6973 }
6974 
6975 
rsa_write_key_no_cipher(RSA * rsa,BIO * f,PyObject * pyfunc)6976 int rsa_write_key_no_cipher(RSA *rsa, BIO *f, PyObject *pyfunc) {
6977     int ret;
6978 
6979     Py_INCREF(pyfunc);
6980     Py_BEGIN_ALLOW_THREADS
6981     ret = PEM_write_bio_RSAPrivateKey(f, rsa, NULL, NULL, 0,
6982                       passphrase_callback, (void *)pyfunc);
6983     Py_END_ALLOW_THREADS
6984     Py_DECREF(pyfunc);
6985     return ret;
6986 }
6987 
6988 
rsa_read_pub_key(BIO * f)6989 RSA *rsa_read_pub_key(BIO *f) {
6990     return PEM_read_bio_RSA_PUBKEY(f, NULL, NULL, NULL);
6991 }
6992 
6993 
rsa_write_pub_key(RSA * rsa,BIO * f)6994 int rsa_write_pub_key(RSA *rsa, BIO *f) {
6995     return PEM_write_bio_RSA_PUBKEY(f, rsa);
6996 }
6997 
rsa_get_e(RSA * rsa)6998 PyObject *rsa_get_e(RSA *rsa) {
6999     const BIGNUM* e = NULL;
7000     RSA_get0_key(rsa, NULL, &e, NULL);
7001     if (!e) {
7002         PyErr_SetString(_rsa_err, "'e' is unset");
7003         return NULL;
7004     }
7005     return bn_to_mpi(e);
7006 }
7007 
rsa_get_n(RSA * rsa)7008 PyObject *rsa_get_n(RSA *rsa) {
7009     const BIGNUM* n = NULL;
7010     RSA_get0_key(rsa, &n, NULL, NULL);
7011     if (!n) {
7012         PyErr_SetString(_rsa_err, "'n' is unset");
7013         return NULL;
7014     }
7015     return bn_to_mpi(n);
7016 }
7017 
rsa_set_e(RSA * rsa,PyObject * eval)7018 PyObject *rsa_set_e(RSA *rsa, PyObject *eval) {
7019     const BIGNUM* n_read = NULL;
7020     BIGNUM* n = NULL;
7021     BIGNUM* e;
7022 
7023     if (!(e = m2_PyObject_AsBIGNUM(eval, _rsa_err))) {
7024         return NULL;
7025     }
7026 
7027     /* n and e must be set at the same time so if e is unset, set it to zero */
7028     RSA_get0_key(rsa, &n_read, NULL, NULL);
7029     if (!n_read) {
7030         n = BN_new();
7031     }
7032 
7033     if (RSA_set0_key(rsa, n, e, NULL) != 1) {
7034         PyErr_SetString(_rsa_err, "Cannot set fields of RSA object.");
7035         BN_free(e);
7036         BN_free(n);
7037         return NULL;
7038     }
7039     Py_RETURN_NONE;
7040 }
7041 
rsa_set_n(RSA * rsa,PyObject * nval)7042 PyObject *rsa_set_n(RSA *rsa, PyObject *nval) {
7043     BIGNUM* n;
7044     const BIGNUM* e_read = NULL;
7045     BIGNUM* e = NULL;
7046 
7047     if (!(n = m2_PyObject_AsBIGNUM(nval, _rsa_err))) {
7048         return NULL;
7049     }
7050 
7051     /* n and e must be set at the same time so if e is unset, set it to zero */
7052     RSA_get0_key(rsa, NULL, &e_read, NULL);
7053     if (!e_read) {
7054         e = BN_new();
7055     }
7056 
7057     if (RSA_set0_key(rsa, n, e, NULL) != 1) {
7058         PyErr_SetString(_rsa_err, "Cannot set fields of RSA object.");
7059         BN_free(n);
7060         BN_free(e);
7061         return NULL;
7062     }
7063     Py_RETURN_NONE;
7064 }
7065 
rsa_set_en(RSA * rsa,PyObject * eval,PyObject * nval)7066 PyObject *rsa_set_en(RSA *rsa, PyObject *eval, PyObject* nval) {
7067     BIGNUM* e, *n;
7068 
7069     if (!(e = m2_PyObject_AsBIGNUM(eval, _rsa_err)) ||
7070         !(n = m2_PyObject_AsBIGNUM(nval, _rsa_err))) {
7071         return NULL;
7072     }
7073 
7074     if (!RSA_set0_key(rsa, n, e, NULL)) {
7075         PyErr_SetString(_rsa_err, "Cannot set fields of RSA object.");
7076         BN_free(e);
7077         BN_free(n);
7078         return NULL;
7079     }
7080     Py_RETURN_NONE;
7081 }
7082 
PyObject_Bin_AsBIGNUM(PyObject * value)7083 static BIGNUM* PyObject_Bin_AsBIGNUM(PyObject* value) {
7084     BIGNUM* bn;
7085     const void* vbuf;
7086     int vlen = 0;
7087 
7088     if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
7089         return NULL;
7090 
7091     if (!(bn = BN_bin2bn((unsigned char *)vbuf, vlen, NULL))) {
7092         m2_PyErr_Msg(_rsa_err);
7093         return NULL;
7094         }
7095 
7096     return bn;
7097 }
7098 
rsa_set_en_bin(RSA * rsa,PyObject * eval,PyObject * nval)7099 PyObject *rsa_set_en_bin(RSA *rsa, PyObject *eval, PyObject* nval) {
7100     BIGNUM* e, *n;
7101 
7102     if (!(e = PyObject_Bin_AsBIGNUM(eval)) ||
7103         !(n = PyObject_Bin_AsBIGNUM(nval))) {
7104         return NULL;
7105     }
7106 
7107     if (!RSA_set0_key(rsa, e, n, NULL)) {
7108         PyErr_SetString(_rsa_err, "Cannot set fields of RSA object.");
7109         BN_free(e);
7110         BN_free(n);
7111         return NULL;
7112     }
7113     Py_RETURN_NONE;
7114 }
7115 
rsa_private_encrypt(RSA * rsa,PyObject * from,int padding)7116 PyObject *rsa_private_encrypt(RSA *rsa, PyObject *from, int padding) {
7117     const void *fbuf;
7118     void *tbuf;
7119     int flen = 0, tlen;
7120     PyObject *ret;
7121 
7122     if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1)
7123         return NULL;
7124 
7125     if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) {
7126         PyErr_SetString(PyExc_MemoryError, "rsa_private_encrypt");
7127         return NULL;
7128     }
7129     tlen = RSA_private_encrypt(flen, (unsigned char *)fbuf,
7130         (unsigned char *)tbuf, rsa, padding);
7131     if (tlen == -1) {
7132         m2_PyErr_Msg(_rsa_err);
7133         PyMem_Free(tbuf);
7134         return NULL;
7135     }
7136 
7137     ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen);
7138 
7139     PyMem_Free(tbuf);
7140     return ret;
7141 }
7142 
rsa_public_decrypt(RSA * rsa,PyObject * from,int padding)7143 PyObject *rsa_public_decrypt(RSA *rsa, PyObject *from, int padding) {
7144     const void *fbuf;
7145     void *tbuf;
7146     int flen = 0, tlen = 0;
7147     PyObject *ret;
7148 
7149     if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1)
7150         return NULL;
7151 
7152     /* OpenSSL docs are confused here: it says we only need buffer
7153      * 'RSA_size()-11', but it is true only for RSA PKCS#1 type 1
7154      * padding. For other uses we need to use different sizes. */
7155     if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) {
7156         PyErr_SetString(PyExc_MemoryError, "rsa_public_decrypt");
7157         return NULL;
7158     }
7159     tlen = RSA_public_decrypt(flen, (unsigned char *)fbuf,
7160         (unsigned char *)tbuf, rsa, padding);
7161     if (tlen == -1) {
7162         m2_PyErr_Msg(_rsa_err);
7163         PyMem_Free(tbuf);
7164         return NULL;
7165     }
7166 
7167     ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen);
7168 
7169     PyMem_Free(tbuf);
7170     return ret;
7171 }
7172 
rsa_public_encrypt(RSA * rsa,PyObject * from,int padding)7173 PyObject *rsa_public_encrypt(RSA *rsa, PyObject *from, int padding) {
7174     const void *fbuf;
7175     void *tbuf;
7176     int flen = 0, tlen;
7177     PyObject *ret;
7178 
7179     if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1)
7180         return NULL;
7181 
7182     if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) {
7183         PyErr_SetString(PyExc_MemoryError, "rsa_public_encrypt");
7184         return NULL;
7185     }
7186     tlen = RSA_public_encrypt(flen, (unsigned char *)fbuf,
7187         (unsigned char *)tbuf, rsa, padding);
7188     if (tlen == -1) {
7189         m2_PyErr_Msg(_rsa_err);
7190         PyMem_Free(tbuf);
7191         return NULL;
7192     }
7193 
7194     ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen);
7195 
7196     PyMem_Free(tbuf);
7197     return ret;
7198 }
7199 
rsa_private_decrypt(RSA * rsa,PyObject * from,int padding)7200 PyObject *rsa_private_decrypt(RSA *rsa, PyObject *from, int padding) {
7201     const void *fbuf;
7202     void *tbuf;
7203     int flen = 0, tlen;
7204     PyObject *ret;
7205 
7206     if (m2_PyObject_AsReadBufferInt(from, &fbuf, &flen) == -1)
7207         return NULL;
7208 
7209     if (!(tbuf = PyMem_Malloc(RSA_size(rsa)))) {
7210         PyErr_SetString(PyExc_MemoryError, "rsa_private_decrypt");
7211         return NULL;
7212     }
7213     tlen = RSA_private_decrypt(flen, (unsigned char *)fbuf,
7214         (unsigned char *)tbuf, rsa, padding);
7215     if (tlen == -1) {
7216         m2_PyErr_Msg(_rsa_err);
7217         PyMem_Free(tbuf);
7218         return NULL;
7219     }
7220     ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen);
7221 
7222     PyMem_Free(tbuf);
7223     return ret;
7224 }
7225 
7226 #if OPENSSL_VERSION_NUMBER >= 0x0090708fL
rsa_padding_add_pkcs1_pss(RSA * rsa,PyObject * digest,EVP_MD * hash,int salt_length)7227 PyObject *rsa_padding_add_pkcs1_pss(RSA *rsa, PyObject *digest, EVP_MD *hash, int salt_length) {
7228     const void *dbuf;
7229     unsigned char *tbuf;
7230     int dlen, result, tlen;
7231     PyObject *ret;
7232 
7233     if (m2_PyObject_AsReadBufferInt(digest, &dbuf, &dlen) == -1)
7234         return NULL;
7235 
7236     tlen = RSA_size(rsa);
7237 
7238     if (!(tbuf = OPENSSL_malloc(tlen))) {
7239         PyErr_SetString(PyExc_MemoryError, "rsa_padding_add_pkcs1_pss");
7240         return NULL;
7241     }
7242     result = RSA_padding_add_PKCS1_PSS(
7243         rsa,
7244         tbuf,
7245         (unsigned char *)dbuf,
7246         hash,
7247         salt_length);
7248 
7249     if (result == -1) {
7250         m2_PyErr_Msg(_rsa_err);
7251         OPENSSL_cleanse(tbuf, tlen);
7252         OPENSSL_free(tbuf);
7253         return NULL;
7254     }
7255     ret = PyBytes_FromStringAndSize((const char *)tbuf, tlen);
7256     OPENSSL_cleanse(tbuf, tlen);
7257     OPENSSL_free(tbuf);
7258     return ret;
7259 }
7260 
rsa_verify_pkcs1_pss(RSA * rsa,PyObject * digest,PyObject * signature,EVP_MD * hash,int salt_length)7261 int rsa_verify_pkcs1_pss(RSA *rsa, PyObject *digest, PyObject *signature, EVP_MD *hash, int salt_length) {
7262     const void *dbuf;
7263     const void *sbuf;
7264     int dlen, slen, ret;
7265 
7266     if (m2_PyObject_AsReadBufferInt(digest, &dbuf, &dlen) == -1) {
7267         return 0;
7268     }
7269 
7270     if (m2_PyObject_AsReadBufferInt(signature, &sbuf, &slen) == -1) {
7271         return 0;
7272     }
7273 
7274     ret = RSA_verify_PKCS1_PSS(
7275         rsa,
7276         (unsigned char *)dbuf,
7277         hash,
7278         (unsigned char *)sbuf,
7279         salt_length);
7280 
7281     return ret;
7282 }
7283 #endif
7284 
rsa_sign(RSA * rsa,PyObject * py_digest_string,int method_type)7285 PyObject *rsa_sign(RSA *rsa, PyObject *py_digest_string, int method_type) {
7286     int digest_len = 0;
7287     int buf_len = 0;
7288     int ret = 0;
7289     unsigned int real_buf_len = 0;
7290     char *digest_string = NULL;
7291     unsigned char * sign_buf = NULL;
7292     PyObject *signature;
7293 
7294     ret = m2_PyString_AsStringAndSizeInt(py_digest_string, &digest_string,
7295                                          &digest_len);
7296     if (ret == -1) {
7297         /* PyString_AsStringAndSize raises the correct exceptions. */
7298         return NULL;
7299     }
7300 
7301     buf_len = RSA_size(rsa);
7302     sign_buf = (unsigned char *)PyMem_Malloc(buf_len);
7303     ret = RSA_sign(method_type, (const unsigned char *)digest_string, digest_len,
7304                    sign_buf, &real_buf_len, rsa);
7305 
7306     if (!ret) {
7307         m2_PyErr_Msg(_rsa_err);
7308         PyMem_Free(sign_buf);
7309         return NULL;
7310     }
7311 
7312     signature =  PyBytes_FromStringAndSize((const char*) sign_buf, buf_len);
7313 
7314     PyMem_Free(sign_buf);
7315     return signature;
7316 }
7317 
rsa_verify(RSA * rsa,PyObject * py_verify_string,PyObject * py_sign_string,int method_type)7318 int rsa_verify(RSA *rsa, PyObject *py_verify_string, PyObject* py_sign_string, int method_type){
7319     int ret = 0;
7320     char * sign_string = NULL;
7321     char * verify_string = NULL;
7322     int verify_len = 0;
7323     int sign_len = 0;
7324 
7325     ret = m2_PyString_AsStringAndSizeInt(py_verify_string, &verify_string,
7326                                          &verify_len);
7327     if (ret == -1) {
7328         /* PyString_AsStringAndSize raises the correct exceptions. */
7329         return 0;
7330     }
7331     ret = m2_PyString_AsStringAndSizeInt(py_sign_string, &sign_string,
7332                                          &sign_len);
7333     if (ret == -1) {
7334         return 0;
7335     }
7336 
7337     ret = RSA_verify(method_type, (unsigned char *) verify_string,
7338                      verify_len, (unsigned char *) sign_string,
7339                      sign_len, rsa);
7340     if (!ret) {
7341         m2_PyErr_Msg(_rsa_err);
7342         return 0;
7343     }
7344     return ret;
7345 }
7346 
rsa_generate_key(int bits,unsigned long e,PyObject * pyfunc)7347 PyObject *rsa_generate_key(int bits, unsigned long e, PyObject *pyfunc) {
7348     RSA *rsa;
7349     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
7350     BN_GENCB *gencb;
7351     BIGNUM *e_big;
7352     int ret;
7353 
7354     if ((e_big=BN_new()) == NULL) {
7355         m2_PyErr_Msg(_rsa_err);
7356         return NULL;
7357     }
7358 
7359     if (BN_set_word(e_big, e) == 0) {
7360         m2_PyErr_Msg(_rsa_err);
7361         BN_free(e_big);
7362         return NULL;
7363     }
7364 
7365     if ((gencb=BN_GENCB_new()) == NULL) {
7366         m2_PyErr_Msg(_rsa_err);
7367         BN_free(e_big);
7368         return NULL;
7369     }
7370 
7371     if ((rsa = RSA_new()) == NULL) {
7372         m2_PyErr_Msg(_rsa_err);
7373         BN_free(e_big);
7374         BN_GENCB_free(gencb);
7375         return NULL;
7376     }
7377 
7378     BN_GENCB_set(gencb, bn_gencb_callback, (void *) pyfunc);
7379 
7380     Py_INCREF(pyfunc);
7381     ret = RSA_generate_key_ex(rsa, bits, e_big, gencb);
7382     BN_free(e_big);
7383     BN_GENCB_free(gencb);
7384     Py_DECREF(pyfunc);
7385 
7386     if (ret)
7387         return SWIG_NewPointerObj((void *)rsa, SWIGTYPE_p_RSA, 0);
7388 
7389     m2_PyErr_Msg(_rsa_err);
7390     RSA_free(rsa);
7391     return NULL;
7392 }
7393 
rsa_type_check(RSA * rsa)7394 int rsa_type_check(RSA *rsa) {
7395     return 1;
7396 }
7397 
rsa_check_pub_key(RSA * rsa)7398 int rsa_check_pub_key(RSA *rsa) {
7399     const BIGNUM* n, *e;
7400     RSA_get0_key(rsa, &n, &e, NULL);
7401     return n && e;
7402 }
7403 
7404 
rsa_write_key_der(RSA * rsa,BIO * bio)7405 int rsa_write_key_der(RSA *rsa, BIO *bio) {
7406     return i2d_RSAPrivateKey_bio(bio, rsa);
7407 }
7408 
7409 
7410 #include <openssl/bn.h>
7411 #include <openssl/err.h>
7412 #include <openssl/pem.h>
7413 #include <openssl/dsa.h>
7414 
dsa_sig_get_r(DSA_SIG * dsa_sig)7415 PyObject *dsa_sig_get_r(DSA_SIG *dsa_sig) {
7416     const BIGNUM* pr;
7417     DSA_SIG_get0(dsa_sig, &pr, NULL);
7418     return bn_to_mpi(pr);
7419 }
7420 
dsa_sig_get_s(DSA_SIG * dsa_sig)7421 PyObject *dsa_sig_get_s(DSA_SIG *dsa_sig) {
7422     const BIGNUM* qs;
7423     DSA_SIG_get0(dsa_sig, NULL, &qs);
7424     return bn_to_mpi(qs);
7425 }
7426 
7427 
7428 static PyObject *_dsa_err;
7429 
dsa_init(PyObject * dsa_err)7430 void dsa_init(PyObject *dsa_err) {
7431     Py_INCREF(dsa_err);
7432     _dsa_err = dsa_err;
7433 }
7434 
7435 
dsa_generate_parameters(int bits,PyObject * pyfunc)7436 DSA *dsa_generate_parameters(int bits, PyObject *pyfunc) {
7437     DSA *dsa;
7438     BN_GENCB *gencb;
7439     int ret;
7440 
7441     if ((gencb=BN_GENCB_new()) == NULL) {
7442         m2_PyErr_Msg(_dh_err);
7443         return NULL;
7444     }
7445 
7446     if ((dsa = DSA_new()) == NULL) {
7447         m2_PyErr_Msg(_dsa_err);
7448         BN_GENCB_free(gencb);
7449         return NULL;
7450     }
7451 
7452     BN_GENCB_set(gencb, bn_gencb_callback, (void *) pyfunc);
7453 
7454     Py_INCREF(pyfunc);
7455     ret = DSA_generate_parameters_ex(dsa, bits, NULL, 0, NULL, NULL,
7456                                      gencb);
7457     Py_DECREF(pyfunc);
7458     BN_GENCB_free(gencb);
7459 
7460     if (ret)
7461         return dsa;
7462 
7463     m2_PyErr_Msg(_dsa_err);
7464     DSA_free(dsa);
7465     return NULL;
7466 }
7467 
dsa_read_params(BIO * f,PyObject * pyfunc)7468 DSA *dsa_read_params(BIO *f, PyObject *pyfunc) {
7469     DSA *ret;
7470 
7471     Py_INCREF(pyfunc);
7472     Py_BEGIN_ALLOW_THREADS
7473     ret = PEM_read_bio_DSAparams(f, NULL, passphrase_callback, (void *)pyfunc);
7474     Py_END_ALLOW_THREADS
7475     Py_DECREF(pyfunc);
7476 
7477     if (ret == NULL) {
7478         m2_PyErr_Msg(_dsa_err);
7479     }
7480 
7481     return ret;
7482 }
7483 
dsa_read_key(BIO * f,PyObject * pyfunc)7484 DSA *dsa_read_key(BIO *f, PyObject *pyfunc) {
7485     DSA *ret;
7486 
7487     Py_INCREF(pyfunc);
7488     Py_BEGIN_ALLOW_THREADS
7489     ret = PEM_read_bio_DSAPrivateKey(f, NULL, passphrase_callback, (void *)pyfunc);
7490     Py_END_ALLOW_THREADS
7491     Py_DECREF(pyfunc);
7492 
7493     if (ret == NULL) {
7494         m2_PyErr_Msg(_dsa_err);
7495     }
7496 
7497     return ret;
7498 }
7499 
dsa_read_pub_key(BIO * f,PyObject * pyfunc)7500 DSA *dsa_read_pub_key(BIO *f, PyObject *pyfunc) {
7501     DSA *ret;
7502 
7503     Py_INCREF(pyfunc);
7504     Py_BEGIN_ALLOW_THREADS
7505     ret = PEM_read_bio_DSA_PUBKEY(f, NULL, passphrase_callback, (void *)pyfunc);
7506     Py_END_ALLOW_THREADS
7507     Py_DECREF(pyfunc);
7508 
7509     if (ret == NULL) {
7510         m2_PyErr_Msg(_dsa_err);
7511     }
7512 
7513     return ret;
7514 }
7515 
7516 
dsa_get_p(DSA * dsa)7517 PyObject *dsa_get_p(DSA *dsa) {
7518     const BIGNUM* p = NULL;
7519     DSA_get0_pqg(dsa, &p, NULL, NULL);
7520     if (!p) {
7521         PyErr_SetString(_dsa_err, "'p' is unset");
7522         return NULL;
7523     }
7524     return bn_to_mpi(p);
7525 }
7526 
dsa_get_q(DSA * dsa)7527 PyObject *dsa_get_q(DSA *dsa) {
7528     const BIGNUM* q = NULL;
7529     DSA_get0_pqg(dsa, NULL, &q, NULL);
7530     if (!q) {
7531         PyErr_SetString(_dsa_err, "'q' is unset");
7532         return NULL;
7533     }
7534     return bn_to_mpi(q);
7535 }
7536 
dsa_get_g(DSA * dsa)7537 PyObject *dsa_get_g(DSA *dsa) {
7538     const BIGNUM* g = NULL;
7539     DSA_get0_pqg(dsa, NULL, NULL, &g);
7540     if (!g) {
7541         PyErr_SetString(_dsa_err, "'g' is unset");
7542         return NULL;
7543     }
7544     return bn_to_mpi(g);
7545 }
7546 
dsa_get_pub(DSA * dsa)7547 PyObject *dsa_get_pub(DSA *dsa) {
7548     const BIGNUM* pub_key = NULL;
7549     DSA_get0_key(dsa, &pub_key, NULL);
7550     if (!pub_key) {
7551         PyErr_SetString(_dsa_err, "'pub' is unset");
7552         return NULL;
7553     }
7554     return bn_to_mpi(pub_key);
7555 }
7556 
dsa_get_priv(DSA * dsa)7557 PyObject *dsa_get_priv(DSA *dsa) {
7558     const BIGNUM* priv_key = NULL;
7559     DSA_get0_key(dsa, NULL, &priv_key);
7560     if (!priv_key) {
7561         PyErr_SetString(_dsa_err, "'priv' is unset");
7562         return NULL;
7563     }
7564     return bn_to_mpi(priv_key);
7565 }
7566 
dsa_set_pqg(DSA * dsa,PyObject * pval,PyObject * qval,PyObject * gval)7567 PyObject *dsa_set_pqg(DSA *dsa, PyObject *pval, PyObject* qval, PyObject* gval) {
7568     BIGNUM* p, *q, *g;
7569 
7570     if (!(p = m2_PyObject_AsBIGNUM(pval, _dsa_err))
7571         || !(q = m2_PyObject_AsBIGNUM(qval, _dsa_err))
7572         || !(g = m2_PyObject_AsBIGNUM(gval, _dsa_err)))
7573         return NULL;
7574 
7575     if (!DSA_set0_pqg(dsa, p, q, g)) {
7576         PyErr_SetString(
7577             _dsa_err,
7578             "Cannot set prime number, subprime, or generator of subgroup for DSA.");
7579         BN_free(p);
7580         BN_free(q);
7581         BN_free(g);
7582         return NULL;
7583         }
7584 
7585     Py_RETURN_NONE;
7586     }
7587 
dsa_set_pub(DSA * dsa,PyObject * value)7588 PyObject *dsa_set_pub(DSA *dsa, PyObject *value) {
7589     BIGNUM *bn;
7590     const void *vbuf;
7591     int vlen = 0;
7592 
7593     if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
7594         return NULL;
7595 
7596     if (!(bn = BN_mpi2bn((unsigned char *)vbuf, vlen, NULL))) {
7597         m2_PyErr_Msg(_dsa_err);
7598         return NULL;
7599     }
7600     if (!DSA_set0_key(dsa, bn, NULL)) {
7601         BN_free(bn);
7602         PyErr_SetString(_dsa_err, "Cannot set private and public key for DSA.");
7603     }
7604     Py_RETURN_NONE;
7605 }
7606 
7607 
dsa_write_params_bio(DSA * dsa,BIO * f)7608 int dsa_write_params_bio(DSA* dsa, BIO* f) {
7609     return PEM_write_bio_DSAparams(f, dsa);
7610 }
7611 
7612 
dsa_write_key_bio(DSA * dsa,BIO * f,EVP_CIPHER * cipher,PyObject * pyfunc)7613 int dsa_write_key_bio(DSA* dsa, BIO* f, EVP_CIPHER *cipher, PyObject *pyfunc) {
7614     int ret;
7615 
7616     Py_INCREF(pyfunc);
7617     Py_BEGIN_ALLOW_THREADS
7618     ret = PEM_write_bio_DSAPrivateKey(f, dsa, cipher, NULL, 0,
7619                                         passphrase_callback, (void *)pyfunc);
7620     Py_END_ALLOW_THREADS
7621     Py_DECREF(pyfunc);
7622     return ret;
7623 }
7624 
7625 
dsa_write_key_bio_no_cipher(DSA * dsa,BIO * f,PyObject * pyfunc)7626 int dsa_write_key_bio_no_cipher(DSA* dsa, BIO* f, PyObject *pyfunc) {
7627     int ret;
7628 
7629     Py_INCREF(pyfunc);
7630     Py_BEGIN_ALLOW_THREADS
7631     ret = PEM_write_bio_DSAPrivateKey(f, dsa, NULL, NULL, 0,
7632                                         passphrase_callback, (void *)pyfunc);
7633     Py_END_ALLOW_THREADS
7634     Py_DECREF(pyfunc);
7635     return ret;
7636 }
7637 
7638 
dsa_write_pub_key_bio(DSA * dsa,BIO * f)7639 int dsa_write_pub_key_bio(DSA* dsa, BIO* f) {
7640     return PEM_write_bio_DSA_PUBKEY(f, dsa);
7641 }
7642 
7643 
dsa_sign(DSA * dsa,PyObject * value)7644 PyObject *dsa_sign(DSA *dsa, PyObject *value) {
7645     const void *vbuf;
7646     int vlen = 0;
7647     PyObject *tuple;
7648     DSA_SIG *sig;
7649 
7650     if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
7651         return NULL;
7652 
7653     if (!(sig = DSA_do_sign(vbuf, vlen, dsa))) {
7654         m2_PyErr_Msg(_dsa_err);
7655         return NULL;
7656     }
7657     if (!(tuple = PyTuple_New(2))) {
7658         DSA_SIG_free(sig);
7659         PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails");
7660         return NULL;
7661     }
7662     PyTuple_SET_ITEM(tuple, 0, dsa_sig_get_r(sig));
7663     PyTuple_SET_ITEM(tuple, 1, dsa_sig_get_s(sig));
7664     DSA_SIG_free(sig);
7665     return tuple;
7666 }
7667 
dsa_verify(DSA * dsa,PyObject * value,PyObject * r,PyObject * s)7668 int dsa_verify(DSA *dsa, PyObject *value, PyObject *r, PyObject *s) {
7669     const void *vbuf, *rbuf, *sbuf;
7670     int vlen = 0, rlen = 0, slen = 0;
7671     DSA_SIG *sig;
7672     BIGNUM* pr, *ps;
7673     int ret;
7674 
7675     if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
7676         || (m2_PyObject_AsReadBufferInt(r, &rbuf, &rlen) == -1)
7677         || (m2_PyObject_AsReadBufferInt(s, &sbuf, &slen) == -1))
7678         return -1;
7679 
7680     if (!(sig = DSA_SIG_new())) {
7681         m2_PyErr_Msg(_dsa_err);
7682         return -1;
7683     }
7684     if (!(pr = BN_mpi2bn((unsigned char *)rbuf, rlen, NULL))) {
7685         m2_PyErr_Msg(_dsa_err);
7686         DSA_SIG_free(sig);
7687         return -1;
7688     }
7689     if (!(ps = BN_mpi2bn((unsigned char *)sbuf, slen, NULL))) {
7690         m2_PyErr_Msg(_dsa_err);
7691         DSA_SIG_free(sig);
7692         BN_free(pr);
7693         return -1;
7694     }
7695     if (!DSA_SIG_set0(sig, pr, ps)) {
7696         m2_PyErr_Msg(_dsa_err);
7697         DSA_SIG_free(sig);
7698         BN_free(pr);
7699         BN_free(ps);
7700         return -1;
7701     }
7702 
7703     ret = DSA_do_verify(vbuf, vlen, sig, dsa);
7704     DSA_SIG_free(sig);
7705     if (ret == -1)
7706         m2_PyErr_Msg(_dsa_err);
7707     return ret;
7708 }
7709 
dsa_sign_asn1(DSA * dsa,PyObject * value)7710 PyObject *dsa_sign_asn1(DSA *dsa, PyObject *value) {
7711     const void *vbuf;
7712     int vlen = 0;
7713     void *sigbuf;
7714     unsigned int siglen;
7715     PyObject *ret;
7716 
7717     if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
7718         return NULL;
7719 
7720     if (!(sigbuf = PyMem_Malloc(DSA_size(dsa)))) {
7721         PyErr_SetString(PyExc_MemoryError, "dsa_sign_asn1");
7722         return NULL;
7723     }
7724     if (!DSA_sign(0, vbuf, vlen, (unsigned char *)sigbuf, &siglen, dsa)) {
7725         m2_PyErr_Msg(_dsa_err);
7726         PyMem_Free(sigbuf);
7727         return NULL;
7728     }
7729 
7730     ret = PyBytes_FromStringAndSize(sigbuf, siglen);
7731 
7732     PyMem_Free(sigbuf);
7733     return ret;
7734 }
7735 
dsa_verify_asn1(DSA * dsa,PyObject * value,PyObject * sig)7736 int dsa_verify_asn1(DSA *dsa, PyObject *value, PyObject *sig) {
7737     const void *vbuf;
7738     void *sbuf;
7739     int vlen = 0, slen = 0, ret = 0;
7740 
7741     if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
7742         || (m2_PyObject_AsReadBufferInt(sig, (const void **)&sbuf, &slen)
7743         == -1))
7744         return -1;
7745 
7746     if ((ret = DSA_verify(0, vbuf, vlen, sbuf, slen, dsa)) == -1)
7747         m2_PyErr_Msg(_dsa_err);
7748     return ret;
7749 }
7750 
dsa_check_key(DSA * dsa)7751 int dsa_check_key(DSA *dsa) {
7752     const BIGNUM* pub_key, *priv_key;
7753     DSA_get0_key(dsa, &pub_key, &priv_key);
7754     return pub_key != NULL && priv_key != NULL;
7755 }
7756 
dsa_check_pub_key(DSA * dsa)7757 int dsa_check_pub_key(DSA *dsa) {
7758     const BIGNUM* pub_key;
7759     DSA_get0_key(dsa, &pub_key, NULL);
7760     return pub_key ? 1 : 0;
7761 }
7762 
dsa_keylen(DSA * dsa)7763 int dsa_keylen(DSA *dsa) {
7764     const BIGNUM* p;
7765     DSA_get0_pqg(dsa, &p, NULL, NULL);
7766     return BN_num_bits(p);
7767 }
7768 
dsa_type_check(DSA * dsa)7769 int dsa_type_check(DSA *dsa) {
7770     return 1;
7771 }
7772 
7773 
7774 #include <pythread.h>
7775 #include <limits.h>
7776 #include <openssl/bio.h>
7777 #include <openssl/dh.h>
7778 #include <openssl/ssl.h>
7779 #include <openssl/tls1.h>
7780 #include <openssl/x509.h>
7781 #ifdef _WIN32
7782 #include <WinSock2.h>
7783 #include <Windows.h>
7784 #pragma comment(lib, "Ws2_32")
7785 typedef unsigned __int64 uint64_t;
7786 #else
7787 #include <poll.h>
7788 #include <sys/time.h>
7789 #endif
7790 
7791 
7792 static PyObject *_ssl_err;
7793 static PyObject *_ssl_timeout_err;
7794 
ssl_init(PyObject * ssl_err,PyObject * ssl_timeout_err)7795 void ssl_init(PyObject *ssl_err, PyObject *ssl_timeout_err) {
7796     SSL_library_init();
7797     SSL_load_error_strings();
7798     Py_INCREF(ssl_err);
7799     Py_INCREF(ssl_timeout_err);
7800     _ssl_err = ssl_err;
7801     _ssl_timeout_err = ssl_timeout_err;
7802 }
7803 
tlsv1_method(void)7804 const SSL_METHOD *tlsv1_method(void) {
7805 #if OPENSSL_VERSION_NUMBER >= 0x10100000L
7806     PyErr_WarnEx(PyExc_DeprecationWarning,
7807                  "Function TLSv1_method has been deprecated.", 1);
7808 #endif
7809     return TLSv1_method();
7810 }
7811 
ssl_ctx_passphrase_callback(SSL_CTX * ctx,PyObject * pyfunc)7812 void ssl_ctx_passphrase_callback(SSL_CTX *ctx, PyObject *pyfunc) {
7813     SSL_CTX_set_default_passwd_cb(ctx, passphrase_callback);
7814     SSL_CTX_set_default_passwd_cb_userdata(ctx, (void *)pyfunc);
7815     Py_INCREF(pyfunc);
7816 }
7817 
ssl_ctx_use_x509(SSL_CTX * ctx,X509 * x)7818 int ssl_ctx_use_x509(SSL_CTX *ctx, X509 *x) {
7819     int i;
7820 
7821     if (!(i = SSL_CTX_use_certificate(ctx, x))) {
7822         m2_PyErr_Msg(_ssl_err);
7823         return -1;
7824     }
7825     return i;
7826 
7827 }
7828 
ssl_ctx_use_cert(SSL_CTX * ctx,char * file)7829 int ssl_ctx_use_cert(SSL_CTX *ctx, char *file) {
7830     int i;
7831 
7832     if (!(i = SSL_CTX_use_certificate_file(ctx, file, SSL_FILETYPE_PEM))) {
7833         m2_PyErr_Msg(_ssl_err);
7834         return -1;
7835     }
7836     return i;
7837 }
7838 
ssl_ctx_use_cert_chain(SSL_CTX * ctx,char * file)7839 int ssl_ctx_use_cert_chain(SSL_CTX *ctx, char *file) {
7840     int i;
7841 
7842     if (!(i = SSL_CTX_use_certificate_chain_file(ctx, file))) {
7843         m2_PyErr_Msg(_ssl_err);
7844         return -1;
7845     }
7846     return i;
7847 }
7848 
7849 
ssl_ctx_use_privkey(SSL_CTX * ctx,char * file)7850 int ssl_ctx_use_privkey(SSL_CTX *ctx, char *file) {
7851     int i;
7852 
7853     if (!(i = SSL_CTX_use_PrivateKey_file(ctx, file, SSL_FILETYPE_PEM))) {
7854         m2_PyErr_Msg(_ssl_err);
7855         return -1;
7856     }
7857     return i;
7858 }
7859 
ssl_ctx_use_rsa_privkey(SSL_CTX * ctx,RSA * rsakey)7860 int ssl_ctx_use_rsa_privkey(SSL_CTX *ctx, RSA *rsakey) {
7861     int i;
7862 
7863     if (!(i = SSL_CTX_use_RSAPrivateKey(ctx, rsakey))) {
7864         m2_PyErr_Msg(_ssl_err);
7865         return -1;
7866     }
7867     return i;
7868 }
7869 
ssl_ctx_use_pkey_privkey(SSL_CTX * ctx,EVP_PKEY * pkey)7870 int ssl_ctx_use_pkey_privkey(SSL_CTX *ctx, EVP_PKEY *pkey) {
7871     int i;
7872 
7873     if (!(i = SSL_CTX_use_PrivateKey(ctx, pkey))) {
7874         m2_PyErr_Msg(_ssl_err);
7875         return -1;
7876     }
7877     return i;
7878 }
7879 
7880 
ssl_ctx_check_privkey(SSL_CTX * ctx)7881 int ssl_ctx_check_privkey(SSL_CTX *ctx) {
7882     int ret;
7883 
7884     if (!(ret = SSL_CTX_check_private_key(ctx))) {
7885         m2_PyErr_Msg(_ssl_err);
7886         return -1;
7887     }
7888     return ret;
7889 }
7890 
ssl_ctx_set_client_CA_list_from_file(SSL_CTX * ctx,const char * ca_file)7891 void ssl_ctx_set_client_CA_list_from_file(SSL_CTX *ctx, const char *ca_file) {
7892     SSL_CTX_set_client_CA_list(ctx, SSL_load_client_CA_file(ca_file));
7893 }
7894 
ssl_ctx_set_verify_default(SSL_CTX * ctx,int mode)7895 void ssl_ctx_set_verify_default(SSL_CTX *ctx, int mode) {
7896     SSL_CTX_set_verify(ctx, mode, NULL);
7897 }
7898 
ssl_ctx_set_verify(SSL_CTX * ctx,int mode,PyObject * pyfunc)7899 void ssl_ctx_set_verify(SSL_CTX *ctx, int mode, PyObject *pyfunc) {
7900     Py_XDECREF(ssl_verify_cb_func);
7901     Py_INCREF(pyfunc);
7902     ssl_verify_cb_func = pyfunc;
7903     SSL_CTX_set_verify(ctx, mode, ssl_verify_callback);
7904 }
7905 
ssl_ctx_set_session_id_context(SSL_CTX * ctx,PyObject * sid_ctx)7906 int ssl_ctx_set_session_id_context(SSL_CTX *ctx, PyObject *sid_ctx) {
7907     const void *buf;
7908     int len = 0;
7909 
7910     if (m2_PyObject_AsReadBufferInt(sid_ctx, &buf, &len) == -1)
7911         return -1;
7912 
7913     return SSL_CTX_set_session_id_context(ctx, buf, len);
7914 }
7915 
ssl_ctx_set_info_callback(SSL_CTX * ctx,PyObject * pyfunc)7916 void ssl_ctx_set_info_callback(SSL_CTX *ctx, PyObject *pyfunc) {
7917     Py_XDECREF(ssl_info_cb_func);
7918     Py_INCREF(pyfunc);
7919     ssl_info_cb_func = pyfunc;
7920     SSL_CTX_set_info_callback(ctx, ssl_info_callback);
7921 }
7922 
ssl_ctx_set_tmp_dh(SSL_CTX * ctx,DH * dh)7923 long ssl_ctx_set_tmp_dh(SSL_CTX *ctx, DH* dh) {
7924     return SSL_CTX_set_tmp_dh(ctx, dh);
7925 }
7926 
ssl_ctx_set_tmp_dh_callback(SSL_CTX * ctx,PyObject * pyfunc)7927 void ssl_ctx_set_tmp_dh_callback(SSL_CTX *ctx,  PyObject *pyfunc) {
7928     Py_XDECREF(ssl_set_tmp_dh_cb_func);
7929     Py_INCREF(pyfunc);
7930     ssl_set_tmp_dh_cb_func = pyfunc;
7931     SSL_CTX_set_tmp_dh_callback(ctx, ssl_set_tmp_dh_callback);
7932 }
7933 
ssl_ctx_set_tmp_rsa(SSL_CTX * ctx,RSA * rsa)7934 long ssl_ctx_set_tmp_rsa(SSL_CTX *ctx, RSA* rsa) {
7935     return SSL_CTX_set_tmp_rsa(ctx, rsa);
7936 }
7937 
ssl_ctx_set_tmp_rsa_callback(SSL_CTX * ctx,PyObject * pyfunc)7938 void ssl_ctx_set_tmp_rsa_callback(SSL_CTX *ctx,  PyObject *pyfunc) {
7939     Py_XDECREF(ssl_set_tmp_rsa_cb_func);
7940     Py_INCREF(pyfunc);
7941     ssl_set_tmp_rsa_cb_func = pyfunc;
7942     SSL_CTX_set_tmp_rsa_callback(ctx, ssl_set_tmp_rsa_callback);
7943 }
7944 
ssl_ctx_load_verify_locations(SSL_CTX * ctx,const char * cafile,const char * capath)7945 int ssl_ctx_load_verify_locations(SSL_CTX *ctx, const char *cafile, const char *capath) {
7946     return SSL_CTX_load_verify_locations(ctx, cafile, capath);
7947 }
7948 
7949 /* SSL_CTX_set_options is a macro. */
ssl_ctx_set_options(SSL_CTX * ctx,long op)7950 long ssl_ctx_set_options(SSL_CTX *ctx, long op) {
7951     return SSL_CTX_set_options(ctx, op);
7952 }
7953 
bio_set_ssl(BIO * bio,SSL * ssl,int flag)7954 int bio_set_ssl(BIO *bio, SSL *ssl, int flag) {
7955     SSL_set_mode(ssl, SSL_MODE_AUTO_RETRY);
7956     return BIO_ctrl(bio, BIO_C_SET_SSL, flag, (char *)ssl);
7957 }
7958 
ssl_set_mode(SSL * ssl,long mode)7959 long ssl_set_mode(SSL *ssl, long mode) {
7960     return SSL_set_mode(ssl, mode);
7961 }
7962 
ssl_get_mode(SSL * ssl)7963 long ssl_get_mode(SSL *ssl) {
7964     return SSL_get_mode(ssl);
7965 }
7966 
ssl_set_tlsext_host_name(SSL * ssl,const char * name)7967 int ssl_set_tlsext_host_name(SSL *ssl, const char *name) {
7968     long l;
7969 
7970     if (!(l = SSL_set_tlsext_host_name(ssl, name))) {
7971         m2_PyErr_Msg(_ssl_err);
7972         return -1;
7973     }
7974     /* Return an "int" to match the 'typemap(out) int' in _lib.i */
7975     return 1;
7976 }
7977 
ssl_set_client_CA_list_from_file(SSL * ssl,const char * ca_file)7978 void ssl_set_client_CA_list_from_file(SSL *ssl, const char *ca_file) {
7979     SSL_set_client_CA_list(ssl, SSL_load_client_CA_file(ca_file));
7980 }
7981 
ssl_set_client_CA_list_from_context(SSL * ssl,SSL_CTX * ctx)7982 void ssl_set_client_CA_list_from_context(SSL *ssl, SSL_CTX *ctx) {
7983     SSL_set_client_CA_list(ssl, SSL_CTX_get_client_CA_list(ctx));
7984 }
7985 
ssl_set_session_id_context(SSL * ssl,PyObject * sid_ctx)7986 int ssl_set_session_id_context(SSL *ssl, PyObject *sid_ctx) {
7987     const void *buf;
7988     int len = 0;
7989 
7990     if (m2_PyObject_AsReadBufferInt(sid_ctx, &buf, &len) == -1)
7991         return -1;
7992 
7993     return SSL_set_session_id_context(ssl, buf, len);
7994 }
7995 
ssl_set_fd(SSL * ssl,int fd)7996 int ssl_set_fd(SSL *ssl, int fd) {
7997     int ret;
7998 
7999     if (!(ret = SSL_set_fd(ssl, fd))) {
8000         m2_PyErr_Msg(_ssl_err);
8001         return -1;
8002     }
8003     return ret;
8004 }
8005 
ssl_handle_error(int ssl_err,int ret)8006 static void ssl_handle_error(int ssl_err, int ret) {
8007     int err;
8008 
8009     switch (ssl_err) {
8010         case SSL_ERROR_SSL:
8011             PyErr_SetString(_ssl_err,
8012                             ERR_reason_error_string(ERR_get_error()));
8013             break;
8014         case SSL_ERROR_SYSCALL:
8015             err = ERR_get_error();
8016             if (err)
8017                 PyErr_SetString(_ssl_err, ERR_reason_error_string(err));
8018             else if (ret == 0)
8019                 PyErr_SetString(_ssl_err, "unexpected eof");
8020             else if (ret == -1)
8021                 PyErr_SetFromErrno(_ssl_err);
8022             else
8023                 assert(0);
8024             break;
8025         default:
8026             PyErr_SetString(_ssl_err, "unexpected SSL error");
8027      }
8028 }
8029 
8030 #ifdef _WIN32
8031 /* http://stackoverflow.com/questions/10905892/equivalent-of-gettimeday-for-windows */
gettimeofday(struct timeval * tp,void * tzp)8032 int gettimeofday(struct timeval *tp, void *tzp)
8033 {
8034     // Note: some broken versions only have 8 trailing zero's, the correct epoch has 9 trailing zero's
8035     static const uint64_t EPOCH = ((uint64_t) 116444736000000000ULL);
8036 
8037     SYSTEMTIME  system_time;
8038     FILETIME    file_time;
8039     uint64_t    time;
8040 
8041     GetSystemTime( &system_time );
8042     SystemTimeToFileTime( &system_time, &file_time );
8043     time =  ((uint64_t)file_time.dwLowDateTime )      ;
8044     time += ((uint64_t)file_time.dwHighDateTime) << 32;
8045 
8046     tp->tv_sec  = (long) ((time - EPOCH) / 10000000L);
8047     tp->tv_usec = (long) (system_time.wMilliseconds * 1000);
8048     return 0;
8049 }
8050 #endif
8051 
ssl_sleep_with_timeout(SSL * ssl,const struct timeval * start,double timeout,int ssl_err)8052 static int ssl_sleep_with_timeout(SSL *ssl, const struct timeval *start,
8053                                   double timeout, int ssl_err) {
8054 #ifdef _WIN32
8055 WSAPOLLFD fd;
8056 #else
8057 struct pollfd fd;
8058 #endif
8059     struct timeval tv;
8060     int ms, tmp;
8061 
8062     assert(timeout > 0);
8063  again:
8064     gettimeofday(&tv, NULL);
8065     /* tv >= start */
8066     if ((timeout + start->tv_sec - tv.tv_sec) > INT_MAX / 1000)
8067         ms = -1;
8068     else {
8069         int fract;
8070 
8071         ms = ((start->tv_sec + (int)timeout) - tv.tv_sec) * 1000;
8072         fract = (int)((start->tv_usec + (timeout - (int)timeout) * 1000000
8073                  - tv.tv_usec + 999) / 1000);
8074         if (ms > 0 && fract > INT_MAX - ms)
8075             ms = -1;
8076         else {
8077             ms += fract;
8078             if (ms <= 0)
8079                 goto timeout;
8080         }
8081     }
8082     switch (ssl_err) {
8083 	    case SSL_ERROR_WANT_READ:
8084             fd.fd = SSL_get_rfd(ssl);
8085             fd.events = POLLIN;
8086             break;
8087 
8088 	    case SSL_ERROR_WANT_WRITE:
8089             fd.fd = SSL_get_wfd(ssl);
8090             fd.events = POLLOUT;
8091             break;
8092 
8093 	    case SSL_ERROR_WANT_X509_LOOKUP:
8094             return 0; /* FIXME: is this correct? */
8095 
8096 	    default:
8097             assert(0);
8098     }
8099     if (fd.fd == -1) {
8100         PyErr_SetString(_ssl_err, "timeout on a non-FD SSL");
8101         return -1;
8102     }
8103     Py_BEGIN_ALLOW_THREADS
8104 #ifdef _WIN32
8105     tmp = WSAPoll(&fd, 1, ms);
8106 #else
8107     tmp = poll(&fd, 1, ms);
8108 #endif
8109     Py_END_ALLOW_THREADS
8110     switch (tmp) {
8111     	case 1:
8112             return 0;
8113     	case 0:
8114             goto timeout;
8115     	case -1:
8116 #ifdef _WIN32
8117             if (WSAGetLastError() == EINTR)
8118 #else
8119             if (errno == EINTR)
8120 #endif
8121                 goto again;
8122             PyErr_SetFromErrno(_ssl_err);
8123             return -1;
8124     }
8125     return 0;
8126 
8127  timeout:
8128     PyErr_SetString(_ssl_timeout_err, "timed out");
8129     return -1;
8130 }
8131 
ssl_accept(SSL * ssl,double timeout)8132 PyObject *ssl_accept(SSL *ssl, double timeout) {
8133     PyObject *obj = NULL;
8134     int r, ssl_err;
8135     struct timeval tv;
8136 
8137     if (timeout > 0)
8138         gettimeofday(&tv, NULL);
8139  again:
8140     Py_BEGIN_ALLOW_THREADS
8141     r = SSL_accept(ssl);
8142     ssl_err = SSL_get_error(ssl, r);
8143     Py_END_ALLOW_THREADS
8144 
8145 
8146     switch (ssl_err) {
8147         case SSL_ERROR_NONE:
8148         case SSL_ERROR_ZERO_RETURN:
8149             obj = PyLong_FromLong((long)1);
8150             break;
8151         case SSL_ERROR_WANT_WRITE:
8152         case SSL_ERROR_WANT_READ:
8153             if (timeout <= 0) {
8154                 obj = PyLong_FromLong((long)0);
8155                 break;
8156             }
8157             if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0)
8158                 goto again;
8159             obj = NULL;
8160             break;
8161         case SSL_ERROR_SSL:
8162         case SSL_ERROR_SYSCALL:
8163             ssl_handle_error(ssl_err, r);
8164             obj = NULL;
8165             break;
8166     }
8167 
8168 
8169     return obj;
8170 }
8171 
ssl_connect(SSL * ssl,double timeout)8172 PyObject *ssl_connect(SSL *ssl, double timeout) {
8173     PyObject *obj = NULL;
8174     int r, ssl_err;
8175     struct timeval tv;
8176 
8177     if (timeout > 0)
8178         gettimeofday(&tv, NULL);
8179  again:
8180     Py_BEGIN_ALLOW_THREADS
8181     r = SSL_connect(ssl);
8182     ssl_err = SSL_get_error(ssl, r);
8183     Py_END_ALLOW_THREADS
8184 
8185 
8186     switch (ssl_err) {
8187         case SSL_ERROR_NONE:
8188         case SSL_ERROR_ZERO_RETURN:
8189             obj = PyLong_FromLong((long)1);
8190             break;
8191         case SSL_ERROR_WANT_WRITE:
8192         case SSL_ERROR_WANT_READ:
8193             if (timeout <= 0) {
8194                 obj = PyLong_FromLong((long)0);
8195                 break;
8196             }
8197             if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0)
8198                 goto again;
8199             obj = NULL;
8200             break;
8201         case SSL_ERROR_SSL:
8202         case SSL_ERROR_SYSCALL:
8203             ssl_handle_error(ssl_err, r);
8204             obj = NULL;
8205             break;
8206     }
8207 
8208 
8209     return obj;
8210 }
8211 
ssl_set_shutdown1(SSL * ssl,int mode)8212 void ssl_set_shutdown1(SSL *ssl, int mode) {
8213     SSL_set_shutdown(ssl, mode);
8214 }
8215 
ssl_read(SSL * ssl,int num,double timeout)8216 PyObject *ssl_read(SSL *ssl, int num, double timeout) {
8217     PyObject *obj = NULL;
8218     void *buf;
8219     int r;
8220     struct timeval tv;
8221 
8222     if (!(buf = PyMem_Malloc(num))) {
8223         PyErr_SetString(PyExc_MemoryError, "ssl_read");
8224         return NULL;
8225     }
8226 
8227 
8228     if (timeout > 0)
8229         gettimeofday(&tv, NULL);
8230  again:
8231     Py_BEGIN_ALLOW_THREADS
8232     r = SSL_read(ssl, buf, num);
8233     Py_END_ALLOW_THREADS
8234 
8235     if (r >= 0) {
8236         buf = PyMem_Realloc(buf, r);
8237         obj = PyBytes_FromStringAndSize(buf, r);
8238     } else {
8239         int ssl_err;
8240 
8241         ssl_err = SSL_get_error(ssl, r);
8242         switch (ssl_err) {
8243             case SSL_ERROR_NONE:
8244             case SSL_ERROR_ZERO_RETURN:
8245                 assert(0);
8246 
8247             case SSL_ERROR_WANT_WRITE:
8248             case SSL_ERROR_WANT_READ:
8249             case SSL_ERROR_WANT_X509_LOOKUP:
8250                 if (timeout <= 0) {
8251                     Py_INCREF(Py_None);
8252                     obj = Py_None;
8253                     break;
8254                 }
8255                 if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0)
8256                     goto again;
8257                 obj = NULL;
8258                 break;
8259             case SSL_ERROR_SSL:
8260             case SSL_ERROR_SYSCALL:
8261                 ssl_handle_error(ssl_err, r);
8262                 obj = NULL;
8263                 break;
8264         }
8265     }
8266     PyMem_Free(buf);
8267 
8268 
8269     return obj;
8270 }
8271 
ssl_read_nbio(SSL * ssl,int num)8272 PyObject *ssl_read_nbio(SSL *ssl, int num) {
8273     PyObject *obj = NULL;
8274     void *buf;
8275     int r, err;
8276 
8277 
8278     if (!(buf = PyMem_Malloc(num))) {
8279         PyErr_SetString(PyExc_MemoryError, "ssl_read");
8280         return NULL;
8281     }
8282 
8283 
8284     Py_BEGIN_ALLOW_THREADS
8285     r = SSL_read(ssl, buf, num);
8286     Py_END_ALLOW_THREADS
8287 
8288 
8289     switch (SSL_get_error(ssl, r)) {
8290         case SSL_ERROR_NONE:
8291         case SSL_ERROR_ZERO_RETURN:
8292             buf = PyMem_Realloc(buf, r);
8293 
8294             obj = PyBytes_FromStringAndSize(buf, r);
8295 
8296             break;
8297         case SSL_ERROR_WANT_WRITE:
8298         case SSL_ERROR_WANT_READ:
8299         case SSL_ERROR_WANT_X509_LOOKUP:
8300             Py_INCREF(Py_None);
8301             obj = Py_None;
8302             break;
8303         case SSL_ERROR_SSL:
8304             m2_PyErr_Msg(_ssl_err);
8305             obj = NULL;
8306             break;
8307         case SSL_ERROR_SYSCALL:
8308             err = ERR_get_error();
8309             if (err)
8310                 PyErr_SetString(_ssl_err, ERR_reason_error_string(err));
8311             else if (r == 0)
8312                 PyErr_SetString(_ssl_err, "unexpected eof");
8313             else if (r == -1)
8314                 PyErr_SetFromErrno(_ssl_err);
8315             obj = NULL;
8316             break;
8317     }
8318     PyMem_Free(buf);
8319 
8320 
8321     return obj;
8322 }
8323 
ssl_write(SSL * ssl,PyObject * blob,double timeout)8324 int ssl_write(SSL *ssl, PyObject *blob, double timeout) {
8325     Py_buffer buf;
8326     int r, ssl_err, ret;
8327     struct timeval tv;
8328 
8329 
8330     if (m2_PyObject_GetBufferInt(blob, &buf, PyBUF_CONTIG_RO) == -1) {
8331         return -1;
8332     }
8333 
8334     if (timeout > 0)
8335         gettimeofday(&tv, NULL);
8336  again:
8337     Py_BEGIN_ALLOW_THREADS
8338     r = SSL_write(ssl, buf.buf, buf.len);
8339     ssl_err = SSL_get_error(ssl, r);
8340     Py_END_ALLOW_THREADS
8341 
8342 
8343     switch (ssl_err) {
8344         case SSL_ERROR_NONE:
8345         case SSL_ERROR_ZERO_RETURN:
8346             ret = r;
8347             break;
8348         case SSL_ERROR_WANT_WRITE:
8349         case SSL_ERROR_WANT_READ:
8350         case SSL_ERROR_WANT_X509_LOOKUP:
8351             if (timeout <= 0) {
8352                 ret = -1;
8353                 break;
8354             }
8355             if (ssl_sleep_with_timeout(ssl, &tv, timeout, ssl_err) == 0)
8356                 goto again;
8357             ret = -1;
8358             break;
8359         case SSL_ERROR_SSL:
8360         case SSL_ERROR_SYSCALL:
8361             ssl_handle_error(ssl_err, r);
8362         default:
8363             ret = -1;
8364     }
8365 
8366     m2_PyBuffer_Release(blob, &buf);
8367     return ret;
8368 }
8369 
ssl_write_nbio(SSL * ssl,PyObject * blob)8370 int ssl_write_nbio(SSL *ssl, PyObject *blob) {
8371     Py_buffer buf;
8372     int r, err, ret;
8373 
8374 
8375     if (m2_PyObject_GetBufferInt(blob, &buf, PyBUF_CONTIG_RO) == -1) {
8376         return -1;
8377     }
8378 
8379 
8380     Py_BEGIN_ALLOW_THREADS
8381     r = SSL_write(ssl, buf.buf, buf.len);
8382     Py_END_ALLOW_THREADS
8383 
8384 
8385     switch (SSL_get_error(ssl, r)) {
8386         case SSL_ERROR_NONE:
8387         case SSL_ERROR_ZERO_RETURN:
8388             ret = r;
8389             break;
8390         case SSL_ERROR_WANT_WRITE:
8391         case SSL_ERROR_WANT_READ:
8392         case SSL_ERROR_WANT_X509_LOOKUP:
8393             ret = -1;
8394             break;
8395         case SSL_ERROR_SSL:
8396             ret = -1;
8397             break;
8398         case SSL_ERROR_SYSCALL:
8399             err = ERR_get_error();
8400             if (err)
8401                 PyErr_SetString(_ssl_err, ERR_reason_error_string(err));
8402             else if (r == 0)
8403                 PyErr_SetString(_ssl_err, "unexpected eof");
8404             else if (r == -1)
8405                 PyErr_SetFromErrno(_ssl_err);
8406         default:
8407             ret = -1;
8408     }
8409 
8410     m2_PyBuffer_Release(blob, &buf);
8411     return ret;
8412 }
8413 
ssl_cipher_get_bits(SSL_CIPHER * c)8414 int ssl_cipher_get_bits(SSL_CIPHER *c) {
8415     return SSL_CIPHER_get_bits(c, NULL);
8416 }
8417 
sk_ssl_cipher_num(STACK_OF (SSL_CIPHER)* stack)8418 int sk_ssl_cipher_num(STACK_OF(SSL_CIPHER) *stack) {
8419     return sk_SSL_CIPHER_num(stack);
8420 }
8421 
sk_ssl_cipher_value(STACK_OF (SSL_CIPHER)* stack,int idx)8422 const SSL_CIPHER *sk_ssl_cipher_value(STACK_OF(SSL_CIPHER) *stack, int idx) {
8423     return sk_SSL_CIPHER_value(stack, idx);
8424 }
8425 
STACK_OF(X509)8426 STACK_OF(X509) *ssl_get_peer_cert_chain(SSL *ssl) {
8427     return SSL_get_peer_cert_chain(ssl);
8428 }
8429 
sk_x509_num(STACK_OF (X509)* stack)8430 int sk_x509_num(STACK_OF(X509) *stack) {
8431     return sk_X509_num(stack);
8432 }
8433 
sk_x509_value(STACK_OF (X509)* stack,int idx)8434 X509 *sk_x509_value(STACK_OF(X509) *stack, int idx) {
8435     return sk_X509_value(stack, idx);
8436 }
8437 
8438 
i2d_ssl_session(BIO * bio,SSL_SESSION * sess)8439 void i2d_ssl_session(BIO *bio, SSL_SESSION *sess) {
8440     i2d_SSL_SESSION_bio(bio, sess);
8441 }
8442 
8443 
ssl_session_read_pem(BIO * bio)8444 SSL_SESSION *ssl_session_read_pem(BIO *bio) {
8445     return PEM_read_bio_SSL_SESSION(bio, NULL, NULL, NULL);
8446 }
8447 
8448 
ssl_session_write_pem(SSL_SESSION * sess,BIO * bio)8449 int ssl_session_write_pem(SSL_SESSION *sess, BIO *bio) {
8450     return PEM_write_bio_SSL_SESSION(bio, sess);
8451 }
8452 
ssl_ctx_set_session_cache_mode(SSL_CTX * ctx,int mode)8453 int ssl_ctx_set_session_cache_mode(SSL_CTX *ctx, int mode)
8454 {
8455     return SSL_CTX_set_session_cache_mode(ctx, mode);
8456 }
8457 
ssl_ctx_get_session_cache_mode(SSL_CTX * ctx)8458 int ssl_ctx_get_session_cache_mode(SSL_CTX *ctx)
8459 {
8460     return SSL_CTX_get_session_cache_mode(ctx);
8461 }
8462 
ssl_ctx_set_cache_size(SSL_CTX * ctx,long arg)8463 static long ssl_ctx_set_cache_size(SSL_CTX *ctx, long arg)
8464 {
8465   return SSL_CTX_sess_set_cache_size(ctx, arg);
8466 }
8467 
ssl_is_init_finished(SSL * ssl)8468 int ssl_is_init_finished(SSL *ssl)
8469 {
8470   return SSL_is_init_finished(ssl);
8471 }
8472 
8473 
8474 #include <openssl/asn1.h>
8475 #include <openssl/x509.h>
8476 #include <openssl/x509v3.h>
8477 
8478 #include <openssl/asn1t.h>
8479 
8480 typedef STACK_OF(X509) SEQ_CERT;
8481 
ASN1_ITEM_TEMPLATE(SEQ_CERT)8482 ASN1_ITEM_TEMPLATE(SEQ_CERT) =
8483     ASN1_EX_TEMPLATE_TYPE(ASN1_TFLG_SEQUENCE_OF, 0, SeqCert, X509)
8484 ASN1_ITEM_TEMPLATE_END(SEQ_CERT)
8485 
8486 IMPLEMENT_ASN1_FUNCTIONS(SEQ_CERT)
8487 
8488 
8489 X509 *x509_read_pem(BIO *bio) {
8490     return PEM_read_bio_X509(bio, NULL, NULL, NULL);
8491 }
8492 
8493 
d2i_x509(BIO * bio)8494 X509 *d2i_x509(BIO *bio) {
8495     return d2i_X509_bio(bio, NULL);
8496 }
8497 
8498 
8499 static PyObject *_x509_err;
8500 
x509_init(PyObject * x509_err)8501 void x509_init(PyObject *x509_err) {
8502     Py_INCREF(x509_err);
8503     _x509_err = x509_err;
8504 }
8505 
8506 
d2i_x509_req(BIO * bio)8507 X509_REQ *d2i_x509_req(BIO *bio) {
8508     return d2i_X509_REQ_bio(bio, NULL);
8509 }
8510 
8511 
x509_req_read_pem(BIO * bio)8512 X509_REQ *x509_req_read_pem(BIO *bio) {
8513     return PEM_read_bio_X509_REQ(bio, NULL, NULL, NULL);
8514 }
8515 
8516 
i2d_x509(X509 * x)8517 PyObject *i2d_x509(X509 *x) {
8518     int len;
8519     PyObject *ret = NULL;
8520     unsigned char *buf = NULL;
8521     len = i2d_X509(x, &buf);
8522     if (len < 0) {
8523         m2_PyErr_Msg(_x509_err);
8524     }
8525     else {
8526 
8527         ret = PyBytes_FromStringAndSize((char*)buf, len);
8528 
8529         OPENSSL_free(buf);
8530     }
8531     return ret;
8532 }
8533 
8534 
x509_req_write_pem(BIO * bio,X509_REQ * x)8535 int x509_req_write_pem(BIO *bio, X509_REQ *x) {
8536     return PEM_write_bio_X509_REQ(bio, x);
8537 }
8538 
8539 
x509_crl_read_pem(BIO * bio)8540 X509_CRL *x509_crl_read_pem(BIO *bio) {
8541     return PEM_read_bio_X509_CRL(bio, NULL, NULL, NULL);
8542 }
8543 
8544 
8545 /* X509_set_version() is a macro. */
x509_set_version(X509 * x,long version)8546 int x509_set_version(X509 *x, long version) {
8547     return X509_set_version(x, version);
8548 }
8549 
8550 /* X509_get_version() is a macro. */
x509_get_version(X509 * x)8551 long x509_get_version(X509 *x) {
8552     return X509_get_version(x);
8553 }
8554 
8555 /* X509_set_notBefore() is a macro. */
x509_set_not_before(X509 * x,ASN1_TIME * tm)8556 int x509_set_not_before(X509 *x, ASN1_TIME *tm) {
8557     return X509_set_notBefore(x, tm);
8558 }
8559 
8560 /* X509_get_notBefore() is a macro. */
x509_get_not_before(X509 * x)8561 ASN1_TIME *x509_get_not_before(X509 *x) {
8562     return X509_get_notBefore(x);
8563 }
8564 
8565 /* X509_set_notAfter() is a macro. */
x509_set_not_after(X509 * x,ASN1_TIME * tm)8566 int x509_set_not_after(X509 *x, ASN1_TIME *tm) {
8567     return X509_set_notAfter(x, tm);
8568 }
8569 
8570 /* X509_get_notAfter() is a macro. */
x509_get_not_after(X509 * x)8571 ASN1_TIME *x509_get_not_after(X509 *x) {
8572     return X509_get_notAfter(x);
8573 }
8574 
x509_sign(X509 * x,EVP_PKEY * pkey,EVP_MD * md)8575 int x509_sign(X509 *x, EVP_PKEY *pkey, EVP_MD *md) {
8576     return X509_sign(x, pkey, md);
8577 }
8578 
8579 /* x509_gmtime_adj() is a macro. */
x509_gmtime_adj(ASN1_TIME * s,long adj)8580 ASN1_TIME *x509_gmtime_adj(ASN1_TIME *s, long adj) {
8581     return X509_gmtime_adj(s, adj);
8582 }
8583 
x509_name_by_nid(X509_NAME * name,int nid)8584 PyObject *x509_name_by_nid(X509_NAME *name, int nid) {
8585     void *buf;
8586     int len, xlen;
8587     PyObject *ret;
8588 
8589     if ((len = X509_NAME_get_text_by_NID(name, nid, NULL, 0)) == -1) {
8590         Py_RETURN_NONE;
8591     }
8592     len++;
8593     if (!(buf = PyMem_Malloc(len))) {
8594         PyErr_SetString(PyExc_MemoryError, "x509_name_by_nid");
8595         return NULL;
8596     }
8597     xlen = X509_NAME_get_text_by_NID(name, nid, buf, len);
8598 
8599     ret = PyBytes_FromStringAndSize(buf, xlen);
8600 
8601     PyMem_Free(buf);
8602     return ret;
8603 }
8604 
x509_name_set_by_nid(X509_NAME * name,int nid,PyObject * obj)8605 int x509_name_set_by_nid(X509_NAME *name, int nid, PyObject *obj) {
8606     return X509_NAME_add_entry_by_NID(name, nid, MBSTRING_ASC, (unsigned char *)PyBytes_AsString(obj), -1, -1, 0);
8607 }
8608 
8609 /* x509_name_add_entry_by_txt */
x509_name_add_entry_by_txt(X509_NAME * name,char * field,int type,char * bytes,int len,int loc,int set)8610 int x509_name_add_entry_by_txt(X509_NAME *name, char *field, int type, char *bytes, int len, int loc, int set) {
8611     return X509_NAME_add_entry_by_txt(name, field, type, (unsigned char *)bytes, len, loc, set);
8612 }
8613 
x509_name_get_der(X509_NAME * name)8614 PyObject *x509_name_get_der(X509_NAME *name) {
8615     const char* pder="";
8616     size_t pderlen;
8617     i2d_X509_NAME(name, 0);
8618     if (!X509_NAME_get0_der(name, (const unsigned char **)pder, &pderlen)) {
8619         m2_PyErr_Msg(_x509_err);
8620         return NULL;
8621     }
8622     return PyBytes_FromStringAndSize(pder, pderlen);
8623 }
8624 
8625 /* sk_X509_free() is a macro. */
sk_x509_free(STACK_OF (X509)* stack)8626 void sk_x509_free(STACK_OF(X509) *stack) {
8627     sk_X509_free(stack);
8628 }
8629 
8630 /* sk_X509_push() is a macro. */
sk_x509_push(STACK_OF (X509)* stack,X509 * x509)8631 int sk_x509_push(STACK_OF(X509) *stack, X509 *x509) {
8632     return sk_X509_push(stack, x509);
8633 }
8634 
8635 /* sk_X509_pop() is a macro. */
sk_x509_pop(STACK_OF (X509)* stack)8636 X509 *sk_x509_pop(STACK_OF(X509) *stack) {
8637     return sk_X509_pop(stack);
8638 }
8639 
8640 
x509_store_load_locations(X509_STORE * store,const char * file)8641 int x509_store_load_locations(X509_STORE *store, const char *file) {
8642     int locations = 0;
8643 
8644     if ((locations = X509_STORE_load_locations(store, file, NULL)) < 1) {
8645         m2_PyErr_Msg(_x509_err);
8646     }
8647     return locations;
8648 }
8649 
x509_type_check(X509 * x509)8650 int x509_type_check(X509 *x509) {
8651     return 1;
8652 }
8653 
x509_name_type_check(X509_NAME * name)8654 int x509_name_type_check(X509_NAME *name) {
8655     return 1;
8656 }
8657 
x509_req_get_subject_name(X509_REQ * x)8658 X509_NAME *x509_req_get_subject_name(X509_REQ *x) {
8659     return X509_REQ_get_subject_name(x);
8660 }
8661 
x509_req_get_version(X509_REQ * x)8662 long x509_req_get_version(X509_REQ *x) {
8663     return X509_REQ_get_version(x);
8664 }
8665 
x509_req_set_version(X509_REQ * x,long version)8666 int x509_req_set_version(X509_REQ *x, long version) {
8667     return X509_REQ_set_version(x, version);
8668 }
8669 
x509_req_add_extensions(X509_REQ * req,STACK_OF (X509_EXTENSION)* exts)8670 int x509_req_add_extensions(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts) {
8671     return X509_REQ_add_extensions(req, exts);
8672 }
8673 
x509_name_entry_create_by_txt(X509_NAME_ENTRY ** ne,char * field,int type,char * bytes,int len)8674 X509_NAME_ENTRY *x509_name_entry_create_by_txt(X509_NAME_ENTRY **ne, char *field, int type, char *bytes, int len) {
8675     return X509_NAME_ENTRY_create_by_txt( ne, field, type, (unsigned char *)bytes, len);
8676 }
8677 
8678 
8679 X509V3_CTX *
x509v3_set_nconf(void)8680 x509v3_set_nconf(void) {
8681       X509V3_CTX * ctx;
8682       CONF *conf = NCONF_new(NULL);
8683 
8684       if (!(ctx=(X509V3_CTX *)PyMem_Malloc(sizeof(X509V3_CTX)))) {
8685           PyErr_SetString(PyExc_MemoryError, "x509v3_set_nconf");
8686           return NULL;
8687       }
8688       /* X509V3_set_nconf does not generate any error signs at all. */
8689       X509V3_set_nconf(ctx, conf);
8690       return ctx;
8691 }
8692 
8693 
8694 X509_EXTENSION *
x509v3_ext_conf(void * conf,X509V3_CTX * ctx,char * name,char * value)8695 x509v3_ext_conf(void *conf, X509V3_CTX *ctx, char *name, char *value) {
8696       X509_EXTENSION * ext = NULL;
8697       ext = X509V3_EXT_conf(conf, ctx, name, value);
8698       PyMem_Free(ctx);
8699       return ext;
8700 }
8701 
8702 
8703 /* X509_EXTENSION_free() might be a macro, didn't find definition. */
x509_extension_free(X509_EXTENSION * ext)8704 void x509_extension_free(X509_EXTENSION *ext) {
8705     X509_EXTENSION_free(ext);
8706 }
8707 
x509_extension_get_name(X509_EXTENSION * ext)8708 PyObject *x509_extension_get_name(X509_EXTENSION *ext) {
8709     PyObject * ext_name;
8710     const char * ext_name_str;
8711     ext_name_str = OBJ_nid2sn(OBJ_obj2nid(X509_EXTENSION_get_object(ext)));
8712     if (!ext_name_str) {
8713         m2_PyErr_Msg(_x509_err);
8714         return NULL;
8715     }
8716     ext_name = PyBytes_FromStringAndSize(ext_name_str, strlen(ext_name_str));
8717     return ext_name;
8718 }
8719 
8720 /* sk_X509_EXTENSION_new_null is a macro. */
STACK_OF(X509_EXTENSION)8721 STACK_OF(X509_EXTENSION) *sk_x509_extension_new_null(void) {
8722     return sk_X509_EXTENSION_new_null();
8723 }
8724 
8725 /* sk_X509_EXTENSION_free() is a macro. */
sk_x509_extension_free(STACK_OF (X509_EXTENSION)* stack)8726 void sk_x509_extension_free(STACK_OF(X509_EXTENSION) *stack) {
8727     sk_X509_EXTENSION_free(stack);
8728 }
8729 
8730 /* sk_X509_EXTENSION_push() is a macro. */
sk_x509_extension_push(STACK_OF (X509_EXTENSION)* stack,X509_EXTENSION * x509_ext)8731 int sk_x509_extension_push(STACK_OF(X509_EXTENSION) *stack, X509_EXTENSION *x509_ext) {
8732     return sk_X509_EXTENSION_push(stack, x509_ext);
8733 }
8734 
8735 /* sk_X509_EXTENSION_pop() is a macro. */
sk_x509_extension_pop(STACK_OF (X509_EXTENSION)* stack)8736 X509_EXTENSION *sk_x509_extension_pop(STACK_OF(X509_EXTENSION) *stack) {
8737     return sk_X509_EXTENSION_pop(stack);
8738 }
8739 
8740 /* sk_X509_EXTENSION_num() is a macro. */
sk_x509_extension_num(STACK_OF (X509_EXTENSION)* stack)8741 int sk_x509_extension_num(STACK_OF(X509_EXTENSION) *stack) {
8742     return sk_X509_EXTENSION_num(stack);
8743 }
8744 
8745 /* sk_X509_EXTENSION_value() is a macro. */
sk_x509_extension_value(STACK_OF (X509_EXTENSION)* stack,int i)8746 X509_EXTENSION *sk_x509_extension_value(STACK_OF(X509_EXTENSION) *stack, int i) {
8747     return sk_X509_EXTENSION_value(stack, i);
8748 }
8749 
8750 /* X509_STORE_CTX_get_app_data is a macro. */
x509_store_ctx_get_app_data(X509_STORE_CTX * ctx)8751 void *x509_store_ctx_get_app_data(X509_STORE_CTX *ctx) {
8752   return X509_STORE_CTX_get_app_data(ctx);
8753 }
8754 
8755 /* X509_STORE_CTX_get_app_data is a macro. */
x509_store_ctx_get_ex_data(X509_STORE_CTX * ctx,int idx)8756 void *x509_store_ctx_get_ex_data(X509_STORE_CTX *ctx, int idx) {
8757   return X509_STORE_CTX_get_ex_data(ctx, idx);
8758 }
8759 
x509_store_set_verify_cb(X509_STORE * store,PyObject * pyfunc)8760 void x509_store_set_verify_cb(X509_STORE *store, PyObject *pyfunc) {
8761     Py_XDECREF(x509_store_verify_cb_func);
8762     Py_INCREF(pyfunc);
8763     x509_store_verify_cb_func = pyfunc;
8764     X509_STORE_set_verify_cb(store, x509_store_verify_callback);
8765 }
8766 
8767 
STACK_OF(X509)8768 STACK_OF(X509) *
8769 make_stack_from_der_sequence(PyObject * pyEncodedString){
8770     STACK_OF(X509) *certs;
8771     Py_ssize_t encoded_string_len;
8772     char *encoded_string;
8773     const unsigned char *tmp_str;
8774 
8775     encoded_string_len = PyBytes_Size(pyEncodedString);
8776 
8777     if (encoded_string_len > INT_MAX) {
8778         PyErr_Format(_x509_err, "object too large");
8779         return NULL;
8780     }
8781 
8782     encoded_string = PyBytes_AsString(pyEncodedString);
8783 
8784     if (!encoded_string) {
8785         PyErr_SetString(_x509_err,
8786                         "Cannot convert Python Bytes to (char *).");
8787         return NULL;
8788     }
8789 
8790     tmp_str = (unsigned char *)encoded_string;
8791     certs = d2i_SEQ_CERT(NULL, &tmp_str, encoded_string_len);
8792     if (certs == NULL) {
8793         PyErr_SetString(_x509_err, "Generating STACK_OF(X509) failed.");
8794         return NULL;
8795     }
8796     return certs;
8797 }
8798 
8799 /* sk_X509_new_null() is a macro returning "STACK_OF(X509) *". */
STACK_OF(X509)8800 STACK_OF(X509) *sk_x509_new_null(void) {
8801     return sk_X509_new_null();
8802 }
8803 
8804 
8805 PyObject *
get_der_encoding_stack(STACK_OF (X509)* stack)8806 get_der_encoding_stack(STACK_OF(X509) *stack){
8807     PyObject * encodedString;
8808 
8809     unsigned char * encoding = NULL;
8810     int len;
8811 
8812     len = i2d_SEQ_CERT(stack, &encoding);
8813     if (!encoding) {
8814        m2_PyErr_Msg(_x509_err);
8815        return NULL;
8816     }
8817 
8818     encodedString = PyBytes_FromStringAndSize((const char *)encoding, len);
8819 
8820     if (encoding)
8821         OPENSSL_free(encoding);
8822 
8823     return encodedString;
8824 }
8825 
8826 
8827 
x509_name_oneline(X509_NAME * x)8828 char *x509_name_oneline(X509_NAME *x) {
8829     return X509_NAME_oneline(x, NULL, 0);
8830 }
8831 
8832 
8833 #include <openssl/asn1.h>
8834 
8835 
8836 /* ASN1_TIME_set_string () is a macro */
asn1_time_type_check(ASN1_TIME * ASN1_TIME)8837 int asn1_time_type_check(ASN1_TIME *ASN1_TIME) {
8838     return 1;
8839 }
8840 
asn1_integer_get(ASN1_INTEGER * asn1)8841 PyObject *asn1_integer_get(ASN1_INTEGER *asn1) {
8842     BIGNUM *bn;
8843     PyObject *ret;
8844     char *hex;
8845 
8846     bn = ASN1_INTEGER_to_BN(asn1, NULL);
8847 
8848     if (!bn){
8849         m2_PyErr_Msg(PyExc_RuntimeError);
8850         return NULL;
8851     }
8852 
8853     hex = BN_bn2hex(bn);
8854 
8855     if (!hex){
8856         m2_PyErr_Msg(PyExc_RuntimeError);
8857         BN_free(bn);
8858         return NULL;
8859     }
8860 
8861     BN_free(bn);
8862 
8863     ret = PyLong_FromString(hex, NULL, 16);
8864 
8865     OPENSSL_free(hex);
8866 
8867     return ret;
8868 }
8869 
asn1_integer_set(ASN1_INTEGER * asn1,PyObject * value)8870 int asn1_integer_set(ASN1_INTEGER *asn1, PyObject *value) {
8871     BIGNUM *bn = NULL;
8872     PyObject *fmt, *args, *hex;
8873 
8874 /* Despite all hopes to the contrary, we cannot survive here with
8875  * PyLong_AsLong shims as provided in
8876  * /usr/include/python2.7/longobject.h.
8877  */
8878     long val = PyLong_AsLong(value);
8879     if (val >= 0) {
8880         return ASN1_INTEGER_set(asn1, val);
8881     } else {
8882         PyErr_Clear();
8883     }
8884 
8885     if (!PyLong_Check(value)){
8886         PyErr_SetString(PyExc_TypeError, "expected int or long");
8887         return 0;
8888     }
8889 
8890     fmt = PyUnicode_FromString("%x");
8891 
8892     if (!fmt)
8893         return 0;
8894 
8895     args = PyTuple_New(1);
8896 
8897     if (!args){
8898         Py_DECREF(fmt);
8899         PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() failed");
8900         return 0;
8901     }
8902 
8903     Py_INCREF(value);
8904     PyTuple_SET_ITEM(args, 0, value);
8905     hex = PyUnicode_Format(fmt, args);
8906 
8907     if (!hex){
8908         PyErr_SetString(PyExc_RuntimeError, "PyString_Format() failed");
8909         Py_DECREF(fmt);
8910         Py_DECREF(args);
8911         return 0;
8912     }
8913 
8914     Py_DECREF(fmt);
8915     Py_DECREF(args);
8916 
8917     if (BN_hex2bn(&bn, PyUnicode_AsUTF8(hex)) <= 0){
8918         m2_PyErr_Msg(PyExc_RuntimeError);
8919         Py_DECREF(hex);
8920         return 0;
8921     }
8922 
8923     Py_DECREF(hex);
8924 
8925     if (!BN_to_ASN1_INTEGER(bn, asn1)){
8926         m2_PyErr_Msg(PyExc_RuntimeError);
8927         BN_free(bn);
8928         return 0;
8929     }
8930 
8931     BN_free(bn);
8932 
8933     return 1;
8934 }
8935 
8936 
8937 
8938 #include <openssl/bio.h>
8939 #include <openssl/evp.h>
8940 #include <openssl/objects.h>
8941 #include <openssl/pkcs7.h>
8942 
8943 
8944 static PyObject *_pkcs7_err, *_smime_err;
8945 
pkcs7_init(PyObject * pkcs7_err)8946 void pkcs7_init(PyObject *pkcs7_err) {
8947     Py_INCREF(pkcs7_err);
8948     _pkcs7_err = pkcs7_err;
8949 }
8950 
smime_init(PyObject * smime_err)8951 void smime_init(PyObject *smime_err) {
8952     Py_INCREF(smime_err);
8953     _smime_err = smime_err;
8954 }
8955 
8956 
pkcs7_decrypt(PKCS7 * pkcs7,EVP_PKEY * pkey,X509 * cert,int flags)8957 PyObject *pkcs7_decrypt(PKCS7 *pkcs7, EVP_PKEY *pkey, X509 *cert, int flags) {
8958     int outlen;
8959     char *outbuf;
8960     BIO *bio;
8961     PyObject *ret;
8962 
8963     if (!(bio=BIO_new(BIO_s_mem()))) {
8964         PyErr_SetString(PyExc_MemoryError, "pkcs7_decrypt");
8965         return NULL;
8966     }
8967     if (!PKCS7_decrypt(pkcs7, pkey, cert, bio, flags)) {
8968         m2_PyErr_Msg(_pkcs7_err);
8969         BIO_free(bio);
8970         return NULL;
8971     }
8972     outlen = BIO_ctrl_pending(bio);
8973     if (!(outbuf=(char *)PyMem_Malloc(outlen))) {
8974         PyErr_SetString(PyExc_MemoryError, "pkcs7_decrypt");
8975         BIO_free(bio);
8976         return NULL;
8977     }
8978     BIO_read(bio, outbuf, outlen);
8979 
8980     ret = PyBytes_FromStringAndSize(outbuf, outlen);
8981 
8982     BIO_free(bio);
8983     PyMem_Free(outbuf);
8984     return ret;
8985 }
8986 
8987 
pkcs7_encrypt(STACK_OF (X509)* stack,BIO * bio,EVP_CIPHER * cipher,int flags)8988 PKCS7 *pkcs7_encrypt(STACK_OF(X509) *stack, BIO *bio, EVP_CIPHER *cipher, int flags) {
8989     return PKCS7_encrypt(stack, bio, cipher, flags);
8990 }
8991 
8992 
8993 
pkcs7_sign1(X509 * x509,EVP_PKEY * pkey,STACK_OF (X509)* stack,BIO * bio,EVP_MD * hash,int flags)8994 PKCS7 *pkcs7_sign1(X509 *x509, EVP_PKEY *pkey, STACK_OF(X509) *stack, BIO *bio, EVP_MD *hash, int flags) {
8995 
8996     PKCS7 *p7 = PKCS7_sign(NULL, NULL, stack, bio, flags | PKCS7_STREAM);
8997     if (p7 == NULL) {
8998         return NULL;
8999     }
9000     if (PKCS7_sign_add_signer(p7, x509, pkey, hash, flags) == NULL) {
9001         return NULL;
9002     }
9003     if (PKCS7_final(p7, bio, flags) != 1) {
9004         return NULL;
9005     }
9006     return p7;
9007 }
9008 
9009 
pkcs7_sign0(X509 * x509,EVP_PKEY * pkey,BIO * bio,EVP_MD * hash,int flags)9010 PKCS7 *pkcs7_sign0(X509 *x509, EVP_PKEY *pkey, BIO *bio, EVP_MD *hash, int flags) {
9011     return pkcs7_sign1(x509, pkey, NULL, bio, hash, flags);
9012 }
9013 
9014 
pkcs7_read_bio(BIO * bio)9015 PKCS7 *pkcs7_read_bio(BIO *bio) {
9016     return PEM_read_bio_PKCS7(bio, NULL, NULL, NULL);
9017 }
9018 
9019 
pkcs7_read_bio_der(BIO * bio)9020 PKCS7 *pkcs7_read_bio_der(BIO *bio) {
9021     return d2i_PKCS7_bio(bio, NULL);
9022 }
9023 
9024 
pkcs7_verify1(PKCS7 * pkcs7,STACK_OF (X509)* stack,X509_STORE * store,BIO * data,int flags)9025 PyObject *pkcs7_verify1(PKCS7 *pkcs7, STACK_OF(X509) *stack, X509_STORE *store, BIO *data, int flags) {
9026     int res, outlen;
9027     char *outbuf;
9028     BIO *bio;
9029     PyObject *ret;
9030 
9031     if (!(bio=BIO_new(BIO_s_mem()))) {
9032         PyErr_SetString(PyExc_MemoryError, "pkcs7_verify1");
9033         return NULL;
9034     }
9035     Py_BEGIN_ALLOW_THREADS
9036     res = PKCS7_verify(pkcs7, stack, store, data, bio, flags);
9037     Py_END_ALLOW_THREADS
9038     if (!res) {
9039         m2_PyErr_Msg(_pkcs7_err);
9040         BIO_free(bio);
9041         return NULL;
9042     }
9043     outlen = BIO_ctrl_pending(bio);
9044     if (!(outbuf=(char *)PyMem_Malloc(outlen))) {
9045         PyErr_SetString(PyExc_MemoryError, "pkcs7_verify1");
9046         BIO_free(bio);
9047         return NULL;
9048     }
9049     BIO_read(bio, outbuf, outlen);
9050 
9051     ret = PyBytes_FromStringAndSize(outbuf, outlen);
9052 
9053     BIO_free(bio);
9054     PyMem_Free(outbuf);
9055     return ret;
9056 }
9057 
pkcs7_verify0(PKCS7 * pkcs7,STACK_OF (X509)* stack,X509_STORE * store,int flags)9058 PyObject *pkcs7_verify0(PKCS7 *pkcs7, STACK_OF(X509) *stack, X509_STORE *store, int flags) {
9059     return pkcs7_verify1(pkcs7, stack, store, NULL, flags);
9060 }
9061 
9062 
smime_write_pkcs7_multi(BIO * bio,PKCS7 * pkcs7,BIO * data,int flags)9063 int smime_write_pkcs7_multi(BIO *bio, PKCS7 *pkcs7, BIO *data, int flags) {
9064     return SMIME_write_PKCS7(bio, pkcs7, data, flags | PKCS7_DETACHED);
9065 }
9066 
9067 
smime_write_pkcs7(BIO * bio,PKCS7 * pkcs7,int flags)9068 int smime_write_pkcs7(BIO *bio, PKCS7 *pkcs7, int flags) {
9069     return SMIME_write_PKCS7(bio, pkcs7, NULL, flags);
9070 }
9071 
smime_read_pkcs7(BIO * bio)9072 PyObject *smime_read_pkcs7(BIO *bio) {
9073     BIO *bcont = NULL;
9074     PKCS7 *p7;
9075     PyObject *tuple, *_p7, *_BIO;
9076     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
9077 
9078     if (BIO_method_type(bio) == BIO_TYPE_MEM) {
9079         /* OpenSSL FAQ explains that this is needed for mem BIO to return EOF,
9080          * like file BIO does. Might need to do this for more mem BIOs but
9081          * not sure if that is safe, so starting with just this single place.
9082          */
9083         BIO_set_mem_eof_return(bio, 0);
9084     }
9085 
9086     Py_BEGIN_ALLOW_THREADS
9087     p7=SMIME_read_PKCS7(bio, &bcont);
9088     Py_END_ALLOW_THREADS
9089     if (!p7) {
9090         m2_PyErr_Msg(_smime_err);
9091         return NULL;
9092     }
9093     if (!(tuple=PyTuple_New(2))) {
9094         PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails");
9095         return NULL;
9096     }
9097     _p7 = SWIG_NewPointerObj((void *)p7, SWIGTYPE_p_PKCS7, 0);
9098     PyTuple_SET_ITEM(tuple, 0, _p7);
9099     if (!bcont) {
9100         Py_INCREF(Py_None);
9101         PyTuple_SET_ITEM(tuple, 1, Py_None);
9102     } else {
9103         _BIO = SWIG_NewPointerObj((void *)bcont, SWIGTYPE_p_BIO, 0);
9104         PyTuple_SET_ITEM(tuple, 1, _BIO);
9105     }
9106     return tuple;
9107 }
9108 
9109 
pkcs7_write_bio(PKCS7 * pkcs7,BIO * bio)9110 int pkcs7_write_bio(PKCS7 *pkcs7, BIO* bio) {
9111     return PEM_write_bio_PKCS7(bio, pkcs7);
9112 }
9113 
9114 
pkcs7_write_bio_der(PKCS7 * pkcs7,BIO * bio)9115 int pkcs7_write_bio_der(PKCS7 *pkcs7, BIO *bio) {
9116     return i2d_PKCS7_bio(bio, pkcs7);
9117 }
9118 
pkcs7_type_nid(PKCS7 * pkcs7)9119 int pkcs7_type_nid(PKCS7 *pkcs7) {
9120     return OBJ_obj2nid(pkcs7->type);
9121 }
9122 
pkcs7_type_sn(PKCS7 * pkcs7)9123 const char *pkcs7_type_sn(PKCS7 *pkcs7) {
9124     return OBJ_nid2sn(OBJ_obj2nid(pkcs7->type));
9125 }
9126 
9127 
smime_crlf_copy(BIO * in,BIO * out)9128 int smime_crlf_copy(BIO *in, BIO *out) {
9129     return SMIME_crlf_copy(in, out, PKCS7_TEXT);
9130 }
9131 
9132 /* return STACK_OF(X509)* */
STACK_OF(X509)9133 STACK_OF(X509) *pkcs7_get0_signers(PKCS7 *p7, STACK_OF(X509) *certs, int flags) {
9134     return PKCS7_get0_signers(p7, certs, flags);
9135 }
9136 
9137 
9138 
9139 #include <openssl/x509v3.h>
9140 
9141 
9142 static PyObject *_util_err;
9143 
util_init(PyObject * util_err)9144 void util_init(PyObject *util_err) {
9145     Py_INCREF(util_err);
9146     _util_err = util_err;
9147 }
9148 
util_hex_to_string(PyObject * blob)9149 PyObject *util_hex_to_string(PyObject *blob) {
9150     PyObject *obj;
9151     const void *buf;
9152     char *ret;
9153     Py_ssize_t len;
9154 
9155     if (m2_PyObject_AsReadBuffer(blob, &buf, &len) == -1)
9156         return NULL;
9157 
9158     ret = hex_to_string((unsigned char *)buf, len);
9159     if (!ret) {
9160         m2_PyErr_Msg(_util_err);
9161         return NULL;
9162     }
9163 
9164     obj = PyBytes_FromString(ret);
9165 
9166     OPENSSL_free(ret);
9167     return obj;
9168 }
9169 
util_string_to_hex(PyObject * blob)9170 PyObject *util_string_to_hex(PyObject *blob) {
9171     PyObject *obj;
9172     const void *buf;
9173     unsigned char *ret;
9174     Py_ssize_t len0;
9175     long len;
9176 
9177     if (m2_PyObject_AsReadBuffer(blob, &buf, &len0) == -1)
9178         return NULL;
9179 
9180     len = len0;
9181     ret = string_to_hex((char *)buf, &len);
9182     if (ret == NULL) {
9183         m2_PyErr_Msg(_util_err);
9184         return NULL;
9185     }
9186     obj = PyBytes_FromStringAndSize((char*)ret, len);
9187     OPENSSL_free(ret);
9188     return obj;
9189 }
9190 
9191 
9192 #include <openssl/bn.h>
9193 #include <openssl/err.h>
9194 #include <openssl/pem.h>
9195 #include <openssl/x509.h>
9196 #include <openssl/ecdsa.h>
9197 #include <openssl/ecdh.h>
9198 
9199 
9200 static PyObject *_ec_err;
9201 
ec_init(PyObject * ec_err)9202 void ec_init(PyObject *ec_err) {
9203     Py_INCREF(ec_err);
9204     _ec_err = ec_err;
9205 }
9206 
ec_get_builtin_curves(void)9207 PyObject *ec_get_builtin_curves(void) {
9208     /*  size_t EC_get_builtin_curves(EC_builtin_curve *r, size_t
9209      *  nitems); */
9210   EC_builtin_curve *curves;
9211   Py_ssize_t ret_curves = 0;
9212   size_t num_curves =  EC_get_builtin_curves(NULL, 0);
9213   PyObject *ret_tuple = NULL;
9214   PyObject *ret_dict = NULL;
9215   Py_ssize_t i;
9216   const char *comment;
9217   const char *sname;
9218 
9219   if (!(curves = PyMem_Malloc(num_curves * sizeof(EC_builtin_curve)))) {
9220       PyErr_SetString(PyExc_MemoryError, "ec_get_builtin_curves");
9221       return NULL;
9222   }
9223 
9224   ret_curves = (Py_ssize_t)EC_get_builtin_curves(curves, num_curves);
9225 
9226   if (!(ret_tuple = PyTuple_New(ret_curves))) {
9227       PyErr_SetString(PyExc_MemoryError, "ec_get_builtin_curves");
9228       return NULL;
9229   }
9230 
9231   for (i = 0; i < ret_curves; i++) {
9232     if (!(ret_dict = PyDict_New())) {
9233         PyErr_SetString(PyExc_MemoryError, "ec_get_builtin_curves");
9234         return NULL;
9235     }
9236 
9237     comment = curves[i].comment;
9238     sname = OBJ_nid2sn(curves[i].nid);
9239     if (sname == NULL)
9240         sname = "";
9241 
9242     PyDict_SetItemString(ret_dict, "NID",
9243                          PyLong_FromLong((long)curves[i].nid));
9244     PyDict_SetItemString(ret_dict, "sname",
9245                          PyString_FromString(sname));
9246     PyDict_SetItemString(ret_dict, "comment",
9247                          PyString_FromString(comment));
9248 
9249     PyTuple_SET_ITEM(ret_tuple, i, ret_dict);
9250 
9251   }
9252 
9253   PyMem_Free(curves);
9254 
9255   return ret_tuple;
9256 }
9257 
ec_key_new_by_curve_name(int nid)9258 EC_KEY* ec_key_new_by_curve_name(int nid)
9259 {
9260     EC_KEY   *key;
9261     EC_GROUP *group;
9262     int ret  =0;
9263     point_conversion_form_t form = POINT_CONVERSION_UNCOMPRESSED;
9264     int      asn1_flag = OPENSSL_EC_NAMED_CURVE;
9265 
9266     /* If I simply do "return EC_KEY_new_by_curve_name(nid);"
9267      * I get large public keys (222 vs 84 bytes for sect233k1 curve).
9268      * I don't know why that is, but 'openssl ecparam -genkey ...' sets
9269      * the ASN.1 flag and the point conversion form, and gets the
9270      * small pub keys. So let's do that too.
9271      */
9272     key = EC_KEY_new();
9273     if (!key) {
9274         PyErr_SetString(PyExc_MemoryError, "ec_key_new_by_curve_name");
9275         return NULL;
9276     }
9277     group = EC_GROUP_new_by_curve_name(nid);
9278     if (!group) {
9279         m2_PyErr_Msg(_ec_err);
9280         EC_KEY_free(key);
9281         return NULL;
9282     }
9283     EC_GROUP_set_asn1_flag(group, asn1_flag);
9284     EC_GROUP_set_point_conversion_form(group, form);
9285     ret = EC_KEY_set_group(key, group);
9286     EC_GROUP_free(group);
9287     if (ret == 0)
9288     {
9289         /* EC_KEY_set_group only returns 0 or 1, and does not set error. */
9290         PyErr_SetString(_ec_err, "cannot set key's group");
9291         EC_KEY_free(key);
9292         return NULL;
9293     }
9294 
9295     return key;
9296 }
9297 
ec_key_get_public_der(EC_KEY * key)9298 PyObject *ec_key_get_public_der(EC_KEY *key) {
9299     char *src=NULL;
9300     int src_len=0;
9301     PyObject *pyo=NULL;
9302 
9303     /* Convert to binary */
9304     src_len = i2d_EC_PUBKEY( key, (unsigned char**)&src );
9305     if (src_len < 0)
9306     {
9307         m2_PyErr_Msg(_ec_err);
9308         return NULL;
9309     }
9310     /* Create a PyBuffer containing a copy of the binary,
9311      * to simplify memory deallocation
9312      */
9313     pyo = PyBytes_FromStringAndSize( src, src_len );
9314 
9315     OPENSSL_free(src);
9316 
9317     return pyo;
9318 }
9319 
ec_key_get_public_key(EC_KEY * key)9320 PyObject *ec_key_get_public_key(EC_KEY *key) {
9321     char *src=NULL;
9322     int src_len=0;
9323     PyObject *pyo=NULL;
9324 
9325     /* Convert to binary */
9326     src_len = i2o_ECPublicKey(key, (unsigned char**)&src);
9327     if (src_len < 0)
9328     {
9329         m2_PyErr_Msg(_ec_err);
9330         return NULL;
9331     }
9332 
9333     pyo = PyBytes_FromStringAndSize( src, src_len );
9334 
9335     OPENSSL_free(src);
9336 
9337     return pyo;
9338 }
9339 
9340 
9341 
ec_key_read_pubkey(BIO * f)9342 EC_KEY *ec_key_read_pubkey(BIO *f) {
9343     return PEM_read_bio_EC_PUBKEY(f, NULL, NULL, NULL);
9344 }
9345 
9346 
ec_key_write_pubkey(EC_KEY * key,BIO * f)9347 int ec_key_write_pubkey(EC_KEY *key, BIO *f) {
9348     return PEM_write_bio_EC_PUBKEY(f, key );
9349 }
9350 
9351 
ec_key_read_bio(BIO * f,PyObject * pyfunc)9352 EC_KEY *ec_key_read_bio(BIO *f, PyObject *pyfunc) {
9353     EC_KEY *ret;
9354 
9355     Py_INCREF(pyfunc);
9356     Py_BEGIN_ALLOW_THREADS
9357     ret = PEM_read_bio_ECPrivateKey(f, NULL, passphrase_callback, (void *)pyfunc);
9358     Py_END_ALLOW_THREADS
9359     Py_DECREF(pyfunc);
9360     return ret;
9361 }
9362 
9363 
ec_key_write_bio(EC_KEY * key,BIO * f,EVP_CIPHER * cipher,PyObject * pyfunc)9364 int ec_key_write_bio(EC_KEY *key, BIO *f, EVP_CIPHER *cipher, PyObject *pyfunc) {
9365     int ret;
9366 
9367     Py_INCREF(pyfunc);
9368     Py_BEGIN_ALLOW_THREADS
9369     ret = PEM_write_bio_ECPrivateKey(f, key, cipher, NULL, 0,
9370         passphrase_callback, (void *)pyfunc);
9371     Py_END_ALLOW_THREADS
9372     Py_DECREF(pyfunc);
9373     return ret;
9374 }
9375 
9376 
ec_key_write_bio_no_cipher(EC_KEY * key,BIO * f,PyObject * pyfunc)9377 int ec_key_write_bio_no_cipher(EC_KEY *key, BIO *f, PyObject *pyfunc) {
9378     int ret;
9379 
9380     Py_INCREF(pyfunc);
9381     Py_BEGIN_ALLOW_THREADS
9382     ret = PEM_write_bio_ECPrivateKey(f, key, NULL, NULL, 0,
9383                       passphrase_callback, (void *)pyfunc);
9384     Py_END_ALLOW_THREADS
9385     Py_DECREF(pyfunc);
9386     return ret;
9387 }
9388 
9389 
ecdsa_sig_get_r(ECDSA_SIG * ecdsa_sig)9390 PyObject *ecdsa_sig_get_r(ECDSA_SIG *ecdsa_sig) {
9391     const BIGNUM* pr;
9392     ECDSA_SIG_get0(ecdsa_sig, &pr, NULL);
9393     return bn_to_mpi(pr);
9394 }
9395 
ecdsa_sig_get_s(ECDSA_SIG * ecdsa_sig)9396 PyObject *ecdsa_sig_get_s(ECDSA_SIG *ecdsa_sig) {
9397     const BIGNUM* ps;
9398     ECDSA_SIG_get0(ecdsa_sig, NULL, &ps);
9399     return bn_to_mpi(ps);
9400 }
9401 
ecdsa_sign(EC_KEY * key,PyObject * value)9402 PyObject *ecdsa_sign(EC_KEY *key, PyObject *value) {
9403     const void *vbuf;
9404     int vlen = 0;
9405     PyObject *tuple;
9406     ECDSA_SIG *sig;
9407 
9408     if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
9409         return NULL;
9410 
9411     if (!(sig = ECDSA_do_sign(vbuf, vlen, key))) {
9412         m2_PyErr_Msg(_ec_err);
9413         return NULL;
9414     }
9415     if (!(tuple = PyTuple_New(2))) {
9416         ECDSA_SIG_free(sig);
9417         PyErr_SetString(PyExc_RuntimeError, "PyTuple_New() fails");
9418         return NULL;
9419     }
9420     PyTuple_SET_ITEM(tuple, 0, ecdsa_sig_get_r(sig));
9421     PyTuple_SET_ITEM(tuple, 1, ecdsa_sig_get_s(sig));
9422     ECDSA_SIG_free(sig);
9423     return tuple;
9424 }
9425 
ecdsa_verify(EC_KEY * key,PyObject * value,PyObject * r,PyObject * s)9426 int ecdsa_verify(EC_KEY *key, PyObject *value, PyObject *r, PyObject *s) {
9427     const void *vbuf, *rbuf, *sbuf;
9428     int vlen = 0, rlen = 0, slen = 0;
9429     ECDSA_SIG *sig;
9430     int ret;
9431     BIGNUM* pr, *ps;
9432 
9433     if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
9434         || (m2_PyObject_AsReadBufferInt(r, &rbuf, &rlen) == -1)
9435         || (m2_PyObject_AsReadBufferInt(s, &sbuf, &slen) == -1))
9436         return -1;
9437 
9438     if (!(pr = BN_mpi2bn((unsigned char *)rbuf, rlen, NULL))) {
9439         m2_PyErr_Msg(_ec_err);
9440         return -1;
9441     }
9442     if (!(ps = BN_mpi2bn((unsigned char *)sbuf, slen, NULL))) {
9443         m2_PyErr_Msg(_ec_err);
9444         BN_free(pr);
9445         return -1;
9446     }
9447 
9448     if (!(sig = ECDSA_SIG_new())) {
9449         m2_PyErr_Msg(_ec_err);
9450         BN_free(pr);
9451         BN_free(ps);
9452         return -1;
9453     }
9454     if (!ECDSA_SIG_set0(sig, pr, ps)) {
9455         PyErr_SetString(_ec_err, "Cannot set r and s fields of ECDSA_SIG.");
9456         ECDSA_SIG_free(sig);
9457         BN_free(pr);
9458         BN_free(ps);
9459         return -1;
9460     }
9461     ret = ECDSA_do_verify(vbuf, vlen, sig, key);
9462     ECDSA_SIG_free(sig);
9463     if (ret == -1)
9464         m2_PyErr_Msg(_ec_err);
9465     return ret;
9466 }
9467 
9468 
ecdsa_sign_asn1(EC_KEY * key,PyObject * value)9469 PyObject *ecdsa_sign_asn1(EC_KEY *key, PyObject *value) {
9470     const void *vbuf;
9471     int vlen = 0;
9472     void *sigbuf;
9473     unsigned int siglen;
9474     PyObject *ret;
9475 
9476     if (m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
9477         return NULL;
9478 
9479     if (!(sigbuf = PyMem_Malloc(ECDSA_size(key)))) {
9480         PyErr_SetString(PyExc_MemoryError, "ecdsa_sign_asn1");
9481         return NULL;
9482     }
9483     if (!ECDSA_sign(0, vbuf, vlen, (unsigned char *)sigbuf, &siglen, key)) {
9484         m2_PyErr_Msg(_ec_err);
9485         PyMem_Free(sigbuf);
9486         return NULL;
9487     }
9488     ret = PyBytes_FromStringAndSize(sigbuf, siglen);
9489 
9490     PyMem_Free(sigbuf);
9491     return ret;
9492 }
9493 
9494 
ecdsa_verify_asn1(EC_KEY * key,PyObject * value,PyObject * sig)9495 int ecdsa_verify_asn1(EC_KEY *key, PyObject *value, PyObject *sig) {
9496     const void *vbuf;
9497     void *sbuf;
9498     int vlen = 0, slen = 0, ret;
9499 
9500     if ((m2_PyObject_AsReadBufferInt(value, &vbuf, &vlen) == -1)
9501         || (m2_PyObject_AsReadBufferInt(sig, (const void **)&sbuf, &slen)
9502         == -1))
9503         return -1;
9504 
9505     if ((ret = ECDSA_verify(0, vbuf, vlen, sbuf, slen, key)) == -1)
9506         m2_PyErr_Msg(_ec_err);
9507     return ret;
9508 }
9509 
ecdh_compute_key(EC_KEY * keypairA,EC_KEY * pubkeyB)9510 PyObject *ecdh_compute_key(EC_KEY *keypairA, EC_KEY *pubkeyB) {
9511     int sharedkeylen;
9512     void *sharedkey;
9513     const EC_POINT *pkpointB;
9514     PyObject *ret;
9515     const EC_GROUP* groupA;
9516 
9517     if ((pkpointB = EC_KEY_get0_public_key(pubkeyB)) == NULL)
9518     {
9519         PyErr_SetString(_ec_err, "Cannot get the public key of EC_KEY object.");
9520         return NULL;
9521     }
9522 
9523     groupA = EC_KEY_get0_group(keypairA);
9524     sharedkeylen = (EC_GROUP_get_degree(groupA) + 7)/8;
9525 
9526     if (!(sharedkey = PyMem_Malloc(sharedkeylen))) {
9527         PyErr_SetString(PyExc_MemoryError, "ecdh_compute_key");
9528         return NULL;
9529     }
9530     if ((sharedkeylen = ECDH_compute_key((unsigned char *)sharedkey, sharedkeylen, pkpointB, keypairA, NULL)) == -1) {
9531         m2_PyErr_Msg(_ec_err);
9532         PyMem_Free(sharedkey);
9533         return NULL;
9534     }
9535 
9536     ret = PyBytes_FromStringAndSize((const char *)sharedkey, sharedkeylen);
9537 
9538     PyMem_Free(sharedkey);
9539 
9540     return ret;
9541 }
9542 
9543 
ec_key_from_pubkey_der(PyObject * pubkey)9544 EC_KEY* ec_key_from_pubkey_der(PyObject *pubkey) {
9545     const void *keypairbuf;
9546     Py_ssize_t keypairbuflen;
9547     const unsigned char *tempBuf;
9548     EC_KEY *keypair;
9549 
9550     if (m2_PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
9551     {
9552         return NULL;
9553     }
9554 
9555     tempBuf = (const unsigned char *)keypairbuf;
9556     if ((keypair = d2i_EC_PUBKEY( NULL, &tempBuf, keypairbuflen)) == 0)
9557     {
9558         m2_PyErr_Msg(_ec_err);
9559         return NULL;
9560     }
9561     return keypair;
9562 }
9563 
ec_key_from_pubkey_params(int nid,PyObject * pubkey)9564 EC_KEY* ec_key_from_pubkey_params(int nid, PyObject *pubkey) {
9565     const void *keypairbuf;
9566     Py_ssize_t keypairbuflen;
9567     const unsigned char *tempBuf;
9568     EC_KEY *keypair;
9569 
9570     if (m2_PyObject_AsReadBuffer(pubkey, &keypairbuf, &keypairbuflen) == -1)
9571     {
9572         return NULL;
9573     }
9574 
9575     keypair = ec_key_new_by_curve_name(nid);
9576     if (!keypair) {
9577         m2_PyErr_Msg(_ec_err);
9578         return NULL;
9579     }
9580 
9581     tempBuf = (const unsigned char *)keypairbuf;
9582     if ((o2i_ECPublicKey( &keypair, &tempBuf, keypairbuflen)) == 0)
9583     {
9584         m2_PyErr_Msg(_ec_err);
9585         return NULL;
9586     }
9587     return keypair;
9588 }
9589 
9590 
9591 // According to [SEC2] the degree of the group is defined as EC key length
ec_key_keylen(EC_KEY * key)9592 int ec_key_keylen(EC_KEY *key) {
9593     const EC_GROUP *group = EC_KEY_get0_group(key);
9594     return EC_GROUP_get_degree(group);
9595 }
9596 
ec_key_type_check(EC_KEY * key)9597 int ec_key_type_check(EC_KEY *key) {
9598     return 1;
9599 }
9600 
9601 
9602 #include <openssl/engine.h>
9603 #include <openssl/ui.h>
9604 #include <stdio.h>
9605 
9606 
9607 
9608 /*
9609  * Code from engine-pkcs11 1.4.0 in engine-pkcs11.c
9610  *
9611 
9612 99  static char *get_pin(UI_METHOD * ui_method, void *callback_data, char *sc_pin,
9613 100                      int maxlen)
9614 101 {
9615 102         UI *ui;
9616 103         struct {
9617 104                 const void *password;
9618 105                 const char *prompt_info;
9619 106         } *mycb = callback_data;
9620 107
9621 108         if (mycb->password) {
9622 109                 sc_pin = set_pin(mycb->password);
9623 110                 return sc_pin;
9624 111         }
9625 
9626  *
9627  * So callback_data need to be always provided and have fixed type.
9628  * UI method still may be NULL.
9629  *
9630  * Following functions allocate and free callback data structure with
9631  * optional password set.
9632  */
9633 
9634 typedef struct {
9635     char * password;
9636     char * prompt;
9637 } _cbd_t;
9638 
engine_pkcs11_data_new(const char * pin)9639 void * engine_pkcs11_data_new(const char *pin) {
9640     _cbd_t * cb = (_cbd_t *) PyMem_Malloc(sizeof(_cbd_t));
9641     if (!cb) {
9642         PyErr_SetString(PyExc_MemoryError, "engine_pkcs11_data_new");
9643         return NULL;
9644     }
9645     cb->password = NULL;
9646     if (pin) {
9647         size_t size = strlen(pin);
9648         cb->password = (char *) PyMem_Malloc(size + 1);
9649         if (!cb->password) {
9650             PyErr_SetString(PyExc_MemoryError, "engine_pkcs11_data_new");
9651             PyMem_Free(cb);
9652             return NULL;
9653         }
9654         memcpy(cb->password, pin, size + 1);
9655     }
9656     cb->prompt = NULL;
9657     return cb;
9658 }
9659 
engine_pkcs11_data_free(void * vcb)9660 void engine_pkcs11_data_free(void * vcb) {
9661     _cbd_t * cb = (_cbd_t *) vcb;
9662     if (!cb)
9663         return;
9664     if (cb->password)
9665         PyMem_Free(cb->password);
9666     PyMem_Free(cb);
9667 }
9668 
9669 
9670 
9671 static PyObject *_engine_err;
9672 
engine_init_error(PyObject * engine_err)9673 void engine_init_error(PyObject *engine_err) {
9674     Py_INCREF(engine_err);
9675     _engine_err = engine_err;
9676 }
9677 
engine_load_certificate(ENGINE * e,const char * slot)9678 X509 * engine_load_certificate(ENGINE *e, const char * slot) {
9679     struct {
9680         const char * slot;
9681         X509 * cert;
9682     } cbd;
9683     cbd.slot = slot;
9684     cbd.cert = NULL;
9685     if (!ENGINE_ctrl_cmd(e, "LOAD_CERT_CTRL", 0, &cbd, NULL, 0)) {
9686         PyErr_SetString(_engine_err, "cannot load certificate");
9687         return NULL;
9688     }
9689     return cbd.cert;
9690 }
9691 
9692 
9693 #include <openssl/objects.h>
9694 
9695 
9696 /*
9697    From the manpage for OBJ_obt2txt ():
9698    BUGS
9699       OBJ_obj2txt() is awkward and messy to use: it doesn’t follow the
9700       convention of other OpenSSL functions where the buffer can be set
9701       to NULL to determine the amount of data that should be written.
9702       Instead buf must point to a valid buffer and buf_len should be set
9703       to a positive value. A buffer length of 80 should be more than
9704       enough to handle any OID encountered in practice.
9705 
9706    The first call to OBJ_obj2txt () therefore passes a non-NULL dummy
9707    buffer. This wart is reportedly removed in OpenSSL 0.9.8b, although
9708    the manpage has not been updated.
9709 
9710    OBJ_obj2txt always prints \0 at the end. But the return value
9711    is the number of "good" bytes written. So memory is allocated for
9712    len + 1 bytes but only len bytes are marshalled to python.
9713 */
obj_obj2txt(const ASN1_OBJECT * obj,int no_name)9714 PyObject *obj_obj2txt(const ASN1_OBJECT *obj, int no_name)
9715 {
9716     int len;
9717     PyObject *ret;
9718     char *buf;
9719     char dummy[1];
9720 
9721     len = OBJ_obj2txt(dummy, 1, obj, no_name);
9722     if (len < 0) {
9723         m2_PyErr_Msg(PyExc_RuntimeError);
9724         return NULL;
9725     } else if (len == 0) {
9726         /* XXX: For OpenSSL prior to 0.9.8b.
9727 
9728           Changes between 0.9.8a and 0.9.8b  [04 May 2006]
9729           ...
9730           *) Several fixes and enhancements to the OID generation code. The old code
9731              sometimes allowed invalid OIDs (1.X for X >= 40 for example), couldn't
9732              handle numbers larger than ULONG_MAX, truncated printing and had a
9733              non standard OBJ_obj2txt() behaviour.
9734              [Steve Henson]
9735         */
9736 
9737         len = 80;
9738     }
9739 
9740     buf = PyMem_Malloc(len + 1);
9741     len = OBJ_obj2txt(buf, len + 1, obj, no_name);
9742 
9743     ret = PyBytes_FromStringAndSize(buf, len);
9744 
9745     PyMem_Free(buf);
9746 
9747     return ret;
9748 }
9749 
9750 #ifdef __cplusplus
9751 extern "C" {
9752 #endif
_wrap_OPENSSL_sk_num(PyObject * self,PyObject * args)9753 SWIGINTERN PyObject *_wrap_OPENSSL_sk_num(PyObject *self, PyObject *args) {
9754   PyObject *resultobj = 0;
9755   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
9756   void *argp1 = 0 ;
9757   int res1 = 0 ;
9758   PyObject *swig_obj[1] ;
9759   int result;
9760 
9761   if (!args) SWIG_fail;
9762   swig_obj[0] = args;
9763   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
9764   if (!SWIG_IsOK(res1)) {
9765     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_num" "', argument " "1"" of type '" "OPENSSL_STACK const *""'");
9766   }
9767   arg1 = (OPENSSL_STACK *)(argp1);
9768   result = (int)OPENSSL_sk_num((struct stack_st const *)arg1);
9769   resultobj = SWIG_From_int((int)(result));
9770   return resultobj;
9771 fail:
9772   return NULL;
9773 }
9774 
9775 
_wrap_OPENSSL_sk_value(PyObject * self,PyObject * args)9776 SWIGINTERN PyObject *_wrap_OPENSSL_sk_value(PyObject *self, PyObject *args) {
9777   PyObject *resultobj = 0;
9778   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
9779   int arg2 ;
9780   void *argp1 = 0 ;
9781   int res1 = 0 ;
9782   int val2 ;
9783   int ecode2 = 0 ;
9784   PyObject *swig_obj[2] ;
9785   void *result = 0 ;
9786 
9787   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_value", 2, 2, swig_obj)) SWIG_fail;
9788   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
9789   if (!SWIG_IsOK(res1)) {
9790     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_value" "', argument " "1"" of type '" "OPENSSL_STACK const *""'");
9791   }
9792   arg1 = (OPENSSL_STACK *)(argp1);
9793   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
9794   if (!SWIG_IsOK(ecode2)) {
9795     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPENSSL_sk_value" "', argument " "2"" of type '" "int""'");
9796   }
9797   arg2 = (int)(val2);
9798   result = (void *)OPENSSL_sk_value((struct stack_st const *)arg1,arg2);
9799   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
9800   return resultobj;
9801 fail:
9802   return NULL;
9803 }
9804 
9805 
_wrap_OPENSSL_sk_set(PyObject * self,PyObject * args)9806 SWIGINTERN PyObject *_wrap_OPENSSL_sk_set(PyObject *self, PyObject *args) {
9807   PyObject *resultobj = 0;
9808   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
9809   int arg2 ;
9810   void *arg3 = (void *) 0 ;
9811   void *argp1 = 0 ;
9812   int res1 = 0 ;
9813   int val2 ;
9814   int ecode2 = 0 ;
9815   int res3 ;
9816   PyObject *swig_obj[3] ;
9817   void *result = 0 ;
9818 
9819   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_set", 3, 3, swig_obj)) SWIG_fail;
9820   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
9821   if (!SWIG_IsOK(res1)) {
9822     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_set" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
9823   }
9824   arg1 = (OPENSSL_STACK *)(argp1);
9825   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
9826   if (!SWIG_IsOK(ecode2)) {
9827     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPENSSL_sk_set" "', argument " "2"" of type '" "int""'");
9828   }
9829   arg2 = (int)(val2);
9830   res3 = SWIG_ConvertPtr(swig_obj[2],SWIG_as_voidptrptr(&arg3), 0, 0);
9831   if (!SWIG_IsOK(res3)) {
9832     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "OPENSSL_sk_set" "', argument " "3"" of type '" "void const *""'");
9833   }
9834   result = (void *)OPENSSL_sk_set(arg1,arg2,(void const *)arg3);
9835   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
9836   return resultobj;
9837 fail:
9838   return NULL;
9839 }
9840 
9841 
_wrap_OPENSSL_sk_new(PyObject * self,PyObject * args)9842 SWIGINTERN PyObject *_wrap_OPENSSL_sk_new(PyObject *self, PyObject *args) {
9843   PyObject *resultobj = 0;
9844   OPENSSL_sk_compfunc arg1 = (OPENSSL_sk_compfunc) 0 ;
9845   PyObject *swig_obj[1] ;
9846   OPENSSL_STACK *result = 0 ;
9847 
9848   if (!args) SWIG_fail;
9849   swig_obj[0] = args;
9850   {
9851     int res = SWIG_ConvertFunctionPtr(swig_obj[0], (void**)(&arg1), SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int);
9852     if (!SWIG_IsOK(res)) {
9853       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "OPENSSL_sk_new" "', argument " "1"" of type '" "OPENSSL_sk_compfunc""'");
9854     }
9855   }
9856   result = (OPENSSL_STACK *)OPENSSL_sk_new(arg1);
9857   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 |  0 );
9858   return resultobj;
9859 fail:
9860   return NULL;
9861 }
9862 
9863 
_wrap_OPENSSL_sk_new_null(PyObject * self,PyObject * args)9864 SWIGINTERN PyObject *_wrap_OPENSSL_sk_new_null(PyObject *self, PyObject *args) {
9865   PyObject *resultobj = 0;
9866   OPENSSL_STACK *result = 0 ;
9867 
9868   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_new_null", 0, 0, 0)) SWIG_fail;
9869   result = (OPENSSL_STACK *)OPENSSL_sk_new_null();
9870   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 |  0 );
9871   return resultobj;
9872 fail:
9873   return NULL;
9874 }
9875 
9876 
_wrap_OPENSSL_sk_new_reserve(PyObject * self,PyObject * args)9877 SWIGINTERN PyObject *_wrap_OPENSSL_sk_new_reserve(PyObject *self, PyObject *args) {
9878   PyObject *resultobj = 0;
9879   OPENSSL_sk_compfunc arg1 = (OPENSSL_sk_compfunc) 0 ;
9880   int arg2 ;
9881   int val2 ;
9882   int ecode2 = 0 ;
9883   PyObject *swig_obj[2] ;
9884   OPENSSL_STACK *result = 0 ;
9885 
9886   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_new_reserve", 2, 2, swig_obj)) SWIG_fail;
9887   {
9888     int res = SWIG_ConvertFunctionPtr(swig_obj[0], (void**)(&arg1), SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int);
9889     if (!SWIG_IsOK(res)) {
9890       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "OPENSSL_sk_new_reserve" "', argument " "1"" of type '" "OPENSSL_sk_compfunc""'");
9891     }
9892   }
9893   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
9894   if (!SWIG_IsOK(ecode2)) {
9895     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPENSSL_sk_new_reserve" "', argument " "2"" of type '" "int""'");
9896   }
9897   arg2 = (int)(val2);
9898   result = (OPENSSL_STACK *)OPENSSL_sk_new_reserve(arg1,arg2);
9899   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 |  0 );
9900   return resultobj;
9901 fail:
9902   return NULL;
9903 }
9904 
9905 
_wrap_OPENSSL_sk_reserve(PyObject * self,PyObject * args)9906 SWIGINTERN PyObject *_wrap_OPENSSL_sk_reserve(PyObject *self, PyObject *args) {
9907   PyObject *resultobj = 0;
9908   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
9909   int arg2 ;
9910   void *argp1 = 0 ;
9911   int res1 = 0 ;
9912   int val2 ;
9913   int ecode2 = 0 ;
9914   PyObject *swig_obj[2] ;
9915   int result;
9916 
9917   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_reserve", 2, 2, swig_obj)) SWIG_fail;
9918   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
9919   if (!SWIG_IsOK(res1)) {
9920     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_reserve" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
9921   }
9922   arg1 = (OPENSSL_STACK *)(argp1);
9923   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
9924   if (!SWIG_IsOK(ecode2)) {
9925     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPENSSL_sk_reserve" "', argument " "2"" of type '" "int""'");
9926   }
9927   arg2 = (int)(val2);
9928   result = (int)OPENSSL_sk_reserve(arg1,arg2);
9929   resultobj = SWIG_From_int((int)(result));
9930   return resultobj;
9931 fail:
9932   return NULL;
9933 }
9934 
9935 
_wrap_OPENSSL_sk_free(PyObject * self,PyObject * args)9936 SWIGINTERN PyObject *_wrap_OPENSSL_sk_free(PyObject *self, PyObject *args) {
9937   PyObject *resultobj = 0;
9938   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
9939   void *argp1 = 0 ;
9940   int res1 = 0 ;
9941   PyObject *swig_obj[1] ;
9942 
9943   if (!args) SWIG_fail;
9944   swig_obj[0] = args;
9945   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
9946   if (!SWIG_IsOK(res1)) {
9947     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_free" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
9948   }
9949   arg1 = (OPENSSL_STACK *)(argp1);
9950   OPENSSL_sk_free(arg1);
9951   resultobj = SWIG_Py_Void();
9952   return resultobj;
9953 fail:
9954   return NULL;
9955 }
9956 
9957 
_wrap_OPENSSL_sk_pop_free(PyObject * self,PyObject * args)9958 SWIGINTERN PyObject *_wrap_OPENSSL_sk_pop_free(PyObject *self, PyObject *args) {
9959   PyObject *resultobj = 0;
9960   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
9961   void (*arg2)(void *) = (void (*)(void *)) 0 ;
9962   void *argp1 = 0 ;
9963   int res1 = 0 ;
9964   PyObject *swig_obj[2] ;
9965 
9966   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_pop_free", 2, 2, swig_obj)) SWIG_fail;
9967   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
9968   if (!SWIG_IsOK(res1)) {
9969     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_pop_free" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
9970   }
9971   arg1 = (OPENSSL_STACK *)(argp1);
9972   {
9973     int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_void__void);
9974     if (!SWIG_IsOK(res)) {
9975       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "OPENSSL_sk_pop_free" "', argument " "2"" of type '" "void (*)(void *)""'");
9976     }
9977   }
9978   OPENSSL_sk_pop_free(arg1,arg2);
9979   resultobj = SWIG_Py_Void();
9980   return resultobj;
9981 fail:
9982   return NULL;
9983 }
9984 
9985 
_wrap_OPENSSL_sk_deep_copy(PyObject * self,PyObject * args)9986 SWIGINTERN PyObject *_wrap_OPENSSL_sk_deep_copy(PyObject *self, PyObject *args) {
9987   PyObject *resultobj = 0;
9988   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
9989   OPENSSL_sk_copyfunc arg2 = (OPENSSL_sk_copyfunc) 0 ;
9990   OPENSSL_sk_freefunc arg3 = (OPENSSL_sk_freefunc) 0 ;
9991   void *argp1 = 0 ;
9992   int res1 = 0 ;
9993   PyObject *swig_obj[3] ;
9994   OPENSSL_STACK *result = 0 ;
9995 
9996   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_deep_copy", 3, 3, swig_obj)) SWIG_fail;
9997   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
9998   if (!SWIG_IsOK(res1)) {
9999     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_deep_copy" "', argument " "1"" of type '" "OPENSSL_STACK const *""'");
10000   }
10001   arg1 = (OPENSSL_STACK *)(argp1);
10002   {
10003     int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__void__p_void);
10004     if (!SWIG_IsOK(res)) {
10005       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "OPENSSL_sk_deep_copy" "', argument " "2"" of type '" "OPENSSL_sk_copyfunc""'");
10006     }
10007   }
10008   {
10009     int res = SWIG_ConvertFunctionPtr(swig_obj[2], (void**)(&arg3), SWIGTYPE_p_f_p_void__void);
10010     if (!SWIG_IsOK(res)) {
10011       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "OPENSSL_sk_deep_copy" "', argument " "3"" of type '" "OPENSSL_sk_freefunc""'");
10012     }
10013   }
10014   result = (OPENSSL_STACK *)OPENSSL_sk_deep_copy((struct stack_st const *)arg1,arg2,arg3);
10015   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 |  0 );
10016   return resultobj;
10017 fail:
10018   return NULL;
10019 }
10020 
10021 
_wrap_OPENSSL_sk_insert(PyObject * self,PyObject * args)10022 SWIGINTERN PyObject *_wrap_OPENSSL_sk_insert(PyObject *self, PyObject *args) {
10023   PyObject *resultobj = 0;
10024   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10025   void *arg2 = (void *) 0 ;
10026   int arg3 ;
10027   void *argp1 = 0 ;
10028   int res1 = 0 ;
10029   int res2 ;
10030   int val3 ;
10031   int ecode3 = 0 ;
10032   PyObject *swig_obj[3] ;
10033   int result;
10034 
10035   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_insert", 3, 3, swig_obj)) SWIG_fail;
10036   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10037   if (!SWIG_IsOK(res1)) {
10038     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_insert" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10039   }
10040   arg1 = (OPENSSL_STACK *)(argp1);
10041   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
10042   if (!SWIG_IsOK(res2)) {
10043     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_insert" "', argument " "2"" of type '" "void const *""'");
10044   }
10045   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
10046   if (!SWIG_IsOK(ecode3)) {
10047     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "OPENSSL_sk_insert" "', argument " "3"" of type '" "int""'");
10048   }
10049   arg3 = (int)(val3);
10050   result = (int)OPENSSL_sk_insert(arg1,(void const *)arg2,arg3);
10051   resultobj = SWIG_From_int((int)(result));
10052   return resultobj;
10053 fail:
10054   return NULL;
10055 }
10056 
10057 
_wrap_OPENSSL_sk_delete(PyObject * self,PyObject * args)10058 SWIGINTERN PyObject *_wrap_OPENSSL_sk_delete(PyObject *self, PyObject *args) {
10059   PyObject *resultobj = 0;
10060   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10061   int arg2 ;
10062   void *argp1 = 0 ;
10063   int res1 = 0 ;
10064   int val2 ;
10065   int ecode2 = 0 ;
10066   PyObject *swig_obj[2] ;
10067   void *result = 0 ;
10068 
10069   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_delete", 2, 2, swig_obj)) SWIG_fail;
10070   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10071   if (!SWIG_IsOK(res1)) {
10072     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_delete" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10073   }
10074   arg1 = (OPENSSL_STACK *)(argp1);
10075   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
10076   if (!SWIG_IsOK(ecode2)) {
10077     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "OPENSSL_sk_delete" "', argument " "2"" of type '" "int""'");
10078   }
10079   arg2 = (int)(val2);
10080   result = (void *)OPENSSL_sk_delete(arg1,arg2);
10081   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
10082   return resultobj;
10083 fail:
10084   return NULL;
10085 }
10086 
10087 
_wrap_OPENSSL_sk_delete_ptr(PyObject * self,PyObject * args)10088 SWIGINTERN PyObject *_wrap_OPENSSL_sk_delete_ptr(PyObject *self, PyObject *args) {
10089   PyObject *resultobj = 0;
10090   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10091   void *arg2 = (void *) 0 ;
10092   void *argp1 = 0 ;
10093   int res1 = 0 ;
10094   int res2 ;
10095   PyObject *swig_obj[2] ;
10096   void *result = 0 ;
10097 
10098   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_delete_ptr", 2, 2, swig_obj)) SWIG_fail;
10099   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10100   if (!SWIG_IsOK(res1)) {
10101     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_delete_ptr" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10102   }
10103   arg1 = (OPENSSL_STACK *)(argp1);
10104   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
10105   if (!SWIG_IsOK(res2)) {
10106     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_delete_ptr" "', argument " "2"" of type '" "void const *""'");
10107   }
10108   result = (void *)OPENSSL_sk_delete_ptr(arg1,(void const *)arg2);
10109   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
10110   return resultobj;
10111 fail:
10112   return NULL;
10113 }
10114 
10115 
_wrap_OPENSSL_sk_find(PyObject * self,PyObject * args)10116 SWIGINTERN PyObject *_wrap_OPENSSL_sk_find(PyObject *self, PyObject *args) {
10117   PyObject *resultobj = 0;
10118   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10119   void *arg2 = (void *) 0 ;
10120   void *argp1 = 0 ;
10121   int res1 = 0 ;
10122   int res2 ;
10123   PyObject *swig_obj[2] ;
10124   int result;
10125 
10126   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_find", 2, 2, swig_obj)) SWIG_fail;
10127   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10128   if (!SWIG_IsOK(res1)) {
10129     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_find" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10130   }
10131   arg1 = (OPENSSL_STACK *)(argp1);
10132   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
10133   if (!SWIG_IsOK(res2)) {
10134     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_find" "', argument " "2"" of type '" "void const *""'");
10135   }
10136   result = (int)OPENSSL_sk_find(arg1,(void const *)arg2);
10137   resultobj = SWIG_From_int((int)(result));
10138   return resultobj;
10139 fail:
10140   return NULL;
10141 }
10142 
10143 
_wrap_OPENSSL_sk_find_ex(PyObject * self,PyObject * args)10144 SWIGINTERN PyObject *_wrap_OPENSSL_sk_find_ex(PyObject *self, PyObject *args) {
10145   PyObject *resultobj = 0;
10146   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10147   void *arg2 = (void *) 0 ;
10148   void *argp1 = 0 ;
10149   int res1 = 0 ;
10150   int res2 ;
10151   PyObject *swig_obj[2] ;
10152   int result;
10153 
10154   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_find_ex", 2, 2, swig_obj)) SWIG_fail;
10155   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10156   if (!SWIG_IsOK(res1)) {
10157     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_find_ex" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10158   }
10159   arg1 = (OPENSSL_STACK *)(argp1);
10160   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
10161   if (!SWIG_IsOK(res2)) {
10162     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_find_ex" "', argument " "2"" of type '" "void const *""'");
10163   }
10164   result = (int)OPENSSL_sk_find_ex(arg1,(void const *)arg2);
10165   resultobj = SWIG_From_int((int)(result));
10166   return resultobj;
10167 fail:
10168   return NULL;
10169 }
10170 
10171 
_wrap_OPENSSL_sk_push(PyObject * self,PyObject * args)10172 SWIGINTERN PyObject *_wrap_OPENSSL_sk_push(PyObject *self, PyObject *args) {
10173   PyObject *resultobj = 0;
10174   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10175   void *arg2 = (void *) 0 ;
10176   void *argp1 = 0 ;
10177   int res1 = 0 ;
10178   int res2 ;
10179   PyObject *swig_obj[2] ;
10180   int result;
10181 
10182   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_push", 2, 2, swig_obj)) SWIG_fail;
10183   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10184   if (!SWIG_IsOK(res1)) {
10185     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_push" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10186   }
10187   arg1 = (OPENSSL_STACK *)(argp1);
10188   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
10189   if (!SWIG_IsOK(res2)) {
10190     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_push" "', argument " "2"" of type '" "void const *""'");
10191   }
10192   result = (int)OPENSSL_sk_push(arg1,(void const *)arg2);
10193   resultobj = SWIG_From_int((int)(result));
10194   return resultobj;
10195 fail:
10196   return NULL;
10197 }
10198 
10199 
_wrap_OPENSSL_sk_unshift(PyObject * self,PyObject * args)10200 SWIGINTERN PyObject *_wrap_OPENSSL_sk_unshift(PyObject *self, PyObject *args) {
10201   PyObject *resultobj = 0;
10202   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10203   void *arg2 = (void *) 0 ;
10204   void *argp1 = 0 ;
10205   int res1 = 0 ;
10206   int res2 ;
10207   PyObject *swig_obj[2] ;
10208   int result;
10209 
10210   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_unshift", 2, 2, swig_obj)) SWIG_fail;
10211   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10212   if (!SWIG_IsOK(res1)) {
10213     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_unshift" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10214   }
10215   arg1 = (OPENSSL_STACK *)(argp1);
10216   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
10217   if (!SWIG_IsOK(res2)) {
10218     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "OPENSSL_sk_unshift" "', argument " "2"" of type '" "void const *""'");
10219   }
10220   result = (int)OPENSSL_sk_unshift(arg1,(void const *)arg2);
10221   resultobj = SWIG_From_int((int)(result));
10222   return resultobj;
10223 fail:
10224   return NULL;
10225 }
10226 
10227 
_wrap_OPENSSL_sk_shift(PyObject * self,PyObject * args)10228 SWIGINTERN PyObject *_wrap_OPENSSL_sk_shift(PyObject *self, PyObject *args) {
10229   PyObject *resultobj = 0;
10230   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10231   void *argp1 = 0 ;
10232   int res1 = 0 ;
10233   PyObject *swig_obj[1] ;
10234   void *result = 0 ;
10235 
10236   if (!args) SWIG_fail;
10237   swig_obj[0] = args;
10238   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10239   if (!SWIG_IsOK(res1)) {
10240     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_shift" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10241   }
10242   arg1 = (OPENSSL_STACK *)(argp1);
10243   result = (void *)OPENSSL_sk_shift(arg1);
10244   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
10245   return resultobj;
10246 fail:
10247   return NULL;
10248 }
10249 
10250 
_wrap_OPENSSL_sk_pop(PyObject * self,PyObject * args)10251 SWIGINTERN PyObject *_wrap_OPENSSL_sk_pop(PyObject *self, PyObject *args) {
10252   PyObject *resultobj = 0;
10253   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10254   void *argp1 = 0 ;
10255   int res1 = 0 ;
10256   PyObject *swig_obj[1] ;
10257   void *result = 0 ;
10258 
10259   if (!args) SWIG_fail;
10260   swig_obj[0] = args;
10261   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10262   if (!SWIG_IsOK(res1)) {
10263     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_pop" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10264   }
10265   arg1 = (OPENSSL_STACK *)(argp1);
10266   result = (void *)OPENSSL_sk_pop(arg1);
10267   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
10268   return resultobj;
10269 fail:
10270   return NULL;
10271 }
10272 
10273 
_wrap_OPENSSL_sk_zero(PyObject * self,PyObject * args)10274 SWIGINTERN PyObject *_wrap_OPENSSL_sk_zero(PyObject *self, PyObject *args) {
10275   PyObject *resultobj = 0;
10276   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10277   void *argp1 = 0 ;
10278   int res1 = 0 ;
10279   PyObject *swig_obj[1] ;
10280 
10281   if (!args) SWIG_fail;
10282   swig_obj[0] = args;
10283   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10284   if (!SWIG_IsOK(res1)) {
10285     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_zero" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10286   }
10287   arg1 = (OPENSSL_STACK *)(argp1);
10288   OPENSSL_sk_zero(arg1);
10289   resultobj = SWIG_Py_Void();
10290   return resultobj;
10291 fail:
10292   return NULL;
10293 }
10294 
10295 
_wrap_OPENSSL_sk_set_cmp_func(PyObject * self,PyObject * args)10296 SWIGINTERN PyObject *_wrap_OPENSSL_sk_set_cmp_func(PyObject *self, PyObject *args) {
10297   PyObject *resultobj = 0;
10298   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10299   OPENSSL_sk_compfunc arg2 = (OPENSSL_sk_compfunc) 0 ;
10300   void *argp1 = 0 ;
10301   int res1 = 0 ;
10302   PyObject *swig_obj[2] ;
10303   OPENSSL_sk_compfunc result;
10304 
10305   if (!SWIG_Python_UnpackTuple(args, "OPENSSL_sk_set_cmp_func", 2, 2, swig_obj)) SWIG_fail;
10306   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10307   if (!SWIG_IsOK(res1)) {
10308     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_set_cmp_func" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10309   }
10310   arg1 = (OPENSSL_STACK *)(argp1);
10311   {
10312     int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int);
10313     if (!SWIG_IsOK(res)) {
10314       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "OPENSSL_sk_set_cmp_func" "', argument " "2"" of type '" "OPENSSL_sk_compfunc""'");
10315     }
10316   }
10317   result = (OPENSSL_sk_compfunc)OPENSSL_sk_set_cmp_func(arg1,arg2);
10318   resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__void_p_q_const__void__int);
10319   return resultobj;
10320 fail:
10321   return NULL;
10322 }
10323 
10324 
_wrap_OPENSSL_sk_dup(PyObject * self,PyObject * args)10325 SWIGINTERN PyObject *_wrap_OPENSSL_sk_dup(PyObject *self, PyObject *args) {
10326   PyObject *resultobj = 0;
10327   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10328   void *argp1 = 0 ;
10329   int res1 = 0 ;
10330   PyObject *swig_obj[1] ;
10331   OPENSSL_STACK *result = 0 ;
10332 
10333   if (!args) SWIG_fail;
10334   swig_obj[0] = args;
10335   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10336   if (!SWIG_IsOK(res1)) {
10337     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_dup" "', argument " "1"" of type '" "OPENSSL_STACK const *""'");
10338   }
10339   arg1 = (OPENSSL_STACK *)(argp1);
10340   result = (OPENSSL_STACK *)OPENSSL_sk_dup((struct stack_st const *)arg1);
10341   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st, 0 |  0 );
10342   return resultobj;
10343 fail:
10344   return NULL;
10345 }
10346 
10347 
_wrap_OPENSSL_sk_sort(PyObject * self,PyObject * args)10348 SWIGINTERN PyObject *_wrap_OPENSSL_sk_sort(PyObject *self, PyObject *args) {
10349   PyObject *resultobj = 0;
10350   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10351   void *argp1 = 0 ;
10352   int res1 = 0 ;
10353   PyObject *swig_obj[1] ;
10354 
10355   if (!args) SWIG_fail;
10356   swig_obj[0] = args;
10357   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10358   if (!SWIG_IsOK(res1)) {
10359     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_sort" "', argument " "1"" of type '" "OPENSSL_STACK *""'");
10360   }
10361   arg1 = (OPENSSL_STACK *)(argp1);
10362   OPENSSL_sk_sort(arg1);
10363   resultobj = SWIG_Py_Void();
10364   return resultobj;
10365 fail:
10366   return NULL;
10367 }
10368 
10369 
_wrap_OPENSSL_sk_is_sorted(PyObject * self,PyObject * args)10370 SWIGINTERN PyObject *_wrap_OPENSSL_sk_is_sorted(PyObject *self, PyObject *args) {
10371   PyObject *resultobj = 0;
10372   OPENSSL_STACK *arg1 = (OPENSSL_STACK *) 0 ;
10373   void *argp1 = 0 ;
10374   int res1 = 0 ;
10375   PyObject *swig_obj[1] ;
10376   int result;
10377 
10378   if (!args) SWIG_fail;
10379   swig_obj[0] = args;
10380   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st, 0 |  0 );
10381   if (!SWIG_IsOK(res1)) {
10382     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "OPENSSL_sk_is_sorted" "', argument " "1"" of type '" "OPENSSL_STACK const *""'");
10383   }
10384   arg1 = (OPENSSL_STACK *)(argp1);
10385   result = (int)OPENSSL_sk_is_sorted((struct stack_st const *)arg1);
10386   resultobj = SWIG_From_int((int)(result));
10387   return resultobj;
10388 fail:
10389   return NULL;
10390 }
10391 
10392 
_wrap_sk_OPENSSL_STRING_num(PyObject * self,PyObject * args)10393 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_num(PyObject *self, PyObject *args) {
10394   PyObject *resultobj = 0;
10395   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10396   void *argp1 = 0 ;
10397   int res1 = 0 ;
10398   PyObject *swig_obj[1] ;
10399   int result;
10400 
10401   if (!args) SWIG_fail;
10402   swig_obj[0] = args;
10403   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10404   if (!SWIG_IsOK(res1)) {
10405     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_num" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING const *""'");
10406   }
10407   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10408   result = (int)sk_OPENSSL_STRING_num((struct stack_st_OPENSSL_STRING const *)arg1);
10409   resultobj = SWIG_From_int((int)(result));
10410   return resultobj;
10411 fail:
10412   return NULL;
10413 }
10414 
10415 
_wrap_sk_OPENSSL_STRING_value(PyObject * self,PyObject * args)10416 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_value(PyObject *self, PyObject *args) {
10417   PyObject *resultobj = 0;
10418   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10419   int arg2 ;
10420   void *argp1 = 0 ;
10421   int res1 = 0 ;
10422   int val2 ;
10423   int ecode2 = 0 ;
10424   PyObject *swig_obj[2] ;
10425   char *result = 0 ;
10426 
10427   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_value", 2, 2, swig_obj)) SWIG_fail;
10428   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10429   if (!SWIG_IsOK(res1)) {
10430     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_value" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING const *""'");
10431   }
10432   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10433   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
10434   if (!SWIG_IsOK(ecode2)) {
10435     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_STRING_value" "', argument " "2"" of type '" "int""'");
10436   }
10437   arg2 = (int)(val2);
10438   result = (char *)sk_OPENSSL_STRING_value((struct stack_st_OPENSSL_STRING const *)arg1,arg2);
10439   resultobj = SWIG_FromCharPtr((const char *)result);
10440   return resultobj;
10441 fail:
10442   return NULL;
10443 }
10444 
10445 
_wrap_sk_OPENSSL_STRING_new(PyObject * self,PyObject * args)10446 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_new(PyObject *self, PyObject *args) {
10447   PyObject *resultobj = 0;
10448   sk_OPENSSL_STRING_compfunc arg1 = (sk_OPENSSL_STRING_compfunc) 0 ;
10449   PyObject *swig_obj[1] ;
10450   struct stack_st_OPENSSL_STRING *result = 0 ;
10451 
10452   if (!args) SWIG_fail;
10453   swig_obj[0] = args;
10454   {
10455     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);
10456     if (!SWIG_IsOK(res)) {
10457       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_new" "', argument " "1"" of type '" "sk_OPENSSL_STRING_compfunc""'");
10458     }
10459   }
10460   result = (struct stack_st_OPENSSL_STRING *)sk_OPENSSL_STRING_new(arg1);
10461   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10462   return resultobj;
10463 fail:
10464   return NULL;
10465 }
10466 
10467 
_wrap_sk_OPENSSL_STRING_new_null(PyObject * self,PyObject * args)10468 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_new_null(PyObject *self, PyObject *args) {
10469   PyObject *resultobj = 0;
10470   struct stack_st_OPENSSL_STRING *result = 0 ;
10471 
10472   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_new_null", 0, 0, 0)) SWIG_fail;
10473   result = (struct stack_st_OPENSSL_STRING *)sk_OPENSSL_STRING_new_null();
10474   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10475   return resultobj;
10476 fail:
10477   return NULL;
10478 }
10479 
10480 
_wrap_sk_OPENSSL_STRING_new_reserve(PyObject * self,PyObject * args)10481 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_new_reserve(PyObject *self, PyObject *args) {
10482   PyObject *resultobj = 0;
10483   sk_OPENSSL_STRING_compfunc arg1 = (sk_OPENSSL_STRING_compfunc) 0 ;
10484   int arg2 ;
10485   int val2 ;
10486   int ecode2 = 0 ;
10487   PyObject *swig_obj[2] ;
10488   struct stack_st_OPENSSL_STRING *result = 0 ;
10489 
10490   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_new_reserve", 2, 2, swig_obj)) SWIG_fail;
10491   {
10492     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);
10493     if (!SWIG_IsOK(res)) {
10494       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_new_reserve" "', argument " "1"" of type '" "sk_OPENSSL_STRING_compfunc""'");
10495     }
10496   }
10497   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
10498   if (!SWIG_IsOK(ecode2)) {
10499     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_STRING_new_reserve" "', argument " "2"" of type '" "int""'");
10500   }
10501   arg2 = (int)(val2);
10502   result = (struct stack_st_OPENSSL_STRING *)sk_OPENSSL_STRING_new_reserve(arg1,arg2);
10503   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10504   return resultobj;
10505 fail:
10506   return NULL;
10507 }
10508 
10509 
_wrap_sk_OPENSSL_STRING_reserve(PyObject * self,PyObject * args)10510 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_reserve(PyObject *self, PyObject *args) {
10511   PyObject *resultobj = 0;
10512   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10513   int arg2 ;
10514   void *argp1 = 0 ;
10515   int res1 = 0 ;
10516   int val2 ;
10517   int ecode2 = 0 ;
10518   PyObject *swig_obj[2] ;
10519   int result;
10520 
10521   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_reserve", 2, 2, swig_obj)) SWIG_fail;
10522   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10523   if (!SWIG_IsOK(res1)) {
10524     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_reserve" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10525   }
10526   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10527   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
10528   if (!SWIG_IsOK(ecode2)) {
10529     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_STRING_reserve" "', argument " "2"" of type '" "int""'");
10530   }
10531   arg2 = (int)(val2);
10532   result = (int)sk_OPENSSL_STRING_reserve(arg1,arg2);
10533   resultobj = SWIG_From_int((int)(result));
10534   return resultobj;
10535 fail:
10536   return NULL;
10537 }
10538 
10539 
_wrap_sk_OPENSSL_STRING_free(PyObject * self,PyObject * args)10540 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_free(PyObject *self, PyObject *args) {
10541   PyObject *resultobj = 0;
10542   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10543   void *argp1 = 0 ;
10544   int res1 = 0 ;
10545   PyObject *swig_obj[1] ;
10546 
10547   if (!args) SWIG_fail;
10548   swig_obj[0] = args;
10549   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10550   if (!SWIG_IsOK(res1)) {
10551     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10552   }
10553   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10554   sk_OPENSSL_STRING_free(arg1);
10555   resultobj = SWIG_Py_Void();
10556   return resultobj;
10557 fail:
10558   return NULL;
10559 }
10560 
10561 
_wrap_sk_OPENSSL_STRING_zero(PyObject * self,PyObject * args)10562 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_zero(PyObject *self, PyObject *args) {
10563   PyObject *resultobj = 0;
10564   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10565   void *argp1 = 0 ;
10566   int res1 = 0 ;
10567   PyObject *swig_obj[1] ;
10568 
10569   if (!args) SWIG_fail;
10570   swig_obj[0] = args;
10571   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10572   if (!SWIG_IsOK(res1)) {
10573     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_zero" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10574   }
10575   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10576   sk_OPENSSL_STRING_zero(arg1);
10577   resultobj = SWIG_Py_Void();
10578   return resultobj;
10579 fail:
10580   return NULL;
10581 }
10582 
10583 
_wrap_sk_OPENSSL_STRING_delete(PyObject * self,PyObject * args)10584 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_delete(PyObject *self, PyObject *args) {
10585   PyObject *resultobj = 0;
10586   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10587   int arg2 ;
10588   void *argp1 = 0 ;
10589   int res1 = 0 ;
10590   int val2 ;
10591   int ecode2 = 0 ;
10592   PyObject *swig_obj[2] ;
10593   char *result = 0 ;
10594 
10595   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_delete", 2, 2, swig_obj)) SWIG_fail;
10596   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10597   if (!SWIG_IsOK(res1)) {
10598     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_delete" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10599   }
10600   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10601   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
10602   if (!SWIG_IsOK(ecode2)) {
10603     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_STRING_delete" "', argument " "2"" of type '" "int""'");
10604   }
10605   arg2 = (int)(val2);
10606   result = (char *)sk_OPENSSL_STRING_delete(arg1,arg2);
10607   resultobj = SWIG_FromCharPtr((const char *)result);
10608   return resultobj;
10609 fail:
10610   return NULL;
10611 }
10612 
10613 
_wrap_sk_OPENSSL_STRING_delete_ptr(PyObject * self,PyObject * args)10614 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_delete_ptr(PyObject *self, PyObject *args) {
10615   PyObject *resultobj = 0;
10616   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10617   char *arg2 = (char *) 0 ;
10618   void *argp1 = 0 ;
10619   int res1 = 0 ;
10620   int res2 ;
10621   char *buf2 = 0 ;
10622   int alloc2 = 0 ;
10623   PyObject *swig_obj[2] ;
10624   char *result = 0 ;
10625 
10626   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_delete_ptr", 2, 2, swig_obj)) SWIG_fail;
10627   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10628   if (!SWIG_IsOK(res1)) {
10629     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_delete_ptr" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10630   }
10631   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10632   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
10633   if (!SWIG_IsOK(res2)) {
10634     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_delete_ptr" "', argument " "2"" of type '" "char *""'");
10635   }
10636   arg2 = (char *)(buf2);
10637   result = (char *)sk_OPENSSL_STRING_delete_ptr(arg1,arg2);
10638   resultobj = SWIG_FromCharPtr((const char *)result);
10639   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10640   return resultobj;
10641 fail:
10642   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10643   return NULL;
10644 }
10645 
10646 
_wrap_sk_OPENSSL_STRING_push(PyObject * self,PyObject * args)10647 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_push(PyObject *self, PyObject *args) {
10648   PyObject *resultobj = 0;
10649   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10650   char *arg2 = (char *) 0 ;
10651   void *argp1 = 0 ;
10652   int res1 = 0 ;
10653   int res2 ;
10654   char *buf2 = 0 ;
10655   int alloc2 = 0 ;
10656   PyObject *swig_obj[2] ;
10657   int result;
10658 
10659   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_push", 2, 2, swig_obj)) SWIG_fail;
10660   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10661   if (!SWIG_IsOK(res1)) {
10662     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_push" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10663   }
10664   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10665   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
10666   if (!SWIG_IsOK(res2)) {
10667     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_push" "', argument " "2"" of type '" "char *""'");
10668   }
10669   arg2 = (char *)(buf2);
10670   result = (int)sk_OPENSSL_STRING_push(arg1,arg2);
10671   resultobj = SWIG_From_int((int)(result));
10672   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10673   return resultobj;
10674 fail:
10675   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10676   return NULL;
10677 }
10678 
10679 
_wrap_sk_OPENSSL_STRING_unshift(PyObject * self,PyObject * args)10680 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_unshift(PyObject *self, PyObject *args) {
10681   PyObject *resultobj = 0;
10682   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10683   char *arg2 = (char *) 0 ;
10684   void *argp1 = 0 ;
10685   int res1 = 0 ;
10686   int res2 ;
10687   char *buf2 = 0 ;
10688   int alloc2 = 0 ;
10689   PyObject *swig_obj[2] ;
10690   int result;
10691 
10692   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_unshift", 2, 2, swig_obj)) SWIG_fail;
10693   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10694   if (!SWIG_IsOK(res1)) {
10695     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_unshift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10696   }
10697   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10698   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
10699   if (!SWIG_IsOK(res2)) {
10700     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_unshift" "', argument " "2"" of type '" "char *""'");
10701   }
10702   arg2 = (char *)(buf2);
10703   result = (int)sk_OPENSSL_STRING_unshift(arg1,arg2);
10704   resultobj = SWIG_From_int((int)(result));
10705   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10706   return resultobj;
10707 fail:
10708   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10709   return NULL;
10710 }
10711 
10712 
_wrap_sk_OPENSSL_STRING_pop(PyObject * self,PyObject * args)10713 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_pop(PyObject *self, PyObject *args) {
10714   PyObject *resultobj = 0;
10715   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10716   void *argp1 = 0 ;
10717   int res1 = 0 ;
10718   PyObject *swig_obj[1] ;
10719   char *result = 0 ;
10720 
10721   if (!args) SWIG_fail;
10722   swig_obj[0] = args;
10723   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10724   if (!SWIG_IsOK(res1)) {
10725     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_pop" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10726   }
10727   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10728   result = (char *)sk_OPENSSL_STRING_pop(arg1);
10729   resultobj = SWIG_FromCharPtr((const char *)result);
10730   return resultobj;
10731 fail:
10732   return NULL;
10733 }
10734 
10735 
_wrap_sk_OPENSSL_STRING_shift(PyObject * self,PyObject * args)10736 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_shift(PyObject *self, PyObject *args) {
10737   PyObject *resultobj = 0;
10738   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10739   void *argp1 = 0 ;
10740   int res1 = 0 ;
10741   PyObject *swig_obj[1] ;
10742   char *result = 0 ;
10743 
10744   if (!args) SWIG_fail;
10745   swig_obj[0] = args;
10746   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10747   if (!SWIG_IsOK(res1)) {
10748     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_shift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10749   }
10750   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10751   result = (char *)sk_OPENSSL_STRING_shift(arg1);
10752   resultobj = SWIG_FromCharPtr((const char *)result);
10753   return resultobj;
10754 fail:
10755   return NULL;
10756 }
10757 
10758 
_wrap_sk_OPENSSL_STRING_pop_free(PyObject * self,PyObject * args)10759 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_pop_free(PyObject *self, PyObject *args) {
10760   PyObject *resultobj = 0;
10761   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10762   sk_OPENSSL_STRING_freefunc arg2 = (sk_OPENSSL_STRING_freefunc) 0 ;
10763   void *argp1 = 0 ;
10764   int res1 = 0 ;
10765   PyObject *swig_obj[2] ;
10766 
10767   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_pop_free", 2, 2, swig_obj)) SWIG_fail;
10768   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10769   if (!SWIG_IsOK(res1)) {
10770     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_pop_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10771   }
10772   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10773   {
10774     int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_char__void);
10775     if (!SWIG_IsOK(res)) {
10776       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_pop_free" "', argument " "2"" of type '" "sk_OPENSSL_STRING_freefunc""'");
10777     }
10778   }
10779   sk_OPENSSL_STRING_pop_free(arg1,arg2);
10780   resultobj = SWIG_Py_Void();
10781   return resultobj;
10782 fail:
10783   return NULL;
10784 }
10785 
10786 
_wrap_sk_OPENSSL_STRING_insert(PyObject * self,PyObject * args)10787 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_insert(PyObject *self, PyObject *args) {
10788   PyObject *resultobj = 0;
10789   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10790   char *arg2 = (char *) 0 ;
10791   int arg3 ;
10792   void *argp1 = 0 ;
10793   int res1 = 0 ;
10794   int res2 ;
10795   char *buf2 = 0 ;
10796   int alloc2 = 0 ;
10797   int val3 ;
10798   int ecode3 = 0 ;
10799   PyObject *swig_obj[3] ;
10800   int result;
10801 
10802   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_insert", 3, 3, swig_obj)) SWIG_fail;
10803   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10804   if (!SWIG_IsOK(res1)) {
10805     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_insert" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10806   }
10807   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10808   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
10809   if (!SWIG_IsOK(res2)) {
10810     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_insert" "', argument " "2"" of type '" "char *""'");
10811   }
10812   arg2 = (char *)(buf2);
10813   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
10814   if (!SWIG_IsOK(ecode3)) {
10815     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "sk_OPENSSL_STRING_insert" "', argument " "3"" of type '" "int""'");
10816   }
10817   arg3 = (int)(val3);
10818   result = (int)sk_OPENSSL_STRING_insert(arg1,arg2,arg3);
10819   resultobj = SWIG_From_int((int)(result));
10820   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10821   return resultobj;
10822 fail:
10823   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10824   return NULL;
10825 }
10826 
10827 
_wrap_sk_OPENSSL_STRING_set(PyObject * self,PyObject * args)10828 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_set(PyObject *self, PyObject *args) {
10829   PyObject *resultobj = 0;
10830   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10831   int arg2 ;
10832   char *arg3 = (char *) 0 ;
10833   void *argp1 = 0 ;
10834   int res1 = 0 ;
10835   int val2 ;
10836   int ecode2 = 0 ;
10837   int res3 ;
10838   char *buf3 = 0 ;
10839   int alloc3 = 0 ;
10840   PyObject *swig_obj[3] ;
10841   char *result = 0 ;
10842 
10843   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_set", 3, 3, swig_obj)) SWIG_fail;
10844   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10845   if (!SWIG_IsOK(res1)) {
10846     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_set" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10847   }
10848   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10849   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
10850   if (!SWIG_IsOK(ecode2)) {
10851     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_STRING_set" "', argument " "2"" of type '" "int""'");
10852   }
10853   arg2 = (int)(val2);
10854   res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3);
10855   if (!SWIG_IsOK(res3)) {
10856     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "sk_OPENSSL_STRING_set" "', argument " "3"" of type '" "char *""'");
10857   }
10858   arg3 = (char *)(buf3);
10859   result = (char *)sk_OPENSSL_STRING_set(arg1,arg2,arg3);
10860   resultobj = SWIG_FromCharPtr((const char *)result);
10861   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
10862   return resultobj;
10863 fail:
10864   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
10865   return NULL;
10866 }
10867 
10868 
_wrap_sk_OPENSSL_STRING_find(PyObject * self,PyObject * args)10869 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_find(PyObject *self, PyObject *args) {
10870   PyObject *resultobj = 0;
10871   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10872   char *arg2 = (char *) 0 ;
10873   void *argp1 = 0 ;
10874   int res1 = 0 ;
10875   int res2 ;
10876   char *buf2 = 0 ;
10877   int alloc2 = 0 ;
10878   PyObject *swig_obj[2] ;
10879   int result;
10880 
10881   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_find", 2, 2, swig_obj)) SWIG_fail;
10882   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10883   if (!SWIG_IsOK(res1)) {
10884     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_find" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10885   }
10886   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10887   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
10888   if (!SWIG_IsOK(res2)) {
10889     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_find" "', argument " "2"" of type '" "char *""'");
10890   }
10891   arg2 = (char *)(buf2);
10892   result = (int)sk_OPENSSL_STRING_find(arg1,arg2);
10893   resultobj = SWIG_From_int((int)(result));
10894   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10895   return resultobj;
10896 fail:
10897   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10898   return NULL;
10899 }
10900 
10901 
_wrap_sk_OPENSSL_STRING_find_ex(PyObject * self,PyObject * args)10902 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_find_ex(PyObject *self, PyObject *args) {
10903   PyObject *resultobj = 0;
10904   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10905   char *arg2 = (char *) 0 ;
10906   void *argp1 = 0 ;
10907   int res1 = 0 ;
10908   int res2 ;
10909   char *buf2 = 0 ;
10910   int alloc2 = 0 ;
10911   PyObject *swig_obj[2] ;
10912   int result;
10913 
10914   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_find_ex", 2, 2, swig_obj)) SWIG_fail;
10915   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10916   if (!SWIG_IsOK(res1)) {
10917     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_find_ex" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10918   }
10919   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10920   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
10921   if (!SWIG_IsOK(res2)) {
10922     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_STRING_find_ex" "', argument " "2"" of type '" "char *""'");
10923   }
10924   arg2 = (char *)(buf2);
10925   result = (int)sk_OPENSSL_STRING_find_ex(arg1,arg2);
10926   resultobj = SWIG_From_int((int)(result));
10927   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10928   return resultobj;
10929 fail:
10930   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
10931   return NULL;
10932 }
10933 
10934 
_wrap_sk_OPENSSL_STRING_sort(PyObject * self,PyObject * args)10935 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_sort(PyObject *self, PyObject *args) {
10936   PyObject *resultobj = 0;
10937   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10938   void *argp1 = 0 ;
10939   int res1 = 0 ;
10940   PyObject *swig_obj[1] ;
10941 
10942   if (!args) SWIG_fail;
10943   swig_obj[0] = args;
10944   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10945   if (!SWIG_IsOK(res1)) {
10946     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_sort" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
10947   }
10948   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10949   sk_OPENSSL_STRING_sort(arg1);
10950   resultobj = SWIG_Py_Void();
10951   return resultobj;
10952 fail:
10953   return NULL;
10954 }
10955 
10956 
_wrap_sk_OPENSSL_STRING_is_sorted(PyObject * self,PyObject * args)10957 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_is_sorted(PyObject *self, PyObject *args) {
10958   PyObject *resultobj = 0;
10959   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10960   void *argp1 = 0 ;
10961   int res1 = 0 ;
10962   PyObject *swig_obj[1] ;
10963   int result;
10964 
10965   if (!args) SWIG_fail;
10966   swig_obj[0] = args;
10967   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10968   if (!SWIG_IsOK(res1)) {
10969     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_is_sorted" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING const *""'");
10970   }
10971   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10972   result = (int)sk_OPENSSL_STRING_is_sorted((struct stack_st_OPENSSL_STRING const *)arg1);
10973   resultobj = SWIG_From_int((int)(result));
10974   return resultobj;
10975 fail:
10976   return NULL;
10977 }
10978 
10979 
_wrap_sk_OPENSSL_STRING_dup(PyObject * self,PyObject * args)10980 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_dup(PyObject *self, PyObject *args) {
10981   PyObject *resultobj = 0;
10982   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
10983   void *argp1 = 0 ;
10984   int res1 = 0 ;
10985   PyObject *swig_obj[1] ;
10986   struct stack_st_OPENSSL_STRING *result = 0 ;
10987 
10988   if (!args) SWIG_fail;
10989   swig_obj[0] = args;
10990   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10991   if (!SWIG_IsOK(res1)) {
10992     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_dup" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING const *""'");
10993   }
10994   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
10995   result = (struct stack_st_OPENSSL_STRING *)sk_OPENSSL_STRING_dup((struct stack_st_OPENSSL_STRING const *)arg1);
10996   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
10997   return resultobj;
10998 fail:
10999   return NULL;
11000 }
11001 
11002 
_wrap_sk_OPENSSL_STRING_deep_copy(PyObject * self,PyObject * args)11003 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_deep_copy(PyObject *self, PyObject *args) {
11004   PyObject *resultobj = 0;
11005   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
11006   sk_OPENSSL_STRING_copyfunc arg2 = (sk_OPENSSL_STRING_copyfunc) 0 ;
11007   sk_OPENSSL_STRING_freefunc arg3 = (sk_OPENSSL_STRING_freefunc) 0 ;
11008   void *argp1 = 0 ;
11009   int res1 = 0 ;
11010   PyObject *swig_obj[3] ;
11011   struct stack_st_OPENSSL_STRING *result = 0 ;
11012 
11013   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_deep_copy", 3, 3, swig_obj)) SWIG_fail;
11014   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
11015   if (!SWIG_IsOK(res1)) {
11016     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_deep_copy" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING const *""'");
11017   }
11018   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
11019   {
11020     int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__char__p_char);
11021     if (!SWIG_IsOK(res)) {
11022       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_deep_copy" "', argument " "2"" of type '" "sk_OPENSSL_STRING_copyfunc""'");
11023     }
11024   }
11025   {
11026     int res = SWIG_ConvertFunctionPtr(swig_obj[2], (void**)(&arg3), SWIGTYPE_p_f_p_char__void);
11027     if (!SWIG_IsOK(res)) {
11028       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_deep_copy" "', argument " "3"" of type '" "sk_OPENSSL_STRING_freefunc""'");
11029     }
11030   }
11031   result = (struct stack_st_OPENSSL_STRING *)sk_OPENSSL_STRING_deep_copy((struct stack_st_OPENSSL_STRING const *)arg1,arg2,arg3);
11032   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
11033   return resultobj;
11034 fail:
11035   return NULL;
11036 }
11037 
11038 
_wrap_sk_OPENSSL_STRING_set_cmp_func(PyObject * self,PyObject * args)11039 SWIGINTERN PyObject *_wrap_sk_OPENSSL_STRING_set_cmp_func(PyObject *self, PyObject *args) {
11040   PyObject *resultobj = 0;
11041   struct stack_st_OPENSSL_STRING *arg1 = (struct stack_st_OPENSSL_STRING *) 0 ;
11042   sk_OPENSSL_STRING_compfunc arg2 = (sk_OPENSSL_STRING_compfunc) 0 ;
11043   void *argp1 = 0 ;
11044   int res1 = 0 ;
11045   PyObject *swig_obj[2] ;
11046   sk_OPENSSL_STRING_compfunc result;
11047 
11048   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_STRING_set_cmp_func", 2, 2, swig_obj)) SWIG_fail;
11049   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_STRING, 0 |  0 );
11050   if (!SWIG_IsOK(res1)) {
11051     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_STRING_set_cmp_func" "', argument " "1"" of type '" "struct stack_st_OPENSSL_STRING *""'");
11052   }
11053   arg1 = (struct stack_st_OPENSSL_STRING *)(argp1);
11054   {
11055     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);
11056     if (!SWIG_IsOK(res)) {
11057       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_STRING_set_cmp_func" "', argument " "2"" of type '" "sk_OPENSSL_STRING_compfunc""'");
11058     }
11059   }
11060   result = (sk_OPENSSL_STRING_compfunc)sk_OPENSSL_STRING_set_cmp_func(arg1,arg2);
11061   resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int);
11062   return resultobj;
11063 fail:
11064   return NULL;
11065 }
11066 
11067 
_wrap_sk_OPENSSL_CSTRING_num(PyObject * self,PyObject * args)11068 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_num(PyObject *self, PyObject *args) {
11069   PyObject *resultobj = 0;
11070   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11071   void *argp1 = 0 ;
11072   int res1 = 0 ;
11073   PyObject *swig_obj[1] ;
11074   int result;
11075 
11076   if (!args) SWIG_fail;
11077   swig_obj[0] = args;
11078   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11079   if (!SWIG_IsOK(res1)) {
11080     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_num" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING const *""'");
11081   }
11082   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11083   result = (int)sk_OPENSSL_CSTRING_num((struct stack_st_OPENSSL_CSTRING const *)arg1);
11084   resultobj = SWIG_From_int((int)(result));
11085   return resultobj;
11086 fail:
11087   return NULL;
11088 }
11089 
11090 
_wrap_sk_OPENSSL_CSTRING_value(PyObject * self,PyObject * args)11091 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_value(PyObject *self, PyObject *args) {
11092   PyObject *resultobj = 0;
11093   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11094   int arg2 ;
11095   void *argp1 = 0 ;
11096   int res1 = 0 ;
11097   int val2 ;
11098   int ecode2 = 0 ;
11099   PyObject *swig_obj[2] ;
11100   char *result = 0 ;
11101 
11102   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_value", 2, 2, swig_obj)) SWIG_fail;
11103   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11104   if (!SWIG_IsOK(res1)) {
11105     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_value" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING const *""'");
11106   }
11107   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11108   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
11109   if (!SWIG_IsOK(ecode2)) {
11110     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_CSTRING_value" "', argument " "2"" of type '" "int""'");
11111   }
11112   arg2 = (int)(val2);
11113   result = (char *)sk_OPENSSL_CSTRING_value((struct stack_st_OPENSSL_CSTRING const *)arg1,arg2);
11114   resultobj = SWIG_FromCharPtr((const char *)result);
11115   return resultobj;
11116 fail:
11117   return NULL;
11118 }
11119 
11120 
_wrap_sk_OPENSSL_CSTRING_new(PyObject * self,PyObject * args)11121 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_new(PyObject *self, PyObject *args) {
11122   PyObject *resultobj = 0;
11123   sk_OPENSSL_CSTRING_compfunc arg1 = (sk_OPENSSL_CSTRING_compfunc) 0 ;
11124   PyObject *swig_obj[1] ;
11125   struct stack_st_OPENSSL_CSTRING *result = 0 ;
11126 
11127   if (!args) SWIG_fail;
11128   swig_obj[0] = args;
11129   {
11130     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);
11131     if (!SWIG_IsOK(res)) {
11132       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_new" "', argument " "1"" of type '" "sk_OPENSSL_CSTRING_compfunc""'");
11133     }
11134   }
11135   result = (struct stack_st_OPENSSL_CSTRING *)sk_OPENSSL_CSTRING_new(arg1);
11136   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11137   return resultobj;
11138 fail:
11139   return NULL;
11140 }
11141 
11142 
_wrap_sk_OPENSSL_CSTRING_new_null(PyObject * self,PyObject * args)11143 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_new_null(PyObject *self, PyObject *args) {
11144   PyObject *resultobj = 0;
11145   struct stack_st_OPENSSL_CSTRING *result = 0 ;
11146 
11147   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_new_null", 0, 0, 0)) SWIG_fail;
11148   result = (struct stack_st_OPENSSL_CSTRING *)sk_OPENSSL_CSTRING_new_null();
11149   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11150   return resultobj;
11151 fail:
11152   return NULL;
11153 }
11154 
11155 
_wrap_sk_OPENSSL_CSTRING_new_reserve(PyObject * self,PyObject * args)11156 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_new_reserve(PyObject *self, PyObject *args) {
11157   PyObject *resultobj = 0;
11158   sk_OPENSSL_CSTRING_compfunc arg1 = (sk_OPENSSL_CSTRING_compfunc) 0 ;
11159   int arg2 ;
11160   int val2 ;
11161   int ecode2 = 0 ;
11162   PyObject *swig_obj[2] ;
11163   struct stack_st_OPENSSL_CSTRING *result = 0 ;
11164 
11165   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_new_reserve", 2, 2, swig_obj)) SWIG_fail;
11166   {
11167     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);
11168     if (!SWIG_IsOK(res)) {
11169       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_new_reserve" "', argument " "1"" of type '" "sk_OPENSSL_CSTRING_compfunc""'");
11170     }
11171   }
11172   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
11173   if (!SWIG_IsOK(ecode2)) {
11174     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_CSTRING_new_reserve" "', argument " "2"" of type '" "int""'");
11175   }
11176   arg2 = (int)(val2);
11177   result = (struct stack_st_OPENSSL_CSTRING *)sk_OPENSSL_CSTRING_new_reserve(arg1,arg2);
11178   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11179   return resultobj;
11180 fail:
11181   return NULL;
11182 }
11183 
11184 
_wrap_sk_OPENSSL_CSTRING_reserve(PyObject * self,PyObject * args)11185 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_reserve(PyObject *self, PyObject *args) {
11186   PyObject *resultobj = 0;
11187   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11188   int arg2 ;
11189   void *argp1 = 0 ;
11190   int res1 = 0 ;
11191   int val2 ;
11192   int ecode2 = 0 ;
11193   PyObject *swig_obj[2] ;
11194   int result;
11195 
11196   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_reserve", 2, 2, swig_obj)) SWIG_fail;
11197   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11198   if (!SWIG_IsOK(res1)) {
11199     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_reserve" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11200   }
11201   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11202   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
11203   if (!SWIG_IsOK(ecode2)) {
11204     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_CSTRING_reserve" "', argument " "2"" of type '" "int""'");
11205   }
11206   arg2 = (int)(val2);
11207   result = (int)sk_OPENSSL_CSTRING_reserve(arg1,arg2);
11208   resultobj = SWIG_From_int((int)(result));
11209   return resultobj;
11210 fail:
11211   return NULL;
11212 }
11213 
11214 
_wrap_sk_OPENSSL_CSTRING_free(PyObject * self,PyObject * args)11215 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_free(PyObject *self, PyObject *args) {
11216   PyObject *resultobj = 0;
11217   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11218   void *argp1 = 0 ;
11219   int res1 = 0 ;
11220   PyObject *swig_obj[1] ;
11221 
11222   if (!args) SWIG_fail;
11223   swig_obj[0] = args;
11224   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11225   if (!SWIG_IsOK(res1)) {
11226     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11227   }
11228   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11229   sk_OPENSSL_CSTRING_free(arg1);
11230   resultobj = SWIG_Py_Void();
11231   return resultobj;
11232 fail:
11233   return NULL;
11234 }
11235 
11236 
_wrap_sk_OPENSSL_CSTRING_zero(PyObject * self,PyObject * args)11237 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_zero(PyObject *self, PyObject *args) {
11238   PyObject *resultobj = 0;
11239   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11240   void *argp1 = 0 ;
11241   int res1 = 0 ;
11242   PyObject *swig_obj[1] ;
11243 
11244   if (!args) SWIG_fail;
11245   swig_obj[0] = args;
11246   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11247   if (!SWIG_IsOK(res1)) {
11248     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_zero" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11249   }
11250   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11251   sk_OPENSSL_CSTRING_zero(arg1);
11252   resultobj = SWIG_Py_Void();
11253   return resultobj;
11254 fail:
11255   return NULL;
11256 }
11257 
11258 
_wrap_sk_OPENSSL_CSTRING_delete(PyObject * self,PyObject * args)11259 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_delete(PyObject *self, PyObject *args) {
11260   PyObject *resultobj = 0;
11261   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11262   int arg2 ;
11263   void *argp1 = 0 ;
11264   int res1 = 0 ;
11265   int val2 ;
11266   int ecode2 = 0 ;
11267   PyObject *swig_obj[2] ;
11268   char *result = 0 ;
11269 
11270   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_delete", 2, 2, swig_obj)) SWIG_fail;
11271   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11272   if (!SWIG_IsOK(res1)) {
11273     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_delete" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11274   }
11275   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11276   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
11277   if (!SWIG_IsOK(ecode2)) {
11278     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_CSTRING_delete" "', argument " "2"" of type '" "int""'");
11279   }
11280   arg2 = (int)(val2);
11281   result = (char *)sk_OPENSSL_CSTRING_delete(arg1,arg2);
11282   resultobj = SWIG_FromCharPtr((const char *)result);
11283   return resultobj;
11284 fail:
11285   return NULL;
11286 }
11287 
11288 
_wrap_sk_OPENSSL_CSTRING_delete_ptr(PyObject * self,PyObject * args)11289 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_delete_ptr(PyObject *self, PyObject *args) {
11290   PyObject *resultobj = 0;
11291   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11292   char *arg2 = (char *) 0 ;
11293   void *argp1 = 0 ;
11294   int res1 = 0 ;
11295   int res2 ;
11296   char *buf2 = 0 ;
11297   int alloc2 = 0 ;
11298   PyObject *swig_obj[2] ;
11299   char *result = 0 ;
11300 
11301   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_delete_ptr", 2, 2, swig_obj)) SWIG_fail;
11302   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11303   if (!SWIG_IsOK(res1)) {
11304     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_delete_ptr" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11305   }
11306   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11307   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
11308   if (!SWIG_IsOK(res2)) {
11309     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_delete_ptr" "', argument " "2"" of type '" "char const *""'");
11310   }
11311   arg2 = (char *)(buf2);
11312   result = (char *)sk_OPENSSL_CSTRING_delete_ptr(arg1,(char const *)arg2);
11313   resultobj = SWIG_FromCharPtr((const char *)result);
11314   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11315   return resultobj;
11316 fail:
11317   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11318   return NULL;
11319 }
11320 
11321 
_wrap_sk_OPENSSL_CSTRING_push(PyObject * self,PyObject * args)11322 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_push(PyObject *self, PyObject *args) {
11323   PyObject *resultobj = 0;
11324   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11325   char *arg2 = (char *) 0 ;
11326   void *argp1 = 0 ;
11327   int res1 = 0 ;
11328   int res2 ;
11329   char *buf2 = 0 ;
11330   int alloc2 = 0 ;
11331   PyObject *swig_obj[2] ;
11332   int result;
11333 
11334   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_push", 2, 2, swig_obj)) SWIG_fail;
11335   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11336   if (!SWIG_IsOK(res1)) {
11337     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_push" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11338   }
11339   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11340   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
11341   if (!SWIG_IsOK(res2)) {
11342     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_push" "', argument " "2"" of type '" "char const *""'");
11343   }
11344   arg2 = (char *)(buf2);
11345   result = (int)sk_OPENSSL_CSTRING_push(arg1,(char const *)arg2);
11346   resultobj = SWIG_From_int((int)(result));
11347   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11348   return resultobj;
11349 fail:
11350   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11351   return NULL;
11352 }
11353 
11354 
_wrap_sk_OPENSSL_CSTRING_unshift(PyObject * self,PyObject * args)11355 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_unshift(PyObject *self, PyObject *args) {
11356   PyObject *resultobj = 0;
11357   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11358   char *arg2 = (char *) 0 ;
11359   void *argp1 = 0 ;
11360   int res1 = 0 ;
11361   int res2 ;
11362   char *buf2 = 0 ;
11363   int alloc2 = 0 ;
11364   PyObject *swig_obj[2] ;
11365   int result;
11366 
11367   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_unshift", 2, 2, swig_obj)) SWIG_fail;
11368   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11369   if (!SWIG_IsOK(res1)) {
11370     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_unshift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11371   }
11372   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11373   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
11374   if (!SWIG_IsOK(res2)) {
11375     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_unshift" "', argument " "2"" of type '" "char const *""'");
11376   }
11377   arg2 = (char *)(buf2);
11378   result = (int)sk_OPENSSL_CSTRING_unshift(arg1,(char const *)arg2);
11379   resultobj = SWIG_From_int((int)(result));
11380   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11381   return resultobj;
11382 fail:
11383   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11384   return NULL;
11385 }
11386 
11387 
_wrap_sk_OPENSSL_CSTRING_pop(PyObject * self,PyObject * args)11388 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_pop(PyObject *self, PyObject *args) {
11389   PyObject *resultobj = 0;
11390   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11391   void *argp1 = 0 ;
11392   int res1 = 0 ;
11393   PyObject *swig_obj[1] ;
11394   char *result = 0 ;
11395 
11396   if (!args) SWIG_fail;
11397   swig_obj[0] = args;
11398   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11399   if (!SWIG_IsOK(res1)) {
11400     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_pop" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11401   }
11402   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11403   result = (char *)sk_OPENSSL_CSTRING_pop(arg1);
11404   resultobj = SWIG_FromCharPtr((const char *)result);
11405   return resultobj;
11406 fail:
11407   return NULL;
11408 }
11409 
11410 
_wrap_sk_OPENSSL_CSTRING_shift(PyObject * self,PyObject * args)11411 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_shift(PyObject *self, PyObject *args) {
11412   PyObject *resultobj = 0;
11413   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11414   void *argp1 = 0 ;
11415   int res1 = 0 ;
11416   PyObject *swig_obj[1] ;
11417   char *result = 0 ;
11418 
11419   if (!args) SWIG_fail;
11420   swig_obj[0] = args;
11421   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11422   if (!SWIG_IsOK(res1)) {
11423     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_shift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11424   }
11425   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11426   result = (char *)sk_OPENSSL_CSTRING_shift(arg1);
11427   resultobj = SWIG_FromCharPtr((const char *)result);
11428   return resultobj;
11429 fail:
11430   return NULL;
11431 }
11432 
11433 
_wrap_sk_OPENSSL_CSTRING_pop_free(PyObject * self,PyObject * args)11434 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_pop_free(PyObject *self, PyObject *args) {
11435   PyObject *resultobj = 0;
11436   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11437   sk_OPENSSL_CSTRING_freefunc arg2 = (sk_OPENSSL_CSTRING_freefunc) 0 ;
11438   void *argp1 = 0 ;
11439   int res1 = 0 ;
11440   PyObject *swig_obj[2] ;
11441 
11442   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_pop_free", 2, 2, swig_obj)) SWIG_fail;
11443   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11444   if (!SWIG_IsOK(res1)) {
11445     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_pop_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11446   }
11447   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11448   {
11449     int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_char__void);
11450     if (!SWIG_IsOK(res)) {
11451       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_pop_free" "', argument " "2"" of type '" "sk_OPENSSL_CSTRING_freefunc""'");
11452     }
11453   }
11454   sk_OPENSSL_CSTRING_pop_free(arg1,arg2);
11455   resultobj = SWIG_Py_Void();
11456   return resultobj;
11457 fail:
11458   return NULL;
11459 }
11460 
11461 
_wrap_sk_OPENSSL_CSTRING_insert(PyObject * self,PyObject * args)11462 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_insert(PyObject *self, PyObject *args) {
11463   PyObject *resultobj = 0;
11464   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11465   char *arg2 = (char *) 0 ;
11466   int arg3 ;
11467   void *argp1 = 0 ;
11468   int res1 = 0 ;
11469   int res2 ;
11470   char *buf2 = 0 ;
11471   int alloc2 = 0 ;
11472   int val3 ;
11473   int ecode3 = 0 ;
11474   PyObject *swig_obj[3] ;
11475   int result;
11476 
11477   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_insert", 3, 3, swig_obj)) SWIG_fail;
11478   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11479   if (!SWIG_IsOK(res1)) {
11480     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_insert" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11481   }
11482   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11483   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
11484   if (!SWIG_IsOK(res2)) {
11485     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_insert" "', argument " "2"" of type '" "char const *""'");
11486   }
11487   arg2 = (char *)(buf2);
11488   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
11489   if (!SWIG_IsOK(ecode3)) {
11490     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "sk_OPENSSL_CSTRING_insert" "', argument " "3"" of type '" "int""'");
11491   }
11492   arg3 = (int)(val3);
11493   result = (int)sk_OPENSSL_CSTRING_insert(arg1,(char const *)arg2,arg3);
11494   resultobj = SWIG_From_int((int)(result));
11495   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11496   return resultobj;
11497 fail:
11498   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11499   return NULL;
11500 }
11501 
11502 
_wrap_sk_OPENSSL_CSTRING_set(PyObject * self,PyObject * args)11503 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_set(PyObject *self, PyObject *args) {
11504   PyObject *resultobj = 0;
11505   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11506   int arg2 ;
11507   char *arg3 = (char *) 0 ;
11508   void *argp1 = 0 ;
11509   int res1 = 0 ;
11510   int val2 ;
11511   int ecode2 = 0 ;
11512   int res3 ;
11513   char *buf3 = 0 ;
11514   int alloc3 = 0 ;
11515   PyObject *swig_obj[3] ;
11516   char *result = 0 ;
11517 
11518   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_set", 3, 3, swig_obj)) SWIG_fail;
11519   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11520   if (!SWIG_IsOK(res1)) {
11521     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_set" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11522   }
11523   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11524   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
11525   if (!SWIG_IsOK(ecode2)) {
11526     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_CSTRING_set" "', argument " "2"" of type '" "int""'");
11527   }
11528   arg2 = (int)(val2);
11529   res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3);
11530   if (!SWIG_IsOK(res3)) {
11531     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "sk_OPENSSL_CSTRING_set" "', argument " "3"" of type '" "char const *""'");
11532   }
11533   arg3 = (char *)(buf3);
11534   result = (char *)sk_OPENSSL_CSTRING_set(arg1,arg2,(char const *)arg3);
11535   resultobj = SWIG_FromCharPtr((const char *)result);
11536   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
11537   return resultobj;
11538 fail:
11539   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
11540   return NULL;
11541 }
11542 
11543 
_wrap_sk_OPENSSL_CSTRING_find(PyObject * self,PyObject * args)11544 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_find(PyObject *self, PyObject *args) {
11545   PyObject *resultobj = 0;
11546   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11547   char *arg2 = (char *) 0 ;
11548   void *argp1 = 0 ;
11549   int res1 = 0 ;
11550   int res2 ;
11551   char *buf2 = 0 ;
11552   int alloc2 = 0 ;
11553   PyObject *swig_obj[2] ;
11554   int result;
11555 
11556   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_find", 2, 2, swig_obj)) SWIG_fail;
11557   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11558   if (!SWIG_IsOK(res1)) {
11559     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_find" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11560   }
11561   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11562   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
11563   if (!SWIG_IsOK(res2)) {
11564     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_find" "', argument " "2"" of type '" "char const *""'");
11565   }
11566   arg2 = (char *)(buf2);
11567   result = (int)sk_OPENSSL_CSTRING_find(arg1,(char const *)arg2);
11568   resultobj = SWIG_From_int((int)(result));
11569   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11570   return resultobj;
11571 fail:
11572   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11573   return NULL;
11574 }
11575 
11576 
_wrap_sk_OPENSSL_CSTRING_find_ex(PyObject * self,PyObject * args)11577 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_find_ex(PyObject *self, PyObject *args) {
11578   PyObject *resultobj = 0;
11579   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11580   char *arg2 = (char *) 0 ;
11581   void *argp1 = 0 ;
11582   int res1 = 0 ;
11583   int res2 ;
11584   char *buf2 = 0 ;
11585   int alloc2 = 0 ;
11586   PyObject *swig_obj[2] ;
11587   int result;
11588 
11589   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_find_ex", 2, 2, swig_obj)) SWIG_fail;
11590   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11591   if (!SWIG_IsOK(res1)) {
11592     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_find_ex" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11593   }
11594   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11595   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
11596   if (!SWIG_IsOK(res2)) {
11597     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_CSTRING_find_ex" "', argument " "2"" of type '" "char const *""'");
11598   }
11599   arg2 = (char *)(buf2);
11600   result = (int)sk_OPENSSL_CSTRING_find_ex(arg1,(char const *)arg2);
11601   resultobj = SWIG_From_int((int)(result));
11602   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11603   return resultobj;
11604 fail:
11605   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
11606   return NULL;
11607 }
11608 
11609 
_wrap_sk_OPENSSL_CSTRING_sort(PyObject * self,PyObject * args)11610 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_sort(PyObject *self, PyObject *args) {
11611   PyObject *resultobj = 0;
11612   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11613   void *argp1 = 0 ;
11614   int res1 = 0 ;
11615   PyObject *swig_obj[1] ;
11616 
11617   if (!args) SWIG_fail;
11618   swig_obj[0] = args;
11619   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11620   if (!SWIG_IsOK(res1)) {
11621     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_sort" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11622   }
11623   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11624   sk_OPENSSL_CSTRING_sort(arg1);
11625   resultobj = SWIG_Py_Void();
11626   return resultobj;
11627 fail:
11628   return NULL;
11629 }
11630 
11631 
_wrap_sk_OPENSSL_CSTRING_is_sorted(PyObject * self,PyObject * args)11632 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_is_sorted(PyObject *self, PyObject *args) {
11633   PyObject *resultobj = 0;
11634   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11635   void *argp1 = 0 ;
11636   int res1 = 0 ;
11637   PyObject *swig_obj[1] ;
11638   int result;
11639 
11640   if (!args) SWIG_fail;
11641   swig_obj[0] = args;
11642   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11643   if (!SWIG_IsOK(res1)) {
11644     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_is_sorted" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING const *""'");
11645   }
11646   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11647   result = (int)sk_OPENSSL_CSTRING_is_sorted((struct stack_st_OPENSSL_CSTRING const *)arg1);
11648   resultobj = SWIG_From_int((int)(result));
11649   return resultobj;
11650 fail:
11651   return NULL;
11652 }
11653 
11654 
_wrap_sk_OPENSSL_CSTRING_dup(PyObject * self,PyObject * args)11655 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_dup(PyObject *self, PyObject *args) {
11656   PyObject *resultobj = 0;
11657   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11658   void *argp1 = 0 ;
11659   int res1 = 0 ;
11660   PyObject *swig_obj[1] ;
11661   struct stack_st_OPENSSL_CSTRING *result = 0 ;
11662 
11663   if (!args) SWIG_fail;
11664   swig_obj[0] = args;
11665   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11666   if (!SWIG_IsOK(res1)) {
11667     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_dup" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING const *""'");
11668   }
11669   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11670   result = (struct stack_st_OPENSSL_CSTRING *)sk_OPENSSL_CSTRING_dup((struct stack_st_OPENSSL_CSTRING const *)arg1);
11671   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11672   return resultobj;
11673 fail:
11674   return NULL;
11675 }
11676 
11677 
_wrap_sk_OPENSSL_CSTRING_deep_copy(PyObject * self,PyObject * args)11678 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_deep_copy(PyObject *self, PyObject *args) {
11679   PyObject *resultobj = 0;
11680   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11681   sk_OPENSSL_CSTRING_copyfunc arg2 = (sk_OPENSSL_CSTRING_copyfunc) 0 ;
11682   sk_OPENSSL_CSTRING_freefunc arg3 = (sk_OPENSSL_CSTRING_freefunc) 0 ;
11683   void *argp1 = 0 ;
11684   int res1 = 0 ;
11685   PyObject *swig_obj[3] ;
11686   struct stack_st_OPENSSL_CSTRING *result = 0 ;
11687 
11688   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_deep_copy", 3, 3, swig_obj)) SWIG_fail;
11689   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11690   if (!SWIG_IsOK(res1)) {
11691     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_deep_copy" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING const *""'");
11692   }
11693   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11694   {
11695     int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__char__p_char);
11696     if (!SWIG_IsOK(res)) {
11697       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_deep_copy" "', argument " "2"" of type '" "sk_OPENSSL_CSTRING_copyfunc""'");
11698     }
11699   }
11700   {
11701     int res = SWIG_ConvertFunctionPtr(swig_obj[2], (void**)(&arg3), SWIGTYPE_p_f_p_char__void);
11702     if (!SWIG_IsOK(res)) {
11703       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_deep_copy" "', argument " "3"" of type '" "sk_OPENSSL_CSTRING_freefunc""'");
11704     }
11705   }
11706   result = (struct stack_st_OPENSSL_CSTRING *)sk_OPENSSL_CSTRING_deep_copy((struct stack_st_OPENSSL_CSTRING const *)arg1,arg2,arg3);
11707   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11708   return resultobj;
11709 fail:
11710   return NULL;
11711 }
11712 
11713 
_wrap_sk_OPENSSL_CSTRING_set_cmp_func(PyObject * self,PyObject * args)11714 SWIGINTERN PyObject *_wrap_sk_OPENSSL_CSTRING_set_cmp_func(PyObject *self, PyObject *args) {
11715   PyObject *resultobj = 0;
11716   struct stack_st_OPENSSL_CSTRING *arg1 = (struct stack_st_OPENSSL_CSTRING *) 0 ;
11717   sk_OPENSSL_CSTRING_compfunc arg2 = (sk_OPENSSL_CSTRING_compfunc) 0 ;
11718   void *argp1 = 0 ;
11719   int res1 = 0 ;
11720   PyObject *swig_obj[2] ;
11721   sk_OPENSSL_CSTRING_compfunc result;
11722 
11723   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_CSTRING_set_cmp_func", 2, 2, swig_obj)) SWIG_fail;
11724   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_CSTRING, 0 |  0 );
11725   if (!SWIG_IsOK(res1)) {
11726     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_CSTRING_set_cmp_func" "', argument " "1"" of type '" "struct stack_st_OPENSSL_CSTRING *""'");
11727   }
11728   arg1 = (struct stack_st_OPENSSL_CSTRING *)(argp1);
11729   {
11730     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);
11731     if (!SWIG_IsOK(res)) {
11732       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_CSTRING_set_cmp_func" "', argument " "2"" of type '" "sk_OPENSSL_CSTRING_compfunc""'");
11733     }
11734   }
11735   result = (sk_OPENSSL_CSTRING_compfunc)sk_OPENSSL_CSTRING_set_cmp_func(arg1,arg2);
11736   resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int);
11737   return resultobj;
11738 fail:
11739   return NULL;
11740 }
11741 
11742 
_wrap_sk_OPENSSL_BLOCK_num(PyObject * self,PyObject * args)11743 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_num(PyObject *self, PyObject *args) {
11744   PyObject *resultobj = 0;
11745   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
11746   void *argp1 = 0 ;
11747   int res1 = 0 ;
11748   PyObject *swig_obj[1] ;
11749   int result;
11750 
11751   if (!args) SWIG_fail;
11752   swig_obj[0] = args;
11753   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
11754   if (!SWIG_IsOK(res1)) {
11755     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_num" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK const *""'");
11756   }
11757   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
11758   result = (int)sk_OPENSSL_BLOCK_num((struct stack_st_OPENSSL_BLOCK const *)arg1);
11759   resultobj = SWIG_From_int((int)(result));
11760   return resultobj;
11761 fail:
11762   return NULL;
11763 }
11764 
11765 
_wrap_sk_OPENSSL_BLOCK_value(PyObject * self,PyObject * args)11766 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_value(PyObject *self, PyObject *args) {
11767   PyObject *resultobj = 0;
11768   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
11769   int arg2 ;
11770   void *argp1 = 0 ;
11771   int res1 = 0 ;
11772   int val2 ;
11773   int ecode2 = 0 ;
11774   PyObject *swig_obj[2] ;
11775   void *result = 0 ;
11776 
11777   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_value", 2, 2, swig_obj)) SWIG_fail;
11778   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
11779   if (!SWIG_IsOK(res1)) {
11780     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_value" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK const *""'");
11781   }
11782   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
11783   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
11784   if (!SWIG_IsOK(ecode2)) {
11785     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_BLOCK_value" "', argument " "2"" of type '" "int""'");
11786   }
11787   arg2 = (int)(val2);
11788   result = (void *)sk_OPENSSL_BLOCK_value((struct stack_st_OPENSSL_BLOCK const *)arg1,arg2);
11789   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
11790   return resultobj;
11791 fail:
11792   return NULL;
11793 }
11794 
11795 
_wrap_sk_OPENSSL_BLOCK_new(PyObject * self,PyObject * args)11796 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_new(PyObject *self, PyObject *args) {
11797   PyObject *resultobj = 0;
11798   sk_OPENSSL_BLOCK_compfunc arg1 = (sk_OPENSSL_BLOCK_compfunc) 0 ;
11799   PyObject *swig_obj[1] ;
11800   struct stack_st_OPENSSL_BLOCK *result = 0 ;
11801 
11802   if (!args) SWIG_fail;
11803   swig_obj[0] = args;
11804   {
11805     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);
11806     if (!SWIG_IsOK(res)) {
11807       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_new" "', argument " "1"" of type '" "sk_OPENSSL_BLOCK_compfunc""'");
11808     }
11809   }
11810   result = (struct stack_st_OPENSSL_BLOCK *)sk_OPENSSL_BLOCK_new(arg1);
11811   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
11812   return resultobj;
11813 fail:
11814   return NULL;
11815 }
11816 
11817 
_wrap_sk_OPENSSL_BLOCK_new_null(PyObject * self,PyObject * args)11818 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_new_null(PyObject *self, PyObject *args) {
11819   PyObject *resultobj = 0;
11820   struct stack_st_OPENSSL_BLOCK *result = 0 ;
11821 
11822   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_new_null", 0, 0, 0)) SWIG_fail;
11823   result = (struct stack_st_OPENSSL_BLOCK *)sk_OPENSSL_BLOCK_new_null();
11824   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
11825   return resultobj;
11826 fail:
11827   return NULL;
11828 }
11829 
11830 
_wrap_sk_OPENSSL_BLOCK_new_reserve(PyObject * self,PyObject * args)11831 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_new_reserve(PyObject *self, PyObject *args) {
11832   PyObject *resultobj = 0;
11833   sk_OPENSSL_BLOCK_compfunc arg1 = (sk_OPENSSL_BLOCK_compfunc) 0 ;
11834   int arg2 ;
11835   int val2 ;
11836   int ecode2 = 0 ;
11837   PyObject *swig_obj[2] ;
11838   struct stack_st_OPENSSL_BLOCK *result = 0 ;
11839 
11840   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_new_reserve", 2, 2, swig_obj)) SWIG_fail;
11841   {
11842     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);
11843     if (!SWIG_IsOK(res)) {
11844       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_new_reserve" "', argument " "1"" of type '" "sk_OPENSSL_BLOCK_compfunc""'");
11845     }
11846   }
11847   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
11848   if (!SWIG_IsOK(ecode2)) {
11849     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_BLOCK_new_reserve" "', argument " "2"" of type '" "int""'");
11850   }
11851   arg2 = (int)(val2);
11852   result = (struct stack_st_OPENSSL_BLOCK *)sk_OPENSSL_BLOCK_new_reserve(arg1,arg2);
11853   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
11854   return resultobj;
11855 fail:
11856   return NULL;
11857 }
11858 
11859 
_wrap_sk_OPENSSL_BLOCK_reserve(PyObject * self,PyObject * args)11860 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_reserve(PyObject *self, PyObject *args) {
11861   PyObject *resultobj = 0;
11862   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
11863   int arg2 ;
11864   void *argp1 = 0 ;
11865   int res1 = 0 ;
11866   int val2 ;
11867   int ecode2 = 0 ;
11868   PyObject *swig_obj[2] ;
11869   int result;
11870 
11871   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_reserve", 2, 2, swig_obj)) SWIG_fail;
11872   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
11873   if (!SWIG_IsOK(res1)) {
11874     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_reserve" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
11875   }
11876   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
11877   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
11878   if (!SWIG_IsOK(ecode2)) {
11879     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_BLOCK_reserve" "', argument " "2"" of type '" "int""'");
11880   }
11881   arg2 = (int)(val2);
11882   result = (int)sk_OPENSSL_BLOCK_reserve(arg1,arg2);
11883   resultobj = SWIG_From_int((int)(result));
11884   return resultobj;
11885 fail:
11886   return NULL;
11887 }
11888 
11889 
_wrap_sk_OPENSSL_BLOCK_free(PyObject * self,PyObject * args)11890 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_free(PyObject *self, PyObject *args) {
11891   PyObject *resultobj = 0;
11892   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
11893   void *argp1 = 0 ;
11894   int res1 = 0 ;
11895   PyObject *swig_obj[1] ;
11896 
11897   if (!args) SWIG_fail;
11898   swig_obj[0] = args;
11899   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
11900   if (!SWIG_IsOK(res1)) {
11901     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
11902   }
11903   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
11904   sk_OPENSSL_BLOCK_free(arg1);
11905   resultobj = SWIG_Py_Void();
11906   return resultobj;
11907 fail:
11908   return NULL;
11909 }
11910 
11911 
_wrap_sk_OPENSSL_BLOCK_zero(PyObject * self,PyObject * args)11912 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_zero(PyObject *self, PyObject *args) {
11913   PyObject *resultobj = 0;
11914   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
11915   void *argp1 = 0 ;
11916   int res1 = 0 ;
11917   PyObject *swig_obj[1] ;
11918 
11919   if (!args) SWIG_fail;
11920   swig_obj[0] = args;
11921   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
11922   if (!SWIG_IsOK(res1)) {
11923     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_zero" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
11924   }
11925   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
11926   sk_OPENSSL_BLOCK_zero(arg1);
11927   resultobj = SWIG_Py_Void();
11928   return resultobj;
11929 fail:
11930   return NULL;
11931 }
11932 
11933 
_wrap_sk_OPENSSL_BLOCK_delete(PyObject * self,PyObject * args)11934 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_delete(PyObject *self, PyObject *args) {
11935   PyObject *resultobj = 0;
11936   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
11937   int arg2 ;
11938   void *argp1 = 0 ;
11939   int res1 = 0 ;
11940   int val2 ;
11941   int ecode2 = 0 ;
11942   PyObject *swig_obj[2] ;
11943   void *result = 0 ;
11944 
11945   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_delete", 2, 2, swig_obj)) SWIG_fail;
11946   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
11947   if (!SWIG_IsOK(res1)) {
11948     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_delete" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
11949   }
11950   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
11951   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
11952   if (!SWIG_IsOK(ecode2)) {
11953     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_BLOCK_delete" "', argument " "2"" of type '" "int""'");
11954   }
11955   arg2 = (int)(val2);
11956   result = (void *)sk_OPENSSL_BLOCK_delete(arg1,arg2);
11957   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
11958   return resultobj;
11959 fail:
11960   return NULL;
11961 }
11962 
11963 
_wrap_sk_OPENSSL_BLOCK_delete_ptr(PyObject * self,PyObject * args)11964 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_delete_ptr(PyObject *self, PyObject *args) {
11965   PyObject *resultobj = 0;
11966   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
11967   void *arg2 = (void *) 0 ;
11968   void *argp1 = 0 ;
11969   int res1 = 0 ;
11970   int res2 ;
11971   PyObject *swig_obj[2] ;
11972   void *result = 0 ;
11973 
11974   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_delete_ptr", 2, 2, swig_obj)) SWIG_fail;
11975   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
11976   if (!SWIG_IsOK(res1)) {
11977     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_delete_ptr" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
11978   }
11979   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
11980   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
11981   if (!SWIG_IsOK(res2)) {
11982     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_delete_ptr" "', argument " "2"" of type '" "void *""'");
11983   }
11984   result = (void *)sk_OPENSSL_BLOCK_delete_ptr(arg1,arg2);
11985   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
11986   return resultobj;
11987 fail:
11988   return NULL;
11989 }
11990 
11991 
_wrap_sk_OPENSSL_BLOCK_push(PyObject * self,PyObject * args)11992 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_push(PyObject *self, PyObject *args) {
11993   PyObject *resultobj = 0;
11994   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
11995   void *arg2 = (void *) 0 ;
11996   void *argp1 = 0 ;
11997   int res1 = 0 ;
11998   int res2 ;
11999   PyObject *swig_obj[2] ;
12000   int result;
12001 
12002   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_push", 2, 2, swig_obj)) SWIG_fail;
12003   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12004   if (!SWIG_IsOK(res1)) {
12005     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_push" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12006   }
12007   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12008   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
12009   if (!SWIG_IsOK(res2)) {
12010     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_push" "', argument " "2"" of type '" "void *""'");
12011   }
12012   result = (int)sk_OPENSSL_BLOCK_push(arg1,arg2);
12013   resultobj = SWIG_From_int((int)(result));
12014   return resultobj;
12015 fail:
12016   return NULL;
12017 }
12018 
12019 
_wrap_sk_OPENSSL_BLOCK_unshift(PyObject * self,PyObject * args)12020 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_unshift(PyObject *self, PyObject *args) {
12021   PyObject *resultobj = 0;
12022   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12023   void *arg2 = (void *) 0 ;
12024   void *argp1 = 0 ;
12025   int res1 = 0 ;
12026   int res2 ;
12027   PyObject *swig_obj[2] ;
12028   int result;
12029 
12030   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_unshift", 2, 2, swig_obj)) SWIG_fail;
12031   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12032   if (!SWIG_IsOK(res1)) {
12033     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_unshift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12034   }
12035   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12036   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
12037   if (!SWIG_IsOK(res2)) {
12038     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_unshift" "', argument " "2"" of type '" "void *""'");
12039   }
12040   result = (int)sk_OPENSSL_BLOCK_unshift(arg1,arg2);
12041   resultobj = SWIG_From_int((int)(result));
12042   return resultobj;
12043 fail:
12044   return NULL;
12045 }
12046 
12047 
_wrap_sk_OPENSSL_BLOCK_pop(PyObject * self,PyObject * args)12048 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_pop(PyObject *self, PyObject *args) {
12049   PyObject *resultobj = 0;
12050   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12051   void *argp1 = 0 ;
12052   int res1 = 0 ;
12053   PyObject *swig_obj[1] ;
12054   void *result = 0 ;
12055 
12056   if (!args) SWIG_fail;
12057   swig_obj[0] = args;
12058   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12059   if (!SWIG_IsOK(res1)) {
12060     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_pop" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12061   }
12062   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12063   result = (void *)sk_OPENSSL_BLOCK_pop(arg1);
12064   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
12065   return resultobj;
12066 fail:
12067   return NULL;
12068 }
12069 
12070 
_wrap_sk_OPENSSL_BLOCK_shift(PyObject * self,PyObject * args)12071 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_shift(PyObject *self, PyObject *args) {
12072   PyObject *resultobj = 0;
12073   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12074   void *argp1 = 0 ;
12075   int res1 = 0 ;
12076   PyObject *swig_obj[1] ;
12077   void *result = 0 ;
12078 
12079   if (!args) SWIG_fail;
12080   swig_obj[0] = args;
12081   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12082   if (!SWIG_IsOK(res1)) {
12083     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_shift" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12084   }
12085   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12086   result = (void *)sk_OPENSSL_BLOCK_shift(arg1);
12087   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
12088   return resultobj;
12089 fail:
12090   return NULL;
12091 }
12092 
12093 
_wrap_sk_OPENSSL_BLOCK_pop_free(PyObject * self,PyObject * args)12094 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_pop_free(PyObject *self, PyObject *args) {
12095   PyObject *resultobj = 0;
12096   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12097   sk_OPENSSL_BLOCK_freefunc arg2 = (sk_OPENSSL_BLOCK_freefunc) 0 ;
12098   void *argp1 = 0 ;
12099   int res1 = 0 ;
12100   PyObject *swig_obj[2] ;
12101 
12102   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_pop_free", 2, 2, swig_obj)) SWIG_fail;
12103   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12104   if (!SWIG_IsOK(res1)) {
12105     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_pop_free" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12106   }
12107   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12108   {
12109     int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_void__void);
12110     if (!SWIG_IsOK(res)) {
12111       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_pop_free" "', argument " "2"" of type '" "sk_OPENSSL_BLOCK_freefunc""'");
12112     }
12113   }
12114   sk_OPENSSL_BLOCK_pop_free(arg1,arg2);
12115   resultobj = SWIG_Py_Void();
12116   return resultobj;
12117 fail:
12118   return NULL;
12119 }
12120 
12121 
_wrap_sk_OPENSSL_BLOCK_insert(PyObject * self,PyObject * args)12122 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_insert(PyObject *self, PyObject *args) {
12123   PyObject *resultobj = 0;
12124   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12125   void *arg2 = (void *) 0 ;
12126   int arg3 ;
12127   void *argp1 = 0 ;
12128   int res1 = 0 ;
12129   int res2 ;
12130   int val3 ;
12131   int ecode3 = 0 ;
12132   PyObject *swig_obj[3] ;
12133   int result;
12134 
12135   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_insert", 3, 3, swig_obj)) SWIG_fail;
12136   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12137   if (!SWIG_IsOK(res1)) {
12138     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_insert" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12139   }
12140   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12141   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
12142   if (!SWIG_IsOK(res2)) {
12143     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_insert" "', argument " "2"" of type '" "void *""'");
12144   }
12145   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
12146   if (!SWIG_IsOK(ecode3)) {
12147     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "sk_OPENSSL_BLOCK_insert" "', argument " "3"" of type '" "int""'");
12148   }
12149   arg3 = (int)(val3);
12150   result = (int)sk_OPENSSL_BLOCK_insert(arg1,arg2,arg3);
12151   resultobj = SWIG_From_int((int)(result));
12152   return resultobj;
12153 fail:
12154   return NULL;
12155 }
12156 
12157 
_wrap_sk_OPENSSL_BLOCK_set(PyObject * self,PyObject * args)12158 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_set(PyObject *self, PyObject *args) {
12159   PyObject *resultobj = 0;
12160   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12161   int arg2 ;
12162   void *arg3 = (void *) 0 ;
12163   void *argp1 = 0 ;
12164   int res1 = 0 ;
12165   int val2 ;
12166   int ecode2 = 0 ;
12167   int res3 ;
12168   PyObject *swig_obj[3] ;
12169   void *result = 0 ;
12170 
12171   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_set", 3, 3, swig_obj)) SWIG_fail;
12172   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12173   if (!SWIG_IsOK(res1)) {
12174     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_set" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12175   }
12176   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12177   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
12178   if (!SWIG_IsOK(ecode2)) {
12179     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_OPENSSL_BLOCK_set" "', argument " "2"" of type '" "int""'");
12180   }
12181   arg2 = (int)(val2);
12182   res3 = SWIG_ConvertPtr(swig_obj[2],SWIG_as_voidptrptr(&arg3), 0, 0);
12183   if (!SWIG_IsOK(res3)) {
12184     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "sk_OPENSSL_BLOCK_set" "', argument " "3"" of type '" "void *""'");
12185   }
12186   result = (void *)sk_OPENSSL_BLOCK_set(arg1,arg2,arg3);
12187   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
12188   return resultobj;
12189 fail:
12190   return NULL;
12191 }
12192 
12193 
_wrap_sk_OPENSSL_BLOCK_find(PyObject * self,PyObject * args)12194 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_find(PyObject *self, PyObject *args) {
12195   PyObject *resultobj = 0;
12196   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12197   void *arg2 = (void *) 0 ;
12198   void *argp1 = 0 ;
12199   int res1 = 0 ;
12200   int res2 ;
12201   PyObject *swig_obj[2] ;
12202   int result;
12203 
12204   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_find", 2, 2, swig_obj)) SWIG_fail;
12205   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12206   if (!SWIG_IsOK(res1)) {
12207     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_find" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12208   }
12209   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12210   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
12211   if (!SWIG_IsOK(res2)) {
12212     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_find" "', argument " "2"" of type '" "void *""'");
12213   }
12214   result = (int)sk_OPENSSL_BLOCK_find(arg1,arg2);
12215   resultobj = SWIG_From_int((int)(result));
12216   return resultobj;
12217 fail:
12218   return NULL;
12219 }
12220 
12221 
_wrap_sk_OPENSSL_BLOCK_find_ex(PyObject * self,PyObject * args)12222 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_find_ex(PyObject *self, PyObject *args) {
12223   PyObject *resultobj = 0;
12224   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12225   void *arg2 = (void *) 0 ;
12226   void *argp1 = 0 ;
12227   int res1 = 0 ;
12228   int res2 ;
12229   PyObject *swig_obj[2] ;
12230   int result;
12231 
12232   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_find_ex", 2, 2, swig_obj)) SWIG_fail;
12233   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12234   if (!SWIG_IsOK(res1)) {
12235     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_find_ex" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12236   }
12237   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12238   res2 = SWIG_ConvertPtr(swig_obj[1],SWIG_as_voidptrptr(&arg2), 0, 0);
12239   if (!SWIG_IsOK(res2)) {
12240     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_OPENSSL_BLOCK_find_ex" "', argument " "2"" of type '" "void *""'");
12241   }
12242   result = (int)sk_OPENSSL_BLOCK_find_ex(arg1,arg2);
12243   resultobj = SWIG_From_int((int)(result));
12244   return resultobj;
12245 fail:
12246   return NULL;
12247 }
12248 
12249 
_wrap_sk_OPENSSL_BLOCK_sort(PyObject * self,PyObject * args)12250 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_sort(PyObject *self, PyObject *args) {
12251   PyObject *resultobj = 0;
12252   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12253   void *argp1 = 0 ;
12254   int res1 = 0 ;
12255   PyObject *swig_obj[1] ;
12256 
12257   if (!args) SWIG_fail;
12258   swig_obj[0] = args;
12259   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12260   if (!SWIG_IsOK(res1)) {
12261     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_sort" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12262   }
12263   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12264   sk_OPENSSL_BLOCK_sort(arg1);
12265   resultobj = SWIG_Py_Void();
12266   return resultobj;
12267 fail:
12268   return NULL;
12269 }
12270 
12271 
_wrap_sk_OPENSSL_BLOCK_is_sorted(PyObject * self,PyObject * args)12272 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_is_sorted(PyObject *self, PyObject *args) {
12273   PyObject *resultobj = 0;
12274   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12275   void *argp1 = 0 ;
12276   int res1 = 0 ;
12277   PyObject *swig_obj[1] ;
12278   int result;
12279 
12280   if (!args) SWIG_fail;
12281   swig_obj[0] = args;
12282   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12283   if (!SWIG_IsOK(res1)) {
12284     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_is_sorted" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK const *""'");
12285   }
12286   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12287   result = (int)sk_OPENSSL_BLOCK_is_sorted((struct stack_st_OPENSSL_BLOCK const *)arg1);
12288   resultobj = SWIG_From_int((int)(result));
12289   return resultobj;
12290 fail:
12291   return NULL;
12292 }
12293 
12294 
_wrap_sk_OPENSSL_BLOCK_dup(PyObject * self,PyObject * args)12295 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_dup(PyObject *self, PyObject *args) {
12296   PyObject *resultobj = 0;
12297   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12298   void *argp1 = 0 ;
12299   int res1 = 0 ;
12300   PyObject *swig_obj[1] ;
12301   struct stack_st_OPENSSL_BLOCK *result = 0 ;
12302 
12303   if (!args) SWIG_fail;
12304   swig_obj[0] = args;
12305   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12306   if (!SWIG_IsOK(res1)) {
12307     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_dup" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK const *""'");
12308   }
12309   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12310   result = (struct stack_st_OPENSSL_BLOCK *)sk_OPENSSL_BLOCK_dup((struct stack_st_OPENSSL_BLOCK const *)arg1);
12311   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12312   return resultobj;
12313 fail:
12314   return NULL;
12315 }
12316 
12317 
_wrap_sk_OPENSSL_BLOCK_deep_copy(PyObject * self,PyObject * args)12318 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_deep_copy(PyObject *self, PyObject *args) {
12319   PyObject *resultobj = 0;
12320   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12321   sk_OPENSSL_BLOCK_copyfunc arg2 = (sk_OPENSSL_BLOCK_copyfunc) 0 ;
12322   sk_OPENSSL_BLOCK_freefunc arg3 = (sk_OPENSSL_BLOCK_freefunc) 0 ;
12323   void *argp1 = 0 ;
12324   int res1 = 0 ;
12325   PyObject *swig_obj[3] ;
12326   struct stack_st_OPENSSL_BLOCK *result = 0 ;
12327 
12328   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_deep_copy", 3, 3, swig_obj)) SWIG_fail;
12329   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12330   if (!SWIG_IsOK(res1)) {
12331     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_deep_copy" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK const *""'");
12332   }
12333   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12334   {
12335     int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_p_q_const__void__p_void);
12336     if (!SWIG_IsOK(res)) {
12337       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_deep_copy" "', argument " "2"" of type '" "sk_OPENSSL_BLOCK_copyfunc""'");
12338     }
12339   }
12340   {
12341     int res = SWIG_ConvertFunctionPtr(swig_obj[2], (void**)(&arg3), SWIGTYPE_p_f_p_void__void);
12342     if (!SWIG_IsOK(res)) {
12343       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_deep_copy" "', argument " "3"" of type '" "sk_OPENSSL_BLOCK_freefunc""'");
12344     }
12345   }
12346   result = (struct stack_st_OPENSSL_BLOCK *)sk_OPENSSL_BLOCK_deep_copy((struct stack_st_OPENSSL_BLOCK const *)arg1,arg2,arg3);
12347   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12348   return resultobj;
12349 fail:
12350   return NULL;
12351 }
12352 
12353 
_wrap_sk_OPENSSL_BLOCK_set_cmp_func(PyObject * self,PyObject * args)12354 SWIGINTERN PyObject *_wrap_sk_OPENSSL_BLOCK_set_cmp_func(PyObject *self, PyObject *args) {
12355   PyObject *resultobj = 0;
12356   struct stack_st_OPENSSL_BLOCK *arg1 = (struct stack_st_OPENSSL_BLOCK *) 0 ;
12357   sk_OPENSSL_BLOCK_compfunc arg2 = (sk_OPENSSL_BLOCK_compfunc) 0 ;
12358   void *argp1 = 0 ;
12359   int res1 = 0 ;
12360   PyObject *swig_obj[2] ;
12361   sk_OPENSSL_BLOCK_compfunc result;
12362 
12363   if (!SWIG_Python_UnpackTuple(args, "sk_OPENSSL_BLOCK_set_cmp_func", 2, 2, swig_obj)) SWIG_fail;
12364   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_OPENSSL_BLOCK, 0 |  0 );
12365   if (!SWIG_IsOK(res1)) {
12366     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_OPENSSL_BLOCK_set_cmp_func" "', argument " "1"" of type '" "struct stack_st_OPENSSL_BLOCK *""'");
12367   }
12368   arg1 = (struct stack_st_OPENSSL_BLOCK *)(argp1);
12369   {
12370     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);
12371     if (!SWIG_IsOK(res)) {
12372       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "sk_OPENSSL_BLOCK_set_cmp_func" "', argument " "2"" of type '" "sk_OPENSSL_BLOCK_compfunc""'");
12373     }
12374   }
12375   result = (sk_OPENSSL_BLOCK_compfunc)sk_OPENSSL_BLOCK_set_cmp_func(arg1,arg2);
12376   resultobj = SWIG_NewFunctionPtrObj((void *)(result), SWIGTYPE_p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int);
12377   return resultobj;
12378 fail:
12379   return NULL;
12380 }
12381 
12382 
_wrap_threading_init(PyObject * self,PyObject * args)12383 SWIGINTERN PyObject *_wrap_threading_init(PyObject *self, PyObject *args) {
12384   PyObject *resultobj = 0;
12385 
12386   if (!SWIG_Python_UnpackTuple(args, "threading_init", 0, 0, 0)) SWIG_fail;
12387   threading_init();
12388   resultobj = SWIG_Py_Void();
12389   return resultobj;
12390 fail:
12391   return NULL;
12392 }
12393 
12394 
_wrap_threading_cleanup(PyObject * self,PyObject * args)12395 SWIGINTERN PyObject *_wrap_threading_cleanup(PyObject *self, PyObject *args) {
12396   PyObject *resultobj = 0;
12397 
12398   if (!SWIG_Python_UnpackTuple(args, "threading_cleanup", 0, 0, 0)) SWIG_fail;
12399   threading_cleanup();
12400   resultobj = SWIG_Py_Void();
12401   return resultobj;
12402 fail:
12403   return NULL;
12404 }
12405 
12406 
_wrap_lib_init(PyObject * self,PyObject * args)12407 SWIGINTERN PyObject *_wrap_lib_init(PyObject *self, PyObject *args) {
12408   PyObject *resultobj = 0;
12409 
12410   if (!SWIG_Python_UnpackTuple(args, "lib_init", 0, 0, 0)) SWIG_fail;
12411   lib_init();
12412   resultobj = SWIG_Py_Void();
12413   return resultobj;
12414 fail:
12415   return NULL;
12416 }
12417 
12418 
_wrap_bn_to_mpi(PyObject * self,PyObject * args)12419 SWIGINTERN PyObject *_wrap_bn_to_mpi(PyObject *self, PyObject *args) {
12420   PyObject *resultobj = 0;
12421   BIGNUM *arg1 = (BIGNUM *) 0 ;
12422   void *argp1 = 0 ;
12423   int res1 = 0 ;
12424   PyObject *swig_obj[1] ;
12425   PyObject *result = 0 ;
12426 
12427   if (!args) SWIG_fail;
12428   swig_obj[0] = args;
12429   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIGNUM, 0 |  0 );
12430   if (!SWIG_IsOK(res1)) {
12431     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bn_to_mpi" "', argument " "1"" of type '" "BIGNUM const *""'");
12432   }
12433   arg1 = (BIGNUM *)(argp1);
12434   result = (PyObject *)bn_to_mpi((BIGNUM const *)arg1);
12435   resultobj = result;
12436   return resultobj;
12437 fail:
12438   return NULL;
12439 }
12440 
12441 
_wrap_mpi_to_bn(PyObject * self,PyObject * args)12442 SWIGINTERN PyObject *_wrap_mpi_to_bn(PyObject *self, PyObject *args) {
12443   PyObject *resultobj = 0;
12444   PyObject *arg1 = (PyObject *) 0 ;
12445   PyObject *swig_obj[1] ;
12446   BIGNUM *result = 0 ;
12447 
12448   if (!args) SWIG_fail;
12449   swig_obj[0] = args;
12450   arg1 = swig_obj[0];
12451   result = (BIGNUM *)mpi_to_bn(arg1);
12452   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 |  0 );
12453   return resultobj;
12454 fail:
12455   return NULL;
12456 }
12457 
12458 
_wrap_bn_to_bin(PyObject * self,PyObject * args)12459 SWIGINTERN PyObject *_wrap_bn_to_bin(PyObject *self, PyObject *args) {
12460   PyObject *resultobj = 0;
12461   BIGNUM *arg1 = (BIGNUM *) 0 ;
12462   void *argp1 = 0 ;
12463   int res1 = 0 ;
12464   PyObject *swig_obj[1] ;
12465   PyObject *result = 0 ;
12466 
12467   if (!args) SWIG_fail;
12468   swig_obj[0] = args;
12469   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIGNUM, 0 |  0 );
12470   if (!SWIG_IsOK(res1)) {
12471     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bn_to_bin" "', argument " "1"" of type '" "BIGNUM *""'");
12472   }
12473   arg1 = (BIGNUM *)(argp1);
12474   result = (PyObject *)bn_to_bin(arg1);
12475   resultobj = result;
12476   return resultobj;
12477 fail:
12478   return NULL;
12479 }
12480 
12481 
_wrap_bin_to_bn(PyObject * self,PyObject * args)12482 SWIGINTERN PyObject *_wrap_bin_to_bn(PyObject *self, PyObject *args) {
12483   PyObject *resultobj = 0;
12484   PyObject *arg1 = (PyObject *) 0 ;
12485   PyObject *swig_obj[1] ;
12486   BIGNUM *result = 0 ;
12487 
12488   if (!args) SWIG_fail;
12489   swig_obj[0] = args;
12490   arg1 = swig_obj[0];
12491   result = (BIGNUM *)bin_to_bn(arg1);
12492   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 |  0 );
12493   return resultobj;
12494 fail:
12495   return NULL;
12496 }
12497 
12498 
_wrap_bn_to_hex(PyObject * self,PyObject * args)12499 SWIGINTERN PyObject *_wrap_bn_to_hex(PyObject *self, PyObject *args) {
12500   PyObject *resultobj = 0;
12501   BIGNUM *arg1 = (BIGNUM *) 0 ;
12502   void *argp1 = 0 ;
12503   int res1 = 0 ;
12504   PyObject *swig_obj[1] ;
12505   PyObject *result = 0 ;
12506 
12507   if (!args) SWIG_fail;
12508   swig_obj[0] = args;
12509   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIGNUM, 0 |  0 );
12510   if (!SWIG_IsOK(res1)) {
12511     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bn_to_hex" "', argument " "1"" of type '" "BIGNUM *""'");
12512   }
12513   arg1 = (BIGNUM *)(argp1);
12514   result = (PyObject *)bn_to_hex(arg1);
12515   resultobj = result;
12516   return resultobj;
12517 fail:
12518   return NULL;
12519 }
12520 
12521 
_wrap_hex_to_bn(PyObject * self,PyObject * args)12522 SWIGINTERN PyObject *_wrap_hex_to_bn(PyObject *self, PyObject *args) {
12523   PyObject *resultobj = 0;
12524   PyObject *arg1 = (PyObject *) 0 ;
12525   PyObject *swig_obj[1] ;
12526   BIGNUM *result = 0 ;
12527 
12528   if (!args) SWIG_fail;
12529   swig_obj[0] = args;
12530   arg1 = swig_obj[0];
12531   result = (BIGNUM *)hex_to_bn(arg1);
12532   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 |  0 );
12533   return resultobj;
12534 fail:
12535   return NULL;
12536 }
12537 
12538 
_wrap_dec_to_bn(PyObject * self,PyObject * args)12539 SWIGINTERN PyObject *_wrap_dec_to_bn(PyObject *self, PyObject *args) {
12540   PyObject *resultobj = 0;
12541   PyObject *arg1 = (PyObject *) 0 ;
12542   PyObject *swig_obj[1] ;
12543   BIGNUM *result = 0 ;
12544 
12545   if (!args) SWIG_fail;
12546   swig_obj[0] = args;
12547   arg1 = swig_obj[0];
12548   result = (BIGNUM *)dec_to_bn(arg1);
12549   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 |  0 );
12550   return resultobj;
12551 fail:
12552   return NULL;
12553 }
12554 
12555 
_wrap_err_print_errors(PyObject * self,PyObject * args)12556 SWIGINTERN PyObject *_wrap_err_print_errors(PyObject *self, PyObject *args) {
12557   PyObject *resultobj = 0;
12558   BIO *arg1 = (BIO *) 0 ;
12559   void *argp1 = 0 ;
12560   int res1 = 0 ;
12561   PyObject *swig_obj[1] ;
12562 
12563   if (!args) SWIG_fail;
12564   swig_obj[0] = args;
12565   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
12566   if (!SWIG_IsOK(res1)) {
12567     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "err_print_errors" "', argument " "1"" of type '" "BIO *""'");
12568   }
12569   arg1 = (BIO *)(argp1);
12570   {
12571     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12572     ERR_print_errors(arg1);
12573     SWIG_PYTHON_THREAD_END_ALLOW;
12574   }
12575   resultobj = SWIG_Py_Void();
12576   return resultobj;
12577 fail:
12578   return NULL;
12579 }
12580 
12581 
_wrap_err_get_error(PyObject * self,PyObject * args)12582 SWIGINTERN PyObject *_wrap_err_get_error(PyObject *self, PyObject *args) {
12583   PyObject *resultobj = 0;
12584   unsigned long result;
12585 
12586   if (!SWIG_Python_UnpackTuple(args, "err_get_error", 0, 0, 0)) SWIG_fail;
12587   result = (unsigned long)ERR_get_error();
12588   resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result));
12589   return resultobj;
12590 fail:
12591   return NULL;
12592 }
12593 
12594 
_wrap_err_peek_error(PyObject * self,PyObject * args)12595 SWIGINTERN PyObject *_wrap_err_peek_error(PyObject *self, PyObject *args) {
12596   PyObject *resultobj = 0;
12597   unsigned long result;
12598 
12599   if (!SWIG_Python_UnpackTuple(args, "err_peek_error", 0, 0, 0)) SWIG_fail;
12600   result = (unsigned long)ERR_peek_error();
12601   resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result));
12602   return resultobj;
12603 fail:
12604   return NULL;
12605 }
12606 
12607 
_wrap_err_lib_error_string(PyObject * self,PyObject * args)12608 SWIGINTERN PyObject *_wrap_err_lib_error_string(PyObject *self, PyObject *args) {
12609   PyObject *resultobj = 0;
12610   unsigned long arg1 ;
12611   unsigned long val1 ;
12612   int ecode1 = 0 ;
12613   PyObject *swig_obj[1] ;
12614   char *result = 0 ;
12615 
12616   if (!args) SWIG_fail;
12617   swig_obj[0] = args;
12618   ecode1 = SWIG_AsVal_unsigned_SS_long(swig_obj[0], &val1);
12619   if (!SWIG_IsOK(ecode1)) {
12620     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "err_lib_error_string" "', argument " "1"" of type '" "unsigned long""'");
12621   }
12622   arg1 = (unsigned long)(val1);
12623   result = (char *)ERR_lib_error_string(arg1);
12624   resultobj = SWIG_FromCharPtr((const char *)result);
12625   return resultobj;
12626 fail:
12627   return NULL;
12628 }
12629 
12630 
_wrap_err_func_error_string(PyObject * self,PyObject * args)12631 SWIGINTERN PyObject *_wrap_err_func_error_string(PyObject *self, PyObject *args) {
12632   PyObject *resultobj = 0;
12633   unsigned long arg1 ;
12634   unsigned long val1 ;
12635   int ecode1 = 0 ;
12636   PyObject *swig_obj[1] ;
12637   char *result = 0 ;
12638 
12639   if (!args) SWIG_fail;
12640   swig_obj[0] = args;
12641   ecode1 = SWIG_AsVal_unsigned_SS_long(swig_obj[0], &val1);
12642   if (!SWIG_IsOK(ecode1)) {
12643     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "err_func_error_string" "', argument " "1"" of type '" "unsigned long""'");
12644   }
12645   arg1 = (unsigned long)(val1);
12646   result = (char *)ERR_func_error_string(arg1);
12647   resultobj = SWIG_FromCharPtr((const char *)result);
12648   return resultobj;
12649 fail:
12650   return NULL;
12651 }
12652 
12653 
_wrap_err_reason_error_string(PyObject * self,PyObject * args)12654 SWIGINTERN PyObject *_wrap_err_reason_error_string(PyObject *self, PyObject *args) {
12655   PyObject *resultobj = 0;
12656   unsigned long arg1 ;
12657   unsigned long val1 ;
12658   int ecode1 = 0 ;
12659   PyObject *swig_obj[1] ;
12660   char *result = 0 ;
12661 
12662   if (!args) SWIG_fail;
12663   swig_obj[0] = args;
12664   ecode1 = SWIG_AsVal_unsigned_SS_long(swig_obj[0], &val1);
12665   if (!SWIG_IsOK(ecode1)) {
12666     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "err_reason_error_string" "', argument " "1"" of type '" "unsigned long""'");
12667   }
12668   arg1 = (unsigned long)(val1);
12669   result = (char *)ERR_reason_error_string(arg1);
12670   resultobj = SWIG_FromCharPtr((const char *)result);
12671   return resultobj;
12672 fail:
12673   return NULL;
12674 }
12675 
12676 
_wrap_bio_s_bio(PyObject * self,PyObject * args)12677 SWIGINTERN PyObject *_wrap_bio_s_bio(PyObject *self, PyObject *args) {
12678   PyObject *resultobj = 0;
12679   BIO_METHOD *result = 0 ;
12680 
12681   if (!SWIG_Python_UnpackTuple(args, "bio_s_bio", 0, 0, 0)) SWIG_fail;
12682   result = (BIO_METHOD *)BIO_s_bio();
12683   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 |  0 );
12684   return resultobj;
12685 fail:
12686   return NULL;
12687 }
12688 
12689 
_wrap_bio_s_mem(PyObject * self,PyObject * args)12690 SWIGINTERN PyObject *_wrap_bio_s_mem(PyObject *self, PyObject *args) {
12691   PyObject *resultobj = 0;
12692   BIO_METHOD *result = 0 ;
12693 
12694   if (!SWIG_Python_UnpackTuple(args, "bio_s_mem", 0, 0, 0)) SWIG_fail;
12695   result = (BIO_METHOD *)BIO_s_mem();
12696   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 |  0 );
12697   return resultobj;
12698 fail:
12699   return NULL;
12700 }
12701 
12702 
_wrap_bio_s_socket(PyObject * self,PyObject * args)12703 SWIGINTERN PyObject *_wrap_bio_s_socket(PyObject *self, PyObject *args) {
12704   PyObject *resultobj = 0;
12705   BIO_METHOD *result = 0 ;
12706 
12707   if (!SWIG_Python_UnpackTuple(args, "bio_s_socket", 0, 0, 0)) SWIG_fail;
12708   result = (BIO_METHOD *)BIO_s_socket();
12709   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 |  0 );
12710   return resultobj;
12711 fail:
12712   return NULL;
12713 }
12714 
12715 
_wrap_bio_f_ssl(PyObject * self,PyObject * args)12716 SWIGINTERN PyObject *_wrap_bio_f_ssl(PyObject *self, PyObject *args) {
12717   PyObject *resultobj = 0;
12718   BIO_METHOD *result = 0 ;
12719 
12720   if (!SWIG_Python_UnpackTuple(args, "bio_f_ssl", 0, 0, 0)) SWIG_fail;
12721   result = (BIO_METHOD *)BIO_f_ssl();
12722   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 |  0 );
12723   return resultobj;
12724 fail:
12725   return NULL;
12726 }
12727 
12728 
_wrap_bio_f_buffer(PyObject * self,PyObject * args)12729 SWIGINTERN PyObject *_wrap_bio_f_buffer(PyObject *self, PyObject *args) {
12730   PyObject *resultobj = 0;
12731   BIO_METHOD *result = 0 ;
12732 
12733   if (!SWIG_Python_UnpackTuple(args, "bio_f_buffer", 0, 0, 0)) SWIG_fail;
12734   result = (BIO_METHOD *)BIO_f_buffer();
12735   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 |  0 );
12736   return resultobj;
12737 fail:
12738   return NULL;
12739 }
12740 
12741 
_wrap_bio_f_cipher(PyObject * self,PyObject * args)12742 SWIGINTERN PyObject *_wrap_bio_f_cipher(PyObject *self, PyObject *args) {
12743   PyObject *resultobj = 0;
12744   BIO_METHOD *result = 0 ;
12745 
12746   if (!SWIG_Python_UnpackTuple(args, "bio_f_cipher", 0, 0, 0)) SWIG_fail;
12747   result = (BIO_METHOD *)BIO_f_cipher();
12748   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO_METHOD, 0 |  0 );
12749   return resultobj;
12750 fail:
12751   return NULL;
12752 }
12753 
12754 
_wrap_bio_new(PyObject * self,PyObject * args)12755 SWIGINTERN PyObject *_wrap_bio_new(PyObject *self, PyObject *args) {
12756   PyObject *resultobj = 0;
12757   BIO_METHOD *arg1 = (BIO_METHOD *) 0 ;
12758   void *argp1 = 0 ;
12759   int res1 = 0 ;
12760   PyObject *swig_obj[1] ;
12761   BIO *result = 0 ;
12762 
12763   if (!args) SWIG_fail;
12764   swig_obj[0] = args;
12765   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO_METHOD, 0 |  0 );
12766   if (!SWIG_IsOK(res1)) {
12767     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_new" "', argument " "1"" of type '" "BIO_METHOD *""'");
12768   }
12769   arg1 = (BIO_METHOD *)(argp1);
12770   {
12771     if (!arg1) {
12772       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12773     }
12774   }
12775   result = (BIO *)BIO_new(arg1);
12776   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 |  0 );
12777   return resultobj;
12778 fail:
12779   return NULL;
12780 }
12781 
12782 
_wrap_bio_new_socket(PyObject * self,PyObject * args)12783 SWIGINTERN PyObject *_wrap_bio_new_socket(PyObject *self, PyObject *args) {
12784   PyObject *resultobj = 0;
12785   int arg1 ;
12786   int arg2 ;
12787   int val1 ;
12788   int ecode1 = 0 ;
12789   int val2 ;
12790   int ecode2 = 0 ;
12791   PyObject *swig_obj[2] ;
12792   BIO *result = 0 ;
12793 
12794   if (!SWIG_Python_UnpackTuple(args, "bio_new_socket", 2, 2, swig_obj)) SWIG_fail;
12795   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
12796   if (!SWIG_IsOK(ecode1)) {
12797     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bio_new_socket" "', argument " "1"" of type '" "int""'");
12798   }
12799   arg1 = (int)(val1);
12800   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
12801   if (!SWIG_IsOK(ecode2)) {
12802     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_socket" "', argument " "2"" of type '" "int""'");
12803   }
12804   arg2 = (int)(val2);
12805   result = (BIO *)BIO_new_socket(arg1,arg2);
12806   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 |  0 );
12807   return resultobj;
12808 fail:
12809   return NULL;
12810 }
12811 
12812 
_wrap_bio_free_all(PyObject * self,PyObject * args)12813 SWIGINTERN PyObject *_wrap_bio_free_all(PyObject *self, PyObject *args) {
12814   PyObject *resultobj = 0;
12815   BIO *arg1 = (BIO *) 0 ;
12816   void *argp1 = 0 ;
12817   int res1 = 0 ;
12818   PyObject *swig_obj[1] ;
12819 
12820   if (!args) SWIG_fail;
12821   swig_obj[0] = args;
12822   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
12823   if (!SWIG_IsOK(res1)) {
12824     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_free_all" "', argument " "1"" of type '" "BIO *""'");
12825   }
12826   arg1 = (BIO *)(argp1);
12827   {
12828     if (!arg1) {
12829       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12830     }
12831   }
12832   {
12833     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
12834     BIO_free_all(arg1);
12835     SWIG_PYTHON_THREAD_END_ALLOW;
12836   }
12837   resultobj = SWIG_Py_Void();
12838   return resultobj;
12839 fail:
12840   return NULL;
12841 }
12842 
12843 
_wrap_bio_dup_chain(PyObject * self,PyObject * args)12844 SWIGINTERN PyObject *_wrap_bio_dup_chain(PyObject *self, PyObject *args) {
12845   PyObject *resultobj = 0;
12846   BIO *arg1 = (BIO *) 0 ;
12847   void *argp1 = 0 ;
12848   int res1 = 0 ;
12849   PyObject *swig_obj[1] ;
12850   BIO *result = 0 ;
12851 
12852   if (!args) SWIG_fail;
12853   swig_obj[0] = args;
12854   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
12855   if (!SWIG_IsOK(res1)) {
12856     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_dup_chain" "', argument " "1"" of type '" "BIO *""'");
12857   }
12858   arg1 = (BIO *)(argp1);
12859   {
12860     if (!arg1) {
12861       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12862     }
12863   }
12864   result = (BIO *)BIO_dup_chain(arg1);
12865   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 |  0 );
12866   return resultobj;
12867 fail:
12868   return NULL;
12869 }
12870 
12871 
_wrap_bio_push(PyObject * self,PyObject * args)12872 SWIGINTERN PyObject *_wrap_bio_push(PyObject *self, PyObject *args) {
12873   PyObject *resultobj = 0;
12874   BIO *arg1 = (BIO *) 0 ;
12875   BIO *arg2 = (BIO *) 0 ;
12876   void *argp1 = 0 ;
12877   int res1 = 0 ;
12878   void *argp2 = 0 ;
12879   int res2 = 0 ;
12880   PyObject *swig_obj[2] ;
12881   BIO *result = 0 ;
12882 
12883   if (!SWIG_Python_UnpackTuple(args, "bio_push", 2, 2, swig_obj)) SWIG_fail;
12884   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
12885   if (!SWIG_IsOK(res1)) {
12886     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_push" "', argument " "1"" of type '" "BIO *""'");
12887   }
12888   arg1 = (BIO *)(argp1);
12889   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
12890   if (!SWIG_IsOK(res2)) {
12891     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_push" "', argument " "2"" of type '" "BIO *""'");
12892   }
12893   arg2 = (BIO *)(argp2);
12894   {
12895     if (!arg1) {
12896       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12897     }
12898   }
12899   {
12900     if (!arg2) {
12901       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12902     }
12903   }
12904   result = (BIO *)BIO_push(arg1,arg2);
12905   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 |  0 );
12906   return resultobj;
12907 fail:
12908   return NULL;
12909 }
12910 
12911 
_wrap_bio_pop(PyObject * self,PyObject * args)12912 SWIGINTERN PyObject *_wrap_bio_pop(PyObject *self, PyObject *args) {
12913   PyObject *resultobj = 0;
12914   BIO *arg1 = (BIO *) 0 ;
12915   void *argp1 = 0 ;
12916   int res1 = 0 ;
12917   PyObject *swig_obj[1] ;
12918   BIO *result = 0 ;
12919 
12920   if (!args) SWIG_fail;
12921   swig_obj[0] = args;
12922   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
12923   if (!SWIG_IsOK(res1)) {
12924     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_pop" "', argument " "1"" of type '" "BIO *""'");
12925   }
12926   arg1 = (BIO *)(argp1);
12927   {
12928     if (!arg1) {
12929       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12930     }
12931   }
12932   result = (BIO *)BIO_pop(arg1);
12933   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 |  0 );
12934   return resultobj;
12935 fail:
12936   return NULL;
12937 }
12938 
12939 
_wrap_bio_eof(PyObject * self,PyObject * args)12940 SWIGINTERN PyObject *_wrap_bio_eof(PyObject *self, PyObject *args) {
12941   PyObject *resultobj = 0;
12942   BIO *arg1 = (BIO *) 0 ;
12943   void *argp1 = 0 ;
12944   int res1 = 0 ;
12945   PyObject *swig_obj[1] ;
12946   int result;
12947 
12948   if (!args) SWIG_fail;
12949   swig_obj[0] = args;
12950   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
12951   if (!SWIG_IsOK(res1)) {
12952     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_eof" "', argument " "1"" of type '" "BIO *""'");
12953   }
12954   arg1 = (BIO *)(argp1);
12955   {
12956     if (!arg1) {
12957       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
12958     }
12959   }
12960   result = (int)BIO_eof(arg1);
12961   {
12962     resultobj=PyLong_FromLong(result);
12963     if (PyErr_Occurred()) SWIG_fail;
12964   }
12965   return resultobj;
12966 fail:
12967   return NULL;
12968 }
12969 
12970 
Swig_var__bio_err_set(PyObject * _val)12971 SWIGINTERN int Swig_var__bio_err_set(PyObject *_val) {
12972   {
12973     void *argp = 0;
12974     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
12975     if (!SWIG_IsOK(res)) {
12976       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_bio_err""' of type '""PyObject *""'");
12977     }
12978     _bio_err = (PyObject *)(argp);
12979   }
12980   return 0;
12981 fail:
12982   return 1;
12983 }
12984 
12985 
Swig_var__bio_err_get(void)12986 SWIGINTERN PyObject *Swig_var__bio_err_get(void) {
12987   PyObject *pyobj = 0;
12988   PyObject *self = 0;
12989 
12990   (void)self;
12991   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_bio_err), SWIGTYPE_p_PyObject,  0 );
12992   return pyobj;
12993 }
12994 
12995 
_wrap_pyfd_init(PyObject * self,PyObject * args)12996 SWIGINTERN PyObject *_wrap_pyfd_init(PyObject *self, PyObject *args) {
12997   PyObject *resultobj = 0;
12998 
12999   if (!SWIG_Python_UnpackTuple(args, "pyfd_init", 0, 0, 0)) SWIG_fail;
13000   pyfd_init();
13001   resultobj = SWIG_Py_Void();
13002   return resultobj;
13003 fail:
13004   return NULL;
13005 }
13006 
13007 
_wrap_bio_init(PyObject * self,PyObject * args)13008 SWIGINTERN PyObject *_wrap_bio_init(PyObject *self, PyObject *args) {
13009   PyObject *resultobj = 0;
13010   PyObject *arg1 = (PyObject *) 0 ;
13011   PyObject *swig_obj[1] ;
13012 
13013   if (!args) SWIG_fail;
13014   swig_obj[0] = args;
13015   {
13016     arg1=swig_obj[0];
13017   }
13018   bio_init(arg1);
13019   resultobj = SWIG_Py_Void();
13020   return resultobj;
13021 fail:
13022   return NULL;
13023 }
13024 
13025 
_wrap_bio_free(PyObject * self,PyObject * args)13026 SWIGINTERN PyObject *_wrap_bio_free(PyObject *self, PyObject *args) {
13027   PyObject *resultobj = 0;
13028   BIO *arg1 = (BIO *) 0 ;
13029   void *argp1 = 0 ;
13030   int res1 = 0 ;
13031   PyObject *swig_obj[1] ;
13032   int result;
13033 
13034   if (!args) SWIG_fail;
13035   swig_obj[0] = args;
13036   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13037   if (!SWIG_IsOK(res1)) {
13038     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_free" "', argument " "1"" of type '" "BIO *""'");
13039   }
13040   arg1 = (BIO *)(argp1);
13041   {
13042     if (!arg1) {
13043       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13044     }
13045   }
13046   result = (int)bio_free(arg1);
13047   {
13048     resultobj=PyLong_FromLong(result);
13049     if (PyErr_Occurred()) SWIG_fail;
13050   }
13051   return resultobj;
13052 fail:
13053   return NULL;
13054 }
13055 
13056 
_wrap_bio_new_file(PyObject * self,PyObject * args)13057 SWIGINTERN PyObject *_wrap_bio_new_file(PyObject *self, PyObject *args) {
13058   PyObject *resultobj = 0;
13059   char *arg1 = (char *) 0 ;
13060   char *arg2 = (char *) 0 ;
13061   int res1 ;
13062   char *buf1 = 0 ;
13063   int alloc1 = 0 ;
13064   int res2 ;
13065   char *buf2 = 0 ;
13066   int alloc2 = 0 ;
13067   PyObject *swig_obj[2] ;
13068   BIO *result = 0 ;
13069 
13070   if (!SWIG_Python_UnpackTuple(args, "bio_new_file", 2, 2, swig_obj)) SWIG_fail;
13071   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
13072   if (!SWIG_IsOK(res1)) {
13073     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_new_file" "', argument " "1"" of type '" "char const *""'");
13074   }
13075   arg1 = (char *)(buf1);
13076   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
13077   if (!SWIG_IsOK(res2)) {
13078     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_new_file" "', argument " "2"" of type '" "char const *""'");
13079   }
13080   arg2 = (char *)(buf2);
13081   result = (BIO *)bio_new_file((char const *)arg1,(char const *)arg2);
13082   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 |  0 );
13083   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
13084   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
13085   return resultobj;
13086 fail:
13087   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
13088   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
13089   return NULL;
13090 }
13091 
13092 
_wrap_bio_new_pyfile(PyObject * self,PyObject * args)13093 SWIGINTERN PyObject *_wrap_bio_new_pyfile(PyObject *self, PyObject *args) {
13094   PyObject *resultobj = 0;
13095   PyObject *arg1 = (PyObject *) 0 ;
13096   int arg2 ;
13097   int val2 ;
13098   int ecode2 = 0 ;
13099   PyObject *swig_obj[2] ;
13100   BIO *result = 0 ;
13101 
13102   if (!SWIG_Python_UnpackTuple(args, "bio_new_pyfile", 2, 2, swig_obj)) SWIG_fail;
13103   {
13104     arg1=swig_obj[0];
13105   }
13106   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
13107   if (!SWIG_IsOK(ecode2)) {
13108     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_pyfile" "', argument " "2"" of type '" "int""'");
13109   }
13110   arg2 = (int)(val2);
13111   result = (BIO *)bio_new_pyfile(arg1,arg2);
13112   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 |  0 );
13113   return resultobj;
13114 fail:
13115   return NULL;
13116 }
13117 
13118 
_wrap_bio_read(PyObject * self,PyObject * args)13119 SWIGINTERN PyObject *_wrap_bio_read(PyObject *self, PyObject *args) {
13120   PyObject *resultobj = 0;
13121   BIO *arg1 = (BIO *) 0 ;
13122   int arg2 ;
13123   void *argp1 = 0 ;
13124   int res1 = 0 ;
13125   int val2 ;
13126   int ecode2 = 0 ;
13127   PyObject *swig_obj[2] ;
13128   PyObject *result = 0 ;
13129 
13130   if (!SWIG_Python_UnpackTuple(args, "bio_read", 2, 2, swig_obj)) SWIG_fail;
13131   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13132   if (!SWIG_IsOK(res1)) {
13133     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_read" "', argument " "1"" of type '" "BIO *""'");
13134   }
13135   arg1 = (BIO *)(argp1);
13136   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
13137   if (!SWIG_IsOK(ecode2)) {
13138     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_read" "', argument " "2"" of type '" "int""'");
13139   }
13140   arg2 = (int)(val2);
13141   {
13142     if (!arg1) {
13143       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13144     }
13145   }
13146   result = (PyObject *)bio_read(arg1,arg2);
13147   {
13148     resultobj=result;
13149   }
13150   return resultobj;
13151 fail:
13152   return NULL;
13153 }
13154 
13155 
_wrap_bio_gets(PyObject * self,PyObject * args)13156 SWIGINTERN PyObject *_wrap_bio_gets(PyObject *self, PyObject *args) {
13157   PyObject *resultobj = 0;
13158   BIO *arg1 = (BIO *) 0 ;
13159   int arg2 ;
13160   void *argp1 = 0 ;
13161   int res1 = 0 ;
13162   int val2 ;
13163   int ecode2 = 0 ;
13164   PyObject *swig_obj[2] ;
13165   PyObject *result = 0 ;
13166 
13167   if (!SWIG_Python_UnpackTuple(args, "bio_gets", 2, 2, swig_obj)) SWIG_fail;
13168   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13169   if (!SWIG_IsOK(res1)) {
13170     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_gets" "', argument " "1"" of type '" "BIO *""'");
13171   }
13172   arg1 = (BIO *)(argp1);
13173   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
13174   if (!SWIG_IsOK(ecode2)) {
13175     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_gets" "', argument " "2"" of type '" "int""'");
13176   }
13177   arg2 = (int)(val2);
13178   {
13179     if (!arg1) {
13180       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13181     }
13182   }
13183   result = (PyObject *)bio_gets(arg1,arg2);
13184   {
13185     resultobj=result;
13186   }
13187   return resultobj;
13188 fail:
13189   return NULL;
13190 }
13191 
13192 
_wrap_bio_write(PyObject * self,PyObject * args)13193 SWIGINTERN PyObject *_wrap_bio_write(PyObject *self, PyObject *args) {
13194   PyObject *resultobj = 0;
13195   BIO *arg1 = (BIO *) 0 ;
13196   PyObject *arg2 = (PyObject *) 0 ;
13197   void *argp1 = 0 ;
13198   int res1 = 0 ;
13199   PyObject *swig_obj[2] ;
13200   int result;
13201 
13202   if (!SWIG_Python_UnpackTuple(args, "bio_write", 2, 2, swig_obj)) SWIG_fail;
13203   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13204   if (!SWIG_IsOK(res1)) {
13205     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_write" "', argument " "1"" of type '" "BIO *""'");
13206   }
13207   arg1 = (BIO *)(argp1);
13208   {
13209     arg2=swig_obj[1];
13210   }
13211   {
13212     if (!arg1) {
13213       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13214     }
13215   }
13216   result = (int)bio_write(arg1,arg2);
13217   {
13218     resultobj=PyLong_FromLong(result);
13219     if (PyErr_Occurred()) SWIG_fail;
13220   }
13221   return resultobj;
13222 fail:
13223   return NULL;
13224 }
13225 
13226 
_wrap_bio_ctrl_pending(PyObject * self,PyObject * args)13227 SWIGINTERN PyObject *_wrap_bio_ctrl_pending(PyObject *self, PyObject *args) {
13228   PyObject *resultobj = 0;
13229   BIO *arg1 = (BIO *) 0 ;
13230   void *argp1 = 0 ;
13231   int res1 = 0 ;
13232   PyObject *swig_obj[1] ;
13233   int result;
13234 
13235   if (!args) SWIG_fail;
13236   swig_obj[0] = args;
13237   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13238   if (!SWIG_IsOK(res1)) {
13239     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_ctrl_pending" "', argument " "1"" of type '" "BIO *""'");
13240   }
13241   arg1 = (BIO *)(argp1);
13242   {
13243     if (!arg1) {
13244       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13245     }
13246   }
13247   result = (int)bio_ctrl_pending(arg1);
13248   {
13249     resultobj=PyLong_FromLong(result);
13250     if (PyErr_Occurred()) SWIG_fail;
13251   }
13252   return resultobj;
13253 fail:
13254   return NULL;
13255 }
13256 
13257 
_wrap_bio_ctrl_wpending(PyObject * self,PyObject * args)13258 SWIGINTERN PyObject *_wrap_bio_ctrl_wpending(PyObject *self, PyObject *args) {
13259   PyObject *resultobj = 0;
13260   BIO *arg1 = (BIO *) 0 ;
13261   void *argp1 = 0 ;
13262   int res1 = 0 ;
13263   PyObject *swig_obj[1] ;
13264   int result;
13265 
13266   if (!args) SWIG_fail;
13267   swig_obj[0] = args;
13268   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13269   if (!SWIG_IsOK(res1)) {
13270     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_ctrl_wpending" "', argument " "1"" of type '" "BIO *""'");
13271   }
13272   arg1 = (BIO *)(argp1);
13273   {
13274     if (!arg1) {
13275       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13276     }
13277   }
13278   result = (int)bio_ctrl_wpending(arg1);
13279   {
13280     resultobj=PyLong_FromLong(result);
13281     if (PyErr_Occurred()) SWIG_fail;
13282   }
13283   return resultobj;
13284 fail:
13285   return NULL;
13286 }
13287 
13288 
_wrap_bio_ctrl_get_write_guarantee(PyObject * self,PyObject * args)13289 SWIGINTERN PyObject *_wrap_bio_ctrl_get_write_guarantee(PyObject *self, PyObject *args) {
13290   PyObject *resultobj = 0;
13291   BIO *arg1 = (BIO *) 0 ;
13292   void *argp1 = 0 ;
13293   int res1 = 0 ;
13294   PyObject *swig_obj[1] ;
13295   int result;
13296 
13297   if (!args) SWIG_fail;
13298   swig_obj[0] = args;
13299   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13300   if (!SWIG_IsOK(res1)) {
13301     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_ctrl_get_write_guarantee" "', argument " "1"" of type '" "BIO *""'");
13302   }
13303   arg1 = (BIO *)(argp1);
13304   {
13305     if (!arg1) {
13306       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13307     }
13308   }
13309   result = (int)bio_ctrl_get_write_guarantee(arg1);
13310   {
13311     resultobj=PyLong_FromLong(result);
13312     if (PyErr_Occurred()) SWIG_fail;
13313   }
13314   return resultobj;
13315 fail:
13316   return NULL;
13317 }
13318 
13319 
_wrap_bio_reset(PyObject * self,PyObject * args)13320 SWIGINTERN PyObject *_wrap_bio_reset(PyObject *self, PyObject *args) {
13321   PyObject *resultobj = 0;
13322   BIO *arg1 = (BIO *) 0 ;
13323   void *argp1 = 0 ;
13324   int res1 = 0 ;
13325   PyObject *swig_obj[1] ;
13326   int result;
13327 
13328   if (!args) SWIG_fail;
13329   swig_obj[0] = args;
13330   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13331   if (!SWIG_IsOK(res1)) {
13332     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_reset" "', argument " "1"" of type '" "BIO *""'");
13333   }
13334   arg1 = (BIO *)(argp1);
13335   {
13336     if (!arg1) {
13337       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13338     }
13339   }
13340   result = (int)bio_reset(arg1);
13341   {
13342     resultobj=PyLong_FromLong(result);
13343     if (PyErr_Occurred()) SWIG_fail;
13344   }
13345   return resultobj;
13346 fail:
13347   return NULL;
13348 }
13349 
13350 
_wrap_bio_flush(PyObject * self,PyObject * args)13351 SWIGINTERN PyObject *_wrap_bio_flush(PyObject *self, PyObject *args) {
13352   PyObject *resultobj = 0;
13353   BIO *arg1 = (BIO *) 0 ;
13354   void *argp1 = 0 ;
13355   int res1 = 0 ;
13356   PyObject *swig_obj[1] ;
13357   int result;
13358 
13359   if (!args) SWIG_fail;
13360   swig_obj[0] = args;
13361   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13362   if (!SWIG_IsOK(res1)) {
13363     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_flush" "', argument " "1"" of type '" "BIO *""'");
13364   }
13365   arg1 = (BIO *)(argp1);
13366   {
13367     if (!arg1) {
13368       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13369     }
13370   }
13371   {
13372     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13373     result = (int)bio_flush(arg1);
13374     SWIG_PYTHON_THREAD_END_ALLOW;
13375   }
13376   {
13377     resultobj=PyLong_FromLong(result);
13378     if (PyErr_Occurred()) SWIG_fail;
13379   }
13380   return resultobj;
13381 fail:
13382   return NULL;
13383 }
13384 
13385 
_wrap_bio_seek(PyObject * self,PyObject * args)13386 SWIGINTERN PyObject *_wrap_bio_seek(PyObject *self, PyObject *args) {
13387   PyObject *resultobj = 0;
13388   BIO *arg1 = (BIO *) 0 ;
13389   int arg2 ;
13390   void *argp1 = 0 ;
13391   int res1 = 0 ;
13392   int val2 ;
13393   int ecode2 = 0 ;
13394   PyObject *swig_obj[2] ;
13395   int result;
13396 
13397   if (!SWIG_Python_UnpackTuple(args, "bio_seek", 2, 2, swig_obj)) SWIG_fail;
13398   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13399   if (!SWIG_IsOK(res1)) {
13400     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_seek" "', argument " "1"" of type '" "BIO *""'");
13401   }
13402   arg1 = (BIO *)(argp1);
13403   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
13404   if (!SWIG_IsOK(ecode2)) {
13405     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_seek" "', argument " "2"" of type '" "int""'");
13406   }
13407   arg2 = (int)(val2);
13408   {
13409     if (!arg1) {
13410       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13411     }
13412   }
13413   result = (int)bio_seek(arg1,arg2);
13414   {
13415     resultobj=PyLong_FromLong(result);
13416     if (PyErr_Occurred()) SWIG_fail;
13417   }
13418   return resultobj;
13419 fail:
13420   return NULL;
13421 }
13422 
13423 
_wrap_bio_tell(PyObject * self,PyObject * args)13424 SWIGINTERN PyObject *_wrap_bio_tell(PyObject *self, PyObject *args) {
13425   PyObject *resultobj = 0;
13426   BIO *arg1 = (BIO *) 0 ;
13427   void *argp1 = 0 ;
13428   int res1 = 0 ;
13429   PyObject *swig_obj[1] ;
13430   int result;
13431 
13432   if (!args) SWIG_fail;
13433   swig_obj[0] = args;
13434   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13435   if (!SWIG_IsOK(res1)) {
13436     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_tell" "', argument " "1"" of type '" "BIO *""'");
13437   }
13438   arg1 = (BIO *)(argp1);
13439   {
13440     if (!arg1) {
13441       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13442     }
13443   }
13444   result = (int)bio_tell(arg1);
13445   {
13446     resultobj=PyLong_FromLong(result);
13447     if (PyErr_Occurred()) SWIG_fail;
13448   }
13449   return resultobj;
13450 fail:
13451   return NULL;
13452 }
13453 
13454 
_wrap_bio_set_flags(PyObject * self,PyObject * args)13455 SWIGINTERN PyObject *_wrap_bio_set_flags(PyObject *self, PyObject *args) {
13456   PyObject *resultobj = 0;
13457   BIO *arg1 = (BIO *) 0 ;
13458   int arg2 ;
13459   void *argp1 = 0 ;
13460   int res1 = 0 ;
13461   int val2 ;
13462   int ecode2 = 0 ;
13463   PyObject *swig_obj[2] ;
13464 
13465   if (!SWIG_Python_UnpackTuple(args, "bio_set_flags", 2, 2, swig_obj)) SWIG_fail;
13466   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13467   if (!SWIG_IsOK(res1)) {
13468     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_flags" "', argument " "1"" of type '" "BIO *""'");
13469   }
13470   arg1 = (BIO *)(argp1);
13471   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
13472   if (!SWIG_IsOK(ecode2)) {
13473     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_set_flags" "', argument " "2"" of type '" "int""'");
13474   }
13475   arg2 = (int)(val2);
13476   {
13477     if (!arg1) {
13478       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13479     }
13480   }
13481   bio_set_flags(arg1,arg2);
13482   resultobj = SWIG_Py_Void();
13483   return resultobj;
13484 fail:
13485   return NULL;
13486 }
13487 
13488 
_wrap_bio_get_flags(PyObject * self,PyObject * args)13489 SWIGINTERN PyObject *_wrap_bio_get_flags(PyObject *self, PyObject *args) {
13490   PyObject *resultobj = 0;
13491   BIO *arg1 = (BIO *) 0 ;
13492   void *argp1 = 0 ;
13493   int res1 = 0 ;
13494   PyObject *swig_obj[1] ;
13495   int result;
13496 
13497   if (!args) SWIG_fail;
13498   swig_obj[0] = args;
13499   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13500   if (!SWIG_IsOK(res1)) {
13501     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_get_flags" "', argument " "1"" of type '" "BIO *""'");
13502   }
13503   arg1 = (BIO *)(argp1);
13504   {
13505     if (!arg1) {
13506       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13507     }
13508   }
13509   result = (int)bio_get_flags(arg1);
13510   {
13511     resultobj=PyLong_FromLong(result);
13512     if (PyErr_Occurred()) SWIG_fail;
13513   }
13514   return resultobj;
13515 fail:
13516   return NULL;
13517 }
13518 
13519 
_wrap_bio_set_cipher(PyObject * self,PyObject * args)13520 SWIGINTERN PyObject *_wrap_bio_set_cipher(PyObject *self, PyObject *args) {
13521   PyObject *resultobj = 0;
13522   BIO *arg1 = (BIO *) 0 ;
13523   EVP_CIPHER *arg2 = (EVP_CIPHER *) 0 ;
13524   PyObject *arg3 = (PyObject *) 0 ;
13525   PyObject *arg4 = (PyObject *) 0 ;
13526   int arg5 ;
13527   void *argp1 = 0 ;
13528   int res1 = 0 ;
13529   void *argp2 = 0 ;
13530   int res2 = 0 ;
13531   int val5 ;
13532   int ecode5 = 0 ;
13533   PyObject *swig_obj[5] ;
13534   PyObject *result = 0 ;
13535 
13536   if (!SWIG_Python_UnpackTuple(args, "bio_set_cipher", 5, 5, swig_obj)) SWIG_fail;
13537   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13538   if (!SWIG_IsOK(res1)) {
13539     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_cipher" "', argument " "1"" of type '" "BIO *""'");
13540   }
13541   arg1 = (BIO *)(argp1);
13542   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
13543   if (!SWIG_IsOK(res2)) {
13544     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_set_cipher" "', argument " "2"" of type '" "EVP_CIPHER *""'");
13545   }
13546   arg2 = (EVP_CIPHER *)(argp2);
13547   {
13548     arg3=swig_obj[2];
13549   }
13550   {
13551     arg4=swig_obj[3];
13552   }
13553   ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
13554   if (!SWIG_IsOK(ecode5)) {
13555     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "bio_set_cipher" "', argument " "5"" of type '" "int""'");
13556   }
13557   arg5 = (int)(val5);
13558   {
13559     if (!arg1) {
13560       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13561     }
13562   }
13563   result = (PyObject *)bio_set_cipher(arg1,arg2,arg3,arg4,arg5);
13564   {
13565     resultobj=result;
13566   }
13567   return resultobj;
13568 fail:
13569   return NULL;
13570 }
13571 
13572 
_wrap_bio_set_mem_eof_return(PyObject * self,PyObject * args)13573 SWIGINTERN PyObject *_wrap_bio_set_mem_eof_return(PyObject *self, PyObject *args) {
13574   PyObject *resultobj = 0;
13575   BIO *arg1 = (BIO *) 0 ;
13576   int arg2 ;
13577   void *argp1 = 0 ;
13578   int res1 = 0 ;
13579   int val2 ;
13580   int ecode2 = 0 ;
13581   PyObject *swig_obj[2] ;
13582   int result;
13583 
13584   if (!SWIG_Python_UnpackTuple(args, "bio_set_mem_eof_return", 2, 2, swig_obj)) SWIG_fail;
13585   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13586   if (!SWIG_IsOK(res1)) {
13587     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_mem_eof_return" "', argument " "1"" of type '" "BIO *""'");
13588   }
13589   arg1 = (BIO *)(argp1);
13590   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
13591   if (!SWIG_IsOK(ecode2)) {
13592     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_set_mem_eof_return" "', argument " "2"" of type '" "int""'");
13593   }
13594   arg2 = (int)(val2);
13595   {
13596     if (!arg1) {
13597       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13598     }
13599   }
13600   result = (int)bio_set_mem_eof_return(arg1,arg2);
13601   {
13602     resultobj=PyLong_FromLong(result);
13603     if (PyErr_Occurred()) SWIG_fail;
13604   }
13605   return resultobj;
13606 fail:
13607   return NULL;
13608 }
13609 
13610 
_wrap_bio_get_fd(PyObject * self,PyObject * args)13611 SWIGINTERN PyObject *_wrap_bio_get_fd(PyObject *self, PyObject *args) {
13612   PyObject *resultobj = 0;
13613   BIO *arg1 = (BIO *) 0 ;
13614   void *argp1 = 0 ;
13615   int res1 = 0 ;
13616   PyObject *swig_obj[1] ;
13617   int result;
13618 
13619   if (!args) SWIG_fail;
13620   swig_obj[0] = args;
13621   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13622   if (!SWIG_IsOK(res1)) {
13623     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_get_fd" "', argument " "1"" of type '" "BIO *""'");
13624   }
13625   arg1 = (BIO *)(argp1);
13626   {
13627     if (!arg1) {
13628       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13629     }
13630   }
13631   result = (int)bio_get_fd(arg1);
13632   {
13633     resultobj=PyLong_FromLong(result);
13634     if (PyErr_Occurred()) SWIG_fail;
13635   }
13636   return resultobj;
13637 fail:
13638   return NULL;
13639 }
13640 
13641 
_wrap_bio_do_handshake(PyObject * self,PyObject * args)13642 SWIGINTERN PyObject *_wrap_bio_do_handshake(PyObject *self, PyObject *args) {
13643   PyObject *resultobj = 0;
13644   BIO *arg1 = (BIO *) 0 ;
13645   void *argp1 = 0 ;
13646   int res1 = 0 ;
13647   PyObject *swig_obj[1] ;
13648   int result;
13649 
13650   if (!args) SWIG_fail;
13651   swig_obj[0] = args;
13652   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13653   if (!SWIG_IsOK(res1)) {
13654     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_do_handshake" "', argument " "1"" of type '" "BIO *""'");
13655   }
13656   arg1 = (BIO *)(argp1);
13657   {
13658     if (!arg1) {
13659       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13660     }
13661   }
13662   {
13663     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
13664     result = (int)bio_do_handshake(arg1);
13665     SWIG_PYTHON_THREAD_END_ALLOW;
13666   }
13667   {
13668     resultobj=PyLong_FromLong(result);
13669     if (PyErr_Occurred()) SWIG_fail;
13670   }
13671   return resultobj;
13672 fail:
13673   return NULL;
13674 }
13675 
13676 
_wrap_bio_make_bio_pair(PyObject * self,PyObject * args)13677 SWIGINTERN PyObject *_wrap_bio_make_bio_pair(PyObject *self, PyObject *args) {
13678   PyObject *resultobj = 0;
13679   BIO *arg1 = (BIO *) 0 ;
13680   BIO *arg2 = (BIO *) 0 ;
13681   void *argp1 = 0 ;
13682   int res1 = 0 ;
13683   void *argp2 = 0 ;
13684   int res2 = 0 ;
13685   PyObject *swig_obj[2] ;
13686   int result;
13687 
13688   if (!SWIG_Python_UnpackTuple(args, "bio_make_bio_pair", 2, 2, swig_obj)) SWIG_fail;
13689   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13690   if (!SWIG_IsOK(res1)) {
13691     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_make_bio_pair" "', argument " "1"" of type '" "BIO *""'");
13692   }
13693   arg1 = (BIO *)(argp1);
13694   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
13695   if (!SWIG_IsOK(res2)) {
13696     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_make_bio_pair" "', argument " "2"" of type '" "BIO *""'");
13697   }
13698   arg2 = (BIO *)(argp2);
13699   {
13700     if (!arg1) {
13701       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13702     }
13703   }
13704   {
13705     if (!arg2) {
13706       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13707     }
13708   }
13709   result = (int)bio_make_bio_pair(arg1,arg2);
13710   {
13711     resultobj=PyLong_FromLong(result);
13712     if (PyErr_Occurred()) SWIG_fail;
13713   }
13714   return resultobj;
13715 fail:
13716   return NULL;
13717 }
13718 
13719 
_wrap_bio_set_write_buf_size(PyObject * self,PyObject * args)13720 SWIGINTERN PyObject *_wrap_bio_set_write_buf_size(PyObject *self, PyObject *args) {
13721   PyObject *resultobj = 0;
13722   BIO *arg1 = (BIO *) 0 ;
13723   size_t arg2 ;
13724   void *argp1 = 0 ;
13725   int res1 = 0 ;
13726   size_t val2 ;
13727   int ecode2 = 0 ;
13728   PyObject *swig_obj[2] ;
13729   int result;
13730 
13731   if (!SWIG_Python_UnpackTuple(args, "bio_set_write_buf_size", 2, 2, swig_obj)) SWIG_fail;
13732   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13733   if (!SWIG_IsOK(res1)) {
13734     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_write_buf_size" "', argument " "1"" of type '" "BIO *""'");
13735   }
13736   arg1 = (BIO *)(argp1);
13737   ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
13738   if (!SWIG_IsOK(ecode2)) {
13739     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_set_write_buf_size" "', argument " "2"" of type '" "size_t""'");
13740   }
13741   arg2 = (size_t)(val2);
13742   {
13743     if (!arg1) {
13744       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13745     }
13746   }
13747   result = (int)bio_set_write_buf_size(arg1,arg2);
13748   {
13749     resultobj=PyLong_FromLong(result);
13750     if (PyErr_Occurred()) SWIG_fail;
13751   }
13752   return resultobj;
13753 fail:
13754   return NULL;
13755 }
13756 
13757 
_wrap_bio_should_retry(PyObject * self,PyObject * args)13758 SWIGINTERN PyObject *_wrap_bio_should_retry(PyObject *self, PyObject *args) {
13759   PyObject *resultobj = 0;
13760   BIO *arg1 = (BIO *) 0 ;
13761   void *argp1 = 0 ;
13762   int res1 = 0 ;
13763   PyObject *swig_obj[1] ;
13764   int result;
13765 
13766   if (!args) SWIG_fail;
13767   swig_obj[0] = args;
13768   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13769   if (!SWIG_IsOK(res1)) {
13770     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_should_retry" "', argument " "1"" of type '" "BIO *""'");
13771   }
13772   arg1 = (BIO *)(argp1);
13773   {
13774     if (!arg1) {
13775       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13776     }
13777   }
13778   result = (int)bio_should_retry(arg1);
13779   {
13780     resultobj=PyLong_FromLong(result);
13781     if (PyErr_Occurred()) SWIG_fail;
13782   }
13783   return resultobj;
13784 fail:
13785   return NULL;
13786 }
13787 
13788 
_wrap_bio_should_read(PyObject * self,PyObject * args)13789 SWIGINTERN PyObject *_wrap_bio_should_read(PyObject *self, PyObject *args) {
13790   PyObject *resultobj = 0;
13791   BIO *arg1 = (BIO *) 0 ;
13792   void *argp1 = 0 ;
13793   int res1 = 0 ;
13794   PyObject *swig_obj[1] ;
13795   int result;
13796 
13797   if (!args) SWIG_fail;
13798   swig_obj[0] = args;
13799   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13800   if (!SWIG_IsOK(res1)) {
13801     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_should_read" "', argument " "1"" of type '" "BIO *""'");
13802   }
13803   arg1 = (BIO *)(argp1);
13804   {
13805     if (!arg1) {
13806       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13807     }
13808   }
13809   result = (int)bio_should_read(arg1);
13810   {
13811     resultobj=PyLong_FromLong(result);
13812     if (PyErr_Occurred()) SWIG_fail;
13813   }
13814   return resultobj;
13815 fail:
13816   return NULL;
13817 }
13818 
13819 
_wrap_bio_should_write(PyObject * self,PyObject * args)13820 SWIGINTERN PyObject *_wrap_bio_should_write(PyObject *self, PyObject *args) {
13821   PyObject *resultobj = 0;
13822   BIO *arg1 = (BIO *) 0 ;
13823   void *argp1 = 0 ;
13824   int res1 = 0 ;
13825   PyObject *swig_obj[1] ;
13826   int result;
13827 
13828   if (!args) SWIG_fail;
13829   swig_obj[0] = args;
13830   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13831   if (!SWIG_IsOK(res1)) {
13832     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_should_write" "', argument " "1"" of type '" "BIO *""'");
13833   }
13834   arg1 = (BIO *)(argp1);
13835   {
13836     if (!arg1) {
13837       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
13838     }
13839   }
13840   result = (int)bio_should_write(arg1);
13841   {
13842     resultobj=PyLong_FromLong(result);
13843     if (PyErr_Occurred()) SWIG_fail;
13844   }
13845   return resultobj;
13846 fail:
13847   return NULL;
13848 }
13849 
13850 
_wrap_BIO_PYFD_CTX_fd_set(PyObject * self,PyObject * args)13851 SWIGINTERN PyObject *_wrap_BIO_PYFD_CTX_fd_set(PyObject *self, PyObject *args) {
13852   PyObject *resultobj = 0;
13853   struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ;
13854   int arg2 ;
13855   void *argp1 = 0 ;
13856   int res1 = 0 ;
13857   int val2 ;
13858   int ecode2 = 0 ;
13859   PyObject *swig_obj[2] ;
13860 
13861   if (!args) SWIG_fail;
13862   swig_obj[0] = args;
13863   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pyfd_struct, 0 |  0 );
13864   if (!SWIG_IsOK(res1)) {
13865     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BIO_PYFD_CTX_fd_set" "', argument " "1"" of type '" "struct pyfd_struct *""'");
13866   }
13867   arg1 = (struct pyfd_struct *)(argp1);
13868   ecode2 = SWIG_AsVal_int(swig_obj[0], &val2);
13869   if (!SWIG_IsOK(ecode2)) {
13870     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "BIO_PYFD_CTX_fd_set" "', argument " "2"" of type '" "int""'");
13871   }
13872   arg2 = (int)(val2);
13873   if (arg1) (arg1)->fd = arg2;
13874   resultobj = SWIG_Py_Void();
13875   return resultobj;
13876 fail:
13877   return NULL;
13878 }
13879 
13880 
_wrap_BIO_PYFD_CTX_fd_get(PyObject * self,PyObject * args)13881 SWIGINTERN PyObject *_wrap_BIO_PYFD_CTX_fd_get(PyObject *self, PyObject *args) {
13882   PyObject *resultobj = 0;
13883   struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ;
13884   void *argp1 = 0 ;
13885   int res1 = 0 ;
13886   PyObject *swig_obj[1] ;
13887   int result;
13888 
13889   if (!SWIG_Python_UnpackTuple(args, "BIO_PYFD_CTX_fd_get", 0, 0, 0)) SWIG_fail;
13890   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pyfd_struct, 0 |  0 );
13891   if (!SWIG_IsOK(res1)) {
13892     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "BIO_PYFD_CTX_fd_get" "', argument " "1"" of type '" "struct pyfd_struct *""'");
13893   }
13894   arg1 = (struct pyfd_struct *)(argp1);
13895   result = (int) ((arg1)->fd);
13896   {
13897     resultobj=PyLong_FromLong(result);
13898     if (PyErr_Occurred()) SWIG_fail;
13899   }
13900   return resultobj;
13901 fail:
13902   return NULL;
13903 }
13904 
13905 
_wrap_new_BIO_PYFD_CTX(PyObject * self,PyObject * args,PyObject * kwargs)13906 SWIGINTERN int _wrap_new_BIO_PYFD_CTX(PyObject *self, PyObject *args, PyObject *kwargs) {
13907   PyObject *resultobj = 0;
13908   struct pyfd_struct *result = 0 ;
13909 
13910   if (!SWIG_Python_CheckNoKeywords(kwargs, "new_BIO_PYFD_CTX")) SWIG_fail;
13911   if (!SWIG_Python_UnpackTuple(args, "new_BIO_PYFD_CTX", 0, 0, 0)) SWIG_fail;
13912   result = (struct pyfd_struct *)calloc(1, sizeof(struct pyfd_struct));
13913   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_pyfd_struct, SWIG_BUILTIN_INIT |  0 );
13914   return resultobj == Py_None ? -1 : 0;
13915 fail:
13916   return -1;
13917 }
13918 
13919 
_wrap_delete_BIO_PYFD_CTX(PyObject * self,PyObject * args)13920 SWIGINTERN PyObject *_wrap_delete_BIO_PYFD_CTX(PyObject *self, PyObject *args) {
13921   PyObject *resultobj = 0;
13922   struct pyfd_struct *arg1 = (struct pyfd_struct *) 0 ;
13923   void *argp1 = 0 ;
13924   int res1 = 0 ;
13925   PyObject *swig_obj[1] ;
13926 
13927   if (!SWIG_Python_UnpackTuple(args, "delete_BIO_PYFD_CTX", 0, 0, 0)) SWIG_fail;
13928   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p_pyfd_struct, SWIG_POINTER_DISOWN |  0 );
13929   if (!SWIG_IsOK(res1)) {
13930     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete_BIO_PYFD_CTX" "', argument " "1"" of type '" "struct pyfd_struct *""'");
13931   }
13932   arg1 = (struct pyfd_struct *)(argp1);
13933   free((char *) arg1);
13934   resultobj = SWIG_Py_Void();
13935   return resultobj;
13936 fail:
13937   return NULL;
13938 }
13939 
13940 
SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_BIO_PYFD_CTX)13941 SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete_BIO_PYFD_CTX) /* defines _wrap_delete_BIO_PYFD_CTX_destructor_closure */
13942 
13943 SWIGINTERN int Swig_var_methods_fdp_set(PyObject *_val) {
13944   {
13945     void *argp = 0;
13946     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_BIO_METHOD,  0 );
13947     if (!SWIG_IsOK(res)) {
13948       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""methods_fdp""' of type '""BIO_METHOD *""'");
13949     }
13950     methods_fdp = (BIO_METHOD *)(argp);
13951   }
13952   return 0;
13953 fail:
13954   return 1;
13955 }
13956 
13957 
Swig_var_methods_fdp_get(void)13958 SWIGINTERN PyObject *Swig_var_methods_fdp_get(void) {
13959   PyObject *pyobj = 0;
13960   PyObject *self = 0;
13961 
13962   (void)self;
13963   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(methods_fdp), SWIGTYPE_p_BIO_METHOD,  0 );
13964   return pyobj;
13965 }
13966 
13967 
_wrap_pyfd_write(PyObject * self,PyObject * args)13968 SWIGINTERN PyObject *_wrap_pyfd_write(PyObject *self, PyObject *args) {
13969   PyObject *resultobj = 0;
13970   BIO *arg1 = (BIO *) 0 ;
13971   char *arg2 = (char *) 0 ;
13972   int arg3 ;
13973   void *argp1 = 0 ;
13974   int res1 = 0 ;
13975   int res2 ;
13976   char *buf2 = 0 ;
13977   int alloc2 = 0 ;
13978   int val3 ;
13979   int ecode3 = 0 ;
13980   PyObject *swig_obj[3] ;
13981   int result;
13982 
13983   if (!SWIG_Python_UnpackTuple(args, "pyfd_write", 3, 3, swig_obj)) SWIG_fail;
13984   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
13985   if (!SWIG_IsOK(res1)) {
13986     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_write" "', argument " "1"" of type '" "BIO *""'");
13987   }
13988   arg1 = (BIO *)(argp1);
13989   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
13990   if (!SWIG_IsOK(res2)) {
13991     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pyfd_write" "', argument " "2"" of type '" "char const *""'");
13992   }
13993   arg2 = (char *)(buf2);
13994   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
13995   if (!SWIG_IsOK(ecode3)) {
13996     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pyfd_write" "', argument " "3"" of type '" "int""'");
13997   }
13998   arg3 = (int)(val3);
13999   {
14000     if (!arg1) {
14001       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14002     }
14003   }
14004   result = (int)pyfd_write(arg1,(char const *)arg2,arg3);
14005   {
14006     resultobj=PyLong_FromLong(result);
14007     if (PyErr_Occurred()) SWIG_fail;
14008   }
14009   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
14010   return resultobj;
14011 fail:
14012   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
14013   return NULL;
14014 }
14015 
14016 
_wrap_pyfd_read(PyObject * self,PyObject * args)14017 SWIGINTERN PyObject *_wrap_pyfd_read(PyObject *self, PyObject *args) {
14018   PyObject *resultobj = 0;
14019   BIO *arg1 = (BIO *) 0 ;
14020   char *arg2 = (char *) 0 ;
14021   int arg3 ;
14022   void *argp1 = 0 ;
14023   int res1 = 0 ;
14024   int res2 ;
14025   char *buf2 = 0 ;
14026   int alloc2 = 0 ;
14027   int val3 ;
14028   int ecode3 = 0 ;
14029   PyObject *swig_obj[3] ;
14030   int result;
14031 
14032   if (!SWIG_Python_UnpackTuple(args, "pyfd_read", 3, 3, swig_obj)) SWIG_fail;
14033   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
14034   if (!SWIG_IsOK(res1)) {
14035     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_read" "', argument " "1"" of type '" "BIO *""'");
14036   }
14037   arg1 = (BIO *)(argp1);
14038   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
14039   if (!SWIG_IsOK(res2)) {
14040     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pyfd_read" "', argument " "2"" of type '" "char *""'");
14041   }
14042   arg2 = (char *)(buf2);
14043   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
14044   if (!SWIG_IsOK(ecode3)) {
14045     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pyfd_read" "', argument " "3"" of type '" "int""'");
14046   }
14047   arg3 = (int)(val3);
14048   {
14049     if (!arg1) {
14050       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14051     }
14052   }
14053   result = (int)pyfd_read(arg1,arg2,arg3);
14054   {
14055     resultobj=PyLong_FromLong(result);
14056     if (PyErr_Occurred()) SWIG_fail;
14057   }
14058   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
14059   return resultobj;
14060 fail:
14061   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
14062   return NULL;
14063 }
14064 
14065 
_wrap_pyfd_puts(PyObject * self,PyObject * args)14066 SWIGINTERN PyObject *_wrap_pyfd_puts(PyObject *self, PyObject *args) {
14067   PyObject *resultobj = 0;
14068   BIO *arg1 = (BIO *) 0 ;
14069   char *arg2 = (char *) 0 ;
14070   void *argp1 = 0 ;
14071   int res1 = 0 ;
14072   int res2 ;
14073   char *buf2 = 0 ;
14074   int alloc2 = 0 ;
14075   PyObject *swig_obj[2] ;
14076   int result;
14077 
14078   if (!SWIG_Python_UnpackTuple(args, "pyfd_puts", 2, 2, swig_obj)) SWIG_fail;
14079   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
14080   if (!SWIG_IsOK(res1)) {
14081     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_puts" "', argument " "1"" of type '" "BIO *""'");
14082   }
14083   arg1 = (BIO *)(argp1);
14084   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
14085   if (!SWIG_IsOK(res2)) {
14086     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pyfd_puts" "', argument " "2"" of type '" "char const *""'");
14087   }
14088   arg2 = (char *)(buf2);
14089   {
14090     if (!arg1) {
14091       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14092     }
14093   }
14094   result = (int)pyfd_puts(arg1,(char const *)arg2);
14095   {
14096     resultobj=PyLong_FromLong(result);
14097     if (PyErr_Occurred()) SWIG_fail;
14098   }
14099   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
14100   return resultobj;
14101 fail:
14102   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
14103   return NULL;
14104 }
14105 
14106 
_wrap_pyfd_gets(PyObject * self,PyObject * args)14107 SWIGINTERN PyObject *_wrap_pyfd_gets(PyObject *self, PyObject *args) {
14108   PyObject *resultobj = 0;
14109   BIO *arg1 = (BIO *) 0 ;
14110   char *arg2 = (char *) 0 ;
14111   int arg3 ;
14112   void *argp1 = 0 ;
14113   int res1 = 0 ;
14114   int res2 ;
14115   char *buf2 = 0 ;
14116   int alloc2 = 0 ;
14117   int val3 ;
14118   int ecode3 = 0 ;
14119   PyObject *swig_obj[3] ;
14120   int result;
14121 
14122   if (!SWIG_Python_UnpackTuple(args, "pyfd_gets", 3, 3, swig_obj)) SWIG_fail;
14123   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
14124   if (!SWIG_IsOK(res1)) {
14125     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_gets" "', argument " "1"" of type '" "BIO *""'");
14126   }
14127   arg1 = (BIO *)(argp1);
14128   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
14129   if (!SWIG_IsOK(res2)) {
14130     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pyfd_gets" "', argument " "2"" of type '" "char *""'");
14131   }
14132   arg2 = (char *)(buf2);
14133   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
14134   if (!SWIG_IsOK(ecode3)) {
14135     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pyfd_gets" "', argument " "3"" of type '" "int""'");
14136   }
14137   arg3 = (int)(val3);
14138   {
14139     if (!arg1) {
14140       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14141     }
14142   }
14143   result = (int)pyfd_gets(arg1,arg2,arg3);
14144   {
14145     resultobj=PyLong_FromLong(result);
14146     if (PyErr_Occurred()) SWIG_fail;
14147   }
14148   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
14149   return resultobj;
14150 fail:
14151   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
14152   return NULL;
14153 }
14154 
14155 
_wrap_pyfd_new(PyObject * self,PyObject * args)14156 SWIGINTERN PyObject *_wrap_pyfd_new(PyObject *self, PyObject *args) {
14157   PyObject *resultobj = 0;
14158   BIO *arg1 = (BIO *) 0 ;
14159   void *argp1 = 0 ;
14160   int res1 = 0 ;
14161   PyObject *swig_obj[1] ;
14162   int result;
14163 
14164   if (!args) SWIG_fail;
14165   swig_obj[0] = args;
14166   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
14167   if (!SWIG_IsOK(res1)) {
14168     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_new" "', argument " "1"" of type '" "BIO *""'");
14169   }
14170   arg1 = (BIO *)(argp1);
14171   {
14172     if (!arg1) {
14173       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14174     }
14175   }
14176   result = (int)pyfd_new(arg1);
14177   {
14178     resultobj=PyLong_FromLong(result);
14179     if (PyErr_Occurred()) SWIG_fail;
14180   }
14181   return resultobj;
14182 fail:
14183   return NULL;
14184 }
14185 
14186 
_wrap_pyfd_free(PyObject * self,PyObject * args)14187 SWIGINTERN PyObject *_wrap_pyfd_free(PyObject *self, PyObject *args) {
14188   PyObject *resultobj = 0;
14189   BIO *arg1 = (BIO *) 0 ;
14190   void *argp1 = 0 ;
14191   int res1 = 0 ;
14192   PyObject *swig_obj[1] ;
14193   int result;
14194 
14195   if (!args) SWIG_fail;
14196   swig_obj[0] = args;
14197   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
14198   if (!SWIG_IsOK(res1)) {
14199     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_free" "', argument " "1"" of type '" "BIO *""'");
14200   }
14201   arg1 = (BIO *)(argp1);
14202   {
14203     if (!arg1) {
14204       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14205     }
14206   }
14207   result = (int)pyfd_free(arg1);
14208   {
14209     resultobj=PyLong_FromLong(result);
14210     if (PyErr_Occurred()) SWIG_fail;
14211   }
14212   return resultobj;
14213 fail:
14214   return NULL;
14215 }
14216 
14217 
_wrap_pyfd_ctrl(PyObject * self,PyObject * args)14218 SWIGINTERN PyObject *_wrap_pyfd_ctrl(PyObject *self, PyObject *args) {
14219   PyObject *resultobj = 0;
14220   BIO *arg1 = (BIO *) 0 ;
14221   int arg2 ;
14222   long arg3 ;
14223   void *arg4 = (void *) 0 ;
14224   void *argp1 = 0 ;
14225   int res1 = 0 ;
14226   int val2 ;
14227   int ecode2 = 0 ;
14228   long val3 ;
14229   int ecode3 = 0 ;
14230   int res4 ;
14231   PyObject *swig_obj[4] ;
14232   long result;
14233 
14234   if (!SWIG_Python_UnpackTuple(args, "pyfd_ctrl", 4, 4, swig_obj)) SWIG_fail;
14235   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
14236   if (!SWIG_IsOK(res1)) {
14237     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pyfd_ctrl" "', argument " "1"" of type '" "BIO *""'");
14238   }
14239   arg1 = (BIO *)(argp1);
14240   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
14241   if (!SWIG_IsOK(ecode2)) {
14242     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pyfd_ctrl" "', argument " "2"" of type '" "int""'");
14243   }
14244   arg2 = (int)(val2);
14245   ecode3 = SWIG_AsVal_long(swig_obj[2], &val3);
14246   if (!SWIG_IsOK(ecode3)) {
14247     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pyfd_ctrl" "', argument " "3"" of type '" "long""'");
14248   }
14249   arg3 = (long)(val3);
14250   res4 = SWIG_ConvertPtr(swig_obj[3],SWIG_as_voidptrptr(&arg4), 0, 0);
14251   if (!SWIG_IsOK(res4)) {
14252     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "pyfd_ctrl" "', argument " "4"" of type '" "void *""'");
14253   }
14254   {
14255     if (!arg1) {
14256       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14257     }
14258   }
14259   result = (long)pyfd_ctrl(arg1,arg2,arg3,arg4);
14260   resultobj = SWIG_From_long((long)(result));
14261   return resultobj;
14262 fail:
14263   return NULL;
14264 }
14265 
14266 
_wrap_bio_new_pyfd(PyObject * self,PyObject * args)14267 SWIGINTERN PyObject *_wrap_bio_new_pyfd(PyObject *self, PyObject *args) {
14268   PyObject *resultobj = 0;
14269   int arg1 ;
14270   int arg2 ;
14271   int val1 ;
14272   int ecode1 = 0 ;
14273   int val2 ;
14274   int ecode2 = 0 ;
14275   PyObject *swig_obj[2] ;
14276   BIO *result = 0 ;
14277 
14278   if (!SWIG_Python_UnpackTuple(args, "bio_new_pyfd", 2, 2, swig_obj)) SWIG_fail;
14279   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
14280   if (!SWIG_IsOK(ecode1)) {
14281     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bio_new_pyfd" "', argument " "1"" of type '" "int""'");
14282   }
14283   arg1 = (int)(val1);
14284   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
14285   if (!SWIG_IsOK(ecode2)) {
14286     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_pyfd" "', argument " "2"" of type '" "int""'");
14287   }
14288   arg2 = (int)(val2);
14289   result = (BIO *)BIO_new_pyfd(arg1,arg2);
14290   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 |  0 );
14291   return resultobj;
14292 fail:
14293   return NULL;
14294 }
14295 
14296 
_wrap_bn_rand(PyObject * self,PyObject * args)14297 SWIGINTERN PyObject *_wrap_bn_rand(PyObject *self, PyObject *args) {
14298   PyObject *resultobj = 0;
14299   int arg1 ;
14300   int arg2 ;
14301   int arg3 ;
14302   int val1 ;
14303   int ecode1 = 0 ;
14304   int val2 ;
14305   int ecode2 = 0 ;
14306   int val3 ;
14307   int ecode3 = 0 ;
14308   PyObject *swig_obj[3] ;
14309   PyObject *result = 0 ;
14310 
14311   if (!SWIG_Python_UnpackTuple(args, "bn_rand", 3, 3, swig_obj)) SWIG_fail;
14312   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
14313   if (!SWIG_IsOK(ecode1)) {
14314     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "bn_rand" "', argument " "1"" of type '" "int""'");
14315   }
14316   arg1 = (int)(val1);
14317   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
14318   if (!SWIG_IsOK(ecode2)) {
14319     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bn_rand" "', argument " "2"" of type '" "int""'");
14320   }
14321   arg2 = (int)(val2);
14322   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
14323   if (!SWIG_IsOK(ecode3)) {
14324     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bn_rand" "', argument " "3"" of type '" "int""'");
14325   }
14326   arg3 = (int)(val3);
14327   result = (PyObject *)bn_rand(arg1,arg2,arg3);
14328   {
14329     resultobj=result;
14330   }
14331   return resultobj;
14332 fail:
14333   return NULL;
14334 }
14335 
14336 
_wrap_bn_rand_range(PyObject * self,PyObject * args)14337 SWIGINTERN PyObject *_wrap_bn_rand_range(PyObject *self, PyObject *args) {
14338   PyObject *resultobj = 0;
14339   PyObject *arg1 = (PyObject *) 0 ;
14340   PyObject *swig_obj[1] ;
14341   PyObject *result = 0 ;
14342 
14343   if (!args) SWIG_fail;
14344   swig_obj[0] = args;
14345   {
14346     arg1=swig_obj[0];
14347   }
14348   result = (PyObject *)bn_rand_range(arg1);
14349   {
14350     resultobj=result;
14351   }
14352   return resultobj;
14353 fail:
14354   return NULL;
14355 }
14356 
14357 
_wrap_rand_file_name__SWIG_0(PyObject * self,Py_ssize_t nobjs,PyObject ** swig_obj)14358 SWIGINTERN PyObject *_wrap_rand_file_name__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
14359   PyObject *resultobj = 0;
14360   char *arg1 = (char *) 0 ;
14361   size_t arg2 ;
14362   int res1 ;
14363   char *buf1 = 0 ;
14364   int alloc1 = 0 ;
14365   size_t val2 ;
14366   int ecode2 = 0 ;
14367   char *result = 0 ;
14368 
14369   if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
14370   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
14371   if (!SWIG_IsOK(res1)) {
14372     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_file_name" "', argument " "1"" of type '" "char *""'");
14373   }
14374   arg1 = (char *)(buf1);
14375   ecode2 = SWIG_AsVal_size_t(swig_obj[1], &val2);
14376   if (!SWIG_IsOK(ecode2)) {
14377     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_file_name" "', argument " "2"" of type '" "size_t""'");
14378   }
14379   arg2 = (size_t)(val2);
14380   result = (char *)RAND_file_name(arg1,arg2);
14381   resultobj = SWIG_FromCharPtr((const char *)result);
14382   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
14383   return resultobj;
14384 fail:
14385   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
14386   return NULL;
14387 }
14388 
14389 
_wrap_rand_load_file(PyObject * self,PyObject * args)14390 SWIGINTERN PyObject *_wrap_rand_load_file(PyObject *self, PyObject *args) {
14391   PyObject *resultobj = 0;
14392   char *arg1 = (char *) 0 ;
14393   long arg2 ;
14394   int res1 ;
14395   char *buf1 = 0 ;
14396   int alloc1 = 0 ;
14397   long val2 ;
14398   int ecode2 = 0 ;
14399   PyObject *swig_obj[2] ;
14400   int result;
14401 
14402   if (!SWIG_Python_UnpackTuple(args, "rand_load_file", 2, 2, swig_obj)) SWIG_fail;
14403   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
14404   if (!SWIG_IsOK(res1)) {
14405     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_load_file" "', argument " "1"" of type '" "char const *""'");
14406   }
14407   arg1 = (char *)(buf1);
14408   ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
14409   if (!SWIG_IsOK(ecode2)) {
14410     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_load_file" "', argument " "2"" of type '" "long""'");
14411   }
14412   arg2 = (long)(val2);
14413   result = (int)RAND_load_file((char const *)arg1,arg2);
14414   {
14415     resultobj=PyLong_FromLong(result);
14416     if (PyErr_Occurred()) SWIG_fail;
14417   }
14418   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
14419   return resultobj;
14420 fail:
14421   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
14422   return NULL;
14423 }
14424 
14425 
_wrap_rand_save_file(PyObject * self,PyObject * args)14426 SWIGINTERN PyObject *_wrap_rand_save_file(PyObject *self, PyObject *args) {
14427   PyObject *resultobj = 0;
14428   char *arg1 = (char *) 0 ;
14429   int res1 ;
14430   char *buf1 = 0 ;
14431   int alloc1 = 0 ;
14432   PyObject *swig_obj[1] ;
14433   int result;
14434 
14435   if (!args) SWIG_fail;
14436   swig_obj[0] = args;
14437   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
14438   if (!SWIG_IsOK(res1)) {
14439     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rand_save_file" "', argument " "1"" of type '" "char const *""'");
14440   }
14441   arg1 = (char *)(buf1);
14442   result = (int)RAND_write_file((char const *)arg1);
14443   {
14444     resultobj=PyLong_FromLong(result);
14445     if (PyErr_Occurred()) SWIG_fail;
14446   }
14447   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
14448   return resultobj;
14449 fail:
14450   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
14451   return NULL;
14452 }
14453 
14454 
_wrap_rand_poll(PyObject * self,PyObject * args)14455 SWIGINTERN PyObject *_wrap_rand_poll(PyObject *self, PyObject *args) {
14456   PyObject *resultobj = 0;
14457   int result;
14458 
14459   if (!SWIG_Python_UnpackTuple(args, "rand_poll", 0, 0, 0)) SWIG_fail;
14460   result = (int)RAND_poll();
14461   {
14462     resultobj=PyLong_FromLong(result);
14463     if (PyErr_Occurred()) SWIG_fail;
14464   }
14465   return resultobj;
14466 fail:
14467   return NULL;
14468 }
14469 
14470 
_wrap_rand_status(PyObject * self,PyObject * args)14471 SWIGINTERN PyObject *_wrap_rand_status(PyObject *self, PyObject *args) {
14472   PyObject *resultobj = 0;
14473   int result;
14474 
14475   if (!SWIG_Python_UnpackTuple(args, "rand_status", 0, 0, 0)) SWIG_fail;
14476   result = (int)RAND_status();
14477   {
14478     resultobj=PyLong_FromLong(result);
14479     if (PyErr_Occurred()) SWIG_fail;
14480   }
14481   return resultobj;
14482 fail:
14483   return NULL;
14484 }
14485 
14486 
_wrap_rand_cleanup(PyObject * self,PyObject * args)14487 SWIGINTERN PyObject *_wrap_rand_cleanup(PyObject *self, PyObject *args) {
14488   PyObject *resultobj = 0;
14489 
14490   if (!SWIG_Python_UnpackTuple(args, "rand_cleanup", 0, 0, 0)) SWIG_fail;
14491   RAND_cleanup();
14492   resultobj = SWIG_Py_Void();
14493   return resultobj;
14494 fail:
14495   return NULL;
14496 }
14497 
14498 
Swig_var__rand_err_set(PyObject * _val)14499 SWIGINTERN int Swig_var__rand_err_set(PyObject *_val) {
14500   {
14501     void *argp = 0;
14502     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
14503     if (!SWIG_IsOK(res)) {
14504       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_rand_err""' of type '""PyObject *""'");
14505     }
14506     _rand_err = (PyObject *)(argp);
14507   }
14508   return 0;
14509 fail:
14510   return 1;
14511 }
14512 
14513 
Swig_var__rand_err_get(void)14514 SWIGINTERN PyObject *Swig_var__rand_err_get(void) {
14515   PyObject *pyobj = 0;
14516   PyObject *self = 0;
14517 
14518   (void)self;
14519   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_rand_err), SWIGTYPE_p_PyObject,  0 );
14520   return pyobj;
14521 }
14522 
14523 
_wrap_rand_init(PyObject * self,PyObject * args)14524 SWIGINTERN PyObject *_wrap_rand_init(PyObject *self, PyObject *args) {
14525   PyObject *resultobj = 0;
14526   PyObject *arg1 = (PyObject *) 0 ;
14527   PyObject *swig_obj[1] ;
14528 
14529   if (!args) SWIG_fail;
14530   swig_obj[0] = args;
14531   {
14532     arg1=swig_obj[0];
14533   }
14534   rand_init(arg1);
14535   resultobj = SWIG_Py_Void();
14536   return resultobj;
14537 fail:
14538   return NULL;
14539 }
14540 
14541 
_wrap_rand_seed(PyObject * self,PyObject * args)14542 SWIGINTERN PyObject *_wrap_rand_seed(PyObject *self, PyObject *args) {
14543   PyObject *resultobj = 0;
14544   PyObject *arg1 = (PyObject *) 0 ;
14545   PyObject *swig_obj[1] ;
14546   PyObject *result = 0 ;
14547 
14548   if (!args) SWIG_fail;
14549   swig_obj[0] = args;
14550   {
14551     arg1=swig_obj[0];
14552   }
14553   result = (PyObject *)rand_seed(arg1);
14554   {
14555     resultobj=result;
14556   }
14557   return resultobj;
14558 fail:
14559   return NULL;
14560 }
14561 
14562 
_wrap_rand_add(PyObject * self,PyObject * args)14563 SWIGINTERN PyObject *_wrap_rand_add(PyObject *self, PyObject *args) {
14564   PyObject *resultobj = 0;
14565   PyObject *arg1 = (PyObject *) 0 ;
14566   double arg2 ;
14567   double val2 ;
14568   int ecode2 = 0 ;
14569   PyObject *swig_obj[2] ;
14570   PyObject *result = 0 ;
14571 
14572   if (!SWIG_Python_UnpackTuple(args, "rand_add", 2, 2, swig_obj)) SWIG_fail;
14573   {
14574     arg1=swig_obj[0];
14575   }
14576   ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
14577   if (!SWIG_IsOK(ecode2)) {
14578     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_add" "', argument " "2"" of type '" "double""'");
14579   }
14580   arg2 = (double)(val2);
14581   result = (PyObject *)rand_add(arg1,arg2);
14582   {
14583     resultobj=result;
14584   }
14585   return resultobj;
14586 fail:
14587   return NULL;
14588 }
14589 
14590 
_wrap_rand_bytes(PyObject * self,PyObject * args)14591 SWIGINTERN PyObject *_wrap_rand_bytes(PyObject *self, PyObject *args) {
14592   PyObject *resultobj = 0;
14593   int arg1 ;
14594   int val1 ;
14595   int ecode1 = 0 ;
14596   PyObject *swig_obj[1] ;
14597   PyObject *result = 0 ;
14598 
14599   if (!args) SWIG_fail;
14600   swig_obj[0] = args;
14601   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
14602   if (!SWIG_IsOK(ecode1)) {
14603     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rand_bytes" "', argument " "1"" of type '" "int""'");
14604   }
14605   arg1 = (int)(val1);
14606   result = (PyObject *)rand_bytes(arg1);
14607   {
14608     resultobj=result;
14609   }
14610   return resultobj;
14611 fail:
14612   return NULL;
14613 }
14614 
14615 
_wrap_rand_pseudo_bytes(PyObject * self,PyObject * args)14616 SWIGINTERN PyObject *_wrap_rand_pseudo_bytes(PyObject *self, PyObject *args) {
14617   PyObject *resultobj = 0;
14618   int arg1 ;
14619   int val1 ;
14620   int ecode1 = 0 ;
14621   PyObject *swig_obj[1] ;
14622   PyObject *result = 0 ;
14623 
14624   if (!args) SWIG_fail;
14625   swig_obj[0] = args;
14626   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
14627   if (!SWIG_IsOK(ecode1)) {
14628     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rand_pseudo_bytes" "', argument " "1"" of type '" "int""'");
14629   }
14630   arg1 = (int)(val1);
14631   result = (PyObject *)rand_pseudo_bytes(arg1);
14632   {
14633     resultobj=result;
14634   }
14635   return resultobj;
14636 fail:
14637   return NULL;
14638 }
14639 
14640 
_wrap_rand_file_name__SWIG_1(PyObject * self,Py_ssize_t nobjs,PyObject ** SWIGUNUSEDPARM (swig_obj))14641 SWIGINTERN PyObject *_wrap_rand_file_name__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **SWIGUNUSEDPARM(swig_obj)) {
14642   PyObject *resultobj = 0;
14643   PyObject *result = 0 ;
14644 
14645   if ((nobjs < 0) || (nobjs > 0)) SWIG_fail;
14646   result = (PyObject *)rand_file_name();
14647   {
14648     resultobj=result;
14649   }
14650   return resultobj;
14651 fail:
14652   return NULL;
14653 }
14654 
14655 
_wrap_rand_file_name(PyObject * self,PyObject * args)14656 SWIGINTERN PyObject *_wrap_rand_file_name(PyObject *self, PyObject *args) {
14657   Py_ssize_t argc;
14658   PyObject *argv[3] = {
14659     0
14660   };
14661 
14662   if (!(argc = SWIG_Python_UnpackTuple(args, "rand_file_name", 0, 2, argv))) SWIG_fail;
14663   --argc;
14664   if (argc == 0) {
14665     return _wrap_rand_file_name__SWIG_1(self, argc, argv);
14666   }
14667   if (argc == 2) {
14668     int _v;
14669     int res = SWIG_AsCharPtrAndSize(argv[0], 0, NULL, 0);
14670     _v = SWIG_CheckState(res);
14671     if (_v) {
14672       {
14673         int res = SWIG_AsVal_size_t(argv[1], NULL);
14674         _v = SWIG_CheckState(res);
14675       }
14676       if (_v) {
14677         return _wrap_rand_file_name__SWIG_0(self, argc, argv);
14678       }
14679     }
14680   }
14681 
14682 fail:
14683   SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'rand_file_name'.\n"
14684     "  Possible C/C++ prototypes are:\n"
14685     "    RAND_file_name(char *,size_t)\n"
14686     "    rand_file_name()\n");
14687   return 0;
14688 }
14689 
14690 
_wrap_rand_screen(PyObject * self,PyObject * args)14691 SWIGINTERN PyObject *_wrap_rand_screen(PyObject *self, PyObject *args) {
14692   PyObject *resultobj = 0;
14693 
14694   if (!SWIG_Python_UnpackTuple(args, "rand_screen", 0, 0, 0)) SWIG_fail;
14695   rand_screen();
14696   resultobj = SWIG_Py_Void();
14697   return resultobj;
14698 fail:
14699   return NULL;
14700 }
14701 
14702 
_wrap_rand_win32_event(PyObject * self,PyObject * args)14703 SWIGINTERN PyObject *_wrap_rand_win32_event(PyObject *self, PyObject *args) {
14704   PyObject *resultobj = 0;
14705   unsigned int arg1 ;
14706   int arg2 ;
14707   long arg3 ;
14708   unsigned int val1 ;
14709   int ecode1 = 0 ;
14710   int val2 ;
14711   int ecode2 = 0 ;
14712   long val3 ;
14713   int ecode3 = 0 ;
14714   PyObject *swig_obj[3] ;
14715   int result;
14716 
14717   if (!SWIG_Python_UnpackTuple(args, "rand_win32_event", 3, 3, swig_obj)) SWIG_fail;
14718   ecode1 = SWIG_AsVal_unsigned_SS_int(swig_obj[0], &val1);
14719   if (!SWIG_IsOK(ecode1)) {
14720     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rand_win32_event" "', argument " "1"" of type '" "unsigned int""'");
14721   }
14722   arg1 = (unsigned int)(val1);
14723   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
14724   if (!SWIG_IsOK(ecode2)) {
14725     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rand_win32_event" "', argument " "2"" of type '" "int""'");
14726   }
14727   arg2 = (int)(val2);
14728   ecode3 = SWIG_AsVal_long(swig_obj[2], &val3);
14729   if (!SWIG_IsOK(ecode3)) {
14730     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rand_win32_event" "', argument " "3"" of type '" "long""'");
14731   }
14732   arg3 = (long)(val3);
14733   result = (int)rand_win32_event(arg1,arg2,arg3);
14734   {
14735     resultobj=PyLong_FromLong(result);
14736     if (PyErr_Occurred()) SWIG_fail;
14737   }
14738   return resultobj;
14739 fail:
14740   return NULL;
14741 }
14742 
14743 
_wrap_md5(PyObject * self,PyObject * args)14744 SWIGINTERN PyObject *_wrap_md5(PyObject *self, PyObject *args) {
14745   PyObject *resultobj = 0;
14746   EVP_MD *result = 0 ;
14747 
14748   if (!SWIG_Python_UnpackTuple(args, "md5", 0, 0, 0)) SWIG_fail;
14749   result = (EVP_MD *)EVP_md5();
14750   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 |  0 );
14751   return resultobj;
14752 fail:
14753   return NULL;
14754 }
14755 
14756 
_wrap_sha1(PyObject * self,PyObject * args)14757 SWIGINTERN PyObject *_wrap_sha1(PyObject *self, PyObject *args) {
14758   PyObject *resultobj = 0;
14759   EVP_MD *result = 0 ;
14760 
14761   if (!SWIG_Python_UnpackTuple(args, "sha1", 0, 0, 0)) SWIG_fail;
14762   result = (EVP_MD *)EVP_sha1();
14763   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 |  0 );
14764   return resultobj;
14765 fail:
14766   return NULL;
14767 }
14768 
14769 
_wrap_ripemd160(PyObject * self,PyObject * args)14770 SWIGINTERN PyObject *_wrap_ripemd160(PyObject *self, PyObject *args) {
14771   PyObject *resultobj = 0;
14772   EVP_MD *result = 0 ;
14773 
14774   if (!SWIG_Python_UnpackTuple(args, "ripemd160", 0, 0, 0)) SWIG_fail;
14775   result = (EVP_MD *)EVP_ripemd160();
14776   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 |  0 );
14777   return resultobj;
14778 fail:
14779   return NULL;
14780 }
14781 
14782 
_wrap_sha224(PyObject * self,PyObject * args)14783 SWIGINTERN PyObject *_wrap_sha224(PyObject *self, PyObject *args) {
14784   PyObject *resultobj = 0;
14785   EVP_MD *result = 0 ;
14786 
14787   if (!SWIG_Python_UnpackTuple(args, "sha224", 0, 0, 0)) SWIG_fail;
14788   result = (EVP_MD *)EVP_sha224();
14789   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 |  0 );
14790   return resultobj;
14791 fail:
14792   return NULL;
14793 }
14794 
14795 
_wrap_sha256(PyObject * self,PyObject * args)14796 SWIGINTERN PyObject *_wrap_sha256(PyObject *self, PyObject *args) {
14797   PyObject *resultobj = 0;
14798   EVP_MD *result = 0 ;
14799 
14800   if (!SWIG_Python_UnpackTuple(args, "sha256", 0, 0, 0)) SWIG_fail;
14801   result = (EVP_MD *)EVP_sha256();
14802   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 |  0 );
14803   return resultobj;
14804 fail:
14805   return NULL;
14806 }
14807 
14808 
_wrap_sha384(PyObject * self,PyObject * args)14809 SWIGINTERN PyObject *_wrap_sha384(PyObject *self, PyObject *args) {
14810   PyObject *resultobj = 0;
14811   EVP_MD *result = 0 ;
14812 
14813   if (!SWIG_Python_UnpackTuple(args, "sha384", 0, 0, 0)) SWIG_fail;
14814   result = (EVP_MD *)EVP_sha384();
14815   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 |  0 );
14816   return resultobj;
14817 fail:
14818   return NULL;
14819 }
14820 
14821 
_wrap_sha512(PyObject * self,PyObject * args)14822 SWIGINTERN PyObject *_wrap_sha512(PyObject *self, PyObject *args) {
14823   PyObject *resultobj = 0;
14824   EVP_MD *result = 0 ;
14825 
14826   if (!SWIG_Python_UnpackTuple(args, "sha512", 0, 0, 0)) SWIG_fail;
14827   result = (EVP_MD *)EVP_sha512();
14828   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD, 0 |  0 );
14829   return resultobj;
14830 fail:
14831   return NULL;
14832 }
14833 
14834 
_wrap_digest_init(PyObject * self,PyObject * args)14835 SWIGINTERN PyObject *_wrap_digest_init(PyObject *self, PyObject *args) {
14836   PyObject *resultobj = 0;
14837   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
14838   EVP_MD *arg2 = (EVP_MD *) 0 ;
14839   void *argp1 = 0 ;
14840   int res1 = 0 ;
14841   void *argp2 = 0 ;
14842   int res2 = 0 ;
14843   PyObject *swig_obj[2] ;
14844   int result;
14845 
14846   if (!SWIG_Python_UnpackTuple(args, "digest_init", 2, 2, swig_obj)) SWIG_fail;
14847   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
14848   if (!SWIG_IsOK(res1)) {
14849     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
14850   }
14851   arg1 = (EVP_MD_CTX *)(argp1);
14852   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_MD, 0 |  0 );
14853   if (!SWIG_IsOK(res2)) {
14854     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_init" "', argument " "2"" of type '" "EVP_MD const *""'");
14855   }
14856   arg2 = (EVP_MD *)(argp2);
14857   {
14858     if (!arg1) {
14859       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14860     }
14861   }
14862   {
14863     if (!arg2) {
14864       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
14865     }
14866   }
14867   result = (int)EVP_DigestInit(arg1,(EVP_MD const *)arg2);
14868   {
14869     resultobj=PyLong_FromLong(result);
14870     if (PyErr_Occurred()) SWIG_fail;
14871   }
14872   return resultobj;
14873 fail:
14874   return NULL;
14875 }
14876 
14877 
_wrap_des_ecb(PyObject * self,PyObject * args)14878 SWIGINTERN PyObject *_wrap_des_ecb(PyObject *self, PyObject *args) {
14879   PyObject *resultobj = 0;
14880   EVP_CIPHER *result = 0 ;
14881 
14882   if (!SWIG_Python_UnpackTuple(args, "des_ecb", 0, 0, 0)) SWIG_fail;
14883   result = (EVP_CIPHER *)EVP_des_ecb();
14884   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
14885   return resultobj;
14886 fail:
14887   return NULL;
14888 }
14889 
14890 
_wrap_des_ede_ecb(PyObject * self,PyObject * args)14891 SWIGINTERN PyObject *_wrap_des_ede_ecb(PyObject *self, PyObject *args) {
14892   PyObject *resultobj = 0;
14893   EVP_CIPHER *result = 0 ;
14894 
14895   if (!SWIG_Python_UnpackTuple(args, "des_ede_ecb", 0, 0, 0)) SWIG_fail;
14896   result = (EVP_CIPHER *)EVP_des_ede();
14897   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
14898   return resultobj;
14899 fail:
14900   return NULL;
14901 }
14902 
14903 
_wrap_des_ede3_ecb(PyObject * self,PyObject * args)14904 SWIGINTERN PyObject *_wrap_des_ede3_ecb(PyObject *self, PyObject *args) {
14905   PyObject *resultobj = 0;
14906   EVP_CIPHER *result = 0 ;
14907 
14908   if (!SWIG_Python_UnpackTuple(args, "des_ede3_ecb", 0, 0, 0)) SWIG_fail;
14909   result = (EVP_CIPHER *)EVP_des_ede3();
14910   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
14911   return resultobj;
14912 fail:
14913   return NULL;
14914 }
14915 
14916 
_wrap_des_cbc(PyObject * self,PyObject * args)14917 SWIGINTERN PyObject *_wrap_des_cbc(PyObject *self, PyObject *args) {
14918   PyObject *resultobj = 0;
14919   EVP_CIPHER *result = 0 ;
14920 
14921   if (!SWIG_Python_UnpackTuple(args, "des_cbc", 0, 0, 0)) SWIG_fail;
14922   result = (EVP_CIPHER *)EVP_des_cbc();
14923   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
14924   return resultobj;
14925 fail:
14926   return NULL;
14927 }
14928 
14929 
_wrap_des_ede_cbc(PyObject * self,PyObject * args)14930 SWIGINTERN PyObject *_wrap_des_ede_cbc(PyObject *self, PyObject *args) {
14931   PyObject *resultobj = 0;
14932   EVP_CIPHER *result = 0 ;
14933 
14934   if (!SWIG_Python_UnpackTuple(args, "des_ede_cbc", 0, 0, 0)) SWIG_fail;
14935   result = (EVP_CIPHER *)EVP_des_ede_cbc();
14936   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
14937   return resultobj;
14938 fail:
14939   return NULL;
14940 }
14941 
14942 
_wrap_des_ede3_cbc(PyObject * self,PyObject * args)14943 SWIGINTERN PyObject *_wrap_des_ede3_cbc(PyObject *self, PyObject *args) {
14944   PyObject *resultobj = 0;
14945   EVP_CIPHER *result = 0 ;
14946 
14947   if (!SWIG_Python_UnpackTuple(args, "des_ede3_cbc", 0, 0, 0)) SWIG_fail;
14948   result = (EVP_CIPHER *)EVP_des_ede3_cbc();
14949   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
14950   return resultobj;
14951 fail:
14952   return NULL;
14953 }
14954 
14955 
_wrap_des_cfb(PyObject * self,PyObject * args)14956 SWIGINTERN PyObject *_wrap_des_cfb(PyObject *self, PyObject *args) {
14957   PyObject *resultobj = 0;
14958   EVP_CIPHER *result = 0 ;
14959 
14960   if (!SWIG_Python_UnpackTuple(args, "des_cfb", 0, 0, 0)) SWIG_fail;
14961   result = (EVP_CIPHER *)EVP_des_cfb();
14962   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
14963   return resultobj;
14964 fail:
14965   return NULL;
14966 }
14967 
14968 
_wrap_des_ede_cfb(PyObject * self,PyObject * args)14969 SWIGINTERN PyObject *_wrap_des_ede_cfb(PyObject *self, PyObject *args) {
14970   PyObject *resultobj = 0;
14971   EVP_CIPHER *result = 0 ;
14972 
14973   if (!SWIG_Python_UnpackTuple(args, "des_ede_cfb", 0, 0, 0)) SWIG_fail;
14974   result = (EVP_CIPHER *)EVP_des_ede_cfb();
14975   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
14976   return resultobj;
14977 fail:
14978   return NULL;
14979 }
14980 
14981 
_wrap_des_ede3_cfb(PyObject * self,PyObject * args)14982 SWIGINTERN PyObject *_wrap_des_ede3_cfb(PyObject *self, PyObject *args) {
14983   PyObject *resultobj = 0;
14984   EVP_CIPHER *result = 0 ;
14985 
14986   if (!SWIG_Python_UnpackTuple(args, "des_ede3_cfb", 0, 0, 0)) SWIG_fail;
14987   result = (EVP_CIPHER *)EVP_des_ede3_cfb();
14988   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
14989   return resultobj;
14990 fail:
14991   return NULL;
14992 }
14993 
14994 
_wrap_des_ofb(PyObject * self,PyObject * args)14995 SWIGINTERN PyObject *_wrap_des_ofb(PyObject *self, PyObject *args) {
14996   PyObject *resultobj = 0;
14997   EVP_CIPHER *result = 0 ;
14998 
14999   if (!SWIG_Python_UnpackTuple(args, "des_ofb", 0, 0, 0)) SWIG_fail;
15000   result = (EVP_CIPHER *)EVP_des_ofb();
15001   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15002   return resultobj;
15003 fail:
15004   return NULL;
15005 }
15006 
15007 
_wrap_des_ede_ofb(PyObject * self,PyObject * args)15008 SWIGINTERN PyObject *_wrap_des_ede_ofb(PyObject *self, PyObject *args) {
15009   PyObject *resultobj = 0;
15010   EVP_CIPHER *result = 0 ;
15011 
15012   if (!SWIG_Python_UnpackTuple(args, "des_ede_ofb", 0, 0, 0)) SWIG_fail;
15013   result = (EVP_CIPHER *)EVP_des_ede_ofb();
15014   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15015   return resultobj;
15016 fail:
15017   return NULL;
15018 }
15019 
15020 
_wrap_des_ede3_ofb(PyObject * self,PyObject * args)15021 SWIGINTERN PyObject *_wrap_des_ede3_ofb(PyObject *self, PyObject *args) {
15022   PyObject *resultobj = 0;
15023   EVP_CIPHER *result = 0 ;
15024 
15025   if (!SWIG_Python_UnpackTuple(args, "des_ede3_ofb", 0, 0, 0)) SWIG_fail;
15026   result = (EVP_CIPHER *)EVP_des_ede3_ofb();
15027   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15028   return resultobj;
15029 fail:
15030   return NULL;
15031 }
15032 
15033 
_wrap_bf_ecb(PyObject * self,PyObject * args)15034 SWIGINTERN PyObject *_wrap_bf_ecb(PyObject *self, PyObject *args) {
15035   PyObject *resultobj = 0;
15036   EVP_CIPHER *result = 0 ;
15037 
15038   if (!SWIG_Python_UnpackTuple(args, "bf_ecb", 0, 0, 0)) SWIG_fail;
15039   result = (EVP_CIPHER *)EVP_bf_ecb();
15040   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15041   return resultobj;
15042 fail:
15043   return NULL;
15044 }
15045 
15046 
_wrap_bf_cbc(PyObject * self,PyObject * args)15047 SWIGINTERN PyObject *_wrap_bf_cbc(PyObject *self, PyObject *args) {
15048   PyObject *resultobj = 0;
15049   EVP_CIPHER *result = 0 ;
15050 
15051   if (!SWIG_Python_UnpackTuple(args, "bf_cbc", 0, 0, 0)) SWIG_fail;
15052   result = (EVP_CIPHER *)EVP_bf_cbc();
15053   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15054   return resultobj;
15055 fail:
15056   return NULL;
15057 }
15058 
15059 
_wrap_bf_cfb(PyObject * self,PyObject * args)15060 SWIGINTERN PyObject *_wrap_bf_cfb(PyObject *self, PyObject *args) {
15061   PyObject *resultobj = 0;
15062   EVP_CIPHER *result = 0 ;
15063 
15064   if (!SWIG_Python_UnpackTuple(args, "bf_cfb", 0, 0, 0)) SWIG_fail;
15065   result = (EVP_CIPHER *)EVP_bf_cfb();
15066   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15067   return resultobj;
15068 fail:
15069   return NULL;
15070 }
15071 
15072 
_wrap_bf_ofb(PyObject * self,PyObject * args)15073 SWIGINTERN PyObject *_wrap_bf_ofb(PyObject *self, PyObject *args) {
15074   PyObject *resultobj = 0;
15075   EVP_CIPHER *result = 0 ;
15076 
15077   if (!SWIG_Python_UnpackTuple(args, "bf_ofb", 0, 0, 0)) SWIG_fail;
15078   result = (EVP_CIPHER *)EVP_bf_ofb();
15079   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15080   return resultobj;
15081 fail:
15082   return NULL;
15083 }
15084 
15085 
_wrap_cast5_ecb(PyObject * self,PyObject * args)15086 SWIGINTERN PyObject *_wrap_cast5_ecb(PyObject *self, PyObject *args) {
15087   PyObject *resultobj = 0;
15088   EVP_CIPHER *result = 0 ;
15089 
15090   if (!SWIG_Python_UnpackTuple(args, "cast5_ecb", 0, 0, 0)) SWIG_fail;
15091   result = (EVP_CIPHER *)EVP_cast5_ecb();
15092   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15093   return resultobj;
15094 fail:
15095   return NULL;
15096 }
15097 
15098 
_wrap_cast5_cbc(PyObject * self,PyObject * args)15099 SWIGINTERN PyObject *_wrap_cast5_cbc(PyObject *self, PyObject *args) {
15100   PyObject *resultobj = 0;
15101   EVP_CIPHER *result = 0 ;
15102 
15103   if (!SWIG_Python_UnpackTuple(args, "cast5_cbc", 0, 0, 0)) SWIG_fail;
15104   result = (EVP_CIPHER *)EVP_cast5_cbc();
15105   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15106   return resultobj;
15107 fail:
15108   return NULL;
15109 }
15110 
15111 
_wrap_cast5_cfb(PyObject * self,PyObject * args)15112 SWIGINTERN PyObject *_wrap_cast5_cfb(PyObject *self, PyObject *args) {
15113   PyObject *resultobj = 0;
15114   EVP_CIPHER *result = 0 ;
15115 
15116   if (!SWIG_Python_UnpackTuple(args, "cast5_cfb", 0, 0, 0)) SWIG_fail;
15117   result = (EVP_CIPHER *)EVP_cast5_cfb();
15118   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15119   return resultobj;
15120 fail:
15121   return NULL;
15122 }
15123 
15124 
_wrap_cast5_ofb(PyObject * self,PyObject * args)15125 SWIGINTERN PyObject *_wrap_cast5_ofb(PyObject *self, PyObject *args) {
15126   PyObject *resultobj = 0;
15127   EVP_CIPHER *result = 0 ;
15128 
15129   if (!SWIG_Python_UnpackTuple(args, "cast5_ofb", 0, 0, 0)) SWIG_fail;
15130   result = (EVP_CIPHER *)EVP_cast5_ofb();
15131   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15132   return resultobj;
15133 fail:
15134   return NULL;
15135 }
15136 
15137 
_wrap_rc4(PyObject * self,PyObject * args)15138 SWIGINTERN PyObject *_wrap_rc4(PyObject *self, PyObject *args) {
15139   PyObject *resultobj = 0;
15140   EVP_CIPHER *result = 0 ;
15141 
15142   if (!SWIG_Python_UnpackTuple(args, "rc4", 0, 0, 0)) SWIG_fail;
15143   result = (EVP_CIPHER *)EVP_rc4();
15144   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15145   return resultobj;
15146 fail:
15147   return NULL;
15148 }
15149 
15150 
_wrap_rc2_40_cbc(PyObject * self,PyObject * args)15151 SWIGINTERN PyObject *_wrap_rc2_40_cbc(PyObject *self, PyObject *args) {
15152   PyObject *resultobj = 0;
15153   EVP_CIPHER *result = 0 ;
15154 
15155   if (!SWIG_Python_UnpackTuple(args, "rc2_40_cbc", 0, 0, 0)) SWIG_fail;
15156   result = (EVP_CIPHER *)EVP_rc2_40_cbc();
15157   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15158   return resultobj;
15159 fail:
15160   return NULL;
15161 }
15162 
15163 
_wrap_aes_128_ecb(PyObject * self,PyObject * args)15164 SWIGINTERN PyObject *_wrap_aes_128_ecb(PyObject *self, PyObject *args) {
15165   PyObject *resultobj = 0;
15166   EVP_CIPHER *result = 0 ;
15167 
15168   if (!SWIG_Python_UnpackTuple(args, "aes_128_ecb", 0, 0, 0)) SWIG_fail;
15169   result = (EVP_CIPHER *)EVP_aes_128_ecb();
15170   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15171   return resultobj;
15172 fail:
15173   return NULL;
15174 }
15175 
15176 
_wrap_aes_128_cbc(PyObject * self,PyObject * args)15177 SWIGINTERN PyObject *_wrap_aes_128_cbc(PyObject *self, PyObject *args) {
15178   PyObject *resultobj = 0;
15179   EVP_CIPHER *result = 0 ;
15180 
15181   if (!SWIG_Python_UnpackTuple(args, "aes_128_cbc", 0, 0, 0)) SWIG_fail;
15182   result = (EVP_CIPHER *)EVP_aes_128_cbc();
15183   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15184   return resultobj;
15185 fail:
15186   return NULL;
15187 }
15188 
15189 
_wrap_aes_128_cfb(PyObject * self,PyObject * args)15190 SWIGINTERN PyObject *_wrap_aes_128_cfb(PyObject *self, PyObject *args) {
15191   PyObject *resultobj = 0;
15192   EVP_CIPHER *result = 0 ;
15193 
15194   if (!SWIG_Python_UnpackTuple(args, "aes_128_cfb", 0, 0, 0)) SWIG_fail;
15195   result = (EVP_CIPHER *)EVP_aes_128_cfb();
15196   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15197   return resultobj;
15198 fail:
15199   return NULL;
15200 }
15201 
15202 
_wrap_aes_128_ofb(PyObject * self,PyObject * args)15203 SWIGINTERN PyObject *_wrap_aes_128_ofb(PyObject *self, PyObject *args) {
15204   PyObject *resultobj = 0;
15205   EVP_CIPHER *result = 0 ;
15206 
15207   if (!SWIG_Python_UnpackTuple(args, "aes_128_ofb", 0, 0, 0)) SWIG_fail;
15208   result = (EVP_CIPHER *)EVP_aes_128_ofb();
15209   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15210   return resultobj;
15211 fail:
15212   return NULL;
15213 }
15214 
15215 
_wrap_aes_128_ctr(PyObject * self,PyObject * args)15216 SWIGINTERN PyObject *_wrap_aes_128_ctr(PyObject *self, PyObject *args) {
15217   PyObject *resultobj = 0;
15218   EVP_CIPHER *result = 0 ;
15219 
15220   if (!SWIG_Python_UnpackTuple(args, "aes_128_ctr", 0, 0, 0)) SWIG_fail;
15221   result = (EVP_CIPHER *)EVP_aes_128_ctr();
15222   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15223   return resultobj;
15224 fail:
15225   return NULL;
15226 }
15227 
15228 
_wrap_aes_192_ecb(PyObject * self,PyObject * args)15229 SWIGINTERN PyObject *_wrap_aes_192_ecb(PyObject *self, PyObject *args) {
15230   PyObject *resultobj = 0;
15231   EVP_CIPHER *result = 0 ;
15232 
15233   if (!SWIG_Python_UnpackTuple(args, "aes_192_ecb", 0, 0, 0)) SWIG_fail;
15234   result = (EVP_CIPHER *)EVP_aes_192_ecb();
15235   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15236   return resultobj;
15237 fail:
15238   return NULL;
15239 }
15240 
15241 
_wrap_aes_192_cbc(PyObject * self,PyObject * args)15242 SWIGINTERN PyObject *_wrap_aes_192_cbc(PyObject *self, PyObject *args) {
15243   PyObject *resultobj = 0;
15244   EVP_CIPHER *result = 0 ;
15245 
15246   if (!SWIG_Python_UnpackTuple(args, "aes_192_cbc", 0, 0, 0)) SWIG_fail;
15247   result = (EVP_CIPHER *)EVP_aes_192_cbc();
15248   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15249   return resultobj;
15250 fail:
15251   return NULL;
15252 }
15253 
15254 
_wrap_aes_192_cfb(PyObject * self,PyObject * args)15255 SWIGINTERN PyObject *_wrap_aes_192_cfb(PyObject *self, PyObject *args) {
15256   PyObject *resultobj = 0;
15257   EVP_CIPHER *result = 0 ;
15258 
15259   if (!SWIG_Python_UnpackTuple(args, "aes_192_cfb", 0, 0, 0)) SWIG_fail;
15260   result = (EVP_CIPHER *)EVP_aes_192_cfb();
15261   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15262   return resultobj;
15263 fail:
15264   return NULL;
15265 }
15266 
15267 
_wrap_aes_192_ofb(PyObject * self,PyObject * args)15268 SWIGINTERN PyObject *_wrap_aes_192_ofb(PyObject *self, PyObject *args) {
15269   PyObject *resultobj = 0;
15270   EVP_CIPHER *result = 0 ;
15271 
15272   if (!SWIG_Python_UnpackTuple(args, "aes_192_ofb", 0, 0, 0)) SWIG_fail;
15273   result = (EVP_CIPHER *)EVP_aes_192_ofb();
15274   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15275   return resultobj;
15276 fail:
15277   return NULL;
15278 }
15279 
15280 
_wrap_aes_192_ctr(PyObject * self,PyObject * args)15281 SWIGINTERN PyObject *_wrap_aes_192_ctr(PyObject *self, PyObject *args) {
15282   PyObject *resultobj = 0;
15283   EVP_CIPHER *result = 0 ;
15284 
15285   if (!SWIG_Python_UnpackTuple(args, "aes_192_ctr", 0, 0, 0)) SWIG_fail;
15286   result = (EVP_CIPHER *)EVP_aes_192_ctr();
15287   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15288   return resultobj;
15289 fail:
15290   return NULL;
15291 }
15292 
15293 
_wrap_aes_256_ecb(PyObject * self,PyObject * args)15294 SWIGINTERN PyObject *_wrap_aes_256_ecb(PyObject *self, PyObject *args) {
15295   PyObject *resultobj = 0;
15296   EVP_CIPHER *result = 0 ;
15297 
15298   if (!SWIG_Python_UnpackTuple(args, "aes_256_ecb", 0, 0, 0)) SWIG_fail;
15299   result = (EVP_CIPHER *)EVP_aes_256_ecb();
15300   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15301   return resultobj;
15302 fail:
15303   return NULL;
15304 }
15305 
15306 
_wrap_aes_256_cbc(PyObject * self,PyObject * args)15307 SWIGINTERN PyObject *_wrap_aes_256_cbc(PyObject *self, PyObject *args) {
15308   PyObject *resultobj = 0;
15309   EVP_CIPHER *result = 0 ;
15310 
15311   if (!SWIG_Python_UnpackTuple(args, "aes_256_cbc", 0, 0, 0)) SWIG_fail;
15312   result = (EVP_CIPHER *)EVP_aes_256_cbc();
15313   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15314   return resultobj;
15315 fail:
15316   return NULL;
15317 }
15318 
15319 
_wrap_aes_256_cfb(PyObject * self,PyObject * args)15320 SWIGINTERN PyObject *_wrap_aes_256_cfb(PyObject *self, PyObject *args) {
15321   PyObject *resultobj = 0;
15322   EVP_CIPHER *result = 0 ;
15323 
15324   if (!SWIG_Python_UnpackTuple(args, "aes_256_cfb", 0, 0, 0)) SWIG_fail;
15325   result = (EVP_CIPHER *)EVP_aes_256_cfb();
15326   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15327   return resultobj;
15328 fail:
15329   return NULL;
15330 }
15331 
15332 
_wrap_aes_256_ofb(PyObject * self,PyObject * args)15333 SWIGINTERN PyObject *_wrap_aes_256_ofb(PyObject *self, PyObject *args) {
15334   PyObject *resultobj = 0;
15335   EVP_CIPHER *result = 0 ;
15336 
15337   if (!SWIG_Python_UnpackTuple(args, "aes_256_ofb", 0, 0, 0)) SWIG_fail;
15338   result = (EVP_CIPHER *)EVP_aes_256_ofb();
15339   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15340   return resultobj;
15341 fail:
15342   return NULL;
15343 }
15344 
15345 
_wrap_aes_256_ctr(PyObject * self,PyObject * args)15346 SWIGINTERN PyObject *_wrap_aes_256_ctr(PyObject *self, PyObject *args) {
15347   PyObject *resultobj = 0;
15348   EVP_CIPHER *result = 0 ;
15349 
15350   if (!SWIG_Python_UnpackTuple(args, "aes_256_ctr", 0, 0, 0)) SWIG_fail;
15351   result = (EVP_CIPHER *)EVP_aes_256_ctr();
15352   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
15353   return resultobj;
15354 fail:
15355   return NULL;
15356 }
15357 
15358 
_wrap_cipher_set_padding(PyObject * self,PyObject * args)15359 SWIGINTERN PyObject *_wrap_cipher_set_padding(PyObject *self, PyObject *args) {
15360   PyObject *resultobj = 0;
15361   EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ;
15362   int arg2 ;
15363   void *argp1 = 0 ;
15364   int res1 = 0 ;
15365   int val2 ;
15366   int ecode2 = 0 ;
15367   PyObject *swig_obj[2] ;
15368   int result;
15369 
15370   if (!SWIG_Python_UnpackTuple(args, "cipher_set_padding", 2, 2, swig_obj)) SWIG_fail;
15371   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 |  0 );
15372   if (!SWIG_IsOK(res1)) {
15373     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_set_padding" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'");
15374   }
15375   arg1 = (EVP_CIPHER_CTX *)(argp1);
15376   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
15377   if (!SWIG_IsOK(ecode2)) {
15378     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "cipher_set_padding" "', argument " "2"" of type '" "int""'");
15379   }
15380   arg2 = (int)(val2);
15381   {
15382     if (!arg1) {
15383       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15384     }
15385   }
15386   result = (int)EVP_CIPHER_CTX_set_padding(arg1,arg2);
15387   {
15388     resultobj=PyLong_FromLong(result);
15389     if (PyErr_Occurred()) SWIG_fail;
15390   }
15391   return resultobj;
15392 fail:
15393   return NULL;
15394 }
15395 
15396 
_wrap_pkey_free(PyObject * self,PyObject * args)15397 SWIGINTERN PyObject *_wrap_pkey_free(PyObject *self, PyObject *args) {
15398   PyObject *resultobj = 0;
15399   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
15400   void *argp1 = 0 ;
15401   int res1 = 0 ;
15402   PyObject *swig_obj[1] ;
15403 
15404   if (!args) SWIG_fail;
15405   swig_obj[0] = args;
15406   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
15407   if (!SWIG_IsOK(res1)) {
15408     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_free" "', argument " "1"" of type '" "EVP_PKEY *""'");
15409   }
15410   arg1 = (EVP_PKEY *)(argp1);
15411   {
15412     if (!arg1) {
15413       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15414     }
15415   }
15416   EVP_PKEY_free(arg1);
15417   resultobj = SWIG_Py_Void();
15418   return resultobj;
15419 fail:
15420   return NULL;
15421 }
15422 
15423 
_wrap_pkey_assign(PyObject * self,PyObject * args)15424 SWIGINTERN PyObject *_wrap_pkey_assign(PyObject *self, PyObject *args) {
15425   PyObject *resultobj = 0;
15426   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
15427   int arg2 ;
15428   char *arg3 = (char *) 0 ;
15429   void *argp1 = 0 ;
15430   int res1 = 0 ;
15431   int val2 ;
15432   int ecode2 = 0 ;
15433   int res3 ;
15434   char *buf3 = 0 ;
15435   int alloc3 = 0 ;
15436   PyObject *swig_obj[3] ;
15437   int result;
15438 
15439   if (!SWIG_Python_UnpackTuple(args, "pkey_assign", 3, 3, swig_obj)) SWIG_fail;
15440   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
15441   if (!SWIG_IsOK(res1)) {
15442     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_assign" "', argument " "1"" of type '" "EVP_PKEY *""'");
15443   }
15444   arg1 = (EVP_PKEY *)(argp1);
15445   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
15446   if (!SWIG_IsOK(ecode2)) {
15447     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "pkey_assign" "', argument " "2"" of type '" "int""'");
15448   }
15449   arg2 = (int)(val2);
15450   res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3);
15451   if (!SWIG_IsOK(res3)) {
15452     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkey_assign" "', argument " "3"" of type '" "char *""'");
15453   }
15454   arg3 = (char *)(buf3);
15455   {
15456     if (!arg1) {
15457       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15458     }
15459   }
15460   result = (int)EVP_PKEY_assign(arg1,arg2,arg3);
15461   {
15462     resultobj=PyLong_FromLong(result);
15463     if (PyErr_Occurred()) SWIG_fail;
15464   }
15465   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
15466   return resultobj;
15467 fail:
15468   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
15469   return NULL;
15470 }
15471 
15472 
_wrap_pkey_assign_ec(PyObject * self,PyObject * args)15473 SWIGINTERN PyObject *_wrap_pkey_assign_ec(PyObject *self, PyObject *args) {
15474   PyObject *resultobj = 0;
15475   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
15476   EC_KEY *arg2 = (EC_KEY *) 0 ;
15477   void *argp1 = 0 ;
15478   int res1 = 0 ;
15479   void *argp2 = 0 ;
15480   int res2 = 0 ;
15481   PyObject *swig_obj[2] ;
15482   int result;
15483 
15484   if (!SWIG_Python_UnpackTuple(args, "pkey_assign_ec", 2, 2, swig_obj)) SWIG_fail;
15485   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
15486   if (!SWIG_IsOK(res1)) {
15487     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_assign_ec" "', argument " "1"" of type '" "EVP_PKEY *""'");
15488   }
15489   arg1 = (EVP_PKEY *)(argp1);
15490   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EC_KEY, 0 |  0 );
15491   if (!SWIG_IsOK(res2)) {
15492     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkey_assign_ec" "', argument " "2"" of type '" "EC_KEY *""'");
15493   }
15494   arg2 = (EC_KEY *)(argp2);
15495   {
15496     if (!arg1) {
15497       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15498     }
15499   }
15500   result = (int)EVP_PKEY_assign_EC_KEY(arg1,arg2);
15501   {
15502     resultobj=PyLong_FromLong(result);
15503     if (PyErr_Occurred()) SWIG_fail;
15504   }
15505   return resultobj;
15506 fail:
15507   return NULL;
15508 }
15509 
15510 
_wrap_pkey_set1_rsa(PyObject * self,PyObject * args)15511 SWIGINTERN PyObject *_wrap_pkey_set1_rsa(PyObject *self, PyObject *args) {
15512   PyObject *resultobj = 0;
15513   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
15514   RSA *arg2 = (RSA *) 0 ;
15515   void *argp1 = 0 ;
15516   int res1 = 0 ;
15517   void *argp2 = 0 ;
15518   int res2 = 0 ;
15519   PyObject *swig_obj[2] ;
15520   int result;
15521 
15522   if (!SWIG_Python_UnpackTuple(args, "pkey_set1_rsa", 2, 2, swig_obj)) SWIG_fail;
15523   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
15524   if (!SWIG_IsOK(res1)) {
15525     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_set1_rsa" "', argument " "1"" of type '" "EVP_PKEY *""'");
15526   }
15527   arg1 = (EVP_PKEY *)(argp1);
15528   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_RSA, 0 |  0 );
15529   if (!SWIG_IsOK(res2)) {
15530     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkey_set1_rsa" "', argument " "2"" of type '" "RSA *""'");
15531   }
15532   arg2 = (RSA *)(argp2);
15533   {
15534     if (!arg1) {
15535       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15536     }
15537   }
15538   {
15539     if (!arg2) {
15540       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15541     }
15542   }
15543   result = (int)EVP_PKEY_set1_RSA(arg1,arg2);
15544   {
15545     resultobj=PyLong_FromLong(result);
15546     if (PyErr_Occurred()) SWIG_fail;
15547   }
15548   return resultobj;
15549 fail:
15550   return NULL;
15551 }
15552 
15553 
_wrap_sign_init(PyObject * self,PyObject * args)15554 SWIGINTERN PyObject *_wrap_sign_init(PyObject *self, PyObject *args) {
15555   PyObject *resultobj = 0;
15556   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
15557   EVP_MD *arg2 = (EVP_MD *) 0 ;
15558   void *argp1 = 0 ;
15559   int res1 = 0 ;
15560   void *argp2 = 0 ;
15561   int res2 = 0 ;
15562   PyObject *swig_obj[2] ;
15563   int result;
15564 
15565   if (!SWIG_Python_UnpackTuple(args, "sign_init", 2, 2, swig_obj)) SWIG_fail;
15566   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
15567   if (!SWIG_IsOK(res1)) {
15568     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sign_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
15569   }
15570   arg1 = (EVP_MD_CTX *)(argp1);
15571   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_MD, 0 |  0 );
15572   if (!SWIG_IsOK(res2)) {
15573     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sign_init" "', argument " "2"" of type '" "EVP_MD const *""'");
15574   }
15575   arg2 = (EVP_MD *)(argp2);
15576   {
15577     if (!arg1) {
15578       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15579     }
15580   }
15581   {
15582     if (!arg2) {
15583       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15584     }
15585   }
15586   result = (int)EVP_SignInit(arg1,(EVP_MD const *)arg2);
15587   {
15588     resultobj=PyLong_FromLong(result);
15589     if (PyErr_Occurred()) SWIG_fail;
15590   }
15591   return resultobj;
15592 fail:
15593   return NULL;
15594 }
15595 
15596 
_wrap_verify_init(PyObject * self,PyObject * args)15597 SWIGINTERN PyObject *_wrap_verify_init(PyObject *self, PyObject *args) {
15598   PyObject *resultobj = 0;
15599   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
15600   EVP_MD *arg2 = (EVP_MD *) 0 ;
15601   void *argp1 = 0 ;
15602   int res1 = 0 ;
15603   void *argp2 = 0 ;
15604   int res2 = 0 ;
15605   PyObject *swig_obj[2] ;
15606   int result;
15607 
15608   if (!SWIG_Python_UnpackTuple(args, "verify_init", 2, 2, swig_obj)) SWIG_fail;
15609   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
15610   if (!SWIG_IsOK(res1)) {
15611     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "verify_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
15612   }
15613   arg1 = (EVP_MD_CTX *)(argp1);
15614   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_MD, 0 |  0 );
15615   if (!SWIG_IsOK(res2)) {
15616     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "verify_init" "', argument " "2"" of type '" "EVP_MD const *""'");
15617   }
15618   arg2 = (EVP_MD *)(argp2);
15619   {
15620     if (!arg1) {
15621       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15622     }
15623   }
15624   {
15625     if (!arg2) {
15626       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15627     }
15628   }
15629   result = (int)EVP_VerifyInit(arg1,(EVP_MD const *)arg2);
15630   {
15631     resultobj=PyLong_FromLong(result);
15632     if (PyErr_Occurred()) SWIG_fail;
15633   }
15634   return resultobj;
15635 fail:
15636   return NULL;
15637 }
15638 
15639 
_wrap_digest_sign_init__SWIG_0(PyObject * self,Py_ssize_t nobjs,PyObject ** swig_obj)15640 SWIGINTERN PyObject *_wrap_digest_sign_init__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
15641   PyObject *resultobj = 0;
15642   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
15643   EVP_PKEY_CTX **arg2 = (EVP_PKEY_CTX **) 0 ;
15644   EVP_MD *arg3 = (EVP_MD *) 0 ;
15645   ENGINE *arg4 = (ENGINE *) 0 ;
15646   EVP_PKEY *arg5 = (EVP_PKEY *) 0 ;
15647   void *argp1 = 0 ;
15648   int res1 = 0 ;
15649   void *argp2 = 0 ;
15650   int res2 = 0 ;
15651   void *argp3 = 0 ;
15652   int res3 = 0 ;
15653   void *argp4 = 0 ;
15654   int res4 = 0 ;
15655   void *argp5 = 0 ;
15656   int res5 = 0 ;
15657   int result;
15658 
15659   if ((nobjs < 5) || (nobjs > 5)) SWIG_fail;
15660   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
15661   if (!SWIG_IsOK(res1)) {
15662     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_sign_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
15663   }
15664   arg1 = (EVP_MD_CTX *)(argp1);
15665   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_EVP_PKEY_CTX, 0 |  0 );
15666   if (!SWIG_IsOK(res2)) {
15667     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_sign_init" "', argument " "2"" of type '" "EVP_PKEY_CTX **""'");
15668   }
15669   arg2 = (EVP_PKEY_CTX **)(argp2);
15670   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_MD, 0 |  0 );
15671   if (!SWIG_IsOK(res3)) {
15672     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "digest_sign_init" "', argument " "3"" of type '" "EVP_MD const *""'");
15673   }
15674   arg3 = (EVP_MD *)(argp3);
15675   res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_ENGINE, 0 |  0 );
15676   if (!SWIG_IsOK(res4)) {
15677     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "digest_sign_init" "', argument " "4"" of type '" "ENGINE *""'");
15678   }
15679   arg4 = (ENGINE *)(argp4);
15680   res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
15681   if (!SWIG_IsOK(res5)) {
15682     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "digest_sign_init" "', argument " "5"" of type '" "EVP_PKEY *""'");
15683   }
15684   arg5 = (EVP_PKEY *)(argp5);
15685   {
15686     if (!arg1) {
15687       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15688     }
15689   }
15690   {
15691     if (!arg3) {
15692       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15693     }
15694   }
15695   {
15696     if (!arg5) {
15697       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15698     }
15699   }
15700   result = (int)EVP_DigestSignInit(arg1,arg2,(EVP_MD const *)arg3,arg4,arg5);
15701   {
15702     resultobj=PyLong_FromLong(result);
15703     if (PyErr_Occurred()) SWIG_fail;
15704   }
15705   return resultobj;
15706 fail:
15707   return NULL;
15708 }
15709 
15710 
_wrap_digest_verify_init__SWIG_0(PyObject * self,Py_ssize_t nobjs,PyObject ** swig_obj)15711 SWIGINTERN PyObject *_wrap_digest_verify_init__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
15712   PyObject *resultobj = 0;
15713   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
15714   EVP_PKEY_CTX **arg2 = (EVP_PKEY_CTX **) 0 ;
15715   EVP_MD *arg3 = (EVP_MD *) 0 ;
15716   ENGINE *arg4 = (ENGINE *) 0 ;
15717   EVP_PKEY *arg5 = (EVP_PKEY *) 0 ;
15718   void *argp1 = 0 ;
15719   int res1 = 0 ;
15720   void *argp2 = 0 ;
15721   int res2 = 0 ;
15722   void *argp3 = 0 ;
15723   int res3 = 0 ;
15724   void *argp4 = 0 ;
15725   int res4 = 0 ;
15726   void *argp5 = 0 ;
15727   int res5 = 0 ;
15728   int result;
15729 
15730   if ((nobjs < 5) || (nobjs > 5)) SWIG_fail;
15731   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
15732   if (!SWIG_IsOK(res1)) {
15733     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_verify_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
15734   }
15735   arg1 = (EVP_MD_CTX *)(argp1);
15736   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_EVP_PKEY_CTX, 0 |  0 );
15737   if (!SWIG_IsOK(res2)) {
15738     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_verify_init" "', argument " "2"" of type '" "EVP_PKEY_CTX **""'");
15739   }
15740   arg2 = (EVP_PKEY_CTX **)(argp2);
15741   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_MD, 0 |  0 );
15742   if (!SWIG_IsOK(res3)) {
15743     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "digest_verify_init" "', argument " "3"" of type '" "EVP_MD const *""'");
15744   }
15745   arg3 = (EVP_MD *)(argp3);
15746   res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_ENGINE, 0 |  0 );
15747   if (!SWIG_IsOK(res4)) {
15748     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "digest_verify_init" "', argument " "4"" of type '" "ENGINE *""'");
15749   }
15750   arg4 = (ENGINE *)(argp4);
15751   res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
15752   if (!SWIG_IsOK(res5)) {
15753     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "digest_verify_init" "', argument " "5"" of type '" "EVP_PKEY *""'");
15754   }
15755   arg5 = (EVP_PKEY *)(argp5);
15756   {
15757     if (!arg1) {
15758       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15759     }
15760   }
15761   {
15762     if (!arg3) {
15763       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15764     }
15765   }
15766   {
15767     if (!arg5) {
15768       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15769     }
15770   }
15771   result = (int)EVP_DigestVerifyInit(arg1,arg2,(EVP_MD const *)arg3,arg4,arg5);
15772   {
15773     resultobj=PyLong_FromLong(result);
15774     if (PyErr_Occurred()) SWIG_fail;
15775   }
15776   return resultobj;
15777 fail:
15778   return NULL;
15779 }
15780 
15781 
_wrap_pkey_size(PyObject * self,PyObject * args)15782 SWIGINTERN PyObject *_wrap_pkey_size(PyObject *self, PyObject *args) {
15783   PyObject *resultobj = 0;
15784   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
15785   void *argp1 = 0 ;
15786   int res1 = 0 ;
15787   PyObject *swig_obj[1] ;
15788   int result;
15789 
15790   if (!args) SWIG_fail;
15791   swig_obj[0] = args;
15792   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
15793   if (!SWIG_IsOK(res1)) {
15794     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_size" "', argument " "1"" of type '" "EVP_PKEY *""'");
15795   }
15796   arg1 = (EVP_PKEY *)(argp1);
15797   {
15798     if (!arg1) {
15799       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15800     }
15801   }
15802   result = (int)EVP_PKEY_size(arg1);
15803   {
15804     resultobj=PyLong_FromLong(result);
15805     if (PyErr_Occurred()) SWIG_fail;
15806   }
15807   return resultobj;
15808 fail:
15809   return NULL;
15810 }
15811 
15812 
Swig_var__evp_err_set(PyObject * _val)15813 SWIGINTERN int Swig_var__evp_err_set(PyObject *_val) {
15814   {
15815     void *argp = 0;
15816     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
15817     if (!SWIG_IsOK(res)) {
15818       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_evp_err""' of type '""PyObject *""'");
15819     }
15820     _evp_err = (PyObject *)(argp);
15821   }
15822   return 0;
15823 fail:
15824   return 1;
15825 }
15826 
15827 
Swig_var__evp_err_get(void)15828 SWIGINTERN PyObject *Swig_var__evp_err_get(void) {
15829   PyObject *pyobj = 0;
15830   PyObject *self = 0;
15831 
15832   (void)self;
15833   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_evp_err), SWIGTYPE_p_PyObject,  0 );
15834   return pyobj;
15835 }
15836 
15837 
_wrap_evp_init(PyObject * self,PyObject * args)15838 SWIGINTERN PyObject *_wrap_evp_init(PyObject *self, PyObject *args) {
15839   PyObject *resultobj = 0;
15840   PyObject *arg1 = (PyObject *) 0 ;
15841   PyObject *swig_obj[1] ;
15842 
15843   if (!args) SWIG_fail;
15844   swig_obj[0] = args;
15845   {
15846     arg1=swig_obj[0];
15847   }
15848   evp_init(arg1);
15849   resultobj = SWIG_Py_Void();
15850   return resultobj;
15851 fail:
15852   return NULL;
15853 }
15854 
15855 
_wrap_pkey_get1_rsa(PyObject * self,PyObject * args)15856 SWIGINTERN PyObject *_wrap_pkey_get1_rsa(PyObject *self, PyObject *args) {
15857   PyObject *resultobj = 0;
15858   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
15859   void *argp1 = 0 ;
15860   int res1 = 0 ;
15861   PyObject *swig_obj[1] ;
15862   RSA *result = 0 ;
15863 
15864   if (!args) SWIG_fail;
15865   swig_obj[0] = args;
15866   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
15867   if (!SWIG_IsOK(res1)) {
15868     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_get1_rsa" "', argument " "1"" of type '" "EVP_PKEY *""'");
15869   }
15870   arg1 = (EVP_PKEY *)(argp1);
15871   {
15872     if (!arg1) {
15873       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15874     }
15875   }
15876   result = (RSA *)pkey_get1_rsa(arg1);
15877   {
15878     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
15879 
15880     if (result != NULL)
15881     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_RSA, 0);
15882     else {
15883       resultobj = NULL;
15884     }
15885   }
15886   return resultobj;
15887 fail:
15888   return NULL;
15889 }
15890 
15891 
_wrap_pkcs5_pbkdf2_hmac_sha1(PyObject * self,PyObject * args)15892 SWIGINTERN PyObject *_wrap_pkcs5_pbkdf2_hmac_sha1(PyObject *self, PyObject *args) {
15893   PyObject *resultobj = 0;
15894   PyObject *arg1 = (PyObject *) 0 ;
15895   PyObject *arg2 = (PyObject *) 0 ;
15896   int arg3 ;
15897   int arg4 ;
15898   int val3 ;
15899   int ecode3 = 0 ;
15900   int val4 ;
15901   int ecode4 = 0 ;
15902   PyObject *swig_obj[4] ;
15903   PyObject *result = 0 ;
15904 
15905   if (!SWIG_Python_UnpackTuple(args, "pkcs5_pbkdf2_hmac_sha1", 4, 4, swig_obj)) SWIG_fail;
15906   {
15907     arg1=swig_obj[0];
15908   }
15909   {
15910     arg2=swig_obj[1];
15911   }
15912   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
15913   if (!SWIG_IsOK(ecode3)) {
15914     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pkcs5_pbkdf2_hmac_sha1" "', argument " "3"" of type '" "int""'");
15915   }
15916   arg3 = (int)(val3);
15917   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
15918   if (!SWIG_IsOK(ecode4)) {
15919     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pkcs5_pbkdf2_hmac_sha1" "', argument " "4"" of type '" "int""'");
15920   }
15921   arg4 = (int)(val4);
15922   result = (PyObject *)pkcs5_pbkdf2_hmac_sha1(arg1,arg2,arg3,arg4);
15923   {
15924     resultobj=result;
15925   }
15926   return resultobj;
15927 fail:
15928   return NULL;
15929 }
15930 
15931 
_wrap_md_ctx_new(PyObject * self,PyObject * args)15932 SWIGINTERN PyObject *_wrap_md_ctx_new(PyObject *self, PyObject *args) {
15933   PyObject *resultobj = 0;
15934   EVP_MD_CTX *result = 0 ;
15935 
15936   if (!SWIG_Python_UnpackTuple(args, "md_ctx_new", 0, 0, 0)) SWIG_fail;
15937   result = (EVP_MD_CTX *)md_ctx_new();
15938   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
15939   return resultobj;
15940 fail:
15941   return NULL;
15942 }
15943 
15944 
_wrap_md_ctx_free(PyObject * self,PyObject * args)15945 SWIGINTERN PyObject *_wrap_md_ctx_free(PyObject *self, PyObject *args) {
15946   PyObject *resultobj = 0;
15947   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
15948   void *argp1 = 0 ;
15949   int res1 = 0 ;
15950   PyObject *swig_obj[1] ;
15951 
15952   if (!args) SWIG_fail;
15953   swig_obj[0] = args;
15954   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
15955   if (!SWIG_IsOK(res1)) {
15956     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "md_ctx_free" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
15957   }
15958   arg1 = (EVP_MD_CTX *)(argp1);
15959   {
15960     if (!arg1) {
15961       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15962     }
15963   }
15964   md_ctx_free(arg1);
15965   resultobj = SWIG_Py_Void();
15966   return resultobj;
15967 fail:
15968   return NULL;
15969 }
15970 
15971 
_wrap_digest_update(PyObject * self,PyObject * args)15972 SWIGINTERN PyObject *_wrap_digest_update(PyObject *self, PyObject *args) {
15973   PyObject *resultobj = 0;
15974   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
15975   PyObject *arg2 = (PyObject *) 0 ;
15976   void *argp1 = 0 ;
15977   int res1 = 0 ;
15978   PyObject *swig_obj[2] ;
15979   int result;
15980 
15981   if (!SWIG_Python_UnpackTuple(args, "digest_update", 2, 2, swig_obj)) SWIG_fail;
15982   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
15983   if (!SWIG_IsOK(res1)) {
15984     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
15985   }
15986   arg1 = (EVP_MD_CTX *)(argp1);
15987   {
15988     arg2=swig_obj[1];
15989   }
15990   {
15991     if (!arg1) {
15992       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
15993     }
15994   }
15995   result = (int)digest_update(arg1,arg2);
15996   {
15997     resultobj=PyLong_FromLong(result);
15998     if (PyErr_Occurred()) SWIG_fail;
15999   }
16000   return resultobj;
16001 fail:
16002   return NULL;
16003 }
16004 
16005 
_wrap_digest_final(PyObject * self,PyObject * args)16006 SWIGINTERN PyObject *_wrap_digest_final(PyObject *self, PyObject *args) {
16007   PyObject *resultobj = 0;
16008   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16009   void *argp1 = 0 ;
16010   int res1 = 0 ;
16011   PyObject *swig_obj[1] ;
16012   PyObject *result = 0 ;
16013 
16014   if (!args) SWIG_fail;
16015   swig_obj[0] = args;
16016   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16017   if (!SWIG_IsOK(res1)) {
16018     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16019   }
16020   arg1 = (EVP_MD_CTX *)(argp1);
16021   {
16022     if (!arg1) {
16023       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16024     }
16025   }
16026   result = (PyObject *)digest_final(arg1);
16027   {
16028     resultobj=result;
16029   }
16030   return resultobj;
16031 fail:
16032   return NULL;
16033 }
16034 
16035 
_wrap_hmac_ctx_new(PyObject * self,PyObject * args)16036 SWIGINTERN PyObject *_wrap_hmac_ctx_new(PyObject *self, PyObject *args) {
16037   PyObject *resultobj = 0;
16038   HMAC_CTX *result = 0 ;
16039 
16040   if (!SWIG_Python_UnpackTuple(args, "hmac_ctx_new", 0, 0, 0)) SWIG_fail;
16041   result = (HMAC_CTX *)hmac_ctx_new();
16042   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_HMAC_CTX, 0 |  0 );
16043   return resultobj;
16044 fail:
16045   return NULL;
16046 }
16047 
16048 
_wrap_hmac_ctx_free(PyObject * self,PyObject * args)16049 SWIGINTERN PyObject *_wrap_hmac_ctx_free(PyObject *self, PyObject *args) {
16050   PyObject *resultobj = 0;
16051   HMAC_CTX *arg1 = (HMAC_CTX *) 0 ;
16052   void *argp1 = 0 ;
16053   int res1 = 0 ;
16054   PyObject *swig_obj[1] ;
16055 
16056   if (!args) SWIG_fail;
16057   swig_obj[0] = args;
16058   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_HMAC_CTX, 0 |  0 );
16059   if (!SWIG_IsOK(res1)) {
16060     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_ctx_free" "', argument " "1"" of type '" "HMAC_CTX *""'");
16061   }
16062   arg1 = (HMAC_CTX *)(argp1);
16063   {
16064     if (!arg1) {
16065       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16066     }
16067   }
16068   hmac_ctx_free(arg1);
16069   resultobj = SWIG_Py_Void();
16070   return resultobj;
16071 fail:
16072   return NULL;
16073 }
16074 
16075 
_wrap_hmac_init(PyObject * self,PyObject * args)16076 SWIGINTERN PyObject *_wrap_hmac_init(PyObject *self, PyObject *args) {
16077   PyObject *resultobj = 0;
16078   HMAC_CTX *arg1 = (HMAC_CTX *) 0 ;
16079   PyObject *arg2 = (PyObject *) 0 ;
16080   EVP_MD *arg3 = (EVP_MD *) 0 ;
16081   void *argp1 = 0 ;
16082   int res1 = 0 ;
16083   void *argp3 = 0 ;
16084   int res3 = 0 ;
16085   PyObject *swig_obj[3] ;
16086   PyObject *result = 0 ;
16087 
16088   if (!SWIG_Python_UnpackTuple(args, "hmac_init", 3, 3, swig_obj)) SWIG_fail;
16089   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_HMAC_CTX, 0 |  0 );
16090   if (!SWIG_IsOK(res1)) {
16091     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_init" "', argument " "1"" of type '" "HMAC_CTX *""'");
16092   }
16093   arg1 = (HMAC_CTX *)(argp1);
16094   {
16095     arg2=swig_obj[1];
16096   }
16097   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_MD, 0 |  0 );
16098   if (!SWIG_IsOK(res3)) {
16099     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hmac_init" "', argument " "3"" of type '" "EVP_MD const *""'");
16100   }
16101   arg3 = (EVP_MD *)(argp3);
16102   {
16103     if (!arg1) {
16104       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16105     }
16106   }
16107   {
16108     if (!arg3) {
16109       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16110     }
16111   }
16112   result = (PyObject *)hmac_init(arg1,arg2,(EVP_MD const *)arg3);
16113   {
16114     resultobj=result;
16115   }
16116   return resultobj;
16117 fail:
16118   return NULL;
16119 }
16120 
16121 
_wrap_hmac_update(PyObject * self,PyObject * args)16122 SWIGINTERN PyObject *_wrap_hmac_update(PyObject *self, PyObject *args) {
16123   PyObject *resultobj = 0;
16124   HMAC_CTX *arg1 = (HMAC_CTX *) 0 ;
16125   PyObject *arg2 = (PyObject *) 0 ;
16126   void *argp1 = 0 ;
16127   int res1 = 0 ;
16128   PyObject *swig_obj[2] ;
16129   PyObject *result = 0 ;
16130 
16131   if (!SWIG_Python_UnpackTuple(args, "hmac_update", 2, 2, swig_obj)) SWIG_fail;
16132   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_HMAC_CTX, 0 |  0 );
16133   if (!SWIG_IsOK(res1)) {
16134     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_update" "', argument " "1"" of type '" "HMAC_CTX *""'");
16135   }
16136   arg1 = (HMAC_CTX *)(argp1);
16137   {
16138     arg2=swig_obj[1];
16139   }
16140   {
16141     if (!arg1) {
16142       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16143     }
16144   }
16145   result = (PyObject *)hmac_update(arg1,arg2);
16146   {
16147     resultobj=result;
16148   }
16149   return resultobj;
16150 fail:
16151   return NULL;
16152 }
16153 
16154 
_wrap_hmac_final(PyObject * self,PyObject * args)16155 SWIGINTERN PyObject *_wrap_hmac_final(PyObject *self, PyObject *args) {
16156   PyObject *resultobj = 0;
16157   HMAC_CTX *arg1 = (HMAC_CTX *) 0 ;
16158   void *argp1 = 0 ;
16159   int res1 = 0 ;
16160   PyObject *swig_obj[1] ;
16161   PyObject *result = 0 ;
16162 
16163   if (!args) SWIG_fail;
16164   swig_obj[0] = args;
16165   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_HMAC_CTX, 0 |  0 );
16166   if (!SWIG_IsOK(res1)) {
16167     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "hmac_final" "', argument " "1"" of type '" "HMAC_CTX *""'");
16168   }
16169   arg1 = (HMAC_CTX *)(argp1);
16170   {
16171     if (!arg1) {
16172       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16173     }
16174   }
16175   result = (PyObject *)hmac_final(arg1);
16176   {
16177     resultobj=result;
16178   }
16179   return resultobj;
16180 fail:
16181   return NULL;
16182 }
16183 
16184 
_wrap_hmac(PyObject * self,PyObject * args)16185 SWIGINTERN PyObject *_wrap_hmac(PyObject *self, PyObject *args) {
16186   PyObject *resultobj = 0;
16187   PyObject *arg1 = (PyObject *) 0 ;
16188   PyObject *arg2 = (PyObject *) 0 ;
16189   EVP_MD *arg3 = (EVP_MD *) 0 ;
16190   void *argp3 = 0 ;
16191   int res3 = 0 ;
16192   PyObject *swig_obj[3] ;
16193   PyObject *result = 0 ;
16194 
16195   if (!SWIG_Python_UnpackTuple(args, "hmac", 3, 3, swig_obj)) SWIG_fail;
16196   {
16197     arg1=swig_obj[0];
16198   }
16199   {
16200     arg2=swig_obj[1];
16201   }
16202   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_MD, 0 |  0 );
16203   if (!SWIG_IsOK(res3)) {
16204     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "hmac" "', argument " "3"" of type '" "EVP_MD const *""'");
16205   }
16206   arg3 = (EVP_MD *)(argp3);
16207   {
16208     if (!arg3) {
16209       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16210     }
16211   }
16212   result = (PyObject *)hmac(arg1,arg2,(EVP_MD const *)arg3);
16213   {
16214     resultobj=result;
16215   }
16216   return resultobj;
16217 fail:
16218   return NULL;
16219 }
16220 
16221 
_wrap_cipher_ctx_new(PyObject * self,PyObject * args)16222 SWIGINTERN PyObject *_wrap_cipher_ctx_new(PyObject *self, PyObject *args) {
16223   PyObject *resultobj = 0;
16224   EVP_CIPHER_CTX *result = 0 ;
16225 
16226   if (!SWIG_Python_UnpackTuple(args, "cipher_ctx_new", 0, 0, 0)) SWIG_fail;
16227   result = (EVP_CIPHER_CTX *)cipher_ctx_new();
16228   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_CIPHER_CTX, 0 |  0 );
16229   return resultobj;
16230 fail:
16231   return NULL;
16232 }
16233 
16234 
_wrap_cipher_ctx_free(PyObject * self,PyObject * args)16235 SWIGINTERN PyObject *_wrap_cipher_ctx_free(PyObject *self, PyObject *args) {
16236   PyObject *resultobj = 0;
16237   EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ;
16238   void *argp1 = 0 ;
16239   int res1 = 0 ;
16240   PyObject *swig_obj[1] ;
16241 
16242   if (!args) SWIG_fail;
16243   swig_obj[0] = args;
16244   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 |  0 );
16245   if (!SWIG_IsOK(res1)) {
16246     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_ctx_free" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'");
16247   }
16248   arg1 = (EVP_CIPHER_CTX *)(argp1);
16249   {
16250     if (!arg1) {
16251       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16252     }
16253   }
16254   cipher_ctx_free(arg1);
16255   resultobj = SWIG_Py_Void();
16256   return resultobj;
16257 fail:
16258   return NULL;
16259 }
16260 
16261 
_wrap_bytes_to_key(PyObject * self,PyObject * args)16262 SWIGINTERN PyObject *_wrap_bytes_to_key(PyObject *self, PyObject *args) {
16263   PyObject *resultobj = 0;
16264   EVP_CIPHER *arg1 = (EVP_CIPHER *) 0 ;
16265   EVP_MD *arg2 = (EVP_MD *) 0 ;
16266   PyObject *arg3 = (PyObject *) 0 ;
16267   PyObject *arg4 = (PyObject *) 0 ;
16268   PyObject *arg5 = (PyObject *) 0 ;
16269   int arg6 ;
16270   void *argp1 = 0 ;
16271   int res1 = 0 ;
16272   void *argp2 = 0 ;
16273   int res2 = 0 ;
16274   int val6 ;
16275   int ecode6 = 0 ;
16276   PyObject *swig_obj[6] ;
16277   PyObject *result = 0 ;
16278 
16279   if (!SWIG_Python_UnpackTuple(args, "bytes_to_key", 6, 6, swig_obj)) SWIG_fail;
16280   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
16281   if (!SWIG_IsOK(res1)) {
16282     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bytes_to_key" "', argument " "1"" of type '" "EVP_CIPHER const *""'");
16283   }
16284   arg1 = (EVP_CIPHER *)(argp1);
16285   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_MD, 0 |  0 );
16286   if (!SWIG_IsOK(res2)) {
16287     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bytes_to_key" "', argument " "2"" of type '" "EVP_MD *""'");
16288   }
16289   arg2 = (EVP_MD *)(argp2);
16290   {
16291     arg3=swig_obj[2];
16292   }
16293   {
16294     arg4=swig_obj[3];
16295   }
16296   {
16297     arg5=swig_obj[4];
16298   }
16299   ecode6 = SWIG_AsVal_int(swig_obj[5], &val6);
16300   if (!SWIG_IsOK(ecode6)) {
16301     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "bytes_to_key" "', argument " "6"" of type '" "int""'");
16302   }
16303   arg6 = (int)(val6);
16304   {
16305     if (!arg1) {
16306       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16307     }
16308   }
16309   {
16310     if (!arg2) {
16311       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16312     }
16313   }
16314   result = (PyObject *)bytes_to_key((EVP_CIPHER const *)arg1,arg2,arg3,arg4,arg5,arg6);
16315   {
16316     resultobj=result;
16317   }
16318   return resultobj;
16319 fail:
16320   return NULL;
16321 }
16322 
16323 
_wrap_cipher_init(PyObject * self,PyObject * args)16324 SWIGINTERN PyObject *_wrap_cipher_init(PyObject *self, PyObject *args) {
16325   PyObject *resultobj = 0;
16326   EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ;
16327   EVP_CIPHER *arg2 = (EVP_CIPHER *) 0 ;
16328   PyObject *arg3 = (PyObject *) 0 ;
16329   PyObject *arg4 = (PyObject *) 0 ;
16330   int arg5 ;
16331   void *argp1 = 0 ;
16332   int res1 = 0 ;
16333   void *argp2 = 0 ;
16334   int res2 = 0 ;
16335   int val5 ;
16336   int ecode5 = 0 ;
16337   PyObject *swig_obj[5] ;
16338   PyObject *result = 0 ;
16339 
16340   if (!SWIG_Python_UnpackTuple(args, "cipher_init", 5, 5, swig_obj)) SWIG_fail;
16341   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 |  0 );
16342   if (!SWIG_IsOK(res1)) {
16343     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_init" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'");
16344   }
16345   arg1 = (EVP_CIPHER_CTX *)(argp1);
16346   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
16347   if (!SWIG_IsOK(res2)) {
16348     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "cipher_init" "', argument " "2"" of type '" "EVP_CIPHER const *""'");
16349   }
16350   arg2 = (EVP_CIPHER *)(argp2);
16351   {
16352     arg3=swig_obj[2];
16353   }
16354   {
16355     arg4=swig_obj[3];
16356   }
16357   ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
16358   if (!SWIG_IsOK(ecode5)) {
16359     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "cipher_init" "', argument " "5"" of type '" "int""'");
16360   }
16361   arg5 = (int)(val5);
16362   {
16363     if (!arg1) {
16364       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16365     }
16366   }
16367   {
16368     if (!arg2) {
16369       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16370     }
16371   }
16372   result = (PyObject *)cipher_init(arg1,(EVP_CIPHER const *)arg2,arg3,arg4,arg5);
16373   {
16374     resultobj=result;
16375   }
16376   return resultobj;
16377 fail:
16378   return NULL;
16379 }
16380 
16381 
_wrap_cipher_update(PyObject * self,PyObject * args)16382 SWIGINTERN PyObject *_wrap_cipher_update(PyObject *self, PyObject *args) {
16383   PyObject *resultobj = 0;
16384   EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ;
16385   PyObject *arg2 = (PyObject *) 0 ;
16386   void *argp1 = 0 ;
16387   int res1 = 0 ;
16388   PyObject *swig_obj[2] ;
16389   PyObject *result = 0 ;
16390 
16391   if (!SWIG_Python_UnpackTuple(args, "cipher_update", 2, 2, swig_obj)) SWIG_fail;
16392   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 |  0 );
16393   if (!SWIG_IsOK(res1)) {
16394     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_update" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'");
16395   }
16396   arg1 = (EVP_CIPHER_CTX *)(argp1);
16397   {
16398     arg2=swig_obj[1];
16399   }
16400   {
16401     if (!arg1) {
16402       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16403     }
16404   }
16405   result = (PyObject *)cipher_update(arg1,arg2);
16406   {
16407     resultobj=result;
16408   }
16409   return resultobj;
16410 fail:
16411   return NULL;
16412 }
16413 
16414 
_wrap_cipher_final(PyObject * self,PyObject * args)16415 SWIGINTERN PyObject *_wrap_cipher_final(PyObject *self, PyObject *args) {
16416   PyObject *resultobj = 0;
16417   EVP_CIPHER_CTX *arg1 = (EVP_CIPHER_CTX *) 0 ;
16418   void *argp1 = 0 ;
16419   int res1 = 0 ;
16420   PyObject *swig_obj[1] ;
16421   PyObject *result = 0 ;
16422 
16423   if (!args) SWIG_fail;
16424   swig_obj[0] = args;
16425   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_CIPHER_CTX, 0 |  0 );
16426   if (!SWIG_IsOK(res1)) {
16427     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "cipher_final" "', argument " "1"" of type '" "EVP_CIPHER_CTX *""'");
16428   }
16429   arg1 = (EVP_CIPHER_CTX *)(argp1);
16430   {
16431     if (!arg1) {
16432       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16433     }
16434   }
16435   result = (PyObject *)cipher_final(arg1);
16436   {
16437     resultobj=result;
16438   }
16439   return resultobj;
16440 fail:
16441   return NULL;
16442 }
16443 
16444 
_wrap_sign_update(PyObject * self,PyObject * args)16445 SWIGINTERN PyObject *_wrap_sign_update(PyObject *self, PyObject *args) {
16446   PyObject *resultobj = 0;
16447   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16448   PyObject *arg2 = (PyObject *) 0 ;
16449   void *argp1 = 0 ;
16450   int res1 = 0 ;
16451   PyObject *swig_obj[2] ;
16452   PyObject *result = 0 ;
16453 
16454   if (!SWIG_Python_UnpackTuple(args, "sign_update", 2, 2, swig_obj)) SWIG_fail;
16455   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16456   if (!SWIG_IsOK(res1)) {
16457     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sign_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16458   }
16459   arg1 = (EVP_MD_CTX *)(argp1);
16460   {
16461     arg2=swig_obj[1];
16462   }
16463   {
16464     if (!arg1) {
16465       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16466     }
16467   }
16468   result = (PyObject *)sign_update(arg1,arg2);
16469   {
16470     resultobj=result;
16471   }
16472   return resultobj;
16473 fail:
16474   return NULL;
16475 }
16476 
16477 
_wrap_sign_final(PyObject * self,PyObject * args)16478 SWIGINTERN PyObject *_wrap_sign_final(PyObject *self, PyObject *args) {
16479   PyObject *resultobj = 0;
16480   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16481   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
16482   void *argp1 = 0 ;
16483   int res1 = 0 ;
16484   void *argp2 = 0 ;
16485   int res2 = 0 ;
16486   PyObject *swig_obj[2] ;
16487   PyObject *result = 0 ;
16488 
16489   if (!SWIG_Python_UnpackTuple(args, "sign_final", 2, 2, swig_obj)) SWIG_fail;
16490   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16491   if (!SWIG_IsOK(res1)) {
16492     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sign_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16493   }
16494   arg1 = (EVP_MD_CTX *)(argp1);
16495   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
16496   if (!SWIG_IsOK(res2)) {
16497     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sign_final" "', argument " "2"" of type '" "EVP_PKEY *""'");
16498   }
16499   arg2 = (EVP_PKEY *)(argp2);
16500   {
16501     if (!arg1) {
16502       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16503     }
16504   }
16505   {
16506     if (!arg2) {
16507       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16508     }
16509   }
16510   result = (PyObject *)sign_final(arg1,arg2);
16511   {
16512     resultobj=result;
16513   }
16514   return resultobj;
16515 fail:
16516   return NULL;
16517 }
16518 
16519 
_wrap_verify_update(PyObject * self,PyObject * args)16520 SWIGINTERN PyObject *_wrap_verify_update(PyObject *self, PyObject *args) {
16521   PyObject *resultobj = 0;
16522   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16523   PyObject *arg2 = (PyObject *) 0 ;
16524   void *argp1 = 0 ;
16525   int res1 = 0 ;
16526   PyObject *swig_obj[2] ;
16527   int result;
16528 
16529   if (!SWIG_Python_UnpackTuple(args, "verify_update", 2, 2, swig_obj)) SWIG_fail;
16530   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16531   if (!SWIG_IsOK(res1)) {
16532     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "verify_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16533   }
16534   arg1 = (EVP_MD_CTX *)(argp1);
16535   {
16536     arg2=swig_obj[1];
16537   }
16538   {
16539     if (!arg1) {
16540       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16541     }
16542   }
16543   result = (int)verify_update(arg1,arg2);
16544   {
16545     resultobj=PyLong_FromLong(result);
16546     if (PyErr_Occurred()) SWIG_fail;
16547   }
16548   return resultobj;
16549 fail:
16550   return NULL;
16551 }
16552 
16553 
_wrap_verify_final(PyObject * self,PyObject * args)16554 SWIGINTERN PyObject *_wrap_verify_final(PyObject *self, PyObject *args) {
16555   PyObject *resultobj = 0;
16556   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16557   PyObject *arg2 = (PyObject *) 0 ;
16558   EVP_PKEY *arg3 = (EVP_PKEY *) 0 ;
16559   void *argp1 = 0 ;
16560   int res1 = 0 ;
16561   void *argp3 = 0 ;
16562   int res3 = 0 ;
16563   PyObject *swig_obj[3] ;
16564   int result;
16565 
16566   if (!SWIG_Python_UnpackTuple(args, "verify_final", 3, 3, swig_obj)) SWIG_fail;
16567   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16568   if (!SWIG_IsOK(res1)) {
16569     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "verify_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16570   }
16571   arg1 = (EVP_MD_CTX *)(argp1);
16572   {
16573     arg2=swig_obj[1];
16574   }
16575   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
16576   if (!SWIG_IsOK(res3)) {
16577     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "verify_final" "', argument " "3"" of type '" "EVP_PKEY *""'");
16578   }
16579   arg3 = (EVP_PKEY *)(argp3);
16580   {
16581     if (!arg1) {
16582       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16583     }
16584   }
16585   {
16586     if (!arg3) {
16587       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16588     }
16589   }
16590   result = (int)verify_final(arg1,arg2,arg3);
16591   {
16592     resultobj=PyLong_FromLong(result);
16593     if (PyErr_Occurred()) SWIG_fail;
16594   }
16595   return resultobj;
16596 fail:
16597   return NULL;
16598 }
16599 
16600 
_wrap_digest_sign_init__SWIG_1(PyObject * self,Py_ssize_t nobjs,PyObject ** swig_obj)16601 SWIGINTERN PyObject *_wrap_digest_sign_init__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
16602   PyObject *resultobj = 0;
16603   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16604   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
16605   void *argp1 = 0 ;
16606   int res1 = 0 ;
16607   void *argp2 = 0 ;
16608   int res2 = 0 ;
16609   int result;
16610 
16611   if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
16612   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16613   if (!SWIG_IsOK(res1)) {
16614     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_sign_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16615   }
16616   arg1 = (EVP_MD_CTX *)(argp1);
16617   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
16618   if (!SWIG_IsOK(res2)) {
16619     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_sign_init" "', argument " "2"" of type '" "EVP_PKEY *""'");
16620   }
16621   arg2 = (EVP_PKEY *)(argp2);
16622   {
16623     if (!arg1) {
16624       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16625     }
16626   }
16627   {
16628     if (!arg2) {
16629       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16630     }
16631   }
16632   result = (int)digest_sign_init(arg1,arg2);
16633   {
16634     resultobj=PyLong_FromLong(result);
16635     if (PyErr_Occurred()) SWIG_fail;
16636   }
16637   return resultobj;
16638 fail:
16639   return NULL;
16640 }
16641 
16642 
_wrap_digest_sign_init(PyObject * self,PyObject * args)16643 SWIGINTERN PyObject *_wrap_digest_sign_init(PyObject *self, PyObject *args) {
16644   Py_ssize_t argc;
16645   PyObject *argv[6] = {
16646     0
16647   };
16648 
16649   if (!(argc = SWIG_Python_UnpackTuple(args, "digest_sign_init", 0, 5, argv))) SWIG_fail;
16650   --argc;
16651   if (argc == 2) {
16652     int _v;
16653     void *vptr = 0;
16654     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EVP_MD_CTX, 0);
16655     _v = SWIG_CheckState(res);
16656     if (_v) {
16657       void *vptr = 0;
16658       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_EVP_PKEY, 0);
16659       _v = SWIG_CheckState(res);
16660       if (_v) {
16661         return _wrap_digest_sign_init__SWIG_1(self, argc, argv);
16662       }
16663     }
16664   }
16665   if (argc == 5) {
16666     int _v;
16667     void *vptr = 0;
16668     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EVP_MD_CTX, 0);
16669     _v = SWIG_CheckState(res);
16670     if (_v) {
16671       void *vptr = 0;
16672       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_p_EVP_PKEY_CTX, 0);
16673       _v = SWIG_CheckState(res);
16674       if (_v) {
16675         void *vptr = 0;
16676         int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_EVP_MD, 0);
16677         _v = SWIG_CheckState(res);
16678         if (_v) {
16679           void *vptr = 0;
16680           int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_ENGINE, 0);
16681           _v = SWIG_CheckState(res);
16682           if (_v) {
16683             void *vptr = 0;
16684             int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_EVP_PKEY, 0);
16685             _v = SWIG_CheckState(res);
16686             if (_v) {
16687               return _wrap_digest_sign_init__SWIG_0(self, argc, argv);
16688             }
16689           }
16690         }
16691       }
16692     }
16693   }
16694 
16695 fail:
16696   SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'digest_sign_init'.\n"
16697     "  Possible C/C++ prototypes are:\n"
16698     "    EVP_DigestSignInit(EVP_MD_CTX *,EVP_PKEY_CTX **,EVP_MD const *,ENGINE *,EVP_PKEY *)\n"
16699     "    digest_sign_init(EVP_MD_CTX *,EVP_PKEY *)\n");
16700   return 0;
16701 }
16702 
16703 
_wrap_digest_sign_update(PyObject * self,PyObject * args)16704 SWIGINTERN PyObject *_wrap_digest_sign_update(PyObject *self, PyObject *args) {
16705   PyObject *resultobj = 0;
16706   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16707   PyObject *arg2 = (PyObject *) 0 ;
16708   void *argp1 = 0 ;
16709   int res1 = 0 ;
16710   PyObject *swig_obj[2] ;
16711   PyObject *result = 0 ;
16712 
16713   if (!SWIG_Python_UnpackTuple(args, "digest_sign_update", 2, 2, swig_obj)) SWIG_fail;
16714   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16715   if (!SWIG_IsOK(res1)) {
16716     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_sign_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16717   }
16718   arg1 = (EVP_MD_CTX *)(argp1);
16719   {
16720     arg2=swig_obj[1];
16721   }
16722   {
16723     if (!arg1) {
16724       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16725     }
16726   }
16727   result = (PyObject *)digest_sign_update(arg1,arg2);
16728   {
16729     resultobj=result;
16730   }
16731   return resultobj;
16732 fail:
16733   return NULL;
16734 }
16735 
16736 
_wrap_digest_sign_final(PyObject * self,PyObject * args)16737 SWIGINTERN PyObject *_wrap_digest_sign_final(PyObject *self, PyObject *args) {
16738   PyObject *resultobj = 0;
16739   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16740   void *argp1 = 0 ;
16741   int res1 = 0 ;
16742   PyObject *swig_obj[1] ;
16743   PyObject *result = 0 ;
16744 
16745   if (!args) SWIG_fail;
16746   swig_obj[0] = args;
16747   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16748   if (!SWIG_IsOK(res1)) {
16749     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_sign_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16750   }
16751   arg1 = (EVP_MD_CTX *)(argp1);
16752   {
16753     if (!arg1) {
16754       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16755     }
16756   }
16757   result = (PyObject *)digest_sign_final(arg1);
16758   {
16759     resultobj=result;
16760   }
16761   return resultobj;
16762 fail:
16763   return NULL;
16764 }
16765 
16766 
_wrap_digest_sign(PyObject * self,PyObject * args)16767 SWIGINTERN PyObject *_wrap_digest_sign(PyObject *self, PyObject *args) {
16768   PyObject *resultobj = 0;
16769   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16770   PyObject *arg2 = (PyObject *) 0 ;
16771   void *argp1 = 0 ;
16772   int res1 = 0 ;
16773   PyObject *swig_obj[2] ;
16774   PyObject *result = 0 ;
16775 
16776   if (!SWIG_Python_UnpackTuple(args, "digest_sign", 2, 2, swig_obj)) SWIG_fail;
16777   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16778   if (!SWIG_IsOK(res1)) {
16779     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_sign" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16780   }
16781   arg1 = (EVP_MD_CTX *)(argp1);
16782   {
16783     arg2=swig_obj[1];
16784   }
16785   {
16786     if (!arg1) {
16787       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16788     }
16789   }
16790   result = (PyObject *)digest_sign(arg1,arg2);
16791   {
16792     resultobj=result;
16793   }
16794   return resultobj;
16795 fail:
16796   return NULL;
16797 }
16798 
16799 
_wrap_digest_verify_init__SWIG_1(PyObject * self,Py_ssize_t nobjs,PyObject ** swig_obj)16800 SWIGINTERN PyObject *_wrap_digest_verify_init__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
16801   PyObject *resultobj = 0;
16802   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16803   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
16804   void *argp1 = 0 ;
16805   int res1 = 0 ;
16806   void *argp2 = 0 ;
16807   int res2 = 0 ;
16808   int result;
16809 
16810   if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
16811   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16812   if (!SWIG_IsOK(res1)) {
16813     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_verify_init" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16814   }
16815   arg1 = (EVP_MD_CTX *)(argp1);
16816   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
16817   if (!SWIG_IsOK(res2)) {
16818     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "digest_verify_init" "', argument " "2"" of type '" "EVP_PKEY *""'");
16819   }
16820   arg2 = (EVP_PKEY *)(argp2);
16821   {
16822     if (!arg1) {
16823       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16824     }
16825   }
16826   {
16827     if (!arg2) {
16828       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16829     }
16830   }
16831   result = (int)digest_verify_init(arg1,arg2);
16832   {
16833     resultobj=PyLong_FromLong(result);
16834     if (PyErr_Occurred()) SWIG_fail;
16835   }
16836   return resultobj;
16837 fail:
16838   return NULL;
16839 }
16840 
16841 
_wrap_digest_verify_init(PyObject * self,PyObject * args)16842 SWIGINTERN PyObject *_wrap_digest_verify_init(PyObject *self, PyObject *args) {
16843   Py_ssize_t argc;
16844   PyObject *argv[6] = {
16845     0
16846   };
16847 
16848   if (!(argc = SWIG_Python_UnpackTuple(args, "digest_verify_init", 0, 5, argv))) SWIG_fail;
16849   --argc;
16850   if (argc == 2) {
16851     int _v;
16852     void *vptr = 0;
16853     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EVP_MD_CTX, 0);
16854     _v = SWIG_CheckState(res);
16855     if (_v) {
16856       void *vptr = 0;
16857       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_EVP_PKEY, 0);
16858       _v = SWIG_CheckState(res);
16859       if (_v) {
16860         return _wrap_digest_verify_init__SWIG_1(self, argc, argv);
16861       }
16862     }
16863   }
16864   if (argc == 5) {
16865     int _v;
16866     void *vptr = 0;
16867     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_EVP_MD_CTX, 0);
16868     _v = SWIG_CheckState(res);
16869     if (_v) {
16870       void *vptr = 0;
16871       int res = SWIG_ConvertPtr(argv[1], &vptr, SWIGTYPE_p_p_EVP_PKEY_CTX, 0);
16872       _v = SWIG_CheckState(res);
16873       if (_v) {
16874         void *vptr = 0;
16875         int res = SWIG_ConvertPtr(argv[2], &vptr, SWIGTYPE_p_EVP_MD, 0);
16876         _v = SWIG_CheckState(res);
16877         if (_v) {
16878           void *vptr = 0;
16879           int res = SWIG_ConvertPtr(argv[3], &vptr, SWIGTYPE_p_ENGINE, 0);
16880           _v = SWIG_CheckState(res);
16881           if (_v) {
16882             void *vptr = 0;
16883             int res = SWIG_ConvertPtr(argv[4], &vptr, SWIGTYPE_p_EVP_PKEY, 0);
16884             _v = SWIG_CheckState(res);
16885             if (_v) {
16886               return _wrap_digest_verify_init__SWIG_0(self, argc, argv);
16887             }
16888           }
16889         }
16890       }
16891     }
16892   }
16893 
16894 fail:
16895   SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'digest_verify_init'.\n"
16896     "  Possible C/C++ prototypes are:\n"
16897     "    EVP_DigestVerifyInit(EVP_MD_CTX *,EVP_PKEY_CTX **,EVP_MD const *,ENGINE *,EVP_PKEY *)\n"
16898     "    digest_verify_init(EVP_MD_CTX *,EVP_PKEY *)\n");
16899   return 0;
16900 }
16901 
16902 
_wrap_digest_verify_update(PyObject * self,PyObject * args)16903 SWIGINTERN PyObject *_wrap_digest_verify_update(PyObject *self, PyObject *args) {
16904   PyObject *resultobj = 0;
16905   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16906   PyObject *arg2 = (PyObject *) 0 ;
16907   void *argp1 = 0 ;
16908   int res1 = 0 ;
16909   PyObject *swig_obj[2] ;
16910   int result;
16911 
16912   if (!SWIG_Python_UnpackTuple(args, "digest_verify_update", 2, 2, swig_obj)) SWIG_fail;
16913   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16914   if (!SWIG_IsOK(res1)) {
16915     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_verify_update" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16916   }
16917   arg1 = (EVP_MD_CTX *)(argp1);
16918   {
16919     arg2=swig_obj[1];
16920   }
16921   {
16922     if (!arg1) {
16923       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16924     }
16925   }
16926   result = (int)digest_verify_update(arg1,arg2);
16927   {
16928     resultobj=PyLong_FromLong(result);
16929     if (PyErr_Occurred()) SWIG_fail;
16930   }
16931   return resultobj;
16932 fail:
16933   return NULL;
16934 }
16935 
16936 
_wrap_digest_verify_final(PyObject * self,PyObject * args)16937 SWIGINTERN PyObject *_wrap_digest_verify_final(PyObject *self, PyObject *args) {
16938   PyObject *resultobj = 0;
16939   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16940   PyObject *arg2 = (PyObject *) 0 ;
16941   void *argp1 = 0 ;
16942   int res1 = 0 ;
16943   PyObject *swig_obj[2] ;
16944   int result;
16945 
16946   if (!SWIG_Python_UnpackTuple(args, "digest_verify_final", 2, 2, swig_obj)) SWIG_fail;
16947   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16948   if (!SWIG_IsOK(res1)) {
16949     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_verify_final" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16950   }
16951   arg1 = (EVP_MD_CTX *)(argp1);
16952   {
16953     arg2=swig_obj[1];
16954   }
16955   {
16956     if (!arg1) {
16957       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16958     }
16959   }
16960   result = (int)digest_verify_final(arg1,arg2);
16961   {
16962     resultobj=PyLong_FromLong(result);
16963     if (PyErr_Occurred()) SWIG_fail;
16964   }
16965   return resultobj;
16966 fail:
16967   return NULL;
16968 }
16969 
16970 
_wrap_digest_verify(PyObject * self,PyObject * args)16971 SWIGINTERN PyObject *_wrap_digest_verify(PyObject *self, PyObject *args) {
16972   PyObject *resultobj = 0;
16973   EVP_MD_CTX *arg1 = (EVP_MD_CTX *) 0 ;
16974   PyObject *arg2 = (PyObject *) 0 ;
16975   PyObject *arg3 = (PyObject *) 0 ;
16976   void *argp1 = 0 ;
16977   int res1 = 0 ;
16978   PyObject *swig_obj[3] ;
16979   int result;
16980 
16981   if (!SWIG_Python_UnpackTuple(args, "digest_verify", 3, 3, swig_obj)) SWIG_fail;
16982   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_MD_CTX, 0 |  0 );
16983   if (!SWIG_IsOK(res1)) {
16984     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "digest_verify" "', argument " "1"" of type '" "EVP_MD_CTX *""'");
16985   }
16986   arg1 = (EVP_MD_CTX *)(argp1);
16987   {
16988     arg2=swig_obj[1];
16989   }
16990   {
16991     arg3=swig_obj[2];
16992   }
16993   {
16994     if (!arg1) {
16995       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
16996     }
16997   }
16998   result = (int)digest_verify(arg1,arg2,arg3);
16999   {
17000     resultobj=PyLong_FromLong(result);
17001     if (PyErr_Occurred()) SWIG_fail;
17002   }
17003   return resultobj;
17004 fail:
17005   return NULL;
17006 }
17007 
17008 
_wrap_get_digestbyname(PyObject * self,PyObject * args)17009 SWIGINTERN PyObject *_wrap_get_digestbyname(PyObject *self, PyObject *args) {
17010   PyObject *resultobj = 0;
17011   char *arg1 = (char *) 0 ;
17012   int res1 ;
17013   char *buf1 = 0 ;
17014   int alloc1 = 0 ;
17015   PyObject *swig_obj[1] ;
17016   EVP_MD *result = 0 ;
17017 
17018   if (!args) SWIG_fail;
17019   swig_obj[0] = args;
17020   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
17021   if (!SWIG_IsOK(res1)) {
17022     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_digestbyname" "', argument " "1"" of type '" "char const *""'");
17023   }
17024   arg1 = (char *)(buf1);
17025   result = (EVP_MD *)get_digestbyname((char const *)arg1);
17026   {
17027     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
17028 
17029     if (result != NULL)
17030     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_EVP_MD, 0);
17031     else {
17032       resultobj = NULL;
17033     }
17034   }
17035   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
17036   return resultobj;
17037 fail:
17038   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
17039   return NULL;
17040 }
17041 
17042 
_wrap_pkey_write_pem_no_cipher(PyObject * self,PyObject * args)17043 SWIGINTERN PyObject *_wrap_pkey_write_pem_no_cipher(PyObject *self, PyObject *args) {
17044   PyObject *resultobj = 0;
17045   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
17046   BIO *arg2 = (BIO *) 0 ;
17047   PyObject *arg3 = (PyObject *) 0 ;
17048   void *argp1 = 0 ;
17049   int res1 = 0 ;
17050   void *argp2 = 0 ;
17051   int res2 = 0 ;
17052   PyObject *swig_obj[3] ;
17053   int result;
17054 
17055   if (!SWIG_Python_UnpackTuple(args, "pkey_write_pem_no_cipher", 3, 3, swig_obj)) SWIG_fail;
17056   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
17057   if (!SWIG_IsOK(res1)) {
17058     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_write_pem_no_cipher" "', argument " "1"" of type '" "EVP_PKEY *""'");
17059   }
17060   arg1 = (EVP_PKEY *)(argp1);
17061   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
17062   if (!SWIG_IsOK(res2)) {
17063     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkey_write_pem_no_cipher" "', argument " "2"" of type '" "BIO *""'");
17064   }
17065   arg2 = (BIO *)(argp2);
17066   {
17067     if (!PyCallable_Check(swig_obj[2])) {
17068       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
17069       return NULL;
17070     }
17071     arg3=swig_obj[2];
17072   }
17073   {
17074     if (!arg1) {
17075       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17076     }
17077   }
17078   {
17079     if (!arg2) {
17080       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17081     }
17082   }
17083   result = (int)pkey_write_pem_no_cipher(arg1,arg2,arg3);
17084   {
17085     resultobj=PyLong_FromLong(result);
17086     if (PyErr_Occurred()) SWIG_fail;
17087   }
17088   return resultobj;
17089 fail:
17090   return NULL;
17091 }
17092 
17093 
_wrap_pkey_write_pem(PyObject * self,PyObject * args)17094 SWIGINTERN PyObject *_wrap_pkey_write_pem(PyObject *self, PyObject *args) {
17095   PyObject *resultobj = 0;
17096   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
17097   BIO *arg2 = (BIO *) 0 ;
17098   EVP_CIPHER *arg3 = (EVP_CIPHER *) 0 ;
17099   PyObject *arg4 = (PyObject *) 0 ;
17100   void *argp1 = 0 ;
17101   int res1 = 0 ;
17102   void *argp2 = 0 ;
17103   int res2 = 0 ;
17104   void *argp3 = 0 ;
17105   int res3 = 0 ;
17106   PyObject *swig_obj[4] ;
17107   int result;
17108 
17109   if (!SWIG_Python_UnpackTuple(args, "pkey_write_pem", 4, 4, swig_obj)) SWIG_fail;
17110   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
17111   if (!SWIG_IsOK(res1)) {
17112     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_write_pem" "', argument " "1"" of type '" "EVP_PKEY *""'");
17113   }
17114   arg1 = (EVP_PKEY *)(argp1);
17115   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
17116   if (!SWIG_IsOK(res2)) {
17117     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkey_write_pem" "', argument " "2"" of type '" "BIO *""'");
17118   }
17119   arg2 = (BIO *)(argp2);
17120   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
17121   if (!SWIG_IsOK(res3)) {
17122     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkey_write_pem" "', argument " "3"" of type '" "EVP_CIPHER *""'");
17123   }
17124   arg3 = (EVP_CIPHER *)(argp3);
17125   {
17126     if (!PyCallable_Check(swig_obj[3])) {
17127       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
17128       return NULL;
17129     }
17130     arg4=swig_obj[3];
17131   }
17132   {
17133     if (!arg1) {
17134       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17135     }
17136   }
17137   {
17138     if (!arg2) {
17139       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17140     }
17141   }
17142   {
17143     if (!arg3) {
17144       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17145     }
17146   }
17147   result = (int)pkey_write_pem(arg1,arg2,arg3,arg4);
17148   {
17149     resultobj=PyLong_FromLong(result);
17150     if (PyErr_Occurred()) SWIG_fail;
17151   }
17152   return resultobj;
17153 fail:
17154   return NULL;
17155 }
17156 
17157 
_wrap_pkey_new(PyObject * self,PyObject * args)17158 SWIGINTERN PyObject *_wrap_pkey_new(PyObject *self, PyObject *args) {
17159   PyObject *resultobj = 0;
17160   EVP_PKEY *result = 0 ;
17161 
17162   if (!SWIG_Python_UnpackTuple(args, "pkey_new", 0, 0, 0)) SWIG_fail;
17163   result = (EVP_PKEY *)pkey_new();
17164   {
17165     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
17166 
17167     if (result != NULL)
17168     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_EVP_PKEY, 0);
17169     else {
17170       resultobj = NULL;
17171     }
17172   }
17173   return resultobj;
17174 fail:
17175   return NULL;
17176 }
17177 
17178 
_wrap_pkey_read_pem(PyObject * self,PyObject * args)17179 SWIGINTERN PyObject *_wrap_pkey_read_pem(PyObject *self, PyObject *args) {
17180   PyObject *resultobj = 0;
17181   BIO *arg1 = (BIO *) 0 ;
17182   PyObject *arg2 = (PyObject *) 0 ;
17183   void *argp1 = 0 ;
17184   int res1 = 0 ;
17185   PyObject *swig_obj[2] ;
17186   EVP_PKEY *result = 0 ;
17187 
17188   if (!SWIG_Python_UnpackTuple(args, "pkey_read_pem", 2, 2, swig_obj)) SWIG_fail;
17189   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
17190   if (!SWIG_IsOK(res1)) {
17191     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_read_pem" "', argument " "1"" of type '" "BIO *""'");
17192   }
17193   arg1 = (BIO *)(argp1);
17194   {
17195     if (!PyCallable_Check(swig_obj[1])) {
17196       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
17197       return NULL;
17198     }
17199     arg2=swig_obj[1];
17200   }
17201   {
17202     if (!arg1) {
17203       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17204     }
17205   }
17206   result = (EVP_PKEY *)pkey_read_pem(arg1,arg2);
17207   {
17208     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
17209 
17210     if (result != NULL)
17211     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_EVP_PKEY, 0);
17212     else {
17213       resultobj = NULL;
17214     }
17215   }
17216   return resultobj;
17217 fail:
17218   return NULL;
17219 }
17220 
17221 
_wrap_pkey_read_pem_pubkey(PyObject * self,PyObject * args)17222 SWIGINTERN PyObject *_wrap_pkey_read_pem_pubkey(PyObject *self, PyObject *args) {
17223   PyObject *resultobj = 0;
17224   BIO *arg1 = (BIO *) 0 ;
17225   PyObject *arg2 = (PyObject *) 0 ;
17226   void *argp1 = 0 ;
17227   int res1 = 0 ;
17228   PyObject *swig_obj[2] ;
17229   EVP_PKEY *result = 0 ;
17230 
17231   if (!SWIG_Python_UnpackTuple(args, "pkey_read_pem_pubkey", 2, 2, swig_obj)) SWIG_fail;
17232   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
17233   if (!SWIG_IsOK(res1)) {
17234     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_read_pem_pubkey" "', argument " "1"" of type '" "BIO *""'");
17235   }
17236   arg1 = (BIO *)(argp1);
17237   {
17238     if (!PyCallable_Check(swig_obj[1])) {
17239       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
17240       return NULL;
17241     }
17242     arg2=swig_obj[1];
17243   }
17244   {
17245     if (!arg1) {
17246       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17247     }
17248   }
17249   result = (EVP_PKEY *)pkey_read_pem_pubkey(arg1,arg2);
17250   {
17251     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
17252 
17253     if (result != NULL)
17254     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_EVP_PKEY, 0);
17255     else {
17256       resultobj = NULL;
17257     }
17258   }
17259   return resultobj;
17260 fail:
17261   return NULL;
17262 }
17263 
17264 
_wrap_pkey_assign_rsa(PyObject * self,PyObject * args)17265 SWIGINTERN PyObject *_wrap_pkey_assign_rsa(PyObject *self, PyObject *args) {
17266   PyObject *resultobj = 0;
17267   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
17268   RSA *arg2 = (RSA *) 0 ;
17269   void *argp1 = 0 ;
17270   int res1 = 0 ;
17271   void *argp2 = 0 ;
17272   int res2 = 0 ;
17273   PyObject *swig_obj[2] ;
17274   int result;
17275 
17276   if (!SWIG_Python_UnpackTuple(args, "pkey_assign_rsa", 2, 2, swig_obj)) SWIG_fail;
17277   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
17278   if (!SWIG_IsOK(res1)) {
17279     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_assign_rsa" "', argument " "1"" of type '" "EVP_PKEY *""'");
17280   }
17281   arg1 = (EVP_PKEY *)(argp1);
17282   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_RSA, 0 |  0 );
17283   if (!SWIG_IsOK(res2)) {
17284     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkey_assign_rsa" "', argument " "2"" of type '" "RSA *""'");
17285   }
17286   arg2 = (RSA *)(argp2);
17287   {
17288     if (!arg1) {
17289       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17290     }
17291   }
17292   {
17293     if (!arg2) {
17294       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17295     }
17296   }
17297   result = (int)pkey_assign_rsa(arg1,arg2);
17298   {
17299     resultobj=PyLong_FromLong(result);
17300     if (PyErr_Occurred()) SWIG_fail;
17301   }
17302   return resultobj;
17303 fail:
17304   return NULL;
17305 }
17306 
17307 
_wrap_pkey_as_der(PyObject * self,PyObject * args)17308 SWIGINTERN PyObject *_wrap_pkey_as_der(PyObject *self, PyObject *args) {
17309   PyObject *resultobj = 0;
17310   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
17311   void *argp1 = 0 ;
17312   int res1 = 0 ;
17313   PyObject *swig_obj[1] ;
17314   PyObject *result = 0 ;
17315 
17316   if (!args) SWIG_fail;
17317   swig_obj[0] = args;
17318   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
17319   if (!SWIG_IsOK(res1)) {
17320     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_as_der" "', argument " "1"" of type '" "EVP_PKEY *""'");
17321   }
17322   arg1 = (EVP_PKEY *)(argp1);
17323   {
17324     if (!arg1) {
17325       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17326     }
17327   }
17328   result = (PyObject *)pkey_as_der(arg1);
17329   {
17330     resultobj=result;
17331   }
17332   return resultobj;
17333 fail:
17334   return NULL;
17335 }
17336 
17337 
_wrap_pkey_get_modulus(PyObject * self,PyObject * args)17338 SWIGINTERN PyObject *_wrap_pkey_get_modulus(PyObject *self, PyObject *args) {
17339   PyObject *resultobj = 0;
17340   EVP_PKEY *arg1 = (EVP_PKEY *) 0 ;
17341   void *argp1 = 0 ;
17342   int res1 = 0 ;
17343   PyObject *swig_obj[1] ;
17344   PyObject *result = 0 ;
17345 
17346   if (!args) SWIG_fail;
17347   swig_obj[0] = args;
17348   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
17349   if (!SWIG_IsOK(res1)) {
17350     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkey_get_modulus" "', argument " "1"" of type '" "EVP_PKEY *""'");
17351   }
17352   arg1 = (EVP_PKEY *)(argp1);
17353   {
17354     if (!arg1) {
17355       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17356     }
17357   }
17358   result = (PyObject *)pkey_get_modulus(arg1);
17359   {
17360     resultobj=result;
17361   }
17362   return resultobj;
17363 fail:
17364   return NULL;
17365 }
17366 
17367 
_wrap_aes_new(PyObject * self,PyObject * args)17368 SWIGINTERN PyObject *_wrap_aes_new(PyObject *self, PyObject *args) {
17369   PyObject *resultobj = 0;
17370   AES_KEY *result = 0 ;
17371 
17372   if (!SWIG_Python_UnpackTuple(args, "aes_new", 0, 0, 0)) SWIG_fail;
17373   result = (AES_KEY *)aes_new();
17374   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_AES_KEY, 0 |  0 );
17375   return resultobj;
17376 fail:
17377   return NULL;
17378 }
17379 
17380 
_wrap_AES_free(PyObject * self,PyObject * args)17381 SWIGINTERN PyObject *_wrap_AES_free(PyObject *self, PyObject *args) {
17382   PyObject *resultobj = 0;
17383   AES_KEY *arg1 = (AES_KEY *) 0 ;
17384   void *argp1 = 0 ;
17385   int res1 = 0 ;
17386   PyObject *swig_obj[1] ;
17387 
17388   if (!args) SWIG_fail;
17389   swig_obj[0] = args;
17390   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AES_KEY, 0 |  0 );
17391   if (!SWIG_IsOK(res1)) {
17392     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_free" "', argument " "1"" of type '" "AES_KEY *""'");
17393   }
17394   arg1 = (AES_KEY *)(argp1);
17395   {
17396     if (!arg1) {
17397       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17398     }
17399   }
17400   AES_free(arg1);
17401   resultobj = SWIG_Py_Void();
17402   return resultobj;
17403 fail:
17404   return NULL;
17405 }
17406 
17407 
_wrap_AES_set_key(PyObject * self,PyObject * args)17408 SWIGINTERN PyObject *_wrap_AES_set_key(PyObject *self, PyObject *args) {
17409   PyObject *resultobj = 0;
17410   AES_KEY *arg1 = (AES_KEY *) 0 ;
17411   PyObject *arg2 = (PyObject *) 0 ;
17412   int arg3 ;
17413   int arg4 ;
17414   void *argp1 = 0 ;
17415   int res1 = 0 ;
17416   int val3 ;
17417   int ecode3 = 0 ;
17418   int val4 ;
17419   int ecode4 = 0 ;
17420   PyObject *swig_obj[4] ;
17421   PyObject *result = 0 ;
17422 
17423   if (!SWIG_Python_UnpackTuple(args, "AES_set_key", 4, 4, swig_obj)) SWIG_fail;
17424   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AES_KEY, 0 |  0 );
17425   if (!SWIG_IsOK(res1)) {
17426     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_set_key" "', argument " "1"" of type '" "AES_KEY *""'");
17427   }
17428   arg1 = (AES_KEY *)(argp1);
17429   {
17430     arg2=swig_obj[1];
17431   }
17432   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
17433   if (!SWIG_IsOK(ecode3)) {
17434     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "AES_set_key" "', argument " "3"" of type '" "int""'");
17435   }
17436   arg3 = (int)(val3);
17437   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
17438   if (!SWIG_IsOK(ecode4)) {
17439     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "AES_set_key" "', argument " "4"" of type '" "int""'");
17440   }
17441   arg4 = (int)(val4);
17442   {
17443     if (!arg1) {
17444       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17445     }
17446   }
17447   result = (PyObject *)AES_set_key(arg1,arg2,arg3,arg4);
17448   {
17449     resultobj=result;
17450   }
17451   return resultobj;
17452 fail:
17453   return NULL;
17454 }
17455 
17456 
_wrap_AES_crypt(PyObject * self,PyObject * args)17457 SWIGINTERN PyObject *_wrap_AES_crypt(PyObject *self, PyObject *args) {
17458   PyObject *resultobj = 0;
17459   AES_KEY *arg1 = (AES_KEY *) 0 ;
17460   PyObject *arg2 = (PyObject *) 0 ;
17461   int arg3 ;
17462   int arg4 ;
17463   void *argp1 = 0 ;
17464   int res1 = 0 ;
17465   int val3 ;
17466   int ecode3 = 0 ;
17467   int val4 ;
17468   int ecode4 = 0 ;
17469   PyObject *swig_obj[4] ;
17470   PyObject *result = 0 ;
17471 
17472   if (!SWIG_Python_UnpackTuple(args, "AES_crypt", 4, 4, swig_obj)) SWIG_fail;
17473   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AES_KEY, 0 |  0 );
17474   if (!SWIG_IsOK(res1)) {
17475     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_crypt" "', argument " "1"" of type '" "AES_KEY const *""'");
17476   }
17477   arg1 = (AES_KEY *)(argp1);
17478   {
17479     arg2=swig_obj[1];
17480   }
17481   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
17482   if (!SWIG_IsOK(ecode3)) {
17483     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "AES_crypt" "', argument " "3"" of type '" "int""'");
17484   }
17485   arg3 = (int)(val3);
17486   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
17487   if (!SWIG_IsOK(ecode4)) {
17488     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "AES_crypt" "', argument " "4"" of type '" "int""'");
17489   }
17490   arg4 = (int)(val4);
17491   {
17492     if (!arg1) {
17493       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17494     }
17495   }
17496   result = (PyObject *)AES_crypt((AES_KEY const *)arg1,arg2,arg3,arg4);
17497   {
17498     resultobj=result;
17499   }
17500   return resultobj;
17501 fail:
17502   return NULL;
17503 }
17504 
17505 
_wrap_AES_type_check(PyObject * self,PyObject * args)17506 SWIGINTERN PyObject *_wrap_AES_type_check(PyObject *self, PyObject *args) {
17507   PyObject *resultobj = 0;
17508   AES_KEY *arg1 = (AES_KEY *) 0 ;
17509   void *argp1 = 0 ;
17510   int res1 = 0 ;
17511   PyObject *swig_obj[1] ;
17512   int result;
17513 
17514   if (!args) SWIG_fail;
17515   swig_obj[0] = args;
17516   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_AES_KEY, 0 |  0 );
17517   if (!SWIG_IsOK(res1)) {
17518     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "AES_type_check" "', argument " "1"" of type '" "AES_KEY *""'");
17519   }
17520   arg1 = (AES_KEY *)(argp1);
17521   {
17522     if (!arg1) {
17523       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17524     }
17525   }
17526   result = (int)AES_type_check(arg1);
17527   {
17528     resultobj=PyLong_FromLong(result);
17529     if (PyErr_Occurred()) SWIG_fail;
17530   }
17531   return resultobj;
17532 fail:
17533   return NULL;
17534 }
17535 
17536 
_wrap_rc4_new(PyObject * self,PyObject * args)17537 SWIGINTERN PyObject *_wrap_rc4_new(PyObject *self, PyObject *args) {
17538   PyObject *resultobj = 0;
17539   RC4_KEY *result = 0 ;
17540 
17541   if (!SWIG_Python_UnpackTuple(args, "rc4_new", 0, 0, 0)) SWIG_fail;
17542   result = (RC4_KEY *)rc4_new();
17543   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RC4_KEY, 0 |  0 );
17544   return resultobj;
17545 fail:
17546   return NULL;
17547 }
17548 
17549 
_wrap_rc4_free(PyObject * self,PyObject * args)17550 SWIGINTERN PyObject *_wrap_rc4_free(PyObject *self, PyObject *args) {
17551   PyObject *resultobj = 0;
17552   RC4_KEY *arg1 = (RC4_KEY *) 0 ;
17553   void *argp1 = 0 ;
17554   int res1 = 0 ;
17555   PyObject *swig_obj[1] ;
17556 
17557   if (!args) SWIG_fail;
17558   swig_obj[0] = args;
17559   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RC4_KEY, 0 |  0 );
17560   if (!SWIG_IsOK(res1)) {
17561     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_free" "', argument " "1"" of type '" "RC4_KEY *""'");
17562   }
17563   arg1 = (RC4_KEY *)(argp1);
17564   {
17565     if (!arg1) {
17566       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17567     }
17568   }
17569   rc4_free(arg1);
17570   resultobj = SWIG_Py_Void();
17571   return resultobj;
17572 fail:
17573   return NULL;
17574 }
17575 
17576 
_wrap_rc4_set_key(PyObject * self,PyObject * args)17577 SWIGINTERN PyObject *_wrap_rc4_set_key(PyObject *self, PyObject *args) {
17578   PyObject *resultobj = 0;
17579   RC4_KEY *arg1 = (RC4_KEY *) 0 ;
17580   PyObject *arg2 = (PyObject *) 0 ;
17581   void *argp1 = 0 ;
17582   int res1 = 0 ;
17583   PyObject *swig_obj[2] ;
17584   PyObject *result = 0 ;
17585 
17586   if (!SWIG_Python_UnpackTuple(args, "rc4_set_key", 2, 2, swig_obj)) SWIG_fail;
17587   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RC4_KEY, 0 |  0 );
17588   if (!SWIG_IsOK(res1)) {
17589     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_set_key" "', argument " "1"" of type '" "RC4_KEY *""'");
17590   }
17591   arg1 = (RC4_KEY *)(argp1);
17592   {
17593     arg2=swig_obj[1];
17594   }
17595   {
17596     if (!arg1) {
17597       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17598     }
17599   }
17600   result = (PyObject *)rc4_set_key(arg1,arg2);
17601   {
17602     resultobj=result;
17603   }
17604   return resultobj;
17605 fail:
17606   return NULL;
17607 }
17608 
17609 
_wrap_rc4_update(PyObject * self,PyObject * args)17610 SWIGINTERN PyObject *_wrap_rc4_update(PyObject *self, PyObject *args) {
17611   PyObject *resultobj = 0;
17612   RC4_KEY *arg1 = (RC4_KEY *) 0 ;
17613   PyObject *arg2 = (PyObject *) 0 ;
17614   void *argp1 = 0 ;
17615   int res1 = 0 ;
17616   PyObject *swig_obj[2] ;
17617   PyObject *result = 0 ;
17618 
17619   if (!SWIG_Python_UnpackTuple(args, "rc4_update", 2, 2, swig_obj)) SWIG_fail;
17620   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RC4_KEY, 0 |  0 );
17621   if (!SWIG_IsOK(res1)) {
17622     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_update" "', argument " "1"" of type '" "RC4_KEY *""'");
17623   }
17624   arg1 = (RC4_KEY *)(argp1);
17625   {
17626     arg2=swig_obj[1];
17627   }
17628   {
17629     if (!arg1) {
17630       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17631     }
17632   }
17633   result = (PyObject *)rc4_update(arg1,arg2);
17634   {
17635     resultobj=result;
17636   }
17637   return resultobj;
17638 fail:
17639   return NULL;
17640 }
17641 
17642 
_wrap_rc4_type_check(PyObject * self,PyObject * args)17643 SWIGINTERN PyObject *_wrap_rc4_type_check(PyObject *self, PyObject *args) {
17644   PyObject *resultobj = 0;
17645   RC4_KEY *arg1 = (RC4_KEY *) 0 ;
17646   void *argp1 = 0 ;
17647   int res1 = 0 ;
17648   PyObject *swig_obj[1] ;
17649   int result;
17650 
17651   if (!args) SWIG_fail;
17652   swig_obj[0] = args;
17653   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RC4_KEY, 0 |  0 );
17654   if (!SWIG_IsOK(res1)) {
17655     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rc4_type_check" "', argument " "1"" of type '" "RC4_KEY *""'");
17656   }
17657   arg1 = (RC4_KEY *)(argp1);
17658   {
17659     if (!arg1) {
17660       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17661     }
17662   }
17663   result = (int)rc4_type_check(arg1);
17664   {
17665     resultobj=PyLong_FromLong(result);
17666     if (PyErr_Occurred()) SWIG_fail;
17667   }
17668   return resultobj;
17669 fail:
17670   return NULL;
17671 }
17672 
17673 
_wrap_dh_new(PyObject * self,PyObject * args)17674 SWIGINTERN PyObject *_wrap_dh_new(PyObject *self, PyObject *args) {
17675   PyObject *resultobj = 0;
17676   DH *result = 0 ;
17677 
17678   if (!SWIG_Python_UnpackTuple(args, "dh_new", 0, 0, 0)) SWIG_fail;
17679   result = (DH *)DH_new();
17680   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DH, 0 |  0 );
17681   return resultobj;
17682 fail:
17683   return NULL;
17684 }
17685 
17686 
_wrap_dh_free(PyObject * self,PyObject * args)17687 SWIGINTERN PyObject *_wrap_dh_free(PyObject *self, PyObject *args) {
17688   PyObject *resultobj = 0;
17689   DH *arg1 = (DH *) 0 ;
17690   void *argp1 = 0 ;
17691   int res1 = 0 ;
17692   PyObject *swig_obj[1] ;
17693 
17694   if (!args) SWIG_fail;
17695   swig_obj[0] = args;
17696   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
17697   if (!SWIG_IsOK(res1)) {
17698     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_free" "', argument " "1"" of type '" "DH *""'");
17699   }
17700   arg1 = (DH *)(argp1);
17701   {
17702     if (!arg1) {
17703       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17704     }
17705   }
17706   DH_free(arg1);
17707   resultobj = SWIG_Py_Void();
17708   return resultobj;
17709 fail:
17710   return NULL;
17711 }
17712 
17713 
_wrap_dh_size(PyObject * self,PyObject * args)17714 SWIGINTERN PyObject *_wrap_dh_size(PyObject *self, PyObject *args) {
17715   PyObject *resultobj = 0;
17716   DH *arg1 = (DH *) 0 ;
17717   void *argp1 = 0 ;
17718   int res1 = 0 ;
17719   PyObject *swig_obj[1] ;
17720   int result;
17721 
17722   if (!args) SWIG_fail;
17723   swig_obj[0] = args;
17724   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
17725   if (!SWIG_IsOK(res1)) {
17726     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_size" "', argument " "1"" of type '" "DH const *""'");
17727   }
17728   arg1 = (DH *)(argp1);
17729   {
17730     if (!arg1) {
17731       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17732     }
17733   }
17734   result = (int)DH_size((DH const *)arg1);
17735   {
17736     resultobj=PyLong_FromLong(result);
17737     if (PyErr_Occurred()) SWIG_fail;
17738   }
17739   return resultobj;
17740 fail:
17741   return NULL;
17742 }
17743 
17744 
_wrap_dh_generate_key(PyObject * self,PyObject * args)17745 SWIGINTERN PyObject *_wrap_dh_generate_key(PyObject *self, PyObject *args) {
17746   PyObject *resultobj = 0;
17747   DH *arg1 = (DH *) 0 ;
17748   void *argp1 = 0 ;
17749   int res1 = 0 ;
17750   PyObject *swig_obj[1] ;
17751   int result;
17752 
17753   if (!args) SWIG_fail;
17754   swig_obj[0] = args;
17755   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
17756   if (!SWIG_IsOK(res1)) {
17757     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_generate_key" "', argument " "1"" of type '" "DH *""'");
17758   }
17759   arg1 = (DH *)(argp1);
17760   {
17761     if (!arg1) {
17762       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17763     }
17764   }
17765   result = (int)DH_generate_key(arg1);
17766   {
17767     resultobj=PyLong_FromLong(result);
17768     if (PyErr_Occurred()) SWIG_fail;
17769   }
17770   return resultobj;
17771 fail:
17772   return NULL;
17773 }
17774 
17775 
_wrap_dhparams_print(PyObject * self,PyObject * args)17776 SWIGINTERN PyObject *_wrap_dhparams_print(PyObject *self, PyObject *args) {
17777   PyObject *resultobj = 0;
17778   BIO *arg1 = (BIO *) 0 ;
17779   DH *arg2 = (DH *) 0 ;
17780   void *argp1 = 0 ;
17781   int res1 = 0 ;
17782   void *argp2 = 0 ;
17783   int res2 = 0 ;
17784   PyObject *swig_obj[2] ;
17785   int result;
17786 
17787   if (!SWIG_Python_UnpackTuple(args, "dhparams_print", 2, 2, swig_obj)) SWIG_fail;
17788   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
17789   if (!SWIG_IsOK(res1)) {
17790     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dhparams_print" "', argument " "1"" of type '" "BIO *""'");
17791   }
17792   arg1 = (BIO *)(argp1);
17793   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_DH, 0 |  0 );
17794   if (!SWIG_IsOK(res2)) {
17795     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dhparams_print" "', argument " "2"" of type '" "DH const *""'");
17796   }
17797   arg2 = (DH *)(argp2);
17798   {
17799     if (!arg1) {
17800       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17801     }
17802   }
17803   {
17804     if (!arg2) {
17805       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17806     }
17807   }
17808   {
17809     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17810     result = (int)DHparams_print(arg1,(DH const *)arg2);
17811     SWIG_PYTHON_THREAD_END_ALLOW;
17812   }
17813   {
17814     resultobj=PyLong_FromLong(result);
17815     if (PyErr_Occurred()) SWIG_fail;
17816   }
17817   return resultobj;
17818 fail:
17819   return NULL;
17820 }
17821 
17822 
Swig_var__dh_err_set(PyObject * _val)17823 SWIGINTERN int Swig_var__dh_err_set(PyObject *_val) {
17824   {
17825     void *argp = 0;
17826     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
17827     if (!SWIG_IsOK(res)) {
17828       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_dh_err""' of type '""PyObject *""'");
17829     }
17830     _dh_err = (PyObject *)(argp);
17831   }
17832   return 0;
17833 fail:
17834   return 1;
17835 }
17836 
17837 
Swig_var__dh_err_get(void)17838 SWIGINTERN PyObject *Swig_var__dh_err_get(void) {
17839   PyObject *pyobj = 0;
17840   PyObject *self = 0;
17841 
17842   (void)self;
17843   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_dh_err), SWIGTYPE_p_PyObject,  0 );
17844   return pyobj;
17845 }
17846 
17847 
_wrap_dh_init(PyObject * self,PyObject * args)17848 SWIGINTERN PyObject *_wrap_dh_init(PyObject *self, PyObject *args) {
17849   PyObject *resultobj = 0;
17850   PyObject *arg1 = (PyObject *) 0 ;
17851   PyObject *swig_obj[1] ;
17852 
17853   if (!args) SWIG_fail;
17854   swig_obj[0] = args;
17855   {
17856     arg1=swig_obj[0];
17857   }
17858   dh_init(arg1);
17859   resultobj = SWIG_Py_Void();
17860   return resultobj;
17861 fail:
17862   return NULL;
17863 }
17864 
17865 
_wrap_dh_type_check(PyObject * self,PyObject * args)17866 SWIGINTERN PyObject *_wrap_dh_type_check(PyObject *self, PyObject *args) {
17867   PyObject *resultobj = 0;
17868   DH *arg1 = (DH *) 0 ;
17869   void *argp1 = 0 ;
17870   int res1 = 0 ;
17871   PyObject *swig_obj[1] ;
17872   int result;
17873 
17874   if (!args) SWIG_fail;
17875   swig_obj[0] = args;
17876   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
17877   if (!SWIG_IsOK(res1)) {
17878     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_type_check" "', argument " "1"" of type '" "DH *""'");
17879   }
17880   arg1 = (DH *)(argp1);
17881   {
17882     if (!arg1) {
17883       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17884     }
17885   }
17886   result = (int)dh_type_check(arg1);
17887   {
17888     resultobj=PyLong_FromLong(result);
17889     if (PyErr_Occurred()) SWIG_fail;
17890   }
17891   return resultobj;
17892 fail:
17893   return NULL;
17894 }
17895 
17896 
_wrap_dh_read_parameters(PyObject * self,PyObject * args)17897 SWIGINTERN PyObject *_wrap_dh_read_parameters(PyObject *self, PyObject *args) {
17898   PyObject *resultobj = 0;
17899   BIO *arg1 = (BIO *) 0 ;
17900   void *argp1 = 0 ;
17901   int res1 = 0 ;
17902   PyObject *swig_obj[1] ;
17903   DH *result = 0 ;
17904 
17905   if (!args) SWIG_fail;
17906   swig_obj[0] = args;
17907   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
17908   if (!SWIG_IsOK(res1)) {
17909     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_read_parameters" "', argument " "1"" of type '" "BIO *""'");
17910   }
17911   arg1 = (BIO *)(argp1);
17912   {
17913     if (!arg1) {
17914       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17915     }
17916   }
17917   {
17918     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
17919     result = (DH *)dh_read_parameters(arg1);
17920     SWIG_PYTHON_THREAD_END_ALLOW;
17921   }
17922   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DH, 0 |  0 );
17923   return resultobj;
17924 fail:
17925   return NULL;
17926 }
17927 
17928 
_wrap_dh_generate_parameters(PyObject * self,PyObject * args)17929 SWIGINTERN PyObject *_wrap_dh_generate_parameters(PyObject *self, PyObject *args) {
17930   PyObject *resultobj = 0;
17931   int arg1 ;
17932   int arg2 ;
17933   PyObject *arg3 = (PyObject *) 0 ;
17934   int val1 ;
17935   int ecode1 = 0 ;
17936   int val2 ;
17937   int ecode2 = 0 ;
17938   PyObject *swig_obj[3] ;
17939   DH *result = 0 ;
17940 
17941   if (!SWIG_Python_UnpackTuple(args, "dh_generate_parameters", 3, 3, swig_obj)) SWIG_fail;
17942   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
17943   if (!SWIG_IsOK(ecode1)) {
17944     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dh_generate_parameters" "', argument " "1"" of type '" "int""'");
17945   }
17946   arg1 = (int)(val1);
17947   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
17948   if (!SWIG_IsOK(ecode2)) {
17949     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "dh_generate_parameters" "', argument " "2"" of type '" "int""'");
17950   }
17951   arg2 = (int)(val2);
17952   {
17953     if (!PyCallable_Check(swig_obj[2])) {
17954       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
17955       return NULL;
17956     }
17957     arg3=swig_obj[2];
17958   }
17959   result = (DH *)dh_generate_parameters(arg1,arg2,arg3);
17960   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DH, 0 |  0 );
17961   return resultobj;
17962 fail:
17963   return NULL;
17964 }
17965 
17966 
_wrap_dh_check(PyObject * self,PyObject * args)17967 SWIGINTERN PyObject *_wrap_dh_check(PyObject *self, PyObject *args) {
17968   PyObject *resultobj = 0;
17969   DH *arg1 = (DH *) 0 ;
17970   void *argp1 = 0 ;
17971   int res1 = 0 ;
17972   PyObject *swig_obj[1] ;
17973   int result;
17974 
17975   if (!args) SWIG_fail;
17976   swig_obj[0] = args;
17977   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
17978   if (!SWIG_IsOK(res1)) {
17979     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_check" "', argument " "1"" of type '" "DH *""'");
17980   }
17981   arg1 = (DH *)(argp1);
17982   {
17983     if (!arg1) {
17984       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
17985     }
17986   }
17987   result = (int)dh_check(arg1);
17988   {
17989     resultobj=PyLong_FromLong(result);
17990     if (PyErr_Occurred()) SWIG_fail;
17991   }
17992   return resultobj;
17993 fail:
17994   return NULL;
17995 }
17996 
17997 
_wrap_dh_compute_key(PyObject * self,PyObject * args)17998 SWIGINTERN PyObject *_wrap_dh_compute_key(PyObject *self, PyObject *args) {
17999   PyObject *resultobj = 0;
18000   DH *arg1 = (DH *) 0 ;
18001   PyObject *arg2 = (PyObject *) 0 ;
18002   void *argp1 = 0 ;
18003   int res1 = 0 ;
18004   PyObject *swig_obj[2] ;
18005   PyObject *result = 0 ;
18006 
18007   if (!SWIG_Python_UnpackTuple(args, "dh_compute_key", 2, 2, swig_obj)) SWIG_fail;
18008   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
18009   if (!SWIG_IsOK(res1)) {
18010     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_compute_key" "', argument " "1"" of type '" "DH *""'");
18011   }
18012   arg1 = (DH *)(argp1);
18013   {
18014     arg2=swig_obj[1];
18015   }
18016   {
18017     if (!arg1) {
18018       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18019     }
18020   }
18021   result = (PyObject *)dh_compute_key(arg1,arg2);
18022   {
18023     resultobj=result;
18024   }
18025   return resultobj;
18026 fail:
18027   return NULL;
18028 }
18029 
18030 
_wrap_dh_get_p(PyObject * self,PyObject * args)18031 SWIGINTERN PyObject *_wrap_dh_get_p(PyObject *self, PyObject *args) {
18032   PyObject *resultobj = 0;
18033   DH *arg1 = (DH *) 0 ;
18034   void *argp1 = 0 ;
18035   int res1 = 0 ;
18036   PyObject *swig_obj[1] ;
18037   PyObject *result = 0 ;
18038 
18039   if (!args) SWIG_fail;
18040   swig_obj[0] = args;
18041   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
18042   if (!SWIG_IsOK(res1)) {
18043     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_p" "', argument " "1"" of type '" "DH *""'");
18044   }
18045   arg1 = (DH *)(argp1);
18046   {
18047     if (!arg1) {
18048       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18049     }
18050   }
18051   result = (PyObject *)dh_get_p(arg1);
18052   {
18053     resultobj=result;
18054   }
18055   return resultobj;
18056 fail:
18057   return NULL;
18058 }
18059 
18060 
_wrap_dh_get_g(PyObject * self,PyObject * args)18061 SWIGINTERN PyObject *_wrap_dh_get_g(PyObject *self, PyObject *args) {
18062   PyObject *resultobj = 0;
18063   DH *arg1 = (DH *) 0 ;
18064   void *argp1 = 0 ;
18065   int res1 = 0 ;
18066   PyObject *swig_obj[1] ;
18067   PyObject *result = 0 ;
18068 
18069   if (!args) SWIG_fail;
18070   swig_obj[0] = args;
18071   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
18072   if (!SWIG_IsOK(res1)) {
18073     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_g" "', argument " "1"" of type '" "DH *""'");
18074   }
18075   arg1 = (DH *)(argp1);
18076   {
18077     if (!arg1) {
18078       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18079     }
18080   }
18081   result = (PyObject *)dh_get_g(arg1);
18082   {
18083     resultobj=result;
18084   }
18085   return resultobj;
18086 fail:
18087   return NULL;
18088 }
18089 
18090 
_wrap_dh_get_pub(PyObject * self,PyObject * args)18091 SWIGINTERN PyObject *_wrap_dh_get_pub(PyObject *self, PyObject *args) {
18092   PyObject *resultobj = 0;
18093   DH *arg1 = (DH *) 0 ;
18094   void *argp1 = 0 ;
18095   int res1 = 0 ;
18096   PyObject *swig_obj[1] ;
18097   PyObject *result = 0 ;
18098 
18099   if (!args) SWIG_fail;
18100   swig_obj[0] = args;
18101   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
18102   if (!SWIG_IsOK(res1)) {
18103     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_pub" "', argument " "1"" of type '" "DH *""'");
18104   }
18105   arg1 = (DH *)(argp1);
18106   {
18107     if (!arg1) {
18108       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18109     }
18110   }
18111   result = (PyObject *)dh_get_pub(arg1);
18112   {
18113     resultobj=result;
18114   }
18115   return resultobj;
18116 fail:
18117   return NULL;
18118 }
18119 
18120 
_wrap_dh_get_priv(PyObject * self,PyObject * args)18121 SWIGINTERN PyObject *_wrap_dh_get_priv(PyObject *self, PyObject *args) {
18122   PyObject *resultobj = 0;
18123   DH *arg1 = (DH *) 0 ;
18124   void *argp1 = 0 ;
18125   int res1 = 0 ;
18126   PyObject *swig_obj[1] ;
18127   PyObject *result = 0 ;
18128 
18129   if (!args) SWIG_fail;
18130   swig_obj[0] = args;
18131   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
18132   if (!SWIG_IsOK(res1)) {
18133     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_get_priv" "', argument " "1"" of type '" "DH *""'");
18134   }
18135   arg1 = (DH *)(argp1);
18136   {
18137     if (!arg1) {
18138       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18139     }
18140   }
18141   result = (PyObject *)dh_get_priv(arg1);
18142   {
18143     resultobj=result;
18144   }
18145   return resultobj;
18146 fail:
18147   return NULL;
18148 }
18149 
18150 
_wrap_dh_set_pg(PyObject * self,PyObject * args)18151 SWIGINTERN PyObject *_wrap_dh_set_pg(PyObject *self, PyObject *args) {
18152   PyObject *resultobj = 0;
18153   DH *arg1 = (DH *) 0 ;
18154   PyObject *arg2 = (PyObject *) 0 ;
18155   PyObject *arg3 = (PyObject *) 0 ;
18156   void *argp1 = 0 ;
18157   int res1 = 0 ;
18158   PyObject *swig_obj[3] ;
18159   PyObject *result = 0 ;
18160 
18161   if (!SWIG_Python_UnpackTuple(args, "dh_set_pg", 3, 3, swig_obj)) SWIG_fail;
18162   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DH, 0 |  0 );
18163   if (!SWIG_IsOK(res1)) {
18164     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dh_set_pg" "', argument " "1"" of type '" "DH *""'");
18165   }
18166   arg1 = (DH *)(argp1);
18167   {
18168     arg2=swig_obj[1];
18169   }
18170   {
18171     arg3=swig_obj[2];
18172   }
18173   {
18174     if (!arg1) {
18175       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18176     }
18177   }
18178   result = (PyObject *)dh_set_pg(arg1,arg2,arg3);
18179   {
18180     resultobj=result;
18181   }
18182   return resultobj;
18183 fail:
18184   return NULL;
18185 }
18186 
18187 
_wrap_rsa_size(PyObject * self,PyObject * args)18188 SWIGINTERN PyObject *_wrap_rsa_size(PyObject *self, PyObject *args) {
18189   PyObject *resultobj = 0;
18190   RSA *arg1 = (RSA *) 0 ;
18191   void *argp1 = 0 ;
18192   int res1 = 0 ;
18193   PyObject *swig_obj[1] ;
18194   int result;
18195 
18196   if (!args) SWIG_fail;
18197   swig_obj[0] = args;
18198   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18199   if (!SWIG_IsOK(res1)) {
18200     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_size" "', argument " "1"" of type '" "RSA const *""'");
18201   }
18202   arg1 = (RSA *)(argp1);
18203   {
18204     if (!arg1) {
18205       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18206     }
18207   }
18208   result = (int)RSA_size((RSA const *)arg1);
18209   {
18210     resultobj=PyLong_FromLong(result);
18211     if (PyErr_Occurred()) SWIG_fail;
18212   }
18213   return resultobj;
18214 fail:
18215   return NULL;
18216 }
18217 
18218 
_wrap_rsa_new(PyObject * self,PyObject * args)18219 SWIGINTERN PyObject *_wrap_rsa_new(PyObject *self, PyObject *args) {
18220   PyObject *resultobj = 0;
18221   RSA *result = 0 ;
18222 
18223   if (!SWIG_Python_UnpackTuple(args, "rsa_new", 0, 0, 0)) SWIG_fail;
18224   result = (RSA *)RSA_new();
18225   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RSA, 0 |  0 );
18226   return resultobj;
18227 fail:
18228   return NULL;
18229 }
18230 
18231 
_wrap_rsa_free(PyObject * self,PyObject * args)18232 SWIGINTERN PyObject *_wrap_rsa_free(PyObject *self, PyObject *args) {
18233   PyObject *resultobj = 0;
18234   RSA *arg1 = (RSA *) 0 ;
18235   void *argp1 = 0 ;
18236   int res1 = 0 ;
18237   PyObject *swig_obj[1] ;
18238 
18239   if (!args) SWIG_fail;
18240   swig_obj[0] = args;
18241   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18242   if (!SWIG_IsOK(res1)) {
18243     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_free" "', argument " "1"" of type '" "RSA *""'");
18244   }
18245   arg1 = (RSA *)(argp1);
18246   {
18247     if (!arg1) {
18248       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18249     }
18250   }
18251   RSA_free(arg1);
18252   resultobj = SWIG_Py_Void();
18253   return resultobj;
18254 fail:
18255   return NULL;
18256 }
18257 
18258 
_wrap_rsa_check_key(PyObject * self,PyObject * args)18259 SWIGINTERN PyObject *_wrap_rsa_check_key(PyObject *self, PyObject *args) {
18260   PyObject *resultobj = 0;
18261   RSA *arg1 = (RSA *) 0 ;
18262   void *argp1 = 0 ;
18263   int res1 = 0 ;
18264   PyObject *swig_obj[1] ;
18265   int result;
18266 
18267   if (!args) SWIG_fail;
18268   swig_obj[0] = args;
18269   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18270   if (!SWIG_IsOK(res1)) {
18271     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_check_key" "', argument " "1"" of type '" "RSA const *""'");
18272   }
18273   arg1 = (RSA *)(argp1);
18274   {
18275     if (!arg1) {
18276       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18277     }
18278   }
18279   result = (int)RSA_check_key((RSA const *)arg1);
18280   {
18281     resultobj=PyLong_FromLong(result);
18282     if (PyErr_Occurred()) SWIG_fail;
18283   }
18284   return resultobj;
18285 fail:
18286   return NULL;
18287 }
18288 
18289 
Swig_var__rsa_err_set(PyObject * _val)18290 SWIGINTERN int Swig_var__rsa_err_set(PyObject *_val) {
18291   {
18292     void *argp = 0;
18293     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
18294     if (!SWIG_IsOK(res)) {
18295       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_rsa_err""' of type '""PyObject *""'");
18296     }
18297     _rsa_err = (PyObject *)(argp);
18298   }
18299   return 0;
18300 fail:
18301   return 1;
18302 }
18303 
18304 
Swig_var__rsa_err_get(void)18305 SWIGINTERN PyObject *Swig_var__rsa_err_get(void) {
18306   PyObject *pyobj = 0;
18307   PyObject *self = 0;
18308 
18309   (void)self;
18310   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_rsa_err), SWIGTYPE_p_PyObject,  0 );
18311   return pyobj;
18312 }
18313 
18314 
_wrap_rsa_init(PyObject * self,PyObject * args)18315 SWIGINTERN PyObject *_wrap_rsa_init(PyObject *self, PyObject *args) {
18316   PyObject *resultobj = 0;
18317   PyObject *arg1 = (PyObject *) 0 ;
18318   PyObject *swig_obj[1] ;
18319 
18320   if (!args) SWIG_fail;
18321   swig_obj[0] = args;
18322   {
18323     arg1=swig_obj[0];
18324   }
18325   rsa_init(arg1);
18326   resultobj = SWIG_Py_Void();
18327   return resultobj;
18328 fail:
18329   return NULL;
18330 }
18331 
18332 
_wrap_rsa_read_key(PyObject * self,PyObject * args)18333 SWIGINTERN PyObject *_wrap_rsa_read_key(PyObject *self, PyObject *args) {
18334   PyObject *resultobj = 0;
18335   BIO *arg1 = (BIO *) 0 ;
18336   PyObject *arg2 = (PyObject *) 0 ;
18337   void *argp1 = 0 ;
18338   int res1 = 0 ;
18339   PyObject *swig_obj[2] ;
18340   RSA *result = 0 ;
18341 
18342   if (!SWIG_Python_UnpackTuple(args, "rsa_read_key", 2, 2, swig_obj)) SWIG_fail;
18343   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
18344   if (!SWIG_IsOK(res1)) {
18345     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_read_key" "', argument " "1"" of type '" "BIO *""'");
18346   }
18347   arg1 = (BIO *)(argp1);
18348   {
18349     if (!PyCallable_Check(swig_obj[1])) {
18350       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
18351       return NULL;
18352     }
18353     arg2=swig_obj[1];
18354   }
18355   {
18356     if (!arg1) {
18357       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18358     }
18359   }
18360   {
18361     if (!arg2) {
18362       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18363     }
18364   }
18365   result = (RSA *)rsa_read_key(arg1,arg2);
18366   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RSA, 0 |  0 );
18367   return resultobj;
18368 fail:
18369   return NULL;
18370 }
18371 
18372 
_wrap_rsa_write_key(PyObject * self,PyObject * args)18373 SWIGINTERN PyObject *_wrap_rsa_write_key(PyObject *self, PyObject *args) {
18374   PyObject *resultobj = 0;
18375   RSA *arg1 = (RSA *) 0 ;
18376   BIO *arg2 = (BIO *) 0 ;
18377   EVP_CIPHER *arg3 = (EVP_CIPHER *) 0 ;
18378   PyObject *arg4 = (PyObject *) 0 ;
18379   void *argp1 = 0 ;
18380   int res1 = 0 ;
18381   void *argp2 = 0 ;
18382   int res2 = 0 ;
18383   void *argp3 = 0 ;
18384   int res3 = 0 ;
18385   PyObject *swig_obj[4] ;
18386   int result;
18387 
18388   if (!SWIG_Python_UnpackTuple(args, "rsa_write_key", 4, 4, swig_obj)) SWIG_fail;
18389   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18390   if (!SWIG_IsOK(res1)) {
18391     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key" "', argument " "1"" of type '" "RSA *""'");
18392   }
18393   arg1 = (RSA *)(argp1);
18394   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
18395   if (!SWIG_IsOK(res2)) {
18396     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rsa_write_key" "', argument " "2"" of type '" "BIO *""'");
18397   }
18398   arg2 = (BIO *)(argp2);
18399   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
18400   if (!SWIG_IsOK(res3)) {
18401     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "rsa_write_key" "', argument " "3"" of type '" "EVP_CIPHER *""'");
18402   }
18403   arg3 = (EVP_CIPHER *)(argp3);
18404   {
18405     if (!PyCallable_Check(swig_obj[3])) {
18406       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
18407       return NULL;
18408     }
18409     arg4=swig_obj[3];
18410   }
18411   {
18412     if (!arg1) {
18413       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18414     }
18415   }
18416   {
18417     if (!arg2) {
18418       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18419     }
18420   }
18421   {
18422     if (!arg3) {
18423       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18424     }
18425   }
18426   {
18427     if (!arg4) {
18428       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18429     }
18430   }
18431   result = (int)rsa_write_key(arg1,arg2,arg3,arg4);
18432   {
18433     resultobj=PyLong_FromLong(result);
18434     if (PyErr_Occurred()) SWIG_fail;
18435   }
18436   return resultobj;
18437 fail:
18438   return NULL;
18439 }
18440 
18441 
_wrap_rsa_write_key_no_cipher(PyObject * self,PyObject * args)18442 SWIGINTERN PyObject *_wrap_rsa_write_key_no_cipher(PyObject *self, PyObject *args) {
18443   PyObject *resultobj = 0;
18444   RSA *arg1 = (RSA *) 0 ;
18445   BIO *arg2 = (BIO *) 0 ;
18446   PyObject *arg3 = (PyObject *) 0 ;
18447   void *argp1 = 0 ;
18448   int res1 = 0 ;
18449   void *argp2 = 0 ;
18450   int res2 = 0 ;
18451   PyObject *swig_obj[3] ;
18452   int result;
18453 
18454   if (!SWIG_Python_UnpackTuple(args, "rsa_write_key_no_cipher", 3, 3, swig_obj)) SWIG_fail;
18455   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18456   if (!SWIG_IsOK(res1)) {
18457     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key_no_cipher" "', argument " "1"" of type '" "RSA *""'");
18458   }
18459   arg1 = (RSA *)(argp1);
18460   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
18461   if (!SWIG_IsOK(res2)) {
18462     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rsa_write_key_no_cipher" "', argument " "2"" of type '" "BIO *""'");
18463   }
18464   arg2 = (BIO *)(argp2);
18465   {
18466     if (!PyCallable_Check(swig_obj[2])) {
18467       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
18468       return NULL;
18469     }
18470     arg3=swig_obj[2];
18471   }
18472   {
18473     if (!arg1) {
18474       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18475     }
18476   }
18477   {
18478     if (!arg2) {
18479       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18480     }
18481   }
18482   {
18483     if (!arg3) {
18484       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18485     }
18486   }
18487   result = (int)rsa_write_key_no_cipher(arg1,arg2,arg3);
18488   {
18489     resultobj=PyLong_FromLong(result);
18490     if (PyErr_Occurred()) SWIG_fail;
18491   }
18492   return resultobj;
18493 fail:
18494   return NULL;
18495 }
18496 
18497 
_wrap_rsa_read_pub_key(PyObject * self,PyObject * args)18498 SWIGINTERN PyObject *_wrap_rsa_read_pub_key(PyObject *self, PyObject *args) {
18499   PyObject *resultobj = 0;
18500   BIO *arg1 = (BIO *) 0 ;
18501   void *argp1 = 0 ;
18502   int res1 = 0 ;
18503   PyObject *swig_obj[1] ;
18504   RSA *result = 0 ;
18505 
18506   if (!args) SWIG_fail;
18507   swig_obj[0] = args;
18508   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
18509   if (!SWIG_IsOK(res1)) {
18510     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_read_pub_key" "', argument " "1"" of type '" "BIO *""'");
18511   }
18512   arg1 = (BIO *)(argp1);
18513   {
18514     if (!arg1) {
18515       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18516     }
18517   }
18518   {
18519     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18520     result = (RSA *)rsa_read_pub_key(arg1);
18521     SWIG_PYTHON_THREAD_END_ALLOW;
18522   }
18523   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_RSA, 0 |  0 );
18524   return resultobj;
18525 fail:
18526   return NULL;
18527 }
18528 
18529 
_wrap_rsa_write_pub_key(PyObject * self,PyObject * args)18530 SWIGINTERN PyObject *_wrap_rsa_write_pub_key(PyObject *self, PyObject *args) {
18531   PyObject *resultobj = 0;
18532   RSA *arg1 = (RSA *) 0 ;
18533   BIO *arg2 = (BIO *) 0 ;
18534   void *argp1 = 0 ;
18535   int res1 = 0 ;
18536   void *argp2 = 0 ;
18537   int res2 = 0 ;
18538   PyObject *swig_obj[2] ;
18539   int result;
18540 
18541   if (!SWIG_Python_UnpackTuple(args, "rsa_write_pub_key", 2, 2, swig_obj)) SWIG_fail;
18542   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18543   if (!SWIG_IsOK(res1)) {
18544     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_pub_key" "', argument " "1"" of type '" "RSA *""'");
18545   }
18546   arg1 = (RSA *)(argp1);
18547   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
18548   if (!SWIG_IsOK(res2)) {
18549     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rsa_write_pub_key" "', argument " "2"" of type '" "BIO *""'");
18550   }
18551   arg2 = (BIO *)(argp2);
18552   {
18553     if (!arg1) {
18554       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18555     }
18556   }
18557   {
18558     if (!arg2) {
18559       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18560     }
18561   }
18562   {
18563     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
18564     result = (int)rsa_write_pub_key(arg1,arg2);
18565     SWIG_PYTHON_THREAD_END_ALLOW;
18566   }
18567   {
18568     resultobj=PyLong_FromLong(result);
18569     if (PyErr_Occurred()) SWIG_fail;
18570   }
18571   return resultobj;
18572 fail:
18573   return NULL;
18574 }
18575 
18576 
_wrap_rsa_get_e(PyObject * self,PyObject * args)18577 SWIGINTERN PyObject *_wrap_rsa_get_e(PyObject *self, PyObject *args) {
18578   PyObject *resultobj = 0;
18579   RSA *arg1 = (RSA *) 0 ;
18580   void *argp1 = 0 ;
18581   int res1 = 0 ;
18582   PyObject *swig_obj[1] ;
18583   PyObject *result = 0 ;
18584 
18585   if (!args) SWIG_fail;
18586   swig_obj[0] = args;
18587   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18588   if (!SWIG_IsOK(res1)) {
18589     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_get_e" "', argument " "1"" of type '" "RSA *""'");
18590   }
18591   arg1 = (RSA *)(argp1);
18592   {
18593     if (!arg1) {
18594       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18595     }
18596   }
18597   result = (PyObject *)rsa_get_e(arg1);
18598   {
18599     resultobj=result;
18600   }
18601   return resultobj;
18602 fail:
18603   return NULL;
18604 }
18605 
18606 
_wrap_rsa_get_n(PyObject * self,PyObject * args)18607 SWIGINTERN PyObject *_wrap_rsa_get_n(PyObject *self, PyObject *args) {
18608   PyObject *resultobj = 0;
18609   RSA *arg1 = (RSA *) 0 ;
18610   void *argp1 = 0 ;
18611   int res1 = 0 ;
18612   PyObject *swig_obj[1] ;
18613   PyObject *result = 0 ;
18614 
18615   if (!args) SWIG_fail;
18616   swig_obj[0] = args;
18617   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18618   if (!SWIG_IsOK(res1)) {
18619     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_get_n" "', argument " "1"" of type '" "RSA *""'");
18620   }
18621   arg1 = (RSA *)(argp1);
18622   {
18623     if (!arg1) {
18624       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18625     }
18626   }
18627   result = (PyObject *)rsa_get_n(arg1);
18628   {
18629     resultobj=result;
18630   }
18631   return resultobj;
18632 fail:
18633   return NULL;
18634 }
18635 
18636 
_wrap_rsa_set_e(PyObject * self,PyObject * args)18637 SWIGINTERN PyObject *_wrap_rsa_set_e(PyObject *self, PyObject *args) {
18638   PyObject *resultobj = 0;
18639   RSA *arg1 = (RSA *) 0 ;
18640   PyObject *arg2 = (PyObject *) 0 ;
18641   void *argp1 = 0 ;
18642   int res1 = 0 ;
18643   PyObject *swig_obj[2] ;
18644   PyObject *result = 0 ;
18645 
18646   if (!SWIG_Python_UnpackTuple(args, "rsa_set_e", 2, 2, swig_obj)) SWIG_fail;
18647   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18648   if (!SWIG_IsOK(res1)) {
18649     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_e" "', argument " "1"" of type '" "RSA *""'");
18650   }
18651   arg1 = (RSA *)(argp1);
18652   {
18653     arg2=swig_obj[1];
18654   }
18655   {
18656     if (!arg1) {
18657       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18658     }
18659   }
18660   result = (PyObject *)rsa_set_e(arg1,arg2);
18661   {
18662     resultobj=result;
18663   }
18664   return resultobj;
18665 fail:
18666   return NULL;
18667 }
18668 
18669 
_wrap_rsa_set_n(PyObject * self,PyObject * args)18670 SWIGINTERN PyObject *_wrap_rsa_set_n(PyObject *self, PyObject *args) {
18671   PyObject *resultobj = 0;
18672   RSA *arg1 = (RSA *) 0 ;
18673   PyObject *arg2 = (PyObject *) 0 ;
18674   void *argp1 = 0 ;
18675   int res1 = 0 ;
18676   PyObject *swig_obj[2] ;
18677   PyObject *result = 0 ;
18678 
18679   if (!SWIG_Python_UnpackTuple(args, "rsa_set_n", 2, 2, swig_obj)) SWIG_fail;
18680   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18681   if (!SWIG_IsOK(res1)) {
18682     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_n" "', argument " "1"" of type '" "RSA *""'");
18683   }
18684   arg1 = (RSA *)(argp1);
18685   {
18686     arg2=swig_obj[1];
18687   }
18688   {
18689     if (!arg1) {
18690       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18691     }
18692   }
18693   result = (PyObject *)rsa_set_n(arg1,arg2);
18694   {
18695     resultobj=result;
18696   }
18697   return resultobj;
18698 fail:
18699   return NULL;
18700 }
18701 
18702 
_wrap_rsa_set_en(PyObject * self,PyObject * args)18703 SWIGINTERN PyObject *_wrap_rsa_set_en(PyObject *self, PyObject *args) {
18704   PyObject *resultobj = 0;
18705   RSA *arg1 = (RSA *) 0 ;
18706   PyObject *arg2 = (PyObject *) 0 ;
18707   PyObject *arg3 = (PyObject *) 0 ;
18708   void *argp1 = 0 ;
18709   int res1 = 0 ;
18710   PyObject *swig_obj[3] ;
18711   PyObject *result = 0 ;
18712 
18713   if (!SWIG_Python_UnpackTuple(args, "rsa_set_en", 3, 3, swig_obj)) SWIG_fail;
18714   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18715   if (!SWIG_IsOK(res1)) {
18716     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_en" "', argument " "1"" of type '" "RSA *""'");
18717   }
18718   arg1 = (RSA *)(argp1);
18719   {
18720     arg2=swig_obj[1];
18721   }
18722   {
18723     arg3=swig_obj[2];
18724   }
18725   {
18726     if (!arg1) {
18727       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18728     }
18729   }
18730   result = (PyObject *)rsa_set_en(arg1,arg2,arg3);
18731   {
18732     resultobj=result;
18733   }
18734   return resultobj;
18735 fail:
18736   return NULL;
18737 }
18738 
18739 
_wrap_PyObject_Bin_AsBIGNUM(PyObject * self,PyObject * args)18740 SWIGINTERN PyObject *_wrap_PyObject_Bin_AsBIGNUM(PyObject *self, PyObject *args) {
18741   PyObject *resultobj = 0;
18742   PyObject *arg1 = (PyObject *) 0 ;
18743   PyObject *swig_obj[1] ;
18744   BIGNUM *result = 0 ;
18745 
18746   if (!args) SWIG_fail;
18747   swig_obj[0] = args;
18748   {
18749     arg1=swig_obj[0];
18750   }
18751   result = (BIGNUM *)PyObject_Bin_AsBIGNUM(arg1);
18752   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIGNUM, 0 |  0 );
18753   return resultobj;
18754 fail:
18755   return NULL;
18756 }
18757 
18758 
_wrap_rsa_set_en_bin(PyObject * self,PyObject * args)18759 SWIGINTERN PyObject *_wrap_rsa_set_en_bin(PyObject *self, PyObject *args) {
18760   PyObject *resultobj = 0;
18761   RSA *arg1 = (RSA *) 0 ;
18762   PyObject *arg2 = (PyObject *) 0 ;
18763   PyObject *arg3 = (PyObject *) 0 ;
18764   void *argp1 = 0 ;
18765   int res1 = 0 ;
18766   PyObject *swig_obj[3] ;
18767   PyObject *result = 0 ;
18768 
18769   if (!SWIG_Python_UnpackTuple(args, "rsa_set_en_bin", 3, 3, swig_obj)) SWIG_fail;
18770   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18771   if (!SWIG_IsOK(res1)) {
18772     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_set_en_bin" "', argument " "1"" of type '" "RSA *""'");
18773   }
18774   arg1 = (RSA *)(argp1);
18775   {
18776     arg2=swig_obj[1];
18777   }
18778   {
18779     arg3=swig_obj[2];
18780   }
18781   {
18782     if (!arg1) {
18783       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18784     }
18785   }
18786   result = (PyObject *)rsa_set_en_bin(arg1,arg2,arg3);
18787   {
18788     resultobj=result;
18789   }
18790   return resultobj;
18791 fail:
18792   return NULL;
18793 }
18794 
18795 
_wrap_rsa_private_encrypt(PyObject * self,PyObject * args)18796 SWIGINTERN PyObject *_wrap_rsa_private_encrypt(PyObject *self, PyObject *args) {
18797   PyObject *resultobj = 0;
18798   RSA *arg1 = (RSA *) 0 ;
18799   PyObject *arg2 = (PyObject *) 0 ;
18800   int arg3 ;
18801   void *argp1 = 0 ;
18802   int res1 = 0 ;
18803   int val3 ;
18804   int ecode3 = 0 ;
18805   PyObject *swig_obj[3] ;
18806   PyObject *result = 0 ;
18807 
18808   if (!SWIG_Python_UnpackTuple(args, "rsa_private_encrypt", 3, 3, swig_obj)) SWIG_fail;
18809   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18810   if (!SWIG_IsOK(res1)) {
18811     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_private_encrypt" "', argument " "1"" of type '" "RSA *""'");
18812   }
18813   arg1 = (RSA *)(argp1);
18814   {
18815     arg2=swig_obj[1];
18816   }
18817   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
18818   if (!SWIG_IsOK(ecode3)) {
18819     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_private_encrypt" "', argument " "3"" of type '" "int""'");
18820   }
18821   arg3 = (int)(val3);
18822   {
18823     if (!arg1) {
18824       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18825     }
18826   }
18827   result = (PyObject *)rsa_private_encrypt(arg1,arg2,arg3);
18828   {
18829     resultobj=result;
18830   }
18831   return resultobj;
18832 fail:
18833   return NULL;
18834 }
18835 
18836 
_wrap_rsa_public_decrypt(PyObject * self,PyObject * args)18837 SWIGINTERN PyObject *_wrap_rsa_public_decrypt(PyObject *self, PyObject *args) {
18838   PyObject *resultobj = 0;
18839   RSA *arg1 = (RSA *) 0 ;
18840   PyObject *arg2 = (PyObject *) 0 ;
18841   int arg3 ;
18842   void *argp1 = 0 ;
18843   int res1 = 0 ;
18844   int val3 ;
18845   int ecode3 = 0 ;
18846   PyObject *swig_obj[3] ;
18847   PyObject *result = 0 ;
18848 
18849   if (!SWIG_Python_UnpackTuple(args, "rsa_public_decrypt", 3, 3, swig_obj)) SWIG_fail;
18850   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18851   if (!SWIG_IsOK(res1)) {
18852     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_public_decrypt" "', argument " "1"" of type '" "RSA *""'");
18853   }
18854   arg1 = (RSA *)(argp1);
18855   {
18856     arg2=swig_obj[1];
18857   }
18858   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
18859   if (!SWIG_IsOK(ecode3)) {
18860     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_public_decrypt" "', argument " "3"" of type '" "int""'");
18861   }
18862   arg3 = (int)(val3);
18863   {
18864     if (!arg1) {
18865       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18866     }
18867   }
18868   result = (PyObject *)rsa_public_decrypt(arg1,arg2,arg3);
18869   {
18870     resultobj=result;
18871   }
18872   return resultobj;
18873 fail:
18874   return NULL;
18875 }
18876 
18877 
_wrap_rsa_public_encrypt(PyObject * self,PyObject * args)18878 SWIGINTERN PyObject *_wrap_rsa_public_encrypt(PyObject *self, PyObject *args) {
18879   PyObject *resultobj = 0;
18880   RSA *arg1 = (RSA *) 0 ;
18881   PyObject *arg2 = (PyObject *) 0 ;
18882   int arg3 ;
18883   void *argp1 = 0 ;
18884   int res1 = 0 ;
18885   int val3 ;
18886   int ecode3 = 0 ;
18887   PyObject *swig_obj[3] ;
18888   PyObject *result = 0 ;
18889 
18890   if (!SWIG_Python_UnpackTuple(args, "rsa_public_encrypt", 3, 3, swig_obj)) SWIG_fail;
18891   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18892   if (!SWIG_IsOK(res1)) {
18893     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_public_encrypt" "', argument " "1"" of type '" "RSA *""'");
18894   }
18895   arg1 = (RSA *)(argp1);
18896   {
18897     arg2=swig_obj[1];
18898   }
18899   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
18900   if (!SWIG_IsOK(ecode3)) {
18901     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_public_encrypt" "', argument " "3"" of type '" "int""'");
18902   }
18903   arg3 = (int)(val3);
18904   {
18905     if (!arg1) {
18906       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18907     }
18908   }
18909   result = (PyObject *)rsa_public_encrypt(arg1,arg2,arg3);
18910   {
18911     resultobj=result;
18912   }
18913   return resultobj;
18914 fail:
18915   return NULL;
18916 }
18917 
18918 
_wrap_rsa_private_decrypt(PyObject * self,PyObject * args)18919 SWIGINTERN PyObject *_wrap_rsa_private_decrypt(PyObject *self, PyObject *args) {
18920   PyObject *resultobj = 0;
18921   RSA *arg1 = (RSA *) 0 ;
18922   PyObject *arg2 = (PyObject *) 0 ;
18923   int arg3 ;
18924   void *argp1 = 0 ;
18925   int res1 = 0 ;
18926   int val3 ;
18927   int ecode3 = 0 ;
18928   PyObject *swig_obj[3] ;
18929   PyObject *result = 0 ;
18930 
18931   if (!SWIG_Python_UnpackTuple(args, "rsa_private_decrypt", 3, 3, swig_obj)) SWIG_fail;
18932   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18933   if (!SWIG_IsOK(res1)) {
18934     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_private_decrypt" "', argument " "1"" of type '" "RSA *""'");
18935   }
18936   arg1 = (RSA *)(argp1);
18937   {
18938     arg2=swig_obj[1];
18939   }
18940   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
18941   if (!SWIG_IsOK(ecode3)) {
18942     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_private_decrypt" "', argument " "3"" of type '" "int""'");
18943   }
18944   arg3 = (int)(val3);
18945   {
18946     if (!arg1) {
18947       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18948     }
18949   }
18950   result = (PyObject *)rsa_private_decrypt(arg1,arg2,arg3);
18951   {
18952     resultobj=result;
18953   }
18954   return resultobj;
18955 fail:
18956   return NULL;
18957 }
18958 
18959 
_wrap_rsa_padding_add_pkcs1_pss(PyObject * self,PyObject * args)18960 SWIGINTERN PyObject *_wrap_rsa_padding_add_pkcs1_pss(PyObject *self, PyObject *args) {
18961   PyObject *resultobj = 0;
18962   RSA *arg1 = (RSA *) 0 ;
18963   PyObject *arg2 = (PyObject *) 0 ;
18964   EVP_MD *arg3 = (EVP_MD *) 0 ;
18965   int arg4 ;
18966   void *argp1 = 0 ;
18967   int res1 = 0 ;
18968   void *argp3 = 0 ;
18969   int res3 = 0 ;
18970   int val4 ;
18971   int ecode4 = 0 ;
18972   PyObject *swig_obj[4] ;
18973   PyObject *result = 0 ;
18974 
18975   if (!SWIG_Python_UnpackTuple(args, "rsa_padding_add_pkcs1_pss", 4, 4, swig_obj)) SWIG_fail;
18976   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
18977   if (!SWIG_IsOK(res1)) {
18978     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_padding_add_pkcs1_pss" "', argument " "1"" of type '" "RSA *""'");
18979   }
18980   arg1 = (RSA *)(argp1);
18981   {
18982     arg2=swig_obj[1];
18983   }
18984   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_MD, 0 |  0 );
18985   if (!SWIG_IsOK(res3)) {
18986     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "rsa_padding_add_pkcs1_pss" "', argument " "3"" of type '" "EVP_MD *""'");
18987   }
18988   arg3 = (EVP_MD *)(argp3);
18989   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
18990   if (!SWIG_IsOK(ecode4)) {
18991     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "rsa_padding_add_pkcs1_pss" "', argument " "4"" of type '" "int""'");
18992   }
18993   arg4 = (int)(val4);
18994   {
18995     if (!arg1) {
18996       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
18997     }
18998   }
18999   {
19000     if (!arg3) {
19001       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19002     }
19003   }
19004   result = (PyObject *)rsa_padding_add_pkcs1_pss(arg1,arg2,arg3,arg4);
19005   {
19006     resultobj=result;
19007   }
19008   return resultobj;
19009 fail:
19010   return NULL;
19011 }
19012 
19013 
_wrap_rsa_verify_pkcs1_pss(PyObject * self,PyObject * args)19014 SWIGINTERN PyObject *_wrap_rsa_verify_pkcs1_pss(PyObject *self, PyObject *args) {
19015   PyObject *resultobj = 0;
19016   RSA *arg1 = (RSA *) 0 ;
19017   PyObject *arg2 = (PyObject *) 0 ;
19018   PyObject *arg3 = (PyObject *) 0 ;
19019   EVP_MD *arg4 = (EVP_MD *) 0 ;
19020   int arg5 ;
19021   void *argp1 = 0 ;
19022   int res1 = 0 ;
19023   void *argp4 = 0 ;
19024   int res4 = 0 ;
19025   int val5 ;
19026   int ecode5 = 0 ;
19027   PyObject *swig_obj[5] ;
19028   int result;
19029 
19030   if (!SWIG_Python_UnpackTuple(args, "rsa_verify_pkcs1_pss", 5, 5, swig_obj)) SWIG_fail;
19031   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
19032   if (!SWIG_IsOK(res1)) {
19033     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_verify_pkcs1_pss" "', argument " "1"" of type '" "RSA *""'");
19034   }
19035   arg1 = (RSA *)(argp1);
19036   {
19037     arg2=swig_obj[1];
19038   }
19039   {
19040     arg3=swig_obj[2];
19041   }
19042   res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_EVP_MD, 0 |  0 );
19043   if (!SWIG_IsOK(res4)) {
19044     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "rsa_verify_pkcs1_pss" "', argument " "4"" of type '" "EVP_MD *""'");
19045   }
19046   arg4 = (EVP_MD *)(argp4);
19047   ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
19048   if (!SWIG_IsOK(ecode5)) {
19049     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "rsa_verify_pkcs1_pss" "', argument " "5"" of type '" "int""'");
19050   }
19051   arg5 = (int)(val5);
19052   {
19053     if (!arg1) {
19054       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19055     }
19056   }
19057   {
19058     if (!arg4) {
19059       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19060     }
19061   }
19062   result = (int)rsa_verify_pkcs1_pss(arg1,arg2,arg3,arg4,arg5);
19063   {
19064     resultobj=PyLong_FromLong(result);
19065     if (PyErr_Occurred()) SWIG_fail;
19066   }
19067   return resultobj;
19068 fail:
19069   return NULL;
19070 }
19071 
19072 
_wrap_rsa_sign(PyObject * self,PyObject * args)19073 SWIGINTERN PyObject *_wrap_rsa_sign(PyObject *self, PyObject *args) {
19074   PyObject *resultobj = 0;
19075   RSA *arg1 = (RSA *) 0 ;
19076   PyObject *arg2 = (PyObject *) 0 ;
19077   int arg3 ;
19078   void *argp1 = 0 ;
19079   int res1 = 0 ;
19080   int val3 ;
19081   int ecode3 = 0 ;
19082   PyObject *swig_obj[3] ;
19083   PyObject *result = 0 ;
19084 
19085   if (!SWIG_Python_UnpackTuple(args, "rsa_sign", 3, 3, swig_obj)) SWIG_fail;
19086   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
19087   if (!SWIG_IsOK(res1)) {
19088     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_sign" "', argument " "1"" of type '" "RSA *""'");
19089   }
19090   arg1 = (RSA *)(argp1);
19091   {
19092     arg2=swig_obj[1];
19093   }
19094   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
19095   if (!SWIG_IsOK(ecode3)) {
19096     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "rsa_sign" "', argument " "3"" of type '" "int""'");
19097   }
19098   arg3 = (int)(val3);
19099   {
19100     if (!arg1) {
19101       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19102     }
19103   }
19104   result = (PyObject *)rsa_sign(arg1,arg2,arg3);
19105   {
19106     resultobj=result;
19107   }
19108   return resultobj;
19109 fail:
19110   return NULL;
19111 }
19112 
19113 
_wrap_rsa_verify(PyObject * self,PyObject * args)19114 SWIGINTERN PyObject *_wrap_rsa_verify(PyObject *self, PyObject *args) {
19115   PyObject *resultobj = 0;
19116   RSA *arg1 = (RSA *) 0 ;
19117   PyObject *arg2 = (PyObject *) 0 ;
19118   PyObject *arg3 = (PyObject *) 0 ;
19119   int arg4 ;
19120   void *argp1 = 0 ;
19121   int res1 = 0 ;
19122   int val4 ;
19123   int ecode4 = 0 ;
19124   PyObject *swig_obj[4] ;
19125   int result;
19126 
19127   if (!SWIG_Python_UnpackTuple(args, "rsa_verify", 4, 4, swig_obj)) SWIG_fail;
19128   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
19129   if (!SWIG_IsOK(res1)) {
19130     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_verify" "', argument " "1"" of type '" "RSA *""'");
19131   }
19132   arg1 = (RSA *)(argp1);
19133   {
19134     arg2=swig_obj[1];
19135   }
19136   {
19137     arg3=swig_obj[2];
19138   }
19139   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
19140   if (!SWIG_IsOK(ecode4)) {
19141     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "rsa_verify" "', argument " "4"" of type '" "int""'");
19142   }
19143   arg4 = (int)(val4);
19144   {
19145     if (!arg1) {
19146       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19147     }
19148   }
19149   result = (int)rsa_verify(arg1,arg2,arg3,arg4);
19150   {
19151     resultobj=PyLong_FromLong(result);
19152     if (PyErr_Occurred()) SWIG_fail;
19153   }
19154   return resultobj;
19155 fail:
19156   return NULL;
19157 }
19158 
19159 
_wrap_rsa_generate_key(PyObject * self,PyObject * args)19160 SWIGINTERN PyObject *_wrap_rsa_generate_key(PyObject *self, PyObject *args) {
19161   PyObject *resultobj = 0;
19162   int arg1 ;
19163   unsigned long arg2 ;
19164   PyObject *arg3 = (PyObject *) 0 ;
19165   int val1 ;
19166   int ecode1 = 0 ;
19167   unsigned long val2 ;
19168   int ecode2 = 0 ;
19169   PyObject *swig_obj[3] ;
19170   PyObject *result = 0 ;
19171 
19172   if (!SWIG_Python_UnpackTuple(args, "rsa_generate_key", 3, 3, swig_obj)) SWIG_fail;
19173   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
19174   if (!SWIG_IsOK(ecode1)) {
19175     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "rsa_generate_key" "', argument " "1"" of type '" "int""'");
19176   }
19177   arg1 = (int)(val1);
19178   ecode2 = SWIG_AsVal_unsigned_SS_long(swig_obj[1], &val2);
19179   if (!SWIG_IsOK(ecode2)) {
19180     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "rsa_generate_key" "', argument " "2"" of type '" "unsigned long""'");
19181   }
19182   arg2 = (unsigned long)(val2);
19183   {
19184     if (!PyCallable_Check(swig_obj[2])) {
19185       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
19186       return NULL;
19187     }
19188     arg3=swig_obj[2];
19189   }
19190   {
19191     if (!arg3) {
19192       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19193     }
19194   }
19195   result = (PyObject *)rsa_generate_key(arg1,arg2,arg3);
19196   {
19197     resultobj=result;
19198   }
19199   return resultobj;
19200 fail:
19201   return NULL;
19202 }
19203 
19204 
_wrap_rsa_type_check(PyObject * self,PyObject * args)19205 SWIGINTERN PyObject *_wrap_rsa_type_check(PyObject *self, PyObject *args) {
19206   PyObject *resultobj = 0;
19207   RSA *arg1 = (RSA *) 0 ;
19208   void *argp1 = 0 ;
19209   int res1 = 0 ;
19210   PyObject *swig_obj[1] ;
19211   int result;
19212 
19213   if (!args) SWIG_fail;
19214   swig_obj[0] = args;
19215   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
19216   if (!SWIG_IsOK(res1)) {
19217     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_type_check" "', argument " "1"" of type '" "RSA *""'");
19218   }
19219   arg1 = (RSA *)(argp1);
19220   {
19221     if (!arg1) {
19222       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19223     }
19224   }
19225   result = (int)rsa_type_check(arg1);
19226   {
19227     resultobj=PyLong_FromLong(result);
19228     if (PyErr_Occurred()) SWIG_fail;
19229   }
19230   return resultobj;
19231 fail:
19232   return NULL;
19233 }
19234 
19235 
_wrap_rsa_check_pub_key(PyObject * self,PyObject * args)19236 SWIGINTERN PyObject *_wrap_rsa_check_pub_key(PyObject *self, PyObject *args) {
19237   PyObject *resultobj = 0;
19238   RSA *arg1 = (RSA *) 0 ;
19239   void *argp1 = 0 ;
19240   int res1 = 0 ;
19241   PyObject *swig_obj[1] ;
19242   int result;
19243 
19244   if (!args) SWIG_fail;
19245   swig_obj[0] = args;
19246   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
19247   if (!SWIG_IsOK(res1)) {
19248     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_check_pub_key" "', argument " "1"" of type '" "RSA *""'");
19249   }
19250   arg1 = (RSA *)(argp1);
19251   {
19252     if (!arg1) {
19253       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19254     }
19255   }
19256   result = (int)rsa_check_pub_key(arg1);
19257   {
19258     resultobj=PyLong_FromLong(result);
19259     if (PyErr_Occurred()) SWIG_fail;
19260   }
19261   return resultobj;
19262 fail:
19263   return NULL;
19264 }
19265 
19266 
_wrap_rsa_write_key_der(PyObject * self,PyObject * args)19267 SWIGINTERN PyObject *_wrap_rsa_write_key_der(PyObject *self, PyObject *args) {
19268   PyObject *resultobj = 0;
19269   RSA *arg1 = (RSA *) 0 ;
19270   BIO *arg2 = (BIO *) 0 ;
19271   void *argp1 = 0 ;
19272   int res1 = 0 ;
19273   void *argp2 = 0 ;
19274   int res2 = 0 ;
19275   PyObject *swig_obj[2] ;
19276   int result;
19277 
19278   if (!SWIG_Python_UnpackTuple(args, "rsa_write_key_der", 2, 2, swig_obj)) SWIG_fail;
19279   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_RSA, 0 |  0 );
19280   if (!SWIG_IsOK(res1)) {
19281     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "rsa_write_key_der" "', argument " "1"" of type '" "RSA *""'");
19282   }
19283   arg1 = (RSA *)(argp1);
19284   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
19285   if (!SWIG_IsOK(res2)) {
19286     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "rsa_write_key_der" "', argument " "2"" of type '" "BIO *""'");
19287   }
19288   arg2 = (BIO *)(argp2);
19289   {
19290     if (!arg1) {
19291       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19292     }
19293   }
19294   {
19295     if (!arg2) {
19296       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19297     }
19298   }
19299   {
19300     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19301     result = (int)rsa_write_key_der(arg1,arg2);
19302     SWIG_PYTHON_THREAD_END_ALLOW;
19303   }
19304   {
19305     resultobj=PyLong_FromLong(result);
19306     if (PyErr_Occurred()) SWIG_fail;
19307   }
19308   return resultobj;
19309 fail:
19310   return NULL;
19311 }
19312 
19313 
_wrap_dsa_new(PyObject * self,PyObject * args)19314 SWIGINTERN PyObject *_wrap_dsa_new(PyObject *self, PyObject *args) {
19315   PyObject *resultobj = 0;
19316   DSA *result = 0 ;
19317 
19318   if (!SWIG_Python_UnpackTuple(args, "dsa_new", 0, 0, 0)) SWIG_fail;
19319   result = (DSA *)DSA_new();
19320   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_DSA, 0 |  0 );
19321   return resultobj;
19322 fail:
19323   return NULL;
19324 }
19325 
19326 
_wrap_dsa_free(PyObject * self,PyObject * args)19327 SWIGINTERN PyObject *_wrap_dsa_free(PyObject *self, PyObject *args) {
19328   PyObject *resultobj = 0;
19329   DSA *arg1 = (DSA *) 0 ;
19330   void *argp1 = 0 ;
19331   int res1 = 0 ;
19332   PyObject *swig_obj[1] ;
19333 
19334   if (!args) SWIG_fail;
19335   swig_obj[0] = args;
19336   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19337   if (!SWIG_IsOK(res1)) {
19338     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_free" "', argument " "1"" of type '" "DSA *""'");
19339   }
19340   arg1 = (DSA *)(argp1);
19341   {
19342     if (!arg1) {
19343       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19344     }
19345   }
19346   DSA_free(arg1);
19347   resultobj = SWIG_Py_Void();
19348   return resultobj;
19349 fail:
19350   return NULL;
19351 }
19352 
19353 
_wrap_dsa_size(PyObject * self,PyObject * args)19354 SWIGINTERN PyObject *_wrap_dsa_size(PyObject *self, PyObject *args) {
19355   PyObject *resultobj = 0;
19356   DSA *arg1 = (DSA *) 0 ;
19357   void *argp1 = 0 ;
19358   int res1 = 0 ;
19359   PyObject *swig_obj[1] ;
19360   int result;
19361 
19362   if (!args) SWIG_fail;
19363   swig_obj[0] = args;
19364   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19365   if (!SWIG_IsOK(res1)) {
19366     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_size" "', argument " "1"" of type '" "DSA const *""'");
19367   }
19368   arg1 = (DSA *)(argp1);
19369   {
19370     if (!arg1) {
19371       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19372     }
19373   }
19374   result = (int)DSA_size((DSA const *)arg1);
19375   {
19376     resultobj=PyLong_FromLong(result);
19377     if (PyErr_Occurred()) SWIG_fail;
19378   }
19379   return resultobj;
19380 fail:
19381   return NULL;
19382 }
19383 
19384 
_wrap_dsa_gen_key(PyObject * self,PyObject * args)19385 SWIGINTERN PyObject *_wrap_dsa_gen_key(PyObject *self, PyObject *args) {
19386   PyObject *resultobj = 0;
19387   DSA *arg1 = (DSA *) 0 ;
19388   void *argp1 = 0 ;
19389   int res1 = 0 ;
19390   PyObject *swig_obj[1] ;
19391   int result;
19392 
19393   if (!args) SWIG_fail;
19394   swig_obj[0] = args;
19395   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19396   if (!SWIG_IsOK(res1)) {
19397     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_gen_key" "', argument " "1"" of type '" "DSA *""'");
19398   }
19399   arg1 = (DSA *)(argp1);
19400   {
19401     if (!arg1) {
19402       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19403     }
19404   }
19405   result = (int)DSA_generate_key(arg1);
19406   {
19407     resultobj=PyLong_FromLong(result);
19408     if (PyErr_Occurred()) SWIG_fail;
19409   }
19410   return resultobj;
19411 fail:
19412   return NULL;
19413 }
19414 
19415 
Swig_var__dsa_err_set(PyObject * _val)19416 SWIGINTERN int Swig_var__dsa_err_set(PyObject *_val) {
19417   {
19418     void *argp = 0;
19419     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
19420     if (!SWIG_IsOK(res)) {
19421       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_dsa_err""' of type '""PyObject *""'");
19422     }
19423     _dsa_err = (PyObject *)(argp);
19424   }
19425   return 0;
19426 fail:
19427   return 1;
19428 }
19429 
19430 
Swig_var__dsa_err_get(void)19431 SWIGINTERN PyObject *Swig_var__dsa_err_get(void) {
19432   PyObject *pyobj = 0;
19433   PyObject *self = 0;
19434 
19435   (void)self;
19436   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_dsa_err), SWIGTYPE_p_PyObject,  0 );
19437   return pyobj;
19438 }
19439 
19440 
_wrap_dsa_init(PyObject * self,PyObject * args)19441 SWIGINTERN PyObject *_wrap_dsa_init(PyObject *self, PyObject *args) {
19442   PyObject *resultobj = 0;
19443   PyObject *arg1 = (PyObject *) 0 ;
19444   PyObject *swig_obj[1] ;
19445 
19446   if (!args) SWIG_fail;
19447   swig_obj[0] = args;
19448   {
19449     arg1=swig_obj[0];
19450   }
19451   dsa_init(arg1);
19452   resultobj = SWIG_Py_Void();
19453   return resultobj;
19454 fail:
19455   return NULL;
19456 }
19457 
19458 
_wrap_dsa_generate_parameters(PyObject * self,PyObject * args)19459 SWIGINTERN PyObject *_wrap_dsa_generate_parameters(PyObject *self, PyObject *args) {
19460   PyObject *resultobj = 0;
19461   int arg1 ;
19462   PyObject *arg2 = (PyObject *) 0 ;
19463   int val1 ;
19464   int ecode1 = 0 ;
19465   PyObject *swig_obj[2] ;
19466   DSA *result = 0 ;
19467 
19468   if (!SWIG_Python_UnpackTuple(args, "dsa_generate_parameters", 2, 2, swig_obj)) SWIG_fail;
19469   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
19470   if (!SWIG_IsOK(ecode1)) {
19471     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "dsa_generate_parameters" "', argument " "1"" of type '" "int""'");
19472   }
19473   arg1 = (int)(val1);
19474   {
19475     if (!PyCallable_Check(swig_obj[1])) {
19476       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
19477       return NULL;
19478     }
19479     arg2=swig_obj[1];
19480   }
19481   {
19482     if (!arg2) {
19483       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19484     }
19485   }
19486   result = (DSA *)dsa_generate_parameters(arg1,arg2);
19487   {
19488     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
19489 
19490     if (result != NULL)
19491     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_DSA, 0);
19492     else {
19493       resultobj = NULL;
19494     }
19495   }
19496   return resultobj;
19497 fail:
19498   return NULL;
19499 }
19500 
19501 
_wrap_dsa_read_params(PyObject * self,PyObject * args)19502 SWIGINTERN PyObject *_wrap_dsa_read_params(PyObject *self, PyObject *args) {
19503   PyObject *resultobj = 0;
19504   BIO *arg1 = (BIO *) 0 ;
19505   PyObject *arg2 = (PyObject *) 0 ;
19506   void *argp1 = 0 ;
19507   int res1 = 0 ;
19508   PyObject *swig_obj[2] ;
19509   DSA *result = 0 ;
19510 
19511   if (!SWIG_Python_UnpackTuple(args, "dsa_read_params", 2, 2, swig_obj)) SWIG_fail;
19512   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
19513   if (!SWIG_IsOK(res1)) {
19514     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_params" "', argument " "1"" of type '" "BIO *""'");
19515   }
19516   arg1 = (BIO *)(argp1);
19517   {
19518     if (!PyCallable_Check(swig_obj[1])) {
19519       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
19520       return NULL;
19521     }
19522     arg2=swig_obj[1];
19523   }
19524   {
19525     if (!arg1) {
19526       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19527     }
19528   }
19529   {
19530     if (!arg2) {
19531       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19532     }
19533   }
19534   result = (DSA *)dsa_read_params(arg1,arg2);
19535   {
19536     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
19537 
19538     if (result != NULL)
19539     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_DSA, 0);
19540     else {
19541       resultobj = NULL;
19542     }
19543   }
19544   return resultobj;
19545 fail:
19546   return NULL;
19547 }
19548 
19549 
_wrap_dsa_read_key(PyObject * self,PyObject * args)19550 SWIGINTERN PyObject *_wrap_dsa_read_key(PyObject *self, PyObject *args) {
19551   PyObject *resultobj = 0;
19552   BIO *arg1 = (BIO *) 0 ;
19553   PyObject *arg2 = (PyObject *) 0 ;
19554   void *argp1 = 0 ;
19555   int res1 = 0 ;
19556   PyObject *swig_obj[2] ;
19557   DSA *result = 0 ;
19558 
19559   if (!SWIG_Python_UnpackTuple(args, "dsa_read_key", 2, 2, swig_obj)) SWIG_fail;
19560   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
19561   if (!SWIG_IsOK(res1)) {
19562     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_key" "', argument " "1"" of type '" "BIO *""'");
19563   }
19564   arg1 = (BIO *)(argp1);
19565   {
19566     if (!PyCallable_Check(swig_obj[1])) {
19567       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
19568       return NULL;
19569     }
19570     arg2=swig_obj[1];
19571   }
19572   {
19573     if (!arg1) {
19574       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19575     }
19576   }
19577   {
19578     if (!arg2) {
19579       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19580     }
19581   }
19582   result = (DSA *)dsa_read_key(arg1,arg2);
19583   {
19584     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
19585 
19586     if (result != NULL)
19587     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_DSA, 0);
19588     else {
19589       resultobj = NULL;
19590     }
19591   }
19592   return resultobj;
19593 fail:
19594   return NULL;
19595 }
19596 
19597 
_wrap_dsa_read_pub_key(PyObject * self,PyObject * args)19598 SWIGINTERN PyObject *_wrap_dsa_read_pub_key(PyObject *self, PyObject *args) {
19599   PyObject *resultobj = 0;
19600   BIO *arg1 = (BIO *) 0 ;
19601   PyObject *arg2 = (PyObject *) 0 ;
19602   void *argp1 = 0 ;
19603   int res1 = 0 ;
19604   PyObject *swig_obj[2] ;
19605   DSA *result = 0 ;
19606 
19607   if (!SWIG_Python_UnpackTuple(args, "dsa_read_pub_key", 2, 2, swig_obj)) SWIG_fail;
19608   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
19609   if (!SWIG_IsOK(res1)) {
19610     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_read_pub_key" "', argument " "1"" of type '" "BIO *""'");
19611   }
19612   arg1 = (BIO *)(argp1);
19613   {
19614     if (!PyCallable_Check(swig_obj[1])) {
19615       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
19616       return NULL;
19617     }
19618     arg2=swig_obj[1];
19619   }
19620   {
19621     if (!arg1) {
19622       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19623     }
19624   }
19625   {
19626     if (!arg2) {
19627       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19628     }
19629   }
19630   result = (DSA *)dsa_read_pub_key(arg1,arg2);
19631   {
19632     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
19633 
19634     if (result != NULL)
19635     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_DSA, 0);
19636     else {
19637       resultobj = NULL;
19638     }
19639   }
19640   return resultobj;
19641 fail:
19642   return NULL;
19643 }
19644 
19645 
_wrap_dsa_get_p(PyObject * self,PyObject * args)19646 SWIGINTERN PyObject *_wrap_dsa_get_p(PyObject *self, PyObject *args) {
19647   PyObject *resultobj = 0;
19648   DSA *arg1 = (DSA *) 0 ;
19649   void *argp1 = 0 ;
19650   int res1 = 0 ;
19651   PyObject *swig_obj[1] ;
19652   PyObject *result = 0 ;
19653 
19654   if (!args) SWIG_fail;
19655   swig_obj[0] = args;
19656   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19657   if (!SWIG_IsOK(res1)) {
19658     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_p" "', argument " "1"" of type '" "DSA *""'");
19659   }
19660   arg1 = (DSA *)(argp1);
19661   {
19662     if (!arg1) {
19663       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19664     }
19665   }
19666   result = (PyObject *)dsa_get_p(arg1);
19667   {
19668     resultobj=result;
19669   }
19670   return resultobj;
19671 fail:
19672   return NULL;
19673 }
19674 
19675 
_wrap_dsa_get_q(PyObject * self,PyObject * args)19676 SWIGINTERN PyObject *_wrap_dsa_get_q(PyObject *self, PyObject *args) {
19677   PyObject *resultobj = 0;
19678   DSA *arg1 = (DSA *) 0 ;
19679   void *argp1 = 0 ;
19680   int res1 = 0 ;
19681   PyObject *swig_obj[1] ;
19682   PyObject *result = 0 ;
19683 
19684   if (!args) SWIG_fail;
19685   swig_obj[0] = args;
19686   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19687   if (!SWIG_IsOK(res1)) {
19688     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_q" "', argument " "1"" of type '" "DSA *""'");
19689   }
19690   arg1 = (DSA *)(argp1);
19691   {
19692     if (!arg1) {
19693       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19694     }
19695   }
19696   result = (PyObject *)dsa_get_q(arg1);
19697   {
19698     resultobj=result;
19699   }
19700   return resultobj;
19701 fail:
19702   return NULL;
19703 }
19704 
19705 
_wrap_dsa_get_g(PyObject * self,PyObject * args)19706 SWIGINTERN PyObject *_wrap_dsa_get_g(PyObject *self, PyObject *args) {
19707   PyObject *resultobj = 0;
19708   DSA *arg1 = (DSA *) 0 ;
19709   void *argp1 = 0 ;
19710   int res1 = 0 ;
19711   PyObject *swig_obj[1] ;
19712   PyObject *result = 0 ;
19713 
19714   if (!args) SWIG_fail;
19715   swig_obj[0] = args;
19716   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19717   if (!SWIG_IsOK(res1)) {
19718     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_g" "', argument " "1"" of type '" "DSA *""'");
19719   }
19720   arg1 = (DSA *)(argp1);
19721   {
19722     if (!arg1) {
19723       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19724     }
19725   }
19726   result = (PyObject *)dsa_get_g(arg1);
19727   {
19728     resultobj=result;
19729   }
19730   return resultobj;
19731 fail:
19732   return NULL;
19733 }
19734 
19735 
_wrap_dsa_get_pub(PyObject * self,PyObject * args)19736 SWIGINTERN PyObject *_wrap_dsa_get_pub(PyObject *self, PyObject *args) {
19737   PyObject *resultobj = 0;
19738   DSA *arg1 = (DSA *) 0 ;
19739   void *argp1 = 0 ;
19740   int res1 = 0 ;
19741   PyObject *swig_obj[1] ;
19742   PyObject *result = 0 ;
19743 
19744   if (!args) SWIG_fail;
19745   swig_obj[0] = args;
19746   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19747   if (!SWIG_IsOK(res1)) {
19748     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_pub" "', argument " "1"" of type '" "DSA *""'");
19749   }
19750   arg1 = (DSA *)(argp1);
19751   {
19752     if (!arg1) {
19753       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19754     }
19755   }
19756   result = (PyObject *)dsa_get_pub(arg1);
19757   {
19758     resultobj=result;
19759   }
19760   return resultobj;
19761 fail:
19762   return NULL;
19763 }
19764 
19765 
_wrap_dsa_get_priv(PyObject * self,PyObject * args)19766 SWIGINTERN PyObject *_wrap_dsa_get_priv(PyObject *self, PyObject *args) {
19767   PyObject *resultobj = 0;
19768   DSA *arg1 = (DSA *) 0 ;
19769   void *argp1 = 0 ;
19770   int res1 = 0 ;
19771   PyObject *swig_obj[1] ;
19772   PyObject *result = 0 ;
19773 
19774   if (!args) SWIG_fail;
19775   swig_obj[0] = args;
19776   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19777   if (!SWIG_IsOK(res1)) {
19778     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_get_priv" "', argument " "1"" of type '" "DSA *""'");
19779   }
19780   arg1 = (DSA *)(argp1);
19781   {
19782     if (!arg1) {
19783       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19784     }
19785   }
19786   result = (PyObject *)dsa_get_priv(arg1);
19787   {
19788     resultobj=result;
19789   }
19790   return resultobj;
19791 fail:
19792   return NULL;
19793 }
19794 
19795 
_wrap_dsa_set_pqg(PyObject * self,PyObject * args)19796 SWIGINTERN PyObject *_wrap_dsa_set_pqg(PyObject *self, PyObject *args) {
19797   PyObject *resultobj = 0;
19798   DSA *arg1 = (DSA *) 0 ;
19799   PyObject *arg2 = (PyObject *) 0 ;
19800   PyObject *arg3 = (PyObject *) 0 ;
19801   PyObject *arg4 = (PyObject *) 0 ;
19802   void *argp1 = 0 ;
19803   int res1 = 0 ;
19804   PyObject *swig_obj[4] ;
19805   PyObject *result = 0 ;
19806 
19807   if (!SWIG_Python_UnpackTuple(args, "dsa_set_pqg", 4, 4, swig_obj)) SWIG_fail;
19808   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19809   if (!SWIG_IsOK(res1)) {
19810     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_set_pqg" "', argument " "1"" of type '" "DSA *""'");
19811   }
19812   arg1 = (DSA *)(argp1);
19813   {
19814     arg2=swig_obj[1];
19815   }
19816   {
19817     arg3=swig_obj[2];
19818   }
19819   {
19820     arg4=swig_obj[3];
19821   }
19822   {
19823     if (!arg1) {
19824       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19825     }
19826   }
19827   result = (PyObject *)dsa_set_pqg(arg1,arg2,arg3,arg4);
19828   {
19829     resultobj=result;
19830   }
19831   return resultobj;
19832 fail:
19833   return NULL;
19834 }
19835 
19836 
_wrap_dsa_set_pub(PyObject * self,PyObject * args)19837 SWIGINTERN PyObject *_wrap_dsa_set_pub(PyObject *self, PyObject *args) {
19838   PyObject *resultobj = 0;
19839   DSA *arg1 = (DSA *) 0 ;
19840   PyObject *arg2 = (PyObject *) 0 ;
19841   void *argp1 = 0 ;
19842   int res1 = 0 ;
19843   PyObject *swig_obj[2] ;
19844   PyObject *result = 0 ;
19845 
19846   if (!SWIG_Python_UnpackTuple(args, "dsa_set_pub", 2, 2, swig_obj)) SWIG_fail;
19847   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19848   if (!SWIG_IsOK(res1)) {
19849     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_set_pub" "', argument " "1"" of type '" "DSA *""'");
19850   }
19851   arg1 = (DSA *)(argp1);
19852   {
19853     arg2=swig_obj[1];
19854   }
19855   {
19856     if (!arg1) {
19857       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19858     }
19859   }
19860   result = (PyObject *)dsa_set_pub(arg1,arg2);
19861   {
19862     resultobj=result;
19863   }
19864   return resultobj;
19865 fail:
19866   return NULL;
19867 }
19868 
19869 
_wrap_dsa_write_params_bio(PyObject * self,PyObject * args)19870 SWIGINTERN PyObject *_wrap_dsa_write_params_bio(PyObject *self, PyObject *args) {
19871   PyObject *resultobj = 0;
19872   DSA *arg1 = (DSA *) 0 ;
19873   BIO *arg2 = (BIO *) 0 ;
19874   void *argp1 = 0 ;
19875   int res1 = 0 ;
19876   void *argp2 = 0 ;
19877   int res2 = 0 ;
19878   PyObject *swig_obj[2] ;
19879   int result;
19880 
19881   if (!SWIG_Python_UnpackTuple(args, "dsa_write_params_bio", 2, 2, swig_obj)) SWIG_fail;
19882   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19883   if (!SWIG_IsOK(res1)) {
19884     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_params_bio" "', argument " "1"" of type '" "DSA *""'");
19885   }
19886   arg1 = (DSA *)(argp1);
19887   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
19888   if (!SWIG_IsOK(res2)) {
19889     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dsa_write_params_bio" "', argument " "2"" of type '" "BIO *""'");
19890   }
19891   arg2 = (BIO *)(argp2);
19892   {
19893     if (!arg1) {
19894       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19895     }
19896   }
19897   {
19898     if (!arg2) {
19899       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19900     }
19901   }
19902   {
19903     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
19904     result = (int)dsa_write_params_bio(arg1,arg2);
19905     SWIG_PYTHON_THREAD_END_ALLOW;
19906   }
19907   {
19908     resultobj=PyLong_FromLong(result);
19909     if (PyErr_Occurred()) SWIG_fail;
19910   }
19911   return resultobj;
19912 fail:
19913   return NULL;
19914 }
19915 
19916 
_wrap_dsa_write_key_bio(PyObject * self,PyObject * args)19917 SWIGINTERN PyObject *_wrap_dsa_write_key_bio(PyObject *self, PyObject *args) {
19918   PyObject *resultobj = 0;
19919   DSA *arg1 = (DSA *) 0 ;
19920   BIO *arg2 = (BIO *) 0 ;
19921   EVP_CIPHER *arg3 = (EVP_CIPHER *) 0 ;
19922   PyObject *arg4 = (PyObject *) 0 ;
19923   void *argp1 = 0 ;
19924   int res1 = 0 ;
19925   void *argp2 = 0 ;
19926   int res2 = 0 ;
19927   void *argp3 = 0 ;
19928   int res3 = 0 ;
19929   PyObject *swig_obj[4] ;
19930   int result;
19931 
19932   if (!SWIG_Python_UnpackTuple(args, "dsa_write_key_bio", 4, 4, swig_obj)) SWIG_fail;
19933   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
19934   if (!SWIG_IsOK(res1)) {
19935     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_key_bio" "', argument " "1"" of type '" "DSA *""'");
19936   }
19937   arg1 = (DSA *)(argp1);
19938   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
19939   if (!SWIG_IsOK(res2)) {
19940     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dsa_write_key_bio" "', argument " "2"" of type '" "BIO *""'");
19941   }
19942   arg2 = (BIO *)(argp2);
19943   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
19944   if (!SWIG_IsOK(res3)) {
19945     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "dsa_write_key_bio" "', argument " "3"" of type '" "EVP_CIPHER *""'");
19946   }
19947   arg3 = (EVP_CIPHER *)(argp3);
19948   {
19949     if (!PyCallable_Check(swig_obj[3])) {
19950       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
19951       return NULL;
19952     }
19953     arg4=swig_obj[3];
19954   }
19955   {
19956     if (!arg1) {
19957       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19958     }
19959   }
19960   {
19961     if (!arg2) {
19962       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19963     }
19964   }
19965   {
19966     if (!arg3) {
19967       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19968     }
19969   }
19970   {
19971     if (!arg4) {
19972       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
19973     }
19974   }
19975   result = (int)dsa_write_key_bio(arg1,arg2,arg3,arg4);
19976   {
19977     resultobj=PyLong_FromLong(result);
19978     if (PyErr_Occurred()) SWIG_fail;
19979   }
19980   return resultobj;
19981 fail:
19982   return NULL;
19983 }
19984 
19985 
_wrap_dsa_write_key_bio_no_cipher(PyObject * self,PyObject * args)19986 SWIGINTERN PyObject *_wrap_dsa_write_key_bio_no_cipher(PyObject *self, PyObject *args) {
19987   PyObject *resultobj = 0;
19988   DSA *arg1 = (DSA *) 0 ;
19989   BIO *arg2 = (BIO *) 0 ;
19990   PyObject *arg3 = (PyObject *) 0 ;
19991   void *argp1 = 0 ;
19992   int res1 = 0 ;
19993   void *argp2 = 0 ;
19994   int res2 = 0 ;
19995   PyObject *swig_obj[3] ;
19996   int result;
19997 
19998   if (!SWIG_Python_UnpackTuple(args, "dsa_write_key_bio_no_cipher", 3, 3, swig_obj)) SWIG_fail;
19999   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
20000   if (!SWIG_IsOK(res1)) {
20001     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_key_bio_no_cipher" "', argument " "1"" of type '" "DSA *""'");
20002   }
20003   arg1 = (DSA *)(argp1);
20004   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
20005   if (!SWIG_IsOK(res2)) {
20006     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dsa_write_key_bio_no_cipher" "', argument " "2"" of type '" "BIO *""'");
20007   }
20008   arg2 = (BIO *)(argp2);
20009   {
20010     if (!PyCallable_Check(swig_obj[2])) {
20011       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
20012       return NULL;
20013     }
20014     arg3=swig_obj[2];
20015   }
20016   {
20017     if (!arg1) {
20018       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20019     }
20020   }
20021   {
20022     if (!arg2) {
20023       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20024     }
20025   }
20026   {
20027     if (!arg3) {
20028       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20029     }
20030   }
20031   result = (int)dsa_write_key_bio_no_cipher(arg1,arg2,arg3);
20032   {
20033     resultobj=PyLong_FromLong(result);
20034     if (PyErr_Occurred()) SWIG_fail;
20035   }
20036   return resultobj;
20037 fail:
20038   return NULL;
20039 }
20040 
20041 
_wrap_dsa_write_pub_key_bio(PyObject * self,PyObject * args)20042 SWIGINTERN PyObject *_wrap_dsa_write_pub_key_bio(PyObject *self, PyObject *args) {
20043   PyObject *resultobj = 0;
20044   DSA *arg1 = (DSA *) 0 ;
20045   BIO *arg2 = (BIO *) 0 ;
20046   void *argp1 = 0 ;
20047   int res1 = 0 ;
20048   void *argp2 = 0 ;
20049   int res2 = 0 ;
20050   PyObject *swig_obj[2] ;
20051   int result;
20052 
20053   if (!SWIG_Python_UnpackTuple(args, "dsa_write_pub_key_bio", 2, 2, swig_obj)) SWIG_fail;
20054   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
20055   if (!SWIG_IsOK(res1)) {
20056     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_write_pub_key_bio" "', argument " "1"" of type '" "DSA *""'");
20057   }
20058   arg1 = (DSA *)(argp1);
20059   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
20060   if (!SWIG_IsOK(res2)) {
20061     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "dsa_write_pub_key_bio" "', argument " "2"" of type '" "BIO *""'");
20062   }
20063   arg2 = (BIO *)(argp2);
20064   {
20065     if (!arg1) {
20066       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20067     }
20068   }
20069   {
20070     if (!arg2) {
20071       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20072     }
20073   }
20074   {
20075     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
20076     result = (int)dsa_write_pub_key_bio(arg1,arg2);
20077     SWIG_PYTHON_THREAD_END_ALLOW;
20078   }
20079   {
20080     resultobj=PyLong_FromLong(result);
20081     if (PyErr_Occurred()) SWIG_fail;
20082   }
20083   return resultobj;
20084 fail:
20085   return NULL;
20086 }
20087 
20088 
_wrap_dsa_sign(PyObject * self,PyObject * args)20089 SWIGINTERN PyObject *_wrap_dsa_sign(PyObject *self, PyObject *args) {
20090   PyObject *resultobj = 0;
20091   DSA *arg1 = (DSA *) 0 ;
20092   PyObject *arg2 = (PyObject *) 0 ;
20093   void *argp1 = 0 ;
20094   int res1 = 0 ;
20095   PyObject *swig_obj[2] ;
20096   PyObject *result = 0 ;
20097 
20098   if (!SWIG_Python_UnpackTuple(args, "dsa_sign", 2, 2, swig_obj)) SWIG_fail;
20099   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
20100   if (!SWIG_IsOK(res1)) {
20101     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_sign" "', argument " "1"" of type '" "DSA *""'");
20102   }
20103   arg1 = (DSA *)(argp1);
20104   {
20105     arg2=swig_obj[1];
20106   }
20107   {
20108     if (!arg1) {
20109       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20110     }
20111   }
20112   result = (PyObject *)dsa_sign(arg1,arg2);
20113   {
20114     resultobj=result;
20115   }
20116   return resultobj;
20117 fail:
20118   return NULL;
20119 }
20120 
20121 
_wrap_dsa_verify(PyObject * self,PyObject * args)20122 SWIGINTERN PyObject *_wrap_dsa_verify(PyObject *self, PyObject *args) {
20123   PyObject *resultobj = 0;
20124   DSA *arg1 = (DSA *) 0 ;
20125   PyObject *arg2 = (PyObject *) 0 ;
20126   PyObject *arg3 = (PyObject *) 0 ;
20127   PyObject *arg4 = (PyObject *) 0 ;
20128   void *argp1 = 0 ;
20129   int res1 = 0 ;
20130   PyObject *swig_obj[4] ;
20131   int result;
20132 
20133   if (!SWIG_Python_UnpackTuple(args, "dsa_verify", 4, 4, swig_obj)) SWIG_fail;
20134   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
20135   if (!SWIG_IsOK(res1)) {
20136     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_verify" "', argument " "1"" of type '" "DSA *""'");
20137   }
20138   arg1 = (DSA *)(argp1);
20139   {
20140     arg2=swig_obj[1];
20141   }
20142   {
20143     arg3=swig_obj[2];
20144   }
20145   {
20146     arg4=swig_obj[3];
20147   }
20148   {
20149     if (!arg1) {
20150       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20151     }
20152   }
20153   result = (int)dsa_verify(arg1,arg2,arg3,arg4);
20154   {
20155     resultobj=PyLong_FromLong(result);
20156     if (PyErr_Occurred()) SWIG_fail;
20157   }
20158   return resultobj;
20159 fail:
20160   return NULL;
20161 }
20162 
20163 
_wrap_dsa_sign_asn1(PyObject * self,PyObject * args)20164 SWIGINTERN PyObject *_wrap_dsa_sign_asn1(PyObject *self, PyObject *args) {
20165   PyObject *resultobj = 0;
20166   DSA *arg1 = (DSA *) 0 ;
20167   PyObject *arg2 = (PyObject *) 0 ;
20168   void *argp1 = 0 ;
20169   int res1 = 0 ;
20170   PyObject *swig_obj[2] ;
20171   PyObject *result = 0 ;
20172 
20173   if (!SWIG_Python_UnpackTuple(args, "dsa_sign_asn1", 2, 2, swig_obj)) SWIG_fail;
20174   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
20175   if (!SWIG_IsOK(res1)) {
20176     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_sign_asn1" "', argument " "1"" of type '" "DSA *""'");
20177   }
20178   arg1 = (DSA *)(argp1);
20179   {
20180     arg2=swig_obj[1];
20181   }
20182   {
20183     if (!arg1) {
20184       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20185     }
20186   }
20187   result = (PyObject *)dsa_sign_asn1(arg1,arg2);
20188   {
20189     resultobj=result;
20190   }
20191   return resultobj;
20192 fail:
20193   return NULL;
20194 }
20195 
20196 
_wrap_dsa_verify_asn1(PyObject * self,PyObject * args)20197 SWIGINTERN PyObject *_wrap_dsa_verify_asn1(PyObject *self, PyObject *args) {
20198   PyObject *resultobj = 0;
20199   DSA *arg1 = (DSA *) 0 ;
20200   PyObject *arg2 = (PyObject *) 0 ;
20201   PyObject *arg3 = (PyObject *) 0 ;
20202   void *argp1 = 0 ;
20203   int res1 = 0 ;
20204   PyObject *swig_obj[3] ;
20205   int result;
20206 
20207   if (!SWIG_Python_UnpackTuple(args, "dsa_verify_asn1", 3, 3, swig_obj)) SWIG_fail;
20208   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
20209   if (!SWIG_IsOK(res1)) {
20210     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_verify_asn1" "', argument " "1"" of type '" "DSA *""'");
20211   }
20212   arg1 = (DSA *)(argp1);
20213   {
20214     arg2=swig_obj[1];
20215   }
20216   {
20217     arg3=swig_obj[2];
20218   }
20219   {
20220     if (!arg1) {
20221       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20222     }
20223   }
20224   result = (int)dsa_verify_asn1(arg1,arg2,arg3);
20225   {
20226     resultobj=PyLong_FromLong(result);
20227     if (PyErr_Occurred()) SWIG_fail;
20228   }
20229   return resultobj;
20230 fail:
20231   return NULL;
20232 }
20233 
20234 
_wrap_dsa_check_key(PyObject * self,PyObject * args)20235 SWIGINTERN PyObject *_wrap_dsa_check_key(PyObject *self, PyObject *args) {
20236   PyObject *resultobj = 0;
20237   DSA *arg1 = (DSA *) 0 ;
20238   void *argp1 = 0 ;
20239   int res1 = 0 ;
20240   PyObject *swig_obj[1] ;
20241   int result;
20242 
20243   if (!args) SWIG_fail;
20244   swig_obj[0] = args;
20245   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
20246   if (!SWIG_IsOK(res1)) {
20247     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_check_key" "', argument " "1"" of type '" "DSA *""'");
20248   }
20249   arg1 = (DSA *)(argp1);
20250   {
20251     if (!arg1) {
20252       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20253     }
20254   }
20255   result = (int)dsa_check_key(arg1);
20256   {
20257     resultobj=PyLong_FromLong(result);
20258     if (PyErr_Occurred()) SWIG_fail;
20259   }
20260   return resultobj;
20261 fail:
20262   return NULL;
20263 }
20264 
20265 
_wrap_dsa_check_pub_key(PyObject * self,PyObject * args)20266 SWIGINTERN PyObject *_wrap_dsa_check_pub_key(PyObject *self, PyObject *args) {
20267   PyObject *resultobj = 0;
20268   DSA *arg1 = (DSA *) 0 ;
20269   void *argp1 = 0 ;
20270   int res1 = 0 ;
20271   PyObject *swig_obj[1] ;
20272   int result;
20273 
20274   if (!args) SWIG_fail;
20275   swig_obj[0] = args;
20276   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
20277   if (!SWIG_IsOK(res1)) {
20278     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_check_pub_key" "', argument " "1"" of type '" "DSA *""'");
20279   }
20280   arg1 = (DSA *)(argp1);
20281   {
20282     if (!arg1) {
20283       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20284     }
20285   }
20286   result = (int)dsa_check_pub_key(arg1);
20287   {
20288     resultobj=PyLong_FromLong(result);
20289     if (PyErr_Occurred()) SWIG_fail;
20290   }
20291   return resultobj;
20292 fail:
20293   return NULL;
20294 }
20295 
20296 
_wrap_dsa_keylen(PyObject * self,PyObject * args)20297 SWIGINTERN PyObject *_wrap_dsa_keylen(PyObject *self, PyObject *args) {
20298   PyObject *resultobj = 0;
20299   DSA *arg1 = (DSA *) 0 ;
20300   void *argp1 = 0 ;
20301   int res1 = 0 ;
20302   PyObject *swig_obj[1] ;
20303   int result;
20304 
20305   if (!args) SWIG_fail;
20306   swig_obj[0] = args;
20307   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
20308   if (!SWIG_IsOK(res1)) {
20309     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_keylen" "', argument " "1"" of type '" "DSA *""'");
20310   }
20311   arg1 = (DSA *)(argp1);
20312   {
20313     if (!arg1) {
20314       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20315     }
20316   }
20317   result = (int)dsa_keylen(arg1);
20318   {
20319     resultobj=PyLong_FromLong(result);
20320     if (PyErr_Occurred()) SWIG_fail;
20321   }
20322   return resultobj;
20323 fail:
20324   return NULL;
20325 }
20326 
20327 
_wrap_dsa_type_check(PyObject * self,PyObject * args)20328 SWIGINTERN PyObject *_wrap_dsa_type_check(PyObject *self, PyObject *args) {
20329   PyObject *resultobj = 0;
20330   DSA *arg1 = (DSA *) 0 ;
20331   void *argp1 = 0 ;
20332   int res1 = 0 ;
20333   PyObject *swig_obj[1] ;
20334   int result;
20335 
20336   if (!args) SWIG_fail;
20337   swig_obj[0] = args;
20338   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_DSA, 0 |  0 );
20339   if (!SWIG_IsOK(res1)) {
20340     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "dsa_type_check" "', argument " "1"" of type '" "DSA *""'");
20341   }
20342   arg1 = (DSA *)(argp1);
20343   {
20344     if (!arg1) {
20345       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20346     }
20347   }
20348   result = (int)dsa_type_check(arg1);
20349   {
20350     resultobj=PyLong_FromLong(result);
20351     if (PyErr_Occurred()) SWIG_fail;
20352   }
20353   return resultobj;
20354 fail:
20355   return NULL;
20356 }
20357 
20358 
_wrap_ssl_get_ciphers(PyObject * self,PyObject * args)20359 SWIGINTERN PyObject *_wrap_ssl_get_ciphers(PyObject *self, PyObject *args) {
20360   PyObject *resultobj = 0;
20361   SSL *arg1 = (SSL *) 0 ;
20362   void *argp1 = 0 ;
20363   int res1 = 0 ;
20364   PyObject *swig_obj[1] ;
20365   struct stack_st_SSL_CIPHER *result = 0 ;
20366 
20367   if (!args) SWIG_fail;
20368   swig_obj[0] = args;
20369   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
20370   if (!SWIG_IsOK(res1)) {
20371     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_ciphers" "', argument " "1"" of type '" "SSL const *""'");
20372   }
20373   arg1 = (SSL *)(argp1);
20374   {
20375     if (!arg1) {
20376       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20377     }
20378   }
20379   result = (struct stack_st_SSL_CIPHER *)SSL_get_ciphers((SSL const *)arg1);
20380   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_SSL_CIPHER, 0 |  0 );
20381   return resultobj;
20382 fail:
20383   return NULL;
20384 }
20385 
20386 
_wrap_ssl_get_version(PyObject * self,PyObject * args)20387 SWIGINTERN PyObject *_wrap_ssl_get_version(PyObject *self, PyObject *args) {
20388   PyObject *resultobj = 0;
20389   SSL *arg1 = (SSL *) 0 ;
20390   void *argp1 = 0 ;
20391   int res1 = 0 ;
20392   PyObject *swig_obj[1] ;
20393   char *result = 0 ;
20394 
20395   if (!args) SWIG_fail;
20396   swig_obj[0] = args;
20397   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
20398   if (!SWIG_IsOK(res1)) {
20399     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_version" "', argument " "1"" of type '" "SSL const *""'");
20400   }
20401   arg1 = (SSL *)(argp1);
20402   {
20403     if (!arg1) {
20404       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20405     }
20406   }
20407   result = (char *)SSL_get_version((SSL const *)arg1);
20408   resultobj = SWIG_FromCharPtr((const char *)result);
20409   return resultobj;
20410 fail:
20411   return NULL;
20412 }
20413 
20414 
_wrap_ssl_get_error(PyObject * self,PyObject * args)20415 SWIGINTERN PyObject *_wrap_ssl_get_error(PyObject *self, PyObject *args) {
20416   PyObject *resultobj = 0;
20417   SSL *arg1 = (SSL *) 0 ;
20418   int arg2 ;
20419   void *argp1 = 0 ;
20420   int res1 = 0 ;
20421   int val2 ;
20422   int ecode2 = 0 ;
20423   PyObject *swig_obj[2] ;
20424   int result;
20425 
20426   if (!SWIG_Python_UnpackTuple(args, "ssl_get_error", 2, 2, swig_obj)) SWIG_fail;
20427   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
20428   if (!SWIG_IsOK(res1)) {
20429     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_error" "', argument " "1"" of type '" "SSL const *""'");
20430   }
20431   arg1 = (SSL *)(argp1);
20432   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
20433   if (!SWIG_IsOK(ecode2)) {
20434     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_get_error" "', argument " "2"" of type '" "int""'");
20435   }
20436   arg2 = (int)(val2);
20437   {
20438     if (!arg1) {
20439       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20440     }
20441   }
20442   result = (int)SSL_get_error((SSL const *)arg1,arg2);
20443   {
20444     resultobj=PyLong_FromLong(result);
20445     if (PyErr_Occurred()) SWIG_fail;
20446   }
20447   return resultobj;
20448 fail:
20449   return NULL;
20450 }
20451 
20452 
_wrap_ssl_get_state(PyObject * self,PyObject * args)20453 SWIGINTERN PyObject *_wrap_ssl_get_state(PyObject *self, PyObject *args) {
20454   PyObject *resultobj = 0;
20455   SSL *arg1 = (SSL *) 0 ;
20456   void *argp1 = 0 ;
20457   int res1 = 0 ;
20458   PyObject *swig_obj[1] ;
20459   char *result = 0 ;
20460 
20461   if (!args) SWIG_fail;
20462   swig_obj[0] = args;
20463   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
20464   if (!SWIG_IsOK(res1)) {
20465     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_state" "', argument " "1"" of type '" "SSL const *""'");
20466   }
20467   arg1 = (SSL *)(argp1);
20468   {
20469     if (!arg1) {
20470       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20471     }
20472   }
20473   result = (char *)SSL_state_string((SSL const *)arg1);
20474   resultobj = SWIG_FromCharPtr((const char *)result);
20475   return resultobj;
20476 fail:
20477   return NULL;
20478 }
20479 
20480 
_wrap_ssl_get_state_v(PyObject * self,PyObject * args)20481 SWIGINTERN PyObject *_wrap_ssl_get_state_v(PyObject *self, PyObject *args) {
20482   PyObject *resultobj = 0;
20483   SSL *arg1 = (SSL *) 0 ;
20484   void *argp1 = 0 ;
20485   int res1 = 0 ;
20486   PyObject *swig_obj[1] ;
20487   char *result = 0 ;
20488 
20489   if (!args) SWIG_fail;
20490   swig_obj[0] = args;
20491   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
20492   if (!SWIG_IsOK(res1)) {
20493     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_state_v" "', argument " "1"" of type '" "SSL const *""'");
20494   }
20495   arg1 = (SSL *)(argp1);
20496   {
20497     if (!arg1) {
20498       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20499     }
20500   }
20501   result = (char *)SSL_state_string_long((SSL const *)arg1);
20502   resultobj = SWIG_FromCharPtr((const char *)result);
20503   return resultobj;
20504 fail:
20505   return NULL;
20506 }
20507 
20508 
_wrap_ssl_get_alert_type(PyObject * self,PyObject * args)20509 SWIGINTERN PyObject *_wrap_ssl_get_alert_type(PyObject *self, PyObject *args) {
20510   PyObject *resultobj = 0;
20511   int arg1 ;
20512   int val1 ;
20513   int ecode1 = 0 ;
20514   PyObject *swig_obj[1] ;
20515   char *result = 0 ;
20516 
20517   if (!args) SWIG_fail;
20518   swig_obj[0] = args;
20519   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
20520   if (!SWIG_IsOK(ecode1)) {
20521     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ssl_get_alert_type" "', argument " "1"" of type '" "int""'");
20522   }
20523   arg1 = (int)(val1);
20524   result = (char *)SSL_alert_type_string(arg1);
20525   resultobj = SWIG_FromCharPtr((const char *)result);
20526   return resultobj;
20527 fail:
20528   return NULL;
20529 }
20530 
20531 
_wrap_ssl_get_alert_type_v(PyObject * self,PyObject * args)20532 SWIGINTERN PyObject *_wrap_ssl_get_alert_type_v(PyObject *self, PyObject *args) {
20533   PyObject *resultobj = 0;
20534   int arg1 ;
20535   int val1 ;
20536   int ecode1 = 0 ;
20537   PyObject *swig_obj[1] ;
20538   char *result = 0 ;
20539 
20540   if (!args) SWIG_fail;
20541   swig_obj[0] = args;
20542   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
20543   if (!SWIG_IsOK(ecode1)) {
20544     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ssl_get_alert_type_v" "', argument " "1"" of type '" "int""'");
20545   }
20546   arg1 = (int)(val1);
20547   result = (char *)SSL_alert_type_string_long(arg1);
20548   resultobj = SWIG_FromCharPtr((const char *)result);
20549   return resultobj;
20550 fail:
20551   return NULL;
20552 }
20553 
20554 
_wrap_ssl_get_alert_desc(PyObject * self,PyObject * args)20555 SWIGINTERN PyObject *_wrap_ssl_get_alert_desc(PyObject *self, PyObject *args) {
20556   PyObject *resultobj = 0;
20557   int arg1 ;
20558   int val1 ;
20559   int ecode1 = 0 ;
20560   PyObject *swig_obj[1] ;
20561   char *result = 0 ;
20562 
20563   if (!args) SWIG_fail;
20564   swig_obj[0] = args;
20565   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
20566   if (!SWIG_IsOK(ecode1)) {
20567     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ssl_get_alert_desc" "', argument " "1"" of type '" "int""'");
20568   }
20569   arg1 = (int)(val1);
20570   result = (char *)SSL_alert_desc_string(arg1);
20571   resultobj = SWIG_FromCharPtr((const char *)result);
20572   return resultobj;
20573 fail:
20574   return NULL;
20575 }
20576 
20577 
_wrap_ssl_get_alert_desc_v(PyObject * self,PyObject * args)20578 SWIGINTERN PyObject *_wrap_ssl_get_alert_desc_v(PyObject *self, PyObject *args) {
20579   PyObject *resultobj = 0;
20580   int arg1 ;
20581   int val1 ;
20582   int ecode1 = 0 ;
20583   PyObject *swig_obj[1] ;
20584   char *result = 0 ;
20585 
20586   if (!args) SWIG_fail;
20587   swig_obj[0] = args;
20588   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
20589   if (!SWIG_IsOK(ecode1)) {
20590     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ssl_get_alert_desc_v" "', argument " "1"" of type '" "int""'");
20591   }
20592   arg1 = (int)(val1);
20593   result = (char *)SSL_alert_desc_string_long(arg1);
20594   resultobj = SWIG_FromCharPtr((const char *)result);
20595   return resultobj;
20596 fail:
20597   return NULL;
20598 }
20599 
20600 
_wrap_sslv23_method(PyObject * self,PyObject * args)20601 SWIGINTERN PyObject *_wrap_sslv23_method(PyObject *self, PyObject *args) {
20602   PyObject *resultobj = 0;
20603   SSL_METHOD *result = 0 ;
20604 
20605   if (!SWIG_Python_UnpackTuple(args, "sslv23_method", 0, 0, 0)) SWIG_fail;
20606   result = (SSL_METHOD *)SSLv23_method();
20607   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_METHOD, 0 |  0 );
20608   return resultobj;
20609 fail:
20610   return NULL;
20611 }
20612 
20613 
_wrap_ssl_ctx_new(PyObject * self,PyObject * args)20614 SWIGINTERN PyObject *_wrap_ssl_ctx_new(PyObject *self, PyObject *args) {
20615   PyObject *resultobj = 0;
20616   SSL_METHOD *arg1 = (SSL_METHOD *) 0 ;
20617   void *argp1 = 0 ;
20618   int res1 = 0 ;
20619   PyObject *swig_obj[1] ;
20620   SSL_CTX *result = 0 ;
20621 
20622   if (!args) SWIG_fail;
20623   swig_obj[0] = args;
20624   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_METHOD, 0 |  0 );
20625   if (!SWIG_IsOK(res1)) {
20626     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_new" "', argument " "1"" of type '" "SSL_METHOD *""'");
20627   }
20628   arg1 = (SSL_METHOD *)(argp1);
20629   result = (SSL_CTX *)SSL_CTX_new(arg1);
20630   {
20631     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
20632 
20633     if (result != NULL)
20634     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_SSL_CTX, 0);
20635     else {
20636       m2_PyErr_Msg(_ssl_err);
20637       resultobj = NULL;
20638     }
20639   }
20640   return resultobj;
20641 fail:
20642   return NULL;
20643 }
20644 
20645 
_wrap_ssl_ctx_free(PyObject * self,PyObject * args)20646 SWIGINTERN PyObject *_wrap_ssl_ctx_free(PyObject *self, PyObject *args) {
20647   PyObject *resultobj = 0;
20648   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20649   void *argp1 = 0 ;
20650   int res1 = 0 ;
20651   PyObject *swig_obj[1] ;
20652 
20653   if (!args) SWIG_fail;
20654   swig_obj[0] = args;
20655   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20656   if (!SWIG_IsOK(res1)) {
20657     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_free" "', argument " "1"" of type '" "SSL_CTX *""'");
20658   }
20659   arg1 = (SSL_CTX *)(argp1);
20660   {
20661     if (!arg1) {
20662       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20663     }
20664   }
20665   SSL_CTX_free(arg1);
20666   resultobj = SWIG_Py_Void();
20667   return resultobj;
20668 fail:
20669   return NULL;
20670 }
20671 
20672 
_wrap_ssl_ctx_set_verify_depth(PyObject * self,PyObject * args)20673 SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify_depth(PyObject *self, PyObject *args) {
20674   PyObject *resultobj = 0;
20675   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20676   int arg2 ;
20677   void *argp1 = 0 ;
20678   int res1 = 0 ;
20679   int val2 ;
20680   int ecode2 = 0 ;
20681   PyObject *swig_obj[2] ;
20682 
20683   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_verify_depth", 2, 2, swig_obj)) SWIG_fail;
20684   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20685   if (!SWIG_IsOK(res1)) {
20686     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_verify_depth" "', argument " "1"" of type '" "SSL_CTX *""'");
20687   }
20688   arg1 = (SSL_CTX *)(argp1);
20689   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
20690   if (!SWIG_IsOK(ecode2)) {
20691     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_verify_depth" "', argument " "2"" of type '" "int""'");
20692   }
20693   arg2 = (int)(val2);
20694   {
20695     if (!arg1) {
20696       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20697     }
20698   }
20699   SSL_CTX_set_verify_depth(arg1,arg2);
20700   resultobj = SWIG_Py_Void();
20701   return resultobj;
20702 fail:
20703   return NULL;
20704 }
20705 
20706 
_wrap_ssl_ctx_get_verify_depth(PyObject * self,PyObject * args)20707 SWIGINTERN PyObject *_wrap_ssl_ctx_get_verify_depth(PyObject *self, PyObject *args) {
20708   PyObject *resultobj = 0;
20709   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20710   void *argp1 = 0 ;
20711   int res1 = 0 ;
20712   PyObject *swig_obj[1] ;
20713   int result;
20714 
20715   if (!args) SWIG_fail;
20716   swig_obj[0] = args;
20717   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20718   if (!SWIG_IsOK(res1)) {
20719     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_verify_depth" "', argument " "1"" of type '" "SSL_CTX const *""'");
20720   }
20721   arg1 = (SSL_CTX *)(argp1);
20722   {
20723     if (!arg1) {
20724       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20725     }
20726   }
20727   result = (int)SSL_CTX_get_verify_depth((SSL_CTX const *)arg1);
20728   {
20729     resultobj=PyLong_FromLong(result);
20730     if (PyErr_Occurred()) SWIG_fail;
20731   }
20732   return resultobj;
20733 fail:
20734   return NULL;
20735 }
20736 
20737 
_wrap_ssl_ctx_get_verify_mode(PyObject * self,PyObject * args)20738 SWIGINTERN PyObject *_wrap_ssl_ctx_get_verify_mode(PyObject *self, PyObject *args) {
20739   PyObject *resultobj = 0;
20740   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20741   void *argp1 = 0 ;
20742   int res1 = 0 ;
20743   PyObject *swig_obj[1] ;
20744   int result;
20745 
20746   if (!args) SWIG_fail;
20747   swig_obj[0] = args;
20748   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20749   if (!SWIG_IsOK(res1)) {
20750     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_verify_mode" "', argument " "1"" of type '" "SSL_CTX const *""'");
20751   }
20752   arg1 = (SSL_CTX *)(argp1);
20753   {
20754     if (!arg1) {
20755       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20756     }
20757   }
20758   result = (int)SSL_CTX_get_verify_mode((SSL_CTX const *)arg1);
20759   {
20760     resultobj=PyLong_FromLong(result);
20761     if (PyErr_Occurred()) SWIG_fail;
20762   }
20763   return resultobj;
20764 fail:
20765   return NULL;
20766 }
20767 
20768 
_wrap_ssl_ctx_set_cipher_list(PyObject * self,PyObject * args)20769 SWIGINTERN PyObject *_wrap_ssl_ctx_set_cipher_list(PyObject *self, PyObject *args) {
20770   PyObject *resultobj = 0;
20771   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20772   char *arg2 = (char *) 0 ;
20773   void *argp1 = 0 ;
20774   int res1 = 0 ;
20775   int res2 ;
20776   char *buf2 = 0 ;
20777   int alloc2 = 0 ;
20778   PyObject *swig_obj[2] ;
20779   int result;
20780 
20781   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_cipher_list", 2, 2, swig_obj)) SWIG_fail;
20782   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20783   if (!SWIG_IsOK(res1)) {
20784     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_cipher_list" "', argument " "1"" of type '" "SSL_CTX *""'");
20785   }
20786   arg1 = (SSL_CTX *)(argp1);
20787   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
20788   if (!SWIG_IsOK(res2)) {
20789     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_cipher_list" "', argument " "2"" of type '" "char const *""'");
20790   }
20791   arg2 = (char *)(buf2);
20792   {
20793     if (!arg1) {
20794       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20795     }
20796   }
20797   result = (int)SSL_CTX_set_cipher_list(arg1,(char const *)arg2);
20798   {
20799     resultobj=PyLong_FromLong(result);
20800     if (PyErr_Occurred()) SWIG_fail;
20801   }
20802   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
20803   return resultobj;
20804 fail:
20805   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
20806   return NULL;
20807 }
20808 
20809 
_wrap_ssl_ctx_add_session(PyObject * self,PyObject * args)20810 SWIGINTERN PyObject *_wrap_ssl_ctx_add_session(PyObject *self, PyObject *args) {
20811   PyObject *resultobj = 0;
20812   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20813   SSL_SESSION *arg2 = (SSL_SESSION *) 0 ;
20814   void *argp1 = 0 ;
20815   int res1 = 0 ;
20816   void *argp2 = 0 ;
20817   int res2 = 0 ;
20818   PyObject *swig_obj[2] ;
20819   int result;
20820 
20821   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_add_session", 2, 2, swig_obj)) SWIG_fail;
20822   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20823   if (!SWIG_IsOK(res1)) {
20824     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_add_session" "', argument " "1"" of type '" "SSL_CTX *""'");
20825   }
20826   arg1 = (SSL_CTX *)(argp1);
20827   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL_SESSION, 0 |  0 );
20828   if (!SWIG_IsOK(res2)) {
20829     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_add_session" "', argument " "2"" of type '" "SSL_SESSION *""'");
20830   }
20831   arg2 = (SSL_SESSION *)(argp2);
20832   {
20833     if (!arg1) {
20834       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20835     }
20836   }
20837   result = (int)SSL_CTX_add_session(arg1,arg2);
20838   {
20839     resultobj=PyLong_FromLong(result);
20840     if (PyErr_Occurred()) SWIG_fail;
20841   }
20842   return resultobj;
20843 fail:
20844   return NULL;
20845 }
20846 
20847 
_wrap_ssl_ctx_remove_session(PyObject * self,PyObject * args)20848 SWIGINTERN PyObject *_wrap_ssl_ctx_remove_session(PyObject *self, PyObject *args) {
20849   PyObject *resultobj = 0;
20850   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20851   SSL_SESSION *arg2 = (SSL_SESSION *) 0 ;
20852   void *argp1 = 0 ;
20853   int res1 = 0 ;
20854   void *argp2 = 0 ;
20855   int res2 = 0 ;
20856   PyObject *swig_obj[2] ;
20857   int result;
20858 
20859   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_remove_session", 2, 2, swig_obj)) SWIG_fail;
20860   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20861   if (!SWIG_IsOK(res1)) {
20862     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_remove_session" "', argument " "1"" of type '" "SSL_CTX *""'");
20863   }
20864   arg1 = (SSL_CTX *)(argp1);
20865   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL_SESSION, 0 |  0 );
20866   if (!SWIG_IsOK(res2)) {
20867     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_remove_session" "', argument " "2"" of type '" "SSL_SESSION *""'");
20868   }
20869   arg2 = (SSL_SESSION *)(argp2);
20870   {
20871     if (!arg1) {
20872       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20873     }
20874   }
20875   result = (int)SSL_CTX_remove_session(arg1,arg2);
20876   {
20877     resultobj=PyLong_FromLong(result);
20878     if (PyErr_Occurred()) SWIG_fail;
20879   }
20880   return resultobj;
20881 fail:
20882   return NULL;
20883 }
20884 
20885 
_wrap_ssl_ctx_set_session_timeout(PyObject * self,PyObject * args)20886 SWIGINTERN PyObject *_wrap_ssl_ctx_set_session_timeout(PyObject *self, PyObject *args) {
20887   PyObject *resultobj = 0;
20888   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20889   long arg2 ;
20890   void *argp1 = 0 ;
20891   int res1 = 0 ;
20892   long val2 ;
20893   int ecode2 = 0 ;
20894   PyObject *swig_obj[2] ;
20895   long result;
20896 
20897   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_session_timeout", 2, 2, swig_obj)) SWIG_fail;
20898   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20899   if (!SWIG_IsOK(res1)) {
20900     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_session_timeout" "', argument " "1"" of type '" "SSL_CTX *""'");
20901   }
20902   arg1 = (SSL_CTX *)(argp1);
20903   ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
20904   if (!SWIG_IsOK(ecode2)) {
20905     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_session_timeout" "', argument " "2"" of type '" "long""'");
20906   }
20907   arg2 = (long)(val2);
20908   {
20909     if (!arg1) {
20910       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20911     }
20912   }
20913   result = (long)SSL_CTX_set_timeout(arg1,arg2);
20914   resultobj = SWIG_From_long((long)(result));
20915   return resultobj;
20916 fail:
20917   return NULL;
20918 }
20919 
20920 
_wrap_ssl_ctx_get_session_timeout(PyObject * self,PyObject * args)20921 SWIGINTERN PyObject *_wrap_ssl_ctx_get_session_timeout(PyObject *self, PyObject *args) {
20922   PyObject *resultobj = 0;
20923   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20924   void *argp1 = 0 ;
20925   int res1 = 0 ;
20926   PyObject *swig_obj[1] ;
20927   long result;
20928 
20929   if (!args) SWIG_fail;
20930   swig_obj[0] = args;
20931   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20932   if (!SWIG_IsOK(res1)) {
20933     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_session_timeout" "', argument " "1"" of type '" "SSL_CTX const *""'");
20934   }
20935   arg1 = (SSL_CTX *)(argp1);
20936   {
20937     if (!arg1) {
20938       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20939     }
20940   }
20941   result = (long)SSL_CTX_get_timeout((SSL_CTX const *)arg1);
20942   resultobj = SWIG_From_long((long)(result));
20943   return resultobj;
20944 fail:
20945   return NULL;
20946 }
20947 
20948 
_wrap_ssl_ctx_get_cert_store(PyObject * self,PyObject * args)20949 SWIGINTERN PyObject *_wrap_ssl_ctx_get_cert_store(PyObject *self, PyObject *args) {
20950   PyObject *resultobj = 0;
20951   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20952   void *argp1 = 0 ;
20953   int res1 = 0 ;
20954   PyObject *swig_obj[1] ;
20955   X509_STORE *result = 0 ;
20956 
20957   if (!args) SWIG_fail;
20958   swig_obj[0] = args;
20959   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20960   if (!SWIG_IsOK(res1)) {
20961     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_cert_store" "', argument " "1"" of type '" "SSL_CTX const *""'");
20962   }
20963   arg1 = (SSL_CTX *)(argp1);
20964   {
20965     if (!arg1) {
20966       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20967     }
20968   }
20969   result = (X509_STORE *)SSL_CTX_get_cert_store((SSL_CTX const *)arg1);
20970   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_STORE, 0 |  0 );
20971   return resultobj;
20972 fail:
20973   return NULL;
20974 }
20975 
20976 
_wrap_ssl_ctx_set_default_verify_paths(PyObject * self,PyObject * args)20977 SWIGINTERN PyObject *_wrap_ssl_ctx_set_default_verify_paths(PyObject *self, PyObject *args) {
20978   PyObject *resultobj = 0;
20979   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
20980   void *argp1 = 0 ;
20981   int res1 = 0 ;
20982   PyObject *swig_obj[1] ;
20983   int result;
20984 
20985   if (!args) SWIG_fail;
20986   swig_obj[0] = args;
20987   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
20988   if (!SWIG_IsOK(res1)) {
20989     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_default_verify_paths" "', argument " "1"" of type '" "SSL_CTX *""'");
20990   }
20991   arg1 = (SSL_CTX *)(argp1);
20992   {
20993     if (!arg1) {
20994       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
20995     }
20996   }
20997   result = (int)SSL_CTX_set_default_verify_paths(arg1);
20998   {
20999     resultobj=PyLong_FromLong(result);
21000     if (PyErr_Occurred()) SWIG_fail;
21001   }
21002   return resultobj;
21003 fail:
21004   return NULL;
21005 }
21006 
21007 
_wrap_ssl_get_ex_data_x509_store_ctx_idx(PyObject * self,PyObject * args)21008 SWIGINTERN PyObject *_wrap_ssl_get_ex_data_x509_store_ctx_idx(PyObject *self, PyObject *args) {
21009   PyObject *resultobj = 0;
21010   int result;
21011 
21012   if (!SWIG_Python_UnpackTuple(args, "ssl_get_ex_data_x509_store_ctx_idx", 0, 0, 0)) SWIG_fail;
21013   result = (int)SSL_get_ex_data_X509_STORE_CTX_idx();
21014   {
21015     resultobj=PyLong_FromLong(result);
21016     if (PyErr_Occurred()) SWIG_fail;
21017   }
21018   return resultobj;
21019 fail:
21020   return NULL;
21021 }
21022 
21023 
_wrap_bio_new_ssl(PyObject * self,PyObject * args)21024 SWIGINTERN PyObject *_wrap_bio_new_ssl(PyObject *self, PyObject *args) {
21025   PyObject *resultobj = 0;
21026   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
21027   int arg2 ;
21028   void *argp1 = 0 ;
21029   int res1 = 0 ;
21030   int val2 ;
21031   int ecode2 = 0 ;
21032   PyObject *swig_obj[2] ;
21033   BIO *result = 0 ;
21034 
21035   if (!SWIG_Python_UnpackTuple(args, "bio_new_ssl", 2, 2, swig_obj)) SWIG_fail;
21036   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
21037   if (!SWIG_IsOK(res1)) {
21038     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_new_ssl" "', argument " "1"" of type '" "SSL_CTX *""'");
21039   }
21040   arg1 = (SSL_CTX *)(argp1);
21041   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
21042   if (!SWIG_IsOK(ecode2)) {
21043     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "bio_new_ssl" "', argument " "2"" of type '" "int""'");
21044   }
21045   arg2 = (int)(val2);
21046   {
21047     if (!arg1) {
21048       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21049     }
21050   }
21051   result = (BIO *)BIO_new_ssl(arg1,arg2);
21052   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_BIO, 0 |  0 );
21053   return resultobj;
21054 fail:
21055   return NULL;
21056 }
21057 
21058 
_wrap_ssl_new(PyObject * self,PyObject * args)21059 SWIGINTERN PyObject *_wrap_ssl_new(PyObject *self, PyObject *args) {
21060   PyObject *resultobj = 0;
21061   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
21062   void *argp1 = 0 ;
21063   int res1 = 0 ;
21064   PyObject *swig_obj[1] ;
21065   SSL *result = 0 ;
21066 
21067   if (!args) SWIG_fail;
21068   swig_obj[0] = args;
21069   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
21070   if (!SWIG_IsOK(res1)) {
21071     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_new" "', argument " "1"" of type '" "SSL_CTX *""'");
21072   }
21073   arg1 = (SSL_CTX *)(argp1);
21074   {
21075     if (!arg1) {
21076       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21077     }
21078   }
21079   result = (SSL *)SSL_new(arg1);
21080   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL, 0 |  0 );
21081   return resultobj;
21082 fail:
21083   return NULL;
21084 }
21085 
21086 
_wrap_ssl_free(PyObject * self,PyObject * args)21087 SWIGINTERN PyObject *_wrap_ssl_free(PyObject *self, PyObject *args) {
21088   PyObject *resultobj = 0;
21089   SSL *arg1 = (SSL *) 0 ;
21090   void *argp1 = 0 ;
21091   int res1 = 0 ;
21092   PyObject *swig_obj[1] ;
21093 
21094   if (!args) SWIG_fail;
21095   swig_obj[0] = args;
21096   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21097   if (!SWIG_IsOK(res1)) {
21098     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_free" "', argument " "1"" of type '" "SSL *""'");
21099   }
21100   arg1 = (SSL *)(argp1);
21101   {
21102     if (!arg1) {
21103       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21104     }
21105   }
21106   {
21107     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21108     SSL_free(arg1);
21109     SWIG_PYTHON_THREAD_END_ALLOW;
21110   }
21111   resultobj = SWIG_Py_Void();
21112   return resultobj;
21113 fail:
21114   return NULL;
21115 }
21116 
21117 
_wrap_ssl_dup(PyObject * self,PyObject * args)21118 SWIGINTERN PyObject *_wrap_ssl_dup(PyObject *self, PyObject *args) {
21119   PyObject *resultobj = 0;
21120   SSL *arg1 = (SSL *) 0 ;
21121   void *argp1 = 0 ;
21122   int res1 = 0 ;
21123   PyObject *swig_obj[1] ;
21124   SSL *result = 0 ;
21125 
21126   if (!args) SWIG_fail;
21127   swig_obj[0] = args;
21128   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21129   if (!SWIG_IsOK(res1)) {
21130     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_dup" "', argument " "1"" of type '" "SSL *""'");
21131   }
21132   arg1 = (SSL *)(argp1);
21133   {
21134     if (!arg1) {
21135       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21136     }
21137   }
21138   result = (SSL *)SSL_dup(arg1);
21139   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL, 0 |  0 );
21140   return resultobj;
21141 fail:
21142   return NULL;
21143 }
21144 
21145 
_wrap_ssl_set_bio(PyObject * self,PyObject * args)21146 SWIGINTERN PyObject *_wrap_ssl_set_bio(PyObject *self, PyObject *args) {
21147   PyObject *resultobj = 0;
21148   SSL *arg1 = (SSL *) 0 ;
21149   BIO *arg2 = (BIO *) 0 ;
21150   BIO *arg3 = (BIO *) 0 ;
21151   void *argp1 = 0 ;
21152   int res1 = 0 ;
21153   void *argp2 = 0 ;
21154   int res2 = 0 ;
21155   void *argp3 = 0 ;
21156   int res3 = 0 ;
21157   PyObject *swig_obj[3] ;
21158 
21159   if (!SWIG_Python_UnpackTuple(args, "ssl_set_bio", 3, 3, swig_obj)) SWIG_fail;
21160   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21161   if (!SWIG_IsOK(res1)) {
21162     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_bio" "', argument " "1"" of type '" "SSL *""'");
21163   }
21164   arg1 = (SSL *)(argp1);
21165   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
21166   if (!SWIG_IsOK(res2)) {
21167     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_bio" "', argument " "2"" of type '" "BIO *""'");
21168   }
21169   arg2 = (BIO *)(argp2);
21170   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_BIO, 0 |  0 );
21171   if (!SWIG_IsOK(res3)) {
21172     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ssl_set_bio" "', argument " "3"" of type '" "BIO *""'");
21173   }
21174   arg3 = (BIO *)(argp3);
21175   {
21176     if (!arg1) {
21177       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21178     }
21179   }
21180   {
21181     if (!arg2) {
21182       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21183     }
21184   }
21185   {
21186     if (!arg3) {
21187       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21188     }
21189   }
21190   SSL_set_bio(arg1,arg2,arg3);
21191   resultobj = SWIG_Py_Void();
21192   return resultobj;
21193 fail:
21194   return NULL;
21195 }
21196 
21197 
_wrap_ssl_set_accept_state(PyObject * self,PyObject * args)21198 SWIGINTERN PyObject *_wrap_ssl_set_accept_state(PyObject *self, PyObject *args) {
21199   PyObject *resultobj = 0;
21200   SSL *arg1 = (SSL *) 0 ;
21201   void *argp1 = 0 ;
21202   int res1 = 0 ;
21203   PyObject *swig_obj[1] ;
21204 
21205   if (!args) SWIG_fail;
21206   swig_obj[0] = args;
21207   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21208   if (!SWIG_IsOK(res1)) {
21209     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_accept_state" "', argument " "1"" of type '" "SSL *""'");
21210   }
21211   arg1 = (SSL *)(argp1);
21212   {
21213     if (!arg1) {
21214       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21215     }
21216   }
21217   SSL_set_accept_state(arg1);
21218   resultobj = SWIG_Py_Void();
21219   return resultobj;
21220 fail:
21221   return NULL;
21222 }
21223 
21224 
_wrap_ssl_set_connect_state(PyObject * self,PyObject * args)21225 SWIGINTERN PyObject *_wrap_ssl_set_connect_state(PyObject *self, PyObject *args) {
21226   PyObject *resultobj = 0;
21227   SSL *arg1 = (SSL *) 0 ;
21228   void *argp1 = 0 ;
21229   int res1 = 0 ;
21230   PyObject *swig_obj[1] ;
21231 
21232   if (!args) SWIG_fail;
21233   swig_obj[0] = args;
21234   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21235   if (!SWIG_IsOK(res1)) {
21236     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_connect_state" "', argument " "1"" of type '" "SSL *""'");
21237   }
21238   arg1 = (SSL *)(argp1);
21239   {
21240     if (!arg1) {
21241       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21242     }
21243   }
21244   SSL_set_connect_state(arg1);
21245   resultobj = SWIG_Py_Void();
21246   return resultobj;
21247 fail:
21248   return NULL;
21249 }
21250 
21251 
_wrap_ssl_get_shutdown(PyObject * self,PyObject * args)21252 SWIGINTERN PyObject *_wrap_ssl_get_shutdown(PyObject *self, PyObject *args) {
21253   PyObject *resultobj = 0;
21254   SSL *arg1 = (SSL *) 0 ;
21255   void *argp1 = 0 ;
21256   int res1 = 0 ;
21257   PyObject *swig_obj[1] ;
21258   int result;
21259 
21260   if (!args) SWIG_fail;
21261   swig_obj[0] = args;
21262   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21263   if (!SWIG_IsOK(res1)) {
21264     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_shutdown" "', argument " "1"" of type '" "SSL const *""'");
21265   }
21266   arg1 = (SSL *)(argp1);
21267   {
21268     if (!arg1) {
21269       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21270     }
21271   }
21272   result = (int)SSL_get_shutdown((SSL const *)arg1);
21273   {
21274     resultobj=PyLong_FromLong(result);
21275     if (PyErr_Occurred()) SWIG_fail;
21276   }
21277   return resultobj;
21278 fail:
21279   return NULL;
21280 }
21281 
21282 
_wrap_ssl_set_shutdown(PyObject * self,PyObject * args)21283 SWIGINTERN PyObject *_wrap_ssl_set_shutdown(PyObject *self, PyObject *args) {
21284   PyObject *resultobj = 0;
21285   SSL *arg1 = (SSL *) 0 ;
21286   int arg2 ;
21287   void *argp1 = 0 ;
21288   int res1 = 0 ;
21289   int val2 ;
21290   int ecode2 = 0 ;
21291   PyObject *swig_obj[2] ;
21292 
21293   if (!SWIG_Python_UnpackTuple(args, "ssl_set_shutdown", 2, 2, swig_obj)) SWIG_fail;
21294   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21295   if (!SWIG_IsOK(res1)) {
21296     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_shutdown" "', argument " "1"" of type '" "SSL *""'");
21297   }
21298   arg1 = (SSL *)(argp1);
21299   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
21300   if (!SWIG_IsOK(ecode2)) {
21301     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_shutdown" "', argument " "2"" of type '" "int""'");
21302   }
21303   arg2 = (int)(val2);
21304   {
21305     if (!arg1) {
21306       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21307     }
21308   }
21309   SSL_set_shutdown(arg1,arg2);
21310   resultobj = SWIG_Py_Void();
21311   return resultobj;
21312 fail:
21313   return NULL;
21314 }
21315 
21316 
_wrap_ssl_shutdown(PyObject * self,PyObject * args)21317 SWIGINTERN PyObject *_wrap_ssl_shutdown(PyObject *self, PyObject *args) {
21318   PyObject *resultobj = 0;
21319   SSL *arg1 = (SSL *) 0 ;
21320   void *argp1 = 0 ;
21321   int res1 = 0 ;
21322   PyObject *swig_obj[1] ;
21323   int result;
21324 
21325   if (!args) SWIG_fail;
21326   swig_obj[0] = args;
21327   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21328   if (!SWIG_IsOK(res1)) {
21329     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_shutdown" "', argument " "1"" of type '" "SSL *""'");
21330   }
21331   arg1 = (SSL *)(argp1);
21332   {
21333     if (!arg1) {
21334       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21335     }
21336   }
21337   {
21338     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21339     result = (int)SSL_shutdown(arg1);
21340     SWIG_PYTHON_THREAD_END_ALLOW;
21341   }
21342   {
21343     resultobj=PyLong_FromLong(result);
21344     if (PyErr_Occurred()) SWIG_fail;
21345   }
21346   return resultobj;
21347 fail:
21348   return NULL;
21349 }
21350 
21351 
_wrap_ssl_clear(PyObject * self,PyObject * args)21352 SWIGINTERN PyObject *_wrap_ssl_clear(PyObject *self, PyObject *args) {
21353   PyObject *resultobj = 0;
21354   SSL *arg1 = (SSL *) 0 ;
21355   void *argp1 = 0 ;
21356   int res1 = 0 ;
21357   PyObject *swig_obj[1] ;
21358   int result;
21359 
21360   if (!args) SWIG_fail;
21361   swig_obj[0] = args;
21362   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21363   if (!SWIG_IsOK(res1)) {
21364     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_clear" "', argument " "1"" of type '" "SSL *""'");
21365   }
21366   arg1 = (SSL *)(argp1);
21367   {
21368     if (!arg1) {
21369       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21370     }
21371   }
21372   result = (int)SSL_clear(arg1);
21373   {
21374     resultobj=PyLong_FromLong(result);
21375     if (PyErr_Occurred()) SWIG_fail;
21376   }
21377   return resultobj;
21378 fail:
21379   return NULL;
21380 }
21381 
21382 
_wrap_ssl_do_handshake(PyObject * self,PyObject * args)21383 SWIGINTERN PyObject *_wrap_ssl_do_handshake(PyObject *self, PyObject *args) {
21384   PyObject *resultobj = 0;
21385   SSL *arg1 = (SSL *) 0 ;
21386   void *argp1 = 0 ;
21387   int res1 = 0 ;
21388   PyObject *swig_obj[1] ;
21389   int result;
21390 
21391   if (!args) SWIG_fail;
21392   swig_obj[0] = args;
21393   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21394   if (!SWIG_IsOK(res1)) {
21395     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_do_handshake" "', argument " "1"" of type '" "SSL *""'");
21396   }
21397   arg1 = (SSL *)(argp1);
21398   {
21399     if (!arg1) {
21400       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21401     }
21402   }
21403   {
21404     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21405     result = (int)SSL_do_handshake(arg1);
21406     SWIG_PYTHON_THREAD_END_ALLOW;
21407   }
21408   {
21409     resultobj=PyLong_FromLong(result);
21410     if (PyErr_Occurred()) SWIG_fail;
21411   }
21412   return resultobj;
21413 fail:
21414   return NULL;
21415 }
21416 
21417 
_wrap_ssl_renegotiate(PyObject * self,PyObject * args)21418 SWIGINTERN PyObject *_wrap_ssl_renegotiate(PyObject *self, PyObject *args) {
21419   PyObject *resultobj = 0;
21420   SSL *arg1 = (SSL *) 0 ;
21421   void *argp1 = 0 ;
21422   int res1 = 0 ;
21423   PyObject *swig_obj[1] ;
21424   int result;
21425 
21426   if (!args) SWIG_fail;
21427   swig_obj[0] = args;
21428   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21429   if (!SWIG_IsOK(res1)) {
21430     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_renegotiate" "', argument " "1"" of type '" "SSL *""'");
21431   }
21432   arg1 = (SSL *)(argp1);
21433   {
21434     if (!arg1) {
21435       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21436     }
21437   }
21438   {
21439     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21440     result = (int)SSL_renegotiate(arg1);
21441     SWIG_PYTHON_THREAD_END_ALLOW;
21442   }
21443   {
21444     resultobj=PyLong_FromLong(result);
21445     if (PyErr_Occurred()) SWIG_fail;
21446   }
21447   return resultobj;
21448 fail:
21449   return NULL;
21450 }
21451 
21452 
_wrap_ssl_pending(PyObject * self,PyObject * args)21453 SWIGINTERN PyObject *_wrap_ssl_pending(PyObject *self, PyObject *args) {
21454   PyObject *resultobj = 0;
21455   SSL *arg1 = (SSL *) 0 ;
21456   void *argp1 = 0 ;
21457   int res1 = 0 ;
21458   PyObject *swig_obj[1] ;
21459   int result;
21460 
21461   if (!args) SWIG_fail;
21462   swig_obj[0] = args;
21463   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21464   if (!SWIG_IsOK(res1)) {
21465     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_pending" "', argument " "1"" of type '" "SSL const *""'");
21466   }
21467   arg1 = (SSL *)(argp1);
21468   {
21469     if (!arg1) {
21470       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21471     }
21472   }
21473   result = (int)SSL_pending((SSL const *)arg1);
21474   {
21475     resultobj=PyLong_FromLong(result);
21476     if (PyErr_Occurred()) SWIG_fail;
21477   }
21478   return resultobj;
21479 fail:
21480   return NULL;
21481 }
21482 
21483 
_wrap_ssl_get_peer_cert(PyObject * self,PyObject * args)21484 SWIGINTERN PyObject *_wrap_ssl_get_peer_cert(PyObject *self, PyObject *args) {
21485   PyObject *resultobj = 0;
21486   SSL *arg1 = (SSL *) 0 ;
21487   void *argp1 = 0 ;
21488   int res1 = 0 ;
21489   PyObject *swig_obj[1] ;
21490   X509 *result = 0 ;
21491 
21492   if (!args) SWIG_fail;
21493   swig_obj[0] = args;
21494   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21495   if (!SWIG_IsOK(res1)) {
21496     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_peer_cert" "', argument " "1"" of type '" "SSL const *""'");
21497   }
21498   arg1 = (SSL *)(argp1);
21499   {
21500     if (!arg1) {
21501       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21502     }
21503   }
21504   result = (X509 *)SSL_get_peer_certificate((SSL const *)arg1);
21505   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 |  0 );
21506   return resultobj;
21507 fail:
21508   return NULL;
21509 }
21510 
21511 
_wrap_ssl_get_current_cipher(PyObject * self,PyObject * args)21512 SWIGINTERN PyObject *_wrap_ssl_get_current_cipher(PyObject *self, PyObject *args) {
21513   PyObject *resultobj = 0;
21514   SSL *arg1 = (SSL *) 0 ;
21515   void *argp1 = 0 ;
21516   int res1 = 0 ;
21517   PyObject *swig_obj[1] ;
21518   SSL_CIPHER *result = 0 ;
21519 
21520   if (!args) SWIG_fail;
21521   swig_obj[0] = args;
21522   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21523   if (!SWIG_IsOK(res1)) {
21524     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_current_cipher" "', argument " "1"" of type '" "SSL const *""'");
21525   }
21526   arg1 = (SSL *)(argp1);
21527   {
21528     if (!arg1) {
21529       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21530     }
21531   }
21532   result = (SSL_CIPHER *)SSL_get_current_cipher((SSL const *)arg1);
21533   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_CIPHER, 0 |  0 );
21534   return resultobj;
21535 fail:
21536   return NULL;
21537 }
21538 
21539 
_wrap_ssl_get_verify_mode(PyObject * self,PyObject * args)21540 SWIGINTERN PyObject *_wrap_ssl_get_verify_mode(PyObject *self, PyObject *args) {
21541   PyObject *resultobj = 0;
21542   SSL *arg1 = (SSL *) 0 ;
21543   void *argp1 = 0 ;
21544   int res1 = 0 ;
21545   PyObject *swig_obj[1] ;
21546   int result;
21547 
21548   if (!args) SWIG_fail;
21549   swig_obj[0] = args;
21550   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21551   if (!SWIG_IsOK(res1)) {
21552     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_mode" "', argument " "1"" of type '" "SSL const *""'");
21553   }
21554   arg1 = (SSL *)(argp1);
21555   {
21556     if (!arg1) {
21557       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21558     }
21559   }
21560   result = (int)SSL_get_verify_mode((SSL const *)arg1);
21561   {
21562     resultobj=PyLong_FromLong(result);
21563     if (PyErr_Occurred()) SWIG_fail;
21564   }
21565   return resultobj;
21566 fail:
21567   return NULL;
21568 }
21569 
21570 
_wrap_ssl_get_verify_depth(PyObject * self,PyObject * args)21571 SWIGINTERN PyObject *_wrap_ssl_get_verify_depth(PyObject *self, PyObject *args) {
21572   PyObject *resultobj = 0;
21573   SSL *arg1 = (SSL *) 0 ;
21574   void *argp1 = 0 ;
21575   int res1 = 0 ;
21576   PyObject *swig_obj[1] ;
21577   int result;
21578 
21579   if (!args) SWIG_fail;
21580   swig_obj[0] = args;
21581   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21582   if (!SWIG_IsOK(res1)) {
21583     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_depth" "', argument " "1"" of type '" "SSL const *""'");
21584   }
21585   arg1 = (SSL *)(argp1);
21586   {
21587     if (!arg1) {
21588       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21589     }
21590   }
21591   result = (int)SSL_get_verify_depth((SSL const *)arg1);
21592   {
21593     resultobj=PyLong_FromLong(result);
21594     if (PyErr_Occurred()) SWIG_fail;
21595   }
21596   return resultobj;
21597 fail:
21598   return NULL;
21599 }
21600 
21601 
_wrap_ssl_get_verify_result(PyObject * self,PyObject * args)21602 SWIGINTERN PyObject *_wrap_ssl_get_verify_result(PyObject *self, PyObject *args) {
21603   PyObject *resultobj = 0;
21604   SSL *arg1 = (SSL *) 0 ;
21605   void *argp1 = 0 ;
21606   int res1 = 0 ;
21607   PyObject *swig_obj[1] ;
21608   long result;
21609 
21610   if (!args) SWIG_fail;
21611   swig_obj[0] = args;
21612   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21613   if (!SWIG_IsOK(res1)) {
21614     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_verify_result" "', argument " "1"" of type '" "SSL const *""'");
21615   }
21616   arg1 = (SSL *)(argp1);
21617   {
21618     if (!arg1) {
21619       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21620     }
21621   }
21622   result = (long)SSL_get_verify_result((SSL const *)arg1);
21623   resultobj = SWIG_From_long((long)(result));
21624   return resultobj;
21625 fail:
21626   return NULL;
21627 }
21628 
21629 
_wrap_ssl_get_ssl_ctx(PyObject * self,PyObject * args)21630 SWIGINTERN PyObject *_wrap_ssl_get_ssl_ctx(PyObject *self, PyObject *args) {
21631   PyObject *resultobj = 0;
21632   SSL *arg1 = (SSL *) 0 ;
21633   void *argp1 = 0 ;
21634   int res1 = 0 ;
21635   PyObject *swig_obj[1] ;
21636   SSL_CTX *result = 0 ;
21637 
21638   if (!args) SWIG_fail;
21639   swig_obj[0] = args;
21640   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21641   if (!SWIG_IsOK(res1)) {
21642     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_ssl_ctx" "', argument " "1"" of type '" "SSL const *""'");
21643   }
21644   arg1 = (SSL *)(argp1);
21645   {
21646     if (!arg1) {
21647       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21648     }
21649   }
21650   result = (SSL_CTX *)SSL_get_SSL_CTX((SSL const *)arg1);
21651   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_CTX, 0 |  0 );
21652   return resultobj;
21653 fail:
21654   return NULL;
21655 }
21656 
21657 
_wrap_ssl_get_default_session_timeout(PyObject * self,PyObject * args)21658 SWIGINTERN PyObject *_wrap_ssl_get_default_session_timeout(PyObject *self, PyObject *args) {
21659   PyObject *resultobj = 0;
21660   SSL *arg1 = (SSL *) 0 ;
21661   void *argp1 = 0 ;
21662   int res1 = 0 ;
21663   PyObject *swig_obj[1] ;
21664   long result;
21665 
21666   if (!args) SWIG_fail;
21667   swig_obj[0] = args;
21668   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21669   if (!SWIG_IsOK(res1)) {
21670     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_default_session_timeout" "', argument " "1"" of type '" "SSL const *""'");
21671   }
21672   arg1 = (SSL *)(argp1);
21673   {
21674     if (!arg1) {
21675       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21676     }
21677   }
21678   result = (long)SSL_get_default_timeout((SSL const *)arg1);
21679   resultobj = SWIG_From_long((long)(result));
21680   return resultobj;
21681 fail:
21682   return NULL;
21683 }
21684 
21685 
_wrap_ssl_set_cipher_list(PyObject * self,PyObject * args)21686 SWIGINTERN PyObject *_wrap_ssl_set_cipher_list(PyObject *self, PyObject *args) {
21687   PyObject *resultobj = 0;
21688   SSL *arg1 = (SSL *) 0 ;
21689   char *arg2 = (char *) 0 ;
21690   void *argp1 = 0 ;
21691   int res1 = 0 ;
21692   int res2 ;
21693   char *buf2 = 0 ;
21694   int alloc2 = 0 ;
21695   PyObject *swig_obj[2] ;
21696   int result;
21697 
21698   if (!SWIG_Python_UnpackTuple(args, "ssl_set_cipher_list", 2, 2, swig_obj)) SWIG_fail;
21699   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21700   if (!SWIG_IsOK(res1)) {
21701     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_cipher_list" "', argument " "1"" of type '" "SSL *""'");
21702   }
21703   arg1 = (SSL *)(argp1);
21704   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
21705   if (!SWIG_IsOK(res2)) {
21706     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_cipher_list" "', argument " "2"" of type '" "char const *""'");
21707   }
21708   arg2 = (char *)(buf2);
21709   {
21710     if (!arg1) {
21711       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21712     }
21713   }
21714   result = (int)SSL_set_cipher_list(arg1,(char const *)arg2);
21715   {
21716     resultobj=PyLong_FromLong(result);
21717     if (PyErr_Occurred()) SWIG_fail;
21718   }
21719   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
21720   return resultobj;
21721 fail:
21722   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
21723   return NULL;
21724 }
21725 
21726 
_wrap_ssl_get_cipher_list(PyObject * self,PyObject * args)21727 SWIGINTERN PyObject *_wrap_ssl_get_cipher_list(PyObject *self, PyObject *args) {
21728   PyObject *resultobj = 0;
21729   SSL *arg1 = (SSL *) 0 ;
21730   int arg2 ;
21731   void *argp1 = 0 ;
21732   int res1 = 0 ;
21733   int val2 ;
21734   int ecode2 = 0 ;
21735   PyObject *swig_obj[2] ;
21736   char *result = 0 ;
21737 
21738   if (!SWIG_Python_UnpackTuple(args, "ssl_get_cipher_list", 2, 2, swig_obj)) SWIG_fail;
21739   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21740   if (!SWIG_IsOK(res1)) {
21741     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_cipher_list" "', argument " "1"" of type '" "SSL const *""'");
21742   }
21743   arg1 = (SSL *)(argp1);
21744   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
21745   if (!SWIG_IsOK(ecode2)) {
21746     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_get_cipher_list" "', argument " "2"" of type '" "int""'");
21747   }
21748   arg2 = (int)(val2);
21749   {
21750     if (!arg1) {
21751       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21752     }
21753   }
21754   result = (char *)SSL_get_cipher_list((SSL const *)arg1,arg2);
21755   resultobj = SWIG_FromCharPtr((const char *)result);
21756   return resultobj;
21757 fail:
21758   return NULL;
21759 }
21760 
21761 
_wrap_ssl_cipher_get_name(PyObject * self,PyObject * args)21762 SWIGINTERN PyObject *_wrap_ssl_cipher_get_name(PyObject *self, PyObject *args) {
21763   PyObject *resultobj = 0;
21764   SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ;
21765   void *argp1 = 0 ;
21766   int res1 = 0 ;
21767   PyObject *swig_obj[1] ;
21768   char *result = 0 ;
21769 
21770   if (!args) SWIG_fail;
21771   swig_obj[0] = args;
21772   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CIPHER, 0 |  0 );
21773   if (!SWIG_IsOK(res1)) {
21774     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_cipher_get_name" "', argument " "1"" of type '" "SSL_CIPHER const *""'");
21775   }
21776   arg1 = (SSL_CIPHER *)(argp1);
21777   {
21778     if (!arg1) {
21779       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21780     }
21781   }
21782   result = (char *)SSL_CIPHER_get_name((SSL_CIPHER const *)arg1);
21783   resultobj = SWIG_FromCharPtr((const char *)result);
21784   return resultobj;
21785 fail:
21786   return NULL;
21787 }
21788 
21789 
_wrap_ssl_cipher_get_version(PyObject * self,PyObject * args)21790 SWIGINTERN PyObject *_wrap_ssl_cipher_get_version(PyObject *self, PyObject *args) {
21791   PyObject *resultobj = 0;
21792   SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ;
21793   void *argp1 = 0 ;
21794   int res1 = 0 ;
21795   PyObject *swig_obj[1] ;
21796   char *result = 0 ;
21797 
21798   if (!args) SWIG_fail;
21799   swig_obj[0] = args;
21800   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CIPHER, 0 |  0 );
21801   if (!SWIG_IsOK(res1)) {
21802     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_cipher_get_version" "', argument " "1"" of type '" "SSL_CIPHER const *""'");
21803   }
21804   arg1 = (SSL_CIPHER *)(argp1);
21805   {
21806     if (!arg1) {
21807       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21808     }
21809   }
21810   result = (char *)SSL_CIPHER_get_version((SSL_CIPHER const *)arg1);
21811   resultobj = SWIG_FromCharPtr((const char *)result);
21812   return resultobj;
21813 fail:
21814   return NULL;
21815 }
21816 
21817 
_wrap_ssl_get_session(PyObject * self,PyObject * args)21818 SWIGINTERN PyObject *_wrap_ssl_get_session(PyObject *self, PyObject *args) {
21819   PyObject *resultobj = 0;
21820   SSL *arg1 = (SSL *) 0 ;
21821   void *argp1 = 0 ;
21822   int res1 = 0 ;
21823   PyObject *swig_obj[1] ;
21824   SSL_SESSION *result = 0 ;
21825 
21826   if (!args) SWIG_fail;
21827   swig_obj[0] = args;
21828   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21829   if (!SWIG_IsOK(res1)) {
21830     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_session" "', argument " "1"" of type '" "SSL const *""'");
21831   }
21832   arg1 = (SSL *)(argp1);
21833   {
21834     if (!arg1) {
21835       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21836     }
21837   }
21838   result = (SSL_SESSION *)SSL_get_session((SSL const *)arg1);
21839   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_SESSION, 0 |  0 );
21840   return resultobj;
21841 fail:
21842   return NULL;
21843 }
21844 
21845 
_wrap_ssl_get1_session(PyObject * self,PyObject * args)21846 SWIGINTERN PyObject *_wrap_ssl_get1_session(PyObject *self, PyObject *args) {
21847   PyObject *resultobj = 0;
21848   SSL *arg1 = (SSL *) 0 ;
21849   void *argp1 = 0 ;
21850   int res1 = 0 ;
21851   PyObject *swig_obj[1] ;
21852   SSL_SESSION *result = 0 ;
21853 
21854   if (!args) SWIG_fail;
21855   swig_obj[0] = args;
21856   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21857   if (!SWIG_IsOK(res1)) {
21858     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get1_session" "', argument " "1"" of type '" "SSL *""'");
21859   }
21860   arg1 = (SSL *)(argp1);
21861   {
21862     if (!arg1) {
21863       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21864     }
21865   }
21866   result = (SSL_SESSION *)SSL_get1_session(arg1);
21867   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_SESSION, 0 |  0 );
21868   return resultobj;
21869 fail:
21870   return NULL;
21871 }
21872 
21873 
_wrap_ssl_set_session(PyObject * self,PyObject * args)21874 SWIGINTERN PyObject *_wrap_ssl_set_session(PyObject *self, PyObject *args) {
21875   PyObject *resultobj = 0;
21876   SSL *arg1 = (SSL *) 0 ;
21877   SSL_SESSION *arg2 = (SSL_SESSION *) 0 ;
21878   void *argp1 = 0 ;
21879   int res1 = 0 ;
21880   void *argp2 = 0 ;
21881   int res2 = 0 ;
21882   PyObject *swig_obj[2] ;
21883   int result;
21884 
21885   if (!SWIG_Python_UnpackTuple(args, "ssl_set_session", 2, 2, swig_obj)) SWIG_fail;
21886   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
21887   if (!SWIG_IsOK(res1)) {
21888     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_session" "', argument " "1"" of type '" "SSL *""'");
21889   }
21890   arg1 = (SSL *)(argp1);
21891   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL_SESSION, 0 |  0 );
21892   if (!SWIG_IsOK(res2)) {
21893     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_session" "', argument " "2"" of type '" "SSL_SESSION *""'");
21894   }
21895   arg2 = (SSL_SESSION *)(argp2);
21896   {
21897     if (!arg1) {
21898       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21899     }
21900   }
21901   result = (int)SSL_set_session(arg1,arg2);
21902   {
21903     resultobj=PyLong_FromLong(result);
21904     if (PyErr_Occurred()) SWIG_fail;
21905   }
21906   return resultobj;
21907 fail:
21908   return NULL;
21909 }
21910 
21911 
_wrap_ssl_session_free(PyObject * self,PyObject * args)21912 SWIGINTERN PyObject *_wrap_ssl_session_free(PyObject *self, PyObject *args) {
21913   PyObject *resultobj = 0;
21914   SSL_SESSION *arg1 = (SSL_SESSION *) 0 ;
21915   void *argp1 = 0 ;
21916   int res1 = 0 ;
21917   PyObject *swig_obj[1] ;
21918 
21919   if (!args) SWIG_fail;
21920   swig_obj[0] = args;
21921   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_SESSION, 0 |  0 );
21922   if (!SWIG_IsOK(res1)) {
21923     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_free" "', argument " "1"" of type '" "SSL_SESSION *""'");
21924   }
21925   arg1 = (SSL_SESSION *)(argp1);
21926   SSL_SESSION_free(arg1);
21927   resultobj = SWIG_Py_Void();
21928   return resultobj;
21929 fail:
21930   return NULL;
21931 }
21932 
21933 
_wrap_ssl_session_print(PyObject * self,PyObject * args)21934 SWIGINTERN PyObject *_wrap_ssl_session_print(PyObject *self, PyObject *args) {
21935   PyObject *resultobj = 0;
21936   BIO *arg1 = (BIO *) 0 ;
21937   SSL_SESSION *arg2 = (SSL_SESSION *) 0 ;
21938   void *argp1 = 0 ;
21939   int res1 = 0 ;
21940   void *argp2 = 0 ;
21941   int res2 = 0 ;
21942   PyObject *swig_obj[2] ;
21943   int result;
21944 
21945   if (!SWIG_Python_UnpackTuple(args, "ssl_session_print", 2, 2, swig_obj)) SWIG_fail;
21946   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
21947   if (!SWIG_IsOK(res1)) {
21948     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_print" "', argument " "1"" of type '" "BIO *""'");
21949   }
21950   arg1 = (BIO *)(argp1);
21951   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL_SESSION, 0 |  0 );
21952   if (!SWIG_IsOK(res2)) {
21953     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_session_print" "', argument " "2"" of type '" "SSL_SESSION const *""'");
21954   }
21955   arg2 = (SSL_SESSION *)(argp2);
21956   {
21957     if (!arg1) {
21958       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
21959     }
21960   }
21961   {
21962     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
21963     result = (int)SSL_SESSION_print(arg1,(SSL_SESSION const *)arg2);
21964     SWIG_PYTHON_THREAD_END_ALLOW;
21965   }
21966   {
21967     resultobj=PyLong_FromLong(result);
21968     if (PyErr_Occurred()) SWIG_fail;
21969   }
21970   return resultobj;
21971 fail:
21972   return NULL;
21973 }
21974 
21975 
_wrap_ssl_session_set_timeout(PyObject * self,PyObject * args)21976 SWIGINTERN PyObject *_wrap_ssl_session_set_timeout(PyObject *self, PyObject *args) {
21977   PyObject *resultobj = 0;
21978   SSL_SESSION *arg1 = (SSL_SESSION *) 0 ;
21979   long arg2 ;
21980   void *argp1 = 0 ;
21981   int res1 = 0 ;
21982   long val2 ;
21983   int ecode2 = 0 ;
21984   PyObject *swig_obj[2] ;
21985   long result;
21986 
21987   if (!SWIG_Python_UnpackTuple(args, "ssl_session_set_timeout", 2, 2, swig_obj)) SWIG_fail;
21988   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_SESSION, 0 |  0 );
21989   if (!SWIG_IsOK(res1)) {
21990     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_set_timeout" "', argument " "1"" of type '" "SSL_SESSION *""'");
21991   }
21992   arg1 = (SSL_SESSION *)(argp1);
21993   ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
21994   if (!SWIG_IsOK(ecode2)) {
21995     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_session_set_timeout" "', argument " "2"" of type '" "long""'");
21996   }
21997   arg2 = (long)(val2);
21998   result = (long)SSL_SESSION_set_timeout(arg1,arg2);
21999   resultobj = SWIG_From_long((long)(result));
22000   return resultobj;
22001 fail:
22002   return NULL;
22003 }
22004 
22005 
_wrap_ssl_session_get_timeout(PyObject * self,PyObject * args)22006 SWIGINTERN PyObject *_wrap_ssl_session_get_timeout(PyObject *self, PyObject *args) {
22007   PyObject *resultobj = 0;
22008   SSL_SESSION *arg1 = (SSL_SESSION *) 0 ;
22009   void *argp1 = 0 ;
22010   int res1 = 0 ;
22011   PyObject *swig_obj[1] ;
22012   long result;
22013 
22014   if (!args) SWIG_fail;
22015   swig_obj[0] = args;
22016   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_SESSION, 0 |  0 );
22017   if (!SWIG_IsOK(res1)) {
22018     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_get_timeout" "', argument " "1"" of type '" "SSL_SESSION const *""'");
22019   }
22020   arg1 = (SSL_SESSION *)(argp1);
22021   result = (long)SSL_SESSION_get_timeout((SSL_SESSION const *)arg1);
22022   resultobj = SWIG_From_long((long)(result));
22023   return resultobj;
22024 fail:
22025   return NULL;
22026 }
22027 
22028 
_wrap_ssl_accept(PyObject * self,PyObject * args)22029 SWIGINTERN PyObject *_wrap_ssl_accept(PyObject *self, PyObject *args) {
22030   PyObject *resultobj = 0;
22031   SSL *arg1 = (SSL *) 0 ;
22032   double arg2 = (double) -1 ;
22033   void *argp1 = 0 ;
22034   int res1 = 0 ;
22035   double val2 ;
22036   int ecode2 = 0 ;
22037   PyObject *swig_obj[2] ;
22038   PyObject *result = 0 ;
22039 
22040   if (!SWIG_Python_UnpackTuple(args, "ssl_accept", 1, 2, swig_obj)) SWIG_fail;
22041   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
22042   if (!SWIG_IsOK(res1)) {
22043     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_accept" "', argument " "1"" of type '" "SSL *""'");
22044   }
22045   arg1 = (SSL *)(argp1);
22046   if (swig_obj[1]) {
22047     ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
22048     if (!SWIG_IsOK(ecode2)) {
22049       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_accept" "', argument " "2"" of type '" "double""'");
22050     }
22051     arg2 = (double)(val2);
22052   }
22053   {
22054     if (!arg1) {
22055       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22056     }
22057   }
22058   result = (PyObject *)ssl_accept(arg1,arg2);
22059   {
22060     resultobj=result;
22061   }
22062   return resultobj;
22063 fail:
22064   return NULL;
22065 }
22066 
22067 
_wrap_ssl_connect(PyObject * self,PyObject * args)22068 SWIGINTERN PyObject *_wrap_ssl_connect(PyObject *self, PyObject *args) {
22069   PyObject *resultobj = 0;
22070   SSL *arg1 = (SSL *) 0 ;
22071   double arg2 = (double) -1 ;
22072   void *argp1 = 0 ;
22073   int res1 = 0 ;
22074   double val2 ;
22075   int ecode2 = 0 ;
22076   PyObject *swig_obj[2] ;
22077   PyObject *result = 0 ;
22078 
22079   if (!SWIG_Python_UnpackTuple(args, "ssl_connect", 1, 2, swig_obj)) SWIG_fail;
22080   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
22081   if (!SWIG_IsOK(res1)) {
22082     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_connect" "', argument " "1"" of type '" "SSL *""'");
22083   }
22084   arg1 = (SSL *)(argp1);
22085   if (swig_obj[1]) {
22086     ecode2 = SWIG_AsVal_double(swig_obj[1], &val2);
22087     if (!SWIG_IsOK(ecode2)) {
22088       SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_connect" "', argument " "2"" of type '" "double""'");
22089     }
22090     arg2 = (double)(val2);
22091   }
22092   {
22093     if (!arg1) {
22094       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22095     }
22096   }
22097   result = (PyObject *)ssl_connect(arg1,arg2);
22098   {
22099     resultobj=result;
22100   }
22101   return resultobj;
22102 fail:
22103   return NULL;
22104 }
22105 
22106 
_wrap_ssl_read(PyObject * self,PyObject * args)22107 SWIGINTERN PyObject *_wrap_ssl_read(PyObject *self, PyObject *args) {
22108   PyObject *resultobj = 0;
22109   SSL *arg1 = (SSL *) 0 ;
22110   int arg2 ;
22111   double arg3 = (double) -1 ;
22112   void *argp1 = 0 ;
22113   int res1 = 0 ;
22114   int val2 ;
22115   int ecode2 = 0 ;
22116   double val3 ;
22117   int ecode3 = 0 ;
22118   PyObject *swig_obj[3] ;
22119   PyObject *result = 0 ;
22120 
22121   if (!SWIG_Python_UnpackTuple(args, "ssl_read", 2, 3, swig_obj)) SWIG_fail;
22122   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
22123   if (!SWIG_IsOK(res1)) {
22124     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_read" "', argument " "1"" of type '" "SSL *""'");
22125   }
22126   arg1 = (SSL *)(argp1);
22127   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
22128   if (!SWIG_IsOK(ecode2)) {
22129     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_read" "', argument " "2"" of type '" "int""'");
22130   }
22131   arg2 = (int)(val2);
22132   if (swig_obj[2]) {
22133     ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
22134     if (!SWIG_IsOK(ecode3)) {
22135       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ssl_read" "', argument " "3"" of type '" "double""'");
22136     }
22137     arg3 = (double)(val3);
22138   }
22139   {
22140     if (!arg1) {
22141       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22142     }
22143   }
22144   result = (PyObject *)ssl_read(arg1,arg2,arg3);
22145   {
22146     resultobj=result;
22147   }
22148   return resultobj;
22149 fail:
22150   return NULL;
22151 }
22152 
22153 
_wrap_ssl_write(PyObject * self,PyObject * args)22154 SWIGINTERN PyObject *_wrap_ssl_write(PyObject *self, PyObject *args) {
22155   PyObject *resultobj = 0;
22156   SSL *arg1 = (SSL *) 0 ;
22157   PyObject *arg2 = (PyObject *) 0 ;
22158   double arg3 = (double) -1 ;
22159   void *argp1 = 0 ;
22160   int res1 = 0 ;
22161   double val3 ;
22162   int ecode3 = 0 ;
22163   PyObject *swig_obj[3] ;
22164   int result;
22165 
22166   if (!SWIG_Python_UnpackTuple(args, "ssl_write", 2, 3, swig_obj)) SWIG_fail;
22167   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
22168   if (!SWIG_IsOK(res1)) {
22169     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_write" "', argument " "1"" of type '" "SSL *""'");
22170   }
22171   arg1 = (SSL *)(argp1);
22172   {
22173     arg2=swig_obj[1];
22174   }
22175   if (swig_obj[2]) {
22176     ecode3 = SWIG_AsVal_double(swig_obj[2], &val3);
22177     if (!SWIG_IsOK(ecode3)) {
22178       SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "ssl_write" "', argument " "3"" of type '" "double""'");
22179     }
22180     arg3 = (double)(val3);
22181   }
22182   {
22183     if (!arg1) {
22184       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22185     }
22186   }
22187   result = (int)ssl_write(arg1,arg2,arg3);
22188   {
22189     resultobj=PyLong_FromLong(result);
22190     if (PyErr_Occurred()) SWIG_fail;
22191   }
22192   return resultobj;
22193 fail:
22194   return NULL;
22195 }
22196 
22197 
Swig_var__ssl_err_set(PyObject * _val)22198 SWIGINTERN int Swig_var__ssl_err_set(PyObject *_val) {
22199   {
22200     void *argp = 0;
22201     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
22202     if (!SWIG_IsOK(res)) {
22203       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_ssl_err""' of type '""PyObject *""'");
22204     }
22205     _ssl_err = (PyObject *)(argp);
22206   }
22207   return 0;
22208 fail:
22209   return 1;
22210 }
22211 
22212 
Swig_var__ssl_err_get(void)22213 SWIGINTERN PyObject *Swig_var__ssl_err_get(void) {
22214   PyObject *pyobj = 0;
22215   PyObject *self = 0;
22216 
22217   (void)self;
22218   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_ssl_err), SWIGTYPE_p_PyObject,  0 );
22219   return pyobj;
22220 }
22221 
22222 
Swig_var__ssl_timeout_err_set(PyObject * _val)22223 SWIGINTERN int Swig_var__ssl_timeout_err_set(PyObject *_val) {
22224   {
22225     void *argp = 0;
22226     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
22227     if (!SWIG_IsOK(res)) {
22228       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_ssl_timeout_err""' of type '""PyObject *""'");
22229     }
22230     _ssl_timeout_err = (PyObject *)(argp);
22231   }
22232   return 0;
22233 fail:
22234   return 1;
22235 }
22236 
22237 
Swig_var__ssl_timeout_err_get(void)22238 SWIGINTERN PyObject *Swig_var__ssl_timeout_err_get(void) {
22239   PyObject *pyobj = 0;
22240   PyObject *self = 0;
22241 
22242   (void)self;
22243   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_ssl_timeout_err), SWIGTYPE_p_PyObject,  0 );
22244   return pyobj;
22245 }
22246 
22247 
_wrap_ssl_init(PyObject * self,PyObject * args)22248 SWIGINTERN PyObject *_wrap_ssl_init(PyObject *self, PyObject *args) {
22249   PyObject *resultobj = 0;
22250   PyObject *arg1 = (PyObject *) 0 ;
22251   PyObject *arg2 = (PyObject *) 0 ;
22252   PyObject *swig_obj[2] ;
22253 
22254   if (!SWIG_Python_UnpackTuple(args, "ssl_init", 2, 2, swig_obj)) SWIG_fail;
22255   {
22256     arg1=swig_obj[0];
22257   }
22258   {
22259     arg2=swig_obj[1];
22260   }
22261   ssl_init(arg1,arg2);
22262   resultobj = SWIG_Py_Void();
22263   return resultobj;
22264 fail:
22265   return NULL;
22266 }
22267 
22268 
_wrap_tlsv1_method(PyObject * self,PyObject * args)22269 SWIGINTERN PyObject *_wrap_tlsv1_method(PyObject *self, PyObject *args) {
22270   PyObject *resultobj = 0;
22271   SSL_METHOD *result = 0 ;
22272 
22273   if (!SWIG_Python_UnpackTuple(args, "tlsv1_method", 0, 0, 0)) SWIG_fail;
22274   result = (SSL_METHOD *)tlsv1_method();
22275   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_METHOD, 0 |  0 );
22276   return resultobj;
22277 fail:
22278   return NULL;
22279 }
22280 
22281 
_wrap_ssl_ctx_passphrase_callback(PyObject * self,PyObject * args)22282 SWIGINTERN PyObject *_wrap_ssl_ctx_passphrase_callback(PyObject *self, PyObject *args) {
22283   PyObject *resultobj = 0;
22284   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22285   PyObject *arg2 = (PyObject *) 0 ;
22286   void *argp1 = 0 ;
22287   int res1 = 0 ;
22288   PyObject *swig_obj[2] ;
22289 
22290   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_passphrase_callback", 2, 2, swig_obj)) SWIG_fail;
22291   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22292   if (!SWIG_IsOK(res1)) {
22293     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_passphrase_callback" "', argument " "1"" of type '" "SSL_CTX *""'");
22294   }
22295   arg1 = (SSL_CTX *)(argp1);
22296   {
22297     if (!PyCallable_Check(swig_obj[1])) {
22298       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
22299       return NULL;
22300     }
22301     arg2=swig_obj[1];
22302   }
22303   {
22304     if (!arg1) {
22305       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22306     }
22307   }
22308   {
22309     if (!arg2) {
22310       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22311     }
22312   }
22313   ssl_ctx_passphrase_callback(arg1,arg2);
22314   resultobj = SWIG_Py_Void();
22315   return resultobj;
22316 fail:
22317   return NULL;
22318 }
22319 
22320 
_wrap_ssl_ctx_use_x509(PyObject * self,PyObject * args)22321 SWIGINTERN PyObject *_wrap_ssl_ctx_use_x509(PyObject *self, PyObject *args) {
22322   PyObject *resultobj = 0;
22323   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22324   X509 *arg2 = (X509 *) 0 ;
22325   void *argp1 = 0 ;
22326   int res1 = 0 ;
22327   void *argp2 = 0 ;
22328   int res2 = 0 ;
22329   PyObject *swig_obj[2] ;
22330   int result;
22331 
22332   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_use_x509", 2, 2, swig_obj)) SWIG_fail;
22333   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22334   if (!SWIG_IsOK(res1)) {
22335     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_x509" "', argument " "1"" of type '" "SSL_CTX *""'");
22336   }
22337   arg1 = (SSL_CTX *)(argp1);
22338   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 |  0 );
22339   if (!SWIG_IsOK(res2)) {
22340     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_x509" "', argument " "2"" of type '" "X509 *""'");
22341   }
22342   arg2 = (X509 *)(argp2);
22343   {
22344     if (!arg1) {
22345       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22346     }
22347   }
22348   result = (int)ssl_ctx_use_x509(arg1,arg2);
22349   {
22350     resultobj=PyLong_FromLong(result);
22351     if (PyErr_Occurred()) SWIG_fail;
22352   }
22353   return resultobj;
22354 fail:
22355   return NULL;
22356 }
22357 
22358 
_wrap_ssl_ctx_use_cert(PyObject * self,PyObject * args)22359 SWIGINTERN PyObject *_wrap_ssl_ctx_use_cert(PyObject *self, PyObject *args) {
22360   PyObject *resultobj = 0;
22361   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22362   char *arg2 = (char *) 0 ;
22363   void *argp1 = 0 ;
22364   int res1 = 0 ;
22365   int res2 ;
22366   char *buf2 = 0 ;
22367   int alloc2 = 0 ;
22368   PyObject *swig_obj[2] ;
22369   int result;
22370 
22371   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_use_cert", 2, 2, swig_obj)) SWIG_fail;
22372   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22373   if (!SWIG_IsOK(res1)) {
22374     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_cert" "', argument " "1"" of type '" "SSL_CTX *""'");
22375   }
22376   arg1 = (SSL_CTX *)(argp1);
22377   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
22378   if (!SWIG_IsOK(res2)) {
22379     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_cert" "', argument " "2"" of type '" "char *""'");
22380   }
22381   arg2 = (char *)(buf2);
22382   {
22383     if (!arg1) {
22384       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22385     }
22386   }
22387   result = (int)ssl_ctx_use_cert(arg1,arg2);
22388   {
22389     resultobj=PyLong_FromLong(result);
22390     if (PyErr_Occurred()) SWIG_fail;
22391   }
22392   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
22393   return resultobj;
22394 fail:
22395   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
22396   return NULL;
22397 }
22398 
22399 
_wrap_ssl_ctx_use_cert_chain(PyObject * self,PyObject * args)22400 SWIGINTERN PyObject *_wrap_ssl_ctx_use_cert_chain(PyObject *self, PyObject *args) {
22401   PyObject *resultobj = 0;
22402   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22403   char *arg2 = (char *) 0 ;
22404   void *argp1 = 0 ;
22405   int res1 = 0 ;
22406   int res2 ;
22407   char *buf2 = 0 ;
22408   int alloc2 = 0 ;
22409   PyObject *swig_obj[2] ;
22410   int result;
22411 
22412   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_use_cert_chain", 2, 2, swig_obj)) SWIG_fail;
22413   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22414   if (!SWIG_IsOK(res1)) {
22415     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_cert_chain" "', argument " "1"" of type '" "SSL_CTX *""'");
22416   }
22417   arg1 = (SSL_CTX *)(argp1);
22418   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
22419   if (!SWIG_IsOK(res2)) {
22420     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_cert_chain" "', argument " "2"" of type '" "char *""'");
22421   }
22422   arg2 = (char *)(buf2);
22423   {
22424     if (!arg1) {
22425       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22426     }
22427   }
22428   result = (int)ssl_ctx_use_cert_chain(arg1,arg2);
22429   {
22430     resultobj=PyLong_FromLong(result);
22431     if (PyErr_Occurred()) SWIG_fail;
22432   }
22433   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
22434   return resultobj;
22435 fail:
22436   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
22437   return NULL;
22438 }
22439 
22440 
_wrap_ssl_ctx_use_privkey(PyObject * self,PyObject * args)22441 SWIGINTERN PyObject *_wrap_ssl_ctx_use_privkey(PyObject *self, PyObject *args) {
22442   PyObject *resultobj = 0;
22443   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22444   char *arg2 = (char *) 0 ;
22445   void *argp1 = 0 ;
22446   int res1 = 0 ;
22447   int res2 ;
22448   char *buf2 = 0 ;
22449   int alloc2 = 0 ;
22450   PyObject *swig_obj[2] ;
22451   int result;
22452 
22453   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_use_privkey", 2, 2, swig_obj)) SWIG_fail;
22454   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22455   if (!SWIG_IsOK(res1)) {
22456     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_privkey" "', argument " "1"" of type '" "SSL_CTX *""'");
22457   }
22458   arg1 = (SSL_CTX *)(argp1);
22459   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
22460   if (!SWIG_IsOK(res2)) {
22461     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_privkey" "', argument " "2"" of type '" "char *""'");
22462   }
22463   arg2 = (char *)(buf2);
22464   {
22465     if (!arg1) {
22466       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22467     }
22468   }
22469   result = (int)ssl_ctx_use_privkey(arg1,arg2);
22470   {
22471     resultobj=PyLong_FromLong(result);
22472     if (PyErr_Occurred()) SWIG_fail;
22473   }
22474   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
22475   return resultobj;
22476 fail:
22477   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
22478   return NULL;
22479 }
22480 
22481 
_wrap_ssl_ctx_use_rsa_privkey(PyObject * self,PyObject * args)22482 SWIGINTERN PyObject *_wrap_ssl_ctx_use_rsa_privkey(PyObject *self, PyObject *args) {
22483   PyObject *resultobj = 0;
22484   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22485   RSA *arg2 = (RSA *) 0 ;
22486   void *argp1 = 0 ;
22487   int res1 = 0 ;
22488   void *argp2 = 0 ;
22489   int res2 = 0 ;
22490   PyObject *swig_obj[2] ;
22491   int result;
22492 
22493   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_use_rsa_privkey", 2, 2, swig_obj)) SWIG_fail;
22494   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22495   if (!SWIG_IsOK(res1)) {
22496     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_rsa_privkey" "', argument " "1"" of type '" "SSL_CTX *""'");
22497   }
22498   arg1 = (SSL_CTX *)(argp1);
22499   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_RSA, 0 |  0 );
22500   if (!SWIG_IsOK(res2)) {
22501     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_rsa_privkey" "', argument " "2"" of type '" "RSA *""'");
22502   }
22503   arg2 = (RSA *)(argp2);
22504   {
22505     if (!arg1) {
22506       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22507     }
22508   }
22509   {
22510     if (!arg2) {
22511       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22512     }
22513   }
22514   result = (int)ssl_ctx_use_rsa_privkey(arg1,arg2);
22515   {
22516     resultobj=PyLong_FromLong(result);
22517     if (PyErr_Occurred()) SWIG_fail;
22518   }
22519   return resultobj;
22520 fail:
22521   return NULL;
22522 }
22523 
22524 
_wrap_ssl_ctx_use_pkey_privkey(PyObject * self,PyObject * args)22525 SWIGINTERN PyObject *_wrap_ssl_ctx_use_pkey_privkey(PyObject *self, PyObject *args) {
22526   PyObject *resultobj = 0;
22527   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22528   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
22529   void *argp1 = 0 ;
22530   int res1 = 0 ;
22531   void *argp2 = 0 ;
22532   int res2 = 0 ;
22533   PyObject *swig_obj[2] ;
22534   int result;
22535 
22536   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_use_pkey_privkey", 2, 2, swig_obj)) SWIG_fail;
22537   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22538   if (!SWIG_IsOK(res1)) {
22539     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_use_pkey_privkey" "', argument " "1"" of type '" "SSL_CTX *""'");
22540   }
22541   arg1 = (SSL_CTX *)(argp1);
22542   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
22543   if (!SWIG_IsOK(res2)) {
22544     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_use_pkey_privkey" "', argument " "2"" of type '" "EVP_PKEY *""'");
22545   }
22546   arg2 = (EVP_PKEY *)(argp2);
22547   {
22548     if (!arg1) {
22549       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22550     }
22551   }
22552   {
22553     if (!arg2) {
22554       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22555     }
22556   }
22557   result = (int)ssl_ctx_use_pkey_privkey(arg1,arg2);
22558   {
22559     resultobj=PyLong_FromLong(result);
22560     if (PyErr_Occurred()) SWIG_fail;
22561   }
22562   return resultobj;
22563 fail:
22564   return NULL;
22565 }
22566 
22567 
_wrap_ssl_ctx_check_privkey(PyObject * self,PyObject * args)22568 SWIGINTERN PyObject *_wrap_ssl_ctx_check_privkey(PyObject *self, PyObject *args) {
22569   PyObject *resultobj = 0;
22570   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22571   void *argp1 = 0 ;
22572   int res1 = 0 ;
22573   PyObject *swig_obj[1] ;
22574   int result;
22575 
22576   if (!args) SWIG_fail;
22577   swig_obj[0] = args;
22578   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22579   if (!SWIG_IsOK(res1)) {
22580     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_check_privkey" "', argument " "1"" of type '" "SSL_CTX *""'");
22581   }
22582   arg1 = (SSL_CTX *)(argp1);
22583   {
22584     if (!arg1) {
22585       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22586     }
22587   }
22588   result = (int)ssl_ctx_check_privkey(arg1);
22589   {
22590     resultobj=PyLong_FromLong(result);
22591     if (PyErr_Occurred()) SWIG_fail;
22592   }
22593   return resultobj;
22594 fail:
22595   return NULL;
22596 }
22597 
22598 
_wrap_ssl_ctx_set_client_CA_list_from_file(PyObject * self,PyObject * args)22599 SWIGINTERN PyObject *_wrap_ssl_ctx_set_client_CA_list_from_file(PyObject *self, PyObject *args) {
22600   PyObject *resultobj = 0;
22601   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22602   char *arg2 = (char *) 0 ;
22603   void *argp1 = 0 ;
22604   int res1 = 0 ;
22605   int res2 ;
22606   char *buf2 = 0 ;
22607   int alloc2 = 0 ;
22608   PyObject *swig_obj[2] ;
22609 
22610   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_client_CA_list_from_file", 2, 2, swig_obj)) SWIG_fail;
22611   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22612   if (!SWIG_IsOK(res1)) {
22613     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_client_CA_list_from_file" "', argument " "1"" of type '" "SSL_CTX *""'");
22614   }
22615   arg1 = (SSL_CTX *)(argp1);
22616   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
22617   if (!SWIG_IsOK(res2)) {
22618     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_client_CA_list_from_file" "', argument " "2"" of type '" "char const *""'");
22619   }
22620   arg2 = (char *)(buf2);
22621   {
22622     if (!arg1) {
22623       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22624     }
22625   }
22626   ssl_ctx_set_client_CA_list_from_file(arg1,(char const *)arg2);
22627   resultobj = SWIG_Py_Void();
22628   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
22629   return resultobj;
22630 fail:
22631   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
22632   return NULL;
22633 }
22634 
22635 
_wrap_ssl_ctx_set_verify_default(PyObject * self,PyObject * args)22636 SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify_default(PyObject *self, PyObject *args) {
22637   PyObject *resultobj = 0;
22638   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22639   int arg2 ;
22640   void *argp1 = 0 ;
22641   int res1 = 0 ;
22642   int val2 ;
22643   int ecode2 = 0 ;
22644   PyObject *swig_obj[2] ;
22645 
22646   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_verify_default", 2, 2, swig_obj)) SWIG_fail;
22647   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22648   if (!SWIG_IsOK(res1)) {
22649     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_verify_default" "', argument " "1"" of type '" "SSL_CTX *""'");
22650   }
22651   arg1 = (SSL_CTX *)(argp1);
22652   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
22653   if (!SWIG_IsOK(ecode2)) {
22654     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_verify_default" "', argument " "2"" of type '" "int""'");
22655   }
22656   arg2 = (int)(val2);
22657   {
22658     if (!arg1) {
22659       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22660     }
22661   }
22662   ssl_ctx_set_verify_default(arg1,arg2);
22663   resultobj = SWIG_Py_Void();
22664   return resultobj;
22665 fail:
22666   return NULL;
22667 }
22668 
22669 
_wrap_ssl_ctx_set_verify(PyObject * self,PyObject * args)22670 SWIGINTERN PyObject *_wrap_ssl_ctx_set_verify(PyObject *self, PyObject *args) {
22671   PyObject *resultobj = 0;
22672   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22673   int arg2 ;
22674   PyObject *arg3 = (PyObject *) 0 ;
22675   void *argp1 = 0 ;
22676   int res1 = 0 ;
22677   int val2 ;
22678   int ecode2 = 0 ;
22679   PyObject *swig_obj[3] ;
22680 
22681   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_verify", 3, 3, swig_obj)) SWIG_fail;
22682   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22683   if (!SWIG_IsOK(res1)) {
22684     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_verify" "', argument " "1"" of type '" "SSL_CTX *""'");
22685   }
22686   arg1 = (SSL_CTX *)(argp1);
22687   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
22688   if (!SWIG_IsOK(ecode2)) {
22689     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_verify" "', argument " "2"" of type '" "int""'");
22690   }
22691   arg2 = (int)(val2);
22692   {
22693     if (!PyCallable_Check(swig_obj[2])) {
22694       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
22695       return NULL;
22696     }
22697     arg3=swig_obj[2];
22698   }
22699   {
22700     if (!arg1) {
22701       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22702     }
22703   }
22704   {
22705     if (!arg3) {
22706       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22707     }
22708   }
22709   ssl_ctx_set_verify(arg1,arg2,arg3);
22710   resultobj = SWIG_Py_Void();
22711   return resultobj;
22712 fail:
22713   return NULL;
22714 }
22715 
22716 
_wrap_ssl_ctx_set_session_id_context(PyObject * self,PyObject * args)22717 SWIGINTERN PyObject *_wrap_ssl_ctx_set_session_id_context(PyObject *self, PyObject *args) {
22718   PyObject *resultobj = 0;
22719   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22720   PyObject *arg2 = (PyObject *) 0 ;
22721   void *argp1 = 0 ;
22722   int res1 = 0 ;
22723   PyObject *swig_obj[2] ;
22724   int result;
22725 
22726   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_session_id_context", 2, 2, swig_obj)) SWIG_fail;
22727   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22728   if (!SWIG_IsOK(res1)) {
22729     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_session_id_context" "', argument " "1"" of type '" "SSL_CTX *""'");
22730   }
22731   arg1 = (SSL_CTX *)(argp1);
22732   {
22733     arg2=swig_obj[1];
22734   }
22735   {
22736     if (!arg1) {
22737       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22738     }
22739   }
22740   result = (int)ssl_ctx_set_session_id_context(arg1,arg2);
22741   {
22742     resultobj=PyLong_FromLong(result);
22743     if (PyErr_Occurred()) SWIG_fail;
22744   }
22745   return resultobj;
22746 fail:
22747   return NULL;
22748 }
22749 
22750 
_wrap_ssl_ctx_set_info_callback(PyObject * self,PyObject * args)22751 SWIGINTERN PyObject *_wrap_ssl_ctx_set_info_callback(PyObject *self, PyObject *args) {
22752   PyObject *resultobj = 0;
22753   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22754   PyObject *arg2 = (PyObject *) 0 ;
22755   void *argp1 = 0 ;
22756   int res1 = 0 ;
22757   PyObject *swig_obj[2] ;
22758 
22759   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_info_callback", 2, 2, swig_obj)) SWIG_fail;
22760   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22761   if (!SWIG_IsOK(res1)) {
22762     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_info_callback" "', argument " "1"" of type '" "SSL_CTX *""'");
22763   }
22764   arg1 = (SSL_CTX *)(argp1);
22765   {
22766     if (!PyCallable_Check(swig_obj[1])) {
22767       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
22768       return NULL;
22769     }
22770     arg2=swig_obj[1];
22771   }
22772   {
22773     if (!arg1) {
22774       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22775     }
22776   }
22777   {
22778     if (!arg2) {
22779       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22780     }
22781   }
22782   ssl_ctx_set_info_callback(arg1,arg2);
22783   resultobj = SWIG_Py_Void();
22784   return resultobj;
22785 fail:
22786   return NULL;
22787 }
22788 
22789 
_wrap_ssl_ctx_set_tmp_dh(PyObject * self,PyObject * args)22790 SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_dh(PyObject *self, PyObject *args) {
22791   PyObject *resultobj = 0;
22792   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22793   DH *arg2 = (DH *) 0 ;
22794   void *argp1 = 0 ;
22795   int res1 = 0 ;
22796   void *argp2 = 0 ;
22797   int res2 = 0 ;
22798   PyObject *swig_obj[2] ;
22799   long result;
22800 
22801   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_tmp_dh", 2, 2, swig_obj)) SWIG_fail;
22802   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22803   if (!SWIG_IsOK(res1)) {
22804     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_dh" "', argument " "1"" of type '" "SSL_CTX *""'");
22805   }
22806   arg1 = (SSL_CTX *)(argp1);
22807   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_DH, 0 |  0 );
22808   if (!SWIG_IsOK(res2)) {
22809     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_tmp_dh" "', argument " "2"" of type '" "DH *""'");
22810   }
22811   arg2 = (DH *)(argp2);
22812   {
22813     if (!arg1) {
22814       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22815     }
22816   }
22817   {
22818     if (!arg2) {
22819       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22820     }
22821   }
22822   result = (long)ssl_ctx_set_tmp_dh(arg1,arg2);
22823   resultobj = SWIG_From_long((long)(result));
22824   return resultobj;
22825 fail:
22826   return NULL;
22827 }
22828 
22829 
_wrap_ssl_ctx_set_tmp_dh_callback(PyObject * self,PyObject * args)22830 SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_dh_callback(PyObject *self, PyObject *args) {
22831   PyObject *resultobj = 0;
22832   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22833   PyObject *arg2 = (PyObject *) 0 ;
22834   void *argp1 = 0 ;
22835   int res1 = 0 ;
22836   PyObject *swig_obj[2] ;
22837 
22838   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_tmp_dh_callback", 2, 2, swig_obj)) SWIG_fail;
22839   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22840   if (!SWIG_IsOK(res1)) {
22841     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_dh_callback" "', argument " "1"" of type '" "SSL_CTX *""'");
22842   }
22843   arg1 = (SSL_CTX *)(argp1);
22844   {
22845     if (!PyCallable_Check(swig_obj[1])) {
22846       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
22847       return NULL;
22848     }
22849     arg2=swig_obj[1];
22850   }
22851   {
22852     if (!arg1) {
22853       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22854     }
22855   }
22856   {
22857     if (!arg2) {
22858       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22859     }
22860   }
22861   ssl_ctx_set_tmp_dh_callback(arg1,arg2);
22862   resultobj = SWIG_Py_Void();
22863   return resultobj;
22864 fail:
22865   return NULL;
22866 }
22867 
22868 
_wrap_ssl_ctx_set_tmp_rsa(PyObject * self,PyObject * args)22869 SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_rsa(PyObject *self, PyObject *args) {
22870   PyObject *resultobj = 0;
22871   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22872   RSA *arg2 = (RSA *) 0 ;
22873   void *argp1 = 0 ;
22874   int res1 = 0 ;
22875   void *argp2 = 0 ;
22876   int res2 = 0 ;
22877   PyObject *swig_obj[2] ;
22878   long result;
22879 
22880   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_tmp_rsa", 2, 2, swig_obj)) SWIG_fail;
22881   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22882   if (!SWIG_IsOK(res1)) {
22883     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_rsa" "', argument " "1"" of type '" "SSL_CTX *""'");
22884   }
22885   arg1 = (SSL_CTX *)(argp1);
22886   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_RSA, 0 |  0 );
22887   if (!SWIG_IsOK(res2)) {
22888     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_set_tmp_rsa" "', argument " "2"" of type '" "RSA *""'");
22889   }
22890   arg2 = (RSA *)(argp2);
22891   {
22892     if (!arg1) {
22893       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22894     }
22895   }
22896   {
22897     if (!arg2) {
22898       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22899     }
22900   }
22901   result = (long)ssl_ctx_set_tmp_rsa(arg1,arg2);
22902   resultobj = SWIG_From_long((long)(result));
22903   return resultobj;
22904 fail:
22905   return NULL;
22906 }
22907 
22908 
_wrap_ssl_ctx_set_tmp_rsa_callback(PyObject * self,PyObject * args)22909 SWIGINTERN PyObject *_wrap_ssl_ctx_set_tmp_rsa_callback(PyObject *self, PyObject *args) {
22910   PyObject *resultobj = 0;
22911   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22912   PyObject *arg2 = (PyObject *) 0 ;
22913   void *argp1 = 0 ;
22914   int res1 = 0 ;
22915   PyObject *swig_obj[2] ;
22916 
22917   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_tmp_rsa_callback", 2, 2, swig_obj)) SWIG_fail;
22918   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22919   if (!SWIG_IsOK(res1)) {
22920     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_tmp_rsa_callback" "', argument " "1"" of type '" "SSL_CTX *""'");
22921   }
22922   arg1 = (SSL_CTX *)(argp1);
22923   {
22924     if (!PyCallable_Check(swig_obj[1])) {
22925       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
22926       return NULL;
22927     }
22928     arg2=swig_obj[1];
22929   }
22930   {
22931     if (!arg1) {
22932       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22933     }
22934   }
22935   {
22936     if (!arg2) {
22937       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22938     }
22939   }
22940   ssl_ctx_set_tmp_rsa_callback(arg1,arg2);
22941   resultobj = SWIG_Py_Void();
22942   return resultobj;
22943 fail:
22944   return NULL;
22945 }
22946 
22947 
_wrap_ssl_ctx_load_verify_locations(PyObject * self,PyObject * args)22948 SWIGINTERN PyObject *_wrap_ssl_ctx_load_verify_locations(PyObject *self, PyObject *args) {
22949   PyObject *resultobj = 0;
22950   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
22951   char *arg2 = (char *) 0 ;
22952   char *arg3 = (char *) 0 ;
22953   void *argp1 = 0 ;
22954   int res1 = 0 ;
22955   int res2 ;
22956   char *buf2 = 0 ;
22957   int alloc2 = 0 ;
22958   int res3 ;
22959   char *buf3 = 0 ;
22960   int alloc3 = 0 ;
22961   PyObject *swig_obj[3] ;
22962   int result;
22963 
22964   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_load_verify_locations", 3, 3, swig_obj)) SWIG_fail;
22965   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
22966   if (!SWIG_IsOK(res1)) {
22967     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_load_verify_locations" "', argument " "1"" of type '" "SSL_CTX *""'");
22968   }
22969   arg1 = (SSL_CTX *)(argp1);
22970   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
22971   if (!SWIG_IsOK(res2)) {
22972     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_ctx_load_verify_locations" "', argument " "2"" of type '" "char const *""'");
22973   }
22974   arg2 = (char *)(buf2);
22975   res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3);
22976   if (!SWIG_IsOK(res3)) {
22977     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ssl_ctx_load_verify_locations" "', argument " "3"" of type '" "char const *""'");
22978   }
22979   arg3 = (char *)(buf3);
22980   {
22981     if (!arg1) {
22982       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
22983     }
22984   }
22985   result = (int)ssl_ctx_load_verify_locations(arg1,(char const *)arg2,(char const *)arg3);
22986   {
22987     resultobj=PyLong_FromLong(result);
22988     if (PyErr_Occurred()) SWIG_fail;
22989   }
22990   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
22991   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
22992   return resultobj;
22993 fail:
22994   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
22995   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
22996   return NULL;
22997 }
22998 
22999 
_wrap_ssl_ctx_set_options(PyObject * self,PyObject * args)23000 SWIGINTERN PyObject *_wrap_ssl_ctx_set_options(PyObject *self, PyObject *args) {
23001   PyObject *resultobj = 0;
23002   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
23003   long arg2 ;
23004   void *argp1 = 0 ;
23005   int res1 = 0 ;
23006   long val2 ;
23007   int ecode2 = 0 ;
23008   PyObject *swig_obj[2] ;
23009   long result;
23010 
23011   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_options", 2, 2, swig_obj)) SWIG_fail;
23012   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
23013   if (!SWIG_IsOK(res1)) {
23014     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_options" "', argument " "1"" of type '" "SSL_CTX *""'");
23015   }
23016   arg1 = (SSL_CTX *)(argp1);
23017   ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
23018   if (!SWIG_IsOK(ecode2)) {
23019     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_options" "', argument " "2"" of type '" "long""'");
23020   }
23021   arg2 = (long)(val2);
23022   {
23023     if (!arg1) {
23024       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23025     }
23026   }
23027   result = (long)ssl_ctx_set_options(arg1,arg2);
23028   resultobj = SWIG_From_long((long)(result));
23029   return resultobj;
23030 fail:
23031   return NULL;
23032 }
23033 
23034 
_wrap_bio_set_ssl(PyObject * self,PyObject * args)23035 SWIGINTERN PyObject *_wrap_bio_set_ssl(PyObject *self, PyObject *args) {
23036   PyObject *resultobj = 0;
23037   BIO *arg1 = (BIO *) 0 ;
23038   SSL *arg2 = (SSL *) 0 ;
23039   int arg3 ;
23040   void *argp1 = 0 ;
23041   int res1 = 0 ;
23042   void *argp2 = 0 ;
23043   int res2 = 0 ;
23044   int val3 ;
23045   int ecode3 = 0 ;
23046   PyObject *swig_obj[3] ;
23047   int result;
23048 
23049   if (!SWIG_Python_UnpackTuple(args, "bio_set_ssl", 3, 3, swig_obj)) SWIG_fail;
23050   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
23051   if (!SWIG_IsOK(res1)) {
23052     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "bio_set_ssl" "', argument " "1"" of type '" "BIO *""'");
23053   }
23054   arg1 = (BIO *)(argp1);
23055   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL, 0 |  0 );
23056   if (!SWIG_IsOK(res2)) {
23057     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "bio_set_ssl" "', argument " "2"" of type '" "SSL *""'");
23058   }
23059   arg2 = (SSL *)(argp2);
23060   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
23061   if (!SWIG_IsOK(ecode3)) {
23062     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "bio_set_ssl" "', argument " "3"" of type '" "int""'");
23063   }
23064   arg3 = (int)(val3);
23065   {
23066     if (!arg1) {
23067       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23068     }
23069   }
23070   {
23071     if (!arg2) {
23072       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23073     }
23074   }
23075   result = (int)bio_set_ssl(arg1,arg2,arg3);
23076   {
23077     resultobj=PyLong_FromLong(result);
23078     if (PyErr_Occurred()) SWIG_fail;
23079   }
23080   return resultobj;
23081 fail:
23082   return NULL;
23083 }
23084 
23085 
_wrap_ssl_set_mode(PyObject * self,PyObject * args)23086 SWIGINTERN PyObject *_wrap_ssl_set_mode(PyObject *self, PyObject *args) {
23087   PyObject *resultobj = 0;
23088   SSL *arg1 = (SSL *) 0 ;
23089   long arg2 ;
23090   void *argp1 = 0 ;
23091   int res1 = 0 ;
23092   long val2 ;
23093   int ecode2 = 0 ;
23094   PyObject *swig_obj[2] ;
23095   long result;
23096 
23097   if (!SWIG_Python_UnpackTuple(args, "ssl_set_mode", 2, 2, swig_obj)) SWIG_fail;
23098   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23099   if (!SWIG_IsOK(res1)) {
23100     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_mode" "', argument " "1"" of type '" "SSL *""'");
23101   }
23102   arg1 = (SSL *)(argp1);
23103   ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
23104   if (!SWIG_IsOK(ecode2)) {
23105     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_mode" "', argument " "2"" of type '" "long""'");
23106   }
23107   arg2 = (long)(val2);
23108   {
23109     if (!arg1) {
23110       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23111     }
23112   }
23113   result = (long)ssl_set_mode(arg1,arg2);
23114   resultobj = SWIG_From_long((long)(result));
23115   return resultobj;
23116 fail:
23117   return NULL;
23118 }
23119 
23120 
_wrap_ssl_get_mode(PyObject * self,PyObject * args)23121 SWIGINTERN PyObject *_wrap_ssl_get_mode(PyObject *self, PyObject *args) {
23122   PyObject *resultobj = 0;
23123   SSL *arg1 = (SSL *) 0 ;
23124   void *argp1 = 0 ;
23125   int res1 = 0 ;
23126   PyObject *swig_obj[1] ;
23127   long result;
23128 
23129   if (!args) SWIG_fail;
23130   swig_obj[0] = args;
23131   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23132   if (!SWIG_IsOK(res1)) {
23133     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_mode" "', argument " "1"" of type '" "SSL *""'");
23134   }
23135   arg1 = (SSL *)(argp1);
23136   {
23137     if (!arg1) {
23138       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23139     }
23140   }
23141   result = (long)ssl_get_mode(arg1);
23142   resultobj = SWIG_From_long((long)(result));
23143   return resultobj;
23144 fail:
23145   return NULL;
23146 }
23147 
23148 
_wrap_ssl_set_tlsext_host_name(PyObject * self,PyObject * args)23149 SWIGINTERN PyObject *_wrap_ssl_set_tlsext_host_name(PyObject *self, PyObject *args) {
23150   PyObject *resultobj = 0;
23151   SSL *arg1 = (SSL *) 0 ;
23152   char *arg2 = (char *) 0 ;
23153   void *argp1 = 0 ;
23154   int res1 = 0 ;
23155   int res2 ;
23156   char *buf2 = 0 ;
23157   int alloc2 = 0 ;
23158   PyObject *swig_obj[2] ;
23159   int result;
23160 
23161   if (!SWIG_Python_UnpackTuple(args, "ssl_set_tlsext_host_name", 2, 2, swig_obj)) SWIG_fail;
23162   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23163   if (!SWIG_IsOK(res1)) {
23164     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_tlsext_host_name" "', argument " "1"" of type '" "SSL *""'");
23165   }
23166   arg1 = (SSL *)(argp1);
23167   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
23168   if (!SWIG_IsOK(res2)) {
23169     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_tlsext_host_name" "', argument " "2"" of type '" "char const *""'");
23170   }
23171   arg2 = (char *)(buf2);
23172   {
23173     if (!arg1) {
23174       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23175     }
23176   }
23177   result = (int)ssl_set_tlsext_host_name(arg1,(char const *)arg2);
23178   {
23179     resultobj=PyLong_FromLong(result);
23180     if (PyErr_Occurred()) SWIG_fail;
23181   }
23182   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
23183   return resultobj;
23184 fail:
23185   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
23186   return NULL;
23187 }
23188 
23189 
_wrap_ssl_set_client_CA_list_from_file(PyObject * self,PyObject * args)23190 SWIGINTERN PyObject *_wrap_ssl_set_client_CA_list_from_file(PyObject *self, PyObject *args) {
23191   PyObject *resultobj = 0;
23192   SSL *arg1 = (SSL *) 0 ;
23193   char *arg2 = (char *) 0 ;
23194   void *argp1 = 0 ;
23195   int res1 = 0 ;
23196   int res2 ;
23197   char *buf2 = 0 ;
23198   int alloc2 = 0 ;
23199   PyObject *swig_obj[2] ;
23200 
23201   if (!SWIG_Python_UnpackTuple(args, "ssl_set_client_CA_list_from_file", 2, 2, swig_obj)) SWIG_fail;
23202   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23203   if (!SWIG_IsOK(res1)) {
23204     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_client_CA_list_from_file" "', argument " "1"" of type '" "SSL *""'");
23205   }
23206   arg1 = (SSL *)(argp1);
23207   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
23208   if (!SWIG_IsOK(res2)) {
23209     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_client_CA_list_from_file" "', argument " "2"" of type '" "char const *""'");
23210   }
23211   arg2 = (char *)(buf2);
23212   {
23213     if (!arg1) {
23214       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23215     }
23216   }
23217   ssl_set_client_CA_list_from_file(arg1,(char const *)arg2);
23218   resultobj = SWIG_Py_Void();
23219   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
23220   return resultobj;
23221 fail:
23222   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
23223   return NULL;
23224 }
23225 
23226 
_wrap_ssl_set_client_CA_list_from_context(PyObject * self,PyObject * args)23227 SWIGINTERN PyObject *_wrap_ssl_set_client_CA_list_from_context(PyObject *self, PyObject *args) {
23228   PyObject *resultobj = 0;
23229   SSL *arg1 = (SSL *) 0 ;
23230   SSL_CTX *arg2 = (SSL_CTX *) 0 ;
23231   void *argp1 = 0 ;
23232   int res1 = 0 ;
23233   void *argp2 = 0 ;
23234   int res2 = 0 ;
23235   PyObject *swig_obj[2] ;
23236 
23237   if (!SWIG_Python_UnpackTuple(args, "ssl_set_client_CA_list_from_context", 2, 2, swig_obj)) SWIG_fail;
23238   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23239   if (!SWIG_IsOK(res1)) {
23240     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_client_CA_list_from_context" "', argument " "1"" of type '" "SSL *""'");
23241   }
23242   arg1 = (SSL *)(argp1);
23243   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL_CTX, 0 |  0 );
23244   if (!SWIG_IsOK(res2)) {
23245     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_set_client_CA_list_from_context" "', argument " "2"" of type '" "SSL_CTX *""'");
23246   }
23247   arg2 = (SSL_CTX *)(argp2);
23248   {
23249     if (!arg1) {
23250       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23251     }
23252   }
23253   {
23254     if (!arg2) {
23255       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23256     }
23257   }
23258   ssl_set_client_CA_list_from_context(arg1,arg2);
23259   resultobj = SWIG_Py_Void();
23260   return resultobj;
23261 fail:
23262   return NULL;
23263 }
23264 
23265 
_wrap_ssl_set_session_id_context(PyObject * self,PyObject * args)23266 SWIGINTERN PyObject *_wrap_ssl_set_session_id_context(PyObject *self, PyObject *args) {
23267   PyObject *resultobj = 0;
23268   SSL *arg1 = (SSL *) 0 ;
23269   PyObject *arg2 = (PyObject *) 0 ;
23270   void *argp1 = 0 ;
23271   int res1 = 0 ;
23272   PyObject *swig_obj[2] ;
23273   int result;
23274 
23275   if (!SWIG_Python_UnpackTuple(args, "ssl_set_session_id_context", 2, 2, swig_obj)) SWIG_fail;
23276   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23277   if (!SWIG_IsOK(res1)) {
23278     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_session_id_context" "', argument " "1"" of type '" "SSL *""'");
23279   }
23280   arg1 = (SSL *)(argp1);
23281   {
23282     arg2=swig_obj[1];
23283   }
23284   {
23285     if (!arg1) {
23286       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23287     }
23288   }
23289   result = (int)ssl_set_session_id_context(arg1,arg2);
23290   {
23291     resultobj=PyLong_FromLong(result);
23292     if (PyErr_Occurred()) SWIG_fail;
23293   }
23294   return resultobj;
23295 fail:
23296   return NULL;
23297 }
23298 
23299 
_wrap_ssl_set_fd(PyObject * self,PyObject * args)23300 SWIGINTERN PyObject *_wrap_ssl_set_fd(PyObject *self, PyObject *args) {
23301   PyObject *resultobj = 0;
23302   SSL *arg1 = (SSL *) 0 ;
23303   int arg2 ;
23304   void *argp1 = 0 ;
23305   int res1 = 0 ;
23306   int val2 ;
23307   int ecode2 = 0 ;
23308   PyObject *swig_obj[2] ;
23309   int result;
23310 
23311   if (!SWIG_Python_UnpackTuple(args, "ssl_set_fd", 2, 2, swig_obj)) SWIG_fail;
23312   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23313   if (!SWIG_IsOK(res1)) {
23314     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_fd" "', argument " "1"" of type '" "SSL *""'");
23315   }
23316   arg1 = (SSL *)(argp1);
23317   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
23318   if (!SWIG_IsOK(ecode2)) {
23319     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_fd" "', argument " "2"" of type '" "int""'");
23320   }
23321   arg2 = (int)(val2);
23322   {
23323     if (!arg1) {
23324       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23325     }
23326   }
23327   result = (int)ssl_set_fd(arg1,arg2);
23328   {
23329     resultobj=PyLong_FromLong(result);
23330     if (PyErr_Occurred()) SWIG_fail;
23331   }
23332   return resultobj;
23333 fail:
23334   return NULL;
23335 }
23336 
23337 
_wrap_ssl_set_shutdown1(PyObject * self,PyObject * args)23338 SWIGINTERN PyObject *_wrap_ssl_set_shutdown1(PyObject *self, PyObject *args) {
23339   PyObject *resultobj = 0;
23340   SSL *arg1 = (SSL *) 0 ;
23341   int arg2 ;
23342   void *argp1 = 0 ;
23343   int res1 = 0 ;
23344   int val2 ;
23345   int ecode2 = 0 ;
23346   PyObject *swig_obj[2] ;
23347 
23348   if (!SWIG_Python_UnpackTuple(args, "ssl_set_shutdown1", 2, 2, swig_obj)) SWIG_fail;
23349   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23350   if (!SWIG_IsOK(res1)) {
23351     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_set_shutdown1" "', argument " "1"" of type '" "SSL *""'");
23352   }
23353   arg1 = (SSL *)(argp1);
23354   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
23355   if (!SWIG_IsOK(ecode2)) {
23356     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_set_shutdown1" "', argument " "2"" of type '" "int""'");
23357   }
23358   arg2 = (int)(val2);
23359   {
23360     if (!arg1) {
23361       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23362     }
23363   }
23364   ssl_set_shutdown1(arg1,arg2);
23365   resultobj = SWIG_Py_Void();
23366   return resultobj;
23367 fail:
23368   return NULL;
23369 }
23370 
23371 
_wrap_ssl_read_nbio(PyObject * self,PyObject * args)23372 SWIGINTERN PyObject *_wrap_ssl_read_nbio(PyObject *self, PyObject *args) {
23373   PyObject *resultobj = 0;
23374   SSL *arg1 = (SSL *) 0 ;
23375   int arg2 ;
23376   void *argp1 = 0 ;
23377   int res1 = 0 ;
23378   int val2 ;
23379   int ecode2 = 0 ;
23380   PyObject *swig_obj[2] ;
23381   PyObject *result = 0 ;
23382 
23383   if (!SWIG_Python_UnpackTuple(args, "ssl_read_nbio", 2, 2, swig_obj)) SWIG_fail;
23384   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23385   if (!SWIG_IsOK(res1)) {
23386     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_read_nbio" "', argument " "1"" of type '" "SSL *""'");
23387   }
23388   arg1 = (SSL *)(argp1);
23389   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
23390   if (!SWIG_IsOK(ecode2)) {
23391     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_read_nbio" "', argument " "2"" of type '" "int""'");
23392   }
23393   arg2 = (int)(val2);
23394   {
23395     if (!arg1) {
23396       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23397     }
23398   }
23399   result = (PyObject *)ssl_read_nbio(arg1,arg2);
23400   {
23401     resultobj=result;
23402   }
23403   return resultobj;
23404 fail:
23405   return NULL;
23406 }
23407 
23408 
_wrap_ssl_write_nbio(PyObject * self,PyObject * args)23409 SWIGINTERN PyObject *_wrap_ssl_write_nbio(PyObject *self, PyObject *args) {
23410   PyObject *resultobj = 0;
23411   SSL *arg1 = (SSL *) 0 ;
23412   PyObject *arg2 = (PyObject *) 0 ;
23413   void *argp1 = 0 ;
23414   int res1 = 0 ;
23415   PyObject *swig_obj[2] ;
23416   int result;
23417 
23418   if (!SWIG_Python_UnpackTuple(args, "ssl_write_nbio", 2, 2, swig_obj)) SWIG_fail;
23419   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23420   if (!SWIG_IsOK(res1)) {
23421     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_write_nbio" "', argument " "1"" of type '" "SSL *""'");
23422   }
23423   arg1 = (SSL *)(argp1);
23424   {
23425     arg2=swig_obj[1];
23426   }
23427   {
23428     if (!arg1) {
23429       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23430     }
23431   }
23432   result = (int)ssl_write_nbio(arg1,arg2);
23433   {
23434     resultobj=PyLong_FromLong(result);
23435     if (PyErr_Occurred()) SWIG_fail;
23436   }
23437   return resultobj;
23438 fail:
23439   return NULL;
23440 }
23441 
23442 
_wrap_ssl_cipher_get_bits(PyObject * self,PyObject * args)23443 SWIGINTERN PyObject *_wrap_ssl_cipher_get_bits(PyObject *self, PyObject *args) {
23444   PyObject *resultobj = 0;
23445   SSL_CIPHER *arg1 = (SSL_CIPHER *) 0 ;
23446   void *argp1 = 0 ;
23447   int res1 = 0 ;
23448   PyObject *swig_obj[1] ;
23449   int result;
23450 
23451   if (!args) SWIG_fail;
23452   swig_obj[0] = args;
23453   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CIPHER, 0 |  0 );
23454   if (!SWIG_IsOK(res1)) {
23455     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_cipher_get_bits" "', argument " "1"" of type '" "SSL_CIPHER *""'");
23456   }
23457   arg1 = (SSL_CIPHER *)(argp1);
23458   {
23459     if (!arg1) {
23460       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23461     }
23462   }
23463   result = (int)ssl_cipher_get_bits(arg1);
23464   {
23465     resultobj=PyLong_FromLong(result);
23466     if (PyErr_Occurred()) SWIG_fail;
23467   }
23468   return resultobj;
23469 fail:
23470   return NULL;
23471 }
23472 
23473 
_wrap_sk_ssl_cipher_num(PyObject * self,PyObject * args)23474 SWIGINTERN PyObject *_wrap_sk_ssl_cipher_num(PyObject *self, PyObject *args) {
23475   PyObject *resultobj = 0;
23476   struct stack_st_SSL_CIPHER *arg1 = (struct stack_st_SSL_CIPHER *) 0 ;
23477   void *argp1 = 0 ;
23478   int res1 = 0 ;
23479   PyObject *swig_obj[1] ;
23480   int result;
23481 
23482   if (!args) SWIG_fail;
23483   swig_obj[0] = args;
23484   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_SSL_CIPHER, 0 |  0 );
23485   if (!SWIG_IsOK(res1)) {
23486     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_ssl_cipher_num" "', argument " "1"" of type '" "struct stack_st_SSL_CIPHER *""'");
23487   }
23488   arg1 = (struct stack_st_SSL_CIPHER *)(argp1);
23489   {
23490     if (!arg1) {
23491       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23492     }
23493   }
23494   result = (int)sk_ssl_cipher_num(arg1);
23495   {
23496     resultobj=PyLong_FromLong(result);
23497     if (PyErr_Occurred()) SWIG_fail;
23498   }
23499   return resultobj;
23500 fail:
23501   return NULL;
23502 }
23503 
23504 
_wrap_sk_ssl_cipher_value(PyObject * self,PyObject * args)23505 SWIGINTERN PyObject *_wrap_sk_ssl_cipher_value(PyObject *self, PyObject *args) {
23506   PyObject *resultobj = 0;
23507   struct stack_st_SSL_CIPHER *arg1 = (struct stack_st_SSL_CIPHER *) 0 ;
23508   int arg2 ;
23509   void *argp1 = 0 ;
23510   int res1 = 0 ;
23511   int val2 ;
23512   int ecode2 = 0 ;
23513   PyObject *swig_obj[2] ;
23514   SSL_CIPHER *result = 0 ;
23515 
23516   if (!SWIG_Python_UnpackTuple(args, "sk_ssl_cipher_value", 2, 2, swig_obj)) SWIG_fail;
23517   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_SSL_CIPHER, 0 |  0 );
23518   if (!SWIG_IsOK(res1)) {
23519     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_ssl_cipher_value" "', argument " "1"" of type '" "struct stack_st_SSL_CIPHER *""'");
23520   }
23521   arg1 = (struct stack_st_SSL_CIPHER *)(argp1);
23522   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
23523   if (!SWIG_IsOK(ecode2)) {
23524     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_ssl_cipher_value" "', argument " "2"" of type '" "int""'");
23525   }
23526   arg2 = (int)(val2);
23527   {
23528     if (!arg1) {
23529       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23530     }
23531   }
23532   result = (SSL_CIPHER *)sk_ssl_cipher_value(arg1,arg2);
23533   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_SSL_CIPHER, 0 |  0 );
23534   return resultobj;
23535 fail:
23536   return NULL;
23537 }
23538 
23539 
_wrap_ssl_get_peer_cert_chain(PyObject * self,PyObject * args)23540 SWIGINTERN PyObject *_wrap_ssl_get_peer_cert_chain(PyObject *self, PyObject *args) {
23541   PyObject *resultobj = 0;
23542   SSL *arg1 = (SSL *) 0 ;
23543   void *argp1 = 0 ;
23544   int res1 = 0 ;
23545   PyObject *swig_obj[1] ;
23546   struct stack_st_X509 *result = 0 ;
23547 
23548   if (!args) SWIG_fail;
23549   swig_obj[0] = args;
23550   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23551   if (!SWIG_IsOK(res1)) {
23552     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_get_peer_cert_chain" "', argument " "1"" of type '" "SSL *""'");
23553   }
23554   arg1 = (SSL *)(argp1);
23555   {
23556     if (!arg1) {
23557       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23558     }
23559   }
23560   result = (struct stack_st_X509 *)ssl_get_peer_cert_chain(arg1);
23561   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_X509, 0 |  0 );
23562   return resultobj;
23563 fail:
23564   return NULL;
23565 }
23566 
23567 
_wrap_sk_x509_num(PyObject * self,PyObject * args)23568 SWIGINTERN PyObject *_wrap_sk_x509_num(PyObject *self, PyObject *args) {
23569   PyObject *resultobj = 0;
23570   struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ;
23571   void *argp1 = 0 ;
23572   int res1 = 0 ;
23573   PyObject *swig_obj[1] ;
23574   int result;
23575 
23576   if (!args) SWIG_fail;
23577   swig_obj[0] = args;
23578   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 |  0 );
23579   if (!SWIG_IsOK(res1)) {
23580     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_num" "', argument " "1"" of type '" "struct stack_st_X509 *""'");
23581   }
23582   arg1 = (struct stack_st_X509 *)(argp1);
23583   {
23584     if (!arg1) {
23585       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23586     }
23587   }
23588   result = (int)sk_x509_num(arg1);
23589   {
23590     resultobj=PyLong_FromLong(result);
23591     if (PyErr_Occurred()) SWIG_fail;
23592   }
23593   return resultobj;
23594 fail:
23595   return NULL;
23596 }
23597 
23598 
_wrap_sk_x509_value(PyObject * self,PyObject * args)23599 SWIGINTERN PyObject *_wrap_sk_x509_value(PyObject *self, PyObject *args) {
23600   PyObject *resultobj = 0;
23601   struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ;
23602   int arg2 ;
23603   void *argp1 = 0 ;
23604   int res1 = 0 ;
23605   int val2 ;
23606   int ecode2 = 0 ;
23607   PyObject *swig_obj[2] ;
23608   X509 *result = 0 ;
23609 
23610   if (!SWIG_Python_UnpackTuple(args, "sk_x509_value", 2, 2, swig_obj)) SWIG_fail;
23611   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 |  0 );
23612   if (!SWIG_IsOK(res1)) {
23613     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_value" "', argument " "1"" of type '" "struct stack_st_X509 *""'");
23614   }
23615   arg1 = (struct stack_st_X509 *)(argp1);
23616   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
23617   if (!SWIG_IsOK(ecode2)) {
23618     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_x509_value" "', argument " "2"" of type '" "int""'");
23619   }
23620   arg2 = (int)(val2);
23621   {
23622     if (!arg1) {
23623       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23624     }
23625   }
23626   result = (X509 *)sk_x509_value(arg1,arg2);
23627   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 |  0 );
23628   return resultobj;
23629 fail:
23630   return NULL;
23631 }
23632 
23633 
_wrap_i2d_ssl_session(PyObject * self,PyObject * args)23634 SWIGINTERN PyObject *_wrap_i2d_ssl_session(PyObject *self, PyObject *args) {
23635   PyObject *resultobj = 0;
23636   BIO *arg1 = (BIO *) 0 ;
23637   SSL_SESSION *arg2 = (SSL_SESSION *) 0 ;
23638   void *argp1 = 0 ;
23639   int res1 = 0 ;
23640   void *argp2 = 0 ;
23641   int res2 = 0 ;
23642   PyObject *swig_obj[2] ;
23643 
23644   if (!SWIG_Python_UnpackTuple(args, "i2d_ssl_session", 2, 2, swig_obj)) SWIG_fail;
23645   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
23646   if (!SWIG_IsOK(res1)) {
23647     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_ssl_session" "', argument " "1"" of type '" "BIO *""'");
23648   }
23649   arg1 = (BIO *)(argp1);
23650   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_SSL_SESSION, 0 |  0 );
23651   if (!SWIG_IsOK(res2)) {
23652     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "i2d_ssl_session" "', argument " "2"" of type '" "SSL_SESSION *""'");
23653   }
23654   arg2 = (SSL_SESSION *)(argp2);
23655   {
23656     if (!arg1) {
23657       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23658     }
23659   }
23660   {
23661     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23662     i2d_ssl_session(arg1,arg2);
23663     SWIG_PYTHON_THREAD_END_ALLOW;
23664   }
23665   resultobj = SWIG_Py_Void();
23666   return resultobj;
23667 fail:
23668   return NULL;
23669 }
23670 
23671 
_wrap_ssl_session_read_pem(PyObject * self,PyObject * args)23672 SWIGINTERN PyObject *_wrap_ssl_session_read_pem(PyObject *self, PyObject *args) {
23673   PyObject *resultobj = 0;
23674   BIO *arg1 = (BIO *) 0 ;
23675   void *argp1 = 0 ;
23676   int res1 = 0 ;
23677   PyObject *swig_obj[1] ;
23678   SSL_SESSION *result = 0 ;
23679 
23680   if (!args) SWIG_fail;
23681   swig_obj[0] = args;
23682   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
23683   if (!SWIG_IsOK(res1)) {
23684     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_read_pem" "', argument " "1"" of type '" "BIO *""'");
23685   }
23686   arg1 = (BIO *)(argp1);
23687   {
23688     if (!arg1) {
23689       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23690     }
23691   }
23692   {
23693     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23694     result = (SSL_SESSION *)ssl_session_read_pem(arg1);
23695     SWIG_PYTHON_THREAD_END_ALLOW;
23696   }
23697   {
23698     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
23699 
23700     if (result != NULL)
23701     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_SSL_SESSION, 0);
23702     else {
23703       m2_PyErr_Msg(_ssl_err);
23704       resultobj = NULL;
23705     }
23706   }
23707   return resultobj;
23708 fail:
23709   return NULL;
23710 }
23711 
23712 
_wrap_ssl_session_write_pem(PyObject * self,PyObject * args)23713 SWIGINTERN PyObject *_wrap_ssl_session_write_pem(PyObject *self, PyObject *args) {
23714   PyObject *resultobj = 0;
23715   SSL_SESSION *arg1 = (SSL_SESSION *) 0 ;
23716   BIO *arg2 = (BIO *) 0 ;
23717   void *argp1 = 0 ;
23718   int res1 = 0 ;
23719   void *argp2 = 0 ;
23720   int res2 = 0 ;
23721   PyObject *swig_obj[2] ;
23722   int result;
23723 
23724   if (!SWIG_Python_UnpackTuple(args, "ssl_session_write_pem", 2, 2, swig_obj)) SWIG_fail;
23725   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_SESSION, 0 |  0 );
23726   if (!SWIG_IsOK(res1)) {
23727     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_session_write_pem" "', argument " "1"" of type '" "SSL_SESSION *""'");
23728   }
23729   arg1 = (SSL_SESSION *)(argp1);
23730   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
23731   if (!SWIG_IsOK(res2)) {
23732     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ssl_session_write_pem" "', argument " "2"" of type '" "BIO *""'");
23733   }
23734   arg2 = (BIO *)(argp2);
23735   {
23736     if (!arg2) {
23737       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23738     }
23739   }
23740   {
23741     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
23742     result = (int)ssl_session_write_pem(arg1,arg2);
23743     SWIG_PYTHON_THREAD_END_ALLOW;
23744   }
23745   {
23746     resultobj=PyLong_FromLong(result);
23747     if (PyErr_Occurred()) SWIG_fail;
23748   }
23749   return resultobj;
23750 fail:
23751   return NULL;
23752 }
23753 
23754 
_wrap_ssl_ctx_set_session_cache_mode(PyObject * self,PyObject * args)23755 SWIGINTERN PyObject *_wrap_ssl_ctx_set_session_cache_mode(PyObject *self, PyObject *args) {
23756   PyObject *resultobj = 0;
23757   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
23758   int arg2 ;
23759   void *argp1 = 0 ;
23760   int res1 = 0 ;
23761   int val2 ;
23762   int ecode2 = 0 ;
23763   PyObject *swig_obj[2] ;
23764   int result;
23765 
23766   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_session_cache_mode", 2, 2, swig_obj)) SWIG_fail;
23767   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
23768   if (!SWIG_IsOK(res1)) {
23769     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_session_cache_mode" "', argument " "1"" of type '" "SSL_CTX *""'");
23770   }
23771   arg1 = (SSL_CTX *)(argp1);
23772   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
23773   if (!SWIG_IsOK(ecode2)) {
23774     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_session_cache_mode" "', argument " "2"" of type '" "int""'");
23775   }
23776   arg2 = (int)(val2);
23777   {
23778     if (!arg1) {
23779       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23780     }
23781   }
23782   result = (int)ssl_ctx_set_session_cache_mode(arg1,arg2);
23783   {
23784     resultobj=PyLong_FromLong(result);
23785     if (PyErr_Occurred()) SWIG_fail;
23786   }
23787   return resultobj;
23788 fail:
23789   return NULL;
23790 }
23791 
23792 
_wrap_ssl_ctx_get_session_cache_mode(PyObject * self,PyObject * args)23793 SWIGINTERN PyObject *_wrap_ssl_ctx_get_session_cache_mode(PyObject *self, PyObject *args) {
23794   PyObject *resultobj = 0;
23795   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
23796   void *argp1 = 0 ;
23797   int res1 = 0 ;
23798   PyObject *swig_obj[1] ;
23799   int result;
23800 
23801   if (!args) SWIG_fail;
23802   swig_obj[0] = args;
23803   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
23804   if (!SWIG_IsOK(res1)) {
23805     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_get_session_cache_mode" "', argument " "1"" of type '" "SSL_CTX *""'");
23806   }
23807   arg1 = (SSL_CTX *)(argp1);
23808   {
23809     if (!arg1) {
23810       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23811     }
23812   }
23813   result = (int)ssl_ctx_get_session_cache_mode(arg1);
23814   {
23815     resultobj=PyLong_FromLong(result);
23816     if (PyErr_Occurred()) SWIG_fail;
23817   }
23818   return resultobj;
23819 fail:
23820   return NULL;
23821 }
23822 
23823 
_wrap_ssl_ctx_set_cache_size(PyObject * self,PyObject * args)23824 SWIGINTERN PyObject *_wrap_ssl_ctx_set_cache_size(PyObject *self, PyObject *args) {
23825   PyObject *resultobj = 0;
23826   SSL_CTX *arg1 = (SSL_CTX *) 0 ;
23827   long arg2 ;
23828   void *argp1 = 0 ;
23829   int res1 = 0 ;
23830   long val2 ;
23831   int ecode2 = 0 ;
23832   PyObject *swig_obj[2] ;
23833   long result;
23834 
23835   if (!SWIG_Python_UnpackTuple(args, "ssl_ctx_set_cache_size", 2, 2, swig_obj)) SWIG_fail;
23836   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL_CTX, 0 |  0 );
23837   if (!SWIG_IsOK(res1)) {
23838     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_ctx_set_cache_size" "', argument " "1"" of type '" "SSL_CTX *""'");
23839   }
23840   arg1 = (SSL_CTX *)(argp1);
23841   ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
23842   if (!SWIG_IsOK(ecode2)) {
23843     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "ssl_ctx_set_cache_size" "', argument " "2"" of type '" "long""'");
23844   }
23845   arg2 = (long)(val2);
23846   {
23847     if (!arg1) {
23848       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23849     }
23850   }
23851   result = (long)ssl_ctx_set_cache_size(arg1,arg2);
23852   resultobj = SWIG_From_long((long)(result));
23853   return resultobj;
23854 fail:
23855   return NULL;
23856 }
23857 
23858 
_wrap_ssl_is_init_finished(PyObject * self,PyObject * args)23859 SWIGINTERN PyObject *_wrap_ssl_is_init_finished(PyObject *self, PyObject *args) {
23860   PyObject *resultobj = 0;
23861   SSL *arg1 = (SSL *) 0 ;
23862   void *argp1 = 0 ;
23863   int res1 = 0 ;
23864   PyObject *swig_obj[1] ;
23865   int result;
23866 
23867   if (!args) SWIG_fail;
23868   swig_obj[0] = args;
23869   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_SSL, 0 |  0 );
23870   if (!SWIG_IsOK(res1)) {
23871     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ssl_is_init_finished" "', argument " "1"" of type '" "SSL *""'");
23872   }
23873   arg1 = (SSL *)(argp1);
23874   {
23875     if (!arg1) {
23876       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23877     }
23878   }
23879   result = (int)ssl_is_init_finished(arg1);
23880   {
23881     resultobj=PyLong_FromLong(result);
23882     if (PyErr_Occurred()) SWIG_fail;
23883   }
23884   return resultobj;
23885 fail:
23886   return NULL;
23887 }
23888 
23889 
_wrap_x509_check_ca(PyObject * self,PyObject * args)23890 SWIGINTERN PyObject *_wrap_x509_check_ca(PyObject *self, PyObject *args) {
23891   PyObject *resultobj = 0;
23892   X509 *arg1 = (X509 *) 0 ;
23893   void *argp1 = 0 ;
23894   int res1 = 0 ;
23895   PyObject *swig_obj[1] ;
23896   int result;
23897 
23898   if (!args) SWIG_fail;
23899   swig_obj[0] = args;
23900   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
23901   if (!SWIG_IsOK(res1)) {
23902     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_ca" "', argument " "1"" of type '" "X509 *""'");
23903   }
23904   arg1 = (X509 *)(argp1);
23905   {
23906     if (!arg1) {
23907       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23908     }
23909   }
23910   result = (int)X509_check_ca(arg1);
23911   {
23912     resultobj=PyLong_FromLong(result);
23913     if (PyErr_Occurred()) SWIG_fail;
23914   }
23915   return resultobj;
23916 fail:
23917   return NULL;
23918 }
23919 
23920 
_wrap_x509_new(PyObject * self,PyObject * args)23921 SWIGINTERN PyObject *_wrap_x509_new(PyObject *self, PyObject *args) {
23922   PyObject *resultobj = 0;
23923   X509 *result = 0 ;
23924 
23925   if (!SWIG_Python_UnpackTuple(args, "x509_new", 0, 0, 0)) SWIG_fail;
23926   result = (X509 *)X509_new();
23927   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 |  0 );
23928   return resultobj;
23929 fail:
23930   return NULL;
23931 }
23932 
23933 
_wrap_x509_dup(PyObject * self,PyObject * args)23934 SWIGINTERN PyObject *_wrap_x509_dup(PyObject *self, PyObject *args) {
23935   PyObject *resultobj = 0;
23936   X509 *arg1 = (X509 *) 0 ;
23937   void *argp1 = 0 ;
23938   int res1 = 0 ;
23939   PyObject *swig_obj[1] ;
23940   X509 *result = 0 ;
23941 
23942   if (!args) SWIG_fail;
23943   swig_obj[0] = args;
23944   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
23945   if (!SWIG_IsOK(res1)) {
23946     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_dup" "', argument " "1"" of type '" "X509 *""'");
23947   }
23948   arg1 = (X509 *)(argp1);
23949   {
23950     if (!arg1) {
23951       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23952     }
23953   }
23954   result = (X509 *)X509_dup(arg1);
23955   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 |  0 );
23956   return resultobj;
23957 fail:
23958   return NULL;
23959 }
23960 
23961 
_wrap_x509_free(PyObject * self,PyObject * args)23962 SWIGINTERN PyObject *_wrap_x509_free(PyObject *self, PyObject *args) {
23963   PyObject *resultobj = 0;
23964   X509 *arg1 = (X509 *) 0 ;
23965   void *argp1 = 0 ;
23966   int res1 = 0 ;
23967   PyObject *swig_obj[1] ;
23968 
23969   if (!args) SWIG_fail;
23970   swig_obj[0] = args;
23971   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
23972   if (!SWIG_IsOK(res1)) {
23973     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_free" "', argument " "1"" of type '" "X509 *""'");
23974   }
23975   arg1 = (X509 *)(argp1);
23976   {
23977     if (!arg1) {
23978       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
23979     }
23980   }
23981   X509_free(arg1);
23982   resultobj = SWIG_Py_Void();
23983   return resultobj;
23984 fail:
23985   return NULL;
23986 }
23987 
23988 
_wrap_x509_crl_free(PyObject * self,PyObject * args)23989 SWIGINTERN PyObject *_wrap_x509_crl_free(PyObject *self, PyObject *args) {
23990   PyObject *resultobj = 0;
23991   X509_CRL *arg1 = (X509_CRL *) 0 ;
23992   void *argp1 = 0 ;
23993   int res1 = 0 ;
23994   PyObject *swig_obj[1] ;
23995 
23996   if (!args) SWIG_fail;
23997   swig_obj[0] = args;
23998   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_CRL, 0 |  0 );
23999   if (!SWIG_IsOK(res1)) {
24000     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_crl_free" "', argument " "1"" of type '" "X509_CRL *""'");
24001   }
24002   arg1 = (X509_CRL *)(argp1);
24003   {
24004     if (!arg1) {
24005       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24006     }
24007   }
24008   X509_CRL_free(arg1);
24009   resultobj = SWIG_Py_Void();
24010   return resultobj;
24011 fail:
24012   return NULL;
24013 }
24014 
24015 
_wrap_x509_crl_new(PyObject * self,PyObject * args)24016 SWIGINTERN PyObject *_wrap_x509_crl_new(PyObject *self, PyObject *args) {
24017   PyObject *resultobj = 0;
24018   X509_CRL *result = 0 ;
24019 
24020   if (!SWIG_Python_UnpackTuple(args, "x509_crl_new", 0, 0, 0)) SWIG_fail;
24021   result = (X509_CRL *)X509_CRL_new();
24022   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_CRL, 0 |  0 );
24023   return resultobj;
24024 fail:
24025   return NULL;
24026 }
24027 
24028 
_wrap_x509_print(PyObject * self,PyObject * args)24029 SWIGINTERN PyObject *_wrap_x509_print(PyObject *self, PyObject *args) {
24030   PyObject *resultobj = 0;
24031   BIO *arg1 = (BIO *) 0 ;
24032   X509 *arg2 = (X509 *) 0 ;
24033   void *argp1 = 0 ;
24034   int res1 = 0 ;
24035   void *argp2 = 0 ;
24036   int res2 = 0 ;
24037   PyObject *swig_obj[2] ;
24038   int result;
24039 
24040   if (!SWIG_Python_UnpackTuple(args, "x509_print", 2, 2, swig_obj)) SWIG_fail;
24041   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
24042   if (!SWIG_IsOK(res1)) {
24043     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_print" "', argument " "1"" of type '" "BIO *""'");
24044   }
24045   arg1 = (BIO *)(argp1);
24046   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 |  0 );
24047   if (!SWIG_IsOK(res2)) {
24048     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_print" "', argument " "2"" of type '" "X509 *""'");
24049   }
24050   arg2 = (X509 *)(argp2);
24051   {
24052     if (!arg1) {
24053       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24054     }
24055   }
24056   {
24057     if (!arg2) {
24058       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24059     }
24060   }
24061   {
24062     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24063     result = (int)X509_print(arg1,arg2);
24064     SWIG_PYTHON_THREAD_END_ALLOW;
24065   }
24066   {
24067     resultobj=PyLong_FromLong(result);
24068     if (PyErr_Occurred()) SWIG_fail;
24069   }
24070   return resultobj;
24071 fail:
24072   return NULL;
24073 }
24074 
24075 
_wrap_x509_crl_print(PyObject * self,PyObject * args)24076 SWIGINTERN PyObject *_wrap_x509_crl_print(PyObject *self, PyObject *args) {
24077   PyObject *resultobj = 0;
24078   BIO *arg1 = (BIO *) 0 ;
24079   X509_CRL *arg2 = (X509_CRL *) 0 ;
24080   void *argp1 = 0 ;
24081   int res1 = 0 ;
24082   void *argp2 = 0 ;
24083   int res2 = 0 ;
24084   PyObject *swig_obj[2] ;
24085   int result;
24086 
24087   if (!SWIG_Python_UnpackTuple(args, "x509_crl_print", 2, 2, swig_obj)) SWIG_fail;
24088   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
24089   if (!SWIG_IsOK(res1)) {
24090     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_crl_print" "', argument " "1"" of type '" "BIO *""'");
24091   }
24092   arg1 = (BIO *)(argp1);
24093   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_CRL, 0 |  0 );
24094   if (!SWIG_IsOK(res2)) {
24095     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_crl_print" "', argument " "2"" of type '" "X509_CRL *""'");
24096   }
24097   arg2 = (X509_CRL *)(argp2);
24098   {
24099     if (!arg1) {
24100       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24101     }
24102   }
24103   {
24104     if (!arg2) {
24105       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24106     }
24107   }
24108   {
24109     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24110     result = (int)X509_CRL_print(arg1,arg2);
24111     SWIG_PYTHON_THREAD_END_ALLOW;
24112   }
24113   {
24114     resultobj=PyLong_FromLong(result);
24115     if (PyErr_Occurred()) SWIG_fail;
24116   }
24117   return resultobj;
24118 fail:
24119   return NULL;
24120 }
24121 
24122 
_wrap_x509_get_serial_number(PyObject * self,PyObject * args)24123 SWIGINTERN PyObject *_wrap_x509_get_serial_number(PyObject *self, PyObject *args) {
24124   PyObject *resultobj = 0;
24125   X509 *arg1 = (X509 *) 0 ;
24126   void *argp1 = 0 ;
24127   int res1 = 0 ;
24128   PyObject *swig_obj[1] ;
24129   ASN1_INTEGER *result = 0 ;
24130 
24131   if (!args) SWIG_fail;
24132   swig_obj[0] = args;
24133   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24134   if (!SWIG_IsOK(res1)) {
24135     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_serial_number" "', argument " "1"" of type '" "X509 *""'");
24136   }
24137   arg1 = (X509 *)(argp1);
24138   {
24139     if (!arg1) {
24140       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24141     }
24142   }
24143   result = (ASN1_INTEGER *)X509_get_serialNumber(arg1);
24144   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_INTEGER, 0 |  0 );
24145   return resultobj;
24146 fail:
24147   return NULL;
24148 }
24149 
24150 
_wrap_x509_set_serial_number(PyObject * self,PyObject * args)24151 SWIGINTERN PyObject *_wrap_x509_set_serial_number(PyObject *self, PyObject *args) {
24152   PyObject *resultobj = 0;
24153   X509 *arg1 = (X509 *) 0 ;
24154   ASN1_INTEGER *arg2 = (ASN1_INTEGER *) 0 ;
24155   void *argp1 = 0 ;
24156   int res1 = 0 ;
24157   void *argp2 = 0 ;
24158   int res2 = 0 ;
24159   PyObject *swig_obj[2] ;
24160   int result;
24161 
24162   if (!SWIG_Python_UnpackTuple(args, "x509_set_serial_number", 2, 2, swig_obj)) SWIG_fail;
24163   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24164   if (!SWIG_IsOK(res1)) {
24165     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_serial_number" "', argument " "1"" of type '" "X509 *""'");
24166   }
24167   arg1 = (X509 *)(argp1);
24168   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_INTEGER, 0 |  0 );
24169   if (!SWIG_IsOK(res2)) {
24170     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_serial_number" "', argument " "2"" of type '" "ASN1_INTEGER *""'");
24171   }
24172   arg2 = (ASN1_INTEGER *)(argp2);
24173   {
24174     if (!arg1) {
24175       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24176     }
24177   }
24178   result = (int)X509_set_serialNumber(arg1,arg2);
24179   {
24180     resultobj=PyLong_FromLong(result);
24181     if (PyErr_Occurred()) SWIG_fail;
24182   }
24183   return resultobj;
24184 fail:
24185   return NULL;
24186 }
24187 
24188 
_wrap_x509_get_pubkey(PyObject * self,PyObject * args)24189 SWIGINTERN PyObject *_wrap_x509_get_pubkey(PyObject *self, PyObject *args) {
24190   PyObject *resultobj = 0;
24191   X509 *arg1 = (X509 *) 0 ;
24192   void *argp1 = 0 ;
24193   int res1 = 0 ;
24194   PyObject *swig_obj[1] ;
24195   EVP_PKEY *result = 0 ;
24196 
24197   if (!args) SWIG_fail;
24198   swig_obj[0] = args;
24199   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24200   if (!SWIG_IsOK(res1)) {
24201     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_pubkey" "', argument " "1"" of type '" "X509 *""'");
24202   }
24203   arg1 = (X509 *)(argp1);
24204   {
24205     if (!arg1) {
24206       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24207     }
24208   }
24209   result = (EVP_PKEY *)X509_get_pubkey(arg1);
24210   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_PKEY, 0 |  0 );
24211   return resultobj;
24212 fail:
24213   return NULL;
24214 }
24215 
24216 
_wrap_x509_set_pubkey(PyObject * self,PyObject * args)24217 SWIGINTERN PyObject *_wrap_x509_set_pubkey(PyObject *self, PyObject *args) {
24218   PyObject *resultobj = 0;
24219   X509 *arg1 = (X509 *) 0 ;
24220   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
24221   void *argp1 = 0 ;
24222   int res1 = 0 ;
24223   void *argp2 = 0 ;
24224   int res2 = 0 ;
24225   PyObject *swig_obj[2] ;
24226   int result;
24227 
24228   if (!SWIG_Python_UnpackTuple(args, "x509_set_pubkey", 2, 2, swig_obj)) SWIG_fail;
24229   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24230   if (!SWIG_IsOK(res1)) {
24231     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_pubkey" "', argument " "1"" of type '" "X509 *""'");
24232   }
24233   arg1 = (X509 *)(argp1);
24234   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
24235   if (!SWIG_IsOK(res2)) {
24236     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_pubkey" "', argument " "2"" of type '" "EVP_PKEY *""'");
24237   }
24238   arg2 = (EVP_PKEY *)(argp2);
24239   {
24240     if (!arg1) {
24241       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24242     }
24243   }
24244   {
24245     if (!arg2) {
24246       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24247     }
24248   }
24249   result = (int)X509_set_pubkey(arg1,arg2);
24250   {
24251     resultobj=PyLong_FromLong(result);
24252     if (PyErr_Occurred()) SWIG_fail;
24253   }
24254   return resultobj;
24255 fail:
24256   return NULL;
24257 }
24258 
24259 
_wrap_x509_get_issuer_name(PyObject * self,PyObject * args)24260 SWIGINTERN PyObject *_wrap_x509_get_issuer_name(PyObject *self, PyObject *args) {
24261   PyObject *resultobj = 0;
24262   X509 *arg1 = (X509 *) 0 ;
24263   void *argp1 = 0 ;
24264   int res1 = 0 ;
24265   PyObject *swig_obj[1] ;
24266   X509_NAME *result = 0 ;
24267 
24268   if (!args) SWIG_fail;
24269   swig_obj[0] = args;
24270   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24271   if (!SWIG_IsOK(res1)) {
24272     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_issuer_name" "', argument " "1"" of type '" "X509 *""'");
24273   }
24274   arg1 = (X509 *)(argp1);
24275   {
24276     if (!arg1) {
24277       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24278     }
24279   }
24280   result = (X509_NAME *)X509_get_issuer_name(arg1);
24281   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 |  0 );
24282   return resultobj;
24283 fail:
24284   return NULL;
24285 }
24286 
24287 
_wrap_x509_set_issuer_name(PyObject * self,PyObject * args)24288 SWIGINTERN PyObject *_wrap_x509_set_issuer_name(PyObject *self, PyObject *args) {
24289   PyObject *resultobj = 0;
24290   X509 *arg1 = (X509 *) 0 ;
24291   X509_NAME *arg2 = (X509_NAME *) 0 ;
24292   void *argp1 = 0 ;
24293   int res1 = 0 ;
24294   void *argp2 = 0 ;
24295   int res2 = 0 ;
24296   PyObject *swig_obj[2] ;
24297   int result;
24298 
24299   if (!SWIG_Python_UnpackTuple(args, "x509_set_issuer_name", 2, 2, swig_obj)) SWIG_fail;
24300   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24301   if (!SWIG_IsOK(res1)) {
24302     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_issuer_name" "', argument " "1"" of type '" "X509 *""'");
24303   }
24304   arg1 = (X509 *)(argp1);
24305   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_NAME, 0 |  0 );
24306   if (!SWIG_IsOK(res2)) {
24307     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_issuer_name" "', argument " "2"" of type '" "X509_NAME *""'");
24308   }
24309   arg2 = (X509_NAME *)(argp2);
24310   {
24311     if (!arg1) {
24312       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24313     }
24314   }
24315   {
24316     if (!arg2) {
24317       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24318     }
24319   }
24320   result = (int)X509_set_issuer_name(arg1,arg2);
24321   {
24322     resultobj=PyLong_FromLong(result);
24323     if (PyErr_Occurred()) SWIG_fail;
24324   }
24325   return resultobj;
24326 fail:
24327   return NULL;
24328 }
24329 
24330 
_wrap_x509_get_subject_name(PyObject * self,PyObject * args)24331 SWIGINTERN PyObject *_wrap_x509_get_subject_name(PyObject *self, PyObject *args) {
24332   PyObject *resultobj = 0;
24333   X509 *arg1 = (X509 *) 0 ;
24334   void *argp1 = 0 ;
24335   int res1 = 0 ;
24336   PyObject *swig_obj[1] ;
24337   X509_NAME *result = 0 ;
24338 
24339   if (!args) SWIG_fail;
24340   swig_obj[0] = args;
24341   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24342   if (!SWIG_IsOK(res1)) {
24343     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_subject_name" "', argument " "1"" of type '" "X509 *""'");
24344   }
24345   arg1 = (X509 *)(argp1);
24346   {
24347     if (!arg1) {
24348       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24349     }
24350   }
24351   result = (X509_NAME *)X509_get_subject_name(arg1);
24352   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 |  0 );
24353   return resultobj;
24354 fail:
24355   return NULL;
24356 }
24357 
24358 
_wrap_x509_set_subject_name(PyObject * self,PyObject * args)24359 SWIGINTERN PyObject *_wrap_x509_set_subject_name(PyObject *self, PyObject *args) {
24360   PyObject *resultobj = 0;
24361   X509 *arg1 = (X509 *) 0 ;
24362   X509_NAME *arg2 = (X509_NAME *) 0 ;
24363   void *argp1 = 0 ;
24364   int res1 = 0 ;
24365   void *argp2 = 0 ;
24366   int res2 = 0 ;
24367   PyObject *swig_obj[2] ;
24368   int result;
24369 
24370   if (!SWIG_Python_UnpackTuple(args, "x509_set_subject_name", 2, 2, swig_obj)) SWIG_fail;
24371   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24372   if (!SWIG_IsOK(res1)) {
24373     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_subject_name" "', argument " "1"" of type '" "X509 *""'");
24374   }
24375   arg1 = (X509 *)(argp1);
24376   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_NAME, 0 |  0 );
24377   if (!SWIG_IsOK(res2)) {
24378     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_subject_name" "', argument " "2"" of type '" "X509_NAME *""'");
24379   }
24380   arg2 = (X509_NAME *)(argp2);
24381   {
24382     if (!arg1) {
24383       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24384     }
24385   }
24386   {
24387     if (!arg2) {
24388       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24389     }
24390   }
24391   result = (int)X509_set_subject_name(arg1,arg2);
24392   {
24393     resultobj=PyLong_FromLong(result);
24394     if (PyErr_Occurred()) SWIG_fail;
24395   }
24396   return resultobj;
24397 fail:
24398   return NULL;
24399 }
24400 
24401 
_wrap_x509_cmp_current_time(PyObject * self,PyObject * args)24402 SWIGINTERN PyObject *_wrap_x509_cmp_current_time(PyObject *self, PyObject *args) {
24403   PyObject *resultobj = 0;
24404   ASN1_TIME *arg1 = (ASN1_TIME *) 0 ;
24405   void *argp1 = 0 ;
24406   int res1 = 0 ;
24407   PyObject *swig_obj[1] ;
24408   int result;
24409 
24410   if (!args) SWIG_fail;
24411   swig_obj[0] = args;
24412   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 0 |  0 );
24413   if (!SWIG_IsOK(res1)) {
24414     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_cmp_current_time" "', argument " "1"" of type '" "ASN1_TIME *""'");
24415   }
24416   arg1 = (ASN1_TIME *)(argp1);
24417   result = (int)X509_cmp_current_time(arg1);
24418   {
24419     resultobj=PyLong_FromLong(result);
24420     if (PyErr_Occurred()) SWIG_fail;
24421   }
24422   return resultobj;
24423 fail:
24424   return NULL;
24425 }
24426 
24427 
_wrap_x509_check_purpose(PyObject * self,PyObject * args)24428 SWIGINTERN PyObject *_wrap_x509_check_purpose(PyObject *self, PyObject *args) {
24429   PyObject *resultobj = 0;
24430   X509 *arg1 = (X509 *) 0 ;
24431   int arg2 ;
24432   int arg3 ;
24433   void *argp1 = 0 ;
24434   int res1 = 0 ;
24435   int val2 ;
24436   int ecode2 = 0 ;
24437   int val3 ;
24438   int ecode3 = 0 ;
24439   PyObject *swig_obj[3] ;
24440   int result;
24441 
24442   if (!SWIG_Python_UnpackTuple(args, "x509_check_purpose", 3, 3, swig_obj)) SWIG_fail;
24443   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24444   if (!SWIG_IsOK(res1)) {
24445     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_purpose" "', argument " "1"" of type '" "X509 *""'");
24446   }
24447   arg1 = (X509 *)(argp1);
24448   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
24449   if (!SWIG_IsOK(ecode2)) {
24450     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_check_purpose" "', argument " "2"" of type '" "int""'");
24451   }
24452   arg2 = (int)(val2);
24453   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
24454   if (!SWIG_IsOK(ecode3)) {
24455     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_check_purpose" "', argument " "3"" of type '" "int""'");
24456   }
24457   arg3 = (int)(val3);
24458   {
24459     if (!arg1) {
24460       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24461     }
24462   }
24463   result = (int)X509_check_purpose(arg1,arg2,arg3);
24464   {
24465     resultobj=PyLong_FromLong(result);
24466     if (PyErr_Occurred()) SWIG_fail;
24467   }
24468   return resultobj;
24469 fail:
24470   return NULL;
24471 }
24472 
24473 
_wrap_x509_check_trust(PyObject * self,PyObject * args)24474 SWIGINTERN PyObject *_wrap_x509_check_trust(PyObject *self, PyObject *args) {
24475   PyObject *resultobj = 0;
24476   X509 *arg1 = (X509 *) 0 ;
24477   int arg2 ;
24478   int arg3 ;
24479   void *argp1 = 0 ;
24480   int res1 = 0 ;
24481   int val2 ;
24482   int ecode2 = 0 ;
24483   int val3 ;
24484   int ecode3 = 0 ;
24485   PyObject *swig_obj[3] ;
24486   int result;
24487 
24488   if (!SWIG_Python_UnpackTuple(args, "x509_check_trust", 3, 3, swig_obj)) SWIG_fail;
24489   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24490   if (!SWIG_IsOK(res1)) {
24491     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_check_trust" "', argument " "1"" of type '" "X509 *""'");
24492   }
24493   arg1 = (X509 *)(argp1);
24494   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
24495   if (!SWIG_IsOK(ecode2)) {
24496     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_check_trust" "', argument " "2"" of type '" "int""'");
24497   }
24498   arg2 = (int)(val2);
24499   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
24500   if (!SWIG_IsOK(ecode3)) {
24501     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_check_trust" "', argument " "3"" of type '" "int""'");
24502   }
24503   arg3 = (int)(val3);
24504   {
24505     if (!arg1) {
24506       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24507     }
24508   }
24509   result = (int)X509_check_trust(arg1,arg2,arg3);
24510   {
24511     resultobj=PyLong_FromLong(result);
24512     if (PyErr_Occurred()) SWIG_fail;
24513   }
24514   return resultobj;
24515 fail:
24516   return NULL;
24517 }
24518 
24519 
_wrap_x509_write_pem(PyObject * self,PyObject * args)24520 SWIGINTERN PyObject *_wrap_x509_write_pem(PyObject *self, PyObject *args) {
24521   PyObject *resultobj = 0;
24522   BIO *arg1 = (BIO *) 0 ;
24523   X509 *arg2 = (X509 *) 0 ;
24524   void *argp1 = 0 ;
24525   int res1 = 0 ;
24526   void *argp2 = 0 ;
24527   int res2 = 0 ;
24528   PyObject *swig_obj[2] ;
24529   int result;
24530 
24531   if (!SWIG_Python_UnpackTuple(args, "x509_write_pem", 2, 2, swig_obj)) SWIG_fail;
24532   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
24533   if (!SWIG_IsOK(res1)) {
24534     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_write_pem" "', argument " "1"" of type '" "BIO *""'");
24535   }
24536   arg1 = (BIO *)(argp1);
24537   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 |  0 );
24538   if (!SWIG_IsOK(res2)) {
24539     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_write_pem" "', argument " "2"" of type '" "X509 *""'");
24540   }
24541   arg2 = (X509 *)(argp2);
24542   {
24543     if (!arg1) {
24544       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24545     }
24546   }
24547   {
24548     if (!arg2) {
24549       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24550     }
24551   }
24552   {
24553     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24554     result = (int)PEM_write_bio_X509(arg1,arg2);
24555     SWIG_PYTHON_THREAD_END_ALLOW;
24556   }
24557   {
24558     resultobj=PyLong_FromLong(result);
24559     if (PyErr_Occurred()) SWIG_fail;
24560   }
24561   return resultobj;
24562 fail:
24563   return NULL;
24564 }
24565 
24566 
_wrap_x509_write_pem_file(PyObject * self,PyObject * args)24567 SWIGINTERN PyObject *_wrap_x509_write_pem_file(PyObject *self, PyObject *args) {
24568   PyObject *resultobj = 0;
24569   FILE *arg1 = (FILE *) 0 ;
24570   X509 *arg2 = (X509 *) 0 ;
24571   void *argp1 = 0 ;
24572   int res1 = 0 ;
24573   void *argp2 = 0 ;
24574   int res2 = 0 ;
24575   PyObject *swig_obj[2] ;
24576   int result;
24577 
24578   if (!SWIG_Python_UnpackTuple(args, "x509_write_pem_file", 2, 2, swig_obj)) SWIG_fail;
24579   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_FILE, 0 |  0 );
24580   if (!SWIG_IsOK(res1)) {
24581     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_write_pem_file" "', argument " "1"" of type '" "FILE *""'");
24582   }
24583   arg1 = (FILE *)(argp1);
24584   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 |  0 );
24585   if (!SWIG_IsOK(res2)) {
24586     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_write_pem_file" "', argument " "2"" of type '" "X509 *""'");
24587   }
24588   arg2 = (X509 *)(argp2);
24589   {
24590     if (!arg2) {
24591       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24592     }
24593   }
24594   result = (int)PEM_write_X509(arg1,arg2);
24595   {
24596     resultobj=PyLong_FromLong(result);
24597     if (PyErr_Occurred()) SWIG_fail;
24598   }
24599   return resultobj;
24600 fail:
24601   return NULL;
24602 }
24603 
24604 
_wrap_x509_verify(PyObject * self,PyObject * args)24605 SWIGINTERN PyObject *_wrap_x509_verify(PyObject *self, PyObject *args) {
24606   PyObject *resultobj = 0;
24607   X509 *arg1 = (X509 *) 0 ;
24608   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
24609   void *argp1 = 0 ;
24610   int res1 = 0 ;
24611   void *argp2 = 0 ;
24612   int res2 = 0 ;
24613   PyObject *swig_obj[2] ;
24614   int result;
24615 
24616   if (!SWIG_Python_UnpackTuple(args, "x509_verify", 2, 2, swig_obj)) SWIG_fail;
24617   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24618   if (!SWIG_IsOK(res1)) {
24619     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_verify" "', argument " "1"" of type '" "X509 *""'");
24620   }
24621   arg1 = (X509 *)(argp1);
24622   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
24623   if (!SWIG_IsOK(res2)) {
24624     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_verify" "', argument " "2"" of type '" "EVP_PKEY *""'");
24625   }
24626   arg2 = (EVP_PKEY *)(argp2);
24627   {
24628     if (!arg1) {
24629       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24630     }
24631   }
24632   {
24633     if (!arg2) {
24634       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24635     }
24636   }
24637   result = (int)X509_verify(arg1,arg2);
24638   {
24639     resultobj=PyLong_FromLong(result);
24640     if (PyErr_Occurred()) SWIG_fail;
24641   }
24642   return resultobj;
24643 fail:
24644   return NULL;
24645 }
24646 
24647 
_wrap_x509_get_verify_error(PyObject * self,PyObject * args)24648 SWIGINTERN PyObject *_wrap_x509_get_verify_error(PyObject *self, PyObject *args) {
24649   PyObject *resultobj = 0;
24650   long arg1 ;
24651   long val1 ;
24652   int ecode1 = 0 ;
24653   PyObject *swig_obj[1] ;
24654   char *result = 0 ;
24655 
24656   if (!args) SWIG_fail;
24657   swig_obj[0] = args;
24658   ecode1 = SWIG_AsVal_long(swig_obj[0], &val1);
24659   if (!SWIG_IsOK(ecode1)) {
24660     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "x509_get_verify_error" "', argument " "1"" of type '" "long""'");
24661   }
24662   arg1 = (long)(val1);
24663   result = (char *)X509_verify_cert_error_string(arg1);
24664   resultobj = SWIG_FromCharPtr((const char *)result);
24665   return resultobj;
24666 fail:
24667   return NULL;
24668 }
24669 
24670 
_wrap_x509_add_ext(PyObject * self,PyObject * args)24671 SWIGINTERN PyObject *_wrap_x509_add_ext(PyObject *self, PyObject *args) {
24672   PyObject *resultobj = 0;
24673   X509 *arg1 = (X509 *) 0 ;
24674   X509_EXTENSION *arg2 = (X509_EXTENSION *) 0 ;
24675   int arg3 ;
24676   void *argp1 = 0 ;
24677   int res1 = 0 ;
24678   void *argp2 = 0 ;
24679   int res2 = 0 ;
24680   int val3 ;
24681   int ecode3 = 0 ;
24682   PyObject *swig_obj[3] ;
24683   int result;
24684 
24685   if (!SWIG_Python_UnpackTuple(args, "x509_add_ext", 3, 3, swig_obj)) SWIG_fail;
24686   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24687   if (!SWIG_IsOK(res1)) {
24688     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_add_ext" "', argument " "1"" of type '" "X509 *""'");
24689   }
24690   arg1 = (X509 *)(argp1);
24691   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_EXTENSION, 0 |  0 );
24692   if (!SWIG_IsOK(res2)) {
24693     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_add_ext" "', argument " "2"" of type '" "X509_EXTENSION *""'");
24694   }
24695   arg2 = (X509_EXTENSION *)(argp2);
24696   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
24697   if (!SWIG_IsOK(ecode3)) {
24698     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_add_ext" "', argument " "3"" of type '" "int""'");
24699   }
24700   arg3 = (int)(val3);
24701   {
24702     if (!arg1) {
24703       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24704     }
24705   }
24706   result = (int)X509_add_ext(arg1,arg2,arg3);
24707   {
24708     resultobj=PyLong_FromLong(result);
24709     if (PyErr_Occurred()) SWIG_fail;
24710   }
24711   return resultobj;
24712 fail:
24713   return NULL;
24714 }
24715 
24716 
_wrap_x509_get_ext_count(PyObject * self,PyObject * args)24717 SWIGINTERN PyObject *_wrap_x509_get_ext_count(PyObject *self, PyObject *args) {
24718   PyObject *resultobj = 0;
24719   X509 *arg1 = (X509 *) 0 ;
24720   void *argp1 = 0 ;
24721   int res1 = 0 ;
24722   PyObject *swig_obj[1] ;
24723   int result;
24724 
24725   if (!args) SWIG_fail;
24726   swig_obj[0] = args;
24727   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24728   if (!SWIG_IsOK(res1)) {
24729     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_ext_count" "', argument " "1"" of type '" "X509 *""'");
24730   }
24731   arg1 = (X509 *)(argp1);
24732   {
24733     if (!arg1) {
24734       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24735     }
24736   }
24737   result = (int)X509_get_ext_count(arg1);
24738   {
24739     resultobj=PyLong_FromLong(result);
24740     if (PyErr_Occurred()) SWIG_fail;
24741   }
24742   return resultobj;
24743 fail:
24744   return NULL;
24745 }
24746 
24747 
_wrap_x509_get_ext(PyObject * self,PyObject * args)24748 SWIGINTERN PyObject *_wrap_x509_get_ext(PyObject *self, PyObject *args) {
24749   PyObject *resultobj = 0;
24750   X509 *arg1 = (X509 *) 0 ;
24751   int arg2 ;
24752   void *argp1 = 0 ;
24753   int res1 = 0 ;
24754   int val2 ;
24755   int ecode2 = 0 ;
24756   PyObject *swig_obj[2] ;
24757   X509_EXTENSION *result = 0 ;
24758 
24759   if (!SWIG_Python_UnpackTuple(args, "x509_get_ext", 2, 2, swig_obj)) SWIG_fail;
24760   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
24761   if (!SWIG_IsOK(res1)) {
24762     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_ext" "', argument " "1"" of type '" "X509 *""'");
24763   }
24764   arg1 = (X509 *)(argp1);
24765   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
24766   if (!SWIG_IsOK(ecode2)) {
24767     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_get_ext" "', argument " "2"" of type '" "int""'");
24768   }
24769   arg2 = (int)(val2);
24770   {
24771     if (!arg1) {
24772       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24773     }
24774   }
24775   result = (X509_EXTENSION *)X509_get_ext(arg1,arg2);
24776   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_EXTENSION, 0 |  0 );
24777   return resultobj;
24778 fail:
24779   return NULL;
24780 }
24781 
24782 
_wrap_x509_ext_print(PyObject * self,PyObject * args)24783 SWIGINTERN PyObject *_wrap_x509_ext_print(PyObject *self, PyObject *args) {
24784   PyObject *resultobj = 0;
24785   BIO *arg1 = (BIO *) 0 ;
24786   X509_EXTENSION *arg2 = (X509_EXTENSION *) 0 ;
24787   unsigned long arg3 ;
24788   int arg4 ;
24789   void *argp1 = 0 ;
24790   int res1 = 0 ;
24791   void *argp2 = 0 ;
24792   int res2 = 0 ;
24793   unsigned long val3 ;
24794   int ecode3 = 0 ;
24795   int val4 ;
24796   int ecode4 = 0 ;
24797   PyObject *swig_obj[4] ;
24798   int result;
24799 
24800   if (!SWIG_Python_UnpackTuple(args, "x509_ext_print", 4, 4, swig_obj)) SWIG_fail;
24801   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
24802   if (!SWIG_IsOK(res1)) {
24803     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_ext_print" "', argument " "1"" of type '" "BIO *""'");
24804   }
24805   arg1 = (BIO *)(argp1);
24806   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_EXTENSION, 0 |  0 );
24807   if (!SWIG_IsOK(res2)) {
24808     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_ext_print" "', argument " "2"" of type '" "X509_EXTENSION *""'");
24809   }
24810   arg2 = (X509_EXTENSION *)(argp2);
24811   ecode3 = SWIG_AsVal_unsigned_SS_long(swig_obj[2], &val3);
24812   if (!SWIG_IsOK(ecode3)) {
24813     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_ext_print" "', argument " "3"" of type '" "unsigned long""'");
24814   }
24815   arg3 = (unsigned long)(val3);
24816   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
24817   if (!SWIG_IsOK(ecode4)) {
24818     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "x509_ext_print" "', argument " "4"" of type '" "int""'");
24819   }
24820   arg4 = (int)(val4);
24821   {
24822     if (!arg1) {
24823       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24824     }
24825   }
24826   {
24827     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24828     result = (int)X509V3_EXT_print(arg1,arg2,arg3,arg4);
24829     SWIG_PYTHON_THREAD_END_ALLOW;
24830   }
24831   {
24832     resultobj=PyLong_FromLong(result);
24833     if (PyErr_Occurred()) SWIG_fail;
24834   }
24835   return resultobj;
24836 fail:
24837   return NULL;
24838 }
24839 
24840 
_wrap_x509_name_new(PyObject * self,PyObject * args)24841 SWIGINTERN PyObject *_wrap_x509_name_new(PyObject *self, PyObject *args) {
24842   PyObject *resultobj = 0;
24843   X509_NAME *result = 0 ;
24844 
24845   if (!SWIG_Python_UnpackTuple(args, "x509_name_new", 0, 0, 0)) SWIG_fail;
24846   result = (X509_NAME *)X509_NAME_new();
24847   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 |  0 );
24848   return resultobj;
24849 fail:
24850   return NULL;
24851 }
24852 
24853 
_wrap_x509_name_free(PyObject * self,PyObject * args)24854 SWIGINTERN PyObject *_wrap_x509_name_free(PyObject *self, PyObject *args) {
24855   PyObject *resultobj = 0;
24856   X509_NAME *arg1 = (X509_NAME *) 0 ;
24857   void *argp1 = 0 ;
24858   int res1 = 0 ;
24859   PyObject *swig_obj[1] ;
24860 
24861   if (!args) SWIG_fail;
24862   swig_obj[0] = args;
24863   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
24864   if (!SWIG_IsOK(res1)) {
24865     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_free" "', argument " "1"" of type '" "X509_NAME *""'");
24866   }
24867   arg1 = (X509_NAME *)(argp1);
24868   {
24869     if (!arg1) {
24870       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24871     }
24872   }
24873   X509_NAME_free(arg1);
24874   resultobj = SWIG_Py_Void();
24875   return resultobj;
24876 fail:
24877   return NULL;
24878 }
24879 
24880 
_wrap_x509_name_print(PyObject * self,PyObject * args)24881 SWIGINTERN PyObject *_wrap_x509_name_print(PyObject *self, PyObject *args) {
24882   PyObject *resultobj = 0;
24883   BIO *arg1 = (BIO *) 0 ;
24884   X509_NAME *arg2 = (X509_NAME *) 0 ;
24885   int arg3 ;
24886   void *argp1 = 0 ;
24887   int res1 = 0 ;
24888   void *argp2 = 0 ;
24889   int res2 = 0 ;
24890   int val3 ;
24891   int ecode3 = 0 ;
24892   PyObject *swig_obj[3] ;
24893   int result;
24894 
24895   if (!SWIG_Python_UnpackTuple(args, "x509_name_print", 3, 3, swig_obj)) SWIG_fail;
24896   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
24897   if (!SWIG_IsOK(res1)) {
24898     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_print" "', argument " "1"" of type '" "BIO *""'");
24899   }
24900   arg1 = (BIO *)(argp1);
24901   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_NAME, 0 |  0 );
24902   if (!SWIG_IsOK(res2)) {
24903     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_print" "', argument " "2"" of type '" "X509_NAME *""'");
24904   }
24905   arg2 = (X509_NAME *)(argp2);
24906   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
24907   if (!SWIG_IsOK(ecode3)) {
24908     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_print" "', argument " "3"" of type '" "int""'");
24909   }
24910   arg3 = (int)(val3);
24911   {
24912     if (!arg1) {
24913       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24914     }
24915   }
24916   {
24917     if (!arg2) {
24918       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24919     }
24920   }
24921   {
24922     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
24923     result = (int)X509_NAME_print(arg1,arg2,arg3);
24924     SWIG_PYTHON_THREAD_END_ALLOW;
24925   }
24926   {
24927     resultobj=PyLong_FromLong(result);
24928     if (PyErr_Occurred()) SWIG_fail;
24929   }
24930   return resultobj;
24931 fail:
24932   return NULL;
24933 }
24934 
24935 
_wrap_x509_name_get_entry(PyObject * self,PyObject * args)24936 SWIGINTERN PyObject *_wrap_x509_name_get_entry(PyObject *self, PyObject *args) {
24937   PyObject *resultobj = 0;
24938   X509_NAME *arg1 = (X509_NAME *) 0 ;
24939   int arg2 ;
24940   void *argp1 = 0 ;
24941   int res1 = 0 ;
24942   int val2 ;
24943   int ecode2 = 0 ;
24944   PyObject *swig_obj[2] ;
24945   X509_NAME_ENTRY *result = 0 ;
24946 
24947   if (!SWIG_Python_UnpackTuple(args, "x509_name_get_entry", 2, 2, swig_obj)) SWIG_fail;
24948   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
24949   if (!SWIG_IsOK(res1)) {
24950     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_entry" "', argument " "1"" of type '" "X509_NAME *""'");
24951   }
24952   arg1 = (X509_NAME *)(argp1);
24953   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
24954   if (!SWIG_IsOK(ecode2)) {
24955     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_get_entry" "', argument " "2"" of type '" "int""'");
24956   }
24957   arg2 = (int)(val2);
24958   {
24959     if (!arg1) {
24960       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24961     }
24962   }
24963   result = (X509_NAME_ENTRY *)X509_NAME_get_entry(arg1,arg2);
24964   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
24965   return resultobj;
24966 fail:
24967   return NULL;
24968 }
24969 
24970 
_wrap_x509_name_entry_count(PyObject * self,PyObject * args)24971 SWIGINTERN PyObject *_wrap_x509_name_entry_count(PyObject *self, PyObject *args) {
24972   PyObject *resultobj = 0;
24973   X509_NAME *arg1 = (X509_NAME *) 0 ;
24974   void *argp1 = 0 ;
24975   int res1 = 0 ;
24976   PyObject *swig_obj[1] ;
24977   int result;
24978 
24979   if (!args) SWIG_fail;
24980   swig_obj[0] = args;
24981   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
24982   if (!SWIG_IsOK(res1)) {
24983     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_count" "', argument " "1"" of type '" "X509_NAME *""'");
24984   }
24985   arg1 = (X509_NAME *)(argp1);
24986   {
24987     if (!arg1) {
24988       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
24989     }
24990   }
24991   result = (int)X509_NAME_entry_count(arg1);
24992   {
24993     resultobj=PyLong_FromLong(result);
24994     if (PyErr_Occurred()) SWIG_fail;
24995   }
24996   return resultobj;
24997 fail:
24998   return NULL;
24999 }
25000 
25001 
_wrap_x509_name_delete_entry(PyObject * self,PyObject * args)25002 SWIGINTERN PyObject *_wrap_x509_name_delete_entry(PyObject *self, PyObject *args) {
25003   PyObject *resultobj = 0;
25004   X509_NAME *arg1 = (X509_NAME *) 0 ;
25005   int arg2 ;
25006   void *argp1 = 0 ;
25007   int res1 = 0 ;
25008   int val2 ;
25009   int ecode2 = 0 ;
25010   PyObject *swig_obj[2] ;
25011   X509_NAME_ENTRY *result = 0 ;
25012 
25013   if (!SWIG_Python_UnpackTuple(args, "x509_name_delete_entry", 2, 2, swig_obj)) SWIG_fail;
25014   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
25015   if (!SWIG_IsOK(res1)) {
25016     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_delete_entry" "', argument " "1"" of type '" "X509_NAME *""'");
25017   }
25018   arg1 = (X509_NAME *)(argp1);
25019   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
25020   if (!SWIG_IsOK(ecode2)) {
25021     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_delete_entry" "', argument " "2"" of type '" "int""'");
25022   }
25023   arg2 = (int)(val2);
25024   {
25025     if (!arg1) {
25026       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25027     }
25028   }
25029   result = (X509_NAME_ENTRY *)X509_NAME_delete_entry(arg1,arg2);
25030   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
25031   return resultobj;
25032 fail:
25033   return NULL;
25034 }
25035 
25036 
_wrap_x509_name_add_entry(PyObject * self,PyObject * args)25037 SWIGINTERN PyObject *_wrap_x509_name_add_entry(PyObject *self, PyObject *args) {
25038   PyObject *resultobj = 0;
25039   X509_NAME *arg1 = (X509_NAME *) 0 ;
25040   X509_NAME_ENTRY *arg2 = (X509_NAME_ENTRY *) 0 ;
25041   int arg3 ;
25042   int arg4 ;
25043   void *argp1 = 0 ;
25044   int res1 = 0 ;
25045   void *argp2 = 0 ;
25046   int res2 = 0 ;
25047   int val3 ;
25048   int ecode3 = 0 ;
25049   int val4 ;
25050   int ecode4 = 0 ;
25051   PyObject *swig_obj[4] ;
25052   int result;
25053 
25054   if (!SWIG_Python_UnpackTuple(args, "x509_name_add_entry", 4, 4, swig_obj)) SWIG_fail;
25055   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
25056   if (!SWIG_IsOK(res1)) {
25057     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry" "', argument " "1"" of type '" "X509_NAME *""'");
25058   }
25059   arg1 = (X509_NAME *)(argp1);
25060   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
25061   if (!SWIG_IsOK(res2)) {
25062     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_add_entry" "', argument " "2"" of type '" "X509_NAME_ENTRY *""'");
25063   }
25064   arg2 = (X509_NAME_ENTRY *)(argp2);
25065   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
25066   if (!SWIG_IsOK(ecode3)) {
25067     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_add_entry" "', argument " "3"" of type '" "int""'");
25068   }
25069   arg3 = (int)(val3);
25070   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
25071   if (!SWIG_IsOK(ecode4)) {
25072     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "x509_name_add_entry" "', argument " "4"" of type '" "int""'");
25073   }
25074   arg4 = (int)(val4);
25075   {
25076     if (!arg1) {
25077       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25078     }
25079   }
25080   {
25081     if (!arg2) {
25082       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25083     }
25084   }
25085   result = (int)X509_NAME_add_entry(arg1,arg2,arg3,arg4);
25086   {
25087     resultobj=PyLong_FromLong(result);
25088     if (PyErr_Occurred()) SWIG_fail;
25089   }
25090   return resultobj;
25091 fail:
25092   return NULL;
25093 }
25094 
25095 
_wrap_x509_name_add_entry_by_obj(PyObject * self,PyObject * args)25096 SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_obj(PyObject *self, PyObject *args) {
25097   PyObject *resultobj = 0;
25098   X509_NAME *arg1 = (X509_NAME *) 0 ;
25099   ASN1_OBJECT *arg2 = (ASN1_OBJECT *) 0 ;
25100   int arg3 ;
25101   unsigned char *arg4 = (unsigned char *) 0 ;
25102   int arg5 ;
25103   int arg6 ;
25104   int arg7 ;
25105   void *argp1 = 0 ;
25106   int res1 = 0 ;
25107   void *argp2 = 0 ;
25108   int res2 = 0 ;
25109   int val3 ;
25110   int ecode3 = 0 ;
25111   void *argp4 = 0 ;
25112   int res4 = 0 ;
25113   int val5 ;
25114   int ecode5 = 0 ;
25115   int val6 ;
25116   int ecode6 = 0 ;
25117   int val7 ;
25118   int ecode7 = 0 ;
25119   PyObject *swig_obj[7] ;
25120   int result;
25121 
25122   if (!SWIG_Python_UnpackTuple(args, "x509_name_add_entry_by_obj", 7, 7, swig_obj)) SWIG_fail;
25123   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
25124   if (!SWIG_IsOK(res1)) {
25125     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry_by_obj" "', argument " "1"" of type '" "X509_NAME *""'");
25126   }
25127   arg1 = (X509_NAME *)(argp1);
25128   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
25129   if (!SWIG_IsOK(res2)) {
25130     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_add_entry_by_obj" "', argument " "2"" of type '" "ASN1_OBJECT *""'");
25131   }
25132   arg2 = (ASN1_OBJECT *)(argp2);
25133   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
25134   if (!SWIG_IsOK(ecode3)) {
25135     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_add_entry_by_obj" "', argument " "3"" of type '" "int""'");
25136   }
25137   arg3 = (int)(val3);
25138   res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_unsigned_char, 0 |  0 );
25139   if (!SWIG_IsOK(res4)) {
25140     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_add_entry_by_obj" "', argument " "4"" of type '" "unsigned char *""'");
25141   }
25142   arg4 = (unsigned char *)(argp4);
25143   ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
25144   if (!SWIG_IsOK(ecode5)) {
25145     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "x509_name_add_entry_by_obj" "', argument " "5"" of type '" "int""'");
25146   }
25147   arg5 = (int)(val5);
25148   ecode6 = SWIG_AsVal_int(swig_obj[5], &val6);
25149   if (!SWIG_IsOK(ecode6)) {
25150     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "x509_name_add_entry_by_obj" "', argument " "6"" of type '" "int""'");
25151   }
25152   arg6 = (int)(val6);
25153   ecode7 = SWIG_AsVal_int(swig_obj[6], &val7);
25154   if (!SWIG_IsOK(ecode7)) {
25155     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "x509_name_add_entry_by_obj" "', argument " "7"" of type '" "int""'");
25156   }
25157   arg7 = (int)(val7);
25158   {
25159     if (!arg1) {
25160       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25161     }
25162   }
25163   result = (int)X509_NAME_add_entry_by_OBJ(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
25164   {
25165     resultobj=PyLong_FromLong(result);
25166     if (PyErr_Occurred()) SWIG_fail;
25167   }
25168   return resultobj;
25169 fail:
25170   return NULL;
25171 }
25172 
25173 
_wrap_x509_name_add_entry_by_nid(PyObject * self,PyObject * args)25174 SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_nid(PyObject *self, PyObject *args) {
25175   PyObject *resultobj = 0;
25176   X509_NAME *arg1 = (X509_NAME *) 0 ;
25177   int arg2 ;
25178   int arg3 ;
25179   unsigned char *arg4 = (unsigned char *) 0 ;
25180   int arg5 ;
25181   int arg6 ;
25182   int arg7 ;
25183   void *argp1 = 0 ;
25184   int res1 = 0 ;
25185   int val2 ;
25186   int ecode2 = 0 ;
25187   int val3 ;
25188   int ecode3 = 0 ;
25189   void *argp4 = 0 ;
25190   int res4 = 0 ;
25191   int val5 ;
25192   int ecode5 = 0 ;
25193   int val6 ;
25194   int ecode6 = 0 ;
25195   int val7 ;
25196   int ecode7 = 0 ;
25197   PyObject *swig_obj[7] ;
25198   int result;
25199 
25200   if (!SWIG_Python_UnpackTuple(args, "x509_name_add_entry_by_nid", 7, 7, swig_obj)) SWIG_fail;
25201   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
25202   if (!SWIG_IsOK(res1)) {
25203     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry_by_nid" "', argument " "1"" of type '" "X509_NAME *""'");
25204   }
25205   arg1 = (X509_NAME *)(argp1);
25206   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
25207   if (!SWIG_IsOK(ecode2)) {
25208     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_add_entry_by_nid" "', argument " "2"" of type '" "int""'");
25209   }
25210   arg2 = (int)(val2);
25211   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
25212   if (!SWIG_IsOK(ecode3)) {
25213     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_add_entry_by_nid" "', argument " "3"" of type '" "int""'");
25214   }
25215   arg3 = (int)(val3);
25216   res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_unsigned_char, 0 |  0 );
25217   if (!SWIG_IsOK(res4)) {
25218     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_add_entry_by_nid" "', argument " "4"" of type '" "unsigned char *""'");
25219   }
25220   arg4 = (unsigned char *)(argp4);
25221   ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
25222   if (!SWIG_IsOK(ecode5)) {
25223     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "x509_name_add_entry_by_nid" "', argument " "5"" of type '" "int""'");
25224   }
25225   arg5 = (int)(val5);
25226   ecode6 = SWIG_AsVal_int(swig_obj[5], &val6);
25227   if (!SWIG_IsOK(ecode6)) {
25228     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "x509_name_add_entry_by_nid" "', argument " "6"" of type '" "int""'");
25229   }
25230   arg6 = (int)(val6);
25231   ecode7 = SWIG_AsVal_int(swig_obj[6], &val7);
25232   if (!SWIG_IsOK(ecode7)) {
25233     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "x509_name_add_entry_by_nid" "', argument " "7"" of type '" "int""'");
25234   }
25235   arg7 = (int)(val7);
25236   {
25237     if (!arg1) {
25238       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25239     }
25240   }
25241   result = (int)X509_NAME_add_entry_by_NID(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
25242   {
25243     resultobj=PyLong_FromLong(result);
25244     if (PyErr_Occurred()) SWIG_fail;
25245   }
25246   return resultobj;
25247 fail:
25248   return NULL;
25249 }
25250 
25251 
_wrap_x509_name_print_ex(PyObject * self,PyObject * args)25252 SWIGINTERN PyObject *_wrap_x509_name_print_ex(PyObject *self, PyObject *args) {
25253   PyObject *resultobj = 0;
25254   BIO *arg1 = (BIO *) 0 ;
25255   X509_NAME *arg2 = (X509_NAME *) 0 ;
25256   int arg3 ;
25257   unsigned long arg4 ;
25258   void *argp1 = 0 ;
25259   int res1 = 0 ;
25260   void *argp2 = 0 ;
25261   int res2 = 0 ;
25262   int val3 ;
25263   int ecode3 = 0 ;
25264   unsigned long val4 ;
25265   int ecode4 = 0 ;
25266   PyObject *swig_obj[4] ;
25267   int result;
25268 
25269   if (!SWIG_Python_UnpackTuple(args, "x509_name_print_ex", 4, 4, swig_obj)) SWIG_fail;
25270   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
25271   if (!SWIG_IsOK(res1)) {
25272     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_print_ex" "', argument " "1"" of type '" "BIO *""'");
25273   }
25274   arg1 = (BIO *)(argp1);
25275   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_NAME, 0 |  0 );
25276   if (!SWIG_IsOK(res2)) {
25277     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_print_ex" "', argument " "2"" of type '" "X509_NAME *""'");
25278   }
25279   arg2 = (X509_NAME *)(argp2);
25280   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
25281   if (!SWIG_IsOK(ecode3)) {
25282     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_print_ex" "', argument " "3"" of type '" "int""'");
25283   }
25284   arg3 = (int)(val3);
25285   ecode4 = SWIG_AsVal_unsigned_SS_long(swig_obj[3], &val4);
25286   if (!SWIG_IsOK(ecode4)) {
25287     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "x509_name_print_ex" "', argument " "4"" of type '" "unsigned long""'");
25288   }
25289   arg4 = (unsigned long)(val4);
25290   {
25291     if (!arg1) {
25292       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25293     }
25294   }
25295   {
25296     if (!arg2) {
25297       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25298     }
25299   }
25300   {
25301     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25302     result = (int)X509_NAME_print_ex(arg1,arg2,arg3,arg4);
25303     SWIG_PYTHON_THREAD_END_ALLOW;
25304   }
25305   {
25306     resultobj=PyLong_FromLong(result);
25307     if (PyErr_Occurred()) SWIG_fail;
25308   }
25309   return resultobj;
25310 fail:
25311   return NULL;
25312 }
25313 
25314 
_wrap_x509_name_hash(PyObject * self,PyObject * args)25315 SWIGINTERN PyObject *_wrap_x509_name_hash(PyObject *self, PyObject *args) {
25316   PyObject *resultobj = 0;
25317   X509_NAME *arg1 = (X509_NAME *) 0 ;
25318   void *argp1 = 0 ;
25319   int res1 = 0 ;
25320   PyObject *swig_obj[1] ;
25321   unsigned long result;
25322 
25323   if (!args) SWIG_fail;
25324   swig_obj[0] = args;
25325   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
25326   if (!SWIG_IsOK(res1)) {
25327     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_hash" "', argument " "1"" of type '" "X509_NAME *""'");
25328   }
25329   arg1 = (X509_NAME *)(argp1);
25330   {
25331     if (!arg1) {
25332       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25333     }
25334   }
25335   result = (unsigned long)X509_NAME_hash_old(arg1);
25336   resultobj = SWIG_From_unsigned_SS_long((unsigned long)(result));
25337   return resultobj;
25338 fail:
25339   return NULL;
25340 }
25341 
25342 
_wrap_x509_name_get_index_by_nid(PyObject * self,PyObject * args)25343 SWIGINTERN PyObject *_wrap_x509_name_get_index_by_nid(PyObject *self, PyObject *args) {
25344   PyObject *resultobj = 0;
25345   X509_NAME *arg1 = (X509_NAME *) 0 ;
25346   int arg2 ;
25347   int arg3 ;
25348   void *argp1 = 0 ;
25349   int res1 = 0 ;
25350   int val2 ;
25351   int ecode2 = 0 ;
25352   int val3 ;
25353   int ecode3 = 0 ;
25354   PyObject *swig_obj[3] ;
25355   int result;
25356 
25357   if (!SWIG_Python_UnpackTuple(args, "x509_name_get_index_by_nid", 3, 3, swig_obj)) SWIG_fail;
25358   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
25359   if (!SWIG_IsOK(res1)) {
25360     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_index_by_nid" "', argument " "1"" of type '" "X509_NAME *""'");
25361   }
25362   arg1 = (X509_NAME *)(argp1);
25363   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
25364   if (!SWIG_IsOK(ecode2)) {
25365     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_get_index_by_nid" "', argument " "2"" of type '" "int""'");
25366   }
25367   arg2 = (int)(val2);
25368   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
25369   if (!SWIG_IsOK(ecode3)) {
25370     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_get_index_by_nid" "', argument " "3"" of type '" "int""'");
25371   }
25372   arg3 = (int)(val3);
25373   {
25374     if (!arg1) {
25375       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25376     }
25377   }
25378   result = (int)X509_NAME_get_index_by_NID(arg1,arg2,arg3);
25379   {
25380     resultobj=PyLong_FromLong(result);
25381     if (PyErr_Occurred()) SWIG_fail;
25382   }
25383   return resultobj;
25384 fail:
25385   return NULL;
25386 }
25387 
25388 
_wrap_x509_name_entry_new(PyObject * self,PyObject * args)25389 SWIGINTERN PyObject *_wrap_x509_name_entry_new(PyObject *self, PyObject *args) {
25390   PyObject *resultobj = 0;
25391   X509_NAME_ENTRY *result = 0 ;
25392 
25393   if (!SWIG_Python_UnpackTuple(args, "x509_name_entry_new", 0, 0, 0)) SWIG_fail;
25394   result = (X509_NAME_ENTRY *)X509_NAME_ENTRY_new();
25395   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
25396   return resultobj;
25397 fail:
25398   return NULL;
25399 }
25400 
25401 
_wrap_x509_name_entry_free(PyObject * self,PyObject * args)25402 SWIGINTERN PyObject *_wrap_x509_name_entry_free(PyObject *self, PyObject *args) {
25403   PyObject *resultobj = 0;
25404   X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ;
25405   void *argp1 = 0 ;
25406   int res1 = 0 ;
25407   PyObject *swig_obj[1] ;
25408 
25409   if (!args) SWIG_fail;
25410   swig_obj[0] = args;
25411   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
25412   if (!SWIG_IsOK(res1)) {
25413     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_free" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'");
25414   }
25415   arg1 = (X509_NAME_ENTRY *)(argp1);
25416   {
25417     if (!arg1) {
25418       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25419     }
25420   }
25421   X509_NAME_ENTRY_free(arg1);
25422   resultobj = SWIG_Py_Void();
25423   return resultobj;
25424 fail:
25425   return NULL;
25426 }
25427 
25428 
_wrap_x509_name_entry_create_by_nid(PyObject * self,PyObject * args)25429 SWIGINTERN PyObject *_wrap_x509_name_entry_create_by_nid(PyObject *self, PyObject *args) {
25430   PyObject *resultobj = 0;
25431   X509_NAME_ENTRY **arg1 = (X509_NAME_ENTRY **) 0 ;
25432   int arg2 ;
25433   int arg3 ;
25434   unsigned char *arg4 = (unsigned char *) 0 ;
25435   int arg5 ;
25436   void *argp1 = 0 ;
25437   int res1 = 0 ;
25438   int val2 ;
25439   int ecode2 = 0 ;
25440   int val3 ;
25441   int ecode3 = 0 ;
25442   void *argp4 = 0 ;
25443   int res4 = 0 ;
25444   int val5 ;
25445   int ecode5 = 0 ;
25446   PyObject *swig_obj[5] ;
25447   X509_NAME_ENTRY *result = 0 ;
25448 
25449   if (!SWIG_Python_UnpackTuple(args, "x509_name_entry_create_by_nid", 5, 5, swig_obj)) SWIG_fail;
25450   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_X509_NAME_ENTRY, 0 |  0 );
25451   if (!SWIG_IsOK(res1)) {
25452     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_create_by_nid" "', argument " "1"" of type '" "X509_NAME_ENTRY **""'");
25453   }
25454   arg1 = (X509_NAME_ENTRY **)(argp1);
25455   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
25456   if (!SWIG_IsOK(ecode2)) {
25457     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_entry_create_by_nid" "', argument " "2"" of type '" "int""'");
25458   }
25459   arg2 = (int)(val2);
25460   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
25461   if (!SWIG_IsOK(ecode3)) {
25462     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_entry_create_by_nid" "', argument " "3"" of type '" "int""'");
25463   }
25464   arg3 = (int)(val3);
25465   res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_unsigned_char, 0 |  0 );
25466   if (!SWIG_IsOK(res4)) {
25467     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_entry_create_by_nid" "', argument " "4"" of type '" "unsigned char *""'");
25468   }
25469   arg4 = (unsigned char *)(argp4);
25470   ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
25471   if (!SWIG_IsOK(ecode5)) {
25472     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "x509_name_entry_create_by_nid" "', argument " "5"" of type '" "int""'");
25473   }
25474   arg5 = (int)(val5);
25475   result = (X509_NAME_ENTRY *)X509_NAME_ENTRY_create_by_NID(arg1,arg2,arg3,arg4,arg5);
25476   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
25477   return resultobj;
25478 fail:
25479   return NULL;
25480 }
25481 
25482 
_wrap_x509_name_entry_set_object(PyObject * self,PyObject * args)25483 SWIGINTERN PyObject *_wrap_x509_name_entry_set_object(PyObject *self, PyObject *args) {
25484   PyObject *resultobj = 0;
25485   X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ;
25486   ASN1_OBJECT *arg2 = (ASN1_OBJECT *) 0 ;
25487   void *argp1 = 0 ;
25488   int res1 = 0 ;
25489   void *argp2 = 0 ;
25490   int res2 = 0 ;
25491   PyObject *swig_obj[2] ;
25492   int result;
25493 
25494   if (!SWIG_Python_UnpackTuple(args, "x509_name_entry_set_object", 2, 2, swig_obj)) SWIG_fail;
25495   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
25496   if (!SWIG_IsOK(res1)) {
25497     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_set_object" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'");
25498   }
25499   arg1 = (X509_NAME_ENTRY *)(argp1);
25500   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
25501   if (!SWIG_IsOK(res2)) {
25502     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_entry_set_object" "', argument " "2"" of type '" "ASN1_OBJECT *""'");
25503   }
25504   arg2 = (ASN1_OBJECT *)(argp2);
25505   {
25506     if (!arg1) {
25507       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25508     }
25509   }
25510   result = (int)X509_NAME_ENTRY_set_object(arg1,arg2);
25511   {
25512     resultobj=PyLong_FromLong(result);
25513     if (PyErr_Occurred()) SWIG_fail;
25514   }
25515   return resultobj;
25516 fail:
25517   return NULL;
25518 }
25519 
25520 
_wrap_x509_name_entry_get_object(PyObject * self,PyObject * args)25521 SWIGINTERN PyObject *_wrap_x509_name_entry_get_object(PyObject *self, PyObject *args) {
25522   PyObject *resultobj = 0;
25523   X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ;
25524   void *argp1 = 0 ;
25525   int res1 = 0 ;
25526   PyObject *swig_obj[1] ;
25527   ASN1_OBJECT *result = 0 ;
25528 
25529   if (!args) SWIG_fail;
25530   swig_obj[0] = args;
25531   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
25532   if (!SWIG_IsOK(res1)) {
25533     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_get_object" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'");
25534   }
25535   arg1 = (X509_NAME_ENTRY *)(argp1);
25536   {
25537     if (!arg1) {
25538       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25539     }
25540   }
25541   result = (ASN1_OBJECT *)X509_NAME_ENTRY_get_object(arg1);
25542   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
25543   return resultobj;
25544 fail:
25545   return NULL;
25546 }
25547 
25548 
_wrap_x509_name_entry_get_data(PyObject * self,PyObject * args)25549 SWIGINTERN PyObject *_wrap_x509_name_entry_get_data(PyObject *self, PyObject *args) {
25550   PyObject *resultobj = 0;
25551   X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ;
25552   void *argp1 = 0 ;
25553   int res1 = 0 ;
25554   PyObject *swig_obj[1] ;
25555   ASN1_STRING *result = 0 ;
25556 
25557   if (!args) SWIG_fail;
25558   swig_obj[0] = args;
25559   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
25560   if (!SWIG_IsOK(res1)) {
25561     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_get_data" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'");
25562   }
25563   arg1 = (X509_NAME_ENTRY *)(argp1);
25564   {
25565     if (!arg1) {
25566       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25567     }
25568   }
25569   result = (ASN1_STRING *)X509_NAME_ENTRY_get_data(arg1);
25570   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_STRING, 0 |  0 );
25571   return resultobj;
25572 fail:
25573   return NULL;
25574 }
25575 
25576 
_wrap_x509_name_entry_set_data(PyObject * self,PyObject * args)25577 SWIGINTERN PyObject *_wrap_x509_name_entry_set_data(PyObject *self, PyObject *args) {
25578   PyObject *resultobj = 0;
25579   X509_NAME_ENTRY *arg1 = (X509_NAME_ENTRY *) 0 ;
25580   int arg2 ;
25581   unsigned char *arg3 = (unsigned char *) 0 ;
25582   int arg4 ;
25583   void *argp1 = 0 ;
25584   int res1 = 0 ;
25585   int val2 ;
25586   int ecode2 = 0 ;
25587   PyObject *swig_obj[3] ;
25588   int result;
25589 
25590   if (!SWIG_Python_UnpackTuple(args, "x509_name_entry_set_data", 3, 3, swig_obj)) SWIG_fail;
25591   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
25592   if (!SWIG_IsOK(res1)) {
25593     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_set_data" "', argument " "1"" of type '" "X509_NAME_ENTRY *""'");
25594   }
25595   arg1 = (X509_NAME_ENTRY *)(argp1);
25596   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
25597   if (!SWIG_IsOK(ecode2)) {
25598     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_entry_set_data" "', argument " "2"" of type '" "int""'");
25599   }
25600   arg2 = (int)(val2);
25601   {
25602     if (PyString_Check(swig_obj[2])) {
25603       Py_ssize_t len;
25604 
25605       arg3 = (unsigned char *)PyString_AsString(swig_obj[2]);
25606       len = PyString_Size(swig_obj[2]);
25607 
25608 
25609       if (len > INT_MAX) {
25610         PyErr_SetString(_x509_err, "object too large");
25611         return NULL;
25612       }
25613       arg4 = len;
25614     } else {
25615       PyErr_SetString(PyExc_TypeError, "expected string");
25616       return NULL;
25617     }
25618   }
25619   {
25620     if (!arg1) {
25621       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25622     }
25623   }
25624   result = (int)X509_NAME_ENTRY_set_data(arg1,arg2,(unsigned char const *)arg3,arg4);
25625   {
25626     resultobj=PyLong_FromLong(result);
25627     if (PyErr_Occurred()) SWIG_fail;
25628   }
25629   return resultobj;
25630 fail:
25631   return NULL;
25632 }
25633 
25634 
_wrap_x509_req_new(PyObject * self,PyObject * args)25635 SWIGINTERN PyObject *_wrap_x509_req_new(PyObject *self, PyObject *args) {
25636   PyObject *resultobj = 0;
25637   X509_REQ *result = 0 ;
25638 
25639   if (!SWIG_Python_UnpackTuple(args, "x509_req_new", 0, 0, 0)) SWIG_fail;
25640   result = (X509_REQ *)X509_REQ_new();
25641   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_REQ, 0 |  0 );
25642   return resultobj;
25643 fail:
25644   return NULL;
25645 }
25646 
25647 
_wrap_x509_req_free(PyObject * self,PyObject * args)25648 SWIGINTERN PyObject *_wrap_x509_req_free(PyObject *self, PyObject *args) {
25649   PyObject *resultobj = 0;
25650   X509_REQ *arg1 = (X509_REQ *) 0 ;
25651   void *argp1 = 0 ;
25652   int res1 = 0 ;
25653   PyObject *swig_obj[1] ;
25654 
25655   if (!args) SWIG_fail;
25656   swig_obj[0] = args;
25657   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 |  0 );
25658   if (!SWIG_IsOK(res1)) {
25659     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_free" "', argument " "1"" of type '" "X509_REQ *""'");
25660   }
25661   arg1 = (X509_REQ *)(argp1);
25662   {
25663     if (!arg1) {
25664       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25665     }
25666   }
25667   X509_REQ_free(arg1);
25668   resultobj = SWIG_Py_Void();
25669   return resultobj;
25670 fail:
25671   return NULL;
25672 }
25673 
25674 
_wrap_x509_req_print(PyObject * self,PyObject * args)25675 SWIGINTERN PyObject *_wrap_x509_req_print(PyObject *self, PyObject *args) {
25676   PyObject *resultobj = 0;
25677   BIO *arg1 = (BIO *) 0 ;
25678   X509_REQ *arg2 = (X509_REQ *) 0 ;
25679   void *argp1 = 0 ;
25680   int res1 = 0 ;
25681   void *argp2 = 0 ;
25682   int res2 = 0 ;
25683   PyObject *swig_obj[2] ;
25684   int result;
25685 
25686   if (!SWIG_Python_UnpackTuple(args, "x509_req_print", 2, 2, swig_obj)) SWIG_fail;
25687   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
25688   if (!SWIG_IsOK(res1)) {
25689     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_print" "', argument " "1"" of type '" "BIO *""'");
25690   }
25691   arg1 = (BIO *)(argp1);
25692   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_REQ, 0 |  0 );
25693   if (!SWIG_IsOK(res2)) {
25694     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_print" "', argument " "2"" of type '" "X509_REQ *""'");
25695   }
25696   arg2 = (X509_REQ *)(argp2);
25697   {
25698     if (!arg1) {
25699       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25700     }
25701   }
25702   {
25703     if (!arg2) {
25704       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25705     }
25706   }
25707   {
25708     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25709     result = (int)X509_REQ_print(arg1,arg2);
25710     SWIG_PYTHON_THREAD_END_ALLOW;
25711   }
25712   {
25713     resultobj=PyLong_FromLong(result);
25714     if (PyErr_Occurred()) SWIG_fail;
25715   }
25716   return resultobj;
25717 fail:
25718   return NULL;
25719 }
25720 
25721 
_wrap_x509_req_get_pubkey(PyObject * self,PyObject * args)25722 SWIGINTERN PyObject *_wrap_x509_req_get_pubkey(PyObject *self, PyObject *args) {
25723   PyObject *resultobj = 0;
25724   X509_REQ *arg1 = (X509_REQ *) 0 ;
25725   void *argp1 = 0 ;
25726   int res1 = 0 ;
25727   PyObject *swig_obj[1] ;
25728   EVP_PKEY *result = 0 ;
25729 
25730   if (!args) SWIG_fail;
25731   swig_obj[0] = args;
25732   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 |  0 );
25733   if (!SWIG_IsOK(res1)) {
25734     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_get_pubkey" "', argument " "1"" of type '" "X509_REQ *""'");
25735   }
25736   arg1 = (X509_REQ *)(argp1);
25737   {
25738     if (!arg1) {
25739       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25740     }
25741   }
25742   result = (EVP_PKEY *)X509_REQ_get_pubkey(arg1);
25743   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_PKEY, 0 |  0 );
25744   return resultobj;
25745 fail:
25746   return NULL;
25747 }
25748 
25749 
_wrap_x509_req_set_pubkey(PyObject * self,PyObject * args)25750 SWIGINTERN PyObject *_wrap_x509_req_set_pubkey(PyObject *self, PyObject *args) {
25751   PyObject *resultobj = 0;
25752   X509_REQ *arg1 = (X509_REQ *) 0 ;
25753   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
25754   void *argp1 = 0 ;
25755   int res1 = 0 ;
25756   void *argp2 = 0 ;
25757   int res2 = 0 ;
25758   PyObject *swig_obj[2] ;
25759   int result;
25760 
25761   if (!SWIG_Python_UnpackTuple(args, "x509_req_set_pubkey", 2, 2, swig_obj)) SWIG_fail;
25762   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 |  0 );
25763   if (!SWIG_IsOK(res1)) {
25764     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_set_pubkey" "', argument " "1"" of type '" "X509_REQ *""'");
25765   }
25766   arg1 = (X509_REQ *)(argp1);
25767   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
25768   if (!SWIG_IsOK(res2)) {
25769     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_set_pubkey" "', argument " "2"" of type '" "EVP_PKEY *""'");
25770   }
25771   arg2 = (EVP_PKEY *)(argp2);
25772   {
25773     if (!arg1) {
25774       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25775     }
25776   }
25777   {
25778     if (!arg2) {
25779       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25780     }
25781   }
25782   result = (int)X509_REQ_set_pubkey(arg1,arg2);
25783   {
25784     resultobj=PyLong_FromLong(result);
25785     if (PyErr_Occurred()) SWIG_fail;
25786   }
25787   return resultobj;
25788 fail:
25789   return NULL;
25790 }
25791 
25792 
_wrap_x509_req_set_subject_name(PyObject * self,PyObject * args)25793 SWIGINTERN PyObject *_wrap_x509_req_set_subject_name(PyObject *self, PyObject *args) {
25794   PyObject *resultobj = 0;
25795   X509_REQ *arg1 = (X509_REQ *) 0 ;
25796   X509_NAME *arg2 = (X509_NAME *) 0 ;
25797   void *argp1 = 0 ;
25798   int res1 = 0 ;
25799   void *argp2 = 0 ;
25800   int res2 = 0 ;
25801   PyObject *swig_obj[2] ;
25802   int result;
25803 
25804   if (!SWIG_Python_UnpackTuple(args, "x509_req_set_subject_name", 2, 2, swig_obj)) SWIG_fail;
25805   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 |  0 );
25806   if (!SWIG_IsOK(res1)) {
25807     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_set_subject_name" "', argument " "1"" of type '" "X509_REQ *""'");
25808   }
25809   arg1 = (X509_REQ *)(argp1);
25810   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_NAME, 0 |  0 );
25811   if (!SWIG_IsOK(res2)) {
25812     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_set_subject_name" "', argument " "2"" of type '" "X509_NAME *""'");
25813   }
25814   arg2 = (X509_NAME *)(argp2);
25815   {
25816     if (!arg1) {
25817       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25818     }
25819   }
25820   {
25821     if (!arg2) {
25822       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25823     }
25824   }
25825   result = (int)X509_REQ_set_subject_name(arg1,arg2);
25826   {
25827     resultobj=PyLong_FromLong(result);
25828     if (PyErr_Occurred()) SWIG_fail;
25829   }
25830   return resultobj;
25831 fail:
25832   return NULL;
25833 }
25834 
25835 
_wrap_x509_req_verify(PyObject * self,PyObject * args)25836 SWIGINTERN PyObject *_wrap_x509_req_verify(PyObject *self, PyObject *args) {
25837   PyObject *resultobj = 0;
25838   X509_REQ *arg1 = (X509_REQ *) 0 ;
25839   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
25840   void *argp1 = 0 ;
25841   int res1 = 0 ;
25842   void *argp2 = 0 ;
25843   int res2 = 0 ;
25844   PyObject *swig_obj[2] ;
25845   int result;
25846 
25847   if (!SWIG_Python_UnpackTuple(args, "x509_req_verify", 2, 2, swig_obj)) SWIG_fail;
25848   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 |  0 );
25849   if (!SWIG_IsOK(res1)) {
25850     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_verify" "', argument " "1"" of type '" "X509_REQ *""'");
25851   }
25852   arg1 = (X509_REQ *)(argp1);
25853   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
25854   if (!SWIG_IsOK(res2)) {
25855     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_verify" "', argument " "2"" of type '" "EVP_PKEY *""'");
25856   }
25857   arg2 = (EVP_PKEY *)(argp2);
25858   {
25859     if (!arg1) {
25860       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25861     }
25862   }
25863   {
25864     if (!arg2) {
25865       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25866     }
25867   }
25868   result = (int)X509_REQ_verify(arg1,arg2);
25869   {
25870     resultobj=PyLong_FromLong(result);
25871     if (PyErr_Occurred()) SWIG_fail;
25872   }
25873   return resultobj;
25874 fail:
25875   return NULL;
25876 }
25877 
25878 
_wrap_x509_req_sign(PyObject * self,PyObject * args)25879 SWIGINTERN PyObject *_wrap_x509_req_sign(PyObject *self, PyObject *args) {
25880   PyObject *resultobj = 0;
25881   X509_REQ *arg1 = (X509_REQ *) 0 ;
25882   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
25883   EVP_MD *arg3 = (EVP_MD *) 0 ;
25884   void *argp1 = 0 ;
25885   int res1 = 0 ;
25886   void *argp2 = 0 ;
25887   int res2 = 0 ;
25888   void *argp3 = 0 ;
25889   int res3 = 0 ;
25890   PyObject *swig_obj[3] ;
25891   int result;
25892 
25893   if (!SWIG_Python_UnpackTuple(args, "x509_req_sign", 3, 3, swig_obj)) SWIG_fail;
25894   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 |  0 );
25895   if (!SWIG_IsOK(res1)) {
25896     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_sign" "', argument " "1"" of type '" "X509_REQ *""'");
25897   }
25898   arg1 = (X509_REQ *)(argp1);
25899   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
25900   if (!SWIG_IsOK(res2)) {
25901     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_sign" "', argument " "2"" of type '" "EVP_PKEY *""'");
25902   }
25903   arg2 = (EVP_PKEY *)(argp2);
25904   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_MD, 0 |  0 );
25905   if (!SWIG_IsOK(res3)) {
25906     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "x509_req_sign" "', argument " "3"" of type '" "EVP_MD const *""'");
25907   }
25908   arg3 = (EVP_MD *)(argp3);
25909   {
25910     if (!arg1) {
25911       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25912     }
25913   }
25914   {
25915     if (!arg2) {
25916       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25917     }
25918   }
25919   {
25920     if (!arg3) {
25921       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25922     }
25923   }
25924   result = (int)X509_REQ_sign(arg1,arg2,(EVP_MD const *)arg3);
25925   {
25926     resultobj=PyLong_FromLong(result);
25927     if (PyErr_Occurred()) SWIG_fail;
25928   }
25929   return resultobj;
25930 fail:
25931   return NULL;
25932 }
25933 
25934 
_wrap_i2d_x509_bio(PyObject * self,PyObject * args)25935 SWIGINTERN PyObject *_wrap_i2d_x509_bio(PyObject *self, PyObject *args) {
25936   PyObject *resultobj = 0;
25937   BIO *arg1 = (BIO *) 0 ;
25938   X509 *arg2 = (X509 *) 0 ;
25939   void *argp1 = 0 ;
25940   int res1 = 0 ;
25941   void *argp2 = 0 ;
25942   int res2 = 0 ;
25943   PyObject *swig_obj[2] ;
25944   int result;
25945 
25946   if (!SWIG_Python_UnpackTuple(args, "i2d_x509_bio", 2, 2, swig_obj)) SWIG_fail;
25947   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
25948   if (!SWIG_IsOK(res1)) {
25949     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_x509_bio" "', argument " "1"" of type '" "BIO *""'");
25950   }
25951   arg1 = (BIO *)(argp1);
25952   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 |  0 );
25953   if (!SWIG_IsOK(res2)) {
25954     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "i2d_x509_bio" "', argument " "2"" of type '" "X509 *""'");
25955   }
25956   arg2 = (X509 *)(argp2);
25957   {
25958     if (!arg1) {
25959       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25960     }
25961   }
25962   {
25963     if (!arg2) {
25964       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
25965     }
25966   }
25967   {
25968     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
25969     result = (int)i2d_X509_bio(arg1,arg2);
25970     SWIG_PYTHON_THREAD_END_ALLOW;
25971   }
25972   {
25973     resultobj=PyLong_FromLong(result);
25974     if (PyErr_Occurred()) SWIG_fail;
25975   }
25976   return resultobj;
25977 fail:
25978   return NULL;
25979 }
25980 
25981 
_wrap_i2d_x509_req_bio(PyObject * self,PyObject * args)25982 SWIGINTERN PyObject *_wrap_i2d_x509_req_bio(PyObject *self, PyObject *args) {
25983   PyObject *resultobj = 0;
25984   BIO *arg1 = (BIO *) 0 ;
25985   X509_REQ *arg2 = (X509_REQ *) 0 ;
25986   void *argp1 = 0 ;
25987   int res1 = 0 ;
25988   void *argp2 = 0 ;
25989   int res2 = 0 ;
25990   PyObject *swig_obj[2] ;
25991   int result;
25992 
25993   if (!SWIG_Python_UnpackTuple(args, "i2d_x509_req_bio", 2, 2, swig_obj)) SWIG_fail;
25994   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
25995   if (!SWIG_IsOK(res1)) {
25996     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_x509_req_bio" "', argument " "1"" of type '" "BIO *""'");
25997   }
25998   arg1 = (BIO *)(argp1);
25999   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_REQ, 0 |  0 );
26000   if (!SWIG_IsOK(res2)) {
26001     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "i2d_x509_req_bio" "', argument " "2"" of type '" "X509_REQ *""'");
26002   }
26003   arg2 = (X509_REQ *)(argp2);
26004   {
26005     if (!arg1) {
26006       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26007     }
26008   }
26009   {
26010     if (!arg2) {
26011       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26012     }
26013   }
26014   {
26015     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26016     result = (int)i2d_X509_REQ_bio(arg1,arg2);
26017     SWIG_PYTHON_THREAD_END_ALLOW;
26018   }
26019   {
26020     resultobj=PyLong_FromLong(result);
26021     if (PyErr_Occurred()) SWIG_fail;
26022   }
26023   return resultobj;
26024 fail:
26025   return NULL;
26026 }
26027 
26028 
_wrap_x509_store_new(PyObject * self,PyObject * args)26029 SWIGINTERN PyObject *_wrap_x509_store_new(PyObject *self, PyObject *args) {
26030   PyObject *resultobj = 0;
26031   X509_STORE *result = 0 ;
26032 
26033   if (!SWIG_Python_UnpackTuple(args, "x509_store_new", 0, 0, 0)) SWIG_fail;
26034   result = (X509_STORE *)X509_STORE_new();
26035   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_STORE, 0 |  0 );
26036   return resultobj;
26037 fail:
26038   return NULL;
26039 }
26040 
26041 
_wrap_x509_store_free(PyObject * self,PyObject * args)26042 SWIGINTERN PyObject *_wrap_x509_store_free(PyObject *self, PyObject *args) {
26043   PyObject *resultobj = 0;
26044   X509_STORE *arg1 = (X509_STORE *) 0 ;
26045   void *argp1 = 0 ;
26046   int res1 = 0 ;
26047   PyObject *swig_obj[1] ;
26048 
26049   if (!args) SWIG_fail;
26050   swig_obj[0] = args;
26051   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 0 |  0 );
26052   if (!SWIG_IsOK(res1)) {
26053     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_free" "', argument " "1"" of type '" "X509_STORE *""'");
26054   }
26055   arg1 = (X509_STORE *)(argp1);
26056   X509_STORE_free(arg1);
26057   resultobj = SWIG_Py_Void();
26058   return resultobj;
26059 fail:
26060   return NULL;
26061 }
26062 
26063 
_wrap_x509_store_add_cert(PyObject * self,PyObject * args)26064 SWIGINTERN PyObject *_wrap_x509_store_add_cert(PyObject *self, PyObject *args) {
26065   PyObject *resultobj = 0;
26066   X509_STORE *arg1 = (X509_STORE *) 0 ;
26067   X509 *arg2 = (X509 *) 0 ;
26068   void *argp1 = 0 ;
26069   int res1 = 0 ;
26070   void *argp2 = 0 ;
26071   int res2 = 0 ;
26072   PyObject *swig_obj[2] ;
26073   int result;
26074 
26075   if (!SWIG_Python_UnpackTuple(args, "x509_store_add_cert", 2, 2, swig_obj)) SWIG_fail;
26076   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 0 |  0 );
26077   if (!SWIG_IsOK(res1)) {
26078     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_add_cert" "', argument " "1"" of type '" "X509_STORE *""'");
26079   }
26080   arg1 = (X509_STORE *)(argp1);
26081   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 |  0 );
26082   if (!SWIG_IsOK(res2)) {
26083     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_store_add_cert" "', argument " "2"" of type '" "X509 *""'");
26084   }
26085   arg2 = (X509 *)(argp2);
26086   {
26087     if (!arg2) {
26088       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26089     }
26090   }
26091   result = (int)X509_STORE_add_cert(arg1,arg2);
26092   {
26093     resultobj=PyLong_FromLong(result);
26094     if (PyErr_Occurred()) SWIG_fail;
26095   }
26096   return resultobj;
26097 fail:
26098   return NULL;
26099 }
26100 
26101 
_wrap_x509_store_set_verify_cb__SWIG_0(PyObject * self,Py_ssize_t nobjs,PyObject ** swig_obj)26102 SWIGINTERN PyObject *_wrap_x509_store_set_verify_cb__SWIG_0(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
26103   PyObject *resultobj = 0;
26104   X509_STORE *arg1 = (X509_STORE *) 0 ;
26105   int (*arg2)(int,X509_STORE_CTX *) = (int (*)(int,X509_STORE_CTX *)) 0 ;
26106   void *argp1 = 0 ;
26107   int res1 = 0 ;
26108 
26109   if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
26110   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 0 |  0 );
26111   if (!SWIG_IsOK(res1)) {
26112     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_set_verify_cb" "', argument " "1"" of type '" "X509_STORE *""'");
26113   }
26114   arg1 = (X509_STORE *)(argp1);
26115   {
26116     int res = SWIG_ConvertFunctionPtr(swig_obj[1], (void**)(&arg2), SWIGTYPE_p_f_int_p_X509_STORE_CTX__int);
26117     if (!SWIG_IsOK(res)) {
26118       SWIG_exception_fail(SWIG_ArgError(res), "in method '" "x509_store_set_verify_cb" "', argument " "2"" of type '" "int (*)(int,X509_STORE_CTX *)""'");
26119     }
26120   }
26121   X509_STORE_set_verify_cb(arg1,arg2);
26122   resultobj = SWIG_Py_Void();
26123   return resultobj;
26124 fail:
26125   return NULL;
26126 }
26127 
26128 
_wrap_x509_store_ctx_get_current_cert(PyObject * self,PyObject * args)26129 SWIGINTERN PyObject *_wrap_x509_store_ctx_get_current_cert(PyObject *self, PyObject *args) {
26130   PyObject *resultobj = 0;
26131   X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ;
26132   void *argp1 = 0 ;
26133   int res1 = 0 ;
26134   PyObject *swig_obj[1] ;
26135   X509 *result = 0 ;
26136 
26137   if (!args) SWIG_fail;
26138   swig_obj[0] = args;
26139   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 |  0 );
26140   if (!SWIG_IsOK(res1)) {
26141     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_current_cert" "', argument " "1"" of type '" "X509_STORE_CTX *""'");
26142   }
26143   arg1 = (X509_STORE_CTX *)(argp1);
26144   result = (X509 *)X509_STORE_CTX_get_current_cert(arg1);
26145   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 |  0 );
26146   return resultobj;
26147 fail:
26148   return NULL;
26149 }
26150 
26151 
_wrap_x509_store_ctx_get_error(PyObject * self,PyObject * args)26152 SWIGINTERN PyObject *_wrap_x509_store_ctx_get_error(PyObject *self, PyObject *args) {
26153   PyObject *resultobj = 0;
26154   X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ;
26155   void *argp1 = 0 ;
26156   int res1 = 0 ;
26157   PyObject *swig_obj[1] ;
26158   int result;
26159 
26160   if (!args) SWIG_fail;
26161   swig_obj[0] = args;
26162   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 |  0 );
26163   if (!SWIG_IsOK(res1)) {
26164     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_error" "', argument " "1"" of type '" "X509_STORE_CTX *""'");
26165   }
26166   arg1 = (X509_STORE_CTX *)(argp1);
26167   result = (int)X509_STORE_CTX_get_error(arg1);
26168   {
26169     resultobj=PyLong_FromLong(result);
26170     if (PyErr_Occurred()) SWIG_fail;
26171   }
26172   return resultobj;
26173 fail:
26174   return NULL;
26175 }
26176 
26177 
_wrap_x509_store_ctx_get_error_depth(PyObject * self,PyObject * args)26178 SWIGINTERN PyObject *_wrap_x509_store_ctx_get_error_depth(PyObject *self, PyObject *args) {
26179   PyObject *resultobj = 0;
26180   X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ;
26181   void *argp1 = 0 ;
26182   int res1 = 0 ;
26183   PyObject *swig_obj[1] ;
26184   int result;
26185 
26186   if (!args) SWIG_fail;
26187   swig_obj[0] = args;
26188   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 |  0 );
26189   if (!SWIG_IsOK(res1)) {
26190     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_error_depth" "', argument " "1"" of type '" "X509_STORE_CTX *""'");
26191   }
26192   arg1 = (X509_STORE_CTX *)(argp1);
26193   result = (int)X509_STORE_CTX_get_error_depth(arg1);
26194   {
26195     resultobj=PyLong_FromLong(result);
26196     if (PyErr_Occurred()) SWIG_fail;
26197   }
26198   return resultobj;
26199 fail:
26200   return NULL;
26201 }
26202 
26203 
_wrap_x509_store_ctx_free(PyObject * self,PyObject * args)26204 SWIGINTERN PyObject *_wrap_x509_store_ctx_free(PyObject *self, PyObject *args) {
26205   PyObject *resultobj = 0;
26206   X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ;
26207   void *argp1 = 0 ;
26208   int res1 = 0 ;
26209   PyObject *swig_obj[1] ;
26210 
26211   if (!args) SWIG_fail;
26212   swig_obj[0] = args;
26213   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 |  0 );
26214   if (!SWIG_IsOK(res1)) {
26215     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_free" "', argument " "1"" of type '" "X509_STORE_CTX *""'");
26216   }
26217   arg1 = (X509_STORE_CTX *)(argp1);
26218   X509_STORE_CTX_free(arg1);
26219   resultobj = SWIG_Py_Void();
26220   return resultobj;
26221 fail:
26222   return NULL;
26223 }
26224 
26225 
_wrap_x509_store_ctx_get1_chain(PyObject * self,PyObject * args)26226 SWIGINTERN PyObject *_wrap_x509_store_ctx_get1_chain(PyObject *self, PyObject *args) {
26227   PyObject *resultobj = 0;
26228   X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ;
26229   void *argp1 = 0 ;
26230   int res1 = 0 ;
26231   PyObject *swig_obj[1] ;
26232   struct stack_st_X509 *result = 0 ;
26233 
26234   if (!args) SWIG_fail;
26235   swig_obj[0] = args;
26236   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 |  0 );
26237   if (!SWIG_IsOK(res1)) {
26238     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get1_chain" "', argument " "1"" of type '" "X509_STORE_CTX *""'");
26239   }
26240   arg1 = (X509_STORE_CTX *)(argp1);
26241   result = (struct stack_st_X509 *)X509_STORE_CTX_get1_chain(arg1);
26242   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_X509, 0 |  0 );
26243   return resultobj;
26244 fail:
26245   return NULL;
26246 }
26247 
26248 
_wrap_x509_extension_get_critical(PyObject * self,PyObject * args)26249 SWIGINTERN PyObject *_wrap_x509_extension_get_critical(PyObject *self, PyObject *args) {
26250   PyObject *resultobj = 0;
26251   X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ;
26252   void *argp1 = 0 ;
26253   int res1 = 0 ;
26254   PyObject *swig_obj[1] ;
26255   int result;
26256 
26257   if (!args) SWIG_fail;
26258   swig_obj[0] = args;
26259   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_EXTENSION, 0 |  0 );
26260   if (!SWIG_IsOK(res1)) {
26261     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_get_critical" "', argument " "1"" of type '" "X509_EXTENSION *""'");
26262   }
26263   arg1 = (X509_EXTENSION *)(argp1);
26264   result = (int)X509_EXTENSION_get_critical(arg1);
26265   {
26266     resultobj=PyLong_FromLong(result);
26267     if (PyErr_Occurred()) SWIG_fail;
26268   }
26269   return resultobj;
26270 fail:
26271   return NULL;
26272 }
26273 
26274 
_wrap_x509_extension_set_critical(PyObject * self,PyObject * args)26275 SWIGINTERN PyObject *_wrap_x509_extension_set_critical(PyObject *self, PyObject *args) {
26276   PyObject *resultobj = 0;
26277   X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ;
26278   int arg2 ;
26279   void *argp1 = 0 ;
26280   int res1 = 0 ;
26281   int val2 ;
26282   int ecode2 = 0 ;
26283   PyObject *swig_obj[2] ;
26284   int result;
26285 
26286   if (!SWIG_Python_UnpackTuple(args, "x509_extension_set_critical", 2, 2, swig_obj)) SWIG_fail;
26287   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_EXTENSION, 0 |  0 );
26288   if (!SWIG_IsOK(res1)) {
26289     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_set_critical" "', argument " "1"" of type '" "X509_EXTENSION *""'");
26290   }
26291   arg1 = (X509_EXTENSION *)(argp1);
26292   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
26293   if (!SWIG_IsOK(ecode2)) {
26294     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_extension_set_critical" "', argument " "2"" of type '" "int""'");
26295   }
26296   arg2 = (int)(val2);
26297   result = (int)X509_EXTENSION_set_critical(arg1,arg2);
26298   {
26299     resultobj=PyLong_FromLong(result);
26300     if (PyErr_Occurred()) SWIG_fail;
26301   }
26302   return resultobj;
26303 fail:
26304   return NULL;
26305 }
26306 
26307 
_wrap_x509_store_set_flags(PyObject * self,PyObject * args)26308 SWIGINTERN PyObject *_wrap_x509_store_set_flags(PyObject *self, PyObject *args) {
26309   PyObject *resultobj = 0;
26310   X509_STORE *arg1 = (X509_STORE *) 0 ;
26311   unsigned long arg2 ;
26312   void *argp1 = 0 ;
26313   int res1 = 0 ;
26314   unsigned long val2 ;
26315   int ecode2 = 0 ;
26316   PyObject *swig_obj[2] ;
26317   int result;
26318 
26319   if (!SWIG_Python_UnpackTuple(args, "x509_store_set_flags", 2, 2, swig_obj)) SWIG_fail;
26320   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 0 |  0 );
26321   if (!SWIG_IsOK(res1)) {
26322     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_set_flags" "', argument " "1"" of type '" "X509_STORE *""'");
26323   }
26324   arg1 = (X509_STORE *)(argp1);
26325   ecode2 = SWIG_AsVal_unsigned_SS_long(swig_obj[1], &val2);
26326   if (!SWIG_IsOK(ecode2)) {
26327     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_store_set_flags" "', argument " "2"" of type '" "unsigned long""'");
26328   }
26329   arg2 = (unsigned long)(val2);
26330   result = (int)X509_STORE_set_flags(arg1,arg2);
26331   {
26332     resultobj=PyLong_FromLong(result);
26333     if (PyErr_Occurred()) SWIG_fail;
26334   }
26335   return resultobj;
26336 fail:
26337   return NULL;
26338 }
26339 
26340 
_wrap_x509_read_pem(PyObject * self,PyObject * args)26341 SWIGINTERN PyObject *_wrap_x509_read_pem(PyObject *self, PyObject *args) {
26342   PyObject *resultobj = 0;
26343   BIO *arg1 = (BIO *) 0 ;
26344   void *argp1 = 0 ;
26345   int res1 = 0 ;
26346   PyObject *swig_obj[1] ;
26347   X509 *result = 0 ;
26348 
26349   if (!args) SWIG_fail;
26350   swig_obj[0] = args;
26351   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
26352   if (!SWIG_IsOK(res1)) {
26353     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_read_pem" "', argument " "1"" of type '" "BIO *""'");
26354   }
26355   arg1 = (BIO *)(argp1);
26356   {
26357     if (!arg1) {
26358       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26359     }
26360   }
26361   {
26362     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26363     result = (X509 *)x509_read_pem(arg1);
26364     SWIG_PYTHON_THREAD_END_ALLOW;
26365   }
26366   {
26367     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
26368 
26369     if (result != NULL)
26370     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509, 0);
26371     else {
26372       m2_PyErr_Msg(_x509_err);
26373       resultobj = NULL;
26374     }
26375   }
26376   return resultobj;
26377 fail:
26378   return NULL;
26379 }
26380 
26381 
_wrap_d2i_x509(PyObject * self,PyObject * args)26382 SWIGINTERN PyObject *_wrap_d2i_x509(PyObject *self, PyObject *args) {
26383   PyObject *resultobj = 0;
26384   BIO *arg1 = (BIO *) 0 ;
26385   void *argp1 = 0 ;
26386   int res1 = 0 ;
26387   PyObject *swig_obj[1] ;
26388   X509 *result = 0 ;
26389 
26390   if (!args) SWIG_fail;
26391   swig_obj[0] = args;
26392   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
26393   if (!SWIG_IsOK(res1)) {
26394     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "d2i_x509" "', argument " "1"" of type '" "BIO *""'");
26395   }
26396   arg1 = (BIO *)(argp1);
26397   {
26398     if (!arg1) {
26399       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26400     }
26401   }
26402   {
26403     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26404     result = (X509 *)d2i_x509(arg1);
26405     SWIG_PYTHON_THREAD_END_ALLOW;
26406   }
26407   {
26408     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
26409 
26410     if (result != NULL)
26411     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509, 0);
26412     else {
26413       m2_PyErr_Msg(_x509_err);
26414       resultobj = NULL;
26415     }
26416   }
26417   return resultobj;
26418 fail:
26419   return NULL;
26420 }
26421 
26422 
Swig_var__x509_err_set(PyObject * _val)26423 SWIGINTERN int Swig_var__x509_err_set(PyObject *_val) {
26424   {
26425     void *argp = 0;
26426     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
26427     if (!SWIG_IsOK(res)) {
26428       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_x509_err""' of type '""PyObject *""'");
26429     }
26430     _x509_err = (PyObject *)(argp);
26431   }
26432   return 0;
26433 fail:
26434   return 1;
26435 }
26436 
26437 
Swig_var__x509_err_get(void)26438 SWIGINTERN PyObject *Swig_var__x509_err_get(void) {
26439   PyObject *pyobj = 0;
26440   PyObject *self = 0;
26441 
26442   (void)self;
26443   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_x509_err), SWIGTYPE_p_PyObject,  0 );
26444   return pyobj;
26445 }
26446 
26447 
_wrap_x509_init(PyObject * self,PyObject * args)26448 SWIGINTERN PyObject *_wrap_x509_init(PyObject *self, PyObject *args) {
26449   PyObject *resultobj = 0;
26450   PyObject *arg1 = (PyObject *) 0 ;
26451   PyObject *swig_obj[1] ;
26452 
26453   if (!args) SWIG_fail;
26454   swig_obj[0] = args;
26455   {
26456     arg1=swig_obj[0];
26457   }
26458   x509_init(arg1);
26459   resultobj = SWIG_Py_Void();
26460   return resultobj;
26461 fail:
26462   return NULL;
26463 }
26464 
26465 
_wrap_d2i_x509_req(PyObject * self,PyObject * args)26466 SWIGINTERN PyObject *_wrap_d2i_x509_req(PyObject *self, PyObject *args) {
26467   PyObject *resultobj = 0;
26468   BIO *arg1 = (BIO *) 0 ;
26469   void *argp1 = 0 ;
26470   int res1 = 0 ;
26471   PyObject *swig_obj[1] ;
26472   X509_REQ *result = 0 ;
26473 
26474   if (!args) SWIG_fail;
26475   swig_obj[0] = args;
26476   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
26477   if (!SWIG_IsOK(res1)) {
26478     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "d2i_x509_req" "', argument " "1"" of type '" "BIO *""'");
26479   }
26480   arg1 = (BIO *)(argp1);
26481   {
26482     if (!arg1) {
26483       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26484     }
26485   }
26486   {
26487     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26488     result = (X509_REQ *)d2i_x509_req(arg1);
26489     SWIG_PYTHON_THREAD_END_ALLOW;
26490   }
26491   {
26492     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
26493 
26494     if (result != NULL)
26495     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509_REQ, 0);
26496     else {
26497       m2_PyErr_Msg(_x509_err);
26498       resultobj = NULL;
26499     }
26500   }
26501   return resultobj;
26502 fail:
26503   return NULL;
26504 }
26505 
26506 
_wrap_x509_req_read_pem(PyObject * self,PyObject * args)26507 SWIGINTERN PyObject *_wrap_x509_req_read_pem(PyObject *self, PyObject *args) {
26508   PyObject *resultobj = 0;
26509   BIO *arg1 = (BIO *) 0 ;
26510   void *argp1 = 0 ;
26511   int res1 = 0 ;
26512   PyObject *swig_obj[1] ;
26513   X509_REQ *result = 0 ;
26514 
26515   if (!args) SWIG_fail;
26516   swig_obj[0] = args;
26517   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
26518   if (!SWIG_IsOK(res1)) {
26519     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_read_pem" "', argument " "1"" of type '" "BIO *""'");
26520   }
26521   arg1 = (BIO *)(argp1);
26522   {
26523     if (!arg1) {
26524       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26525     }
26526   }
26527   {
26528     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26529     result = (X509_REQ *)x509_req_read_pem(arg1);
26530     SWIG_PYTHON_THREAD_END_ALLOW;
26531   }
26532   {
26533     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
26534 
26535     if (result != NULL)
26536     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509_REQ, 0);
26537     else {
26538       m2_PyErr_Msg(_x509_err);
26539       resultobj = NULL;
26540     }
26541   }
26542   return resultobj;
26543 fail:
26544   return NULL;
26545 }
26546 
26547 
_wrap_i2d_x509(PyObject * self,PyObject * args)26548 SWIGINTERN PyObject *_wrap_i2d_x509(PyObject *self, PyObject *args) {
26549   PyObject *resultobj = 0;
26550   X509 *arg1 = (X509 *) 0 ;
26551   void *argp1 = 0 ;
26552   int res1 = 0 ;
26553   PyObject *swig_obj[1] ;
26554   PyObject *result = 0 ;
26555 
26556   if (!args) SWIG_fail;
26557   swig_obj[0] = args;
26558   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
26559   if (!SWIG_IsOK(res1)) {
26560     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_x509" "', argument " "1"" of type '" "X509 *""'");
26561   }
26562   arg1 = (X509 *)(argp1);
26563   {
26564     if (!arg1) {
26565       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26566     }
26567   }
26568   result = (PyObject *)i2d_x509(arg1);
26569   {
26570     resultobj=result;
26571   }
26572   return resultobj;
26573 fail:
26574   return NULL;
26575 }
26576 
26577 
_wrap_x509_req_write_pem(PyObject * self,PyObject * args)26578 SWIGINTERN PyObject *_wrap_x509_req_write_pem(PyObject *self, PyObject *args) {
26579   PyObject *resultobj = 0;
26580   BIO *arg1 = (BIO *) 0 ;
26581   X509_REQ *arg2 = (X509_REQ *) 0 ;
26582   void *argp1 = 0 ;
26583   int res1 = 0 ;
26584   void *argp2 = 0 ;
26585   int res2 = 0 ;
26586   PyObject *swig_obj[2] ;
26587   int result;
26588 
26589   if (!SWIG_Python_UnpackTuple(args, "x509_req_write_pem", 2, 2, swig_obj)) SWIG_fail;
26590   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
26591   if (!SWIG_IsOK(res1)) {
26592     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_write_pem" "', argument " "1"" of type '" "BIO *""'");
26593   }
26594   arg1 = (BIO *)(argp1);
26595   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_REQ, 0 |  0 );
26596   if (!SWIG_IsOK(res2)) {
26597     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_write_pem" "', argument " "2"" of type '" "X509_REQ *""'");
26598   }
26599   arg2 = (X509_REQ *)(argp2);
26600   {
26601     if (!arg1) {
26602       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26603     }
26604   }
26605   {
26606     if (!arg2) {
26607       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26608     }
26609   }
26610   {
26611     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26612     result = (int)x509_req_write_pem(arg1,arg2);
26613     SWIG_PYTHON_THREAD_END_ALLOW;
26614   }
26615   {
26616     resultobj=PyLong_FromLong(result);
26617     if (PyErr_Occurred()) SWIG_fail;
26618   }
26619   return resultobj;
26620 fail:
26621   return NULL;
26622 }
26623 
26624 
_wrap_x509_crl_read_pem(PyObject * self,PyObject * args)26625 SWIGINTERN PyObject *_wrap_x509_crl_read_pem(PyObject *self, PyObject *args) {
26626   PyObject *resultobj = 0;
26627   BIO *arg1 = (BIO *) 0 ;
26628   void *argp1 = 0 ;
26629   int res1 = 0 ;
26630   PyObject *swig_obj[1] ;
26631   X509_CRL *result = 0 ;
26632 
26633   if (!args) SWIG_fail;
26634   swig_obj[0] = args;
26635   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
26636   if (!SWIG_IsOK(res1)) {
26637     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_crl_read_pem" "', argument " "1"" of type '" "BIO *""'");
26638   }
26639   arg1 = (BIO *)(argp1);
26640   {
26641     if (!arg1) {
26642       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26643     }
26644   }
26645   {
26646     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
26647     result = (X509_CRL *)x509_crl_read_pem(arg1);
26648     SWIG_PYTHON_THREAD_END_ALLOW;
26649   }
26650   {
26651     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
26652 
26653     if (result != NULL)
26654     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509_CRL, 0);
26655     else {
26656       m2_PyErr_Msg(_x509_err);
26657       resultobj = NULL;
26658     }
26659   }
26660   return resultobj;
26661 fail:
26662   return NULL;
26663 }
26664 
26665 
_wrap_x509_set_version(PyObject * self,PyObject * args)26666 SWIGINTERN PyObject *_wrap_x509_set_version(PyObject *self, PyObject *args) {
26667   PyObject *resultobj = 0;
26668   X509 *arg1 = (X509 *) 0 ;
26669   long arg2 ;
26670   void *argp1 = 0 ;
26671   int res1 = 0 ;
26672   long val2 ;
26673   int ecode2 = 0 ;
26674   PyObject *swig_obj[2] ;
26675   int result;
26676 
26677   if (!SWIG_Python_UnpackTuple(args, "x509_set_version", 2, 2, swig_obj)) SWIG_fail;
26678   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
26679   if (!SWIG_IsOK(res1)) {
26680     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_version" "', argument " "1"" of type '" "X509 *""'");
26681   }
26682   arg1 = (X509 *)(argp1);
26683   ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
26684   if (!SWIG_IsOK(ecode2)) {
26685     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_set_version" "', argument " "2"" of type '" "long""'");
26686   }
26687   arg2 = (long)(val2);
26688   {
26689     if (!arg1) {
26690       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26691     }
26692   }
26693   result = (int)x509_set_version(arg1,arg2);
26694   {
26695     resultobj=PyLong_FromLong(result);
26696     if (PyErr_Occurred()) SWIG_fail;
26697   }
26698   return resultobj;
26699 fail:
26700   return NULL;
26701 }
26702 
26703 
_wrap_x509_get_version(PyObject * self,PyObject * args)26704 SWIGINTERN PyObject *_wrap_x509_get_version(PyObject *self, PyObject *args) {
26705   PyObject *resultobj = 0;
26706   X509 *arg1 = (X509 *) 0 ;
26707   void *argp1 = 0 ;
26708   int res1 = 0 ;
26709   PyObject *swig_obj[1] ;
26710   long result;
26711 
26712   if (!args) SWIG_fail;
26713   swig_obj[0] = args;
26714   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
26715   if (!SWIG_IsOK(res1)) {
26716     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_version" "', argument " "1"" of type '" "X509 *""'");
26717   }
26718   arg1 = (X509 *)(argp1);
26719   {
26720     if (!arg1) {
26721       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26722     }
26723   }
26724   result = (long)x509_get_version(arg1);
26725   resultobj = SWIG_From_long((long)(result));
26726   return resultobj;
26727 fail:
26728   return NULL;
26729 }
26730 
26731 
_wrap_x509_set_not_before(PyObject * self,PyObject * args)26732 SWIGINTERN PyObject *_wrap_x509_set_not_before(PyObject *self, PyObject *args) {
26733   PyObject *resultobj = 0;
26734   X509 *arg1 = (X509 *) 0 ;
26735   ASN1_TIME *arg2 = (ASN1_TIME *) 0 ;
26736   void *argp1 = 0 ;
26737   int res1 = 0 ;
26738   void *argp2 = 0 ;
26739   int res2 = 0 ;
26740   PyObject *swig_obj[2] ;
26741   int result;
26742 
26743   if (!SWIG_Python_UnpackTuple(args, "x509_set_not_before", 2, 2, swig_obj)) SWIG_fail;
26744   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
26745   if (!SWIG_IsOK(res1)) {
26746     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_not_before" "', argument " "1"" of type '" "X509 *""'");
26747   }
26748   arg1 = (X509 *)(argp1);
26749   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_TIME, 0 |  0 );
26750   if (!SWIG_IsOK(res2)) {
26751     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_not_before" "', argument " "2"" of type '" "ASN1_TIME *""'");
26752   }
26753   arg2 = (ASN1_TIME *)(argp2);
26754   {
26755     if (!arg1) {
26756       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26757     }
26758   }
26759   result = (int)x509_set_not_before(arg1,arg2);
26760   {
26761     resultobj=PyLong_FromLong(result);
26762     if (PyErr_Occurred()) SWIG_fail;
26763   }
26764   return resultobj;
26765 fail:
26766   return NULL;
26767 }
26768 
26769 
_wrap_x509_get_not_before(PyObject * self,PyObject * args)26770 SWIGINTERN PyObject *_wrap_x509_get_not_before(PyObject *self, PyObject *args) {
26771   PyObject *resultobj = 0;
26772   X509 *arg1 = (X509 *) 0 ;
26773   void *argp1 = 0 ;
26774   int res1 = 0 ;
26775   PyObject *swig_obj[1] ;
26776   ASN1_TIME *result = 0 ;
26777 
26778   if (!args) SWIG_fail;
26779   swig_obj[0] = args;
26780   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
26781   if (!SWIG_IsOK(res1)) {
26782     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_not_before" "', argument " "1"" of type '" "X509 *""'");
26783   }
26784   arg1 = (X509 *)(argp1);
26785   {
26786     if (!arg1) {
26787       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26788     }
26789   }
26790   result = (ASN1_TIME *)x509_get_not_before(arg1);
26791   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 |  0 );
26792   return resultobj;
26793 fail:
26794   return NULL;
26795 }
26796 
26797 
_wrap_x509_set_not_after(PyObject * self,PyObject * args)26798 SWIGINTERN PyObject *_wrap_x509_set_not_after(PyObject *self, PyObject *args) {
26799   PyObject *resultobj = 0;
26800   X509 *arg1 = (X509 *) 0 ;
26801   ASN1_TIME *arg2 = (ASN1_TIME *) 0 ;
26802   void *argp1 = 0 ;
26803   int res1 = 0 ;
26804   void *argp2 = 0 ;
26805   int res2 = 0 ;
26806   PyObject *swig_obj[2] ;
26807   int result;
26808 
26809   if (!SWIG_Python_UnpackTuple(args, "x509_set_not_after", 2, 2, swig_obj)) SWIG_fail;
26810   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
26811   if (!SWIG_IsOK(res1)) {
26812     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_set_not_after" "', argument " "1"" of type '" "X509 *""'");
26813   }
26814   arg1 = (X509 *)(argp1);
26815   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_TIME, 0 |  0 );
26816   if (!SWIG_IsOK(res2)) {
26817     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_set_not_after" "', argument " "2"" of type '" "ASN1_TIME *""'");
26818   }
26819   arg2 = (ASN1_TIME *)(argp2);
26820   {
26821     if (!arg1) {
26822       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26823     }
26824   }
26825   result = (int)x509_set_not_after(arg1,arg2);
26826   {
26827     resultobj=PyLong_FromLong(result);
26828     if (PyErr_Occurred()) SWIG_fail;
26829   }
26830   return resultobj;
26831 fail:
26832   return NULL;
26833 }
26834 
26835 
_wrap_x509_get_not_after(PyObject * self,PyObject * args)26836 SWIGINTERN PyObject *_wrap_x509_get_not_after(PyObject *self, PyObject *args) {
26837   PyObject *resultobj = 0;
26838   X509 *arg1 = (X509 *) 0 ;
26839   void *argp1 = 0 ;
26840   int res1 = 0 ;
26841   PyObject *swig_obj[1] ;
26842   ASN1_TIME *result = 0 ;
26843 
26844   if (!args) SWIG_fail;
26845   swig_obj[0] = args;
26846   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
26847   if (!SWIG_IsOK(res1)) {
26848     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_get_not_after" "', argument " "1"" of type '" "X509 *""'");
26849   }
26850   arg1 = (X509 *)(argp1);
26851   {
26852     if (!arg1) {
26853       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26854     }
26855   }
26856   result = (ASN1_TIME *)x509_get_not_after(arg1);
26857   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 |  0 );
26858   return resultobj;
26859 fail:
26860   return NULL;
26861 }
26862 
26863 
_wrap_x509_sign(PyObject * self,PyObject * args)26864 SWIGINTERN PyObject *_wrap_x509_sign(PyObject *self, PyObject *args) {
26865   PyObject *resultobj = 0;
26866   X509 *arg1 = (X509 *) 0 ;
26867   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
26868   EVP_MD *arg3 = (EVP_MD *) 0 ;
26869   void *argp1 = 0 ;
26870   int res1 = 0 ;
26871   void *argp2 = 0 ;
26872   int res2 = 0 ;
26873   void *argp3 = 0 ;
26874   int res3 = 0 ;
26875   PyObject *swig_obj[3] ;
26876   int result;
26877 
26878   if (!SWIG_Python_UnpackTuple(args, "x509_sign", 3, 3, swig_obj)) SWIG_fail;
26879   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
26880   if (!SWIG_IsOK(res1)) {
26881     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_sign" "', argument " "1"" of type '" "X509 *""'");
26882   }
26883   arg1 = (X509 *)(argp1);
26884   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
26885   if (!SWIG_IsOK(res2)) {
26886     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_sign" "', argument " "2"" of type '" "EVP_PKEY *""'");
26887   }
26888   arg2 = (EVP_PKEY *)(argp2);
26889   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_MD, 0 |  0 );
26890   if (!SWIG_IsOK(res3)) {
26891     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "x509_sign" "', argument " "3"" of type '" "EVP_MD *""'");
26892   }
26893   arg3 = (EVP_MD *)(argp3);
26894   {
26895     if (!arg1) {
26896       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26897     }
26898   }
26899   {
26900     if (!arg2) {
26901       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26902     }
26903   }
26904   {
26905     if (!arg3) {
26906       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26907     }
26908   }
26909   result = (int)x509_sign(arg1,arg2,arg3);
26910   {
26911     resultobj=PyLong_FromLong(result);
26912     if (PyErr_Occurred()) SWIG_fail;
26913   }
26914   return resultobj;
26915 fail:
26916   return NULL;
26917 }
26918 
26919 
_wrap_x509_gmtime_adj(PyObject * self,PyObject * args)26920 SWIGINTERN PyObject *_wrap_x509_gmtime_adj(PyObject *self, PyObject *args) {
26921   PyObject *resultobj = 0;
26922   ASN1_TIME *arg1 = (ASN1_TIME *) 0 ;
26923   long arg2 ;
26924   void *argp1 = 0 ;
26925   int res1 = 0 ;
26926   long val2 ;
26927   int ecode2 = 0 ;
26928   PyObject *swig_obj[2] ;
26929   ASN1_TIME *result = 0 ;
26930 
26931   if (!SWIG_Python_UnpackTuple(args, "x509_gmtime_adj", 2, 2, swig_obj)) SWIG_fail;
26932   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 0 |  0 );
26933   if (!SWIG_IsOK(res1)) {
26934     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_gmtime_adj" "', argument " "1"" of type '" "ASN1_TIME *""'");
26935   }
26936   arg1 = (ASN1_TIME *)(argp1);
26937   ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
26938   if (!SWIG_IsOK(ecode2)) {
26939     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_gmtime_adj" "', argument " "2"" of type '" "long""'");
26940   }
26941   arg2 = (long)(val2);
26942   result = (ASN1_TIME *)x509_gmtime_adj(arg1,arg2);
26943   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 |  0 );
26944   return resultobj;
26945 fail:
26946   return NULL;
26947 }
26948 
26949 
_wrap_x509_name_by_nid(PyObject * self,PyObject * args)26950 SWIGINTERN PyObject *_wrap_x509_name_by_nid(PyObject *self, PyObject *args) {
26951   PyObject *resultobj = 0;
26952   X509_NAME *arg1 = (X509_NAME *) 0 ;
26953   int arg2 ;
26954   void *argp1 = 0 ;
26955   int res1 = 0 ;
26956   int val2 ;
26957   int ecode2 = 0 ;
26958   PyObject *swig_obj[2] ;
26959   PyObject *result = 0 ;
26960 
26961   if (!SWIG_Python_UnpackTuple(args, "x509_name_by_nid", 2, 2, swig_obj)) SWIG_fail;
26962   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
26963   if (!SWIG_IsOK(res1)) {
26964     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_by_nid" "', argument " "1"" of type '" "X509_NAME *""'");
26965   }
26966   arg1 = (X509_NAME *)(argp1);
26967   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
26968   if (!SWIG_IsOK(ecode2)) {
26969     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_by_nid" "', argument " "2"" of type '" "int""'");
26970   }
26971   arg2 = (int)(val2);
26972   {
26973     if (!arg1) {
26974       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
26975     }
26976   }
26977   result = (PyObject *)x509_name_by_nid(arg1,arg2);
26978   {
26979     resultobj=result;
26980   }
26981   return resultobj;
26982 fail:
26983   return NULL;
26984 }
26985 
26986 
_wrap_x509_name_set_by_nid(PyObject * self,PyObject * args)26987 SWIGINTERN PyObject *_wrap_x509_name_set_by_nid(PyObject *self, PyObject *args) {
26988   PyObject *resultobj = 0;
26989   X509_NAME *arg1 = (X509_NAME *) 0 ;
26990   int arg2 ;
26991   PyObject *arg3 = (PyObject *) 0 ;
26992   void *argp1 = 0 ;
26993   int res1 = 0 ;
26994   int val2 ;
26995   int ecode2 = 0 ;
26996   PyObject *swig_obj[3] ;
26997   int result;
26998 
26999   if (!SWIG_Python_UnpackTuple(args, "x509_name_set_by_nid", 3, 3, swig_obj)) SWIG_fail;
27000   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
27001   if (!SWIG_IsOK(res1)) {
27002     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_set_by_nid" "', argument " "1"" of type '" "X509_NAME *""'");
27003   }
27004   arg1 = (X509_NAME *)(argp1);
27005   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
27006   if (!SWIG_IsOK(ecode2)) {
27007     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_name_set_by_nid" "', argument " "2"" of type '" "int""'");
27008   }
27009   arg2 = (int)(val2);
27010   {
27011     arg3=swig_obj[2];
27012   }
27013   {
27014     if (!arg1) {
27015       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27016     }
27017   }
27018   result = (int)x509_name_set_by_nid(arg1,arg2,arg3);
27019   {
27020     resultobj=PyLong_FromLong(result);
27021     if (PyErr_Occurred()) SWIG_fail;
27022   }
27023   return resultobj;
27024 fail:
27025   return NULL;
27026 }
27027 
27028 
_wrap_x509_name_add_entry_by_txt(PyObject * self,PyObject * args)27029 SWIGINTERN PyObject *_wrap_x509_name_add_entry_by_txt(PyObject *self, PyObject *args) {
27030   PyObject *resultobj = 0;
27031   X509_NAME *arg1 = (X509_NAME *) 0 ;
27032   char *arg2 = (char *) 0 ;
27033   int arg3 ;
27034   char *arg4 = (char *) 0 ;
27035   int arg5 ;
27036   int arg6 ;
27037   int arg7 ;
27038   void *argp1 = 0 ;
27039   int res1 = 0 ;
27040   int res2 ;
27041   char *buf2 = 0 ;
27042   int alloc2 = 0 ;
27043   int val3 ;
27044   int ecode3 = 0 ;
27045   int res4 ;
27046   char *buf4 = 0 ;
27047   int alloc4 = 0 ;
27048   int val5 ;
27049   int ecode5 = 0 ;
27050   int val6 ;
27051   int ecode6 = 0 ;
27052   int val7 ;
27053   int ecode7 = 0 ;
27054   PyObject *swig_obj[7] ;
27055   int result;
27056 
27057   if (!SWIG_Python_UnpackTuple(args, "x509_name_add_entry_by_txt", 7, 7, swig_obj)) SWIG_fail;
27058   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
27059   if (!SWIG_IsOK(res1)) {
27060     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_add_entry_by_txt" "', argument " "1"" of type '" "X509_NAME *""'");
27061   }
27062   arg1 = (X509_NAME *)(argp1);
27063   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
27064   if (!SWIG_IsOK(res2)) {
27065     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_add_entry_by_txt" "', argument " "2"" of type '" "char *""'");
27066   }
27067   arg2 = (char *)(buf2);
27068   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
27069   if (!SWIG_IsOK(ecode3)) {
27070     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_add_entry_by_txt" "', argument " "3"" of type '" "int""'");
27071   }
27072   arg3 = (int)(val3);
27073   res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4);
27074   if (!SWIG_IsOK(res4)) {
27075     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_add_entry_by_txt" "', argument " "4"" of type '" "char *""'");
27076   }
27077   arg4 = (char *)(buf4);
27078   ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
27079   if (!SWIG_IsOK(ecode5)) {
27080     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "x509_name_add_entry_by_txt" "', argument " "5"" of type '" "int""'");
27081   }
27082   arg5 = (int)(val5);
27083   ecode6 = SWIG_AsVal_int(swig_obj[5], &val6);
27084   if (!SWIG_IsOK(ecode6)) {
27085     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "x509_name_add_entry_by_txt" "', argument " "6"" of type '" "int""'");
27086   }
27087   arg6 = (int)(val6);
27088   ecode7 = SWIG_AsVal_int(swig_obj[6], &val7);
27089   if (!SWIG_IsOK(ecode7)) {
27090     SWIG_exception_fail(SWIG_ArgError(ecode7), "in method '" "x509_name_add_entry_by_txt" "', argument " "7"" of type '" "int""'");
27091   }
27092   arg7 = (int)(val7);
27093   {
27094     if (!arg1) {
27095       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27096     }
27097   }
27098   result = (int)x509_name_add_entry_by_txt(arg1,arg2,arg3,arg4,arg5,arg6,arg7);
27099   {
27100     resultobj=PyLong_FromLong(result);
27101     if (PyErr_Occurred()) SWIG_fail;
27102   }
27103   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
27104   if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
27105   return resultobj;
27106 fail:
27107   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
27108   if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
27109   return NULL;
27110 }
27111 
27112 
_wrap_x509_name_get_der(PyObject * self,PyObject * args)27113 SWIGINTERN PyObject *_wrap_x509_name_get_der(PyObject *self, PyObject *args) {
27114   PyObject *resultobj = 0;
27115   X509_NAME *arg1 = (X509_NAME *) 0 ;
27116   void *argp1 = 0 ;
27117   int res1 = 0 ;
27118   PyObject *swig_obj[1] ;
27119   PyObject *result = 0 ;
27120 
27121   if (!args) SWIG_fail;
27122   swig_obj[0] = args;
27123   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
27124   if (!SWIG_IsOK(res1)) {
27125     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_get_der" "', argument " "1"" of type '" "X509_NAME *""'");
27126   }
27127   arg1 = (X509_NAME *)(argp1);
27128   {
27129     if (!arg1) {
27130       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27131     }
27132   }
27133   result = (PyObject *)x509_name_get_der(arg1);
27134   {
27135     resultobj=result;
27136   }
27137   return resultobj;
27138 fail:
27139   return NULL;
27140 }
27141 
27142 
_wrap_sk_x509_free(PyObject * self,PyObject * args)27143 SWIGINTERN PyObject *_wrap_sk_x509_free(PyObject *self, PyObject *args) {
27144   PyObject *resultobj = 0;
27145   struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ;
27146   void *argp1 = 0 ;
27147   int res1 = 0 ;
27148   PyObject *swig_obj[1] ;
27149 
27150   if (!args) SWIG_fail;
27151   swig_obj[0] = args;
27152   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 |  0 );
27153   if (!SWIG_IsOK(res1)) {
27154     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_free" "', argument " "1"" of type '" "struct stack_st_X509 *""'");
27155   }
27156   arg1 = (struct stack_st_X509 *)(argp1);
27157   {
27158     if (!arg1) {
27159       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27160     }
27161   }
27162   sk_x509_free(arg1);
27163   resultobj = SWIG_Py_Void();
27164   return resultobj;
27165 fail:
27166   return NULL;
27167 }
27168 
27169 
_wrap_sk_x509_push(PyObject * self,PyObject * args)27170 SWIGINTERN PyObject *_wrap_sk_x509_push(PyObject *self, PyObject *args) {
27171   PyObject *resultobj = 0;
27172   struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ;
27173   X509 *arg2 = (X509 *) 0 ;
27174   void *argp1 = 0 ;
27175   int res1 = 0 ;
27176   void *argp2 = 0 ;
27177   int res2 = 0 ;
27178   PyObject *swig_obj[2] ;
27179   int result;
27180 
27181   if (!SWIG_Python_UnpackTuple(args, "sk_x509_push", 2, 2, swig_obj)) SWIG_fail;
27182   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 |  0 );
27183   if (!SWIG_IsOK(res1)) {
27184     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_push" "', argument " "1"" of type '" "struct stack_st_X509 *""'");
27185   }
27186   arg1 = (struct stack_st_X509 *)(argp1);
27187   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 |  0 );
27188   if (!SWIG_IsOK(res2)) {
27189     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_x509_push" "', argument " "2"" of type '" "X509 *""'");
27190   }
27191   arg2 = (X509 *)(argp2);
27192   {
27193     if (!arg1) {
27194       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27195     }
27196   }
27197   {
27198     if (!arg2) {
27199       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27200     }
27201   }
27202   result = (int)sk_x509_push(arg1,arg2);
27203   {
27204     resultobj=PyLong_FromLong(result);
27205     if (PyErr_Occurred()) SWIG_fail;
27206   }
27207   return resultobj;
27208 fail:
27209   return NULL;
27210 }
27211 
27212 
_wrap_sk_x509_pop(PyObject * self,PyObject * args)27213 SWIGINTERN PyObject *_wrap_sk_x509_pop(PyObject *self, PyObject *args) {
27214   PyObject *resultobj = 0;
27215   struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ;
27216   void *argp1 = 0 ;
27217   int res1 = 0 ;
27218   PyObject *swig_obj[1] ;
27219   X509 *result = 0 ;
27220 
27221   if (!args) SWIG_fail;
27222   swig_obj[0] = args;
27223   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 |  0 );
27224   if (!SWIG_IsOK(res1)) {
27225     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_pop" "', argument " "1"" of type '" "struct stack_st_X509 *""'");
27226   }
27227   arg1 = (struct stack_st_X509 *)(argp1);
27228   {
27229     if (!arg1) {
27230       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27231     }
27232   }
27233   result = (X509 *)sk_x509_pop(arg1);
27234   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 |  0 );
27235   return resultobj;
27236 fail:
27237   return NULL;
27238 }
27239 
27240 
_wrap_x509_store_load_locations(PyObject * self,PyObject * args)27241 SWIGINTERN PyObject *_wrap_x509_store_load_locations(PyObject *self, PyObject *args) {
27242   PyObject *resultobj = 0;
27243   X509_STORE *arg1 = (X509_STORE *) 0 ;
27244   char *arg2 = (char *) 0 ;
27245   void *argp1 = 0 ;
27246   int res1 = 0 ;
27247   int res2 ;
27248   char *buf2 = 0 ;
27249   int alloc2 = 0 ;
27250   PyObject *swig_obj[2] ;
27251   int result;
27252 
27253   if (!SWIG_Python_UnpackTuple(args, "x509_store_load_locations", 2, 2, swig_obj)) SWIG_fail;
27254   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 0 |  0 );
27255   if (!SWIG_IsOK(res1)) {
27256     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_load_locations" "', argument " "1"" of type '" "X509_STORE *""'");
27257   }
27258   arg1 = (X509_STORE *)(argp1);
27259   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
27260   if (!SWIG_IsOK(res2)) {
27261     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_store_load_locations" "', argument " "2"" of type '" "char const *""'");
27262   }
27263   arg2 = (char *)(buf2);
27264   result = (int)x509_store_load_locations(arg1,(char const *)arg2);
27265   {
27266     resultobj=PyLong_FromLong(result);
27267     if (PyErr_Occurred()) SWIG_fail;
27268   }
27269   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
27270   return resultobj;
27271 fail:
27272   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
27273   return NULL;
27274 }
27275 
27276 
_wrap_x509_type_check(PyObject * self,PyObject * args)27277 SWIGINTERN PyObject *_wrap_x509_type_check(PyObject *self, PyObject *args) {
27278   PyObject *resultobj = 0;
27279   X509 *arg1 = (X509 *) 0 ;
27280   void *argp1 = 0 ;
27281   int res1 = 0 ;
27282   PyObject *swig_obj[1] ;
27283   int result;
27284 
27285   if (!args) SWIG_fail;
27286   swig_obj[0] = args;
27287   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
27288   if (!SWIG_IsOK(res1)) {
27289     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_type_check" "', argument " "1"" of type '" "X509 *""'");
27290   }
27291   arg1 = (X509 *)(argp1);
27292   {
27293     if (!arg1) {
27294       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27295     }
27296   }
27297   result = (int)x509_type_check(arg1);
27298   {
27299     resultobj=PyLong_FromLong(result);
27300     if (PyErr_Occurred()) SWIG_fail;
27301   }
27302   return resultobj;
27303 fail:
27304   return NULL;
27305 }
27306 
27307 
_wrap_x509_name_type_check(PyObject * self,PyObject * args)27308 SWIGINTERN PyObject *_wrap_x509_name_type_check(PyObject *self, PyObject *args) {
27309   PyObject *resultobj = 0;
27310   X509_NAME *arg1 = (X509_NAME *) 0 ;
27311   void *argp1 = 0 ;
27312   int res1 = 0 ;
27313   PyObject *swig_obj[1] ;
27314   int result;
27315 
27316   if (!args) SWIG_fail;
27317   swig_obj[0] = args;
27318   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
27319   if (!SWIG_IsOK(res1)) {
27320     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_type_check" "', argument " "1"" of type '" "X509_NAME *""'");
27321   }
27322   arg1 = (X509_NAME *)(argp1);
27323   {
27324     if (!arg1) {
27325       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27326     }
27327   }
27328   result = (int)x509_name_type_check(arg1);
27329   {
27330     resultobj=PyLong_FromLong(result);
27331     if (PyErr_Occurred()) SWIG_fail;
27332   }
27333   return resultobj;
27334 fail:
27335   return NULL;
27336 }
27337 
27338 
_wrap_x509_req_get_subject_name(PyObject * self,PyObject * args)27339 SWIGINTERN PyObject *_wrap_x509_req_get_subject_name(PyObject *self, PyObject *args) {
27340   PyObject *resultobj = 0;
27341   X509_REQ *arg1 = (X509_REQ *) 0 ;
27342   void *argp1 = 0 ;
27343   int res1 = 0 ;
27344   PyObject *swig_obj[1] ;
27345   X509_NAME *result = 0 ;
27346 
27347   if (!args) SWIG_fail;
27348   swig_obj[0] = args;
27349   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 |  0 );
27350   if (!SWIG_IsOK(res1)) {
27351     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_get_subject_name" "', argument " "1"" of type '" "X509_REQ *""'");
27352   }
27353   arg1 = (X509_REQ *)(argp1);
27354   {
27355     if (!arg1) {
27356       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27357     }
27358   }
27359   result = (X509_NAME *)x509_req_get_subject_name(arg1);
27360   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME, 0 |  0 );
27361   return resultobj;
27362 fail:
27363   return NULL;
27364 }
27365 
27366 
_wrap_x509_req_get_version(PyObject * self,PyObject * args)27367 SWIGINTERN PyObject *_wrap_x509_req_get_version(PyObject *self, PyObject *args) {
27368   PyObject *resultobj = 0;
27369   X509_REQ *arg1 = (X509_REQ *) 0 ;
27370   void *argp1 = 0 ;
27371   int res1 = 0 ;
27372   PyObject *swig_obj[1] ;
27373   long result;
27374 
27375   if (!args) SWIG_fail;
27376   swig_obj[0] = args;
27377   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 |  0 );
27378   if (!SWIG_IsOK(res1)) {
27379     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_get_version" "', argument " "1"" of type '" "X509_REQ *""'");
27380   }
27381   arg1 = (X509_REQ *)(argp1);
27382   {
27383     if (!arg1) {
27384       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27385     }
27386   }
27387   result = (long)x509_req_get_version(arg1);
27388   resultobj = SWIG_From_long((long)(result));
27389   return resultobj;
27390 fail:
27391   return NULL;
27392 }
27393 
27394 
_wrap_x509_req_set_version(PyObject * self,PyObject * args)27395 SWIGINTERN PyObject *_wrap_x509_req_set_version(PyObject *self, PyObject *args) {
27396   PyObject *resultobj = 0;
27397   X509_REQ *arg1 = (X509_REQ *) 0 ;
27398   long arg2 ;
27399   void *argp1 = 0 ;
27400   int res1 = 0 ;
27401   long val2 ;
27402   int ecode2 = 0 ;
27403   PyObject *swig_obj[2] ;
27404   int result;
27405 
27406   if (!SWIG_Python_UnpackTuple(args, "x509_req_set_version", 2, 2, swig_obj)) SWIG_fail;
27407   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 |  0 );
27408   if (!SWIG_IsOK(res1)) {
27409     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_set_version" "', argument " "1"" of type '" "X509_REQ *""'");
27410   }
27411   arg1 = (X509_REQ *)(argp1);
27412   ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
27413   if (!SWIG_IsOK(ecode2)) {
27414     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_req_set_version" "', argument " "2"" of type '" "long""'");
27415   }
27416   arg2 = (long)(val2);
27417   {
27418     if (!arg1) {
27419       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27420     }
27421   }
27422   result = (int)x509_req_set_version(arg1,arg2);
27423   {
27424     resultobj=PyLong_FromLong(result);
27425     if (PyErr_Occurred()) SWIG_fail;
27426   }
27427   return resultobj;
27428 fail:
27429   return NULL;
27430 }
27431 
27432 
_wrap_x509_req_add_extensions(PyObject * self,PyObject * args)27433 SWIGINTERN PyObject *_wrap_x509_req_add_extensions(PyObject *self, PyObject *args) {
27434   PyObject *resultobj = 0;
27435   X509_REQ *arg1 = (X509_REQ *) 0 ;
27436   struct stack_st_X509_EXTENSION *arg2 = (struct stack_st_X509_EXTENSION *) 0 ;
27437   void *argp1 = 0 ;
27438   int res1 = 0 ;
27439   void *argp2 = 0 ;
27440   int res2 = 0 ;
27441   PyObject *swig_obj[2] ;
27442   int result;
27443 
27444   if (!SWIG_Python_UnpackTuple(args, "x509_req_add_extensions", 2, 2, swig_obj)) SWIG_fail;
27445   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_REQ, 0 |  0 );
27446   if (!SWIG_IsOK(res1)) {
27447     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_req_add_extensions" "', argument " "1"" of type '" "X509_REQ *""'");
27448   }
27449   arg1 = (X509_REQ *)(argp1);
27450   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 |  0 );
27451   if (!SWIG_IsOK(res2)) {
27452     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_req_add_extensions" "', argument " "2"" of type '" "struct stack_st_X509_EXTENSION *""'");
27453   }
27454   arg2 = (struct stack_st_X509_EXTENSION *)(argp2);
27455   {
27456     if (!arg1) {
27457       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27458     }
27459   }
27460   result = (int)x509_req_add_extensions(arg1,arg2);
27461   {
27462     resultobj=PyLong_FromLong(result);
27463     if (PyErr_Occurred()) SWIG_fail;
27464   }
27465   return resultobj;
27466 fail:
27467   return NULL;
27468 }
27469 
27470 
_wrap_x509_name_entry_create_by_txt(PyObject * self,PyObject * args)27471 SWIGINTERN PyObject *_wrap_x509_name_entry_create_by_txt(PyObject *self, PyObject *args) {
27472   PyObject *resultobj = 0;
27473   X509_NAME_ENTRY **arg1 = (X509_NAME_ENTRY **) 0 ;
27474   char *arg2 = (char *) 0 ;
27475   int arg3 ;
27476   char *arg4 = (char *) 0 ;
27477   int arg5 ;
27478   void *argp1 = 0 ;
27479   int res1 = 0 ;
27480   int res2 ;
27481   char *buf2 = 0 ;
27482   int alloc2 = 0 ;
27483   int val3 ;
27484   int ecode3 = 0 ;
27485   int res4 ;
27486   char *buf4 = 0 ;
27487   int alloc4 = 0 ;
27488   int val5 ;
27489   int ecode5 = 0 ;
27490   PyObject *swig_obj[5] ;
27491   X509_NAME_ENTRY *result = 0 ;
27492 
27493   if (!SWIG_Python_UnpackTuple(args, "x509_name_entry_create_by_txt", 5, 5, swig_obj)) SWIG_fail;
27494   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_X509_NAME_ENTRY, 0 |  0 );
27495   if (!SWIG_IsOK(res1)) {
27496     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_entry_create_by_txt" "', argument " "1"" of type '" "X509_NAME_ENTRY **""'");
27497   }
27498   arg1 = (X509_NAME_ENTRY **)(argp1);
27499   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
27500   if (!SWIG_IsOK(res2)) {
27501     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509_name_entry_create_by_txt" "', argument " "2"" of type '" "char *""'");
27502   }
27503   arg2 = (char *)(buf2);
27504   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
27505   if (!SWIG_IsOK(ecode3)) {
27506     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "x509_name_entry_create_by_txt" "', argument " "3"" of type '" "int""'");
27507   }
27508   arg3 = (int)(val3);
27509   res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4);
27510   if (!SWIG_IsOK(res4)) {
27511     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509_name_entry_create_by_txt" "', argument " "4"" of type '" "char *""'");
27512   }
27513   arg4 = (char *)(buf4);
27514   ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
27515   if (!SWIG_IsOK(ecode5)) {
27516     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "x509_name_entry_create_by_txt" "', argument " "5"" of type '" "int""'");
27517   }
27518   arg5 = (int)(val5);
27519   result = (X509_NAME_ENTRY *)x509_name_entry_create_by_txt(arg1,arg2,arg3,arg4,arg5);
27520   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_NAME_ENTRY, 0 |  0 );
27521   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
27522   if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
27523   return resultobj;
27524 fail:
27525   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
27526   if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
27527   return NULL;
27528 }
27529 
27530 
_wrap_x509v3_set_nconf(PyObject * self,PyObject * args)27531 SWIGINTERN PyObject *_wrap_x509v3_set_nconf(PyObject *self, PyObject *args) {
27532   PyObject *resultobj = 0;
27533   X509V3_CTX *result = 0 ;
27534 
27535   if (!SWIG_Python_UnpackTuple(args, "x509v3_set_nconf", 0, 0, 0)) SWIG_fail;
27536   result = (X509V3_CTX *)x509v3_set_nconf();
27537   {
27538     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
27539 
27540     if (result != NULL)
27541     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509V3_CTX, 0);
27542     else {
27543       resultobj = NULL;
27544     }
27545   }
27546   return resultobj;
27547 fail:
27548   return NULL;
27549 }
27550 
27551 
_wrap_x509v3_ext_conf(PyObject * self,PyObject * args)27552 SWIGINTERN PyObject *_wrap_x509v3_ext_conf(PyObject *self, PyObject *args) {
27553   PyObject *resultobj = 0;
27554   void *arg1 = (void *) 0 ;
27555   X509V3_CTX *arg2 = (X509V3_CTX *) 0 ;
27556   char *arg3 = (char *) 0 ;
27557   char *arg4 = (char *) 0 ;
27558   int res1 ;
27559   void *argp2 = 0 ;
27560   int res2 = 0 ;
27561   int res3 ;
27562   char *buf3 = 0 ;
27563   int alloc3 = 0 ;
27564   int res4 ;
27565   char *buf4 = 0 ;
27566   int alloc4 = 0 ;
27567   PyObject *swig_obj[4] ;
27568   X509_EXTENSION *result = 0 ;
27569 
27570   if (!SWIG_Python_UnpackTuple(args, "x509v3_ext_conf", 4, 4, swig_obj)) SWIG_fail;
27571   res1 = SWIG_ConvertPtr(swig_obj[0],SWIG_as_voidptrptr(&arg1), 0, 0);
27572   if (!SWIG_IsOK(res1)) {
27573     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509v3_ext_conf" "', argument " "1"" of type '" "void *""'");
27574   }
27575   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509V3_CTX, 0 |  0 );
27576   if (!SWIG_IsOK(res2)) {
27577     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "x509v3_ext_conf" "', argument " "2"" of type '" "X509V3_CTX *""'");
27578   }
27579   arg2 = (X509V3_CTX *)(argp2);
27580   res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3);
27581   if (!SWIG_IsOK(res3)) {
27582     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "x509v3_ext_conf" "', argument " "3"" of type '" "char *""'");
27583   }
27584   arg3 = (char *)(buf3);
27585   res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4);
27586   if (!SWIG_IsOK(res4)) {
27587     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "x509v3_ext_conf" "', argument " "4"" of type '" "char *""'");
27588   }
27589   arg4 = (char *)(buf4);
27590   result = (X509_EXTENSION *)x509v3_ext_conf(arg1,arg2,arg3,arg4);
27591   {
27592     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
27593 
27594     if (result != NULL)
27595     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_X509_EXTENSION, 0);
27596     else {
27597       m2_PyErr_Msg(_x509_err);
27598       resultobj = NULL;
27599     }
27600   }
27601   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
27602   if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
27603   return resultobj;
27604 fail:
27605   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
27606   if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
27607   return NULL;
27608 }
27609 
27610 
_wrap_x509_extension_free(PyObject * self,PyObject * args)27611 SWIGINTERN PyObject *_wrap_x509_extension_free(PyObject *self, PyObject *args) {
27612   PyObject *resultobj = 0;
27613   X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ;
27614   void *argp1 = 0 ;
27615   int res1 = 0 ;
27616   PyObject *swig_obj[1] ;
27617 
27618   if (!args) SWIG_fail;
27619   swig_obj[0] = args;
27620   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_EXTENSION, 0 |  0 );
27621   if (!SWIG_IsOK(res1)) {
27622     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_free" "', argument " "1"" of type '" "X509_EXTENSION *""'");
27623   }
27624   arg1 = (X509_EXTENSION *)(argp1);
27625   x509_extension_free(arg1);
27626   resultobj = SWIG_Py_Void();
27627   return resultobj;
27628 fail:
27629   return NULL;
27630 }
27631 
27632 
_wrap_x509_extension_get_name(PyObject * self,PyObject * args)27633 SWIGINTERN PyObject *_wrap_x509_extension_get_name(PyObject *self, PyObject *args) {
27634   PyObject *resultobj = 0;
27635   X509_EXTENSION *arg1 = (X509_EXTENSION *) 0 ;
27636   void *argp1 = 0 ;
27637   int res1 = 0 ;
27638   PyObject *swig_obj[1] ;
27639   PyObject *result = 0 ;
27640 
27641   if (!args) SWIG_fail;
27642   swig_obj[0] = args;
27643   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_EXTENSION, 0 |  0 );
27644   if (!SWIG_IsOK(res1)) {
27645     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_extension_get_name" "', argument " "1"" of type '" "X509_EXTENSION *""'");
27646   }
27647   arg1 = (X509_EXTENSION *)(argp1);
27648   result = (PyObject *)x509_extension_get_name(arg1);
27649   {
27650     resultobj=result;
27651   }
27652   return resultobj;
27653 fail:
27654   return NULL;
27655 }
27656 
27657 
_wrap_sk_x509_extension_new_null(PyObject * self,PyObject * args)27658 SWIGINTERN PyObject *_wrap_sk_x509_extension_new_null(PyObject *self, PyObject *args) {
27659   PyObject *resultobj = 0;
27660   struct stack_st_X509_EXTENSION *result = 0 ;
27661 
27662   if (!SWIG_Python_UnpackTuple(args, "sk_x509_extension_new_null", 0, 0, 0)) SWIG_fail;
27663   result = (struct stack_st_X509_EXTENSION *)sk_x509_extension_new_null();
27664   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_X509_EXTENSION, 0 |  0 );
27665   return resultobj;
27666 fail:
27667   return NULL;
27668 }
27669 
27670 
_wrap_sk_x509_extension_free(PyObject * self,PyObject * args)27671 SWIGINTERN PyObject *_wrap_sk_x509_extension_free(PyObject *self, PyObject *args) {
27672   PyObject *resultobj = 0;
27673   struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ;
27674   void *argp1 = 0 ;
27675   int res1 = 0 ;
27676   PyObject *swig_obj[1] ;
27677 
27678   if (!args) SWIG_fail;
27679   swig_obj[0] = args;
27680   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 |  0 );
27681   if (!SWIG_IsOK(res1)) {
27682     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_free" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'");
27683   }
27684   arg1 = (struct stack_st_X509_EXTENSION *)(argp1);
27685   sk_x509_extension_free(arg1);
27686   resultobj = SWIG_Py_Void();
27687   return resultobj;
27688 fail:
27689   return NULL;
27690 }
27691 
27692 
_wrap_sk_x509_extension_push(PyObject * self,PyObject * args)27693 SWIGINTERN PyObject *_wrap_sk_x509_extension_push(PyObject *self, PyObject *args) {
27694   PyObject *resultobj = 0;
27695   struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ;
27696   X509_EXTENSION *arg2 = (X509_EXTENSION *) 0 ;
27697   void *argp1 = 0 ;
27698   int res1 = 0 ;
27699   void *argp2 = 0 ;
27700   int res2 = 0 ;
27701   PyObject *swig_obj[2] ;
27702   int result;
27703 
27704   if (!SWIG_Python_UnpackTuple(args, "sk_x509_extension_push", 2, 2, swig_obj)) SWIG_fail;
27705   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 |  0 );
27706   if (!SWIG_IsOK(res1)) {
27707     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_push" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'");
27708   }
27709   arg1 = (struct stack_st_X509_EXTENSION *)(argp1);
27710   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509_EXTENSION, 0 |  0 );
27711   if (!SWIG_IsOK(res2)) {
27712     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "sk_x509_extension_push" "', argument " "2"" of type '" "X509_EXTENSION *""'");
27713   }
27714   arg2 = (X509_EXTENSION *)(argp2);
27715   result = (int)sk_x509_extension_push(arg1,arg2);
27716   {
27717     resultobj=PyLong_FromLong(result);
27718     if (PyErr_Occurred()) SWIG_fail;
27719   }
27720   return resultobj;
27721 fail:
27722   return NULL;
27723 }
27724 
27725 
_wrap_sk_x509_extension_pop(PyObject * self,PyObject * args)27726 SWIGINTERN PyObject *_wrap_sk_x509_extension_pop(PyObject *self, PyObject *args) {
27727   PyObject *resultobj = 0;
27728   struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ;
27729   void *argp1 = 0 ;
27730   int res1 = 0 ;
27731   PyObject *swig_obj[1] ;
27732   X509_EXTENSION *result = 0 ;
27733 
27734   if (!args) SWIG_fail;
27735   swig_obj[0] = args;
27736   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 |  0 );
27737   if (!SWIG_IsOK(res1)) {
27738     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_pop" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'");
27739   }
27740   arg1 = (struct stack_st_X509_EXTENSION *)(argp1);
27741   result = (X509_EXTENSION *)sk_x509_extension_pop(arg1);
27742   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_EXTENSION, 0 |  0 );
27743   return resultobj;
27744 fail:
27745   return NULL;
27746 }
27747 
27748 
_wrap_sk_x509_extension_num(PyObject * self,PyObject * args)27749 SWIGINTERN PyObject *_wrap_sk_x509_extension_num(PyObject *self, PyObject *args) {
27750   PyObject *resultobj = 0;
27751   struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ;
27752   void *argp1 = 0 ;
27753   int res1 = 0 ;
27754   PyObject *swig_obj[1] ;
27755   int result;
27756 
27757   if (!args) SWIG_fail;
27758   swig_obj[0] = args;
27759   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 |  0 );
27760   if (!SWIG_IsOK(res1)) {
27761     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_num" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'");
27762   }
27763   arg1 = (struct stack_st_X509_EXTENSION *)(argp1);
27764   result = (int)sk_x509_extension_num(arg1);
27765   {
27766     resultobj=PyLong_FromLong(result);
27767     if (PyErr_Occurred()) SWIG_fail;
27768   }
27769   return resultobj;
27770 fail:
27771   return NULL;
27772 }
27773 
27774 
_wrap_sk_x509_extension_value(PyObject * self,PyObject * args)27775 SWIGINTERN PyObject *_wrap_sk_x509_extension_value(PyObject *self, PyObject *args) {
27776   PyObject *resultobj = 0;
27777   struct stack_st_X509_EXTENSION *arg1 = (struct stack_st_X509_EXTENSION *) 0 ;
27778   int arg2 ;
27779   void *argp1 = 0 ;
27780   int res1 = 0 ;
27781   int val2 ;
27782   int ecode2 = 0 ;
27783   PyObject *swig_obj[2] ;
27784   X509_EXTENSION *result = 0 ;
27785 
27786   if (!SWIG_Python_UnpackTuple(args, "sk_x509_extension_value", 2, 2, swig_obj)) SWIG_fail;
27787   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509_EXTENSION, 0 |  0 );
27788   if (!SWIG_IsOK(res1)) {
27789     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "sk_x509_extension_value" "', argument " "1"" of type '" "struct stack_st_X509_EXTENSION *""'");
27790   }
27791   arg1 = (struct stack_st_X509_EXTENSION *)(argp1);
27792   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
27793   if (!SWIG_IsOK(ecode2)) {
27794     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "sk_x509_extension_value" "', argument " "2"" of type '" "int""'");
27795   }
27796   arg2 = (int)(val2);
27797   result = (X509_EXTENSION *)sk_x509_extension_value(arg1,arg2);
27798   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509_EXTENSION, 0 |  0 );
27799   return resultobj;
27800 fail:
27801   return NULL;
27802 }
27803 
27804 
_wrap_x509_store_ctx_get_app_data(PyObject * self,PyObject * args)27805 SWIGINTERN PyObject *_wrap_x509_store_ctx_get_app_data(PyObject *self, PyObject *args) {
27806   PyObject *resultobj = 0;
27807   X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ;
27808   void *argp1 = 0 ;
27809   int res1 = 0 ;
27810   PyObject *swig_obj[1] ;
27811   void *result = 0 ;
27812 
27813   if (!args) SWIG_fail;
27814   swig_obj[0] = args;
27815   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 |  0 );
27816   if (!SWIG_IsOK(res1)) {
27817     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_app_data" "', argument " "1"" of type '" "X509_STORE_CTX *""'");
27818   }
27819   arg1 = (X509_STORE_CTX *)(argp1);
27820   result = (void *)x509_store_ctx_get_app_data(arg1);
27821   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
27822   return resultobj;
27823 fail:
27824   return NULL;
27825 }
27826 
27827 
_wrap_x509_store_ctx_get_ex_data(PyObject * self,PyObject * args)27828 SWIGINTERN PyObject *_wrap_x509_store_ctx_get_ex_data(PyObject *self, PyObject *args) {
27829   PyObject *resultobj = 0;
27830   X509_STORE_CTX *arg1 = (X509_STORE_CTX *) 0 ;
27831   int arg2 ;
27832   void *argp1 = 0 ;
27833   int res1 = 0 ;
27834   int val2 ;
27835   int ecode2 = 0 ;
27836   PyObject *swig_obj[2] ;
27837   void *result = 0 ;
27838 
27839   if (!SWIG_Python_UnpackTuple(args, "x509_store_ctx_get_ex_data", 2, 2, swig_obj)) SWIG_fail;
27840   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE_CTX, 0 |  0 );
27841   if (!SWIG_IsOK(res1)) {
27842     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_ctx_get_ex_data" "', argument " "1"" of type '" "X509_STORE_CTX *""'");
27843   }
27844   arg1 = (X509_STORE_CTX *)(argp1);
27845   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
27846   if (!SWIG_IsOK(ecode2)) {
27847     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "x509_store_ctx_get_ex_data" "', argument " "2"" of type '" "int""'");
27848   }
27849   arg2 = (int)(val2);
27850   result = (void *)x509_store_ctx_get_ex_data(arg1,arg2);
27851   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
27852   return resultobj;
27853 fail:
27854   return NULL;
27855 }
27856 
27857 
_wrap_x509_store_set_verify_cb__SWIG_1(PyObject * self,Py_ssize_t nobjs,PyObject ** swig_obj)27858 SWIGINTERN PyObject *_wrap_x509_store_set_verify_cb__SWIG_1(PyObject *self, Py_ssize_t nobjs, PyObject **swig_obj) {
27859   PyObject *resultobj = 0;
27860   X509_STORE *arg1 = (X509_STORE *) 0 ;
27861   PyObject *arg2 = (PyObject *) 0 ;
27862   void *argp1 = 0 ;
27863   int res1 = 0 ;
27864 
27865   if ((nobjs < 2) || (nobjs > 2)) SWIG_fail;
27866   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_STORE, 0 |  0 );
27867   if (!SWIG_IsOK(res1)) {
27868     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_store_set_verify_cb" "', argument " "1"" of type '" "X509_STORE *""'");
27869   }
27870   arg1 = (X509_STORE *)(argp1);
27871   {
27872     if (!PyCallable_Check(swig_obj[1])) {
27873       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
27874       return NULL;
27875     }
27876     arg2=swig_obj[1];
27877   }
27878   {
27879     if (!arg2) {
27880       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
27881     }
27882   }
27883   x509_store_set_verify_cb(arg1,arg2);
27884   resultobj = SWIG_Py_Void();
27885   return resultobj;
27886 fail:
27887   return NULL;
27888 }
27889 
27890 
_wrap_x509_store_set_verify_cb(PyObject * self,PyObject * args)27891 SWIGINTERN PyObject *_wrap_x509_store_set_verify_cb(PyObject *self, PyObject *args) {
27892   Py_ssize_t argc;
27893   PyObject *argv[3] = {
27894     0
27895   };
27896 
27897   if (!(argc = SWIG_Python_UnpackTuple(args, "x509_store_set_verify_cb", 0, 2, argv))) SWIG_fail;
27898   --argc;
27899   if (argc == 2) {
27900     int _v;
27901     void *vptr = 0;
27902     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_X509_STORE, 0);
27903     _v = SWIG_CheckState(res);
27904     if (_v) {
27905       void *ptr = 0;
27906       int res = SWIG_ConvertFunctionPtr(argv[1], &ptr, SWIGTYPE_p_f_int_p_X509_STORE_CTX__int);
27907       _v = SWIG_CheckState(res);
27908       if (_v) {
27909         return _wrap_x509_store_set_verify_cb__SWIG_0(self, argc, argv);
27910       }
27911     }
27912   }
27913   if (argc == 2) {
27914     int _v;
27915     void *vptr = 0;
27916     int res = SWIG_ConvertPtr(argv[0], &vptr, SWIGTYPE_p_X509_STORE, 0);
27917     _v = SWIG_CheckState(res);
27918     if (_v) {
27919       _v = (argv[1] != 0);
27920       if (_v) {
27921         return _wrap_x509_store_set_verify_cb__SWIG_1(self, argc, argv);
27922       }
27923     }
27924   }
27925 
27926 fail:
27927   SWIG_Python_RaiseOrModifyTypeError("Wrong number or type of arguments for overloaded function 'x509_store_set_verify_cb'.\n"
27928     "  Possible C/C++ prototypes are:\n"
27929     "    X509_STORE_set_verify_cb(X509_STORE *,int (*)(int,X509_STORE_CTX *))\n"
27930     "    x509_store_set_verify_cb(X509_STORE *,PyObject *)\n");
27931   return 0;
27932 }
27933 
27934 
_wrap_make_stack_from_der_sequence(PyObject * self,PyObject * args)27935 SWIGINTERN PyObject *_wrap_make_stack_from_der_sequence(PyObject *self, PyObject *args) {
27936   PyObject *resultobj = 0;
27937   PyObject *arg1 = (PyObject *) 0 ;
27938   PyObject *swig_obj[1] ;
27939   struct stack_st_X509 *result = 0 ;
27940 
27941   if (!args) SWIG_fail;
27942   swig_obj[0] = args;
27943   {
27944     arg1=swig_obj[0];
27945   }
27946   result = (struct stack_st_X509 *)make_stack_from_der_sequence(arg1);
27947   {
27948     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
27949 
27950     if (result != NULL)
27951     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_stack_st_X509, 0);
27952     else {
27953       resultobj = NULL;
27954     }
27955   }
27956   return resultobj;
27957 fail:
27958   return NULL;
27959 }
27960 
27961 
_wrap_sk_x509_new_null(PyObject * self,PyObject * args)27962 SWIGINTERN PyObject *_wrap_sk_x509_new_null(PyObject *self, PyObject *args) {
27963   PyObject *resultobj = 0;
27964   struct stack_st_X509 *result = 0 ;
27965 
27966   if (!SWIG_Python_UnpackTuple(args, "sk_x509_new_null", 0, 0, 0)) SWIG_fail;
27967   result = (struct stack_st_X509 *)sk_x509_new_null();
27968   {
27969     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
27970 
27971     if (result != NULL)
27972     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_stack_st_X509, 0);
27973     else {
27974       resultobj = NULL;
27975     }
27976   }
27977   return resultobj;
27978 fail:
27979   return NULL;
27980 }
27981 
27982 
_wrap_get_der_encoding_stack(PyObject * self,PyObject * args)27983 SWIGINTERN PyObject *_wrap_get_der_encoding_stack(PyObject *self, PyObject *args) {
27984   PyObject *resultobj = 0;
27985   struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ;
27986   void *argp1 = 0 ;
27987   int res1 = 0 ;
27988   PyObject *swig_obj[1] ;
27989   PyObject *result = 0 ;
27990 
27991   if (!args) SWIG_fail;
27992   swig_obj[0] = args;
27993   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 |  0 );
27994   if (!SWIG_IsOK(res1)) {
27995     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "get_der_encoding_stack" "', argument " "1"" of type '" "struct stack_st_X509 *""'");
27996   }
27997   arg1 = (struct stack_st_X509 *)(argp1);
27998   {
27999     if (!arg1) {
28000       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28001     }
28002   }
28003   result = (PyObject *)get_der_encoding_stack(arg1);
28004   {
28005     resultobj=result;
28006   }
28007   return resultobj;
28008 fail:
28009   return NULL;
28010 }
28011 
28012 
_wrap_x509_name_oneline(PyObject * self,PyObject * args)28013 SWIGINTERN PyObject *_wrap_x509_name_oneline(PyObject *self, PyObject *args) {
28014   PyObject *resultobj = 0;
28015   X509_NAME *arg1 = (X509_NAME *) 0 ;
28016   void *argp1 = 0 ;
28017   int res1 = 0 ;
28018   PyObject *swig_obj[1] ;
28019   char *result = 0 ;
28020 
28021   if (!args) SWIG_fail;
28022   swig_obj[0] = args;
28023   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509_NAME, 0 |  0 );
28024   if (!SWIG_IsOK(res1)) {
28025     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "x509_name_oneline" "', argument " "1"" of type '" "X509_NAME *""'");
28026   }
28027   arg1 = (X509_NAME *)(argp1);
28028   {
28029     if (!arg1) {
28030       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28031     }
28032   }
28033   result = (char *)x509_name_oneline(arg1);
28034   resultobj = SWIG_FromCharPtr((const char *)result);
28035   {
28036     if (result != NULL)
28037     OPENSSL_free(result);
28038   }
28039   return resultobj;
28040 fail:
28041   return NULL;
28042 }
28043 
28044 
_wrap_asn1_object_new(PyObject * self,PyObject * args)28045 SWIGINTERN PyObject *_wrap_asn1_object_new(PyObject *self, PyObject *args) {
28046   PyObject *resultobj = 0;
28047   ASN1_OBJECT *result = 0 ;
28048 
28049   if (!SWIG_Python_UnpackTuple(args, "asn1_object_new", 0, 0, 0)) SWIG_fail;
28050   result = (ASN1_OBJECT *)ASN1_OBJECT_new();
28051   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
28052   return resultobj;
28053 fail:
28054   return NULL;
28055 }
28056 
28057 
_wrap_asn1_object_create(PyObject * self,PyObject * args)28058 SWIGINTERN PyObject *_wrap_asn1_object_create(PyObject *self, PyObject *args) {
28059   PyObject *resultobj = 0;
28060   int arg1 ;
28061   unsigned char *arg2 = (unsigned char *) 0 ;
28062   int arg3 ;
28063   char *arg4 = (char *) 0 ;
28064   char *arg5 = (char *) 0 ;
28065   int val1 ;
28066   int ecode1 = 0 ;
28067   void *argp2 = 0 ;
28068   int res2 = 0 ;
28069   int val3 ;
28070   int ecode3 = 0 ;
28071   int res4 ;
28072   char *buf4 = 0 ;
28073   int alloc4 = 0 ;
28074   int res5 ;
28075   char *buf5 = 0 ;
28076   int alloc5 = 0 ;
28077   PyObject *swig_obj[5] ;
28078   ASN1_OBJECT *result = 0 ;
28079 
28080   if (!SWIG_Python_UnpackTuple(args, "asn1_object_create", 5, 5, swig_obj)) SWIG_fail;
28081   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
28082   if (!SWIG_IsOK(ecode1)) {
28083     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "asn1_object_create" "', argument " "1"" of type '" "int""'");
28084   }
28085   arg1 = (int)(val1);
28086   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_unsigned_char, 0 |  0 );
28087   if (!SWIG_IsOK(res2)) {
28088     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_object_create" "', argument " "2"" of type '" "unsigned char *""'");
28089   }
28090   arg2 = (unsigned char *)(argp2);
28091   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
28092   if (!SWIG_IsOK(ecode3)) {
28093     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "asn1_object_create" "', argument " "3"" of type '" "int""'");
28094   }
28095   arg3 = (int)(val3);
28096   res4 = SWIG_AsCharPtrAndSize(swig_obj[3], &buf4, NULL, &alloc4);
28097   if (!SWIG_IsOK(res4)) {
28098     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "asn1_object_create" "', argument " "4"" of type '" "char const *""'");
28099   }
28100   arg4 = (char *)(buf4);
28101   res5 = SWIG_AsCharPtrAndSize(swig_obj[4], &buf5, NULL, &alloc5);
28102   if (!SWIG_IsOK(res5)) {
28103     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "asn1_object_create" "', argument " "5"" of type '" "char const *""'");
28104   }
28105   arg5 = (char *)(buf5);
28106   result = (ASN1_OBJECT *)ASN1_OBJECT_create(arg1,arg2,arg3,(char const *)arg4,(char const *)arg5);
28107   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
28108   if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
28109   if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
28110   return resultobj;
28111 fail:
28112   if (alloc4 == SWIG_NEWOBJ) free((char*)buf4);
28113   if (alloc5 == SWIG_NEWOBJ) free((char*)buf5);
28114   return NULL;
28115 }
28116 
28117 
_wrap_asn1_object_free(PyObject * self,PyObject * args)28118 SWIGINTERN PyObject *_wrap_asn1_object_free(PyObject *self, PyObject *args) {
28119   PyObject *resultobj = 0;
28120   ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ;
28121   void *argp1 = 0 ;
28122   int res1 = 0 ;
28123   PyObject *swig_obj[1] ;
28124 
28125   if (!args) SWIG_fail;
28126   swig_obj[0] = args;
28127   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
28128   if (!SWIG_IsOK(res1)) {
28129     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_object_free" "', argument " "1"" of type '" "ASN1_OBJECT *""'");
28130   }
28131   arg1 = (ASN1_OBJECT *)(argp1);
28132   {
28133     if (!arg1) {
28134       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28135     }
28136   }
28137   ASN1_OBJECT_free(arg1);
28138   resultobj = SWIG_Py_Void();
28139   return resultobj;
28140 fail:
28141   return NULL;
28142 }
28143 
28144 
_wrap_i2d_asn1_object(PyObject * self,PyObject * args)28145 SWIGINTERN PyObject *_wrap_i2d_asn1_object(PyObject *self, PyObject *args) {
28146   PyObject *resultobj = 0;
28147   ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ;
28148   unsigned char **arg2 = (unsigned char **) 0 ;
28149   void *argp1 = 0 ;
28150   int res1 = 0 ;
28151   void *argp2 = 0 ;
28152   int res2 = 0 ;
28153   PyObject *swig_obj[2] ;
28154   int result;
28155 
28156   if (!SWIG_Python_UnpackTuple(args, "i2d_asn1_object", 2, 2, swig_obj)) SWIG_fail;
28157   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
28158   if (!SWIG_IsOK(res1)) {
28159     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "i2d_asn1_object" "', argument " "1"" of type '" "ASN1_OBJECT *""'");
28160   }
28161   arg1 = (ASN1_OBJECT *)(argp1);
28162   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_unsigned_char, 0 |  0 );
28163   if (!SWIG_IsOK(res2)) {
28164     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "i2d_asn1_object" "', argument " "2"" of type '" "unsigned char **""'");
28165   }
28166   arg2 = (unsigned char **)(argp2);
28167   {
28168     if (!arg1) {
28169       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28170     }
28171   }
28172   result = (int)i2d_ASN1_OBJECT(arg1,arg2);
28173   {
28174     resultobj=PyLong_FromLong(result);
28175     if (PyErr_Occurred()) SWIG_fail;
28176   }
28177   return resultobj;
28178 fail:
28179   return NULL;
28180 }
28181 
28182 
_wrap_d2i_asn1_object(PyObject * self,PyObject * args)28183 SWIGINTERN PyObject *_wrap_d2i_asn1_object(PyObject *self, PyObject *args) {
28184   PyObject *resultobj = 0;
28185   ASN1_OBJECT **arg1 = (ASN1_OBJECT **) 0 ;
28186   unsigned char **arg2 = (unsigned char **) 0 ;
28187   long arg3 ;
28188   void *argp1 = 0 ;
28189   int res1 = 0 ;
28190   void *argp2 = 0 ;
28191   int res2 = 0 ;
28192   long val3 ;
28193   int ecode3 = 0 ;
28194   PyObject *swig_obj[3] ;
28195   ASN1_OBJECT *result = 0 ;
28196 
28197   if (!SWIG_Python_UnpackTuple(args, "d2i_asn1_object", 3, 3, swig_obj)) SWIG_fail;
28198   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_p_ASN1_OBJECT, 0 |  0 );
28199   if (!SWIG_IsOK(res1)) {
28200     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "d2i_asn1_object" "', argument " "1"" of type '" "ASN1_OBJECT **""'");
28201   }
28202   arg1 = (ASN1_OBJECT **)(argp1);
28203   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_p_unsigned_char, 0 |  0 );
28204   if (!SWIG_IsOK(res2)) {
28205     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "d2i_asn1_object" "', argument " "2"" of type '" "unsigned char const **""'");
28206   }
28207   arg2 = (unsigned char **)(argp2);
28208   ecode3 = SWIG_AsVal_long(swig_obj[2], &val3);
28209   if (!SWIG_IsOK(ecode3)) {
28210     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "d2i_asn1_object" "', argument " "3"" of type '" "long""'");
28211   }
28212   arg3 = (long)(val3);
28213   result = (ASN1_OBJECT *)d2i_ASN1_OBJECT(arg1,(unsigned char const **)arg2,arg3);
28214   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
28215   return resultobj;
28216 fail:
28217   return NULL;
28218 }
28219 
28220 
_wrap_asn1_bit_string_new(PyObject * self,PyObject * args)28221 SWIGINTERN PyObject *_wrap_asn1_bit_string_new(PyObject *self, PyObject *args) {
28222   PyObject *resultobj = 0;
28223   ASN1_BIT_STRING *result = 0 ;
28224 
28225   if (!SWIG_Python_UnpackTuple(args, "asn1_bit_string_new", 0, 0, 0)) SWIG_fail;
28226   result = (ASN1_BIT_STRING *)ASN1_BIT_STRING_new();
28227   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_BIT_STRING, 0 |  0 );
28228   return resultobj;
28229 fail:
28230   return NULL;
28231 }
28232 
28233 
_wrap_asn1_string_new(PyObject * self,PyObject * args)28234 SWIGINTERN PyObject *_wrap_asn1_string_new(PyObject *self, PyObject *args) {
28235   PyObject *resultobj = 0;
28236   ASN1_STRING *result = 0 ;
28237 
28238   if (!SWIG_Python_UnpackTuple(args, "asn1_string_new", 0, 0, 0)) SWIG_fail;
28239   result = (ASN1_STRING *)ASN1_STRING_new();
28240   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_STRING, 0 |  0 );
28241   return resultobj;
28242 fail:
28243   return NULL;
28244 }
28245 
28246 
_wrap_asn1_string_free(PyObject * self,PyObject * args)28247 SWIGINTERN PyObject *_wrap_asn1_string_free(PyObject *self, PyObject *args) {
28248   PyObject *resultobj = 0;
28249   ASN1_STRING *arg1 = (ASN1_STRING *) 0 ;
28250   void *argp1 = 0 ;
28251   int res1 = 0 ;
28252   PyObject *swig_obj[1] ;
28253 
28254   if (!args) SWIG_fail;
28255   swig_obj[0] = args;
28256   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_STRING, 0 |  0 );
28257   if (!SWIG_IsOK(res1)) {
28258     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_free" "', argument " "1"" of type '" "ASN1_STRING *""'");
28259   }
28260   arg1 = (ASN1_STRING *)(argp1);
28261   {
28262     if (!arg1) {
28263       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28264     }
28265   }
28266   ASN1_STRING_free(arg1);
28267   resultobj = SWIG_Py_Void();
28268   return resultobj;
28269 fail:
28270   return NULL;
28271 }
28272 
28273 
_wrap_asn1_string_set(PyObject * self,PyObject * args)28274 SWIGINTERN PyObject *_wrap_asn1_string_set(PyObject *self, PyObject *args) {
28275   PyObject *resultobj = 0;
28276   ASN1_STRING *arg1 = (ASN1_STRING *) 0 ;
28277   void *arg2 = (void *) 0 ;
28278   int arg3 ;
28279   void *argp1 = 0 ;
28280   int res1 = 0 ;
28281   PyObject *swig_obj[2] ;
28282   int result;
28283 
28284   if (!SWIG_Python_UnpackTuple(args, "asn1_string_set", 2, 2, swig_obj)) SWIG_fail;
28285   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_STRING, 0 |  0 );
28286   if (!SWIG_IsOK(res1)) {
28287     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_set" "', argument " "1"" of type '" "ASN1_STRING *""'");
28288   }
28289   arg1 = (ASN1_STRING *)(argp1);
28290   {
28291     if (PyBytes_Check(swig_obj[1])) {
28292       Py_ssize_t len;
28293 
28294       arg2 = PyBytes_AsString(swig_obj[1]);
28295       len = PyBytes_Size(swig_obj[1]);
28296 
28297       if (len > INT_MAX) {
28298         PyErr_SetString(PyExc_ValueError, "object too large");
28299         return NULL;
28300       }
28301       arg3 = len;
28302     }
28303     else {
28304       PyErr_SetString(PyExc_TypeError, "expected string");
28305       return NULL;
28306     }
28307   }
28308   {
28309     if (!arg1) {
28310       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28311     }
28312   }
28313   result = (int)ASN1_STRING_set(arg1,(void const *)arg2,arg3);
28314   {
28315     resultobj=PyLong_FromLong(result);
28316     if (PyErr_Occurred()) SWIG_fail;
28317   }
28318   return resultobj;
28319 fail:
28320   return NULL;
28321 }
28322 
28323 
_wrap_asn1_string_print(PyObject * self,PyObject * args)28324 SWIGINTERN PyObject *_wrap_asn1_string_print(PyObject *self, PyObject *args) {
28325   PyObject *resultobj = 0;
28326   BIO *arg1 = (BIO *) 0 ;
28327   ASN1_STRING *arg2 = (ASN1_STRING *) 0 ;
28328   void *argp1 = 0 ;
28329   int res1 = 0 ;
28330   void *argp2 = 0 ;
28331   int res2 = 0 ;
28332   PyObject *swig_obj[2] ;
28333   int result;
28334 
28335   if (!SWIG_Python_UnpackTuple(args, "asn1_string_print", 2, 2, swig_obj)) SWIG_fail;
28336   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
28337   if (!SWIG_IsOK(res1)) {
28338     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_print" "', argument " "1"" of type '" "BIO *""'");
28339   }
28340   arg1 = (BIO *)(argp1);
28341   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_STRING, 0 |  0 );
28342   if (!SWIG_IsOK(res2)) {
28343     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_string_print" "', argument " "2"" of type '" "ASN1_STRING *""'");
28344   }
28345   arg2 = (ASN1_STRING *)(argp2);
28346   {
28347     if (!arg1) {
28348       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28349     }
28350   }
28351   {
28352     if (!arg2) {
28353       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28354     }
28355   }
28356   {
28357     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28358     result = (int)ASN1_STRING_print(arg1,arg2);
28359     SWIG_PYTHON_THREAD_END_ALLOW;
28360   }
28361   {
28362     resultobj=PyLong_FromLong(result);
28363     if (PyErr_Occurred()) SWIG_fail;
28364   }
28365   return resultobj;
28366 fail:
28367   return NULL;
28368 }
28369 
28370 
_wrap_asn1_string_print_ex(PyObject * self,PyObject * args)28371 SWIGINTERN PyObject *_wrap_asn1_string_print_ex(PyObject *self, PyObject *args) {
28372   PyObject *resultobj = 0;
28373   BIO *arg1 = (BIO *) 0 ;
28374   ASN1_STRING *arg2 = (ASN1_STRING *) 0 ;
28375   unsigned long arg3 ;
28376   void *argp1 = 0 ;
28377   int res1 = 0 ;
28378   void *argp2 = 0 ;
28379   int res2 = 0 ;
28380   unsigned long val3 ;
28381   int ecode3 = 0 ;
28382   PyObject *swig_obj[3] ;
28383   int result;
28384 
28385   if (!SWIG_Python_UnpackTuple(args, "asn1_string_print_ex", 3, 3, swig_obj)) SWIG_fail;
28386   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
28387   if (!SWIG_IsOK(res1)) {
28388     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_string_print_ex" "', argument " "1"" of type '" "BIO *""'");
28389   }
28390   arg1 = (BIO *)(argp1);
28391   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_STRING, 0 |  0 );
28392   if (!SWIG_IsOK(res2)) {
28393     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_string_print_ex" "', argument " "2"" of type '" "ASN1_STRING *""'");
28394   }
28395   arg2 = (ASN1_STRING *)(argp2);
28396   ecode3 = SWIG_AsVal_unsigned_SS_long(swig_obj[2], &val3);
28397   if (!SWIG_IsOK(ecode3)) {
28398     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "asn1_string_print_ex" "', argument " "3"" of type '" "unsigned long""'");
28399   }
28400   arg3 = (unsigned long)(val3);
28401   {
28402     if (!arg1) {
28403       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28404     }
28405   }
28406   {
28407     if (!arg2) {
28408       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28409     }
28410   }
28411   {
28412     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28413     result = (int)ASN1_STRING_print_ex(arg1,arg2,arg3);
28414     SWIG_PYTHON_THREAD_END_ALLOW;
28415   }
28416   {
28417     resultobj=PyLong_FromLong(result);
28418     if (PyErr_Occurred()) SWIG_fail;
28419   }
28420   return resultobj;
28421 fail:
28422   return NULL;
28423 }
28424 
28425 
_wrap_asn1_time_new(PyObject * self,PyObject * args)28426 SWIGINTERN PyObject *_wrap_asn1_time_new(PyObject *self, PyObject *args) {
28427   PyObject *resultobj = 0;
28428   ASN1_TIME *result = 0 ;
28429 
28430   if (!SWIG_Python_UnpackTuple(args, "asn1_time_new", 0, 0, 0)) SWIG_fail;
28431   result = (ASN1_TIME *)ASN1_TIME_new();
28432   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 |  0 );
28433   return resultobj;
28434 fail:
28435   return NULL;
28436 }
28437 
28438 
_wrap_asn1_time_free(PyObject * self,PyObject * args)28439 SWIGINTERN PyObject *_wrap_asn1_time_free(PyObject *self, PyObject *args) {
28440   PyObject *resultobj = 0;
28441   ASN1_TIME *arg1 = (ASN1_TIME *) 0 ;
28442   void *argp1 = 0 ;
28443   int res1 = 0 ;
28444   PyObject *swig_obj[1] ;
28445 
28446   if (!args) SWIG_fail;
28447   swig_obj[0] = args;
28448   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 0 |  0 );
28449   if (!SWIG_IsOK(res1)) {
28450     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_free" "', argument " "1"" of type '" "ASN1_TIME *""'");
28451   }
28452   arg1 = (ASN1_TIME *)(argp1);
28453   {
28454     if (!arg1) {
28455       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28456     }
28457   }
28458   ASN1_TIME_free(arg1);
28459   resultobj = SWIG_Py_Void();
28460   return resultobj;
28461 fail:
28462   return NULL;
28463 }
28464 
28465 
_wrap_asn1_time_check(PyObject * self,PyObject * args)28466 SWIGINTERN PyObject *_wrap_asn1_time_check(PyObject *self, PyObject *args) {
28467   PyObject *resultobj = 0;
28468   ASN1_TIME *arg1 = (ASN1_TIME *) 0 ;
28469   void *argp1 = 0 ;
28470   int res1 = 0 ;
28471   PyObject *swig_obj[1] ;
28472   int result;
28473 
28474   if (!args) SWIG_fail;
28475   swig_obj[0] = args;
28476   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 0 |  0 );
28477   if (!SWIG_IsOK(res1)) {
28478     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_check" "', argument " "1"" of type '" "ASN1_TIME *""'");
28479   }
28480   arg1 = (ASN1_TIME *)(argp1);
28481   {
28482     if (!arg1) {
28483       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28484     }
28485   }
28486   result = (int)ASN1_TIME_check(arg1);
28487   {
28488     resultobj=PyLong_FromLong(result);
28489     if (PyErr_Occurred()) SWIG_fail;
28490   }
28491   return resultobj;
28492 fail:
28493   return NULL;
28494 }
28495 
28496 
_wrap_asn1_time_set(PyObject * self,PyObject * args)28497 SWIGINTERN PyObject *_wrap_asn1_time_set(PyObject *self, PyObject *args) {
28498   PyObject *resultobj = 0;
28499   ASN1_TIME *arg1 = (ASN1_TIME *) 0 ;
28500   long arg2 ;
28501   void *argp1 = 0 ;
28502   int res1 = 0 ;
28503   long val2 ;
28504   int ecode2 = 0 ;
28505   PyObject *swig_obj[2] ;
28506   ASN1_TIME *result = 0 ;
28507 
28508   if (!SWIG_Python_UnpackTuple(args, "asn1_time_set", 2, 2, swig_obj)) SWIG_fail;
28509   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 0 |  0 );
28510   if (!SWIG_IsOK(res1)) {
28511     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_set" "', argument " "1"" of type '" "ASN1_TIME *""'");
28512   }
28513   arg1 = (ASN1_TIME *)(argp1);
28514   ecode2 = SWIG_AsVal_long(swig_obj[1], &val2);
28515   if (!SWIG_IsOK(ecode2)) {
28516     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "asn1_time_set" "', argument " "2"" of type '" "long""'");
28517   }
28518   arg2 = (long)(val2);
28519   {
28520     if (!arg1) {
28521       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28522     }
28523   }
28524   result = (ASN1_TIME *)ASN1_TIME_set(arg1,arg2);
28525   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_TIME, 0 |  0 );
28526   return resultobj;
28527 fail:
28528   return NULL;
28529 }
28530 
28531 
_wrap_asn1_time_set_string(PyObject * self,PyObject * args)28532 SWIGINTERN PyObject *_wrap_asn1_time_set_string(PyObject *self, PyObject *args) {
28533   PyObject *resultobj = 0;
28534   ASN1_TIME *arg1 = (ASN1_TIME *) 0 ;
28535   char *arg2 = (char *) 0 ;
28536   void *argp1 = 0 ;
28537   int res1 = 0 ;
28538   int res2 ;
28539   char *buf2 = 0 ;
28540   int alloc2 = 0 ;
28541   PyObject *swig_obj[2] ;
28542   int result;
28543 
28544   if (!SWIG_Python_UnpackTuple(args, "asn1_time_set_string", 2, 2, swig_obj)) SWIG_fail;
28545   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 0 |  0 );
28546   if (!SWIG_IsOK(res1)) {
28547     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_set_string" "', argument " "1"" of type '" "ASN1_TIME *""'");
28548   }
28549   arg1 = (ASN1_TIME *)(argp1);
28550   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
28551   if (!SWIG_IsOK(res2)) {
28552     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_time_set_string" "', argument " "2"" of type '" "char const *""'");
28553   }
28554   arg2 = (char *)(buf2);
28555   {
28556     if (!arg1) {
28557       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28558     }
28559   }
28560   result = (int)ASN1_TIME_set_string(arg1,(char const *)arg2);
28561   {
28562     resultobj=PyLong_FromLong(result);
28563     if (PyErr_Occurred()) SWIG_fail;
28564   }
28565   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
28566   return resultobj;
28567 fail:
28568   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
28569   return NULL;
28570 }
28571 
28572 
_wrap_asn1_time_print(PyObject * self,PyObject * args)28573 SWIGINTERN PyObject *_wrap_asn1_time_print(PyObject *self, PyObject *args) {
28574   PyObject *resultobj = 0;
28575   BIO *arg1 = (BIO *) 0 ;
28576   ASN1_TIME *arg2 = (ASN1_TIME *) 0 ;
28577   void *argp1 = 0 ;
28578   int res1 = 0 ;
28579   void *argp2 = 0 ;
28580   int res2 = 0 ;
28581   PyObject *swig_obj[2] ;
28582   int result;
28583 
28584   if (!SWIG_Python_UnpackTuple(args, "asn1_time_print", 2, 2, swig_obj)) SWIG_fail;
28585   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
28586   if (!SWIG_IsOK(res1)) {
28587     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_print" "', argument " "1"" of type '" "BIO *""'");
28588   }
28589   arg1 = (BIO *)(argp1);
28590   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_TIME, 0 |  0 );
28591   if (!SWIG_IsOK(res2)) {
28592     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_time_print" "', argument " "2"" of type '" "ASN1_TIME *""'");
28593   }
28594   arg2 = (ASN1_TIME *)(argp2);
28595   {
28596     if (!arg1) {
28597       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28598     }
28599   }
28600   {
28601     if (!arg2) {
28602       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28603     }
28604   }
28605   {
28606     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
28607     result = (int)ASN1_TIME_print(arg1,arg2);
28608     SWIG_PYTHON_THREAD_END_ALLOW;
28609   }
28610   {
28611     resultobj=PyLong_FromLong(result);
28612     if (PyErr_Occurred()) SWIG_fail;
28613   }
28614   return resultobj;
28615 fail:
28616   return NULL;
28617 }
28618 
28619 
_wrap_asn1_integer_new(PyObject * self,PyObject * args)28620 SWIGINTERN PyObject *_wrap_asn1_integer_new(PyObject *self, PyObject *args) {
28621   PyObject *resultobj = 0;
28622   ASN1_INTEGER *result = 0 ;
28623 
28624   if (!SWIG_Python_UnpackTuple(args, "asn1_integer_new", 0, 0, 0)) SWIG_fail;
28625   result = (ASN1_INTEGER *)ASN1_INTEGER_new();
28626   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_INTEGER, 0 |  0 );
28627   return resultobj;
28628 fail:
28629   return NULL;
28630 }
28631 
28632 
_wrap_asn1_integer_free(PyObject * self,PyObject * args)28633 SWIGINTERN PyObject *_wrap_asn1_integer_free(PyObject *self, PyObject *args) {
28634   PyObject *resultobj = 0;
28635   ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ;
28636   void *argp1 = 0 ;
28637   int res1 = 0 ;
28638   PyObject *swig_obj[1] ;
28639 
28640   if (!args) SWIG_fail;
28641   swig_obj[0] = args;
28642   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_INTEGER, 0 |  0 );
28643   if (!SWIG_IsOK(res1)) {
28644     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_free" "', argument " "1"" of type '" "ASN1_INTEGER *""'");
28645   }
28646   arg1 = (ASN1_INTEGER *)(argp1);
28647   {
28648     if (!arg1) {
28649       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28650     }
28651   }
28652   ASN1_INTEGER_free(arg1);
28653   resultobj = SWIG_Py_Void();
28654   return resultobj;
28655 fail:
28656   return NULL;
28657 }
28658 
28659 
_wrap_asn1_integer_cmp(PyObject * self,PyObject * args)28660 SWIGINTERN PyObject *_wrap_asn1_integer_cmp(PyObject *self, PyObject *args) {
28661   PyObject *resultobj = 0;
28662   ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ;
28663   ASN1_INTEGER *arg2 = (ASN1_INTEGER *) 0 ;
28664   void *argp1 = 0 ;
28665   int res1 = 0 ;
28666   void *argp2 = 0 ;
28667   int res2 = 0 ;
28668   PyObject *swig_obj[2] ;
28669   int result;
28670 
28671   if (!SWIG_Python_UnpackTuple(args, "asn1_integer_cmp", 2, 2, swig_obj)) SWIG_fail;
28672   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_INTEGER, 0 |  0 );
28673   if (!SWIG_IsOK(res1)) {
28674     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_cmp" "', argument " "1"" of type '" "ASN1_INTEGER *""'");
28675   }
28676   arg1 = (ASN1_INTEGER *)(argp1);
28677   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_ASN1_INTEGER, 0 |  0 );
28678   if (!SWIG_IsOK(res2)) {
28679     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "asn1_integer_cmp" "', argument " "2"" of type '" "ASN1_INTEGER *""'");
28680   }
28681   arg2 = (ASN1_INTEGER *)(argp2);
28682   {
28683     if (!arg1) {
28684       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28685     }
28686   }
28687   {
28688     if (!arg2) {
28689       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28690     }
28691   }
28692   result = (int)ASN1_INTEGER_cmp(arg1,arg2);
28693   {
28694     resultobj=PyLong_FromLong(result);
28695     if (PyErr_Occurred()) SWIG_fail;
28696   }
28697   return resultobj;
28698 fail:
28699   return NULL;
28700 }
28701 
28702 
_wrap_asn1_time_type_check(PyObject * self,PyObject * args)28703 SWIGINTERN PyObject *_wrap_asn1_time_type_check(PyObject *self, PyObject *args) {
28704   PyObject *resultobj = 0;
28705   ASN1_TIME *arg1 = (ASN1_TIME *) 0 ;
28706   void *argp1 = 0 ;
28707   int res1 = 0 ;
28708   PyObject *swig_obj[1] ;
28709   int result;
28710 
28711   if (!args) SWIG_fail;
28712   swig_obj[0] = args;
28713   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_TIME, 0 |  0 );
28714   if (!SWIG_IsOK(res1)) {
28715     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_time_type_check" "', argument " "1"" of type '" "ASN1_TIME *""'");
28716   }
28717   arg1 = (ASN1_TIME *)(argp1);
28718   {
28719     if (!arg1) {
28720       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28721     }
28722   }
28723   result = (int)asn1_time_type_check(arg1);
28724   {
28725     resultobj=PyLong_FromLong(result);
28726     if (PyErr_Occurred()) SWIG_fail;
28727   }
28728   return resultobj;
28729 fail:
28730   return NULL;
28731 }
28732 
28733 
_wrap_asn1_integer_get(PyObject * self,PyObject * args)28734 SWIGINTERN PyObject *_wrap_asn1_integer_get(PyObject *self, PyObject *args) {
28735   PyObject *resultobj = 0;
28736   ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ;
28737   void *argp1 = 0 ;
28738   int res1 = 0 ;
28739   PyObject *swig_obj[1] ;
28740   PyObject *result = 0 ;
28741 
28742   if (!args) SWIG_fail;
28743   swig_obj[0] = args;
28744   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_INTEGER, 0 |  0 );
28745   if (!SWIG_IsOK(res1)) {
28746     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_get" "', argument " "1"" of type '" "ASN1_INTEGER *""'");
28747   }
28748   arg1 = (ASN1_INTEGER *)(argp1);
28749   {
28750     if (!arg1) {
28751       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28752     }
28753   }
28754   result = (PyObject *)asn1_integer_get(arg1);
28755   {
28756     resultobj=result;
28757   }
28758   return resultobj;
28759 fail:
28760   return NULL;
28761 }
28762 
28763 
_wrap_asn1_integer_set(PyObject * self,PyObject * args)28764 SWIGINTERN PyObject *_wrap_asn1_integer_set(PyObject *self, PyObject *args) {
28765   PyObject *resultobj = 0;
28766   ASN1_INTEGER *arg1 = (ASN1_INTEGER *) 0 ;
28767   PyObject *arg2 = (PyObject *) 0 ;
28768   void *argp1 = 0 ;
28769   int res1 = 0 ;
28770   PyObject *swig_obj[2] ;
28771   int result;
28772 
28773   if (!SWIG_Python_UnpackTuple(args, "asn1_integer_set", 2, 2, swig_obj)) SWIG_fail;
28774   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_INTEGER, 0 |  0 );
28775   if (!SWIG_IsOK(res1)) {
28776     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "asn1_integer_set" "', argument " "1"" of type '" "ASN1_INTEGER *""'");
28777   }
28778   arg1 = (ASN1_INTEGER *)(argp1);
28779   {
28780     arg2=swig_obj[1];
28781   }
28782   {
28783     if (!arg1) {
28784       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28785     }
28786   }
28787   result = (int)asn1_integer_set(arg1,arg2);
28788   {
28789     resultobj=PyLong_FromLong(result);
28790     if (PyErr_Occurred()) SWIG_fail;
28791   }
28792   return resultobj;
28793 fail:
28794   return NULL;
28795 }
28796 
28797 
_wrap_pkcs7_new(PyObject * self,PyObject * args)28798 SWIGINTERN PyObject *_wrap_pkcs7_new(PyObject *self, PyObject *args) {
28799   PyObject *resultobj = 0;
28800   PKCS7 *result = 0 ;
28801 
28802   if (!SWIG_Python_UnpackTuple(args, "pkcs7_new", 0, 0, 0)) SWIG_fail;
28803   result = (PKCS7 *)PKCS7_new();
28804   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_PKCS7, 0 |  0 );
28805   return resultobj;
28806 fail:
28807   return NULL;
28808 }
28809 
28810 
_wrap_pkcs7_free(PyObject * self,PyObject * args)28811 SWIGINTERN PyObject *_wrap_pkcs7_free(PyObject *self, PyObject *args) {
28812   PyObject *resultobj = 0;
28813   PKCS7 *arg1 = (PKCS7 *) 0 ;
28814   void *argp1 = 0 ;
28815   int res1 = 0 ;
28816   PyObject *swig_obj[1] ;
28817 
28818   if (!args) SWIG_fail;
28819   swig_obj[0] = args;
28820   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 |  0 );
28821   if (!SWIG_IsOK(res1)) {
28822     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_free" "', argument " "1"" of type '" "PKCS7 *""'");
28823   }
28824   arg1 = (PKCS7 *)(argp1);
28825   {
28826     if (!arg1) {
28827       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28828     }
28829   }
28830   PKCS7_free(arg1);
28831   resultobj = SWIG_Py_Void();
28832   return resultobj;
28833 fail:
28834   return NULL;
28835 }
28836 
28837 
_wrap_pkcs7_add_certificate(PyObject * self,PyObject * args)28838 SWIGINTERN PyObject *_wrap_pkcs7_add_certificate(PyObject *self, PyObject *args) {
28839   PyObject *resultobj = 0;
28840   PKCS7 *arg1 = (PKCS7 *) 0 ;
28841   X509 *arg2 = (X509 *) 0 ;
28842   void *argp1 = 0 ;
28843   int res1 = 0 ;
28844   void *argp2 = 0 ;
28845   int res2 = 0 ;
28846   PyObject *swig_obj[2] ;
28847 
28848   if (!SWIG_Python_UnpackTuple(args, "pkcs7_add_certificate", 2, 2, swig_obj)) SWIG_fail;
28849   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 |  0 );
28850   if (!SWIG_IsOK(res1)) {
28851     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_add_certificate" "', argument " "1"" of type '" "PKCS7 *""'");
28852   }
28853   arg1 = (PKCS7 *)(argp1);
28854   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_X509, 0 |  0 );
28855   if (!SWIG_IsOK(res2)) {
28856     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_add_certificate" "', argument " "2"" of type '" "X509 *""'");
28857   }
28858   arg2 = (X509 *)(argp2);
28859   {
28860     if (!arg1) {
28861       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28862     }
28863   }
28864   {
28865     if (!arg2) {
28866       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
28867     }
28868   }
28869   PKCS7_add_certificate(arg1,arg2);
28870   resultobj = SWIG_Py_Void();
28871   return resultobj;
28872 fail:
28873   return NULL;
28874 }
28875 
28876 
Swig_var__pkcs7_err_set(PyObject * _val)28877 SWIGINTERN int Swig_var__pkcs7_err_set(PyObject *_val) {
28878   {
28879     void *argp = 0;
28880     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
28881     if (!SWIG_IsOK(res)) {
28882       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_pkcs7_err""' of type '""PyObject *""'");
28883     }
28884     _pkcs7_err = (PyObject *)(argp);
28885   }
28886   return 0;
28887 fail:
28888   return 1;
28889 }
28890 
28891 
Swig_var__pkcs7_err_get(void)28892 SWIGINTERN PyObject *Swig_var__pkcs7_err_get(void) {
28893   PyObject *pyobj = 0;
28894   PyObject *self = 0;
28895 
28896   (void)self;
28897   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_pkcs7_err), SWIGTYPE_p_PyObject,  0 );
28898   return pyobj;
28899 }
28900 
28901 
Swig_var__smime_err_set(PyObject * _val)28902 SWIGINTERN int Swig_var__smime_err_set(PyObject *_val) {
28903   {
28904     void *argp = 0;
28905     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
28906     if (!SWIG_IsOK(res)) {
28907       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_smime_err""' of type '""PyObject *""'");
28908     }
28909     _smime_err = (PyObject *)(argp);
28910   }
28911   return 0;
28912 fail:
28913   return 1;
28914 }
28915 
28916 
Swig_var__smime_err_get(void)28917 SWIGINTERN PyObject *Swig_var__smime_err_get(void) {
28918   PyObject *pyobj = 0;
28919   PyObject *self = 0;
28920 
28921   (void)self;
28922   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_smime_err), SWIGTYPE_p_PyObject,  0 );
28923   return pyobj;
28924 }
28925 
28926 
_wrap_pkcs7_init(PyObject * self,PyObject * args)28927 SWIGINTERN PyObject *_wrap_pkcs7_init(PyObject *self, PyObject *args) {
28928   PyObject *resultobj = 0;
28929   PyObject *arg1 = (PyObject *) 0 ;
28930   PyObject *swig_obj[1] ;
28931 
28932   if (!args) SWIG_fail;
28933   swig_obj[0] = args;
28934   {
28935     arg1=swig_obj[0];
28936   }
28937   pkcs7_init(arg1);
28938   resultobj = SWIG_Py_Void();
28939   return resultobj;
28940 fail:
28941   return NULL;
28942 }
28943 
28944 
_wrap_smime_init(PyObject * self,PyObject * args)28945 SWIGINTERN PyObject *_wrap_smime_init(PyObject *self, PyObject *args) {
28946   PyObject *resultobj = 0;
28947   PyObject *arg1 = (PyObject *) 0 ;
28948   PyObject *swig_obj[1] ;
28949 
28950   if (!args) SWIG_fail;
28951   swig_obj[0] = args;
28952   {
28953     arg1=swig_obj[0];
28954   }
28955   smime_init(arg1);
28956   resultobj = SWIG_Py_Void();
28957   return resultobj;
28958 fail:
28959   return NULL;
28960 }
28961 
28962 
_wrap_pkcs7_decrypt(PyObject * self,PyObject * args)28963 SWIGINTERN PyObject *_wrap_pkcs7_decrypt(PyObject *self, PyObject *args) {
28964   PyObject *resultobj = 0;
28965   PKCS7 *arg1 = (PKCS7 *) 0 ;
28966   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
28967   X509 *arg3 = (X509 *) 0 ;
28968   int arg4 ;
28969   void *argp1 = 0 ;
28970   int res1 = 0 ;
28971   void *argp2 = 0 ;
28972   int res2 = 0 ;
28973   void *argp3 = 0 ;
28974   int res3 = 0 ;
28975   int val4 ;
28976   int ecode4 = 0 ;
28977   PyObject *swig_obj[4] ;
28978   PyObject *result = 0 ;
28979 
28980   if (!SWIG_Python_UnpackTuple(args, "pkcs7_decrypt", 4, 4, swig_obj)) SWIG_fail;
28981   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 |  0 );
28982   if (!SWIG_IsOK(res1)) {
28983     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_decrypt" "', argument " "1"" of type '" "PKCS7 *""'");
28984   }
28985   arg1 = (PKCS7 *)(argp1);
28986   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
28987   if (!SWIG_IsOK(res2)) {
28988     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_decrypt" "', argument " "2"" of type '" "EVP_PKEY *""'");
28989   }
28990   arg2 = (EVP_PKEY *)(argp2);
28991   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_X509, 0 |  0 );
28992   if (!SWIG_IsOK(res3)) {
28993     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_decrypt" "', argument " "3"" of type '" "X509 *""'");
28994   }
28995   arg3 = (X509 *)(argp3);
28996   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
28997   if (!SWIG_IsOK(ecode4)) {
28998     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pkcs7_decrypt" "', argument " "4"" of type '" "int""'");
28999   }
29000   arg4 = (int)(val4);
29001   {
29002     if (!arg1) {
29003       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29004     }
29005   }
29006   {
29007     if (!arg2) {
29008       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29009     }
29010   }
29011   {
29012     if (!arg3) {
29013       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29014     }
29015   }
29016   result = (PyObject *)pkcs7_decrypt(arg1,arg2,arg3,arg4);
29017   {
29018     resultobj=result;
29019   }
29020   return resultobj;
29021 fail:
29022   return NULL;
29023 }
29024 
29025 
_wrap_pkcs7_encrypt(PyObject * self,PyObject * args)29026 SWIGINTERN PyObject *_wrap_pkcs7_encrypt(PyObject *self, PyObject *args) {
29027   PyObject *resultobj = 0;
29028   struct stack_st_X509 *arg1 = (struct stack_st_X509 *) 0 ;
29029   BIO *arg2 = (BIO *) 0 ;
29030   EVP_CIPHER *arg3 = (EVP_CIPHER *) 0 ;
29031   int arg4 ;
29032   void *argp1 = 0 ;
29033   int res1 = 0 ;
29034   void *argp2 = 0 ;
29035   int res2 = 0 ;
29036   void *argp3 = 0 ;
29037   int res3 = 0 ;
29038   int val4 ;
29039   int ecode4 = 0 ;
29040   PyObject *swig_obj[4] ;
29041   PKCS7 *result = 0 ;
29042 
29043   if (!SWIG_Python_UnpackTuple(args, "pkcs7_encrypt", 4, 4, swig_obj)) SWIG_fail;
29044   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_stack_st_X509, 0 |  0 );
29045   if (!SWIG_IsOK(res1)) {
29046     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_encrypt" "', argument " "1"" of type '" "struct stack_st_X509 *""'");
29047   }
29048   arg1 = (struct stack_st_X509 *)(argp1);
29049   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
29050   if (!SWIG_IsOK(res2)) {
29051     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_encrypt" "', argument " "2"" of type '" "BIO *""'");
29052   }
29053   arg2 = (BIO *)(argp2);
29054   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
29055   if (!SWIG_IsOK(res3)) {
29056     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_encrypt" "', argument " "3"" of type '" "EVP_CIPHER *""'");
29057   }
29058   arg3 = (EVP_CIPHER *)(argp3);
29059   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
29060   if (!SWIG_IsOK(ecode4)) {
29061     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pkcs7_encrypt" "', argument " "4"" of type '" "int""'");
29062   }
29063   arg4 = (int)(val4);
29064   {
29065     if (!arg1) {
29066       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29067     }
29068   }
29069   {
29070     if (!arg2) {
29071       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29072     }
29073   }
29074   {
29075     if (!arg3) {
29076       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29077     }
29078   }
29079   {
29080     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29081     result = (PKCS7 *)pkcs7_encrypt(arg1,arg2,arg3,arg4);
29082     SWIG_PYTHON_THREAD_END_ALLOW;
29083   }
29084   {
29085     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
29086 
29087     if (result != NULL)
29088     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_PKCS7, 0);
29089     else {
29090       m2_PyErr_Msg(_smime_err);
29091       resultobj = NULL;
29092     }
29093   }
29094   return resultobj;
29095 fail:
29096   return NULL;
29097 }
29098 
29099 
_wrap_pkcs7_sign1(PyObject * self,PyObject * args)29100 SWIGINTERN PyObject *_wrap_pkcs7_sign1(PyObject *self, PyObject *args) {
29101   PyObject *resultobj = 0;
29102   X509 *arg1 = (X509 *) 0 ;
29103   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
29104   struct stack_st_X509 *arg3 = (struct stack_st_X509 *) 0 ;
29105   BIO *arg4 = (BIO *) 0 ;
29106   EVP_MD *arg5 = (EVP_MD *) 0 ;
29107   int arg6 ;
29108   void *argp1 = 0 ;
29109   int res1 = 0 ;
29110   void *argp2 = 0 ;
29111   int res2 = 0 ;
29112   void *argp3 = 0 ;
29113   int res3 = 0 ;
29114   void *argp4 = 0 ;
29115   int res4 = 0 ;
29116   void *argp5 = 0 ;
29117   int res5 = 0 ;
29118   int val6 ;
29119   int ecode6 = 0 ;
29120   PyObject *swig_obj[6] ;
29121   PKCS7 *result = 0 ;
29122 
29123   if (!SWIG_Python_UnpackTuple(args, "pkcs7_sign1", 6, 6, swig_obj)) SWIG_fail;
29124   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
29125   if (!SWIG_IsOK(res1)) {
29126     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_sign1" "', argument " "1"" of type '" "X509 *""'");
29127   }
29128   arg1 = (X509 *)(argp1);
29129   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
29130   if (!SWIG_IsOK(res2)) {
29131     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_sign1" "', argument " "2"" of type '" "EVP_PKEY *""'");
29132   }
29133   arg2 = (EVP_PKEY *)(argp2);
29134   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_stack_st_X509, 0 |  0 );
29135   if (!SWIG_IsOK(res3)) {
29136     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_sign1" "', argument " "3"" of type '" "struct stack_st_X509 *""'");
29137   }
29138   arg3 = (struct stack_st_X509 *)(argp3);
29139   res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_BIO, 0 |  0 );
29140   if (!SWIG_IsOK(res4)) {
29141     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "pkcs7_sign1" "', argument " "4"" of type '" "BIO *""'");
29142   }
29143   arg4 = (BIO *)(argp4);
29144   res5 = SWIG_ConvertPtr(swig_obj[4], &argp5,SWIGTYPE_p_EVP_MD, 0 |  0 );
29145   if (!SWIG_IsOK(res5)) {
29146     SWIG_exception_fail(SWIG_ArgError(res5), "in method '" "pkcs7_sign1" "', argument " "5"" of type '" "EVP_MD *""'");
29147   }
29148   arg5 = (EVP_MD *)(argp5);
29149   ecode6 = SWIG_AsVal_int(swig_obj[5], &val6);
29150   if (!SWIG_IsOK(ecode6)) {
29151     SWIG_exception_fail(SWIG_ArgError(ecode6), "in method '" "pkcs7_sign1" "', argument " "6"" of type '" "int""'");
29152   }
29153   arg6 = (int)(val6);
29154   {
29155     if (!arg1) {
29156       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29157     }
29158   }
29159   {
29160     if (!arg2) {
29161       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29162     }
29163   }
29164   {
29165     if (!arg3) {
29166       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29167     }
29168   }
29169   {
29170     if (!arg4) {
29171       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29172     }
29173   }
29174   {
29175     if (!arg5) {
29176       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29177     }
29178   }
29179   {
29180     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29181     result = (PKCS7 *)pkcs7_sign1(arg1,arg2,arg3,arg4,arg5,arg6);
29182     SWIG_PYTHON_THREAD_END_ALLOW;
29183   }
29184   {
29185     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
29186 
29187     if (result != NULL)
29188     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_PKCS7, 0);
29189     else {
29190       m2_PyErr_Msg(_smime_err);
29191       resultobj = NULL;
29192     }
29193   }
29194   return resultobj;
29195 fail:
29196   return NULL;
29197 }
29198 
29199 
_wrap_pkcs7_sign0(PyObject * self,PyObject * args)29200 SWIGINTERN PyObject *_wrap_pkcs7_sign0(PyObject *self, PyObject *args) {
29201   PyObject *resultobj = 0;
29202   X509 *arg1 = (X509 *) 0 ;
29203   EVP_PKEY *arg2 = (EVP_PKEY *) 0 ;
29204   BIO *arg3 = (BIO *) 0 ;
29205   EVP_MD *arg4 = (EVP_MD *) 0 ;
29206   int arg5 ;
29207   void *argp1 = 0 ;
29208   int res1 = 0 ;
29209   void *argp2 = 0 ;
29210   int res2 = 0 ;
29211   void *argp3 = 0 ;
29212   int res3 = 0 ;
29213   void *argp4 = 0 ;
29214   int res4 = 0 ;
29215   int val5 ;
29216   int ecode5 = 0 ;
29217   PyObject *swig_obj[5] ;
29218   PKCS7 *result = 0 ;
29219 
29220   if (!SWIG_Python_UnpackTuple(args, "pkcs7_sign0", 5, 5, swig_obj)) SWIG_fail;
29221   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_X509, 0 |  0 );
29222   if (!SWIG_IsOK(res1)) {
29223     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_sign0" "', argument " "1"" of type '" "X509 *""'");
29224   }
29225   arg1 = (X509 *)(argp1);
29226   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EVP_PKEY, 0 |  0 );
29227   if (!SWIG_IsOK(res2)) {
29228     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_sign0" "', argument " "2"" of type '" "EVP_PKEY *""'");
29229   }
29230   arg2 = (EVP_PKEY *)(argp2);
29231   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_BIO, 0 |  0 );
29232   if (!SWIG_IsOK(res3)) {
29233     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_sign0" "', argument " "3"" of type '" "BIO *""'");
29234   }
29235   arg3 = (BIO *)(argp3);
29236   res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_EVP_MD, 0 |  0 );
29237   if (!SWIG_IsOK(res4)) {
29238     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "pkcs7_sign0" "', argument " "4"" of type '" "EVP_MD *""'");
29239   }
29240   arg4 = (EVP_MD *)(argp4);
29241   ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
29242   if (!SWIG_IsOK(ecode5)) {
29243     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "pkcs7_sign0" "', argument " "5"" of type '" "int""'");
29244   }
29245   arg5 = (int)(val5);
29246   {
29247     if (!arg1) {
29248       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29249     }
29250   }
29251   {
29252     if (!arg2) {
29253       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29254     }
29255   }
29256   {
29257     if (!arg3) {
29258       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29259     }
29260   }
29261   {
29262     if (!arg4) {
29263       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29264     }
29265   }
29266   {
29267     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29268     result = (PKCS7 *)pkcs7_sign0(arg1,arg2,arg3,arg4,arg5);
29269     SWIG_PYTHON_THREAD_END_ALLOW;
29270   }
29271   {
29272     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
29273 
29274     if (result != NULL)
29275     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_PKCS7, 0);
29276     else {
29277       m2_PyErr_Msg(_smime_err);
29278       resultobj = NULL;
29279     }
29280   }
29281   return resultobj;
29282 fail:
29283   return NULL;
29284 }
29285 
29286 
_wrap_pkcs7_read_bio(PyObject * self,PyObject * args)29287 SWIGINTERN PyObject *_wrap_pkcs7_read_bio(PyObject *self, PyObject *args) {
29288   PyObject *resultobj = 0;
29289   BIO *arg1 = (BIO *) 0 ;
29290   void *argp1 = 0 ;
29291   int res1 = 0 ;
29292   PyObject *swig_obj[1] ;
29293   PKCS7 *result = 0 ;
29294 
29295   if (!args) SWIG_fail;
29296   swig_obj[0] = args;
29297   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
29298   if (!SWIG_IsOK(res1)) {
29299     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_read_bio" "', argument " "1"" of type '" "BIO *""'");
29300   }
29301   arg1 = (BIO *)(argp1);
29302   {
29303     if (!arg1) {
29304       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29305     }
29306   }
29307   {
29308     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29309     result = (PKCS7 *)pkcs7_read_bio(arg1);
29310     SWIG_PYTHON_THREAD_END_ALLOW;
29311   }
29312   {
29313     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
29314 
29315     if (result != NULL)
29316     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_PKCS7, 0);
29317     else {
29318       m2_PyErr_Msg(_pkcs7_err);
29319       resultobj = NULL;
29320     }
29321   }
29322   return resultobj;
29323 fail:
29324   return NULL;
29325 }
29326 
29327 
_wrap_pkcs7_read_bio_der(PyObject * self,PyObject * args)29328 SWIGINTERN PyObject *_wrap_pkcs7_read_bio_der(PyObject *self, PyObject *args) {
29329   PyObject *resultobj = 0;
29330   BIO *arg1 = (BIO *) 0 ;
29331   void *argp1 = 0 ;
29332   int res1 = 0 ;
29333   PyObject *swig_obj[1] ;
29334   PKCS7 *result = 0 ;
29335 
29336   if (!args) SWIG_fail;
29337   swig_obj[0] = args;
29338   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
29339   if (!SWIG_IsOK(res1)) {
29340     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_read_bio_der" "', argument " "1"" of type '" "BIO *""'");
29341   }
29342   arg1 = (BIO *)(argp1);
29343   {
29344     if (!arg1) {
29345       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29346     }
29347   }
29348   {
29349     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29350     result = (PKCS7 *)pkcs7_read_bio_der(arg1);
29351     SWIG_PYTHON_THREAD_END_ALLOW;
29352   }
29353   {
29354     PyObject *self = NULL; /* bug in SWIG_NewPointerObj as of 3.0.5 */
29355 
29356     if (result != NULL)
29357     resultobj = SWIG_NewPointerObj(result, SWIGTYPE_p_PKCS7, 0);
29358     else {
29359       m2_PyErr_Msg(_pkcs7_err);
29360       resultobj = NULL;
29361     }
29362   }
29363   return resultobj;
29364 fail:
29365   return NULL;
29366 }
29367 
29368 
_wrap_pkcs7_verify1(PyObject * self,PyObject * args)29369 SWIGINTERN PyObject *_wrap_pkcs7_verify1(PyObject *self, PyObject *args) {
29370   PyObject *resultobj = 0;
29371   PKCS7 *arg1 = (PKCS7 *) 0 ;
29372   struct stack_st_X509 *arg2 = (struct stack_st_X509 *) 0 ;
29373   X509_STORE *arg3 = (X509_STORE *) 0 ;
29374   BIO *arg4 = (BIO *) 0 ;
29375   int arg5 ;
29376   void *argp1 = 0 ;
29377   int res1 = 0 ;
29378   void *argp2 = 0 ;
29379   int res2 = 0 ;
29380   void *argp3 = 0 ;
29381   int res3 = 0 ;
29382   void *argp4 = 0 ;
29383   int res4 = 0 ;
29384   int val5 ;
29385   int ecode5 = 0 ;
29386   PyObject *swig_obj[5] ;
29387   PyObject *result = 0 ;
29388 
29389   if (!SWIG_Python_UnpackTuple(args, "pkcs7_verify1", 5, 5, swig_obj)) SWIG_fail;
29390   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 |  0 );
29391   if (!SWIG_IsOK(res1)) {
29392     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_verify1" "', argument " "1"" of type '" "PKCS7 *""'");
29393   }
29394   arg1 = (PKCS7 *)(argp1);
29395   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_stack_st_X509, 0 |  0 );
29396   if (!SWIG_IsOK(res2)) {
29397     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_verify1" "', argument " "2"" of type '" "struct stack_st_X509 *""'");
29398   }
29399   arg2 = (struct stack_st_X509 *)(argp2);
29400   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_X509_STORE, 0 |  0 );
29401   if (!SWIG_IsOK(res3)) {
29402     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_verify1" "', argument " "3"" of type '" "X509_STORE *""'");
29403   }
29404   arg3 = (X509_STORE *)(argp3);
29405   res4 = SWIG_ConvertPtr(swig_obj[3], &argp4,SWIGTYPE_p_BIO, 0 |  0 );
29406   if (!SWIG_IsOK(res4)) {
29407     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "pkcs7_verify1" "', argument " "4"" of type '" "BIO *""'");
29408   }
29409   arg4 = (BIO *)(argp4);
29410   ecode5 = SWIG_AsVal_int(swig_obj[4], &val5);
29411   if (!SWIG_IsOK(ecode5)) {
29412     SWIG_exception_fail(SWIG_ArgError(ecode5), "in method '" "pkcs7_verify1" "', argument " "5"" of type '" "int""'");
29413   }
29414   arg5 = (int)(val5);
29415   {
29416     if (!arg1) {
29417       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29418     }
29419   }
29420   {
29421     if (!arg2) {
29422       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29423     }
29424   }
29425   {
29426     if (!arg4) {
29427       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29428     }
29429   }
29430   result = (PyObject *)pkcs7_verify1(arg1,arg2,arg3,arg4,arg5);
29431   {
29432     resultobj=result;
29433   }
29434   return resultobj;
29435 fail:
29436   return NULL;
29437 }
29438 
29439 
_wrap_pkcs7_verify0(PyObject * self,PyObject * args)29440 SWIGINTERN PyObject *_wrap_pkcs7_verify0(PyObject *self, PyObject *args) {
29441   PyObject *resultobj = 0;
29442   PKCS7 *arg1 = (PKCS7 *) 0 ;
29443   struct stack_st_X509 *arg2 = (struct stack_st_X509 *) 0 ;
29444   X509_STORE *arg3 = (X509_STORE *) 0 ;
29445   int arg4 ;
29446   void *argp1 = 0 ;
29447   int res1 = 0 ;
29448   void *argp2 = 0 ;
29449   int res2 = 0 ;
29450   void *argp3 = 0 ;
29451   int res3 = 0 ;
29452   int val4 ;
29453   int ecode4 = 0 ;
29454   PyObject *swig_obj[4] ;
29455   PyObject *result = 0 ;
29456 
29457   if (!SWIG_Python_UnpackTuple(args, "pkcs7_verify0", 4, 4, swig_obj)) SWIG_fail;
29458   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 |  0 );
29459   if (!SWIG_IsOK(res1)) {
29460     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_verify0" "', argument " "1"" of type '" "PKCS7 *""'");
29461   }
29462   arg1 = (PKCS7 *)(argp1);
29463   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_stack_st_X509, 0 |  0 );
29464   if (!SWIG_IsOK(res2)) {
29465     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_verify0" "', argument " "2"" of type '" "struct stack_st_X509 *""'");
29466   }
29467   arg2 = (struct stack_st_X509 *)(argp2);
29468   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_X509_STORE, 0 |  0 );
29469   if (!SWIG_IsOK(res3)) {
29470     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "pkcs7_verify0" "', argument " "3"" of type '" "X509_STORE *""'");
29471   }
29472   arg3 = (X509_STORE *)(argp3);
29473   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
29474   if (!SWIG_IsOK(ecode4)) {
29475     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "pkcs7_verify0" "', argument " "4"" of type '" "int""'");
29476   }
29477   arg4 = (int)(val4);
29478   {
29479     if (!arg1) {
29480       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29481     }
29482   }
29483   {
29484     if (!arg2) {
29485       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29486     }
29487   }
29488   result = (PyObject *)pkcs7_verify0(arg1,arg2,arg3,arg4);
29489   {
29490     resultobj=result;
29491   }
29492   return resultobj;
29493 fail:
29494   return NULL;
29495 }
29496 
29497 
_wrap_smime_write_pkcs7_multi(PyObject * self,PyObject * args)29498 SWIGINTERN PyObject *_wrap_smime_write_pkcs7_multi(PyObject *self, PyObject *args) {
29499   PyObject *resultobj = 0;
29500   BIO *arg1 = (BIO *) 0 ;
29501   PKCS7 *arg2 = (PKCS7 *) 0 ;
29502   BIO *arg3 = (BIO *) 0 ;
29503   int arg4 ;
29504   void *argp1 = 0 ;
29505   int res1 = 0 ;
29506   void *argp2 = 0 ;
29507   int res2 = 0 ;
29508   void *argp3 = 0 ;
29509   int res3 = 0 ;
29510   int val4 ;
29511   int ecode4 = 0 ;
29512   PyObject *swig_obj[4] ;
29513   int result;
29514 
29515   if (!SWIG_Python_UnpackTuple(args, "smime_write_pkcs7_multi", 4, 4, swig_obj)) SWIG_fail;
29516   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
29517   if (!SWIG_IsOK(res1)) {
29518     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smime_write_pkcs7_multi" "', argument " "1"" of type '" "BIO *""'");
29519   }
29520   arg1 = (BIO *)(argp1);
29521   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_PKCS7, 0 |  0 );
29522   if (!SWIG_IsOK(res2)) {
29523     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "smime_write_pkcs7_multi" "', argument " "2"" of type '" "PKCS7 *""'");
29524   }
29525   arg2 = (PKCS7 *)(argp2);
29526   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_BIO, 0 |  0 );
29527   if (!SWIG_IsOK(res3)) {
29528     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "smime_write_pkcs7_multi" "', argument " "3"" of type '" "BIO *""'");
29529   }
29530   arg3 = (BIO *)(argp3);
29531   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
29532   if (!SWIG_IsOK(ecode4)) {
29533     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "smime_write_pkcs7_multi" "', argument " "4"" of type '" "int""'");
29534   }
29535   arg4 = (int)(val4);
29536   {
29537     if (!arg1) {
29538       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29539     }
29540   }
29541   {
29542     if (!arg2) {
29543       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29544     }
29545   }
29546   {
29547     if (!arg3) {
29548       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29549     }
29550   }
29551   {
29552     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29553     result = (int)smime_write_pkcs7_multi(arg1,arg2,arg3,arg4);
29554     SWIG_PYTHON_THREAD_END_ALLOW;
29555   }
29556   {
29557     resultobj=PyLong_FromLong(result);
29558     if (PyErr_Occurred()) SWIG_fail;
29559   }
29560   return resultobj;
29561 fail:
29562   return NULL;
29563 }
29564 
29565 
_wrap_smime_write_pkcs7(PyObject * self,PyObject * args)29566 SWIGINTERN PyObject *_wrap_smime_write_pkcs7(PyObject *self, PyObject *args) {
29567   PyObject *resultobj = 0;
29568   BIO *arg1 = (BIO *) 0 ;
29569   PKCS7 *arg2 = (PKCS7 *) 0 ;
29570   int arg3 ;
29571   void *argp1 = 0 ;
29572   int res1 = 0 ;
29573   void *argp2 = 0 ;
29574   int res2 = 0 ;
29575   int val3 ;
29576   int ecode3 = 0 ;
29577   PyObject *swig_obj[3] ;
29578   int result;
29579 
29580   if (!SWIG_Python_UnpackTuple(args, "smime_write_pkcs7", 3, 3, swig_obj)) SWIG_fail;
29581   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
29582   if (!SWIG_IsOK(res1)) {
29583     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smime_write_pkcs7" "', argument " "1"" of type '" "BIO *""'");
29584   }
29585   arg1 = (BIO *)(argp1);
29586   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_PKCS7, 0 |  0 );
29587   if (!SWIG_IsOK(res2)) {
29588     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "smime_write_pkcs7" "', argument " "2"" of type '" "PKCS7 *""'");
29589   }
29590   arg2 = (PKCS7 *)(argp2);
29591   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
29592   if (!SWIG_IsOK(ecode3)) {
29593     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "smime_write_pkcs7" "', argument " "3"" of type '" "int""'");
29594   }
29595   arg3 = (int)(val3);
29596   {
29597     if (!arg1) {
29598       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29599     }
29600   }
29601   {
29602     if (!arg2) {
29603       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29604     }
29605   }
29606   {
29607     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29608     result = (int)smime_write_pkcs7(arg1,arg2,arg3);
29609     SWIG_PYTHON_THREAD_END_ALLOW;
29610   }
29611   {
29612     resultobj=PyLong_FromLong(result);
29613     if (PyErr_Occurred()) SWIG_fail;
29614   }
29615   return resultobj;
29616 fail:
29617   return NULL;
29618 }
29619 
29620 
_wrap_smime_read_pkcs7(PyObject * self,PyObject * args)29621 SWIGINTERN PyObject *_wrap_smime_read_pkcs7(PyObject *self, PyObject *args) {
29622   PyObject *resultobj = 0;
29623   BIO *arg1 = (BIO *) 0 ;
29624   void *argp1 = 0 ;
29625   int res1 = 0 ;
29626   PyObject *swig_obj[1] ;
29627   PyObject *result = 0 ;
29628 
29629   if (!args) SWIG_fail;
29630   swig_obj[0] = args;
29631   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
29632   if (!SWIG_IsOK(res1)) {
29633     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smime_read_pkcs7" "', argument " "1"" of type '" "BIO *""'");
29634   }
29635   arg1 = (BIO *)(argp1);
29636   {
29637     if (!arg1) {
29638       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29639     }
29640   }
29641   result = (PyObject *)smime_read_pkcs7(arg1);
29642   {
29643     resultobj=result;
29644   }
29645   return resultobj;
29646 fail:
29647   return NULL;
29648 }
29649 
29650 
_wrap_pkcs7_write_bio(PyObject * self,PyObject * args)29651 SWIGINTERN PyObject *_wrap_pkcs7_write_bio(PyObject *self, PyObject *args) {
29652   PyObject *resultobj = 0;
29653   PKCS7 *arg1 = (PKCS7 *) 0 ;
29654   BIO *arg2 = (BIO *) 0 ;
29655   void *argp1 = 0 ;
29656   int res1 = 0 ;
29657   void *argp2 = 0 ;
29658   int res2 = 0 ;
29659   PyObject *swig_obj[2] ;
29660   int result;
29661 
29662   if (!SWIG_Python_UnpackTuple(args, "pkcs7_write_bio", 2, 2, swig_obj)) SWIG_fail;
29663   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 |  0 );
29664   if (!SWIG_IsOK(res1)) {
29665     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_write_bio" "', argument " "1"" of type '" "PKCS7 *""'");
29666   }
29667   arg1 = (PKCS7 *)(argp1);
29668   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
29669   if (!SWIG_IsOK(res2)) {
29670     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_write_bio" "', argument " "2"" of type '" "BIO *""'");
29671   }
29672   arg2 = (BIO *)(argp2);
29673   {
29674     if (!arg1) {
29675       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29676     }
29677   }
29678   {
29679     if (!arg2) {
29680       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29681     }
29682   }
29683   {
29684     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29685     result = (int)pkcs7_write_bio(arg1,arg2);
29686     SWIG_PYTHON_THREAD_END_ALLOW;
29687   }
29688   {
29689     resultobj=PyLong_FromLong(result);
29690     if (PyErr_Occurred()) SWIG_fail;
29691   }
29692   return resultobj;
29693 fail:
29694   return NULL;
29695 }
29696 
29697 
_wrap_pkcs7_write_bio_der(PyObject * self,PyObject * args)29698 SWIGINTERN PyObject *_wrap_pkcs7_write_bio_der(PyObject *self, PyObject *args) {
29699   PyObject *resultobj = 0;
29700   PKCS7 *arg1 = (PKCS7 *) 0 ;
29701   BIO *arg2 = (BIO *) 0 ;
29702   void *argp1 = 0 ;
29703   int res1 = 0 ;
29704   void *argp2 = 0 ;
29705   int res2 = 0 ;
29706   PyObject *swig_obj[2] ;
29707   int result;
29708 
29709   if (!SWIG_Python_UnpackTuple(args, "pkcs7_write_bio_der", 2, 2, swig_obj)) SWIG_fail;
29710   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 |  0 );
29711   if (!SWIG_IsOK(res1)) {
29712     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_write_bio_der" "', argument " "1"" of type '" "PKCS7 *""'");
29713   }
29714   arg1 = (PKCS7 *)(argp1);
29715   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
29716   if (!SWIG_IsOK(res2)) {
29717     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_write_bio_der" "', argument " "2"" of type '" "BIO *""'");
29718   }
29719   arg2 = (BIO *)(argp2);
29720   {
29721     if (!arg1) {
29722       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29723     }
29724   }
29725   {
29726     if (!arg2) {
29727       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29728     }
29729   }
29730   {
29731     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29732     result = (int)pkcs7_write_bio_der(arg1,arg2);
29733     SWIG_PYTHON_THREAD_END_ALLOW;
29734   }
29735   {
29736     resultobj=PyLong_FromLong(result);
29737     if (PyErr_Occurred()) SWIG_fail;
29738   }
29739   return resultobj;
29740 fail:
29741   return NULL;
29742 }
29743 
29744 
_wrap_pkcs7_type_nid(PyObject * self,PyObject * args)29745 SWIGINTERN PyObject *_wrap_pkcs7_type_nid(PyObject *self, PyObject *args) {
29746   PyObject *resultobj = 0;
29747   PKCS7 *arg1 = (PKCS7 *) 0 ;
29748   void *argp1 = 0 ;
29749   int res1 = 0 ;
29750   PyObject *swig_obj[1] ;
29751   int result;
29752 
29753   if (!args) SWIG_fail;
29754   swig_obj[0] = args;
29755   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 |  0 );
29756   if (!SWIG_IsOK(res1)) {
29757     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_type_nid" "', argument " "1"" of type '" "PKCS7 *""'");
29758   }
29759   arg1 = (PKCS7 *)(argp1);
29760   {
29761     if (!arg1) {
29762       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29763     }
29764   }
29765   result = (int)pkcs7_type_nid(arg1);
29766   {
29767     resultobj=PyLong_FromLong(result);
29768     if (PyErr_Occurred()) SWIG_fail;
29769   }
29770   return resultobj;
29771 fail:
29772   return NULL;
29773 }
29774 
29775 
_wrap_pkcs7_type_sn(PyObject * self,PyObject * args)29776 SWIGINTERN PyObject *_wrap_pkcs7_type_sn(PyObject *self, PyObject *args) {
29777   PyObject *resultobj = 0;
29778   PKCS7 *arg1 = (PKCS7 *) 0 ;
29779   void *argp1 = 0 ;
29780   int res1 = 0 ;
29781   PyObject *swig_obj[1] ;
29782   char *result = 0 ;
29783 
29784   if (!args) SWIG_fail;
29785   swig_obj[0] = args;
29786   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 |  0 );
29787   if (!SWIG_IsOK(res1)) {
29788     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_type_sn" "', argument " "1"" of type '" "PKCS7 *""'");
29789   }
29790   arg1 = (PKCS7 *)(argp1);
29791   {
29792     if (!arg1) {
29793       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29794     }
29795   }
29796   result = (char *)pkcs7_type_sn(arg1);
29797   resultobj = SWIG_FromCharPtr((const char *)result);
29798   return resultobj;
29799 fail:
29800   return NULL;
29801 }
29802 
29803 
_wrap_smime_crlf_copy(PyObject * self,PyObject * args)29804 SWIGINTERN PyObject *_wrap_smime_crlf_copy(PyObject *self, PyObject *args) {
29805   PyObject *resultobj = 0;
29806   BIO *arg1 = (BIO *) 0 ;
29807   BIO *arg2 = (BIO *) 0 ;
29808   void *argp1 = 0 ;
29809   int res1 = 0 ;
29810   void *argp2 = 0 ;
29811   int res2 = 0 ;
29812   PyObject *swig_obj[2] ;
29813   int result;
29814 
29815   if (!SWIG_Python_UnpackTuple(args, "smime_crlf_copy", 2, 2, swig_obj)) SWIG_fail;
29816   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
29817   if (!SWIG_IsOK(res1)) {
29818     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "smime_crlf_copy" "', argument " "1"" of type '" "BIO *""'");
29819   }
29820   arg1 = (BIO *)(argp1);
29821   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
29822   if (!SWIG_IsOK(res2)) {
29823     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "smime_crlf_copy" "', argument " "2"" of type '" "BIO *""'");
29824   }
29825   arg2 = (BIO *)(argp2);
29826   {
29827     if (!arg1) {
29828       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29829     }
29830   }
29831   {
29832     if (!arg2) {
29833       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29834     }
29835   }
29836   {
29837     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
29838     result = (int)smime_crlf_copy(arg1,arg2);
29839     SWIG_PYTHON_THREAD_END_ALLOW;
29840   }
29841   {
29842     resultobj=PyLong_FromLong(result);
29843     if (PyErr_Occurred()) SWIG_fail;
29844   }
29845   return resultobj;
29846 fail:
29847   return NULL;
29848 }
29849 
29850 
_wrap_pkcs7_get0_signers(PyObject * self,PyObject * args)29851 SWIGINTERN PyObject *_wrap_pkcs7_get0_signers(PyObject *self, PyObject *args) {
29852   PyObject *resultobj = 0;
29853   PKCS7 *arg1 = (PKCS7 *) 0 ;
29854   struct stack_st_X509 *arg2 = (struct stack_st_X509 *) 0 ;
29855   int arg3 ;
29856   void *argp1 = 0 ;
29857   int res1 = 0 ;
29858   void *argp2 = 0 ;
29859   int res2 = 0 ;
29860   int val3 ;
29861   int ecode3 = 0 ;
29862   PyObject *swig_obj[3] ;
29863   struct stack_st_X509 *result = 0 ;
29864 
29865   if (!SWIG_Python_UnpackTuple(args, "pkcs7_get0_signers", 3, 3, swig_obj)) SWIG_fail;
29866   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_PKCS7, 0 |  0 );
29867   if (!SWIG_IsOK(res1)) {
29868     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "pkcs7_get0_signers" "', argument " "1"" of type '" "PKCS7 *""'");
29869   }
29870   arg1 = (PKCS7 *)(argp1);
29871   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_stack_st_X509, 0 |  0 );
29872   if (!SWIG_IsOK(res2)) {
29873     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "pkcs7_get0_signers" "', argument " "2"" of type '" "struct stack_st_X509 *""'");
29874   }
29875   arg2 = (struct stack_st_X509 *)(argp2);
29876   ecode3 = SWIG_AsVal_int(swig_obj[2], &val3);
29877   if (!SWIG_IsOK(ecode3)) {
29878     SWIG_exception_fail(SWIG_ArgError(ecode3), "in method '" "pkcs7_get0_signers" "', argument " "3"" of type '" "int""'");
29879   }
29880   arg3 = (int)(val3);
29881   {
29882     if (!arg1) {
29883       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29884     }
29885   }
29886   {
29887     if (!arg2) {
29888       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
29889     }
29890   }
29891   result = (struct stack_st_X509 *)pkcs7_get0_signers(arg1,arg2,arg3);
29892   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_stack_st_X509, 0 |  0 );
29893   return resultobj;
29894 fail:
29895   return NULL;
29896 }
29897 
29898 
Swig_var__util_err_set(PyObject * _val)29899 SWIGINTERN int Swig_var__util_err_set(PyObject *_val) {
29900   {
29901     void *argp = 0;
29902     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
29903     if (!SWIG_IsOK(res)) {
29904       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_util_err""' of type '""PyObject *""'");
29905     }
29906     _util_err = (PyObject *)(argp);
29907   }
29908   return 0;
29909 fail:
29910   return 1;
29911 }
29912 
29913 
Swig_var__util_err_get(void)29914 SWIGINTERN PyObject *Swig_var__util_err_get(void) {
29915   PyObject *pyobj = 0;
29916   PyObject *self = 0;
29917 
29918   (void)self;
29919   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_util_err), SWIGTYPE_p_PyObject,  0 );
29920   return pyobj;
29921 }
29922 
29923 
_wrap_util_init(PyObject * self,PyObject * args)29924 SWIGINTERN PyObject *_wrap_util_init(PyObject *self, PyObject *args) {
29925   PyObject *resultobj = 0;
29926   PyObject *arg1 = (PyObject *) 0 ;
29927   PyObject *swig_obj[1] ;
29928 
29929   if (!args) SWIG_fail;
29930   swig_obj[0] = args;
29931   {
29932     arg1=swig_obj[0];
29933   }
29934   util_init(arg1);
29935   resultobj = SWIG_Py_Void();
29936   return resultobj;
29937 fail:
29938   return NULL;
29939 }
29940 
29941 
_wrap_util_hex_to_string(PyObject * self,PyObject * args)29942 SWIGINTERN PyObject *_wrap_util_hex_to_string(PyObject *self, PyObject *args) {
29943   PyObject *resultobj = 0;
29944   PyObject *arg1 = (PyObject *) 0 ;
29945   PyObject *swig_obj[1] ;
29946   PyObject *result = 0 ;
29947 
29948   if (!args) SWIG_fail;
29949   swig_obj[0] = args;
29950   {
29951     arg1=swig_obj[0];
29952   }
29953   result = (PyObject *)util_hex_to_string(arg1);
29954   {
29955     resultobj=result;
29956   }
29957   return resultobj;
29958 fail:
29959   return NULL;
29960 }
29961 
29962 
_wrap_util_string_to_hex(PyObject * self,PyObject * args)29963 SWIGINTERN PyObject *_wrap_util_string_to_hex(PyObject *self, PyObject *args) {
29964   PyObject *resultobj = 0;
29965   PyObject *arg1 = (PyObject *) 0 ;
29966   PyObject *swig_obj[1] ;
29967   PyObject *result = 0 ;
29968 
29969   if (!args) SWIG_fail;
29970   swig_obj[0] = args;
29971   {
29972     arg1=swig_obj[0];
29973   }
29974   result = (PyObject *)util_string_to_hex(arg1);
29975   {
29976     resultobj=result;
29977   }
29978   return resultobj;
29979 fail:
29980   return NULL;
29981 }
29982 
29983 
_wrap_ec_key_new(PyObject * self,PyObject * args)29984 SWIGINTERN PyObject *_wrap_ec_key_new(PyObject *self, PyObject *args) {
29985   PyObject *resultobj = 0;
29986   EC_KEY *result = 0 ;
29987 
29988   if (!SWIG_Python_UnpackTuple(args, "ec_key_new", 0, 0, 0)) SWIG_fail;
29989   result = (EC_KEY *)EC_KEY_new();
29990   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 |  0 );
29991   return resultobj;
29992 fail:
29993   return NULL;
29994 }
29995 
29996 
_wrap_ec_key_free(PyObject * self,PyObject * args)29997 SWIGINTERN PyObject *_wrap_ec_key_free(PyObject *self, PyObject *args) {
29998   PyObject *resultobj = 0;
29999   EC_KEY *arg1 = (EC_KEY *) 0 ;
30000   void *argp1 = 0 ;
30001   int res1 = 0 ;
30002   PyObject *swig_obj[1] ;
30003 
30004   if (!args) SWIG_fail;
30005   swig_obj[0] = args;
30006   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30007   if (!SWIG_IsOK(res1)) {
30008     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_free" "', argument " "1"" of type '" "EC_KEY *""'");
30009   }
30010   arg1 = (EC_KEY *)(argp1);
30011   {
30012     if (!arg1) {
30013       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30014     }
30015   }
30016   EC_KEY_free(arg1);
30017   resultobj = SWIG_Py_Void();
30018   return resultobj;
30019 fail:
30020   return NULL;
30021 }
30022 
30023 
_wrap_ec_key_size(PyObject * self,PyObject * args)30024 SWIGINTERN PyObject *_wrap_ec_key_size(PyObject *self, PyObject *args) {
30025   PyObject *resultobj = 0;
30026   EC_KEY *arg1 = (EC_KEY *) 0 ;
30027   void *argp1 = 0 ;
30028   int res1 = 0 ;
30029   PyObject *swig_obj[1] ;
30030   int result;
30031 
30032   if (!args) SWIG_fail;
30033   swig_obj[0] = args;
30034   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30035   if (!SWIG_IsOK(res1)) {
30036     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_size" "', argument " "1"" of type '" "EC_KEY const *""'");
30037   }
30038   arg1 = (EC_KEY *)(argp1);
30039   {
30040     if (!arg1) {
30041       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30042     }
30043   }
30044   result = (int)ECDSA_size((EC_KEY const *)arg1);
30045   {
30046     resultobj=PyLong_FromLong(result);
30047     if (PyErr_Occurred()) SWIG_fail;
30048   }
30049   return resultobj;
30050 fail:
30051   return NULL;
30052 }
30053 
30054 
_wrap_ec_key_gen_key(PyObject * self,PyObject * args)30055 SWIGINTERN PyObject *_wrap_ec_key_gen_key(PyObject *self, PyObject *args) {
30056   PyObject *resultobj = 0;
30057   EC_KEY *arg1 = (EC_KEY *) 0 ;
30058   void *argp1 = 0 ;
30059   int res1 = 0 ;
30060   PyObject *swig_obj[1] ;
30061   int result;
30062 
30063   if (!args) SWIG_fail;
30064   swig_obj[0] = args;
30065   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30066   if (!SWIG_IsOK(res1)) {
30067     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_gen_key" "', argument " "1"" of type '" "EC_KEY *""'");
30068   }
30069   arg1 = (EC_KEY *)(argp1);
30070   {
30071     if (!arg1) {
30072       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30073     }
30074   }
30075   result = (int)EC_KEY_generate_key(arg1);
30076   {
30077     resultobj=PyLong_FromLong(result);
30078     if (PyErr_Occurred()) SWIG_fail;
30079   }
30080   return resultobj;
30081 fail:
30082   return NULL;
30083 }
30084 
30085 
_wrap_ec_key_check_key(PyObject * self,PyObject * args)30086 SWIGINTERN PyObject *_wrap_ec_key_check_key(PyObject *self, PyObject *args) {
30087   PyObject *resultobj = 0;
30088   EC_KEY *arg1 = (EC_KEY *) 0 ;
30089   void *argp1 = 0 ;
30090   int res1 = 0 ;
30091   PyObject *swig_obj[1] ;
30092   int result;
30093 
30094   if (!args) SWIG_fail;
30095   swig_obj[0] = args;
30096   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30097   if (!SWIG_IsOK(res1)) {
30098     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_check_key" "', argument " "1"" of type '" "EC_KEY const *""'");
30099   }
30100   arg1 = (EC_KEY *)(argp1);
30101   {
30102     if (!arg1) {
30103       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30104     }
30105   }
30106   result = (int)EC_KEY_check_key((EC_KEY const *)arg1);
30107   {
30108     resultobj=PyLong_FromLong(result);
30109     if (PyErr_Occurred()) SWIG_fail;
30110   }
30111   return resultobj;
30112 fail:
30113   return NULL;
30114 }
30115 
30116 
Swig_var__ec_err_set(PyObject * _val)30117 SWIGINTERN int Swig_var__ec_err_set(PyObject *_val) {
30118   {
30119     void *argp = 0;
30120     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
30121     if (!SWIG_IsOK(res)) {
30122       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_ec_err""' of type '""PyObject *""'");
30123     }
30124     _ec_err = (PyObject *)(argp);
30125   }
30126   return 0;
30127 fail:
30128   return 1;
30129 }
30130 
30131 
Swig_var__ec_err_get(void)30132 SWIGINTERN PyObject *Swig_var__ec_err_get(void) {
30133   PyObject *pyobj = 0;
30134   PyObject *self = 0;
30135 
30136   (void)self;
30137   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_ec_err), SWIGTYPE_p_PyObject,  0 );
30138   return pyobj;
30139 }
30140 
30141 
_wrap_ec_init(PyObject * self,PyObject * args)30142 SWIGINTERN PyObject *_wrap_ec_init(PyObject *self, PyObject *args) {
30143   PyObject *resultobj = 0;
30144   PyObject *arg1 = (PyObject *) 0 ;
30145   PyObject *swig_obj[1] ;
30146 
30147   if (!args) SWIG_fail;
30148   swig_obj[0] = args;
30149   {
30150     arg1=swig_obj[0];
30151   }
30152   ec_init(arg1);
30153   resultobj = SWIG_Py_Void();
30154   return resultobj;
30155 fail:
30156   return NULL;
30157 }
30158 
30159 
_wrap_ec_get_builtin_curves(PyObject * self,PyObject * args)30160 SWIGINTERN PyObject *_wrap_ec_get_builtin_curves(PyObject *self, PyObject *args) {
30161   PyObject *resultobj = 0;
30162   PyObject *result = 0 ;
30163 
30164   if (!SWIG_Python_UnpackTuple(args, "ec_get_builtin_curves", 0, 0, 0)) SWIG_fail;
30165   result = (PyObject *)ec_get_builtin_curves();
30166   {
30167     resultobj=result;
30168   }
30169   return resultobj;
30170 fail:
30171   return NULL;
30172 }
30173 
30174 
_wrap_ec_key_new_by_curve_name(PyObject * self,PyObject * args)30175 SWIGINTERN PyObject *_wrap_ec_key_new_by_curve_name(PyObject *self, PyObject *args) {
30176   PyObject *resultobj = 0;
30177   int arg1 ;
30178   int val1 ;
30179   int ecode1 = 0 ;
30180   PyObject *swig_obj[1] ;
30181   EC_KEY *result = 0 ;
30182 
30183   if (!args) SWIG_fail;
30184   swig_obj[0] = args;
30185   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
30186   if (!SWIG_IsOK(ecode1)) {
30187     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ec_key_new_by_curve_name" "', argument " "1"" of type '" "int""'");
30188   }
30189   arg1 = (int)(val1);
30190   result = (EC_KEY *)ec_key_new_by_curve_name(arg1);
30191   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 |  0 );
30192   return resultobj;
30193 fail:
30194   return NULL;
30195 }
30196 
30197 
_wrap_ec_key_get_public_der(PyObject * self,PyObject * args)30198 SWIGINTERN PyObject *_wrap_ec_key_get_public_der(PyObject *self, PyObject *args) {
30199   PyObject *resultobj = 0;
30200   EC_KEY *arg1 = (EC_KEY *) 0 ;
30201   void *argp1 = 0 ;
30202   int res1 = 0 ;
30203   PyObject *swig_obj[1] ;
30204   PyObject *result = 0 ;
30205 
30206   if (!args) SWIG_fail;
30207   swig_obj[0] = args;
30208   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30209   if (!SWIG_IsOK(res1)) {
30210     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_get_public_der" "', argument " "1"" of type '" "EC_KEY *""'");
30211   }
30212   arg1 = (EC_KEY *)(argp1);
30213   {
30214     if (!arg1) {
30215       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30216     }
30217   }
30218   result = (PyObject *)ec_key_get_public_der(arg1);
30219   {
30220     resultobj=result;
30221   }
30222   return resultobj;
30223 fail:
30224   return NULL;
30225 }
30226 
30227 
_wrap_ec_key_get_public_key(PyObject * self,PyObject * args)30228 SWIGINTERN PyObject *_wrap_ec_key_get_public_key(PyObject *self, PyObject *args) {
30229   PyObject *resultobj = 0;
30230   EC_KEY *arg1 = (EC_KEY *) 0 ;
30231   void *argp1 = 0 ;
30232   int res1 = 0 ;
30233   PyObject *swig_obj[1] ;
30234   PyObject *result = 0 ;
30235 
30236   if (!args) SWIG_fail;
30237   swig_obj[0] = args;
30238   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30239   if (!SWIG_IsOK(res1)) {
30240     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_get_public_key" "', argument " "1"" of type '" "EC_KEY *""'");
30241   }
30242   arg1 = (EC_KEY *)(argp1);
30243   {
30244     if (!arg1) {
30245       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30246     }
30247   }
30248   result = (PyObject *)ec_key_get_public_key(arg1);
30249   {
30250     resultobj=result;
30251   }
30252   return resultobj;
30253 fail:
30254   return NULL;
30255 }
30256 
30257 
_wrap_ec_key_read_pubkey(PyObject * self,PyObject * args)30258 SWIGINTERN PyObject *_wrap_ec_key_read_pubkey(PyObject *self, PyObject *args) {
30259   PyObject *resultobj = 0;
30260   BIO *arg1 = (BIO *) 0 ;
30261   void *argp1 = 0 ;
30262   int res1 = 0 ;
30263   PyObject *swig_obj[1] ;
30264   EC_KEY *result = 0 ;
30265 
30266   if (!args) SWIG_fail;
30267   swig_obj[0] = args;
30268   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
30269   if (!SWIG_IsOK(res1)) {
30270     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_read_pubkey" "', argument " "1"" of type '" "BIO *""'");
30271   }
30272   arg1 = (BIO *)(argp1);
30273   {
30274     if (!arg1) {
30275       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30276     }
30277   }
30278   {
30279     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30280     result = (EC_KEY *)ec_key_read_pubkey(arg1);
30281     SWIG_PYTHON_THREAD_END_ALLOW;
30282   }
30283   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 |  0 );
30284   return resultobj;
30285 fail:
30286   return NULL;
30287 }
30288 
30289 
_wrap_ec_key_write_pubkey(PyObject * self,PyObject * args)30290 SWIGINTERN PyObject *_wrap_ec_key_write_pubkey(PyObject *self, PyObject *args) {
30291   PyObject *resultobj = 0;
30292   EC_KEY *arg1 = (EC_KEY *) 0 ;
30293   BIO *arg2 = (BIO *) 0 ;
30294   void *argp1 = 0 ;
30295   int res1 = 0 ;
30296   void *argp2 = 0 ;
30297   int res2 = 0 ;
30298   PyObject *swig_obj[2] ;
30299   int result;
30300 
30301   if (!SWIG_Python_UnpackTuple(args, "ec_key_write_pubkey", 2, 2, swig_obj)) SWIG_fail;
30302   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30303   if (!SWIG_IsOK(res1)) {
30304     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_write_pubkey" "', argument " "1"" of type '" "EC_KEY *""'");
30305   }
30306   arg1 = (EC_KEY *)(argp1);
30307   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
30308   if (!SWIG_IsOK(res2)) {
30309     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ec_key_write_pubkey" "', argument " "2"" of type '" "BIO *""'");
30310   }
30311   arg2 = (BIO *)(argp2);
30312   {
30313     if (!arg1) {
30314       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30315     }
30316   }
30317   {
30318     if (!arg2) {
30319       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30320     }
30321   }
30322   {
30323     SWIG_PYTHON_THREAD_BEGIN_ALLOW;
30324     result = (int)ec_key_write_pubkey(arg1,arg2);
30325     SWIG_PYTHON_THREAD_END_ALLOW;
30326   }
30327   {
30328     resultobj=PyLong_FromLong(result);
30329     if (PyErr_Occurred()) SWIG_fail;
30330   }
30331   return resultobj;
30332 fail:
30333   return NULL;
30334 }
30335 
30336 
_wrap_ec_key_read_bio(PyObject * self,PyObject * args)30337 SWIGINTERN PyObject *_wrap_ec_key_read_bio(PyObject *self, PyObject *args) {
30338   PyObject *resultobj = 0;
30339   BIO *arg1 = (BIO *) 0 ;
30340   PyObject *arg2 = (PyObject *) 0 ;
30341   void *argp1 = 0 ;
30342   int res1 = 0 ;
30343   PyObject *swig_obj[2] ;
30344   EC_KEY *result = 0 ;
30345 
30346   if (!SWIG_Python_UnpackTuple(args, "ec_key_read_bio", 2, 2, swig_obj)) SWIG_fail;
30347   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_BIO, 0 |  0 );
30348   if (!SWIG_IsOK(res1)) {
30349     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_read_bio" "', argument " "1"" of type '" "BIO *""'");
30350   }
30351   arg1 = (BIO *)(argp1);
30352   {
30353     if (!PyCallable_Check(swig_obj[1])) {
30354       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
30355       return NULL;
30356     }
30357     arg2=swig_obj[1];
30358   }
30359   {
30360     if (!arg1) {
30361       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30362     }
30363   }
30364   {
30365     if (!arg2) {
30366       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30367     }
30368   }
30369   result = (EC_KEY *)ec_key_read_bio(arg1,arg2);
30370   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 |  0 );
30371   return resultobj;
30372 fail:
30373   return NULL;
30374 }
30375 
30376 
_wrap_ec_key_write_bio(PyObject * self,PyObject * args)30377 SWIGINTERN PyObject *_wrap_ec_key_write_bio(PyObject *self, PyObject *args) {
30378   PyObject *resultobj = 0;
30379   EC_KEY *arg1 = (EC_KEY *) 0 ;
30380   BIO *arg2 = (BIO *) 0 ;
30381   EVP_CIPHER *arg3 = (EVP_CIPHER *) 0 ;
30382   PyObject *arg4 = (PyObject *) 0 ;
30383   void *argp1 = 0 ;
30384   int res1 = 0 ;
30385   void *argp2 = 0 ;
30386   int res2 = 0 ;
30387   void *argp3 = 0 ;
30388   int res3 = 0 ;
30389   PyObject *swig_obj[4] ;
30390   int result;
30391 
30392   if (!SWIG_Python_UnpackTuple(args, "ec_key_write_bio", 4, 4, swig_obj)) SWIG_fail;
30393   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30394   if (!SWIG_IsOK(res1)) {
30395     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_write_bio" "', argument " "1"" of type '" "EC_KEY *""'");
30396   }
30397   arg1 = (EC_KEY *)(argp1);
30398   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
30399   if (!SWIG_IsOK(res2)) {
30400     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ec_key_write_bio" "', argument " "2"" of type '" "BIO *""'");
30401   }
30402   arg2 = (BIO *)(argp2);
30403   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_EVP_CIPHER, 0 |  0 );
30404   if (!SWIG_IsOK(res3)) {
30405     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "ec_key_write_bio" "', argument " "3"" of type '" "EVP_CIPHER *""'");
30406   }
30407   arg3 = (EVP_CIPHER *)(argp3);
30408   {
30409     if (!PyCallable_Check(swig_obj[3])) {
30410       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
30411       return NULL;
30412     }
30413     arg4=swig_obj[3];
30414   }
30415   {
30416     if (!arg1) {
30417       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30418     }
30419   }
30420   {
30421     if (!arg2) {
30422       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30423     }
30424   }
30425   {
30426     if (!arg3) {
30427       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30428     }
30429   }
30430   {
30431     if (!arg4) {
30432       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30433     }
30434   }
30435   result = (int)ec_key_write_bio(arg1,arg2,arg3,arg4);
30436   {
30437     resultobj=PyLong_FromLong(result);
30438     if (PyErr_Occurred()) SWIG_fail;
30439   }
30440   return resultobj;
30441 fail:
30442   return NULL;
30443 }
30444 
30445 
_wrap_ec_key_write_bio_no_cipher(PyObject * self,PyObject * args)30446 SWIGINTERN PyObject *_wrap_ec_key_write_bio_no_cipher(PyObject *self, PyObject *args) {
30447   PyObject *resultobj = 0;
30448   EC_KEY *arg1 = (EC_KEY *) 0 ;
30449   BIO *arg2 = (BIO *) 0 ;
30450   PyObject *arg3 = (PyObject *) 0 ;
30451   void *argp1 = 0 ;
30452   int res1 = 0 ;
30453   void *argp2 = 0 ;
30454   int res2 = 0 ;
30455   PyObject *swig_obj[3] ;
30456   int result;
30457 
30458   if (!SWIG_Python_UnpackTuple(args, "ec_key_write_bio_no_cipher", 3, 3, swig_obj)) SWIG_fail;
30459   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30460   if (!SWIG_IsOK(res1)) {
30461     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_write_bio_no_cipher" "', argument " "1"" of type '" "EC_KEY *""'");
30462   }
30463   arg1 = (EC_KEY *)(argp1);
30464   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_BIO, 0 |  0 );
30465   if (!SWIG_IsOK(res2)) {
30466     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ec_key_write_bio_no_cipher" "', argument " "2"" of type '" "BIO *""'");
30467   }
30468   arg2 = (BIO *)(argp2);
30469   {
30470     if (!PyCallable_Check(swig_obj[2])) {
30471       PyErr_SetString(PyExc_TypeError, "expected PyCallable");
30472       return NULL;
30473     }
30474     arg3=swig_obj[2];
30475   }
30476   {
30477     if (!arg1) {
30478       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30479     }
30480   }
30481   {
30482     if (!arg2) {
30483       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30484     }
30485   }
30486   {
30487     if (!arg3) {
30488       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30489     }
30490   }
30491   result = (int)ec_key_write_bio_no_cipher(arg1,arg2,arg3);
30492   {
30493     resultobj=PyLong_FromLong(result);
30494     if (PyErr_Occurred()) SWIG_fail;
30495   }
30496   return resultobj;
30497 fail:
30498   return NULL;
30499 }
30500 
30501 
_wrap_ecdsa_sig_get_r(PyObject * self,PyObject * args)30502 SWIGINTERN PyObject *_wrap_ecdsa_sig_get_r(PyObject *self, PyObject *args) {
30503   PyObject *resultobj = 0;
30504   ECDSA_SIG *arg1 = (ECDSA_SIG *) 0 ;
30505   void *argp1 = 0 ;
30506   int res1 = 0 ;
30507   PyObject *swig_obj[1] ;
30508   PyObject *result = 0 ;
30509 
30510   if (!args) SWIG_fail;
30511   swig_obj[0] = args;
30512   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ECDSA_SIG, 0 |  0 );
30513   if (!SWIG_IsOK(res1)) {
30514     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_sig_get_r" "', argument " "1"" of type '" "ECDSA_SIG *""'");
30515   }
30516   arg1 = (ECDSA_SIG *)(argp1);
30517   result = (PyObject *)ecdsa_sig_get_r(arg1);
30518   {
30519     resultobj=result;
30520   }
30521   return resultobj;
30522 fail:
30523   return NULL;
30524 }
30525 
30526 
_wrap_ecdsa_sig_get_s(PyObject * self,PyObject * args)30527 SWIGINTERN PyObject *_wrap_ecdsa_sig_get_s(PyObject *self, PyObject *args) {
30528   PyObject *resultobj = 0;
30529   ECDSA_SIG *arg1 = (ECDSA_SIG *) 0 ;
30530   void *argp1 = 0 ;
30531   int res1 = 0 ;
30532   PyObject *swig_obj[1] ;
30533   PyObject *result = 0 ;
30534 
30535   if (!args) SWIG_fail;
30536   swig_obj[0] = args;
30537   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ECDSA_SIG, 0 |  0 );
30538   if (!SWIG_IsOK(res1)) {
30539     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_sig_get_s" "', argument " "1"" of type '" "ECDSA_SIG *""'");
30540   }
30541   arg1 = (ECDSA_SIG *)(argp1);
30542   result = (PyObject *)ecdsa_sig_get_s(arg1);
30543   {
30544     resultobj=result;
30545   }
30546   return resultobj;
30547 fail:
30548   return NULL;
30549 }
30550 
30551 
_wrap_ecdsa_sign(PyObject * self,PyObject * args)30552 SWIGINTERN PyObject *_wrap_ecdsa_sign(PyObject *self, PyObject *args) {
30553   PyObject *resultobj = 0;
30554   EC_KEY *arg1 = (EC_KEY *) 0 ;
30555   PyObject *arg2 = (PyObject *) 0 ;
30556   void *argp1 = 0 ;
30557   int res1 = 0 ;
30558   PyObject *swig_obj[2] ;
30559   PyObject *result = 0 ;
30560 
30561   if (!SWIG_Python_UnpackTuple(args, "ecdsa_sign", 2, 2, swig_obj)) SWIG_fail;
30562   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30563   if (!SWIG_IsOK(res1)) {
30564     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_sign" "', argument " "1"" of type '" "EC_KEY *""'");
30565   }
30566   arg1 = (EC_KEY *)(argp1);
30567   {
30568     arg2=swig_obj[1];
30569   }
30570   {
30571     if (!arg1) {
30572       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30573     }
30574   }
30575   result = (PyObject *)ecdsa_sign(arg1,arg2);
30576   {
30577     resultobj=result;
30578   }
30579   return resultobj;
30580 fail:
30581   return NULL;
30582 }
30583 
30584 
_wrap_ecdsa_verify(PyObject * self,PyObject * args)30585 SWIGINTERN PyObject *_wrap_ecdsa_verify(PyObject *self, PyObject *args) {
30586   PyObject *resultobj = 0;
30587   EC_KEY *arg1 = (EC_KEY *) 0 ;
30588   PyObject *arg2 = (PyObject *) 0 ;
30589   PyObject *arg3 = (PyObject *) 0 ;
30590   PyObject *arg4 = (PyObject *) 0 ;
30591   void *argp1 = 0 ;
30592   int res1 = 0 ;
30593   PyObject *swig_obj[4] ;
30594   int result;
30595 
30596   if (!SWIG_Python_UnpackTuple(args, "ecdsa_verify", 4, 4, swig_obj)) SWIG_fail;
30597   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30598   if (!SWIG_IsOK(res1)) {
30599     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_verify" "', argument " "1"" of type '" "EC_KEY *""'");
30600   }
30601   arg1 = (EC_KEY *)(argp1);
30602   {
30603     arg2=swig_obj[1];
30604   }
30605   {
30606     arg3=swig_obj[2];
30607   }
30608   {
30609     arg4=swig_obj[3];
30610   }
30611   {
30612     if (!arg1) {
30613       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30614     }
30615   }
30616   result = (int)ecdsa_verify(arg1,arg2,arg3,arg4);
30617   {
30618     resultobj=PyLong_FromLong(result);
30619     if (PyErr_Occurred()) SWIG_fail;
30620   }
30621   return resultobj;
30622 fail:
30623   return NULL;
30624 }
30625 
30626 
_wrap_ecdsa_sign_asn1(PyObject * self,PyObject * args)30627 SWIGINTERN PyObject *_wrap_ecdsa_sign_asn1(PyObject *self, PyObject *args) {
30628   PyObject *resultobj = 0;
30629   EC_KEY *arg1 = (EC_KEY *) 0 ;
30630   PyObject *arg2 = (PyObject *) 0 ;
30631   void *argp1 = 0 ;
30632   int res1 = 0 ;
30633   PyObject *swig_obj[2] ;
30634   PyObject *result = 0 ;
30635 
30636   if (!SWIG_Python_UnpackTuple(args, "ecdsa_sign_asn1", 2, 2, swig_obj)) SWIG_fail;
30637   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30638   if (!SWIG_IsOK(res1)) {
30639     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_sign_asn1" "', argument " "1"" of type '" "EC_KEY *""'");
30640   }
30641   arg1 = (EC_KEY *)(argp1);
30642   {
30643     arg2=swig_obj[1];
30644   }
30645   {
30646     if (!arg1) {
30647       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30648     }
30649   }
30650   result = (PyObject *)ecdsa_sign_asn1(arg1,arg2);
30651   {
30652     resultobj=result;
30653   }
30654   return resultobj;
30655 fail:
30656   return NULL;
30657 }
30658 
30659 
_wrap_ecdsa_verify_asn1(PyObject * self,PyObject * args)30660 SWIGINTERN PyObject *_wrap_ecdsa_verify_asn1(PyObject *self, PyObject *args) {
30661   PyObject *resultobj = 0;
30662   EC_KEY *arg1 = (EC_KEY *) 0 ;
30663   PyObject *arg2 = (PyObject *) 0 ;
30664   PyObject *arg3 = (PyObject *) 0 ;
30665   void *argp1 = 0 ;
30666   int res1 = 0 ;
30667   PyObject *swig_obj[3] ;
30668   int result;
30669 
30670   if (!SWIG_Python_UnpackTuple(args, "ecdsa_verify_asn1", 3, 3, swig_obj)) SWIG_fail;
30671   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30672   if (!SWIG_IsOK(res1)) {
30673     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdsa_verify_asn1" "', argument " "1"" of type '" "EC_KEY *""'");
30674   }
30675   arg1 = (EC_KEY *)(argp1);
30676   {
30677     arg2=swig_obj[1];
30678   }
30679   {
30680     arg3=swig_obj[2];
30681   }
30682   {
30683     if (!arg1) {
30684       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30685     }
30686   }
30687   result = (int)ecdsa_verify_asn1(arg1,arg2,arg3);
30688   {
30689     resultobj=PyLong_FromLong(result);
30690     if (PyErr_Occurred()) SWIG_fail;
30691   }
30692   return resultobj;
30693 fail:
30694   return NULL;
30695 }
30696 
30697 
_wrap_ecdh_compute_key(PyObject * self,PyObject * args)30698 SWIGINTERN PyObject *_wrap_ecdh_compute_key(PyObject *self, PyObject *args) {
30699   PyObject *resultobj = 0;
30700   EC_KEY *arg1 = (EC_KEY *) 0 ;
30701   EC_KEY *arg2 = (EC_KEY *) 0 ;
30702   void *argp1 = 0 ;
30703   int res1 = 0 ;
30704   void *argp2 = 0 ;
30705   int res2 = 0 ;
30706   PyObject *swig_obj[2] ;
30707   PyObject *result = 0 ;
30708 
30709   if (!SWIG_Python_UnpackTuple(args, "ecdh_compute_key", 2, 2, swig_obj)) SWIG_fail;
30710   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30711   if (!SWIG_IsOK(res1)) {
30712     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ecdh_compute_key" "', argument " "1"" of type '" "EC_KEY *""'");
30713   }
30714   arg1 = (EC_KEY *)(argp1);
30715   res2 = SWIG_ConvertPtr(swig_obj[1], &argp2,SWIGTYPE_p_EC_KEY, 0 |  0 );
30716   if (!SWIG_IsOK(res2)) {
30717     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "ecdh_compute_key" "', argument " "2"" of type '" "EC_KEY *""'");
30718   }
30719   arg2 = (EC_KEY *)(argp2);
30720   {
30721     if (!arg1) {
30722       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30723     }
30724   }
30725   {
30726     if (!arg2) {
30727       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30728     }
30729   }
30730   result = (PyObject *)ecdh_compute_key(arg1,arg2);
30731   {
30732     resultobj=result;
30733   }
30734   return resultobj;
30735 fail:
30736   return NULL;
30737 }
30738 
30739 
_wrap_ec_key_from_pubkey_der(PyObject * self,PyObject * args)30740 SWIGINTERN PyObject *_wrap_ec_key_from_pubkey_der(PyObject *self, PyObject *args) {
30741   PyObject *resultobj = 0;
30742   PyObject *arg1 = (PyObject *) 0 ;
30743   PyObject *swig_obj[1] ;
30744   EC_KEY *result = 0 ;
30745 
30746   if (!args) SWIG_fail;
30747   swig_obj[0] = args;
30748   {
30749     arg1=swig_obj[0];
30750   }
30751   result = (EC_KEY *)ec_key_from_pubkey_der(arg1);
30752   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 |  0 );
30753   return resultobj;
30754 fail:
30755   return NULL;
30756 }
30757 
30758 
_wrap_ec_key_from_pubkey_params(PyObject * self,PyObject * args)30759 SWIGINTERN PyObject *_wrap_ec_key_from_pubkey_params(PyObject *self, PyObject *args) {
30760   PyObject *resultobj = 0;
30761   int arg1 ;
30762   PyObject *arg2 = (PyObject *) 0 ;
30763   int val1 ;
30764   int ecode1 = 0 ;
30765   PyObject *swig_obj[2] ;
30766   EC_KEY *result = 0 ;
30767 
30768   if (!SWIG_Python_UnpackTuple(args, "ec_key_from_pubkey_params", 2, 2, swig_obj)) SWIG_fail;
30769   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
30770   if (!SWIG_IsOK(ecode1)) {
30771     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "ec_key_from_pubkey_params" "', argument " "1"" of type '" "int""'");
30772   }
30773   arg1 = (int)(val1);
30774   {
30775     arg2=swig_obj[1];
30776   }
30777   result = (EC_KEY *)ec_key_from_pubkey_params(arg1,arg2);
30778   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EC_KEY, 0 |  0 );
30779   return resultobj;
30780 fail:
30781   return NULL;
30782 }
30783 
30784 
_wrap_ec_key_keylen(PyObject * self,PyObject * args)30785 SWIGINTERN PyObject *_wrap_ec_key_keylen(PyObject *self, PyObject *args) {
30786   PyObject *resultobj = 0;
30787   EC_KEY *arg1 = (EC_KEY *) 0 ;
30788   void *argp1 = 0 ;
30789   int res1 = 0 ;
30790   PyObject *swig_obj[1] ;
30791   int result;
30792 
30793   if (!args) SWIG_fail;
30794   swig_obj[0] = args;
30795   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30796   if (!SWIG_IsOK(res1)) {
30797     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_keylen" "', argument " "1"" of type '" "EC_KEY *""'");
30798   }
30799   arg1 = (EC_KEY *)(argp1);
30800   {
30801     if (!arg1) {
30802       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30803     }
30804   }
30805   result = (int)ec_key_keylen(arg1);
30806   {
30807     resultobj=PyLong_FromLong(result);
30808     if (PyErr_Occurred()) SWIG_fail;
30809   }
30810   return resultobj;
30811 fail:
30812   return NULL;
30813 }
30814 
30815 
_wrap_ec_key_type_check(PyObject * self,PyObject * args)30816 SWIGINTERN PyObject *_wrap_ec_key_type_check(PyObject *self, PyObject *args) {
30817   PyObject *resultobj = 0;
30818   EC_KEY *arg1 = (EC_KEY *) 0 ;
30819   void *argp1 = 0 ;
30820   int res1 = 0 ;
30821   PyObject *swig_obj[1] ;
30822   int result;
30823 
30824   if (!args) SWIG_fail;
30825   swig_obj[0] = args;
30826   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_EC_KEY, 0 |  0 );
30827   if (!SWIG_IsOK(res1)) {
30828     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "ec_key_type_check" "', argument " "1"" of type '" "EC_KEY *""'");
30829   }
30830   arg1 = (EC_KEY *)(argp1);
30831   {
30832     if (!arg1) {
30833       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30834     }
30835   }
30836   result = (int)ec_key_type_check(arg1);
30837   {
30838     resultobj=PyLong_FromLong(result);
30839     if (PyErr_Occurred()) SWIG_fail;
30840   }
30841   return resultobj;
30842 fail:
30843   return NULL;
30844 }
30845 
30846 
_wrap_engine_load_builtin_engines(PyObject * self,PyObject * args)30847 SWIGINTERN PyObject *_wrap_engine_load_builtin_engines(PyObject *self, PyObject *args) {
30848   PyObject *resultobj = 0;
30849 
30850   if (!SWIG_Python_UnpackTuple(args, "engine_load_builtin_engines", 0, 0, 0)) SWIG_fail;
30851   ENGINE_load_builtin_engines();
30852   resultobj = SWIG_Py_Void();
30853   return resultobj;
30854 fail:
30855   return NULL;
30856 }
30857 
30858 
_wrap_engine_load_dynamic(PyObject * self,PyObject * args)30859 SWIGINTERN PyObject *_wrap_engine_load_dynamic(PyObject *self, PyObject *args) {
30860   PyObject *resultobj = 0;
30861 
30862   if (!SWIG_Python_UnpackTuple(args, "engine_load_dynamic", 0, 0, 0)) SWIG_fail;
30863   ENGINE_load_dynamic();
30864   resultobj = SWIG_Py_Void();
30865   return resultobj;
30866 fail:
30867   return NULL;
30868 }
30869 
30870 
_wrap_engine_load_openssl(PyObject * self,PyObject * args)30871 SWIGINTERN PyObject *_wrap_engine_load_openssl(PyObject *self, PyObject *args) {
30872   PyObject *resultobj = 0;
30873 
30874   if (!SWIG_Python_UnpackTuple(args, "engine_load_openssl", 0, 0, 0)) SWIG_fail;
30875   ENGINE_load_openssl();
30876   resultobj = SWIG_Py_Void();
30877   return resultobj;
30878 fail:
30879   return NULL;
30880 }
30881 
30882 
_wrap_engine_cleanup(PyObject * self,PyObject * args)30883 SWIGINTERN PyObject *_wrap_engine_cleanup(PyObject *self, PyObject *args) {
30884   PyObject *resultobj = 0;
30885 
30886   if (!SWIG_Python_UnpackTuple(args, "engine_cleanup", 0, 0, 0)) SWIG_fail;
30887   ENGINE_cleanup();
30888   resultobj = SWIG_Py_Void();
30889   return resultobj;
30890 fail:
30891   return NULL;
30892 }
30893 
30894 
_wrap_engine_new(PyObject * self,PyObject * args)30895 SWIGINTERN PyObject *_wrap_engine_new(PyObject *self, PyObject *args) {
30896   PyObject *resultobj = 0;
30897   ENGINE *result = 0 ;
30898 
30899   if (!SWIG_Python_UnpackTuple(args, "engine_new", 0, 0, 0)) SWIG_fail;
30900   result = (ENGINE *)ENGINE_new();
30901   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ENGINE, 0 |  0 );
30902   return resultobj;
30903 fail:
30904   return NULL;
30905 }
30906 
30907 
_wrap_engine_by_id(PyObject * self,PyObject * args)30908 SWIGINTERN PyObject *_wrap_engine_by_id(PyObject *self, PyObject *args) {
30909   PyObject *resultobj = 0;
30910   char *arg1 = (char *) 0 ;
30911   int res1 ;
30912   char *buf1 = 0 ;
30913   int alloc1 = 0 ;
30914   PyObject *swig_obj[1] ;
30915   ENGINE *result = 0 ;
30916 
30917   if (!args) SWIG_fail;
30918   swig_obj[0] = args;
30919   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
30920   if (!SWIG_IsOK(res1)) {
30921     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_by_id" "', argument " "1"" of type '" "char const *""'");
30922   }
30923   arg1 = (char *)(buf1);
30924   {
30925     if (!arg1) {
30926       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30927     }
30928   }
30929   result = (ENGINE *)ENGINE_by_id((char const *)arg1);
30930   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ENGINE, 0 |  0 );
30931   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
30932   return resultobj;
30933 fail:
30934   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
30935   return NULL;
30936 }
30937 
30938 
_wrap_engine_free(PyObject * self,PyObject * args)30939 SWIGINTERN PyObject *_wrap_engine_free(PyObject *self, PyObject *args) {
30940   PyObject *resultobj = 0;
30941   ENGINE *arg1 = (ENGINE *) 0 ;
30942   void *argp1 = 0 ;
30943   int res1 = 0 ;
30944   PyObject *swig_obj[1] ;
30945   int result;
30946 
30947   if (!args) SWIG_fail;
30948   swig_obj[0] = args;
30949   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ENGINE, 0 |  0 );
30950   if (!SWIG_IsOK(res1)) {
30951     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_free" "', argument " "1"" of type '" "ENGINE *""'");
30952   }
30953   arg1 = (ENGINE *)(argp1);
30954   {
30955     if (!arg1) {
30956       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30957     }
30958   }
30959   result = (int)ENGINE_free(arg1);
30960   {
30961     resultobj=PyLong_FromLong(result);
30962     if (PyErr_Occurred()) SWIG_fail;
30963   }
30964   return resultobj;
30965 fail:
30966   return NULL;
30967 }
30968 
30969 
_wrap_engine_init(PyObject * self,PyObject * args)30970 SWIGINTERN PyObject *_wrap_engine_init(PyObject *self, PyObject *args) {
30971   PyObject *resultobj = 0;
30972   ENGINE *arg1 = (ENGINE *) 0 ;
30973   void *argp1 = 0 ;
30974   int res1 = 0 ;
30975   PyObject *swig_obj[1] ;
30976   int result;
30977 
30978   if (!args) SWIG_fail;
30979   swig_obj[0] = args;
30980   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ENGINE, 0 |  0 );
30981   if (!SWIG_IsOK(res1)) {
30982     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_init" "', argument " "1"" of type '" "ENGINE *""'");
30983   }
30984   arg1 = (ENGINE *)(argp1);
30985   {
30986     if (!arg1) {
30987       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
30988     }
30989   }
30990   result = (int)ENGINE_init(arg1);
30991   {
30992     resultobj=PyLong_FromLong(result);
30993     if (PyErr_Occurred()) SWIG_fail;
30994   }
30995   return resultobj;
30996 fail:
30997   return NULL;
30998 }
30999 
31000 
_wrap_engine_finish(PyObject * self,PyObject * args)31001 SWIGINTERN PyObject *_wrap_engine_finish(PyObject *self, PyObject *args) {
31002   PyObject *resultobj = 0;
31003   ENGINE *arg1 = (ENGINE *) 0 ;
31004   void *argp1 = 0 ;
31005   int res1 = 0 ;
31006   PyObject *swig_obj[1] ;
31007   int result;
31008 
31009   if (!args) SWIG_fail;
31010   swig_obj[0] = args;
31011   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ENGINE, 0 |  0 );
31012   if (!SWIG_IsOK(res1)) {
31013     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_finish" "', argument " "1"" of type '" "ENGINE *""'");
31014   }
31015   arg1 = (ENGINE *)(argp1);
31016   {
31017     if (!arg1) {
31018       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31019     }
31020   }
31021   result = (int)ENGINE_finish(arg1);
31022   {
31023     resultobj=PyLong_FromLong(result);
31024     if (PyErr_Occurred()) SWIG_fail;
31025   }
31026   return resultobj;
31027 fail:
31028   return NULL;
31029 }
31030 
31031 
_wrap_engine_get_id(PyObject * self,PyObject * args)31032 SWIGINTERN PyObject *_wrap_engine_get_id(PyObject *self, PyObject *args) {
31033   PyObject *resultobj = 0;
31034   ENGINE *arg1 = (ENGINE *) 0 ;
31035   void *argp1 = 0 ;
31036   int res1 = 0 ;
31037   PyObject *swig_obj[1] ;
31038   char *result = 0 ;
31039 
31040   if (!args) SWIG_fail;
31041   swig_obj[0] = args;
31042   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ENGINE, 0 |  0 );
31043   if (!SWIG_IsOK(res1)) {
31044     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_get_id" "', argument " "1"" of type '" "ENGINE const *""'");
31045   }
31046   arg1 = (ENGINE *)(argp1);
31047   {
31048     if (!arg1) {
31049       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31050     }
31051   }
31052   result = (char *)ENGINE_get_id((ENGINE const *)arg1);
31053   resultobj = SWIG_FromCharPtr((const char *)result);
31054   return resultobj;
31055 fail:
31056   return NULL;
31057 }
31058 
31059 
_wrap_engine_get_name(PyObject * self,PyObject * args)31060 SWIGINTERN PyObject *_wrap_engine_get_name(PyObject *self, PyObject *args) {
31061   PyObject *resultobj = 0;
31062   ENGINE *arg1 = (ENGINE *) 0 ;
31063   void *argp1 = 0 ;
31064   int res1 = 0 ;
31065   PyObject *swig_obj[1] ;
31066   char *result = 0 ;
31067 
31068   if (!args) SWIG_fail;
31069   swig_obj[0] = args;
31070   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ENGINE, 0 |  0 );
31071   if (!SWIG_IsOK(res1)) {
31072     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_get_name" "', argument " "1"" of type '" "ENGINE const *""'");
31073   }
31074   arg1 = (ENGINE *)(argp1);
31075   {
31076     if (!arg1) {
31077       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31078     }
31079   }
31080   result = (char *)ENGINE_get_name((ENGINE const *)arg1);
31081   resultobj = SWIG_FromCharPtr((const char *)result);
31082   return resultobj;
31083 fail:
31084   return NULL;
31085 }
31086 
31087 
_wrap_engine_ctrl_cmd_string(PyObject * self,PyObject * args)31088 SWIGINTERN PyObject *_wrap_engine_ctrl_cmd_string(PyObject *self, PyObject *args) {
31089   PyObject *resultobj = 0;
31090   ENGINE *arg1 = (ENGINE *) 0 ;
31091   char *arg2 = (char *) 0 ;
31092   char *arg3 = (char *) 0 ;
31093   int arg4 ;
31094   void *argp1 = 0 ;
31095   int res1 = 0 ;
31096   int res2 ;
31097   char *buf2 = 0 ;
31098   int alloc2 = 0 ;
31099   int res3 ;
31100   char *buf3 = 0 ;
31101   int alloc3 = 0 ;
31102   int val4 ;
31103   int ecode4 = 0 ;
31104   PyObject *swig_obj[4] ;
31105   int result;
31106 
31107   if (!SWIG_Python_UnpackTuple(args, "engine_ctrl_cmd_string", 4, 4, swig_obj)) SWIG_fail;
31108   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ENGINE, 0 |  0 );
31109   if (!SWIG_IsOK(res1)) {
31110     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_ctrl_cmd_string" "', argument " "1"" of type '" "ENGINE *""'");
31111   }
31112   arg1 = (ENGINE *)(argp1);
31113   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
31114   if (!SWIG_IsOK(res2)) {
31115     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "engine_ctrl_cmd_string" "', argument " "2"" of type '" "char const *""'");
31116   }
31117   arg2 = (char *)(buf2);
31118   res3 = SWIG_AsCharPtrAndSize(swig_obj[2], &buf3, NULL, &alloc3);
31119   if (!SWIG_IsOK(res3)) {
31120     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "engine_ctrl_cmd_string" "', argument " "3"" of type '" "char const *""'");
31121   }
31122   arg3 = (char *)(buf3);
31123   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
31124   if (!SWIG_IsOK(ecode4)) {
31125     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "engine_ctrl_cmd_string" "', argument " "4"" of type '" "int""'");
31126   }
31127   arg4 = (int)(val4);
31128   {
31129     if (!arg1) {
31130       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31131     }
31132   }
31133   result = (int)ENGINE_ctrl_cmd_string(arg1,(char const *)arg2,(char const *)arg3,arg4);
31134   {
31135     resultobj=PyLong_FromLong(result);
31136     if (PyErr_Occurred()) SWIG_fail;
31137   }
31138   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31139   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
31140   return resultobj;
31141 fail:
31142   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31143   if (alloc3 == SWIG_NEWOBJ) free((char*)buf3);
31144   return NULL;
31145 }
31146 
31147 
_wrap_ui_openssl(PyObject * self,PyObject * args)31148 SWIGINTERN PyObject *_wrap_ui_openssl(PyObject *self, PyObject *args) {
31149   PyObject *resultobj = 0;
31150   UI_METHOD *result = 0 ;
31151 
31152   if (!SWIG_Python_UnpackTuple(args, "ui_openssl", 0, 0, 0)) SWIG_fail;
31153   result = (UI_METHOD *)UI_OpenSSL();
31154   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_UI_METHOD, 0 |  0 );
31155   return resultobj;
31156 fail:
31157   return NULL;
31158 }
31159 
31160 
_wrap__cbd_t_password_set(PyObject * self,PyObject * args)31161 SWIGINTERN PyObject *_wrap__cbd_t_password_set(PyObject *self, PyObject *args) {
31162   PyObject *resultobj = 0;
31163   _cbd_t *arg1 = (_cbd_t *) 0 ;
31164   char *arg2 = (char *) 0 ;
31165   void *argp1 = 0 ;
31166   int res1 = 0 ;
31167   int res2 ;
31168   char *buf2 = 0 ;
31169   int alloc2 = 0 ;
31170   PyObject *swig_obj[2] ;
31171 
31172   if (!args) SWIG_fail;
31173   swig_obj[0] = args;
31174   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, 0 |  0 );
31175   if (!SWIG_IsOK(res1)) {
31176     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_password_set" "', argument " "1"" of type '" "_cbd_t *""'");
31177   }
31178   arg1 = (_cbd_t *)(argp1);
31179   res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2);
31180   if (!SWIG_IsOK(res2)) {
31181     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_cbd_t_password_set" "', argument " "2"" of type '" "char *""'");
31182   }
31183   arg2 = (char *)(buf2);
31184   if (arg1->password) free((char*)arg1->password);
31185   if (arg2) {
31186     size_t size = strlen((const char *)(arg2)) + 1;
31187     arg1->password = (char *)(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
31188   } else {
31189     arg1->password = 0;
31190   }
31191   resultobj = SWIG_Py_Void();
31192   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31193   return resultobj;
31194 fail:
31195   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31196   return NULL;
31197 }
31198 
31199 
_wrap__cbd_t_password_get(PyObject * self,PyObject * args)31200 SWIGINTERN PyObject *_wrap__cbd_t_password_get(PyObject *self, PyObject *args) {
31201   PyObject *resultobj = 0;
31202   _cbd_t *arg1 = (_cbd_t *) 0 ;
31203   void *argp1 = 0 ;
31204   int res1 = 0 ;
31205   PyObject *swig_obj[1] ;
31206   char *result = 0 ;
31207 
31208   if (!SWIG_Python_UnpackTuple(args, "_cbd_t_password_get", 0, 0, 0)) SWIG_fail;
31209   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, 0 |  0 );
31210   if (!SWIG_IsOK(res1)) {
31211     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_password_get" "', argument " "1"" of type '" "_cbd_t *""'");
31212   }
31213   arg1 = (_cbd_t *)(argp1);
31214   result = (char *) ((arg1)->password);
31215   resultobj = SWIG_FromCharPtr((const char *)result);
31216   return resultobj;
31217 fail:
31218   return NULL;
31219 }
31220 
31221 
_wrap__cbd_t_prompt_set(PyObject * self,PyObject * args)31222 SWIGINTERN PyObject *_wrap__cbd_t_prompt_set(PyObject *self, PyObject *args) {
31223   PyObject *resultobj = 0;
31224   _cbd_t *arg1 = (_cbd_t *) 0 ;
31225   char *arg2 = (char *) 0 ;
31226   void *argp1 = 0 ;
31227   int res1 = 0 ;
31228   int res2 ;
31229   char *buf2 = 0 ;
31230   int alloc2 = 0 ;
31231   PyObject *swig_obj[2] ;
31232 
31233   if (!args) SWIG_fail;
31234   swig_obj[0] = args;
31235   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, 0 |  0 );
31236   if (!SWIG_IsOK(res1)) {
31237     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_prompt_set" "', argument " "1"" of type '" "_cbd_t *""'");
31238   }
31239   arg1 = (_cbd_t *)(argp1);
31240   res2 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf2, NULL, &alloc2);
31241   if (!SWIG_IsOK(res2)) {
31242     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "_cbd_t_prompt_set" "', argument " "2"" of type '" "char *""'");
31243   }
31244   arg2 = (char *)(buf2);
31245   if (arg1->prompt) free((char*)arg1->prompt);
31246   if (arg2) {
31247     size_t size = strlen((const char *)(arg2)) + 1;
31248     arg1->prompt = (char *)(char *)memcpy(malloc((size)*sizeof(char)), (const char *)(arg2), sizeof(char)*(size));
31249   } else {
31250     arg1->prompt = 0;
31251   }
31252   resultobj = SWIG_Py_Void();
31253   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31254   return resultobj;
31255 fail:
31256   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31257   return NULL;
31258 }
31259 
31260 
_wrap__cbd_t_prompt_get(PyObject * self,PyObject * args)31261 SWIGINTERN PyObject *_wrap__cbd_t_prompt_get(PyObject *self, PyObject *args) {
31262   PyObject *resultobj = 0;
31263   _cbd_t *arg1 = (_cbd_t *) 0 ;
31264   void *argp1 = 0 ;
31265   int res1 = 0 ;
31266   PyObject *swig_obj[1] ;
31267   char *result = 0 ;
31268 
31269   if (!SWIG_Python_UnpackTuple(args, "_cbd_t_prompt_get", 0, 0, 0)) SWIG_fail;
31270   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, 0 |  0 );
31271   if (!SWIG_IsOK(res1)) {
31272     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_cbd_t_prompt_get" "', argument " "1"" of type '" "_cbd_t *""'");
31273   }
31274   arg1 = (_cbd_t *)(argp1);
31275   result = (char *) ((arg1)->prompt);
31276   resultobj = SWIG_FromCharPtr((const char *)result);
31277   return resultobj;
31278 fail:
31279   return NULL;
31280 }
31281 
31282 
_wrap_new__cbd_t(PyObject * self,PyObject * args,PyObject * kwargs)31283 SWIGINTERN int _wrap_new__cbd_t(PyObject *self, PyObject *args, PyObject *kwargs) {
31284   PyObject *resultobj = 0;
31285   _cbd_t *result = 0 ;
31286 
31287   if (!SWIG_Python_CheckNoKeywords(kwargs, "new__cbd_t")) SWIG_fail;
31288   if (!SWIG_Python_UnpackTuple(args, "new__cbd_t", 0, 0, 0)) SWIG_fail;
31289   result = (_cbd_t *)calloc(1, sizeof(_cbd_t));
31290   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p__cbd_t, SWIG_BUILTIN_INIT |  0 );
31291   return resultobj == Py_None ? -1 : 0;
31292 fail:
31293   return -1;
31294 }
31295 
31296 
_wrap_delete__cbd_t(PyObject * self,PyObject * args)31297 SWIGINTERN PyObject *_wrap_delete__cbd_t(PyObject *self, PyObject *args) {
31298   PyObject *resultobj = 0;
31299   _cbd_t *arg1 = (_cbd_t *) 0 ;
31300   void *argp1 = 0 ;
31301   int res1 = 0 ;
31302   PyObject *swig_obj[1] ;
31303 
31304   if (!SWIG_Python_UnpackTuple(args, "delete__cbd_t", 0, 0, 0)) SWIG_fail;
31305   res1 = SWIG_ConvertPtr(self, &argp1,SWIGTYPE_p__cbd_t, SWIG_POINTER_DISOWN |  0 );
31306   if (!SWIG_IsOK(res1)) {
31307     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "delete__cbd_t" "', argument " "1"" of type '" "_cbd_t *""'");
31308   }
31309   arg1 = (_cbd_t *)(argp1);
31310   free((char *) arg1);
31311   resultobj = SWIG_Py_Void();
31312   return resultobj;
31313 fail:
31314   return NULL;
31315 }
31316 
31317 
SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete__cbd_t)31318 SWIGPY_DESTRUCTOR_CLOSURE(_wrap_delete__cbd_t) /* defines _wrap_delete__cbd_t_destructor_closure */
31319 
31320 SWIGINTERN PyObject *_wrap_engine_pkcs11_data_new(PyObject *self, PyObject *args) {
31321   PyObject *resultobj = 0;
31322   char *arg1 = (char *) 0 ;
31323   int res1 ;
31324   char *buf1 = 0 ;
31325   int alloc1 = 0 ;
31326   PyObject *swig_obj[1] ;
31327   void *result = 0 ;
31328 
31329   if (!args) SWIG_fail;
31330   swig_obj[0] = args;
31331   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
31332   if (!SWIG_IsOK(res1)) {
31333     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_pkcs11_data_new" "', argument " "1"" of type '" "char const *""'");
31334   }
31335   arg1 = (char *)(buf1);
31336   result = (void *)engine_pkcs11_data_new((char const *)arg1);
31337   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_void, 0 |  0 );
31338   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31339   return resultobj;
31340 fail:
31341   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31342   return NULL;
31343 }
31344 
31345 
_wrap_engine_pkcs11_data_free(PyObject * self,PyObject * args)31346 SWIGINTERN PyObject *_wrap_engine_pkcs11_data_free(PyObject *self, PyObject *args) {
31347   PyObject *resultobj = 0;
31348   void *arg1 = (void *) 0 ;
31349   int res1 ;
31350   PyObject *swig_obj[1] ;
31351 
31352   if (!args) SWIG_fail;
31353   swig_obj[0] = args;
31354   res1 = SWIG_ConvertPtr(swig_obj[0],SWIG_as_voidptrptr(&arg1), 0, 0);
31355   if (!SWIG_IsOK(res1)) {
31356     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_pkcs11_data_free" "', argument " "1"" of type '" "void *""'");
31357   }
31358   engine_pkcs11_data_free(arg1);
31359   resultobj = SWIG_Py_Void();
31360   return resultobj;
31361 fail:
31362   return NULL;
31363 }
31364 
31365 
_wrap_engine_load_private_key(PyObject * self,PyObject * args)31366 SWIGINTERN PyObject *_wrap_engine_load_private_key(PyObject *self, PyObject *args) {
31367   PyObject *resultobj = 0;
31368   ENGINE *arg1 = (ENGINE *) 0 ;
31369   char *arg2 = (char *) 0 ;
31370   UI_METHOD *arg3 = (UI_METHOD *) 0 ;
31371   void *arg4 = (void *) 0 ;
31372   void *argp1 = 0 ;
31373   int res1 = 0 ;
31374   int res2 ;
31375   char *buf2 = 0 ;
31376   int alloc2 = 0 ;
31377   void *argp3 = 0 ;
31378   int res3 = 0 ;
31379   int res4 ;
31380   PyObject *swig_obj[4] ;
31381   EVP_PKEY *result = 0 ;
31382 
31383   if (!SWIG_Python_UnpackTuple(args, "engine_load_private_key", 4, 4, swig_obj)) SWIG_fail;
31384   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ENGINE, 0 |  0 );
31385   if (!SWIG_IsOK(res1)) {
31386     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_load_private_key" "', argument " "1"" of type '" "ENGINE *""'");
31387   }
31388   arg1 = (ENGINE *)(argp1);
31389   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
31390   if (!SWIG_IsOK(res2)) {
31391     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "engine_load_private_key" "', argument " "2"" of type '" "char const *""'");
31392   }
31393   arg2 = (char *)(buf2);
31394   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_UI_METHOD, 0 |  0 );
31395   if (!SWIG_IsOK(res3)) {
31396     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "engine_load_private_key" "', argument " "3"" of type '" "UI_METHOD *""'");
31397   }
31398   arg3 = (UI_METHOD *)(argp3);
31399   res4 = SWIG_ConvertPtr(swig_obj[3],SWIG_as_voidptrptr(&arg4), 0, 0);
31400   if (!SWIG_IsOK(res4)) {
31401     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "engine_load_private_key" "', argument " "4"" of type '" "void *""'");
31402   }
31403   {
31404     if (!arg1) {
31405       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31406     }
31407   }
31408   {
31409     if (!arg2) {
31410       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31411     }
31412   }
31413   result = (EVP_PKEY *)ENGINE_load_private_key(arg1,(char const *)arg2,arg3,arg4);
31414   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_PKEY, 0 |  0 );
31415   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31416   return resultobj;
31417 fail:
31418   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31419   return NULL;
31420 }
31421 
31422 
_wrap_engine_load_public_key(PyObject * self,PyObject * args)31423 SWIGINTERN PyObject *_wrap_engine_load_public_key(PyObject *self, PyObject *args) {
31424   PyObject *resultobj = 0;
31425   ENGINE *arg1 = (ENGINE *) 0 ;
31426   char *arg2 = (char *) 0 ;
31427   UI_METHOD *arg3 = (UI_METHOD *) 0 ;
31428   void *arg4 = (void *) 0 ;
31429   void *argp1 = 0 ;
31430   int res1 = 0 ;
31431   int res2 ;
31432   char *buf2 = 0 ;
31433   int alloc2 = 0 ;
31434   void *argp3 = 0 ;
31435   int res3 = 0 ;
31436   int res4 ;
31437   PyObject *swig_obj[4] ;
31438   EVP_PKEY *result = 0 ;
31439 
31440   if (!SWIG_Python_UnpackTuple(args, "engine_load_public_key", 4, 4, swig_obj)) SWIG_fail;
31441   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ENGINE, 0 |  0 );
31442   if (!SWIG_IsOK(res1)) {
31443     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_load_public_key" "', argument " "1"" of type '" "ENGINE *""'");
31444   }
31445   arg1 = (ENGINE *)(argp1);
31446   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
31447   if (!SWIG_IsOK(res2)) {
31448     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "engine_load_public_key" "', argument " "2"" of type '" "char const *""'");
31449   }
31450   arg2 = (char *)(buf2);
31451   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_UI_METHOD, 0 |  0 );
31452   if (!SWIG_IsOK(res3)) {
31453     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "engine_load_public_key" "', argument " "3"" of type '" "UI_METHOD *""'");
31454   }
31455   arg3 = (UI_METHOD *)(argp3);
31456   res4 = SWIG_ConvertPtr(swig_obj[3],SWIG_as_voidptrptr(&arg4), 0, 0);
31457   if (!SWIG_IsOK(res4)) {
31458     SWIG_exception_fail(SWIG_ArgError(res4), "in method '" "engine_load_public_key" "', argument " "4"" of type '" "void *""'");
31459   }
31460   {
31461     if (!arg1) {
31462       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31463     }
31464   }
31465   {
31466     if (!arg2) {
31467       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31468     }
31469   }
31470   result = (EVP_PKEY *)ENGINE_load_public_key(arg1,(char const *)arg2,arg3,arg4);
31471   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_EVP_PKEY, 0 |  0 );
31472   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31473   return resultobj;
31474 fail:
31475   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31476   return NULL;
31477 }
31478 
31479 
Swig_var__engine_err_set(PyObject * _val)31480 SWIGINTERN int Swig_var__engine_err_set(PyObject *_val) {
31481   {
31482     void *argp = 0;
31483     int res = SWIG_ConvertPtr(_val, &argp, SWIGTYPE_p_PyObject,  0 );
31484     if (!SWIG_IsOK(res)) {
31485       SWIG_exception_fail(SWIG_ArgError(res), "in variable '""_engine_err""' of type '""PyObject *""'");
31486     }
31487     _engine_err = (PyObject *)(argp);
31488   }
31489   return 0;
31490 fail:
31491   return 1;
31492 }
31493 
31494 
Swig_var__engine_err_get(void)31495 SWIGINTERN PyObject *Swig_var__engine_err_get(void) {
31496   PyObject *pyobj = 0;
31497   PyObject *self = 0;
31498 
31499   (void)self;
31500   pyobj = SWIG_NewPointerObj(SWIG_as_voidptr(_engine_err), SWIGTYPE_p_PyObject,  0 );
31501   return pyobj;
31502 }
31503 
31504 
_wrap_engine_init_error(PyObject * self,PyObject * args)31505 SWIGINTERN PyObject *_wrap_engine_init_error(PyObject *self, PyObject *args) {
31506   PyObject *resultobj = 0;
31507   PyObject *arg1 = (PyObject *) 0 ;
31508   PyObject *swig_obj[1] ;
31509 
31510   if (!args) SWIG_fail;
31511   swig_obj[0] = args;
31512   {
31513     arg1=swig_obj[0];
31514   }
31515   engine_init_error(arg1);
31516   resultobj = SWIG_Py_Void();
31517   return resultobj;
31518 fail:
31519   return NULL;
31520 }
31521 
31522 
_wrap_engine_load_certificate(PyObject * self,PyObject * args)31523 SWIGINTERN PyObject *_wrap_engine_load_certificate(PyObject *self, PyObject *args) {
31524   PyObject *resultobj = 0;
31525   ENGINE *arg1 = (ENGINE *) 0 ;
31526   char *arg2 = (char *) 0 ;
31527   void *argp1 = 0 ;
31528   int res1 = 0 ;
31529   int res2 ;
31530   char *buf2 = 0 ;
31531   int alloc2 = 0 ;
31532   PyObject *swig_obj[2] ;
31533   X509 *result = 0 ;
31534 
31535   if (!SWIG_Python_UnpackTuple(args, "engine_load_certificate", 2, 2, swig_obj)) SWIG_fail;
31536   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ENGINE, 0 |  0 );
31537   if (!SWIG_IsOK(res1)) {
31538     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_load_certificate" "', argument " "1"" of type '" "ENGINE *""'");
31539   }
31540   arg1 = (ENGINE *)(argp1);
31541   res2 = SWIG_AsCharPtrAndSize(swig_obj[1], &buf2, NULL, &alloc2);
31542   if (!SWIG_IsOK(res2)) {
31543     SWIG_exception_fail(SWIG_ArgError(res2), "in method '" "engine_load_certificate" "', argument " "2"" of type '" "char const *""'");
31544   }
31545   arg2 = (char *)(buf2);
31546   {
31547     if (!arg1) {
31548       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31549     }
31550   }
31551   {
31552     if (!arg2) {
31553       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31554     }
31555   }
31556   result = (X509 *)engine_load_certificate(arg1,(char const *)arg2);
31557   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_X509, 0 |  0 );
31558   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31559   return resultobj;
31560 fail:
31561   if (alloc2 == SWIG_NEWOBJ) free((char*)buf2);
31562   return NULL;
31563 }
31564 
31565 
_wrap_engine_set_default(PyObject * self,PyObject * args)31566 SWIGINTERN PyObject *_wrap_engine_set_default(PyObject *self, PyObject *args) {
31567   PyObject *resultobj = 0;
31568   ENGINE *arg1 = (ENGINE *) 0 ;
31569   unsigned int arg2 ;
31570   void *argp1 = 0 ;
31571   int res1 = 0 ;
31572   unsigned int val2 ;
31573   int ecode2 = 0 ;
31574   PyObject *swig_obj[2] ;
31575   int result;
31576 
31577   if (!SWIG_Python_UnpackTuple(args, "engine_set_default", 2, 2, swig_obj)) SWIG_fail;
31578   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ENGINE, 0 |  0 );
31579   if (!SWIG_IsOK(res1)) {
31580     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "engine_set_default" "', argument " "1"" of type '" "ENGINE *""'");
31581   }
31582   arg1 = (ENGINE *)(argp1);
31583   ecode2 = SWIG_AsVal_unsigned_SS_int(swig_obj[1], &val2);
31584   if (!SWIG_IsOK(ecode2)) {
31585     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "engine_set_default" "', argument " "2"" of type '" "unsigned int""'");
31586   }
31587   arg2 = (unsigned int)(val2);
31588   {
31589     if (!arg1) {
31590       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31591     }
31592   }
31593   result = (int)ENGINE_set_default(arg1,arg2);
31594   {
31595     resultobj=PyLong_FromLong(result);
31596     if (PyErr_Occurred()) SWIG_fail;
31597   }
31598   return resultobj;
31599 fail:
31600   return NULL;
31601 }
31602 
31603 
_wrap_obj_nid2obj(PyObject * self,PyObject * args)31604 SWIGINTERN PyObject *_wrap_obj_nid2obj(PyObject *self, PyObject *args) {
31605   PyObject *resultobj = 0;
31606   int arg1 ;
31607   int val1 ;
31608   int ecode1 = 0 ;
31609   PyObject *swig_obj[1] ;
31610   ASN1_OBJECT *result = 0 ;
31611 
31612   if (!args) SWIG_fail;
31613   swig_obj[0] = args;
31614   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
31615   if (!SWIG_IsOK(ecode1)) {
31616     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "obj_nid2obj" "', argument " "1"" of type '" "int""'");
31617   }
31618   arg1 = (int)(val1);
31619   result = (ASN1_OBJECT *)OBJ_nid2obj(arg1);
31620   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
31621   return resultobj;
31622 fail:
31623   return NULL;
31624 }
31625 
31626 
_wrap_obj_nid2ln(PyObject * self,PyObject * args)31627 SWIGINTERN PyObject *_wrap_obj_nid2ln(PyObject *self, PyObject *args) {
31628   PyObject *resultobj = 0;
31629   int arg1 ;
31630   int val1 ;
31631   int ecode1 = 0 ;
31632   PyObject *swig_obj[1] ;
31633   char *result = 0 ;
31634 
31635   if (!args) SWIG_fail;
31636   swig_obj[0] = args;
31637   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
31638   if (!SWIG_IsOK(ecode1)) {
31639     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "obj_nid2ln" "', argument " "1"" of type '" "int""'");
31640   }
31641   arg1 = (int)(val1);
31642   result = (char *)OBJ_nid2ln(arg1);
31643   resultobj = SWIG_FromCharPtr((const char *)result);
31644   return resultobj;
31645 fail:
31646   return NULL;
31647 }
31648 
31649 
_wrap_obj_nid2sn(PyObject * self,PyObject * args)31650 SWIGINTERN PyObject *_wrap_obj_nid2sn(PyObject *self, PyObject *args) {
31651   PyObject *resultobj = 0;
31652   int arg1 ;
31653   int val1 ;
31654   int ecode1 = 0 ;
31655   PyObject *swig_obj[1] ;
31656   char *result = 0 ;
31657 
31658   if (!args) SWIG_fail;
31659   swig_obj[0] = args;
31660   ecode1 = SWIG_AsVal_int(swig_obj[0], &val1);
31661   if (!SWIG_IsOK(ecode1)) {
31662     SWIG_exception_fail(SWIG_ArgError(ecode1), "in method '" "obj_nid2sn" "', argument " "1"" of type '" "int""'");
31663   }
31664   arg1 = (int)(val1);
31665   result = (char *)OBJ_nid2sn(arg1);
31666   resultobj = SWIG_FromCharPtr((const char *)result);
31667   return resultobj;
31668 fail:
31669   return NULL;
31670 }
31671 
31672 
_wrap_obj_obj2nid(PyObject * self,PyObject * args)31673 SWIGINTERN PyObject *_wrap_obj_obj2nid(PyObject *self, PyObject *args) {
31674   PyObject *resultobj = 0;
31675   ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ;
31676   void *argp1 = 0 ;
31677   int res1 = 0 ;
31678   PyObject *swig_obj[1] ;
31679   int result;
31680 
31681   if (!args) SWIG_fail;
31682   swig_obj[0] = args;
31683   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
31684   if (!SWIG_IsOK(res1)) {
31685     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_obj2nid" "', argument " "1"" of type '" "ASN1_OBJECT const *""'");
31686   }
31687   arg1 = (ASN1_OBJECT *)(argp1);
31688   {
31689     if (!arg1) {
31690       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31691     }
31692   }
31693   result = (int)OBJ_obj2nid((ASN1_OBJECT const *)arg1);
31694   {
31695     resultobj=PyLong_FromLong(result);
31696     if (PyErr_Occurred()) SWIG_fail;
31697   }
31698   return resultobj;
31699 fail:
31700   return NULL;
31701 }
31702 
31703 
_wrap_obj_ln2nid(PyObject * self,PyObject * args)31704 SWIGINTERN PyObject *_wrap_obj_ln2nid(PyObject *self, PyObject *args) {
31705   PyObject *resultobj = 0;
31706   char *arg1 = (char *) 0 ;
31707   int res1 ;
31708   char *buf1 = 0 ;
31709   int alloc1 = 0 ;
31710   PyObject *swig_obj[1] ;
31711   int result;
31712 
31713   if (!args) SWIG_fail;
31714   swig_obj[0] = args;
31715   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
31716   if (!SWIG_IsOK(res1)) {
31717     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_ln2nid" "', argument " "1"" of type '" "char const *""'");
31718   }
31719   arg1 = (char *)(buf1);
31720   {
31721     if (!arg1) {
31722       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31723     }
31724   }
31725   result = (int)OBJ_ln2nid((char const *)arg1);
31726   {
31727     resultobj=PyLong_FromLong(result);
31728     if (PyErr_Occurred()) SWIG_fail;
31729   }
31730   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31731   return resultobj;
31732 fail:
31733   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31734   return NULL;
31735 }
31736 
31737 
_wrap_obj_sn2nid(PyObject * self,PyObject * args)31738 SWIGINTERN PyObject *_wrap_obj_sn2nid(PyObject *self, PyObject *args) {
31739   PyObject *resultobj = 0;
31740   char *arg1 = (char *) 0 ;
31741   int res1 ;
31742   char *buf1 = 0 ;
31743   int alloc1 = 0 ;
31744   PyObject *swig_obj[1] ;
31745   int result;
31746 
31747   if (!args) SWIG_fail;
31748   swig_obj[0] = args;
31749   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
31750   if (!SWIG_IsOK(res1)) {
31751     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_sn2nid" "', argument " "1"" of type '" "char const *""'");
31752   }
31753   arg1 = (char *)(buf1);
31754   {
31755     if (!arg1) {
31756       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31757     }
31758   }
31759   result = (int)OBJ_sn2nid((char const *)arg1);
31760   {
31761     resultobj=PyLong_FromLong(result);
31762     if (PyErr_Occurred()) SWIG_fail;
31763   }
31764   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31765   return resultobj;
31766 fail:
31767   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31768   return NULL;
31769 }
31770 
31771 
_wrap_obj_txt2nid(PyObject * self,PyObject * args)31772 SWIGINTERN PyObject *_wrap_obj_txt2nid(PyObject *self, PyObject *args) {
31773   PyObject *resultobj = 0;
31774   char *arg1 = (char *) 0 ;
31775   int res1 ;
31776   char *buf1 = 0 ;
31777   int alloc1 = 0 ;
31778   PyObject *swig_obj[1] ;
31779   int result;
31780 
31781   if (!args) SWIG_fail;
31782   swig_obj[0] = args;
31783   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
31784   if (!SWIG_IsOK(res1)) {
31785     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_txt2nid" "', argument " "1"" of type '" "char const *""'");
31786   }
31787   arg1 = (char *)(buf1);
31788   {
31789     if (!arg1) {
31790       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31791     }
31792   }
31793   result = (int)OBJ_txt2nid((char const *)arg1);
31794   {
31795     resultobj=PyLong_FromLong(result);
31796     if (PyErr_Occurred()) SWIG_fail;
31797   }
31798   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31799   return resultobj;
31800 fail:
31801   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31802   return NULL;
31803 }
31804 
31805 
_wrap_obj_txt2obj(PyObject * self,PyObject * args)31806 SWIGINTERN PyObject *_wrap_obj_txt2obj(PyObject *self, PyObject *args) {
31807   PyObject *resultobj = 0;
31808   char *arg1 = (char *) 0 ;
31809   int arg2 ;
31810   int res1 ;
31811   char *buf1 = 0 ;
31812   int alloc1 = 0 ;
31813   int val2 ;
31814   int ecode2 = 0 ;
31815   PyObject *swig_obj[2] ;
31816   ASN1_OBJECT *result = 0 ;
31817 
31818   if (!SWIG_Python_UnpackTuple(args, "obj_txt2obj", 2, 2, swig_obj)) SWIG_fail;
31819   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
31820   if (!SWIG_IsOK(res1)) {
31821     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_txt2obj" "', argument " "1"" of type '" "char const *""'");
31822   }
31823   arg1 = (char *)(buf1);
31824   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
31825   if (!SWIG_IsOK(ecode2)) {
31826     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "obj_txt2obj" "', argument " "2"" of type '" "int""'");
31827   }
31828   arg2 = (int)(val2);
31829   {
31830     if (!arg1) {
31831       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31832     }
31833   }
31834   result = (ASN1_OBJECT *)OBJ_txt2obj((char const *)arg1,arg2);
31835   resultobj = SWIG_NewPointerObj(SWIG_as_voidptr(result), SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
31836   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31837   return resultobj;
31838 fail:
31839   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31840   return NULL;
31841 }
31842 
31843 
_wrap__obj_obj2txt(PyObject * self,PyObject * args)31844 SWIGINTERN PyObject *_wrap__obj_obj2txt(PyObject *self, PyObject *args) {
31845   PyObject *resultobj = 0;
31846   char *arg1 = (char *) 0 ;
31847   int arg2 ;
31848   ASN1_OBJECT *arg3 = (ASN1_OBJECT *) 0 ;
31849   int arg4 ;
31850   int res1 ;
31851   char *buf1 = 0 ;
31852   int alloc1 = 0 ;
31853   int val2 ;
31854   int ecode2 = 0 ;
31855   void *argp3 = 0 ;
31856   int res3 = 0 ;
31857   int val4 ;
31858   int ecode4 = 0 ;
31859   PyObject *swig_obj[4] ;
31860   int result;
31861 
31862   if (!SWIG_Python_UnpackTuple(args, "_obj_obj2txt", 4, 4, swig_obj)) SWIG_fail;
31863   res1 = SWIG_AsCharPtrAndSize(swig_obj[0], &buf1, NULL, &alloc1);
31864   if (!SWIG_IsOK(res1)) {
31865     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "_obj_obj2txt" "', argument " "1"" of type '" "char *""'");
31866   }
31867   arg1 = (char *)(buf1);
31868   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
31869   if (!SWIG_IsOK(ecode2)) {
31870     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "_obj_obj2txt" "', argument " "2"" of type '" "int""'");
31871   }
31872   arg2 = (int)(val2);
31873   res3 = SWIG_ConvertPtr(swig_obj[2], &argp3,SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
31874   if (!SWIG_IsOK(res3)) {
31875     SWIG_exception_fail(SWIG_ArgError(res3), "in method '" "_obj_obj2txt" "', argument " "3"" of type '" "ASN1_OBJECT const *""'");
31876   }
31877   arg3 = (ASN1_OBJECT *)(argp3);
31878   ecode4 = SWIG_AsVal_int(swig_obj[3], &val4);
31879   if (!SWIG_IsOK(ecode4)) {
31880     SWIG_exception_fail(SWIG_ArgError(ecode4), "in method '" "_obj_obj2txt" "', argument " "4"" of type '" "int""'");
31881   }
31882   arg4 = (int)(val4);
31883   {
31884     if (!arg3) {
31885       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31886     }
31887   }
31888   result = (int)OBJ_obj2txt(arg1,arg2,(ASN1_OBJECT const *)arg3,arg4);
31889   {
31890     resultobj=PyLong_FromLong(result);
31891     if (PyErr_Occurred()) SWIG_fail;
31892   }
31893   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31894   return resultobj;
31895 fail:
31896   if (alloc1 == SWIG_NEWOBJ) free((char*)buf1);
31897   return NULL;
31898 }
31899 
31900 
_wrap_obj_obj2txt(PyObject * self,PyObject * args)31901 SWIGINTERN PyObject *_wrap_obj_obj2txt(PyObject *self, PyObject *args) {
31902   PyObject *resultobj = 0;
31903   ASN1_OBJECT *arg1 = (ASN1_OBJECT *) 0 ;
31904   int arg2 ;
31905   void *argp1 = 0 ;
31906   int res1 = 0 ;
31907   int val2 ;
31908   int ecode2 = 0 ;
31909   PyObject *swig_obj[2] ;
31910   PyObject *result = 0 ;
31911 
31912   if (!SWIG_Python_UnpackTuple(args, "obj_obj2txt", 2, 2, swig_obj)) SWIG_fail;
31913   res1 = SWIG_ConvertPtr(swig_obj[0], &argp1,SWIGTYPE_p_ASN1_OBJECT, 0 |  0 );
31914   if (!SWIG_IsOK(res1)) {
31915     SWIG_exception_fail(SWIG_ArgError(res1), "in method '" "obj_obj2txt" "', argument " "1"" of type '" "ASN1_OBJECT const *""'");
31916   }
31917   arg1 = (ASN1_OBJECT *)(argp1);
31918   ecode2 = SWIG_AsVal_int(swig_obj[1], &val2);
31919   if (!SWIG_IsOK(ecode2)) {
31920     SWIG_exception_fail(SWIG_ArgError(ecode2), "in method '" "obj_obj2txt" "', argument " "2"" of type '" "int""'");
31921   }
31922   arg2 = (int)(val2);
31923   {
31924     if (!arg1) {
31925       SWIG_exception(SWIG_ValueError,"Received a NULL pointer.");
31926     }
31927   }
31928   result = (PyObject *)obj_obj2txt((ASN1_OBJECT const *)arg1,arg2);
31929   {
31930     resultobj=result;
31931   }
31932   return resultobj;
31933 fail:
31934   return NULL;
31935 }
31936 
31937 
31938 static PyMethodDef SwigMethods[] = {
31939 	 { "SWIG_PyInstanceMethod_New", SWIG_PyInstanceMethod_New, METH_O, NULL},
31940 	 { "OPENSSL_sk_num", _wrap_OPENSSL_sk_num, METH_O, NULL},
31941 	 { "OPENSSL_sk_value", _wrap_OPENSSL_sk_value, METH_VARARGS, NULL},
31942 	 { "OPENSSL_sk_set", _wrap_OPENSSL_sk_set, METH_VARARGS, NULL},
31943 	 { "OPENSSL_sk_new", _wrap_OPENSSL_sk_new, METH_O, NULL},
31944 	 { "OPENSSL_sk_new_null", _wrap_OPENSSL_sk_new_null, METH_NOARGS, NULL},
31945 	 { "OPENSSL_sk_new_reserve", _wrap_OPENSSL_sk_new_reserve, METH_VARARGS, NULL},
31946 	 { "OPENSSL_sk_reserve", _wrap_OPENSSL_sk_reserve, METH_VARARGS, NULL},
31947 	 { "OPENSSL_sk_free", _wrap_OPENSSL_sk_free, METH_O, NULL},
31948 	 { "OPENSSL_sk_pop_free", _wrap_OPENSSL_sk_pop_free, METH_VARARGS, NULL},
31949 	 { "OPENSSL_sk_deep_copy", _wrap_OPENSSL_sk_deep_copy, METH_VARARGS, NULL},
31950 	 { "OPENSSL_sk_insert", _wrap_OPENSSL_sk_insert, METH_VARARGS, NULL},
31951 	 { "OPENSSL_sk_delete", _wrap_OPENSSL_sk_delete, METH_VARARGS, NULL},
31952 	 { "OPENSSL_sk_delete_ptr", _wrap_OPENSSL_sk_delete_ptr, METH_VARARGS, NULL},
31953 	 { "OPENSSL_sk_find", _wrap_OPENSSL_sk_find, METH_VARARGS, NULL},
31954 	 { "OPENSSL_sk_find_ex", _wrap_OPENSSL_sk_find_ex, METH_VARARGS, NULL},
31955 	 { "OPENSSL_sk_push", _wrap_OPENSSL_sk_push, METH_VARARGS, NULL},
31956 	 { "OPENSSL_sk_unshift", _wrap_OPENSSL_sk_unshift, METH_VARARGS, NULL},
31957 	 { "OPENSSL_sk_shift", _wrap_OPENSSL_sk_shift, METH_O, NULL},
31958 	 { "OPENSSL_sk_pop", _wrap_OPENSSL_sk_pop, METH_O, NULL},
31959 	 { "OPENSSL_sk_zero", _wrap_OPENSSL_sk_zero, METH_O, NULL},
31960 	 { "OPENSSL_sk_set_cmp_func", _wrap_OPENSSL_sk_set_cmp_func, METH_VARARGS, NULL},
31961 	 { "OPENSSL_sk_dup", _wrap_OPENSSL_sk_dup, METH_O, NULL},
31962 	 { "OPENSSL_sk_sort", _wrap_OPENSSL_sk_sort, METH_O, NULL},
31963 	 { "OPENSSL_sk_is_sorted", _wrap_OPENSSL_sk_is_sorted, METH_O, NULL},
31964 	 { "sk_OPENSSL_STRING_num", _wrap_sk_OPENSSL_STRING_num, METH_O, NULL},
31965 	 { "sk_OPENSSL_STRING_value", _wrap_sk_OPENSSL_STRING_value, METH_VARARGS, NULL},
31966 	 { "sk_OPENSSL_STRING_new", _wrap_sk_OPENSSL_STRING_new, METH_O, NULL},
31967 	 { "sk_OPENSSL_STRING_new_null", _wrap_sk_OPENSSL_STRING_new_null, METH_NOARGS, NULL},
31968 	 { "sk_OPENSSL_STRING_new_reserve", _wrap_sk_OPENSSL_STRING_new_reserve, METH_VARARGS, NULL},
31969 	 { "sk_OPENSSL_STRING_reserve", _wrap_sk_OPENSSL_STRING_reserve, METH_VARARGS, NULL},
31970 	 { "sk_OPENSSL_STRING_free", _wrap_sk_OPENSSL_STRING_free, METH_O, NULL},
31971 	 { "sk_OPENSSL_STRING_zero", _wrap_sk_OPENSSL_STRING_zero, METH_O, NULL},
31972 	 { "sk_OPENSSL_STRING_delete", _wrap_sk_OPENSSL_STRING_delete, METH_VARARGS, NULL},
31973 	 { "sk_OPENSSL_STRING_delete_ptr", _wrap_sk_OPENSSL_STRING_delete_ptr, METH_VARARGS, NULL},
31974 	 { "sk_OPENSSL_STRING_push", _wrap_sk_OPENSSL_STRING_push, METH_VARARGS, NULL},
31975 	 { "sk_OPENSSL_STRING_unshift", _wrap_sk_OPENSSL_STRING_unshift, METH_VARARGS, NULL},
31976 	 { "sk_OPENSSL_STRING_pop", _wrap_sk_OPENSSL_STRING_pop, METH_O, NULL},
31977 	 { "sk_OPENSSL_STRING_shift", _wrap_sk_OPENSSL_STRING_shift, METH_O, NULL},
31978 	 { "sk_OPENSSL_STRING_pop_free", _wrap_sk_OPENSSL_STRING_pop_free, METH_VARARGS, NULL},
31979 	 { "sk_OPENSSL_STRING_insert", _wrap_sk_OPENSSL_STRING_insert, METH_VARARGS, NULL},
31980 	 { "sk_OPENSSL_STRING_set", _wrap_sk_OPENSSL_STRING_set, METH_VARARGS, NULL},
31981 	 { "sk_OPENSSL_STRING_find", _wrap_sk_OPENSSL_STRING_find, METH_VARARGS, NULL},
31982 	 { "sk_OPENSSL_STRING_find_ex", _wrap_sk_OPENSSL_STRING_find_ex, METH_VARARGS, NULL},
31983 	 { "sk_OPENSSL_STRING_sort", _wrap_sk_OPENSSL_STRING_sort, METH_O, NULL},
31984 	 { "sk_OPENSSL_STRING_is_sorted", _wrap_sk_OPENSSL_STRING_is_sorted, METH_O, NULL},
31985 	 { "sk_OPENSSL_STRING_dup", _wrap_sk_OPENSSL_STRING_dup, METH_O, NULL},
31986 	 { "sk_OPENSSL_STRING_deep_copy", _wrap_sk_OPENSSL_STRING_deep_copy, METH_VARARGS, NULL},
31987 	 { "sk_OPENSSL_STRING_set_cmp_func", _wrap_sk_OPENSSL_STRING_set_cmp_func, METH_VARARGS, NULL},
31988 	 { "sk_OPENSSL_CSTRING_num", _wrap_sk_OPENSSL_CSTRING_num, METH_O, NULL},
31989 	 { "sk_OPENSSL_CSTRING_value", _wrap_sk_OPENSSL_CSTRING_value, METH_VARARGS, NULL},
31990 	 { "sk_OPENSSL_CSTRING_new", _wrap_sk_OPENSSL_CSTRING_new, METH_O, NULL},
31991 	 { "sk_OPENSSL_CSTRING_new_null", _wrap_sk_OPENSSL_CSTRING_new_null, METH_NOARGS, NULL},
31992 	 { "sk_OPENSSL_CSTRING_new_reserve", _wrap_sk_OPENSSL_CSTRING_new_reserve, METH_VARARGS, NULL},
31993 	 { "sk_OPENSSL_CSTRING_reserve", _wrap_sk_OPENSSL_CSTRING_reserve, METH_VARARGS, NULL},
31994 	 { "sk_OPENSSL_CSTRING_free", _wrap_sk_OPENSSL_CSTRING_free, METH_O, NULL},
31995 	 { "sk_OPENSSL_CSTRING_zero", _wrap_sk_OPENSSL_CSTRING_zero, METH_O, NULL},
31996 	 { "sk_OPENSSL_CSTRING_delete", _wrap_sk_OPENSSL_CSTRING_delete, METH_VARARGS, NULL},
31997 	 { "sk_OPENSSL_CSTRING_delete_ptr", _wrap_sk_OPENSSL_CSTRING_delete_ptr, METH_VARARGS, NULL},
31998 	 { "sk_OPENSSL_CSTRING_push", _wrap_sk_OPENSSL_CSTRING_push, METH_VARARGS, NULL},
31999 	 { "sk_OPENSSL_CSTRING_unshift", _wrap_sk_OPENSSL_CSTRING_unshift, METH_VARARGS, NULL},
32000 	 { "sk_OPENSSL_CSTRING_pop", _wrap_sk_OPENSSL_CSTRING_pop, METH_O, NULL},
32001 	 { "sk_OPENSSL_CSTRING_shift", _wrap_sk_OPENSSL_CSTRING_shift, METH_O, NULL},
32002 	 { "sk_OPENSSL_CSTRING_pop_free", _wrap_sk_OPENSSL_CSTRING_pop_free, METH_VARARGS, NULL},
32003 	 { "sk_OPENSSL_CSTRING_insert", _wrap_sk_OPENSSL_CSTRING_insert, METH_VARARGS, NULL},
32004 	 { "sk_OPENSSL_CSTRING_set", _wrap_sk_OPENSSL_CSTRING_set, METH_VARARGS, NULL},
32005 	 { "sk_OPENSSL_CSTRING_find", _wrap_sk_OPENSSL_CSTRING_find, METH_VARARGS, NULL},
32006 	 { "sk_OPENSSL_CSTRING_find_ex", _wrap_sk_OPENSSL_CSTRING_find_ex, METH_VARARGS, NULL},
32007 	 { "sk_OPENSSL_CSTRING_sort", _wrap_sk_OPENSSL_CSTRING_sort, METH_O, NULL},
32008 	 { "sk_OPENSSL_CSTRING_is_sorted", _wrap_sk_OPENSSL_CSTRING_is_sorted, METH_O, NULL},
32009 	 { "sk_OPENSSL_CSTRING_dup", _wrap_sk_OPENSSL_CSTRING_dup, METH_O, NULL},
32010 	 { "sk_OPENSSL_CSTRING_deep_copy", _wrap_sk_OPENSSL_CSTRING_deep_copy, METH_VARARGS, NULL},
32011 	 { "sk_OPENSSL_CSTRING_set_cmp_func", _wrap_sk_OPENSSL_CSTRING_set_cmp_func, METH_VARARGS, NULL},
32012 	 { "sk_OPENSSL_BLOCK_num", _wrap_sk_OPENSSL_BLOCK_num, METH_O, NULL},
32013 	 { "sk_OPENSSL_BLOCK_value", _wrap_sk_OPENSSL_BLOCK_value, METH_VARARGS, NULL},
32014 	 { "sk_OPENSSL_BLOCK_new", _wrap_sk_OPENSSL_BLOCK_new, METH_O, NULL},
32015 	 { "sk_OPENSSL_BLOCK_new_null", _wrap_sk_OPENSSL_BLOCK_new_null, METH_NOARGS, NULL},
32016 	 { "sk_OPENSSL_BLOCK_new_reserve", _wrap_sk_OPENSSL_BLOCK_new_reserve, METH_VARARGS, NULL},
32017 	 { "sk_OPENSSL_BLOCK_reserve", _wrap_sk_OPENSSL_BLOCK_reserve, METH_VARARGS, NULL},
32018 	 { "sk_OPENSSL_BLOCK_free", _wrap_sk_OPENSSL_BLOCK_free, METH_O, NULL},
32019 	 { "sk_OPENSSL_BLOCK_zero", _wrap_sk_OPENSSL_BLOCK_zero, METH_O, NULL},
32020 	 { "sk_OPENSSL_BLOCK_delete", _wrap_sk_OPENSSL_BLOCK_delete, METH_VARARGS, NULL},
32021 	 { "sk_OPENSSL_BLOCK_delete_ptr", _wrap_sk_OPENSSL_BLOCK_delete_ptr, METH_VARARGS, NULL},
32022 	 { "sk_OPENSSL_BLOCK_push", _wrap_sk_OPENSSL_BLOCK_push, METH_VARARGS, NULL},
32023 	 { "sk_OPENSSL_BLOCK_unshift", _wrap_sk_OPENSSL_BLOCK_unshift, METH_VARARGS, NULL},
32024 	 { "sk_OPENSSL_BLOCK_pop", _wrap_sk_OPENSSL_BLOCK_pop, METH_O, NULL},
32025 	 { "sk_OPENSSL_BLOCK_shift", _wrap_sk_OPENSSL_BLOCK_shift, METH_O, NULL},
32026 	 { "sk_OPENSSL_BLOCK_pop_free", _wrap_sk_OPENSSL_BLOCK_pop_free, METH_VARARGS, NULL},
32027 	 { "sk_OPENSSL_BLOCK_insert", _wrap_sk_OPENSSL_BLOCK_insert, METH_VARARGS, NULL},
32028 	 { "sk_OPENSSL_BLOCK_set", _wrap_sk_OPENSSL_BLOCK_set, METH_VARARGS, NULL},
32029 	 { "sk_OPENSSL_BLOCK_find", _wrap_sk_OPENSSL_BLOCK_find, METH_VARARGS, NULL},
32030 	 { "sk_OPENSSL_BLOCK_find_ex", _wrap_sk_OPENSSL_BLOCK_find_ex, METH_VARARGS, NULL},
32031 	 { "sk_OPENSSL_BLOCK_sort", _wrap_sk_OPENSSL_BLOCK_sort, METH_O, NULL},
32032 	 { "sk_OPENSSL_BLOCK_is_sorted", _wrap_sk_OPENSSL_BLOCK_is_sorted, METH_O, NULL},
32033 	 { "sk_OPENSSL_BLOCK_dup", _wrap_sk_OPENSSL_BLOCK_dup, METH_O, NULL},
32034 	 { "sk_OPENSSL_BLOCK_deep_copy", _wrap_sk_OPENSSL_BLOCK_deep_copy, METH_VARARGS, NULL},
32035 	 { "sk_OPENSSL_BLOCK_set_cmp_func", _wrap_sk_OPENSSL_BLOCK_set_cmp_func, METH_VARARGS, NULL},
32036 	 { "threading_init", _wrap_threading_init, METH_NOARGS, NULL},
32037 	 { "threading_cleanup", _wrap_threading_cleanup, METH_NOARGS, NULL},
32038 	 { "lib_init", _wrap_lib_init, METH_NOARGS, NULL},
32039 	 { "bn_to_mpi", _wrap_bn_to_mpi, METH_O, NULL},
32040 	 { "mpi_to_bn", _wrap_mpi_to_bn, METH_O, NULL},
32041 	 { "bn_to_bin", _wrap_bn_to_bin, METH_O, NULL},
32042 	 { "bin_to_bn", _wrap_bin_to_bn, METH_O, NULL},
32043 	 { "bn_to_hex", _wrap_bn_to_hex, METH_O, NULL},
32044 	 { "hex_to_bn", _wrap_hex_to_bn, METH_O, NULL},
32045 	 { "dec_to_bn", _wrap_dec_to_bn, METH_O, NULL},
32046 	 { "err_print_errors", _wrap_err_print_errors, METH_O, NULL},
32047 	 { "err_get_error", _wrap_err_get_error, METH_NOARGS, NULL},
32048 	 { "err_peek_error", _wrap_err_peek_error, METH_NOARGS, NULL},
32049 	 { "err_lib_error_string", _wrap_err_lib_error_string, METH_O, NULL},
32050 	 { "err_func_error_string", _wrap_err_func_error_string, METH_O, NULL},
32051 	 { "err_reason_error_string", _wrap_err_reason_error_string, METH_O, NULL},
32052 	 { "bio_s_bio", _wrap_bio_s_bio, METH_NOARGS, NULL},
32053 	 { "bio_s_mem", _wrap_bio_s_mem, METH_NOARGS, NULL},
32054 	 { "bio_s_socket", _wrap_bio_s_socket, METH_NOARGS, NULL},
32055 	 { "bio_f_ssl", _wrap_bio_f_ssl, METH_NOARGS, NULL},
32056 	 { "bio_f_buffer", _wrap_bio_f_buffer, METH_NOARGS, NULL},
32057 	 { "bio_f_cipher", _wrap_bio_f_cipher, METH_NOARGS, NULL},
32058 	 { "bio_new", _wrap_bio_new, METH_O, NULL},
32059 	 { "bio_new_socket", _wrap_bio_new_socket, METH_VARARGS, NULL},
32060 	 { "bio_free_all", _wrap_bio_free_all, METH_O, NULL},
32061 	 { "bio_dup_chain", _wrap_bio_dup_chain, METH_O, NULL},
32062 	 { "bio_push", _wrap_bio_push, METH_VARARGS, NULL},
32063 	 { "bio_pop", _wrap_bio_pop, METH_O, NULL},
32064 	 { "bio_eof", _wrap_bio_eof, METH_O, NULL},
32065 	 { "pyfd_init", _wrap_pyfd_init, METH_NOARGS, NULL},
32066 	 { "bio_init", _wrap_bio_init, METH_O, NULL},
32067 	 { "bio_free", _wrap_bio_free, METH_O, NULL},
32068 	 { "bio_new_file", _wrap_bio_new_file, METH_VARARGS, NULL},
32069 	 { "bio_new_pyfile", _wrap_bio_new_pyfile, METH_VARARGS, NULL},
32070 	 { "bio_read", _wrap_bio_read, METH_VARARGS, NULL},
32071 	 { "bio_gets", _wrap_bio_gets, METH_VARARGS, NULL},
32072 	 { "bio_write", _wrap_bio_write, METH_VARARGS, NULL},
32073 	 { "bio_ctrl_pending", _wrap_bio_ctrl_pending, METH_O, NULL},
32074 	 { "bio_ctrl_wpending", _wrap_bio_ctrl_wpending, METH_O, NULL},
32075 	 { "bio_ctrl_get_write_guarantee", _wrap_bio_ctrl_get_write_guarantee, METH_O, NULL},
32076 	 { "bio_reset", _wrap_bio_reset, METH_O, NULL},
32077 	 { "bio_flush", _wrap_bio_flush, METH_O, NULL},
32078 	 { "bio_seek", _wrap_bio_seek, METH_VARARGS, NULL},
32079 	 { "bio_tell", _wrap_bio_tell, METH_O, NULL},
32080 	 { "bio_set_flags", _wrap_bio_set_flags, METH_VARARGS, NULL},
32081 	 { "bio_get_flags", _wrap_bio_get_flags, METH_O, NULL},
32082 	 { "bio_set_cipher", _wrap_bio_set_cipher, METH_VARARGS, NULL},
32083 	 { "bio_set_mem_eof_return", _wrap_bio_set_mem_eof_return, METH_VARARGS, NULL},
32084 	 { "bio_get_fd", _wrap_bio_get_fd, METH_O, NULL},
32085 	 { "bio_do_handshake", _wrap_bio_do_handshake, METH_O, NULL},
32086 	 { "bio_make_bio_pair", _wrap_bio_make_bio_pair, METH_VARARGS, NULL},
32087 	 { "bio_set_write_buf_size", _wrap_bio_set_write_buf_size, METH_VARARGS, NULL},
32088 	 { "bio_should_retry", _wrap_bio_should_retry, METH_O, NULL},
32089 	 { "bio_should_read", _wrap_bio_should_read, METH_O, NULL},
32090 	 { "bio_should_write", _wrap_bio_should_write, METH_O, NULL},
32091 	 { "pyfd_write", _wrap_pyfd_write, METH_VARARGS, NULL},
32092 	 { "pyfd_read", _wrap_pyfd_read, METH_VARARGS, NULL},
32093 	 { "pyfd_puts", _wrap_pyfd_puts, METH_VARARGS, NULL},
32094 	 { "pyfd_gets", _wrap_pyfd_gets, METH_VARARGS, NULL},
32095 	 { "pyfd_new", _wrap_pyfd_new, METH_O, NULL},
32096 	 { "pyfd_free", _wrap_pyfd_free, METH_O, NULL},
32097 	 { "pyfd_ctrl", _wrap_pyfd_ctrl, METH_VARARGS, NULL},
32098 	 { "bio_new_pyfd", _wrap_bio_new_pyfd, METH_VARARGS, NULL},
32099 	 { "bn_rand", _wrap_bn_rand, METH_VARARGS, NULL},
32100 	 { "bn_rand_range", _wrap_bn_rand_range, METH_O, NULL},
32101 	 { "rand_load_file", _wrap_rand_load_file, METH_VARARGS, NULL},
32102 	 { "rand_save_file", _wrap_rand_save_file, METH_O, NULL},
32103 	 { "rand_poll", _wrap_rand_poll, METH_NOARGS, NULL},
32104 	 { "rand_status", _wrap_rand_status, METH_NOARGS, NULL},
32105 	 { "rand_cleanup", _wrap_rand_cleanup, METH_NOARGS, NULL},
32106 	 { "rand_init", _wrap_rand_init, METH_O, NULL},
32107 	 { "rand_seed", _wrap_rand_seed, METH_O, NULL},
32108 	 { "rand_add", _wrap_rand_add, METH_VARARGS, NULL},
32109 	 { "rand_bytes", _wrap_rand_bytes, METH_O, NULL},
32110 	 { "rand_pseudo_bytes", _wrap_rand_pseudo_bytes, METH_O, NULL},
32111 	 { "rand_file_name", _wrap_rand_file_name, METH_VARARGS, NULL},
32112 	 { "rand_screen", _wrap_rand_screen, METH_NOARGS, NULL},
32113 	 { "rand_win32_event", _wrap_rand_win32_event, METH_VARARGS, NULL},
32114 	 { "md5", _wrap_md5, METH_NOARGS, NULL},
32115 	 { "sha1", _wrap_sha1, METH_NOARGS, NULL},
32116 	 { "ripemd160", _wrap_ripemd160, METH_NOARGS, NULL},
32117 	 { "sha224", _wrap_sha224, METH_NOARGS, NULL},
32118 	 { "sha256", _wrap_sha256, METH_NOARGS, NULL},
32119 	 { "sha384", _wrap_sha384, METH_NOARGS, NULL},
32120 	 { "sha512", _wrap_sha512, METH_NOARGS, NULL},
32121 	 { "digest_init", _wrap_digest_init, METH_VARARGS, NULL},
32122 	 { "des_ecb", _wrap_des_ecb, METH_NOARGS, NULL},
32123 	 { "des_ede_ecb", _wrap_des_ede_ecb, METH_NOARGS, NULL},
32124 	 { "des_ede3_ecb", _wrap_des_ede3_ecb, METH_NOARGS, NULL},
32125 	 { "des_cbc", _wrap_des_cbc, METH_NOARGS, NULL},
32126 	 { "des_ede_cbc", _wrap_des_ede_cbc, METH_NOARGS, NULL},
32127 	 { "des_ede3_cbc", _wrap_des_ede3_cbc, METH_NOARGS, NULL},
32128 	 { "des_cfb", _wrap_des_cfb, METH_NOARGS, NULL},
32129 	 { "des_ede_cfb", _wrap_des_ede_cfb, METH_NOARGS, NULL},
32130 	 { "des_ede3_cfb", _wrap_des_ede3_cfb, METH_NOARGS, NULL},
32131 	 { "des_ofb", _wrap_des_ofb, METH_NOARGS, NULL},
32132 	 { "des_ede_ofb", _wrap_des_ede_ofb, METH_NOARGS, NULL},
32133 	 { "des_ede3_ofb", _wrap_des_ede3_ofb, METH_NOARGS, NULL},
32134 	 { "bf_ecb", _wrap_bf_ecb, METH_NOARGS, NULL},
32135 	 { "bf_cbc", _wrap_bf_cbc, METH_NOARGS, NULL},
32136 	 { "bf_cfb", _wrap_bf_cfb, METH_NOARGS, NULL},
32137 	 { "bf_ofb", _wrap_bf_ofb, METH_NOARGS, NULL},
32138 	 { "cast5_ecb", _wrap_cast5_ecb, METH_NOARGS, NULL},
32139 	 { "cast5_cbc", _wrap_cast5_cbc, METH_NOARGS, NULL},
32140 	 { "cast5_cfb", _wrap_cast5_cfb, METH_NOARGS, NULL},
32141 	 { "cast5_ofb", _wrap_cast5_ofb, METH_NOARGS, NULL},
32142 	 { "rc4", _wrap_rc4, METH_NOARGS, NULL},
32143 	 { "rc2_40_cbc", _wrap_rc2_40_cbc, METH_NOARGS, NULL},
32144 	 { "aes_128_ecb", _wrap_aes_128_ecb, METH_NOARGS, NULL},
32145 	 { "aes_128_cbc", _wrap_aes_128_cbc, METH_NOARGS, NULL},
32146 	 { "aes_128_cfb", _wrap_aes_128_cfb, METH_NOARGS, NULL},
32147 	 { "aes_128_ofb", _wrap_aes_128_ofb, METH_NOARGS, NULL},
32148 	 { "aes_128_ctr", _wrap_aes_128_ctr, METH_NOARGS, NULL},
32149 	 { "aes_192_ecb", _wrap_aes_192_ecb, METH_NOARGS, NULL},
32150 	 { "aes_192_cbc", _wrap_aes_192_cbc, METH_NOARGS, NULL},
32151 	 { "aes_192_cfb", _wrap_aes_192_cfb, METH_NOARGS, NULL},
32152 	 { "aes_192_ofb", _wrap_aes_192_ofb, METH_NOARGS, NULL},
32153 	 { "aes_192_ctr", _wrap_aes_192_ctr, METH_NOARGS, NULL},
32154 	 { "aes_256_ecb", _wrap_aes_256_ecb, METH_NOARGS, NULL},
32155 	 { "aes_256_cbc", _wrap_aes_256_cbc, METH_NOARGS, NULL},
32156 	 { "aes_256_cfb", _wrap_aes_256_cfb, METH_NOARGS, NULL},
32157 	 { "aes_256_ofb", _wrap_aes_256_ofb, METH_NOARGS, NULL},
32158 	 { "aes_256_ctr", _wrap_aes_256_ctr, METH_NOARGS, NULL},
32159 	 { "cipher_set_padding", _wrap_cipher_set_padding, METH_VARARGS, NULL},
32160 	 { "pkey_free", _wrap_pkey_free, METH_O, NULL},
32161 	 { "pkey_assign", _wrap_pkey_assign, METH_VARARGS, NULL},
32162 	 { "pkey_assign_ec", _wrap_pkey_assign_ec, METH_VARARGS, NULL},
32163 	 { "pkey_set1_rsa", _wrap_pkey_set1_rsa, METH_VARARGS, NULL},
32164 	 { "sign_init", _wrap_sign_init, METH_VARARGS, NULL},
32165 	 { "verify_init", _wrap_verify_init, METH_VARARGS, NULL},
32166 	 { "pkey_size", _wrap_pkey_size, METH_O, NULL},
32167 	 { "evp_init", _wrap_evp_init, METH_O, NULL},
32168 	 { "pkey_get1_rsa", _wrap_pkey_get1_rsa, METH_O, NULL},
32169 	 { "pkcs5_pbkdf2_hmac_sha1", _wrap_pkcs5_pbkdf2_hmac_sha1, METH_VARARGS, NULL},
32170 	 { "md_ctx_new", _wrap_md_ctx_new, METH_NOARGS, NULL},
32171 	 { "md_ctx_free", _wrap_md_ctx_free, METH_O, NULL},
32172 	 { "digest_update", _wrap_digest_update, METH_VARARGS, NULL},
32173 	 { "digest_final", _wrap_digest_final, METH_O, NULL},
32174 	 { "hmac_ctx_new", _wrap_hmac_ctx_new, METH_NOARGS, NULL},
32175 	 { "hmac_ctx_free", _wrap_hmac_ctx_free, METH_O, NULL},
32176 	 { "hmac_init", _wrap_hmac_init, METH_VARARGS, NULL},
32177 	 { "hmac_update", _wrap_hmac_update, METH_VARARGS, NULL},
32178 	 { "hmac_final", _wrap_hmac_final, METH_O, NULL},
32179 	 { "hmac", _wrap_hmac, METH_VARARGS, NULL},
32180 	 { "cipher_ctx_new", _wrap_cipher_ctx_new, METH_NOARGS, NULL},
32181 	 { "cipher_ctx_free", _wrap_cipher_ctx_free, METH_O, NULL},
32182 	 { "bytes_to_key", _wrap_bytes_to_key, METH_VARARGS, NULL},
32183 	 { "cipher_init", _wrap_cipher_init, METH_VARARGS, NULL},
32184 	 { "cipher_update", _wrap_cipher_update, METH_VARARGS, NULL},
32185 	 { "cipher_final", _wrap_cipher_final, METH_O, NULL},
32186 	 { "sign_update", _wrap_sign_update, METH_VARARGS, NULL},
32187 	 { "sign_final", _wrap_sign_final, METH_VARARGS, NULL},
32188 	 { "verify_update", _wrap_verify_update, METH_VARARGS, NULL},
32189 	 { "verify_final", _wrap_verify_final, METH_VARARGS, NULL},
32190 	 { "digest_sign_init", _wrap_digest_sign_init, METH_VARARGS, NULL},
32191 	 { "digest_sign_update", _wrap_digest_sign_update, METH_VARARGS, NULL},
32192 	 { "digest_sign_final", _wrap_digest_sign_final, METH_O, NULL},
32193 	 { "digest_sign", _wrap_digest_sign, METH_VARARGS, NULL},
32194 	 { "digest_verify_init", _wrap_digest_verify_init, METH_VARARGS, NULL},
32195 	 { "digest_verify_update", _wrap_digest_verify_update, METH_VARARGS, NULL},
32196 	 { "digest_verify_final", _wrap_digest_verify_final, METH_VARARGS, NULL},
32197 	 { "digest_verify", _wrap_digest_verify, METH_VARARGS, NULL},
32198 	 { "get_digestbyname", _wrap_get_digestbyname, METH_O, NULL},
32199 	 { "pkey_write_pem_no_cipher", _wrap_pkey_write_pem_no_cipher, METH_VARARGS, NULL},
32200 	 { "pkey_write_pem", _wrap_pkey_write_pem, METH_VARARGS, NULL},
32201 	 { "pkey_new", _wrap_pkey_new, METH_NOARGS, NULL},
32202 	 { "pkey_read_pem", _wrap_pkey_read_pem, METH_VARARGS, NULL},
32203 	 { "pkey_read_pem_pubkey", _wrap_pkey_read_pem_pubkey, METH_VARARGS, NULL},
32204 	 { "pkey_assign_rsa", _wrap_pkey_assign_rsa, METH_VARARGS, NULL},
32205 	 { "pkey_as_der", _wrap_pkey_as_der, METH_O, NULL},
32206 	 { "pkey_get_modulus", _wrap_pkey_get_modulus, METH_O, NULL},
32207 	 { "aes_new", _wrap_aes_new, METH_NOARGS, NULL},
32208 	 { "AES_free", _wrap_AES_free, METH_O, NULL},
32209 	 { "AES_set_key", _wrap_AES_set_key, METH_VARARGS, NULL},
32210 	 { "AES_crypt", _wrap_AES_crypt, METH_VARARGS, NULL},
32211 	 { "AES_type_check", _wrap_AES_type_check, METH_O, NULL},
32212 	 { "rc4_new", _wrap_rc4_new, METH_NOARGS, NULL},
32213 	 { "rc4_free", _wrap_rc4_free, METH_O, NULL},
32214 	 { "rc4_set_key", _wrap_rc4_set_key, METH_VARARGS, NULL},
32215 	 { "rc4_update", _wrap_rc4_update, METH_VARARGS, NULL},
32216 	 { "rc4_type_check", _wrap_rc4_type_check, METH_O, NULL},
32217 	 { "dh_new", _wrap_dh_new, METH_NOARGS, NULL},
32218 	 { "dh_free", _wrap_dh_free, METH_O, NULL},
32219 	 { "dh_size", _wrap_dh_size, METH_O, NULL},
32220 	 { "dh_generate_key", _wrap_dh_generate_key, METH_O, NULL},
32221 	 { "dhparams_print", _wrap_dhparams_print, METH_VARARGS, NULL},
32222 	 { "dh_init", _wrap_dh_init, METH_O, NULL},
32223 	 { "dh_type_check", _wrap_dh_type_check, METH_O, NULL},
32224 	 { "dh_read_parameters", _wrap_dh_read_parameters, METH_O, NULL},
32225 	 { "dh_generate_parameters", _wrap_dh_generate_parameters, METH_VARARGS, NULL},
32226 	 { "dh_check", _wrap_dh_check, METH_O, NULL},
32227 	 { "dh_compute_key", _wrap_dh_compute_key, METH_VARARGS, NULL},
32228 	 { "dh_get_p", _wrap_dh_get_p, METH_O, NULL},
32229 	 { "dh_get_g", _wrap_dh_get_g, METH_O, NULL},
32230 	 { "dh_get_pub", _wrap_dh_get_pub, METH_O, NULL},
32231 	 { "dh_get_priv", _wrap_dh_get_priv, METH_O, NULL},
32232 	 { "dh_set_pg", _wrap_dh_set_pg, METH_VARARGS, NULL},
32233 	 { "rsa_size", _wrap_rsa_size, METH_O, NULL},
32234 	 { "rsa_new", _wrap_rsa_new, METH_NOARGS, NULL},
32235 	 { "rsa_free", _wrap_rsa_free, METH_O, NULL},
32236 	 { "rsa_check_key", _wrap_rsa_check_key, METH_O, NULL},
32237 	 { "rsa_init", _wrap_rsa_init, METH_O, NULL},
32238 	 { "rsa_read_key", _wrap_rsa_read_key, METH_VARARGS, NULL},
32239 	 { "rsa_write_key", _wrap_rsa_write_key, METH_VARARGS, NULL},
32240 	 { "rsa_write_key_no_cipher", _wrap_rsa_write_key_no_cipher, METH_VARARGS, NULL},
32241 	 { "rsa_read_pub_key", _wrap_rsa_read_pub_key, METH_O, NULL},
32242 	 { "rsa_write_pub_key", _wrap_rsa_write_pub_key, METH_VARARGS, NULL},
32243 	 { "rsa_get_e", _wrap_rsa_get_e, METH_O, NULL},
32244 	 { "rsa_get_n", _wrap_rsa_get_n, METH_O, NULL},
32245 	 { "rsa_set_e", _wrap_rsa_set_e, METH_VARARGS, NULL},
32246 	 { "rsa_set_n", _wrap_rsa_set_n, METH_VARARGS, NULL},
32247 	 { "rsa_set_en", _wrap_rsa_set_en, METH_VARARGS, NULL},
32248 	 { "PyObject_Bin_AsBIGNUM", _wrap_PyObject_Bin_AsBIGNUM, METH_O, NULL},
32249 	 { "rsa_set_en_bin", _wrap_rsa_set_en_bin, METH_VARARGS, NULL},
32250 	 { "rsa_private_encrypt", _wrap_rsa_private_encrypt, METH_VARARGS, NULL},
32251 	 { "rsa_public_decrypt", _wrap_rsa_public_decrypt, METH_VARARGS, NULL},
32252 	 { "rsa_public_encrypt", _wrap_rsa_public_encrypt, METH_VARARGS, NULL},
32253 	 { "rsa_private_decrypt", _wrap_rsa_private_decrypt, METH_VARARGS, NULL},
32254 	 { "rsa_padding_add_pkcs1_pss", _wrap_rsa_padding_add_pkcs1_pss, METH_VARARGS, NULL},
32255 	 { "rsa_verify_pkcs1_pss", _wrap_rsa_verify_pkcs1_pss, METH_VARARGS, NULL},
32256 	 { "rsa_sign", _wrap_rsa_sign, METH_VARARGS, NULL},
32257 	 { "rsa_verify", _wrap_rsa_verify, METH_VARARGS, NULL},
32258 	 { "rsa_generate_key", _wrap_rsa_generate_key, METH_VARARGS, NULL},
32259 	 { "rsa_type_check", _wrap_rsa_type_check, METH_O, NULL},
32260 	 { "rsa_check_pub_key", _wrap_rsa_check_pub_key, METH_O, NULL},
32261 	 { "rsa_write_key_der", _wrap_rsa_write_key_der, METH_VARARGS, NULL},
32262 	 { "dsa_new", _wrap_dsa_new, METH_NOARGS, NULL},
32263 	 { "dsa_free", _wrap_dsa_free, METH_O, NULL},
32264 	 { "dsa_size", _wrap_dsa_size, METH_O, NULL},
32265 	 { "dsa_gen_key", _wrap_dsa_gen_key, METH_O, NULL},
32266 	 { "dsa_init", _wrap_dsa_init, METH_O, NULL},
32267 	 { "dsa_generate_parameters", _wrap_dsa_generate_parameters, METH_VARARGS, NULL},
32268 	 { "dsa_read_params", _wrap_dsa_read_params, METH_VARARGS, NULL},
32269 	 { "dsa_read_key", _wrap_dsa_read_key, METH_VARARGS, NULL},
32270 	 { "dsa_read_pub_key", _wrap_dsa_read_pub_key, METH_VARARGS, NULL},
32271 	 { "dsa_get_p", _wrap_dsa_get_p, METH_O, NULL},
32272 	 { "dsa_get_q", _wrap_dsa_get_q, METH_O, NULL},
32273 	 { "dsa_get_g", _wrap_dsa_get_g, METH_O, NULL},
32274 	 { "dsa_get_pub", _wrap_dsa_get_pub, METH_O, NULL},
32275 	 { "dsa_get_priv", _wrap_dsa_get_priv, METH_O, NULL},
32276 	 { "dsa_set_pqg", _wrap_dsa_set_pqg, METH_VARARGS, NULL},
32277 	 { "dsa_set_pub", _wrap_dsa_set_pub, METH_VARARGS, NULL},
32278 	 { "dsa_write_params_bio", _wrap_dsa_write_params_bio, METH_VARARGS, NULL},
32279 	 { "dsa_write_key_bio", _wrap_dsa_write_key_bio, METH_VARARGS, NULL},
32280 	 { "dsa_write_key_bio_no_cipher", _wrap_dsa_write_key_bio_no_cipher, METH_VARARGS, NULL},
32281 	 { "dsa_write_pub_key_bio", _wrap_dsa_write_pub_key_bio, METH_VARARGS, NULL},
32282 	 { "dsa_sign", _wrap_dsa_sign, METH_VARARGS, NULL},
32283 	 { "dsa_verify", _wrap_dsa_verify, METH_VARARGS, NULL},
32284 	 { "dsa_sign_asn1", _wrap_dsa_sign_asn1, METH_VARARGS, NULL},
32285 	 { "dsa_verify_asn1", _wrap_dsa_verify_asn1, METH_VARARGS, NULL},
32286 	 { "dsa_check_key", _wrap_dsa_check_key, METH_O, NULL},
32287 	 { "dsa_check_pub_key", _wrap_dsa_check_pub_key, METH_O, NULL},
32288 	 { "dsa_keylen", _wrap_dsa_keylen, METH_O, NULL},
32289 	 { "dsa_type_check", _wrap_dsa_type_check, METH_O, NULL},
32290 	 { "ssl_get_ciphers", _wrap_ssl_get_ciphers, METH_O, NULL},
32291 	 { "ssl_get_version", _wrap_ssl_get_version, METH_O, NULL},
32292 	 { "ssl_get_error", _wrap_ssl_get_error, METH_VARARGS, NULL},
32293 	 { "ssl_get_state", _wrap_ssl_get_state, METH_O, NULL},
32294 	 { "ssl_get_state_v", _wrap_ssl_get_state_v, METH_O, NULL},
32295 	 { "ssl_get_alert_type", _wrap_ssl_get_alert_type, METH_O, NULL},
32296 	 { "ssl_get_alert_type_v", _wrap_ssl_get_alert_type_v, METH_O, NULL},
32297 	 { "ssl_get_alert_desc", _wrap_ssl_get_alert_desc, METH_O, NULL},
32298 	 { "ssl_get_alert_desc_v", _wrap_ssl_get_alert_desc_v, METH_O, NULL},
32299 	 { "sslv23_method", _wrap_sslv23_method, METH_NOARGS, NULL},
32300 	 { "ssl_ctx_new", _wrap_ssl_ctx_new, METH_O, NULL},
32301 	 { "ssl_ctx_free", _wrap_ssl_ctx_free, METH_O, NULL},
32302 	 { "ssl_ctx_set_verify_depth", _wrap_ssl_ctx_set_verify_depth, METH_VARARGS, NULL},
32303 	 { "ssl_ctx_get_verify_depth", _wrap_ssl_ctx_get_verify_depth, METH_O, NULL},
32304 	 { "ssl_ctx_get_verify_mode", _wrap_ssl_ctx_get_verify_mode, METH_O, NULL},
32305 	 { "ssl_ctx_set_cipher_list", _wrap_ssl_ctx_set_cipher_list, METH_VARARGS, NULL},
32306 	 { "ssl_ctx_add_session", _wrap_ssl_ctx_add_session, METH_VARARGS, NULL},
32307 	 { "ssl_ctx_remove_session", _wrap_ssl_ctx_remove_session, METH_VARARGS, NULL},
32308 	 { "ssl_ctx_set_session_timeout", _wrap_ssl_ctx_set_session_timeout, METH_VARARGS, NULL},
32309 	 { "ssl_ctx_get_session_timeout", _wrap_ssl_ctx_get_session_timeout, METH_O, NULL},
32310 	 { "ssl_ctx_get_cert_store", _wrap_ssl_ctx_get_cert_store, METH_O, NULL},
32311 	 { "ssl_ctx_set_default_verify_paths", _wrap_ssl_ctx_set_default_verify_paths, METH_O, NULL},
32312 	 { "ssl_get_ex_data_x509_store_ctx_idx", _wrap_ssl_get_ex_data_x509_store_ctx_idx, METH_NOARGS, NULL},
32313 	 { "bio_new_ssl", _wrap_bio_new_ssl, METH_VARARGS, NULL},
32314 	 { "ssl_new", _wrap_ssl_new, METH_O, NULL},
32315 	 { "ssl_free", _wrap_ssl_free, METH_O, NULL},
32316 	 { "ssl_dup", _wrap_ssl_dup, METH_O, NULL},
32317 	 { "ssl_set_bio", _wrap_ssl_set_bio, METH_VARARGS, NULL},
32318 	 { "ssl_set_accept_state", _wrap_ssl_set_accept_state, METH_O, NULL},
32319 	 { "ssl_set_connect_state", _wrap_ssl_set_connect_state, METH_O, NULL},
32320 	 { "ssl_get_shutdown", _wrap_ssl_get_shutdown, METH_O, NULL},
32321 	 { "ssl_set_shutdown", _wrap_ssl_set_shutdown, METH_VARARGS, NULL},
32322 	 { "ssl_shutdown", _wrap_ssl_shutdown, METH_O, NULL},
32323 	 { "ssl_clear", _wrap_ssl_clear, METH_O, NULL},
32324 	 { "ssl_do_handshake", _wrap_ssl_do_handshake, METH_O, NULL},
32325 	 { "ssl_renegotiate", _wrap_ssl_renegotiate, METH_O, NULL},
32326 	 { "ssl_pending", _wrap_ssl_pending, METH_O, NULL},
32327 	 { "ssl_get_peer_cert", _wrap_ssl_get_peer_cert, METH_O, NULL},
32328 	 { "ssl_get_current_cipher", _wrap_ssl_get_current_cipher, METH_O, NULL},
32329 	 { "ssl_get_verify_mode", _wrap_ssl_get_verify_mode, METH_O, NULL},
32330 	 { "ssl_get_verify_depth", _wrap_ssl_get_verify_depth, METH_O, NULL},
32331 	 { "ssl_get_verify_result", _wrap_ssl_get_verify_result, METH_O, NULL},
32332 	 { "ssl_get_ssl_ctx", _wrap_ssl_get_ssl_ctx, METH_O, NULL},
32333 	 { "ssl_get_default_session_timeout", _wrap_ssl_get_default_session_timeout, METH_O, NULL},
32334 	 { "ssl_set_cipher_list", _wrap_ssl_set_cipher_list, METH_VARARGS, NULL},
32335 	 { "ssl_get_cipher_list", _wrap_ssl_get_cipher_list, METH_VARARGS, NULL},
32336 	 { "ssl_cipher_get_name", _wrap_ssl_cipher_get_name, METH_O, NULL},
32337 	 { "ssl_cipher_get_version", _wrap_ssl_cipher_get_version, METH_O, NULL},
32338 	 { "ssl_get_session", _wrap_ssl_get_session, METH_O, NULL},
32339 	 { "ssl_get1_session", _wrap_ssl_get1_session, METH_O, NULL},
32340 	 { "ssl_set_session", _wrap_ssl_set_session, METH_VARARGS, NULL},
32341 	 { "ssl_session_free", _wrap_ssl_session_free, METH_O, NULL},
32342 	 { "ssl_session_print", _wrap_ssl_session_print, METH_VARARGS, NULL},
32343 	 { "ssl_session_set_timeout", _wrap_ssl_session_set_timeout, METH_VARARGS, NULL},
32344 	 { "ssl_session_get_timeout", _wrap_ssl_session_get_timeout, METH_O, NULL},
32345 	 { "ssl_accept", _wrap_ssl_accept, METH_VARARGS, NULL},
32346 	 { "ssl_connect", _wrap_ssl_connect, METH_VARARGS, NULL},
32347 	 { "ssl_read", _wrap_ssl_read, METH_VARARGS, NULL},
32348 	 { "ssl_write", _wrap_ssl_write, METH_VARARGS, NULL},
32349 	 { "ssl_init", _wrap_ssl_init, METH_VARARGS, NULL},
32350 	 { "tlsv1_method", _wrap_tlsv1_method, METH_NOARGS, NULL},
32351 	 { "ssl_ctx_passphrase_callback", _wrap_ssl_ctx_passphrase_callback, METH_VARARGS, NULL},
32352 	 { "ssl_ctx_use_x509", _wrap_ssl_ctx_use_x509, METH_VARARGS, NULL},
32353 	 { "ssl_ctx_use_cert", _wrap_ssl_ctx_use_cert, METH_VARARGS, NULL},
32354 	 { "ssl_ctx_use_cert_chain", _wrap_ssl_ctx_use_cert_chain, METH_VARARGS, NULL},
32355 	 { "ssl_ctx_use_privkey", _wrap_ssl_ctx_use_privkey, METH_VARARGS, NULL},
32356 	 { "ssl_ctx_use_rsa_privkey", _wrap_ssl_ctx_use_rsa_privkey, METH_VARARGS, NULL},
32357 	 { "ssl_ctx_use_pkey_privkey", _wrap_ssl_ctx_use_pkey_privkey, METH_VARARGS, NULL},
32358 	 { "ssl_ctx_check_privkey", _wrap_ssl_ctx_check_privkey, METH_O, NULL},
32359 	 { "ssl_ctx_set_client_CA_list_from_file", _wrap_ssl_ctx_set_client_CA_list_from_file, METH_VARARGS, NULL},
32360 	 { "ssl_ctx_set_verify_default", _wrap_ssl_ctx_set_verify_default, METH_VARARGS, NULL},
32361 	 { "ssl_ctx_set_verify", _wrap_ssl_ctx_set_verify, METH_VARARGS, NULL},
32362 	 { "ssl_ctx_set_session_id_context", _wrap_ssl_ctx_set_session_id_context, METH_VARARGS, NULL},
32363 	 { "ssl_ctx_set_info_callback", _wrap_ssl_ctx_set_info_callback, METH_VARARGS, NULL},
32364 	 { "ssl_ctx_set_tmp_dh", _wrap_ssl_ctx_set_tmp_dh, METH_VARARGS, NULL},
32365 	 { "ssl_ctx_set_tmp_dh_callback", _wrap_ssl_ctx_set_tmp_dh_callback, METH_VARARGS, NULL},
32366 	 { "ssl_ctx_set_tmp_rsa", _wrap_ssl_ctx_set_tmp_rsa, METH_VARARGS, NULL},
32367 	 { "ssl_ctx_set_tmp_rsa_callback", _wrap_ssl_ctx_set_tmp_rsa_callback, METH_VARARGS, NULL},
32368 	 { "ssl_ctx_load_verify_locations", _wrap_ssl_ctx_load_verify_locations, METH_VARARGS, NULL},
32369 	 { "ssl_ctx_set_options", _wrap_ssl_ctx_set_options, METH_VARARGS, NULL},
32370 	 { "bio_set_ssl", _wrap_bio_set_ssl, METH_VARARGS, NULL},
32371 	 { "ssl_set_mode", _wrap_ssl_set_mode, METH_VARARGS, NULL},
32372 	 { "ssl_get_mode", _wrap_ssl_get_mode, METH_O, NULL},
32373 	 { "ssl_set_tlsext_host_name", _wrap_ssl_set_tlsext_host_name, METH_VARARGS, NULL},
32374 	 { "ssl_set_client_CA_list_from_file", _wrap_ssl_set_client_CA_list_from_file, METH_VARARGS, NULL},
32375 	 { "ssl_set_client_CA_list_from_context", _wrap_ssl_set_client_CA_list_from_context, METH_VARARGS, NULL},
32376 	 { "ssl_set_session_id_context", _wrap_ssl_set_session_id_context, METH_VARARGS, NULL},
32377 	 { "ssl_set_fd", _wrap_ssl_set_fd, METH_VARARGS, NULL},
32378 	 { "ssl_set_shutdown1", _wrap_ssl_set_shutdown1, METH_VARARGS, NULL},
32379 	 { "ssl_read_nbio", _wrap_ssl_read_nbio, METH_VARARGS, NULL},
32380 	 { "ssl_write_nbio", _wrap_ssl_write_nbio, METH_VARARGS, NULL},
32381 	 { "ssl_cipher_get_bits", _wrap_ssl_cipher_get_bits, METH_O, NULL},
32382 	 { "sk_ssl_cipher_num", _wrap_sk_ssl_cipher_num, METH_O, NULL},
32383 	 { "sk_ssl_cipher_value", _wrap_sk_ssl_cipher_value, METH_VARARGS, NULL},
32384 	 { "ssl_get_peer_cert_chain", _wrap_ssl_get_peer_cert_chain, METH_O, NULL},
32385 	 { "sk_x509_num", _wrap_sk_x509_num, METH_O, NULL},
32386 	 { "sk_x509_value", _wrap_sk_x509_value, METH_VARARGS, NULL},
32387 	 { "i2d_ssl_session", _wrap_i2d_ssl_session, METH_VARARGS, NULL},
32388 	 { "ssl_session_read_pem", _wrap_ssl_session_read_pem, METH_O, NULL},
32389 	 { "ssl_session_write_pem", _wrap_ssl_session_write_pem, METH_VARARGS, NULL},
32390 	 { "ssl_ctx_set_session_cache_mode", _wrap_ssl_ctx_set_session_cache_mode, METH_VARARGS, NULL},
32391 	 { "ssl_ctx_get_session_cache_mode", _wrap_ssl_ctx_get_session_cache_mode, METH_O, NULL},
32392 	 { "ssl_ctx_set_cache_size", _wrap_ssl_ctx_set_cache_size, METH_VARARGS, NULL},
32393 	 { "ssl_is_init_finished", _wrap_ssl_is_init_finished, METH_O, NULL},
32394 	 { "x509_check_ca", _wrap_x509_check_ca, METH_O, NULL},
32395 	 { "x509_new", _wrap_x509_new, METH_NOARGS, NULL},
32396 	 { "x509_dup", _wrap_x509_dup, METH_O, NULL},
32397 	 { "x509_free", _wrap_x509_free, METH_O, NULL},
32398 	 { "x509_crl_free", _wrap_x509_crl_free, METH_O, NULL},
32399 	 { "x509_crl_new", _wrap_x509_crl_new, METH_NOARGS, NULL},
32400 	 { "x509_print", _wrap_x509_print, METH_VARARGS, NULL},
32401 	 { "x509_crl_print", _wrap_x509_crl_print, METH_VARARGS, NULL},
32402 	 { "x509_get_serial_number", _wrap_x509_get_serial_number, METH_O, NULL},
32403 	 { "x509_set_serial_number", _wrap_x509_set_serial_number, METH_VARARGS, NULL},
32404 	 { "x509_get_pubkey", _wrap_x509_get_pubkey, METH_O, NULL},
32405 	 { "x509_set_pubkey", _wrap_x509_set_pubkey, METH_VARARGS, NULL},
32406 	 { "x509_get_issuer_name", _wrap_x509_get_issuer_name, METH_O, NULL},
32407 	 { "x509_set_issuer_name", _wrap_x509_set_issuer_name, METH_VARARGS, NULL},
32408 	 { "x509_get_subject_name", _wrap_x509_get_subject_name, METH_O, NULL},
32409 	 { "x509_set_subject_name", _wrap_x509_set_subject_name, METH_VARARGS, NULL},
32410 	 { "x509_cmp_current_time", _wrap_x509_cmp_current_time, METH_O, NULL},
32411 	 { "x509_check_purpose", _wrap_x509_check_purpose, METH_VARARGS, NULL},
32412 	 { "x509_check_trust", _wrap_x509_check_trust, METH_VARARGS, NULL},
32413 	 { "x509_write_pem", _wrap_x509_write_pem, METH_VARARGS, NULL},
32414 	 { "x509_write_pem_file", _wrap_x509_write_pem_file, METH_VARARGS, NULL},
32415 	 { "x509_verify", _wrap_x509_verify, METH_VARARGS, NULL},
32416 	 { "x509_get_verify_error", _wrap_x509_get_verify_error, METH_O, NULL},
32417 	 { "x509_add_ext", _wrap_x509_add_ext, METH_VARARGS, NULL},
32418 	 { "x509_get_ext_count", _wrap_x509_get_ext_count, METH_O, NULL},
32419 	 { "x509_get_ext", _wrap_x509_get_ext, METH_VARARGS, NULL},
32420 	 { "x509_ext_print", _wrap_x509_ext_print, METH_VARARGS, NULL},
32421 	 { "x509_name_new", _wrap_x509_name_new, METH_NOARGS, NULL},
32422 	 { "x509_name_free", _wrap_x509_name_free, METH_O, NULL},
32423 	 { "x509_name_print", _wrap_x509_name_print, METH_VARARGS, NULL},
32424 	 { "x509_name_get_entry", _wrap_x509_name_get_entry, METH_VARARGS, NULL},
32425 	 { "x509_name_entry_count", _wrap_x509_name_entry_count, METH_O, NULL},
32426 	 { "x509_name_delete_entry", _wrap_x509_name_delete_entry, METH_VARARGS, NULL},
32427 	 { "x509_name_add_entry", _wrap_x509_name_add_entry, METH_VARARGS, NULL},
32428 	 { "x509_name_add_entry_by_obj", _wrap_x509_name_add_entry_by_obj, METH_VARARGS, NULL},
32429 	 { "x509_name_add_entry_by_nid", _wrap_x509_name_add_entry_by_nid, METH_VARARGS, NULL},
32430 	 { "x509_name_print_ex", _wrap_x509_name_print_ex, METH_VARARGS, NULL},
32431 	 { "x509_name_hash", _wrap_x509_name_hash, METH_O, NULL},
32432 	 { "x509_name_get_index_by_nid", _wrap_x509_name_get_index_by_nid, METH_VARARGS, NULL},
32433 	 { "x509_name_entry_new", _wrap_x509_name_entry_new, METH_NOARGS, NULL},
32434 	 { "x509_name_entry_free", _wrap_x509_name_entry_free, METH_O, NULL},
32435 	 { "x509_name_entry_create_by_nid", _wrap_x509_name_entry_create_by_nid, METH_VARARGS, NULL},
32436 	 { "x509_name_entry_set_object", _wrap_x509_name_entry_set_object, METH_VARARGS, NULL},
32437 	 { "x509_name_entry_get_object", _wrap_x509_name_entry_get_object, METH_O, NULL},
32438 	 { "x509_name_entry_get_data", _wrap_x509_name_entry_get_data, METH_O, NULL},
32439 	 { "x509_name_entry_set_data", _wrap_x509_name_entry_set_data, METH_VARARGS, NULL},
32440 	 { "x509_req_new", _wrap_x509_req_new, METH_NOARGS, NULL},
32441 	 { "x509_req_free", _wrap_x509_req_free, METH_O, NULL},
32442 	 { "x509_req_print", _wrap_x509_req_print, METH_VARARGS, NULL},
32443 	 { "x509_req_get_pubkey", _wrap_x509_req_get_pubkey, METH_O, NULL},
32444 	 { "x509_req_set_pubkey", _wrap_x509_req_set_pubkey, METH_VARARGS, NULL},
32445 	 { "x509_req_set_subject_name", _wrap_x509_req_set_subject_name, METH_VARARGS, NULL},
32446 	 { "x509_req_verify", _wrap_x509_req_verify, METH_VARARGS, NULL},
32447 	 { "x509_req_sign", _wrap_x509_req_sign, METH_VARARGS, NULL},
32448 	 { "i2d_x509_bio", _wrap_i2d_x509_bio, METH_VARARGS, NULL},
32449 	 { "i2d_x509_req_bio", _wrap_i2d_x509_req_bio, METH_VARARGS, NULL},
32450 	 { "x509_store_new", _wrap_x509_store_new, METH_NOARGS, NULL},
32451 	 { "x509_store_free", _wrap_x509_store_free, METH_O, NULL},
32452 	 { "x509_store_add_cert", _wrap_x509_store_add_cert, METH_VARARGS, NULL},
32453 	 { "x509_store_ctx_get_current_cert", _wrap_x509_store_ctx_get_current_cert, METH_O, NULL},
32454 	 { "x509_store_ctx_get_error", _wrap_x509_store_ctx_get_error, METH_O, NULL},
32455 	 { "x509_store_ctx_get_error_depth", _wrap_x509_store_ctx_get_error_depth, METH_O, NULL},
32456 	 { "x509_store_ctx_free", _wrap_x509_store_ctx_free, METH_O, NULL},
32457 	 { "x509_store_ctx_get1_chain", _wrap_x509_store_ctx_get1_chain, METH_O, NULL},
32458 	 { "x509_extension_get_critical", _wrap_x509_extension_get_critical, METH_O, NULL},
32459 	 { "x509_extension_set_critical", _wrap_x509_extension_set_critical, METH_VARARGS, NULL},
32460 	 { "x509_store_set_flags", _wrap_x509_store_set_flags, METH_VARARGS, NULL},
32461 	 { "x509_read_pem", _wrap_x509_read_pem, METH_O, NULL},
32462 	 { "d2i_x509", _wrap_d2i_x509, METH_O, NULL},
32463 	 { "x509_init", _wrap_x509_init, METH_O, NULL},
32464 	 { "d2i_x509_req", _wrap_d2i_x509_req, METH_O, NULL},
32465 	 { "x509_req_read_pem", _wrap_x509_req_read_pem, METH_O, NULL},
32466 	 { "i2d_x509", _wrap_i2d_x509, METH_O, NULL},
32467 	 { "x509_req_write_pem", _wrap_x509_req_write_pem, METH_VARARGS, NULL},
32468 	 { "x509_crl_read_pem", _wrap_x509_crl_read_pem, METH_O, NULL},
32469 	 { "x509_set_version", _wrap_x509_set_version, METH_VARARGS, NULL},
32470 	 { "x509_get_version", _wrap_x509_get_version, METH_O, NULL},
32471 	 { "x509_set_not_before", _wrap_x509_set_not_before, METH_VARARGS, NULL},
32472 	 { "x509_get_not_before", _wrap_x509_get_not_before, METH_O, NULL},
32473 	 { "x509_set_not_after", _wrap_x509_set_not_after, METH_VARARGS, NULL},
32474 	 { "x509_get_not_after", _wrap_x509_get_not_after, METH_O, NULL},
32475 	 { "x509_sign", _wrap_x509_sign, METH_VARARGS, NULL},
32476 	 { "x509_gmtime_adj", _wrap_x509_gmtime_adj, METH_VARARGS, NULL},
32477 	 { "x509_name_by_nid", _wrap_x509_name_by_nid, METH_VARARGS, NULL},
32478 	 { "x509_name_set_by_nid", _wrap_x509_name_set_by_nid, METH_VARARGS, NULL},
32479 	 { "x509_name_add_entry_by_txt", _wrap_x509_name_add_entry_by_txt, METH_VARARGS, NULL},
32480 	 { "x509_name_get_der", _wrap_x509_name_get_der, METH_O, NULL},
32481 	 { "sk_x509_free", _wrap_sk_x509_free, METH_O, NULL},
32482 	 { "sk_x509_push", _wrap_sk_x509_push, METH_VARARGS, NULL},
32483 	 { "sk_x509_pop", _wrap_sk_x509_pop, METH_O, NULL},
32484 	 { "x509_store_load_locations", _wrap_x509_store_load_locations, METH_VARARGS, NULL},
32485 	 { "x509_type_check", _wrap_x509_type_check, METH_O, NULL},
32486 	 { "x509_name_type_check", _wrap_x509_name_type_check, METH_O, NULL},
32487 	 { "x509_req_get_subject_name", _wrap_x509_req_get_subject_name, METH_O, NULL},
32488 	 { "x509_req_get_version", _wrap_x509_req_get_version, METH_O, NULL},
32489 	 { "x509_req_set_version", _wrap_x509_req_set_version, METH_VARARGS, NULL},
32490 	 { "x509_req_add_extensions", _wrap_x509_req_add_extensions, METH_VARARGS, NULL},
32491 	 { "x509_name_entry_create_by_txt", _wrap_x509_name_entry_create_by_txt, METH_VARARGS, NULL},
32492 	 { "x509v3_set_nconf", _wrap_x509v3_set_nconf, METH_NOARGS, NULL},
32493 	 { "x509v3_ext_conf", _wrap_x509v3_ext_conf, METH_VARARGS, NULL},
32494 	 { "x509_extension_free", _wrap_x509_extension_free, METH_O, NULL},
32495 	 { "x509_extension_get_name", _wrap_x509_extension_get_name, METH_O, NULL},
32496 	 { "sk_x509_extension_new_null", _wrap_sk_x509_extension_new_null, METH_NOARGS, NULL},
32497 	 { "sk_x509_extension_free", _wrap_sk_x509_extension_free, METH_O, NULL},
32498 	 { "sk_x509_extension_push", _wrap_sk_x509_extension_push, METH_VARARGS, NULL},
32499 	 { "sk_x509_extension_pop", _wrap_sk_x509_extension_pop, METH_O, NULL},
32500 	 { "sk_x509_extension_num", _wrap_sk_x509_extension_num, METH_O, NULL},
32501 	 { "sk_x509_extension_value", _wrap_sk_x509_extension_value, METH_VARARGS, NULL},
32502 	 { "x509_store_ctx_get_app_data", _wrap_x509_store_ctx_get_app_data, METH_O, NULL},
32503 	 { "x509_store_ctx_get_ex_data", _wrap_x509_store_ctx_get_ex_data, METH_VARARGS, NULL},
32504 	 { "x509_store_set_verify_cb", _wrap_x509_store_set_verify_cb, METH_VARARGS, NULL},
32505 	 { "make_stack_from_der_sequence", _wrap_make_stack_from_der_sequence, METH_O, NULL},
32506 	 { "sk_x509_new_null", _wrap_sk_x509_new_null, METH_NOARGS, NULL},
32507 	 { "get_der_encoding_stack", _wrap_get_der_encoding_stack, METH_O, NULL},
32508 	 { "x509_name_oneline", _wrap_x509_name_oneline, METH_O, NULL},
32509 	 { "asn1_object_new", _wrap_asn1_object_new, METH_NOARGS, NULL},
32510 	 { "asn1_object_create", _wrap_asn1_object_create, METH_VARARGS, NULL},
32511 	 { "asn1_object_free", _wrap_asn1_object_free, METH_O, NULL},
32512 	 { "i2d_asn1_object", _wrap_i2d_asn1_object, METH_VARARGS, NULL},
32513 	 { "d2i_asn1_object", _wrap_d2i_asn1_object, METH_VARARGS, NULL},
32514 	 { "asn1_bit_string_new", _wrap_asn1_bit_string_new, METH_NOARGS, NULL},
32515 	 { "asn1_string_new", _wrap_asn1_string_new, METH_NOARGS, NULL},
32516 	 { "asn1_string_free", _wrap_asn1_string_free, METH_O, NULL},
32517 	 { "asn1_string_set", _wrap_asn1_string_set, METH_VARARGS, NULL},
32518 	 { "asn1_string_print", _wrap_asn1_string_print, METH_VARARGS, NULL},
32519 	 { "asn1_string_print_ex", _wrap_asn1_string_print_ex, METH_VARARGS, NULL},
32520 	 { "asn1_time_new", _wrap_asn1_time_new, METH_NOARGS, NULL},
32521 	 { "asn1_time_free", _wrap_asn1_time_free, METH_O, NULL},
32522 	 { "asn1_time_check", _wrap_asn1_time_check, METH_O, NULL},
32523 	 { "asn1_time_set", _wrap_asn1_time_set, METH_VARARGS, NULL},
32524 	 { "asn1_time_set_string", _wrap_asn1_time_set_string, METH_VARARGS, NULL},
32525 	 { "asn1_time_print", _wrap_asn1_time_print, METH_VARARGS, NULL},
32526 	 { "asn1_integer_new", _wrap_asn1_integer_new, METH_NOARGS, NULL},
32527 	 { "asn1_integer_free", _wrap_asn1_integer_free, METH_O, NULL},
32528 	 { "asn1_integer_cmp", _wrap_asn1_integer_cmp, METH_VARARGS, NULL},
32529 	 { "asn1_time_type_check", _wrap_asn1_time_type_check, METH_O, NULL},
32530 	 { "asn1_integer_get", _wrap_asn1_integer_get, METH_O, NULL},
32531 	 { "asn1_integer_set", _wrap_asn1_integer_set, METH_VARARGS, NULL},
32532 	 { "pkcs7_new", _wrap_pkcs7_new, METH_NOARGS, NULL},
32533 	 { "pkcs7_free", _wrap_pkcs7_free, METH_O, NULL},
32534 	 { "pkcs7_add_certificate", _wrap_pkcs7_add_certificate, METH_VARARGS, NULL},
32535 	 { "pkcs7_init", _wrap_pkcs7_init, METH_O, NULL},
32536 	 { "smime_init", _wrap_smime_init, METH_O, NULL},
32537 	 { "pkcs7_decrypt", _wrap_pkcs7_decrypt, METH_VARARGS, NULL},
32538 	 { "pkcs7_encrypt", _wrap_pkcs7_encrypt, METH_VARARGS, NULL},
32539 	 { "pkcs7_sign1", _wrap_pkcs7_sign1, METH_VARARGS, NULL},
32540 	 { "pkcs7_sign0", _wrap_pkcs7_sign0, METH_VARARGS, NULL},
32541 	 { "pkcs7_read_bio", _wrap_pkcs7_read_bio, METH_O, NULL},
32542 	 { "pkcs7_read_bio_der", _wrap_pkcs7_read_bio_der, METH_O, NULL},
32543 	 { "pkcs7_verify1", _wrap_pkcs7_verify1, METH_VARARGS, NULL},
32544 	 { "pkcs7_verify0", _wrap_pkcs7_verify0, METH_VARARGS, NULL},
32545 	 { "smime_write_pkcs7_multi", _wrap_smime_write_pkcs7_multi, METH_VARARGS, NULL},
32546 	 { "smime_write_pkcs7", _wrap_smime_write_pkcs7, METH_VARARGS, NULL},
32547 	 { "smime_read_pkcs7", _wrap_smime_read_pkcs7, METH_O, NULL},
32548 	 { "pkcs7_write_bio", _wrap_pkcs7_write_bio, METH_VARARGS, NULL},
32549 	 { "pkcs7_write_bio_der", _wrap_pkcs7_write_bio_der, METH_VARARGS, NULL},
32550 	 { "pkcs7_type_nid", _wrap_pkcs7_type_nid, METH_O, NULL},
32551 	 { "pkcs7_type_sn", _wrap_pkcs7_type_sn, METH_O, NULL},
32552 	 { "smime_crlf_copy", _wrap_smime_crlf_copy, METH_VARARGS, NULL},
32553 	 { "pkcs7_get0_signers", _wrap_pkcs7_get0_signers, METH_VARARGS, NULL},
32554 	 { "util_init", _wrap_util_init, METH_O, NULL},
32555 	 { "util_hex_to_string", _wrap_util_hex_to_string, METH_O, NULL},
32556 	 { "util_string_to_hex", _wrap_util_string_to_hex, METH_O, NULL},
32557 	 { "ec_key_new", _wrap_ec_key_new, METH_NOARGS, NULL},
32558 	 { "ec_key_free", _wrap_ec_key_free, METH_O, NULL},
32559 	 { "ec_key_size", _wrap_ec_key_size, METH_O, NULL},
32560 	 { "ec_key_gen_key", _wrap_ec_key_gen_key, METH_O, NULL},
32561 	 { "ec_key_check_key", _wrap_ec_key_check_key, METH_O, NULL},
32562 	 { "ec_init", _wrap_ec_init, METH_O, NULL},
32563 	 { "ec_get_builtin_curves", _wrap_ec_get_builtin_curves, METH_NOARGS, NULL},
32564 	 { "ec_key_new_by_curve_name", _wrap_ec_key_new_by_curve_name, METH_O, NULL},
32565 	 { "ec_key_get_public_der", _wrap_ec_key_get_public_der, METH_O, NULL},
32566 	 { "ec_key_get_public_key", _wrap_ec_key_get_public_key, METH_O, NULL},
32567 	 { "ec_key_read_pubkey", _wrap_ec_key_read_pubkey, METH_O, NULL},
32568 	 { "ec_key_write_pubkey", _wrap_ec_key_write_pubkey, METH_VARARGS, NULL},
32569 	 { "ec_key_read_bio", _wrap_ec_key_read_bio, METH_VARARGS, NULL},
32570 	 { "ec_key_write_bio", _wrap_ec_key_write_bio, METH_VARARGS, NULL},
32571 	 { "ec_key_write_bio_no_cipher", _wrap_ec_key_write_bio_no_cipher, METH_VARARGS, NULL},
32572 	 { "ecdsa_sig_get_r", _wrap_ecdsa_sig_get_r, METH_O, NULL},
32573 	 { "ecdsa_sig_get_s", _wrap_ecdsa_sig_get_s, METH_O, NULL},
32574 	 { "ecdsa_sign", _wrap_ecdsa_sign, METH_VARARGS, NULL},
32575 	 { "ecdsa_verify", _wrap_ecdsa_verify, METH_VARARGS, NULL},
32576 	 { "ecdsa_sign_asn1", _wrap_ecdsa_sign_asn1, METH_VARARGS, NULL},
32577 	 { "ecdsa_verify_asn1", _wrap_ecdsa_verify_asn1, METH_VARARGS, NULL},
32578 	 { "ecdh_compute_key", _wrap_ecdh_compute_key, METH_VARARGS, NULL},
32579 	 { "ec_key_from_pubkey_der", _wrap_ec_key_from_pubkey_der, METH_O, NULL},
32580 	 { "ec_key_from_pubkey_params", _wrap_ec_key_from_pubkey_params, METH_VARARGS, NULL},
32581 	 { "ec_key_keylen", _wrap_ec_key_keylen, METH_O, NULL},
32582 	 { "ec_key_type_check", _wrap_ec_key_type_check, METH_O, NULL},
32583 	 { "engine_load_builtin_engines", _wrap_engine_load_builtin_engines, METH_NOARGS, NULL},
32584 	 { "engine_load_dynamic", _wrap_engine_load_dynamic, METH_NOARGS, NULL},
32585 	 { "engine_load_openssl", _wrap_engine_load_openssl, METH_NOARGS, NULL},
32586 	 { "engine_cleanup", _wrap_engine_cleanup, METH_NOARGS, NULL},
32587 	 { "engine_new", _wrap_engine_new, METH_NOARGS, NULL},
32588 	 { "engine_by_id", _wrap_engine_by_id, METH_O, NULL},
32589 	 { "engine_free", _wrap_engine_free, METH_O, NULL},
32590 	 { "engine_init", _wrap_engine_init, METH_O, NULL},
32591 	 { "engine_finish", _wrap_engine_finish, METH_O, NULL},
32592 	 { "engine_get_id", _wrap_engine_get_id, METH_O, NULL},
32593 	 { "engine_get_name", _wrap_engine_get_name, METH_O, NULL},
32594 	 { "engine_ctrl_cmd_string", _wrap_engine_ctrl_cmd_string, METH_VARARGS, NULL},
32595 	 { "ui_openssl", _wrap_ui_openssl, METH_NOARGS, NULL},
32596 	 { "engine_pkcs11_data_new", _wrap_engine_pkcs11_data_new, METH_O, NULL},
32597 	 { "engine_pkcs11_data_free", _wrap_engine_pkcs11_data_free, METH_O, NULL},
32598 	 { "engine_load_private_key", _wrap_engine_load_private_key, METH_VARARGS, NULL},
32599 	 { "engine_load_public_key", _wrap_engine_load_public_key, METH_VARARGS, NULL},
32600 	 { "engine_init_error", _wrap_engine_init_error, METH_O, NULL},
32601 	 { "engine_load_certificate", _wrap_engine_load_certificate, METH_VARARGS, NULL},
32602 	 { "engine_set_default", _wrap_engine_set_default, METH_VARARGS, NULL},
32603 	 { "obj_nid2obj", _wrap_obj_nid2obj, METH_O, NULL},
32604 	 { "obj_nid2ln", _wrap_obj_nid2ln, METH_O, NULL},
32605 	 { "obj_nid2sn", _wrap_obj_nid2sn, METH_O, NULL},
32606 	 { "obj_obj2nid", _wrap_obj_obj2nid, METH_O, NULL},
32607 	 { "obj_ln2nid", _wrap_obj_ln2nid, METH_O, NULL},
32608 	 { "obj_sn2nid", _wrap_obj_sn2nid, METH_O, NULL},
32609 	 { "obj_txt2nid", _wrap_obj_txt2nid, METH_O, NULL},
32610 	 { "obj_txt2obj", _wrap_obj_txt2obj, METH_VARARGS, NULL},
32611 	 { "_obj_obj2txt", _wrap__obj_obj2txt, METH_VARARGS, NULL},
32612 	 { "obj_obj2txt", _wrap_obj_obj2txt, METH_VARARGS, NULL},
32613 	 { NULL, NULL, 0, NULL }
32614 };
32615 
32616 static PyMethodDef SwigMethods_proxydocs[] = {
32617 	 { NULL, NULL, 0, NULL }
32618 };
32619 
32620 static SwigPyGetSet BIO_PYFD_CTX___dict___getset = { SwigPyObject_get___dict__, 0 };
32621 static SwigPyGetSet BIO_PYFD_CTX_fd_getset = { _wrap_BIO_PYFD_CTX_fd_get, _wrap_BIO_PYFD_CTX_fd_set };
32622 SWIGINTERN PyGetSetDef SwigPyBuiltin__pyfd_struct_getset[] = {
32623     { (char *)"__dict__", SwigPyBuiltin_FunpackGetterClosure, 0, (char *)"", &BIO_PYFD_CTX___dict___getset },
32624     { (char *)"fd", SwigPyBuiltin_FunpackGetterClosure, SwigPyBuiltin_FunpackSetterClosure, (char *)"", &BIO_PYFD_CTX_fd_getset },
32625     { NULL, NULL, NULL, NULL, NULL } /* Sentinel */
32626 };
32627 
32628 SWIGINTERN PyObject *
SwigPyBuiltin__pyfd_struct_richcompare(PyObject * self,PyObject * other,int op)32629 SwigPyBuiltin__pyfd_struct_richcompare(PyObject *self, PyObject *other, int op) {
32630   PyObject *result = NULL;
32631   if (!result) {
32632     if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) {
32633       result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op);
32634     } else {
32635       result = Py_NotImplemented;
32636       Py_INCREF(result);
32637     }
32638   }
32639   return result;
32640 }
32641 
32642 SWIGINTERN PyMethodDef SwigPyBuiltin__pyfd_struct_methods[] = {
32643   { NULL, NULL, 0, NULL } /* Sentinel */
32644 };
32645 
32646 static PyHeapTypeObject SwigPyBuiltin__pyfd_struct_type = {
32647   {
32648 #if PY_VERSION_HEX >= 0x03000000
32649     PyVarObject_HEAD_INIT(NULL, 0)
32650 #else
32651     PyObject_HEAD_INIT(NULL)
32652     0,                                        /* ob_size */
32653 #endif
32654     "m2crypto.BIO_PYFD_CTX",                  /* tp_name */
32655     sizeof(SwigPyObject),                     /* tp_basicsize */
32656     0,                                        /* tp_itemsize */
32657     _wrap_delete_BIO_PYFD_CTX_destructor_closure,                 /* tp_dealloc */
32658     (printfunc) 0,                            /* tp_print */
32659     (getattrfunc) 0,                          /* tp_getattr */
32660     (setattrfunc) 0,                          /* tp_setattr */
32661 #if PY_VERSION_HEX >= 0x03000000
32662     0,                                        /* tp_compare */
32663 #else
32664     (cmpfunc) 0,                              /* tp_compare */
32665 #endif
32666     (reprfunc) 0,                             /* tp_repr */
32667     &SwigPyBuiltin__pyfd_struct_type.as_number,                   /* tp_as_number */
32668     &SwigPyBuiltin__pyfd_struct_type.as_sequence,                 /* tp_as_sequence */
32669     &SwigPyBuiltin__pyfd_struct_type.as_mapping,                  /* tp_as_mapping */
32670     SwigPyObject_hash,                        /* tp_hash */
32671     (ternaryfunc) 0,                          /* tp_call */
32672     (reprfunc) 0,                             /* tp_str */
32673     (getattrofunc) 0,                         /* tp_getattro */
32674     (setattrofunc) 0,                         /* tp_setattro */
32675     &SwigPyBuiltin__pyfd_struct_type.as_buffer,                   /* tp_as_buffer */
32676 #if PY_VERSION_HEX >= 0x03000000
32677     Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,   /* tp_flags */
32678 #else
32679     Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */
32680 #endif
32681     "::pyfd_struct",                          /* tp_doc */
32682     (traverseproc) 0,                         /* tp_traverse */
32683     (inquiry) 0,                              /* tp_clear */
32684     SwigPyBuiltin__pyfd_struct_richcompare,   /* tp_richcompare */
32685     0,                                        /* tp_weaklistoffset */
32686     (getiterfunc) 0,                          /* tp_iter */
32687     (iternextfunc) 0,                         /* tp_iternext */
32688     SwigPyBuiltin__pyfd_struct_methods,       /* tp_methods */
32689     0,                                        /* tp_members */
32690     SwigPyBuiltin__pyfd_struct_getset,        /* tp_getset */
32691     0,                                        /* tp_base */
32692     0,                                        /* tp_dict */
32693     (descrgetfunc) 0,                         /* tp_descr_get */
32694     (descrsetfunc) 0,                         /* tp_descr_set */
32695     offsetof(SwigPyObject, dict),             /* tp_dictoffset */
32696     _wrap_new_BIO_PYFD_CTX,                   /* tp_init */
32697     (allocfunc) 0,                            /* tp_alloc */
32698     (newfunc) 0,                              /* tp_new */
32699     (freefunc) 0,                             /* tp_free */
32700     (inquiry) 0,                              /* tp_is_gc */
32701     (PyObject *) 0,                           /* tp_bases */
32702     (PyObject *) 0,                           /* tp_mro */
32703     (PyObject *) 0,                           /* tp_cache */
32704     (PyObject *) 0,                           /* tp_subclasses */
32705     (PyObject *) 0,                           /* tp_weaklist */
32706     (destructor) 0,                           /* tp_del */
32707     (int) 0,                                  /* tp_version_tag */
32708 #if PY_VERSION_HEX >= 0x03040000
32709     (destructor) 0,                           /* tp_finalize */
32710 #endif
32711 #if PY_VERSION_HEX >= 0x03080000
32712     (vectorcallfunc) 0,                       /* tp_vectorcall */
32713 #endif
32714 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
32715     0,                                        /* tp_print */
32716 #endif
32717 #ifdef COUNT_ALLOCS
32718     (Py_ssize_t) 0,                           /* tp_allocs */
32719     (Py_ssize_t) 0,                           /* tp_frees */
32720     (Py_ssize_t) 0,                           /* tp_maxalloc */
32721     0,                                        /* tp_prev */
32722     0,                                        /* tp_next */
32723 #endif
32724   },
32725 #if PY_VERSION_HEX >= 0x03050000
32726   {
32727     (unaryfunc) 0,                            /* am_await */
32728     (unaryfunc) 0,                            /* am_aiter */
32729     (unaryfunc) 0,                            /* am_anext */
32730   },
32731 #endif
32732   {
32733     (binaryfunc) 0,                           /* nb_add */
32734     (binaryfunc) 0,                           /* nb_subtract */
32735     (binaryfunc) 0,                           /* nb_multiply */
32736 #if PY_VERSION_HEX < 0x03000000
32737     (binaryfunc) 0,                           /* nb_divide */
32738 #endif
32739     (binaryfunc) 0,                           /* nb_remainder */
32740     (binaryfunc) 0,                           /* nb_divmod */
32741     (ternaryfunc) 0,                          /* nb_power */
32742     (unaryfunc) 0,                            /* nb_negative */
32743     (unaryfunc) 0,                            /* nb_positive */
32744     (unaryfunc) 0,                            /* nb_absolute */
32745     (inquiry) 0,                              /* nb_nonzero */
32746     (unaryfunc) 0,                            /* nb_invert */
32747     (binaryfunc) 0,                           /* nb_lshift */
32748     (binaryfunc) 0,                           /* nb_rshift */
32749     (binaryfunc) 0,                           /* nb_and */
32750     (binaryfunc) 0,                           /* nb_xor */
32751     (binaryfunc) 0,                           /* nb_or */
32752 #if PY_VERSION_HEX < 0x03000000
32753     (coercion) 0,                             /* nb_coerce */
32754 #endif
32755     (unaryfunc) 0,                            /* nb_int */
32756 #if PY_VERSION_HEX >= 0x03000000
32757     (void *) 0,                               /* nb_reserved */
32758 #else
32759     (unaryfunc) 0,                            /* nb_long */
32760 #endif
32761     (unaryfunc) 0,                            /* nb_float */
32762 #if PY_VERSION_HEX < 0x03000000
32763     (unaryfunc) 0,                            /* nb_oct */
32764     (unaryfunc) 0,                            /* nb_hex */
32765 #endif
32766     (binaryfunc) 0,                           /* nb_inplace_add */
32767     (binaryfunc) 0,                           /* nb_inplace_subtract */
32768     (binaryfunc) 0,                           /* nb_inplace_multiply */
32769 #if PY_VERSION_HEX < 0x03000000
32770     (binaryfunc) 0,                           /* nb_inplace_divide */
32771 #endif
32772     (binaryfunc) 0,                           /* nb_inplace_remainder */
32773     (ternaryfunc) 0,                          /* nb_inplace_power */
32774     (binaryfunc) 0,                           /* nb_inplace_lshift */
32775     (binaryfunc) 0,                           /* nb_inplace_rshift */
32776     (binaryfunc) 0,                           /* nb_inplace_and */
32777     (binaryfunc) 0,                           /* nb_inplace_xor */
32778     (binaryfunc) 0,                           /* nb_inplace_or */
32779     (binaryfunc) 0,                           /* nb_floor_divide */
32780     (binaryfunc) 0,                           /* nb_true_divide */
32781     (binaryfunc) 0,                           /* nb_inplace_floor_divide */
32782     (binaryfunc) 0,                           /* nb_inplace_true_divide */
32783     (unaryfunc) 0,                            /* nb_index */
32784 #if PY_VERSION_HEX >= 0x03050000
32785     (binaryfunc) 0,                           /* nb_matrix_multiply */
32786     (binaryfunc) 0,                           /* nb_inplace_matrix_multiply */
32787 #endif
32788   },
32789   {
32790     (lenfunc) 0,                              /* mp_length */
32791     (binaryfunc) 0,                           /* mp_subscript */
32792     (objobjargproc) 0,                        /* mp_ass_subscript */
32793   },
32794   {
32795     (lenfunc) 0,                              /* sq_length */
32796     (binaryfunc) 0,                           /* sq_concat */
32797     (ssizeargfunc) 0,                         /* sq_repeat */
32798     (ssizeargfunc) 0,                         /* sq_item */
32799 #if PY_VERSION_HEX >= 0x03000000
32800     (void *) 0,                               /* was_sq_slice */
32801 #else
32802     (ssizessizeargfunc) 0,                    /* sq_slice */
32803 #endif
32804     (ssizeobjargproc) 0,                      /* sq_ass_item */
32805 #if PY_VERSION_HEX >= 0x03000000
32806     (void *) 0,                               /* was_sq_ass_slice */
32807 #else
32808     (ssizessizeobjargproc) 0,                 /* sq_ass_slice */
32809 #endif
32810     (objobjproc) 0,                           /* sq_contains */
32811     (binaryfunc) 0,                           /* sq_inplace_concat */
32812     (ssizeargfunc) 0,                         /* sq_inplace_repeat */
32813   },
32814   {
32815 #if PY_VERSION_HEX < 0x03000000
32816     (readbufferproc) 0,                       /* bf_getreadbuffer */
32817     (writebufferproc) 0,                      /* bf_getwritebuffer */
32818     (segcountproc) 0,                         /* bf_getsegcount */
32819     (charbufferproc) 0,                       /* bf_getcharbuffer */
32820 #endif
32821     (getbufferproc) 0,                        /* bf_getbuffer */
32822     (releasebufferproc) 0,                    /* bf_releasebuffer */
32823   },
32824     (PyObject *) 0,                           /* ht_name */
32825     (PyObject *) 0,                           /* ht_slots */
32826 #if PY_VERSION_HEX >= 0x03030000
32827     (PyObject *) 0,                           /* ht_qualname */
32828     0,                                        /* ht_cached_keys */
32829 #endif
32830 };
32831 
32832 SWIGINTERN SwigPyClientData SwigPyBuiltin__pyfd_struct_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin__pyfd_struct_type};
32833 
32834 static SwigPyGetSet _cbd_t___dict___getset = { SwigPyObject_get___dict__, 0 };
32835 static SwigPyGetSet _cbd_t_password_getset = { _wrap__cbd_t_password_get, _wrap__cbd_t_password_set };
32836 static SwigPyGetSet _cbd_t_prompt_getset = { _wrap__cbd_t_prompt_get, _wrap__cbd_t_prompt_set };
32837 SWIGINTERN PyGetSetDef SwigPyBuiltin___cbd_t_getset[] = {
32838     { (char *)"__dict__", SwigPyBuiltin_FunpackGetterClosure, 0, (char *)"", &_cbd_t___dict___getset },
32839     { (char *)"password", SwigPyBuiltin_FunpackGetterClosure, SwigPyBuiltin_FunpackSetterClosure, (char *)"", &_cbd_t_password_getset },
32840     { (char *)"prompt", SwigPyBuiltin_FunpackGetterClosure, SwigPyBuiltin_FunpackSetterClosure, (char *)"", &_cbd_t_prompt_getset },
32841     { NULL, NULL, NULL, NULL, NULL } /* Sentinel */
32842 };
32843 
32844 SWIGINTERN PyObject *
SwigPyBuiltin___cbd_t_richcompare(PyObject * self,PyObject * other,int op)32845 SwigPyBuiltin___cbd_t_richcompare(PyObject *self, PyObject *other, int op) {
32846   PyObject *result = NULL;
32847   if (!result) {
32848     if (SwigPyObject_Check(self) && SwigPyObject_Check(other)) {
32849       result = SwigPyObject_richcompare((SwigPyObject *)self, (SwigPyObject *)other, op);
32850     } else {
32851       result = Py_NotImplemented;
32852       Py_INCREF(result);
32853     }
32854   }
32855   return result;
32856 }
32857 
32858 SWIGINTERN PyMethodDef SwigPyBuiltin___cbd_t_methods[] = {
32859   { NULL, NULL, 0, NULL } /* Sentinel */
32860 };
32861 
32862 static PyHeapTypeObject SwigPyBuiltin___cbd_t_type = {
32863   {
32864 #if PY_VERSION_HEX >= 0x03000000
32865     PyVarObject_HEAD_INIT(NULL, 0)
32866 #else
32867     PyObject_HEAD_INIT(NULL)
32868     0,                                        /* ob_size */
32869 #endif
32870     "m2crypto._cbd_t",                        /* tp_name */
32871     sizeof(SwigPyObject),                     /* tp_basicsize */
32872     0,                                        /* tp_itemsize */
32873     _wrap_delete__cbd_t_destructor_closure,   /* tp_dealloc */
32874     (printfunc) 0,                            /* tp_print */
32875     (getattrfunc) 0,                          /* tp_getattr */
32876     (setattrfunc) 0,                          /* tp_setattr */
32877 #if PY_VERSION_HEX >= 0x03000000
32878     0,                                        /* tp_compare */
32879 #else
32880     (cmpfunc) 0,                              /* tp_compare */
32881 #endif
32882     (reprfunc) 0,                             /* tp_repr */
32883     &SwigPyBuiltin___cbd_t_type.as_number,    /* tp_as_number */
32884     &SwigPyBuiltin___cbd_t_type.as_sequence,  /* tp_as_sequence */
32885     &SwigPyBuiltin___cbd_t_type.as_mapping,   /* tp_as_mapping */
32886     SwigPyObject_hash,                        /* tp_hash */
32887     (ternaryfunc) 0,                          /* tp_call */
32888     (reprfunc) 0,                             /* tp_str */
32889     (getattrofunc) 0,                         /* tp_getattro */
32890     (setattrofunc) 0,                         /* tp_setattro */
32891     &SwigPyBuiltin___cbd_t_type.as_buffer,    /* tp_as_buffer */
32892 #if PY_VERSION_HEX >= 0x03000000
32893     Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE,   /* tp_flags */
32894 #else
32895     Py_TPFLAGS_DEFAULT|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_CHECKTYPES, /* tp_flags */
32896 #endif
32897     "::_cbd_t",                               /* tp_doc */
32898     (traverseproc) 0,                         /* tp_traverse */
32899     (inquiry) 0,                              /* tp_clear */
32900     SwigPyBuiltin___cbd_t_richcompare,        /* tp_richcompare */
32901     0,                                        /* tp_weaklistoffset */
32902     (getiterfunc) 0,                          /* tp_iter */
32903     (iternextfunc) 0,                         /* tp_iternext */
32904     SwigPyBuiltin___cbd_t_methods,            /* tp_methods */
32905     0,                                        /* tp_members */
32906     SwigPyBuiltin___cbd_t_getset,             /* tp_getset */
32907     0,                                        /* tp_base */
32908     0,                                        /* tp_dict */
32909     (descrgetfunc) 0,                         /* tp_descr_get */
32910     (descrsetfunc) 0,                         /* tp_descr_set */
32911     offsetof(SwigPyObject, dict),             /* tp_dictoffset */
32912     _wrap_new__cbd_t,                         /* tp_init */
32913     (allocfunc) 0,                            /* tp_alloc */
32914     (newfunc) 0,                              /* tp_new */
32915     (freefunc) 0,                             /* tp_free */
32916     (inquiry) 0,                              /* tp_is_gc */
32917     (PyObject *) 0,                           /* tp_bases */
32918     (PyObject *) 0,                           /* tp_mro */
32919     (PyObject *) 0,                           /* tp_cache */
32920     (PyObject *) 0,                           /* tp_subclasses */
32921     (PyObject *) 0,                           /* tp_weaklist */
32922     (destructor) 0,                           /* tp_del */
32923     (int) 0,                                  /* tp_version_tag */
32924 #if PY_VERSION_HEX >= 0x03040000
32925     (destructor) 0,                           /* tp_finalize */
32926 #endif
32927 #if PY_VERSION_HEX >= 0x03080000
32928     (vectorcallfunc) 0,                       /* tp_vectorcall */
32929 #endif
32930 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
32931     0,                                        /* tp_print */
32932 #endif
32933 #ifdef COUNT_ALLOCS
32934     (Py_ssize_t) 0,                           /* tp_allocs */
32935     (Py_ssize_t) 0,                           /* tp_frees */
32936     (Py_ssize_t) 0,                           /* tp_maxalloc */
32937     0,                                        /* tp_prev */
32938     0,                                        /* tp_next */
32939 #endif
32940   },
32941 #if PY_VERSION_HEX >= 0x03050000
32942   {
32943     (unaryfunc) 0,                            /* am_await */
32944     (unaryfunc) 0,                            /* am_aiter */
32945     (unaryfunc) 0,                            /* am_anext */
32946   },
32947 #endif
32948   {
32949     (binaryfunc) 0,                           /* nb_add */
32950     (binaryfunc) 0,                           /* nb_subtract */
32951     (binaryfunc) 0,                           /* nb_multiply */
32952 #if PY_VERSION_HEX < 0x03000000
32953     (binaryfunc) 0,                           /* nb_divide */
32954 #endif
32955     (binaryfunc) 0,                           /* nb_remainder */
32956     (binaryfunc) 0,                           /* nb_divmod */
32957     (ternaryfunc) 0,                          /* nb_power */
32958     (unaryfunc) 0,                            /* nb_negative */
32959     (unaryfunc) 0,                            /* nb_positive */
32960     (unaryfunc) 0,                            /* nb_absolute */
32961     (inquiry) 0,                              /* nb_nonzero */
32962     (unaryfunc) 0,                            /* nb_invert */
32963     (binaryfunc) 0,                           /* nb_lshift */
32964     (binaryfunc) 0,                           /* nb_rshift */
32965     (binaryfunc) 0,                           /* nb_and */
32966     (binaryfunc) 0,                           /* nb_xor */
32967     (binaryfunc) 0,                           /* nb_or */
32968 #if PY_VERSION_HEX < 0x03000000
32969     (coercion) 0,                             /* nb_coerce */
32970 #endif
32971     (unaryfunc) 0,                            /* nb_int */
32972 #if PY_VERSION_HEX >= 0x03000000
32973     (void *) 0,                               /* nb_reserved */
32974 #else
32975     (unaryfunc) 0,                            /* nb_long */
32976 #endif
32977     (unaryfunc) 0,                            /* nb_float */
32978 #if PY_VERSION_HEX < 0x03000000
32979     (unaryfunc) 0,                            /* nb_oct */
32980     (unaryfunc) 0,                            /* nb_hex */
32981 #endif
32982     (binaryfunc) 0,                           /* nb_inplace_add */
32983     (binaryfunc) 0,                           /* nb_inplace_subtract */
32984     (binaryfunc) 0,                           /* nb_inplace_multiply */
32985 #if PY_VERSION_HEX < 0x03000000
32986     (binaryfunc) 0,                           /* nb_inplace_divide */
32987 #endif
32988     (binaryfunc) 0,                           /* nb_inplace_remainder */
32989     (ternaryfunc) 0,                          /* nb_inplace_power */
32990     (binaryfunc) 0,                           /* nb_inplace_lshift */
32991     (binaryfunc) 0,                           /* nb_inplace_rshift */
32992     (binaryfunc) 0,                           /* nb_inplace_and */
32993     (binaryfunc) 0,                           /* nb_inplace_xor */
32994     (binaryfunc) 0,                           /* nb_inplace_or */
32995     (binaryfunc) 0,                           /* nb_floor_divide */
32996     (binaryfunc) 0,                           /* nb_true_divide */
32997     (binaryfunc) 0,                           /* nb_inplace_floor_divide */
32998     (binaryfunc) 0,                           /* nb_inplace_true_divide */
32999     (unaryfunc) 0,                            /* nb_index */
33000 #if PY_VERSION_HEX >= 0x03050000
33001     (binaryfunc) 0,                           /* nb_matrix_multiply */
33002     (binaryfunc) 0,                           /* nb_inplace_matrix_multiply */
33003 #endif
33004   },
33005   {
33006     (lenfunc) 0,                              /* mp_length */
33007     (binaryfunc) 0,                           /* mp_subscript */
33008     (objobjargproc) 0,                        /* mp_ass_subscript */
33009   },
33010   {
33011     (lenfunc) 0,                              /* sq_length */
33012     (binaryfunc) 0,                           /* sq_concat */
33013     (ssizeargfunc) 0,                         /* sq_repeat */
33014     (ssizeargfunc) 0,                         /* sq_item */
33015 #if PY_VERSION_HEX >= 0x03000000
33016     (void *) 0,                               /* was_sq_slice */
33017 #else
33018     (ssizessizeargfunc) 0,                    /* sq_slice */
33019 #endif
33020     (ssizeobjargproc) 0,                      /* sq_ass_item */
33021 #if PY_VERSION_HEX >= 0x03000000
33022     (void *) 0,                               /* was_sq_ass_slice */
33023 #else
33024     (ssizessizeobjargproc) 0,                 /* sq_ass_slice */
33025 #endif
33026     (objobjproc) 0,                           /* sq_contains */
33027     (binaryfunc) 0,                           /* sq_inplace_concat */
33028     (ssizeargfunc) 0,                         /* sq_inplace_repeat */
33029   },
33030   {
33031 #if PY_VERSION_HEX < 0x03000000
33032     (readbufferproc) 0,                       /* bf_getreadbuffer */
33033     (writebufferproc) 0,                      /* bf_getwritebuffer */
33034     (segcountproc) 0,                         /* bf_getsegcount */
33035     (charbufferproc) 0,                       /* bf_getcharbuffer */
33036 #endif
33037     (getbufferproc) 0,                        /* bf_getbuffer */
33038     (releasebufferproc) 0,                    /* bf_releasebuffer */
33039   },
33040     (PyObject *) 0,                           /* ht_name */
33041     (PyObject *) 0,                           /* ht_slots */
33042 #if PY_VERSION_HEX >= 0x03030000
33043     (PyObject *) 0,                           /* ht_qualname */
33044     0,                                        /* ht_cached_keys */
33045 #endif
33046 };
33047 
33048 SWIGINTERN SwigPyClientData SwigPyBuiltin___cbd_t_clientdata = {0, 0, 0, 0, 0, 0, (PyTypeObject *)&SwigPyBuiltin___cbd_t_type};
33049 
33050 
33051 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (BEGIN) -------- */
33052 
33053 static swig_type_info _swigt__p_AES_KEY = {"_p_AES_KEY", "AES_KEY *", 0, 0, (void*)0, 0};
33054 static swig_type_info _swigt__p_ASN1_BIT_STRING = {"_p_ASN1_BIT_STRING", "ASN1_BIT_STRING *", 0, 0, (void*)0, 0};
33055 static swig_type_info _swigt__p_ASN1_INTEGER = {"_p_ASN1_INTEGER", "ASN1_INTEGER *", 0, 0, (void*)0, 0};
33056 static swig_type_info _swigt__p_ASN1_OBJECT = {"_p_ASN1_OBJECT", "ASN1_OBJECT *", 0, 0, (void*)0, 0};
33057 static swig_type_info _swigt__p_ASN1_STRING = {"_p_ASN1_STRING", "ASN1_STRING *", 0, 0, (void*)0, 0};
33058 static swig_type_info _swigt__p_ASN1_TIME = {"_p_ASN1_TIME", "ASN1_TIME *", 0, 0, (void*)0, 0};
33059 static swig_type_info _swigt__p_BIGNUM = {"_p_BIGNUM", "BIGNUM *", 0, 0, (void*)0, 0};
33060 static swig_type_info _swigt__p_BIO = {"_p_BIO", "BIO *", 0, 0, (void*)0, 0};
33061 static swig_type_info _swigt__p_BIO_METHOD = {"_p_BIO_METHOD", "BIO_METHOD *", 0, 0, (void*)0, 0};
33062 static swig_type_info _swigt__p_DH = {"_p_DH", "DH *", 0, 0, (void*)0, 0};
33063 static swig_type_info _swigt__p_DSA = {"_p_DSA", "DSA *", 0, 0, (void*)0, 0};
33064 static swig_type_info _swigt__p_ECDSA_SIG = {"_p_ECDSA_SIG", "ECDSA_SIG *", 0, 0, (void*)0, 0};
33065 static swig_type_info _swigt__p_EC_KEY = {"_p_EC_KEY", "EC_KEY *", 0, 0, (void*)0, 0};
33066 static swig_type_info _swigt__p_ENGINE = {"_p_ENGINE", "ENGINE *", 0, 0, (void*)0, 0};
33067 static swig_type_info _swigt__p_EVP_CIPHER = {"_p_EVP_CIPHER", "EVP_CIPHER *", 0, 0, (void*)0, 0};
33068 static swig_type_info _swigt__p_EVP_CIPHER_CTX = {"_p_EVP_CIPHER_CTX", "EVP_CIPHER_CTX *", 0, 0, (void*)0, 0};
33069 static swig_type_info _swigt__p_EVP_MD = {"_p_EVP_MD", "EVP_MD *", 0, 0, (void*)0, 0};
33070 static swig_type_info _swigt__p_EVP_MD_CTX = {"_p_EVP_MD_CTX", "EVP_MD_CTX *", 0, 0, (void*)0, 0};
33071 static swig_type_info _swigt__p_EVP_PKEY = {"_p_EVP_PKEY", "EVP_PKEY *", 0, 0, (void*)0, 0};
33072 static swig_type_info _swigt__p_FILE = {"_p_FILE", "FILE *", 0, 0, (void*)0, 0};
33073 static swig_type_info _swigt__p_HMAC_CTX = {"_p_HMAC_CTX", "HMAC_CTX *", 0, 0, (void*)0, 0};
33074 static swig_type_info _swigt__p_PKCS7 = {"_p_PKCS7", "PKCS7 *", 0, 0, (void*)0, 0};
33075 static swig_type_info _swigt__p_PyObject = {"_p_PyObject", "PyObject *", 0, 0, (void*)0, 0};
33076 static swig_type_info _swigt__p_RC4_KEY = {"_p_RC4_KEY", "RC4_KEY *", 0, 0, (void*)0, 0};
33077 static swig_type_info _swigt__p_RSA = {"_p_RSA", "RSA *", 0, 0, (void*)0, 0};
33078 static swig_type_info _swigt__p_SSL = {"_p_SSL", "SSL *", 0, 0, (void*)0, 0};
33079 static swig_type_info _swigt__p_SSL_CIPHER = {"_p_SSL_CIPHER", "SSL_CIPHER *", 0, 0, (void*)0, 0};
33080 static swig_type_info _swigt__p_SSL_CTX = {"_p_SSL_CTX", "SSL_CTX *", 0, 0, (void*)0, 0};
33081 static swig_type_info _swigt__p_SSL_METHOD = {"_p_SSL_METHOD", "SSL_METHOD *", 0, 0, (void*)0, 0};
33082 static swig_type_info _swigt__p_SSL_SESSION = {"_p_SSL_SESSION", "SSL_SESSION *", 0, 0, (void*)0, 0};
33083 static swig_type_info _swigt__p_SwigPyObject = {"_p_SwigPyObject", "SwigPyObject *", 0, 0, (void*)0, 0};
33084 static swig_type_info _swigt__p_UI_METHOD = {"_p_UI_METHOD", "UI_METHOD *", 0, 0, (void*)0, 0};
33085 static swig_type_info _swigt__p_X509 = {"_p_X509", "X509 *", 0, 0, (void*)0, 0};
33086 static swig_type_info _swigt__p_X509V3_CTX = {"_p_X509V3_CTX", "X509V3_CTX *", 0, 0, (void*)0, 0};
33087 static swig_type_info _swigt__p_X509_CRL = {"_p_X509_CRL", "X509_CRL *", 0, 0, (void*)0, 0};
33088 static swig_type_info _swigt__p_X509_EXTENSION = {"_p_X509_EXTENSION", "X509_EXTENSION *", 0, 0, (void*)0, 0};
33089 static swig_type_info _swigt__p_X509_NAME = {"_p_X509_NAME", "X509_NAME *", 0, 0, (void*)0, 0};
33090 static swig_type_info _swigt__p_X509_NAME_ENTRY = {"_p_X509_NAME_ENTRY", "X509_NAME_ENTRY *", 0, 0, (void*)0, 0};
33091 static swig_type_info _swigt__p_X509_REQ = {"_p_X509_REQ", "X509_REQ *", 0, 0, (void*)0, 0};
33092 static swig_type_info _swigt__p_X509_STORE = {"_p_X509_STORE", "X509_STORE *", 0, 0, (void*)0, 0};
33093 static swig_type_info _swigt__p_X509_STORE_CTX = {"_p_X509_STORE_CTX", "X509_STORE_CTX *", 0, 0, (void*)0, 0};
33094 static swig_type_info _swigt__p___INTMAX_TYPE__ = {"_p___INTMAX_TYPE__", "__INTMAX_TYPE__ *|intmax_t *", 0, 0, (void*)0, 0};
33095 static swig_type_info _swigt__p___INT_FAST16_TYPE__ = {"_p___INT_FAST16_TYPE__", "__INT_FAST16_TYPE__ *|int_fast16_t *", 0, 0, (void*)0, 0};
33096 static swig_type_info _swigt__p___INT_FAST32_TYPE__ = {"_p___INT_FAST32_TYPE__", "__INT_FAST32_TYPE__ *|int_fast32_t *", 0, 0, (void*)0, 0};
33097 static swig_type_info _swigt__p___INT_FAST64_TYPE__ = {"_p___INT_FAST64_TYPE__", "__INT_FAST64_TYPE__ *|int_fast64_t *", 0, 0, (void*)0, 0};
33098 static swig_type_info _swigt__p___INT_FAST8_TYPE__ = {"_p___INT_FAST8_TYPE__", "__INT_FAST8_TYPE__ *|int_fast8_t *", 0, 0, (void*)0, 0};
33099 static swig_type_info _swigt__p___INT_LEAST16_TYPE__ = {"_p___INT_LEAST16_TYPE__", "__INT_LEAST16_TYPE__ *|int_least16_t *", 0, 0, (void*)0, 0};
33100 static swig_type_info _swigt__p___INT_LEAST32_TYPE__ = {"_p___INT_LEAST32_TYPE__", "__INT_LEAST32_TYPE__ *|int_least32_t *", 0, 0, (void*)0, 0};
33101 static swig_type_info _swigt__p___INT_LEAST64_TYPE__ = {"_p___INT_LEAST64_TYPE__", "__INT_LEAST64_TYPE__ *|int_least64_t *", 0, 0, (void*)0, 0};
33102 static swig_type_info _swigt__p___INT_LEAST8_TYPE__ = {"_p___INT_LEAST8_TYPE__", "__INT_LEAST8_TYPE__ *|int_least8_t *", 0, 0, (void*)0, 0};
33103 static swig_type_info _swigt__p___UINTMAX_TYPE__ = {"_p___UINTMAX_TYPE__", "__UINTMAX_TYPE__ *|uintmax_t *", 0, 0, (void*)0, 0};
33104 static swig_type_info _swigt__p___UINT_FAST16_TYPE__ = {"_p___UINT_FAST16_TYPE__", "__UINT_FAST16_TYPE__ *|uint_fast16_t *", 0, 0, (void*)0, 0};
33105 static swig_type_info _swigt__p___UINT_FAST32_TYPE__ = {"_p___UINT_FAST32_TYPE__", "__UINT_FAST32_TYPE__ *|uint_fast32_t *", 0, 0, (void*)0, 0};
33106 static swig_type_info _swigt__p___UINT_FAST64_TYPE__ = {"_p___UINT_FAST64_TYPE__", "__UINT_FAST64_TYPE__ *|uint_fast64_t *", 0, 0, (void*)0, 0};
33107 static swig_type_info _swigt__p___UINT_FAST8_TYPE__ = {"_p___UINT_FAST8_TYPE__", "__UINT_FAST8_TYPE__ *|uint_fast8_t *", 0, 0, (void*)0, 0};
33108 static swig_type_info _swigt__p___UINT_LEAST16_TYPE__ = {"_p___UINT_LEAST16_TYPE__", "__UINT_LEAST16_TYPE__ *|uint_least16_t *", 0, 0, (void*)0, 0};
33109 static swig_type_info _swigt__p___UINT_LEAST32_TYPE__ = {"_p___UINT_LEAST32_TYPE__", "__UINT_LEAST32_TYPE__ *|uint_least32_t *", 0, 0, (void*)0, 0};
33110 static swig_type_info _swigt__p___UINT_LEAST64_TYPE__ = {"_p___UINT_LEAST64_TYPE__", "__UINT_LEAST64_TYPE__ *|uint_least64_t *", 0, 0, (void*)0, 0};
33111 static swig_type_info _swigt__p___UINT_LEAST8_TYPE__ = {"_p___UINT_LEAST8_TYPE__", "__UINT_LEAST8_TYPE__ *|uint_least8_t *", 0, 0, (void*)0, 0};
33112 static swig_type_info _swigt__p__cbd_t = {"_p__cbd_t", "_cbd_t *", 0, 0, (void*)&SwigPyBuiltin___cbd_t_clientdata, 0};
33113 static swig_type_info _swigt__p_char = {"_p_char", "char *", 0, 0, (void*)0, 0};
33114 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};
33115 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};
33116 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};
33117 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};
33118 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};
33119 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};
33120 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};
33121 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};
33122 static swig_type_info _swigt__p_p_ASN1_OBJECT = {"_p_p_ASN1_OBJECT", "ASN1_OBJECT **", 0, 0, (void*)0, 0};
33123 static swig_type_info _swigt__p_p_EVP_PKEY_CTX = {"_p_p_EVP_PKEY_CTX", "EVP_PKEY_CTX **", 0, 0, (void*)0, 0};
33124 static swig_type_info _swigt__p_p_X509_NAME_ENTRY = {"_p_p_X509_NAME_ENTRY", "X509_NAME_ENTRY **", 0, 0, (void*)0, 0};
33125 static swig_type_info _swigt__p_p_unsigned_char = {"_p_p_unsigned_char", "unsigned char **", 0, 0, (void*)0, 0};
33126 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};
33127 static swig_type_info _swigt__p_stack_st = {"_p_stack_st", "struct stack_st *|OPENSSL_STACK *", 0, 0, (void*)0, 0};
33128 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};
33129 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};
33130 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};
33131 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};
33132 static swig_type_info _swigt__p_stack_st_X509 = {"_p_stack_st_X509", "struct stack_st_X509 *", 0, 0, (void*)0, 0};
33133 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};
33134 static swig_type_info _swigt__p_unsigned_char = {"_p_unsigned_char", "unsigned char *", 0, 0, (void*)0, 0};
33135 static swig_type_info _swigt__p_void = {"_p_void", "void *", 0, 0, (void*)0, 0};
33136 
33137 static swig_type_info *swig_type_initial[] = {
33138   &_swigt__p_AES_KEY,
33139   &_swigt__p_ASN1_BIT_STRING,
33140   &_swigt__p_ASN1_INTEGER,
33141   &_swigt__p_ASN1_OBJECT,
33142   &_swigt__p_ASN1_STRING,
33143   &_swigt__p_ASN1_TIME,
33144   &_swigt__p_BIGNUM,
33145   &_swigt__p_BIO,
33146   &_swigt__p_BIO_METHOD,
33147   &_swigt__p_DH,
33148   &_swigt__p_DSA,
33149   &_swigt__p_ECDSA_SIG,
33150   &_swigt__p_EC_KEY,
33151   &_swigt__p_ENGINE,
33152   &_swigt__p_EVP_CIPHER,
33153   &_swigt__p_EVP_CIPHER_CTX,
33154   &_swigt__p_EVP_MD,
33155   &_swigt__p_EVP_MD_CTX,
33156   &_swigt__p_EVP_PKEY,
33157   &_swigt__p_FILE,
33158   &_swigt__p_HMAC_CTX,
33159   &_swigt__p_PKCS7,
33160   &_swigt__p_PyObject,
33161   &_swigt__p_RC4_KEY,
33162   &_swigt__p_RSA,
33163   &_swigt__p_SSL,
33164   &_swigt__p_SSL_CIPHER,
33165   &_swigt__p_SSL_CTX,
33166   &_swigt__p_SSL_METHOD,
33167   &_swigt__p_SSL_SESSION,
33168   &_swigt__p_SwigPyObject,
33169   &_swigt__p_UI_METHOD,
33170   &_swigt__p_X509,
33171   &_swigt__p_X509V3_CTX,
33172   &_swigt__p_X509_CRL,
33173   &_swigt__p_X509_EXTENSION,
33174   &_swigt__p_X509_NAME,
33175   &_swigt__p_X509_NAME_ENTRY,
33176   &_swigt__p_X509_REQ,
33177   &_swigt__p_X509_STORE,
33178   &_swigt__p_X509_STORE_CTX,
33179   &_swigt__p___INTMAX_TYPE__,
33180   &_swigt__p___INT_FAST16_TYPE__,
33181   &_swigt__p___INT_FAST32_TYPE__,
33182   &_swigt__p___INT_FAST64_TYPE__,
33183   &_swigt__p___INT_FAST8_TYPE__,
33184   &_swigt__p___INT_LEAST16_TYPE__,
33185   &_swigt__p___INT_LEAST32_TYPE__,
33186   &_swigt__p___INT_LEAST64_TYPE__,
33187   &_swigt__p___INT_LEAST8_TYPE__,
33188   &_swigt__p___UINTMAX_TYPE__,
33189   &_swigt__p___UINT_FAST16_TYPE__,
33190   &_swigt__p___UINT_FAST32_TYPE__,
33191   &_swigt__p___UINT_FAST64_TYPE__,
33192   &_swigt__p___UINT_FAST8_TYPE__,
33193   &_swigt__p___UINT_LEAST16_TYPE__,
33194   &_swigt__p___UINT_LEAST32_TYPE__,
33195   &_swigt__p___UINT_LEAST64_TYPE__,
33196   &_swigt__p___UINT_LEAST8_TYPE__,
33197   &_swigt__p__cbd_t,
33198   &_swigt__p_char,
33199   &_swigt__p_f_int_p_X509_STORE_CTX__int,
33200   &_swigt__p_f_p_char__void,
33201   &_swigt__p_f_p_q_const__char__p_char,
33202   &_swigt__p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int,
33203   &_swigt__p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int,
33204   &_swigt__p_f_p_q_const__void__p_void,
33205   &_swigt__p_f_p_q_const__void_p_q_const__void__int,
33206   &_swigt__p_f_p_void__void,
33207   &_swigt__p_p_ASN1_OBJECT,
33208   &_swigt__p_p_EVP_PKEY_CTX,
33209   &_swigt__p_p_X509_NAME_ENTRY,
33210   &_swigt__p_p_unsigned_char,
33211   &_swigt__p_pyfd_struct,
33212   &_swigt__p_stack_st,
33213   &_swigt__p_stack_st_OPENSSL_BLOCK,
33214   &_swigt__p_stack_st_OPENSSL_CSTRING,
33215   &_swigt__p_stack_st_OPENSSL_STRING,
33216   &_swigt__p_stack_st_SSL_CIPHER,
33217   &_swigt__p_stack_st_X509,
33218   &_swigt__p_stack_st_X509_EXTENSION,
33219   &_swigt__p_unsigned_char,
33220   &_swigt__p_void,
33221 };
33222 
33223 static swig_cast_info _swigc__p_AES_KEY[] = {  {&_swigt__p_AES_KEY, 0, 0, 0},{0, 0, 0, 0}};
33224 static swig_cast_info _swigc__p_ASN1_BIT_STRING[] = {  {&_swigt__p_ASN1_BIT_STRING, 0, 0, 0},{0, 0, 0, 0}};
33225 static swig_cast_info _swigc__p_ASN1_INTEGER[] = {  {&_swigt__p_ASN1_INTEGER, 0, 0, 0},{0, 0, 0, 0}};
33226 static swig_cast_info _swigc__p_ASN1_OBJECT[] = {  {&_swigt__p_ASN1_OBJECT, 0, 0, 0},{0, 0, 0, 0}};
33227 static swig_cast_info _swigc__p_ASN1_STRING[] = {  {&_swigt__p_ASN1_STRING, 0, 0, 0},{0, 0, 0, 0}};
33228 static swig_cast_info _swigc__p_ASN1_TIME[] = {  {&_swigt__p_ASN1_TIME, 0, 0, 0},{0, 0, 0, 0}};
33229 static swig_cast_info _swigc__p_BIGNUM[] = {  {&_swigt__p_BIGNUM, 0, 0, 0},{0, 0, 0, 0}};
33230 static swig_cast_info _swigc__p_BIO[] = {  {&_swigt__p_BIO, 0, 0, 0},{0, 0, 0, 0}};
33231 static swig_cast_info _swigc__p_BIO_METHOD[] = {  {&_swigt__p_BIO_METHOD, 0, 0, 0},{0, 0, 0, 0}};
33232 static swig_cast_info _swigc__p_DH[] = {  {&_swigt__p_DH, 0, 0, 0},{0, 0, 0, 0}};
33233 static swig_cast_info _swigc__p_DSA[] = {  {&_swigt__p_DSA, 0, 0, 0},{0, 0, 0, 0}};
33234 static swig_cast_info _swigc__p_ECDSA_SIG[] = {  {&_swigt__p_ECDSA_SIG, 0, 0, 0},{0, 0, 0, 0}};
33235 static swig_cast_info _swigc__p_EC_KEY[] = {  {&_swigt__p_EC_KEY, 0, 0, 0},{0, 0, 0, 0}};
33236 static swig_cast_info _swigc__p_ENGINE[] = {  {&_swigt__p_ENGINE, 0, 0, 0},{0, 0, 0, 0}};
33237 static swig_cast_info _swigc__p_EVP_CIPHER[] = {  {&_swigt__p_EVP_CIPHER, 0, 0, 0},{0, 0, 0, 0}};
33238 static swig_cast_info _swigc__p_EVP_CIPHER_CTX[] = {  {&_swigt__p_EVP_CIPHER_CTX, 0, 0, 0},{0, 0, 0, 0}};
33239 static swig_cast_info _swigc__p_EVP_MD[] = {  {&_swigt__p_EVP_MD, 0, 0, 0},{0, 0, 0, 0}};
33240 static swig_cast_info _swigc__p_EVP_MD_CTX[] = {  {&_swigt__p_EVP_MD_CTX, 0, 0, 0},{0, 0, 0, 0}};
33241 static swig_cast_info _swigc__p_EVP_PKEY[] = {  {&_swigt__p_EVP_PKEY, 0, 0, 0},{0, 0, 0, 0}};
33242 static swig_cast_info _swigc__p_FILE[] = {  {&_swigt__p_FILE, 0, 0, 0},{0, 0, 0, 0}};
33243 static swig_cast_info _swigc__p_HMAC_CTX[] = {  {&_swigt__p_HMAC_CTX, 0, 0, 0},{0, 0, 0, 0}};
33244 static swig_cast_info _swigc__p_PKCS7[] = {  {&_swigt__p_PKCS7, 0, 0, 0},{0, 0, 0, 0}};
33245 static swig_cast_info _swigc__p_PyObject[] = {  {&_swigt__p_PyObject, 0, 0, 0},{0, 0, 0, 0}};
33246 static swig_cast_info _swigc__p_RC4_KEY[] = {  {&_swigt__p_RC4_KEY, 0, 0, 0},{0, 0, 0, 0}};
33247 static swig_cast_info _swigc__p_RSA[] = {  {&_swigt__p_RSA, 0, 0, 0},{0, 0, 0, 0}};
33248 static swig_cast_info _swigc__p_SSL[] = {  {&_swigt__p_SSL, 0, 0, 0},{0, 0, 0, 0}};
33249 static swig_cast_info _swigc__p_SSL_CIPHER[] = {  {&_swigt__p_SSL_CIPHER, 0, 0, 0},{0, 0, 0, 0}};
33250 static swig_cast_info _swigc__p_SSL_CTX[] = {  {&_swigt__p_SSL_CTX, 0, 0, 0},{0, 0, 0, 0}};
33251 static swig_cast_info _swigc__p_SSL_METHOD[] = {  {&_swigt__p_SSL_METHOD, 0, 0, 0},{0, 0, 0, 0}};
33252 static swig_cast_info _swigc__p_SSL_SESSION[] = {  {&_swigt__p_SSL_SESSION, 0, 0, 0},{0, 0, 0, 0}};
33253 static swig_cast_info _swigc__p_SwigPyObject[] = {  {&_swigt__p_SwigPyObject, 0, 0, 0},{0, 0, 0, 0}};
33254 static swig_cast_info _swigc__p_UI_METHOD[] = {  {&_swigt__p_UI_METHOD, 0, 0, 0},{0, 0, 0, 0}};
33255 static swig_cast_info _swigc__p_X509[] = {  {&_swigt__p_X509, 0, 0, 0},{0, 0, 0, 0}};
33256 static swig_cast_info _swigc__p_X509V3_CTX[] = {  {&_swigt__p_X509V3_CTX, 0, 0, 0},{0, 0, 0, 0}};
33257 static swig_cast_info _swigc__p_X509_CRL[] = {  {&_swigt__p_X509_CRL, 0, 0, 0},{0, 0, 0, 0}};
33258 static swig_cast_info _swigc__p_X509_EXTENSION[] = {  {&_swigt__p_X509_EXTENSION, 0, 0, 0},{0, 0, 0, 0}};
33259 static swig_cast_info _swigc__p_X509_NAME[] = {  {&_swigt__p_X509_NAME, 0, 0, 0},{0, 0, 0, 0}};
33260 static swig_cast_info _swigc__p_X509_NAME_ENTRY[] = {  {&_swigt__p_X509_NAME_ENTRY, 0, 0, 0},{0, 0, 0, 0}};
33261 static swig_cast_info _swigc__p_X509_REQ[] = {  {&_swigt__p_X509_REQ, 0, 0, 0},{0, 0, 0, 0}};
33262 static swig_cast_info _swigc__p_X509_STORE[] = {  {&_swigt__p_X509_STORE, 0, 0, 0},{0, 0, 0, 0}};
33263 static swig_cast_info _swigc__p_X509_STORE_CTX[] = {  {&_swigt__p_X509_STORE_CTX, 0, 0, 0},{0, 0, 0, 0}};
33264 static swig_cast_info _swigc__p___INTMAX_TYPE__[] = {  {&_swigt__p___INTMAX_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33265 static swig_cast_info _swigc__p___INT_FAST16_TYPE__[] = {  {&_swigt__p___INT_FAST16_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33266 static swig_cast_info _swigc__p___INT_FAST32_TYPE__[] = {  {&_swigt__p___INT_FAST32_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33267 static swig_cast_info _swigc__p___INT_FAST64_TYPE__[] = {  {&_swigt__p___INT_FAST64_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33268 static swig_cast_info _swigc__p___INT_FAST8_TYPE__[] = {  {&_swigt__p___INT_FAST8_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33269 static swig_cast_info _swigc__p___INT_LEAST16_TYPE__[] = {  {&_swigt__p___INT_LEAST16_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33270 static swig_cast_info _swigc__p___INT_LEAST32_TYPE__[] = {  {&_swigt__p___INT_LEAST32_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33271 static swig_cast_info _swigc__p___INT_LEAST64_TYPE__[] = {  {&_swigt__p___INT_LEAST64_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33272 static swig_cast_info _swigc__p___INT_LEAST8_TYPE__[] = {  {&_swigt__p___INT_LEAST8_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33273 static swig_cast_info _swigc__p___UINTMAX_TYPE__[] = {  {&_swigt__p___UINTMAX_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33274 static swig_cast_info _swigc__p___UINT_FAST16_TYPE__[] = {  {&_swigt__p___UINT_FAST16_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33275 static swig_cast_info _swigc__p___UINT_FAST32_TYPE__[] = {  {&_swigt__p___UINT_FAST32_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33276 static swig_cast_info _swigc__p___UINT_FAST64_TYPE__[] = {  {&_swigt__p___UINT_FAST64_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33277 static swig_cast_info _swigc__p___UINT_FAST8_TYPE__[] = {  {&_swigt__p___UINT_FAST8_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33278 static swig_cast_info _swigc__p___UINT_LEAST16_TYPE__[] = {  {&_swigt__p___UINT_LEAST16_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33279 static swig_cast_info _swigc__p___UINT_LEAST32_TYPE__[] = {  {&_swigt__p___UINT_LEAST32_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33280 static swig_cast_info _swigc__p___UINT_LEAST64_TYPE__[] = {  {&_swigt__p___UINT_LEAST64_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33281 static swig_cast_info _swigc__p___UINT_LEAST8_TYPE__[] = {  {&_swigt__p___UINT_LEAST8_TYPE__, 0, 0, 0},{0, 0, 0, 0}};
33282 static swig_cast_info _swigc__p__cbd_t[] = {  {&_swigt__p__cbd_t, 0, 0, 0},{0, 0, 0, 0}};
33283 static swig_cast_info _swigc__p_char[] = {  {&_swigt__p_char, 0, 0, 0},{0, 0, 0, 0}};
33284 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}};
33285 static swig_cast_info _swigc__p_f_p_char__void[] = {  {&_swigt__p_f_p_char__void, 0, 0, 0},{0, 0, 0, 0}};
33286 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}};
33287 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}};
33288 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}};
33289 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}};
33290 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}};
33291 static swig_cast_info _swigc__p_f_p_void__void[] = {  {&_swigt__p_f_p_void__void, 0, 0, 0},{0, 0, 0, 0}};
33292 static swig_cast_info _swigc__p_p_ASN1_OBJECT[] = {  {&_swigt__p_p_ASN1_OBJECT, 0, 0, 0},{0, 0, 0, 0}};
33293 static swig_cast_info _swigc__p_p_EVP_PKEY_CTX[] = {  {&_swigt__p_p_EVP_PKEY_CTX, 0, 0, 0},{0, 0, 0, 0}};
33294 static swig_cast_info _swigc__p_p_X509_NAME_ENTRY[] = {  {&_swigt__p_p_X509_NAME_ENTRY, 0, 0, 0},{0, 0, 0, 0}};
33295 static swig_cast_info _swigc__p_p_unsigned_char[] = {  {&_swigt__p_p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
33296 static swig_cast_info _swigc__p_pyfd_struct[] = {  {&_swigt__p_pyfd_struct, 0, 0, 0},{0, 0, 0, 0}};
33297 static swig_cast_info _swigc__p_stack_st[] = {  {&_swigt__p_stack_st, 0, 0, 0},{0, 0, 0, 0}};
33298 static swig_cast_info _swigc__p_stack_st_OPENSSL_BLOCK[] = {  {&_swigt__p_stack_st_OPENSSL_BLOCK, 0, 0, 0},{0, 0, 0, 0}};
33299 static swig_cast_info _swigc__p_stack_st_OPENSSL_CSTRING[] = {  {&_swigt__p_stack_st_OPENSSL_CSTRING, 0, 0, 0},{0, 0, 0, 0}};
33300 static swig_cast_info _swigc__p_stack_st_OPENSSL_STRING[] = {  {&_swigt__p_stack_st_OPENSSL_STRING, 0, 0, 0},{0, 0, 0, 0}};
33301 static swig_cast_info _swigc__p_stack_st_SSL_CIPHER[] = {  {&_swigt__p_stack_st_SSL_CIPHER, 0, 0, 0},{0, 0, 0, 0}};
33302 static swig_cast_info _swigc__p_stack_st_X509[] = {  {&_swigt__p_stack_st_X509, 0, 0, 0},{0, 0, 0, 0}};
33303 static swig_cast_info _swigc__p_stack_st_X509_EXTENSION[] = {  {&_swigt__p_stack_st_X509_EXTENSION, 0, 0, 0},{0, 0, 0, 0}};
33304 static swig_cast_info _swigc__p_unsigned_char[] = {  {&_swigt__p_unsigned_char, 0, 0, 0},{0, 0, 0, 0}};
33305 static swig_cast_info _swigc__p_void[] = {  {&_swigt__p_void, 0, 0, 0},{0, 0, 0, 0}};
33306 
33307 static swig_cast_info *swig_cast_initial[] = {
33308   _swigc__p_AES_KEY,
33309   _swigc__p_ASN1_BIT_STRING,
33310   _swigc__p_ASN1_INTEGER,
33311   _swigc__p_ASN1_OBJECT,
33312   _swigc__p_ASN1_STRING,
33313   _swigc__p_ASN1_TIME,
33314   _swigc__p_BIGNUM,
33315   _swigc__p_BIO,
33316   _swigc__p_BIO_METHOD,
33317   _swigc__p_DH,
33318   _swigc__p_DSA,
33319   _swigc__p_ECDSA_SIG,
33320   _swigc__p_EC_KEY,
33321   _swigc__p_ENGINE,
33322   _swigc__p_EVP_CIPHER,
33323   _swigc__p_EVP_CIPHER_CTX,
33324   _swigc__p_EVP_MD,
33325   _swigc__p_EVP_MD_CTX,
33326   _swigc__p_EVP_PKEY,
33327   _swigc__p_FILE,
33328   _swigc__p_HMAC_CTX,
33329   _swigc__p_PKCS7,
33330   _swigc__p_PyObject,
33331   _swigc__p_RC4_KEY,
33332   _swigc__p_RSA,
33333   _swigc__p_SSL,
33334   _swigc__p_SSL_CIPHER,
33335   _swigc__p_SSL_CTX,
33336   _swigc__p_SSL_METHOD,
33337   _swigc__p_SSL_SESSION,
33338   _swigc__p_SwigPyObject,
33339   _swigc__p_UI_METHOD,
33340   _swigc__p_X509,
33341   _swigc__p_X509V3_CTX,
33342   _swigc__p_X509_CRL,
33343   _swigc__p_X509_EXTENSION,
33344   _swigc__p_X509_NAME,
33345   _swigc__p_X509_NAME_ENTRY,
33346   _swigc__p_X509_REQ,
33347   _swigc__p_X509_STORE,
33348   _swigc__p_X509_STORE_CTX,
33349   _swigc__p___INTMAX_TYPE__,
33350   _swigc__p___INT_FAST16_TYPE__,
33351   _swigc__p___INT_FAST32_TYPE__,
33352   _swigc__p___INT_FAST64_TYPE__,
33353   _swigc__p___INT_FAST8_TYPE__,
33354   _swigc__p___INT_LEAST16_TYPE__,
33355   _swigc__p___INT_LEAST32_TYPE__,
33356   _swigc__p___INT_LEAST64_TYPE__,
33357   _swigc__p___INT_LEAST8_TYPE__,
33358   _swigc__p___UINTMAX_TYPE__,
33359   _swigc__p___UINT_FAST16_TYPE__,
33360   _swigc__p___UINT_FAST32_TYPE__,
33361   _swigc__p___UINT_FAST64_TYPE__,
33362   _swigc__p___UINT_FAST8_TYPE__,
33363   _swigc__p___UINT_LEAST16_TYPE__,
33364   _swigc__p___UINT_LEAST32_TYPE__,
33365   _swigc__p___UINT_LEAST64_TYPE__,
33366   _swigc__p___UINT_LEAST8_TYPE__,
33367   _swigc__p__cbd_t,
33368   _swigc__p_char,
33369   _swigc__p_f_int_p_X509_STORE_CTX__int,
33370   _swigc__p_f_p_char__void,
33371   _swigc__p_f_p_q_const__char__p_char,
33372   _swigc__p_f_p_q_const__p_q_const__char_p_q_const__p_q_const__char__int,
33373   _swigc__p_f_p_q_const__p_q_const__void_p_q_const__p_q_const__void__int,
33374   _swigc__p_f_p_q_const__void__p_void,
33375   _swigc__p_f_p_q_const__void_p_q_const__void__int,
33376   _swigc__p_f_p_void__void,
33377   _swigc__p_p_ASN1_OBJECT,
33378   _swigc__p_p_EVP_PKEY_CTX,
33379   _swigc__p_p_X509_NAME_ENTRY,
33380   _swigc__p_p_unsigned_char,
33381   _swigc__p_pyfd_struct,
33382   _swigc__p_stack_st,
33383   _swigc__p_stack_st_OPENSSL_BLOCK,
33384   _swigc__p_stack_st_OPENSSL_CSTRING,
33385   _swigc__p_stack_st_OPENSSL_STRING,
33386   _swigc__p_stack_st_SSL_CIPHER,
33387   _swigc__p_stack_st_X509,
33388   _swigc__p_stack_st_X509_EXTENSION,
33389   _swigc__p_unsigned_char,
33390   _swigc__p_void,
33391 };
33392 
33393 
33394 /* -------- TYPE CONVERSION AND EQUIVALENCE RULES (END) -------- */
33395 
33396 static swig_const_info swig_const_table[] = {
33397 {0, 0, 0, 0.0, 0, 0}};
33398 
33399 #ifdef __cplusplus
33400 }
33401 #endif
33402 static PyTypeObject *builtin_bases[2];
33403 
33404 /* -----------------------------------------------------------------------------
33405  * Type initialization:
33406  * This problem is tough by the requirement that no dynamic
33407  * memory is used. Also, since swig_type_info structures store pointers to
33408  * swig_cast_info structures and swig_cast_info structures store pointers back
33409  * to swig_type_info structures, we need some lookup code at initialization.
33410  * The idea is that swig generates all the structures that are needed.
33411  * The runtime then collects these partially filled structures.
33412  * The SWIG_InitializeModule function takes these initial arrays out of
33413  * swig_module, and does all the lookup, filling in the swig_module.types
33414  * array with the correct data and linking the correct swig_cast_info
33415  * structures together.
33416  *
33417  * The generated swig_type_info structures are assigned statically to an initial
33418  * array. We just loop through that array, and handle each type individually.
33419  * First we lookup if this type has been already loaded, and if so, use the
33420  * loaded structure instead of the generated one. Then we have to fill in the
33421  * cast linked list. The cast data is initially stored in something like a
33422  * two-dimensional array. Each row corresponds to a type (there are the same
33423  * number of rows as there are in the swig_type_initial array). Each entry in
33424  * a column is one of the swig_cast_info structures for that type.
33425  * The cast_initial array is actually an array of arrays, because each row has
33426  * a variable number of columns. So to actually build the cast linked list,
33427  * we find the array of casts associated with the type, and loop through it
33428  * adding the casts to the list. The one last trick we need to do is making
33429  * sure the type pointer in the swig_cast_info struct is correct.
33430  *
33431  * First off, we lookup the cast->type name to see if it is already loaded.
33432  * There are three cases to handle:
33433  *  1) If the cast->type has already been loaded AND the type we are adding
33434  *     casting info to has not been loaded (it is in this module), THEN we
33435  *     replace the cast->type pointer with the type pointer that has already
33436  *     been loaded.
33437  *  2) If BOTH types (the one we are adding casting info to, and the
33438  *     cast->type) are loaded, THEN the cast info has already been loaded by
33439  *     the previous module so we just ignore it.
33440  *  3) Finally, if cast->type has not already been loaded, then we add that
33441  *     swig_cast_info to the linked list (because the cast->type) pointer will
33442  *     be correct.
33443  * ----------------------------------------------------------------------------- */
33444 
33445 #ifdef __cplusplus
33446 extern "C" {
33447 #if 0
33448 } /* c-mode */
33449 #endif
33450 #endif
33451 
33452 #if 0
33453 #define SWIGRUNTIME_DEBUG
33454 #endif
33455 
33456 
33457 SWIGRUNTIME void
SWIG_InitializeModule(void * clientdata)33458 SWIG_InitializeModule(void *clientdata) {
33459   size_t i;
33460   swig_module_info *module_head, *iter;
33461   int init;
33462 
33463   /* check to see if the circular list has been setup, if not, set it up */
33464   if (swig_module.next==0) {
33465     /* Initialize the swig_module */
33466     swig_module.type_initial = swig_type_initial;
33467     swig_module.cast_initial = swig_cast_initial;
33468     swig_module.next = &swig_module;
33469     init = 1;
33470   } else {
33471     init = 0;
33472   }
33473 
33474   /* Try and load any already created modules */
33475   module_head = SWIG_GetModule(clientdata);
33476   if (!module_head) {
33477     /* This is the first module loaded for this interpreter */
33478     /* so set the swig module into the interpreter */
33479     SWIG_SetModule(clientdata, &swig_module);
33480   } else {
33481     /* the interpreter has loaded a SWIG module, but has it loaded this one? */
33482     iter=module_head;
33483     do {
33484       if (iter==&swig_module) {
33485         /* Our module is already in the list, so there's nothing more to do. */
33486         return;
33487       }
33488       iter=iter->next;
33489     } while (iter!= module_head);
33490 
33491     /* otherwise we must add our module into the list */
33492     swig_module.next = module_head->next;
33493     module_head->next = &swig_module;
33494   }
33495 
33496   /* When multiple interpreters are used, a module could have already been initialized in
33497        a different interpreter, but not yet have a pointer in this interpreter.
33498        In this case, we do not want to continue adding types... everything should be
33499        set up already */
33500   if (init == 0) return;
33501 
33502   /* Now work on filling in swig_module.types */
33503 #ifdef SWIGRUNTIME_DEBUG
33504   printf("SWIG_InitializeModule: size %lu\n", (unsigned long)swig_module.size);
33505 #endif
33506   for (i = 0; i < swig_module.size; ++i) {
33507     swig_type_info *type = 0;
33508     swig_type_info *ret;
33509     swig_cast_info *cast;
33510 
33511 #ifdef SWIGRUNTIME_DEBUG
33512     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
33513 #endif
33514 
33515     /* if there is another module already loaded */
33516     if (swig_module.next != &swig_module) {
33517       type = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, swig_module.type_initial[i]->name);
33518     }
33519     if (type) {
33520       /* Overwrite clientdata field */
33521 #ifdef SWIGRUNTIME_DEBUG
33522       printf("SWIG_InitializeModule: found type %s\n", type->name);
33523 #endif
33524       if (swig_module.type_initial[i]->clientdata) {
33525         type->clientdata = swig_module.type_initial[i]->clientdata;
33526 #ifdef SWIGRUNTIME_DEBUG
33527         printf("SWIG_InitializeModule: found and overwrite type %s \n", type->name);
33528 #endif
33529       }
33530     } else {
33531       type = swig_module.type_initial[i];
33532     }
33533 
33534     /* Insert casting types */
33535     cast = swig_module.cast_initial[i];
33536     while (cast->type) {
33537       /* Don't need to add information already in the list */
33538       ret = 0;
33539 #ifdef SWIGRUNTIME_DEBUG
33540       printf("SWIG_InitializeModule: look cast %s\n", cast->type->name);
33541 #endif
33542       if (swig_module.next != &swig_module) {
33543         ret = SWIG_MangledTypeQueryModule(swig_module.next, &swig_module, cast->type->name);
33544 #ifdef SWIGRUNTIME_DEBUG
33545         if (ret) printf("SWIG_InitializeModule: found cast %s\n", ret->name);
33546 #endif
33547       }
33548       if (ret) {
33549         if (type == swig_module.type_initial[i]) {
33550 #ifdef SWIGRUNTIME_DEBUG
33551           printf("SWIG_InitializeModule: skip old type %s\n", ret->name);
33552 #endif
33553           cast->type = ret;
33554           ret = 0;
33555         } else {
33556           /* Check for casting already in the list */
33557           swig_cast_info *ocast = SWIG_TypeCheck(ret->name, type);
33558 #ifdef SWIGRUNTIME_DEBUG
33559           if (ocast) printf("SWIG_InitializeModule: skip old cast %s\n", ret->name);
33560 #endif
33561           if (!ocast) ret = 0;
33562         }
33563       }
33564 
33565       if (!ret) {
33566 #ifdef SWIGRUNTIME_DEBUG
33567         printf("SWIG_InitializeModule: adding cast %s\n", cast->type->name);
33568 #endif
33569         if (type->cast) {
33570           type->cast->prev = cast;
33571           cast->next = type->cast;
33572         }
33573         type->cast = cast;
33574       }
33575       cast++;
33576     }
33577     /* Set entry in modules->types array equal to the type */
33578     swig_module.types[i] = type;
33579   }
33580   swig_module.types[i] = 0;
33581 
33582 #ifdef SWIGRUNTIME_DEBUG
33583   printf("**** SWIG_InitializeModule: Cast List ******\n");
33584   for (i = 0; i < swig_module.size; ++i) {
33585     int j = 0;
33586     swig_cast_info *cast = swig_module.cast_initial[i];
33587     printf("SWIG_InitializeModule: type %lu %s\n", (unsigned long)i, swig_module.type_initial[i]->name);
33588     while (cast->type) {
33589       printf("SWIG_InitializeModule: cast type %s\n", cast->type->name);
33590       cast++;
33591       ++j;
33592     }
33593     printf("---- Total casts: %d\n",j);
33594   }
33595   printf("**** SWIG_InitializeModule: Cast List ******\n");
33596 #endif
33597 }
33598 
33599 /* This function will propagate the clientdata field of type to
33600 * any new swig_type_info structures that have been added into the list
33601 * of equivalent types.  It is like calling
33602 * SWIG_TypeClientData(type, clientdata) a second time.
33603 */
33604 SWIGRUNTIME void
SWIG_PropagateClientData(void)33605 SWIG_PropagateClientData(void) {
33606   size_t i;
33607   swig_cast_info *equiv;
33608   static int init_run = 0;
33609 
33610   if (init_run) return;
33611   init_run = 1;
33612 
33613   for (i = 0; i < swig_module.size; i++) {
33614     if (swig_module.types[i]->clientdata) {
33615       equiv = swig_module.types[i]->cast;
33616       while (equiv) {
33617         if (!equiv->converter) {
33618           if (equiv->type && !equiv->type->clientdata)
33619           SWIG_TypeClientData(equiv->type, swig_module.types[i]->clientdata);
33620         }
33621         equiv = equiv->next;
33622       }
33623     }
33624   }
33625 }
33626 
33627 #ifdef __cplusplus
33628 #if 0
33629 {
33630   /* c-mode */
33631 #endif
33632 }
33633 #endif
33634 
33635 
33636 
33637 #ifdef __cplusplus
33638 extern "C" {
33639 #endif
33640 
33641   /* Python-specific SWIG API */
33642 #define SWIG_newvarlink()                             SWIG_Python_newvarlink()
33643 #define SWIG_addvarlink(p, name, get_attr, set_attr)  SWIG_Python_addvarlink(p, name, get_attr, set_attr)
33644 #define SWIG_InstallConstants(d, constants)           SWIG_Python_InstallConstants(d, constants)
33645 
33646   /* -----------------------------------------------------------------------------
33647    * global variable support code.
33648    * ----------------------------------------------------------------------------- */
33649 
33650   typedef struct swig_globalvar {
33651     char       *name;                  /* Name of global variable */
33652     PyObject *(*get_attr)(void);       /* Return the current value */
33653     int       (*set_attr)(PyObject *); /* Set the value */
33654     struct swig_globalvar *next;
33655   } swig_globalvar;
33656 
33657   typedef struct swig_varlinkobject {
33658     PyObject_HEAD
33659     swig_globalvar *vars;
33660   } swig_varlinkobject;
33661 
33662   SWIGINTERN PyObject *
swig_varlink_repr(swig_varlinkobject * SWIGUNUSEDPARM (v))33663   swig_varlink_repr(swig_varlinkobject *SWIGUNUSEDPARM(v)) {
33664 #if PY_VERSION_HEX >= 0x03000000
33665     return PyUnicode_InternFromString("<Swig global variables>");
33666 #else
33667     return PyString_FromString("<Swig global variables>");
33668 #endif
33669   }
33670 
33671   SWIGINTERN PyObject *
swig_varlink_str(swig_varlinkobject * v)33672   swig_varlink_str(swig_varlinkobject *v) {
33673 #if PY_VERSION_HEX >= 0x03000000
33674     PyObject *str = PyUnicode_InternFromString("(");
33675     PyObject *tail;
33676     PyObject *joined;
33677     swig_globalvar *var;
33678     for (var = v->vars; var; var=var->next) {
33679       tail = PyUnicode_FromString(var->name);
33680       joined = PyUnicode_Concat(str, tail);
33681       Py_DecRef(str);
33682       Py_DecRef(tail);
33683       str = joined;
33684       if (var->next) {
33685         tail = PyUnicode_InternFromString(", ");
33686         joined = PyUnicode_Concat(str, tail);
33687         Py_DecRef(str);
33688         Py_DecRef(tail);
33689         str = joined;
33690       }
33691     }
33692     tail = PyUnicode_InternFromString(")");
33693     joined = PyUnicode_Concat(str, tail);
33694     Py_DecRef(str);
33695     Py_DecRef(tail);
33696     str = joined;
33697 #else
33698     PyObject *str = PyString_FromString("(");
33699     swig_globalvar *var;
33700     for (var = v->vars; var; var=var->next) {
33701       PyString_ConcatAndDel(&str,PyString_FromString(var->name));
33702       if (var->next) PyString_ConcatAndDel(&str,PyString_FromString(", "));
33703     }
33704     PyString_ConcatAndDel(&str,PyString_FromString(")"));
33705 #endif
33706     return str;
33707   }
33708 
33709   SWIGINTERN void
swig_varlink_dealloc(swig_varlinkobject * v)33710   swig_varlink_dealloc(swig_varlinkobject *v) {
33711     swig_globalvar *var = v->vars;
33712     while (var) {
33713       swig_globalvar *n = var->next;
33714       free(var->name);
33715       free(var);
33716       var = n;
33717     }
33718   }
33719 
33720   SWIGINTERN PyObject *
swig_varlink_getattr(swig_varlinkobject * v,char * n)33721   swig_varlink_getattr(swig_varlinkobject *v, char *n) {
33722     PyObject *res = NULL;
33723     swig_globalvar *var = v->vars;
33724     while (var) {
33725       if (strcmp(var->name,n) == 0) {
33726         res = (*var->get_attr)();
33727         break;
33728       }
33729       var = var->next;
33730     }
33731     if (res == NULL && !PyErr_Occurred()) {
33732       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
33733     }
33734     return res;
33735   }
33736 
33737   SWIGINTERN int
swig_varlink_setattr(swig_varlinkobject * v,char * n,PyObject * p)33738   swig_varlink_setattr(swig_varlinkobject *v, char *n, PyObject *p) {
33739     int res = 1;
33740     swig_globalvar *var = v->vars;
33741     while (var) {
33742       if (strcmp(var->name,n) == 0) {
33743         res = (*var->set_attr)(p);
33744         break;
33745       }
33746       var = var->next;
33747     }
33748     if (res == 1 && !PyErr_Occurred()) {
33749       PyErr_Format(PyExc_AttributeError, "Unknown C global variable '%s'", n);
33750     }
33751     return res;
33752   }
33753 
33754   SWIGINTERN PyTypeObject*
swig_varlink_type(void)33755   swig_varlink_type(void) {
33756     static char varlink__doc__[] = "Swig var link object";
33757     static PyTypeObject varlink_type;
33758     static int type_init = 0;
33759     if (!type_init) {
33760       const PyTypeObject tmp = {
33761 #if PY_VERSION_HEX >= 0x03000000
33762         PyVarObject_HEAD_INIT(NULL, 0)
33763 #else
33764         PyObject_HEAD_INIT(NULL)
33765         0,                                  /* ob_size */
33766 #endif
33767         "swigvarlink",                      /* tp_name */
33768         sizeof(swig_varlinkobject),         /* tp_basicsize */
33769         0,                                  /* tp_itemsize */
33770         (destructor) swig_varlink_dealloc,  /* tp_dealloc */
33771         0,                                  /* tp_print */
33772         (getattrfunc) swig_varlink_getattr, /* tp_getattr */
33773         (setattrfunc) swig_varlink_setattr, /* tp_setattr */
33774         0,                                  /* tp_compare */
33775         (reprfunc) swig_varlink_repr,       /* tp_repr */
33776         0,                                  /* tp_as_number */
33777         0,                                  /* tp_as_sequence */
33778         0,                                  /* tp_as_mapping */
33779         0,                                  /* tp_hash */
33780         0,                                  /* tp_call */
33781         (reprfunc) swig_varlink_str,        /* tp_str */
33782         0,                                  /* tp_getattro */
33783         0,                                  /* tp_setattro */
33784         0,                                  /* tp_as_buffer */
33785         0,                                  /* tp_flags */
33786         varlink__doc__,                     /* tp_doc */
33787         0,                                  /* tp_traverse */
33788         0,                                  /* tp_clear */
33789         0,                                  /* tp_richcompare */
33790         0,                                  /* tp_weaklistoffset */
33791         0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, /* tp_iter -> tp_weaklist */
33792         0,                                  /* tp_del */
33793         0,                                  /* tp_version_tag */
33794 #if PY_VERSION_HEX >= 0x03040000
33795         0,                                  /* tp_finalize */
33796 #endif
33797 #if PY_VERSION_HEX >= 0x03080000
33798         0,                                  /* tp_vectorcall */
33799 #endif
33800 #if (PY_VERSION_HEX >= 0x03080000) && (PY_VERSION_HEX < 0x03090000)
33801         0,                                  /* tp_print */
33802 #endif
33803 #ifdef COUNT_ALLOCS
33804         0,                                  /* tp_allocs */
33805         0,                                  /* tp_frees */
33806         0,                                  /* tp_maxalloc */
33807         0,                                  /* tp_prev */
33808         0                                   /* tp_next */
33809 #endif
33810       };
33811       varlink_type = tmp;
33812       type_init = 1;
33813       if (PyType_Ready(&varlink_type) < 0)
33814       return NULL;
33815     }
33816     return &varlink_type;
33817   }
33818 
33819   /* Create a variable linking object for use later */
33820   SWIGINTERN PyObject *
SWIG_Python_newvarlink(void)33821   SWIG_Python_newvarlink(void) {
33822     swig_varlinkobject *result = PyObject_NEW(swig_varlinkobject, swig_varlink_type());
33823     if (result) {
33824       result->vars = 0;
33825     }
33826     return ((PyObject*) result);
33827   }
33828 
33829   SWIGINTERN void
SWIG_Python_addvarlink(PyObject * p,const char * name,PyObject * (* get_attr)(void),int (* set_attr)(PyObject * p))33830   SWIG_Python_addvarlink(PyObject *p, const char *name, PyObject *(*get_attr)(void), int (*set_attr)(PyObject *p)) {
33831     swig_varlinkobject *v = (swig_varlinkobject *) p;
33832     swig_globalvar *gv = (swig_globalvar *) malloc(sizeof(swig_globalvar));
33833     if (gv) {
33834       size_t size = strlen(name)+1;
33835       gv->name = (char *)malloc(size);
33836       if (gv->name) {
33837         memcpy(gv->name, name, size);
33838         gv->get_attr = get_attr;
33839         gv->set_attr = set_attr;
33840         gv->next = v->vars;
33841       }
33842     }
33843     v->vars = gv;
33844   }
33845 
33846   SWIGINTERN PyObject *
SWIG_globals(void)33847   SWIG_globals(void) {
33848     static PyObject *globals = 0;
33849     if (!globals) {
33850       globals = SWIG_newvarlink();
33851     }
33852     return globals;
33853   }
33854 
33855   /* -----------------------------------------------------------------------------
33856    * constants/methods manipulation
33857    * ----------------------------------------------------------------------------- */
33858 
33859   /* Install Constants */
33860   SWIGINTERN void
SWIG_Python_InstallConstants(PyObject * d,swig_const_info constants[])33861   SWIG_Python_InstallConstants(PyObject *d, swig_const_info constants[]) {
33862     PyObject *obj = 0;
33863     size_t i;
33864     for (i = 0; constants[i].type; ++i) {
33865       switch(constants[i].type) {
33866       case SWIG_PY_POINTER:
33867         obj = SWIG_InternalNewPointerObj(constants[i].pvalue, *(constants[i]).ptype,0);
33868         break;
33869       case SWIG_PY_BINARY:
33870         obj = SWIG_NewPackedObj(constants[i].pvalue, constants[i].lvalue, *(constants[i].ptype));
33871         break;
33872       default:
33873         obj = 0;
33874         break;
33875       }
33876       if (obj) {
33877         PyDict_SetItemString(d, constants[i].name, obj);
33878         Py_DECREF(obj);
33879       }
33880     }
33881   }
33882 
33883   /* -----------------------------------------------------------------------------*/
33884   /* Fix SwigMethods to carry the callback ptrs when needed */
33885   /* -----------------------------------------------------------------------------*/
33886 
33887   SWIGINTERN void
SWIG_Python_FixMethods(PyMethodDef * methods,swig_const_info * const_table,swig_type_info ** types,swig_type_info ** types_initial)33888   SWIG_Python_FixMethods(PyMethodDef *methods,
33889     swig_const_info *const_table,
33890     swig_type_info **types,
33891     swig_type_info **types_initial) {
33892     size_t i;
33893     for (i = 0; methods[i].ml_name; ++i) {
33894       const char *c = methods[i].ml_doc;
33895       if (!c) continue;
33896       c = strstr(c, "swig_ptr: ");
33897       if (c) {
33898         int j;
33899         swig_const_info *ci = 0;
33900         const char *name = c + 10;
33901         for (j = 0; const_table[j].type; ++j) {
33902           if (strncmp(const_table[j].name, name,
33903               strlen(const_table[j].name)) == 0) {
33904             ci = &(const_table[j]);
33905             break;
33906           }
33907         }
33908         if (ci) {
33909           void *ptr = (ci->type == SWIG_PY_POINTER) ? ci->pvalue : 0;
33910           if (ptr) {
33911             size_t shift = (ci->ptype) - types;
33912             swig_type_info *ty = types_initial[shift];
33913             size_t ldoc = (c - methods[i].ml_doc);
33914             size_t lptr = strlen(ty->name)+2*sizeof(void*)+2;
33915             char *ndoc = (char*)malloc(ldoc + lptr + 10);
33916             if (ndoc) {
33917               char *buff = ndoc;
33918               memcpy(buff, methods[i].ml_doc, ldoc);
33919               buff += ldoc;
33920               memcpy(buff, "swig_ptr: ", 10);
33921               buff += 10;
33922               SWIG_PackVoidPtr(buff, ptr, ty->name, lptr);
33923               methods[i].ml_doc = ndoc;
33924             }
33925           }
33926         }
33927       }
33928     }
33929   }
33930 
33931   /* -----------------------------------------------------------------------------
33932    * Method creation and docstring support functions
33933    * ----------------------------------------------------------------------------- */
33934 
33935   /* -----------------------------------------------------------------------------
33936    * Function to find the method definition with the correct docstring for the
33937    * proxy module as opposed to the low-level API
33938    * ----------------------------------------------------------------------------- */
33939 
SWIG_PythonGetProxyDoc(const char * name)33940   SWIGINTERN PyMethodDef *SWIG_PythonGetProxyDoc(const char *name) {
33941     /* Find the function in the modified method table */
33942     size_t offset = 0;
33943     int found = 0;
33944     while (SwigMethods_proxydocs[offset].ml_meth != NULL) {
33945       if (strcmp(SwigMethods_proxydocs[offset].ml_name, name) == 0) {
33946         found = 1;
33947         break;
33948       }
33949       offset++;
33950     }
33951     /* Use the copy with the modified docstring if available */
33952     return found ? &SwigMethods_proxydocs[offset] : NULL;
33953   }
33954 
33955   /* -----------------------------------------------------------------------------
33956    * Wrapper of PyInstanceMethod_New() used in Python 3
33957    * It is exported to the generated module, used for -fastproxy
33958    * ----------------------------------------------------------------------------- */
33959 
SWIG_PyInstanceMethod_New(PyObject * SWIGUNUSEDPARM (self),PyObject * func)33960   SWIGINTERN PyObject *SWIG_PyInstanceMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
33961     if (PyCFunction_Check(func)) {
33962       PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
33963       PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
33964       if (ml)
33965       func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
33966     }
33967 #if PY_VERSION_HEX >= 0x03000000
33968     return PyInstanceMethod_New(func);
33969 #else
33970     return PyMethod_New(func, NULL, NULL);
33971 #endif
33972   }
33973 
33974   /* -----------------------------------------------------------------------------
33975    * Wrapper of PyStaticMethod_New()
33976    * It is exported to the generated module, used for -fastproxy
33977    * ----------------------------------------------------------------------------- */
33978 
SWIG_PyStaticMethod_New(PyObject * SWIGUNUSEDPARM (self),PyObject * func)33979   SWIGINTERN PyObject *SWIG_PyStaticMethod_New(PyObject *SWIGUNUSEDPARM(self), PyObject *func) {
33980     if (PyCFunction_Check(func)) {
33981       PyCFunctionObject *funcobj = (PyCFunctionObject *)func;
33982       PyMethodDef *ml = SWIG_PythonGetProxyDoc(funcobj->m_ml->ml_name);
33983       if (ml)
33984       func = PyCFunction_NewEx(ml, funcobj->m_self, funcobj->m_module);
33985     }
33986     return PyStaticMethod_New(func);
33987   }
33988 
33989 #ifdef __cplusplus
33990 }
33991 #endif
33992 
33993 /* -----------------------------------------------------------------------------*
33994  *  Partial Init method
33995  * -----------------------------------------------------------------------------*/
33996 
33997 #ifdef __cplusplus
33998 extern "C"
33999 #endif
34000 
34001 SWIGEXPORT
34002 #if PY_VERSION_HEX >= 0x03000000
34003 PyObject*
34004 #else
34005 void
34006 #endif
SWIG_init(void)34007 SWIG_init(void) {
34008   PyObject *m, *d, *md, *globals;
34009 
34010 #if PY_VERSION_HEX >= 0x03000000
34011   static struct PyModuleDef SWIG_module = {
34012     PyModuleDef_HEAD_INIT,
34013     SWIG_name,
34014     NULL,
34015     -1,
34016     SwigMethods,
34017     NULL,
34018     NULL,
34019     NULL,
34020     NULL
34021   };
34022 #endif
34023 
34024 #if defined(SWIGPYTHON_BUILTIN)
34025   static SwigPyClientData SwigPyObject_clientdata = {
34026     0, 0, 0, 0, 0, 0, 0
34027   };
34028   static PyGetSetDef this_getset_def = {
34029     (char *)"this", &SwigPyBuiltin_ThisClosure, NULL, NULL, NULL
34030   };
34031   static SwigPyGetSet thisown_getset_closure = {
34032     SwigPyObject_own,
34033     SwigPyObject_own
34034   };
34035   static PyGetSetDef thisown_getset_def = {
34036     (char *)"thisown", SwigPyBuiltin_GetterClosure, SwigPyBuiltin_SetterClosure, NULL, &thisown_getset_closure
34037   };
34038   PyTypeObject *builtin_pytype;
34039   int builtin_base_count;
34040   swig_type_info *builtin_basetype;
34041   PyObject *tuple;
34042   PyGetSetDescrObject *static_getset;
34043   PyTypeObject *metatype;
34044   PyTypeObject *swigpyobject;
34045   SwigPyClientData *cd;
34046   PyObject *public_interface, *public_symbol;
34047   PyObject *this_descr;
34048   PyObject *thisown_descr;
34049   PyObject *self = 0;
34050   int i;
34051 
34052   (void)builtin_pytype;
34053   (void)builtin_base_count;
34054   (void)builtin_basetype;
34055   (void)tuple;
34056   (void)static_getset;
34057   (void)self;
34058 
34059   /* Metaclass is used to implement static member variables */
34060   metatype = SwigPyObjectType();
34061   assert(metatype);
34062 #endif
34063 
34064   (void)globals;
34065 
34066   /* Create singletons now to avoid potential deadlocks with multi-threaded usage after module initialization */
34067   SWIG_This();
34068   SWIG_Python_TypeCache();
34069   SwigPyPacked_type();
34070 #ifndef SWIGPYTHON_BUILTIN
34071   SwigPyObject_type();
34072 #endif
34073 
34074   /* Fix SwigMethods to carry the callback ptrs when needed */
34075   SWIG_Python_FixMethods(SwigMethods, swig_const_table, swig_types, swig_type_initial);
34076 
34077 #if PY_VERSION_HEX >= 0x03000000
34078   m = PyModule_Create(&SWIG_module);
34079 #else
34080   m = Py_InitModule(SWIG_name, SwigMethods);
34081 #endif
34082 
34083   md = d = PyModule_GetDict(m);
34084   (void)md;
34085 
34086   SWIG_InitializeModule(0);
34087 
34088 #ifdef SWIGPYTHON_BUILTIN
34089   swigpyobject = SwigPyObject_TypeOnce();
34090 
34091   SwigPyObject_stype = SWIG_MangledTypeQuery("_p_SwigPyObject");
34092   assert(SwigPyObject_stype);
34093   cd = (SwigPyClientData*) SwigPyObject_stype->clientdata;
34094   if (!cd) {
34095     SwigPyObject_stype->clientdata = &SwigPyObject_clientdata;
34096     SwigPyObject_clientdata.pytype = swigpyobject;
34097   } else if (swigpyobject->tp_basicsize != cd->pytype->tp_basicsize) {
34098     PyErr_SetString(PyExc_RuntimeError, "Import error: attempted to load two incompatible swig-generated modules.");
34099 # if PY_VERSION_HEX >= 0x03000000
34100     return NULL;
34101 # else
34102     return;
34103 # endif
34104   }
34105 
34106   /* All objects have a 'this' attribute */
34107   this_descr = PyDescr_NewGetSet(SwigPyObject_type(), &this_getset_def);
34108   (void)this_descr;
34109 
34110   /* All objects have a 'thisown' attribute */
34111   thisown_descr = PyDescr_NewGetSet(SwigPyObject_type(), &thisown_getset_def);
34112   (void)thisown_descr;
34113 
34114   public_interface = PyList_New(0);
34115   public_symbol = 0;
34116   (void)public_symbol;
34117 
34118   PyDict_SetItemString(md, "__all__", public_interface);
34119   Py_DECREF(public_interface);
34120   for (i = 0; SwigMethods[i].ml_name != NULL; ++i)
34121   SwigPyBuiltin_AddPublicSymbol(public_interface, SwigMethods[i].ml_name);
34122   for (i = 0; swig_const_table[i].name != 0; ++i)
34123   SwigPyBuiltin_AddPublicSymbol(public_interface, swig_const_table[i].name);
34124 #endif
34125 
34126   SWIG_InstallConstants(d,swig_const_table);
34127 
34128   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_VERSION_NUMBER",SWIG_From_long((long)(0x101010bfL)));
34129   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_VERSION_TEXT",SWIG_FromCharPtr("OpenSSL 1.1.1k  25 Mar 2021"));
34130   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SHLIB_VERSION_HISTORY",SWIG_FromCharPtr(""));
34131   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SHLIB_VERSION_NUMBER",SWIG_FromCharPtr("1.1"));
34132   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_FILE",SWIG_FromCharPtr("/usr/include/openssl/opensslconf.h"));
34133   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_LINE",SWIG_From_int((int)(134)));
34134   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_MIN_API",SWIG_From_int((int)(0)));
34135   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_API_COMPAT",SWIG_From_int((int)(0)));
34136   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "bio_noclose",SWIG_From_int((int)(BIO_NOCLOSE)));
34137   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "bio_close",SWIG_From_int((int)(BIO_CLOSE)));
34138   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_READ",SWIG_From_int((int)(0x01)));
34139   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_WRITE",SWIG_From_int((int)(0x02)));
34140   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_IO_SPECIAL",SWIG_From_int((int)(0x04)));
34141   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))));
34142   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_SHOULD_RETRY",SWIG_From_int((int)(0x08)));
34143   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "BIO_FLAGS_MEM_RDONLY",SWIG_From_int((int)(0x200)));
34144   globals = SWIG_globals();
34145   if (!globals) {
34146     PyErr_SetString(PyExc_TypeError, "Failure to create SWIG globals.");
34147 #if PY_VERSION_HEX >= 0x03000000
34148     return NULL;
34149 #else
34150     return;
34151 #endif
34152   }
34153   PyDict_SetItemString(md, "cvar", globals);
34154   Py_DECREF(globals);
34155   SwigPyBuiltin_AddPublicSymbol(public_interface, "cvar");
34156   SWIG_addvarlink(globals, "_bio_err", Swig_var__bio_err_get, Swig_var__bio_err_set);
34157 
34158   /* type '::pyfd_struct' */
34159   builtin_pytype = (PyTypeObject *)&SwigPyBuiltin__pyfd_struct_type;
34160   builtin_pytype->tp_dict = d = PyDict_New();
34161   SwigPyBuiltin_SetMetaType(builtin_pytype, metatype);
34162   builtin_pytype->tp_new = PyType_GenericNew;
34163   builtin_base_count = 0;
34164   builtin_bases[builtin_base_count] = NULL;
34165   SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases);
34166   PyDict_SetItemString(d, "this", this_descr);
34167   PyDict_SetItemString(d, "thisown", thisown_descr);
34168   if (PyType_Ready(builtin_pytype) < 0) {
34169     PyErr_SetString(PyExc_TypeError, "Could not create type 'BIO_PYFD_CTX'.");
34170 #if PY_VERSION_HEX >= 0x03000000
34171     return NULL;
34172 #else
34173     return;
34174 #endif
34175   }
34176   Py_INCREF(builtin_pytype);
34177   PyModule_AddObject(m, "BIO_PYFD_CTX", (PyObject *)builtin_pytype);
34178   SwigPyBuiltin_AddPublicSymbol(public_interface, "BIO_PYFD_CTX");
34179   d = md;
34180   SWIG_addvarlink(globals, "methods_fdp", Swig_var_methods_fdp_get, Swig_var_methods_fdp_set);
34181   SWIG_addvarlink(globals, "_rand_err", Swig_var__rand_err_get, Swig_var__rand_err_set);
34182   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS5_SALT_LEN",SWIG_From_int((int)(8)));
34183   SWIG_addvarlink(globals, "_evp_err", Swig_var__evp_err_get, Swig_var__evp_err_set);
34184   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "AES_BLOCK_SIZE",SWIG_From_int((int)(AES_BLOCK_SIZE)));
34185   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_NO_RC4",SWIG_From_int((int)(0)));
34186   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "dh_check_ok",SWIG_From_int((int)(0)));
34187   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "dh_check_p_not_prime",SWIG_From_int((int)(DH_CHECK_P_NOT_PRIME)));
34188   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "dh_check_p_not_strong",SWIG_From_int((int)(DH_CHECK_P_NOT_STRONG_PRIME)));
34189   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "dh_check_g_failed",SWIG_From_int((int)(DH_UNABLE_TO_CHECK_GENERATOR)));
34190   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "dh_check_bad_g",SWIG_From_int((int)(DH_NOT_SUITABLE_GENERATOR)));
34191   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "DH_GENERATOR_2",SWIG_From_int((int)(2)));
34192   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "DH_GENERATOR_5",SWIG_From_int((int)(5)));
34193   SWIG_addvarlink(globals, "_dh_err", Swig_var__dh_err_get, Swig_var__dh_err_set);
34194   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "no_padding",SWIG_From_int((int)(RSA_NO_PADDING)));
34195   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "pkcs1_padding",SWIG_From_int((int)(RSA_PKCS1_PADDING)));
34196   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "pkcs1_oaep_padding",SWIG_From_int((int)(RSA_PKCS1_OAEP_PADDING)));
34197   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sha1",SWIG_From_int((int)(NID_sha1)));
34198   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sha224",SWIG_From_int((int)(NID_sha224)));
34199   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sha256",SWIG_From_int((int)(NID_sha256)));
34200   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sha384",SWIG_From_int((int)(NID_sha384)));
34201   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sha512",SWIG_From_int((int)(NID_sha512)));
34202   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_md5",SWIG_From_int((int)(NID_md5)));
34203   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_ripemd160",SWIG_From_int((int)(NID_ripemd160)));
34204   SWIG_addvarlink(globals, "_rsa_err", Swig_var__rsa_err_get, Swig_var__rsa_err_set);
34205   SWIG_addvarlink(globals, "_dsa_err", Swig_var__dsa_err_get, Swig_var__dsa_err_set);
34206   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_none",SWIG_From_int((int)(SSL_ERROR_NONE)));
34207   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_ssl",SWIG_From_int((int)(SSL_ERROR_SSL)));
34208   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_want_read",SWIG_From_int((int)(SSL_ERROR_WANT_READ)));
34209   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_want_write",SWIG_From_int((int)(SSL_ERROR_WANT_WRITE)));
34210   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_want_x509_lookup",SWIG_From_int((int)(SSL_ERROR_WANT_X509_LOOKUP)));
34211   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_syscall",SWIG_From_int((int)(SSL_ERROR_SYSCALL)));
34212   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_zero_return",SWIG_From_int((int)(SSL_ERROR_ZERO_RETURN)));
34213   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ssl_error_want_connect",SWIG_From_int((int)(SSL_ERROR_WANT_CONNECT)));
34214   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_VERIFY_NONE",SWIG_From_int((int)(0x00)));
34215   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_VERIFY_PEER",SWIG_From_int((int)(0x01)));
34216   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_VERIFY_FAIL_IF_NO_PEER_CERT",SWIG_From_int((int)(0x02)));
34217   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_VERIFY_CLIENT_ONCE",SWIG_From_int((int)(0x04)));
34218   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "VERIFY_CRL_CHECK_LEAF",SWIG_From_int((int)(X509_V_FLAG_CRL_CHECK)));
34219   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "VERIFY_CRL_CHECK_CHAIN",SWIG_From_int((int)(X509_V_FLAG_CRL_CHECK|X509_V_FLAG_CRL_CHECK_ALL)));
34220   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_CONNECT",SWIG_From_int((int)(0x1000)));
34221   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_ACCEPT",SWIG_From_int((int)(0x2000)));
34222   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_MASK",SWIG_From_int((int)(0x0FFF)));
34223   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_INIT",SWIG_From_int((int)((SSL_ST_CONNECT|SSL_ST_ACCEPT))));
34224   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_BEFORE",SWIG_From_int((int)(0x4000)));
34225   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_OK",SWIG_From_int((int)(0x03)));
34226   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_ST_RENEGOTIATE",SWIG_From_int((int)((0x04|SSL_ST_CONNECT|SSL_ST_ACCEPT))));
34227   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_LOOP",SWIG_From_int((int)(0x01)));
34228   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_EXIT",SWIG_From_int((int)(0x02)));
34229   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_READ",SWIG_From_int((int)(0x04)));
34230   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_WRITE",SWIG_From_int((int)(0x08)));
34231   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_ALERT",SWIG_From_int((int)(0x4000)));
34232   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_READ_ALERT",SWIG_From_int((int)((SSL_CB_ALERT|SSL_CB_READ))));
34233   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_WRITE_ALERT",SWIG_From_int((int)((SSL_CB_ALERT|SSL_CB_WRITE))));
34234   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_ACCEPT_LOOP",SWIG_From_int((int)((SSL_ST_ACCEPT|SSL_CB_LOOP))));
34235   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_ACCEPT_EXIT",SWIG_From_int((int)((SSL_ST_ACCEPT|SSL_CB_EXIT))));
34236   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_CONNECT_LOOP",SWIG_From_int((int)((SSL_ST_CONNECT|SSL_CB_LOOP))));
34237   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_CONNECT_EXIT",SWIG_From_int((int)((SSL_ST_CONNECT|SSL_CB_EXIT))));
34238   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_HANDSHAKE_START",SWIG_From_int((int)(0x10)));
34239   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_CB_HANDSHAKE_DONE",SWIG_From_int((int)(0x20)));
34240   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_SENT_SHUTDOWN",SWIG_From_int((int)(1)));
34241   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_RECEIVED_SHUTDOWN",SWIG_From_int((int)(2)));
34242   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_SESS_CACHE_OFF",SWIG_From_int((int)(0x000)));
34243   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_SESS_CACHE_CLIENT",SWIG_From_int((int)(0x001)));
34244   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_SESS_CACHE_SERVER",SWIG_From_int((int)(0x002)));
34245   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_SESS_CACHE_BOTH",SWIG_From_int((int)((SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER))));
34246   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_OP_ALL",SWIG_From_int((int)(0x00000FFFL)));
34247   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_OP_NO_SSLv2",SWIG_From_int((int)(0x01000000L)));
34248   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_OP_NO_SSLv3",SWIG_From_int((int)(0x02000000L)));
34249   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_OP_NO_TLSv1",SWIG_From_int((int)(0x04000000L)));
34250   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS",SWIG_From_int((int)(0x00000800L)));
34251   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_MODE_ENABLE_PARTIAL_WRITE",SWIG_From_int((int)(SSL_MODE_ENABLE_PARTIAL_WRITE)));
34252   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)));
34253   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "SSL_MODE_AUTO_RETRY",SWIG_From_int((int)(SSL_MODE_AUTO_RETRY)));
34254   SWIG_addvarlink(globals, "_ssl_err", Swig_var__ssl_err_get, Swig_var__ssl_err_set);
34255   SWIG_addvarlink(globals, "_ssl_timeout_err", Swig_var__ssl_timeout_err_get, Swig_var__ssl_timeout_err_set);
34256   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_DEFAULT",SWIG_From_int((int)(-1)));
34257   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_COMPAT",SWIG_From_int((int)(1)));
34258   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_SSL_CLIENT",SWIG_From_int((int)(2)));
34259   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_SSL_SERVER",SWIG_From_int((int)(3)));
34260   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_EMAIL",SWIG_From_int((int)(4)));
34261   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_OBJECT_SIGN",SWIG_From_int((int)(5)));
34262   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_OCSP_SIGN",SWIG_From_int((int)(6)));
34263   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_OCSP_REQUEST",SWIG_From_int((int)(7)));
34264   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_DYNAMIC",SWIG_From_int((int)(1)));
34265   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_DYNAMIC_NAME",SWIG_From_int((int)(2)));
34266   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_TRUSTED",SWIG_From_int((int)(1)));
34267   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_REJECTED",SWIG_From_int((int)(2)));
34268   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_TRUST_UNTRUSTED",SWIG_From_int((int)(3)));
34269   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_SSL_CLIENT",SWIG_From_int((int)(1)));
34270   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_SSL_SERVER",SWIG_From_int((int)(2)));
34271   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_NS_SSL_SERVER",SWIG_From_int((int)(3)));
34272   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_SMIME_SIGN",SWIG_From_int((int)(4)));
34273   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_SMIME_ENCRYPT",SWIG_From_int((int)(5)));
34274   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_CRL_SIGN",SWIG_From_int((int)(6)));
34275   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_ANY",SWIG_From_int((int)(7)));
34276   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_PURPOSE_OCSP_HELPER",SWIG_From_int((int)(8)));
34277   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509V3_EXT_UNKNOWN_MASK",SWIG_From_long((long)((0xfL << 16))));
34278   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509V3_EXT_DEFAULT",SWIG_From_long((long)(0)));
34279   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509V3_EXT_ERROR_UNKNOWN",SWIG_From_long((long)((1L << 16))));
34280   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509V3_EXT_PARSE_UNKNOWN",SWIG_From_long((long)((2L << 16))));
34281   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509V3_EXT_DUMP_UNKNOWN",SWIG_From_long((long)((3L << 16))));
34282   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_commonName",SWIG_From_int((int)(13)));
34283   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_countryName",SWIG_From_int((int)(14)));
34284   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_localityName",SWIG_From_int((int)(15)));
34285   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_stateOrProvinceName",SWIG_From_int((int)(16)));
34286   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_organizationName",SWIG_From_int((int)(17)));
34287   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_organizationalUnitName",SWIG_From_int((int)(18)));
34288   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_serialNumber",SWIG_From_int((int)(105)));
34289   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_surname",SWIG_From_int((int)(100)));
34290   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_givenName",SWIG_From_int((int)(99)));
34291   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_pkcs9_emailAddress",SWIG_From_int((int)(48)));
34292   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_OK",SWIG_From_int((int)(0)));
34293   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT",SWIG_From_int((int)(2)));
34294   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_GET_CRL",SWIG_From_int((int)(3)));
34295   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE",SWIG_From_int((int)(4)));
34296   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE",SWIG_From_int((int)(5)));
34297   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY",SWIG_From_int((int)(6)));
34298   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_SIGNATURE_FAILURE",SWIG_From_int((int)(7)));
34299   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CRL_SIGNATURE_FAILURE",SWIG_From_int((int)(8)));
34300   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_NOT_YET_VALID",SWIG_From_int((int)(9)));
34301   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_HAS_EXPIRED",SWIG_From_int((int)(10)));
34302   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CRL_NOT_YET_VALID",SWIG_From_int((int)(11)));
34303   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CRL_HAS_EXPIRED",SWIG_From_int((int)(12)));
34304   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD",SWIG_From_int((int)(13)));
34305   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD",SWIG_From_int((int)(14)));
34306   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD",SWIG_From_int((int)(15)));
34307   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD",SWIG_From_int((int)(16)));
34308   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_OUT_OF_MEM",SWIG_From_int((int)(17)));
34309   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT",SWIG_From_int((int)(18)));
34310   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN",SWIG_From_int((int)(19)));
34311   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY",SWIG_From_int((int)(20)));
34312   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE",SWIG_From_int((int)(21)));
34313   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_CHAIN_TOO_LONG",SWIG_From_int((int)(22)));
34314   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_REVOKED",SWIG_From_int((int)(23)));
34315   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_INVALID_CA",SWIG_From_int((int)(24)));
34316   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_PATH_LENGTH_EXCEEDED",SWIG_From_int((int)(25)));
34317   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_INVALID_PURPOSE",SWIG_From_int((int)(26)));
34318   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_UNTRUSTED",SWIG_From_int((int)(27)));
34319   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_CERT_REJECTED",SWIG_From_int((int)(28)));
34320   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "X509_V_ERR_APPLICATION_VERIFICATION",SWIG_From_int((int)(50)));
34321   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_COMPAT",SWIG_From_int((int)(0)));
34322   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_SEP_COMMA_PLUS",SWIG_From_int((int)((1 << 16))));
34323   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_SEP_CPLUS_SPC",SWIG_From_int((int)((2 << 16))));
34324   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_SEP_MULTILINE",SWIG_From_int((int)((4 << 16))));
34325   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_DN_REV",SWIG_From_int((int)((1 << 20))));
34326   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_FN_LN",SWIG_From_int((int)((1 << 21))));
34327   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_SPC_EQ",SWIG_From_int((int)((1 << 23))));
34328   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_DUMP_UNKNOWN_FIELDS",SWIG_From_int((int)((1 << 24))));
34329   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_FN_ALIGN",SWIG_From_int((int)((1 << 25))));
34330   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_ONELINE",SWIG_From_int((int)((ASN1_STRFLGS_RFC2253|ASN1_STRFLGS_ESC_QUOTE|XN_FLAG_SEP_CPLUS_SPC|XN_FLAG_SPC_EQ))));
34331   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "XN_FLAG_MULTILINE",SWIG_From_int((int)((ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB|XN_FLAG_SEP_MULTILINE|XN_FLAG_SPC_EQ|XN_FLAG_FN_LN|XN_FLAG_FN_ALIGN))));
34332   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))));
34333   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "RSA_3",SWIG_From_int((int)(0x3L)));
34334   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "RSA_F4",SWIG_From_int((int)(0x10001L)));
34335   SWIG_addvarlink(globals, "_x509_err", Swig_var__x509_err_get, Swig_var__x509_err_set);
34336   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_ESC_2253",SWIG_From_int((int)(1)));
34337   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_ESC_CTRL",SWIG_From_int((int)(2)));
34338   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_ESC_MSB",SWIG_From_int((int)(4)));
34339   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_ESC_QUOTE",SWIG_From_int((int)(8)));
34340   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_UTF8_CONVERT",SWIG_From_int((int)(0x10)));
34341   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_IGNORE_TYPE",SWIG_From_int((int)(0x20)));
34342   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_SHOW_TYPE",SWIG_From_int((int)(0x40)));
34343   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_DUMP_ALL",SWIG_From_int((int)(0x80)));
34344   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_DUMP_UNKNOWN",SWIG_From_int((int)(0x100)));
34345   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_DUMP_DER",SWIG_From_int((int)(0x200)));
34346   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ASN1_STRFLGS_RFC2253",SWIG_From_int((int)((ASN1_STRFLGS_ESC_2253|ASN1_STRFLGS_ESC_CTRL|ASN1_STRFLGS_ESC_MSB|ASN1_STRFLGS_UTF8_CONVERT|ASN1_STRFLGS_DUMP_UNKNOWN|ASN1_STRFLGS_DUMP_DER))));
34347   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_TEXT",SWIG_From_int((int)(0x1)));
34348   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOCERTS",SWIG_From_int((int)(0x2)));
34349   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOSIGS",SWIG_From_int((int)(0x4)));
34350   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOCHAIN",SWIG_From_int((int)(0x8)));
34351   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOINTERN",SWIG_From_int((int)(0x10)));
34352   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOVERIFY",SWIG_From_int((int)(0x20)));
34353   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_DETACHED",SWIG_From_int((int)(0x40)));
34354   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_BINARY",SWIG_From_int((int)(0x80)));
34355   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_NOATTR",SWIG_From_int((int)(0x100)));
34356   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_SIGNED",SWIG_From_int((int)(NID_pkcs7_signed)));
34357   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_ENVELOPED",SWIG_From_int((int)(NID_pkcs7_enveloped)));
34358   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_SIGNED_ENVELOPED",SWIG_From_int((int)(NID_pkcs7_signedAndEnveloped)));
34359   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "PKCS7_DATA",SWIG_From_int((int)(NID_pkcs7_data)));
34360   SWIG_addvarlink(globals, "_pkcs7_err", Swig_var__pkcs7_err_get, Swig_var__pkcs7_err_set);
34361   SWIG_addvarlink(globals, "_smime_err", Swig_var__smime_err_get, Swig_var__smime_err_set);
34362   SWIG_addvarlink(globals, "_util_err", Swig_var__util_err_get, Swig_var__util_err_set);
34363   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "OPENSSL_NO_EC",SWIG_From_int((int)(0)));
34364   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp112r1",SWIG_From_int((int)(NID_secp112r1)));
34365   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp112r2",SWIG_From_int((int)(NID_secp112r2)));
34366   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp128r1",SWIG_From_int((int)(NID_secp128r1)));
34367   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp128r2",SWIG_From_int((int)(NID_secp128r2)));
34368   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp160k1",SWIG_From_int((int)(NID_secp160k1)));
34369   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp160r1",SWIG_From_int((int)(NID_secp160r1)));
34370   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp160r2",SWIG_From_int((int)(NID_secp160r2)));
34371   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp192k1",SWIG_From_int((int)(NID_secp192k1)));
34372   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp224k1",SWIG_From_int((int)(NID_secp224k1)));
34373   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp224r1",SWIG_From_int((int)(NID_secp224r1)));
34374   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp256k1",SWIG_From_int((int)(NID_secp256k1)));
34375   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp384r1",SWIG_From_int((int)(NID_secp384r1)));
34376   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_secp521r1",SWIG_From_int((int)(NID_secp521r1)));
34377   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect113r1",SWIG_From_int((int)(NID_sect113r1)));
34378   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect113r2",SWIG_From_int((int)(NID_sect113r2)));
34379   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect131r1",SWIG_From_int((int)(NID_sect131r1)));
34380   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect131r2",SWIG_From_int((int)(NID_sect131r2)));
34381   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect163k1",SWIG_From_int((int)(NID_sect163k1)));
34382   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect163r1",SWIG_From_int((int)(NID_sect163r1)));
34383   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect163r2",SWIG_From_int((int)(NID_sect163r2)));
34384   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect193r1",SWIG_From_int((int)(NID_sect193r1)));
34385   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect193r2",SWIG_From_int((int)(NID_sect193r2)));
34386   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect233k1",SWIG_From_int((int)(NID_sect233k1)));
34387   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect233r1",SWIG_From_int((int)(NID_sect233r1)));
34388   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect239k1",SWIG_From_int((int)(NID_sect239k1)));
34389   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect283k1",SWIG_From_int((int)(NID_sect283k1)));
34390   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect283r1",SWIG_From_int((int)(NID_sect283r1)));
34391   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect409k1",SWIG_From_int((int)(NID_sect409k1)));
34392   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect409r1",SWIG_From_int((int)(NID_sect409r1)));
34393   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect571k1",SWIG_From_int((int)(NID_sect571k1)));
34394   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_sect571r1",SWIG_From_int((int)(NID_sect571r1)));
34395   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime192v1",SWIG_From_int((int)(NID_X9_62_prime192v1)));
34396   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime192v2",SWIG_From_int((int)(NID_X9_62_prime192v2)));
34397   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime192v3",SWIG_From_int((int)(NID_X9_62_prime192v3)));
34398   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime239v1",SWIG_From_int((int)(NID_X9_62_prime239v1)));
34399   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime239v2",SWIG_From_int((int)(NID_X9_62_prime239v2)));
34400   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime239v3",SWIG_From_int((int)(NID_X9_62_prime239v3)));
34401   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_prime256v1",SWIG_From_int((int)(NID_X9_62_prime256v1)));
34402   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb163v1",SWIG_From_int((int)(NID_X9_62_c2pnb163v1)));
34403   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb163v2",SWIG_From_int((int)(NID_X9_62_c2pnb163v2)));
34404   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb163v3",SWIG_From_int((int)(NID_X9_62_c2pnb163v3)));
34405   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb176v1",SWIG_From_int((int)(NID_X9_62_c2pnb176v1)));
34406   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb191v1",SWIG_From_int((int)(NID_X9_62_c2tnb191v1)));
34407   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb191v2",SWIG_From_int((int)(NID_X9_62_c2tnb191v2)));
34408   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb191v3",SWIG_From_int((int)(NID_X9_62_c2tnb191v3)));
34409   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb208w1",SWIG_From_int((int)(NID_X9_62_c2pnb208w1)));
34410   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb239v1",SWIG_From_int((int)(NID_X9_62_c2tnb239v1)));
34411   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb239v2",SWIG_From_int((int)(NID_X9_62_c2tnb239v2)));
34412   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb239v3",SWIG_From_int((int)(NID_X9_62_c2tnb239v3)));
34413   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb272w1",SWIG_From_int((int)(NID_X9_62_c2pnb272w1)));
34414   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb304w1",SWIG_From_int((int)(NID_X9_62_c2pnb304w1)));
34415   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb359v1",SWIG_From_int((int)(NID_X9_62_c2tnb359v1)));
34416   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2pnb368w1",SWIG_From_int((int)(NID_X9_62_c2pnb368w1)));
34417   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_X9_62_c2tnb431r1",SWIG_From_int((int)(NID_X9_62_c2tnb431r1)));
34418   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls1",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls1)));
34419   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls3",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls3)));
34420   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls4",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls4)));
34421   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls5",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls5)));
34422   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls6",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls6)));
34423   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls7",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls7)));
34424   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls8",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls8)));
34425   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls9",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls9)));
34426   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls10",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls10)));
34427   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_wap_wsg_idm_ecid_wtls11",SWIG_From_int((int)(NID_wap_wsg_idm_ecid_wtls11)));
34428   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)));
34429   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_ipsec3",SWIG_From_int((int)(NID_ipsec3)));
34430   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "NID_ipsec4",SWIG_From_int((int)(NID_ipsec4)));
34431   SWIG_addvarlink(globals, "_ec_err", Swig_var__ec_err_get, Swig_var__ec_err_set);
34432 
34433   /* type '::_cbd_t' */
34434   builtin_pytype = (PyTypeObject *)&SwigPyBuiltin___cbd_t_type;
34435   builtin_pytype->tp_dict = d = PyDict_New();
34436   SwigPyBuiltin_SetMetaType(builtin_pytype, metatype);
34437   builtin_pytype->tp_new = PyType_GenericNew;
34438   builtin_base_count = 0;
34439   builtin_bases[builtin_base_count] = NULL;
34440   SwigPyBuiltin_InitBases(builtin_pytype, builtin_bases);
34441   PyDict_SetItemString(d, "this", this_descr);
34442   PyDict_SetItemString(d, "thisown", thisown_descr);
34443   if (PyType_Ready(builtin_pytype) < 0) {
34444     PyErr_SetString(PyExc_TypeError, "Could not create type '_cbd_t'.");
34445 #if PY_VERSION_HEX >= 0x03000000
34446     return NULL;
34447 #else
34448     return;
34449 #endif
34450   }
34451   Py_INCREF(builtin_pytype);
34452   PyModule_AddObject(m, "_cbd_t", (PyObject *)builtin_pytype);
34453   SwigPyBuiltin_AddPublicSymbol(public_interface, "_cbd_t");
34454   d = md;
34455   SWIG_addvarlink(globals, "_engine_err", Swig_var__engine_err_get, Swig_var__engine_err_set);
34456   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_RSA",SWIG_From_int((int)(0x0001)));
34457   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_DSA",SWIG_From_int((int)(0x0002)));
34458   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_DH",SWIG_From_int((int)(0x0004)));
34459   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_RAND",SWIG_From_int((int)(0x0008)));
34460   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_ECDH",SWIG_From_int((int)(0x0010)));
34461   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_ECDSA",SWIG_From_int((int)(0x0020)));
34462   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_CIPHERS",SWIG_From_int((int)(0x0040)));
34463   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_DIGESTS",SWIG_From_int((int)(0x0080)));
34464   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_STORE",SWIG_From_int((int)(0x0100)));
34465   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_ALL",SWIG_From_int((int)(0xFFFF)));
34466   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "ENGINE_METHOD_NONE",SWIG_From_int((int)(0x0000)));
34467   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "encrypt",SWIG_From_int((int)(1)));
34468   SWIG_Python_SetConstant(d, d == md ? public_interface : NULL, "decrypt",SWIG_From_int((int)(0)));
34469 
34470   /* Initialize threading */
34471   SWIG_PYTHON_INITIALIZE_THREADS;
34472 #if PY_VERSION_HEX >= 0x03000000
34473   return m;
34474 #else
34475   return;
34476 #endif
34477 }
34478 
34479